[xiph-commits] r10510 - in experimental/j: . Elphel333 Elphel333/common Elphel333/http Elphel333/http/config_cgi Elphel333/rtp Elphel333/rtp/cgi Elphel333/rtp/daemon Elphel333/rtp/daemon/rtp Elphel333/rtp/daemon/rtp/win32 Elphel333/shout

j at svn.xiph.org j at svn.xiph.org
Wed Nov 30 17:40:38 PST 2005


Author: j
Date: 2005-11-30 17:39:59 -0800 (Wed, 30 Nov 2005)
New Revision: 10510

Added:
   experimental/j/Elphel333/
   experimental/j/Elphel333/README
   experimental/j/Elphel333/common/
   experimental/j/Elphel333/common/.target-makefrag
   experimental/j/Elphel333/common/Makefile
   experimental/j/Elphel333/common/c313a.h
   experimental/j/Elphel333/common/defines.h
   experimental/j/Elphel333/common/oggtheora.c
   experimental/j/Elphel333/common/oggtheora.h
   experimental/j/Elphel333/common/oggtheora_tables.h
   experimental/j/Elphel333/common/utils.c
   experimental/j/Elphel333/http/
   experimental/j/Elphel333/http/.target-makefrag
   experimental/j/Elphel333/http/Makefile
   experimental/j/Elphel333/http/README
   experimental/j/Elphel333/http/TheoraHTTP.c
   experimental/j/Elphel333/http/config_cgi/
   experimental/j/Elphel333/http/config_cgi/.target-makefrag
   experimental/j/Elphel333/http/config_cgi/Makefile
   experimental/j/Elphel333/http/config_cgi/http_strm.c
   experimental/j/Elphel333/http/config_cgi/index1.html
   experimental/j/Elphel333/rtp/
   experimental/j/Elphel333/rtp/README
   experimental/j/Elphel333/rtp/cgi/
   experimental/j/Elphel333/rtp/cgi/.target-makefrag
   experimental/j/Elphel333/rtp/cgi/Makefile
   experimental/j/Elphel333/rtp/cgi/cstrm.c
   experimental/j/Elphel333/rtp/cgi/defines.h
   experimental/j/Elphel333/rtp/cgi/index1.html
   experimental/j/Elphel333/rtp/daemon/
   experimental/j/Elphel333/rtp/daemon/.target-makefrag
   experimental/j/Elphel333/rtp/daemon/Makefile
   experimental/j/Elphel333/rtp/daemon/README
   experimental/j/Elphel333/rtp/daemon/TheoraStrm.c
   experimental/j/Elphel333/rtp/daemon/rtp/
   experimental/j/Elphel333/rtp/daemon/rtp/.target-makefrag
   experimental/j/Elphel333/rtp/daemon/rtp/COPYRIGHT
   experimental/j/Elphel333/rtp/daemon/rtp/MODS
   experimental/j/Elphel333/rtp/daemon/rtp/Makefile.am
   experimental/j/Elphel333/rtp/daemon/rtp/Makefile.in
   experimental/j/Elphel333/rtp/daemon/rtp/README
   experimental/j/Elphel333/rtp/daemon/rtp/README.qfdes
   experimental/j/Elphel333/rtp/daemon/rtp/VERSION
   experimental/j/Elphel333/rtp/daemon/rtp/acconfig.h
   experimental/j/Elphel333/rtp/daemon/rtp/aclocal.m4
   experimental/j/Elphel333/rtp/daemon/rtp/addrinfo.h
   experimental/j/Elphel333/rtp/daemon/rtp/addrsize.h
   experimental/j/Elphel333/rtp/daemon/rtp/asarray.c
   experimental/j/Elphel333/rtp/daemon/rtp/asarray.h
   experimental/j/Elphel333/rtp/daemon/rtp/autogen.sh
   experimental/j/Elphel333/rtp/daemon/rtp/base64.c
   experimental/j/Elphel333/rtp/daemon/rtp/base64.h
   experimental/j/Elphel333/rtp/daemon/rtp/bills_srtp.h
   experimental/j/Elphel333/rtp/daemon/rtp/bittypes.h
   experimental/j/Elphel333/rtp/daemon/rtp/boxes-fst.dat
   experimental/j/Elphel333/rtp/daemon/rtp/btree.c
   experimental/j/Elphel333/rtp/daemon/rtp/btree.h
   experimental/j/Elphel333/rtp/daemon/rtp/cdecl_ext.h
   experimental/j/Elphel333/rtp/daemon/rtp/common60.dsp
   experimental/j/Elphel333/rtp/daemon/rtp/config.guess
   experimental/j/Elphel333/rtp/daemon/rtp/config.h.in
   experimental/j/Elphel333/rtp/daemon/rtp/config.sub
   experimental/j/Elphel333/rtp/daemon/rtp/config_unix.h
   experimental/j/Elphel333/rtp/daemon/rtp/config_win32.h
   experimental/j/Elphel333/rtp/daemon/rtp/configure
   experimental/j/Elphel333/rtp/daemon/rtp/configure.in
   experimental/j/Elphel333/rtp/daemon/rtp/crypt_random.c
   experimental/j/Elphel333/rtp/daemon/rtp/crypt_random.h
   experimental/j/Elphel333/rtp/daemon/rtp/debug.c
   experimental/j/Elphel333/rtp/daemon/rtp/debug.h
   experimental/j/Elphel333/rtp/daemon/rtp/depcomp
   experimental/j/Elphel333/rtp/daemon/rtp/drand48.c
   experimental/j/Elphel333/rtp/daemon/rtp/drand48.h
   experimental/j/Elphel333/rtp/daemon/rtp/getaddrinfo.c
   experimental/j/Elphel333/rtp/daemon/rtp/gettimeofday.c
   experimental/j/Elphel333/rtp/daemon/rtp/gettimeofday.h
   experimental/j/Elphel333/rtp/daemon/rtp/hmac.c
   experimental/j/Elphel333/rtp/daemon/rtp/hmac.h
   experimental/j/Elphel333/rtp/daemon/rtp/inet_ntop.c
   experimental/j/Elphel333/rtp/daemon/rtp/inet_ntop.h
   experimental/j/Elphel333/rtp/daemon/rtp/inet_pton.c
   experimental/j/Elphel333/rtp/daemon/rtp/inet_pton.h
   experimental/j/Elphel333/rtp/daemon/rtp/install-sh
   experimental/j/Elphel333/rtp/daemon/rtp/ltmain.sh
   experimental/j/Elphel333/rtp/daemon/rtp/mbus.c
   experimental/j/Elphel333/rtp/daemon/rtp/mbus.h
   experimental/j/Elphel333/rtp/daemon/rtp/mbus_addr.c
   experimental/j/Elphel333/rtp/daemon/rtp/mbus_addr.h
   experimental/j/Elphel333/rtp/daemon/rtp/mbus_config.c
   experimental/j/Elphel333/rtp/daemon/rtp/mbus_config.h
   experimental/j/Elphel333/rtp/daemon/rtp/mbus_parser.c
   experimental/j/Elphel333/rtp/daemon/rtp/mbus_parser.h
   experimental/j/Elphel333/rtp/daemon/rtp/md5.c
   experimental/j/Elphel333/rtp/daemon/rtp/md5.h
   experimental/j/Elphel333/rtp/daemon/rtp/memory.c
   experimental/j/Elphel333/rtp/daemon/rtp/memory.h
   experimental/j/Elphel333/rtp/daemon/rtp/missing
   experimental/j/Elphel333/rtp/daemon/rtp/mkinstalldirs
   experimental/j/Elphel333/rtp/daemon/rtp/net_udp.c
   experimental/j/Elphel333/rtp/daemon/rtp/net_udp.h
   experimental/j/Elphel333/rtp/daemon/rtp/ntp.c
   experimental/j/Elphel333/rtp/daemon/rtp/ntp.h
   experimental/j/Elphel333/rtp/daemon/rtp/qfDES.c
   experimental/j/Elphel333/rtp/daemon/rtp/qfDES.h
   experimental/j/Elphel333/rtp/daemon/rtp/rijndael-alg-fst.c
   experimental/j/Elphel333/rtp/daemon/rtp/rijndael-alg-fst.h
   experimental/j/Elphel333/rtp/daemon/rtp/rijndael-api-fst.c
   experimental/j/Elphel333/rtp/daemon/rtp/rijndael-api-fst.h
   experimental/j/Elphel333/rtp/daemon/rtp/rtp.c
   experimental/j/Elphel333/rtp/daemon/rtp/rtp.h
   experimental/j/Elphel333/rtp/daemon/rtp/sockstorage.h
   experimental/j/Elphel333/rtp/daemon/rtp/util.c
   experimental/j/Elphel333/rtp/daemon/rtp/util.h
   experimental/j/Elphel333/rtp/daemon/rtp/version.h
   experimental/j/Elphel333/rtp/daemon/rtp/vsnprintf.c
   experimental/j/Elphel333/rtp/daemon/rtp/vsnprintf.h
   experimental/j/Elphel333/rtp/daemon/rtp/win32/
   experimental/j/Elphel333/rtp/daemon/rtp/win32/Makefile.am
   experimental/j/Elphel333/rtp/daemon/rtp/win32/Makefile.in
   experimental/j/Elphel333/rtp/daemon/rtp/win32/echo.txt
   experimental/j/Elphel333/rtp/daemon/rtp/win32/null.txt
   experimental/j/Elphel333/rtp/daemon/rtp/win32/set.txt
   experimental/j/Elphel333/rtp/daemon/rtp/win32_ver.h
   experimental/j/Elphel333/shout/
   experimental/j/Elphel333/shout/.target-makefrag
   experimental/j/Elphel333/shout/Makefile
   experimental/j/Elphel333/shout/TheoraShout.c
Log:
add some Elphel333 code.



Added: experimental/j/Elphel333/README
===================================================================
--- experimental/j/Elphel333/README	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/README	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,11 @@
+This are three modules for the Elphel 333 Theora camera.
+each module provides a way to access the Theora video stream
+of the camera.
+    http  - provides the video as an Ogg Theora http stream,
+            the same way as streams are provided by icecast2
+    rtp   - provides the video as an RTP Theora stream.
+            this modules provides unicast and multicast rtp
+    shout - with with module you can send and Ogg Theora stream
+            to an icecast2 server. the stream can be configured 
+            via the webinterface
+           

Added: experimental/j/Elphel333/common/.target-makefrag
===================================================================
--- experimental/j/Elphel333/common/.target-makefrag	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/common/.target-makefrag	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1 @@
+AXIS_BUILDTYPE=cris-axis-linux-gnu

Added: experimental/j/Elphel333/common/Makefile
===================================================================
--- experimental/j/Elphel333/common/Makefile	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/common/Makefile	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,25 @@
+#
+# Makefile for the Elphel streamer.
+# This probably requires GNU make.
+#
+AXIS_USABLE_LIBS = UCLIBC GLIBC
+include $(AXIS_TOP_DIR)/tools/build/Rules.axis
+
+
+
+DEFS   = -DHAVE_CONFIG_H
+CFLAGS = -O2 -W  -Wwrite-strings -Wbad-function-cast -Wmissing-prototypes -Wcast-qual -Wmissing-declarations  $(DEFS) 
+LIBS   = -lm 
+
+LD	= ld-cris
+
+OBJS=oggtheora.o utils.o
+SRCS=$(OBJS:%.o=%.c)
+
+all: $(OBJS)
+
+.c.o:
+	$(CC) $(CFLAGS) $(INC) -c $<
+
+clean:
+	-rm -f *.o *~

Added: experimental/j/Elphel333/common/c313a.h
===================================================================
--- experimental/j/Elphel333/common/c313a.h	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/common/c313a.h	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,502 @@
+/*
+ * 05.03.2002 changing for revA
+ * 03.19.2002 Started support for different sensors
+ */
+
+#ifndef _ASM_CMOSCAM_H
+#define _ASM_CMOSCAM_H
+
+/* _IOC_TYPE, bits 8 to 15 in ioctl cmd */
+
+#define CMOSCAM_IOCTYPE 124
+
+/* MINORS */
+
+#define CMOSCAM_MINOR_FRAME	1
+#define CMOSCAM_MINOR_FPN	2
+//#define CMOSCAM_MINOR_IORW	1
+//#define CMOSCAM_MINOR_I2C	2
+//#define CMOSCAM_MINOR_RAW	3
+#define CMOSCAM_MINOR_I2C	3
+#define CMOSCAM_MINOR_DMA	4
+#define CMOSCAM_MINOR_MCP	5
+#define CMOSCAM_MINOR_LOCK	6
+#define CMOSCAM_MINOR_UNLOCK	7
+#define CMOSCAM_MINOR_SENSORJTAGFPGA 8
+#define CMOSCAM_MINOR_RWTABLES 9
+#define CMOSCAM_MINOR_SENSORFPGACOMM 10
+#define CMOSCAM_MINOR_CIRCBUF 11
+#define CMOSCAM_MINOR_CIRCINDEX 12
+
+/* camera sequencer states */
+
+//New sequencer states
+
+#define CAMSEQ_OFF       0 // off, not programmed (Video mode off on Zoran sensors)
+#define CAMSEQ_READY     1 // sensor programmed may acquire at will (programSensor sets number of frames to skip (if any)
+#define CAMSEQ_SKIP      2 // skipping specified number of frames, interrupt service routine counts and will start acquisition
+#define CAMSEQ_WAIT_F 	 3 // set by "start exposure" or interrupt service routine. WAIT_F/WAIT_T/acquire/done differs by hardware register
+#define CAMSEQ_WAIT_T 	 4 // set by "start exposure" or interrupt service routine. Wait/acquire/done differs by hardware register
+#define CAMSEQ_ACQUIRE   5 // acquisition in progress (camSeqState is still CAMSEQ_WAIT)
+#define CAMSEQ_DONE      6 // acquisition over  (camSeqState is still CAMSEQ_WAIT)
+#define CAMSEQ_JPEG      7 // waiting for JPEG done interrupt, acquiring/compressing some frames
+
+#define CAMSEQ_RUN       8 // compressor is constantly running (but if camSeqCount>0 - just skipping "bad" frames)
+#define CAMSEQ_STOP      9 // compressor is constantly running but will stop after next "compressor ready"
+#define CAMSEQ_SINGLE   10 // compressor is constantly running to all the buffer
+/*
+Status CAMSEQ_OFF may be changed to CAMSEQ_READY only by programSensor, it will also stop sensor (if needed)
+  and set camSeqCount (if needed) to skip certain number of frames before actual acquisition
+  camSeqStart (called mostly through ioctl) will return error if state was not "CAMSEQ_READY" or "CAMSEQ_DONE".
+  If called from correct states will either start ISR-based waiting for specified number of frames  or just acquisition.
+  In the first case ISR will start acquisition itself
+  State "CAMSEQ_WAIT_F" is set at the same time as starting acquisition (by either camSeqStart() or ISR),
+  States CAMSEQ_WAIT_F,CAMSEQ_ACQUIRE, CAMSEQ_DONE are returned after testing the hardware register in FPGA if camSeqState==CAMSEQ_WAIT_F
+  camSeqStop will terminate any acquisition in progress and set state to CAMSEQ_READY (if it was not CAMSEQ_OFF)
+*/
+// For KAI11000 sensor board
+#define	sensorcom_W_size	1024
+#define	sensorcom_R_size	256
+
+/* MCP definitions */
+
+#define	MCP_W_size	1024
+#define	MCP_R_size	256
+
+#define	MCPOtherBits	0xffa7a7ff
+#define MCPOffReset	0x00101800
+#define MCPReset	0x00001800
+#define MCPNoReset	0x00105800
+#define MCPToggleA	0x00080000
+#define MCPToggleB	0x00001000
+#define MCPctlseq	0x00
+#define MCPsofttg	0x02
+#define MCPeackn	0x03
+#define MCPctlgate	0x04
+#define MCPwstdly	0x06
+#define MCPwrsmsk	0x07
+#define MCPwrsup	0x08
+#define MCPwrmons	0x09
+#define MCPwnom		0x0a
+#define MCPwdenom	0x0b
+#define MCPwoutw	0x0c
+#define MCPwinvctl	0x0d
+#define MCPctlsync	0x0e
+#define MCPwrdlys	0x10
+#define MCPwinv		0x40
+#define MCPwshared	0x80
+#define MCPwrsynctb	0x100
+#define MCPwrseq	0x200
+
+
+/* supported ioctl _IOC_NR's */
+#ifndef I2C_WRITEARG
+ #define I2C_WRITEARG(bus, slave, reg, value) (((bus) << 24) | ((slave) << 16) | ((reg) << 8) | (value))
+ #define I2C_READARG(bus, slave, reg) (((bus) << 24) | ((slave) << 16) | ((reg) << 8))
+
+ #define I2C_ARGBUS(arg) (((arg) >> 24)  & 0x1)
+ #define I2C_ARGSLAVE(arg) (((arg) >> 16)  & 0xff)
+ #define I2C_ARGREG(arg) (((arg) >> 8) & 0xff)
+ #define I2C_ARGVALUE(arg) ((arg) & 0xff)
+
+ #define I2C_WRITEREG 0x1   /* write to an i2c register */
+ #define I2C_READREG  0x2   /* read from an i2c register */
+#endif
+
+/* new for Micron sensors  - 16bit data, always bus 0 */
+#ifndef I2C_16_WRITEARG
+ #define I2C_16_WRITEREG 0x3   /* write 2 bytes to an i2c register */
+ #define I2C_16_READREG  0x4   /* read 2 bytes from an i2c register */
+  
+ #define I2C_16_WRITEARG(slave, reg, value) (((slave) << 24) | ((reg) << 16) | (value))
+ #define I2C_16_READARG(slave, reg) (((slave) << 24) | ((reg) << 16))
+
+ #define I2C_16_ARGSLAVE(arg)   (((arg) >> 24) & 0xff)
+ #define I2C_16_ARGREG(arg)     (((arg) >> 16) & 0xff)
+ #define I2C_16_ARGVALUE(arg)   ( (arg)      & 0xffff)
+ #define I2C_16_ARGVALUE_H(arg) (((arg) >>  8) & 0xff)
+ #define I2C_16_ARGVALUE_L(arg) ( (arg)        & 0xff)
+#endif
+
+
+
+// otherParamsRO[16]
+
+#define _CCCMD(x,y)  (_IO(CMOSCAM_IOCTYPE, (x << 6) | (y & 0x3f)))
+
+
+
+#define CCAM_CTRL(x)  ((_IOC_NR(x) >> 6) & 0x03)
+#define CCAM_ADDR(x)  (_IOC_NR(x) & 0x3f)
+
+//#define CCAM_RWSENSOR   1 /* direct read/write first 32 sensor registers */  // will not use at all
+#define CCAM_RPARS      2 /* read  parameters      0..0x3f */
+#define CCAM_WPARS      3 /* write parameters      0..0x3f */
+
+/* New parameters and update logic
+ * Separate read and write set of 64 registers
+ * User may specify:
+ *   0 - do not update
+ *   1 - update at once
+ *   2 - update when appropriate
+ * and read update status:
+ *   0 - will not be updated
+ *   1 - in sync
+ *   2 - waiting to be updated
+ *   3 - update in progress (TODO: - support async)
+ * 	When updating (validating) parameters and copying them to the read "registers" the I2C registers will be written
+ *  only if they are different from the shadows
+ */
+
+/* abstract sensor register names */
+#define P_UPDATE         0	    /* R/W, see above */
+#define P_SENSOR         1     /* read only
+                           4  - ZR32112MLC - now there is no way to see color/mono
+                           5  - ZR32112PLC
+                           8  - ZR32212MLC
+                           9  - ZR32112PLC
+                           32 - KAC1310-mono
+                           33 - KAC1310-RGB
+                           34 - KAC1310-CMY
+                           48 - MI1300
+                           49 - MT9M001 (1280x1024,same as MI1300)
+                           50 - MT9M001 (1600x1200)
+                           51 - MT9T001 (2048*1536)
+                           64 - IBIS5-1300*/
+
+// leave it here - may be used in user applications
+#define SENSOR_MASK      0xfc
+#define SENSOR_ZR32112   0x04
+#define SENSOR_ZR32212   0x08
+#define SENSOR_KAC1310   0x20
+#define SENSOR_MI1300    0x30
+#define SENSOR_MT9X001   0x30 // MT9M001 - 1, MT9D001 - 2, MT9T001 - 3
+#define SENSOR_IBIS51300 0x40
+#define SENSOR_KAI11000  0x80
+#define SENSOR_NONE      0xfc
+
+// sensor sizes:
+//#define SENSORWIDTH_ZR32112  1288
+//#define SENSORHEIGHT_ZR32112 1032
+#define SENSORWIDTH_ZR32112  1280
+#define SENSORHEIGHT_ZR32112 1024
+//#define SENSORWIDTH_ZR32212  1288
+#define SENSORWIDTH_ZR32212  1280
+#define SENSORHEIGHT_ZR32212 968
+#define SENSORWIDTH_KAC1310  1280
+#define SENSORHEIGHT_KAC1310 1024
+//#define SENSORWIDTH_KAC1310  1296
+//#define SENSORHEIGHT_KAC1310 1046
+#define SENSORWIDTH_MI1300  1280
+#define SENSORHEIGHT_MI1300 1024
+
+#define SENSORWIDTH_MT9M001  1280
+#define SENSORHEIGHT_MT9M001 1024
+#define SENSORWIDTH_MT9D001  1600
+#define SENSORHEIGHT_MT9D001 1200
+#define SENSORWIDTH_MT9T001  2048
+#define SENSORHEIGHT_MT9T001 1536
+
+#define SENSORWIDTH_IBIS51300  1280
+#define SENSORHEIGHT_IBIS51300 1024
+
+#define P_PARS_CHANGED   2 /* RD P_RO_VALID  0	window parameters valid                  */
+#define P_DMA_VALID      3 /* RD P_RO_VALID  0	window parameters valid                  */
+#define P_ACTUAL_WIDTH   4 /* RD P_RO_WIDTH  1	pixels/row                               */
+#define P_ACTUAL_HEIGHT  5 /* RD P_RO_HEIGHT 2  pixels/column                            */
+#define P_LPR            6 /* RD P_RO_LPR    3	32-bit words per row (aligned each row)  */
+#define P_IMAGE_SIZE     7 /* RD P_RO_SIZE   4	total image size (dma data) in bytes     */
+#define P_BAYER          8 /* filter number at (0,0) 0-R, 1-G(R), 2-G(B), 3 - B. Write enabled at first, move to WindowSize later */
+#define P_TRIGGERED		 9 /* when trigger occured - 4 LSBs - pixel in DMA word, higher bits - number of DMA word */
+#define P_PERIOD        10 // Frame period (read only)
+#define P_FRAME         11 // Frame number (reset with JPEG pointers) -(read only)
+#define P_JPEG_WP       12 // Last reported JPEG write pointer in the circular buffer. May need to be adjustment
+#define P_CLK_FPGA      13 // FPGA clock in MHz
+#define P_CLK_SENSOR    14 // Sensor clock in MHz
+#define P_FPGA_XTRA     15 // Extra cycles needed to compressor (probably constant...)
+
+//#define P_TRIG          16 /* R/W P_RW_TRIG   0	 0 - internal, 1 - external               */
+#define P_TRIG          16 /* External trigger mode                                           */
+                           /* bit 0  - "old" external mode (0- internal, 1 - external )       */
+                           /* bit 1 - enable(1) or disable(0) external trigger to stop clip   */
+                           /* ... to be continued */
+#define P_EXPOS         17 /* P_RW_EXPOS  1	 exposure time                            */
+#define P_BGFRAME       18 // Background measurement mode - will use 16-bit mode and no FPN correction 
+
+//#define P_DMA_SZ        18 // P_RW_DMA_SZ 2	 DMA block size (debug, mostly)
+//#define P_DMA_LOOP      19 // Cyclic DMA buffer (should be updated to multiple of frames)
+
+
+
+
+
+// image page numbers depend on image size/pixel depth, so changing any of them will invalidate all pages
+#define P_PAGE_ACQ      19  // Number of image page buffer to acquire to (0.1?)
+#define P_PAGE_READ     20  // Number of image page buffer to read from to (0.1?)
+
+#define P_OVERLAP       21 // number of EXRA lines to be acquired
+#define P_VIDEO         22 /* still (stopped) - 0, video - 1. KAC1310 - video only */
+
+#define P_AUXCM		23 /* signal on AUXCLK pin: 0 - 0, 1 - 1, 1x - 20MHz */
+
+#define P_VIRT_WIDTH    24 /* Virtual window width - KAC-1310 sensor */
+#define P_VIRT_HEIGHT   25 /* Virtual window height - KAC-1310 sensor */
+#define P_WOI_LEFT      26 /* WOI left corner (before applying decimation) */
+#define P_WOI_TOP       27 /* WOI top corner */
+#define P_WOI_WIDTH     28 /* WOI width */
+#define P_WOI_HEIGHT    29 /* WOI height */
+
+#define P_FLIPH         30
+#define P_FLIPV         31
+#define P_DCM_HOR       32 /* Horizontal decimation (1/2/4/8) */
+#define P_DCM_VERT      33 /* Vertical   decimation (1/2/4/8) copied from horizontal for Zoran chips */
+#define P_BIN_HOR       34 /* binning 1/2 - KAC1310 only */
+#define P_BIN_VERT      35 /* not used yet binning 1/2 - KAC1310 only */
+
+#define P_COLOR         36 /* mono - 0, color mode - 1 */
+#define P_TEST          37 // 0 - normal, 1 - sensor test, 2 - FPGA test
+#define P_MCLK          38 /* 2..129 */
+#define P_MCLK_DIS      39 /* disable sensor clock */
+						 
+#define P_BITS          40 /* pixel depth - bits 10/8/4 */
+#define P_SHIFTL        41 /* "digital gain" - shift left by 0/1/2 bits  (3 ->-1)*/
+#define P_FPNS          42 // FPN correction mode (subtract) 0..3
+                           // 0-none, 1 - fine(25%), 2 - 50%, 3 - coarse(100%)
+#define P_FPNM          43 // FPN correction mode (multiply) 0..3
+                           // 0-none, 1 - fine(+/-12.5%), 2 - medium (+/-25%), +3 - coarse(+/-50%)
+#define P_VEXPOS        44 /* video exposure (if 0 - use P_RW_EXPOS in ms) */
+#define P_VIRTTRIG      45 // Sum of pixels in a line greater than this value - trigger acquisition
+
+#define P_GAINR         46 /* R channel gain (mono gain) */
+#define P_GAING         47 /* G channel gain ("red line" in ZR32212) */
+#define P_GAINB         48 /* B channel gain (mono gain) */
+#define P_GAINGB        49 /* G channel gain ("blue line" in ZR32212) - copied from P_RW_GAING in ZR2112 */
+#define P_FATZERO       50 // subtract while adding data from to consequitive frames (async trigger)
+// will be more for KODAK sensor ?
+#define P_SPEC_KAC_GGA  51 // KAC-1310 Global gain A , 6 bits, (14)
+#define P_SPEC_KAC_GGB  52 // KAC-1310 Global gain B , 6 bits, (14)
+#define P_SPEC_KAC_GGM  53 // KAC-1310 Global gain mode, 3 bits, 0
+#define P_QUALITY       54 // JPEG IMAGE QUALITY
+#define P_FP100S        55 // Frames per 100 sec (fps * 100)
+#define P_SENSOR_WIDTH  56
+#define P_SENSOR_HEIGHT 57
+#define P_COLOR_SATURATION_BLUE 58 // 100*realtive saturation blue
+#define P_COLOR_SATURATION_RED  59 // 100*realtive saturation red
+#define P_GAMMA         60 // 100*gamma  (for now - just a hint table could be more complex. Use higher bytes for colors in 333)
+#define P_PIXEL_LOW     61 //  (just a hint for gamma table) "fat zero" (on 8-bit scale)
+#define P_PIXEL_HIGH    62 //  (just a hint for gamma table) highest pixel value (before table) on a 256-scale
+
+
+#define P_DONTCARE      63 // write anything - just to force update
+
+
+
+
+/*
+EXAMPLE usage:
+
+    i2c_arg = I2C_WRITEARG(STA013_WRITE_ADDR, reg, val);
+    ioctl(fd, _IO(ETRAXI2C_IOCTYPE, I2C_WRITEREG), i2c_arg);
+
+    i2c_arg = I2C_READARG(STA013_READ_ADDR, reg);
+    val = ioctl(fd, _IO(ETRAXI2C_IOCTYPE, I2C_READREG), i2c_arg);
+
+
+*/
+
+
+
+/* i2c errors */
+#ifndef ERR_I2C_SCL_ST0
+ #define	ERR_I2C_SCL_ST0		 1
+ #define	ERR_I2C_SDA_ST0		 2
+ #define	ERR_I2C_SCL_ST1		 4
+ #define	ERR_I2C_SDA_ST1		 8
+ #define	ERR_I2C_SCL_NOPULLUP 16
+ #define	ERR_I2C_SDA_NOPULLUP 32
+
+/* i2c_diagnose called by i2c_start (?) could not find any problems. Try again start */
+ #define    ERR_I2C_NOTDETECTED  64
+ #define	ERR_I2C_SHORT		 128
+ #define	ERR_I2C_BSY		     256
+ #define	ERR_I2C_NACK		 512
+#endif
+
+
+/* supported ioctl _IOC_NR's */
+#define IO_CCAM_SET_EXT_EXPOSURE  0x06
+#define IO_CCAM_MONITOR_SEQ       0x07
+
+
+//#define IO_CCAM_STOP_DMA	0x08
+//#define IO_CCAM_START_DMA	0x09 // just starts DMA - descriptor list should be set eatlier
+//#define IO_CCAM_START_RAW	0x0a // Programs DMA descriptor list according to current frame size, FPGA registers and starts DMA
+
+
+#define IO_CCAM_JPEG		0x08 // JPEG-compressor related commands
+#define      JPEG_CMD_RESET	0x00 //	Resets pointers - both acquisition and readout
+//#define      JPEG_CMD_ARM	0x01 // Prepare compressor to read next frame acquired
+#define      JPEG_CMD_GET	0x02 // Read current page (will return empty (and length==0) if not ready
+#define      JPEG_CMD_FORGET	 0x03 // increment read frame pointer
+#define      JPEG_CMD_CATCHUP	 0x04 // set read pointer to the last acquired (or acquiring if none is acquired yet)
+#define      JPEG_CMD_ACQUIRE	 0x05 // acquire and compress one frame
+#define      JPEG_CMD_SAVE_RP	 0x06 // save read pointer
+#define      JPEG_CMD_RESTORE_RP 0x07 // restore read pointer
+#define      JPEG_CMD_N_DONE     0x08 // return 1 if no more frames to be acquired (frame number)
+#define      JPEG_CMD_L_DONE     0x09 // return 1 if no more frames to be acquired (total length)
+#define      JPEG_CMD_START      0x0a // start constant compression mode
+#define      JPEG_CMD_STOP       0x0b // stop constant compression mode (may want to wait for CAMSEQ_DONE)
+#define      JPEG_CMD_FRAMES     0x0c // returns number of frames in buffer, (re)uilds frames chain
+#define      JPEG_CMD_JUST_STOP  0x0d // just stop - don't start cycle if was allready off!
+#define      JPEG_CMD_DUMP       0x0f // printk all static data/tables
+
+#define      JPEG_CTRL_MONOCHROME    0x400
+#define      JPEG_CTRL_MONOCHROME_BLOCKED    0x1000
+
+#define IO_CCAM_JPEG_QUALITY	0x09 // Set P_QUALITY
+
+#define IO_CCAM_JPEG_GET_N	0x0a	// get specified number of frames (will add to already asked for if any)
+#define IO_CCAM_JPEG_GET_L	0x0b	// get specified length (will stop after frame if got more)
+
+#define IO_CCAM_JPEG_CTRL	0x0c // Write JPEG control word (0x10000 - use header, LSW - other settings)
+#define IO_CCAM_DMA		0x0d
+  #define CCAM_DMA_CMD_STOP	  0x00
+  #define CCAM_DMA_CMD_START  0x01 // just starts DMA - descriptor list should be set eatlier
+
+#define IO_CCAM_CR_MODIFY 0x0e	//(bit number)<<2 | op; op= 0 - nop, 1 - set, 2 - reset, 3 - toggle)
+#define IO_CCAM_CR_SHADOW 0x0f
+
+
+/* Memory mappable memory... can be mmap'd by application.
+*       Contains the following layout:
+*       offset                          content
+*       -------------------             ---------------------
+*       CCAM_MMAP_OFFSET_MMAP_HEADER    struct ccamMmapHeader + fill
+*       CCAM_MMAP_OFFSET_JPEG_HEADER    jpeg header to use + fill
+*       CCAM_MMAP_OFFSET_DMABUF         dma buffer, contiguous
+*/
+
+/* Jpeg dma buffer. Buffer must be a multiple of
+*       64Kbyte because one dma descriptor conveniently handles that many...
+*       (can not handle more than that also).
+*  The #define CCAM_CHUNK_PER_DMABUF can be increased to allow acquiring
+*  larger images, if system memory can be freed up elsewhere.
+*  A value of 128 means 128*64Kbytes per buffer, or 8Mbyte for buffer,
+*  of 16Mbyte total system memory.
+*  Jpeg images rarely get as big as 4MB, but they can get bigger.
+*/
+#define CCAM_BYTES_PER_CHUNK  (1<<16)  /* dma buffer bytes per descriptor */
+#define CCAM_DESCR_PER_CHUNK  1
+/* If CCAM_CHUNK_PER_DMABUF is 100 then buffer is about 6.5 million bytes
+*       which is probably bigger than any single image we'll generate,
+*       and is also bigger than raw data (which is 5.5MB).
+*       However, images bigger than 6.5/2 == 3.25 million bytes will
+*       not be able to be double-buffered and thus will slow things down.
+*/
+//#define CCAM_CHUNK_PER_DMABUF 102  /* no. of 64Kbyte chunks per buffer */
+#define CCAM_CHUNK_PER_DMABUF 300  /* no. of 64Kbyte chunks per buffer */
+#define CCAM_WORDS_PER_DMABUF (CCAM_CHUNK_PER_DMABUF<<14) /*32bit words...*/
+#define CCAM_BYTES_PER_DMABUF (CCAM_CHUNK_PER_DMABUF<<16)
+/*  For past compatibility, CCMA_DMA_SIZE...
+*/
+#define CCAM_DMA_SIZE CCAM_WORDS_PER_DMABUF
+// rather arbitrary - size of indax of frames in buffer, will be limiting factor if frames are less than 256 bytes
+#define CCAM_DMA_INDEX_SIZE (CCAM_DMA_SIZE>>6)
+/*
+*       CCAM_MMAP_OFFSET... -- offsets in bytes in memory mapped region.
+*       CCAM_MMAP_SIZE -- no. of bytes to mmap.
+*/       
+#define CCAM_MMAP_OFFSET_MMAP_HEADER 0
+#define CCAM_MMAP_OFFSET_JPEG_HEADER (PAGE_SIZE)
+#define CCAM_MMAP_OFFSET_DMABUF (4*PAGE_SIZE)
+#define CCAM_MMAP_SIZE (PAGE_SIZE*sizeof(long)+CCAM_BYTES_PER_DMABUF)
+
+// ccamMmapHeader -- Data structure at beginning of mmap'able memory:
+// this allows quick access by an application to this data.
+// NOTE: this must not exceed PAGESIZE bytes since the jpeg header lives there.
+struct ccamMmapHeader
+{
+    /* Application must not change use_header except through setting
+    *  of parameters.
+    */
+    int use_header;     /* should jpeg header/tailer be added? */
+    /* Application must not change headerSize; doing so would only
+    *   confuse
+    */
+    int headerSize;     /* no. of bytes in jpeg header */
+    /* Application may set exposureIdx and jpegIdx to any desired value
+    *   when no acquisition is going on (e.g. before JPEG_CMD_ACQUIRE).
+    */
+    int exposureIdx;    /* incremented on every frame sync (exposure) irupt*/
+    int jpegIdx;        /* incremented on every jpeg done interrupt */
+    /* Data buffering info.
+    *   This is readonly by application, which should use:
+    *   JPEG_CMD_RESET to zero readOffset and writeOffset and buf[readOffset].
+    *   JPEG_CMD_ACQUIRE to acquire image (when done, sets buf[writeOffset]
+    *   and then advances writeOffset and zeroes buf[writeOffset]).
+    *   JPEG_CMD_FORGET to advance readOffset.
+    *
+    *   readOffset and writeOffset are byte offsets from beginning of
+    *   the dma buffer where one can find the respective ccamFileDataHeader.
+    */
+    int readOffset;     /* where we (maybe) can read next image from (bytes) */
+    int writeOffset;    /* where next image will be placed at (bytes) */
+    /* nfr is the number of frames left to acquire in a sequnce of frames 
+    */
+    int nfr;
+    /* lfr is the length (in bytes) of frames left to acquire.
+    *   This is a crude measurement that basically says how much of the
+    *   dma buffer we're willing to consume.
+    */
+    int lfr;
+    /* While dma of jpeg data is enabled/ongoing, jpegBusy is set nonzero.
+    */
+    int jpegBusy;
+};
+
+// ccamFileDataHeader -- Data structure preceding each image in dma buffer.
+// (Note that the actual image may wrap around, but the 
+// this struct is always placed so as to avoid wraparound and be aligned).
+// Note that this does not include jpeg header or tailer, and any way
+// the actual data is in parts (the offset to is given in part[i].offset,
+// a byte count relative to start of dma buffer).
+struct ccamFileDataHeader
+{
+    /* Image is not acquired / valid yet until Valid set to 1 or -1  .
+    *   A value of -1 indicates buffer overflow error.
+    */
+    int valid;
+    /* Value for "valid: (note, OVERFLOW can be recovered from) */
+    #define CCAM_IMAGE_VALIDFLAG_NOTDONE 0  /* MUST be zero */
+    #define CCAM_IMAGE_VALIDFLAG_DONEOK  1 
+    #define CCAM_IMAGE_VALIDFLAG_OVERFLOW -1  /* buffer was too small */
+    #define CCAM_IMAGE_VALIDFLAG_FATAL  -2  /* misc. unexpected error */
+    /* nBytes -- Total size of image stored in dma buffer.
+    *   This does not include e.g. jpeg header (or this header).
+    */
+    int nBytes;
+    /* nBytesMax -- maximum available during acquisition.
+    *   However, the last CCAM_IMAGE_OVERFLOW_BYTES bytes, if used,
+    *   should be taken to indicate that an overlow occurred.
+    *   The value for CCAM_IMAGE_OVERFLOW_BYTES should be large enough
+    *   to accomodate various corrections without adding a bunch of extra logic.
+    */
+    #define CCAM_IMAGE_OVERFLOW_BYTES 512
+    int nBytesMax;
+    /* Offset (bytes) in dma buffer of next image header (IFF Valid is 1) */
+    int nextOffset;
+    /* Offset and size (bytes) in dma buffer of parts of data 
+    *   However, only some part(s) may be used, skip those with zero count.
+    *   Before acq is done, part[i].nBytes is maximum size of the part;
+    *   after acq (when valid is set to 1) it is set to actual amount.
+    *   Two parts is enough for a simple ring buffer approach.
+    */
+    #define CCAM_IMAGE_NPARTS_MAX 2
+    struct
+    {
+        int offset;     /* w/in dma buffer, bytes */
+        int nBytes;     /* size of this part */
+    } part[CCAM_IMAGE_NPARTS_MAX];
+};
+
+#endif /* _ASM_CMOSCAM_H */

Added: experimental/j/Elphel333/common/defines.h
===================================================================
--- experimental/j/Elphel333/common/defines.h	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/common/defines.h	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,103 @@
+// Implementation of Theora RTP streaming
+// Copyright 2005 Elphel, Inc
+// Andrey Latin andrey.latin at gmail.com
+
+#ifndef __STRAMER_H_DEF_
+#define __STREAMER_H_DEF_
+
+#include <inttypes.h>
+
+
+#define HAVE_NANOSLEEP 	1
+
+#define RTP_PT_THEORA	98
+#define BUF_SIZE	1460
+#define TimeScale	90000
+
+#define TimestampTicks	1000000
+
+typedef uint64_t Timestamp;
+typedef uint32_t RtpTimestamp;
+
+#ifndef true
+#define true		1
+#endif
+#ifndef false
+#define false		0
+#endif
+
+
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#define RAW_TH_DATA	0
+#define TH_IDENT_HDR	0x80
+#define TH_COMMENT_HDR	0x81
+#define TH_SETUP_HDR	0x82
+
+
+// Payload RTP header for Theora bitstream
+
+struct TheoraPayloadHeader {
+	uint32_t	shident:32;	// Setup Header Ident
+	uint8_t		C_bit:1;
+	uint8_t		F_bit:1;
+	uint8_t		reserv:2;
+	uint8_t		n_pkts:4;	// number of complete packets in payload
+	uint8_t		type_payload:8;
+	uint16_t	payload_len;
+};
+
+///////////// for manage streamer with web interface ///////
+#define STOP_STREAM	0
+#define START_STREAM	1
+//#define STOP_SCANNING	0
+//#define START_SCANNING	1
+
+//#define JPEG_ACCESS_MMAP 1
+//#define JPEG_ACCESS_DRV	 2
+
+typedef struct strm_common {
+	char 	address[21];   	// address or hostname
+	int	port;		// port no
+	double	fps;		// soft FPS
+	int     regim;		// mmap/driver access to JPEG data
+	int	scanning;	// mode scanning on/off	 
+	char 	name[21];	// SDES name field for subtitles
+	char	telephone[21];  // phone subtitles
+	char	toolname[21];   
+	char	note[61];
+	char	location[41];
+	char	email[21];
+	char    encrypt_key[41];// encryption key
+	int     encryption;	// mode encryption on/off
+	int	status;		// start/top streamer
+} strm_data_t;
+
+
+
+
+int 		usec_sleep(int);
+Timestamp 	GetTimestamp(void);
+Timestamp	GetTimerMs(void);
+Timestamp 	GetRelativeTime(void);
+void 		InitTimer(void);
+void 		SeedRandom(void);
+uint32_t 	GetRandomMcastAddress(void); 
+uint16_t 	GetRandomPortBlock(void);
+RtpTimestamp 	TimestampToRtp(Timestamp);
+Timestamp 	TimestampToNtp(Timestamp);
+void HexDump(
+        u_int8_t* pBytes, u_int32_t numBytes);
+
+
+
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif //__STRAMER_H_DEF_
+

Added: experimental/j/Elphel333/common/oggtheora.c
===================================================================
--- experimental/j/Elphel333/common/oggtheora.c	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/common/oggtheora.c	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,1809 @@
+/*!***************************************************************************
+*! FILE NAME  : oggtheora.c
+*! DESCRIPTION: TBD
+*! Copyright 2005 Elphel, Inc
+*! -----------------------------------------------------------------------------**
+*!
+*!  oggtheora.c 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.
+*!
+*!  oggtheora.c 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 oggtheora.c if not, write to the Free Software
+*!  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*! -----------------------------------------------------------------------------**
+*/
+
+/****************** INCLUDE FILES SECTION ***********************************/
+#include <stdio.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <errno.h>
+#include <unistd.h>
+#include <string.h>
+#include "c313a.h"
+#include "oggtheora.h"
+
+
+// used libog-1.1.1/crc/framing.c
+#define OC_NHUFFMAN_TABLES (80)
+#define OC_NDCT_TOKENS     (32)
+
+//#define D(x) x
+#define D(x)
+
+/*A Huffman code for a Theora DCT token.
+  Each set of Huffman codes in a given table must form a complete, prefix-free
+   code.
+  There is no requirement that all the tokens in a table have a valid code,
+   but the current encoder is not optimized to take advantage of this.
+  If there is not at least one table with a code for every token in each of
+   the five groups of 16 tables, then the encoder may fail to encode certain
+   frames.
+  The complete table in the first group of 16 does not have to be in the same
+   place as the complete table in the other groups, but the complete tables in
+   the remaining four groups must all be in the same place.*/
+typedef struct{
+  /*The bit pattern for the code, with the LSbit of the pattern aligned in
+     the LSbit of the word.*/
+  u_int32_t pattern;
+  /*The number of bits in the code.
+    This must be between 0 and 32, inclusive.*/
+  int          nbits;
+}theora_huff_code;
+
+#define ogg_uint32_t u_int32_t
+
+#include "oggtheora_tables.h"
+
+// from theora/experimental/include/theora/theora.h
+#define OC_EINVAL    (-10)
+
+// from theora/experimental/lib/ocintrin.h
+#define OC_MAXI(_a,_b)      ((_a)<(_b)?(_b):(_a))
+
+// from theora/libogg-1.1.1/include/ogg/ogg.h
+typedef struct {
+  long endbyte;
+  int  endbit;
+
+  unsigned char *buffer;
+  unsigned char *ptr;
+  long storage;
+} oggpack_buffer;
+
+
+// from theora/experimental/lib/huffenc.c
+
+/*A description of a Huffman code value used when encoding the tree.*/
+typedef struct{
+  /*The bit pattern, left-shifted so that the MSB of all patterns is
+     aligned.*/
+  ogg_uint32_t pattern;
+//  u_int32_t pattern;
+  /*The amount the bit pattern was shifted.*/
+  int          shift;
+  /*The token this bit pattern represents.*/
+  int          token;
+}oc_huff_entry;
+       extern int errno;
+
+
+//#define C333_MAXWIDTH (4096)
+//#define C333_MAXHEIGHT (2048)
+// FPGA_MASK is used to specify (macroblock*4)-level "skip" and "low quality" (qi[0] - high, qi[1] - low)
+// skip applies to some INTER frames and will not be coded.
+// the mask is made for the 128x64 macroblock array, (0,0) matching the lower-left corner of the image
+// each element (u_int_16) encodes 8 macroblock flag pairs (LSB left, in each pair lower bit is quality,
+// higher - "skip"
+
+/*
+static u_int16_t FPGA_MASK[C333_MAXHEIGHT>>5][C333_MAXWIDTH>>8]; // [64][16]
+static const u_int32_t FPGA_ZEROBIN[6]={ // Index Sharpness S.Fact>50 Zbin       Round
+                                 0x80a6, //   0       0        0      0.65(166)  0.499(128)
+                                 0x76a6, //   1       0        1      0.65(166)  0.460(118)
+                                 0x7ac0, //   2       1        0      0.75(192)  0.476(122)
+                                 0x66c0, //   3       1        1      0.75(192)  0.400(102)
+                                 0x7ae6, //   4       2        0      0.90(230)  0.476(122)
+                                 0x55e6};//   5       2        1      0.90(230)  0.333( 85)
+static u_int32_t FPGA_QTABLES[512];
+static u_int16_t FPGA_HTI     [12];
+static u_int16_t FPGA_HTI30   [16];
+static u_int32_t FPGA_HTABLE  [1024];
+static u_int16_t FPGA_FIRSTBIT[4];
+
+*/
+
+   
+  void fill_FPGA_qtable (u_int32_t *table,
+                         int       inter,
+                         int       color,
+                         int       qindex_dc, // always the same in a frame
+                         int       qindex_ac, // may be different if it is a second qi in a frame
+                         int       sharpness);  // 0..2 - common for all q
+   void fill_FPGA_qtables (
+     u_int32_t  tables[512],
+     int  sharpness,
+     int  intra_y_qi_hi,   // index in DC_Scale/AC_Scale tables, intra frame, luma
+     int  intra_c_qi_hi,   // index in DC_Scale/AC_Scale tables, intra frame, chroma
+     int  inter_y_qi_hi,   // index in DC_Scale/AC_Scale tables, inter frame, luma
+     int  inter_c_qi_hi,   // index in DC_Scale/AC_Scale tables, inter frame, chroma
+
+     int  intra_y_qi_lo,   // index in DC_Scale/AC_Scale tables, intra frame, luma
+     int  intra_c_qi_lo,   // index in DC_Scale/AC_Scale tables, intra frame, chroma
+     int  inter_y_qi_lo,   // index in DC_Scale/AC_Scale tables, inter frame, luma
+     int  inter_c_qi_lo);   // index in DC_Scale/AC_Scale tables, inter frame, chroma
+  // {len[3:0],data[13:0]} - data is MSB aligned
+   int fill_FPGA_htables (u_int16_t hti  [12],
+                          u_int16_t hti30[16],
+                          u_int32_t htable[1024],
+                          int       pre_ht[12],
+                          int       pre_ht30[6]);
+
+
+int theora_write_bits (char * buf, // buffer
+                          int * bp,   // pointer to bit pointer
+                          u_int32_t data,   // data to write
+                          int nb);     // number of bits to write
+static int huff_entry_cmp(const void *_c1,const void *_c2);
+
+int oc_huff_codes_pack(char *buf, int* bp,
+ const theora_huff_code _codes[OC_NHUFFMAN_TABLES][OC_NDCT_TOKENS]);
+
+int ogg_page      (ogg_header_t *    ogg_header, // pointer to the header data (returns - header length in bytes)
+                            char     flags,
+                            u_int64_t granule,
+                            u_int32_t stream_serial,
+                            int      page,       // page
+                            int      num_packets, // number of packets in the page
+                   len_data_t *      packets);
+
+/*
+    similar to above, but dedicated to the frame data.
+    There could be 2 types
+    - first page of a frame (packet) then frame header will be attached 
+      and bit-combined with the frame
+    - continuation  page (flags bit 0 should be set) - 
+        then no frame header will be added to the data
+    currently there can not be two frames (packets) on one page
+*/
+int ogg_frame_page      (ogg_header_t *    ogg_header,      // pointer to the header data (returns - header length in bytes)
+                            char           flags,           // +1 - continuation, +4 - last (+2 - first)
+                            int            maxpage,         // maximal page size (w/o ogg header)
+                            u_int64_t      granule,         // 
+                            u_int32_t      stream_serial,   //
+                            int            page,            // page
+                            len_data_t     frame_header,    // not used if (flags & 1). frame_header.len is measured in bits, not bytes!
+                            int          * len,             // pointer frame data length (will modify - if non-zero - need continuation)
+                            u_int8_t    ** frame_data);     // pointer to pointer to an array with frame data
+                                                            // if it is not continuation data is bit-aligned to be combined with frame_header
+                                                            // first word of frame data will be modified - OR-ed with the last one from
+                                                            // the frame_header
+                   
+                   
+int theora_identification (char *buf,  // returns length, buf should be big enough - 42 bytes
+                              int   fmbw, // width in macroblocks
+                              int   fmbh, // height in macroblocks
+                              int   frn, // frame rate nominator ( in 1/1000000)
+                              int   frd, // frame rate denominator (1000000)
+                              int   nobr, // nominal bit rate (-1 - undefined?)
+                              int   qual, // relative quality (was 0x10)
+                              int   kfgshift); // number of bits in granule used for number of i-frames
+int theora_comments (char       *buf,    // returns length, buf should be big enough - ?? bytes
+                        int         buflen,  // buffer size (returns -1 if fails to fit)
+                        const char *vendor, // Null-terminated string (was "Xiph.Org libTheora I 20040317 3 2 0\0")
+                        int         nuser,   // number of user comments
+                        const char **user);
+   int theora_setup (char       *buf,    // returns length, buf should be big enough - ?? bytes
+                     int         buflen,  // buffer size (returns -1 if fails to fit)
+// the next pointers will likely point to constant tables, the same ones should be used to program FPGA internal tables                     
+                     const int  *lflims,  // if null - skip  alltogether, not null - 5 assumed bits/value
+                     const int  *acscale, // will encode 10bits/item
+                     const int  *dcscale, // will encode 10bits/item
+                     const int  bms[][64]    // array of 3 BMS tables
+                        );
+void fill_fpga_mask_windows (u_int16_t  mask_array[C333_MAXHEIGHT>>5][C333_MAXWIDTH>>8],
+                           int width,
+                           int height, 
+                           int qual_left, // all in pixels, high quality will be inside and including the spacified coordinates
+                           int qual_bottom,
+                           int qual_right,
+                           int qual_top,
+                           int skip_left,
+                           int skip_bottom,
+                           int skip_right,
+                           int skip_top);
+   int theora_frameheader (char       *buf,    // returns length, buf should be big enough - ?? bytes
+                           int         buflen,  // buffer size (returns -1 if fails to fit) - not implemented yet
+                           int         width,   // pixels - will ">>" as needed
+                           int         height,  // pixels - will ">>" as needed
+                           int         frame_flags,   // 0 - intra, 1 - inter(full), 3 - inter (skip according mask)
+                           int         nqis,     // number of qi in a frame (valid 1 or 2)
+                           int         qis[2], // q[0] - high, DC, q[1] - low (AC only)
+                          
+                           u_int16_t   mask_array[C333_MAXHEIGHT>>5][C333_MAXWIDTH>>8] //
+//                           int mask_array[C333_MAXHEIGHT>>5][C333_MAXWIDTH>>8] //
+                        );
+   void theora_frameheaders(int         width,   // pixels - will ">>" as needed
+                           int         height,  // pixels - will ">>" as needed
+                           len_data_t  frame_headers[3],   // [0] - intra, [1] - inter(full), [2] - inter (skip according mask)
+                           int         nqis,     // number of qi in a frame (valid 1 or 2)
+                           int         qis[2], // q[0] - high, DC, q[1] - low (AC only)
+                           u_int16_t   mask_array[C333_MAXHEIGHT>>5][C333_MAXWIDTH>>8] //
+                        );
+
+
+
+    int makeOggTheora(u_int32_t * ccam_dma_index, // will be mmaped array in the camera
+                      u_int8_t  * ccam_dma,       // will be mmaped array in the camera (char array)
+                      FILE *      movie_file,
+                      int         page_size,  // maximal; page size to use
+                      len_data_t  packets[6], // 0 - identification
+                                              // 1 - comment
+                                              // 2 - setup
+                                              // 3 - frame - intra (.len - in bits, not bytes!)
+                                              // 4 - frame - inter/full
+                                              // 5 - frame - inter/mapped
+                      u_int32_t   stream_serial,
+                      int         kfgshiftm // number of bits in granule used for number of i-frames
+                      );
+                      
+   void write_7_2_1(char * buf,         // bitstream buffer
+                    int  * bp,          // bitstream bit pointer
+                    int    length);     // run length to encode
+   
+   void write_7_2_2(char * buf,         // bitstream buffer
+                    int  * bp,          // bitstream bit pointer
+                    int    length);     // run length to encode
+   
+   void   put_7_2_1(char * buf,         // bitstream buffer
+                    int  * bp,          // bitstream bit pointer
+                    int  * current_bit, // current running bit (-1 - undefined)
+                    int  * run,         // current length of bits (when current bit == -1 undefined)
+                    int    bit,         // bit to encode (<0 - flush)
+                    int    len);        // number of bits to put
+
+   void   put_7_2_2(char * buf,         // bitstream buffer
+                    int  * bp,          // bitstream bit pointer
+                    int  * current_bit, // current running bit (-1 - undefined)
+                    int  * run,         // current length of bits (when current bit == -1 undefined)
+                    int    bit,         // bit to encode (<0 - flush)
+                    int    len);        // number of bits to put
+
+                           
+//++++++++++++++++++++++++++++++++++++++++++++++
+
+void fill_fpga_mask_windows (u_int16_t  mask_array[C333_MAXHEIGHT>>5][C333_MAXWIDTH>>8],
+                           int width,
+                           int height, 
+                           int qual_left, // all in pixels, high quality will be inside and including the spacified coordinates
+                           int qual_bottom,
+                           int qual_right,
+                           int qual_top,
+                           int skip_left,
+                           int skip_bottom,
+                           int skip_right,
+                           int skip_top) {
+    const int mask[8]={3,0xc,0x30,0xc0,0x300,0xc00,0x3000,0xc000};
+    int x,y,x8,d;
+    int w  = (width-1)   >> 5;
+    int h  = (height-1)  >> 5;
+    int ql = qual_left   >> 5;
+    int qb = qual_bottom >> 5;
+    int qr = qual_right  >> 5;
+    int qt = qual_top    >> 5;
+    int sl = skip_left   >> 5;
+    int sb = skip_bottom >> 5;
+    int sr = skip_right  >> 5;
+    int st = skip_top    >> 5;
+    if (w>((C333_MAXWIDTH >>5) -1)) w=((C333_MAXWIDTH >>5) -1);
+    if (h>((C333_MAXHEIGHT>>5) -1)) h=((C333_MAXHEIGHT>>5) -1);
+D(fprintf(stderr,"fill_fpga_mask_windows w=%d, h=%d\n",w,h));
+D(fprintf(stderr,"ql=%d qb=%d qr=%d qt=%d sl=%d sb=%d sr=%d st=%d\n",ql,qb,qr,qt,sl,sb,sr,st));
+     
+// this implementation is not optimized for speed - it is possible to do later.
+    for (y=0;y<=h;y++) for (x=0;x<=w;x++) {
+      d=((((x>qr) || (x<ql) || (y>qt) || (y<qb))? 1 : 0) |
+         (((x>sr) || (x<sl) || (y>st) || (y<sb))? 2 : 0)) << ((x & 7) << 1);
+         x8=x>>3;
+         mask_array[y][x8] ^= ((mask_array[y][x8] ^ d) & mask[x & 7]);
+D(if (d>0) fprintf(stderr,"d= 0x%x, x=%d, mask_array[%d][%d]=0x%x\n",d,x,y,x8,mask_array[y][x8]));
+         
+    }
+}
+
+
+   void write_7_2_1(char * buf,         // bitstream buffer
+                    int  * bp,          // bitstream bit pointer
+                    int    length)      // run length to encode
+   {
+     if        (length>=34) {
+       theora_write_bits (buf, bp,  0x3f,6);
+       theora_write_bits (buf, bp,  length-34,12);
+     } else if (length>=18) {
+       theora_write_bits (buf, bp,  0x3e,6);
+       theora_write_bits (buf, bp,  length-18,4);
+     } else if (length>=10) {
+       theora_write_bits (buf, bp,  0x1e,5);
+       theora_write_bits (buf, bp,  length-10,3);
+     } else if (length>= 6) {
+       theora_write_bits (buf, bp,  0x0e,4);
+       theora_write_bits (buf, bp,  length- 6,2);
+     } else if (length>= 4) {
+       theora_write_bits (buf, bp,  0x06,3);
+       theora_write_bits (buf, bp,  length-4,1);
+     } else if (length>= 2) {
+       theora_write_bits (buf, bp,  0x02,2);
+       theora_write_bits (buf, bp,  length-2,1);
+     } else  {
+       theora_write_bits (buf, bp,  0x00,1);
+     }
+     
+   }
+   
+   void write_7_2_2(char * buf,         // bitstream buffer
+                    int  * bp,          // bitstream bit pointer
+                    int    length)      // run length to encode
+   {
+     if        (length>=15) {
+       theora_write_bits (buf, bp,  0x1f,5);
+       theora_write_bits (buf, bp,  length-15,4);
+     } else if (length>=11) {
+       theora_write_bits (buf, bp,  0x1e,5);
+       theora_write_bits (buf, bp,  length-11,2);
+     } else if (length>= 7) {
+       theora_write_bits (buf, bp,  0x0e,4);
+       theora_write_bits (buf, bp,  length- 7,2);
+     } else if (length>= 5) {
+       theora_write_bits (buf, bp,  0x06,3);
+       theora_write_bits (buf, bp,  length-5,1);
+     } else if (length>= 3) {
+       theora_write_bits (buf, bp,  0x02,2);
+       theora_write_bits (buf, bp,  length-3,1);
+     } else  {
+       theora_write_bits (buf, bp,  0x00,1);
+       theora_write_bits (buf, bp,  length-1,1);
+     }
+     
+   }
+   
+   void put_7_2_1(char * buf,         // bitstream buffer
+                  int  * bp,          // bitstream bit pointer
+                  int  * current_bit, // current running bit (-1 - undefined)
+                  int  * run,         // current length of bits (when current bit == -1 undefined)
+                  int    bit,         // bit to encode (<0 - flush)
+                  int    len)         // number of bits to put
+   {
+//  D(fprintf(stderr, "put_7_2_1: put %d of bit %d\n",len,bit));
+     if (current_bit[0]<0) {
+       if (bit >=0) { // do nothing for empty string
+         theora_write_bits (buf, bp,  bit, 1); // start new run
+         current_bit[0]=bit;
+         run[0]=len;
+         while (run[0]>=4129) {
+           write_7_2_1(buf, bp, 4129);
+           run[0]-=4129;
+           if (run[0]>0) theora_write_bits (buf, bp,  bit, 1);
+           else current_bit[0]=-1;
+         }
+       }
+     } else { // current_bit >= 0
+       if (bit <0) { //flush
+         write_7_2_1(buf, bp, run[0]);
+         current_bit[0]=-1;
+//         run[0]=0; //?  not needed
+       } else { // continue
+         if (bit == current_bit[0]) {
+           run[0]+=len;
+           while (run[0]>=4129) {
+             write_7_2_1(buf, bp, 4129);
+             run[0]-=4129;
+             if (run[0]>0) theora_write_bits (buf, bp,  bit, 1);
+             else current_bit[0]=-1;
+           }
+         } else { // bit flipped
+           write_7_2_1(buf, bp, run[0]);
+           current_bit[0]=bit;
+           run[0]=len;
+           while (run[0]>=4129) {
+             write_7_2_1(buf, bp, 4129);
+             run[0]-=4129;
+             if (run[0]>0) theora_write_bits (buf, bp,  bit, 1);
+             else current_bit[0]=-1;
+           }
+         }
+       }
+     } 
+   }
+   
+   
+   void put_7_2_2(char * buf,         // bitstream buffer
+                  int  * bp,          // bitstream bit pointer
+                  int  * current_bit, // current running bit (-1 - undefined)
+                  int  * run,         // current length of bits (when current bit == -1 undefined)
+                  int    bit,         // bit to encode (<0 - flush)
+                  int    len)         // number of bits to put
+   {
+//  fprintf(stderr, "put_7_2_2: put %d of bit %d\n",len,bit);  
+     if (current_bit[0]<0) {
+       if (bit >=0) { // do nothing for empty string
+         theora_write_bits (buf, bp,  bit, 1); // start new run
+         current_bit[0]=bit;
+         run[0]=len;
+         while (run[0]>=30) {
+           write_7_2_2(buf, bp, 30);
+           run[0]-=30;
+           if (run[0]>0) theora_write_bits (buf, bp,  bit, 1);
+           else current_bit[0]=-1;
+         }
+       }
+     } else { // current_bit >= 0
+       if (bit <0) { //flush
+         write_7_2_2(buf, bp, run[0]);
+         current_bit[0]=-1;
+//         run[0]=0; //?  not needed
+       } else { // continue
+         if (bit == current_bit[0]) {
+           run[0]+=len;
+           while (run[0]>=30) {
+             write_7_2_2(buf, bp, 30);
+             run[0]-=30;
+             if (run[0]>0) theora_write_bits (buf, bp,  bit, 1);
+             else current_bit[0]=-1;
+           }
+         } else { // bit flipped
+           write_7_2_2(buf, bp, run[0]);
+           current_bit[0]=bit;
+           run[0]=len;
+           while (run[0]>=30) {
+             write_7_2_2(buf, bp, 30);
+             run[0]-=30;
+             if (run[0]>0) theora_write_bits (buf, bp,  bit, 1);
+             else current_bit[0]=-1;
+           }
+         }
+       }
+     } 
+   }
+   
+   int theora_frameheader (char       *buf,    // returns length, buf should be big enough - ?? bytes
+                           int         buflen,  // buffer size (returns -1 if fails to fit) - not implemented yet
+                           int         width,   // pixels - will ">>" as needed
+                           int         height,  // pixels - will ">>" as needed
+                           int         frame_flags,   // 0 - intra, 1 - inter(full), 3 - inter (skip according mask)
+                           int         nqis,     // number of qi in a frame (valid 1 or 2)
+                           int         qis[2], // q[0] - high, DC, q[1] - low (AC only)
+                           u_int16_t   mask_array[C333_MAXHEIGHT>>5][C333_MAXWIDTH>>8] //
+                          )
+   {
+  D(fprintf(stderr, "theora_frameheader, frame_flags=%d, nqis=%d, qis[0]=%d,  qis[1]=%d\n",frame_flags,nqis,qis[0],qis[1]));
+   
+   int block_lev[C333_MAXHEIGHT>>6][C333_MAXWIDTH>>8]; // [32][16]
+   int bp=0;
+   int current_bit=-1;
+   int run=0;
+     
+   int nstx=(width  >> 7);
+   int nsty=(height >> 6);
+   int nst=  nsty * nstx;
+   int nsbs= nst  * 12;  // number of all superblocks (32x32)
+   int nsbl= nst  * 8;   // number of luma superblocks
+//   int nsbc= nst  * 2;   // number of superblocks for each color plane
+//   int nbs=  nsbs << 4;  // total number of blocks
+//   int sbpcoded;
+//   int sbfcoded;
+   int x,x8,xf,y,d,d1,d2,c,ncmbs,i;
+   if (nqis>2) return -1;
+   theora_write_bits (buf, &bp,  0,            1); // data packet
+   theora_write_bits (buf, &bp,  frame_flags,  1); // frame type
+   for (i=0; i<nqis; i++) {
+     theora_write_bits (buf, &bp,  qis[0],       6); // high quality, then low one (if present)
+     theora_write_bits (buf, &bp,  (i<(nqis-1))?1:0, 1); // more QIS
+   }
+  D(fprintf(stderr, "qis out - bp=%d\n",bp));
+   if (frame_flags==1) { // inter full
+     put_7_2_1(buf, &bp, &current_bit, &run, 0, nsbs); // no partially coded superblocks;
+     put_7_2_1(buf, &bp, &current_bit, &run, -1, 0); // flush
+     put_7_2_1(buf, &bp, &current_bit, &run, 1, nsbs); // all superblocks fully coded;
+     put_7_2_1(buf, &bp, &current_bit, &run, -1, 0); // flush
+  D(fprintf(stderr, "(1) - bp=%d\n",bp));
+   } else if (frame_flags==3) { // inter - use mask
+     put_7_2_1(buf, &bp, &current_bit, &run, 0, nsbl); // no partially coded superblocks in luma;
+     for (y=0;y<(height>>5);y+=2) for (x=0;x<(width>>5);x+=2) { // build array
+       x8=x>>3;
+       xf= ((x>>1) & 3)<<2;
+       d1= mask_array[y  ][x8]>>xf;
+       d2= mask_array[y+1][x8]>>xf;
+       d= ((d1 & 2)?0:1) | ((d2 & 2)?0:2) | ((d2 & 8)?0:4) | ((d1 & 8)?0:8);
+       block_lev[y>>1][x8] =( (block_lev[y>>1][x8] ^ (d<<xf)) & (0xf << xf)) ^ block_lev[y>>1][x8];
+       put_7_2_1(buf, &bp, &current_bit, &run, ((d!=0) && (d!=0xf))?1:0, 1); // specify partial for Cb
+     }
+  D(fprintf(stderr, "(2) - bp=%d\n",bp));
+     for (y=0;y<(height>>5);y+=2) for (x=0;x<(width>>5);x+=2) { // build array
+       x8=x>>3;
+       xf= ((x>>1) & 3)<<2;
+       d= (block_lev[y>>1][x8]>>xf) & 0xf;
+       put_7_2_1(buf, &bp, &current_bit, &run, ((d!=0) && (d!=0xf))?1:0, 1); // specify partial for Cr
+     }
+     put_7_2_1(buf, &bp, &current_bit, &run, -1, 0); // flush
+// now - fully coded
+// luma first
+  D(fprintf(stderr, "(3) - bp=%d\n",bp));
+     ncmbs=0; // also count number of coded macroblocks (here - groups of 4)
+     for (y=0;y<(height>>5);y++) for (x=0;x<(width>>5);x++) {
+//       put_7_2_1(buf, &bp, &current_bit, &run,((mask_array[y  ][x>>3]>>((x&7)<<1)) & 2)?0:1,1);
+       c=((mask_array[y  ][x>>3]>>((x&7)<<1)) & 2)?0:1;
+       put_7_2_1(buf, &bp, &current_bit, &run,c,1);
+       ncmbs+=c;
+     }  
+// repeat twice - for Cb and Cr
+  D(fprintf(stderr, "(4) - bp=%d\n",bp));
+     for (i=0;i<2;i++) for (y=0;y<(height>>5);y+=2) for (x=0;x<(width>>5);x+=2) {
+       x8=x>>3;
+       xf= ((x>>1) & 3)<<2;
+       d= (block_lev[y>>1][x8]>>xf) & 0xf;
+       put_7_2_1(buf, &bp, &current_bit, &run, (d==0)?1:0, 1); // fully coded
+     }
+     put_7_2_1(buf, &bp, &current_bit, &run, -1, 0); // flush
+// partially coded - repeat twice (for Cb and Cr)
+  D(fprintf(stderr, "(5) - bp=%d\n",bp));
+     
+     for (i=0;i<2;i++) for (y=0;y<(height>>5);y+=2) for (x=0;x<(width>>5);x+=2) { 
+       x8=x>>3;
+       xf= ((x>>1) & 3)<<2;
+       d= (block_lev[y>>1][x8]>>xf) & 0xf;
+       if ((d!=0) && (d!=0xf)) {
+         put_7_2_2(buf, &bp, &current_bit, &run, (d & 1)?0:1, 4); // 4 blocks
+         put_7_2_2(buf, &bp, &current_bit, &run, (d & 2)?0:1, 4); // 4 blocks
+         put_7_2_2(buf, &bp, &current_bit, &run, (d & 4)?0:1, 4); // 4 blocks
+         put_7_2_2(buf, &bp, &current_bit, &run, (d & 8)?0:1, 4); // 4 blocks
+
+       }
+     }
+     put_7_2_1(buf, &bp, &current_bit, &run, -1, 0); // flush
+   } else theora_write_bits (buf, &bp,  0, 3);  // 3 bits 0 for intra only
+   
+  D(fprintf(stderr, "(6) - bp=%d\n",bp));
+
+   if (frame_flags!=0) { // inter any
+     ncmbs=32*nst; // all coded - 32 macroblocks per supertile
+// macroblock coding modes - all INTER_NOMV (0), so using scheme 5 that codes it as a single bit "0"
+  D(fprintf(stderr, "ncmbs=%d\n",ncmbs));
+     theora_write_bits (buf, &bp,  5, 3); // 3 bits - mscheme=5
+     for (;ncmbs>=32;ncmbs-=32) theora_write_bits (buf, &bp,  0, 32); // 32 of coded macroblcks
+     theora_write_bits (buf, &bp,  0, ncmbs); // <32 of coded macroblcks
+  }
+// For all INTER frames one bit MVMODE should be here, even if it is not used (inter_nomv)
+   if (frame_flags!=0) // inter any
+     theora_write_bits (buf, &bp,  0, 1);
+    
+// block-level qi
+  D(fprintf(stderr, "(7) - bp=%d\n",bp));
+   if (nqis>1) {
+// for luma blocks granularity is now 1 superblock (16 blocks) so no need for Hilbert    
+     if (current_bit>=0) return -2; // should be closed
+// now - fully coded
+// luma first
+     for (y=0;y<(height>>5);y++) for (x=0;x<(width>>5);x++) {
+       put_7_2_1(buf, &bp, &current_bit, &run,((mask_array[y  ][x>>3]>>((x&7)<<1)) & 1)?1:0,16);
+     }
+  D(fprintf(stderr, "(8) - bp=%d\n",bp));
+     for (y=0;y<(height>>5);y+=2) for (x=0;x<(width>>5);x+=2) { // process Cb, build array
+       x8=x>>3;
+       xf= ((x>>1) & 3)<<2;
+       d1= mask_array[y  ][x8]>>xf;
+       d2= mask_array[y+1][x8]>>xf;
+       d= ((d1 & 1)?1:0) | ((d2 & 1)?2:0) | ((d2 & 4)?4:0) | ((d1 & 4)?8:0);
+       block_lev[y>>1][x8] ^= (block_lev[y>>1][x8] ^ (d<<xf)) & (0xf << xf);
+       put_7_2_1(buf, &bp, &current_bit, &run, (d    ) & 1, 4);// four blocks with the same qi
+       put_7_2_1(buf, &bp, &current_bit, &run, (d >>1) & 1, 4);// four blocks with the same qi
+       put_7_2_1(buf, &bp, &current_bit, &run, (d >>2) & 1, 4);// four blocks with the same qi
+       put_7_2_1(buf, &bp, &current_bit, &run, (d >>3) & 1, 4);// four blocks with the same qi
+     }
+  D(fprintf(stderr, "(9) - bp=%d\n",bp));
+     for (y=0;y<(height>>5);y+=2) for (x=0;x<(width>>5);x+=2) { // build array
+       x8=x>>3;
+       xf= ((x>>1) & 3)<<2;
+       d= (block_lev[y>>1][x8]>>0xf) & 0xf;
+       put_7_2_1(buf, &bp, &current_bit, &run, (d    ) & 1, 4);// four blocks with the same qi
+       put_7_2_1(buf, &bp, &current_bit, &run, (d >>1) & 1, 4);// four blocks with the same qi
+       put_7_2_1(buf, &bp, &current_bit, &run, (d >>2) & 1, 4);// four blocks with the same qi
+       put_7_2_1(buf, &bp, &current_bit, &run, (d >>3) & 1, 4);// four blocks with the same qi
+     }
+  D(fprintf(stderr, "(10) - bp=%d\n",bp));
+     
+     put_7_2_1(buf, &bp, &current_bit, &run, -1, 0); // flush
+  D(fprintf(stderr, "(11) - bp=%d\n",bp));
+     
+   }
+   return bp;
+  }
+
+
+   void theora_frameheaders(int         width,   // pixels - will ">>" as needed
+                           int         height,  // pixels - will ">>" as needed
+//                           int         frame_flags,   // 0 - intra, 1 - inter(full), 3 - inter (skip according mask)
+                           len_data_t  frame_headers[3],   // [0] - intra, [1] - inter(full), [2] - inter (skip according mask)
+                           int         nqis,     // number of qi in a frame (valid 1 or 2)
+                           int         qis[2], // q[0] - high, DC, q[1] - low (AC only)
+                           u_int16_t   mask_array[C333_MAXHEIGHT>>5][C333_MAXWIDTH>>8] //
+                        )
+    {
+      char * buf;
+      int    i;
+      buf = malloc(64000); //?? maximal size?
+      frame_headers[0].len= theora_frameheader(buf, 64000, width, height, 0, nqis, qis,  mask_array);
+      for (i=frame_headers[0].len; i<(((frame_headers[0].len+31)>>3)& (~0x3)); i++) buf[i]=0;
+      frame_headers[0].data=malloc(((frame_headers[0].len+31)>>3)& (~0x3));
+      memcpy (frame_headers[0].data,buf,((frame_headers[0].len+31)>>3)& (~0x3));
+      
+      frame_headers[1].len= theora_frameheader(buf, 64000, width, height, 1, nqis, qis,  mask_array);
+      for (i=frame_headers[1].len; i<(((frame_headers[1].len+31)>>3)& (~0x3)); i++) buf[i]=0;
+      frame_headers[1].data=malloc(((frame_headers[1].len+31)>>3)& (~0x3));
+      memcpy (frame_headers[1].data,buf,((frame_headers[1].len+31)>>3)& (~0x3));
+
+      frame_headers[2].len= theora_frameheader(buf, 64000, width, height, 3, nqis, qis,  mask_array);
+      for (i=frame_headers[2].len; i<(((frame_headers[2].len+31)>>3)& (~0x3)); i++) buf[i]=0;
+      frame_headers[2].data=malloc(((frame_headers[2].len+31)>>3)& (~0x3));
+      memcpy (frame_headers[2].data,buf,((frame_headers[2].len+31)>>3)& (~0x3));
+    }
+  
+   int theora_write_bits (char * buf, // buffer
+                          int * bp,   // pointer to bit pointer
+                          u_int32_t data,   // data to write
+                          int nb)     // number of bits to write
+   {
+     int i,m, bytp,bitp;
+     if (((*bp | nb) & 7) == 0) { // byte sync not lost
+       for (i=(nb-8); i>=0; i-=8) {
+         buf[(*bp)>>3]=(data>>i) & 0xff;
+         *bp+=8;
+       }
+     } else while (nb>0){ // processing on bit level
+       m= 0xff >> (bitp=((*bp) & 7));
+       bytp=(*bp)>>3;
+       if ((bitp+nb)>=8) {
+         buf[bytp]=((buf[bytp] ^ (data >> (bitp+nb-8))) & m) ^ buf[bytp];
+         *bp=(bytp+1)<<3;
+         nb-=(8-bitp);
+       } else {
+         buf[bytp]=((buf[bytp] ^ (data << (8-bitp-nb))) & m) ^ buf[bytp];
+         *bp+=nb;
+         break;
+       }  
+     }
+    return *bp;                        
+   }
+
+
+
+
+/*Compares two oc_huff_entry structures by their bit patterns.
+  _c1: The first entry to compare.
+  _c2: The second entry to compare.
+  Return: <0 if _c1<_c2, >0 if _c1>_c2.*/
+static int huff_entry_cmp(const void *_c1,const void *_c2){
+  ogg_uint32_t b1;
+  ogg_uint32_t b2;
+  b1=((const oc_huff_entry *)_c1)->pattern;
+  b2=((const oc_huff_entry *)_c2)->pattern;
+  return b1<b2?-1:b1>b2?1:0;
+}
+
+/*Encodes a description of the given Huffman tables.
+  Although the codes are stored in the encoder as flat arrays, in the bit
+   stream and in the decoder they are structured as a tree.
+  This function recovers the tree structure from the flat array and then
+   writes it out.
+  Note that the codes MUST form a Huffman code, and not merely a prefix-free
+   code, since the binary tree is assumed to be full.
+  _opb:   The buffer to store the tree in.
+  _codes: The Huffman tables to pack.
+  Return: 0 on success, or a negative value if one of the given Huffman tables
+   does not form a full, prefix-free code.*/
+
+// used void oggpackB_write(oggpack_buffer *b,unsigned long value,int bits) from theora/libogg-1.1.1/src/bitwise.c
+// it is probably optimized so it will be a good idea to use the library, but now - just some shortcuts.
+//   int theora_write_bits (char * buf, // buffer
+//                          int * bp,   // pointer to bit pointer
+//                          int data,   // data to write
+//                          int nb)     // number of bits to write
+
+   
+//int oc_huff_codes_pack(oggpack_buffer *_opb,
+int oc_huff_codes_pack(char *buf, int* bp,
+ const theora_huff_code _codes[OC_NHUFFMAN_TABLES][OC_NDCT_TOKENS]){
+  int i;
+  for(i=0;i<OC_NHUFFMAN_TABLES;i++){
+    oc_huff_entry entries[OC_NDCT_TOKENS];
+    int           bpos;
+    int           maxlen;
+    int           mask;
+    int           j;
+    /*First, find the maximum code length so we can align all the bit
+       patterns.*/
+    maxlen=_codes[i][0].nbits;
+    for(j=1;j<OC_NDCT_TOKENS;j++){
+      maxlen=OC_MAXI(_codes[i][j].nbits,maxlen);
+    }
+    mask=(1<<maxlen)-1;
+    /*Copy over the codes into our temporary workspace.
+      The bit patterns are aligned, and the original entry each code is from
+       is stored as well.*/
+    for(j=0;j<OC_NDCT_TOKENS;j++){
+      entries[j].shift=maxlen-_codes[i][j].nbits;
+      entries[j].pattern=_codes[i][j].pattern<<entries[j].shift&mask;
+      entries[j].token=j;
+    }
+    /*Sort the codes into ascending order.
+      This is the order the leaves of the tree will be traversed.*/
+    qsort(entries,OC_NDCT_TOKENS,sizeof(entries[0]),huff_entry_cmp);
+    /*For each leaf of the tree:*/
+    bpos=maxlen;
+    for(j=0;j<OC_NDCT_TOKENS;j++){
+      int bit;
+      /*If this code has any bits at all.*/
+      if(entries[j].shift<maxlen){
+        /*Descend into the tree, writing a bit for each branch.*/
+//        for(;bpos>entries[j].shift;bpos--)oggpackB_write(_opb,0,1);
+        for(;bpos>entries[j].shift;bpos--)theora_write_bits(buf,bp,0,1);
+        
+        /*Mark this as a leaf node, and write its value.*/
+//        oggpackB_write(_opb,1,1);
+        theora_write_bits(buf,bp,1,1);
+//        oggpackB_write(_opb,entries[j].token,5);
+        theora_write_bits(buf,bp,entries[j].token,5);
+        /*For each 1 branch we've descended, back up the tree until we reach a
+           0 branch.*/
+        bit=1<<bpos;
+        for(;entries[j].pattern&bit;bpos++)bit<<=1;
+        /*Validate the code.*/
+        if(j+1<OC_NDCT_TOKENS){
+          mask=~(bit-1)<<1;
+          /*The next entry should have a 1 bit where we had a 0, and should
+             match our code above that bit.
+            This verifies both fullness and prefix-freeness simultaneously.*/
+          if(!(entries[j+1].pattern&bit)||
+           (entries[j].pattern&mask)!=(entries[j+1].pattern&mask)){
+            return OC_EINVAL;
+          }
+        }
+        /*If there are no more codes, we should have ascended back to the top
+           of the tree.*/
+        else if(bpos<maxlen)return OC_EINVAL;
+      }
+    }
+  }
+  return 0;
+}
+
+
+// code assumes little endian
+int ogg_page      (ogg_header_t *    ogg_header, // pointer to the header data (returns - header length in bytes)
+                            char     flags,
+                            u_int64_t granule,
+                            u_int32_t stream_serial,
+                            int      page,       // page
+                            int      num_packets, // number of packets in the page
+                   len_data_t *      packets) {
+     int i,n,nn,r;
+     u_int32_t crc_reg;
+     char * c_header= (char *) ogg_header;
+     memcpy (ogg_header->OggS,oggs_string,4);
+     ogg_header->version=        0;
+     ogg_header->serial[0]=      stream_serial & 0xff;
+     ogg_header->serial[1]=      (stream_serial>> 8) & 0xff;
+     ogg_header->serial[2]=      (stream_serial>>16) & 0xff;
+     ogg_header->serial[3]=      (stream_serial>>24) & 0xff;
+     ogg_header->flags=          flags;
+     ogg_header->granule[0]=     granule & 0xff;
+     ogg_header->granule[1]=     (granule>> 8) & 0xff;
+     ogg_header->granule[2]=     (granule>>16) & 0xff;
+     ogg_header->granule[3]=     (granule>>24) & 0xff;
+     ogg_header->granule[4]=     (granule>>32) & 0xff;
+     ogg_header->granule[5]=     (granule>>40) & 0xff;
+     ogg_header->granule[6]=     (granule>>48) & 0xff;
+     ogg_header->granule[7]=     (granule>>56) & 0xff;
+     ogg_header->page[0]=        page & 0xff;
+     ogg_header->page[1]=        (page>> 8) & 0xff;
+     ogg_header->page[2]=        (page>>16) & 0xff;
+     ogg_header->page[3]=        (page>>24) & 0xff;
+     ogg_header->crc[0]=         0;
+     ogg_header->crc[1]=         0;
+     ogg_header->crc[2]=         0;
+     ogg_header->crc[3]=         0;
+// first pass - just fill lacing values/number of segments
+     n=0;
+     for (i=0;i<num_packets; i++) {
+        nn=(packets[i].len/255);
+        r= packets[i].len - 255* nn;
+        nn+=n;
+        if (nn>254)
+            return -1;
+        for (;n<nn;n++)
+            ogg_header->lacing_values[n]=255;
+        ogg_header->lacing_values[n++]=r;
+     }
+     ogg_header->num_segm=       n;
+     // second pass - calculate the crc     
+     crc_reg=0;
+     for (i=0;i<(27+c_header[26]);i++) 
+        crc_reg=(crc_reg<<8)^crc_lookup[((crc_reg >> 24)^c_header[i])&0xff];
+     for (i=0;i<num_packets; i++) {
+       for (n=0;n<packets[i].len;n++) 
+            crc_reg=(crc_reg<<8)^crc_lookup[((crc_reg >> 24)^packets[i].data[n])&0xff];
+     }
+     ogg_header->crc[0]=        crc_reg & 0xff;
+     ogg_header->crc[1]=        (crc_reg>> 8) & 0xff;
+     ogg_header->crc[2]=        (crc_reg>>16) & 0xff;
+     ogg_header->crc[3]=        (crc_reg>>24) & 0xff;
+     return (27+c_header[26]);
+}
+
+// similar to above, but dedicated to the frame data.
+// There could be 2 types
+// - first page of a frame (packet) then frame header will be attached and bit-combined with the frame
+// - continuation  page (flags bit 0 should be set) - then no frame header will be added to the data
+// currently there could not be two frames (packets) on one page
+int ogg_frame_page      (ogg_header_t *    ogg_header,      // pointer to the header data (returns - header length in bytes)
+                            char           flags,           // +1 - continuation, +4 - last (+2 - first)
+                            int            maxpage,         // maximal page size (w/o ogg header)
+                            u_int64_t      granule,         // 
+                            u_int32_t      stream_serial,   //
+                            int            page,            // page
+                            len_data_t     frame_header,    // not used if (flags & 1). frame_header.len is measured in bits, not bytes!
+                            int          * len,             // pointer frame data length (will modify - if non-zero - need continuation)
+                            u_int8_t    ** frame_datap)     // pointer to pointer to an array with frame data
+                                                            // if it is not continuation data is bit-aligned to be combined with frame_header
+                                                            // first word of frame data will be modified - OR-ed with the last one from
+                                                            // the frame_header
+                   
+   {
+     int i,l,n,nn,r;
+     int dl;
+//     unsigned char cmask[4];
+//     u_int32_t  *mask = (u_int32_t *) cmask;
+     u_int8_t   * frame_data = frame_datap[0];
+     u_int32_t  mask;
+     u_int8_t  *cmask= (u_int8_t  *) &mask;
+     u_int32_t  *fh32=  (u_int32_t *) frame_header.data;
+     u_int32_t crc_reg;
+     u_int32_t  *fd32=  (u_int32_t *) frame_data;
+     char * c_header= (char *) ogg_header;
+     u_int64_t  granule0=0;
+//quick fix to modify (up to) last 31 bits of header (not first data word)
+     int        skip_first_data=0;
+D(fprintf(stderr,"ogg_frame_page: flags=%d, page= %d, frame_header.len=%d, len=%d\n",flags, page, frame_header.len, len[0]));
+     memcpy (ogg_header->OggS,oggs_string,4);
+     ogg_header->version=        0;
+     ogg_header->serial[0]=      stream_serial & 0xff;
+     ogg_header->serial[1]=      (stream_serial>> 8) & 0xff;
+     ogg_header->serial[2]=      (stream_serial>>16) & 0xff;
+     ogg_header->serial[3]=      (stream_serial>>24) & 0xff;
+     ogg_header->page[0]=        page & 0xff;
+     ogg_header->page[1]=        (page>> 8) & 0xff;
+     ogg_header->page[2]=        (page>>16) & 0xff;
+     ogg_header->page[3]=        (page>>24) & 0xff;
+     ogg_header->crc[0]=         0;
+     ogg_header->crc[1]=         0;
+     ogg_header->crc[2]=         0;
+     ogg_header->crc[3]=         0;
+
+
+
+    // combine frame_data[0] with the tail of frame_header if needed
+     if ((flags & 1) == 0) { //first page in packet
+      if ((i=(frame_header.len & 0x1f))) {
+        skip_first_data=4;
+        n=0;
+        mask=0;
+        while (i>=8) {cmask[n++]=0xff; i-=8;}
+        cmask[n]=(0xff00 >> i) & 0xff;
+ D(fprintf(stderr,"ogg_frame_page: 0 frame_header.data[0]=0x%x,frame_header.data[1]=0x%x,frame_header.data[2]=0x%x,frame_header.data[3]=0x%x\n",
+ frame_header.data[0],frame_header.data[1],frame_header.data[2],frame_header.data[3]));
+
+D(fprintf(stderr,"ogg_frame_page: 1 mask=0x%x, fd32[0]=0x%x, fh32[frame_header.len>>5]=0x%x\n",mask,fd32[0],fh32[frame_header.len>>5]));
+// modifying header, not data (was a problem with mmap)
+#if 0
+       fd32[0]^= (fd32[0]^fh32[frame_header.len>>5]) & mask;
+D(fprintf(stderr,"ogg_frame_page: 2 mask=0x%x, fd32[0]=0x%x, fh32[frame_header.len>>5]=0x%x\n",mask,fd32[0],fh32[frame_header.len>>5]));
+#else
+       fh32[frame_header.len>>5]^=(fd32[0]^fh32[frame_header.len>>5]) & ~mask;
+#endif
+      }
+     }
+     
+// see if everything will fit on this page
+     l=((flags & 1) == 0)?((frame_header.len>>3)&(~3)):0; // add frame header to the first page in a frame
+     if ((l+len[0])> maxpage) {
+       nn= maxpage/255;
+       dl= 255*nn;
+       nn--;
+       r=255;
+       granule0=~0ULL;
+       ogg_header->flags= flags & 3; //remove "last page" flag
+D(fprintf(stderr,"*"));
+     } else {
+       granule0=granule;
+D(fprintf(stderr," granule0=0x%llx\n",granule0));
+       dl=l+len[0];
+       nn=dl/255;
+       r= dl-255*nn;
+       ogg_header->flags=          flags;
+     }
+//D(fprintf(stderr," granule0=0x%llx\n",granule0));
+     frame_datap[0]+=(dl-l);
+     ogg_header->granule[0]=     granule0 & 0xff;
+     ogg_header->granule[1]=     (granule0>> 8) & 0xff;
+     ogg_header->granule[2]=     (granule0>>16) & 0xff;
+     ogg_header->granule[3]=     (granule0>>24) & 0xff;
+     ogg_header->granule[4]=     (granule0>>32) & 0xff;
+     ogg_header->granule[5]=     (granule0>>40) & 0xff;
+     ogg_header->granule[6]=     (granule0>>48) & 0xff;
+     ogg_header->granule[7]=     (granule0>>56) & 0xff;
+
+
+// first pass - just fill lacing values/number of segments
+D(fprintf(stderr,"            ogg_frame_page: l=%d, len= %d\n",l, len[0]));
+//     if (nn>254) return -1;
+     for (n=0;n<nn;n++) ogg_header->lacing_values[n]=255;
+     ogg_header->lacing_values[n++]=r;
+     ogg_header->num_segm=  n;
+
+
+     
+// second pass - calculate the crc
+     crc_reg=0;
+     for (i=0;i<(27+c_header[26]);i++) crc_reg=(crc_reg<<8)^crc_lookup[((crc_reg >> 24)^c_header[i])&0xff];
+     if ((l+skip_first_data)>0) for (n=0;n<(l+skip_first_data);n++) crc_reg=(crc_reg<<8)^crc_lookup[((crc_reg >> 24)^frame_header.data[n])&0xff];
+     for (n=skip_first_data;n<(dl-l);n++)        crc_reg=(crc_reg<<8)^crc_lookup[((crc_reg >> 24)^frame_data[n])&0xff];
+     
+D(fprintf(stderr,"            ogg_frame_page: l=%d, (dl-l)= %d, n=0x%x\n",l, (dl-l),n));
+D(for (i=0;i<32;i++) fprintf(stderr," %x",frame_data[i]));
+D(fprintf(stderr,"\n"));
+    
+D(for (i=-32;i<0;i++) fprintf(stderr," %x",frame_data[(dl-l)+i]));
+D(fprintf(stderr,"\n"));
+     
+     ogg_header->crc[0]=        crc_reg & 0xff;
+     ogg_header->crc[1]=        (crc_reg>> 8) & 0xff;
+     ogg_header->crc[2]=        (crc_reg>>16) & 0xff;
+     ogg_header->crc[3]=        (crc_reg>>24) & 0xff;
+     len[0]-=(dl-l);
+     return (27+c_header[26]);
+   }
+
+
+
+
+//static const char theora_string[6]={0x74,0x68,0x65,0x6f,0x72,0x61};
+   int theora_identification (char *buf,  // returns length, buf should be big enough - 42 bytes
+                              int   fmbw, // width in macroblocks
+                              int   fmbh, // height in macroblocks
+                              int   frn, // frame rate nominator ( in 1/1000000)
+                              int   frd, // frame rate denominator (1000000)
+                              int   nobr, // nominal bit rate (-1 - undefined?)
+                              int   qual, // relative quality (was 0x10)
+                              int   kfgshift) // number of bits in granule used for number of i-frames
+   {
+     int bp;
+     buf[ 0]=0x80;
+     memcpy (buf+1,theora_string,6);
+     buf[ 7]=0x03;
+     buf[ 8]=0x02;
+     buf[ 9]=0x00;
+     buf[10]=(fmbw >> 8)  & 0xff;
+     buf[11]=fmbw &         0xff;
+     buf[12]=(fmbh >> 8)  & 0xff;
+     buf[13]=fmbh &         0xff;
+     buf[14]=(fmbw >> 12) & 0xff;
+     buf[15]=(fmbw >>  4) & 0xff;
+     buf[16]=(fmbw <<  4) & 0xff;
+     
+     buf[17]=(fmbh >> 12) & 0xff;
+     buf[18]=(fmbh >>  4) & 0xff;
+     buf[19]=(fmbh <<  4) & 0xff;
+     buf[20]=0x00;
+     buf[21]=0x00;
+     buf[22]=(frn >> 24) &0xff;
+     buf[23]=(frn >> 16) &0xff;
+     buf[24]=(frn >>  8) &0xff;
+     buf[25]= frn        &0xff;
+     buf[26]=(frd >> 24) &0xff;
+     buf[27]=(frd >> 16) &0xff;
+     buf[28]=(frd >>  8) &0xff;
+     buf[29]= frd        &0xff;
+     buf[30]= 0; //PARN - 3 bytes
+     buf[31]= 0;
+     buf[32]= 0;
+     buf[33]= 0; //PARD - 3 bytes
+     buf[34]= 0;
+     buf[35]= 0;
+     buf[36]= 0; // color space - "undefined"
+     buf[37]=(nobr >> 16) &0xff;
+     buf[38]=(nobr >>  8) &0xff;
+     buf[39]= nobr        &0xff;
+     bp=40 << 3; // bit pointer
+     theora_write_bits (buf, &bp, qual,6);
+     theora_write_bits (buf, &bp, kfgshift,5);
+     theora_write_bits (buf, &bp, 0,2); // pixel format 4:2:0
+     theora_write_bits (buf, &bp, 0,3); // reserved bits
+     return 42; // length
+   }
+                              
+   int theora_comments (char        *buf,    // returns length, buf should be big enough - ?? bytes
+                        int          buflen,  // buffer size (returns -1 if fails to fit)
+                        const char  *vendor, // Null-terminated string (was "Xiph.Org libTheora I 20040317 3 2 0\0")
+                        int          nuser,   // number of user comments
+                        const char **user)
+   {
+     int b,len,i;
+     if (buflen<15) return -1;
+     buf[ 0]=0x81;
+     memcpy (buf+1,theora_string,6);
+     b=7;
+     len=0; if (vendor) len = strlen(vendor);
+     buf[b++]= len        &0xff; // here - little endian
+     buf[b++]=(len >>  8) &0xff;
+     buf[b++]=(len >> 16) &0xff;
+     buf[b++]=(len >> 24) &0xff;
+     if (len>0) {
+       if (buflen<(b+len+4)) return -1;
+       memcpy (&buf[b],vendor,len);
+       b+=len;
+     }
+     buf[b++]= nuser        &0xff; // here - little endian
+     buf[b++]=(nuser >>  8) &0xff;
+     buf[b++]=(nuser >> 16) &0xff;
+     buf[b++]=(nuser >> 24) &0xff;
+     for (i=0;i<nuser;i++) {
+       len=strlen(user[i]);
+       if (buflen<(b+len+4)) return -1;
+       buf[b++]= len        &0xff; // here - little endian
+       buf[b++]=(len >>  8) &0xff;
+       buf[b++]=(len >> 16) &0xff;
+       buf[b++]=(len >> 24) &0xff;
+       memcpy (&buf[b],user[i],len);
+       b+=len;
+     }
+//  D(fprintf(stderr, "theora_comments b=%d\n",b));
+    return b;    
+   }
+
+   int theora_setup (char       *buf,    // returns length, buf should be big enough - ?? bytes
+                     int         buflen,  // buffer size (returns -1 if fails to fit)
+// the next pointers will likely point to constant tables, the same ones should be used to program FPGA internal tables                     
+                     const int  *lflims,  // if null - skip  alltogether, not null - 5 assumed bits/value
+                     const int  *acscale, // will encode 10bits/item
+                     const int  *dcscale, // will encode 10bits/item
+                     const int  bms[][64]    // array of 3 BMS tables
+                        )
+   {
+     int bp,i,bmi;
+     buf[ 0]=0x82;
+     memcpy (buf+1,theora_string,6);
+     bp=7<<3;
+// Here should go the loop filters - try to skip them alltogether as current FPGAa implementation does not support them
+    if (lflims) {
+     theora_write_bits (buf, &bp, 5,3); // loop filter values are 5 bit long
+     for (i=0;i<64;i++)  theora_write_bits (buf, &bp, lflims[i],5);
+    } else theora_write_bits (buf, &bp, 0,3); // loop filter values are 0 length (so all zeros)
+// now put ACSCALE table
+     theora_write_bits (buf, &bp, 9,4); // ACSCALE table will have 10 bits
+     for (i=0;i<64;i++) theora_write_bits (buf, &bp, acscale[i],10);
+// now put DCSCALE table
+     theora_write_bits (buf, &bp, 9,4); // DCSCALE table will have 10 bits
+     for (i=0;i<64;i++) theora_write_bits (buf, &bp, dcscale[i],10);
+// BMS - counting on standartd VP3 set of 3 base matrices
+     theora_write_bits (buf, &bp, 2,9); // NBMS=3
+     for (bmi=0;bmi<3;bmi++) for (i=0;i<64;i++) theora_write_bits (buf, &bp, bms[bmi][i],8);
+// next tables:
+//NQRS=   {{1,1,1},{1,1,1}}
+//QRSIZES={{63},{63},{63},{63},{63},{63}}
+//QRBMIS{{{0,0},{1,1},{1,1}},{{2,2},{2,2},{2,2}}}
+// Maybe just preencode and put 37 bits?
+     theora_write_bits (buf, &bp,  0,2); // QRBMIS[0][0][0]=0
+     theora_write_bits (buf, &bp, 62,6); // QRSIZES[0][0][0]=63
+     theora_write_bits (buf, &bp,  0,2); // QRBMIS[0][0][1]=0
+     theora_write_bits (buf, &bp,  1,1); // NEWQR=1
+     theora_write_bits (buf, &bp,  1,2); // QRBMIS[0][1][0]=1
+     theora_write_bits (buf, &bp, 62,6); // QRSIZES[0][1][0]=63
+     theora_write_bits (buf, &bp,  1,2); // QRBMIS[0][1][1]=1
+     theora_write_bits (buf, &bp,  0,1); // NEWQR=0:
+                                         //  NQRS[0][2]=NQRS[0][1]=1
+                                         //  QRSIZES[0][2]=QRSIZES[0][1]={63}
+                                         //  QRBMIS[0][2] = QRBMIS[0][1]={1,1}
+     theora_write_bits (buf, &bp,  1,1); // NEWQR=1
+     theora_write_bits (buf, &bp,  2,2); // QRBMIS[1][0][0]=2
+     theora_write_bits (buf, &bp, 62,6); // QRSIZES[1][0][0]=63
+     theora_write_bits (buf, &bp,  2,2); // QRBMIS[1][0][1]=2
+     theora_write_bits (buf, &bp,  0,1); // NEWQR=0
+     theora_write_bits (buf, &bp,  0,1); // (qti>0), so write RPQR=0
+                                         //  NQRS[1][1]=NQRS[1][0]=1
+                                         //  QRSIZES[1][1]=QRSIZES[1][0]={63}
+                                         //  QRBMIS [1][1]=QRBMIS [1][0]={2,2}
+     theora_write_bits (buf, &bp,  0,1); // NEWQR=0
+     theora_write_bits (buf, &bp,  0,1); // (qti>0), so write RPQR=0
+                                         //  NQRS[2][1]=NQRS[1][1]=1
+                                         //  QRSIZES[2][1]=QRSIZES[1][1]={63}
+                                         //  QRBMIS [2][1]=QRBMIS [1][1]={2,2}
+// next - huffman tables                                          
+     if ((i=oc_huff_codes_pack(buf, &bp, OC_VP31_HUFF_CODES))<0) return i;
+// D(fprintf(stderr, "setup bits=%d\n",bp));
+     return (bp>>3)+((bp & 7)? 1:0);
+
+   }
+
+
+//filling out FPGA tables
+  void fill_FPGA_qtable (u_int32_t *table,
+                         int       inter,
+                         int       color,
+                         int       qindex_dc, // always the same in a frame
+                         int       qindex_ac, // may be different if it is a second qi in a frame
+                         int       sharpness)  // 0..2 - common for all q
+{
+     int       zbin_index_dc= (sharpness<<1) | (theora_DCSCALE[qindex_dc]>50)?1:0;// index of zero bin/rounding table to use (table is separate)
+     int       zbin_index_ac= (sharpness<<1) | (theora_DCSCALE[qindex_ac]>50)?1:0;// index of zero bin/rounding table to use (table is separate)
+     int i;
+     int bmi=inter?2:(color?1:0);
+     
+     int mindc= inter? 32 :16;
+     int minac= inter? 16 : 8;
+     int dqcoef  = (((((theora_BMS[bmi][0] * theora_DCSCALE[qindex_dc])/100)<<2) > mindc)?
+         (((theora_BMS[bmi][0] * theora_DCSCALE[qindex_dc])/100)<<2): mindc) & 0xfff;
+     int qcoef   = (524288/dqcoef) & 0xffff;
+ D(fprintf(stderr,"bmi=%d, qindex_dc=%d, qindex_ac=%d, sharpness=%d, zbin_index_dc=%d, zbin_index_ac=%d\n",bmi, qindex_dc, qindex_ac, sharpness,
+             zbin_index_dc,zbin_index_ac));
+     table[0]=(zbin_index_dc<<28) | (dqcoef<<16) | qcoef;
+//  D(fprintf(stderr,"%x/%x=%x ",dqcoef,(524288/dqcoef),table[0]));
+
+// FPGA Quantization table is transposed (at least for now - wil fix later)
+     for (i=1; i<64; i=i+1) {
+       dqcoef  = (((((theora_BMS[bmi][i] * theora_ACSCALE[qindex_ac])/100)<<2) > minac)?
+        (((theora_BMS[bmi][i] * theora_ACSCALE[qindex_ac])/100)<<2): minac) & 0xfff;
+       qcoef   = (524288/dqcoef) & 0xffff;
+       table[i]=(zbin_index_ac<<28) | (dqcoef<<16) | qcoef;
+
+//Changed back - transposed in FPGA
+//       table[((i>>3) & 0x7) | ((i << 3) & 0x38)]=(zbin_index_ac<<28) | (dqcoef<<16) | qcoef;
+//   D(fprintf(stderr,"%x/%x=%x ",dqcoef,(524288/dqcoef),table[i]));
+     }
+   D(fprintf(stderr,"\n"));
+}
+  void fill_FPGA_qtables (
+     u_int32_t  tables[512],
+     int  sharpness,
+     int  intra_y_qi_hi,   // index in DC_Scale/AC_Scale tables, intra frame, luma
+     int  intra_c_qi_hi,   // index in DC_Scale/AC_Scale tables, intra frame, chroma
+     int  inter_y_qi_hi,   // index in DC_Scale/AC_Scale tables, inter frame, luma
+     int  inter_c_qi_hi,   // index in DC_Scale/AC_Scale tables, inter frame, chroma
+
+     int  intra_y_qi_lo,   // index in DC_Scale/AC_Scale tables, intra frame, luma
+     int  intra_c_qi_lo,   // index in DC_Scale/AC_Scale tables, intra frame, chroma
+     int  inter_y_qi_lo,   // index in DC_Scale/AC_Scale tables, inter frame, luma
+     int  inter_c_qi_lo)   // index in DC_Scale/AC_Scale tables, inter frame, chroma
+     {
+       fill_FPGA_qtable (&tables[  0], 0, 0, intra_y_qi_hi, intra_y_qi_hi, sharpness);
+       fill_FPGA_qtable (&tables[128], 0, 1, intra_c_qi_hi, intra_c_qi_hi, sharpness);
+       fill_FPGA_qtable (&tables[256], 1, 0, inter_y_qi_hi, inter_y_qi_hi, sharpness);
+       fill_FPGA_qtable (&tables[384], 1, 1, inter_c_qi_hi, inter_c_qi_hi, sharpness);
+       fill_FPGA_qtable (&tables[ 64], 0, 0, intra_y_qi_hi, intra_y_qi_lo, sharpness);
+       fill_FPGA_qtable (&tables[192], 0, 1, intra_c_qi_hi, intra_c_qi_lo, sharpness);
+       fill_FPGA_qtable (&tables[320], 1, 0, inter_y_qi_hi, inter_y_qi_lo, sharpness);
+       fill_FPGA_qtable (&tables[448], 1, 1, inter_c_qi_hi, inter_c_qi_lo, sharpness);
+     }
+  // {len[3:0],data[13:0]} - data is MSB aligned
+  int fill_FPGA_htables (u_int16_t hti  [12],
+                          u_int16_t hti30[16],
+                          u_int32_t htable[1024],
+                          int       pre_ht[12],
+                          int       pre_ht30[6])
+  {
+     int i,j,k,l,d;                       
+     for (i=0; i<12; i++) hti[i]=pre_ht30[pre_ht[i]];
+     for (i=0; i<16; i++) hti30[i]=7;             // unused
+     for (i=0; i< 6; i++) hti30[pre_ht30[i]] = i; // fill just needed
+     for (i=0; i< 5; i++) for (j=0;j<6;j++) for (k=0;k<32;k++) {
+       l=OC_VP31_HUFF_CODES[(i<<4)+pre_ht30[j]][k].nbits;
+       if (l>14) {fprintf(stderr,"huffman code too long %d > 14 in table %d, token %d\n",
+                  l, (i<<4)+j,k ); return -1;}
+       d=OC_VP31_HUFF_CODES[(i<<4)+pre_ht30[j]][k].pattern  << (14-l);  // only - up to 14 bits long !!!
+       htable[i*192 + (j<<5) +k] = (d & 0x3fff) | (l << 14);
+     }      
+    return 0;
+  }
+           
+
+ // fwrites data to stream, until all sent
+int fwrite_all(FILE *  stream, char * data, int len) {
+    char *cp= data;
+    int   l=0;
+    while (len>0) {
+        if ((l = fwrite(cp, 1,len, stream))<0) return l;
+        len -= l;
+        cp  += l;
+    }  
+    return (cp-data);  
+}
+
+int makeOggTheora(u_int32_t * ccam_dma_index, // will be mmaped array in the camera
+                      u_int8_t  * ccam_dma,       // will be mmaped array in the camera (char array)
+                      FILE *      movie_file,
+                      int         page_size,      // maximal; page size to use
+                      len_data_t  packets[6],     // 0 - identification
+                                                  // 1 - comment
+                                                  // 2 - setup
+                                                  // 3 - frame - intra (.len - in bits, not bytes!)
+                                                  // 4 - frame - inter/full
+                                                  // 5 - frame - inter/mapped
+                      u_int32_t   stream_serial,
+                      int         kfgshiftm       // number of bits in granule used for number of i-frames
+                      ) {
+    
+      ogg_header_t header;
+      int          header_length, fw;
+      u_int64_t    granule=0;
+      u_int64_t    granule_mask=(1<<kfgshiftm)-1;
+      //u_int64_t    next_granule=0;
+      u_int8_t   * dp;
+      u_int8_t   * dp_prev;
+      int          nframe=0;
+      int          frame_start=0;   // in bytes
+      int          next_frame_start;// in bytes
+      int          frame_length;
+      //int          frame_length_written;
+      int          frame_header_length;   // frame header lengh truncated to 32-bit words (the rest is combined with frame data)
+      int          frame_type;      // 0 - intra, 1 - inter/full, 2 - inter/partial
+      int          page=0;
+      int          last_page_flags;
+      int          overlapped_header; // 0/4 - if "4" then bits from the first word of data are already copied to the header
+      int          first_frame=1;
+// first make and send out first two pages (second - with 2 packets)
+    D(fprintf(stderr,"makeOggTheora: stream_serial=0x%x, kfgshiftm=0x%x\n",stream_serial,kfgshiftm));
+
+    header_length= ogg_page (&header, 2, 0, stream_serial, page++, 1, &packets[0]); //42
+    if (header_length<0) return header_length-1000;
+    if ((fw= fwrite_all(movie_file, (char *) &header, header_length))<0) {
+        fprintf(stderr,"error writing output data1 - error = %d (%s)\n",
+                                                         errno,strerror(errno)); 
+        return fw;
+    }
+    if ((fw= fwrite_all(movie_file, packets[0].data, packets[0].len))<0) {
+        fprintf(stderr,"error writing output data2 - error = %d (%s)\n",
+                                                         errno,strerror(errno)); 
+        return fw;
+    }
+    header_length= ogg_page (&header, 0, 0, stream_serial, page++, 2, &packets[1]);
+
+    if (header_length<0) 
+        return header_length-2000;
+    
+    if ((fw= fwrite_all(movie_file, (char *) &header, header_length))<0) {
+        fprintf(stderr,"error writing output data3 - error = %d (%s)\n",
+                                                         errno,strerror(errno)); 
+        return fw;
+    }
+    if ((fw= fwrite_all(movie_file, packets[1].data, packets[1].len))<0) {
+        fprintf(stderr,"error writing output data4 - error = %d (%s)\n",
+                        errno, strerror(errno)); 
+        return fw;
+    }
+    if ((fw= fwrite_all(movie_file, packets[2].data, packets[2].len))<0) {
+        fprintf(stderr,"error writing output data5 - error = %d (%s)\n",
+                        errno,strerror(errno)); 
+        return fw;
+    }
+    // now frames
+    // what kind of an abort command is ths?
+    while (ccam_dma_index[nframe]!=0xffffffff) {
+        D(fprintf(stderr,"++++++++++++++++++++makeOggTheora: ccam_dma_index[%d]=%d(0x%x)\n",nframe,ccam_dma_index[nframe],ccam_dma_index[nframe]));
+      
+        frame_length=(ccam_dma_index[nframe] & 0xfffffff)-frame_start;
+        next_frame_start=((ccam_dma_index[nframe] & 0xfffffff)+63) & (~0x1f);
+        frame_type=(ccam_dma_index[nframe]>>28) & 3;
+#if 0
+        frame_header_length=  (packets[3+frame_type].len>>3)& (~3);
+#else
+        frame_header_length=  ((packets[3+frame_type].len+31)>>3)& (~3);
+        overlapped_header=    (packets[3+frame_type].len & 31)?4:0;
+#endif
+        last_page_flags= (ccam_dma_index[nframe+1]==0xffffffff)?4:0;
+        //next_granule= (granule | (frame_type?0:granule_mask))+1;
+        //granule= (granule | (frame_type?0:granule_mask))+1;
+        dp=&ccam_dma[frame_start];
+        if (first_frame) {
+            first_frame=0;
+        } else if (frame_type==INTRA){
+            //granule= (granule | ((frame_type==0)?granule_mask:0))+1;
+            granule=(granule+ (((granule&granule_mask)+1)<<kfgshiftm)) & (~granule_mask);
+        } else {
+            granule=(granule & (~granule_mask)) |  ((granule+1) &granule_mask);
+        }
+        D(fprintf(stderr,"********************makeOggTheora: nframe=%d, frame_length=%d (0x%x), next_frame_start=%d(0x%x), frame_type=%d\n",
+        nframe,frame_length,frame_length,next_frame_start,next_frame_start,frame_type));
+
+        dp_prev=&ccam_dma[frame_start];
+
+        header_length= ogg_frame_page (&header,                  // pointer to the header data (returns - header length in bytes)
+                                        last_page_flags,         // +1 - continuation, +4 - last (+2 - first)
+                                                                 // "last" will be masked out if needed
+                                        page_size,
+                                        granule,
+                                        stream_serial,
+                                        page++,
+                                        packets[3+frame_type],  // not used if (flags & 1). frame_header.len is measured in bits, not bytes!
+                                        &frame_length,          // frame data length
+                                        &dp);                   // pointer to array with frame data (bytes)
+            
+ D(fprintf(stderr,"----header_length=%d, (dp-dp_prev)=0x%x, dp[0]=%x, dp_prev[0]=%x\n", header_length,(int) (dp-dp_prev),dp[0],dp_prev[0]));
+ D(fprintf(stderr,"----header_length=%d, (dp-dp_prev)=0x%x, dp[1]=%x, dp_prev[1]=%x\n", header_length,(int) (dp-dp_prev),dp[1],dp_prev[1]));
+ D(fprintf(stderr,"----header_length=%d, (dp-dp_prev)=0x%x, dp[2]=%x, dp_prev[2]=%x\n", header_length,(int) (dp-dp_prev),dp[2],dp_prev[2]));
+
+        if (header_length<0) 
+            return header_length-3000;
+        // write to output stream first (or only) page of a frame
+        if ((fw= fwrite_all(movie_file, (char *) &header, header_length))<0) {
+            fprintf(stderr,"error writing output data6 - error = %d (%s)\n",
+                            errno,strerror(errno)); 
+            return fw;
+        }
+        if ((fw= fwrite_all(movie_file, packets[3+frame_type].data, frame_header_length))<0) {
+            fprintf(stderr,"error writing output data7 - error = %d (%s)\n",
+                            errno,strerror(errno)); 
+            return fw;
+        }
+        if ((fw= fwrite_all(movie_file, dp_prev+overlapped_header, (int) (dp-dp_prev-overlapped_header)))<0) {
+            fprintf(stderr,"error writing output data8 - error = %d (%s)\n",
+                            errno,strerror(errno)); 
+            return fw;
+        }
+
+        // see if needed more pages
+        while (frame_length>0) {
+            dp_prev=dp;
+            header_length= ogg_frame_page (&header,               // [1]
+                                           last_page_flags,       // [2]
+                                           page_size,
+                                           granule,
+                                           stream_serial,
+                                           page++,
+                                           packets[3+frame_type], // [3]
+                                           &frame_length,         // [4]
+                                           &dp                    // [5]
+                                          );
+        /*
+         [1] pointer to the header data
+             (returns - header length in bytes)
+         [2] +1 - continuation, +4 - last (+2 - first)
+             "last" will be masked out if needed
+         [3]  not used if (flags & 1). 
+              frame_header.len is measured in bits, not bytes!
+         [4]  frame data length
+         [5]  pointer to array with frame data(bytes)
+        */
+
+ D(fprintf(stderr,"----header_length=%d, (dp-dp_prev)=0x%x, dp[0]=%x, dp_prev[0]=%x\n", header_length,(int) (dp-dp_prev),dp[0],dp_prev[0]));
+ D(fprintf(stderr,"----header_length=%d, (dp-dp_prev)=0x%x, dp[1]=%x, dp_prev[1]=%x\n", header_length,(int) (dp-dp_prev),dp[1],dp_prev[1]));
+ D(fprintf(stderr,"----header_length=%d, (dp-dp_prev)=0x%x, dp[2]=%x, dp_prev[2]=%x\n", header_length,(int) (dp-dp_prev),dp[2],dp_prev[2]));
+
+            // write to output stream other pages of a frame
+            if ((fw= fwrite_all(movie_file, (char *) &header, header_length))<0) {
+                fprintf(stderr,"error writing output data9 - error = %d (%s)\n",
+                                errno,strerror(errno)); 
+                return fw;
+            }
+            if ((fw= fwrite_all(movie_file, dp_prev, (int) (dp-dp_prev)))<0){
+                fprintf(stderr,"error writing output data10 - error = %d (%s)\n",
+                                errno,strerror(errno)); 
+                return fw;
+            }                               
+        }
+        //granule= (granule | (frame_type?0:granule_mask))+1;
+        nframe++;
+        frame_start=next_frame_start;
+    }
+    return 0;
+}
+
+                           
+int oggtheora_prepare (const char *headers_filename, // file to save headers
+                       u_int16_t   fpga_mask[C333_MAXHEIGHT>>5][C333_MAXWIDTH>>8], // [64][16]
+                       u_int32_t   fpga_zerobin[6],
+                       u_int32_t   fpga_qtables[512],
+                       u_int16_t   fpga_hti    [12],
+                       u_int16_t   fpga_hti30  [16],
+                       u_int32_t   fpga_htable [1024],
+                       u_int16_t   fpga_firstbit[4],
+                       int         nstx, //number of supertiles (128x64) horizontal
+                       int         nsty, //number of supertiles (128x64) vertical
+                       int         frn,  // frame rate nominator (1000000=1fps)
+                       int         nobr, // (-1 - "undfined")
+                       int         qual, // realtive quality =16
+                       int         kfgshiftm,
+                       char       *vendor, // "Xiph.Org libTheora I 20040317 3 2 0"
+                       int         nuser,
+                       char      **user,
+// selective qi and skipping blocks is not tested yet
+                       int         qual_left,
+                       int         qual_bottom,
+                       int         qual_right,
+                       int         qual_top,
+                       int         skip_left,
+                       int         skip_bottom,
+                       int         skip_right,
+                       int         skip_top,
+                       int         qis[2], // 0..63 if both are the same, single qi will be encoded
+                       int         sharpness, // 0..2 - is it obsolete in encodr now?
+// table that maps combinbatins of (frame type: 0 - intra, 1  inter whole, 2 - inter, partial (mapped)), AC(/DC) and chroma(/luma)
+// to internal (FPGA) indices (1-of-6 - not 1-of-16 as there is not enough room in FPGA Block RAM) 
+                       int         pre_ht[12],
+// this table maps intenal (1-of-6) Huffman table index to the standard 1-of-16. Not all the tables in the standard set of 80 can work -
+// currently code length is limited to 14 bits
+                       int         pre_ht30[6]){
+//     char       s[1024];
+//     char      *cp;
+//     char      *ep;
+     int        i,d; //j,r;
+     int        fmbw=nstx<<3; // width in macroblocks
+     int        fmbh=nsty<<2; // height in macroblocks
+     const int  frd=1000000;  // frame rate denominator (1000000)
+//     u_int32_t  kfgshiftm;  // number of bits in granule used for number of i-frames
+     char       packet1[44];
+     char       packet2[4096];
+     char       packet3[4096];
+     len_data_t packets[6];
+     
+     int        width = fmbw << 4;
+     int        height= fmbh << 4; 
+     len_data_t frame_headers[3];
+     int        nqis=(qis[1]==qis[0])?1:2;
+     FILE      *ofile;
+     const u_int32_t FPGA_ZEROBIN_TAB[6]={ // Index Sharpness S.Fact>50 Zbin       Round
+                                           0x80a6, //   0       0        0      0.65(166)  0.499(128)
+                                           0x76a6, //   1       0        1      0.65(166)  0.460(118)
+                                           0x7ac0, //   2       1        0      0.75(192)  0.476(122)
+                                           0x66c0, //   3       1        1      0.75(192)  0.400(102)
+                                           0x7ae6, //   4       2        0      0.90(230)  0.476(122)
+                                           0x55e6};//   5       2        1      0.90(230)  0.333( 85)
+     
+     memcpy (fpga_zerobin,FPGA_ZEROBIN_TAB,sizeof(FPGA_ZEROBIN_TAB));
+
+     packets[0].data=packet1; packets[0].len=42;
+     packets[1].data=packet2; packets[1].len=4096;
+     packets[2].data=packet3; packets[2].len=4096;
+     packets[0].len=theora_identification (packets[0].data,fmbw,fmbh,frn,frd, nobr, qual, kfgshiftm); //28
+     if (packets[1].len < 0) return packets[1].len;
+     packets[1].len=theora_comments (packets[1].data, packets[1].len, vendor, nuser, (const char **) user);
+     if (packets[1].len < 0) return packets[1].len;
+     packets[2].len=theora_setup (packets[2].data,packets[2].len, theora_LFLIMS, theora_ACSCALE, theora_DCSCALE, theora_BMS);
+     if (packets[2].len < 0) return packets[2].len;
+     fill_fpga_mask_windows (fpga_mask, width, height, qual_left, qual_bottom, qual_right, qual_top,
+                             skip_left, skip_bottom, skip_right, skip_top);
+     theora_frameheaders (width, height, frame_headers, nqis, qis, fpga_mask); //mask_array);
+     for (i=0;i<3;i++)  fpga_firstbit[i] = frame_headers[i].len & 0x1f;
+ // three different frame headers
+     packets[3].len= frame_headers[0].len;
+     packets[3].data=frame_headers[0].data;
+     packets[4].len= frame_headers[1].len;
+     packets[4].data=frame_headers[1].data;
+     packets[5].len= frame_headers[2].len;
+     packets[5].data=frame_headers[2].data;
+// build quantization tables to be loaded to FPGA
+     fill_FPGA_qtables (fpga_qtables,
+                        sharpness,
+                        qis[0],   // index in DC_Scale/AC_Scale tables, intra frame, luma
+                        qis[0],   // index in DC_Scale/AC_Scale tables, intra frame, chroma
+                        qis[0],   // index in DC_Scale/AC_Scale tables, inter frame, luma
+                        qis[0],   // index in DC_Scale/AC_Scale tables, inter frame, chroma
+
+                        qis[1],   // index in DC_Scale/AC_Scale tables, intra frame, luma
+                        qis[1],   // index in DC_Scale/AC_Scale tables, intra frame, chroma
+                        qis[1],   // index in DC_Scale/AC_Scale tables, inter frame, luma
+                        qis[1]);  // index in DC_Scale/AC_Scale tables, inter frame, chroma
+// build Huffman tables to be loaded to FPGA
+    if ((i=fill_FPGA_htables (fpga_hti, fpga_hti30, fpga_htable, pre_ht, pre_ht30))<0) return -5;
+
+// now save all 6 packets (3 stream headers and 3 different frame headers) in a file.
+// Data will be 32-bit aligned, first word will be 6 (number of packets, then length of each one (in bits!) then packets 32-bit aligned
+  
+    if ((ofile = fopen(headers_filename, "w"))==NULL)
+       {fprintf(stderr,"error opening file %s for writing - error = %d (%s)\n",headers_filename,errno,strerror(errno)); return -1;}
+    d=6;   
+    if (fwrite(&d, 4, 1, ofile)<1) return -2;
+    for (i=0;i<6;i++) {
+       d=packets[i].len;
+       if (i<3) d<<=3; // make them all in bits (first 3 were in bytes)
+       if (fwrite(&d, 4, 1, ofile)<1) return -2;
+    }
+    if (fwrite(&kfgshiftm, 4, 1, ofile)<1) return -2; // save it for the second part - sending clip out
+D(int ii=0;)     
+    for (i=0;i<6;i++) {
+       d=packets[i].len;
+       if (i<3) d<<=3; // make them all in bits (first 3 were in bytes)
+       d= (d+31) >> 5;
+         
+         D(for (ii=0;ii<20;ii++) fprintf(stderr," %x",0xff & packets[i].data[ii]));
+         D(fprintf(stderr,"\n"));
+       if (fwrite(packets[i].data, 4,d, ofile)<(unsigned)d) return -3;
+    }
+    fclose (ofile);
+    for (i=0; i<3; i++) free(frame_headers[i].data);
+    return 0;
+ }
+// now encapsulate compressed data and output stream (to stdout?)
+// The two arrays will be just mmap-ed in the camera
+int oggtheora_send    (const char *headers_filename, // filename of a file with 6 headers and their lengths (in bits)
+                       u_int8_t    ccam_dma      [CCAM_BYTES_PER_DMABUF],
+                       u_int32_t   ccam_dma_index[CCAM_DMA_INDEX_SIZE],
+                       u_int32_t   stream_serial) {
+    int        kfgshiftm=9;
+    len_data_t packets[6];
+    FILE      *headers_file;
+    u_int32_t  num_headers;
+    u_int32_t  header_lengths[6];
+    int        i,r;
+
+    if ((headers_file = fopen(headers_filename, "r"))==NULL) {
+        fprintf(stderr,"error opening file %s for reading - error = %d (%s)\n",
+                                         headers_filename,errno,strerror(errno)); 
+        return -1;
+    }
+    if (fread (&num_headers,   4, 1, headers_file)<1) 
+        return -4;
+    if (num_headers!=6) 
+        return -5;
+    if (fread (header_lengths, 4, 6, headers_file)<6) 
+        return -5;
+    if (fread (&kfgshiftm,     4, 1, headers_file)<1) 
+        return -5;
+
+    for (i=0;i<3;i++) 
+        packets[i].len=header_lengths[i]>>3; // now - in bytes
+    for (i=3;i<6;i++) 
+        packets[i].len=header_lengths[i]; // these are needed to be in bits
+    for (i=0;i<6;i++) {
+        header_lengths[i]=(header_lengths[i]+31)>>5;
+        packets[i].data=malloc(header_lengths[i]<<2);
+        if (((r=fread (packets[i].data, 4, header_lengths[i], headers_file))) < (int)header_lengths[i]) {
+            fprintf(stderr, "i=%d, fread returned %d, wanted - %d\n",i, r,header_lengths[i]);
+            return -6;
+        }     
+    }
+    fclose(headers_file);
+
+    D(fprintf(stderr, "oggtheora_send:stream_serial=%x\n",stream_serial));
+    i= makeOggTheora( ccam_dma_index, // will be mmaped array in the camera
+                      ccam_dma,       // will be mmaped array in the camera (char array)
+                      stdout,         // output stream
+                      8192,           // page_size,      // maximal page size to use
+                      packets,        // headers:
+                                      // 0 - identification
+                                      // 1 - comment
+                                      // 2 - setup
+                                      // 3 - frame - intra (.len - in bits, not bytes!)
+                                      // 4 - frame - inter/full
+                                      // 5 - frame - inter/mapped
+                      stream_serial,
+                      kfgshiftm);        // number of bits in granule used for number of i-frames
+    for (i=0; i<6; i++) 
+        free(packets[i].data);
+    return i;
+}
+
+
+char * fnegets(FILE* fin, char * s) {
+      int i;
+      char * cp;
+      fgets(s, 1024, fin);
+      while ((s[(i=strspn(s," \t\n"))]=='#') || (s[i]==0)) fgets(s, 1024, fin);;
+      cp = s +strspn(s," \t");
+      for (i=strlen(cp)-1;strchr(" \t\n",cp[i]) && (i>0);i--) cp[i]=0;
+return cp;
+}
+
+
+int  setup_tbl_FPGA( int nframes_total,
+             int nframes_inter_full, // number of INTER frames (full) after each INTRA
+                     int nframes_inter_masked, // number of INTER frames (masked) after each INTER full (not tested yet)
+                     int time_slow)   // reduce reported fps by this
+  {
+
+     char       headers_filename[]="/tmp/headers";
+     char       parameters_filename[]="/etc/oggtheora_params";
+     char       controlfn[]="/dev/ccam_img";
+     char       fpga_tables_fn[]="/dev/fpga_tables";
+     char       s[1024];
+     char      *cp;
+     char      *ep;
+     int        i,j; //,r;
+     int        nstx; // width  in superblocks
+     int        nsty; // height in superblocks
+     int        frn; // frame rate nominator ( in 1/1000000)
+     int        nobr; // nominal bit rate (-1 - undefined?)
+     int        qual; // relative quality (was 0x10)
+     int        kfgshiftm=9; // will calculate
+     int        nuser = 1;
+     char      *vendor = NULL;
+     char     **user=NULL;
+     
+     int        qual_left; // all in pixels, high quality will be inside and including the spacified coordinates
+     int        qual_bottom;
+     int        qual_right;
+     int        qual_top;
+     int        skip_left;
+     int        skip_bottom;
+     int        skip_right;
+     int        skip_top;
+     int        nqis;
+     int        qis[2];
+     int  sharpness;       // 0-2 - obsolete now in Theora
+
+     int  pre_ht[12];
+     int  pre_ht30[6];
+    
+
+     u_int16_t   fpga_mask[C333_MAXHEIGHT>>5][C333_MAXWIDTH>>8]; // [64][16]
+     u_int32_t   fpga_zerobin[6];
+     u_int32_t   fpga_qtables[512];
+     u_int16_t   fpga_hti    [12];
+     u_int16_t   fpga_hti30  [16];
+     u_int32_t   fpga_htable [1024];
+     u_int16_t   fpga_firstbit[4];
+
+     int fpga_tables_fd;
+     u_int32_t d[2];
+
+     FILE *ifile;
+     int devfd;
+
+     i= (nframes_inter_masked+1)*nframes_inter_full; // "period-1" of INTRA frames
+     for (kfgshiftm=0;i!=0;i>>=1) kfgshiftm++;
+      if  (kfgshiftm<6) kfgshiftm=6;
+
+
+// read parameters from file, then replace some with current
+     if ((ifile = fopen(parameters_filename, "r"))==NULL)
+        {fprintf(stderr,"error opening file %s for reading - error = %d (%s)\n",parameters_filename,errno,strerror(errno)); return -1;}
+
+     cp=fnegets(ifile,s); nstx=          strtol (cp,&ep,10);
+     cp=fnegets(ifile,s); nsty=          strtol (cp,&ep,10);
+     cp=fnegets(ifile,s); frn=           strtol (cp,&ep,10);
+     cp=fnegets(ifile,s); nobr=          strtol (cp,&ep,10);
+     cp=fnegets(ifile,s); qual=          strtol (cp,&ep,10);
+     vendor= strdup(fnegets(ifile,s));
+     cp=fnegets(ifile,s); nuser=     strtol (cp,&ep,10);
+     if (nuser) {
+       user= (char**) malloc(nuser * sizeof (cp));
+       for (i=0; i<nuser;i++) user[i] = strdup(fnegets(ifile,s));
+     }
+     cp=fnegets(ifile,s); if (cp[0]!='=') { fprintf(stderr, "expecting separator (=) line\n"); return -3;}
+     cp=fnegets(ifile,s); qual_left=     strtol (cp,&ep,10);
+     cp=fnegets(ifile,s); qual_bottom=   strtol (cp,&ep,10);
+     cp=fnegets(ifile,s); qual_right=    strtol (cp,&ep,10);
+     cp=fnegets(ifile,s); qual_top=      strtol (cp,&ep,10);
+     cp=fnegets(ifile,s); skip_left=     strtol (cp,&ep,10);
+     cp=fnegets(ifile,s); skip_bottom=   strtol (cp,&ep,10);
+     cp=fnegets(ifile,s); skip_right=    strtol (cp,&ep,10);
+     cp=fnegets(ifile,s); skip_top=      strtol (cp,&ep,10);
+     cp=fnegets(ifile,s); nqis=          strtol (cp,&ep,10);
+     for (i=0; i<nqis; i++) {cp=fnegets(ifile,s); qis[i]=     strtol (cp,&ep,10);}
+     if (nqis<2) qis[1]=qis[0];
+     cp=fnegets(ifile,s); if (cp[0]!='=') { fprintf(stderr, "expecting separator (=) line\n"); return -3;}
+     cp=fnegets(ifile,s); sharpness=      strtol (cp,&ep,10);
+     cp=fnegets(ifile,s); if (cp[0]!='=') { fprintf(stderr, "expecting separator (=) line\n"); return -3;}
+     ep=fnegets(ifile,s); for (i=0;i<12;i++) { cp=ep; pre_ht[i]=    strtol (cp,&ep,10);}
+     ep=fnegets(ifile,s); for (i=0;i<6; i++) { cp=ep; pre_ht30[i]=  strtol (cp,&ep,10);}
+     cp=fnegets(ifile,s); if (cp[0]!='=') { fprintf(stderr, "expecting separator (=) line\n"); return -3;}
+     fclose (ifile);
+
+// read frame size, frame rate from sensor
+    if ((devfd = open(controlfn, O_RDONLY)) <0)
+      {fprintf(stderr,"error opening file %s for reading - error = %d (%s)\n",controlfn,errno,strerror(errno)); return -1;}
+     nstx=ioctl(devfd, _CCCMD( CCAM_RPARS , P_ACTUAL_WIDTH), 0)>>7;
+     nsty=ioctl(devfd, _CCCMD( CCAM_RPARS , P_ACTUAL_HEIGHT), 0)>>6;
+     frn=(ioctl(devfd, _CCCMD( CCAM_RPARS , P_FP100S), 0)*10000)/time_slow;
+     qis[1]=qis[0]=(ioctl(devfd, _CCCMD( CCAM_RPARS , P_QUALITY), 0)*63)/100;
+     fprintf(stderr,"fps=%d/1000000\r\n",frn);
+    close (devfd);
+ 
+// now prepare headers and FPGA tables
+     i=oggtheora_prepare (headers_filename, // file to save headers
+                       fpga_mask, // [64][16]
+                       fpga_zerobin,
+                       fpga_qtables,
+                       fpga_hti,
+                       fpga_hti30,
+                       fpga_htable,
+                       fpga_firstbit,
+                       nstx, //number of supertiles (128x64) horizontal
+                       nsty, //number of supertiles (128x64) vertical
+                       frn,  // frame rate nominator (1000000=1fps)
+                       nobr, // (-1 - "undfined")
+                       qual, // realtive quality =16
+                       kfgshiftm,
+                       vendor, // "Xiph.Org libTheora I 20040317 3 2 0"
+                       nuser,
+                       user,
+// selective qi and skipping blocks is not tested yet
+                       qual_left,
+                       qual_bottom,
+                       qual_right,
+                       qual_top,
+                       skip_left,
+                       skip_bottom,
+                       skip_right,
+                       skip_top,
+                       qis, // 0..63 if both are the same, single qi will be encoded
+                       sharpness, // 0..2 - is it obsolete in encodr now?
+// table that maps combinbatins of (frame type: 0 - intra, 1  inter whole, 2 - inter, partial (mapped)), AC(/DC) and chroma(/luma)
+// to internal (FPGA) indices (1-of-6 - not 1-of-16 as there is not enough room in FPGA Block RAM) 
+                       pre_ht,
+// this table maps intenal (1-of-6) Huffman table index to the standard 1-of-16. Not all the tables in the standard set of 80 can work -
+// currently code length is limited to 14 bits
+                       pre_ht30);
+// free used stings
+     free(vendor);
+     if (nuser) {
+       for (i=0; i<nuser;i++) free (user[i]);
+       free (user);
+     }
+// write tables to FPGA
+  
+     fpga_tables_fd = open(fpga_tables_fn, O_RDWR);
+     lseek(fpga_tables_fd, 0x400<< 2,0);// 400 - start of zerobin table in fpga
+     write(fpga_tables_fd, fpga_zerobin,6<<2);
+
+     lseek(fpga_tables_fd, 0x0  << 2,0);// qtables
+     for (i=0;i<512;i++) {
+        d[0]=  fpga_qtables[i] & 0xffff;
+        d[1]= (fpga_qtables[i] >> 16) & 0xffff;
+        write(fpga_tables_fd, d,8);
+     }
+     
+     lseek(fpga_tables_fd, 0x1400  << 2,0);// hti
+     for (i=0;i<12;i++)  {
+        d[0]=  fpga_hti[i];
+        write(fpga_tables_fd, d,4);
+     }
+    
+     lseek(fpga_tables_fd, 0x1500  << 2,0);// hti30
+     for (i=0;i<16;i++)  {
+        d[0]=  fpga_hti30[i];
+        write(fpga_tables_fd, d,4);
+     }
+
+     lseek(fpga_tables_fd, 0x1000<< 2,0);// htable
+     write(fpga_tables_fd, fpga_htable,1024<<2);
+
+
+     lseek(fpga_tables_fd, 0x1600  << 2,0);// map
+     for (i=0;i<3; i++)  {
+        d[0]=  fpga_firstbit[i];
+        write(fpga_tables_fd, d,4);
+     }
+
+     lseek(fpga_tables_fd, 0xc00 << 2,0);// firstbit
+     for (i=0;i<(C333_MAXHEIGHT>>5);i++) for (j=0;j<(C333_MAXWIDTH>>8);j++) {
+        d[0]=  fpga_mask[i][j];
+        write(fpga_tables_fd, d,4);
+     }
+     close (fpga_tables_fd);
+     
+return 0;
+}
+ 
+

Added: experimental/j/Elphel333/common/oggtheora.h
===================================================================
--- experimental/j/Elphel333/common/oggtheora.h	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/common/oggtheora.h	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,101 @@
+// Implementation of Theora RTP streaming
+// Copyright 2005 Elphel, Inc
+// Andrey Latin andrey.latin at gmail.com
+
+
+#ifndef __OGGTHEORA_STRM_H_DEF_
+#define __OGGTHEORA_STRM_H_DEF_
+
+typedef enum {
+    INTRA = 0,
+    INTER_FULL = 1,
+    INTER_PARTIAL = 2
+} FrameType;
+
+
+typedef struct {
+  int     len;
+  char *  data;
+} len_data_t;
+
+
+typedef struct {
+  u_int8_t            OggS[4];
+  u_int8_t            version;
+  u_int8_t            flags;
+//  u_int64_t           granule;
+//  u_int32_t           serial;
+//  u_int32_t           page;
+//  u_int32_t           crc;
+  u_int8_t           granule[8];
+  u_int8_t           serial[4];
+  u_int8_t           page[4];
+  u_int8_t           crc[4];
+  u_int8_t           num_segm;
+  u_int8_t           lacing_values [255];
+
+} ogg_header_t;
+
+
+#define C333_MAXWIDTH (4096)
+#define C333_MAXHEIGHT (2048)
+
+
+int oggtheora_prepare (const char *headers_filename, // file to save headers
+                       u_int16_t   fpga_mask[C333_MAXHEIGHT>>5][C333_MAXWIDTH>>8], // [64][16]
+                       u_int32_t   fpga_zerobin[6],
+                       u_int32_t   fpga_qtables[512],
+                       u_int16_t   fpga_hti    [12],
+                       u_int16_t   fpga_hti30  [16],
+                       u_int32_t   fpga_htable [1024],
+                       u_int16_t   fpga_firstbit[4],
+                       int         nstx, //number of supertiles (128x64) horizontal
+                       int         nsty, //number of supertiles (128x64) vertical
+                       int         frn,  // frame rate nominator (1000000=1fps)
+                       int         nobr, // (-1 - "undfined")
+                       int         qual, // realtive quality =16
+                       int         kfgshiftm,
+                       char       *vendor, // "Xiph.Org libTheora I 20040317 3 2 0"
+                       int         nuser,
+                       char      **user,
+// selective qi and skipping blocks is not tested yet
+                       int         qual_left,
+                       int         qual_bottom,
+                       int         qual_right,
+                       int         qual_top,
+                       int         skip_left,
+                       int         skip_bottom,
+                       int         skip_right,
+                       int         skip_top,
+                       int         qis[2], // 0..63 if both are the same, single qi will be encoded
+                       int         sharpness, // 0..2 - is it obsolete in encodr now?
+// table that maps combinbatins of (frame type: 0 - intra, 1  inter whole, 2 - inter, partial (mapped)), AC(/DC) and chroma(/luma)
+// to internal (FPGA) indices (1-of-6 - not 1-of-16 as there is not enough room in FPGA Block RAM) 
+                       int         pre_ht[12],
+// this table maps intenal (1-of-6) Huffman table index to the standard 1-of-16. Not all the tables in the standard set of 80 can work -
+// currently code length is limited to 14 bits
+                       int         pre_ht30[6]);
+
+
+// now encapsulate compressed data and output stream (to stdout?)
+// The two arrays will be just mmap-ed in the camera
+int oggtheora_send    (const char *headers_filename, // filename of a file with 6 headers and their lengths (in bits)
+                       u_int8_t    ccam_dma      [CCAM_BYTES_PER_DMABUF],
+                       u_int32_t   ccam_dma_index[CCAM_DMA_INDEX_SIZE],
+                       u_int32_t   stream_serial);
+
+
+int make_OggTheoraHdrs(const char *headers_filename);
+int fwrite_all(FILE *  stream, char * data, int len); 
+char * fnegets(FILE* fin, char * s);
+int  setup_tbl_FPGA( int nframes_total,
+		     int nframes_inter_full, // number of INTER frames (full) after each INTRA
+                     int nframes_inter_masked, // number of INTER frames (masked) after each INTER full (not tested yet)
+                     int time_slow);   // reduce reported fps by this
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif 
+                      

Added: experimental/j/Elphel333/common/oggtheora_tables.h
===================================================================
--- experimental/j/Elphel333/common/oggtheora_tables.h	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/common/oggtheora_tables.h	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,952 @@
+
+static const u_int32_t crc_lookup[256]={
+  0x00000000,0x04c11db7,0x09823b6e,0x0d4326d9,
+  0x130476dc,0x17c56b6b,0x1a864db2,0x1e475005,
+  0x2608edb8,0x22c9f00f,0x2f8ad6d6,0x2b4bcb61,
+  0x350c9b64,0x31cd86d3,0x3c8ea00a,0x384fbdbd,
+  0x4c11db70,0x48d0c6c7,0x4593e01e,0x4152fda9,
+  0x5f15adac,0x5bd4b01b,0x569796c2,0x52568b75,
+  0x6a1936c8,0x6ed82b7f,0x639b0da6,0x675a1011,
+  0x791d4014,0x7ddc5da3,0x709f7b7a,0x745e66cd,
+  0x9823b6e0,0x9ce2ab57,0x91a18d8e,0x95609039,
+  0x8b27c03c,0x8fe6dd8b,0x82a5fb52,0x8664e6e5,
+  0xbe2b5b58,0xbaea46ef,0xb7a96036,0xb3687d81,
+  0xad2f2d84,0xa9ee3033,0xa4ad16ea,0xa06c0b5d,
+  0xd4326d90,0xd0f37027,0xddb056fe,0xd9714b49,
+  0xc7361b4c,0xc3f706fb,0xceb42022,0xca753d95,
+  0xf23a8028,0xf6fb9d9f,0xfbb8bb46,0xff79a6f1,
+  0xe13ef6f4,0xe5ffeb43,0xe8bccd9a,0xec7dd02d,
+  0x34867077,0x30476dc0,0x3d044b19,0x39c556ae,
+  0x278206ab,0x23431b1c,0x2e003dc5,0x2ac12072,
+  0x128e9dcf,0x164f8078,0x1b0ca6a1,0x1fcdbb16,
+  0x018aeb13,0x054bf6a4,0x0808d07d,0x0cc9cdca,
+  0x7897ab07,0x7c56b6b0,0x71159069,0x75d48dde,
+  0x6b93dddb,0x6f52c06c,0x6211e6b5,0x66d0fb02,
+  0x5e9f46bf,0x5a5e5b08,0x571d7dd1,0x53dc6066,
+  0x4d9b3063,0x495a2dd4,0x44190b0d,0x40d816ba,
+  0xaca5c697,0xa864db20,0xa527fdf9,0xa1e6e04e,
+  0xbfa1b04b,0xbb60adfc,0xb6238b25,0xb2e29692,
+  0x8aad2b2f,0x8e6c3698,0x832f1041,0x87ee0df6,
+  0x99a95df3,0x9d684044,0x902b669d,0x94ea7b2a,
+  0xe0b41de7,0xe4750050,0xe9362689,0xedf73b3e,
+  0xf3b06b3b,0xf771768c,0xfa325055,0xfef34de2,
+  0xc6bcf05f,0xc27dede8,0xcf3ecb31,0xcbffd686,
+  0xd5b88683,0xd1799b34,0xdc3abded,0xd8fba05a,
+  0x690ce0ee,0x6dcdfd59,0x608edb80,0x644fc637,
+  0x7a089632,0x7ec98b85,0x738aad5c,0x774bb0eb,
+  0x4f040d56,0x4bc510e1,0x46863638,0x42472b8f,
+  0x5c007b8a,0x58c1663d,0x558240e4,0x51435d53,
+  0x251d3b9e,0x21dc2629,0x2c9f00f0,0x285e1d47,
+  0x36194d42,0x32d850f5,0x3f9b762c,0x3b5a6b9b,
+  0x0315d626,0x07d4cb91,0x0a97ed48,0x0e56f0ff,
+  0x1011a0fa,0x14d0bd4d,0x19939b94,0x1d528623,
+  0xf12f560e,0xf5ee4bb9,0xf8ad6d60,0xfc6c70d7,
+  0xe22b20d2,0xe6ea3d65,0xeba91bbc,0xef68060b,
+  0xd727bbb6,0xd3e6a601,0xdea580d8,0xda649d6f,
+  0xc423cd6a,0xc0e2d0dd,0xcda1f604,0xc960ebb3,
+  0xbd3e8d7e,0xb9ff90c9,0xb4bcb610,0xb07daba7,
+  0xae3afba2,0xaafbe615,0xa7b8c0cc,0xa379dd7b,
+  0x9b3660c6,0x9ff77d71,0x92b45ba8,0x9675461f,
+  0x8832161a,0x8cf30bad,0x81b02d74,0x857130c3,
+  0x5d8a9099,0x594b8d2e,0x5408abf7,0x50c9b640,
+  0x4e8ee645,0x4a4ffbf2,0x470cdd2b,0x43cdc09c,
+  0x7b827d21,0x7f436096,0x7200464f,0x76c15bf8,
+  0x68860bfd,0x6c47164a,0x61043093,0x65c52d24,
+  0x119b4be9,0x155a565e,0x18197087,0x1cd86d30,
+  0x029f3d35,0x065e2082,0x0b1d065b,0x0fdc1bec,
+  0x3793a651,0x3352bbe6,0x3e119d3f,0x3ad08088,
+  0x2497d08d,0x2056cd3a,0x2d15ebe3,0x29d4f654,
+  0xc5a92679,0xc1683bce,0xcc2b1d17,0xc8ea00a0,
+  0xd6ad50a5,0xd26c4d12,0xdf2f6bcb,0xdbee767c,
+  0xe3a1cbc1,0xe760d676,0xea23f0af,0xeee2ed18,
+  0xf0a5bd1d,0xf464a0aa,0xf9278673,0xfde69bc4,
+  0x89b8fd09,0x8d79e0be,0x803ac667,0x84fbdbd0,
+  0x9abc8bd5,0x9e7d9662,0x933eb0bb,0x97ffad0c,
+  0xafb010b1,0xab710d06,0xa6322bdf,0xa2f33668,
+  0xbcb4666d,0xb8757bda,0xb5365d03,0xb1f740b4};
+
+static const char theora_string[6]={0x74,0x68,0x65,0x6f,0x72,0x61};
+static const char oggs_string[4]=  {0x4f,0x67,0x67,0x53};
+
+
+static const int theora_BMS[3][64]= {
+  {
+     16, 11, 10, 16, 24,  40, 51, 61,
+     12, 12, 14, 19, 26,  58, 60, 55,
+     14, 13, 16, 24, 40,  57, 69, 56,
+     14, 17, 22, 29, 51,  87, 80, 62,
+     18, 22, 37, 58, 68, 109,103, 77,
+     24, 35, 55, 64, 81, 104,113, 92,
+     49, 64, 78, 87,103, 121,120,101,
+     72, 92, 95, 98,112, 100,103, 99
+  },
+  {
+     17, 18, 24, 47, 99, 99, 99, 99,
+     18, 21, 26, 66, 99, 99, 99, 99,
+     24, 26, 56, 99, 99, 99, 99, 99,
+     47, 66, 99, 99, 99, 99, 99, 99,
+     99, 99, 99, 99, 99, 99, 99, 99,
+     99, 99, 99, 99, 99, 99, 99, 99,
+     99, 99, 99, 99, 99, 99, 99, 99,
+     99, 99, 99, 99, 99, 99, 99, 99
+  },
+  {
+     16, 16, 16, 20, 24, 28, 32, 40,
+     16, 16, 20, 24, 28, 32, 40, 48,
+     16, 20, 24, 28, 32, 40, 48, 64,
+     20, 24, 28, 32, 40, 48, 64, 64,
+     24, 28, 32, 40, 48, 64, 64, 64,
+     28, 32, 40, 48, 64, 64, 64, 96,
+     32, 40, 48, 64, 64, 64, 96,128,
+     40, 48, 64, 64, 64, 96,128,128
+  }
+ } ;
+
+static const int theora_DCSCALE[]= {
+    220,200,190,180,170,170,160,160,
+    150,150,140,140,130,130,120,120,
+    110,110,100,100, 90, 90, 90, 80,
+     80, 80, 70, 70, 70, 60, 60, 60,
+     60, 50, 50, 50, 50, 40, 40, 40,
+     40, 40, 30, 30, 30, 30, 30, 30,
+     30, 20, 20, 20, 20, 20, 20, 20,
+     20, 10, 10, 10, 10, 10, 10, 10
+  };
+static const int theora_ACSCALE[]= {
+    500,450,400,370,340,310,285,265,
+    245,225,210,195,185,180,170,160,
+    150,145,135,130,125,115,110,107,
+    100, 96, 93, 89, 85, 82, 75, 74,
+     70, 68, 64, 60, 57, 56, 52, 50,
+     49, 45, 44, 43, 40, 38, 37, 35,
+     33, 32, 30, 29, 28, 25, 24, 22,
+     21, 19, 18, 17, 15, 13, 12, 10
+  };
+#if 0  
+static const int theora_LFLIMS[]= { // not used now
+    30,25,20,20,15,15,14,14,
+    13,13,12,12,11,11,10,10,
+     9, 9, 8, 8, 7, 7, 7, 7,
+     6, 6, 6, 6, 5, 5, 5, 5,
+     4, 4, 4, 4, 3, 3, 3, 3,
+     2, 2, 2, 2, 2, 2, 2, 2,
+     0, 0, 0, 0, 0, 0, 0, 0,
+     0, 0, 0, 0, 0, 0, 0, 0
+  };
+#else
+static const int theora_LFLIMS[]= { // not used now
+     0, 0, 0, 0, 0, 0, 0, 0,
+     0, 0, 0, 0, 0, 0, 0, 0,
+     0, 0, 0, 0, 0, 0, 0, 0,
+     0, 0, 0, 0, 0, 0, 0, 0,
+     0, 0, 0, 0, 0, 0, 0, 0,
+     0, 0, 0, 0, 0, 0, 0, 0,
+     0, 0, 0, 0, 0, 0, 0, 0,
+     0, 0, 0, 0, 0, 0, 0, 0
+  };
+#endif
+/*The default Huffman codes used for VP3.1.*/
+// value, length - ordered in token number order
+const theora_huff_code OC_VP31_HUFF_CODES[OC_NHUFFMAN_TABLES][OC_NDCT_TOKENS]={
+  {
+    {0x002D, 6},{0x0026, 7},{0x0166, 9},{0x004E, 8},
+    {0x02CE,10},{0x059E,11},{0x027D,11},{0x0008, 5},
+    {0x04F9,12},{0x000F, 4},{0x000E, 4},{0x001B, 5},
+    {0x0006, 4},{0x0008, 4},{0x0005, 4},{0x001A, 5},
+    {0x0015, 5},{0x0007, 4},{0x000C, 4},{0x0001, 3},
+    {0x0000, 3},{0x0009, 4},{0x0017, 5},{0x0029, 6},
+    {0x0028, 6},{0x00B2, 8},{0x04F8,12},{0x059F,11},
+    {0x009E, 9},{0x013F,10},{0x0012, 6},{0x0058, 7}
+  },
+  {
+    {0x0010, 5},{0x0047, 7},{0x01FF, 9},{0x008C, 8},
+    {0x03FC,10},{0x046A,11},{0x0469,11},{0x0022, 6},
+    {0x11A1,13},{0x000E, 4},{0x000D, 4},{0x0004, 4},
+    {0x0005, 4},{0x0009, 4},{0x0006, 4},{0x001E, 5},
+    {0x0016, 5},{0x0007, 4},{0x000C, 4},{0x0001, 3},
+    {0x0000, 3},{0x000A, 4},{0x0017, 5},{0x007D, 7},
+    {0x007E, 7},{0x011B, 9},{0x08D1,12},{0x03FD,10},
+    {0x046B,11},{0x11A0,13},{0x007C, 7},{0x00FE, 8}
+  },
+  {
+    {0x0016, 5},{0x0020, 6},{0x0086, 8},{0x0087, 8},
+    {0x0367,10},{0x06CC,11},{0x06CB,11},{0x006E, 7},
+    {0x366D,14},{0x000F, 4},{0x000E, 4},{0x0004, 4},
+    {0x0005, 4},{0x000A, 4},{0x0006, 4},{0x001A, 5},
+    {0x0011, 5},{0x0007, 4},{0x000C, 4},{0x0001, 3},
+    {0x0000, 3},{0x0009, 4},{0x0017, 5},{0x006F, 7},
+    {0x006D, 7},{0x0364,10},{0x0D9A,12},{0x06CA,11},
+    {0x1B37,13},{0x366C,14},{0x0042, 7},{0x00D8, 8}
+  },
+  {
+    {0x0000, 4},{0x002D, 6},{0x00F7, 8},{0x0058, 7},
+    {0x0167, 9},{0x02CB,10},{0x02CA,10},{0x000E, 6},
+    {0x1661,13},{0x0003, 3},{0x0002, 3},{0x0008, 4},
+    {0x0009, 4},{0x000D, 4},{0x0002, 4},{0x001F, 5},
+    {0x0017, 5},{0x0001, 4},{0x000C, 4},{0x000E, 4},
+    {0x000A, 4},{0x0006, 5},{0x0078, 7},{0x000F, 6},
+    {0x007A, 7},{0x0164, 9},{0x0599,11},{0x02CD,10},
+    {0x0B31,12},{0x1660,13},{0x0079, 7},{0x00F6, 8}
+  },
+  {
+    {0x0003, 4},{0x003C, 6},{0x000F, 7},{0x007A, 7},
+    {0x001D, 8},{0x0020, 9},{0x0072,10},{0x0006, 6},
+    {0x0399,13},{0x0004, 3},{0x0005, 3},{0x0005, 4},
+    {0x0006, 4},{0x000E, 4},{0x0004, 4},{0x0000, 4},
+    {0x0019, 5},{0x0002, 4},{0x000D, 4},{0x0007, 4},
+    {0x001F, 5},{0x0030, 6},{0x0011, 8},{0x0031, 6},
+    {0x0005, 6},{0x0021, 9},{0x00E7,11},{0x0038, 9},
+    {0x01CD,12},{0x0398,13},{0x007B, 7},{0x0009, 7}
+  },
+  {
+    {0x0009, 4},{0x0002, 5},{0x0074, 7},{0x0007, 6},
+    {0x00EC, 8},{0x00D1, 9},{0x01A6,10},{0x0006, 6},
+    {0x0D21,13},{0x0005, 3},{0x0006, 3},{0x0008, 4},
+    {0x0007, 4},{0x000F, 4},{0x0004, 4},{0x0000, 4},
+    {0x001C, 5},{0x0002, 4},{0x0005, 4},{0x0003, 4},
+    {0x000C, 5},{0x0035, 7},{0x01A7,10},{0x001B, 6},
+    {0x0077, 7},{0x01A5,10},{0x0349,11},{0x00D0, 9},
+    {0x0691,12},{0x0D20,13},{0x0075, 7},{0x00ED, 8}
+  },
+  {
+    {0x000A, 4},{0x000C, 5},{0x0012, 6},{0x001B, 6},
+    {0x00B7, 8},{0x016C, 9},{0x0099, 9},{0x005A, 7},
+    {0x16D8,13},{0x0007, 3},{0x0006, 3},{0x0009, 4},
+    {0x0008, 4},{0x0000, 3},{0x0005, 4},{0x0017, 5},
+    {0x000E, 5},{0x0002, 4},{0x0003, 4},{0x000F, 5},
+    {0x001A, 6},{0x004D, 8},{0x2DB3,14},{0x002C, 6},
+    {0x0011, 6},{0x02DA,10},{0x05B7,11},{0x0098, 9},
+    {0x0B6D,12},{0x2DB2,14},{0x0010, 6},{0x0027, 7}
+  },
+  {
+    {0x000D, 4},{0x000F, 5},{0x001D, 6},{0x0008, 5},
+    {0x0051, 7},{0x0056, 8},{0x00AF, 9},{0x002A, 7},
+    {0x148A,13},{0x0007, 3},{0x0000, 2},{0x0008, 4},
+    {0x0009, 4},{0x000C, 4},{0x0006, 4},{0x0017, 5},
+    {0x000B, 5},{0x0016, 5},{0x0015, 5},{0x0009, 5},
+    {0x0050, 7},{0x00AE, 9},{0x2917,14},{0x001C, 6},
+    {0x0014, 6},{0x0290,10},{0x0523,11},{0x0149, 9},
+    {0x0A44,12},{0x2916,14},{0x0053, 7},{0x00A5, 8}
+  },
+  {
+    {0x0001, 4},{0x001D, 6},{0x00F5, 8},{0x00F4, 8},
+    {0x024D,10},{0x0499,11},{0x0498,11},{0x0001, 5},
+    {0x0021, 6},{0x0006, 3},{0x0005, 3},{0x0006, 4},
+    {0x0005, 4},{0x0002, 4},{0x0007, 5},{0x0025, 6},
+    {0x007B, 7},{0x001C, 6},{0x0020, 6},{0x000D, 6},
+    {0x0048, 7},{0x0092, 8},{0x0127, 9},{0x000E, 4},
+    {0x0004, 4},{0x0011, 5},{0x000C, 6},{0x003C, 6},
+    {0x000F, 5},{0x0000, 5},{0x001F, 5},{0x0013, 5}
+  },
+  {
+    {0x0005, 4},{0x003C, 6},{0x0040, 7},{0x000D, 7},
+    {0x0031, 9},{0x0061,10},{0x0060,10},{0x0002, 5},
+    {0x00F5, 8},{0x0006, 3},{0x0005, 3},{0x0007, 4},
+    {0x0006, 4},{0x0002, 4},{0x0009, 5},{0x0025, 6},
+    {0x0007, 6},{0x0021, 6},{0x0024, 6},{0x0010, 6},
+    {0x0041, 7},{0x00F4, 8},{0x0019, 8},{0x000E, 4},
+    {0x0003, 4},{0x0011, 5},{0x0011, 6},{0x003F, 6},
+    {0x003E, 6},{0x007B, 7},{0x0000, 4},{0x0013, 5}
+  },
+  {
+    {0x000A, 4},{0x0007, 5},{0x0001, 6},{0x0009, 6},
+    {0x0131, 9},{0x0261,10},{0x0260,10},{0x0015, 6},
+    {0x0001, 7},{0x0007, 3},{0x0006, 3},{0x0008, 4},
+    {0x0007, 4},{0x0006, 4},{0x0012, 5},{0x002F, 6},
+    {0x0014, 6},{0x0027, 6},{0x002D, 6},{0x0016, 6},
+    {0x004D, 7},{0x0099, 8},{0x0000, 7},{0x0004, 4},
+    {0x0001, 4},{0x0005, 5},{0x0017, 6},{0x002E, 6},
+    {0x002C, 6},{0x0008, 6},{0x0006, 5},{0x0001, 5}
+  },
+  {
+    {0x0000, 3},{0x000E, 5},{0x0017, 6},{0x002A, 6},
+    {0x0010, 7},{0x00F9,10},{0x00F8,10},{0x001E, 7},
+    {0x003F, 8},{0x0007, 3},{0x0006, 3},{0x0009, 4},
+    {0x0008, 4},{0x0006, 4},{0x000F, 5},{0x0005, 5},
+    {0x0016, 6},{0x0029, 6},{0x002B, 6},{0x0015, 6},
+    {0x0050, 7},{0x0011, 7},{0x007D, 9},{0x0004, 4},
+    {0x0017, 5},{0x0006, 5},{0x0014, 6},{0x002C, 6},
+    {0x002D, 6},{0x000E, 6},{0x0009, 6},{0x0051, 7}
+  },
+  {
+    {0x0002, 3},{0x0018, 5},{0x002F, 6},{0x000D, 5},
+    {0x0053, 7},{0x0295,10},{0x0294,10},{0x00A4, 8},
+    {0x007C, 8},{0x0000, 2},{0x0007, 3},{0x0009, 4},
+    {0x0008, 4},{0x001B, 5},{0x000C, 5},{0x0028, 6},
+    {0x006A, 7},{0x001E, 6},{0x001D, 6},{0x0069, 7},
+    {0x00D7, 8},{0x007D, 8},{0x014B, 9},{0x0019, 5},
+    {0x0016, 5},{0x002E, 6},{0x001C, 6},{0x002B, 6},
+    {0x002A, 6},{0x0068, 7},{0x003F, 7},{0x00D6, 8}
+  },
+  {
+    {0x0002, 3},{0x001B, 5},{0x000C, 5},{0x0018, 5},
+    {0x0029, 6},{0x007F, 8},{0x02F0,10},{0x0198, 9},
+    {0x0179, 9},{0x0000, 2},{0x0007, 3},{0x0009, 4},
+    {0x0008, 4},{0x001A, 5},{0x000D, 5},{0x002A, 6},
+    {0x0064, 7},{0x001E, 6},{0x0067, 7},{0x005F, 7},
+    {0x00CD, 8},{0x007E, 8},{0x02F1,10},{0x0016, 5},
+    {0x000E, 5},{0x002E, 6},{0x0065, 7},{0x002B, 6},
+    {0x0028, 6},{0x003E, 7},{0x00BD, 8},{0x0199, 9}
+  },
+  {
+    {0x0002, 3},{0x0007, 4},{0x0016, 5},{0x0006, 4},
+    {0x0036, 6},{0x005C, 7},{0x015D, 9},{0x015C, 9},
+    {0x02BF,10},{0x0000, 2},{0x0007, 3},{0x0009, 4},
+    {0x0008, 4},{0x0018, 5},{0x0034, 6},{0x002A, 6},
+    {0x005E, 7},{0x006A, 7},{0x0064, 7},{0x005D, 7},
+    {0x00CB, 8},{0x00AD, 8},{0x02BE,10},{0x0014, 5},
+    {0x0033, 6},{0x006E, 7},{0x005F, 7},{0x006F, 7},
+    {0x006B, 7},{0x00CA, 8},{0x00AC, 8},{0x015E, 9}
+  },
+  {
+    {0x000F, 4},{0x001D, 5},{0x0018, 5},{0x000B, 4},
+    {0x0019, 5},{0x0029, 6},{0x00D6, 8},{0x0551,11},
+    {0x0AA1,12},{0x0001, 2},{0x0000, 2},{0x0009, 4},
+    {0x0008, 4},{0x001B, 5},{0x0038, 6},{0x0028, 6},
+    {0x0057, 7},{0x006A, 7},{0x0068, 7},{0x0056, 7},
+    {0x00E5, 8},{0x0155, 9},{0x0AA0,12},{0x0073, 7},
+    {0x0069, 7},{0x00D7, 8},{0x00AB, 8},{0x00E4, 8},
+    {0x00A9, 8},{0x0151, 9},{0x0150, 9},{0x02A9,10}
+  },
+  {
+    {0x0008, 5},{0x0025, 7},{0x017A, 9},{0x02F7,10},
+    {0x0BDB,12},{0x17B4,13},{0x2F6B,14},{0x001D, 5},
+    {0x2F6A,14},{0x0008, 4},{0x0007, 4},{0x0001, 4},
+    {0x0002, 4},{0x000A, 4},{0x0006, 4},{0x0000, 4},
+    {0x001C, 5},{0x0009, 4},{0x000D, 4},{0x000F, 4},
+    {0x000C, 4},{0x0003, 4},{0x000A, 5},{0x0016, 5},
+    {0x0013, 6},{0x005D, 7},{0x0024, 7},{0x00BC, 8},
+    {0x005C, 7},{0x05EC,11},{0x000B, 5},{0x005F, 7}
+  },
+  {
+    {0x000F, 5},{0x0010, 6},{0x004B, 8},{0x00C6, 8},
+    {0x031D,10},{0x0C71,12},{0x0C70,12},{0x0001, 4},
+    {0x0C73,12},{0x0008, 4},{0x0009, 4},{0x0002, 4},
+    {0x0003, 4},{0x000B, 4},{0x0006, 4},{0x0000, 4},
+    {0x001C, 5},{0x0005, 4},{0x000D, 4},{0x000F, 4},
+    {0x000A, 4},{0x0019, 5},{0x0013, 6},{0x001D, 5},
+    {0x0030, 6},{0x0062, 7},{0x0024, 7},{0x004A, 8},
+    {0x018F, 9},{0x0C72,12},{0x000E, 5},{0x0011, 6}
+  },
+  {
+    {0x001B, 5},{0x0003, 6},{0x008D, 8},{0x0040, 7},
+    {0x0239,10},{0x0471,11},{0x08E0,12},{0x0003, 4},
+    {0x11C3,13},{0x000A, 4},{0x0009, 4},{0x0004, 4},
+    {0x0005, 4},{0x000E, 4},{0x0007, 4},{0x0001, 4},
+    {0x001E, 5},{0x0006, 4},{0x000C, 4},{0x000B, 4},
+    {0x0002, 4},{0x0000, 5},{0x0041, 7},{0x001F, 5},
+    {0x0022, 6},{0x0002, 6},{0x008F, 8},{0x008C, 8},
+    {0x011D, 9},{0x11C2,13},{0x001A, 5},{0x0021, 6}
+  },
+  {
+    {0x001F, 5},{0x0003, 6},{0x0003, 7},{0x0043, 7},
+    {0x000B, 9},{0x0015,10},{0x0051,12},{0x0003, 4},
+    {0x0050,12},{0x000D, 4},{0x000C, 4},{0x0004, 4},
+    {0x0006, 4},{0x000E, 4},{0x000A, 4},{0x0001, 4},
+    {0x001E, 5},{0x0005, 4},{0x0009, 4},{0x0007, 4},
+    {0x0011, 5},{0x0002, 6},{0x0004, 8},{0x0002, 4},
+    {0x002D, 6},{0x0020, 6},{0x0042, 7},{0x0001, 7},
+    {0x0000, 7},{0x0029,11},{0x0017, 5},{0x002C, 6}
+  },
+  {
+    {0x0003, 4},{0x001F, 6},{0x003A, 7},{0x005D, 7},
+    {0x0173, 9},{0x02E4,10},{0x172D,13},{0x0004, 4},
+    {0x172C,13},{0x000F, 4},{0x000E, 4},{0x0009, 4},
+    {0x0008, 4},{0x000C, 4},{0x000A, 4},{0x0001, 4},
+    {0x0016, 5},{0x0002, 4},{0x0005, 4},{0x001A, 5},
+    {0x002F, 6},{0x0038, 7},{0x05CA,11},{0x0006, 4},
+    {0x0037, 6},{0x001E, 6},{0x003B, 7},{0x0039, 7},
+    {0x00B8, 8},{0x0B97,12},{0x0000, 4},{0x0036, 6}
+  },
+  {
+    {0x0006, 4},{0x0037, 6},{0x005D, 7},{0x000C, 6},
+    {0x00B9, 8},{0x02E3,10},{0x05C4,11},{0x0004, 4},
+    {0x1715,13},{0x0000, 3},{0x000F, 4},{0x0008, 4},
+    {0x0007, 4},{0x000C, 4},{0x0009, 4},{0x001D, 5},
+    {0x0016, 5},{0x001C, 5},{0x001A, 5},{0x000B, 5},
+    {0x005E, 7},{0x0170, 9},{0x1714,13},{0x000A, 4},
+    {0x000A, 5},{0x0036, 6},{0x005F, 7},{0x001B, 7},
+    {0x001A, 7},{0x0B8B,12},{0x0002, 4},{0x0007, 5}
+  },
+  {
+    {0x000C, 4},{0x000B, 5},{0x0079, 7},{0x0022, 6},
+    {0x00F0, 8},{0x0119, 9},{0x0230,10},{0x001D, 5},
+    {0x08C4,12},{0x0001, 3},{0x0000, 3},{0x000A, 4},
+    {0x0009, 4},{0x000B, 4},{0x0007, 4},{0x001C, 5},
+    {0x003D, 6},{0x000D, 5},{0x0008, 5},{0x0015, 6},
+    {0x008D, 8},{0x118B,13},{0x118A,13},{0x000D, 4},
+    {0x0010, 5},{0x0009, 5},{0x0014, 6},{0x0047, 7},
+    {0x00F1, 8},{0x0463,11},{0x001F, 5},{0x000C, 5}
+  },
+  {
+    {0x0000, 3},{0x001A, 5},{0x0033, 6},{0x000C, 5},
+    {0x0046, 7},{0x01E3, 9},{0x03C5,10},{0x0017, 5},
+    {0x1E21,13},{0x0002, 3},{0x0001, 3},{0x0009, 4},
+    {0x000A, 4},{0x0007, 4},{0x001B, 5},{0x003D, 6},
+    {0x001B, 6},{0x0022, 6},{0x0079, 7},{0x00F0, 8},
+    {0x1E20,13},{0x1E23,13},{0x1E22,13},{0x000E, 4},
+    {0x0016, 5},{0x0018, 5},{0x0032, 6},{0x001A, 6},
+    {0x0047, 7},{0x0789,11},{0x001F, 5},{0x0010, 5}
+  },
+  {
+    {0x001D, 5},{0x0061, 7},{0x004E, 8},{0x009E, 9},
+    {0x027C,11},{0x09F5,13},{0x09F4,13},{0x0003, 4},
+    {0x0060, 7},{0x0000, 3},{0x000F, 4},{0x000B, 4},
+    {0x000A, 4},{0x0009, 4},{0x0005, 4},{0x000D, 5},
+    {0x0031, 6},{0x0008, 5},{0x0038, 6},{0x0012, 6},
+    {0x0026, 7},{0x013F,10},{0x04FB,12},{0x000D, 4},
+    {0x0002, 4},{0x000C, 5},{0x0039, 6},{0x001C, 6},
+    {0x000F, 5},{0x001D, 6},{0x0008, 4},{0x0019, 5}
+  },
+  {
+    {0x0007, 4},{0x0019, 6},{0x00AB, 8},{0x00AA, 8},
+    {0x0119,10},{0x0461,12},{0x0460,12},{0x001B, 5},
+    {0x0047, 8},{0x0001, 3},{0x0000, 3},{0x000C, 4},
+    {0x000B, 4},{0x0009, 4},{0x0005, 4},{0x000D, 5},
+    {0x0035, 6},{0x003D, 6},{0x003C, 6},{0x0018, 6},
+    {0x0022, 7},{0x008D, 9},{0x0231,11},{0x000E, 4},
+    {0x001F, 5},{0x0009, 5},{0x002B, 6},{0x0010, 6},
+    {0x0034, 6},{0x0054, 7},{0x0008, 4},{0x0014, 5}
+  },
+  {
+    {0x000C, 4},{0x0005, 5},{0x0008, 6},{0x005B, 7},
+    {0x004D, 9},{0x0131,11},{0x0261,12},{0x001A, 5},
+    {0x0012, 7},{0x0000, 3},{0x000F, 4},{0x000A, 4},
+    {0x0009, 4},{0x0006, 4},{0x001B, 5},{0x0006, 5},
+    {0x001C, 6},{0x002C, 6},{0x0015, 6},{0x005A, 7},
+    {0x0027, 8},{0x0099,10},{0x0260,12},{0x000E, 4},
+    {0x0004, 4},{0x000F, 5},{0x0007, 5},{0x001D, 6},
+    {0x000B, 5},{0x0014, 6},{0x0008, 4},{0x0017, 5}
+  },
+  {
+    {0x000F, 4},{0x0013, 5},{0x0075, 7},{0x0024, 6},
+    {0x0095, 8},{0x0251,10},{0x04A0,11},{0x0010, 5},
+    {0x00C8, 8},{0x0002, 3},{0x0001, 3},{0x0001, 4},
+    {0x0000, 4},{0x001A, 5},{0x0011, 5},{0x002C, 6},
+    {0x0065, 7},{0x0074, 7},{0x004B, 7},{0x00C9, 8},
+    {0x0129, 9},{0x0943,12},{0x0942,12},{0x0003, 3},
+    {0x000A, 4},{0x001C, 5},{0x0018, 5},{0x0033, 6},
+    {0x0017, 5},{0x002D, 6},{0x001B, 5},{0x003B, 6}
+  },
+  {
+    {0x0003, 3},{0x001A, 5},{0x002D, 6},{0x0038, 6},
+    {0x0028, 7},{0x0395,10},{0x0E51,12},{0x0037, 6},
+    {0x00E4, 8},{0x0001, 3},{0x0000, 3},{0x001F, 5},
+    {0x001E, 5},{0x0017, 5},{0x003A, 6},{0x0073, 7},
+    {0x002A, 7},{0x002B, 7},{0x0029, 7},{0x01CB, 9},
+    {0x0729,11},{0x1CA1,13},{0x1CA0,13},{0x0004, 3},
+    {0x000A, 4},{0x0004, 4},{0x0018, 5},{0x0036, 6},
+    {0x000B, 5},{0x002C, 6},{0x0019, 5},{0x003B, 6}
+  },
+  {
+    {0x0004, 3},{0x0004, 4},{0x003F, 6},{0x0017, 5},
+    {0x0075, 7},{0x01F5, 9},{0x07D1,11},{0x0017, 6},
+    {0x01F6, 9},{0x0001, 3},{0x0000, 3},{0x001B, 5},
+    {0x001A, 5},{0x000A, 5},{0x0032, 6},{0x0074, 7},
+    {0x00F8, 8},{0x00F9, 8},{0x01F7, 9},{0x03E9,10},
+    {0x0FA0,12},{0x1F43,13},{0x1F42,13},{0x0003, 3},
+    {0x000A, 4},{0x001E, 5},{0x001C, 5},{0x003B, 6},
+    {0x0018, 5},{0x0016, 6},{0x0016, 5},{0x0033, 6}
+  },
+  {
+    {0x0004, 3},{0x0007, 4},{0x0018, 5},{0x001E, 5},
+    {0x0036, 6},{0x0031, 7},{0x0177, 9},{0x0077, 7},
+    {0x0176, 9},{0x0001, 3},{0x0000, 3},{0x001A, 5},
+    {0x0019, 5},{0x003A, 6},{0x0019, 6},{0x005C, 7},
+    {0x00BA, 8},{0x0061, 8},{0x00C1, 9},{0x0180,10},
+    {0x0302,11},{0x0607,12},{0x0606,12},{0x0002, 3},
+    {0x000A, 4},{0x001F, 5},{0x001C, 5},{0x0037, 6},
+    {0x0016, 5},{0x0076, 7},{0x000D, 5},{0x002F, 6}
+  },
+  {
+    {0x0000, 3},{0x000A, 4},{0x001A, 5},{0x000C, 4},
+    {0x001D, 5},{0x0039, 6},{0x0078, 7},{0x005E, 7},
+    {0x0393,11},{0x0002, 3},{0x0001, 3},{0x0016, 5},
+    {0x000F, 5},{0x002E, 6},{0x005F, 7},{0x0073, 8},
+    {0x00E5, 9},{0x01C8,10},{0x0E4A,13},{0x1C97,14},
+    {0x1C96,14},{0x0E49,13},{0x0E48,13},{0x0004, 3},
+    {0x0006, 4},{0x001F, 5},{0x001B, 5},{0x001D, 6},
+    {0x0038, 6},{0x0038, 7},{0x003D, 6},{0x0079, 7}
+  },
+  {
+    {0x000B, 5},{0x002B, 7},{0x0054, 8},{0x01B7, 9},
+    {0x06D9,11},{0x0DB1,12},{0x0DB0,12},{0x0002, 4},
+    {0x00AB, 9},{0x0009, 4},{0x000A, 4},{0x0007, 4},
+    {0x0008, 4},{0x000F, 4},{0x000C, 4},{0x0003, 4},
+    {0x001D, 5},{0x0004, 4},{0x000B, 4},{0x0006, 4},
+    {0x001A, 5},{0x0003, 6},{0x00AA, 9},{0x0001, 4},
+    {0x0000, 5},{0x0014, 6},{0x006C, 7},{0x00DA, 8},
+    {0x0002, 6},{0x036D,10},{0x001C, 5},{0x0037, 6}
+  },
+  {
+    {0x001D, 5},{0x0004, 6},{0x00B6, 8},{0x006A, 8},
+    {0x05B9,11},{0x16E1,13},{0x16E0,13},{0x0007, 4},
+    {0x016F, 9},{0x000C, 4},{0x000D, 4},{0x0009, 4},
+    {0x0008, 4},{0x000F, 4},{0x000A, 4},{0x0003, 4},
+    {0x0017, 5},{0x0002, 4},{0x0004, 4},{0x001C, 5},
+    {0x002C, 6},{0x006B, 8},{0x0B71,12},{0x0005, 4},
+    {0x0003, 5},{0x001B, 6},{0x005A, 7},{0x0034, 7},
+    {0x0005, 6},{0x02DD,10},{0x0000, 4},{0x000C, 5}
+  },
+  {
+    {0x0003, 4},{0x007F, 7},{0x00A1, 8},{0x00A0, 8},
+    {0x020C,10},{0x0834,12},{0x106B,13},{0x0007, 4},
+    {0x0082, 8},{0x000E, 4},{0x000D, 4},{0x000B, 4},
+    {0x000C, 4},{0x0000, 3},{0x0009, 4},{0x0002, 4},
+    {0x0011, 5},{0x001E, 5},{0x0015, 5},{0x003E, 6},
+    {0x0040, 7},{0x041B,11},{0x106A,13},{0x0006, 4},
+    {0x000A, 5},{0x0029, 6},{0x007E, 7},{0x0051, 7},
+    {0x0021, 6},{0x0107, 9},{0x0004, 4},{0x000B, 5}
+  },
+  {
+    {0x0007, 4},{0x001B, 6},{0x00F6, 8},{0x00E9, 8},
+    {0x03A1,10},{0x0740,11},{0x0E82,12},{0x001F, 5},
+    {0x01EF, 9},{0x0001, 3},{0x0002, 3},{0x000B, 4},
+    {0x000C, 4},{0x000D, 4},{0x0008, 4},{0x001C, 5},
+    {0x0003, 5},{0x0012, 5},{0x0002, 5},{0x0075, 7},
+    {0x01D1, 9},{0x1D07,13},{0x1D06,13},{0x000A, 4},
+    {0x0013, 5},{0x003B, 6},{0x001A, 6},{0x007A, 7},
+    {0x003C, 6},{0x01EE, 9},{0x0000, 4},{0x000C, 5}
+  },
+  {
+    {0x000D, 4},{0x003D, 6},{0x0042, 7},{0x0037, 7},
+    {0x00D9, 9},{0x0362,11},{0x06C6,12},{0x001F, 5},
+    {0x0086, 8},{0x0001, 3},{0x0002, 3},{0x000C, 4},
+    {0x000B, 4},{0x000A, 4},{0x0001, 4},{0x000F, 5},
+    {0x0025, 6},{0x003C, 6},{0x001A, 6},{0x0087, 8},
+    {0x01B0,10},{0x0D8F,13},{0x0D8E,13},{0x000E, 4},
+    {0x0013, 5},{0x000C, 5},{0x0024, 6},{0x0020, 6},
+    {0x0011, 5},{0x006D, 8},{0x0000, 4},{0x000E, 5}
+  },
+  {
+    {0x0000, 3},{0x0012, 5},{0x0076, 7},{0x0077, 7},
+    {0x014D, 9},{0x0533,11},{0x14C9,13},{0x0013, 5},
+    {0x00A5, 8},{0x0002, 3},{0x0003, 3},{0x000B, 4},
+    {0x000C, 4},{0x0008, 4},{0x001A, 5},{0x002B, 6},
+    {0x0075, 7},{0x0074, 7},{0x00A7, 8},{0x0298,10},
+    {0x14C8,13},{0x14CB,13},{0x14CA,13},{0x000F, 4},
+    {0x001C, 5},{0x0007, 5},{0x002A, 6},{0x0028, 6},
+    {0x001B, 5},{0x00A4, 8},{0x0002, 4},{0x0006, 5}
+  },
+  {
+    {0x0002, 3},{0x001A, 5},{0x002B, 6},{0x003A, 6},
+    {0x00ED, 8},{0x0283,10},{0x0A0A,12},{0x0004, 5},
+    {0x00A1, 8},{0x0004, 3},{0x0003, 3},{0x000B, 4},
+    {0x000C, 4},{0x001F, 5},{0x0006, 5},{0x0077, 7},
+    {0x00A3, 8},{0x00A2, 8},{0x0140, 9},{0x1417,13},
+    {0x1416,13},{0x0A09,12},{0x0A08,12},{0x0000, 3},
+    {0x001E, 5},{0x0007, 5},{0x002A, 6},{0x0029, 6},
+    {0x001C, 5},{0x00EC, 8},{0x001B, 5},{0x0005, 5}
+  },
+  {
+    {0x0002, 3},{0x0002, 4},{0x0018, 5},{0x001D, 5},
+    {0x0035, 6},{0x00E4, 8},{0x01CF,11},{0x001D, 7},
+    {0x0072, 9},{0x0004, 3},{0x0005, 3},{0x0006, 4},
+    {0x0007, 4},{0x0006, 5},{0x0073, 7},{0x0038, 8},
+    {0x01CE,11},{0x039B,12},{0x0398,12},{0x0733,13},
+    {0x0732,13},{0x0735,13},{0x0734,13},{0x0000, 3},
+    {0x001F, 5},{0x001B, 5},{0x0034, 6},{0x000F, 6},
+    {0x001E, 5},{0x00E5, 8},{0x0019, 5},{0x0038, 6}
+  },
+  {
+    {0x0016, 5},{0x0050, 7},{0x0172, 9},{0x02E7,10},
+    {0x1732,13},{0x2E67,14},{0x2E66,14},{0x0006, 4},
+    {0x0051, 7},{0x0001, 3},{0x0000, 3},{0x000D, 4},
+    {0x000C, 4},{0x0009, 4},{0x001C, 5},{0x0009, 5},
+    {0x001C, 6},{0x001D, 6},{0x005D, 7},{0x00B8, 8},
+    {0x05CD,11},{0x1731,13},{0x1730,13},{0x000F, 4},
+    {0x0005, 4},{0x000F, 5},{0x0008, 5},{0x0029, 6},
+    {0x001D, 5},{0x002F, 6},{0x0008, 4},{0x0015, 5}
+  },
+  {
+    {0x0009, 4},{0x0021, 6},{0x0040, 7},{0x00AD, 8},
+    {0x02B0,10},{0x1589,13},{0x1588,13},{0x001C, 5},
+    {0x005F, 7},{0x0000, 3},{0x000F, 4},{0x000D, 4},
+    {0x000C, 4},{0x0006, 4},{0x0011, 5},{0x002A, 6},
+    {0x0057, 7},{0x005E, 7},{0x0041, 7},{0x0159, 9},
+    {0x0563,11},{0x158B,13},{0x158A,13},{0x0001, 3},
+    {0x0005, 4},{0x0014, 5},{0x003B, 6},{0x002E, 6},
+    {0x0004, 4},{0x003A, 6},{0x0007, 4},{0x0016, 5}
+  },
+  {
+    {0x000E, 4},{0x0007, 5},{0x0046, 7},{0x0045, 7},
+    {0x0064, 9},{0x032A,12},{0x0657,13},{0x0018, 5},
+    {0x000D, 6},{0x0000, 3},{0x000F, 4},{0x000A, 4},
+    {0x000B, 4},{0x001A, 5},{0x0036, 6},{0x0047, 7},
+    {0x0044, 7},{0x0018, 7},{0x0033, 8},{0x00CB,10},
+    {0x0656,13},{0x0329,12},{0x0328,12},{0x0002, 3},
+    {0x0006, 4},{0x0019, 5},{0x000E, 5},{0x0037, 6},
+    {0x0009, 4},{0x000F, 5},{0x0002, 4},{0x0010, 5}
+  },
+  {
+    {0x0003, 3},{0x0018, 5},{0x0023, 6},{0x0077, 7},
+    {0x0194, 9},{0x1956,13},{0x32AF,14},{0x003A, 6},
+    {0x0076, 7},{0x0002, 3},{0x0001, 3},{0x001F, 5},
+    {0x001E, 5},{0x0014, 5},{0x0022, 6},{0x0064, 7},
+    {0x0197, 9},{0x0196, 9},{0x032B,10},{0x0654,11},
+    {0x32AE,14},{0x1955,13},{0x1954,13},{0x0000, 3},
+    {0x0009, 4},{0x001C, 5},{0x0015, 5},{0x0010, 5},
+    {0x000D, 4},{0x0017, 5},{0x0016, 5},{0x0033, 6}
+  },
+  {
+    {0x0005, 3},{0x0006, 4},{0x003E, 6},{0x0010, 5},
+    {0x0048, 7},{0x093F,12},{0x24FA,14},{0x0032, 6},
+    {0x0067, 7},{0x0002, 3},{0x0001, 3},{0x001B, 5},
+    {0x001E, 5},{0x0034, 6},{0x0066, 7},{0x0092, 8},
+    {0x0126, 9},{0x024E,10},{0x049E,11},{0x49F7,15},
+    {0x49F6,15},{0x24F9,14},{0x24F8,14},{0x0000, 3},
+    {0x0007, 4},{0x0018, 5},{0x0011, 5},{0x003F, 6},
+    {0x000E, 4},{0x0013, 5},{0x0035, 6},{0x0025, 6}
+  },
+  {
+    {0x0005, 3},{0x0008, 4},{0x0012, 5},{0x001C, 5},
+    {0x001C, 6},{0x00EA, 9},{0x1D75,14},{0x001E, 6},
+    {0x0066, 7},{0x0001, 3},{0x0002, 3},{0x001B, 5},
+    {0x001A, 5},{0x001F, 6},{0x003B, 7},{0x0074, 8},
+    {0x01D6,10},{0x03AF,11},{0x1D74,14},{0x1D77,14},
+    {0x1D76,14},{0x0EB9,13},{0x0EB8,13},{0x000F, 4},
+    {0x0006, 4},{0x0013, 5},{0x003B, 6},{0x003A, 6},
+    {0x0000, 3},{0x0018, 5},{0x0032, 6},{0x0067, 7}
+  },
+  {
+    {0x0004, 3},{0x000A, 4},{0x001B, 5},{0x000C, 4},
+    {0x000D, 5},{0x00E6, 8},{0x0684,11},{0x0072, 7},
+    {0x00E7, 8},{0x0002, 3},{0x0001, 3},{0x0017, 5},
+    {0x0016, 5},{0x0018, 6},{0x00D1, 8},{0x01A0, 9},
+    {0x0686,11},{0x0D0F,12},{0x0D0A,12},{0x1A17,13},
+    {0x1A16,13},{0x1A1D,13},{0x1A1C,13},{0x000F, 4},
+    {0x001D, 5},{0x000E, 5},{0x0035, 6},{0x0038, 6},
+    {0x0000, 3},{0x000F, 5},{0x0019, 6},{0x0069, 7}
+  },
+  {
+    {0x0003, 3},{0x000C, 4},{0x001B, 5},{0x0000, 3},
+    {0x0003, 4},{0x002E, 6},{0x0051, 9},{0x00BC, 8},
+    {0x0053, 9},{0x0004, 3},{0x0002, 3},{0x0016, 5},
+    {0x0015, 5},{0x0015, 7},{0x0050, 9},{0x00A4,10},
+    {0x0294,12},{0x052B,13},{0x052A,13},{0x052D,13},
+    {0x052C,13},{0x052F,13},{0x052E,13},{0x000E, 4},
+    {0x001A, 5},{0x0004, 5},{0x0028, 6},{0x0029, 6},
+    {0x000F, 4},{0x000B, 6},{0x005F, 7},{0x00BD, 8}
+  },
+  {
+    {0x0003, 4},{0x0009, 6},{0x00D0, 8},{0x01A3, 9},
+    {0x0344,10},{0x0D14,12},{0x1A2B,13},{0x0004, 4},
+    {0x0015, 7},{0x0000, 3},{0x000F, 4},{0x000B, 4},
+    {0x000C, 4},{0x000E, 4},{0x0009, 4},{0x001B, 5},
+    {0x000A, 5},{0x0014, 5},{0x000D, 5},{0x002A, 6},
+    {0x0014, 7},{0x068B,11},{0x1A2A,13},{0x0008, 4},
+    {0x000B, 5},{0x002B, 6},{0x000B, 6},{0x0069, 7},
+    {0x0035, 6},{0x0008, 6},{0x0007, 4},{0x000C, 5}
+  },
+  {
+    {0x000A, 4},{0x003C, 6},{0x0032, 7},{0x0030, 7},
+    {0x00C5, 9},{0x0621,12},{0x0620,12},{0x001F, 5},
+    {0x0033, 7},{0x0001, 3},{0x0000, 3},{0x000E, 4},
+    {0x000D, 4},{0x000C, 4},{0x0004, 4},{0x000D, 5},
+    {0x0026, 6},{0x0027, 6},{0x0014, 6},{0x0063, 8},
+    {0x0189,10},{0x0623,12},{0x0622,12},{0x000B, 4},
+    {0x0012, 5},{0x003D, 6},{0x0022, 6},{0x0015, 6},
+    {0x000B, 5},{0x0023, 6},{0x0007, 4},{0x0010, 5}
+  },
+  {
+    {0x000F, 4},{0x000C, 5},{0x0043, 7},{0x0010, 6},
+    {0x0044, 8},{0x0114,10},{0x0455,12},{0x0018, 5},
+    {0x0023, 7},{0x0001, 3},{0x0000, 3},{0x000E, 4},
+    {0x000D, 4},{0x0009, 4},{0x0019, 5},{0x0009, 5},
+    {0x0017, 6},{0x0016, 6},{0x0042, 7},{0x008B, 9},
+    {0x0454,12},{0x0457,12},{0x0456,12},{0x000B, 4},
+    {0x0015, 5},{0x000A, 5},{0x0029, 6},{0x0020, 6},
+    {0x000D, 5},{0x0028, 6},{0x0007, 4},{0x0011, 5}
+  },
+  {
+    {0x0001, 3},{0x001A, 5},{0x0029, 6},{0x002A, 6},
+    {0x00A0, 8},{0x0285,10},{0x1425,13},{0x0002, 5},
+    {0x0000, 7},{0x0002, 3},{0x0003, 3},{0x000C, 4},
+    {0x000B, 4},{0x0008, 4},{0x0012, 5},{0x0001, 6},
+    {0x0051, 7},{0x0001, 7},{0x0143, 9},{0x0508,11},
+    {0x1424,13},{0x1427,13},{0x1426,13},{0x000F, 4},
+    {0x001C, 5},{0x0003, 5},{0x0037, 6},{0x002B, 6},
+    {0x0013, 5},{0x0036, 6},{0x001D, 5},{0x0001, 5}
+  },
+  {
+    {0x0004, 3},{0x001F, 5},{0x003D, 6},{0x0006, 5},
+    {0x0016, 7},{0x0053, 9},{0x014A,11},{0x0034, 6},
+    {0x002A, 8},{0x0002, 3},{0x0003, 3},{0x000B, 4},
+    {0x000C, 4},{0x001C, 5},{0x0037, 6},{0x0017, 7},
+    {0x002B, 8},{0x0028, 8},{0x00A4,10},{0x052D,13},
+    {0x052C,13},{0x052F,13},{0x052E,13},{0x0000, 3},
+    {0x001D, 5},{0x0007, 5},{0x0004, 5},{0x0035, 6},
+    {0x0014, 5},{0x0036, 6},{0x0015, 5},{0x003C, 6}
+  },
+  {
+    {0x0004, 3},{0x000A, 4},{0x0007, 5},{0x001D, 5},
+    {0x0009, 6},{0x01F3, 9},{0x07C7,11},{0x0008, 6},
+    {0x01F0, 9},{0x0003, 3},{0x0002, 3},{0x000D, 4},
+    {0x000C, 4},{0x0017, 5},{0x007D, 7},{0x01F2, 9},
+    {0x07C6,11},{0x07C5,11},{0x1F12,13},{0x3E27,14},
+    {0x3E26,14},{0x1F11,13},{0x1F10,13},{0x0000, 3},
+    {0x001E, 5},{0x0006, 5},{0x0039, 6},{0x0038, 6},
+    {0x003F, 6},{0x002C, 6},{0x0005, 5},{0x002D, 6}
+  },
+  {
+    {0x0002, 3},{0x0007, 4},{0x0018, 5},{0x0003, 4},
+    {0x0005, 5},{0x0035, 7},{0x004F, 9},{0x0012, 7},
+    {0x04E5,13},{0x0005, 3},{0x0004, 3},{0x000D, 4},
+    {0x000E, 4},{0x0033, 6},{0x0026, 8},{0x009D,10},
+    {0x04E4,13},{0x04E7,13},{0x04E6,13},{0x04E1,13},
+    {0x04E0,13},{0x04E3,13},{0x04E2,13},{0x0000, 3},
+    {0x001F, 5},{0x000C, 5},{0x003D, 6},{0x003C, 6},
+    {0x0032, 6},{0x0034, 7},{0x001B, 6},{0x0008, 6}
+  },
+  {
+    {0x0000, 3},{0x0004, 4},{0x001C, 5},{0x000F, 4},
+    {0x0002, 4},{0x0007, 5},{0x0075, 7},{0x00E8, 8},
+    {0x1D2A,13},{0x0005, 3},{0x0004, 3},{0x000D, 4},
+    {0x000C, 4},{0x0077, 7},{0x0E96,12},{0x3A57,14},
+    {0x3A56,14},{0x3A5D,14},{0x3A5C,14},{0x3A5F,14},
+    {0x3A5E,14},{0x1D29,13},{0x1D28,13},{0x0003, 3},
+    {0x0006, 5},{0x000A, 5},{0x002C, 7},{0x0017, 6},
+    {0x0076, 7},{0x01D3, 9},{0x03A4,10},{0x002D, 7}
+  },
+  {
+    {0x000A, 4},{0x0024, 6},{0x00BF, 8},{0x0085, 8},
+    {0x0211,10},{0x0842,12},{0x1087,13},{0x0018, 5},
+    {0x0020, 6},{0x0001, 3},{0x0002, 3},{0x000E, 4},
+    {0x000D, 4},{0x0007, 4},{0x0013, 5},{0x0025, 6},
+    {0x005E, 7},{0x0043, 7},{0x00BE, 8},{0x0109, 9},
+    {0x1086,13},{0x0841,12},{0x0840,12},{0x000F, 4},
+    {0x0001, 4},{0x0011, 5},{0x0000, 5},{0x002E, 6},
+    {0x0019, 5},{0x0001, 5},{0x0006, 4},{0x0016, 5}
+  },
+  {
+    {0x0002, 3},{0x000F, 5},{0x006F, 7},{0x0061, 7},
+    {0x0374,10},{0x1BA8,13},{0x3753,14},{0x0012, 5},
+    {0x0036, 6},{0x0000, 3},{0x0001, 3},{0x000A, 4},
+    {0x000B, 4},{0x001A, 5},{0x0031, 6},{0x0060, 7},
+    {0x00DC, 8},{0x01BB, 9},{0x06EB,11},{0x1BAB,13},
+    {0x3752,14},{0x3755,14},{0x3754,14},{0x000E, 4},
+    {0x0006, 4},{0x0013, 5},{0x000E, 5},{0x003E, 6},
+    {0x0008, 4},{0x001E, 5},{0x0019, 5},{0x003F, 6}
+  },
+  {
+    {0x0003, 3},{0x001C, 5},{0x0025, 6},{0x0024, 6},
+    {0x01DA, 9},{0x1DBD,13},{0x3B7C,14},{0x003C, 6},
+    {0x003D, 6},{0x0000, 3},{0x0001, 3},{0x000B, 4},
+    {0x000A, 4},{0x000B, 5},{0x0077, 7},{0x00EC, 8},
+    {0x03B6,10},{0x076E,11},{0x1DBF,13},{0x76FB,15},
+    {0x76FA,15},{0x3B79,14},{0x3B78,14},{0x000D, 4},
+    {0x001F, 5},{0x0013, 5},{0x000A, 5},{0x0008, 5},
+    {0x000C, 4},{0x0008, 4},{0x0009, 5},{0x003A, 6}
+  },
+  {
+    {0x0005, 3},{0x0003, 4},{0x0004, 5},{0x0010, 5},
+    {0x008F, 8},{0x0475,11},{0x11D1,13},{0x0079, 7},
+    {0x0027, 6},{0x0002, 3},{0x0003, 3},{0x0001, 4},
+    {0x0000, 4},{0x0026, 6},{0x0046, 7},{0x011C, 9},
+    {0x0477,11},{0x08ED,12},{0x11D0,13},{0x11D3,13},
+    {0x11D2,13},{0x11D9,13},{0x11D8,13},{0x000D, 4},
+    {0x001F, 5},{0x0012, 5},{0x0005, 5},{0x003D, 6},
+    {0x000C, 4},{0x000E, 4},{0x0022, 6},{0x0078, 7}
+  },
+  {
+    {0x0005, 3},{0x000C, 4},{0x001B, 5},{0x0000, 4},
+    {0x0006, 6},{0x03E2,10},{0x3E3D,14},{0x000F, 7},
+    {0x0034, 6},{0x0003, 3},{0x0002, 3},{0x001E, 5},
+    {0x001D, 5},{0x007D, 7},{0x01F0, 9},{0x07C6,11},
+    {0x3E3C,14},{0x3E3F,14},{0x3E3E,14},{0x3E39,14},
+    {0x3E38,14},{0x3E3B,14},{0x3E3A,14},{0x0008, 4},
+    {0x001C, 5},{0x0002, 5},{0x003F, 6},{0x0035, 6},
+    {0x0009, 4},{0x0001, 3},{0x000E, 7},{0x00F9, 8}
+  },
+  {
+    {0x0004, 3},{0x000B, 4},{0x0001, 4},{0x000A, 4},
+    {0x001E, 6},{0x00E0, 9},{0x0E1E,13},{0x0071, 8},
+    {0x0039, 7},{0x0007, 3},{0x0006, 3},{0x000D, 5},
+    {0x000C, 5},{0x0020, 7},{0x01C2,10},{0x1C3F,14},
+    {0x1C3E,14},{0x0E19,13},{0x0E18,13},{0x0E1B,13},
+    {0x0E1A,13},{0x0E1D,13},{0x0E1C,13},{0x0000, 4},
+    {0x0009, 5},{0x001D, 6},{0x001F, 6},{0x0011, 6},
+    {0x0005, 4},{0x0001, 3},{0x0043, 8},{0x0042, 8}
+  },
+  {
+    {0x0004, 3},{0x000D, 4},{0x0007, 4},{0x0002, 3},
+    {0x0014, 5},{0x016C, 9},{0x16D1,13},{0x02DF,10},
+    {0x016E, 9},{0x0000, 2},{0x0007, 3},{0x002C, 6},
+    {0x002B, 6},{0x02DE,10},{0x16D0,13},{0x16D3,13},
+    {0x16D2,13},{0x2DB5,14},{0x2DB4,14},{0x2DB7,14},
+    {0x2DB6,14},{0x16D9,13},{0x16D8,13},{0x000C, 5},
+    {0x002A, 6},{0x005A, 7},{0x001B, 6},{0x001A, 6},
+    {0x0017, 5},{0x000C, 4},{0x05B7,11},{0x05B5,11}
+  },
+  {
+    {0x0002, 2},{0x000F, 4},{0x001C, 5},{0x000C, 4},
+    {0x003B, 6},{0x01AC, 9},{0x1AD8,13},{0x35B3,14},
+    {0x35B2,14},{0x0001, 2},{0x0000, 2},{0x0069, 7},
+    {0x0068, 7},{0x35BD,14},{0x35BC,14},{0x35BF,14},
+    {0x35BE,14},{0x35B9,14},{0x35B8,14},{0x35BB,14},
+    {0x35BA,14},{0x35B5,14},{0x35B4,14},{0x01A9, 9},
+    {0x01A8, 9},{0x035A,10},{0x00D7, 8},{0x00D5, 8},
+    {0x003A, 6},{0x001B, 5},{0x35B7,14},{0x35B6,14}
+  },
+  {
+    {0x0000, 3},{0x0010, 5},{0x0072, 7},{0x0071, 7},
+    {0x0154, 9},{0x0AAB,12},{0x0AA8,12},{0x0014, 5},
+    {0x0070, 7},{0x0002, 3},{0x0003, 3},{0x000C, 4},
+    {0x000B, 4},{0x0003, 4},{0x0011, 5},{0x0073, 7},
+    {0x0054, 7},{0x00AB, 8},{0x02AB,10},{0x1553,13},
+    {0x1552,13},{0x1555,13},{0x1554,13},{0x000D, 4},
+    {0x001E, 5},{0x0012, 5},{0x003E, 6},{0x002B, 6},
+    {0x0002, 4},{0x003F, 6},{0x001D, 5},{0x0013, 5}
+  },
+  {
+    {0x0003, 3},{0x001F, 5},{0x0029, 6},{0x003D, 6},
+    {0x000C, 7},{0x0069,10},{0x0345,13},{0x0002, 5},
+    {0x0028, 6},{0x0002, 3},{0x0001, 3},{0x000E, 4},
+    {0x000C, 4},{0x0015, 5},{0x0007, 6},{0x001B, 8},
+    {0x006B,10},{0x006A,10},{0x0344,13},{0x0347,13},
+    {0x0346,13},{0x01A1,12},{0x01A0,12},{0x000B, 4},
+    {0x001A, 5},{0x0012, 5},{0x0000, 5},{0x003C, 6},
+    {0x0008, 4},{0x001B, 5},{0x0013, 5},{0x0001, 5}
+  },
+  {
+    {0x0004, 3},{0x0004, 4},{0x003F, 6},{0x0014, 5},
+    {0x0056, 7},{0x015C, 9},{0x15D5,13},{0x003C, 6},
+    {0x002A, 6},{0x0000, 3},{0x0001, 3},{0x000E, 4},
+    {0x000D, 4},{0x000C, 5},{0x00AF, 8},{0x02BB,10},
+    {0x15D4,13},{0x15D7,13},{0x15D6,13},{0x15D1,13},
+    {0x15D0,13},{0x15D3,13},{0x15D2,13},{0x000B, 4},
+    {0x0019, 5},{0x000D, 5},{0x003E, 6},{0x0031, 6},
+    {0x0007, 4},{0x0005, 4},{0x003D, 6},{0x0030, 6}
+  },
+  {
+    {0x0005, 3},{0x0008, 4},{0x001A, 5},{0x0000, 4},
+    {0x0036, 6},{0x0011, 8},{0x0106,12},{0x000A, 7},
+    {0x006E, 7},{0x0002, 3},{0x0003, 3},{0x0003, 4},
+    {0x0002, 4},{0x006F, 7},{0x0021, 9},{0x020F,13},
+    {0x020E,13},{0x0101,12},{0x0100,12},{0x0103,12},
+    {0x0102,12},{0x0105,12},{0x0104,12},{0x000C, 4},
+    {0x001E, 5},{0x0003, 5},{0x003E, 6},{0x003F, 6},
+    {0x0009, 4},{0x000E, 4},{0x000B, 7},{0x0009, 7}
+  },
+  {
+    {0x0002, 3},{0x000E, 4},{0x001E, 5},{0x000C, 4},
+    {0x001F, 5},{0x006E, 7},{0x00AD,10},{0x00AF,10},
+    {0x0014, 7},{0x0004, 3},{0x0003, 3},{0x001A, 5},
+    {0x0017, 5},{0x002A, 8},{0x0576,13},{0x0AEF,14},
+    {0x0AEE,14},{0x0571,13},{0x0570,13},{0x0573,13},
+    {0x0572,13},{0x0575,13},{0x0574,13},{0x0003, 4},
+    {0x0016, 5},{0x0004, 5},{0x0036, 6},{0x000B, 6},
+    {0x000A, 4},{0x0000, 3},{0x006F, 7},{0x00AC,10}
+  },
+  {
+    {0x0004, 3},{0x0005, 4},{0x0003, 3},{0x0001, 3},
+    {0x0004, 4},{0x002F, 6},{0x0526,11},{0x1495,13},
+    {0x00A6, 8},{0x0007, 3},{0x0006, 3},{0x002D, 6},
+    {0x002C, 6},{0x1494,13},{0x1497,13},{0x1496,13},
+    {0x1491,13},{0x1490,13},{0x1493,13},{0x1492,13},
+    {0x293D,14},{0x293C,14},{0x293F,14},{0x0000, 3},
+    {0x0028, 6},{0x00A5, 8},{0x0148, 9},{0x00A7, 8},
+    {0x002E, 6},{0x0015, 5},{0x0A4E,12},{0x293E,14}
+  },
+  {
+    {0x0004, 3},{0x0005, 4},{0x0003, 3},{0x0001, 3},
+    {0x0004, 4},{0x002F, 6},{0x0526,11},{0x1495,13},
+    {0x00A6, 8},{0x0007, 3},{0x0006, 3},{0x002D, 6},
+    {0x002C, 6},{0x1494,13},{0x1497,13},{0x1496,13},
+    {0x1491,13},{0x1490,13},{0x1493,13},{0x1492,13},
+    {0x293D,14},{0x293C,14},{0x293F,14},{0x0000, 3},
+    {0x0028, 6},{0x00A5, 8},{0x0148, 9},{0x00A7, 8},
+    {0x002E, 6},{0x0015, 5},{0x0A4E,12},{0x293E,14}
+  },
+  {
+    {0x0004, 3},{0x0005, 4},{0x0003, 3},{0x0001, 3},
+    {0x0004, 4},{0x002F, 6},{0x0526,11},{0x1495,13},
+    {0x00A6, 8},{0x0007, 3},{0x0006, 3},{0x002D, 6},
+    {0x002C, 6},{0x1494,13},{0x1497,13},{0x1496,13},
+    {0x1491,13},{0x1490,13},{0x1493,13},{0x1492,13},
+    {0x293D,14},{0x293C,14},{0x293F,14},{0x0000, 3},
+    {0x0028, 6},{0x00A5, 8},{0x0148, 9},{0x00A7, 8},
+    {0x002E, 6},{0x0015, 5},{0x0A4E,12},{0x293E,14}
+  },
+  {
+    {0x0003, 3},{0x0011, 5},{0x0020, 6},{0x0074, 7},
+    {0x010D, 9},{0x0863,12},{0x0860,12},{0x000A, 5},
+    {0x0075, 7},{0x0001, 3},{0x0000, 3},{0x000B, 4},
+    {0x000A, 4},{0x0018, 5},{0x0038, 6},{0x0042, 7},
+    {0x010F, 9},{0x010E, 9},{0x0219,10},{0x10C3,13},
+    {0x10C2,13},{0x10C5,13},{0x10C4,13},{0x000F, 4},
+    {0x0004, 4},{0x0019, 5},{0x000B, 5},{0x0039, 6},
+    {0x0009, 4},{0x001B, 5},{0x001A, 5},{0x003B, 6}
+  },
+  {
+    {0x0005, 3},{0x0001, 4},{0x003E, 6},{0x0001, 5},
+    {0x00E2, 8},{0x1C6F,13},{0x38D9,14},{0x0039, 6},
+    {0x001F, 6},{0x0002, 3},{0x0001, 3},{0x0009, 4},
+    {0x0008, 4},{0x0000, 5},{0x0070, 7},{0x01C7, 9},
+    {0x038C,10},{0x071A,11},{0x38D8,14},{0x38DB,14},
+    {0x38DA,14},{0x38DD,14},{0x38DC,14},{0x000D, 4},
+    {0x001D, 5},{0x000E, 5},{0x003F, 6},{0x003C, 6},
+    {0x000C, 4},{0x0006, 4},{0x003D, 6},{0x001E, 6}
+  },
+  {
+    {0x0006, 3},{0x000B, 4},{0x0011, 5},{0x001E, 5},
+    {0x0074, 7},{0x03AA,10},{0x1D5C,13},{0x0001, 6},
+    {0x0021, 6},{0x0001, 3},{0x0002, 3},{0x0007, 4},
+    {0x0006, 4},{0x003E, 6},{0x00EB, 8},{0x01D4, 9},
+    {0x0EAF,12},{0x3ABB,14},{0x3ABA,14},{0x1D59,13},
+    {0x1D58,13},{0x1D5B,13},{0x1D5A,13},{0x000A, 4},
+    {0x001C, 5},{0x0001, 5},{0x003F, 6},{0x003B, 6},
+    {0x0001, 4},{0x0009, 4},{0x0020, 6},{0x0000, 6}
+  },
+  {
+    {0x0004, 3},{0x000A, 4},{0x0017, 5},{0x0004, 4},
+    {0x0016, 6},{0x016A, 9},{0x16B1,13},{0x0017, 7},
+    {0x005B, 7},{0x0006, 3},{0x0007, 3},{0x0001, 4},
+    {0x0000, 4},{0x000A, 6},{0x02D7,10},{0x0B5A,12},
+    {0x16B0,13},{0x16B3,13},{0x16B2,13},{0x2D6D,14},
+    {0x2D6C,14},{0x2D6F,14},{0x2D6E,14},{0x0006, 4},
+    {0x000A, 5},{0x0004, 5},{0x002C, 6},{0x0017, 6},
+    {0x0003, 4},{0x0007, 4},{0x0016, 7},{0x00B4, 8}
+  },
+  {
+    {0x0005, 3},{0x000D, 4},{0x0005, 4},{0x0009, 4},
+    {0x0033, 6},{0x0193, 9},{0x192C,13},{0x0061, 8},
+    {0x0031, 7},{0x0000, 2},{0x0007, 3},{0x0010, 5},
+    {0x0011, 5},{0x00C8, 8},{0x192F,13},{0x325B,14},
+    {0x325A,14},{0x1929,13},{0x1928,13},{0x192B,13},
+    {0x192A,13},{0x325D,14},{0x325C,14},{0x0018, 5},
+    {0x001A, 6},{0x001B, 6},{0x0065, 7},{0x0019, 6},
+    {0x0004, 4},{0x0007, 4},{0x0060, 8},{0x0324,10}
+  },
+  {
+    {0x0006, 3},{0x0000, 3},{0x0002, 4},{0x000F, 4},
+    {0x0039, 6},{0x01D9, 9},{0x1D82,13},{0x0761,11},
+    {0x03BE,10},{0x0001, 2},{0x0002, 2},{0x000F, 6},
+    {0x000E, 6},{0x0762,11},{0x3B07,14},{0x3B06,14},
+    {0x3B1D,14},{0x3B1C,14},{0x3B1F,14},{0x3B1E,14},
+    {0x3B19,14},{0x3B18,14},{0x3B1B,14},{0x0038, 6},
+    {0x01DE, 9},{0x00ED, 8},{0x03BF,10},{0x00EE, 8},
+    {0x003A, 6},{0x0006, 5},{0x0EC0,12},{0x3B1A,14}
+  },
+  {
+    {0x0000, 2},{0x0002, 3},{0x000F, 5},{0x0006, 4},
+    {0x001C, 6},{0x01D0,10},{0x0E8C,13},{0x1D1B,14},
+    {0x1D1A,14},{0x0003, 2},{0x0002, 2},{0x00EA, 9},
+    {0x00E9, 9},{0x0E89,13},{0x0E88,13},{0x0E8B,13},
+    {0x0E8A,13},{0x1D65,14},{0x1D64,14},{0x1D67,14},
+    {0x1D66,14},{0x1D61,14},{0x1D60,14},{0x03AD,11},
+    {0x1D63,14},{0x1D62,14},{0x1D1D,14},{0x1D1C,14},
+    {0x003B, 7},{0x01D7,10},{0x1D1F,14},{0x1D1E,14}
+  },
+  {
+    {0x0002, 2},{0x000F, 4},{0x001C, 5},{0x000C, 4},
+    {0x003B, 6},{0x01AC, 9},{0x1AD8,13},{0x35B3,14},
+    {0x35B2,14},{0x0001, 2},{0x0000, 2},{0x0069, 7},
+    {0x0068, 7},{0x35BD,14},{0x35BC,14},{0x35BF,14},
+    {0x35BE,14},{0x35B9,14},{0x35B8,14},{0x35BB,14},
+    {0x35BA,14},{0x35B5,14},{0x35B4,14},{0x01A9, 9},
+    {0x01A8, 9},{0x035A,10},{0x00D7, 8},{0x00D5, 8},
+    {0x003A, 6},{0x001B, 5},{0x35B7,14},{0x35B6,14}
+  }
+};
+  

Added: experimental/j/Elphel333/common/utils.c
===================================================================
--- experimental/j/Elphel333/common/utils.c	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/common/utils.c	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,181 @@
+/******************************************************************************
+This 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 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; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+	
+******************************************************************************/
+// Streamer for Elphel JPEG camera 313 input device
+// Copyright (c) 2004 Andy Latin aka Landy, Dmitry Latin aka ipfreely
+// All rights reserved.
+//
+// http://andy.qnx.org.ru
+// mail to:  
+// andy at qnx.org.ru   
+// landy at mail333.com
+/////////////////////////////////////////////////////////////////////////////
+
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <time.h>
+#include <sys/time.h>
+
+#include "defines.h"
+
+
+///////////////// Time functions ///////////////////////////////////////
+
+int usec_sleep(int usec_delay)
+{
+#ifdef HAVE_NANOSLEEP
+    struct timespec ts;
+    ts.tv_sec  =  usec_delay / TimestampTicks;
+    ts.tv_nsec = (usec_delay % TimestampTicks) * 1000;
+    return nanosleep(&ts, NULL);
+#else
+    return usleep(usec_delay);
+#endif
+}
+
+// Returns current time in microseconds
+Timestamp GetTimestamp()
+{
+        struct timeval tv;
+        gettimeofday(&tv, NULL);
+        return (tv.tv_sec * TimestampTicks) + tv.tv_usec;
+}
+
+// Returns current time in milliseconds
+Timestamp GetTimerMs(void)
+{
+     return GetTimestamp()/1000;
+}  
+
+
+static Timestamp RelativeTime=0;
+
+// Returns time spent between now and last call in microseconds
+Timestamp GetRelativeTime()
+{
+  Timestamp t,r;
+
+  t=GetTimestamp();
+  r=t-RelativeTime;
+  RelativeTime=t;
+  return r;
+}
+
+// Initialize timer, must be called at least once at start
+void InitTimer()
+{
+  GetRelativeTime();
+}
+
+
+static  int once = 0;
+
+void SeedRandom(void)
+{
+   if (!once) {
+	srandom(time(NULL));
+	once = 1;
+   }
+}
+
+uint32_t GetRandomMcastAddress(void) 
+{
+	SeedRandom();
+
+	// pick a random number in the multicast range
+	uint32_t mcast = ((random() & 0x0FFFFFFF) | 0xE0000000);
+
+	// screen out undesirable values
+	// introduces small biases in the results
+
+	// stay away from 224.0.0.x
+	if ((mcast & 0x0FFFFF00) == 0) {
+		mcast |= 0x00000100;	// move to 224.0.1
+	} 
+
+	// stay out of SSM range 232.x.x.x
+	// user should explictly select this if they want SSM
+	if ((mcast & 0xFF000000) == 232) {
+		mcast |= 0x01000000;	// move to 233
+	}
+
+	// stay away from .0 .1 and .255
+	if ((mcast & 0xFF) == 0 || (mcast & 0xFF) == 1 
+	  || (mcast & 0xFF) == 255) {
+		mcast = (mcast & 0xFFFFFFF0) | 0x4;	// move to .4 or .244
+	}
+
+  return htonl(mcast);
+}
+
+uint16_t GetRandomPortBlock(void) 
+{
+	SeedRandom();
+
+	// Get random block of 4 port numbers above 20000
+	return (uint16_t)(20000 + ((random() >> 18) << 2));
+}
+
+
+///////////////////// Rtp time functions /////////////////////
+
+static Timestamp StartTimestamp = 0;
+static Timestamp RtpTimestampOffset =0;
+
+RtpTimestamp TimestampToRtp(Timestamp t)
+{
+  if (StartTimestamp !=0) {
+	    return (uint32_t)(((t - StartTimestamp) 
+		* TimeScale) / TimestampTicks)
+	      	+ RtpTimestampOffset;
+	  }
+	  StartTimestamp = t;
+	  return 0;
+	}
+
+static const u_int32_t SECS_BETWEEN_1900_1970 = 2208988800U;
+
+Timestamp TimestampToNtp(Timestamp t) 
+{
+	// low order ntp 32 bits is 2 ^ 32 -1 ticks per sec
+	register uint32_t usecs = t % TimestampTicks;
+	return (((t / TimestampTicks) + SECS_BETWEEN_1900_1970) << 32)
+		| ((usecs << 12) + (usecs << 8) - ((usecs * 3650) >> 6));
+}
+
+void HexDump(
+        u_int8_t* pBytes, u_int32_t numBytes)
+{
+	uint32_t i;
+
+        printf("<%u bytes> ", numBytes);
+        for (i = 0; i < numBytes; i++) {
+                if ((i % 16) == 0 && numBytes > 16) {
+                        printf("\n");
+                }
+                printf("%02x ", pBytes[i]);
+        }
+        printf("\n");
+}
+#if 0
+void main(){
+  float t=0;
+  InitTimer();
+  while(1){ t+=GetRelativeTime();printf("time= %10.6f\r",t);fflush(stdout); }
+}
+#endif
+

Added: experimental/j/Elphel333/http/.target-makefrag
===================================================================
--- experimental/j/Elphel333/http/.target-makefrag	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/http/.target-makefrag	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1 @@
+AXIS_BUILDTYPE=cris-axis-linux-gnu

Added: experimental/j/Elphel333/http/Makefile
===================================================================
--- experimental/j/Elphel333/http/Makefile	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/http/Makefile	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,34 @@
+#
+# Makefile for the Elphel streamer.
+# This probably requires GNU make.
+#
+AXIS_USABLE_LIBS = UCLIBC GLIBC
+include $(AXIS_TOP_DIR)/tools/build/Rules.axis
+
+THEORACOMMON=../common
+THEORACOMMON_OBJS=$(THEORACOMMON)/oggtheora.o $(THEORACOMMON)/utils.o
+
+DEFS   = -DHAVE_CONFIG_H
+CFLAGS = -O2 -W  -Wwrite-strings -Wbad-function-cast -Wmissing-prototypes -Wcast-qual -Wmissing-declarations  $(DEFS) -I$(THEORACOMMON)
+LIBS   = -lm 
+
+LD	= ld-cris
+
+TARGET = theora.cgi
+OBJS   = TheoraHTTP.o
+SRCS   = $(OBJS:%.o=%.c)
+
+all: $(TARGET)
+
+$(TARGET): $(OBJS) $(THEORACOMMON_OBJS)
+	 $(CC) $(CFLAGS) -o $@ $(OBJS) $(THEORACOMMON_OBJS) $(LIBS)
+	 strip-cris $@
+
+.c.o:
+	$(CC) $(CFLAGS) $(INC) -c $<
+
+$(THEORACOMMON_OBJS): 
+	cd $(THEORACOMMON) && $(MAKE)
+
+clean:
+	-rm -f *.o $(OBJS) $(TARGET)

Added: experimental/j/Elphel333/http/README
===================================================================
--- experimental/j/Elphel333/http/README	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/http/README	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,8 @@
+make sure you souced init_env
+
+./.target-makefrag should be
+AXIS_BUILDTYPE=cris-axis-linux-gnu
+
+if not run: make cris-axis-linux-gnu
+
+after that run make to build TheoraHTTP

Added: experimental/j/Elphel333/http/TheoraHTTP.c
===================================================================
--- experimental/j/Elphel333/http/TheoraHTTP.c	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/http/TheoraHTTP.c	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,461 @@
+/******************************************************************************
+This 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 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; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    
+******************************************************************************/
+// HTTP Ogg Streamer for Elphel Camera 333 input device
+// Copyright (c) 2005 Jan Gerber
+/////////////////////////////////////////////////////////////////////////////
+#include <sys/time.h>
+#include <sys/mman.h>           /* mmap */
+#include <sys/ioctl.h>
+#include <sys/fcntl.h>
+#include <ctype.h>
+#include <inttypes.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <getopt.h>
+#include <errno.h>
+
+
+#include "c313a.h"
+
+#include "defines.h"
+#include "oggtheora.h"
+
+#define D(x) 
+
+#define HDR_INTERVAL   100   // send headers every 4 s for  25 fps
+
+///////////////////// GLOBAL DATA ///////////////////
+int                 mTimeinterval = 40000;  // default for 25 fps
+const char          mmapFileName[]= "/var/tmp/mmap_strm";
+strm_data_t         *strm_data;
+static strm_data_t  strm_data_par;
+int                 hdr_size;
+/////////////// OggTheora data///////////////////////
+int                 kfgshiftm=9;
+len_data_t          packets[6];
+u_int32_t           header_lengths[6];
+uint8_t             *b_headers;
+/////////////////////////////////////////////////////
+
+
+static void
+usage()
+{
+    printf("\n");
+    printf("\tTheora HTTP streamer for Elphel Camera model 333. \n");
+    printf("\tBased on TheoraStrm 0.5 (RTP streamer)\n");
+  
+    printf("\n\tUsage: TheoraStrm [-f <fps>] [-a <address>] [-p <port>] [-w] [-h]\n\n");
+    printf("\t\t[-w] - use WEB interface for manage streamer\n\n");
+
+    printf("\t If used WEB interface for manage of streamer, options enumerated\n");
+    printf("\t below can be changed from browser.\n\n");
+    
+    printf("\t\t[-f<fps>] - max values fps(frame per second), default 25.\n");
+    printf("\t\tRange from 1 to 30 fps.\n");
+    printf("\t\t[-a<address>] - Unicast or multicast address for streaming RTP\n");
+    printf("\t\t\tDefault 239.0.0.1\n");
+
+    printf("\t\t[-p<port>] - port for streaming data. Must be EVEN!\n");
+    printf("\t\t\tDefault 20000.\n");
+
+    printf("\t\t[-k<password>] - set encryption mode with key <password> (DES)\n");
+    printf("\t\t[-h]  - this help\n\n");
+  exit(-1);
+}
+
+int make_OggTheoraHdrs(const char *headers_filename)
+{
+     FILE      *headers_file;
+     u_int32_t  num_headers;
+     int        i,r;
+
+     //rtp foo, has to go
+    //struct stat     f_stat;
+
+    if ((headers_file = fopen(headers_filename, "r"))==NULL) {
+        fprintf(stderr,"error opening file %s for reading - error = %d (%s)\n",
+                        headers_filename,errno,strerror(errno)); 
+        return -1;
+    }
+    if (fread (&num_headers,   4, 1, headers_file)<1) 
+        return -4;
+    if (num_headers!=6) 
+        return -5;
+    if (fread (header_lengths, 4, 6, headers_file)<6) 
+        return -5;
+    if (fread (&kfgshiftm,     4, 1, headers_file)<1) 
+        return -5;
+
+    for (i=0;i<3;i++) 
+        packets[i].len=header_lengths[i]>>3; // now - in bytes
+    for (i=3;i<6;i++) 
+        packets[i].len=header_lengths[i]; // these are needed to be in bits
+    for (i=0;i<6;i++) {
+        header_lengths[i]=(header_lengths[i]+31)>>5;
+        packets[i].data=malloc(header_lengths[i]<<2);
+        if (((r=fread (packets[i].data, 4, header_lengths[i], headers_file))) < (int)header_lengths[i]) {
+           fprintf(stderr, "i=%d, fread returned %d, wanted - %d\n",
+                           i, r,header_lengths[i]);
+           return -6;
+        }     
+    }
+    fclose(headers_file);
+// now some RTP foo that is in no way RFC
+/*
+    stat(headers_filename,&f_stat);
+    hdr_size = f_stat.st_size;
+    //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+    // draft realese - TODO for RFC future
+    b_headers = (uint8_t *)malloc(hdr_size+1);
+    if ((headers_file = fopen(headers_filename, "r"))==NULL) {
+        fprintf(stderr,"error opening file %s for reading - error = %d (%s)\n",
+                       headers_filename,errno,strerror(errno)); 
+        return -1;
+    }
+    // put data into memory buffer
+    if (fread (b_headers+1,   hdr_size, 1, headers_file)<1) 
+        return -7;
+    hdr_size +=1;
+    fclose(headers_file);
+*/
+    return 0;    
+}
+
+static void main_loop() {
+    uint64_t    time_frame = 0;
+    uint32_t    len=0;
+    int         delta, nframe;
+    char        headers_filename[]="/tmp/headers";
+    char        controlfn[]="/dev/ccam_img";
+
+    int         devfd, i;
+    int         acq_data;
+    int         nframes_total, nframes_inter_full, nframes_inter_masked;
+    int         time_slow;
+    u_int8_t    *ccam_dma, *dp = NULL;
+    u_int32_t   *ccam_dma_index;
+    int         circindex_fd;
+    int         circbuf_fd;
+    int         circbuf_size;
+    int         circindex_size;
+ 
+    int         wp,wp0,frame_start = 0,frame_end,frame_type= 0,a_ready;
+    uint32_t    frame_length;
+    int         next_frame_start, frame_no =0,last_page_flags = 0;
+
+    //FIXME, use some random number here.
+    u_int32_t   stream_serial=0x114a36b7;
+    int         page = 0;
+    
+    //FIXME where does this have to go?                    
+    u_int64_t  granule=0;
+    int header_length;
+    ogg_header_t header;
+    int page_size=8192;
+
+
+    a_ready = 0; 
+    circindex_fd = open("/dev/circindex", O_RDWR);
+    if (circindex_fd<0) { // check control OK
+        fprintf(stderr,"Error opening %s\n", "/dev/circindex");
+        return ;
+    }
+    // find total buffer length
+    circindex_size=lseek(circindex_fd,0,2);
+    ccam_dma_index = (u_int32_t *) mmap(0, circindex_size, PROT_READ, MAP_SHARED, circindex_fd, 0);
+    if(ccam_dma_index ==((u_int32_t  *) -1)) {
+        fprintf(stderr,"Error in mmap %s\r\n","/dev/circindex");
+        close(circindex_fd);
+        return ;
+    }
+
+    circbuf_fd = open("/dev/circbuf", O_RDWR);
+    if (circbuf_fd<0) { // check control OK
+        fprintf(stderr,"Error opening %s\n", "/dev/circbuf");
+        close(circindex_fd);
+        return ;
+    }
+    // find total buffer length
+    circbuf_size=lseek(circbuf_fd,0,2);
+    fprintf(stderr,"circbuf stores %d long values (%d bytes)\n",
+                                                (circbuf_size>>2),circbuf_size);
+    ccam_dma = 
+        (u_int8_t *) mmap(0, circbuf_size, PROT_READ, MAP_SHARED, circbuf_fd, 0);
+    if(ccam_dma ==((u_int8_t  *) -1)) {
+        fprintf(stderr,"Error in mmap %s\r\n","/dev/circbuf");
+        close(circindex_fd);
+        close(circbuf_fd);
+        return ;
+    }
+    
+    InitTimer();
+    wp=wp0=0;
+    
+    nframe = HDR_INTERVAL;
+    nframes_total = 0;    // unlimited 
+    nframes_inter_full = 128;
+    nframes_inter_masked = 0;
+    time_slow = (int)(100./strm_data_par.fps);
+    fprintf(stderr,"fps =%f time_slow %d\n",strm_data_par.fps,time_slow);
+    acq_data = ((nframes_total)<<16 ) 
+              | (((nframes_inter_full   > 255)? 
+                255:
+                ((nframes_inter_full   < 0)?0:nframes_inter_full  )) << 8) 
+              | ((nframes_inter_masked > 255)? 
+                255:
+                ((nframes_inter_masked < 0)?0:nframes_inter_masked));
+
+    if(setup_tbl_FPGA( nframes_total, nframes_inter_full,
+                                      nframes_inter_masked, time_slow)<0)
+        return;
+    
+    if(make_OggTheoraHdrs(headers_filename)<0) {
+        fprintf(stderr,"Error prepare headers while parsing %s\n",headers_filename);
+        free(b_headers);
+        return;
+    }
+    frame_no = 0;
+
+    while (true) {
+        // start acquisition
+        fprintf(stderr,"start acquisition\n");
+        if ((devfd = open(controlfn, O_RDONLY)) <0) {
+            fprintf(stderr,"error opening file %s for reading - error = %d (%s)\n",
+                    controlfn,errno,strerror(errno));
+            return ;
+        }
+        // start compression
+        fprintf(stderr,"start compressoin\n");
+        ioctl(devfd, _IO(CMOSCAM_IOCTYPE, IO_CCAM_JPEG_GET_N ), acq_data);
+
+        //wait for encoding to be done (or aborted?)
+        fprintf(stderr,"wait for encoding\n");
+        while ((i=ioctl(devfd, _IO(CMOSCAM_IOCTYPE, IO_CCAM_MONITOR_SEQ ), 0)) > CAMSEQ_JPEG) {
+            if(strm_data->status == STOP_STREAM ) {
+                break;   // receive command STOP from web interface
+            }
+            // has to break here if http connection is closed
+            
+            // data ready ?    
+            if(wp == 0) {
+                while(frame_no <0)
+                    frame_no = ioctl(devfd, _CCCMD( CCAM_RPARS , P_JPEG_WP), 0)-1;
+                usec_sleep(mTimeinterval>>1);
+                sched_yield();
+                wp=1;
+            }
+
+            // dark_loop
+            fprintf(stderr,"dark loop\n");
+            do {
+                // what does this do??? 
+                last_page_flags= (ccam_dma_index[frame_no+1]==0xffffffff)?4:0;
+                
+                if (last_page_flags == 4) {
+                   usec_sleep(mTimeinterval);
+                   sched_yield();
+                }
+            } while(last_page_flags == 4);
+            fprintf(stderr,"dark loop done\n");
+            //frame_no = ioctl(devfd, _CCCMD( CCAM_RPARS , P_JPEG_WP), 0)-1;
+            // soft correction FPS    
+
+            frame_length=(ccam_dma_index[frame_no] & 0xfffffff)-frame_start;
+  
+            //index of next frame in dma
+            next_frame_start=((ccam_dma_index[frame_no] & 0xfffffff)+63) & (~0x1f);
+
+            frame_type=(ccam_dma_index[frame_no]>>28) & 3;
+
+            // figure out what this does?
+            wp0 = ioctl(devfd, _CCCMD( CCAM_RPARS , P_JPEG_WP), 0)-1;
+            if(wp0 < 0) {
+                fprintf (stderr,"frame length %d \tframe_no %d = %d \n",
+                                                     frame_length,frame_no,wp0);
+                frame_no=wp0;
+                wp = 0;
+                continue;
+            }
+
+            time_frame+= mTimeinterval; // time start for next frame INTER/INTRA
+
+            //pointer to next theora frame in camera dma
+            dp=&ccam_dma[frame_start];
+
+            //why this check for 1000000?
+            if((unsigned)frame_length <1000000) {
+                fprintf(stderr,"ogg_frame_page\n");
+                header_length= ogg_frame_page (&header,       // [1]
+                                       last_page_flags,       // [2]
+                                       page_size,             // [3]
+                                       granule,
+                                       stream_serial,
+                                       page++,
+                                       packets[3+frame_type], // [4]
+                                       &frame_length,         // [5]
+                                       &dp                    // [6]
+                                      );
+                
+                /*
+                 [1] pointer to the header data
+                     (returns - header length in bytes)
+                 [2] +1 - continuation, +4 - last (+2 - first)
+                     "last" will be masked out if needed
+                 [3]  maximal; page size to use
+                 [4]  not used if (flags & 1). 
+                      frame_header.len is measured in bits, not bytes!
+                 [5]  frame data length
+                 [6]  pointer to array with frame data(bytes)
+                */
+                
+                //FIXME now actually print the ogg page here.
+                fprintf(stderr,"FIXME, now print ogg page, header_length %d = frame_length %d \n",
+                                                     header_length,frame_length);
+                
+            }
+            frame_start=next_frame_start;
+            frame_no++;
+            if(frame_no > wp0)
+                wp = 0;
+
+            nframe++;
+            //???
+            //xmemchk();
+        }
+        if(strm_data->status == STOP_STREAM ) {
+        // stop sencor
+            // system("hello -z 0");
+            fprintf (stderr,"RTP Streamer stopped \n");
+            break;   // receive command STOP from web interface
+            //ioctl(devfd, _IO(CMOSCAM_IOCTYPE, IO_CCAM_JPEG ), JPEG_CMD_STOP);
+        } // if STOP_STREAM         
+    } // while main    
+//=========================== END MAIN LOOP ============================ 
+}
+
+
+int main(int argc, char *argv[]) 
+{
+    int         devfd,c,flag,use_web;
+
+    flag = 0;
+    use_web = false;
+    strcpy(strm_data_par.address,"239.0.0.1");
+    strm_data_par.port = 20000;
+    strm_data_par.fps  = 25.;
+    strm_data_par.status   = START_STREAM;
+    //strm_data_par.regim    = JPEG_ACCESS_DRV; 
+    //strm_data_par.scanning = STOP_SCANNING;
+    strcpy(strm_data_par.name,"Elphel Camera #1");
+    strcpy(strm_data_par.telephone,"1-800-RTP-HOT-PHONE");
+    strcpy(strm_data_par.toolname,"Elphel Theora Streamer");
+    strcpy(strm_data_par.note,"Draft release ofr RTP Theora");
+    strcpy(strm_data_par.location,"This camera located anywhere");
+    strcpy(strm_data_par.email,"camera at elphel.com");
+    strm_data_par.encrypt_key[0]='\0';
+
+    while(true) {
+        c = getopt(argc, argv, "hwa:p:f:k:");
+        if (c == -1)
+            break;
+     
+        switch (c) {
+            case 'h':
+                flag++;    
+                break;
+            case 'w':
+                use_web = true;     
+                break;
+            case 'a':
+                memset(strm_data_par.address,0,21);
+                strncpy(strm_data_par.address,optarg,20);
+                break;
+            case 'k':
+                memset(strm_data_par.encrypt_key,0,41);
+                strncpy(strm_data_par.encrypt_key,optarg,40);
+                strm_data_par.encryption=1;
+                break;
+            case 'p':
+                strm_data_par.port = atol(optarg);    
+                break;
+            case 'f':
+                strm_data_par.fps = atof(optarg);
+                if(strm_data_par.fps < 0. )
+                    strm_data_par.fps=25.;    
+                break;
+            case '?':
+                flag++;
+                break;
+            default:
+                fprintf (stderr,"?? getopt returned character code 0%o ??\n", c);
+        }
+    }
+    if ((optind < argc)|| flag>0) {
+        usage();
+        exit(1);
+    }
+    if(use_web) {
+        unlink(mmapFileName);
+        // map shared memory for manage this with CGI 
+        // where shared memory opening whith query too
+    
+        devfd = open(mmapFileName,O_RDWR|O_CREAT); 
+        if(devfd == -1) {
+            printf("Error opening %s!\n",mmapFileName);
+        }
+        lseek(devfd,sizeof(strm_data_t),SEEK_SET);
+        write(devfd,"",1);
+        strm_data = (strm_data_t *) mmap(0, sizeof(strm_data_t), 
+                                     PROT_READ|PROT_WRITE, MAP_SHARED, devfd, 0);
+        if((int)strm_data == -1) {
+             fprintf(stderr,"Error in mmap %s\r\n",mmapFileName);
+             close(devfd);
+             unlink(mmapFileName);
+             exit(1);
+        }
+    } 
+    else {
+        strm_data = &strm_data_par;  // use data from local buffer   
+        // not used web - start streamer immediate
+        strm_data_par.status = START_STREAM;
+    }       
+    
+    // OK - init data
+
+    // General LOOP waiting command START
+    while(true) {
+         if(strm_data->status == -1)
+            break;
+         if(strm_data->status == STOP_STREAM ) {
+            //sleep some time and test status again
+            usec_sleep(100000);
+            continue;
+         }
+
+        mTimeinterval = (int) TimestampTicks/strm_data->fps; // min interval between frames
+        fprintf(stderr,"Time frame %u for FPS %f, dest address %s:%d \n\n", mTimeinterval, strm_data->fps, 
+        strm_data->address,strm_data->port);
+        memcpy((void *)&strm_data_par,(void *)strm_data,sizeof(strm_data_t));
+         
+        fprintf(stderr,"\n HTTP Streamer for Theora starting...\n");
+        main_loop();
+  } // general while    
+  return 0;
+}

Added: experimental/j/Elphel333/http/config_cgi/.target-makefrag
===================================================================
--- experimental/j/Elphel333/http/config_cgi/.target-makefrag	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/http/config_cgi/.target-makefrag	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1 @@
+AXIS_BUILDTYPE=cris-axis-linux-gnu

Added: experimental/j/Elphel333/http/config_cgi/Makefile
===================================================================
--- experimental/j/Elphel333/http/config_cgi/Makefile	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/http/config_cgi/Makefile	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,49 @@
+AXIS_USABLE_LIBS = UCLIBC GLIBC
+include $(AXIS_TOP_DIR)/tools/build/Rules.axis
+
+INCDIR    = $(prefix)/include
+LIBDIR    = $(prefix)/lib
+
+INSTDIR   = $(prefix)/bin
+INSTMODE  = 0755
+
+INSTOWNER = root
+INSTGROUP = root
+
+CFLAGS   += -Wall -g -I$(INCDIR) -I$(AXIS_KERNEL_DIR)/include
+LDFLAGS  += -L$(LIBDIR) 
+
+ifndef UCLIBC
+# -lm - to use math library
+LDLIBS = -lcrypt -lm
+endif
+
+# miscellaneous OS-dependent stuff
+# linker
+LN= $(CC)
+# file deletion command
+RM= rm -f
+# file rename command
+MV= mv
+# End of configurable options.
+
+PROGS     = http_strm.cgi
+
+APPSOURCES= http_strm.c 
+SRCS= $(APPSOURCES)
+
+APPSOBJ= http_strm.o 
+
+OBJS= $(APPSOBJ)
+
+CFLAGS	+= -Wall
+
+all:	$(PROGS)
+
+http_strm.cgi: $(OBJS)
+	$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@
+	strip-cris http_strm.cgi
+
+clean:
+	rm -f $(PROGS) *.o *.bak *~ core 
+

Added: experimental/j/Elphel333/http/config_cgi/http_strm.c
===================================================================
--- experimental/j/Elphel333/http/config_cgi/http_strm.c	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/http/config_cgi/http_strm.c	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,206 @@
+/******************************************************************************
+ * This 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 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; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * ******************************************************************************/
+// CGI interface dispatcher for Theora http stream on  Elphel 333 camera
+// Copyright (c) 2005 Jan Gerber
+// /////////////////////////////////////////////////////////////////////////////
+
+#include <fcntl.h>  /*open*/
+#include <unistd.h> /* close, sleep */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/ioctl.h>
+
+#include <sys/types.h> /* for fstat */
+#include <sys/stat.h> /* for fstat */
+
+#include <sys/mman.h>    /* mmap */
+
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+
+#define QRY_MAXPARAMS 64
+struct key_value {
+  char *key;
+  char *value;
+};
+
+struct key_value gparams[QRY_MAXPARAMS+1];
+
+#define STOP_STREAM     0
+#define START_STREAM    1
+#define STOP_SCANNING   0
+#define START_SCANNING  1
+
+#define JPEG_ACCESS_MMAP 1
+#define JPEG_ACCESS_DRV  2
+
+typedef struct strm_common {
+  char   address[21];     // address or hostname
+  int    port;    // port no
+  double fps;    // soft FPS
+  int    regim;    // mmap/driver access to JPEG data
+  int    scanning;  // mode scanning on/off
+  char   name[21];  // SDES name field for subtitles
+  char   telephone[21];  // phone subtitles
+  char   toolname[21];
+  char   note[61];
+  char   location[41];
+  char   email[21];
+  char   encrypt_key[41];// encryption key
+  int    encryption;  // mode encryption on/off
+  int    status;    // start/top streamer
+} strm_data_t;
+
+
+/////////////////////// prototypes /////////////////////////////////////////
+int parseQuery(struct key_value * params, char * qry);
+char * paramValue(struct key_value * params, char * skey); // returns pointer to parameter value, NULL if not defined
+int unescape (char * s, int l);
+int hexdigit (char c);
+
+///////////////////////////////////////////////////////////////////////////
+
+int hexdigit (char c) {
+  int i;
+  i=c-'0';
+  if ((i>=0) && (i<10)) return i;
+  i=c-'a'+10;
+  if ((i>=10) && (i<16)) return i;
+  i=c-'A'+10;
+  if ((i>=10) && (i<16)) return i;
+  return 0;  // could be -1??
+}
+
+int unescape (char * s, int l) {
+  int i=0;
+  int j=0;
+  while ((i<l) && s[i]) {
+    if ((s[i]=='%') && (i<(l-2)) && s[i+1]){ // behavior from Mozilla
+      s[j++]=(hexdigit(s[i+1])<<4) | hexdigit(s[i+2]);
+      i+=3;
+    } else s[j++]=s[i++];
+  }
+  if (i<l) s[j]=0;
+  return j;
+}
+
+int parseQuery(struct key_value * params, char * qry)
+{
+  char * cp;
+  int l=0;
+  cp=strtok(qry,"=");
+  while ((cp) && (l<QRY_MAXPARAMS)) {
+    params[l].key=cp;
+    cp=strtok(NULL,"&");
+    params[l++].value=cp;
+    if (cp) cp=strtok(NULL,"=");
+  }
+ params[l].key=NULL;
+ return l;
+}
+
+char * paramValue(struct key_value * params, char * skey)
+{ // returns pointer to parameter value, NULL if not defined
+  int i=0;
+  if (skey)
+   while ((i<QRY_MAXPARAMS) && (params[i].key)) {
+    if (strcmp(skey,params[i].key)==0) return   params[i].value;
+
+    i++;
+   }
+  return NULL;
+}
+
+
+////////////////////////////////////////////////////////////////////////
+int main (int argc, char *argv[]) {
+  int devfd,i,code;
+  char * cp;
+  char * vp;
+  /* these are from cgitest.cgi */
+  const char *method;
+  const char *query;
+  const char *uri;
+  char  copyQuery [4096];
+
+  const char mmapFileName[]= "/var/tmp/mmap_strm";
+  strm_data_t    *strm_data;
+
+  method = getenv("REQUEST_METHOD");
+  query  = getenv("QUERY_STRING");
+  uri    = getenv("REQUEST_URI");
+  i= (query)? strlen (query):0;
+     fprintf(stderr,"querry length=%d\n", i);
+
+  if (i>(sizeof(copyQuery)-1)) i= sizeof(copyQuery)-1;
+  if (i>0) strncpy(copyQuery,query, i);
+  copyQuery[i]=0;
+  unescape(copyQuery,sizeof(copyQuery));
+
+  if (method == NULL) {
+    /* Not a CGI! */
+    printf("This program should be run as a CGI from the web server!\n");
+    exit(1);
+  }
+
+  parseQuery(gparams, copyQuery);
+  //open mmap memory
+  devfd = open(mmapFileName,O_RDWR);   //S_IRWXU);
+  if(devfd == -1) {
+    printf("Error create SHM data!\n");
+  }
+  lseek(devfd,sizeof(strm_data_t),SEEK_SET);
+  strm_data = (strm_data_t *)mmap(0, sizeof(strm_data_t), PROT_READ|PROT_WRITE, MAP_SHARED, devfd, 0);
+  if((int)strm_data == -1) {
+    fprintf(stderr,"Error in mmap %s\r\n",mmapFileName);
+    close(devfd);
+    exit(1);
+  }
+  code = STOP_STREAM;
+  if((vp=paramValue(gparams, "c")))  
+    code = strtol(vp,&cp,10);
+  if((strm_data->status == START_STREAM ) && code== START_STREAM) {
+    // streamer already started! Restart it with new parameters
+    strm_data->status = STOP_STREAM;
+    // wait some time
+    usleep(100000);
+   }
+
+   if ((vp=paramValue(gparams, "addr")))  strncpy(strm_data->address,vp,20);
+   if ((vp=paramValue(gparams, "port")))  strm_data->port = strtol (vp,&cp,10);
+   if ((vp=paramValue(gparams, "fps")))   strm_data->fps  = strtod(vp,&cp);
+   if ((vp=paramValue(gparams, "scan")))  strm_data->scanning = strtol (vp,&cp,10);
+   if ((vp=paramValue(gparams, "reg")))   strm_data->regim = strtol (vp,&cp,10);
+
+   if ((vp=paramValue(gparams, "name")))  strncpy(strm_data->name,vp,20);
+   if ((vp=paramValue(gparams, "loc")))   strncpy(strm_data->location,vp,40);
+   if ((vp=paramValue(gparams, "note")))  strncpy(strm_data->note,vp,60);
+   if ((vp=paramValue(gparams, "tool")))  strncpy(strm_data->toolname,vp,20);
+   if ((vp=paramValue(gparams, "phone"))) strncpy(strm_data->telephone,vp,20);
+   if ((vp=paramValue(gparams, "email"))) strncpy(strm_data->email,vp,20);
+   if ((vp=paramValue(gparams, "key")))   strncpy(strm_data->encrypt_key,vp,40);
+   if ((vp=paramValue(gparams, "encr")))  strm_data->encryption = strtol (vp,&cp,10);
+
+   // OK - new parameters passed to mapped memory
+   // start streamer
+
+   strm_data->status = code;
+   close(devfd);
+   return 0;
+}

Added: experimental/j/Elphel333/http/config_cgi/index1.html
===================================================================
--- experimental/j/Elphel333/http/config_cgi/index1.html	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/http/config_cgi/index1.html	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,1215 @@
+<html>
+<head>
+<style>
+<!--
+#window_selection{
+position:absolute;
+left:0;
+top:0;
+width:1px;
+height:1px;
+color:red;
+z-index:100;
+font-size:1px;
+border: 1px #FF0000 solid;}
+
+.inputs    {  background-color: #EEEEEE; text-align: right; font-family: Verdana, Arial, Helvetica, sans-serif}
+.textStyle {  font-family: Verdana, Arial, Helvetica, sans-serif}
+.info      {  background-color: #aaaaaa; text-align: right; font-family: Verdana, Arial, Helvetica, sans-serif; color: #FF0033}
+.nowrap    {  text-align: right; white-space: nowrap;}
+-->
+</style>
+
+<script language="JavaScript">
+var isDOM=document.getElementById?true:false;
+var isOperaIE= document.all?true:false;
+  document.dragging=false;
+  document.dragEn=false;
+  document.previewDecimation=2;
+//  document.previewScale=1/document.previewDecimation;
+  document.maxWidth=1280;
+  document.maxHeight=1024;
+  document.dcm=1;
+  document.flipX=1;
+  document.flipY=0;
+  document.cgi="/admin-bin/ccam.cgi?";
+  document.previewURL="";
+  document.newWinURL="";
+  document.updateURL="";
+  document.startStopClipURL="pics/1pix.jpeg";
+  document.commonParameters="";
+//  document.commonOptions="vxych";
+//  document.defaultOptions="vxyh";
+  document.defaultOptions="vh";
+  document.saveExposure=20;
+  document.firstX=0;
+  document.firstY=0;
+  document.sizeX; // signed
+  document.sizeY; // signed
+  document.discret=1;
+  document.snap=4;
+  document.mapTop=0;
+  document.mapLeft=0;
+  document.mapWidth= document.maxWidth/document.previewDecimation;
+  document.mapHeight=document.maxHeight/document.previewDecimation;
+  document.minTilesX=2;
+  document.minTilesY=2;
+  document.imageGot=0;
+  document.clipFrame=0;
+  document.sensor=49; // MT9M001
+  document.sensorBlack=0;
+  document.sensorWhite=254;
+  document.updateTime=3000; // will sync if not in use longer than...
+  document.timeoutCntr=0;  // watches if there is any pending timeout
+  document.updating=0;
+  document.dummyImg=new Image();
+  document.timeNotSet=1;
+  document.acquireImage=""; // string to evaluate after camera is tested that it is not running streamer
+  document.discret_x=128;
+  document.discret_y=64;
+//////////// for Theora RTP streamer ///////////////////
+  document.Address = "239.0.0.1";
+  document.Port = 20000;
+  document.Sfps = 15;
+  document.cgi_strm ="/admin-bin/cstrm.cgi?";  
+  document.startStopStreamerURL="pics/1pix.jpeg";
+
+//////////////////////////////// STREAMER FUNCTIONS ///////////////////////////////////////////
+function StreamerStartStop(c) {
+
+ document.Sfps=parseFloat(document.getElementById("idRequestedFPS").value);
+ document.startStopStreamerURL=document.cgi_strm+"opt=s&addr="+document.Address
+  				+"&port="+document.Port+"&fps="+document.Sfps
+		                +"&c="+c
+  if(c==1) {
+    document.dummyImg.src=document.startStopStreamerURL;
+   } 
+   else { 
+    document.dummyImg.src=document.startStopStreamerURL;
+   }
+//alert(document.startStopStreamerURL);
+}
+
+function updateAddress() {
+document.Address=document.getElementById("idAddress").value;
+
+//alert('change Address for stream '+document.Address);
+}
+
+function updatePort() {
+var port=parseInt(document.getElementById("idPort").value);
+if (port < 20000) { alert( 'Port must be above 20000 !!! ');
+	document.Port=20000;
+	document.getElementById("idPort").value=20000;
+} else if(port>50000) { alert("Port number to big!");
+	document.Port=20000;
+	document.getElementById("idPort").value=20000;
+}else if (Math.floor(port/2)*2 !=port) { alert("Port number must be EVEN !!! ");
+		document.Port = 20000;
+ 	     document.getElementById("idPort").value=20000;	
+} else document.Port=port;
+
+}
+/////////////////////////////////////// Streamer END /////////////////////////////////////////////////////////////
+
+
+// XML related stuff
+// abort did not work? try different object
+function loadXMLDocDummy(url) {
+    // branch for native XMLHttpRequest object
+    if (window.XMLHttpRequest) {
+        dummyReq = new XMLHttpRequest();
+        dummyReq.onreadystatechange = processDummyReqChange;
+        dummyReq.open("GET", url, true);
+        dummyReq.send(null);
+    // branch for IE/Windows ActiveX version
+    } else if (window.ActiveXObject) {
+        dummyReq = new ActiveXObject("Microsoft.XMLHTTP");
+        if (dummyReq) {
+            dummyReq.onreadystatechange = processDummyReqChange;
+            dummyReq.open("GET", url, true);
+            dummyReq.send();
+        }
+    }
+}
+function processDummyReqChange() {
+    if ((dummyReq.readyState >1 ) && document.timeNotSet) {
+      document.timeNotSet=0;
+      dummyReq.abort();  // abort that reply from 1972
+      updateXML(); // start over again
+    }
+}
+
+
+function loadXMLDoc(url) {
+    // branch for native XMLHttpRequest object
+    if (window.XMLHttpRequest) {
+        req = new XMLHttpRequest();
+        req.onreadystatechange = processReqChange;
+        req.open("GET", url, true);
+        req.send(null);
+    // branch for IE/Windows ActiveX version
+    } else if (window.ActiveXObject) {
+        req = new ActiveXObject("Microsoft.XMLHTTP");
+        if (req) {
+            req.onreadystatechange = processReqChange;
+            req.open("GET", url, true);
+            req.send();
+        }
+    }
+}
+function processReqChange() {
+    // only if req shows "loaded"
+    if (req.readyState == 4) {
+        // only if "OK"
+        if (req.status == 200) {
+            // ...processing statements go here...
+          getFromCamera();
+        } else {
+            alert("There was a problem retrieving the XML data:\n" +
+                req.statusText);
+        }
+    }
+    window.status=req.readyState;
+//   if (req.readyState>1)   alert("req.readyState="+req.readyState);
+}
+
+function acquireIfCan(cmd) {
+    // branch for native XMLHttpRequest object
+    document.acquireImage=cmd;
+//    myAlert("acquireIfCan: "+cmd);
+    
+    url=document.loadXMLStateURL;
+    if (window.XMLHttpRequest) {
+        camState = new XMLHttpRequest();
+        camState.onreadystatechange = processStateChange;
+        camState.open("GET", url, true);
+        camState.send(null);
+    // branch for IE/Windows ActiveX version
+    } else if (window.ActiveXObject) {
+        camState = new ActiveXObject("Microsoft.XMLHTTP");
+        if (camState) {
+            camState.onreadystatechange = processStateChange;
+            camState.open("GET", url, true);
+            camState.send();
+        }
+    }
+}
+function processStateChange() {
+    // only if req shows "loaded"
+    if (camState.readyState == 4) {
+        // only if "OK"
+        if (camState.status == 200) {
+            // ...processing statements go here...
+           if (parseInt(camState.responseXML.getElementsByTagName('SENSOR_STATE' )[0].firstChild.nodeValue)>7)  {
+              alert("Can not acquire preview image as streamer is possibly running.\n"+
+                      "You may want to try to stop it or reset the camera");
+// and just do nothing...                      
+           } else {
+// here - actually acquire requested image
+             eval(document.acquireImage);
+           }           
+
+
+        } else {
+            alert("There was a problem retrieving the XML data:\n" +
+                camState.statusText);
+        }
+    }
+}
+
+function updateXML() {
+ document.updating++;
+ updateLinks(); // move it later outside?
+ if (document.timeNotSet) loadXMLDocDummy(document.loadXMLDocURL);
+ else                     loadXMLDoc(document.loadXMLDocURL);
+ 
+// alert(document.updating);
+}
+function myAlert(s) {
+  var sl=60;
+  var i=0;
+
+  while (i< s.length) {
+   if ((s.length-i)<sl) sl=s.length-i;
+   s=s.substr(0,i).concat("\n",s.substr(i, s.length-i));
+   i+=sl+1;
+  }
+ alert (s);  
+}
+function watchDog(t) {
+  document.timeoutCntr++;
+ window.status=document.timeoutCntr;
+//  setTimeout('document.timeoutCntr--;',t);
+  setTimeout('document.timeoutCntr--;window.status=document.timeoutCntr',t);
+}
+
+
+
+
+
+
+function updateFPS() {
+}
+
+function g2n() { // setst numeric window dimentions accrording to dragging
+// update values in the text fields
+ document.getElementById("idHeight").value= Math.round(Math.abs(document.sizeY)*document.previewDecimation);
+ document.getElementById("idWidth").value=  Math.round(Math.abs(document.sizeX)*document.previewDecimation);
+/* document.getElementById("idBottom").value= document.maxHeight-
+       (Math.round(Math.min(document.firstY, document.firstY + document.sizeY + document.discret)*document.previewDecimation)+document.getElementById("idHeight").value);
+*/       
+/*
+ document.getElementById("idBottom").value= document.maxHeight-
+       (Math.round(Math.max(document.firstY, document.firstY + document.sizeY + document.discret)*document.previewDecimation)+document.getElementById("idHeight").value);
+*/       
+ document.getElementById("idBottom").value= Math.round((document.mapHeight-Math.max(document.firstY, document.firstY + document.sizeY + document.discret))*document.previewDecimation);
+ document.getElementById("idLeft").value=
+       Math.round(Math.min(document.firstX, document.firstX + document.sizeX + document.discret)*document.previewDecimation);
+ updateNumWindow();
+}
+
+function commonDragging(mouseX,mouseY){ 
+ if (document.dragging) {
+   var dsc=16*document.dcm/document.previewDecimation;
+
+   var y=mouseY - document.mapTop;
+   var x=mouseX - document.mapLeft;
+// Snap to borders
+   if (x<document.snap) x=0;  else if (x>=document.mapWidth-document.snap) x=document.mapWidth-1;
+   if (y<document.snap) y=0;  else if (y>=document.mapHeight-document.snap) y=document.mapHeight-1;
+
+   var h=Math.abs(y-document.firstY)+1;
+   var w=Math.abs(x-document.firstX)+1;
+   h=dsc*Math.floor(h/dsc); if (h<dsc*document.minTilesY) h=dsc*document.minTilesY;
+   w=dsc*Math.floor(w/dsc); if (w<dsc*document.minTilesX) w=dsc*document.minTilesX;
+   if (y<document.firstY)  h=-h;
+   if (x<document.firstX)  w=-w;
+  
+   if ((h!=document.sizeY) || (w!=document.sizeY)) {
+     document.sizeY=h;
+     document.sizeX=w;
+
+   g2n();
+   } 
+ }
+}
+
+function  commonMouseDown (mouseX,mouseY) {
+   document.discret=2*document.dcm/document.previewDecimation; if (document.discret<1) document.discret=1;
+   var y=mouseY - parseInt(document.getElementById("mapImage").style.top);
+   var x=mouseX - parseInt(document.getElementById("mapImage").style.left);
+   document.sizeY=16*document.minTilesY*document.dcm/document.previewDecimation;
+   document.sizeX=16*document.minTilesX*document.dcm/document.previewDecimation;
+// Snap to borders
+   if (x<document.snap) x=0;  else if (x>=document.mapWidth-document.snap) x=document.mapWidth-document.discret;
+   if (y<document.snap) y=0;  else if (y>=document.mapHeight-document.snap) y=document.mapHeight-document.discret;
+
+   document.firstY=document.discret*Math.round(y/document.discret); 
+   document.firstX=document.discret*Math.round(x/document.discret);
+   if ((document.firstY + document.sizeY)>document.mapHeight) document.sizeY =- document.sizeY;
+   if ((document.firstX + document.sizeX)>document.mapWidth)  document.sizeX =- document.sizeX;
+   g2n();
+
+   document.dragging=true;
+
+}
+
+function  commonMouseUp   () {
+ endDragging();
+}
+
+
+
+
+
+function initDragging()
+{
+  if (!document.dragEn) {
+    if(isDOM) {
+	 if (!isOperaIE) {
+       document.getElementById("mapImage").addEventListener("mousemove", dragging_Mozilla, true);
+       document.getElementById("mapImage").addEventListener("mousedown", mouseDown_Mozilla, true);
+       document.getElementById("mapImage").addEventListener("mouseup",   mouseUp_Mozilla, true);
+     } else {
+       document.getElementById("mapImage").onmousemove= dragging_Opera;
+       document.getElementById("mapImage").onmousedown= mouseDown_Opera;
+       document.getElementById("mapImage").onmouseup=   mouseUp_Opera ;
+	 }
+    }
+    else alert ("incompartible browser");
+    document.getElementById("window_selection").style.borderColor= "#00ff00";
+    document.dragEn=true;
+  }
+
+}
+function endDragging()
+{
+ document.dragging=false;
+  if (document.dragEn) {
+    if(isDOM) {
+	 if (!isOperaIE) {
+      document.getElementById("mapImage").removeEventListener("mousemove", dragging_Mozilla, true);
+      document.getElementById("mapImage").removeEventListener("mousedown", mouseDown_Mozilla, true);
+      document.getElementById("mapImage").removeEventListener("mouseup",   mouseUp_Mozilla, true);
+     } else {
+       document.getElementById("mapImage").onmousemove= null;
+       document.getElementById("mapImage").onmousedown= null;
+       document.getElementById("mapImage").onmouseup=   null;
+	 }
+    }
+
+    else alert ("incompartible browser");
+    document.dragEn=false;
+    document.getElementById("window_selection").style.borderColor= "#ff0000";
+  }
+}
+
+function updateColor(){
+ document.commonOptions=document.defaultOptions;
+ if (document.getElementById("idColor").checked)document.commonOptions+="c";
+ if (document.flipX) document.commonOptions+="x";
+ if (document.flipY) document.commonOptions+="y";
+// alert ("updateColor: document.commonOptions="+document.commonOptions);
+ updateLinks();
+}
+
+function updateGamma(){
+var g;
+ g=parseFloat(document.getElementById("idGamma").value);
+ if (!((g>=0.13)&&(g<=10))) document.getElementById("idGamma").value=0.47;
+  updateLinks();
+}
+
+// document.getElementById("idLevelBlack").value=2;
+// document.getElementById("idLevelWhite").value=254;
+function updateLevels(){
+  var vb,vw;
+  vb=parseInt(document.getElementById("idLevelBlack").value);
+  if (!((vb>=0)&&(vb<=254))) {
+    vb=0;
+    document.getElementById("idLevelBlack").value=0;
+  }  
+  vw=parseInt(document.getElementById("idLevelWhite").value);
+  if (!((vw>=vb)&&(vw<=255))) document.getElementById("idLevelWhite").value=255;
+ 
+}
+
+
+
+function updateGains(){
+var g;
+ g=parseInt(document.getElementById("idGainY").value); if (!((g>=0)&&(g<=63))) document.getElementById("idGainY").value=20;
+ g=parseInt(document.getElementById("idGainR").value); if (!((g>=0)&&(g<=63))) document.getElementById("idGainR").value=20;
+ g=parseInt(document.getElementById("idGainG").value); if (!((g>=0)&&(g<=63))) document.getElementById("idGainG").value=20;
+ g=parseInt(document.getElementById("idGainB").value); if (!((g>=0)&&(g<=63))) document.getElementById("idGainB").value=20;
+  updateLinks();
+}
+function updateExposure(){ //now it is measured in 100uS
+//  var e=parseInt(document.getElementById("idExposure").value); if (!((e>0)&&(e<10000))) document.getElementById("idExposure").value=20;
+  var e=parseFloat(document.getElementById("idExposure").value); if (!((e>0)&&(e<10000))) e=20;
+    e=Math.round (10*e)/10;document.getElementById("idExposure").value=e;
+
+//  document.saveExposure=parseInt(document.getElementById("idExposure").value);
+  document.saveExposure=parseFloat(document.getElementById("idExposure").value);
+  document.getElementById("idFrameTime").checked=false;
+  updateLinks();
+}
+function updateFullFrameExposure(){
+  document.getElementById("idExposure").value=(document.getElementById("idFrameTime").checked)?"":document.saveExposure;
+  updateLinks();
+}
+function updateQuality(){
+  var v=v=parseInt(document.getElementById("idQuality").value);
+  if (!((v>0)&&(v<=100))) document.getElementById("idQuality").value=50;
+  updateLinks();
+}
+function updateSaturation(m){ // m=0 - set both (from blue), m=1 - red only
+  var v;
+   if (m>0) {
+     v=parseFloat(document.getElementById("idSaturationRed").value);
+     if (!((v>=0)&&(v<=5))) v=1.0;
+     document.getElementById("idSaturationRed").value=v;
+   } else {
+     v=parseFloat(document.getElementById("idSaturationBlue").value);
+     if (!((v>=0)&&(v<=5))) v=1.0;
+     document.getElementById("idSaturationBlue").value=v;
+     document.getElementById("idSaturationRed").value=v;
+   }     
+  updateLinks();
+}
+function updateVideoSize(){
+      v=parseInt(document.getElementById("idTimeScale").value); if (!((v>0)&&(v<1000))) document.getElementById("idTimeScale").value=10;
+      v=parseInt(document.getElementById("idTheoraFrames").value); if (!((v>0)&&(v<65536))) document.getElementById("idTheoraFrames").value=40;
+      v=parseInt(document.getElementById("idTheoraInter").value); if (!((v>=0)&&(v<256))) document.getElementById("idTheoraInter").value=255;
+  updateLinks();
+}
+function showControls(){
+ var w;
+    w=window.open('vcontrols.html',
+                  'Controls'+escape(document.URL),
+                  'resizable=no,scrollbars=no,status=no,alwaysRaised=yes,height=335,width=100' );
+   w.focus();
+}
+function showClipFrame(){
+//    var w=window.open('clip_frame.html',
+//                  'Frame'+escape(document.URL),
+//                  'resizable=no,scrollbars=no,status=no,alwaysRaised=yes,'+
+//                  'height='+(100+parseInt(document.getElementById('idHeight').value))+
+//                  'width='+(20+parseInt(document.getElementById('idWidth').value)) );
+//   w.focus();
+  acquireIfCan("var w=window.open('clip_frame.html'," +
+               "'Frame'+escape(document.URL)," +
+               "'resizable=no,scrollbars=no,status=no,alwaysRaised=yes,'+" +
+               "'height='+(100+parseInt(document.getElementById('idHeight').value))+ "+
+               "'width='+(20+parseInt(document.getElementById('idWidth').value)) ); "+
+               "w.focus();" );
+
+}
+
+function updateLinks(){
+   var t=new Date();
+   var g;
+   var e=Math.round (parseFloat(document.getElementById("idExposure").value)*10); // 10 times actual
+   var requestedFPS;
+   updateFPS();
+   requestedFPS=parseFloat(document.getElementById("idRequestedFPS").value);
+   if (!(requestedFPS>0)){
+     requestedFPS=0;
+     document.getElementById("idRequestedFPS").value=" ";
+   }
+   var dcms="&dv="+document.dcm+"&dh="+document.dcm+"&";
+   document.commonParameters ="iq="+parseInt(document.getElementById("idQuality").value)+"&"+
+                              "kga="+parseInt(document.getElementById("idGainY").value)+"&"+
+                              "kgm=6&"+
+                              "gr="+ parseInt(document.getElementById("idGainR").value)+"&"+
+                              "gg="+ parseInt(document.getElementById("idGainG").value)+"&"+
+                              "ggb="+parseInt(document.getElementById("idGainG").value)+"&"+
+                              "gb="+ parseInt(document.getElementById("idGainB").value)+"&"+
+                              "csb="+Math.round(100*parseFloat(document.getElementById("idSaturationBlue").value))+"&"+
+                              "csr="+Math.round(100*parseFloat(document.getElementById("idSaturationRed").value))+"&"+
+                              "bit=8"+"&"+
+                              "gam="+Math.round(100*parseFloat(document.getElementById("idGamma").value))+"&"+
+                              "pxl="+parseInt(document.getElementById("idLevelBlack").value)+"&"+
+                              "pxh="+parseInt(document.getElementById("idLevelWhite").value);
+   if (!document.getElementById("idFrameTime").checked)
+     document.commonParameters+="&e="+e;
+   else document.commonParameters+="&e=-1";
+/*
+   document.previewURL=document.cgi+"opt="+document.commonOptions+
+//         "&dv=2&dh=2&ww=1280&wh=1024&wl=0&wt=0&"+
+
+         "&dv="+document.previewDecimation+"&dh="+document.previewDecimation+"&ww="+document.maxWidth+"&wh="+document.maxHeight+"&wl=0&wt=0&"+
+         document.commonParameters+
+         "&fps="+ requestedFPS+
+         "&_time="+t.getTime();
+*/
+   document.previewURL="/pics/nopreview.gif";
+   
+   
+   document.probeURL=document.cgi+"opt="+document.commonOptions+
+         "&dv=1&dh=1&ww=2100&wh=2100&wl=0&wt=0&iq=1"+"&_time="+t.getTime();
+
+  document.commonParameters+= "&ww="+ parseInt(document.getElementById("idWidth").value)+"&"+
+                              "wh="+ parseInt(document.getElementById("idHeight").value)+"&"+
+                              "wl="+ parseInt(document.getElementById("idLeft").value)+"&"+
+                              "wt="+ parseInt(document.getElementById("idBottom").value);
+//new/new win will be ogg/theora
+   document.newWinURL= document.cgi+"opt=o"+document.commonOptions+dcms+
+                       document.commonParameters+
+                       "&fps="+ requestedFPS+
+                       "&tts="+ parseInt(document.getElementById("idTimeScale").value)+
+                       "&tnf="+ parseInt(document.getElementById("idTheoraFrames").value)+
+                       "&tni="+ parseInt(document.getElementById("idTheoraInter").value)+
+                       "&_time="+t.getTime();
+   document.updateURL= document.cgi+"opt="+document.commonOptions+"u"+dcms+
+                       document.commonParameters+
+                       "&fps="+ requestedFPS+
+                       "&_time="+t.getTime();
+
+  document.startStopClipURL=document.cgi+"opt="+document.commonOptions+"q"+dcms+document.commonParameters+
+                              "&qts="+ parseInt(document.getElementById("idTimeScale").value)+
+                              "&fps="+ requestedFPS+
+                              "&_time="+t.getTime()+"&qcmd=";
+   document.getElementById('idStillPhoto').href=document.newWinURL;
+   document.getElementById('idLastPhoto').href=document.cgi+"opt=o"+"&_time="+t.getTime();
+//   document.getElementById('idFrame').href=document.cgi+"hist="+document.clipFrame+"&_time="+t.getTime();
+   document.getElementById('idInfo').href=document.cgi+"html=2"+"&_time="+t.getTime();
+
+/*   document.getElementById('idClip').href=document.cgi+"opt="+document.commonOptions+"q"+dcms+document.commonParameters+
+                              "&qcmd=4"+
+                              "&qts="+ parseInt(document.getElementById("idTimeScale").value)+
+                              "&fps="+ requestedFPS+
+                              "&_time="+t.getTime();*/
+  document.loadXMLDocURL=document.cgi+"html=10&_time="+t.getTime();
+  document.loadXMLStateURL=document.cgi+"html=12&_time="+t.getTime();
+  document.rescueURL=document.cgi+"opt=*q&qcmd=2&_time="+t.getTime(); // unfreeze
+  document.setTimeURL=document.cgi+"_time="+t.getTime(); // unfreeze
+}
+function updateClipFrame(v){
+  if ((v<9999) && (v>-9999)) document.clipFrame=v;
+  document.getElementById("idClipFrame").value=document.clipFrame;
+  updateLinks();
+}
+function changeClipFrame(m) { // m=-2 - first, m=-1 - prev, +1 - next, +2 - last
+  if      (m==-2) document.clipFrame= 1; //first
+  else if (m==-1) document.clipFrame-=1; //previous
+  else if (m== 1) document.clipFrame+=1; //next
+  else if (m== 2) document.clipFrame=0; //last
+  updateClipFrame(document.clipFrame);
+}
+function clipStartStop(c) {
+  updateLinks();
+  document.dummyImg.src=document.startStopClipURL+c;
+}
+function updateParameters() {
+  updateLinks();
+  document.dummyImg.src=document.updateURL;
+}
+function cameraReset() {
+  updateLinks();
+  document.dummyImg.src=document.rescueURL;
+}
+function setTimeIf1972(){
+  updateLinks();
+  document.dummyImg
+  document.dummyImg.onload=updateXML;
+  document.dummyImg.src=document.setTimeURL;
+//  alert(document.dummyImg.src);
+}
+function getFromCamera(){
+   document.imageGot=1;
+   document.maxWidth=                        parseInt(req.responseXML.getElementsByTagName('P_SENSOR_WIDTH' )[0].firstChild.nodeValue);
+   document.maxHeight=                       parseInt(req.responseXML.getElementsByTagName('P_SENSOR_HEIGHT')[0].firstChild.nodeValue);
+// don't read decimation - it will likely be from the perview
+// document.dcm=                             parseInt(req.responseXML.getElementsByTagName('P_DCM_HOR'      )[0].firstChild.nodeValue);
+   
+   document.getElementById("idDCM8").checked=(document.dcm>=8);
+   document.getElementById("idDCM4").checked=((document.dcm>=4) && (document.dcm<8));
+   document.getElementById("idDCM2").checked=((document.dcm>=2) && (document.dcm<4));
+   document.getElementById("idDCM1").checked=                      (document.dcm<2);
+   document.getElementById("idGainY").value= parseInt(req.responseXML.getElementsByTagName('P_SPEC_KAC_GGA' )[0].firstChild.nodeValue);
+   document.getElementById("idGainR").value= parseInt(req.responseXML.getElementsByTagName('P_GAINR'        )[0].firstChild.nodeValue);
+   document.getElementById("idGainG").value= parseInt(req.responseXML.getElementsByTagName('P_GAING'        )[0].firstChild.nodeValue);
+   document.getElementById("idGainB").value= parseInt(req.responseXML.getElementsByTagName('P_GAINB'        )[0].firstChild.nodeValue);
+
+   document.getElementById("idWidth").value= parseInt(req.responseXML.getElementsByTagName('P_WOI_WIDTH'    )[0].firstChild.nodeValue);
+   document.getElementById("idHeight").value=parseInt(req.responseXML.getElementsByTagName('P_WOI_HEIGHT'   )[0].firstChild.nodeValue);
+   document.getElementById("idLeft").value=  parseInt(req.responseXML.getElementsByTagName('P_WOI_LEFT'     )[0].firstChild.nodeValue);
+   document.getElementById("idBottom").value=   parseInt(req.responseXML.getElementsByTagName('P_WOI_TOP'      )[0].firstChild.nodeValue);
+   
+   document.flipX= (parseInt(req.responseXML.getElementsByTagName('P_FLIPH')[0].firstChild.nodeValue)>0)?1:0;
+   document.flipY= (parseInt(req.responseXML.getElementsByTagName('P_FLIPV')[0].firstChild.nodeValue)>0)?1:0;
+   document.getElementById("idColor").checked= (parseInt(req.responseXML.getElementsByTagName('P_COLOR')[0].firstChild.nodeValue)>0)?"true":"false";
+   document.getElementById("idGamma").value= 0.01*parseInt(req.responseXML.getElementsByTagName('P_GAMMA'        )[0].firstChild.nodeValue);
+   document.getElementById("idSaturationBlue").value= 0.01*parseInt(req.responseXML.getElementsByTagName('P_COLOR_SATURATION_BLUE')[0].firstChild.nodeValue);
+   document.getElementById("idSaturationRed").value= 0.01*parseInt(req.responseXML.getElementsByTagName('P_COLOR_SATURATION_RED' )[0].firstChild.nodeValue);
+
+   document.getElementById("idLevelBlack").value=parseInt(req.responseXML.getElementsByTagName('P_PIXEL_LOW' )[0].firstChild.nodeValue);
+   document.getElementById("idLevelWhite").value=parseInt(req.responseXML.getElementsByTagName('P_PIXEL_HIGH')[0].firstChild.nodeValue);
+
+   
+   document.getElementById("idQuality").value= parseInt(req.responseXML.getElementsByTagName('P_QUALITY'      )[0].firstChild.nodeValue);
+   document.getElementById("idExposure").value= 0.1*parseInt(req.responseXML.getElementsByTagName('P_EXPOS'   )[0].firstChild.nodeValue);
+   document.previewDecimation=(document.maxWidth>1600)?4:2;
+
+   document.getElementById('mapImage').style.width=document.maxWidth/document.previewDecimation;
+   document.getElementById('mapImage').style.height=document.maxHeight/document.previewDecimation;
+   document.getElementById('idControls').style.top=document.maxHeight/document.previewDecimation+8;
+   if (document.previewDecimation==2)    document.getElementById('idControls').style.width=document.maxWidth/document.previewDecimation;
+   document.mapWidth= document.maxWidth/document.previewDecimation;
+   document.mapHeight=document.maxHeight/document.previewDecimation;
+//   fullWindow();
+// read defaults if sensor was never programmed 
+   document.sensor=parseInt(req.responseXML.getElementsByTagName('P_SENSOR' )[0].firstChild.nodeValue);
+   if ((!(parseInt(req.responseXML.getElementsByTagName('SENSOR_STATE' )[0].firstChild.nodeValue)>0)) ||
+       (!(parseInt(req.responseXML.getElementsByTagName('P_QUALITY' )[0].firstChild.nodeValue)>0))) {
+         setDefaults();
+   }
+//    else updateLinks();
+   updateColor();
+   updateNumWindow();
+   if (parseInt(req.responseXML.getElementsByTagName('SENSOR_STATE' )[0].firstChild.nodeValue)<8) {
+     document.getElementById("mapImage").style.backgroundImage="url("+document.previewURL+")";
+   } else alert("Can not acquire preview image as streamer is possibly running.\n"+
+              "You may want to try to stop it or reset the camera");
+   if ((document.sensor >=49) && (document.sensor <=51))  document.getElementById("idGainY").style.display="none";
+}
+function setDefaults() {
+// common defaults:
+   document.flipX=1;
+   document.flipY=0;
+   document.getElementById("idColor").checked= true;
+   document.getElementById("idGamma").value= 0.47;
+   document.getElementById("idSaturationBlue").value=2.0;
+   document.getElementById("idSaturationRed").value= 2.0;
+
+   document.getElementById("idQuality").value= 46;
+   document.getElementById("idExposure").value= 20.0;
+// default windows:
+  switch (document.sensor) {
+  case 49: MT9M001_dflt(); break;
+  case 50: MT9D001_dflt(); break;
+  case 51: MT9T001_dflt(); break;
+  default: other_dflt();
+  updateColor();
+//  updateLinks();
+  }
+  
+}
+
+function other_dflt() { // MT9M001_dflt()
+ document.getElementById("idGainY").value=63;
+ document.getElementById("idGainR").value=22;
+ document.getElementById("idGainG").value=16;
+ document.getElementById("idGainB").value=17;
+ document.getElementById("idLevelBlack").value=2;
+ document.getElementById("idLevelWhite").value=254;
+
+}
+function MT9M001_dflt() {
+ document.getElementById("idGainY").value=63;
+ document.getElementById("idGainR").value=22;
+ document.getElementById("idGainG").value=16;
+ document.getElementById("idGainB").value=17;
+ document.getElementById("idLevelBlack").value=2;
+ document.getElementById("idLevelWhite").value=254;
+}
+function MT9D001_dflt() {
+ document.getElementById("idGainY").value=63;
+ document.getElementById("idGainR").value=17; //42
+ document.getElementById("idGainG").value=11; //25
+ document.getElementById("idGainB").value=13; //27
+ document.getElementById("idLevelBlack").value=2;
+ document.getElementById("idLevelWhite").value=254;
+}  
+function MT9T001_dflt() {
+ document.getElementById("idGainY").value=63;
+ document.getElementById("idGainR").value=16;
+ document.getElementById("idGainG").value=11;
+ document.getElementById("idGainB").value=12;
+ document.getElementById("idLevelBlack").value=10;
+ document.getElementById("idLevelWhite").value=254;
+}  
+
+function updateNumWindow() { // validate window sizes, show window
+  if      (document.getElementById("idDCM1").checked) document.dcm=1;
+  else if (document.getElementById("idDCM2").checked) document.dcm=2;
+  else if (document.getElementById("idDCM4").checked) document.dcm=4;
+  else if (document.getElementById("idDCM8").checked) document.dcm=8;
+
+//alert('document.dcm='+document.dcm);
+  var w=parseInt(document.getElementById("idWidth").value);
+  var h=parseInt(document.getElementById("idHeight").value);
+  var l=parseInt(document.getElementById("idLeft").value);
+  var b=parseInt(document.getElementById("idBottom").value);
+//alert("w="+w+"\nh="+h+"\nl="+l+"\nt="+t);
+// l >=0, l<(maxWidth-16*document.dcm)
+/*
+  if (l<0) l=0;
+  if (l>=(document.maxWidth-32*document.dcm)) l=document.maxWidth-32*document.dcm;
+  l= 2*document.dcm*Math.floor(l/2/document.dcm);
+  if((l+w)>document.maxWidth) w= document.maxWidth-l;
+  w=16*document.dcm*Math.floor(w/16/document.dcm);
+  if (w<32*document.dcm) w=32*document.dcm;
+  if (t<0) t=0;
+  if (t>=(document.maxHeight-32*document.dcm)) t=document.maxHeight-32*document.dcm;
+  t= 2*document.dcm*Math.floor(t/2/document.dcm);
+  if((t+h)>document.maxHeight) h= document.maxHeight-t;
+  h=16*document.dcm*Math.floor(h/16/document.dcm);
+  if (h<32*document.dcm) h=32*document.dcm;
+*/
+//  document.discret_x=128;
+//  document.discret_y=64;
+  if (l<0) l=0;
+  if (l>=(document.maxWidth- document.discret_x*document.dcm)) l=document.maxWidth- document.discret_x*document.dcm;
+  l= document.dcm*Math.round(l/document.dcm);
+  if((l+w)>document.maxWidth) w= document.maxWidth-l;
+  w=document.discret_x*document.dcm*Math.round(w/document.discret_x/document.dcm);
+  if (w<document.discret_x*document.dcm) w=document.discret_x*document.dcm;
+  if((l+w)>document.maxWidth) l= document.maxWidth-w;
+  if (b<0) b=0;
+  if (b>=(document.maxHeight - document.discret_y*document.dcm)) b=document.maxHeight - document.discret_y*document.dcm;
+  b= document.dcm*Math.round(b/document.dcm);
+  if((b+h)>document.maxHeight) h= document.maxHeight-b;
+  h=document.discret_y*document.dcm*Math.round(h/document.discret_y/document.dcm);
+  if (h<document.discret_y*document.dcm) h=document.discret_y*document.dcm;
+  if((b+h)>document.maxHeight) b= document.maxHeight-h;
+
+
+// update values in the text fields
+  document.getElementById("idWidth").value=w;
+  document.getElementById("idHeight").value=h;
+  document.getElementById("idLeft").value=l;
+  document.getElementById("idBottom").value=b;
+// show graphically (see if needed 1 extra pixel for the border each side)
+  document.getElementById("window_selection").style.width= (w/document.previewDecimation)-2;
+  document.getElementById("window_selection").style.height=(h/document.previewDecimation)-2;
+  document.getElementById("window_selection").style.left=  l/document.previewDecimation;
+//  document.getElementById("window_selection").style.top=   t/document.previewDecimation;
+  document.getElementById("window_selection").style.top=   (document.maxHeight-b-h)/document.previewDecimation;
+//  alert ("w="+w+"\nh="+h+"\nl="+l+"\nb="+b+"\ndocument.previewDecimation="+document.previewDecimation);
+  updateLinks();
+}
+
+function fullWindow() {
+  document.getElementById("idWidth").value=document.maxWidth;
+  document.getElementById("idHeight").value=document.maxHeight;
+  document.getElementById("idLeft").value=0;
+  document.getElementById("idBottom").value=0;
+  updateNumWindow();
+}  
+
+function imgPreview() {
+//  if (document.imageGot==1) {
+    updateLinks();
+    acquireIfCan("document.getElementById('mapImage').style.backgroundImage='url('+document.previewURL+')';");
+
+
+// disable preview
+//    document.getElementById("mapImage").style.backgroundImage="url("+document.previewURL+")";
+//  } else  imgPreview_init();
+}
+
+function imgNewWindow() {
+  updateLinks();
+  var w=parseInt(document.getElementById("idWidth").value)/document.dcm;
+  var h=parseInt(document.getElementById("idHeight").value)/document.dcm;
+//  window.open(document.newWinURL,'image','resizable=yes,scrollbars=yes, width='+(w+40)+',height='+(h+30));
+  var cmd="window.open(document.newWinURL,'image','resizable=yes,scrollbars=yes, width="+(w+40)+",height="+(h+30)+"');"
+  acquireIfCan(cmd);
+
+}
+
+// Mozilla functions
+function mouseDown_Mozilla (e) {
+ if (document.dragging) mouseUp_Mozilla   (e);
+ else commonMouseDown (e.pageX,e.pageY);
+}
+function dragging_Mozilla(e) {commonDragging(e.pageX,e.pageY);}
+function mouseUp_Mozilla   (e) { commonMouseUp   ();}
+// Opera/IE6 functions
+function mouseDown_Opera (e) {
+ if (document.dragging) mouseUp_Mozilla   (e);
+ else commonMouseDown (event.clientX,event.clientY);
+}
+function dragging_Opera(){ commonDragging(event.clientX,event.clientY);}
+function mouseUp_Opera  () {commonMouseUp   ();}
+
+</script>
+<title>Elphel Model 333 Camera with Ogg/Theora</title>
+</head>
+<!--<body  class="textStyle" bgcolor="#CCCCCC" onLoad="setTimeIf1972();updateColor();updateNumWindow();"> -->
+<body  class="textStyle" bgcolor="#CCCCCC" onLoad="updateXML();">
+
+<!--
+<div id="mapImage" style="position:absolute; width:640px; height:512px; z-index:101; left: 0px; top: 0px;  border-style: solid; background-position: top center; background-repeat: no-repeat; border: 1px none #000000">
+-->
+
+<div id="mapImage" style="position:absolute; width:640px; height:512px; z-index:101; left: 0px; top: 0px;  border-style: solid; background-position: top left; background-repeat: repeat; border: 1px none #000000">
+
+
+  <div id="window_selection"></div>
+</div>
+<div id="idControls" style="position:absolute; width:640px; height:200px; z-index:101; left: 0px; top: 520;">
+
+<form method="post" action="">
+    <table border="1" cellspacing="0" cellpadding="0" width="100%">
+      <tr valign="top"> 
+        <td>
+         <table border="1" cellspacing="0" cellpadding="0" width="100%" height="100%">
+         <tr><td>
+          
+          <table border="0" cellspacing="0" cellpadding="0" width="100%">
+            <tr> 
+              <td colspan="2"> 
+                <div align="center"><b>Window</b> </div>
+              </td></tr>
+<!--            <tr><td colspan="2">&nbsp;</td></tr> -->
+              <tr>
+              <td> 
+                <div align="center">
+                  <input type="button" id="idSelectDrag" value="Drag" onClick="initDragging();" >
+                </div>
+              </td>
+              <td> 
+                <div align="center">
+                  <input type="button" id="idSelectFull" value="Full" onClick="fullWindow();" >
+                </div>
+              </td>
+            </tr>
+<!--            <tr><td colspan="2">&nbsp;</td></tr> -->
+
+            <tr> 
+              <td>
+                <div class="nowrap">
+                W<input type="text" id="idWidth" size="4" maxlength="4" value="1280" onChange="updateNumWindow();" class="inputs"></div>
+              </td>
+              <td> 
+                <div class="nowrap">
+                H<input type="text" id="idHeight" size="4" maxlength="4" value="1024" onChange="updateNumWindow();" class="inputs">
+                </div>
+              </td>
+            </tr>
+              <td>
+                <div class="nowrap">
+                L<input type="text" id="idLeft" size="4" maxlength="4" value="0" onChange="updateNumWindow();" class="inputs">
+                </div>
+              </td>
+              <td> 
+                <div class="nowrap">
+                B<input type="text" id="idBottom" size="4" maxlength="4" value="0" onChange="updateNumWindow();" class="inputs">
+                </div>
+                
+              </td>
+            </tr>
+            
+<!--            <tr><td colspan="2">&nbsp;</td></tr> -->
+            <tr><td>
+            </table>
+            </td> </tr>
+            <tr><td>
+             <table border="0"  width= "100%">
+              <tr>
+               <td colspan="4"><div align="center"><b>Decimation</b></div></td>
+              </tr>
+              <tr>
+               <td>none</td><td>1/2</td><td>1/4</td><td>1/8</td>
+              </tr>
+              <tr>
+               <td> <input type="radio" id="idDCM1" name="nDecimation" value="1" onChange="updateNumWindow();" onClick="updateNumWindow();" checked ></td>
+               <td> <input type="radio" id="idDCM2" name="nDecimation" value="2" onChange="updateNumWindow();" onClick="updateNumWindow();"  ></td>
+               <td> <input type="radio" id="idDCM4" name="nDecimation" value="4" onChange="updateNumWindow();" onClick="updateNumWindow();"  ></td>
+               <td> <input type="radio" id="idDCM8" name="nDecimation" value="8" onChange="updateNumWindow();" onClick="updateNumWindow();" c ></td>
+              </tr>
+             </table>
+            </td></tr>
+
+            
+            <tr > 
+              <td>
+               <table><tr>
+                 <td><div style="nowrap"><b>Quality</b></div></td>
+                 <td><div style="nowrap"><input type="text" id="idQuality" size="2" maxlength="2" value="46" onChange="updateQuality();" class="inputs">%</div></td>
+                </tr>
+               </table>
+              </td>
+            </tr>
+
+
+            <tr>
+              <td>
+                <table><tr> 
+                  <td>Rst</td>
+                  <td><input type="radio" id="idReset" name="nReset" value="1" onClick="cameraReset();"></td>
+                  </td>    
+                  <td>
+                  <input type="button" id="idDefault" value="Defaults" onClick="setDefaults();" >
+                </td>
+                </tr></table>
+              </td>
+            </tr>
+          </table>
+      </td>
+        
+
+        
+      <td>
+       <table border="1" cellspacing="0" cellpadding="0" width="100%" height="100%">
+        <tr><td>
+          <table border="0" cellspacing="0" cellpadding="0" width="100%">
+            <tr>
+              <td colspan="2">
+                <div align="center"><b>Exposure</b></div>
+              </td>
+              </tr>
+              <tr>
+              <td>
+                <div align="right">
+                  <input type="text" id="idExposure" size="5" maxlength="5" value="20" onChange="updateExposure();" class="inputs">
+                </div>
+              </td>
+              <td>ms</td>
+            </tr>
+            <tr>
+              <td>
+                <div align="center">1 frame</div>
+              </td>
+              <td>
+                <input type="checkbox" id="idFrameTime" onClick="updateFullFrameExposure()">
+              </td>
+            </tr>
+          </table>
+        </td></tr>
+        <tr><td>  
+          <table border="0" cellspacing="0" cellpadding="0" width="100%">
+            <tr>
+              <td colspan="2">
+                <div align="center"><b>Gains</b>
+<input type="text" id="idGainY" size="3" maxlength="3" value="100" onChange="updateGains();" class="inputs"></div>
+              </td>
+            <tr>
+              <td> 
+                <div align="right">R </div>
+              </td>
+              <td>
+                <input type="text" id="idGainR" size="3" maxlength="3" value="30" onChange="updateGains();" class="inputs">
+              </td>
+            </tr>
+            <tr> 
+              <td> 
+                <div align="right">G </div>
+              </td>
+              <td>
+                <input type="text" id="idGainG" size="3" maxlength="3" value="25" onChange="updateGains();" class="inputs">
+              </td>
+            </tr>
+            <tr> 
+              <td> 
+                <div align="right">B </div>
+              </td>
+              <td>
+                <input type="text" id="idGainB" size="3" maxlength="3" value="30" onChange="updateGains();" class="inputs">
+              </td>
+            </tr>
+            <tr>
+              <td>Color</td>
+              <td >
+                <input type="checkbox" id="idColor" onClick="updateColor()" checked>
+              </td>
+            </tr>
+           </table>
+         </td></tr>
+        </table> 
+      </td>
+
+
+
+      
+        
+      <td>
+       <table border="1" cellspacing="0" cellpadding="0" width="100%" height="100%">
+        <tr><td>
+          <table border="0" cellspacing="0" cellpadding="0" width="100%">
+            
+            <tr>
+              <td colspan="2"><div align="center"><b>Contrast</b></div></td>
+            </tr>
+            <tr>
+              <td>
+                <div align="right">Gamma</div>
+              </td>
+<!--              <td><input type="text" id="idGainY" size="3" maxlength="3" value="30" onChange="updateGains();" class="inputs"></td> --> <!-- KAC1310-->
+              <td><input type="text" id="idGamma" size="4" maxlength="4" value="0.47" onChange="updateGamma();" class="inputs"></td>
+            </tr>
+            
+            <tr>
+              <td>Levels</td><td> </td>
+            </tr>
+            <tr>
+              <td>
+                <div align="right">Black</div>
+              </td>
+              <td><input type="text" id="idLevelBlack" size="4" maxlength="4" value="0" onChange="updateLevels();" class="inputs"></td>
+            </tr>
+            <tr>
+              <td>
+                <div align="right">White</div>
+              </td>
+              <td><input type="text" id="idLevelWhite" size="4" maxlength="4" value="255" onChange="updateLevels();" class="inputs"></td>
+            </tr>
+
+          </table>
+        </td></tr>
+        <tr><td>
+          <table border="0" cellspacing="0" cellpadding="0" width="100%">
+            <tr>
+              <td colspan="2"><div align="center"><b>Saturation</b></div></td>
+            </tr>
+            <tr>
+              <td>
+                <div align="right">B-Y</div>
+              </td>
+              <td><input type="text" id="idSaturationBlue" size="4" maxlength="4" value="2.0" onChange="updateSaturation(0);" class="inputs"></td>
+            </tr>
+            <tr>
+              <td>
+                <div align="right">R-Y</div>
+              </td>
+              <td><input type="text" id="idSaturationRed" size="4" maxlength="4" value="2.0" onChange="updateSaturation(1);" class="inputs"></td>
+            </tr>
+            
+
+            
+          </table>
+        </td></tr>
+       </table>
+      </td>
+
+
+
+        
+        <td>
+          <table border="1" cellspacing="0" cellpadding="0" width="100%" height="100%">
+            <tr>
+              <td><table border="0" cellspacing="0" cellpadding="0" width="100%" >
+            <tr>
+              <td colspan="2" nowrap="y">
+
+                              <b> Theora Clip: <a id="idStillPhoto" href="#" target="_blank">New</a> : </b>
+                              <b><a id="idLastPhoto" href="#" target="_blank">Last</a></b>
+                             <b><a id="idInfo" href="#" target="_blank">?</a></b> : 
+                             <b><a href="index_help.html" target="_blank">HELP</a></b></div>
+
+                      
+              </td>
+            </tr>
+<!--
+            <tr>
+                    <td>
+                      <div align="center">
+                        <input type="button" id="idPreview" value="Preview" onClick="imgPreview();" >
+                      </div>
+                    </td><td>
+                      <div align="center">
+                        <input type="button" id="idGet" value="Separate window" onClick="imgNewWindow();" >
+                      </div>
+                    </td>
+</tr>          </table></td>
+            </tr>
+-->
+            <tr>
+              <td>
+                <table border="0" cellspacing="0" cellpadding="0" width="100%" >
+<!--
+                  <tr>
+                    <td colspan="2">
+                      <div align="center">
+                        <b><a id="idClip" href="#" target="_blank">Video Clip</a></b>&nbsp;&nbsp;
+                        <b><a id="idClip" href="strctl.cgi" target="_blank">Video Streamers</a></b>
+                      </div>
+                    </td>
+                  </tr>
+
+                  <tr>
+                    <td colspan="2">
+                        <input type="button" id="idStart" value="Start" onClick="clipStartStop(1);" >
+                        <input type="button" id="idStop" value="Stop" onClick="clipStartStop(2);" >
+                        <input type="button" id="idAcquire" value="Acquire" onClick="clipStartStop(3);" >
+                    </td>
+                  </tr>
+              <tr>
+              <tr>
+                <td> <div align="left">
+                    <input type="button" id="idUpdate" value="Update" onClick="updateParameters();" >
+                </div></td>
+                <td>
+                    <input type="button" id="idVcontrols" value="Video Controls" onClick="showControls();" >
+                </td>
+              </tr>
+-->
+              <tr>
+                <td> <div align="left">
+                    Frame rate
+                </div></td>
+                <td>
+                   <input type="text" id="idRequestedFPS" size="5" maxlength="5" value=" " onChange="updateVideoSize();" class="inputs">
+                   fps
+                </td>
+              </tr>
+              <tr>
+                <td> <div align="left">
+                   Time Scale
+                </div></td>
+                <td>
+                   <input type="text" id="idTimeScale" size="3" maxlength="3" value="3" onChange="updateVideoSize();" class="inputs">
+                   x
+                </td>
+              </tr>
+              <tr>
+                <td> <div align="left">
+                   Tot. frames
+                </div></td>
+                <td>
+                   <input type="text" id="idTheoraFrames" size="5" maxlength="5" value="100" onChange="updateVideoSize();" class="inputs">
+                </td>
+              </tr>
+              <tr>
+                <td> <div align="left">
+                   INTER/INTRA
+                </div></td>
+                <td>
+                   <input type="text" id="idTheoraInter" size="3" maxlength="3" value="255" onChange="updateVideoSize();" class="inputs">
+                </td>
+              </tr>
+<!--
+              <tr>
+                <td colspan="2">
+                <input type="button" id="idFBack" value="<<" onClick="changeClipFrame(-2);" >
+                <input type="button" id="idBack" value="<" onClick="changeClipFrame(-1);" >
+                  <input type="text" id="idClipFrame" size="4" maxlength="4" value="0" onChange="updateClipFrame(this.value);" class="inputs">
+                <input type="button" id="idFrw" value=">" onClick="changeClipFrame(1);" >
+                <input type="button" id="idFFrw" value=">>" onClick="changeClipFrame(2);" >
+                </td>
+              </tr>
+              <tr><td colspan="2">
+                <input type="button" id="idShowClipFrame" value="Show clip frame" onClick="showClipFrame();" >
+                 <b><a id="idFrame" href="#" target="_blank">Frame</a></b>              
+              </td></tr>
+-->
+                </table>
+</td>
+            </tr>
+
+          </table>
+        </td>
+    </tr>
+<!-- Video streamer -->
+            <tr>
+              <td>
+                <table border="0" cellspacing="0" cellpadding="0" width="100%" >
+                  <tr>
+                    <td colspan="2">
+                      <div align="center"><b>Theora RTP
+                        Streamer</b>
+                        <img src="pics/1pix.jpeg" width="1" height="1" name="n1pix" id="id1pix">
+                      </div>
+                    </td>
+                  </tr>
+                  <tr>
+                    <td>
+                        <input type="button" id="idStartStrm" value="Start streaming" onClick="StreamerStartStop(1);" >
+                    </td>
+                    <td>
+                        <input type="button" id="idStopStrm" value="Stop streaming" onClick="StreamerStartStop(0);" >
+                    </td>
+                 </tr>
+                 <tr>
+                    <td>
+                      <div align="right">Addr/hostname</div>
+                    </td>
+                    <td> 
+                      <input type="text" id="idAddress" size="15" maxlength="15" value="239.0.0.1" onChange="updateAddress();" class="inputs" name="text">
+                    </td>
+                  </tr>
+                  <tr> 
+                    <td>
+                      <div align="right">Port#</div>
+                    </td>
+                    <td> 
+                      <input type="text" id="idPort" size="5" maxlength="5" value="20000" onChange="updatePort();" class="inputs" name="text">
+                    </td>
+		   </tr>
+
+	      </td>
+	     </tr>
+
+          </table>
+        </td>
+    </tr>
+
+  </table>
+</form>
+</div>
+</body>
+</html>

Added: experimental/j/Elphel333/rtp/README
===================================================================
--- experimental/j/Elphel333/rtp/README	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/README	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,49 @@
+This is experemental RTP Theora streamer for Elphel 333. 
+
+
+with ./init_env loaded you should be able to build cgi and daemon module.
+
+to install:
+daemon/TheoraStrm -> /mnt/flash/local/bin
+cgi/cstrm.cgi     -> /mnt/flash/etc/httpd/html/admin-bin
+cgi/index1.html   -> /mnt/flash/etc/httpd/html/
+
+
+And next - login into camera via telnet and set +x for TheoraStrm and cstrm_cgi via chmod
+
+Ok. Via WEB browser open index1.html(I test it on Firefox). Setup parameters of picture(size, quality and etc)
+and press New. You can't save file.
+
+In field Addr/hostname set address PC (unicast or multicast). If you use multicast address - yuo must set routing on interface of PC:
+
+# route add -net 224.0.0.0 netmask 240.0.0.0 eth0
+
+ and can test multicast 
+
+#ping 224.0.0.1
+
+All host with enablet multicast answer to you(include yours cameras).
+
+In telnet session into camera you can start streamer in waiting mode
+
+# TheoraStrm -w &
+
+Ok. Now press button Start - streamer must starting(you can see message on telnet session) and sending RTP packets into selected address and port. Periodicaly he send headers(after 100 frames) for syncing players.
+
+Ok. on PC you can start receiver:
+
+./TheoraRtp -a <address cam or multicast addr> -p <port> | ./mplayer -vo sdl -nocache -fps <n> -
+
+TheoraRtp syncing with stream and dumping OGG file(builded on fly) into stdout, and next (via pipe) send it to player
+
+You can dump this file too.
+./TheoraRtp -a <addr> -p <port> >file.ogg
+
+
+This is implementation of stream Theora as large file, building on receiver on fly. Receiver can attach to 
+stream on any time(syncing now building on headers in stream, after receive headers we can build and decode
+OGG file).
+
+THIS IS NOT RFC implementation. It is only for testing(We not have complete  RFC of Theora RTP )
+
+Andy Latin

Added: experimental/j/Elphel333/rtp/cgi/.target-makefrag
===================================================================
--- experimental/j/Elphel333/rtp/cgi/.target-makefrag	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/cgi/.target-makefrag	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1 @@
+AXIS_BUILDTYPE=cris-axis-linux-gnu

Added: experimental/j/Elphel333/rtp/cgi/Makefile
===================================================================
--- experimental/j/Elphel333/rtp/cgi/Makefile	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/cgi/Makefile	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,49 @@
+AXIS_USABLE_LIBS = UCLIBC GLIBC
+include $(AXIS_TOP_DIR)/tools/build/Rules.axis
+
+INCDIR    = $(prefix)/include
+LIBDIR    = $(prefix)/lib
+
+INSTDIR   = $(prefix)/bin
+INSTMODE  = 0755
+
+INSTOWNER = root
+INSTGROUP = root
+
+CFLAGS   += -Wall -g -I$(INCDIR) -I$(AXIS_KERNEL_DIR)/include
+LDFLAGS  += -L$(LIBDIR) 
+
+ifndef UCLIBC
+# -lm - to use math library
+LDLIBS = -lcrypt -lm
+endif
+
+# miscellaneous OS-dependent stuff
+# linker
+LN= $(CC)
+# file deletion command
+RM= rm -f
+# file rename command
+MV= mv
+# End of configurable options.
+
+PROGS     = cstrm.cgi
+
+APPSOURCES= cstrm.c 
+SRCS= $(APPSOURCES)
+
+APPSOBJ= cstrm.o 
+
+OBJS= $(APPSOBJ)
+
+CFLAGS	+= -Wall
+
+all:	$(PROGS)
+
+cstrm.cgi: $(OBJS)
+	$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@
+	strip-cris cstrm.cgi
+
+clean:
+	rm -f $(PROGS) *.o *.bak *~ core 
+

Added: experimental/j/Elphel333/rtp/cgi/cstrm.c
===================================================================
--- experimental/j/Elphel333/rtp/cgi/cstrm.c	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/cgi/cstrm.c	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,215 @@
+/******************************************************************************
+ * This 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 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; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * ******************************************************************************/
+// CGI interface for Streamer on  Elphel JPEG camera 313 input device
+// // Copyright (c) 2004 Andy Latin aka Landy, Dmitry Latin aka ipfreely
+// // All rights reserved.
+// //
+// // http://andy.qnx.org.ru
+// // mail to:
+// // andy at qnx.org.ru
+// // landy at mail333.com
+// /////////////////////////////////////////////////////////////////////////////
+
+#include <fcntl.h>  /*open*/
+#include <unistd.h> /* close, sleep */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/ioctl.h>
+
+#include <sys/types.h> /* for fstat */
+#include <sys/stat.h> /* for fstat */
+
+#include <sys/mman.h>		/* mmap */
+
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+
+#define QRY_MAXPARAMS 64
+struct key_value {
+	char *key;
+	char *value;
+};
+
+struct key_value gparams[QRY_MAXPARAMS+1];
+
+#define STOP_STREAM     0
+#define START_STREAM    1
+#define STOP_SCANNING   0
+#define START_SCANNING  1
+
+#define JPEG_ACCESS_MMAP 1
+#define JPEG_ACCESS_DRV  2
+
+typedef struct strm_common {
+	char 	address[21];   	// address or hostname
+	int	port;		// port no
+	double	fps;		// soft FPS
+	int     regim;		// mmap/driver access to JPEG data
+	int	scanning;	// mode scanning on/off
+	char 	name[21];	// SDES name field for subtitles
+	char	telephone[21];  // phone subtitles
+	char	toolname[21];
+	char	note[61];
+	char	location[41];
+	char	email[21];
+	char    encrypt_key[41];// encryption key
+	int     encryption;	// mode encryption on/off
+	int	status;		// start/top streamer
+} strm_data_t;
+
+
+
+/////////////////////// prototypes /////////////////////////////////////////
+int parseQuery(struct key_value * params, char * qry);
+char * paramValue(struct key_value * params, char * skey); // returns pointer to parameter value, NULL if not defined
+int unescape (char * s, int l);
+int hexdigit (char c);
+
+///////////////////////////////////////////////////////////////////////////
+
+int hexdigit (char c) {
+  int i;
+  i=c-'0';
+  if ((i>=0) && (i<10)) return i;
+  i=c-'a'+10;
+  if ((i>=10) && (i<16)) return i;
+  i=c-'A'+10;
+  if ((i>=10) && (i<16)) return i;
+  return 0;	// could be -1??
+}
+
+int unescape (char * s, int l) {
+  int i=0;
+  int j=0;
+  while ((i<l) && s[i]) {
+    if ((s[i]=='%') && (i<(l-2)) && s[i+1]){ // behavior from Mozilla
+      s[j++]=(hexdigit(s[i+1])<<4) | hexdigit(s[i+2]);
+      i+=3;
+    } else s[j++]=s[i++];
+  }
+  if (i<l) s[j]=0;
+  return j;
+}
+
+int parseQuery(struct key_value * params, char * qry)
+{
+  char * cp;
+  int l=0;
+  cp=strtok(qry,"=");
+  while ((cp) && (l<QRY_MAXPARAMS)) {
+    params[l].key=cp;
+    cp=strtok(NULL,"&");
+    params[l++].value=cp;
+    if (cp) cp=strtok(NULL,"=");
+  }
+ params[l].key=NULL;
+ return l;
+}
+
+char * paramValue(struct key_value * params, char * skey)
+{ // returns pointer to parameter value, NULL if not defined
+  int i=0;
+  if (skey)
+   while ((i<QRY_MAXPARAMS) && (params[i].key)) {
+    if (strcmp(skey,params[i].key)==0) return 	params[i].value;
+
+    i++;
+   }
+  return NULL;
+}
+
+
+////////////////////////////////////////////////////////////////////////
+int main (int argc, char *argv[]) {
+  int devfd,i,code;
+  char * cp;
+  char * vp;
+/* these are from cgitest.cgi */
+  const char *method;
+  const char *query;
+  const char *uri;
+  char  copyQuery [4096];
+
+  const char mmapFileName[]= "/var/tmp/mmap_strm";
+  strm_data_t    *strm_data;
+
+  method = getenv("REQUEST_METHOD");
+  query  = getenv("QUERY_STRING");
+  uri    = getenv("REQUEST_URI");
+  i= (query)? strlen (query):0;
+     fprintf(stderr,"querry length=%d\n", i);
+
+  if (i>(sizeof(copyQuery)-1)) i= sizeof(copyQuery)-1;
+  if (i>0) strncpy(copyQuery,query, i);
+  copyQuery[i]=0;
+  unescape(copyQuery,sizeof(copyQuery));
+
+  if (method == NULL)
+  {
+    /* Not a CGI! */
+    printf("This program should be run as a CGI from the web server!\n");
+    exit(1);
+  }
+
+  parseQuery(gparams, copyQuery);
+ // open mmap memory
+  devfd = open(mmapFileName,O_RDWR);   //S_IRWXU);
+  if(devfd == -1) {
+	printf("Error create SHM data!\n");
+  }
+  lseek(devfd,sizeof(strm_data_t),SEEK_SET);
+  strm_data = (strm_data_t *)mmap(0, sizeof(strm_data_t), PROT_READ|PROT_WRITE, MAP_SHARED, devfd, 0);
+  if((int)strm_data == -1) {
+        fprintf(stderr,"Error in mmap %s\r\n",mmapFileName);
+        close(devfd);
+	exit(1);
+  }
+  code = STOP_STREAM;
+  if((vp=paramValue(gparams, "c")))  code = strtol(vp,&cp,10);
+  if((strm_data->status == START_STREAM ) && code== START_STREAM) {
+    // streamer already started! Restart it with new parameters
+    strm_data->status = STOP_STREAM;
+    // wait some time
+    usleep(100000);
+   }
+
+    if ((vp=paramValue(gparams, "addr")))  strncpy(strm_data->address,vp,20);
+    if ((vp=paramValue(gparams, "port")))  strm_data->port = strtol (vp,&cp,10);
+    if ((vp=paramValue(gparams, "fps")))   strm_data->fps  = strtod(vp,&cp);
+    if ((vp=paramValue(gparams, "scan")))  strm_data->scanning = strtol (vp,&cp,10);
+    if ((vp=paramValue(gparams, "reg")))   strm_data->regim = strtol (vp,&cp,10);
+
+    if ((vp=paramValue(gparams, "name")))  strncpy(strm_data->name,vp,20);
+    if ((vp=paramValue(gparams, "loc")))   strncpy(strm_data->location,vp,40);
+    if ((vp=paramValue(gparams, "note")))  strncpy(strm_data->note,vp,60);
+    if ((vp=paramValue(gparams, "tool")))  strncpy(strm_data->toolname,vp,20);
+    if ((vp=paramValue(gparams, "phone"))) strncpy(strm_data->telephone,vp,20);
+    if ((vp=paramValue(gparams, "email"))) strncpy(strm_data->email,vp,20);
+    if ((vp=paramValue(gparams, "key")))   strncpy(strm_data->encrypt_key,vp,40);
+    if ((vp=paramValue(gparams, "encr")))  strm_data->encryption = strtol (vp,&cp,10);
+
+    // OK - new parameters passed to mapped memory
+    // start streamer
+
+  strm_data->status = code;
+  close(devfd);
+
+ return 0;
+}
+

Added: experimental/j/Elphel333/rtp/cgi/defines.h
===================================================================
--- experimental/j/Elphel333/rtp/cgi/defines.h	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/cgi/defines.h	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,116 @@
+#ifndef __STREAMER_H_DEF_
+#define  __STREAMER_H_DEF_
+
+#include <inttypes.h>
+
+
+#define HAVE_NANOSLEEP 1
+
+#define MAX_SIZE_JPEG    1024*1024   // max size buffer for JPEG picture, may be increase for best quality
+
+#define JPEG_HEADER_SIZE 	623
+#define RTP_PT_JPEG             26    /* The definition is from RFC1890 */
+#define RTP_JPEG_RESTART        0x40
+#define BUF_SIZE		1460  // MTU - 40 bytes	
+#define TimeScale		90000 // RFC
+
+#define TimestampTicks  	1000000
+
+typedef uint64_t Timestamp;
+typedef uint32_t RtpTimestamp;
+
+
+
+#ifndef true
+#define true		1
+#endif
+#ifndef false
+#define false		0
+#endif
+
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+struct jpeghdr {
+        unsigned int tspec:8;   /* type-specific field */
+        unsigned int off:24;    /* fragment byte offset */
+        uint8_t	     type;      /* id of jpeg decoder params */
+        uint8_t	     q;         /* quantization factor (or table id) */
+        uint8_t      width;     /* frame width in 8 pixel blocks */
+        uint8_t      height;    /* frame height in 8 pixel blocks */
+};
+
+struct jpeghdr_rst {
+        uint16_t     dri;
+        unsigned int f:1;
+        unsigned int l:1;
+        unsigned int count:14;
+};
+
+struct jpeghdr_qtable {
+        uint8_t  mbz;
+        uint8_t  precision;
+        uint16_t length;
+	uint8_t  lqt[64];
+	uint8_t  cqt[64];
+};
+
+///////////// for manage streamer with web interface ///////
+#define STOP_STREAM	0
+#define START_STREAM	1
+#define STOP_SCANNING	0
+#define START_SCANNING	1
+
+#define JPEG_ACCESS_MMAP 1
+#define JPEG_ACCESS_DRV	 2
+
+typedef struct strm_common {
+	char 	address[21];   	// address or hostname
+	int	port;		// port no
+	double	fps;		// soft FPS
+	int     regim;		// mmap/driver access to JPEG data
+	int	scanning;	// mode scanning on/off	 
+	char 	name[21];	// SDES name field for subtitles
+	char	telephone[21];  // phone subtitles
+	char	toolname[21];   
+	char	note[61];
+	char	location[41];
+	char	email[21];
+	char    encrypt_key[41];// encryption key
+	int     encryption;	// mode encryption on/off
+	int	status;		// start/top streamer
+} strm_data_t;
+
+
+///////////////// prototypes ///////////////////////////////////////
+
+int 		usec_sleep(int);
+Timestamp 	GetTimestamp(void);
+Timestamp	GetTimerMs(void);
+Timestamp 	GetRelativeTime(void);
+void 		InitTimer(void);
+void 		SeedRandom(void);
+uint32_t 	GetRandomMcastAddress(void); 
+uint16_t 	GetRandomPortBlock(void);
+RtpTimestamp 	TimestampToRtp(Timestamp);
+Timestamp 	TimestampToNtp(Timestamp);
+
+int  getJPEGdata_mmap(int 		/* mmap file descriptor */, 
+		      unsigned long * 	/* mmap memory */,
+		      int 		/* size of mmap memory */,
+		      int 		/* time interval between frames - 1/fps */, 
+		      uint8_t  	*	/* JPEG data without header but with EOI*/,
+		      uint64_t 	* 	/* time stamp current frame */
+		);
+int getFrame( uint8_t *, uint8_t *, uint8_t *, uint8_t *,
+	    uint16_t *, uint16_t *, uint16_t *, uint8_t *);
+
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif
+

Added: experimental/j/Elphel333/rtp/cgi/index1.html
===================================================================
--- experimental/j/Elphel333/rtp/cgi/index1.html	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/cgi/index1.html	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,1215 @@
+<html>
+<head>
+<style>
+<!--
+#window_selection{
+position:absolute;
+left:0;
+top:0;
+width:1px;
+height:1px;
+color:red;
+z-index:100;
+font-size:1px;
+border: 1px #FF0000 solid;}
+
+.inputs    {  background-color: #EEEEEE; text-align: right; font-family: Verdana, Arial, Helvetica, sans-serif}
+.textStyle {  font-family: Verdana, Arial, Helvetica, sans-serif}
+.info      {  background-color: #aaaaaa; text-align: right; font-family: Verdana, Arial, Helvetica, sans-serif; color: #FF0033}
+.nowrap    {  text-align: right; white-space: nowrap;}
+-->
+</style>
+
+<script language="JavaScript">
+var isDOM=document.getElementById?true:false;
+var isOperaIE= document.all?true:false;
+  document.dragging=false;
+  document.dragEn=false;
+  document.previewDecimation=2;
+//  document.previewScale=1/document.previewDecimation;
+  document.maxWidth=1280;
+  document.maxHeight=1024;
+  document.dcm=1;
+  document.flipX=1;
+  document.flipY=0;
+  document.cgi="/admin-bin/ccam.cgi?";
+  document.previewURL="";
+  document.newWinURL="";
+  document.updateURL="";
+  document.startStopClipURL="pics/1pix.jpeg";
+  document.commonParameters="";
+//  document.commonOptions="vxych";
+//  document.defaultOptions="vxyh";
+  document.defaultOptions="vh";
+  document.saveExposure=20;
+  document.firstX=0;
+  document.firstY=0;
+  document.sizeX; // signed
+  document.sizeY; // signed
+  document.discret=1;
+  document.snap=4;
+  document.mapTop=0;
+  document.mapLeft=0;
+  document.mapWidth= document.maxWidth/document.previewDecimation;
+  document.mapHeight=document.maxHeight/document.previewDecimation;
+  document.minTilesX=2;
+  document.minTilesY=2;
+  document.imageGot=0;
+  document.clipFrame=0;
+  document.sensor=49; // MT9M001
+  document.sensorBlack=0;
+  document.sensorWhite=254;
+  document.updateTime=3000; // will sync if not in use longer than...
+  document.timeoutCntr=0;  // watches if there is any pending timeout
+  document.updating=0;
+  document.dummyImg=new Image();
+  document.timeNotSet=1;
+  document.acquireImage=""; // string to evaluate after camera is tested that it is not running streamer
+  document.discret_x=128;
+  document.discret_y=64;
+//////////// for Theora RTP streamer ///////////////////
+  document.Address = "239.0.0.1";
+  document.Port = 20000;
+  document.Sfps = 15;
+  document.cgi_strm ="/admin-bin/cstrm.cgi?";  
+  document.startStopStreamerURL="pics/1pix.jpeg";
+
+//////////////////////////////// STREAMER FUNCTIONS ///////////////////////////////////////////
+function StreamerStartStop(c) {
+
+ document.Sfps=parseFloat(document.getElementById("idRequestedFPS").value);
+ document.startStopStreamerURL=document.cgi_strm+"opt=s&addr="+document.Address
+  				+"&port="+document.Port+"&fps="+document.Sfps
+		                +"&c="+c
+  if(c==1) {
+    document.dummyImg.src=document.startStopStreamerURL;
+   } 
+   else { 
+    document.dummyImg.src=document.startStopStreamerURL;
+   }
+//alert(document.startStopStreamerURL);
+}
+
+function updateAddress() {
+document.Address=document.getElementById("idAddress").value;
+
+//alert('change Address for stream '+document.Address);
+}
+
+function updatePort() {
+var port=parseInt(document.getElementById("idPort").value);
+if (port < 20000) { alert( 'Port must be above 20000 !!! ');
+	document.Port=20000;
+	document.getElementById("idPort").value=20000;
+} else if(port>50000) { alert("Port number to big!");
+	document.Port=20000;
+	document.getElementById("idPort").value=20000;
+}else if (Math.floor(port/2)*2 !=port) { alert("Port number must be EVEN !!! ");
+		document.Port = 20000;
+ 	     document.getElementById("idPort").value=20000;	
+} else document.Port=port;
+
+}
+/////////////////////////////////////// Streamer END /////////////////////////////////////////////////////////////
+
+
+// XML related stuff
+// abort did not work? try different object
+function loadXMLDocDummy(url) {
+    // branch for native XMLHttpRequest object
+    if (window.XMLHttpRequest) {
+        dummyReq = new XMLHttpRequest();
+        dummyReq.onreadystatechange = processDummyReqChange;
+        dummyReq.open("GET", url, true);
+        dummyReq.send(null);
+    // branch for IE/Windows ActiveX version
+    } else if (window.ActiveXObject) {
+        dummyReq = new ActiveXObject("Microsoft.XMLHTTP");
+        if (dummyReq) {
+            dummyReq.onreadystatechange = processDummyReqChange;
+            dummyReq.open("GET", url, true);
+            dummyReq.send();
+        }
+    }
+}
+function processDummyReqChange() {
+    if ((dummyReq.readyState >1 ) && document.timeNotSet) {
+      document.timeNotSet=0;
+      dummyReq.abort();  // abort that reply from 1972
+      updateXML(); // start over again
+    }
+}
+
+
+function loadXMLDoc(url) {
+    // branch for native XMLHttpRequest object
+    if (window.XMLHttpRequest) {
+        req = new XMLHttpRequest();
+        req.onreadystatechange = processReqChange;
+        req.open("GET", url, true);
+        req.send(null);
+    // branch for IE/Windows ActiveX version
+    } else if (window.ActiveXObject) {
+        req = new ActiveXObject("Microsoft.XMLHTTP");
+        if (req) {
+            req.onreadystatechange = processReqChange;
+            req.open("GET", url, true);
+            req.send();
+        }
+    }
+}
+function processReqChange() {
+    // only if req shows "loaded"
+    if (req.readyState == 4) {
+        // only if "OK"
+        if (req.status == 200) {
+            // ...processing statements go here...
+          getFromCamera();
+        } else {
+            alert("There was a problem retrieving the XML data:\n" +
+                req.statusText);
+        }
+    }
+    window.status=req.readyState;
+//   if (req.readyState>1)   alert("req.readyState="+req.readyState);
+}
+
+function acquireIfCan(cmd) {
+    // branch for native XMLHttpRequest object
+    document.acquireImage=cmd;
+//    myAlert("acquireIfCan: "+cmd);
+    
+    url=document.loadXMLStateURL;
+    if (window.XMLHttpRequest) {
+        camState = new XMLHttpRequest();
+        camState.onreadystatechange = processStateChange;
+        camState.open("GET", url, true);
+        camState.send(null);
+    // branch for IE/Windows ActiveX version
+    } else if (window.ActiveXObject) {
+        camState = new ActiveXObject("Microsoft.XMLHTTP");
+        if (camState) {
+            camState.onreadystatechange = processStateChange;
+            camState.open("GET", url, true);
+            camState.send();
+        }
+    }
+}
+function processStateChange() {
+    // only if req shows "loaded"
+    if (camState.readyState == 4) {
+        // only if "OK"
+        if (camState.status == 200) {
+            // ...processing statements go here...
+           if (parseInt(camState.responseXML.getElementsByTagName('SENSOR_STATE' )[0].firstChild.nodeValue)>7)  {
+              alert("Can not acquire preview image as streamer is possibly running.\n"+
+                      "You may want to try to stop it or reset the camera");
+// and just do nothing...                      
+           } else {
+// here - actually acquire requested image
+             eval(document.acquireImage);
+           }           
+
+
+        } else {
+            alert("There was a problem retrieving the XML data:\n" +
+                camState.statusText);
+        }
+    }
+}
+
+function updateXML() {
+ document.updating++;
+ updateLinks(); // move it later outside?
+ if (document.timeNotSet) loadXMLDocDummy(document.loadXMLDocURL);
+ else                     loadXMLDoc(document.loadXMLDocURL);
+ 
+// alert(document.updating);
+}
+function myAlert(s) {
+  var sl=60;
+  var i=0;
+
+  while (i< s.length) {
+   if ((s.length-i)<sl) sl=s.length-i;
+   s=s.substr(0,i).concat("\n",s.substr(i, s.length-i));
+   i+=sl+1;
+  }
+ alert (s);  
+}
+function watchDog(t) {
+  document.timeoutCntr++;
+ window.status=document.timeoutCntr;
+//  setTimeout('document.timeoutCntr--;',t);
+  setTimeout('document.timeoutCntr--;window.status=document.timeoutCntr',t);
+}
+
+
+
+
+
+
+function updateFPS() {
+}
+
+function g2n() { // setst numeric window dimentions accrording to dragging
+// update values in the text fields
+ document.getElementById("idHeight").value= Math.round(Math.abs(document.sizeY)*document.previewDecimation);
+ document.getElementById("idWidth").value=  Math.round(Math.abs(document.sizeX)*document.previewDecimation);
+/* document.getElementById("idBottom").value= document.maxHeight-
+       (Math.round(Math.min(document.firstY, document.firstY + document.sizeY + document.discret)*document.previewDecimation)+document.getElementById("idHeight").value);
+*/       
+/*
+ document.getElementById("idBottom").value= document.maxHeight-
+       (Math.round(Math.max(document.firstY, document.firstY + document.sizeY + document.discret)*document.previewDecimation)+document.getElementById("idHeight").value);
+*/       
+ document.getElementById("idBottom").value= Math.round((document.mapHeight-Math.max(document.firstY, document.firstY + document.sizeY + document.discret))*document.previewDecimation);
+ document.getElementById("idLeft").value=
+       Math.round(Math.min(document.firstX, document.firstX + document.sizeX + document.discret)*document.previewDecimation);
+ updateNumWindow();
+}
+
+function commonDragging(mouseX,mouseY){ 
+ if (document.dragging) {
+   var dsc=16*document.dcm/document.previewDecimation;
+
+   var y=mouseY - document.mapTop;
+   var x=mouseX - document.mapLeft;
+// Snap to borders
+   if (x<document.snap) x=0;  else if (x>=document.mapWidth-document.snap) x=document.mapWidth-1;
+   if (y<document.snap) y=0;  else if (y>=document.mapHeight-document.snap) y=document.mapHeight-1;
+
+   var h=Math.abs(y-document.firstY)+1;
+   var w=Math.abs(x-document.firstX)+1;
+   h=dsc*Math.floor(h/dsc); if (h<dsc*document.minTilesY) h=dsc*document.minTilesY;
+   w=dsc*Math.floor(w/dsc); if (w<dsc*document.minTilesX) w=dsc*document.minTilesX;
+   if (y<document.firstY)  h=-h;
+   if (x<document.firstX)  w=-w;
+  
+   if ((h!=document.sizeY) || (w!=document.sizeY)) {
+     document.sizeY=h;
+     document.sizeX=w;
+
+   g2n();
+   } 
+ }
+}
+
+function  commonMouseDown (mouseX,mouseY) {
+   document.discret=2*document.dcm/document.previewDecimation; if (document.discret<1) document.discret=1;
+   var y=mouseY - parseInt(document.getElementById("mapImage").style.top);
+   var x=mouseX - parseInt(document.getElementById("mapImage").style.left);
+   document.sizeY=16*document.minTilesY*document.dcm/document.previewDecimation;
+   document.sizeX=16*document.minTilesX*document.dcm/document.previewDecimation;
+// Snap to borders
+   if (x<document.snap) x=0;  else if (x>=document.mapWidth-document.snap) x=document.mapWidth-document.discret;
+   if (y<document.snap) y=0;  else if (y>=document.mapHeight-document.snap) y=document.mapHeight-document.discret;
+
+   document.firstY=document.discret*Math.round(y/document.discret); 
+   document.firstX=document.discret*Math.round(x/document.discret);
+   if ((document.firstY + document.sizeY)>document.mapHeight) document.sizeY =- document.sizeY;
+   if ((document.firstX + document.sizeX)>document.mapWidth)  document.sizeX =- document.sizeX;
+   g2n();
+
+   document.dragging=true;
+
+}
+
+function  commonMouseUp   () {
+ endDragging();
+}
+
+
+
+
+
+function initDragging()
+{
+  if (!document.dragEn) {
+    if(isDOM) {
+	 if (!isOperaIE) {
+       document.getElementById("mapImage").addEventListener("mousemove", dragging_Mozilla, true);
+       document.getElementById("mapImage").addEventListener("mousedown", mouseDown_Mozilla, true);
+       document.getElementById("mapImage").addEventListener("mouseup",   mouseUp_Mozilla, true);
+     } else {
+       document.getElementById("mapImage").onmousemove= dragging_Opera;
+       document.getElementById("mapImage").onmousedown= mouseDown_Opera;
+       document.getElementById("mapImage").onmouseup=   mouseUp_Opera ;
+	 }
+    }
+    else alert ("incompartible browser");
+    document.getElementById("window_selection").style.borderColor= "#00ff00";
+    document.dragEn=true;
+  }
+
+}
+function endDragging()
+{
+ document.dragging=false;
+  if (document.dragEn) {
+    if(isDOM) {
+	 if (!isOperaIE) {
+      document.getElementById("mapImage").removeEventListener("mousemove", dragging_Mozilla, true);
+      document.getElementById("mapImage").removeEventListener("mousedown", mouseDown_Mozilla, true);
+      document.getElementById("mapImage").removeEventListener("mouseup",   mouseUp_Mozilla, true);
+     } else {
+       document.getElementById("mapImage").onmousemove= null;
+       document.getElementById("mapImage").onmousedown= null;
+       document.getElementById("mapImage").onmouseup=   null;
+	 }
+    }
+
+    else alert ("incompartible browser");
+    document.dragEn=false;
+    document.getElementById("window_selection").style.borderColor= "#ff0000";
+  }
+}
+
+function updateColor(){
+ document.commonOptions=document.defaultOptions;
+ if (document.getElementById("idColor").checked)document.commonOptions+="c";
+ if (document.flipX) document.commonOptions+="x";
+ if (document.flipY) document.commonOptions+="y";
+// alert ("updateColor: document.commonOptions="+document.commonOptions);
+ updateLinks();
+}
+
+function updateGamma(){
+var g;
+ g=parseFloat(document.getElementById("idGamma").value);
+ if (!((g>=0.13)&&(g<=10))) document.getElementById("idGamma").value=0.47;
+  updateLinks();
+}
+
+// document.getElementById("idLevelBlack").value=2;
+// document.getElementById("idLevelWhite").value=254;
+function updateLevels(){
+  var vb,vw;
+  vb=parseInt(document.getElementById("idLevelBlack").value);
+  if (!((vb>=0)&&(vb<=254))) {
+    vb=0;
+    document.getElementById("idLevelBlack").value=0;
+  }  
+  vw=parseInt(document.getElementById("idLevelWhite").value);
+  if (!((vw>=vb)&&(vw<=255))) document.getElementById("idLevelWhite").value=255;
+ 
+}
+
+
+
+function updateGains(){
+var g;
+ g=parseInt(document.getElementById("idGainY").value); if (!((g>=0)&&(g<=63))) document.getElementById("idGainY").value=20;
+ g=parseInt(document.getElementById("idGainR").value); if (!((g>=0)&&(g<=63))) document.getElementById("idGainR").value=20;
+ g=parseInt(document.getElementById("idGainG").value); if (!((g>=0)&&(g<=63))) document.getElementById("idGainG").value=20;
+ g=parseInt(document.getElementById("idGainB").value); if (!((g>=0)&&(g<=63))) document.getElementById("idGainB").value=20;
+  updateLinks();
+}
+function updateExposure(){ //now it is measured in 100uS
+//  var e=parseInt(document.getElementById("idExposure").value); if (!((e>0)&&(e<10000))) document.getElementById("idExposure").value=20;
+  var e=parseFloat(document.getElementById("idExposure").value); if (!((e>0)&&(e<10000))) e=20;
+    e=Math.round (10*e)/10;document.getElementById("idExposure").value=e;
+
+//  document.saveExposure=parseInt(document.getElementById("idExposure").value);
+  document.saveExposure=parseFloat(document.getElementById("idExposure").value);
+  document.getElementById("idFrameTime").checked=false;
+  updateLinks();
+}
+function updateFullFrameExposure(){
+  document.getElementById("idExposure").value=(document.getElementById("idFrameTime").checked)?"":document.saveExposure;
+  updateLinks();
+}
+function updateQuality(){
+  var v=v=parseInt(document.getElementById("idQuality").value);
+  if (!((v>0)&&(v<=100))) document.getElementById("idQuality").value=50;
+  updateLinks();
+}
+function updateSaturation(m){ // m=0 - set both (from blue), m=1 - red only
+  var v;
+   if (m>0) {
+     v=parseFloat(document.getElementById("idSaturationRed").value);
+     if (!((v>=0)&&(v<=5))) v=1.0;
+     document.getElementById("idSaturationRed").value=v;
+   } else {
+     v=parseFloat(document.getElementById("idSaturationBlue").value);
+     if (!((v>=0)&&(v<=5))) v=1.0;
+     document.getElementById("idSaturationBlue").value=v;
+     document.getElementById("idSaturationRed").value=v;
+   }     
+  updateLinks();
+}
+function updateVideoSize(){
+      v=parseInt(document.getElementById("idTimeScale").value); if (!((v>0)&&(v<1000))) document.getElementById("idTimeScale").value=10;
+      v=parseInt(document.getElementById("idTheoraFrames").value); if (!((v>0)&&(v<65536))) document.getElementById("idTheoraFrames").value=40;
+      v=parseInt(document.getElementById("idTheoraInter").value); if (!((v>=0)&&(v<256))) document.getElementById("idTheoraInter").value=255;
+  updateLinks();
+}
+function showControls(){
+ var w;
+    w=window.open('vcontrols.html',
+                  'Controls'+escape(document.URL),
+                  'resizable=no,scrollbars=no,status=no,alwaysRaised=yes,height=335,width=100' );
+   w.focus();
+}
+function showClipFrame(){
+//    var w=window.open('clip_frame.html',
+//                  'Frame'+escape(document.URL),
+//                  'resizable=no,scrollbars=no,status=no,alwaysRaised=yes,'+
+//                  'height='+(100+parseInt(document.getElementById('idHeight').value))+
+//                  'width='+(20+parseInt(document.getElementById('idWidth').value)) );
+//   w.focus();
+  acquireIfCan("var w=window.open('clip_frame.html'," +
+               "'Frame'+escape(document.URL)," +
+               "'resizable=no,scrollbars=no,status=no,alwaysRaised=yes,'+" +
+               "'height='+(100+parseInt(document.getElementById('idHeight').value))+ "+
+               "'width='+(20+parseInt(document.getElementById('idWidth').value)) ); "+
+               "w.focus();" );
+
+}
+
+function updateLinks(){
+   var t=new Date();
+   var g;
+   var e=Math.round (parseFloat(document.getElementById("idExposure").value)*10); // 10 times actual
+   var requestedFPS;
+   updateFPS();
+   requestedFPS=parseFloat(document.getElementById("idRequestedFPS").value);
+   if (!(requestedFPS>0)){
+     requestedFPS=0;
+     document.getElementById("idRequestedFPS").value=" ";
+   }
+   var dcms="&dv="+document.dcm+"&dh="+document.dcm+"&";
+   document.commonParameters ="iq="+parseInt(document.getElementById("idQuality").value)+"&"+
+                              "kga="+parseInt(document.getElementById("idGainY").value)+"&"+
+                              "kgm=6&"+
+                              "gr="+ parseInt(document.getElementById("idGainR").value)+"&"+
+                              "gg="+ parseInt(document.getElementById("idGainG").value)+"&"+
+                              "ggb="+parseInt(document.getElementById("idGainG").value)+"&"+
+                              "gb="+ parseInt(document.getElementById("idGainB").value)+"&"+
+                              "csb="+Math.round(100*parseFloat(document.getElementById("idSaturationBlue").value))+"&"+
+                              "csr="+Math.round(100*parseFloat(document.getElementById("idSaturationRed").value))+"&"+
+                              "bit=8"+"&"+
+                              "gam="+Math.round(100*parseFloat(document.getElementById("idGamma").value))+"&"+
+                              "pxl="+parseInt(document.getElementById("idLevelBlack").value)+"&"+
+                              "pxh="+parseInt(document.getElementById("idLevelWhite").value);
+   if (!document.getElementById("idFrameTime").checked)
+     document.commonParameters+="&e="+e;
+   else document.commonParameters+="&e=-1";
+/*
+   document.previewURL=document.cgi+"opt="+document.commonOptions+
+//         "&dv=2&dh=2&ww=1280&wh=1024&wl=0&wt=0&"+
+
+         "&dv="+document.previewDecimation+"&dh="+document.previewDecimation+"&ww="+document.maxWidth+"&wh="+document.maxHeight+"&wl=0&wt=0&"+
+         document.commonParameters+
+         "&fps="+ requestedFPS+
+         "&_time="+t.getTime();
+*/
+   document.previewURL="/pics/nopreview.gif";
+   
+   
+   document.probeURL=document.cgi+"opt="+document.commonOptions+
+         "&dv=1&dh=1&ww=2100&wh=2100&wl=0&wt=0&iq=1"+"&_time="+t.getTime();
+
+  document.commonParameters+= "&ww="+ parseInt(document.getElementById("idWidth").value)+"&"+
+                              "wh="+ parseInt(document.getElementById("idHeight").value)+"&"+
+                              "wl="+ parseInt(document.getElementById("idLeft").value)+"&"+
+                              "wt="+ parseInt(document.getElementById("idBottom").value);
+//new/new win will be ogg/theora
+   document.newWinURL= document.cgi+"opt=o"+document.commonOptions+dcms+
+                       document.commonParameters+
+                       "&fps="+ requestedFPS+
+                       "&tts="+ parseInt(document.getElementById("idTimeScale").value)+
+                       "&tnf="+ parseInt(document.getElementById("idTheoraFrames").value)+
+                       "&tni="+ parseInt(document.getElementById("idTheoraInter").value)+
+                       "&_time="+t.getTime();
+   document.updateURL= document.cgi+"opt="+document.commonOptions+"u"+dcms+
+                       document.commonParameters+
+                       "&fps="+ requestedFPS+
+                       "&_time="+t.getTime();
+
+  document.startStopClipURL=document.cgi+"opt="+document.commonOptions+"q"+dcms+document.commonParameters+
+                              "&qts="+ parseInt(document.getElementById("idTimeScale").value)+
+                              "&fps="+ requestedFPS+
+                              "&_time="+t.getTime()+"&qcmd=";
+   document.getElementById('idStillPhoto').href=document.newWinURL;
+   document.getElementById('idLastPhoto').href=document.cgi+"opt=o"+"&_time="+t.getTime();
+//   document.getElementById('idFrame').href=document.cgi+"hist="+document.clipFrame+"&_time="+t.getTime();
+   document.getElementById('idInfo').href=document.cgi+"html=2"+"&_time="+t.getTime();
+
+/*   document.getElementById('idClip').href=document.cgi+"opt="+document.commonOptions+"q"+dcms+document.commonParameters+
+                              "&qcmd=4"+
+                              "&qts="+ parseInt(document.getElementById("idTimeScale").value)+
+                              "&fps="+ requestedFPS+
+                              "&_time="+t.getTime();*/
+  document.loadXMLDocURL=document.cgi+"html=10&_time="+t.getTime();
+  document.loadXMLStateURL=document.cgi+"html=12&_time="+t.getTime();
+  document.rescueURL=document.cgi+"opt=*q&qcmd=2&_time="+t.getTime(); // unfreeze
+  document.setTimeURL=document.cgi+"_time="+t.getTime(); // unfreeze
+}
+function updateClipFrame(v){
+  if ((v<9999) && (v>-9999)) document.clipFrame=v;
+  document.getElementById("idClipFrame").value=document.clipFrame;
+  updateLinks();
+}
+function changeClipFrame(m) { // m=-2 - first, m=-1 - prev, +1 - next, +2 - last
+  if      (m==-2) document.clipFrame= 1; //first
+  else if (m==-1) document.clipFrame-=1; //previous
+  else if (m== 1) document.clipFrame+=1; //next
+  else if (m== 2) document.clipFrame=0; //last
+  updateClipFrame(document.clipFrame);
+}
+function clipStartStop(c) {
+  updateLinks();
+  document.dummyImg.src=document.startStopClipURL+c;
+}
+function updateParameters() {
+  updateLinks();
+  document.dummyImg.src=document.updateURL;
+}
+function cameraReset() {
+  updateLinks();
+  document.dummyImg.src=document.rescueURL;
+}
+function setTimeIf1972(){
+  updateLinks();
+  document.dummyImg
+  document.dummyImg.onload=updateXML;
+  document.dummyImg.src=document.setTimeURL;
+//  alert(document.dummyImg.src);
+}
+function getFromCamera(){
+   document.imageGot=1;
+   document.maxWidth=                        parseInt(req.responseXML.getElementsByTagName('P_SENSOR_WIDTH' )[0].firstChild.nodeValue);
+   document.maxHeight=                       parseInt(req.responseXML.getElementsByTagName('P_SENSOR_HEIGHT')[0].firstChild.nodeValue);
+// don't read decimation - it will likely be from the perview
+// document.dcm=                             parseInt(req.responseXML.getElementsByTagName('P_DCM_HOR'      )[0].firstChild.nodeValue);
+   
+   document.getElementById("idDCM8").checked=(document.dcm>=8);
+   document.getElementById("idDCM4").checked=((document.dcm>=4) && (document.dcm<8));
+   document.getElementById("idDCM2").checked=((document.dcm>=2) && (document.dcm<4));
+   document.getElementById("idDCM1").checked=                      (document.dcm<2);
+   document.getElementById("idGainY").value= parseInt(req.responseXML.getElementsByTagName('P_SPEC_KAC_GGA' )[0].firstChild.nodeValue);
+   document.getElementById("idGainR").value= parseInt(req.responseXML.getElementsByTagName('P_GAINR'        )[0].firstChild.nodeValue);
+   document.getElementById("idGainG").value= parseInt(req.responseXML.getElementsByTagName('P_GAING'        )[0].firstChild.nodeValue);
+   document.getElementById("idGainB").value= parseInt(req.responseXML.getElementsByTagName('P_GAINB'        )[0].firstChild.nodeValue);
+
+   document.getElementById("idWidth").value= parseInt(req.responseXML.getElementsByTagName('P_WOI_WIDTH'    )[0].firstChild.nodeValue);
+   document.getElementById("idHeight").value=parseInt(req.responseXML.getElementsByTagName('P_WOI_HEIGHT'   )[0].firstChild.nodeValue);
+   document.getElementById("idLeft").value=  parseInt(req.responseXML.getElementsByTagName('P_WOI_LEFT'     )[0].firstChild.nodeValue);
+   document.getElementById("idBottom").value=   parseInt(req.responseXML.getElementsByTagName('P_WOI_TOP'      )[0].firstChild.nodeValue);
+   
+   document.flipX= (parseInt(req.responseXML.getElementsByTagName('P_FLIPH')[0].firstChild.nodeValue)>0)?1:0;
+   document.flipY= (parseInt(req.responseXML.getElementsByTagName('P_FLIPV')[0].firstChild.nodeValue)>0)?1:0;
+   document.getElementById("idColor").checked= (parseInt(req.responseXML.getElementsByTagName('P_COLOR')[0].firstChild.nodeValue)>0)?"true":"false";
+   document.getElementById("idGamma").value= 0.01*parseInt(req.responseXML.getElementsByTagName('P_GAMMA'        )[0].firstChild.nodeValue);
+   document.getElementById("idSaturationBlue").value= 0.01*parseInt(req.responseXML.getElementsByTagName('P_COLOR_SATURATION_BLUE')[0].firstChild.nodeValue);
+   document.getElementById("idSaturationRed").value= 0.01*parseInt(req.responseXML.getElementsByTagName('P_COLOR_SATURATION_RED' )[0].firstChild.nodeValue);
+
+   document.getElementById("idLevelBlack").value=parseInt(req.responseXML.getElementsByTagName('P_PIXEL_LOW' )[0].firstChild.nodeValue);
+   document.getElementById("idLevelWhite").value=parseInt(req.responseXML.getElementsByTagName('P_PIXEL_HIGH')[0].firstChild.nodeValue);
+
+   
+   document.getElementById("idQuality").value= parseInt(req.responseXML.getElementsByTagName('P_QUALITY'      )[0].firstChild.nodeValue);
+   document.getElementById("idExposure").value= 0.1*parseInt(req.responseXML.getElementsByTagName('P_EXPOS'   )[0].firstChild.nodeValue);
+   document.previewDecimation=(document.maxWidth>1600)?4:2;
+
+   document.getElementById('mapImage').style.width=document.maxWidth/document.previewDecimation;
+   document.getElementById('mapImage').style.height=document.maxHeight/document.previewDecimation;
+   document.getElementById('idControls').style.top=document.maxHeight/document.previewDecimation+8;
+   if (document.previewDecimation==2)    document.getElementById('idControls').style.width=document.maxWidth/document.previewDecimation;
+   document.mapWidth= document.maxWidth/document.previewDecimation;
+   document.mapHeight=document.maxHeight/document.previewDecimation;
+//   fullWindow();
+// read defaults if sensor was never programmed 
+   document.sensor=parseInt(req.responseXML.getElementsByTagName('P_SENSOR' )[0].firstChild.nodeValue);
+   if ((!(parseInt(req.responseXML.getElementsByTagName('SENSOR_STATE' )[0].firstChild.nodeValue)>0)) ||
+       (!(parseInt(req.responseXML.getElementsByTagName('P_QUALITY' )[0].firstChild.nodeValue)>0))) {
+         setDefaults();
+   }
+//    else updateLinks();
+   updateColor();
+   updateNumWindow();
+   if (parseInt(req.responseXML.getElementsByTagName('SENSOR_STATE' )[0].firstChild.nodeValue)<8) {
+     document.getElementById("mapImage").style.backgroundImage="url("+document.previewURL+")";
+   } else alert("Can not acquire preview image as streamer is possibly running.\n"+
+              "You may want to try to stop it or reset the camera");
+   if ((document.sensor >=49) && (document.sensor <=51))  document.getElementById("idGainY").style.display="none";
+}
+function setDefaults() {
+// common defaults:
+   document.flipX=1;
+   document.flipY=0;
+   document.getElementById("idColor").checked= true;
+   document.getElementById("idGamma").value= 0.47;
+   document.getElementById("idSaturationBlue").value=2.0;
+   document.getElementById("idSaturationRed").value= 2.0;
+
+   document.getElementById("idQuality").value= 46;
+   document.getElementById("idExposure").value= 20.0;
+// default windows:
+  switch (document.sensor) {
+  case 49: MT9M001_dflt(); break;
+  case 50: MT9D001_dflt(); break;
+  case 51: MT9T001_dflt(); break;
+  default: other_dflt();
+  updateColor();
+//  updateLinks();
+  }
+  
+}
+
+function other_dflt() { // MT9M001_dflt()
+ document.getElementById("idGainY").value=63;
+ document.getElementById("idGainR").value=22;
+ document.getElementById("idGainG").value=16;
+ document.getElementById("idGainB").value=17;
+ document.getElementById("idLevelBlack").value=2;
+ document.getElementById("idLevelWhite").value=254;
+
+}
+function MT9M001_dflt() {
+ document.getElementById("idGainY").value=63;
+ document.getElementById("idGainR").value=22;
+ document.getElementById("idGainG").value=16;
+ document.getElementById("idGainB").value=17;
+ document.getElementById("idLevelBlack").value=2;
+ document.getElementById("idLevelWhite").value=254;
+}
+function MT9D001_dflt() {
+ document.getElementById("idGainY").value=63;
+ document.getElementById("idGainR").value=17; //42
+ document.getElementById("idGainG").value=11; //25
+ document.getElementById("idGainB").value=13; //27
+ document.getElementById("idLevelBlack").value=2;
+ document.getElementById("idLevelWhite").value=254;
+}  
+function MT9T001_dflt() {
+ document.getElementById("idGainY").value=63;
+ document.getElementById("idGainR").value=16;
+ document.getElementById("idGainG").value=11;
+ document.getElementById("idGainB").value=12;
+ document.getElementById("idLevelBlack").value=10;
+ document.getElementById("idLevelWhite").value=254;
+}  
+
+function updateNumWindow() { // validate window sizes, show window
+  if      (document.getElementById("idDCM1").checked) document.dcm=1;
+  else if (document.getElementById("idDCM2").checked) document.dcm=2;
+  else if (document.getElementById("idDCM4").checked) document.dcm=4;
+  else if (document.getElementById("idDCM8").checked) document.dcm=8;
+
+//alert('document.dcm='+document.dcm);
+  var w=parseInt(document.getElementById("idWidth").value);
+  var h=parseInt(document.getElementById("idHeight").value);
+  var l=parseInt(document.getElementById("idLeft").value);
+  var b=parseInt(document.getElementById("idBottom").value);
+//alert("w="+w+"\nh="+h+"\nl="+l+"\nt="+t);
+// l >=0, l<(maxWidth-16*document.dcm)
+/*
+  if (l<0) l=0;
+  if (l>=(document.maxWidth-32*document.dcm)) l=document.maxWidth-32*document.dcm;
+  l= 2*document.dcm*Math.floor(l/2/document.dcm);
+  if((l+w)>document.maxWidth) w= document.maxWidth-l;
+  w=16*document.dcm*Math.floor(w/16/document.dcm);
+  if (w<32*document.dcm) w=32*document.dcm;
+  if (t<0) t=0;
+  if (t>=(document.maxHeight-32*document.dcm)) t=document.maxHeight-32*document.dcm;
+  t= 2*document.dcm*Math.floor(t/2/document.dcm);
+  if((t+h)>document.maxHeight) h= document.maxHeight-t;
+  h=16*document.dcm*Math.floor(h/16/document.dcm);
+  if (h<32*document.dcm) h=32*document.dcm;
+*/
+//  document.discret_x=128;
+//  document.discret_y=64;
+  if (l<0) l=0;
+  if (l>=(document.maxWidth- document.discret_x*document.dcm)) l=document.maxWidth- document.discret_x*document.dcm;
+  l= document.dcm*Math.round(l/document.dcm);
+  if((l+w)>document.maxWidth) w= document.maxWidth-l;
+  w=document.discret_x*document.dcm*Math.round(w/document.discret_x/document.dcm);
+  if (w<document.discret_x*document.dcm) w=document.discret_x*document.dcm;
+  if((l+w)>document.maxWidth) l= document.maxWidth-w;
+  if (b<0) b=0;
+  if (b>=(document.maxHeight - document.discret_y*document.dcm)) b=document.maxHeight - document.discret_y*document.dcm;
+  b= document.dcm*Math.round(b/document.dcm);
+  if((b+h)>document.maxHeight) h= document.maxHeight-b;
+  h=document.discret_y*document.dcm*Math.round(h/document.discret_y/document.dcm);
+  if (h<document.discret_y*document.dcm) h=document.discret_y*document.dcm;
+  if((b+h)>document.maxHeight) b= document.maxHeight-h;
+
+
+// update values in the text fields
+  document.getElementById("idWidth").value=w;
+  document.getElementById("idHeight").value=h;
+  document.getElementById("idLeft").value=l;
+  document.getElementById("idBottom").value=b;
+// show graphically (see if needed 1 extra pixel for the border each side)
+  document.getElementById("window_selection").style.width= (w/document.previewDecimation)-2;
+  document.getElementById("window_selection").style.height=(h/document.previewDecimation)-2;
+  document.getElementById("window_selection").style.left=  l/document.previewDecimation;
+//  document.getElementById("window_selection").style.top=   t/document.previewDecimation;
+  document.getElementById("window_selection").style.top=   (document.maxHeight-b-h)/document.previewDecimation;
+//  alert ("w="+w+"\nh="+h+"\nl="+l+"\nb="+b+"\ndocument.previewDecimation="+document.previewDecimation);
+  updateLinks();
+}
+
+function fullWindow() {
+  document.getElementById("idWidth").value=document.maxWidth;
+  document.getElementById("idHeight").value=document.maxHeight;
+  document.getElementById("idLeft").value=0;
+  document.getElementById("idBottom").value=0;
+  updateNumWindow();
+}  
+
+function imgPreview() {
+//  if (document.imageGot==1) {
+    updateLinks();
+    acquireIfCan("document.getElementById('mapImage').style.backgroundImage='url('+document.previewURL+')';");
+
+
+// disable preview
+//    document.getElementById("mapImage").style.backgroundImage="url("+document.previewURL+")";
+//  } else  imgPreview_init();
+}
+
+function imgNewWindow() {
+  updateLinks();
+  var w=parseInt(document.getElementById("idWidth").value)/document.dcm;
+  var h=parseInt(document.getElementById("idHeight").value)/document.dcm;
+//  window.open(document.newWinURL,'image','resizable=yes,scrollbars=yes, width='+(w+40)+',height='+(h+30));
+  var cmd="window.open(document.newWinURL,'image','resizable=yes,scrollbars=yes, width="+(w+40)+",height="+(h+30)+"');"
+  acquireIfCan(cmd);
+
+}
+
+// Mozilla functions
+function mouseDown_Mozilla (e) {
+ if (document.dragging) mouseUp_Mozilla   (e);
+ else commonMouseDown (e.pageX,e.pageY);
+}
+function dragging_Mozilla(e) {commonDragging(e.pageX,e.pageY);}
+function mouseUp_Mozilla   (e) { commonMouseUp   ();}
+// Opera/IE6 functions
+function mouseDown_Opera (e) {
+ if (document.dragging) mouseUp_Mozilla   (e);
+ else commonMouseDown (event.clientX,event.clientY);
+}
+function dragging_Opera(){ commonDragging(event.clientX,event.clientY);}
+function mouseUp_Opera  () {commonMouseUp   ();}
+
+</script>
+<title>Elphel Model 333 Camera with Ogg/Theora</title>
+</head>
+<!--<body  class="textStyle" bgcolor="#CCCCCC" onLoad="setTimeIf1972();updateColor();updateNumWindow();"> -->
+<body  class="textStyle" bgcolor="#CCCCCC" onLoad="updateXML();">
+
+<!--
+<div id="mapImage" style="position:absolute; width:640px; height:512px; z-index:101; left: 0px; top: 0px;  border-style: solid; background-position: top center; background-repeat: no-repeat; border: 1px none #000000">
+-->
+
+<div id="mapImage" style="position:absolute; width:640px; height:512px; z-index:101; left: 0px; top: 0px;  border-style: solid; background-position: top left; background-repeat: repeat; border: 1px none #000000">
+
+
+  <div id="window_selection"></div>
+</div>
+<div id="idControls" style="position:absolute; width:640px; height:200px; z-index:101; left: 0px; top: 520;">
+
+<form method="post" action="">
+    <table border="1" cellspacing="0" cellpadding="0" width="100%">
+      <tr valign="top"> 
+        <td>
+         <table border="1" cellspacing="0" cellpadding="0" width="100%" height="100%">
+         <tr><td>
+          
+          <table border="0" cellspacing="0" cellpadding="0" width="100%">
+            <tr> 
+              <td colspan="2"> 
+                <div align="center"><b>Window</b> </div>
+              </td></tr>
+<!--            <tr><td colspan="2">&nbsp;</td></tr> -->
+              <tr>
+              <td> 
+                <div align="center">
+                  <input type="button" id="idSelectDrag" value="Drag" onClick="initDragging();" >
+                </div>
+              </td>
+              <td> 
+                <div align="center">
+                  <input type="button" id="idSelectFull" value="Full" onClick="fullWindow();" >
+                </div>
+              </td>
+            </tr>
+<!--            <tr><td colspan="2">&nbsp;</td></tr> -->
+
+            <tr> 
+              <td>
+                <div class="nowrap">
+                W<input type="text" id="idWidth" size="4" maxlength="4" value="1280" onChange="updateNumWindow();" class="inputs"></div>
+              </td>
+              <td> 
+                <div class="nowrap">
+                H<input type="text" id="idHeight" size="4" maxlength="4" value="1024" onChange="updateNumWindow();" class="inputs">
+                </div>
+              </td>
+            </tr>
+              <td>
+                <div class="nowrap">
+                L<input type="text" id="idLeft" size="4" maxlength="4" value="0" onChange="updateNumWindow();" class="inputs">
+                </div>
+              </td>
+              <td> 
+                <div class="nowrap">
+                B<input type="text" id="idBottom" size="4" maxlength="4" value="0" onChange="updateNumWindow();" class="inputs">
+                </div>
+                
+              </td>
+            </tr>
+            
+<!--            <tr><td colspan="2">&nbsp;</td></tr> -->
+            <tr><td>
+            </table>
+            </td> </tr>
+            <tr><td>
+             <table border="0"  width= "100%">
+              <tr>
+               <td colspan="4"><div align="center"><b>Decimation</b></div></td>
+              </tr>
+              <tr>
+               <td>none</td><td>1/2</td><td>1/4</td><td>1/8</td>
+              </tr>
+              <tr>
+               <td> <input type="radio" id="idDCM1" name="nDecimation" value="1" onChange="updateNumWindow();" onClick="updateNumWindow();" checked ></td>
+               <td> <input type="radio" id="idDCM2" name="nDecimation" value="2" onChange="updateNumWindow();" onClick="updateNumWindow();"  ></td>
+               <td> <input type="radio" id="idDCM4" name="nDecimation" value="4" onChange="updateNumWindow();" onClick="updateNumWindow();"  ></td>
+               <td> <input type="radio" id="idDCM8" name="nDecimation" value="8" onChange="updateNumWindow();" onClick="updateNumWindow();" c ></td>
+              </tr>
+             </table>
+            </td></tr>
+
+            
+            <tr > 
+              <td>
+               <table><tr>
+                 <td><div style="nowrap"><b>Quality</b></div></td>
+                 <td><div style="nowrap"><input type="text" id="idQuality" size="2" maxlength="2" value="46" onChange="updateQuality();" class="inputs">%</div></td>
+                </tr>
+               </table>
+              </td>
+            </tr>
+
+
+            <tr>
+              <td>
+                <table><tr> 
+                  <td>Rst</td>
+                  <td><input type="radio" id="idReset" name="nReset" value="1" onClick="cameraReset();"></td>
+                  </td>    
+                  <td>
+                  <input type="button" id="idDefault" value="Defaults" onClick="setDefaults();" >
+                </td>
+                </tr></table>
+              </td>
+            </tr>
+          </table>
+      </td>
+        
+
+        
+      <td>
+       <table border="1" cellspacing="0" cellpadding="0" width="100%" height="100%">
+        <tr><td>
+          <table border="0" cellspacing="0" cellpadding="0" width="100%">
+            <tr>
+              <td colspan="2">
+                <div align="center"><b>Exposure</b></div>
+              </td>
+              </tr>
+              <tr>
+              <td>
+                <div align="right">
+                  <input type="text" id="idExposure" size="5" maxlength="5" value="20" onChange="updateExposure();" class="inputs">
+                </div>
+              </td>
+              <td>ms</td>
+            </tr>
+            <tr>
+              <td>
+                <div align="center">1 frame</div>
+              </td>
+              <td>
+                <input type="checkbox" id="idFrameTime" onClick="updateFullFrameExposure()">
+              </td>
+            </tr>
+          </table>
+        </td></tr>
+        <tr><td>  
+          <table border="0" cellspacing="0" cellpadding="0" width="100%">
+            <tr>
+              <td colspan="2">
+                <div align="center"><b>Gains</b>
+<input type="text" id="idGainY" size="3" maxlength="3" value="100" onChange="updateGains();" class="inputs"></div>
+              </td>
+            <tr>
+              <td> 
+                <div align="right">R </div>
+              </td>
+              <td>
+                <input type="text" id="idGainR" size="3" maxlength="3" value="30" onChange="updateGains();" class="inputs">
+              </td>
+            </tr>
+            <tr> 
+              <td> 
+                <div align="right">G </div>
+              </td>
+              <td>
+                <input type="text" id="idGainG" size="3" maxlength="3" value="25" onChange="updateGains();" class="inputs">
+              </td>
+            </tr>
+            <tr> 
+              <td> 
+                <div align="right">B </div>
+              </td>
+              <td>
+                <input type="text" id="idGainB" size="3" maxlength="3" value="30" onChange="updateGains();" class="inputs">
+              </td>
+            </tr>
+            <tr>
+              <td>Color</td>
+              <td >
+                <input type="checkbox" id="idColor" onClick="updateColor()" checked>
+              </td>
+            </tr>
+           </table>
+         </td></tr>
+        </table> 
+      </td>
+
+
+
+      
+        
+      <td>
+       <table border="1" cellspacing="0" cellpadding="0" width="100%" height="100%">
+        <tr><td>
+          <table border="0" cellspacing="0" cellpadding="0" width="100%">
+            
+            <tr>
+              <td colspan="2"><div align="center"><b>Contrast</b></div></td>
+            </tr>
+            <tr>
+              <td>
+                <div align="right">Gamma</div>
+              </td>
+<!--              <td><input type="text" id="idGainY" size="3" maxlength="3" value="30" onChange="updateGains();" class="inputs"></td> --> <!-- KAC1310-->
+              <td><input type="text" id="idGamma" size="4" maxlength="4" value="0.47" onChange="updateGamma();" class="inputs"></td>
+            </tr>
+            
+            <tr>
+              <td>Levels</td><td> </td>
+            </tr>
+            <tr>
+              <td>
+                <div align="right">Black</div>
+              </td>
+              <td><input type="text" id="idLevelBlack" size="4" maxlength="4" value="0" onChange="updateLevels();" class="inputs"></td>
+            </tr>
+            <tr>
+              <td>
+                <div align="right">White</div>
+              </td>
+              <td><input type="text" id="idLevelWhite" size="4" maxlength="4" value="255" onChange="updateLevels();" class="inputs"></td>
+            </tr>
+
+          </table>
+        </td></tr>
+        <tr><td>
+          <table border="0" cellspacing="0" cellpadding="0" width="100%">
+            <tr>
+              <td colspan="2"><div align="center"><b>Saturation</b></div></td>
+            </tr>
+            <tr>
+              <td>
+                <div align="right">B-Y</div>
+              </td>
+              <td><input type="text" id="idSaturationBlue" size="4" maxlength="4" value="2.0" onChange="updateSaturation(0);" class="inputs"></td>
+            </tr>
+            <tr>
+              <td>
+                <div align="right">R-Y</div>
+              </td>
+              <td><input type="text" id="idSaturationRed" size="4" maxlength="4" value="2.0" onChange="updateSaturation(1);" class="inputs"></td>
+            </tr>
+            
+
+            
+          </table>
+        </td></tr>
+       </table>
+      </td>
+
+
+
+        
+        <td>
+          <table border="1" cellspacing="0" cellpadding="0" width="100%" height="100%">
+            <tr>
+              <td><table border="0" cellspacing="0" cellpadding="0" width="100%" >
+            <tr>
+              <td colspan="2" nowrap="y">
+
+                              <b> Theora Clip: <a id="idStillPhoto" href="#" target="_blank">New</a> : </b>
+                              <b><a id="idLastPhoto" href="#" target="_blank">Last</a></b>
+                             <b><a id="idInfo" href="#" target="_blank">?</a></b> : 
+                             <b><a href="index_help.html" target="_blank">HELP</a></b></div>
+
+                      
+              </td>
+            </tr>
+<!--
+            <tr>
+                    <td>
+                      <div align="center">
+                        <input type="button" id="idPreview" value="Preview" onClick="imgPreview();" >
+                      </div>
+                    </td><td>
+                      <div align="center">
+                        <input type="button" id="idGet" value="Separate window" onClick="imgNewWindow();" >
+                      </div>
+                    </td>
+</tr>          </table></td>
+            </tr>
+-->
+            <tr>
+              <td>
+                <table border="0" cellspacing="0" cellpadding="0" width="100%" >
+<!--
+                  <tr>
+                    <td colspan="2">
+                      <div align="center">
+                        <b><a id="idClip" href="#" target="_blank">Video Clip</a></b>&nbsp;&nbsp;
+                        <b><a id="idClip" href="strctl.cgi" target="_blank">Video Streamers</a></b>
+                      </div>
+                    </td>
+                  </tr>
+
+                  <tr>
+                    <td colspan="2">
+                        <input type="button" id="idStart" value="Start" onClick="clipStartStop(1);" >
+                        <input type="button" id="idStop" value="Stop" onClick="clipStartStop(2);" >
+                        <input type="button" id="idAcquire" value="Acquire" onClick="clipStartStop(3);" >
+                    </td>
+                  </tr>
+              <tr>
+              <tr>
+                <td> <div align="left">
+                    <input type="button" id="idUpdate" value="Update" onClick="updateParameters();" >
+                </div></td>
+                <td>
+                    <input type="button" id="idVcontrols" value="Video Controls" onClick="showControls();" >
+                </td>
+              </tr>
+-->
+              <tr>
+                <td> <div align="left">
+                    Frame rate
+                </div></td>
+                <td>
+                   <input type="text" id="idRequestedFPS" size="5" maxlength="5" value=" " onChange="updateVideoSize();" class="inputs">
+                   fps
+                </td>
+              </tr>
+              <tr>
+                <td> <div align="left">
+                   Time Scale
+                </div></td>
+                <td>
+                   <input type="text" id="idTimeScale" size="3" maxlength="3" value="3" onChange="updateVideoSize();" class="inputs">
+                   x
+                </td>
+              </tr>
+              <tr>
+                <td> <div align="left">
+                   Tot. frames
+                </div></td>
+                <td>
+                   <input type="text" id="idTheoraFrames" size="5" maxlength="5" value="100" onChange="updateVideoSize();" class="inputs">
+                </td>
+              </tr>
+              <tr>
+                <td> <div align="left">
+                   INTER/INTRA
+                </div></td>
+                <td>
+                   <input type="text" id="idTheoraInter" size="3" maxlength="3" value="255" onChange="updateVideoSize();" class="inputs">
+                </td>
+              </tr>
+<!--
+              <tr>
+                <td colspan="2">
+                <input type="button" id="idFBack" value="<<" onClick="changeClipFrame(-2);" >
+                <input type="button" id="idBack" value="<" onClick="changeClipFrame(-1);" >
+                  <input type="text" id="idClipFrame" size="4" maxlength="4" value="0" onChange="updateClipFrame(this.value);" class="inputs">
+                <input type="button" id="idFrw" value=">" onClick="changeClipFrame(1);" >
+                <input type="button" id="idFFrw" value=">>" onClick="changeClipFrame(2);" >
+                </td>
+              </tr>
+              <tr><td colspan="2">
+                <input type="button" id="idShowClipFrame" value="Show clip frame" onClick="showClipFrame();" >
+                 <b><a id="idFrame" href="#" target="_blank">Frame</a></b>              
+              </td></tr>
+-->
+                </table>
+</td>
+            </tr>
+
+          </table>
+        </td>
+    </tr>
+<!-- Video streamer -->
+            <tr>
+              <td>
+                <table border="0" cellspacing="0" cellpadding="0" width="100%" >
+                  <tr>
+                    <td colspan="2">
+                      <div align="center"><b>Theora RTP
+                        Streamer</b>
+                        <img src="pics/1pix.jpeg" width="1" height="1" name="n1pix" id="id1pix">
+                      </div>
+                    </td>
+                  </tr>
+                  <tr>
+                    <td>
+                        <input type="button" id="idStartStrm" value="Start streaming" onClick="StreamerStartStop(1);" >
+                    </td>
+                    <td>
+                        <input type="button" id="idStopStrm" value="Stop streaming" onClick="StreamerStartStop(0);" >
+                    </td>
+                 </tr>
+                 <tr>
+                    <td>
+                      <div align="right">Addr/hostname</div>
+                    </td>
+                    <td> 
+                      <input type="text" id="idAddress" size="15" maxlength="15" value="239.0.0.1" onChange="updateAddress();" class="inputs" name="text">
+                    </td>
+                  </tr>
+                  <tr> 
+                    <td>
+                      <div align="right">Port#</div>
+                    </td>
+                    <td> 
+                      <input type="text" id="idPort" size="5" maxlength="5" value="20000" onChange="updatePort();" class="inputs" name="text">
+                    </td>
+		   </tr>
+
+	      </td>
+	     </tr>
+
+          </table>
+        </td>
+    </tr>
+
+  </table>
+</form>
+</div>
+</body>
+</html>

Added: experimental/j/Elphel333/rtp/daemon/.target-makefrag
===================================================================
--- experimental/j/Elphel333/rtp/daemon/.target-makefrag	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/daemon/.target-makefrag	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1 @@
+AXIS_BUILDTYPE=cris-axis-linux-gnu

Added: experimental/j/Elphel333/rtp/daemon/Makefile
===================================================================
--- experimental/j/Elphel333/rtp/daemon/Makefile	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/daemon/Makefile	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,46 @@
+#
+# Makefile for the Elphel streamer.
+# This probably requires GNU make.
+#
+AXIS_USABLE_LIBS = UCLIBC GLIBC
+include $(AXIS_TOP_DIR)/tools/build/Rules.axis
+
+THEORACOMMON=../../common
+THEORACOMMON_OBJS=$(THEORACOMMON)/oggtheora.o $(THEORACOMMON)/utils.o
+
+# Location of includes and library
+CSRC   = rtp
+
+# Library name
+LNAME  = uclmmbase
+
+DEFS   = -DHAVE_CONFIG_H
+CFLAGS = -O2 -W  -Wwrite-strings -Wbad-function-cast -Wmissing-prototypes -Wcast-qual -Wmissing-declarations  $(DEFS) -I$(CSRC) -I$(THEORACOMMON)
+LIBS   = -lm -L$(CSRC)/.libs -l$(LNAME) 
+
+LD	= ld-cris
+
+TARGET = TheoraStrm
+OBJS   = TheoraStrm.o
+SRCS   = $(OBJS:%.o=%.c)
+
+all: $(TARGET)
+
+$(TARGET): $(OBJS) $(CSRC)/lib$(LNAME).a  $(THEORACOMMON_OBJS)
+	 $(CC) $(CFLAGS) -o $@ $(OBJS) $(THEORACOMMON_OBJS) $(LIBS)
+	 strip-cris $@
+
+.c.o:
+	$(CC) $(CFLAGS) $(INC) -c $<
+
+$(THEORACOMMON_OBJS): 
+	cd $(THEORACOMMON) && $(MAKE)
+
+$(CSRC)/lib$(LNAME).a:
+	cd $(CSRC) && $(MAKE)
+
+clean:
+	-rm -f *.o $(OBJS) $(TARGET)
+
+distclean: clean
+	-rm -f Makefile

Added: experimental/j/Elphel333/rtp/daemon/README
===================================================================
--- experimental/j/Elphel333/rtp/daemon/README	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/daemon/README	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,8 @@
+note:
+    due to brokenness of rtp lib for cross compile you have to run:
+      cd ntp
+      ./configure && ./configure --host=cris --build=i586-linux 
+      make
+      cd ..
+    make will fail, ingore that and run make
+    

Added: experimental/j/Elphel333/rtp/daemon/TheoraStrm.c
===================================================================
--- experimental/j/Elphel333/rtp/daemon/TheoraStrm.c	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/daemon/TheoraStrm.c	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,668 @@
+/******************************************************************************
+This 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 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; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+	
+******************************************************************************/
+// Streamer for Elphel Camera 333 input device
+// Copyright (c) 2005 Andy Latin 
+// All rights reserved.
+//
+// http://andy.qnx.org.ru
+// mail to:  
+// andy at qnx.org.ru   
+// andrey.latin at gmail.com
+/////////////////////////////////////////////////////////////////////////////
+#include <sys/time.h>
+#include <sys/mman.h>           /* mmap */
+#include <ctype.h>
+#include <inttypes.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <getopt.h>
+
+#include "c313a.h"
+
+
+/*************** RTP UCL library *******************/
+#include "uclconf.h"
+#include "config_unix.h"
+#include "config_win32.h"
+#include "debug.h"
+#include "memory.h"
+#include "rtp.h"
+
+#include "defines.h"
+#include "oggtheora.h"
+
+#define D(x) 
+
+#define HDR_INTERVAL   100   // send headers every 4 s for  25 fps
+///////////////////// GLOBAL DATA ///////////////////
+int			mTimeinterval = 40000;  // default for 25 fps
+const char 		mmapFileName[]= "/var/tmp/mmap_strm";
+strm_data_t  		*strm_data;
+static strm_data_t  	strm_data_par;
+int			hdr_size;
+/////////////// OggTheora data///////////////////////
+
+ int        kfgshiftm=9;
+ len_data_t packets[6];
+ u_int32_t  header_lengths[6];
+ uint8_t    *b_headers;
+
+/////////////////////////////////////////////////////
+
+static void
+usage()
+{
+    printf("\n");
+    printf("\tTheora RTP streamer for Elphel Camera model 333. \n");
+    printf("\tInitial version writed by: Andrey Latin\n");
+    printf("\nTheoraStrm 0.5 (C) 2005 Elphel Team\n\n");
+    printf("\nThis is distributed in the hope that it will be useful,\n");
+    printf("\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\n");
+    printf("\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n");
+    printf("\nGNU General Public License for more details.\n\n");
+
+    printf("\n\tUsage: TheoraStrm [-f <fps>] [-a <address>] [-p <port>] [-w] [-h]\n\n");
+    printf("\t\t[-w] - use WEB interface for manage streamer\n\n");
+
+    printf("\t If used WEB interface for manage of streamer, options enumerated\n");
+    printf("\t below can be changed from browser.\n\n");
+    
+    printf("\t\t[-f<fps>] - max values fps(frame per second), default 25.\n");
+    printf("\t\tRange from 1 to 30 fps.\n");
+    printf("\t\t[-a<address>] - Unicast or multicast address for streaming RTP\n");
+    printf("\t\t\tDefault 239.0.0.1\n");
+
+    printf("\t\t[-p<port>] - port for streaming data. Must be EVEN!\n");
+    printf("\t\t\tDefault 20000.\n");
+
+    printf("\t\t[-k<password>] - set encryption mode with key <password> (DES)\n");
+    printf("\t\t[-h]  - this help\n\n");
+  exit(-1);
+}
+
+
+/* ------------------------------------------------------------------------- */
+/* RTP callback related */
+
+static void
+sdes_print(struct rtp *session, uint32_t ssrc, rtcp_sdes_type stype) {
+	const char *sdes_type_names[] = {
+		"end", "cname", "name", "email", "telephone", 
+		"location", "tool", "note", "priv"
+	};
+	const uint8_t n = sizeof(sdes_type_names) / sizeof(sdes_type_names[0]);
+
+	if (stype > n) {
+		/* Theoretically impossible */
+		printf("boo! invalud sdes field %d\n", stype);
+		return;
+	}
+	
+	printf("SSRC 0x%08x reported SDES type %s - ", ssrc, 
+	       sdes_type_names[stype]);
+
+	if (stype == RTCP_SDES_PRIV) {
+		printf("don't know how to display.\n");
+	} else {
+		printf("%s\n", rtp_get_sdes(session, ssrc, stype));
+	}
+}
+
+static void
+packet_print(struct rtp *session, rtp_packet *p) 
+{
+	printf("Received data (payload %d timestamp %06d size %d) ", 
+		p->rtp_pak_pt, p->rtp_pak_ts, p->rtp_data_len);
+
+	if (p->rtp_pak_ssrc == rtp_my_ssrc(session)) {
+		/* Unless filtering is enabled we are likely to see
+		   out packets if sending to a multicast group. */
+		printf("that I just sent.\n");
+	} else {
+		printf("from SSRC 0x%08x\n", p->rtp_pak_ssrc); 
+	} 
+}
+
+static void
+rtp_event_handler(struct rtp *session, rtp_event *e) 
+{
+	rtp_packet	*p;
+	rtcp_sdes_item	*r;
+
+	switch(e->type) {
+	case RX_RTP: 
+		p = (rtp_packet*)e->data;
+		packet_print(session, p);
+		xfree(p); /* xfree() is mandatory to release RTP packet data */
+		break;
+	case RX_SDES:
+		r = (rtcp_sdes_item*)e->data;
+		sdes_print(session, e->ssrc, r->type);
+		break;
+	case RX_BYE:
+		break;
+	case SOURCE_CREATED:
+		printf("New source created, SSRC = 0x%08x\n", e->ssrc);
+		break;
+	case SOURCE_DELETED:
+		printf("Source deleted, SSRC = 0x%08x\n", e->ssrc);
+		break;
+	case RX_SR:
+	case RX_RR:
+	case RX_RR_EMPTY:
+	case RX_RTCP_START:
+	case RX_RTCP_FINISH:
+   		free(e->data);
+		break;
+	case RR_TIMEOUT:
+		printf("RR_TIMEOUT\n");
+   		free(e->data);
+		break;
+	case RX_APP:
+		printf("RX_APP\n");
+   		free(e->data);
+		break;
+	}
+	fflush(stdout);
+}
+
+
+//////////////////////////////////////////////////////////////////
+// make RTP packets from Theora and send it 			//
+//////////////////////////////////////////////////////////////////
+static void
+rtp_SendTheoraFrame( struct rtp* session, uint32_t rtp_ts,
+                   uint8_t *theora_data, uint32_t len, uint8_t type_frame)
+{
+       uint8_t rtp_packet_buf[BUF_SIZE],*ptr;
+
+	uint32_t	lastPacket,dataOffset;
+        uint32_t 	bytesToSend,payloadLength,payload_len;
+	int	m_first;
+
+        ptr=&rtp_packet_buf[2];
+	rtp_packet_buf[0]=0x0;
+	rtp_packet_buf[1]=type_frame;
+	m_first = 1;
+	lastPacket = 0;	
+	bytesToSend   = len ; 
+	dataOffset    = 0;
+        D(printf("data len %u \n",len);)
+        // first buffer for sending has 2 byets and DATA
+	// we fill buffer manualy
+        if(len <= BUF_SIZE-2) {
+		memcpy(ptr, theora_data, len);
+        	 rtp_send_data(session, rtp_ts, RTP_PT_THEORA, lastPacket,
+ 		   0, NULL, rtp_packet_buf , len+2 , NULL, 0, 0);
+		return;
+	}
+	else { 
+	     memcpy(ptr,theora_data,BUF_SIZE-2);
+       	     rtp_send_data(session, rtp_ts, RTP_PT_THEORA, lastPacket,
+	   	0, NULL, rtp_packet_buf , BUF_SIZE , NULL, 0, 0);
+        }
+
+	payloadLength = BUF_SIZE;
+        ptr = theora_data+BUF_SIZE-2;
+	dataOffset = dataOffset + BUF_SIZE -2;	
+
+	do {
+         payload_len  = min(payloadLength,bytesToSend - dataOffset);
+
+	 if(  payload_len < payloadLength) 
+	      lastPacket = 1;
+	 else
+	      lastPacket = 0;
+
+       	 rtp_send_data(session, rtp_ts, RTP_PT_THEORA, lastPacket,
+	   0, NULL, ptr , payload_len , NULL, 0, 0);
+ 
+  	ptr += payload_len;
+	dataOffset += payload_len;
+	 
+	} while (dataOffset < bytesToSend);
+
+}
+
+// SEND  headers to clients. It is Not RFC!!!!!!!!!!!!!!!
+static void 
+rtp_SendTheoraHdrs(struct rtp* session, uint32_t rtp_ts,
+		uint8_t *header_data,uint16_t len)
+{
+       uint8_t *ptr;
+
+	int	lastPacket,dataOffset;
+        int 	bytesToSend,payloadLength,payload_len;
+
+        ptr = header_data;
+
+        header_data[0] = 0x80;// it is NOT RFC !!! First byte in packet identification Headers	
+	bytesToSend   = len;
+	dataOffset    = 0;
+	payloadLength = BUF_SIZE;
+
+	do {
+         payload_len  = min(payloadLength,bytesToSend - dataOffset);
+
+	 if(  payload_len < payloadLength) 
+	      lastPacket = 1;
+	 else
+	      lastPacket = 0;
+
+//	 if(lastPacket) hdr_ptr->F_bit=1;
+
+	 rtp_send_data(session, rtp_ts, RTP_PT_THEORA, lastPacket,
+	   0, NULL, ptr + dataOffset , payload_len , NULL, 0, 0);
+	 
+	  dataOffset += payload_len;
+	 
+	} while (dataOffset < bytesToSend);
+
+}
+
+
+int make_OggTheoraHdrs(const char *headers_filename)
+{
+     FILE      *headers_file;
+     u_int32_t  num_headers;
+     int        i,r;
+     struct stat     f_stat;
+
+    if ((headers_file = fopen(headers_filename, "r"))==NULL)
+       {fprintf(stderr,"error opening file %s for reading - error = %d (%s)\n",headers_filename,errno,strerror(errno)); return -1;}
+    if (fread (&num_headers,   4, 1, headers_file)<1) return -4;
+    if (num_headers!=6) return -5;
+    if (fread (header_lengths, 4, 6, headers_file)<6) return -5;
+    if (fread (&kfgshiftm,     4, 1, headers_file)<1) return -5;
+
+    for (i=0;i<3;i++) packets[i].len=header_lengths[i]>>3; // now - in bytes
+    for (i=3;i<6;i++) packets[i].len=header_lengths[i]; // these are needed to be in bits
+    for (i=0;i<6;i++) {
+      header_lengths[i]=(header_lengths[i]+31)>>5;
+      packets[i].data=malloc(header_lengths[i]<<2);
+      if (((r=fread (packets[i].data, 4, header_lengths[i], headers_file))) < (int)header_lengths[i]) {
+		 fprintf(stderr, "i=%d, fread returned %d, wanted - %d\n",i, r,header_lengths[i]);
+		 return -6;
+	   }	 
+    }
+    fclose(headers_file);
+    stat(headers_filename,&f_stat);
+    hdr_size = f_stat.st_size;
+    //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+    // draft realese - TODO for RFC future
+    b_headers = (uint8_t *)malloc(hdr_size+1);
+    if ((headers_file = fopen(headers_filename, "r"))==NULL)
+       {fprintf(stderr,"error opening file %s for reading - error = %d (%s)\n",headers_filename,errno,strerror(errno)); return -1;}
+    // put data into memory buffer
+    if (fread (b_headers+1,   hdr_size, 1, headers_file)<1) return -7;
+    hdr_size +=1;
+    fclose(headers_file);
+	
+return 0;    
+}
+
+static void
+main_loop(struct rtp* session) 
+{
+	uint64_t        time_frame = 0;
+	uint32_t	rtp_ts,len=0;
+	int		delta, nframe;
+	char		headers_filename[]="/tmp/headers";
+	char       	controlfn[]="/dev/ccam_img";
+
+	int 		devfd, i;
+	int 		acq_data, nframes_total, nframes_inter_full,
+			nframes_inter_masked, time_slow;
+	u_int8_t   	*ccam_dma, *dp = NULL;
+    	u_int32_t  	*ccam_dma_index;
+    	int        	circindex_fd;
+   	int        	circbuf_fd;
+    	int        	circbuf_size;
+    	int       	circindex_size;
+ 
+	int		wp,wp0,frame_start = 0,frame_end,frame_type= 0,a_ready;
+	uint32_t	frame_length;
+	int		next_frame_start, frame_no =0,last_page_flags = 0;
+
+	printf("Sending to ");
+	printf("%s port %d (local SSRC = 0x%08x)\n", 
+	       rtp_get_addr(session),
+	       rtp_get_rx_port(session),
+	       rtp_my_ssrc(session));
+
+      a_ready = 0; 
+      circindex_fd = open("/dev/circindex", O_RDWR);
+      if (circindex_fd<0) { // check control OK
+         fprintf(stderr,"Error opening %s\n", "/dev/circindex");
+         return ;
+      }
+      // find total buffer length
+      circindex_size=lseek(circindex_fd,0,2);
+      ccam_dma_index = (u_int32_t *) mmap(0, circindex_size, PROT_READ, MAP_SHARED, circindex_fd, 0);
+      if(ccam_dma_index ==((u_int32_t  *) -1)) {
+        fprintf(stderr,"Error in mmap %s\r\n","/dev/circindex");
+        close(circindex_fd);
+        return ;
+      }
+
+      circbuf_fd = open("/dev/circbuf", O_RDWR);
+      if (circbuf_fd<0) { // check control OK
+        fprintf(stderr,"Error opening %s\n", "/dev/circbuf");
+        close(circindex_fd);
+        return ;
+      }
+      // find total buffer length
+      circbuf_size=lseek(circbuf_fd,0,2);
+      fprintf(stderr,"circbuf stores %d long values (%d bytes)\n",(circbuf_size>>2),circbuf_size);
+      ccam_dma = (u_int8_t *) mmap(0, circbuf_size, PROT_READ, MAP_SHARED, circbuf_fd, 0);
+      if(ccam_dma ==((u_int8_t  *) -1)) {
+        fprintf(stderr,"Error in mmap %s\r\n","/dev/circbuf");
+        close(circindex_fd);
+        close(circbuf_fd);
+        return ;
+      }
+ 
+    
+	InitTimer();
+	wp=wp0=0;
+	
+   	nframe = HDR_INTERVAL;
+	nframes_total = 0;	// unlimited 
+	nframes_inter_full = 128;
+	nframes_inter_masked = 0;
+	time_slow = (int)(100./strm_data_par.fps);
+        fprintf(stderr,"fps =%f time_slow %d\n",strm_data_par.fps,time_slow);
+        acq_data = ((nframes_total)<<16 ) |
+                  (((nframes_inter_full   > 255)? 255:((nframes_inter_full   < 0)?0:nframes_inter_full  )) << 8) |
+                   ((nframes_inter_masked > 255)? 255:((nframes_inter_masked < 0)?0:nframes_inter_masked));
+
+
+	if(setup_tbl_FPGA( nframes_total, nframes_inter_full,
+ 				nframes_inter_masked, time_slow)<0) return;
+ 
+   	if(make_OggTheoraHdrs(headers_filename)<0) {
+		fprintf(stderr,"Error prepare headers while parsing %s\n",headers_filename);
+		free(b_headers);
+		return;
+	}
+	frame_no = 0;
+
+	while (true) {
+
+	// now - time to start acquisition
+    	if ((devfd = open(controlfn, O_RDONLY)) <0) {
+        	fprintf(stderr,"error opening file %s for reading - error = %d (%s)\n",controlfn,errno,strerror(errno)); 
+		return ;
+	}
+	// start compression
+      	ioctl(devfd, _IO(CMOSCAM_IOCTYPE, IO_CCAM_JPEG_GET_N ), acq_data);
+
+	//    now wait for done (or aborted?)
+    	while (((i=ioctl(devfd, _IO(CMOSCAM_IOCTYPE, IO_CCAM_MONITOR_SEQ ), 0))) > CAMSEQ_JPEG) {
+
+	     if(strm_data->status == STOP_STREAM ) {
+			break;   // receive command STOP from web interface
+	     }
+	// data ready ?    
+	if(wp == 0) {
+        while(frame_no <0)
+ 	 frame_no = ioctl(devfd, _CCCMD( CCAM_RPARS , P_JPEG_WP), 0)-1;
+         usec_sleep(mTimeinterval>>1);
+	 sched_yield();
+	 wp=1;
+	}
+
+dark_loop:
+
+        last_page_flags= (ccam_dma_index[frame_no+1]==0xffffffff)?4:0;
+
+	if (last_page_flags == 4)
+	{
+            usec_sleep(mTimeinterval);
+	    sched_yield();
+	    goto dark_loop;    
+	}
+//	 frame_no = ioctl(devfd, _CCCMD( CCAM_RPARS , P_JPEG_WP), 0)-1;
+
+		// soft correction FPS    
+		if(time_frame == 0) time_frame=GetTimestamp()+1; // when starting - send headers to clients
+			// check number of sended data frames
+			// may be we are ready to send Theora Headers?
+		if(nframe >= HDR_INTERVAL) {
+			rtp_SendTheoraHdrs(session,TimestampToRtp(GetTimestamp()),
+				           b_headers , hdr_size);
+				nframe = 0;
+		}
+   		delta=time_frame-GetTimestamp(); // may be waiting more ?
+  
+   		if( delta  > 0) {
+   	   		while(delta > 0){
+       				if(delta <= 10000) 
+           				usec_sleep(0); // sleeps 1 clock tick (10ms)!
+       				else
+           				usec_sleep(delta-10000);
+       				delta-=GetRelativeTime();
+     	    		}
+      		}
+        frame_length=(ccam_dma_index[frame_no] & 0xfffffff)-frame_start;
+ //       printf("FFFF %u \n",(ccam_dma_index[frame_no] & 0xfffffff)- frame_start);
+        next_frame_start=((ccam_dma_index[frame_no] & 0xfffffff)+63) & (~0x1f);
+        frame_type=(ccam_dma_index[frame_no]>>28) & 3;
+	wp0 = ioctl(devfd, _CCCMD( CCAM_RPARS , P_JPEG_WP), 0)-1;
+	if(wp0 < 0) {
+		printf("frame length %d \tframe_no %d = %d \n",frame_length,frame_no,wp0);
+
+		frame_no=wp0;
+		wp = 0;
+		continue;
+	}
+
+   		rtp_ts =TimestampToRtp(time_frame);
+
+   		time_frame+= mTimeinterval; // time start for next frame INTER/INTRA
+   		/* Send control packets */
+   		rtp_send_ctrl(session, rtp_ts, NULL);
+   		rtp_update(session);
+
+
+        dp=&ccam_dma[frame_start];
+        if((unsigned)frame_length <1000000)
+ 	     rtp_SendTheoraFrame( session, rtp_ts, dp, frame_length, frame_type);
+
+        frame_start=next_frame_start;
+	frame_no++;
+	if(frame_no > wp0)
+		wp = 0;
+
+		nframe++;
+		xmemchk();
+	   }
+     if(strm_data->status == STOP_STREAM ) {
+	// stop sencor
+        system("hello -z 0");
+        printf("RTP Streamer stopped \n");
+	break;   // receive command STOP from web interface
+
+  //ioctl(devfd, _IO(CMOSCAM_IOCTYPE, IO_CCAM_JPEG ), JPEG_CMD_STOP);
+	} // if STOP_STREAM	     
+
+   } // while main	
+
+//=========================== END MAIN LOOP ============================ 
+   
+}
+
+
+int main(int argc, char *argv[]) 
+{
+	struct rtp	*session = NULL;
+ 	int 		devfd,c,flag,use_web;
+
+    flag = 0;
+    use_web = false;
+    strcpy(strm_data_par.address,"239.0.0.1");
+    strm_data_par.port = 20000;
+    strm_data_par.fps  = 25.;
+    strm_data_par.status   = STOP_STREAM;
+//    strm_data_par.regim    = JPEG_ACCESS_DRV; 
+//    strm_data_par.scanning = STOP_SCANNING;
+    strcpy(strm_data_par.name,"Elphel Camera #1");
+    strcpy(strm_data_par.telephone,"1-800-RTP-HOT-PHONE");
+    strcpy(strm_data_par.toolname,"Elphel Theora Streamer");
+    strcpy(strm_data_par.note,"Draft release ofr RTP Theora");
+    strcpy(strm_data_par.location,"This camera located anywhere");
+    strcpy(strm_data_par.email,"camera at elphel.com");
+    strm_data_par.encrypt_key[0]='\0';
+
+   while(true) {
+     c = getopt(argc, argv, "hwa:p:f:k:");
+     if (c == -1)
+	       break;
+     
+     switch (c) {
+      	case 'h':
+	    flag++;	
+            break;
+	case 'w':
+	    use_web = true; 	
+            break;
+      	case 'a':
+	    memset(strm_data_par.address,0,21);
+	    strncpy(strm_data_par.address,optarg,20);
+            break;
+      	case 'k':
+	    memset(strm_data_par.encrypt_key,0,41);
+	    strncpy(strm_data_par.encrypt_key,optarg,40);
+	    strm_data_par.encryption=1;
+            break;
+      	case 'p':
+	    strm_data_par.port = atol(optarg);	
+            break;
+       	case 'f':
+	    strm_data_par.fps = atof(optarg);
+            if(strm_data_par.fps < 0. )
+		strm_data_par.fps=25.;	
+            break;
+
+     	case '?':
+	     flag++;
+             break;
+
+     	default:
+           printf ("?? getopt returned character code 0%o ??\n", c);
+       }
+    }
+   if ((optind < argc)|| flag>0) {
+	  usage();
+	  exit(1);
+   }
+
+   if(use_web) {
+        unlink(mmapFileName);
+	// map shared memory for manage this with CGI 
+	// where shared memory opening whith query too
+	
+        devfd = open(mmapFileName,O_RDWR|O_CREAT); 
+        if(devfd == -1) {
+  	       printf("Error opening %s!\n",mmapFileName);	  
+	       
+        }
+	lseek(devfd,sizeof(strm_data_t),SEEK_SET);
+	write(devfd,"",1);
+
+        strm_data =(strm_data_t *) mmap(0, sizeof(strm_data_t), PROT_READ|PROT_WRITE, MAP_SHARED, devfd, 0);
+        if((int)strm_data == -1) {
+             fprintf(stderr,"Error in mmap %s\r\n",mmapFileName);
+	     close(devfd);
+	     unlink(mmapFileName);
+	     exit(1);
+        }
+    } 
+    else {
+	strm_data = &strm_data_par;  // use data from local buffer   
+	// not used web - start streamer immediate
+	strm_data_par.status = START_STREAM;
+    }   	
+	
+       	// OK - init data
+
+       // General LOOP waiting command START
+	while(true) {
+	     if(strm_data->status == -1)
+		break;
+	     if(strm_data->status == STOP_STREAM ) {
+		  //sleep some time and test status again
+		  usec_sleep(100000);
+		  continue;
+	     }
+	printf("\n RTP Streamer for Theora starting...\n");
+
+	mTimeinterval = (int) TimestampTicks/strm_data->fps; // min interval between frames
+        printf("Time frame %u for FPS %f, dest address %s:%d \n\n", mTimeinterval, strm_data->fps, 
+			strm_data->address,strm_data->port);
+	memcpy((void *)&strm_data_par,(void *)strm_data,sizeof(strm_data_t));
+	//OK - receive command START streaming    
+	// create session and transmit data	
+	// address,port and fps(soft - not hardware) may be changed
+	// from web interfase
+        session = rtp_init_xmitter( strm_data->address,	/* Host/Group IP address */ 
+			   strm_data->port,		/* receive port */
+			   strm_data->port,		/* transmit port */
+			   16,			/* time-to-live */
+			   8000000,		/* B/W estimate */
+			   rtp_event_handler,	/* RTP event callback */
+			   NULL);		/* App. specific data */
+
+	if (session) {
+
+             if(strm_data->encryption) {
+                if (!rtp_set_encryption_key(session,strm_data->encrypt_key))
+			printf("Can't init encryption !\n ");
+             }
+
+	     uint32_t 	my_ssrc = rtp_my_ssrc(session);
+
+		/* Set local participant info */
+		rtp_set_sdes(session, my_ssrc, RTCP_SDES_NAME,strm_data->name, strlen(strm_data->name));
+		rtp_set_sdes(session, my_ssrc, RTCP_SDES_EMAIL,strm_data->email, strlen(strm_data->email));
+		rtp_set_sdes(session, my_ssrc, RTCP_SDES_PHONE,strm_data->telephone, strlen(strm_data->telephone));
+		rtp_set_sdes(session, my_ssrc, RTCP_SDES_LOC,strm_data->location, strlen(strm_data->location));
+		rtp_set_sdes(session, my_ssrc, RTCP_SDES_TOOL,strm_data->toolname, strlen(strm_data->toolname));
+		rtp_set_sdes(session, my_ssrc, RTCP_SDES_NOTE,strm_data->note, strlen(strm_data->note));
+
+		/* Filter out local packets if requested */
+		rtp_set_option(session, RTP_OPT_FILTER_MY_PACKETS, true );
+		rtp_set_option(session, RTP_OPT_WEAK_VALIDATION, false);
+		rtp_set_option(session, RTP_OPT_PROMISC, true);
+
+		// Run main loop - get data from buffer and sent RTP packets
+		// while this process not received command stop
+		main_loop(session);
+
+		/* Say bye-bye */
+		rtp_send_bye(session);
+		rtp_done(session);
+		xmemchk();
+	} 
+	else {
+	   fprintf(stderr,"Could not initialize session for %s port %d\n", strm_data->address, strm_data->port);
+	}
+     } // general while	
+  return 0;
+}

Added: experimental/j/Elphel333/rtp/daemon/rtp/.target-makefrag
===================================================================
--- experimental/j/Elphel333/rtp/daemon/rtp/.target-makefrag	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/daemon/rtp/.target-makefrag	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1 @@
+AXIS_BUILDTYPE=cris-axis-linux-gnu

Added: experimental/j/Elphel333/rtp/daemon/rtp/COPYRIGHT
===================================================================
--- experimental/j/Elphel333/rtp/daemon/rtp/COPYRIGHT	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/daemon/rtp/COPYRIGHT	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,35 @@
+Copyright (C) 1995-2000 University College London
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, is permitted provided that the following conditions 
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. All advertising materials mentioning features or use of this software
+   must display the following acknowledgement:
+     This product includes software developed by the Computer Science
+     Department at University College London
+4. Neither the name of the University nor of the Department may be used
+   to endorse or promote products derived from this software without
+   specific prior written permission.
+THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND ANY
+EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
+
+This product includes software developed by the Computer Systems
+Engineering Group at Lawrence Berkeley Laboratory.
+
+Encryption features of this software use the RSA Data Security, Inc. MD5
+Message-Digest Algorithm.

Added: experimental/j/Elphel333/rtp/daemon/rtp/MODS
===================================================================
--- experimental/j/Elphel333/rtp/daemon/rtp/MODS	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/daemon/rtp/MODS	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,388 @@
+Common Code Library: Modification history
+
+v1.0.0  - Initial version, based on RAT v3.2.7
+	* 14 November 1998
+
+v1.0.1  - Added HMAC authentication code
+	- Added timeout to udp_recv()
+	- Added authentication of Mbus messages
+	- Added RTP library
+	- Added select and fd_set functions to net_udp.[ch]
+	- IPv6 code now runs on the pre-release stack for Solaris 2.7
+	- Mbus code support a configuration file on Unix, and the registry
+	  on Win32, to save/restore settings
+	- Add udp_host_addr() to get a text-version of the address to which
+	  a socket is bound.
+	- Set IPv6 ttl and loopback state correctly on Solaris
+	- Move mbus hearbeat code into this library
+	- Remove key expiry from the mbus code, since it created race
+	  conditions when multiple tools for a single conference were
+	  started either side of the expiry time.
+	- Update mbus addressing scheme - names are now sets of tokens, if the
+	  set of tokens in the destination address is a subset of the address 
+	  of the entity receiving that message then the message is accepted. An
+	  empty set is a valid destination address for a message, and that will
+	  be accepted by all receivers (ie: a wildcard).
+	- Remove channel ID from mbus code.
+	- Fix configure script to work with solaris 2.7 where inet_aton() and 
+	  inet_pton() have prototypes but no implementation.
+	* 31 March 1999 [rat v4.0.0]
+
+v1.0.2  - Assorted fixes to RTP library
+	- Fix bounds overruns in memory.c - will now run with -DDEBUG_MEM
+	  with the bounds checker on.
+	- Add timestamp to mbus packet headers.
+	- Add mbus_qmsgf()
+	- Cleanup mbus transmission path
+	- Add support for DES encryption to the mbus (on by default)
+	- Fix DES code
+	- Mbus keeps a cache of other entities, and only allows sending of
+	  reliable messages to known unicast addresses. 
+	- Mbus error function now takes a "type of error" argument
+	- Added xrealloc()
+	- Fix reordering of mbus messages
+	* 14 May 1999 [rat v4.0.1]
+
+v1.0.3  - Fix inet_aton() in net_udp.c
+	* 15 May 1999 [rat v4.0.2]
+
+v1.0.4  - Fix compilation with Microsoft IPv6 stack
+	- Solaris 2.5.1 doesn't have vsnprintf(), use vsprintf() instead
+	  and don't worry about the possible buffer overflow problems. 
+	  Reported by Holger Wirtz.
+	- Added mbus_addr_valid()
+	- Added timeout to mbus_recv()
+	- Fixes to mbus code from Dirk Kutscher
+	* 2 June 1999 [rat v4.0.3]
+
+v1.0.5  - Not quite sure what happened with this version, but if you have
+	  it it's probably not a good idea to use it! :-)
+
+v1.0.6  - Add ability to send to one port whilst receiving on another, 
+	  requested by Henning Schulzrinne.
+	- Add mbus_cmd_handler() to change the function handling the
+	  reception of mbus commands.
+	- Compilation fixes for Irix 6.5 contributed by Bob Olson.
+	- Add extra sanity checking to mbus_recv()
+	- Add extra sanity checking to mbus_parse_*
+	- Fix source address passed to mbus_recv() callback - was missing
+	  the "(" and ")" around it.
+	- Fix memory leak in mbus_recv()
+	- Fixes for configure script on 64 bit IRIX from Peter Orbaek
+	- Move base64 tests into test_base64.c and integrate with the test suite
+	* Released 5 July 1999 
+
+v1.0.7  - Add udp_exit to close sockets and leave multicast groups if necessary.
+	- Fix mbus_exit close sockets.
+	- Move the code to deal with the mbus configuration into mbus_config.c
+	  which will make it easier to write an mbus packet logger without code 
+	  duplication (such a logger can't easily be part of mbus.c, since it's
+	  needs conflict with correct protocol operation).
+	- Note that v1.3 of the Microsoft Research IPv6 stack requires an explicit
+	  route to be added for multicast traffic before a group can be joined. If
+	  you get errors in the IPV6_ADD_MEMBERSHIP setsockopt, this is probably
+	  the reason. We could specify an interface explicitly, but which one to
+	  pick?
+	- Updates to the IPv6 code for the Detexis Musica IPv6 stack
+	- Updates to the RTP code from Markus Germeier: time-out and delete sources,
+	  fix X but in RTP header, add support for sending BYE packets.
+	- Add inet_pton() and inet_ntop() implementations, for those platforms
+	  which are missing them.
+	- Add gettimeofday() workaround for win32
+	- Add drand48() workaround for win32
+	* Released 20 August 1999
+
+v1.0.8  - Add mbus_sent_all()
+	- Add loop count to mbus_recv(), so it will always return after 10
+	  packets have been received. The prevents a denial of service attack
+	  if packets are sent faster than the timeout period.
+	- Add binary tree.
+	- Add OpenBSD fixes from Angelos D. Keromytis
+	- Add Jerry Isdale's debug_dump() routine.
+	- Add fix to RTP init_seq() to correct bug(?) in RFC1889 which
+	  means we incorrectly report the one packet lost in the first
+	  reporting interval. Fix by Bill Fenner.
+	- Make the RTP create_source() routine return a pointer to the
+	  source. Patch from Bill Fenner.
+	- Changes to the probation code in rtp.c from Bill Fenner.
+	- Fix types in the RTP source struct.
+	- Add a SOURCE_CREATED event to the RTP callback.
+	- Add option to accept RTP packets before a corresponding RTCP
+	  packet has been received.
+	- Add RX_RR_EMPTY event to the RTP code, to indicate that an empty
+	  reception report (ie: no report blocks) has been received.
+	- Add RX_RTCP_START and RX_RTCP_FINISH events to the RTP code.
+	- debug_msg() now displays the pid
+	- The mbus code now maintains the list of active sources more correctly, 
+	  making mbus_addr_valid() useful
+	- rtp_init() now takes separate rx_port and tx_port, instead of a
+	  single port for both sending and receiving.
+	- Add rtp_get_addr(), rtp_get_rx_port(), rtp_get_tx_port() and rtp_get_ttl()
+	- Change return type of rtp_recv to int (was void).  Returns TRUE if
+	  packets were processed, FALSE otherwise.
+	- Timeout RRs from the RTP database, if they're not refreshed for
+	  3 times the RTCP reporting interval
+	- rtp_update() only expires sources once per reporting interval, to
+	  avoid burning too many cycles.
+	- Mbus updates contributed by Markus Germeier
+		- we now can configure the multicast address and port which the
+		  mbus should use in ~/.mbus 
+		- honor the SCOPE setting in ~/.mbus
+		- expire sources we haven't heard from for a while
+		- fixes small memory leak in remove_other_addr
+		- mbus_exit now sends a mbus.quit and cleans up other_* structures
+	- RTP updates contributed by Timur Friedman.
+		- Add support for RTCP APP packets
+		- Add support for a promiscuous mode to the RTP code, when in
+		  promiscuous mode there is no wait for a minimum number of RTP
+		  packets before recognizing a source.
+		- Add the functions rtp_setopt() and rtp_getopt() that can be used
+		  to control various options (right now just promiscuous mode).
+		- Split rtp_recv_data() into two functions.
+	* 5 October 1999
+
+v1.0.9  - Ignore ECONNREFUSED in net_udp.c
+	- Add mbus_rendezvous_waiting() and mbus_rendezvous_go() to enable
+	  easy rendezvous between multiple processes.
+	- Change rtp_setopt() and rtp_getopt() to take boolean options only.
+	- Remove rtp_weak_validation(), use rtp_setopt(RTP_OPT_WEAK_VALIDATION)
+	  instead.
+	- Delete RTP database entries which haven't been heard from for
+	  more than 5 times the RTCP reporting interval.
+	* 2 November 1999 [rat v4.1.1]
+
+v1.0.10 - Mbus updates from Markus Germeier, which fix compatibility with
+	  the Uni Bremen implementation:
+		- mbus.bye() signals an entity when it leaves. (mbus.quit commands
+		  an entity to leave)
+		- Generate and work with 64 bit DES keys. Generate parity bits for key.
+		  Check if key in configuration file sets parity bits correctly.
+		- mbus_heartbeat(m, 1) should send an mbus.hello() every second and
+		  not every two seconds
+		- HMAC-MD5 should read HMAC-MD5-96
+		- Honor the MBUS environment variable for the MBUS configuration file
+		- The TZI Mbus implementations generate spaces in configuration file,
+		  which mislead the UCL Mbus to dump core. Allow Spaces in .mbus
+		- Address must be unique
+		- Delete failed reliable messages if err_handler is present
+	- Fix uninitialized use of session->last_update in RTP code
+	- Fix assertion failures in RTP library when sending RTCP packets
+	- Recognize, but ignore, profile specific extensions to RTCP SR/RR packets
+	- Update RTCP reporting interval calculation
+	- Implement reverse reconsideration of RTCP reporting interval
+	- Fix tv_diff in rtp.c to handle negative results
+	- Remove rtp_get_encryption_key(), the user of the library is assumed to 
+	  remember the passphrase used and doesn't need access to the internal
+	  form of the key.
+	- GNU autoconf modifications from Bill Fenner
+	- Global change of integer types, and removal of compatibility defines:
+		u_int8  -> u_int8_t
+		u_int16 -> u_int16_t
+		u_int32 -> u_int32_t
+	  and the same for the signed varients.
+	- Implement encryption in the RTP code
+	- Ignore connection refused errors in IPv4 UDP send.
+	- Hide definition of struct mbus_config
+	- Add a version number to the mbus config file
+	- Fixes for FreeBSD v3.2 with INRIA IPv6 stack from Fred Templin
+	- Add configure check for sin6_len in struct sockaddr_in6 (seems
+	  that FreeBSD has this, but many systems don't)
+	- Fix batching of multiple mbus messages into one packet.
+	* 13 December 1999 [rat v4.1.2]
+
+v1.1.0  - Changed autoconf generated header to uclconf.h.
+	- Changed library name to uclmmbase to be consistent with other libs.   
+	- Add RTP_OPT_FILTER_MY_PACKETS
+	- Cleanup test routines
+	- Fix various potential buffer overflow problems
+	- Update copyright notices to welcome in the new millennium
+	- Previous versions of udp_send() would sometimes return -1 on error, 
+	  and would sometimes abort(). We now always return -1 and never abort.
+	- Add test routines for code in net_udp.c
+	- Fix SCOPE parameter in mbus configuration on windows
+	- Fix sending of hearbeat messages whilst in mbus.waiting() and mbus.go() loops
+	- Tidy up mbus_qmsg();
+	- Add workaround for buffer overflow bug in _dprintf() which caused
+	  a crash under Windows NT service pack 6. This is not a real fix, we
+	  need to use vsnprintf() in there, but Windows doesn't implement it
+	  and I don't have time before we give the demo... Sigh, only two
+	  days wasted.
+	- Fix buffer overflow in _dprintf() on Windows, using _vsnprintf().
+	- Update IPv6 support for Microsoft Research IPv6 stack, v1.4
+		- Use the versions of inet_ntop() and inet_pton() provided with the 
+		  IPv6 stack, but retain our own implementation when building with 
+		  IPv4 support only.
+		- Use getaddrinfo() rather than getnodebyname() to get our IPv6 address if
+		  running with the Microsoft Research IPv6 stack. 
+		- We now require getaddrinfo() to be present in all IPv6 stacks: those which
+		  do not have this call (eg: the Musica IPv6 stack) MUST provide a workaround
+		  implementation.
+	  versions of MSR IPv6 prior to 1.4 are no longer supported.
+	- Update IPv6 support for Red Hat Linux 6.1
+	- Fix generation of version.h on Win32
+	- Add VC++ project file to build the test suite under Win32
+	- Add extra debug code to the mbus library
+	- Rewrite mbus code: mbus_parser.[ch] exist now, and include routines moved from the
+	  main mbus.[ch] files. Note that the interface to the mbus_parse_*() functions has
+	  now changed and is not backwards compatible.
+	- Remove the mbus_addr() function, add an extra parameter to mbus_init() instead.
+	* 28 January 2000
+
+v1.1.1  - Add extra debugging code
+	* 1 February 2000
+
+v1.1.2  - Add routines for handling NTP format timestamps, in ntp.[ch]
+	- Add udp_addr_valid.
+	- Fix cname setup for Win32.
+	- Add udp_init_if() call, to open a UDP/IP socket bound to a
+	  specific interface
+	- Add rtp_init_if() call, to open an RTP socket bound to a 
+	  specific interface
+	- Add asarray.[ch] string holding associative array.
+	- Fix compilation with -Wwrite-strings and -Wcast-align
+	- Split mbus_addr_match() and mbus_add_identical() into mbus_addr.[ch]
+	* 14 February 2000
+
+v1.1.3  - Fix debug_set_core_dir() when not debugging.
+	* 14 February 2000
+
+v1.1.4  - Add tests for mbus_parser.c/mbus_addr.c and fix bugs found
+	- Fix use of free()'d memory in mbus.c
+	* 24 February 2000
+
+v1.1.5  - Remove SunOS and Solaris defines from the configure script, they
+	  shouldn't be necessary any longer.
+	- Add workaround for missing getaddrinfo() on some platforms.
+	- Remove most of the abort() statements from udp_init(), we now
+	  return NULL in most cases of an error.
+	- Fix header extension handling when padding bit set for RTP packets.
+	- Change RTP event type #defines into rtp_event_type so compiler can
+	  check all cases are covered in decision blocks.
+	- Fix waiting_ack next is set to null when message is put on ack list.
+	- Add check for udp socket allocation success in mbus_init.
+	- Add get_appname to util.[ch].
+	- Bound ttl to max 127 in rtp.c rather than asserting <= 127.
+	- Change rtp_init to return NULL in rtp.c if ports or ttl 
+	  inappropriate.
+	- Clarify that rtp_recv(), rtp_send_data() and rtp_send_ctrl() take an
+	  RTP format timestamp for the current time.
+	* 17 April 2000
+
+v1.2.0	- Add udp_fd() function, to retrieve the underlying file descriptor.
+	- udp_get_host_addr4() will now return NULL on failure, and leave
+	  errno set.
+	- Workaround failure to get host IP address when setting the RTP
+	  CNAME (we use user at 127.0.0.1 as the CNAME in this case). 
+	- Fix rtp_send_data() to correctly handle header extensions. This required
+	  a change to the API: the extn_len parameter now counts the length on the
+	  extension in 32 bit words minus one, and there is an additional extn_type
+	  parameter. If you don't use header extensions in your application, set the
+	  additional parameter to zero. 
+	- Fix reception of packets with RTP header extension.
+	* 16 May 2000
+
+v1.2.1	* 16 June 2000 [rat v4.2.5]
+
+v1.2.2	- Fix bug in mbus transmit code which caused messages to have the same sequence
+	  number as the preceeding ack.
+	- Remove get_appname() function from util.[ch], since it didn't
+	  work in all cases (sometimes argv[0] doesn't contain anything
+	  sensible).
+	- Fix RTP header extension code (patch from Jori <jori at lumumba.luc.ac.be>)
+	  as part of RTP interoperability tests.
+	- FreeBSD 4.1 doesn't support binding to an IPv6 multicast address, must
+	  bind to in6addr_any instead (reported by Shirasaki Yasuhiro).
+	- Fix validation of RTCP packets with padding (reported by Vladimir Brauner).
+	- Fix padding octet count in RTCP packets sent with padding (Vladimir Brauner).
+	- Fix RTCP timer reconsideration (Vladimir Brauner).
+	* 22 August 2000 [rat v4.2.8]
+
+v1.2.3	- Add prototype for rtp_del_csrc() which will be needed by the
+ 	  mixer in rat.
+	* 8 September 2000 [rat v4.2.9]
+
+v1.2.4	- Implement rtp_add_csrc() and rtp_del_csrc().
+	- ifdef'ed out FreeBSD bug check in test_net_udp.c for Win32.  
+	  Prevents compilation of test cases otherwise.  Reported by Micheal
+	  Stovenour <michael.stovenour at lucent.com>.
+	* 1 November 2000 [rat v4.2.10]
+
+v1.2.5	- More informative error message when the lock on the mbus configuration 
+	  file cannot be gained.
+	- rtp_init()/rtp_init_if() now take "const char *" for the address
+	- Fix expiration of our own SSRC from the RTP database, if filtering our
+	  packets.
+	- Mark entries in the RTP source database as active senders if we can an 
+	  SR packet from them.
+	- Cleanup RTP database once per second, rather than once per reporting 
+	  interval. This is needed to ensure that reverse reconsideration works
+	  correctly, and sources are correctly deleted after BYEs are received.
+	- Fix reverse reconsideration of the RTCP interval
+	- Change socket_error to support formatted messages.
+	- Add socket_error messages for gethostbyname failures.
+	- Include lower layer overhead when calculating average RTCP size
+	  (patch from Timur Friedman).
+	- Add support for SDES PRIV (the correct formatting of the PRIV item
+	  into prefix length, prefix and value is left to the caller).
+	- Change xmalloc to fill allocated buffer with dummy value when DEBUG 
+	  is defined.  Change DEBUG_MEM version to use same dummy value rather
+	  than a random value, reduces chances of uninitialized pointers 
+	  trashing data before crashing.
+	- Add callback types to rtp.h - rtp_callback and rtcp_app_callback.
+	- For consistency rtp_{get,set}opt -> rtp_{get,set}_option.
+	- Remove unnecessary components from qfdes enumeration declarations.
+	- New directories (src, tests, docs, examples).
+	- Fixed Win32 .{dsw,dsp} files for new directory structure.
+	- Documented net_udp.c.
+	- Move strfind to util.[ch] from mbus_addr.[ch].
+	- Fix CSRC handling (patch from Ivo Sedlacek <ivo.sedlacek at anfdata.cz>)
+	- Fix uninitialized field in SDES PRIV handling (Robert Olson)
+	- Documented debug.[ch], hmac.[ch], md5.[ch], memory.[ch], rtp.[ch].
+	- Added small rtp example. 
+	- Change configure to only select doc for build if gtkdoc installed.
+	* 5 April 2001 [rat v4.2.14]	
+
+1.2.6	- Fix so that we no longer send an RTCP BYE if we leave the session 
+          before sending any other packets.
+	- Fix initial estimate of average RTCP packet size.
+	- Implement RTCP BYE reconsideration.
+	- Fix RTCP transmission interval.
+	- Fix handling of probationary sources in the RTP code (a source is
+	  no longer treated as probationary if we've received RTCP packet 
+	  from it).
+	* 24 April 2001 [rat v4.2.16]
+
+1.2.7	- Add support for Rijndael encryption to the RTP library, contributed
+          by Robert Olson <olson at mcs.anl.gov>.
+	- Fix IPv6 support on Linux
+	- Add configuration for Windows 2000 IPv6 stack
+	- Connect/disconnect to socket before/after getsockname call to make 
+	  it work
+	* 18 May 2001 [rat v4.2.17]
+
+1.2.8   - Created a new socket for use for getsockname - there were too
+          many bugs with disconnecting an IPv6 connected socket.
+    - Fixed include ordering for Win2k.
+    * 25 May 2001 [rat v4.2.18] [nte v2.2]
+
+
+Still to do...
+	- IPv6 code sometimes doesn't get the correct interface address,
+	  since it does a gethostbyname() and looks that up, yet that can
+	  return the IPv4 hostname only on some machines.
+	- Doesn't do DNS AAAA lookups when given a name rather than an IP address.
+	- Mbus code should check timestamp in received headers, and discard
+	  messages if it decreases, as a hinderance to replay attacks.
+	- Mbus code should be more paranoid about handling garbage inputs, we
+	  can likely get all sorts of buffer overflows by feeding random data
+	  into it.
+	- rtp_recv should split into rtp_select and rtp_recv. Jitter issues
+	  otherwise, as pointed out by Orion.
+	- Allow a callback for background processing during mbus_rendezvous_*()
+	- mbus_exit() queues an mbus.bye() message, but that never gets sent.
+	- Handling of SSRC collisions is broken.
+	- When weak RTP validation is enabled, spurious sources can be
+	  added to the database (from the CSRC area of a packet?). Reported
+	  by Xiaotao Wu <xiaotaow at cs.columbia.edu>
+	- RTP estimate of lower layer overhead is IPv4 specific.
+

Added: experimental/j/Elphel333/rtp/daemon/rtp/Makefile.am
===================================================================
--- experimental/j/Elphel333/rtp/daemon/rtp/Makefile.am	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/daemon/rtp/Makefile.am	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,101 @@
+SUBDIRS = win32
+
+noinst_LTLIBRARIES = libuclmmbase.la
+
+
+libuclmmbase_la_SOURCES= \
+	asarray.c \
+	base64.c \
+	btree.c \
+	crypt_random.c \
+	debug.c \
+	drand48.c \
+	hmac.c \
+	inet_ntop.c \
+	inet_pton.c \
+	mbus.c \
+	mbus_addr.c \
+	mbus_config.c \
+	mbus_parser.c \
+	md5.c \
+	memory.c \
+	net_udp.c \
+	ntp.c \
+	qfDES.c \
+	rijndael-alg-fst.c \
+	rijndael-api-fst.c \
+	rtp.c \
+	util.c \
+	version.h 
+
+EXTRA_DIST = \
+	acconfig.h \
+	addrinfo.h \
+	addrsize.h \
+	asarray.h \
+	base64.h \
+	bills_srtp.h \
+	bittypes.h \
+	boxes-fst.dat \
+	btree.h \
+	cdecl_ext.h \
+	common60.dsp \
+	config_unix.h \
+	config_win32.h \
+	COPYRIGHT \
+	crypt_random.h \
+	debug.h \
+	drand48.h \
+	getaddrinfo.c \
+	gettimeofday.c \
+	gettimeofday.h \
+	hmac.h \
+	inet_ntop.h \
+	inet_pton.h \
+	install-sh \
+	mbus_addr.h \
+	mbus_config.h \
+	mbus.h \
+	mbus_parser.h \
+	md5.h \
+	memory.h \
+	net_udp.h \
+	ntp.h \
+	qfDES.h \
+	rijndael-alg-fst.h \
+	rijndael-api-fst.h \
+	rtp.h \
+	sockstorage.h \
+	util.h \
+	vsnprintf.c \
+	vsnprintf.h \
+	MODS \
+	README \
+	README.qfdes \
+	VERSION \
+	test_rtp_encrypt.txt \
+	test-libcommon
+
+check_PROGRAMS = test
+test_SOURCES = \
+	test.c \
+	test_base64.c \
+	test_base64.h \
+	test_des.c \
+	test_des.h \
+	test_mbus_addr.c \
+	test_mbus_addr.h \
+	test_mbus_parser.c \
+	test_mbus_parser.h \
+	test_md5.c \
+	test_md5.h \
+	test_memory.c \
+	test_memory.h \
+	test_net_udp.c \
+	test_net_udp.h 
+
+test_LDADD = libuclmmbase.la
+version.h: VERSION
+	sed -e 's/.*/#define CCL_VERSION "v&"/' $? > version.h
+
+AM_CFLAGS = -DDEBUG

Added: experimental/j/Elphel333/rtp/daemon/rtp/Makefile.in
===================================================================
--- experimental/j/Elphel333/rtp/daemon/rtp/Makefile.in	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/daemon/rtp/Makefile.in	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,786 @@
+# Makefile.in generated by automake 1.7.2 from Makefile.am.
+# @configure_input@
+
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# 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.
+
+AXIS_USABLE_LIBS = GLIBC UCLIBC
+include $(AXIS_TOP_DIR)/tools/build/Rules.axis
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = .
+
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+host_triplet = @host@
+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@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GTKDOC = @GTKDOC@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+OPTDOC = @OPTDOC@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = cris-ranlib 
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+##STRIP = @STRIP@
+VERSION = @VERSION@
+##ac_ct_CC = @ac_ct_CC@
+##ac_ct_RANLIB = @ac_ct_RANLIB@
+##ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__quote = @am__quote@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = win32
+
+noinst_LTLIBRARIES = libuclmmbase.la
+
+libuclmmbase_la_SOURCES = \
+	asarray.c \
+	base64.c \
+	btree.c \
+	crypt_random.c \
+	debug.c \
+	drand48.c \
+	hmac.c \
+	inet_ntop.c \
+	inet_pton.c \
+	mbus.c \
+	mbus_addr.c \
+	mbus_config.c \
+	mbus_parser.c \
+	md5.c \
+	memory.c \
+	net_udp.c \
+	ntp.c \
+	qfDES.c \
+	rijndael-alg-fst.c \
+	rijndael-api-fst.c \
+	rtp.c \
+	util.c \
+	version.h 
+
+
+EXTRA_DIST = \
+	acconfig.h \
+	addrinfo.h \
+	addrsize.h \
+	asarray.h \
+	base64.h \
+	bills_srtp.h \
+	bittypes.h \
+	boxes-fst.dat \
+	btree.h \
+	cdecl_ext.h \
+	common60.dsp \
+	config_unix.h \
+	config_win32.h \
+	COPYRIGHT \
+	crypt_random.h \
+	debug.h \
+	drand48.h \
+	getaddrinfo.c \
+	gettimeofday.c \
+	gettimeofday.h \
+	hmac.h \
+	inet_ntop.h \
+	inet_pton.h \
+	install-sh \
+	mbus_addr.h \
+	mbus_config.h \
+	mbus.h \
+	mbus_parser.h \
+	md5.h \
+	memory.h \
+	net_udp.h \
+	ntp.h \
+	qfDES.h \
+	rijndael-alg-fst.h \
+	rijndael-api-fst.h \
+	rtp.h \
+	sockstorage.h \
+	util.h \
+	vsnprintf.c \
+	vsnprintf.h \
+	MODS \
+	README \
+	README.qfdes \
+	VERSION \
+	test_rtp_encrypt.txt \
+	test-libcommon
+
+
+check_PROGRAMS = test
+test_SOURCES = \
+	test.c \
+	test_base64.c \
+	test_base64.h \
+	test_des.c \
+	test_des.h \
+	test_mbus_addr.c \
+	test_mbus_addr.h \
+	test_mbus_parser.c \
+	test_mbus_parser.h \
+	test_md5.c \
+	test_md5.h \
+	test_memory.c \
+	test_memory.h \
+	test_net_udp.c \
+	test_net_udp.h 
+
+
+test_LDADD = libuclmmbase.la
+
+AM_CFLAGS = -DDEBUG
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = uclconf.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+
+libuclmmbase_la_LDFLAGS =
+libuclmmbase_la_LIBADD =
+am_libuclmmbase_la_OBJECTS = asarray.lo base64.lo btree.lo \
+	crypt_random.lo debug.lo drand48.lo hmac.lo inet_ntop.lo \
+	inet_pton.lo mbus.lo mbus_addr.lo mbus_config.lo mbus_parser.lo \
+	md5.lo memory.lo net_udp.lo ntp.lo qfDES.lo rijndael-alg-fst.lo \
+	rijndael-api-fst.lo rtp.lo util.lo
+libuclmmbase_la_OBJECTS = $(am_libuclmmbase_la_OBJECTS)
+check_PROGRAMS = test$(EXEEXT)
+am_test_OBJECTS = test.$(OBJEXT) test_base64.$(OBJEXT) \
+	test_des.$(OBJEXT) test_mbus_addr.$(OBJEXT) \
+	test_mbus_parser.$(OBJEXT) test_md5.$(OBJEXT) \
+	test_memory.$(OBJEXT) test_net_udp.$(OBJEXT)
+test_OBJECTS = $(am_test_OBJECTS)
+test_DEPENDENCIES = libuclmmbase.la
+test_LDFLAGS =
+
+DEFAULT_INCLUDES =  -I. -I$(srcdir) -I.
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+ at AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/asarray.Plo ./$(DEPDIR)/base64.Plo \
+ at AMDEP_TRUE@	./$(DEPDIR)/btree.Plo ./$(DEPDIR)/crypt_random.Plo \
+ at AMDEP_TRUE@	./$(DEPDIR)/debug.Plo ./$(DEPDIR)/drand48.Plo \
+ at AMDEP_TRUE@	./$(DEPDIR)/hmac.Plo ./$(DEPDIR)/inet_ntop.Plo \
+ at AMDEP_TRUE@	./$(DEPDIR)/inet_pton.Plo ./$(DEPDIR)/mbus.Plo \
+ at AMDEP_TRUE@	./$(DEPDIR)/mbus_addr.Plo \
+ at AMDEP_TRUE@	./$(DEPDIR)/mbus_config.Plo \
+ at AMDEP_TRUE@	./$(DEPDIR)/mbus_parser.Plo ./$(DEPDIR)/md5.Plo \
+ at AMDEP_TRUE@	./$(DEPDIR)/memory.Plo ./$(DEPDIR)/net_udp.Plo \
+ at AMDEP_TRUE@	./$(DEPDIR)/ntp.Plo ./$(DEPDIR)/qfDES.Plo \
+ at AMDEP_TRUE@	./$(DEPDIR)/rijndael-alg-fst.Plo \
+ at AMDEP_TRUE@	./$(DEPDIR)/rijndael-api-fst.Plo \
+ at AMDEP_TRUE@	./$(DEPDIR)/rtp.Plo ./$(DEPDIR)/test.Po \
+ at AMDEP_TRUE@	./$(DEPDIR)/test_base64.Po ./$(DEPDIR)/test_des.Po \
+ at AMDEP_TRUE@	./$(DEPDIR)/test_mbus_addr.Po \
+ at AMDEP_TRUE@	./$(DEPDIR)/test_mbus_parser.Po \
+ at AMDEP_TRUE@	./$(DEPDIR)/test_md5.Po ./$(DEPDIR)/test_memory.Po \
+ at AMDEP_TRUE@	./$(DEPDIR)/test_net_udp.Po ./$(DEPDIR)/util.Plo
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
+	$(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+DIST_SOURCES = $(libuclmmbase_la_SOURCES) $(test_SOURCES)
+
+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 = README Makefile.am Makefile.in acconfig.h aclocal.m4 \
+	config.guess config.h.in config.sub configure configure.in \
+	depcomp install-sh ltmain.sh missing mkinstalldirs
+DIST_SUBDIRS = $(SUBDIRS)
+SOURCES = $(libuclmmbase_la_SOURCES) $(test_SOURCES)
+
+all: uclconf.h
+	$(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno
+$(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.in $(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.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
+	cd $(srcdir) && $(AUTOCONF)
+
+$(ACLOCAL_M4):  configure.in 
+	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+
+uclconf.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 uclconf.h
+
+$(srcdir)/config.h.in:  $(top_srcdir)/configure.in $(ACLOCAL_M4) $(top_srcdir)/acconfig.h
+	cd $(top_srcdir) && $(AUTOHEADER)
+	touch $(srcdir)/config.h.in
+
+distclean-hdr:
+	-rm -f uclconf.h stamp-h1
+
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" = "$$p" && dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libuclmmbase.la: $(libuclmmbase_la_OBJECTS) $(libuclmmbase_la_DEPENDENCIES) 
+	$(LINK)  $(libuclmmbase_la_LDFLAGS) $(libuclmmbase_la_OBJECTS) $(libuclmmbase_la_LIBADD) $(LIBS)
+	cd .libs && ln -s libuclmmbase.al libuclmmbase.a
+
+clean-checkPROGRAMS:
+	@list='$(check_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+test$(EXEEXT): $(test_OBJECTS) $(test_DEPENDENCIES) 
+	@rm -f test$(EXEEXT)
+	$(LINK) $(test_LDFLAGS) $(test_OBJECTS) $(test_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT) core *.core
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/asarray.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/base64.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btree.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/crypt_random.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/debug.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/drand48.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hmac.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/inet_ntop.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/inet_pton.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbus.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbus_addr.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbus_config.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mbus_parser.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/md5.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/memory.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/net_udp.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ntp.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/qfDES.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rijndael-alg-fst.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rijndael-api-fst.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rtp.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_base64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_des.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_mbus_addr.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_mbus_parser.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_md5.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_memory.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_net_udp.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/util.Plo at am__quote@
+
+distclean-depend:
+	-rm -rf ./$(DEPDIR)
+
+.c.o:
+ at am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
+ at am__fastdepCC_TRUE@	  -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
+ at am__fastdepCC_TRUE@	then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
+ at am__fastdepCC_TRUE@	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
+ at am__fastdepCC_TRUE@	fi
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
+
+.c.obj:
+ at am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
+ at am__fastdepCC_TRUE@	  -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
+ at am__fastdepCC_TRUE@	then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
+ at am__fastdepCC_TRUE@	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
+ at am__fastdepCC_TRUE@	fi
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
+
+.c.lo:
+ at am__fastdepCC_TRUE@	if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
+ at am__fastdepCC_TRUE@	  -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
+ at am__fastdepCC_TRUE@	then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \
+ at am__fastdepCC_TRUE@	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
+ at am__fastdepCC_TRUE@	fi
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# 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) config.h.in $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       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) 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 = $(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)
+	@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='$(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
+	-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` \
+	  && 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
+	$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
+check: check-recursive
+all-am: Makefile $(LTLIBRARIES) uclconf.h
+installdirs: installdirs-recursive
+installdirs-am:
+
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-rm -f Makefile $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
+	clean-noinstLTLIBRARIES mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+distclean-am: clean-am distclean-compile distclean-depend \
+	distclean-generic distclean-hdr distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+	-rm -rf autom4te.cache
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \
+	clean-checkPROGRAMS clean-generic clean-libtool \
+	clean-noinstLTLIBRARIES clean-recursive ctags ctags-recursive \
+	dist dist-all dist-gzip distcheck distclean distclean-compile \
+	distclean-depend distclean-generic distclean-hdr \
+	distclean-libtool 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-recursive \
+	install-exec install-exec-am install-exec-recursive \
+	install-info install-info-am install-info-recursive install-man \
+	install-recursive install-strip installcheck installcheck-am \
+	installdirs installdirs-am installdirs-recursive \
+	maintainer-clean maintainer-clean-generic \
+	maintainer-clean-recursive mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool 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-recursive
+
+version.h: VERSION
+	sed -e 's/.*/#define CCL_VERSION "v&"/' $? > version.h
+# 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:

Added: experimental/j/Elphel333/rtp/daemon/rtp/README
===================================================================
--- experimental/j/Elphel333/rtp/daemon/rtp/README	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/daemon/rtp/README	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,12 @@
+UCL Common Code Library
+
+Routines common to a number of multimedia tools.  The library
+originates from work on the RAT project: these are portions that are
+not directly related to an audio tool and potentially useful
+elsewhere.  
+
+This library is required to build RAT v3.2.7 or later, and may be
+needed for other UCL tools.
+
+--
+Comments and contributions welcome, please email to mm-tools at cs.ucl.ac.uk.

Added: experimental/j/Elphel333/rtp/daemon/rtp/README.qfdes
===================================================================
--- experimental/j/Elphel333/rtp/daemon/rtp/README.qfdes	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/daemon/rtp/README.qfdes	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,122 @@
+The qfDES code is derived from Saleem Bhatti's code, but has been significantly
+revised, debugged and updated. The following is the original README, followed
+by some other information which may be useful, taken from Eric Young's libdes.
+
+===============================================================================
+This is yet another implementation of DES in software, for those of us that
+don't have access to DES hardware. The library is fairly (but not quite)
+complete, as are the two progs, qf-des and qf-key. However, debugging and
+testing is still proceeding ...
+
+Quickie Roadmap
+---------------
+
+qf-des: Do DES on files (qf-des.c)
+qf-key: Generate keys and IVs (qf-key.c)
+
+libqfDES.a: library of DES stuff
+
+qfDES.h: Interface file for libqfDES.a
+qfDES.c: The DES function
+
+qfDES-print.c: For generating some of the DES macros and S-Box/P transforms
+
+qfDES-key.c: Key and IV generation
+
+qfDES-memory.c: Fiddling around with memory
+
+Disclaimer
+----------
+This version of the qfDES is for me only, so if you have it and are not me,
+then I take no responsibility for what happens when you use it!
+
+TTFN,
+--/Saleem
+
+===============================================================================
+
+Modes of DES
+Quite a bit of the following information has been taken from
+	AS 2805.5.2
+	Australian Standard
+	Electronic funds transfer - Requirements for interfaces,
+	Part 5.2: Modes of operation for an n-bit block cipher algorithm
+	Appendix A
+
+There are several different modes in which DES can be used, they are
+as follows.
+
+Electronic Codebook Mode (ECB) (des_ecb_encrypt())
+- 64 bits are enciphered at a time.
+- The order of the blocks can be rearranged without detection.
+- The same plaintext block always produces the same ciphertext block
+  (for the same key) making it vulnerable to a 'dictionary attack'.
+- An error will only affect one ciphertext block.
+
+Cipher Block Chaining Mode (CBC) (des_cbc_encrypt())
+- a multiple of 64 bits are enciphered at a time.
+- The CBC mode produces the same ciphertext whenever the same
+  plaintext is encrypted using the same key and starting variable.
+- The chaining operation makes the ciphertext blocks dependent on the
+  current and all preceding plaintext blocks and therefore blocks can not
+  be rearranged.
+- The use of different starting variables prevents the same plaintext
+  enciphering to the same ciphertext.
+- An error will affect the current and the following ciphertext blocks.
+
+Cipher Feedback Mode (CFB) (des_cfb_encrypt())
+- a number of bits (j) <= 64 are enciphered at a time.
+- The CFB mode produces the same ciphertext whenever the same
+  plaintext is encrypted using the same key and starting variable.
+- The chaining operation makes the ciphertext variables dependent on the
+  current and all preceding variables and therefore j-bit variables are
+  chained together and con not be rearranged.
+- The use of different starting variables prevents the same plaintext
+  enciphering to the same ciphertext.
+- The strength of the CFB mode depends on the size of k (maximal if
+  j == k).  In my implementation this is always the case.
+- Selection of a small value for j will require more cycles through
+  the encipherment algorithm per unit of plaintext and thus cause
+  greater processing overheads.
+- Only multiples of j bits can be enciphered.
+- An error will affect the current and the following ciphertext variables.
+
+Output Feedback Mode (OFB) (des_ofb_encrypt())
+- a number of bits (j) <= 64 are enciphered at a time.
+- The OFB mode produces the same ciphertext whenever the same
+  plaintext enciphered using the same key and starting variable.  More
+  over, in the OFB mode the same key stream is produced when the same
+  key and start variable are used.  Consequently, for security reasons
+  a specific start variable should be used only once for a given key.
+- The absence of chaining makes the OFB more vulnerable to specific attacks.
+- The use of different start variables values prevents the same
+  plaintext enciphering to the same ciphertext, by producing different
+  key streams.
+- Selection of a small value for j will require more cycles through
+  the encipherment algorithm per unit of plaintext and thus cause
+  greater processing overheads.
+- Only multiples of j bits can be enciphered.
+- OFB mode of operation does not extend ciphertext errors in the
+  resultant plaintext output.  Every bit error in the ciphertext causes
+  only one bit to be in error in the deciphered plaintext.
+- OFB mode is not self-synchronising.  If the two operation of
+  encipherment and decipherment get out of synchronism, the system needs
+  to be re-initialised.
+- Each re-initialisation should use a value of the start variable
+different from the start variable values used before with the same
+key.  The reason for this is that an identical bit stream would be
+produced each time from the same parameters.  This would be
+susceptible to a ' known plaintext' attack.
+
+Triple ECB Mode (des_3ecb_encrypt())
+- Encrypt with key1, decrypt with key2 and encrypt with key1 again.
+- As for ECB encryption but increases the effective key length to 112 bits.
+- If both keys are the same it is equivalent to encrypting once with
+  just one key.
+
+Triple CBC Mode (des_3cbc_encrypt())
+- Encrypt with key1, decrypt with key2 and encrypt with key1 again.
+- As for CBC encryption but increases the effective key length to 112 bits.
+- If both keys are the same it is equivalent to encrypting once with
+  just one key.
+===============================================================================

Added: experimental/j/Elphel333/rtp/daemon/rtp/VERSION
===================================================================
--- experimental/j/Elphel333/rtp/daemon/rtp/VERSION	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/daemon/rtp/VERSION	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1 @@
+1.2.8

Added: experimental/j/Elphel333/rtp/daemon/rtp/acconfig.h
===================================================================
--- experimental/j/Elphel333/rtp/daemon/rtp/acconfig.h	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/daemon/rtp/acconfig.h	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,51 @@
+/*
+ * Define this if you have a /dev/urandom which can supply good random numbers.
+ */
+#undef HAVE_DEV_URANDOM
+
+/*
+ * Define this if you want IPv6 support.
+ */
+#undef HAVE_IPv6
+
+/*
+ * V6 structures that host may or may not be present.
+ */
+#undef HAVE_ST_ADDRINFO
+#undef HAVE_GETIPNODEBYNAME
+#undef HAVE_SIN6_LEN
+
+/*
+ * Define these if your C library is missing some functions...
+ */
+#undef NEED_VSNPRINTF
+#undef NEED_INET_PTON
+#undef NEED_INET_NTOP
+
+/*
+ * If you don't have these types in <inttypes.h>, #define these to be
+ * the types you do have.
+ */
+#undef int8_t
+#undef int16_t
+#undef int32_t
+#undef int64_t
+#undef uint8_t
+#undef uint16_t
+#undef uint32_t
+
+/*
+ * Debugging:
+ * DEBUG: general debugging
+ * DEBUG_MEM: debug memory allocation
+ */
+#undef DEBUG
+#undef DEBUG_MEM
+
+ at BOTTOM@
+
+#ifndef WORDS_BIGENDIAN
+#define WORDS_SMALLENDIAN
+#endif
+
+

Added: experimental/j/Elphel333/rtp/daemon/rtp/aclocal.m4
===================================================================
--- experimental/j/Elphel333/rtp/daemon/rtp/aclocal.m4	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/daemon/rtp/aclocal.m4	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,4447 @@
+# generated automatically by aclocal 1.7.2 -*- 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.
+
+# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
+
+# 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.
+
+AC_PREREQ([2.52])
+
+# serial 6
+
+# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
+AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
+
+# 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 1996, 1997, 1998, 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 8
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery.  Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+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
+
+_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],
+[_am_stamp_count=`expr ${_am_stamp_count-0} + 1`
+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.2])])
+
+# 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])])
+
+# serial 4						-*- Autoconf -*-
+
+# Copyright 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.
+
+
+# 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
+
+  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
+    # 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.
+    echo '#include "conftest.h"' > conftest.c
+    echo 'int i;' > conftest.h
+    echo "${am__include} ${am__quote}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=conftest.c object=conftest.o \
+       depfile=conftest.Po tmpdepfile=conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o conftest.o conftest.c >/dev/null 2>&1 &&
+       grep conftest.h conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      am_cv_$1_dependencies_compiler_type=$depmode
+      break
+    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],
+[rm -f .deps 2>/dev/null
+mkdir .deps 2>/dev/null
+if test -d .deps; then
+  DEPDIR=.deps
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  DEPDIR=_deps
+fi
+rmdir .deps 2>/dev/null
+AC_SUBST([DEPDIR])
+])
+
+
+# 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 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'
+doit:
+	@echo done
+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])])
+
+# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
+
+# serial 46 AC_PROG_LIBTOOL
+
+AC_DEFUN([AC_PROG_LIBTOOL],
+[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+# Prevent multiple expansion
+define([AC_PROG_LIBTOOL], [])
+])
+
+AC_DEFUN([AC_LIBTOOL_SETUP],
+[AC_PREREQ(2.13)dnl
+AC_REQUIRE([AC_ENABLE_SHARED])dnl
+AC_REQUIRE([AC_ENABLE_STATIC])dnl
+AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_LD])dnl
+AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
+AC_REQUIRE([AC_PROG_NM])dnl
+AC_REQUIRE([LT_AC_PROG_SED])dnl
+
+AC_REQUIRE([AC_PROG_LN_S])dnl
+AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
+AC_REQUIRE([AC_OBJEXT])dnl
+AC_REQUIRE([AC_EXEEXT])dnl
+dnl
+
+_LT_AC_PROG_ECHO_BACKSLASH
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    AC_PATH_MAGIC
+  fi
+  ;;
+esac
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_CHECK_TOOL(STRIP, strip, :)
+
+ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+enable_win32_dll=yes, enable_win32_dll=no)
+
+AC_ARG_ENABLE(libtool-lock,
+  [  --disable-libtool-lock  avoid locking (might break parallel builds)])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.$ac_objext` in
+    *32-bit*)
+      LD="${LD-ld} -32"
+      ;;
+    *N32*)
+      LD="${LD-ld} -n32"
+      ;;
+    *64-bit*)
+      LD="${LD-ld} -64"
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-linux*)
+  # Test if the compiler is 64bit
+  echo 'int i;' > conftest.$ac_ext
+  lt_cv_cc_64bit_output=no
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.$ac_objext` in
+    *"ELF 64"*)
+      lt_cv_cc_64bit_output=yes
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+  
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+    [AC_LANG_SAVE
+     AC_LANG_C
+     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+     AC_LANG_RESTORE])
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+
+ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
+  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+  AC_CHECK_TOOL(AS, as, false)
+  AC_CHECK_TOOL(OBJDUMP, objdump, false)
+
+  # recent cygwin and mingw systems supply a stub DllMain which the user
+  # can override, but on older systems we have to supply one
+  AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
+    [AC_TRY_LINK([],
+      [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
+      DllMain (0, 0, 0);],
+      [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
+
+  case $host/$CC in
+  *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
+    # old mingw systems require "-dll" to link a DLL, while more recent ones
+    # require "-mdll"
+    SAVE_CFLAGS="$CFLAGS"
+    CFLAGS="$CFLAGS -mdll"
+    AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
+      [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
+    CFLAGS="$SAVE_CFLAGS" ;;
+  *-*-cygwin* | *-*-pw32*)
+    # cygwin systems need to pass --dll to the linker, and not link
+    # crt.o which will require a WinMain at 16 definition.
+    lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
+  esac
+  ;;
+  ])
+esac
+
+_LT_AC_LTCONFIG_HACK
+
+])
+
+# AC_LIBTOOL_HEADER_ASSERT
+# ------------------------
+AC_DEFUN([AC_LIBTOOL_HEADER_ASSERT],
+[AC_CACHE_CHECK([whether $CC supports assert without backlinking],
+    [lt_cv_func_assert_works],
+    [case $host in
+    *-*-solaris*)
+      if test "$GCC" = yes && test "$with_gnu_ld" != yes; then
+        case `$CC --version 2>/dev/null` in
+        [[12]].*) lt_cv_func_assert_works=no ;;
+        *)        lt_cv_func_assert_works=yes ;;
+        esac
+      fi
+      ;;
+    esac])
+
+if test "x$lt_cv_func_assert_works" = xyes; then
+  AC_CHECK_HEADERS(assert.h)
+fi
+])# AC_LIBTOOL_HEADER_ASSERT
+
+# _LT_AC_CHECK_DLFCN
+# --------------------
+AC_DEFUN([_LT_AC_CHECK_DLFCN],
+[AC_CHECK_HEADERS(dlfcn.h)
+])# _LT_AC_CHECK_DLFCN
+
+# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+# ---------------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
+[AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([AC_PROG_NM])
+AC_REQUIRE([AC_OBJEXT])
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Transform the above into a raw symbol and a C symbol.
+symxfrm='\1 \2\3 \3'
+
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[[BCDT]]'
+  ;;
+cygwin* | mingw* | pw32*)
+  symcode='[[ABCDGISTW]]'
+  ;;
+hpux*) # Its linker distinguishes data from code symbols
+  lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+  lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  ;;
+irix* | nonstopux*)
+  symcode='[[BCDEGRST]]'
+  ;;
+osf*)
+  symcode='[[BCDEGQRST]]'
+  ;;
+solaris* | sysv5*)
+  symcode='[[BDT]]'
+  ;;
+sysv4)
+  symcode='[[DFNSTU]]'
+  ;;
+esac
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $host_os in
+mingw*)
+  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
+  symcode='[[ABCDGISTW]]'
+fi
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Write the raw and C identifiers.
+lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+  rm -f conftest*
+  cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+EOF
+
+  if AC_TRY_EVAL(ac_compile); then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+	mv -f "$nlist"T "$nlist"
+      else
+	rm -f "$nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if egrep ' nm_test_var$' "$nlist" >/dev/null; then
+	if egrep ' nm_test_func$' "$nlist" >/dev/null; then
+	  cat <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+	  # Now generate the symbol file.
+	  eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
+
+	  cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr void *
+#else
+# define lt_ptr char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+  const char *name;
+  lt_ptr address;
+}
+lt_preloaded_symbols[[]] =
+{
+EOF
+	  sed "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
+	  cat <<\EOF >> conftest.$ac_ext
+  {0, (lt_ptr) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+	  # Now try linking the two files.
+	  mv conftest.$ac_objext conftstm.$ac_objext
+	  save_LIBS="$LIBS"
+	  save_CFLAGS="$CFLAGS"
+	  LIBS="conftstm.$ac_objext"
+	  CFLAGS="$CFLAGS$no_builtin_flag"
+	  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
+	    pipe_works=yes
+	  fi
+	  LIBS="$save_LIBS"
+	  CFLAGS="$save_CFLAGS"
+	else
+	  echo "cannot find nm_test_func in $nlist" >&AC_FD_CC
+	fi
+      else
+	echo "cannot find nm_test_var in $nlist" >&AC_FD_CC
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC
+    fi
+  else
+    echo "$progname: failed program was:" >&AC_FD_CC
+    cat conftest.$ac_ext >&5
+  fi
+  rm -f conftest* conftst*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$pipe_works" = yes; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
+  fi
+done
+])
+global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  global_symbol_to_cdecl=
+  global_symbol_to_c_name_address=
+else
+  global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
+  global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
+fi
+if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
+then
+  AC_MSG_RESULT(failed)
+else
+  AC_MSG_RESULT(ok)
+fi
+]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+
+# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
+# ---------------------------------
+AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR],
+[# Find the correct PATH separator.  Usually this is `:', but
+# DJGPP uses `;' like DOS.
+if test "X${PATH_SEPARATOR+set}" != Xset; then
+  UNAME=${UNAME-`uname 2>/dev/null`}
+  case X$UNAME in
+    *-DOS) lt_cv_sys_path_separator=';' ;;
+    *)     lt_cv_sys_path_separator=':' ;;
+  esac
+  PATH_SEPARATOR=$lt_cv_sys_path_separator
+fi
+])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
+
+# _LT_AC_PROG_ECHO_BACKSLASH
+# --------------------------
+# Add some code to the start of the generated configure script which
+# will find an echo command which doesn't interpret backslashes.
+AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
+[ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
+			      [AC_DIVERT_PUSH(NOTICE)])
+_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
+
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+  # Remove one level of quotation (which was required for Make).
+  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
+  ;;
+esac
+
+echo=${ECHO-echo}
+if test "X[$]1" = X--no-reexec; then
+  # Discard the --no-reexec flag, and continue.
+  shift
+elif test "X[$]1" = X--fallback-echo; then
+  # Avoid inline document here, it may be left over
+  :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
+  # Yippee, $echo works!
+  :
+else
+  # Restart under the correct shell.
+  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
+fi
+
+if test "X[$]1" = X--fallback-echo; then
+  # used as fallback echo
+  shift
+  cat <<EOF
+$*
+EOF
+  exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+if test -z "$ECHO"; then
+if test "X${echo_test_string+set}" != Xset; then
+# find a string as large as possible, as long as the shell can cope with it
+  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
+    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
+       echo_test_string="`eval $cmd`" &&
+       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
+    then
+      break
+    fi
+  done
+fi
+
+if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+   test "X$echo_testing_string" = "X$echo_test_string"; then
+  :
+else
+  # The Solaris, AIX, and Digital Unix default echo programs unquote
+  # backslashes.  This makes it impossible to quote backslashes using
+  #   echo "$something" | sed 's/\\/\\\\/g'
+  #
+  # So, first we look for a working echo in the user's PATH.
+
+  IFS="${IFS= 	}"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for dir in $PATH /usr/ucb; do
+    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+       test "X$echo_testing_string" = "X$echo_test_string"; then
+      echo="$dir/echo"
+      break
+    fi
+  done
+  IFS="$save_ifs"
+
+  if test "X$echo" = Xecho; then
+    # We didn't find a better echo, so look for alternatives.
+    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
+       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
+       test "X$echo_testing_string" = "X$echo_test_string"; then
+      # This shell has a builtin print -r that does the trick.
+      echo='print -r'
+    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
+	 test "X$CONFIG_SHELL" != X/bin/ksh; then
+      # If we have ksh, try running configure again with it.
+      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+      export ORIGINAL_CONFIG_SHELL
+      CONFIG_SHELL=/bin/ksh
+      export CONFIG_SHELL
+      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
+    else
+      # Try using printf.
+      echo='printf %s\n'
+      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+	 test "X$echo_testing_string" = "X$echo_test_string"; then
+	# Cool, printf works
+	:
+      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+	   test "X$echo_testing_string" = 'X\t' &&
+	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+	   test "X$echo_testing_string" = "X$echo_test_string"; then
+	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+	export CONFIG_SHELL
+	SHELL="$CONFIG_SHELL"
+	export SHELL
+	echo="$CONFIG_SHELL [$]0 --fallback-echo"
+      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+	   test "X$echo_testing_string" = 'X\t' &&
+	   echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+	   test "X$echo_testing_string" = "X$echo_test_string"; then
+	echo="$CONFIG_SHELL [$]0 --fallback-echo"
+      else
+	# maybe with a smaller string...
+	prev=:
+
+	for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
+	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
+	  then
+	    break
+	  fi
+	  prev="$cmd"
+	done
+
+	if test "$prev" != 'sed 50q "[$]0"'; then
+	  echo_test_string=`eval $prev`
+	  export echo_test_string
+	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
+	else
+	  # Oops.  We lost completely, so just stick with echo.
+	  echo=echo
+	fi
+      fi
+    fi
+  fi
+fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
+   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
+fi
+
+AC_SUBST(ECHO)
+AC_DIVERT_POP
+])# _LT_AC_PROG_ECHO_BACKSLASH
+
+# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ------------------------------------------------------------------
+AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
+[if test "$cross_compiling" = yes; then :
+  [$4]
+else
+  AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+[#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL		RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL		DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL		0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW		DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW	RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW	DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW	0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      /* dlclose (self); */
+    }
+
+    exit (status);
+}]
+EOF
+  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) $1 ;;
+      x$lt_dlneed_uscore) $2 ;;
+      x$lt_unknown|x*) $3 ;;
+    esac
+  else :
+    # compilation failed
+    $3
+  fi
+fi
+rm -fr conftest*
+])# _LT_AC_TRY_DLOPEN_SELF
+
+# AC_LIBTOOL_DLOPEN_SELF
+# -------------------
+AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
+[if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  cygwin* | mingw* | pw32*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+   ;;
+
+  *)
+    AC_CHECK_FUNC([shl_load],
+          [lt_cv_dlopen="shl_load"],
+      [AC_CHECK_LIB([dld], [shl_load],
+            [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
+	[AC_CHECK_FUNC([dlopen],
+	      [lt_cv_dlopen="dlopen"],
+	  [AC_CHECK_LIB([dl], [dlopen],
+	        [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+	    [AC_CHECK_LIB([svld], [dlopen],
+	          [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+	      [AC_CHECK_LIB([dld], [dld_link],
+	            [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
+	      ])
+	    ])
+	  ])
+	])
+      ])
+    ;;
+  esac
+
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS="$LDFLAGS"
+    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    AC_CACHE_CHECK([whether a program can dlopen itself],
+	  lt_cv_dlopen_self, [dnl
+	  _LT_AC_TRY_DLOPEN_SELF(
+	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+    ])
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+    	  lt_cv_dlopen_self_static, [dnl
+	  _LT_AC_TRY_DLOPEN_SELF(
+	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
+      ])
+    fi
+
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+])# AC_LIBTOOL_DLOPEN_SELF
+
+AC_DEFUN([_LT_AC_LTCONFIG_HACK],
+[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e s/^X//'
+sed_quote_subst='s/\([[\\"\\`$\\\\]]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([[\\"\\`\\\\]]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except M$VC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+need_locks="$enable_libtool_lock"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+if test x"$host" != x"$build"; then
+  ac_tool_prefix=${host_alias}-
+else
+  ac_tool_prefix=
+fi
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+    ;;
+  *)
+    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+# Allow CC to be a program name with arguments.
+set dummy $CC
+compiler="[$]2"
+
+AC_MSG_CHECKING([for objdir])
+rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+AC_MSG_RESULT($objdir)
+
+
+AC_ARG_WITH(pic,
+[  --with-pic              try to use only PIC/non-PIC objects [default=use both]],
+pic_mode="$withval", pic_mode=default)
+test -z "$pic_mode" && pic_mode=default
+
+# We assume here that the value for lt_cv_prog_cc_pic will not be cached
+# in isolation, and that seeing it set (from the cache) indicates that
+# the associated values are set (in the cache) correctly too.
+AC_MSG_CHECKING([for $compiler option to produce PIC])
+AC_CACHE_VAL(lt_cv_prog_cc_pic,
+[ lt_cv_prog_cc_pic=
+  lt_cv_prog_cc_shlib=
+  lt_cv_prog_cc_wl=
+  lt_cv_prog_cc_static=
+  lt_cv_prog_cc_no_builtin=
+  lt_cv_prog_cc_can_build_shared=$can_build_shared
+
+  if test "$GCC" = yes; then
+    lt_cv_prog_cc_wl='-Wl,'
+    lt_cv_prog_cc_static='-static'
+
+    case $host_os in
+    aix*)
+      # Below there is a dirty hack to force normal static linking with -ldl
+      # The problem is because libdl dynamically linked with both libc and
+      # libC (AIX C++ library), which obviously doesn't included in libraries
+      # list by gcc. This cause undefined symbols with -static flags.
+      # This hack allows C programs to be linked with "-static -ldl", but
+      # not sure about C++ programs.
+      lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
+      ;;
+    amigaos*)
+      # FIXME: we need at least 68020 code to build shared libraries, but
+      # adding the `-m68020' flag to GCC prevents building anything better,
+      # like `-m68040'.
+      lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
+      ;;
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_cv_prog_cc_pic='-fno-common'
+      ;;
+    cygwin* | mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_cv_prog_cc_pic='-DDLL_EXPORT'
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	 lt_cv_prog_cc_pic=-Kconform_pic
+      fi
+      ;;
+    *)
+      lt_cv_prog_cc_pic='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for PIC flags for the system compiler.
+    case $host_os in
+    aix3* | aix4* | aix5*)
+      lt_cv_prog_cc_wl='-Wl,'
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_cv_prog_cc_static='-Bstatic'
+      else
+	lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
+      lt_cv_prog_cc_wl='-Wl,'
+      lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
+      lt_cv_prog_cc_pic='+Z'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_cv_prog_cc_wl='-Wl,'
+      lt_cv_prog_cc_static='-non_shared'
+      # PIC (with -KPIC) is the default.
+      ;;
+
+    cygwin* | mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_cv_prog_cc_pic='-DDLL_EXPORT'
+      ;;
+
+    newsos6)
+      lt_cv_prog_cc_pic='-KPIC'
+      lt_cv_prog_cc_static='-Bstatic'
+      ;;
+
+    osf3* | osf4* | osf5*)
+      # All OSF/1 code is PIC.
+      lt_cv_prog_cc_wl='-Wl,'
+      lt_cv_prog_cc_static='-non_shared'
+      ;;
+
+    sco3.2v5*)
+      lt_cv_prog_cc_pic='-Kpic'
+      lt_cv_prog_cc_static='-dn'
+      lt_cv_prog_cc_shlib='-belf'
+      ;;
+
+    solaris*)
+      lt_cv_prog_cc_pic='-KPIC'
+      lt_cv_prog_cc_static='-Bstatic'
+      lt_cv_prog_cc_wl='-Wl,'
+      ;;
+
+    sunos4*)
+      lt_cv_prog_cc_pic='-PIC'
+      lt_cv_prog_cc_static='-Bstatic'
+      lt_cv_prog_cc_wl='-Qoption ld '
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      lt_cv_prog_cc_pic='-KPIC'
+      lt_cv_prog_cc_static='-Bstatic'
+      lt_cv_prog_cc_wl='-Wl,'
+      ;;
+
+    uts4*)
+      lt_cv_prog_cc_pic='-pic'
+      lt_cv_prog_cc_static='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	lt_cv_prog_cc_pic='-Kconform_pic'
+	lt_cv_prog_cc_static='-Bstatic'
+      fi
+      ;;
+
+    *)
+      lt_cv_prog_cc_can_build_shared=no
+      ;;
+    esac
+  fi
+])
+if test -z "$lt_cv_prog_cc_pic"; then
+  AC_MSG_RESULT([none])
+else
+  AC_MSG_RESULT([$lt_cv_prog_cc_pic])
+
+  # Check to make sure the pic_flag actually works.
+  AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works])
+  AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl
+    save_CFLAGS="$CFLAGS"
+    CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
+    AC_TRY_COMPILE([], [], [dnl
+      case $host_os in
+      hpux9* | hpux10* | hpux11*)
+	# On HP-UX, both CC and GCC only warn that PIC is supported... then
+	# they create non-PIC objects.  So, if there were any warnings, we
+	# assume that PIC is not supported.
+	if test -s conftest.err; then
+	  lt_cv_prog_cc_pic_works=no
+	else
+	  lt_cv_prog_cc_pic_works=yes
+	fi
+	;;
+      *)
+	lt_cv_prog_cc_pic_works=yes
+	;;
+      esac
+    ], [dnl
+      lt_cv_prog_cc_pic_works=no
+    ])
+    CFLAGS="$save_CFLAGS"
+  ])
+
+  if test "X$lt_cv_prog_cc_pic_works" = Xno; then
+    lt_cv_prog_cc_pic=
+    lt_cv_prog_cc_can_build_shared=no
+  else
+    lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
+  fi
+
+  AC_MSG_RESULT([$lt_cv_prog_cc_pic_works])
+fi
+
+# Check for any special shared library compilation flags.
+if test -n "$lt_cv_prog_cc_shlib"; then
+  AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries])
+  if echo "$old_CC $old_CFLAGS " | egrep -e "[[ 	]]$lt_cv_prog_cc_shlib[[ 	]]" >/dev/null; then :
+  else
+   AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure])
+    lt_cv_prog_cc_can_build_shared=no
+  fi
+fi
+
+AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works])
+AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl
+  lt_cv_prog_cc_static_works=no
+  save_LDFLAGS="$LDFLAGS"
+  LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
+  AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes])
+  LDFLAGS="$save_LDFLAGS"
+])
+
+# Belt *and* braces to stop my trousers falling down:
+test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
+AC_MSG_RESULT([$lt_cv_prog_cc_static_works])
+
+pic_flag="$lt_cv_prog_cc_pic"
+special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
+wl="$lt_cv_prog_cc_wl"
+link_static_flag="$lt_cv_prog_cc_static"
+no_builtin_flag="$lt_cv_prog_cc_no_builtin"
+can_build_shared="$lt_cv_prog_cc_can_build_shared"
+
+
+# Check to see if options -o and -c are simultaneously supported by compiler
+AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext])
+AC_CACHE_VAL([lt_cv_compiler_c_o], [
+$rm -r conftest 2>/dev/null
+mkdir conftest
+cd conftest
+echo "int some_variable = 0;" > conftest.$ac_ext
+mkdir out
+# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
+# that will create temporary files in the current directory regardless of
+# the output directory.  Thus, making CWD read-only will cause this test
+# to fail, enabling locking or at least warning the user not to do parallel
+# builds.
+chmod -w .
+save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
+compiler_c_o=no
+if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
+  # The compiler can only warn and ignore the option if not recognized
+  # So say no if there are warnings
+  if test -s out/conftest.err; then
+    lt_cv_compiler_c_o=no
+  else
+    lt_cv_compiler_c_o=yes
+  fi
+else
+  # Append any errors to the config.log.
+  cat out/conftest.err 1>&AC_FD_CC
+  lt_cv_compiler_c_o=no
+fi
+CFLAGS="$save_CFLAGS"
+chmod u+w .
+$rm conftest* out/*
+rmdir out
+cd ..
+rmdir conftest
+$rm -r conftest 2>/dev/null
+])
+compiler_c_o=$lt_cv_compiler_c_o
+AC_MSG_RESULT([$compiler_c_o])
+
+if test x"$compiler_c_o" = x"yes"; then
+  # Check to see if we can write to a .lo
+  AC_MSG_CHECKING([if $compiler supports -c -o file.lo])
+  AC_CACHE_VAL([lt_cv_compiler_o_lo], [
+  lt_cv_compiler_o_lo=no
+  save_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -c -o conftest.lo"
+  save_objext="$ac_objext"
+  ac_objext=lo
+  AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
+    # The compiler can only warn and ignore the option if not recognized
+    # So say no if there are warnings
+    if test -s conftest.err; then
+      lt_cv_compiler_o_lo=no
+    else
+      lt_cv_compiler_o_lo=yes
+    fi
+  ])
+  ac_objext="$save_objext"
+  CFLAGS="$save_CFLAGS"
+  ])
+  compiler_o_lo=$lt_cv_compiler_o_lo
+  AC_MSG_RESULT([$compiler_o_lo])
+else
+  compiler_o_lo=no
+fi
+
+# Check to see if we can do hard links to lock some files if needed
+hard_links="nottested"
+if test "$compiler_c_o" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  AC_MSG_CHECKING([if we can lock with hard links])
+  hard_links=yes
+  $rm conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  AC_MSG_RESULT([$hard_links])
+  if test "$hard_links" = no; then
+    AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe])
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+if test "$GCC" = yes; then
+  # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
+  AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions])
+  echo "int some_variable = 0;" > conftest.$ac_ext
+  save_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
+  compiler_rtti_exceptions=no
+  AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
+    # The compiler can only warn and ignore the option if not recognized
+    # So say no if there are warnings
+    if test -s conftest.err; then
+      compiler_rtti_exceptions=no
+    else
+      compiler_rtti_exceptions=yes
+    fi
+  ])
+  CFLAGS="$save_CFLAGS"
+  AC_MSG_RESULT([$compiler_rtti_exceptions])
+
+  if test "$compiler_rtti_exceptions" = "yes"; then
+    no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
+  else
+    no_builtin_flag=' -fno-builtin'
+  fi
+fi
+
+# See if the linker supports building shared libraries.
+AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries])
+
+allow_undefined_flag=
+no_undefined_flag=
+need_lib_prefix=unknown
+need_version=unknown
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+archive_cmds=
+archive_expsym_cmds=
+old_archive_from_new_cmds=
+old_archive_from_expsyms_cmds=
+export_dynamic_flag_spec=
+whole_archive_flag_spec=
+thread_safe_flag_spec=
+hardcode_into_libs=no
+hardcode_libdir_flag_spec=
+hardcode_libdir_separator=
+hardcode_direct=no
+hardcode_minus_L=no
+hardcode_shlibpath_var=unsupported
+runpath_var=
+link_all_deplibs=unknown
+always_export_symbols=no
+export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
+# include_expsyms should be a list of space-separated symbols to be *always*
+# included in the symbol list
+include_expsyms=
+# exclude_expsyms can be an egrep regular expression of symbols to exclude
+# it will be wrapped by ` (' and `)$', so one must not match beginning or
+# end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+# as well as any symbol that contains `d'.
+exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
+# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+# platforms (ab)use it in PIC code, but their linkers get confused if
+# the symbol is explicitly referenced.  Since portable code cannot
+# rely on this symbol name, it's probably fine to never include it in
+# preloaded symbol tables.
+extract_expsyms_cmds=
+
+case $host_os in
+cygwin* | mingw* | pw32*)
+  # FIXME: the MSVC++ port hasn't been tested in a loooong time
+  # When not using gcc, we currently assume that we are using
+  # Microsoft Visual C++.
+  if test "$GCC" != yes; then
+    with_gnu_ld=no
+  fi
+  ;;
+openbsd*)
+  with_gnu_ld=no
+  ;;
+esac
+
+ld_shlibs=yes
+if test "$with_gnu_ld" = yes; then
+  # If archive_cmds runs LD, not CC, wlarc should be empty
+  wlarc='${wl}'
+
+  # See if GNU ld supports shared libraries.
+  case $host_os in
+  aix3* | aix4* | aix5*)
+    # On AIX, the GNU linker is very broken
+    # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
+    ld_shlibs=no
+    cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+    ;;
+
+  amigaos*)
+    archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+    hardcode_libdir_flag_spec='-L$libdir'
+    hardcode_minus_L=yes
+
+    # Samuel A. Falvo II <kc5tja at dolphin.openprojects.net> reports
+    # that the semantics of dynamic libraries on AmigaOS, at least up
+    # to version 4, is to share data among multiple programs linked
+    # with the same dynamic library.  Since this doesn't match the
+    # behavior of shared libraries on other platforms, we can use
+    # them.
+    ld_shlibs=no
+    ;;
+
+  beos*)
+    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+      allow_undefined_flag=unsupported
+      # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+      # support --undefined.  This deserves some investigation.  FIXME
+      archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+    else
+      ld_shlibs=no
+    fi
+    ;;
+
+  cygwin* | mingw* | pw32*)
+    # hardcode_libdir_flag_spec is actually meaningless, as there is
+    # no search path for DLLs.
+    hardcode_libdir_flag_spec='-L$libdir'
+    allow_undefined_flag=unsupported
+    always_export_symbols=yes
+
+    extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
+      sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
+      test -f $output_objdir/impgen.exe || (cd $output_objdir && \
+      if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
+      else $CC -o impgen impgen.c ; fi)~
+      $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
+
+    old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
+
+    # cygwin and mingw dlls have different entry points and sets of symbols
+    # to exclude.
+    # FIXME: what about values for MSVC?
+    dll_entry=__cygwin_dll_entry at 12
+    dll_exclude_symbols=DllMain at 12,_cygwin_dll_entry at 12,_cygwin_noncygwin_dll_entry at 12~
+    case $host_os in
+    mingw*)
+      # mingw values
+      dll_entry=_DllMainCRTStartup at 12
+      dll_exclude_symbols=DllMain at 12,DllMainCRTStartup at 12,DllEntryPoint at 12~
+      ;;
+    esac
+
+    # mingw and cygwin differ, and it's simplest to just exclude the union
+    # of the two symbol sets.
+    dll_exclude_symbols=DllMain at 12,_cygwin_dll_entry at 12,_cygwin_noncygwin_dll_entry at 12,DllMainCRTStartup at 12,DllEntryPoint at 12
+
+    # recent cygwin and mingw systems supply a stub DllMain which the user
+    # can override, but on older systems we have to supply one (in ltdll.c)
+    if test "x$lt_cv_need_dllmain" = "xyes"; then
+      ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
+      ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~
+	test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
+    else
+      ltdll_obj=
+      ltdll_cmds=
+    fi
+
+    # Extract the symbol export list from an `--export-all' def file,
+    # then regenerate the def file from the symbol export list, so that
+    # the compiled dll only exports the symbol export list.
+    # Be careful not to strip the DATA tag left be newer dlltools.
+    export_symbols_cmds="$ltdll_cmds"'
+      $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
+      sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
+
+    # If the export-symbols file already is a .def file (1st line
+    # is EXPORTS), use it as is.
+    # If DATA tags from a recent dlltool are present, honour them!
+    archive_expsym_cmds='if test "x`sed 1q $export_symbols`" = xEXPORTS; then
+	cp $export_symbols $output_objdir/$soname-def;
+      else
+	echo EXPORTS > $output_objdir/$soname-def;
+	_lt_hint=1;
+	cat $export_symbols | while read symbol; do
+	 set dummy \$symbol;
+	 case \[$]# in
+	   2) echo "   \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
+	   4) echo "   \[$]2 \[$]3 \[$]4 ; " >> $output_objdir/$soname-def; _lt_hint=`expr \$_lt_hint - 1`;;
+	   *) echo "     \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
+	 esac;
+	 _lt_hint=`expr 1 + \$_lt_hint`;
+	done;
+      fi~
+      '"$ltdll_cmds"'
+      $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
+      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
+      $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
+      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~
+      $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
+    ;;
+
+  netbsd*)
+    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+      wlarc=
+    else
+      archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+    fi
+    ;;
+
+  solaris* | sysv5*)
+    if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
+      ld_shlibs=no
+      cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+    elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+    else
+      ld_shlibs=no
+    fi
+    ;;
+
+  sunos4*)
+    archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+    wlarc=
+    hardcode_direct=yes
+    hardcode_shlibpath_var=no
+    ;;
+
+  *)
+    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+    else
+      ld_shlibs=no
+    fi
+    ;;
+  esac
+
+  if test "$ld_shlibs" = yes; then
+    runpath_var=LD_RUN_PATH
+    hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec='${wl}--export-dynamic'
+    case $host_os in
+    cygwin* | mingw* | pw32*)
+      # dlltool doesn't understand --whole-archive et. al.
+      whole_archive_flag_spec=
+      ;;
+    *)
+      # ancient GNU ld didn't support --whole-archive et. al.
+      if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
+	whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+	whole_archive_flag_spec=
+      fi
+      ;;
+    esac
+  fi
+else
+  # PORTME fill in a description of your system's linker (not GNU ld)
+  case $host_os in
+  aix3*)
+    allow_undefined_flag=unsupported
+    always_export_symbols=yes
+    archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+    # Note: this linker hardcodes the directories in LIBPATH if there
+    # are no directories specified by -L.
+    hardcode_minus_L=yes
+    if test "$GCC" = yes && test -z "$link_static_flag"; then
+      # Neither direct hardcoding nor static linking is supported with a
+      # broken collect2.
+      hardcode_direct=unsupported
+    fi
+    ;;
+
+  aix4* | aix5*)
+    if test "$host_cpu" = ia64; then
+      # On IA64, the linker does run time linking by default, so we don't
+      # have to do anything special.
+      aix_use_runtimelinking=no
+      exp_sym_flag='-Bexport'
+      no_entry_flag=""
+    else
+      aix_use_runtimelinking=no
+
+      # Test if we are trying to use run time linking or normal
+      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+      # need to do runtime linking.
+      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
+	for ld_flag in $LDFLAGS; do
+	  case $ld_flag in
+	  *-brtl*)
+	    aix_use_runtimelinking=yes
+	    break
+	  ;;
+	  esac
+	done
+      esac
+
+      exp_sym_flag='-bexport'
+      no_entry_flag='-bnoentry'
+    fi
+
+    # When large executables or shared objects are built, AIX ld can
+    # have problems creating the table of contents.  If linking a library
+    # or program results in "error TOC overflow" add -mminimal-toc to
+    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+    hardcode_direct=yes
+    archive_cmds=''
+    hardcode_libdir_separator=':'
+    if test "$GCC" = yes; then
+      case $host_os in aix4.[[012]]|aix4.[[012]].*)
+	collect2name=`${CC} -print-prog-name=collect2`
+	if test -f "$collect2name" && \
+	  strings "$collect2name" | grep resolve_lib_name >/dev/null
+	then
+	  # We have reworked collect2
+	  hardcode_direct=yes
+	else
+	  # We have old collect2
+	  hardcode_direct=unsupported
+	  # It fails to find uninstalled libraries when the uninstalled
+	  # path is not listed in the libpath.  Setting hardcode_minus_L
+	  # to unsupported forces relinking
+	  hardcode_minus_L=yes
+	  hardcode_libdir_flag_spec='-L$libdir'
+	  hardcode_libdir_separator=
+	fi
+      esac
+
+      shared_flag='-shared'
+    else
+      # not using gcc
+      if test "$host_cpu" = ia64; then
+	shared_flag='${wl}-G'
+      else
+	if test "$aix_use_runtimelinking" = yes; then
+	  shared_flag='${wl}-G'
+	else
+	  shared_flag='${wl}-bM:SRE'
+	fi
+      fi
+    fi
+
+    # It seems that -bexpall can do strange things, so it is better to
+    # generate a list of symbols to export.
+    always_export_symbols=yes
+    if test "$aix_use_runtimelinking" = yes; then
+      # Warning - without using the other runtime loading flags (-brtl),
+      # -berok will link without error, but may produce a broken library.
+      allow_undefined_flag='-berok'
+      hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
+      archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+    else
+      if test "$host_cpu" = ia64; then
+	hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+	allow_undefined_flag="-z nodefs"
+	archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+      else
+	hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
+	# Warning - without using the other run time loading flags,
+	# -berok will link without error, but may produce a broken library.
+	allow_undefined_flag='${wl}-berok'
+	# This is a bit strange, but is similar to how AIX traditionally builds
+	# it's shared libraries.
+	archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname'
+      fi
+    fi
+    ;;
+
+  amigaos*)
+    archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+    hardcode_libdir_flag_spec='-L$libdir'
+    hardcode_minus_L=yes
+    # see comment about different semantics on the GNU ld section
+    ld_shlibs=no
+    ;;
+
+  cygwin* | mingw* | pw32*)
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    # hardcode_libdir_flag_spec is actually meaningless, as there is
+    # no search path for DLLs.
+    hardcode_libdir_flag_spec=' '
+    allow_undefined_flag=unsupported
+    # Tell ltmain to make .lib files, not .a files.
+    libext=lib
+    # FIXME: Setting linknames here is a bad hack.
+    archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
+    # The linker will automatically build a .lib file if we build a DLL.
+    old_archive_from_new_cmds='true'
+    # FIXME: Should let the user specify the lib program.
+    old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
+    fix_srcfile_path='`cygpath -w "$srcfile"`'
+    ;;
+
+  darwin* | rhapsody*)
+    case "$host_os" in
+    rhapsody* | darwin1.[[012]])
+      allow_undefined_flag='-undefined suppress'
+      ;;
+    *) # Darwin 1.3 on
+      allow_undefined_flag='-flat_namespace -undefined suppress'
+      ;;
+    esac
+    # FIXME: Relying on posixy $() will cause problems for
+    #        cross-compilation, but unfortunately the echo tests do not
+    #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
+    #	     `"' quotes if we put them in here... so don't!
+    archive_cmds='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs && $CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib ${lib}-master.o $deplibs$linker_flags $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)'
+    # We need to add '_' to the symbols in $export_symbols first
+    #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
+    hardcode_direct=yes
+    hardcode_shlibpath_var=no
+    whole_archive_flag_spec='-all_load $convenience'
+    ;;
+
+  freebsd1*)
+    ld_shlibs=no
+    ;;
+
+  # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+  # support.  Future versions do this automatically, but an explicit c++rt0.o
+  # does not break anything, and helps significantly (at the cost of a little
+  # extra space).
+  freebsd2.2*)
+    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+    hardcode_libdir_flag_spec='-R$libdir'
+    hardcode_direct=yes
+    hardcode_shlibpath_var=no
+    ;;
+
+  # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+  freebsd2*)
+    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+    hardcode_direct=yes
+    hardcode_minus_L=yes
+    hardcode_shlibpath_var=no
+    ;;
+
+  # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+  freebsd*)
+    archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+    hardcode_libdir_flag_spec='-R$libdir'
+    hardcode_direct=yes
+    hardcode_shlibpath_var=no
+    ;;
+
+  hpux9* | hpux10* | hpux11*)
+    case $host_os in
+    hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
+    *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
+    esac
+    hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+    hardcode_libdir_separator=:
+    hardcode_direct=yes
+    hardcode_minus_L=yes # Not in the search PATH, but as the default
+			 # location of the library.
+    export_dynamic_flag_spec='${wl}-E'
+    ;;
+
+  irix5* | irix6* | nonstopux*)
+    if test "$GCC" = yes; then
+      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+    else
+      archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      hardcode_libdir_flag_spec='-rpath $libdir'
+    fi
+    hardcode_libdir_separator=:
+    link_all_deplibs=yes
+    ;;
+
+  netbsd*)
+    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+    else
+      archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+    fi
+    hardcode_libdir_flag_spec='-R$libdir'
+    hardcode_direct=yes
+    hardcode_shlibpath_var=no
+    ;;
+
+  newsos6)
+    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+    hardcode_direct=yes
+    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+    hardcode_libdir_separator=:
+    hardcode_shlibpath_var=no
+    ;;
+
+  openbsd*)
+    hardcode_direct=yes
+    hardcode_shlibpath_var=no
+    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+      export_dynamic_flag_spec='${wl}-E'
+    else
+      case "$host_os" in
+      openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_libdir_flag_spec='-R$libdir'
+        ;;
+      *)
+        archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+        hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+        ;;
+      esac
+    fi
+    ;;
+
+  os2*)
+    hardcode_libdir_flag_spec='-L$libdir'
+    hardcode_minus_L=yes
+    allow_undefined_flag=unsupported
+    archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+    old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+    ;;
+
+  osf3*)
+    if test "$GCC" = yes; then
+      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+      archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+    else
+      allow_undefined_flag=' -expect_unresolved \*'
+      archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+    fi
+    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+    hardcode_libdir_separator=:
+    ;;
+
+  osf4* | osf5*)	# as osf3* with the addition of -msym flag
+    if test "$GCC" = yes; then
+      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+      archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+    else
+      allow_undefined_flag=' -expect_unresolved \*'
+      archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+      $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+
+      #Both c and cxx compiler support -rpath directly
+      hardcode_libdir_flag_spec='-rpath $libdir'
+    fi
+    hardcode_libdir_separator=:
+    ;;
+
+  sco3.2v5*)
+    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+    hardcode_shlibpath_var=no
+    runpath_var=LD_RUN_PATH
+    hardcode_runpath_var=yes
+    export_dynamic_flag_spec='${wl}-Bexport'
+    ;;
+
+  solaris*)
+    # gcc --version < 3.0 without binutils cannot create self contained
+    # shared libraries reliably, requiring libgcc.a to resolve some of
+    # the object symbols generated in some cases.  Libraries that use
+    # assert need libgcc.a to resolve __eprintf, for example.  Linking
+    # a copy of libgcc.a into every shared library to guarantee resolving
+    # such symbols causes other problems:  According to Tim Van Holder
+    # <tim.van.holder at pandora.be>, C++ libraries end up with a separate
+    # (to the application) exception stack for one thing.
+    no_undefined_flag=' -z defs'
+    if test "$GCC" = yes; then
+      case `$CC --version 2>/dev/null` in
+      [[12]].*)
+	cat <<EOF 1>&2
+
+*** Warning: Releases of GCC earlier than version 3.0 cannot reliably
+*** create self contained shared libraries on Solaris systems, without
+*** introducing a dependency on libgcc.a.  Therefore, libtool is disabling
+*** -no-undefined support, which will at least allow you to build shared
+*** libraries.  However, you may find that when you link such libraries
+*** into an application without using GCC, you have to manually add
+*** \`gcc --print-libgcc-file-name\` to the link command.  We urge you to
+*** upgrade to a newer version of GCC.  Another option is to rebuild your
+*** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
+
+EOF
+        no_undefined_flag=
+	;;
+      esac
+    fi
+    # $CC -shared without GNU ld will not create a library from C++
+    # object files and a static libstdc++, better avoid it by now
+    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+    hardcode_libdir_flag_spec='-R$libdir'
+    hardcode_shlibpath_var=no
+    case $host_os in
+    solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+    *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+      whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
+    esac
+    link_all_deplibs=yes
+    ;;
+
+  sunos4*)
+    if test "x$host_vendor" = xsequent; then
+      # Use $CC to link under sequent, because it throws in some extra .o
+      # files that make .init and .fini sections work.
+      archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+    else
+      archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+    fi
+    hardcode_libdir_flag_spec='-L$libdir'
+    hardcode_direct=yes
+    hardcode_minus_L=yes
+    hardcode_shlibpath_var=no
+    ;;
+
+  sysv4)
+    case $host_vendor in
+      sni)
+        archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+        hardcode_direct=yes # is this really true???
+        ;;
+      siemens)
+        ## LD is ld it makes a PLAMLIB
+        ## CC just makes a GrossModule.
+        archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+        reload_cmds='$CC -r -o $output$reload_objs'
+        hardcode_direct=no
+        ;;
+      motorola)
+        archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+        hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+        ;;
+    esac
+    runpath_var='LD_RUN_PATH'
+    hardcode_shlibpath_var=no
+    ;;
+
+  sysv4.3*)
+    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+    hardcode_shlibpath_var=no
+    export_dynamic_flag_spec='-Bexport'
+    ;;
+
+  sysv5*)
+    no_undefined_flag=' -z text'
+    # $CC -shared without GNU ld will not create a library from C++
+    # object files and a static libstdc++, better avoid it by now
+    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+    hardcode_libdir_flag_spec=
+    hardcode_shlibpath_var=no
+    runpath_var='LD_RUN_PATH'
+    ;;
+
+  uts4*)
+    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+    hardcode_libdir_flag_spec='-L$libdir'
+    hardcode_shlibpath_var=no
+    ;;
+
+  dgux*)
+    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+    hardcode_libdir_flag_spec='-L$libdir'
+    hardcode_shlibpath_var=no
+    ;;
+
+  sysv4*MP*)
+    if test -d /usr/nec; then
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var=no
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ld_shlibs=yes
+    fi
+    ;;
+
+  sysv4.2uw2*)
+    archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+    hardcode_direct=yes
+    hardcode_minus_L=no
+    hardcode_shlibpath_var=no
+    hardcode_runpath_var=yes
+    runpath_var=LD_RUN_PATH
+    ;;
+
+  sysv5uw7* | unixware7*)
+    no_undefined_flag='${wl}-z ${wl}text'
+    if test "$GCC" = yes; then
+      archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+    else
+      archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+    fi
+    runpath_var='LD_RUN_PATH'
+    hardcode_shlibpath_var=no
+    ;;
+
+  *)
+    ld_shlibs=no
+    ;;
+  esac
+fi
+AC_MSG_RESULT([$ld_shlibs])
+test "$ld_shlibs" = no && can_build_shared=no
+
+# Check hardcoding attributes.
+AC_MSG_CHECKING([how to hardcode library paths into programs])
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" || \
+   test -n "$runpath_var"; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$hardcode_shlibpath_var" != no &&
+     test "$hardcode_minus_L" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action=unsupported
+fi
+AC_MSG_RESULT([$hardcode_action])
+
+striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  AC_MSG_RESULT([yes])
+else
+  AC_MSG_RESULT([no])
+fi
+
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+# PORTME Fill in your ld.so characteristics
+AC_MSG_CHECKING([dynamic linker characteristics])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}.so$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}.so$major'
+  ;;
+
+aix4* | aix5*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[[01]] | aix4.[[01]].*)
+	if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+	     echo ' yes '
+	     echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+	  :
+	else
+	  can_build_shared=no
+	fi
+	;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can
+    # not hardcode correct soname into executable. Probably we can
+    # add versioning support to collect2, so additional links can
+    # be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}.so$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  hardcode_into_libs=yes
+  ;;
+
+amigaos*)
+  library_names_spec='$libname.ixlibrary $libname.a'
+  # Create ${libname}_ixlibrary.a entries in /sys/libs.
+  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
+  ;;
+
+beos*)
+  library_names_spec='${libname}.so'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi4*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+  soname_spec='${libname}${release}.so$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  export_dynamic_flag_spec=-rdynamic
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32*)
+  version_type=windows
+  need_version=no
+  need_lib_prefix=no
+  case $GCC,$host_os in
+  yes,cygwin*)
+    library_names_spec='$libname.dll.a'
+    soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
+    postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog .libs/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $rm \$dlpath'
+    ;;
+  yes,mingw*)
+    library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
+    sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g" -e "s,=/,/,g"`
+    ;;
+  yes,pw32*)
+    library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
+    ;;
+  *)
+    library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  # FIXME: Relying on posixy $() will cause problems for
+  #        cross-compilation, but unfortunately the echo tests do not
+  #        yet detect zsh echo's removal of \ escapes.
+  library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)'
+  soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+freebsd*)
+  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  *)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
+  soname_spec='${libname}${release}.so$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  dynamic_linker="$host_os dld.sl"
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  shlibpath_var=SHLIB_PATH
+  shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+  library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
+  soname_spec='${libname}${release}.sl$major'
+  # HP-UX runs *really* slowly unless shared libraries are mode 555.
+  postinstall_cmds='chmod 555 $lib'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)          version_type=irix ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}.so$major'
+  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+  soname_spec='${libname}${release}.so$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  case $host_cpu:$lt_cv_cc_64bit_output in
+  powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
+    sys_lib_dlsearch_path_spec="/lib64 /usr/lib64"
+    sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64"
+    ;;
+  esac
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
+    soname_spec='${libname}${release}.so$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+openbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case "$host_os" in
+    openbsd2.[[89]] | openbsd2.[[89]].*)
+      shlibpath_overrides_runpath=no
+      ;;
+    *)
+      shlibpath_overrides_runpath=yes
+      ;;
+    esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+os2*)
+  libname_spec='$name'
+  need_lib_prefix=no
+  library_names_spec='$libname.dll $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_version=no
+  soname_spec='${libname}${release}.so$major'
+  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  hardcode_into_libs=yes
+  ;;
+
+sco3.2v5*)
+  version_type=osf
+  soname_spec='${libname}${release}.so$major'
+  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+  soname_spec='${libname}${release}.so$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  version_type=linux
+  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+  soname_spec='${libname}${release}.so$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+  soname_spec='${libname}${release}.so$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+  soname_spec='${libname}${release}.so$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
+    soname_spec='$libname.so.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+
+# Report the final consequences.
+AC_MSG_CHECKING([if libtool supports shared libraries])
+AC_MSG_RESULT([$can_build_shared])
+
+AC_MSG_CHECKING([whether to build shared libraries])
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case "$host_os" in
+aix3*)
+  test "$enable_shared" = yes && enable_static=no
+  if test -n "$RANLIB"; then
+    archive_cmds="$archive_cmds~\$RANLIB \$lib"
+    postinstall_cmds='$RANLIB $lib'
+  fi
+  ;;
+
+aix4*)
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
+  fi
+  ;;
+esac
+AC_MSG_RESULT([$enable_shared])
+
+AC_MSG_CHECKING([whether to build static libraries])
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+AC_MSG_RESULT([$enable_static])
+
+if test "$hardcode_action" = relink; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+AC_LIBTOOL_DLOPEN_SELF
+
+if test "$enable_shared" = yes && test "$GCC" = yes; then
+  case $archive_cmds in
+  *'~'*)
+    # FIXME: we may have to deal with multi-command sequences.
+    ;;
+  '$CC '*)
+    # Test whether the compiler implicitly links with -lc since on some
+    # systems, -lgcc has to come before -lc. If gcc already passes -lc
+    # to ld, don't add -lc before -lgcc.
+    AC_MSG_CHECKING([whether -lc should be explicitly linked in])
+    AC_CACHE_VAL([lt_cv_archive_cmds_need_lc],
+    [$rm conftest*
+    echo 'static int dummy;' > conftest.$ac_ext
+
+    if AC_TRY_EVAL(ac_compile); then
+      soname=conftest
+      lib=conftest
+      libobjs=conftest.$ac_objext
+      deplibs=
+      wl=$lt_cv_prog_cc_wl
+      compiler_flags=-v
+      linker_flags=-v
+      verstring=
+      output_objdir=.
+      libname=conftest
+      save_allow_undefined_flag=$allow_undefined_flag
+      allow_undefined_flag=
+      if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
+      then
+	lt_cv_archive_cmds_need_lc=no
+      else
+	lt_cv_archive_cmds_need_lc=yes
+      fi
+      allow_undefined_flag=$save_allow_undefined_flag
+    else
+      cat conftest.err 1>&5
+    fi])
+    AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc])
+    ;;
+  esac
+fi
+need_lc=${lt_cv_archive_cmds_need_lc-yes}
+
+# The second clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  :
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  test -f Makefile && make "$ltmain"
+fi
+
+if test -f "$ltmain"; then
+  trap "$rm \"${ofile}T\"; exit 1" 1 2 15
+  $rm -f "${ofile}T"
+
+  echo creating $ofile
+
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS SED \
+    AR AR_FLAGS CC LD LN_S NM SHELL \
+    reload_flag reload_cmds wl \
+    pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
+    thread_safe_flag_spec whole_archive_flag_spec libname_spec \
+    library_names_spec soname_spec \
+    RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
+    old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
+    postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
+    old_striplib striplib file_magic_cmd export_symbols_cmds \
+    deplibs_check_method allow_undefined_flag no_undefined_flag \
+    finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
+    global_symbol_to_c_name_address \
+    hardcode_libdir_flag_spec hardcode_libdir_separator  \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
+
+    case $var in
+    reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
+    extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  cat <<__EOF__ > "${ofile}T"
+#! $SHELL
+
+# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996-2000 Free Software Foundation, Inc.
+# Originally by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 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.
+
+# A sed that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="${SED} -e s/^X//"
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$need_lc
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# The default C compiler.
+CC=$lt_CC
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS=$lt_AS
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_wl
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_pic_flag
+pic_mode=$pic_mode
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_compiler_c_o
+
+# Can we write directly to a .lo ?
+compiler_o_lo=$lt_compiler_o_lo
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_link_static_flag
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_no_builtin_flag
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# ### END LIBTOOL CONFIG
+
+__EOF__
+
+  case $host_os in
+  aix3*)
+    cat <<\EOF >> "${ofile}T"
+
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+EOF
+    ;;
+  esac
+
+  case $host_os in
+  cygwin* | mingw* | pw32* | os2*)
+    cat <<'EOF' >> "${ofile}T"
+      # This is a source program that is used to create dlls on Windows
+      # Don't remove nor modify the starting and closing comments
+# /* ltdll.c starts here */
+# #define WIN32_LEAN_AND_MEAN
+# #include <windows.h>
+# #undef WIN32_LEAN_AND_MEAN
+# #include <stdio.h>
+#
+# #ifndef __CYGWIN__
+# #  ifdef __CYGWIN32__
+# #    define __CYGWIN__ __CYGWIN32__
+# #  endif
+# #endif
+#
+# #ifdef __cplusplus
+# extern "C" {
+# #endif
+# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
+# #ifdef __cplusplus
+# }
+# #endif
+#
+# #ifdef __CYGWIN__
+# #include <cygwin/cygwin_dll.h>
+# DECLARE_CYGWIN_DLL( DllMain );
+# #endif
+# HINSTANCE __hDllInstance_base;
+#
+# BOOL APIENTRY
+# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
+# {
+#   __hDllInstance_base = hInst;
+#   return TRUE;
+# }
+# /* ltdll.c ends here */
+	# This is a source program that is used to create import libraries
+	# on Windows for dlls which lack them. Don't remove nor modify the
+	# starting and closing comments
+# /* impgen.c starts here */
+# /*   Copyright (C) 1999-2000 Free Software Foundation, Inc.
+#
+#  This file is part of GNU libtool.
+#
+#  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 <stdio.h>		/* for printf() */
+# #include <unistd.h>		/* for open(), lseek(), read() */
+# #include <fcntl.h>		/* for O_RDONLY, O_BINARY */
+# #include <string.h>		/* for strdup() */
+#
+# /* O_BINARY isn't required (or even defined sometimes) under Unix */
+# #ifndef O_BINARY
+# #define O_BINARY 0
+# #endif
+#
+# static unsigned int
+# pe_get16 (fd, offset)
+#      int fd;
+#      int offset;
+# {
+#   unsigned char b[2];
+#   lseek (fd, offset, SEEK_SET);
+#   read (fd, b, 2);
+#   return b[0] + (b[1]<<8);
+# }
+#
+# static unsigned int
+# pe_get32 (fd, offset)
+#     int fd;
+#     int offset;
+# {
+#   unsigned char b[4];
+#   lseek (fd, offset, SEEK_SET);
+#   read (fd, b, 4);
+#   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
+# }
+#
+# static unsigned int
+# pe_as32 (ptr)
+#      void *ptr;
+# {
+#   unsigned char *b = ptr;
+#   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
+# }
+#
+# int
+# main (argc, argv)
+#     int argc;
+#     char *argv[];
+# {
+#     int dll;
+#     unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
+#     unsigned long export_rva, export_size, nsections, secptr, expptr;
+#     unsigned long name_rvas, nexp;
+#     unsigned char *expdata, *erva;
+#     char *filename, *dll_name;
+#
+#     filename = argv[1];
+#
+#     dll = open(filename, O_RDONLY|O_BINARY);
+#     if (dll < 1)
+# 	return 1;
+#
+#     dll_name = filename;
+#
+#     for (i=0; filename[i]; i++)
+# 	if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
+# 	    dll_name = filename + i +1;
+#
+#     pe_header_offset = pe_get32 (dll, 0x3c);
+#     opthdr_ofs = pe_header_offset + 4 + 20;
+#     num_entries = pe_get32 (dll, opthdr_ofs + 92);
+#
+#     if (num_entries < 1) /* no exports */
+# 	return 1;
+#
+#     export_rva = pe_get32 (dll, opthdr_ofs + 96);
+#     export_size = pe_get32 (dll, opthdr_ofs + 100);
+#     nsections = pe_get16 (dll, pe_header_offset + 4 +2);
+#     secptr = (pe_header_offset + 4 + 20 +
+# 	      pe_get16 (dll, pe_header_offset + 4 + 16));
+#
+#     expptr = 0;
+#     for (i = 0; i < nsections; i++)
+#     {
+# 	char sname[8];
+# 	unsigned long secptr1 = secptr + 40 * i;
+# 	unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
+# 	unsigned long vsize = pe_get32 (dll, secptr1 + 16);
+# 	unsigned long fptr = pe_get32 (dll, secptr1 + 20);
+# 	lseek(dll, secptr1, SEEK_SET);
+# 	read(dll, sname, 8);
+# 	if (vaddr <= export_rva && vaddr+vsize > export_rva)
+# 	{
+# 	    expptr = fptr + (export_rva - vaddr);
+# 	    if (export_rva + export_size > vaddr + vsize)
+# 		export_size = vsize - (export_rva - vaddr);
+# 	    break;
+# 	}
+#     }
+#
+#     expdata = (unsigned char*)malloc(export_size);
+#     lseek (dll, expptr, SEEK_SET);
+#     read (dll, expdata, export_size);
+#     erva = expdata - export_rva;
+#
+#     nexp = pe_as32 (expdata+24);
+#     name_rvas = pe_as32 (expdata+32);
+#
+#     printf ("EXPORTS\n");
+#     for (i = 0; i<nexp; i++)
+#     {
+# 	unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
+# 	printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
+#     }
+#
+#     return 0;
+# }
+# /* impgen.c ends here */
+
+EOF
+    ;;
+  esac
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
+
+  mv -f "${ofile}T" "$ofile" || \
+    (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
+  chmod +x "$ofile"
+fi
+
+])# _LT_AC_LTCONFIG_HACK
+
+# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
+AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
+
+# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
+AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
+
+# AC_ENABLE_SHARED - implement the --enable-shared flag
+# Usage: AC_ENABLE_SHARED[(DEFAULT)]
+#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
+#   `yes'.
+AC_DEFUN([AC_ENABLE_SHARED],
+[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE(shared,
+changequote(<<, >>)dnl
+<<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
+changequote([, ])dnl
+[p=${PACKAGE-default}
+case $enableval in
+yes) enable_shared=yes ;;
+no) enable_shared=no ;;
+*)
+  enable_shared=no
+  # Look at the argument we got.  We use all the common list separators.
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+  for pkg in $enableval; do
+    if test "X$pkg" = "X$p"; then
+      enable_shared=yes
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac],
+enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
+])
+
+# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
+AC_DEFUN([AC_DISABLE_SHARED],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_SHARED(no)])
+
+# AC_ENABLE_STATIC - implement the --enable-static flag
+# Usage: AC_ENABLE_STATIC[(DEFAULT)]
+#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
+#   `yes'.
+AC_DEFUN([AC_ENABLE_STATIC],
+[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE(static,
+changequote(<<, >>)dnl
+<<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
+changequote([, ])dnl
+[p=${PACKAGE-default}
+case $enableval in
+yes) enable_static=yes ;;
+no) enable_static=no ;;
+*)
+  enable_static=no
+  # Look at the argument we got.  We use all the common list separators.
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+  for pkg in $enableval; do
+    if test "X$pkg" = "X$p"; then
+      enable_static=yes
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac],
+enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
+])
+
+# AC_DISABLE_STATIC - set the default static flag to --disable-static
+AC_DEFUN([AC_DISABLE_STATIC],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_STATIC(no)])
+
+
+# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
+# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
+#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
+#   `yes'.
+AC_DEFUN([AC_ENABLE_FAST_INSTALL],
+[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE(fast-install,
+changequote(<<, >>)dnl
+<<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
+changequote([, ])dnl
+[p=${PACKAGE-default}
+case $enableval in
+yes) enable_fast_install=yes ;;
+no) enable_fast_install=no ;;
+*)
+  enable_fast_install=no
+  # Look at the argument we got.  We use all the common list separators.
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+  for pkg in $enableval; do
+    if test "X$pkg" = "X$p"; then
+      enable_fast_install=yes
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac],
+enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
+])
+
+# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
+AC_DEFUN([AC_DISABLE_FAST_INSTALL],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_FAST_INSTALL(no)])
+
+# AC_LIBTOOL_PICMODE - implement the --with-pic flag
+# Usage: AC_LIBTOOL_PICMODE[(MODE)]
+#   Where MODE is either `yes' or `no'.  If omitted, it defaults to
+#   `both'.
+AC_DEFUN([AC_LIBTOOL_PICMODE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+pic_mode=ifelse($#,1,$1,default)])
+
+
+# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
+AC_DEFUN([AC_PATH_TOOL_PREFIX],
+[AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+  /*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+  ?:/*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
+  ;;
+  *)
+  ac_save_MAGIC_CMD="$MAGIC_CMD"
+  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word.  This closes a longstanding sh security hole.
+  ac_dummy="ifelse([$2], , $PATH, [$2])"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$1; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+      if test -n "$file_magic_test_file"; then
+	case $deplibs_check_method in
+	"file_magic "*)
+	  file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+	    egrep "$file_magic_regex" > /dev/null; then
+	    :
+	  else
+	    cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  MAGIC_CMD="$ac_save_MAGIC_CMD"
+  ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  AC_MSG_RESULT($MAGIC_CMD)
+else
+  AC_MSG_RESULT(no)
+fi
+])
+
+
+# AC_PATH_MAGIC - find a file program which can recognise a shared library
+AC_DEFUN([AC_PATH_MAGIC],
+[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
+AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
+  else
+    MAGIC_CMD=:
+  fi
+fi
+])
+
+
+# AC_PROG_LD - find the path to the GNU or non-GNU linker
+AC_DEFUN([AC_PROG_LD],
+[AC_ARG_WITH(gnu-ld,
+[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
+test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  AC_MSG_CHECKING([for ld used by GCC])
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [[\\/]]* | [[A-Za-z]]:[[\\/]]*)
+      re_direlt='/[[^/]][[^/]]*/\.\./'
+      # Canonicalize the path of ld
+      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  AC_MSG_CHECKING([for GNU ld])
+else
+  AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some GNU ld's only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+	test "$with_gnu_ld" != no && break
+      else
+	test "$with_gnu_ld" != yes && break
+      fi
+    fi
+  done
+  IFS="$ac_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  AC_MSG_RESULT($LD)
+else
+  AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_PROG_LD_GNU
+])
+
+# AC_PROG_LD_GNU -
+AC_DEFUN([AC_PROG_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+  lt_cv_prog_gnu_ld=yes
+else
+  lt_cv_prog_gnu_ld=no
+fi])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])
+
+# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
+#   -- PORTME Some linkers may need a different reload flag.
+AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
+[AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
+[lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+test -n "$reload_flag" && reload_flag=" $reload_flag"
+])
+
+# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
+#  -- PORTME fill in with the dynamic library characteristics
+AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
+[AC_CACHE_CHECK([how to recognise dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given egrep regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix4* | aix5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi4*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin* | mingw* | pw32*)
+  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  case "$host_os" in
+  rhapsody* | darwin1.[[012]])
+    lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
+    ;;
+  *) # Darwin 1.3 on
+    lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
+    ;;
+  esac
+  ;;
+
+freebsd*)
+  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20*|hpux11*)
+  lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libc.sl
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+  irix5* | nonstopux*)
+    # this will be overridden with pass_all, but let us keep it just in case
+    lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
+    ;;
+  *)
+    case $LD in
+    *-32|*"-32 ") libmagic=32-bit;;
+    *-n32|*"-n32 ") libmagic=N32;;
+    *-64|*"-64 ") libmagic=64-bit;;
+    *) libmagic=never-match;;
+    esac
+    # this will be overridden with pass_all, but let us keep it just in case
+    lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
+    ;;
+  esac
+  lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be Linux ELF.
+linux*)
+  case $host_cpu in
+  alpha* | hppa* | i*86 | m68* | mips | mipsel | powerpc* | s390* | sparc* | ia64* | x86_64*)
+    lt_cv_deplibs_check_method=pass_all ;;
+  *)
+    # glibc up to 2.1.1 does not perform some relocations on ARM
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
+  esac
+  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+  ;;
+
+netbsd*)
+  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$'
+  fi
+  ;;
+
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
+
+openbsd*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
+  else
+    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  # this will be overridden with pass_all, but let us keep it just in case
+  lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sco3.2v5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  lt_cv_file_magic_test_file=/lib/libc.so
+  ;;
+
+sysv5uw[[78]]* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
+esac
+])
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+])
+
+
+# AC_PROG_NM - find the path to a BSD-compatible name lister
+AC_DEFUN([AC_PROG_NM],
+[AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
+AC_MSG_CHECKING([for BSD-compatible nm])
+AC_CACHE_VAL(lt_cv_path_NM,
+[if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+    test -z "$ac_dir" && ac_dir=.
+    tmp_nm=$ac_dir/${ac_tool_prefix}nm
+    if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
+      # Check to see if the nm accepts a BSD-compat flag.
+      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+      #   nm: unknown option "B" ignored
+      # Tru64's nm complains that /dev/null is an invalid object file
+      if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
+	lt_cv_path_NM="$tmp_nm -B"
+	break
+      elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+	lt_cv_path_NM="$tmp_nm -p"
+	break
+      else
+	lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	continue # so that we can try to find one that supports BSD flags
+      fi
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi])
+NM="$lt_cv_path_NM"
+AC_MSG_RESULT([$NM])
+])
+
+# AC_CHECK_LIBM - check for math library
+AC_DEFUN([AC_CHECK_LIBM],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cygwin* | *-*-pw32*)
+  # These system don't have libm
+  ;;
+*-ncr-sysv4.3*)
+  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+  AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
+  ;;
+*)
+  AC_CHECK_LIB(m, main, LIBM="-lm")
+  ;;
+esac
+])
+
+# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
+# the libltdl convenience library and LTDLINCL to the include flags for
+# the libltdl header and adds --enable-ltdl-convenience to the
+# configure arguments.  Note that LIBLTDL and LTDLINCL are not
+# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If DIR is not
+# provided, it is assumed to be `libltdl'.  LIBLTDL will be prefixed
+# with '${top_builddir}/' and LTDLINCL will be prefixed with
+# '${top_srcdir}/' (note the single quotes!).  If your package is not
+# flat and you're not using automake, define top_builddir and
+# top_srcdir appropriately in the Makefiles.
+AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+  case $enable_ltdl_convenience in
+  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
+  "") enable_ltdl_convenience=yes
+      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
+  esac
+  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
+  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+  # For backwards non-gettext consistent compatibility...
+  INCLTDL="$LTDLINCL"
+])
+
+# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
+# the libltdl installable library and LTDLINCL to the include flags for
+# the libltdl header and adds --enable-ltdl-install to the configure
+# arguments.  Note that LIBLTDL and LTDLINCL are not AC_SUBSTed, nor is
+# AC_CONFIG_SUBDIRS called.  If DIR is not provided and an installed
+# libltdl is not found, it is assumed to be `libltdl'.  LIBLTDL will
+# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed
+# with '${top_srcdir}/' (note the single quotes!).  If your package is
+# not flat and you're not using automake, define top_builddir and
+# top_srcdir appropriately in the Makefiles.
+# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
+AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+  AC_CHECK_LIB(ltdl, main,
+  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
+  [if test x"$enable_ltdl_install" = xno; then
+     AC_MSG_WARN([libltdl not installed, but installation disabled])
+   else
+     enable_ltdl_install=yes
+   fi
+  ])
+  if test x"$enable_ltdl_install" = x"yes"; then
+    ac_configure_args="$ac_configure_args --enable-ltdl-install"
+    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
+    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+  else
+    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
+    LIBLTDL="-lltdl"
+    LTDLINCL=
+  fi
+  # For backwards non-gettext consistent compatibility...
+  INCLTDL="$LTDLINCL"
+])
+
+# old names
+AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
+AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
+AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
+AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
+AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
+
+# This is just to silence aclocal about the macro not being used
+ifelse([AC_DISABLE_FAST_INSTALL])
+
+# NOTE: This macro has been submitted for inclusion into   #
+#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
+#  a released version of Autoconf we should remove this    #
+#  macro and use it instead.                               #
+# LT_AC_PROG_SED
+# --------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible.  Prefer GNU sed if found.
+AC_DEFUN([LT_AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_executable_p="test -f"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+        _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
+      fi
+    done
+  done
+done
+
+  # Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+: ${TMPDIR=/tmp}
+{
+  tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=$TMPDIR/sed$$-$RANDOM
+  (umask 077 && mkdir $tmp)
+} ||
+{
+   echo "$me: cannot create a temporary directory in $TMPDIR" >&2
+   { (exit 1); exit 1; }
+}
+  _max=0
+  _count=0
+  # Add /usr/xpg4/bin/sed as it is typically found on Solaris
+  # along with /bin/sed that truncates output.
+  for _sed in $_sed_list /usr/xpg4/bin/sed; do
+    test ! -f ${_sed} && break
+    cat /dev/null > "$tmp/sed.in"
+    _count=0
+    echo ${ECHO_N-$ac_n} "0123456789${ECHO_C-$ac_c}" >"$tmp/sed.in"
+    # Check for GNU sed and select it if it is found.
+    if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
+      lt_cv_path_SED=${_sed}
+      break
+    fi
+    while true; do
+      cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
+      mv "$tmp/sed.tmp" "$tmp/sed.in"
+      cp "$tmp/sed.in" "$tmp/sed.nl"
+      echo >>"$tmp/sed.nl"
+      ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
+      cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
+      # 40000 chars as input seems more than enough
+      test $_count -gt 10 && break
+      _count=`expr $_count + 1`
+      if test $_count -gt $_max; then
+        _max=$_count
+        lt_cv_path_SED=$_sed
+      fi
+    done
+  done
+  rm -rf "$tmp"
+])
+if test "X$SED" != "X"; then
+  lt_cv_path_SED=$SED
+else
+  SED=$lt_cv_path_SED
+fi
+AC_MSG_RESULT([$SED])
+])
+

Added: experimental/j/Elphel333/rtp/daemon/rtp/addrinfo.h
===================================================================
--- experimental/j/Elphel333/rtp/daemon/rtp/addrinfo.h	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/daemon/rtp/addrinfo.h	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,122 @@
+/*
+ * Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/* $Id: addrinfo.h,v 1.1.1.1 2005/03/18 09:18:47 elphel Exp $ */
+
+#ifndef HAVE_ADDRINFO
+
+/*
+ * Error return codes from getaddrinfo()
+ */
+#define	EAI_ADDRFAMILY	 1	/* address family for hostname not supported */
+#define	EAI_AGAIN	 2	/* temporary failure in name resolution */
+#define	EAI_BADFLAGS	 3	/* invalid value for ai_flags */
+#define	EAI_FAIL	 4	/* non-recoverable failure in name resolution */
+#define	EAI_FAMILY	 5	/* ai_family not supported */
+#define	EAI_MEMORY	 6	/* memory allocation failure */
+#define	EAI_NODATA	 7	/* no address associated with hostname */
+#define	EAI_NONAME	 8	/* hostname nor servname provided, or not known */
+#define	EAI_SERVICE	 9	/* servname not supported for ai_socktype */
+#define	EAI_SOCKTYPE	10	/* ai_socktype not supported */
+#define	EAI_SYSTEM	11	/* system error returned in errno */
+#define EAI_BADHINTS	12
+#define EAI_PROTOCOL	13
+#define EAI_MAX		14
+
+/* internal error */
+#define	NETDB_INTERNAL	-1	/* see errno */
+
+/*
+ * Flag values for getaddrinfo()
+ */
+#define	AI_PASSIVE	0x00000001 /* get address to use bind() */
+#define	AI_CANONNAME	0x00000002 /* fill ai_canonname */
+#define	AI_NUMERICHOST	0x00000004 /* prevent name resolution */
+/* valid flags for addrinfo */
+#define	AI_MASK		(AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST)
+
+#define	AI_ALL		0x00000100 /* IPv6 and IPv4-mapped (with AI_V4MAPPED) */
+#define	AI_V4MAPPED_CFG	0x00000200 /* accept IPv4-mapped if kernel supports */
+#define	AI_ADDRCONFIG	0x00000400 /* only if any address is assigned */
+#define	AI_V4MAPPED	0x00000800 /* accept IPv4-mapped IPv6 address */
+/* special recommended flags for getipnodebyname */
+#define	AI_DEFAULT	(AI_V4MAPPED_CFG | AI_ADDRCONFIG)
+
+struct addrinfo {
+	int	ai_flags;	/* AI_PASSIVE, AI_CANONNAME */
+	int	ai_family;	/* PF_xxx */
+	int	ai_socktype;	/* SOCK_xxx */
+	int	ai_protocol;	/* 0 or IPPROTO_xxx for IPv4 and IPv6 */
+	size_t	ai_addrlen;	/* length of ai_addr */
+	char	*ai_canonname;	/* canonical name for hostname */
+	struct sockaddr *ai_addr;	/* binary address */
+	struct addrinfo *ai_next;	/* next structure in linked list */
+};
+
+extern void freeaddrinfo __P((struct addrinfo *));
+extern void freehostent __P((struct hostent *));
+extern char *gai_strerror __P((int));
+extern int getaddrinfo __P((const char *, const char *,
+			    const struct addrinfo *, struct addrinfo **));
+extern int getnameinfo __P((const struct sockaddr *, size_t, char *,
+			    size_t, char *, size_t, int));
+extern struct hostent *getipnodebyaddr __P((const void *, size_t, int, int *));
+extern struct hostent *getipnodebyname __P((const char *, int, int, int *));
+extern int inet_pton __P((int, const char *, void *));
+extern const char *inet_ntop __P((int, const void *, char *, size_t));
+#endif /* HAVE_ADDRINFO */
+
+/*
+ * Constants for getnameinfo()
+ */
+#ifndef NI_MAXHOST
+#define	NI_MAXHOST	1025
+#endif
+#ifndef NI_MAXSERV
+#define	NI_MAXSERV	32
+#endif
+
+/*
+ * Flag values for getnameinfo()
+ */
+#ifndef NI_NOFQDN
+#define	NI_NOFQDN	0x00000001
+#endif
+#ifndef NI_NUMERICHOST
+#define	NI_NUMERICHOST	0x00000002
+#endif
+#ifndef NI_NAMEREQD
+#define	NI_NAMEREQD	0x00000004
+#endif
+#ifndef NI_NUMERICSERV
+#define	NI_NUMERICSERV	0x00000008
+#endif
+#ifndef NI_DGRAM
+#define	NI_DGRAM	0x00000010
+#endif

Added: experimental/j/Elphel333/rtp/daemon/rtp/addrsize.h
===================================================================
--- experimental/j/Elphel333/rtp/daemon/rtp/addrsize.h	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/daemon/rtp/addrsize.h	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 1999 WIDE Project.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+#ifndef INADDRSZ 
+#define INADDRSZ 4		/* IPv4 T_A */
+#endif
+
+#ifndef IN6ADDRSZ
+#define IN6ADDRSZ	16	/* IPv6 T_AAAA */
+#endif 
+

Added: experimental/j/Elphel333/rtp/daemon/rtp/asarray.c
===================================================================
--- experimental/j/Elphel333/rtp/daemon/rtp/asarray.c	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/daemon/rtp/asarray.c	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,172 @@
+/*
+ * FILE:    asarray.c
+ *
+ * AUTHORS: Orion Hodson
+ *
+ * Copyright (c) 1999-2000 University College London
+ * All rights reserved.
+ */
+ 
+#include "config_unix.h"
+#include "config_win32.h"
+
+#include "debug.h"
+#include "memory.h"
+#include "util.h"
+
+#include "asarray.h"
+
+typedef struct s_hash_tuple {
+        uint32_t hash;
+        char *key;
+        char *value;
+        struct s_hash_tuple *next;
+} hash_tuple;
+
+#define ASARRAY_SIZE 11
+
+struct _asarray {
+        hash_tuple *table[ASARRAY_SIZE];
+        int32_t     nitems[ASARRAY_SIZE];
+};
+
+static uint32_t 
+asarray_hash(const char *key)
+{
+        uint32_t hash = 0;
+
+        while(*key != '\0') {
+                hash = hash * 31;
+                hash += ((uint32_t)*key) + 1;
+                key++;
+        }
+
+        return hash;
+}
+
+int32_t
+asarray_add(asarray *pa, const char *key, const char *value)
+{
+        hash_tuple *t;
+        int row;
+
+        t = (hash_tuple*)xmalloc(sizeof(hash_tuple));
+        if (t) {
+                /* transfer values */
+                t->hash  = asarray_hash(key);
+                t->key   = xstrdup(key);
+                t->value = xstrdup(value);
+                /* Add to table */
+                row            = t->hash % ASARRAY_SIZE;
+                t->next        = pa->table[row];
+                pa->table[row] = t;
+                pa->nitems[row]++;
+                return TRUE;
+        }
+        return FALSE;
+}
+
+void
+asarray_remove(asarray *pa, const char *key)
+{
+        hash_tuple **t, *e;
+        uint32_t hash;
+        int row;
+
+        hash = asarray_hash(key);
+        row  = hash % ASARRAY_SIZE;
+        t    = &pa->table[row];
+        while((*t) != NULL) {
+                if ((hash == (*t)->hash) && 
+                    (strcmp(key, (*t)->key) == 0)) {
+                        e = *t;
+                        *t = e->next;
+                        xfree(e->key);
+                        xfree(e->value);
+                        xfree(e);
+                        pa->nitems[row]--;
+                        ASSERT(pa->nitems[row] >= 0);
+                        break;
+                } else {
+                        t = &(*t)->next;
+                }
+        }
+}
+
+const char* 
+asarray_get_key_no(asarray *pa, int32_t index)
+{
+        int32_t row = 0;
+
+        index += 1;
+        while (row < ASARRAY_SIZE && index > pa->nitems[row]) {
+                index -= pa->nitems[row];
+                row++;
+        }
+
+        if (row < ASARRAY_SIZE) {
+                hash_tuple *t;
+                t = pa->table[row];
+                while(--index > 0) {
+                        ASSERT(t->next != NULL);
+                        t = t->next;
+                }
+                return t->key;
+        }
+        return NULL;
+}
+
+/* asarray_lookup points value at actual value        */
+/* and return TRUE if key found.                      */
+int32_t
+asarray_lookup(asarray *pa, const char *key, char **value)
+{
+        hash_tuple *t;
+        int          row;
+        uint32_t     hash;
+
+        hash = asarray_hash(key);
+        row  = hash % ASARRAY_SIZE;
+
+        t = pa->table[row];
+        while(t != NULL) {
+                if (t->hash == hash && strcmp(key, t->key) == 0) {
+                        *value = t->value;
+                        return TRUE;
+                }
+                t = t->next;
+        }
+        *value = NULL;
+        return FALSE;
+}
+
+int32_t
+asarray_create(asarray **ppa)
+{
+        asarray *pa;
+        pa = (asarray*)xmalloc(sizeof(asarray));
+        if (pa != NULL) {
+                memset(pa, 0, sizeof(asarray));
+                *ppa = pa;
+                return TRUE;
+        }
+        return FALSE;
+}
+
+void
+asarray_destroy(asarray **ppa)
+{
+        asarray    *pa;
+        const char *key;
+
+        pa = *ppa;
+        ASSERT(pa != NULL);
+
+        while ((key = asarray_get_key_no(pa, 0)) != NULL) {
+                asarray_remove(pa, key);
+        }
+
+        xfree(pa);
+        *ppa = NULL;
+        xmemchk();
+}

Added: experimental/j/Elphel333/rtp/daemon/rtp/asarray.h
===================================================================
--- experimental/j/Elphel333/rtp/daemon/rtp/asarray.h	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/daemon/rtp/asarray.h	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,48 @@
+/*
+ * FILE:    asarray.h
+ * AUTHORS: Orion Hodson 
+ *
+ * Associative array for strings.  Perloined from RAT settings code.
+ *
+ * Copyright (c) 1999-2000 University College London
+ * All rights reserved.
+ *
+ * $Id: asarray.h,v 1.1.1.1 2005/03/18 09:19:02 elphel Exp $
+ */
+
+#ifndef __AS_ARRAY_H
+#define __AS_ARRAY_H
+
+typedef struct _asarray asarray;
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+/* Associative array for strings only.  Makes own internal copies of
+ * keys and values.
+ *
+ * Functions that return use TRUE for success and FALSE for failure.
+ * Double pointers in arguments are filled in by the function being 
+ * called.
+ */
+
+int32_t     asarray_create  (asarray **ppa);
+void        asarray_destroy (asarray **ppa);
+
+int32_t     asarray_add    (asarray *pa, const char *key, const char *value);
+void        asarray_remove (asarray *pa, const char *key);
+int32_t     asarray_lookup (asarray *pa, const char *key, char **value);
+
+/* asarray_get_key - gets key corresponding to index'th entry in
+ * internal representation, has not relation to order <key,value>
+ * tuples added in.  This function exists to provide easy way to drain
+ * array one item at a time. 
+ */
+const char* asarray_get_key_no(asarray *pa, int32_t index);
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /* __AS_ARRAY_H */

Added: experimental/j/Elphel333/rtp/daemon/rtp/autogen.sh
===================================================================
--- experimental/j/Elphel333/rtp/daemon/rtp/autogen.sh	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/daemon/rtp/autogen.sh	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,17 @@
+#!/bin/sh
+#
+echo "Generating build information using aclocal, automake and autoconf"
+echo "This may take a while ..."
+
+# Touch the timestamps on all the files since CVS messes them up
+directory=`dirname $0`
+touch $directory/configure.in
+
+# Regenerate configuration files
+aclocal
+automake --foreign --include-deps --add-missing --copy
+autoconf
+
+# Run configure for this platform
+#./configure $*
+echo "Now you are ready to run ./configure"


Property changes on: experimental/j/Elphel333/rtp/daemon/rtp/autogen.sh
___________________________________________________________________
Name: svn:executable
   + 

Added: experimental/j/Elphel333/rtp/daemon/rtp/base64.c
===================================================================
--- experimental/j/Elphel333/rtp/daemon/rtp/base64.c	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/daemon/rtp/base64.c	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,134 @@
+/*
+ * FILE:   base64.c
+ * AUTHOR: Colin Perkins
+ *
+ * MIME base64 encoder/decoder described in rfc1521. This code is derived
+ * from version 2.7 of the Bellcore metamail package.
+ *
+ * Copyright (c) 1998-2000 University College London
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, is permitted provided that the following conditions 
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *      This product includes software developed by the Computer Science
+ *      Department at University College London
+ * 4. Neither the name of the University nor of the Department may be used
+ *    to endorse or promote products derived from this software without
+ *    specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * Copyright (c) 1991 Bell Communications Research, Inc. (Bellcore)
+ * 
+ * Permission to use, copy, modify, and distribute this material 
+ * for any purpose and without fee is hereby granted, provided 
+ * that the above copyright notice and this permission notice 
+ * appear in all copies, and that the name of Bellcore not be 
+ * used in advertising or publicity pertaining to this 
+ * material without the specific, prior written permission 
+ * of an authorized representative of Bellcore.  BELLCORE 
+ * MAKES NO REPRESENTATIONS ABOUT THE ACCURACY OR SUITABILITY 
+ * OF THIS MATERIAL FOR ANY PURPOSE.  IT IS PROVIDED "AS IS", 
+ * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
+ * 
+ */
+
+#include "config_unix.h"
+#include "config_win32.h"
+#include "debug.h"
+#include "base64.h"
+
+static unsigned char basis_64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+
+int base64encode(const unsigned char *input, int input_length, unsigned char *output, int output_length)
+{
+	int	i = 0, j = 0;
+	int	pad;
+
+	ASSERT(output_length >= (input_length * 4 / 3));
+
+	while (i < input_length) {
+		pad = 3 - (input_length - i);
+		if (pad == 2) {
+			output[j  ] = basis_64[input[i]>>2];
+			output[j+1] = basis_64[(input[i] & 0x03) << 4];
+			output[j+2] = '=';
+			output[j+3] = '=';
+		} else if (pad == 1) {
+			output[j  ] = basis_64[input[i]>>2];
+			output[j+1] = basis_64[((input[i] & 0x03) << 4) | ((input[i+1] & 0xf0) >> 4)];
+			output[j+2] = basis_64[(input[i+1] & 0x0f) << 2];
+			output[j+3] = '=';
+		} else{
+			output[j  ] = basis_64[input[i]>>2];
+			output[j+1] = basis_64[((input[i] & 0x03) << 4) | ((input[i+1] & 0xf0) >> 4)];
+			output[j+2] = basis_64[((input[i+1] & 0x0f) << 2) | ((input[i+2] & 0xc0) >> 6)];
+			output[j+3] = basis_64[input[i+2] & 0x3f];
+		}
+		i += 3;
+		j += 4;
+	}
+	return j;
+}
+
+/* This assumes that an unsigned char is exactly 8 bits. Not portable code! :-) */
+static unsigned char index_64[128] = {
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,   62, 0xff, 0xff, 0xff,   63,
+      52,   53,   54,   55,   56,   57,   58,   59,   60,   61, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff,    0,    1,    2,    3,    4,    5,    6,    7,    8,    9,   10,   11,   12,   13,   14,
+      15,   16,   17,   18,   19,   20,   21,   22,   23,   24,   25, 0xff, 0xff, 0xff, 0xff, 0xff,
+    0xff,   26,   27,   28,   29,   30,   31,   32,   33,   34,   35,   36,   37,   38,   39,   40,
+      41,   42,   43,   44,   45,   46,   47,   48,   49,   50,   51, 0xff, 0xff, 0xff, 0xff, 0xff
+};
+
+#define char64(c)  ((c > 127) ? 0xff : index_64[(c)])
+
+int base64decode(const unsigned char *input, int input_length, unsigned char *output, int output_length)
+{
+	int		i = 0, j = 0, pad;
+	unsigned char	c[4];
+
+	ASSERT(output_length >= (input_length * 3 / 4));
+	ASSERT((input_length % 4) == 0);
+	while ((i + 3) < input_length) {
+		pad  = 0;
+		c[0] = char64(input[i  ]); pad += (c[0] == 0xff);
+		c[1] = char64(input[i+1]); pad += (c[1] == 0xff);
+		c[2] = char64(input[i+2]); pad += (c[2] == 0xff);
+		c[3] = char64(input[i+3]); pad += (c[3] == 0xff);
+		if (pad == 2) {
+			output[j++] = (c[0] << 2) | ((c[1] & 0x30) >> 4);
+			output[j]   = (c[1] & 0x0f) << 4;
+		} else if (pad == 1) {
+			output[j++] = (c[0] << 2) | ((c[1] & 0x30) >> 4);
+			output[j++] = ((c[1] & 0x0f) << 4) | ((c[2] & 0x3c) >> 2);
+			output[j]   = (c[2] & 0x03) << 6;
+		} else {
+			output[j++] = (c[0] << 2) | ((c[1] & 0x30) >> 4);
+			output[j++] = ((c[1] & 0x0f) << 4) | ((c[2] & 0x3c) >> 2);
+			output[j++] = ((c[2] & 0x03) << 6) | (c[3] & 0x3f);
+		}
+		i += 4;
+	}
+	return j;
+}
+

Added: experimental/j/Elphel333/rtp/daemon/rtp/base64.h
===================================================================
--- experimental/j/Elphel333/rtp/daemon/rtp/base64.h	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/daemon/rtp/base64.h	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,38 @@
+/*
+ * FILE:    base64.h
+ * AUTHORS: Colin Perkins
+ * 
+ * Copyright (c) 1998-2000 University College London
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, is permitted provided that the following conditions 
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *      This product includes software developed by the Computer Science
+ *      Department at University College London
+ * 4. Neither the name of the University nor of the Department may be used
+ *    to endorse or promote products derived from this software without
+ *    specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+int base64encode(const unsigned char *input, int input_length, unsigned char *output, int output_length);
+int base64decode(const unsigned char *input, int input_length, unsigned char *output, int output_length);
+

Added: experimental/j/Elphel333/rtp/daemon/rtp/bills_srtp.h
===================================================================
--- experimental/j/Elphel333/rtp/daemon/rtp/bills_srtp.h	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/daemon/rtp/bills_srtp.h	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,10 @@
+typedef struct bills_srtp_t {
+  srtp_ctx_t sender_srtp_ctx;
+  srtp_ctx_t receiver_srtp_ctx;
+} bills_srtp_t;
+
+bills_srtp_t *srtp_init(unsigned int our_ssrc,
+			unsigned int their_ssrc,
+			unsigned char *input_key,
+			int do_encrypt,
+			int do_auth);

Added: experimental/j/Elphel333/rtp/daemon/rtp/bittypes.h
===================================================================
--- experimental/j/Elphel333/rtp/daemon/rtp/bittypes.h	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/daemon/rtp/bittypes.h	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 1999 WIDE Project.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+#ifndef HAVE_U_INT8_T
+
+#if SIZEOF_CHAR == 1
+typedef unsigned char u_int8_t;
+#elif SIZEOF_INT == 1
+typedef unsigned int u_int8_t;
+#else  /* XXX */
+#error "there's no appropriate type for u_int8_t"
+#endif
+
+#endif /* HAVE_U_INT8_T */
+
+#ifndef HAVE_U_INT16_T 
+
+#if SIZEOF_SHORT == 2
+typedef unsigned short u_int16_t;
+#elif SIZEOF_INT == 2
+typedef unsigned int u_int16_t;
+#elif SIZEOF_CHAR == 2
+typedef unsigned char u_int16_t;
+#else  /* XXX */
+#error "there's no appropriate type for u_int16_t"
+#endif
+
+#endif /* HAVE_U_INT16_T */
+
+#ifndef HAVE_U_INT32_T
+
+#if SIZEOF_INT == 4
+typedef unsigned int u_int32_t;
+#elif SIZEOF_LONG == 4
+typedef unsigned long u_int32_t;
+#elif SIZEOF_SHORT == 4
+typedef unsigned short u_int32_t;
+#else  /* XXX */
+#error "there's no appropriate type for u_int32_t"
+#endif
+
+#endif /* HAVE_U_INT32_T */

Added: experimental/j/Elphel333/rtp/daemon/rtp/boxes-fst.dat
===================================================================
--- experimental/j/Elphel333/rtp/daemon/rtp/boxes-fst.dat	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/daemon/rtp/boxes-fst.dat	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,914 @@
+static word8 S[256] = {
+ 99, 124, 119, 123, 242, 107, 111, 197,  48,   1, 103,  43, 254, 215, 171, 118, 
+202, 130, 201, 125, 250,  89,  71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 
+183, 253, 147,  38,  54,  63, 247, 204,  52, 165, 229, 241, 113, 216,  49,  21, 
+  4, 199,  35, 195,  24, 150,   5, 154,   7,  18, 128, 226, 235,  39, 178, 117, 
+  9, 131,  44,  26,  27, 110,  90, 160,  82,  59, 214, 179,  41, 227,  47, 132, 
+ 83, 209,   0, 237,  32, 252, 177,  91, 106, 203, 190,  57,  74,  76,  88, 207, 
+208, 239, 170, 251,  67,  77,  51, 133,  69, 249,   2, 127,  80,  60, 159, 168, 
+ 81, 163,  64, 143, 146, 157,  56, 245, 188, 182, 218,  33,  16, 255, 243, 210, 
+205,  12,  19, 236,  95, 151,  68,  23, 196, 167, 126,  61, 100,  93,  25, 115, 
+ 96, 129,  79, 220,  34,  42, 144, 136,  70, 238, 184,  20, 222,  94,  11, 219, 
+224,  50,  58,  10,  73,   6,  36,  92, 194, 211, 172,  98, 145, 149, 228, 121, 
+231, 200,  55, 109, 141, 213,  78, 169, 108,  86, 244, 234, 101, 122, 174,   8, 
+186, 120,  37,  46,  28, 166, 180, 198, 232, 221, 116,  31,  75, 189, 139, 138, 
+112,  62, 181, 102,  72,   3, 246,  14,  97,  53,  87, 185, 134, 193,  29, 158, 
+225, 248, 152,  17, 105, 217, 142, 148, 155,  30, 135, 233, 206,  85,  40, 223, 
+140, 161, 137,  13, 191, 230,  66, 104,  65, 153,  45,  15, 176,  84, 187,  22
+};
+
+#ifdef INTERMEDIATE_VALUE_KAT
+static word8 Si[256] = {
+ 82,   9, 106, 213,  48,  54, 165,  56, 191,  64, 163, 158, 129, 243, 215, 251, 
+124, 227,  57, 130, 155,  47, 255, 135,  52, 142,  67,  68, 196, 222, 233, 203, 
+ 84, 123, 148,  50, 166, 194,  35,  61, 238,  76, 149,  11,  66, 250, 195,  78, 
+  8,  46, 161, 102,  40, 217,  36, 178, 118,  91, 162,  73, 109, 139, 209,  37, 
+114, 248, 246, 100, 134, 104, 152,  22, 212, 164,  92, 204,  93, 101, 182, 146, 
+108, 112,  72,  80, 253, 237, 185, 218,  94,  21,  70,  87, 167, 141, 157, 132, 
+144, 216, 171,   0, 140, 188, 211,  10, 247, 228,  88,   5, 184, 179,  69,   6, 
+208,  44,  30, 143, 202,  63,  15,   2, 193, 175, 189,   3,   1,  19, 138, 107, 
+ 58, 145,  17,  65,  79, 103, 220, 234, 151, 242, 207, 206, 240, 180, 230, 115, 
+150, 172, 116,  34, 231, 173,  53, 133, 226, 249,  55, 232,  28, 117, 223, 110, 
+ 71, 241,  26, 113,  29,  41, 197, 137, 111, 183,  98,  14, 170,  24, 190,  27, 
+252,  86,  62,  75, 198, 210, 121,  32, 154, 219, 192, 254, 120, 205,  90, 244, 
+ 31, 221, 168,  51, 136,   7, 199,  49, 177,  18,  16,  89,  39, 128, 236,  95, 
+ 96,  81, 127, 169,  25, 181,  74,  13,  45, 229, 122, 159, 147, 201, 156, 239, 
+160, 224,  59,  77, 174,  42, 245, 176, 200, 235, 187,  60, 131,  83, 153,  97, 
+ 23,  43,   4, 126, 186, 119, 214,  38, 225, 105,  20,  99,  85,  33,  12, 125
+};
+#endif /* INTERMEDIATE_VALUE_KAT */
+
+static word8 T1[256][4] = {
+{0xc6,0x63,0x63,0xa5}, {0xf8,0x7c,0x7c,0x84}, {0xee,0x77,0x77,0x99}, {0xf6,0x7b,0x7b,0x8d}, 
+{0xff,0xf2,0xf2,0x0d}, {0xd6,0x6b,0x6b,0xbd}, {0xde,0x6f,0x6f,0xb1}, {0x91,0xc5,0xc5,0x54}, 
+{0x60,0x30,0x30,0x50}, {0x02,0x01,0x01,0x03}, {0xce,0x67,0x67,0xa9}, {0x56,0x2b,0x2b,0x7d}, 
+{0xe7,0xfe,0xfe,0x19}, {0xb5,0xd7,0xd7,0x62}, {0x4d,0xab,0xab,0xe6}, {0xec,0x76,0x76,0x9a}, 
+{0x8f,0xca,0xca,0x45}, {0x1f,0x82,0x82,0x9d}, {0x89,0xc9,0xc9,0x40}, {0xfa,0x7d,0x7d,0x87}, 
+{0xef,0xfa,0xfa,0x15}, {0xb2,0x59,0x59,0xeb}, {0x8e,0x47,0x47,0xc9}, {0xfb,0xf0,0xf0,0x0b}, 
+{0x41,0xad,0xad,0xec}, {0xb3,0xd4,0xd4,0x67}, {0x5f,0xa2,0xa2,0xfd}, {0x45,0xaf,0xaf,0xea}, 
+{0x23,0x9c,0x9c,0xbf}, {0x53,0xa4,0xa4,0xf7}, {0xe4,0x72,0x72,0x96}, {0x9b,0xc0,0xc0,0x5b}, 
+{0x75,0xb7,0xb7,0xc2}, {0xe1,0xfd,0xfd,0x1c}, {0x3d,0x93,0x93,0xae}, {0x4c,0x26,0x26,0x6a}, 
+{0x6c,0x36,0x36,0x5a}, {0x7e,0x3f,0x3f,0x41}, {0xf5,0xf7,0xf7,0x02}, {0x83,0xcc,0xcc,0x4f}, 
+{0x68,0x34,0x34,0x5c}, {0x51,0xa5,0xa5,0xf4}, {0xd1,0xe5,0xe5,0x34}, {0xf9,0xf1,0xf1,0x08}, 
+{0xe2,0x71,0x71,0x93}, {0xab,0xd8,0xd8,0x73}, {0x62,0x31,0x31,0x53}, {0x2a,0x15,0x15,0x3f}, 
+{0x08,0x04,0x04,0x0c}, {0x95,0xc7,0xc7,0x52}, {0x46,0x23,0x23,0x65}, {0x9d,0xc3,0xc3,0x5e}, 
+{0x30,0x18,0x18,0x28}, {0x37,0x96,0x96,0xa1}, {0x0a,0x05,0x05,0x0f}, {0x2f,0x9a,0x9a,0xb5}, 
+{0x0e,0x07,0x07,0x09}, {0x24,0x12,0x12,0x36}, {0x1b,0x80,0x80,0x9b}, {0xdf,0xe2,0xe2,0x3d}, 
+{0xcd,0xeb,0xeb,0x26}, {0x4e,0x27,0x27,0x69}, {0x7f,0xb2,0xb2,0xcd}, {0xea,0x75,0x75,0x9f}, 
+{0x12,0x09,0x09,0x1b}, {0x1d,0x83,0x83,0x9e}, {0x58,0x2c,0x2c,0x74}, {0x34,0x1a,0x1a,0x2e}, 
+{0x36,0x1b,0x1b,0x2d}, {0xdc,0x6e,0x6e,0xb2}, {0xb4,0x5a,0x5a,0xee}, {0x5b,0xa0,0xa0,0xfb}, 
+{0xa4,0x52,0x52,0xf6}, {0x76,0x3b,0x3b,0x4d}, {0xb7,0xd6,0xd6,0x61}, {0x7d,0xb3,0xb3,0xce}, 
+{0x52,0x29,0x29,0x7b}, {0xdd,0xe3,0xe3,0x3e}, {0x5e,0x2f,0x2f,0x71}, {0x13,0x84,0x84,0x97}, 
+{0xa6,0x53,0x53,0xf5}, {0xb9,0xd1,0xd1,0x68}, {0x00,0x00,0x00,0x00}, {0xc1,0xed,0xed,0x2c}, 
+{0x40,0x20,0x20,0x60}, {0xe3,0xfc,0xfc,0x1f}, {0x79,0xb1,0xb1,0xc8}, {0xb6,0x5b,0x5b,0xed}, 
+{0xd4,0x6a,0x6a,0xbe}, {0x8d,0xcb,0xcb,0x46}, {0x67,0xbe,0xbe,0xd9}, {0x72,0x39,0x39,0x4b}, 
+{0x94,0x4a,0x4a,0xde}, {0x98,0x4c,0x4c,0xd4}, {0xb0,0x58,0x58,0xe8}, {0x85,0xcf,0xcf,0x4a}, 
+{0xbb,0xd0,0xd0,0x6b}, {0xc5,0xef,0xef,0x2a}, {0x4f,0xaa,0xaa,0xe5}, {0xed,0xfb,0xfb,0x16}, 
+{0x86,0x43,0x43,0xc5}, {0x9a,0x4d,0x4d,0xd7}, {0x66,0x33,0x33,0x55}, {0x11,0x85,0x85,0x94}, 
+{0x8a,0x45,0x45,0xcf}, {0xe9,0xf9,0xf9,0x10}, {0x04,0x02,0x02,0x06}, {0xfe,0x7f,0x7f,0x81}, 
+{0xa0,0x50,0x50,0xf0}, {0x78,0x3c,0x3c,0x44}, {0x25,0x9f,0x9f,0xba}, {0x4b,0xa8,0xa8,0xe3}, 
+{0xa2,0x51,0x51,0xf3}, {0x5d,0xa3,0xa3,0xfe}, {0x80,0x40,0x40,0xc0}, {0x05,0x8f,0x8f,0x8a}, 
+{0x3f,0x92,0x92,0xad}, {0x21,0x9d,0x9d,0xbc}, {0x70,0x38,0x38,0x48}, {0xf1,0xf5,0xf5,0x04}, 
+{0x63,0xbc,0xbc,0xdf}, {0x77,0xb6,0xb6,0xc1}, {0xaf,0xda,0xda,0x75}, {0x42,0x21,0x21,0x63}, 
+{0x20,0x10,0x10,0x30}, {0xe5,0xff,0xff,0x1a}, {0xfd,0xf3,0xf3,0x0e}, {0xbf,0xd2,0xd2,0x6d}, 
+{0x81,0xcd,0xcd,0x4c}, {0x18,0x0c,0x0c,0x14}, {0x26,0x13,0x13,0x35}, {0xc3,0xec,0xec,0x2f}, 
+{0xbe,0x5f,0x5f,0xe1}, {0x35,0x97,0x97,0xa2}, {0x88,0x44,0x44,0xcc}, {0x2e,0x17,0x17,0x39}, 
+{0x93,0xc4,0xc4,0x57}, {0x55,0xa7,0xa7,0xf2}, {0xfc,0x7e,0x7e,0x82}, {0x7a,0x3d,0x3d,0x47}, 
+{0xc8,0x64,0x64,0xac}, {0xba,0x5d,0x5d,0xe7}, {0x32,0x19,0x19,0x2b}, {0xe6,0x73,0x73,0x95}, 
+{0xc0,0x60,0x60,0xa0}, {0x19,0x81,0x81,0x98}, {0x9e,0x4f,0x4f,0xd1}, {0xa3,0xdc,0xdc,0x7f}, 
+{0x44,0x22,0x22,0x66}, {0x54,0x2a,0x2a,0x7e}, {0x3b,0x90,0x90,0xab}, {0x0b,0x88,0x88,0x83}, 
+{0x8c,0x46,0x46,0xca}, {0xc7,0xee,0xee,0x29}, {0x6b,0xb8,0xb8,0xd3}, {0x28,0x14,0x14,0x3c}, 
+{0xa7,0xde,0xde,0x79}, {0xbc,0x5e,0x5e,0xe2}, {0x16,0x0b,0x0b,0x1d}, {0xad,0xdb,0xdb,0x76}, 
+{0xdb,0xe0,0xe0,0x3b}, {0x64,0x32,0x32,0x56}, {0x74,0x3a,0x3a,0x4e}, {0x14,0x0a,0x0a,0x1e}, 
+{0x92,0x49,0x49,0xdb}, {0x0c,0x06,0x06,0x0a}, {0x48,0x24,0x24,0x6c}, {0xb8,0x5c,0x5c,0xe4}, 
+{0x9f,0xc2,0xc2,0x5d}, {0xbd,0xd3,0xd3,0x6e}, {0x43,0xac,0xac,0xef}, {0xc4,0x62,0x62,0xa6}, 
+{0x39,0x91,0x91,0xa8}, {0x31,0x95,0x95,0xa4}, {0xd3,0xe4,0xe4,0x37}, {0xf2,0x79,0x79,0x8b}, 
+{0xd5,0xe7,0xe7,0x32}, {0x8b,0xc8,0xc8,0x43}, {0x6e,0x37,0x37,0x59}, {0xda,0x6d,0x6d,0xb7}, 
+{0x01,0x8d,0x8d,0x8c}, {0xb1,0xd5,0xd5,0x64}, {0x9c,0x4e,0x4e,0xd2}, {0x49,0xa9,0xa9,0xe0}, 
+{0xd8,0x6c,0x6c,0xb4}, {0xac,0x56,0x56,0xfa}, {0xf3,0xf4,0xf4,0x07}, {0xcf,0xea,0xea,0x25}, 
+{0xca,0x65,0x65,0xaf}, {0xf4,0x7a,0x7a,0x8e}, {0x47,0xae,0xae,0xe9}, {0x10,0x08,0x08,0x18}, 
+{0x6f,0xba,0xba,0xd5}, {0xf0,0x78,0x78,0x88}, {0x4a,0x25,0x25,0x6f}, {0x5c,0x2e,0x2e,0x72}, 
+{0x38,0x1c,0x1c,0x24}, {0x57,0xa6,0xa6,0xf1}, {0x73,0xb4,0xb4,0xc7}, {0x97,0xc6,0xc6,0x51}, 
+{0xcb,0xe8,0xe8,0x23}, {0xa1,0xdd,0xdd,0x7c}, {0xe8,0x74,0x74,0x9c}, {0x3e,0x1f,0x1f,0x21}, 
+{0x96,0x4b,0x4b,0xdd}, {0x61,0xbd,0xbd,0xdc}, {0x0d,0x8b,0x8b,0x86}, {0x0f,0x8a,0x8a,0x85}, 
+{0xe0,0x70,0x70,0x90}, {0x7c,0x3e,0x3e,0x42}, {0x71,0xb5,0xb5,0xc4}, {0xcc,0x66,0x66,0xaa}, 
+{0x90,0x48,0x48,0xd8}, {0x06,0x03,0x03,0x05}, {0xf7,0xf6,0xf6,0x01}, {0x1c,0x0e,0x0e,0x12}, 
+{0xc2,0x61,0x61,0xa3}, {0x6a,0x35,0x35,0x5f}, {0xae,0x57,0x57,0xf9}, {0x69,0xb9,0xb9,0xd0}, 
+{0x17,0x86,0x86,0x91}, {0x99,0xc1,0xc1,0x58}, {0x3a,0x1d,0x1d,0x27}, {0x27,0x9e,0x9e,0xb9}, 
+{0xd9,0xe1,0xe1,0x38}, {0xeb,0xf8,0xf8,0x13}, {0x2b,0x98,0x98,0xb3}, {0x22,0x11,0x11,0x33}, 
+{0xd2,0x69,0x69,0xbb}, {0xa9,0xd9,0xd9,0x70}, {0x07,0x8e,0x8e,0x89}, {0x33,0x94,0x94,0xa7}, 
+{0x2d,0x9b,0x9b,0xb6}, {0x3c,0x1e,0x1e,0x22}, {0x15,0x87,0x87,0x92}, {0xc9,0xe9,0xe9,0x20}, 
+{0x87,0xce,0xce,0x49}, {0xaa,0x55,0x55,0xff}, {0x50,0x28,0x28,0x78}, {0xa5,0xdf,0xdf,0x7a}, 
+{0x03,0x8c,0x8c,0x8f}, {0x59,0xa1,0xa1,0xf8}, {0x09,0x89,0x89,0x80}, {0x1a,0x0d,0x0d,0x17}, 
+{0x65,0xbf,0xbf,0xda}, {0xd7,0xe6,0xe6,0x31}, {0x84,0x42,0x42,0xc6}, {0xd0,0x68,0x68,0xb8}, 
+{0x82,0x41,0x41,0xc3}, {0x29,0x99,0x99,0xb0}, {0x5a,0x2d,0x2d,0x77}, {0x1e,0x0f,0x0f,0x11}, 
+{0x7b,0xb0,0xb0,0xcb}, {0xa8,0x54,0x54,0xfc}, {0x6d,0xbb,0xbb,0xd6}, {0x2c,0x16,0x16,0x3a}
+};
+
+static word8 T2[256][4] = {
+{0xa5,0xc6,0x63,0x63}, {0x84,0xf8,0x7c,0x7c}, {0x99,0xee,0x77,0x77}, {0x8d,0xf6,0x7b,0x7b}, 
+{0x0d,0xff,0xf2,0xf2}, {0xbd,0xd6,0x6b,0x6b}, {0xb1,0xde,0x6f,0x6f}, {0x54,0x91,0xc5,0xc5}, 
+{0x50,0x60,0x30,0x30}, {0x03,0x02,0x01,0x01}, {0xa9,0xce,0x67,0x67}, {0x7d,0x56,0x2b,0x2b}, 
+{0x19,0xe7,0xfe,0xfe}, {0x62,0xb5,0xd7,0xd7}, {0xe6,0x4d,0xab,0xab}, {0x9a,0xec,0x76,0x76}, 
+{0x45,0x8f,0xca,0xca}, {0x9d,0x1f,0x82,0x82}, {0x40,0x89,0xc9,0xc9}, {0x87,0xfa,0x7d,0x7d}, 
+{0x15,0xef,0xfa,0xfa}, {0xeb,0xb2,0x59,0x59}, {0xc9,0x8e,0x47,0x47}, {0x0b,0xfb,0xf0,0xf0}, 
+{0xec,0x41,0xad,0xad}, {0x67,0xb3,0xd4,0xd4}, {0xfd,0x5f,0xa2,0xa2}, {0xea,0x45,0xaf,0xaf}, 
+{0xbf,0x23,0x9c,0x9c}, {0xf7,0x53,0xa4,0xa4}, {0x96,0xe4,0x72,0x72}, {0x5b,0x9b,0xc0,0xc0}, 
+{0xc2,0x75,0xb7,0xb7}, {0x1c,0xe1,0xfd,0xfd}, {0xae,0x3d,0x93,0x93}, {0x6a,0x4c,0x26,0x26}, 
+{0x5a,0x6c,0x36,0x36}, {0x41,0x7e,0x3f,0x3f}, {0x02,0xf5,0xf7,0xf7}, {0x4f,0x83,0xcc,0xcc}, 
+{0x5c,0x68,0x34,0x34}, {0xf4,0x51,0xa5,0xa5}, {0x34,0xd1,0xe5,0xe5}, {0x08,0xf9,0xf1,0xf1}, 
+{0x93,0xe2,0x71,0x71}, {0x73,0xab,0xd8,0xd8}, {0x53,0x62,0x31,0x31}, {0x3f,0x2a,0x15,0x15}, 
+{0x0c,0x08,0x04,0x04}, {0x52,0x95,0xc7,0xc7}, {0x65,0x46,0x23,0x23}, {0x5e,0x9d,0xc3,0xc3}, 
+{0x28,0x30,0x18,0x18}, {0xa1,0x37,0x96,0x96}, {0x0f,0x0a,0x05,0x05}, {0xb5,0x2f,0x9a,0x9a}, 
+{0x09,0x0e,0x07,0x07}, {0x36,0x24,0x12,0x12}, {0x9b,0x1b,0x80,0x80}, {0x3d,0xdf,0xe2,0xe2}, 
+{0x26,0xcd,0xeb,0xeb}, {0x69,0x4e,0x27,0x27}, {0xcd,0x7f,0xb2,0xb2}, {0x9f,0xea,0x75,0x75}, 
+{0x1b,0x12,0x09,0x09}, {0x9e,0x1d,0x83,0x83}, {0x74,0x58,0x2c,0x2c}, {0x2e,0x34,0x1a,0x1a}, 
+{0x2d,0x36,0x1b,0x1b}, {0xb2,0xdc,0x6e,0x6e}, {0xee,0xb4,0x5a,0x5a}, {0xfb,0x5b,0xa0,0xa0}, 
+{0xf6,0xa4,0x52,0x52}, {0x4d,0x76,0x3b,0x3b}, {0x61,0xb7,0xd6,0xd6}, {0xce,0x7d,0xb3,0xb3}, 
+{0x7b,0x52,0x29,0x29}, {0x3e,0xdd,0xe3,0xe3}, {0x71,0x5e,0x2f,0x2f}, {0x97,0x13,0x84,0x84}, 
+{0xf5,0xa6,0x53,0x53}, {0x68,0xb9,0xd1,0xd1}, {0x00,0x00,0x00,0x00}, {0x2c,0xc1,0xed,0xed}, 
+{0x60,0x40,0x20,0x20}, {0x1f,0xe3,0xfc,0xfc}, {0xc8,0x79,0xb1,0xb1}, {0xed,0xb6,0x5b,0x5b}, 
+{0xbe,0xd4,0x6a,0x6a}, {0x46,0x8d,0xcb,0xcb}, {0xd9,0x67,0xbe,0xbe}, {0x4b,0x72,0x39,0x39}, 
+{0xde,0x94,0x4a,0x4a}, {0xd4,0x98,0x4c,0x4c}, {0xe8,0xb0,0x58,0x58}, {0x4a,0x85,0xcf,0xcf}, 
+{0x6b,0xbb,0xd0,0xd0}, {0x2a,0xc5,0xef,0xef}, {0xe5,0x4f,0xaa,0xaa}, {0x16,0xed,0xfb,0xfb}, 
+{0xc5,0x86,0x43,0x43}, {0xd7,0x9a,0x4d,0x4d}, {0x55,0x66,0x33,0x33}, {0x94,0x11,0x85,0x85}, 
+{0xcf,0x8a,0x45,0x45}, {0x10,0xe9,0xf9,0xf9}, {0x06,0x04,0x02,0x02}, {0x81,0xfe,0x7f,0x7f}, 
+{0xf0,0xa0,0x50,0x50}, {0x44,0x78,0x3c,0x3c}, {0xba,0x25,0x9f,0x9f}, {0xe3,0x4b,0xa8,0xa8}, 
+{0xf3,0xa2,0x51,0x51}, {0xfe,0x5d,0xa3,0xa3}, {0xc0,0x80,0x40,0x40}, {0x8a,0x05,0x8f,0x8f}, 
+{0xad,0x3f,0x92,0x92}, {0xbc,0x21,0x9d,0x9d}, {0x48,0x70,0x38,0x38}, {0x04,0xf1,0xf5,0xf5}, 
+{0xdf,0x63,0xbc,0xbc}, {0xc1,0x77,0xb6,0xb6}, {0x75,0xaf,0xda,0xda}, {0x63,0x42,0x21,0x21}, 
+{0x30,0x20,0x10,0x10}, {0x1a,0xe5,0xff,0xff}, {0x0e,0xfd,0xf3,0xf3}, {0x6d,0xbf,0xd2,0xd2}, 
+{0x4c,0x81,0xcd,0xcd}, {0x14,0x18,0x0c,0x0c}, {0x35,0x26,0x13,0x13}, {0x2f,0xc3,0xec,0xec}, 
+{0xe1,0xbe,0x5f,0x5f}, {0xa2,0x35,0x97,0x97}, {0xcc,0x88,0x44,0x44}, {0x39,0x2e,0x17,0x17}, 
+{0x57,0x93,0xc4,0xc4}, {0xf2,0x55,0xa7,0xa7}, {0x82,0xfc,0x7e,0x7e}, {0x47,0x7a,0x3d,0x3d}, 
+{0xac,0xc8,0x64,0x64}, {0xe7,0xba,0x5d,0x5d}, {0x2b,0x32,0x19,0x19}, {0x95,0xe6,0x73,0x73}, 
+{0xa0,0xc0,0x60,0x60}, {0x98,0x19,0x81,0x81}, {0xd1,0x9e,0x4f,0x4f}, {0x7f,0xa3,0xdc,0xdc}, 
+{0x66,0x44,0x22,0x22}, {0x7e,0x54,0x2a,0x2a}, {0xab,0x3b,0x90,0x90}, {0x83,0x0b,0x88,0x88}, 
+{0xca,0x8c,0x46,0x46}, {0x29,0xc7,0xee,0xee}, {0xd3,0x6b,0xb8,0xb8}, {0x3c,0x28,0x14,0x14}, 
+{0x79,0xa7,0xde,0xde}, {0xe2,0xbc,0x5e,0x5e}, {0x1d,0x16,0x0b,0x0b}, {0x76,0xad,0xdb,0xdb}, 
+{0x3b,0xdb,0xe0,0xe0}, {0x56,0x64,0x32,0x32}, {0x4e,0x74,0x3a,0x3a}, {0x1e,0x14,0x0a,0x0a}, 
+{0xdb,0x92,0x49,0x49}, {0x0a,0x0c,0x06,0x06}, {0x6c,0x48,0x24,0x24}, {0xe4,0xb8,0x5c,0x5c}, 
+{0x5d,0x9f,0xc2,0xc2}, {0x6e,0xbd,0xd3,0xd3}, {0xef,0x43,0xac,0xac}, {0xa6,0xc4,0x62,0x62}, 
+{0xa8,0x39,0x91,0x91}, {0xa4,0x31,0x95,0x95}, {0x37,0xd3,0xe4,0xe4}, {0x8b,0xf2,0x79,0x79}, 
+{0x32,0xd5,0xe7,0xe7}, {0x43,0x8b,0xc8,0xc8}, {0x59,0x6e,0x37,0x37}, {0xb7,0xda,0x6d,0x6d}, 
+{0x8c,0x01,0x8d,0x8d}, {0x64,0xb1,0xd5,0xd5}, {0xd2,0x9c,0x4e,0x4e}, {0xe0,0x49,0xa9,0xa9}, 
+{0xb4,0xd8,0x6c,0x6c}, {0xfa,0xac,0x56,0x56}, {0x07,0xf3,0xf4,0xf4}, {0x25,0xcf,0xea,0xea}, 
+{0xaf,0xca,0x65,0x65}, {0x8e,0xf4,0x7a,0x7a}, {0xe9,0x47,0xae,0xae}, {0x18,0x10,0x08,0x08}, 
+{0xd5,0x6f,0xba,0xba}, {0x88,0xf0,0x78,0x78}, {0x6f,0x4a,0x25,0x25}, {0x72,0x5c,0x2e,0x2e}, 
+{0x24,0x38,0x1c,0x1c}, {0xf1,0x57,0xa6,0xa6}, {0xc7,0x73,0xb4,0xb4}, {0x51,0x97,0xc6,0xc6}, 
+{0x23,0xcb,0xe8,0xe8}, {0x7c,0xa1,0xdd,0xdd}, {0x9c,0xe8,0x74,0x74}, {0x21,0x3e,0x1f,0x1f}, 
+{0xdd,0x96,0x4b,0x4b}, {0xdc,0x61,0xbd,0xbd}, {0x86,0x0d,0x8b,0x8b}, {0x85,0x0f,0x8a,0x8a}, 
+{0x90,0xe0,0x70,0x70}, {0x42,0x7c,0x3e,0x3e}, {0xc4,0x71,0xb5,0xb5}, {0xaa,0xcc,0x66,0x66}, 
+{0xd8,0x90,0x48,0x48}, {0x05,0x06,0x03,0x03}, {0x01,0xf7,0xf6,0xf6}, {0x12,0x1c,0x0e,0x0e}, 
+{0xa3,0xc2,0x61,0x61}, {0x5f,0x6a,0x35,0x35}, {0xf9,0xae,0x57,0x57}, {0xd0,0x69,0xb9,0xb9}, 
+{0x91,0x17,0x86,0x86}, {0x58,0x99,0xc1,0xc1}, {0x27,0x3a,0x1d,0x1d}, {0xb9,0x27,0x9e,0x9e}, 
+{0x38,0xd9,0xe1,0xe1}, {0x13,0xeb,0xf8,0xf8}, {0xb3,0x2b,0x98,0x98}, {0x33,0x22,0x11,0x11}, 
+{0xbb,0xd2,0x69,0x69}, {0x70,0xa9,0xd9,0xd9}, {0x89,0x07,0x8e,0x8e}, {0xa7,0x33,0x94,0x94}, 
+{0xb6,0x2d,0x9b,0x9b}, {0x22,0x3c,0x1e,0x1e}, {0x92,0x15,0x87,0x87}, {0x20,0xc9,0xe9,0xe9}, 
+{0x49,0x87,0xce,0xce}, {0xff,0xaa,0x55,0x55}, {0x78,0x50,0x28,0x28}, {0x7a,0xa5,0xdf,0xdf}, 
+{0x8f,0x03,0x8c,0x8c}, {0xf8,0x59,0xa1,0xa1}, {0x80,0x09,0x89,0x89}, {0x17,0x1a,0x0d,0x0d}, 
+{0xda,0x65,0xbf,0xbf}, {0x31,0xd7,0xe6,0xe6}, {0xc6,0x84,0x42,0x42}, {0xb8,0xd0,0x68,0x68}, 
+{0xc3,0x82,0x41,0x41}, {0xb0,0x29,0x99,0x99}, {0x77,0x5a,0x2d,0x2d}, {0x11,0x1e,0x0f,0x0f}, 
+{0xcb,0x7b,0xb0,0xb0}, {0xfc,0xa8,0x54,0x54}, {0xd6,0x6d,0xbb,0xbb}, {0x3a,0x2c,0x16,0x16}
+};
+
+static word8 T3[256][4] = {
+{0x63,0xa5,0xc6,0x63}, {0x7c,0x84,0xf8,0x7c}, {0x77,0x99,0xee,0x77}, {0x7b,0x8d,0xf6,0x7b}, 
+{0xf2,0x0d,0xff,0xf2}, {0x6b,0xbd,0xd6,0x6b}, {0x6f,0xb1,0xde,0x6f}, {0xc5,0x54,0x91,0xc5}, 
+{0x30,0x50,0x60,0x30}, {0x01,0x03,0x02,0x01}, {0x67,0xa9,0xce,0x67}, {0x2b,0x7d,0x56,0x2b}, 
+{0xfe,0x19,0xe7,0xfe}, {0xd7,0x62,0xb5,0xd7}, {0xab,0xe6,0x4d,0xab}, {0x76,0x9a,0xec,0x76}, 
+{0xca,0x45,0x8f,0xca}, {0x82,0x9d,0x1f,0x82}, {0xc9,0x40,0x89,0xc9}, {0x7d,0x87,0xfa,0x7d}, 
+{0xfa,0x15,0xef,0xfa}, {0x59,0xeb,0xb2,0x59}, {0x47,0xc9,0x8e,0x47}, {0xf0,0x0b,0xfb,0xf0}, 
+{0xad,0xec,0x41,0xad}, {0xd4,0x67,0xb3,0xd4}, {0xa2,0xfd,0x5f,0xa2}, {0xaf,0xea,0x45,0xaf}, 
+{0x9c,0xbf,0x23,0x9c}, {0xa4,0xf7,0x53,0xa4}, {0x72,0x96,0xe4,0x72}, {0xc0,0x5b,0x9b,0xc0}, 
+{0xb7,0xc2,0x75,0xb7}, {0xfd,0x1c,0xe1,0xfd}, {0x93,0xae,0x3d,0x93}, {0x26,0x6a,0x4c,0x26}, 
+{0x36,0x5a,0x6c,0x36}, {0x3f,0x41,0x7e,0x3f}, {0xf7,0x02,0xf5,0xf7}, {0xcc,0x4f,0x83,0xcc}, 
+{0x34,0x5c,0x68,0x34}, {0xa5,0xf4,0x51,0xa5}, {0xe5,0x34,0xd1,0xe5}, {0xf1,0x08,0xf9,0xf1}, 
+{0x71,0x93,0xe2,0x71}, {0xd8,0x73,0xab,0xd8}, {0x31,0x53,0x62,0x31}, {0x15,0x3f,0x2a,0x15}, 
+{0x04,0x0c,0x08,0x04}, {0xc7,0x52,0x95,0xc7}, {0x23,0x65,0x46,0x23}, {0xc3,0x5e,0x9d,0xc3}, 
+{0x18,0x28,0x30,0x18}, {0x96,0xa1,0x37,0x96}, {0x05,0x0f,0x0a,0x05}, {0x9a,0xb5,0x2f,0x9a}, 
+{0x07,0x09,0x0e,0x07}, {0x12,0x36,0x24,0x12}, {0x80,0x9b,0x1b,0x80}, {0xe2,0x3d,0xdf,0xe2}, 
+{0xeb,0x26,0xcd,0xeb}, {0x27,0x69,0x4e,0x27}, {0xb2,0xcd,0x7f,0xb2}, {0x75,0x9f,0xea,0x75}, 
+{0x09,0x1b,0x12,0x09}, {0x83,0x9e,0x1d,0x83}, {0x2c,0x74,0x58,0x2c}, {0x1a,0x2e,0x34,0x1a}, 
+{0x1b,0x2d,0x36,0x1b}, {0x6e,0xb2,0xdc,0x6e}, {0x5a,0xee,0xb4,0x5a}, {0xa0,0xfb,0x5b,0xa0}, 
+{0x52,0xf6,0xa4,0x52}, {0x3b,0x4d,0x76,0x3b}, {0xd6,0x61,0xb7,0xd6}, {0xb3,0xce,0x7d,0xb3}, 
+{0x29,0x7b,0x52,0x29}, {0xe3,0x3e,0xdd,0xe3}, {0x2f,0x71,0x5e,0x2f}, {0x84,0x97,0x13,0x84}, 
+{0x53,0xf5,0xa6,0x53}, {0xd1,0x68,0xb9,0xd1}, {0x00,0x00,0x00,0x00}, {0xed,0x2c,0xc1,0xed}, 
+{0x20,0x60,0x40,0x20}, {0xfc,0x1f,0xe3,0xfc}, {0xb1,0xc8,0x79,0xb1}, {0x5b,0xed,0xb6,0x5b}, 
+{0x6a,0xbe,0xd4,0x6a}, {0xcb,0x46,0x8d,0xcb}, {0xbe,0xd9,0x67,0xbe}, {0x39,0x4b,0x72,0x39}, 
+{0x4a,0xde,0x94,0x4a}, {0x4c,0xd4,0x98,0x4c}, {0x58,0xe8,0xb0,0x58}, {0xcf,0x4a,0x85,0xcf}, 
+{0xd0,0x6b,0xbb,0xd0}, {0xef,0x2a,0xc5,0xef}, {0xaa,0xe5,0x4f,0xaa}, {0xfb,0x16,0xed,0xfb}, 
+{0x43,0xc5,0x86,0x43}, {0x4d,0xd7,0x9a,0x4d}, {0x33,0x55,0x66,0x33}, {0x85,0x94,0x11,0x85}, 
+{0x45,0xcf,0x8a,0x45}, {0xf9,0x10,0xe9,0xf9}, {0x02,0x06,0x04,0x02}, {0x7f,0x81,0xfe,0x7f}, 
+{0x50,0xf0,0xa0,0x50}, {0x3c,0x44,0x78,0x3c}, {0x9f,0xba,0x25,0x9f}, {0xa8,0xe3,0x4b,0xa8}, 
+{0x51,0xf3,0xa2,0x51}, {0xa3,0xfe,0x5d,0xa3}, {0x40,0xc0,0x80,0x40}, {0x8f,0x8a,0x05,0x8f}, 
+{0x92,0xad,0x3f,0x92}, {0x9d,0xbc,0x21,0x9d}, {0x38,0x48,0x70,0x38}, {0xf5,0x04,0xf1,0xf5}, 
+{0xbc,0xdf,0x63,0xbc}, {0xb6,0xc1,0x77,0xb6}, {0xda,0x75,0xaf,0xda}, {0x21,0x63,0x42,0x21}, 
+{0x10,0x30,0x20,0x10}, {0xff,0x1a,0xe5,0xff}, {0xf3,0x0e,0xfd,0xf3}, {0xd2,0x6d,0xbf,0xd2}, 
+{0xcd,0x4c,0x81,0xcd}, {0x0c,0x14,0x18,0x0c}, {0x13,0x35,0x26,0x13}, {0xec,0x2f,0xc3,0xec}, 
+{0x5f,0xe1,0xbe,0x5f}, {0x97,0xa2,0x35,0x97}, {0x44,0xcc,0x88,0x44}, {0x17,0x39,0x2e,0x17}, 
+{0xc4,0x57,0x93,0xc4}, {0xa7,0xf2,0x55,0xa7}, {0x7e,0x82,0xfc,0x7e}, {0x3d,0x47,0x7a,0x3d}, 
+{0x64,0xac,0xc8,0x64}, {0x5d,0xe7,0xba,0x5d}, {0x19,0x2b,0x32,0x19}, {0x73,0x95,0xe6,0x73}, 
+{0x60,0xa0,0xc0,0x60}, {0x81,0x98,0x19,0x81}, {0x4f,0xd1,0x9e,0x4f}, {0xdc,0x7f,0xa3,0xdc}, 
+{0x22,0x66,0x44,0x22}, {0x2a,0x7e,0x54,0x2a}, {0x90,0xab,0x3b,0x90}, {0x88,0x83,0x0b,0x88}, 
+{0x46,0xca,0x8c,0x46}, {0xee,0x29,0xc7,0xee}, {0xb8,0xd3,0x6b,0xb8}, {0x14,0x3c,0x28,0x14}, 
+{0xde,0x79,0xa7,0xde}, {0x5e,0xe2,0xbc,0x5e}, {0x0b,0x1d,0x16,0x0b}, {0xdb,0x76,0xad,0xdb}, 
+{0xe0,0x3b,0xdb,0xe0}, {0x32,0x56,0x64,0x32}, {0x3a,0x4e,0x74,0x3a}, {0x0a,0x1e,0x14,0x0a}, 
+{0x49,0xdb,0x92,0x49}, {0x06,0x0a,0x0c,0x06}, {0x24,0x6c,0x48,0x24}, {0x5c,0xe4,0xb8,0x5c}, 
+{0xc2,0x5d,0x9f,0xc2}, {0xd3,0x6e,0xbd,0xd3}, {0xac,0xef,0x43,0xac}, {0x62,0xa6,0xc4,0x62}, 
+{0x91,0xa8,0x39,0x91}, {0x95,0xa4,0x31,0x95}, {0xe4,0x37,0xd3,0xe4}, {0x79,0x8b,0xf2,0x79}, 
+{0xe7,0x32,0xd5,0xe7}, {0xc8,0x43,0x8b,0xc8}, {0x37,0x59,0x6e,0x37}, {0x6d,0xb7,0xda,0x6d}, 
+{0x8d,0x8c,0x01,0x8d}, {0xd5,0x64,0xb1,0xd5}, {0x4e,0xd2,0x9c,0x4e}, {0xa9,0xe0,0x49,0xa9}, 
+{0x6c,0xb4,0xd8,0x6c}, {0x56,0xfa,0xac,0x56}, {0xf4,0x07,0xf3,0xf4}, {0xea,0x25,0xcf,0xea}, 
+{0x65,0xaf,0xca,0x65}, {0x7a,0x8e,0xf4,0x7a}, {0xae,0xe9,0x47,0xae}, {0x08,0x18,0x10,0x08}, 
+{0xba,0xd5,0x6f,0xba}, {0x78,0x88,0xf0,0x78}, {0x25,0x6f,0x4a,0x25}, {0x2e,0x72,0x5c,0x2e}, 
+{0x1c,0x24,0x38,0x1c}, {0xa6,0xf1,0x57,0xa6}, {0xb4,0xc7,0x73,0xb4}, {0xc6,0x51,0x97,0xc6}, 
+{0xe8,0x23,0xcb,0xe8}, {0xdd,0x7c,0xa1,0xdd}, {0x74,0x9c,0xe8,0x74}, {0x1f,0x21,0x3e,0x1f}, 
+{0x4b,0xdd,0x96,0x4b}, {0xbd,0xdc,0x61,0xbd}, {0x8b,0x86,0x0d,0x8b}, {0x8a,0x85,0x0f,0x8a}, 
+{0x70,0x90,0xe0,0x70}, {0x3e,0x42,0x7c,0x3e}, {0xb5,0xc4,0x71,0xb5}, {0x66,0xaa,0xcc,0x66}, 
+{0x48,0xd8,0x90,0x48}, {0x03,0x05,0x06,0x03}, {0xf6,0x01,0xf7,0xf6}, {0x0e,0x12,0x1c,0x0e}, 
+{0x61,0xa3,0xc2,0x61}, {0x35,0x5f,0x6a,0x35}, {0x57,0xf9,0xae,0x57}, {0xb9,0xd0,0x69,0xb9}, 
+{0x86,0x91,0x17,0x86}, {0xc1,0x58,0x99,0xc1}, {0x1d,0x27,0x3a,0x1d}, {0x9e,0xb9,0x27,0x9e}, 
+{0xe1,0x38,0xd9,0xe1}, {0xf8,0x13,0xeb,0xf8}, {0x98,0xb3,0x2b,0x98}, {0x11,0x33,0x22,0x11}, 
+{0x69,0xbb,0xd2,0x69}, {0xd9,0x70,0xa9,0xd9}, {0x8e,0x89,0x07,0x8e}, {0x94,0xa7,0x33,0x94}, 
+{0x9b,0xb6,0x2d,0x9b}, {0x1e,0x22,0x3c,0x1e}, {0x87,0x92,0x15,0x87}, {0xe9,0x20,0xc9,0xe9}, 
+{0xce,0x49,0x87,0xce}, {0x55,0xff,0xaa,0x55}, {0x28,0x78,0x50,0x28}, {0xdf,0x7a,0xa5,0xdf}, 
+{0x8c,0x8f,0x03,0x8c}, {0xa1,0xf8,0x59,0xa1}, {0x89,0x80,0x09,0x89}, {0x0d,0x17,0x1a,0x0d}, 
+{0xbf,0xda,0x65,0xbf}, {0xe6,0x31,0xd7,0xe6}, {0x42,0xc6,0x84,0x42}, {0x68,0xb8,0xd0,0x68}, 
+{0x41,0xc3,0x82,0x41}, {0x99,0xb0,0x29,0x99}, {0x2d,0x77,0x5a,0x2d}, {0x0f,0x11,0x1e,0x0f}, 
+{0xb0,0xcb,0x7b,0xb0}, {0x54,0xfc,0xa8,0x54}, {0xbb,0xd6,0x6d,0xbb}, {0x16,0x3a,0x2c,0x16}
+};
+
+static word8 T4[256][4] = {
+{0x63,0x63,0xa5,0xc6}, {0x7c,0x7c,0x84,0xf8}, {0x77,0x77,0x99,0xee}, {0x7b,0x7b,0x8d,0xf6}, 
+{0xf2,0xf2,0x0d,0xff}, {0x6b,0x6b,0xbd,0xd6}, {0x6f,0x6f,0xb1,0xde}, {0xc5,0xc5,0x54,0x91}, 
+{0x30,0x30,0x50,0x60}, {0x01,0x01,0x03,0x02}, {0x67,0x67,0xa9,0xce}, {0x2b,0x2b,0x7d,0x56}, 
+{0xfe,0xfe,0x19,0xe7}, {0xd7,0xd7,0x62,0xb5}, {0xab,0xab,0xe6,0x4d}, {0x76,0x76,0x9a,0xec}, 
+{0xca,0xca,0x45,0x8f}, {0x82,0x82,0x9d,0x1f}, {0xc9,0xc9,0x40,0x89}, {0x7d,0x7d,0x87,0xfa}, 
+{0xfa,0xfa,0x15,0xef}, {0x59,0x59,0xeb,0xb2}, {0x47,0x47,0xc9,0x8e}, {0xf0,0xf0,0x0b,0xfb}, 
+{0xad,0xad,0xec,0x41}, {0xd4,0xd4,0x67,0xb3}, {0xa2,0xa2,0xfd,0x5f}, {0xaf,0xaf,0xea,0x45}, 
+{0x9c,0x9c,0xbf,0x23}, {0xa4,0xa4,0xf7,0x53}, {0x72,0x72,0x96,0xe4}, {0xc0,0xc0,0x5b,0x9b}, 
+{0xb7,0xb7,0xc2,0x75}, {0xfd,0xfd,0x1c,0xe1}, {0x93,0x93,0xae,0x3d}, {0x26,0x26,0x6a,0x4c}, 
+{0x36,0x36,0x5a,0x6c}, {0x3f,0x3f,0x41,0x7e}, {0xf7,0xf7,0x02,0xf5}, {0xcc,0xcc,0x4f,0x83}, 
+{0x34,0x34,0x5c,0x68}, {0xa5,0xa5,0xf4,0x51}, {0xe5,0xe5,0x34,0xd1}, {0xf1,0xf1,0x08,0xf9}, 
+{0x71,0x71,0x93,0xe2}, {0xd8,0xd8,0x73,0xab}, {0x31,0x31,0x53,0x62}, {0x15,0x15,0x3f,0x2a}, 
+{0x04,0x04,0x0c,0x08}, {0xc7,0xc7,0x52,0x95}, {0x23,0x23,0x65,0x46}, {0xc3,0xc3,0x5e,0x9d}, 
+{0x18,0x18,0x28,0x30}, {0x96,0x96,0xa1,0x37}, {0x05,0x05,0x0f,0x0a}, {0x9a,0x9a,0xb5,0x2f}, 
+{0x07,0x07,0x09,0x0e}, {0x12,0x12,0x36,0x24}, {0x80,0x80,0x9b,0x1b}, {0xe2,0xe2,0x3d,0xdf}, 
+{0xeb,0xeb,0x26,0xcd}, {0x27,0x27,0x69,0x4e}, {0xb2,0xb2,0xcd,0x7f}, {0x75,0x75,0x9f,0xea}, 
+{0x09,0x09,0x1b,0x12}, {0x83,0x83,0x9e,0x1d}, {0x2c,0x2c,0x74,0x58}, {0x1a,0x1a,0x2e,0x34}, 
+{0x1b,0x1b,0x2d,0x36}, {0x6e,0x6e,0xb2,0xdc}, {0x5a,0x5a,0xee,0xb4}, {0xa0,0xa0,0xfb,0x5b}, 
+{0x52,0x52,0xf6,0xa4}, {0x3b,0x3b,0x4d,0x76}, {0xd6,0xd6,0x61,0xb7}, {0xb3,0xb3,0xce,0x7d}, 
+{0x29,0x29,0x7b,0x52}, {0xe3,0xe3,0x3e,0xdd}, {0x2f,0x2f,0x71,0x5e}, {0x84,0x84,0x97,0x13}, 
+{0x53,0x53,0xf5,0xa6}, {0xd1,0xd1,0x68,0xb9}, {0x00,0x00,0x00,0x00}, {0xed,0xed,0x2c,0xc1}, 
+{0x20,0x20,0x60,0x40}, {0xfc,0xfc,0x1f,0xe3}, {0xb1,0xb1,0xc8,0x79}, {0x5b,0x5b,0xed,0xb6}, 
+{0x6a,0x6a,0xbe,0xd4}, {0xcb,0xcb,0x46,0x8d}, {0xbe,0xbe,0xd9,0x67}, {0x39,0x39,0x4b,0x72}, 
+{0x4a,0x4a,0xde,0x94}, {0x4c,0x4c,0xd4,0x98}, {0x58,0x58,0xe8,0xb0}, {0xcf,0xcf,0x4a,0x85}, 
+{0xd0,0xd0,0x6b,0xbb}, {0xef,0xef,0x2a,0xc5}, {0xaa,0xaa,0xe5,0x4f}, {0xfb,0xfb,0x16,0xed}, 
+{0x43,0x43,0xc5,0x86}, {0x4d,0x4d,0xd7,0x9a}, {0x33,0x33,0x55,0x66}, {0x85,0x85,0x94,0x11}, 
+{0x45,0x45,0xcf,0x8a}, {0xf9,0xf9,0x10,0xe9}, {0x02,0x02,0x06,0x04}, {0x7f,0x7f,0x81,0xfe}, 
+{0x50,0x50,0xf0,0xa0}, {0x3c,0x3c,0x44,0x78}, {0x9f,0x9f,0xba,0x25}, {0xa8,0xa8,0xe3,0x4b}, 
+{0x51,0x51,0xf3,0xa2}, {0xa3,0xa3,0xfe,0x5d}, {0x40,0x40,0xc0,0x80}, {0x8f,0x8f,0x8a,0x05}, 
+{0x92,0x92,0xad,0x3f}, {0x9d,0x9d,0xbc,0x21}, {0x38,0x38,0x48,0x70}, {0xf5,0xf5,0x04,0xf1}, 
+{0xbc,0xbc,0xdf,0x63}, {0xb6,0xb6,0xc1,0x77}, {0xda,0xda,0x75,0xaf}, {0x21,0x21,0x63,0x42}, 
+{0x10,0x10,0x30,0x20}, {0xff,0xff,0x1a,0xe5}, {0xf3,0xf3,0x0e,0xfd}, {0xd2,0xd2,0x6d,0xbf}, 
+{0xcd,0xcd,0x4c,0x81}, {0x0c,0x0c,0x14,0x18}, {0x13,0x13,0x35,0x26}, {0xec,0xec,0x2f,0xc3}, 
+{0x5f,0x5f,0xe1,0xbe}, {0x97,0x97,0xa2,0x35}, {0x44,0x44,0xcc,0x88}, {0x17,0x17,0x39,0x2e}, 
+{0xc4,0xc4,0x57,0x93}, {0xa7,0xa7,0xf2,0x55}, {0x7e,0x7e,0x82,0xfc}, {0x3d,0x3d,0x47,0x7a}, 
+{0x64,0x64,0xac,0xc8}, {0x5d,0x5d,0xe7,0xba}, {0x19,0x19,0x2b,0x32}, {0x73,0x73,0x95,0xe6}, 
+{0x60,0x60,0xa0,0xc0}, {0x81,0x81,0x98,0x19}, {0x4f,0x4f,0xd1,0x9e}, {0xdc,0xdc,0x7f,0xa3}, 
+{0x22,0x22,0x66,0x44}, {0x2a,0x2a,0x7e,0x54}, {0x90,0x90,0xab,0x3b}, {0x88,0x88,0x83,0x0b}, 
+{0x46,0x46,0xca,0x8c}, {0xee,0xee,0x29,0xc7}, {0xb8,0xb8,0xd3,0x6b}, {0x14,0x14,0x3c,0x28}, 
+{0xde,0xde,0x79,0xa7}, {0x5e,0x5e,0xe2,0xbc}, {0x0b,0x0b,0x1d,0x16}, {0xdb,0xdb,0x76,0xad}, 
+{0xe0,0xe0,0x3b,0xdb}, {0x32,0x32,0x56,0x64}, {0x3a,0x3a,0x4e,0x74}, {0x0a,0x0a,0x1e,0x14}, 
+{0x49,0x49,0xdb,0x92}, {0x06,0x06,0x0a,0x0c}, {0x24,0x24,0x6c,0x48}, {0x5c,0x5c,0xe4,0xb8}, 
+{0xc2,0xc2,0x5d,0x9f}, {0xd3,0xd3,0x6e,0xbd}, {0xac,0xac,0xef,0x43}, {0x62,0x62,0xa6,0xc4}, 
+{0x91,0x91,0xa8,0x39}, {0x95,0x95,0xa4,0x31}, {0xe4,0xe4,0x37,0xd3}, {0x79,0x79,0x8b,0xf2}, 
+{0xe7,0xe7,0x32,0xd5}, {0xc8,0xc8,0x43,0x8b}, {0x37,0x37,0x59,0x6e}, {0x6d,0x6d,0xb7,0xda}, 
+{0x8d,0x8d,0x8c,0x01}, {0xd5,0xd5,0x64,0xb1}, {0x4e,0x4e,0xd2,0x9c}, {0xa9,0xa9,0xe0,0x49}, 
+{0x6c,0x6c,0xb4,0xd8}, {0x56,0x56,0xfa,0xac}, {0xf4,0xf4,0x07,0xf3}, {0xea,0xea,0x25,0xcf}, 
+{0x65,0x65,0xaf,0xca}, {0x7a,0x7a,0x8e,0xf4}, {0xae,0xae,0xe9,0x47}, {0x08,0x08,0x18,0x10}, 
+{0xba,0xba,0xd5,0x6f}, {0x78,0x78,0x88,0xf0}, {0x25,0x25,0x6f,0x4a}, {0x2e,0x2e,0x72,0x5c}, 
+{0x1c,0x1c,0x24,0x38}, {0xa6,0xa6,0xf1,0x57}, {0xb4,0xb4,0xc7,0x73}, {0xc6,0xc6,0x51,0x97}, 
+{0xe8,0xe8,0x23,0xcb}, {0xdd,0xdd,0x7c,0xa1}, {0x74,0x74,0x9c,0xe8}, {0x1f,0x1f,0x21,0x3e}, 
+{0x4b,0x4b,0xdd,0x96}, {0xbd,0xbd,0xdc,0x61}, {0x8b,0x8b,0x86,0x0d}, {0x8a,0x8a,0x85,0x0f}, 
+{0x70,0x70,0x90,0xe0}, {0x3e,0x3e,0x42,0x7c}, {0xb5,0xb5,0xc4,0x71}, {0x66,0x66,0xaa,0xcc}, 
+{0x48,0x48,0xd8,0x90}, {0x03,0x03,0x05,0x06}, {0xf6,0xf6,0x01,0xf7}, {0x0e,0x0e,0x12,0x1c}, 
+{0x61,0x61,0xa3,0xc2}, {0x35,0x35,0x5f,0x6a}, {0x57,0x57,0xf9,0xae}, {0xb9,0xb9,0xd0,0x69}, 
+{0x86,0x86,0x91,0x17}, {0xc1,0xc1,0x58,0x99}, {0x1d,0x1d,0x27,0x3a}, {0x9e,0x9e,0xb9,0x27}, 
+{0xe1,0xe1,0x38,0xd9}, {0xf8,0xf8,0x13,0xeb}, {0x98,0x98,0xb3,0x2b}, {0x11,0x11,0x33,0x22}, 
+{0x69,0x69,0xbb,0xd2}, {0xd9,0xd9,0x70,0xa9}, {0x8e,0x8e,0x89,0x07}, {0x94,0x94,0xa7,0x33}, 
+{0x9b,0x9b,0xb6,0x2d}, {0x1e,0x1e,0x22,0x3c}, {0x87,0x87,0x92,0x15}, {0xe9,0xe9,0x20,0xc9}, 
+{0xce,0xce,0x49,0x87}, {0x55,0x55,0xff,0xaa}, {0x28,0x28,0x78,0x50}, {0xdf,0xdf,0x7a,0xa5}, 
+{0x8c,0x8c,0x8f,0x03}, {0xa1,0xa1,0xf8,0x59}, {0x89,0x89,0x80,0x09}, {0x0d,0x0d,0x17,0x1a}, 
+{0xbf,0xbf,0xda,0x65}, {0xe6,0xe6,0x31,0xd7}, {0x42,0x42,0xc6,0x84}, {0x68,0x68,0xb8,0xd0}, 
+{0x41,0x41,0xc3,0x82}, {0x99,0x99,0xb0,0x29}, {0x2d,0x2d,0x77,0x5a}, {0x0f,0x0f,0x11,0x1e}, 
+{0xb0,0xb0,0xcb,0x7b}, {0x54,0x54,0xfc,0xa8}, {0xbb,0xbb,0xd6,0x6d}, {0x16,0x16,0x3a,0x2c},
+};
+
+static word8 T5[256][4] = {
+{0x51,0xf4,0xa7,0x50}, {0x7e,0x41,0x65,0x53}, {0x1a,0x17,0xa4,0xc3}, {0x3a,0x27,0x5e,0x96}, 
+{0x3b,0xab,0x6b,0xcb}, {0x1f,0x9d,0x45,0xf1}, {0xac,0xfa,0x58,0xab}, {0x4b,0xe3,0x03,0x93}, 
+{0x20,0x30,0xfa,0x55}, {0xad,0x76,0x6d,0xf6}, {0x88,0xcc,0x76,0x91}, {0xf5,0x02,0x4c,0x25}, 
+{0x4f,0xe5,0xd7,0xfc}, {0xc5,0x2a,0xcb,0xd7}, {0x26,0x35,0x44,0x80}, {0xb5,0x62,0xa3,0x8f}, 
+{0xde,0xb1,0x5a,0x49}, {0x25,0xba,0x1b,0x67}, {0x45,0xea,0x0e,0x98}, {0x5d,0xfe,0xc0,0xe1}, 
+{0xc3,0x2f,0x75,0x02}, {0x81,0x4c,0xf0,0x12}, {0x8d,0x46,0x97,0xa3}, {0x6b,0xd3,0xf9,0xc6}, 
+{0x03,0x8f,0x5f,0xe7}, {0x15,0x92,0x9c,0x95}, {0xbf,0x6d,0x7a,0xeb}, {0x95,0x52,0x59,0xda}, 
+{0xd4,0xbe,0x83,0x2d}, {0x58,0x74,0x21,0xd3}, {0x49,0xe0,0x69,0x29}, {0x8e,0xc9,0xc8,0x44}, 
+{0x75,0xc2,0x89,0x6a}, {0xf4,0x8e,0x79,0x78}, {0x99,0x58,0x3e,0x6b}, {0x27,0xb9,0x71,0xdd}, 
+{0xbe,0xe1,0x4f,0xb6}, {0xf0,0x88,0xad,0x17}, {0xc9,0x20,0xac,0x66}, {0x7d,0xce,0x3a,0xb4}, 
+{0x63,0xdf,0x4a,0x18}, {0xe5,0x1a,0x31,0x82}, {0x97,0x51,0x33,0x60}, {0x62,0x53,0x7f,0x45}, 
+{0xb1,0x64,0x77,0xe0}, {0xbb,0x6b,0xae,0x84}, {0xfe,0x81,0xa0,0x1c}, {0xf9,0x08,0x2b,0x94}, 
+{0x70,0x48,0x68,0x58}, {0x8f,0x45,0xfd,0x19}, {0x94,0xde,0x6c,0x87}, {0x52,0x7b,0xf8,0xb7}, 
+{0xab,0x73,0xd3,0x23}, {0x72,0x4b,0x02,0xe2}, {0xe3,0x1f,0x8f,0x57}, {0x66,0x55,0xab,0x2a}, 
+{0xb2,0xeb,0x28,0x07}, {0x2f,0xb5,0xc2,0x03}, {0x86,0xc5,0x7b,0x9a}, {0xd3,0x37,0x08,0xa5}, 
+{0x30,0x28,0x87,0xf2}, {0x23,0xbf,0xa5,0xb2}, {0x02,0x03,0x6a,0xba}, {0xed,0x16,0x82,0x5c}, 
+{0x8a,0xcf,0x1c,0x2b}, {0xa7,0x79,0xb4,0x92}, {0xf3,0x07,0xf2,0xf0}, {0x4e,0x69,0xe2,0xa1}, 
+{0x65,0xda,0xf4,0xcd}, {0x06,0x05,0xbe,0xd5}, {0xd1,0x34,0x62,0x1f}, {0xc4,0xa6,0xfe,0x8a}, 
+{0x34,0x2e,0x53,0x9d}, {0xa2,0xf3,0x55,0xa0}, {0x05,0x8a,0xe1,0x32}, {0xa4,0xf6,0xeb,0x75}, 
+{0x0b,0x83,0xec,0x39}, {0x40,0x60,0xef,0xaa}, {0x5e,0x71,0x9f,0x06}, {0xbd,0x6e,0x10,0x51}, 
+{0x3e,0x21,0x8a,0xf9}, {0x96,0xdd,0x06,0x3d}, {0xdd,0x3e,0x05,0xae}, {0x4d,0xe6,0xbd,0x46}, 
+{0x91,0x54,0x8d,0xb5}, {0x71,0xc4,0x5d,0x05}, {0x04,0x06,0xd4,0x6f}, {0x60,0x50,0x15,0xff}, 
+{0x19,0x98,0xfb,0x24}, {0xd6,0xbd,0xe9,0x97}, {0x89,0x40,0x43,0xcc}, {0x67,0xd9,0x9e,0x77}, 
+{0xb0,0xe8,0x42,0xbd}, {0x07,0x89,0x8b,0x88}, {0xe7,0x19,0x5b,0x38}, {0x79,0xc8,0xee,0xdb}, 
+{0xa1,0x7c,0x0a,0x47}, {0x7c,0x42,0x0f,0xe9}, {0xf8,0x84,0x1e,0xc9}, {0x00,0x00,0x00,0x00}, 
+{0x09,0x80,0x86,0x83}, {0x32,0x2b,0xed,0x48}, {0x1e,0x11,0x70,0xac}, {0x6c,0x5a,0x72,0x4e}, 
+{0xfd,0x0e,0xff,0xfb}, {0x0f,0x85,0x38,0x56}, {0x3d,0xae,0xd5,0x1e}, {0x36,0x2d,0x39,0x27}, 
+{0x0a,0x0f,0xd9,0x64}, {0x68,0x5c,0xa6,0x21}, {0x9b,0x5b,0x54,0xd1}, {0x24,0x36,0x2e,0x3a}, 
+{0x0c,0x0a,0x67,0xb1}, {0x93,0x57,0xe7,0x0f}, {0xb4,0xee,0x96,0xd2}, {0x1b,0x9b,0x91,0x9e}, 
+{0x80,0xc0,0xc5,0x4f}, {0x61,0xdc,0x20,0xa2}, {0x5a,0x77,0x4b,0x69}, {0x1c,0x12,0x1a,0x16}, 
+{0xe2,0x93,0xba,0x0a}, {0xc0,0xa0,0x2a,0xe5}, {0x3c,0x22,0xe0,0x43}, {0x12,0x1b,0x17,0x1d}, 
+{0x0e,0x09,0x0d,0x0b}, {0xf2,0x8b,0xc7,0xad}, {0x2d,0xb6,0xa8,0xb9}, {0x14,0x1e,0xa9,0xc8}, 
+{0x57,0xf1,0x19,0x85}, {0xaf,0x75,0x07,0x4c}, {0xee,0x99,0xdd,0xbb}, {0xa3,0x7f,0x60,0xfd}, 
+{0xf7,0x01,0x26,0x9f}, {0x5c,0x72,0xf5,0xbc}, {0x44,0x66,0x3b,0xc5}, {0x5b,0xfb,0x7e,0x34}, 
+{0x8b,0x43,0x29,0x76}, {0xcb,0x23,0xc6,0xdc}, {0xb6,0xed,0xfc,0x68}, {0xb8,0xe4,0xf1,0x63}, 
+{0xd7,0x31,0xdc,0xca}, {0x42,0x63,0x85,0x10}, {0x13,0x97,0x22,0x40}, {0x84,0xc6,0x11,0x20}, 
+{0x85,0x4a,0x24,0x7d}, {0xd2,0xbb,0x3d,0xf8}, {0xae,0xf9,0x32,0x11}, {0xc7,0x29,0xa1,0x6d}, 
+{0x1d,0x9e,0x2f,0x4b}, {0xdc,0xb2,0x30,0xf3}, {0x0d,0x86,0x52,0xec}, {0x77,0xc1,0xe3,0xd0}, 
+{0x2b,0xb3,0x16,0x6c}, {0xa9,0x70,0xb9,0x99}, {0x11,0x94,0x48,0xfa}, {0x47,0xe9,0x64,0x22}, 
+{0xa8,0xfc,0x8c,0xc4}, {0xa0,0xf0,0x3f,0x1a}, {0x56,0x7d,0x2c,0xd8}, {0x22,0x33,0x90,0xef}, 
+{0x87,0x49,0x4e,0xc7}, {0xd9,0x38,0xd1,0xc1}, {0x8c,0xca,0xa2,0xfe}, {0x98,0xd4,0x0b,0x36}, 
+{0xa6,0xf5,0x81,0xcf}, {0xa5,0x7a,0xde,0x28}, {0xda,0xb7,0x8e,0x26}, {0x3f,0xad,0xbf,0xa4}, 
+{0x2c,0x3a,0x9d,0xe4}, {0x50,0x78,0x92,0x0d}, {0x6a,0x5f,0xcc,0x9b}, {0x54,0x7e,0x46,0x62}, 
+{0xf6,0x8d,0x13,0xc2}, {0x90,0xd8,0xb8,0xe8}, {0x2e,0x39,0xf7,0x5e}, {0x82,0xc3,0xaf,0xf5}, 
+{0x9f,0x5d,0x80,0xbe}, {0x69,0xd0,0x93,0x7c}, {0x6f,0xd5,0x2d,0xa9}, {0xcf,0x25,0x12,0xb3}, 
+{0xc8,0xac,0x99,0x3b}, {0x10,0x18,0x7d,0xa7}, {0xe8,0x9c,0x63,0x6e}, {0xdb,0x3b,0xbb,0x7b}, 
+{0xcd,0x26,0x78,0x09}, {0x6e,0x59,0x18,0xf4}, {0xec,0x9a,0xb7,0x01}, {0x83,0x4f,0x9a,0xa8}, 
+{0xe6,0x95,0x6e,0x65}, {0xaa,0xff,0xe6,0x7e}, {0x21,0xbc,0xcf,0x08}, {0xef,0x15,0xe8,0xe6}, 
+{0xba,0xe7,0x9b,0xd9}, {0x4a,0x6f,0x36,0xce}, {0xea,0x9f,0x09,0xd4}, {0x29,0xb0,0x7c,0xd6}, 
+{0x31,0xa4,0xb2,0xaf}, {0x2a,0x3f,0x23,0x31}, {0xc6,0xa5,0x94,0x30}, {0x35,0xa2,0x66,0xc0}, 
+{0x74,0x4e,0xbc,0x37}, {0xfc,0x82,0xca,0xa6}, {0xe0,0x90,0xd0,0xb0}, {0x33,0xa7,0xd8,0x15}, 
+{0xf1,0x04,0x98,0x4a}, {0x41,0xec,0xda,0xf7}, {0x7f,0xcd,0x50,0x0e}, {0x17,0x91,0xf6,0x2f}, 
+{0x76,0x4d,0xd6,0x8d}, {0x43,0xef,0xb0,0x4d}, {0xcc,0xaa,0x4d,0x54}, {0xe4,0x96,0x04,0xdf}, 
+{0x9e,0xd1,0xb5,0xe3}, {0x4c,0x6a,0x88,0x1b}, {0xc1,0x2c,0x1f,0xb8}, {0x46,0x65,0x51,0x7f}, 
+{0x9d,0x5e,0xea,0x04}, {0x01,0x8c,0x35,0x5d}, {0xfa,0x87,0x74,0x73}, {0xfb,0x0b,0x41,0x2e}, 
+{0xb3,0x67,0x1d,0x5a}, {0x92,0xdb,0xd2,0x52}, {0xe9,0x10,0x56,0x33}, {0x6d,0xd6,0x47,0x13}, 
+{0x9a,0xd7,0x61,0x8c}, {0x37,0xa1,0x0c,0x7a}, {0x59,0xf8,0x14,0x8e}, {0xeb,0x13,0x3c,0x89}, 
+{0xce,0xa9,0x27,0xee}, {0xb7,0x61,0xc9,0x35}, {0xe1,0x1c,0xe5,0xed}, {0x7a,0x47,0xb1,0x3c}, 
+{0x9c,0xd2,0xdf,0x59}, {0x55,0xf2,0x73,0x3f}, {0x18,0x14,0xce,0x79}, {0x73,0xc7,0x37,0xbf}, 
+{0x53,0xf7,0xcd,0xea}, {0x5f,0xfd,0xaa,0x5b}, {0xdf,0x3d,0x6f,0x14}, {0x78,0x44,0xdb,0x86}, 
+{0xca,0xaf,0xf3,0x81}, {0xb9,0x68,0xc4,0x3e}, {0x38,0x24,0x34,0x2c}, {0xc2,0xa3,0x40,0x5f}, 
+{0x16,0x1d,0xc3,0x72}, {0xbc,0xe2,0x25,0x0c}, {0x28,0x3c,0x49,0x8b}, {0xff,0x0d,0x95,0x41}, 
+{0x39,0xa8,0x01,0x71}, {0x08,0x0c,0xb3,0xde}, {0xd8,0xb4,0xe4,0x9c}, {0x64,0x56,0xc1,0x90}, 
+{0x7b,0xcb,0x84,0x61}, {0xd5,0x32,0xb6,0x70}, {0x48,0x6c,0x5c,0x74}, {0xd0,0xb8,0x57,0x42}
+};
+
+static word8 T6[256][4] = {
+{0x50,0x51,0xf4,0xa7}, {0x53,0x7e,0x41,0x65}, {0xc3,0x1a,0x17,0xa4}, {0x96,0x3a,0x27,0x5e}, 
+{0xcb,0x3b,0xab,0x6b}, {0xf1,0x1f,0x9d,0x45}, {0xab,0xac,0xfa,0x58}, {0x93,0x4b,0xe3,0x03}, 
+{0x55,0x20,0x30,0xfa}, {0xf6,0xad,0x76,0x6d}, {0x91,0x88,0xcc,0x76}, {0x25,0xf5,0x02,0x4c}, 
+{0xfc,0x4f,0xe5,0xd7}, {0xd7,0xc5,0x2a,0xcb}, {0x80,0x26,0x35,0x44}, {0x8f,0xb5,0x62,0xa3}, 
+{0x49,0xde,0xb1,0x5a}, {0x67,0x25,0xba,0x1b}, {0x98,0x45,0xea,0x0e}, {0xe1,0x5d,0xfe,0xc0}, 
+{0x02,0xc3,0x2f,0x75}, {0x12,0x81,0x4c,0xf0}, {0xa3,0x8d,0x46,0x97}, {0xc6,0x6b,0xd3,0xf9}, 
+{0xe7,0x03,0x8f,0x5f}, {0x95,0x15,0x92,0x9c}, {0xeb,0xbf,0x6d,0x7a}, {0xda,0x95,0x52,0x59}, 
+{0x2d,0xd4,0xbe,0x83}, {0xd3,0x58,0x74,0x21}, {0x29,0x49,0xe0,0x69}, {0x44,0x8e,0xc9,0xc8}, 
+{0x6a,0x75,0xc2,0x89}, {0x78,0xf4,0x8e,0x79}, {0x6b,0x99,0x58,0x3e}, {0xdd,0x27,0xb9,0x71}, 
+{0xb6,0xbe,0xe1,0x4f}, {0x17,0xf0,0x88,0xad}, {0x66,0xc9,0x20,0xac}, {0xb4,0x7d,0xce,0x3a}, 
+{0x18,0x63,0xdf,0x4a}, {0x82,0xe5,0x1a,0x31}, {0x60,0x97,0x51,0x33}, {0x45,0x62,0x53,0x7f}, 
+{0xe0,0xb1,0x64,0x77}, {0x84,0xbb,0x6b,0xae}, {0x1c,0xfe,0x81,0xa0}, {0x94,0xf9,0x08,0x2b}, 
+{0x58,0x70,0x48,0x68}, {0x19,0x8f,0x45,0xfd}, {0x87,0x94,0xde,0x6c}, {0xb7,0x52,0x7b,0xf8}, 
+{0x23,0xab,0x73,0xd3}, {0xe2,0x72,0x4b,0x02}, {0x57,0xe3,0x1f,0x8f}, {0x2a,0x66,0x55,0xab}, 
+{0x07,0xb2,0xeb,0x28}, {0x03,0x2f,0xb5,0xc2}, {0x9a,0x86,0xc5,0x7b}, {0xa5,0xd3,0x37,0x08}, 
+{0xf2,0x30,0x28,0x87}, {0xb2,0x23,0xbf,0xa5}, {0xba,0x02,0x03,0x6a}, {0x5c,0xed,0x16,0x82}, 
+{0x2b,0x8a,0xcf,0x1c}, {0x92,0xa7,0x79,0xb4}, {0xf0,0xf3,0x07,0xf2}, {0xa1,0x4e,0x69,0xe2}, 
+{0xcd,0x65,0xda,0xf4}, {0xd5,0x06,0x05,0xbe}, {0x1f,0xd1,0x34,0x62}, {0x8a,0xc4,0xa6,0xfe}, 
+{0x9d,0x34,0x2e,0x53}, {0xa0,0xa2,0xf3,0x55}, {0x32,0x05,0x8a,0xe1}, {0x75,0xa4,0xf6,0xeb}, 
+{0x39,0x0b,0x83,0xec}, {0xaa,0x40,0x60,0xef}, {0x06,0x5e,0x71,0x9f}, {0x51,0xbd,0x6e,0x10}, 
+{0xf9,0x3e,0x21,0x8a}, {0x3d,0x96,0xdd,0x06}, {0xae,0xdd,0x3e,0x05}, {0x46,0x4d,0xe6,0xbd}, 
+{0xb5,0x91,0x54,0x8d}, {0x05,0x71,0xc4,0x5d}, {0x6f,0x04,0x06,0xd4}, {0xff,0x60,0x50,0x15}, 
+{0x24,0x19,0x98,0xfb}, {0x97,0xd6,0xbd,0xe9}, {0xcc,0x89,0x40,0x43}, {0x77,0x67,0xd9,0x9e}, 
+{0xbd,0xb0,0xe8,0x42}, {0x88,0x07,0x89,0x8b}, {0x38,0xe7,0x19,0x5b}, {0xdb,0x79,0xc8,0xee}, 
+{0x47,0xa1,0x7c,0x0a}, {0xe9,0x7c,0x42,0x0f}, {0xc9,0xf8,0x84,0x1e}, {0x00,0x00,0x00,0x00}, 
+{0x83,0x09,0x80,0x86}, {0x48,0x32,0x2b,0xed}, {0xac,0x1e,0x11,0x70}, {0x4e,0x6c,0x5a,0x72}, 
+{0xfb,0xfd,0x0e,0xff}, {0x56,0x0f,0x85,0x38}, {0x1e,0x3d,0xae,0xd5}, {0x27,0x36,0x2d,0x39}, 
+{0x64,0x0a,0x0f,0xd9}, {0x21,0x68,0x5c,0xa6}, {0xd1,0x9b,0x5b,0x54}, {0x3a,0x24,0x36,0x2e}, 
+{0xb1,0x0c,0x0a,0x67}, {0x0f,0x93,0x57,0xe7}, {0xd2,0xb4,0xee,0x96}, {0x9e,0x1b,0x9b,0x91}, 
+{0x4f,0x80,0xc0,0xc5}, {0xa2,0x61,0xdc,0x20}, {0x69,0x5a,0x77,0x4b}, {0x16,0x1c,0x12,0x1a}, 
+{0x0a,0xe2,0x93,0xba}, {0xe5,0xc0,0xa0,0x2a}, {0x43,0x3c,0x22,0xe0}, {0x1d,0x12,0x1b,0x17}, 
+{0x0b,0x0e,0x09,0x0d}, {0xad,0xf2,0x8b,0xc7}, {0xb9,0x2d,0xb6,0xa8}, {0xc8,0x14,0x1e,0xa9}, 
+{0x85,0x57,0xf1,0x19}, {0x4c,0xaf,0x75,0x07}, {0xbb,0xee,0x99,0xdd}, {0xfd,0xa3,0x7f,0x60}, 
+{0x9f,0xf7,0x01,0x26}, {0xbc,0x5c,0x72,0xf5}, {0xc5,0x44,0x66,0x3b}, {0x34,0x5b,0xfb,0x7e}, 
+{0x76,0x8b,0x43,0x29}, {0xdc,0xcb,0x23,0xc6}, {0x68,0xb6,0xed,0xfc}, {0x63,0xb8,0xe4,0xf1}, 
+{0xca,0xd7,0x31,0xdc}, {0x10,0x42,0x63,0x85}, {0x40,0x13,0x97,0x22}, {0x20,0x84,0xc6,0x11}, 
+{0x7d,0x85,0x4a,0x24}, {0xf8,0xd2,0xbb,0x3d}, {0x11,0xae,0xf9,0x32}, {0x6d,0xc7,0x29,0xa1}, 
+{0x4b,0x1d,0x9e,0x2f}, {0xf3,0xdc,0xb2,0x30}, {0xec,0x0d,0x86,0x52}, {0xd0,0x77,0xc1,0xe3}, 
+{0x6c,0x2b,0xb3,0x16}, {0x99,0xa9,0x70,0xb9}, {0xfa,0x11,0x94,0x48}, {0x22,0x47,0xe9,0x64}, 
+{0xc4,0xa8,0xfc,0x8c}, {0x1a,0xa0,0xf0,0x3f}, {0xd8,0x56,0x7d,0x2c}, {0xef,0x22,0x33,0x90}, 
+{0xc7,0x87,0x49,0x4e}, {0xc1,0xd9,0x38,0xd1}, {0xfe,0x8c,0xca,0xa2}, {0x36,0x98,0xd4,0x0b}, 
+{0xcf,0xa6,0xf5,0x81}, {0x28,0xa5,0x7a,0xde}, {0x26,0xda,0xb7,0x8e}, {0xa4,0x3f,0xad,0xbf}, 
+{0xe4,0x2c,0x3a,0x9d}, {0x0d,0x50,0x78,0x92}, {0x9b,0x6a,0x5f,0xcc}, {0x62,0x54,0x7e,0x46}, 
+{0xc2,0xf6,0x8d,0x13}, {0xe8,0x90,0xd8,0xb8}, {0x5e,0x2e,0x39,0xf7}, {0xf5,0x82,0xc3,0xaf}, 
+{0xbe,0x9f,0x5d,0x80}, {0x7c,0x69,0xd0,0x93}, {0xa9,0x6f,0xd5,0x2d}, {0xb3,0xcf,0x25,0x12}, 
+{0x3b,0xc8,0xac,0x99}, {0xa7,0x10,0x18,0x7d}, {0x6e,0xe8,0x9c,0x63}, {0x7b,0xdb,0x3b,0xbb}, 
+{0x09,0xcd,0x26,0x78}, {0xf4,0x6e,0x59,0x18}, {0x01,0xec,0x9a,0xb7}, {0xa8,0x83,0x4f,0x9a}, 
+{0x65,0xe6,0x95,0x6e}, {0x7e,0xaa,0xff,0xe6}, {0x08,0x21,0xbc,0xcf}, {0xe6,0xef,0x15,0xe8}, 
+{0xd9,0xba,0xe7,0x9b}, {0xce,0x4a,0x6f,0x36}, {0xd4,0xea,0x9f,0x09}, {0xd6,0x29,0xb0,0x7c}, 
+{0xaf,0x31,0xa4,0xb2}, {0x31,0x2a,0x3f,0x23}, {0x30,0xc6,0xa5,0x94}, {0xc0,0x35,0xa2,0x66}, 
+{0x37,0x74,0x4e,0xbc}, {0xa6,0xfc,0x82,0xca}, {0xb0,0xe0,0x90,0xd0}, {0x15,0x33,0xa7,0xd8}, 
+{0x4a,0xf1,0x04,0x98}, {0xf7,0x41,0xec,0xda}, {0x0e,0x7f,0xcd,0x50}, {0x2f,0x17,0x91,0xf6}, 
+{0x8d,0x76,0x4d,0xd6}, {0x4d,0x43,0xef,0xb0}, {0x54,0xcc,0xaa,0x4d}, {0xdf,0xe4,0x96,0x04}, 
+{0xe3,0x9e,0xd1,0xb5}, {0x1b,0x4c,0x6a,0x88}, {0xb8,0xc1,0x2c,0x1f}, {0x7f,0x46,0x65,0x51}, 
+{0x04,0x9d,0x5e,0xea}, {0x5d,0x01,0x8c,0x35}, {0x73,0xfa,0x87,0x74}, {0x2e,0xfb,0x0b,0x41}, 
+{0x5a,0xb3,0x67,0x1d}, {0x52,0x92,0xdb,0xd2}, {0x33,0xe9,0x10,0x56}, {0x13,0x6d,0xd6,0x47}, 
+{0x8c,0x9a,0xd7,0x61}, {0x7a,0x37,0xa1,0x0c}, {0x8e,0x59,0xf8,0x14}, {0x89,0xeb,0x13,0x3c}, 
+{0xee,0xce,0xa9,0x27}, {0x35,0xb7,0x61,0xc9}, {0xed,0xe1,0x1c,0xe5}, {0x3c,0x7a,0x47,0xb1}, 
+{0x59,0x9c,0xd2,0xdf}, {0x3f,0x55,0xf2,0x73}, {0x79,0x18,0x14,0xce}, {0xbf,0x73,0xc7,0x37}, 
+{0xea,0x53,0xf7,0xcd}, {0x5b,0x5f,0xfd,0xaa}, {0x14,0xdf,0x3d,0x6f}, {0x86,0x78,0x44,0xdb}, 
+{0x81,0xca,0xaf,0xf3}, {0x3e,0xb9,0x68,0xc4}, {0x2c,0x38,0x24,0x34}, {0x5f,0xc2,0xa3,0x40}, 
+{0x72,0x16,0x1d,0xc3}, {0x0c,0xbc,0xe2,0x25}, {0x8b,0x28,0x3c,0x49}, {0x41,0xff,0x0d,0x95}, 
+{0x71,0x39,0xa8,0x01}, {0xde,0x08,0x0c,0xb3}, {0x9c,0xd8,0xb4,0xe4}, {0x90,0x64,0x56,0xc1}, 
+{0x61,0x7b,0xcb,0x84}, {0x70,0xd5,0x32,0xb6}, {0x74,0x48,0x6c,0x5c}, {0x42,0xd0,0xb8,0x57},
+};
+
+static word8 T7[256][4] = {
+{0xa7,0x50,0x51,0xf4}, {0x65,0x53,0x7e,0x41}, {0xa4,0xc3,0x1a,0x17}, {0x5e,0x96,0x3a,0x27}, 
+{0x6b,0xcb,0x3b,0xab}, {0x45,0xf1,0x1f,0x9d}, {0x58,0xab,0xac,0xfa}, {0x03,0x93,0x4b,0xe3}, 
+{0xfa,0x55,0x20,0x30}, {0x6d,0xf6,0xad,0x76}, {0x76,0x91,0x88,0xcc}, {0x4c,0x25,0xf5,0x02}, 
+{0xd7,0xfc,0x4f,0xe5}, {0xcb,0xd7,0xc5,0x2a}, {0x44,0x80,0x26,0x35}, {0xa3,0x8f,0xb5,0x62}, 
+{0x5a,0x49,0xde,0xb1}, {0x1b,0x67,0x25,0xba}, {0x0e,0x98,0x45,0xea}, {0xc0,0xe1,0x5d,0xfe}, 
+{0x75,0x02,0xc3,0x2f}, {0xf0,0x12,0x81,0x4c}, {0x97,0xa3,0x8d,0x46}, {0xf9,0xc6,0x6b,0xd3}, 
+{0x5f,0xe7,0x03,0x8f}, {0x9c,0x95,0x15,0x92}, {0x7a,0xeb,0xbf,0x6d}, {0x59,0xda,0x95,0x52}, 
+{0x83,0x2d,0xd4,0xbe}, {0x21,0xd3,0x58,0x74}, {0x69,0x29,0x49,0xe0}, {0xc8,0x44,0x8e,0xc9}, 
+{0x89,0x6a,0x75,0xc2}, {0x79,0x78,0xf4,0x8e}, {0x3e,0x6b,0x99,0x58}, {0x71,0xdd,0x27,0xb9}, 
+{0x4f,0xb6,0xbe,0xe1}, {0xad,0x17,0xf0,0x88}, {0xac,0x66,0xc9,0x20}, {0x3a,0xb4,0x7d,0xce}, 
+{0x4a,0x18,0x63,0xdf}, {0x31,0x82,0xe5,0x1a}, {0x33,0x60,0x97,0x51}, {0x7f,0x45,0x62,0x53}, 
+{0x77,0xe0,0xb1,0x64}, {0xae,0x84,0xbb,0x6b}, {0xa0,0x1c,0xfe,0x81}, {0x2b,0x94,0xf9,0x08}, 
+{0x68,0x58,0x70,0x48}, {0xfd,0x19,0x8f,0x45}, {0x6c,0x87,0x94,0xde}, {0xf8,0xb7,0x52,0x7b}, 
+{0xd3,0x23,0xab,0x73}, {0x02,0xe2,0x72,0x4b}, {0x8f,0x57,0xe3,0x1f}, {0xab,0x2a,0x66,0x55}, 
+{0x28,0x07,0xb2,0xeb}, {0xc2,0x03,0x2f,0xb5}, {0x7b,0x9a,0x86,0xc5}, {0x08,0xa5,0xd3,0x37}, 
+{0x87,0xf2,0x30,0x28}, {0xa5,0xb2,0x23,0xbf}, {0x6a,0xba,0x02,0x03}, {0x82,0x5c,0xed,0x16}, 
+{0x1c,0x2b,0x8a,0xcf}, {0xb4,0x92,0xa7,0x79}, {0xf2,0xf0,0xf3,0x07}, {0xe2,0xa1,0x4e,0x69}, 
+{0xf4,0xcd,0x65,0xda}, {0xbe,0xd5,0x06,0x05}, {0x62,0x1f,0xd1,0x34}, {0xfe,0x8a,0xc4,0xa6}, 
+{0x53,0x9d,0x34,0x2e}, {0x55,0xa0,0xa2,0xf3}, {0xe1,0x32,0x05,0x8a}, {0xeb,0x75,0xa4,0xf6}, 
+{0xec,0x39,0x0b,0x83}, {0xef,0xaa,0x40,0x60}, {0x9f,0x06,0x5e,0x71}, {0x10,0x51,0xbd,0x6e}, 
+{0x8a,0xf9,0x3e,0x21}, {0x06,0x3d,0x96,0xdd}, {0x05,0xae,0xdd,0x3e}, {0xbd,0x46,0x4d,0xe6}, 
+{0x8d,0xb5,0x91,0x54}, {0x5d,0x05,0x71,0xc4}, {0xd4,0x6f,0x04,0x06}, {0x15,0xff,0x60,0x50}, 
+{0xfb,0x24,0x19,0x98}, {0xe9,0x97,0xd6,0xbd}, {0x43,0xcc,0x89,0x40}, {0x9e,0x77,0x67,0xd9}, 
+{0x42,0xbd,0xb0,0xe8}, {0x8b,0x88,0x07,0x89}, {0x5b,0x38,0xe7,0x19}, {0xee,0xdb,0x79,0xc8}, 
+{0x0a,0x47,0xa1,0x7c}, {0x0f,0xe9,0x7c,0x42}, {0x1e,0xc9,0xf8,0x84}, {0x00,0x00,0x00,0x00}, 
+{0x86,0x83,0x09,0x80}, {0xed,0x48,0x32,0x2b}, {0x70,0xac,0x1e,0x11}, {0x72,0x4e,0x6c,0x5a}, 
+{0xff,0xfb,0xfd,0x0e}, {0x38,0x56,0x0f,0x85}, {0xd5,0x1e,0x3d,0xae}, {0x39,0x27,0x36,0x2d}, 
+{0xd9,0x64,0x0a,0x0f}, {0xa6,0x21,0x68,0x5c}, {0x54,0xd1,0x9b,0x5b}, {0x2e,0x3a,0x24,0x36}, 
+{0x67,0xb1,0x0c,0x0a}, {0xe7,0x0f,0x93,0x57}, {0x96,0xd2,0xb4,0xee}, {0x91,0x9e,0x1b,0x9b}, 
+{0xc5,0x4f,0x80,0xc0}, {0x20,0xa2,0x61,0xdc}, {0x4b,0x69,0x5a,0x77}, {0x1a,0x16,0x1c,0x12}, 
+{0xba,0x0a,0xe2,0x93}, {0x2a,0xe5,0xc0,0xa0}, {0xe0,0x43,0x3c,0x22}, {0x17,0x1d,0x12,0x1b}, 
+{0x0d,0x0b,0x0e,0x09}, {0xc7,0xad,0xf2,0x8b}, {0xa8,0xb9,0x2d,0xb6}, {0xa9,0xc8,0x14,0x1e}, 
+{0x19,0x85,0x57,0xf1}, {0x07,0x4c,0xaf,0x75}, {0xdd,0xbb,0xee,0x99}, {0x60,0xfd,0xa3,0x7f}, 
+{0x26,0x9f,0xf7,0x01}, {0xf5,0xbc,0x5c,0x72}, {0x3b,0xc5,0x44,0x66}, {0x7e,0x34,0x5b,0xfb}, 
+{0x29,0x76,0x8b,0x43}, {0xc6,0xdc,0xcb,0x23}, {0xfc,0x68,0xb6,0xed}, {0xf1,0x63,0xb8,0xe4}, 
+{0xdc,0xca,0xd7,0x31}, {0x85,0x10,0x42,0x63}, {0x22,0x40,0x13,0x97}, {0x11,0x20,0x84,0xc6}, 
+{0x24,0x7d,0x85,0x4a}, {0x3d,0xf8,0xd2,0xbb}, {0x32,0x11,0xae,0xf9}, {0xa1,0x6d,0xc7,0x29}, 
+{0x2f,0x4b,0x1d,0x9e}, {0x30,0xf3,0xdc,0xb2}, {0x52,0xec,0x0d,0x86}, {0xe3,0xd0,0x77,0xc1}, 
+{0x16,0x6c,0x2b,0xb3}, {0xb9,0x99,0xa9,0x70}, {0x48,0xfa,0x11,0x94}, {0x64,0x22,0x47,0xe9}, 
+{0x8c,0xc4,0xa8,0xfc}, {0x3f,0x1a,0xa0,0xf0}, {0x2c,0xd8,0x56,0x7d}, {0x90,0xef,0x22,0x33}, 
+{0x4e,0xc7,0x87,0x49}, {0xd1,0xc1,0xd9,0x38}, {0xa2,0xfe,0x8c,0xca}, {0x0b,0x36,0x98,0xd4}, 
+{0x81,0xcf,0xa6,0xf5}, {0xde,0x28,0xa5,0x7a}, {0x8e,0x26,0xda,0xb7}, {0xbf,0xa4,0x3f,0xad}, 
+{0x9d,0xe4,0x2c,0x3a}, {0x92,0x0d,0x50,0x78}, {0xcc,0x9b,0x6a,0x5f}, {0x46,0x62,0x54,0x7e}, 
+{0x13,0xc2,0xf6,0x8d}, {0xb8,0xe8,0x90,0xd8}, {0xf7,0x5e,0x2e,0x39}, {0xaf,0xf5,0x82,0xc3}, 
+{0x80,0xbe,0x9f,0x5d}, {0x93,0x7c,0x69,0xd0}, {0x2d,0xa9,0x6f,0xd5}, {0x12,0xb3,0xcf,0x25}, 
+{0x99,0x3b,0xc8,0xac}, {0x7d,0xa7,0x10,0x18}, {0x63,0x6e,0xe8,0x9c}, {0xbb,0x7b,0xdb,0x3b}, 
+{0x78,0x09,0xcd,0x26}, {0x18,0xf4,0x6e,0x59}, {0xb7,0x01,0xec,0x9a}, {0x9a,0xa8,0x83,0x4f}, 
+{0x6e,0x65,0xe6,0x95}, {0xe6,0x7e,0xaa,0xff}, {0xcf,0x08,0x21,0xbc}, {0xe8,0xe6,0xef,0x15}, 
+{0x9b,0xd9,0xba,0xe7}, {0x36,0xce,0x4a,0x6f}, {0x09,0xd4,0xea,0x9f}, {0x7c,0xd6,0x29,0xb0}, 
+{0xb2,0xaf,0x31,0xa4}, {0x23,0x31,0x2a,0x3f}, {0x94,0x30,0xc6,0xa5}, {0x66,0xc0,0x35,0xa2}, 
+{0xbc,0x37,0x74,0x4e}, {0xca,0xa6,0xfc,0x82}, {0xd0,0xb0,0xe0,0x90}, {0xd8,0x15,0x33,0xa7}, 
+{0x98,0x4a,0xf1,0x04}, {0xda,0xf7,0x41,0xec}, {0x50,0x0e,0x7f,0xcd}, {0xf6,0x2f,0x17,0x91}, 
+{0xd6,0x8d,0x76,0x4d}, {0xb0,0x4d,0x43,0xef}, {0x4d,0x54,0xcc,0xaa}, {0x04,0xdf,0xe4,0x96}, 
+{0xb5,0xe3,0x9e,0xd1}, {0x88,0x1b,0x4c,0x6a}, {0x1f,0xb8,0xc1,0x2c}, {0x51,0x7f,0x46,0x65}, 
+{0xea,0x04,0x9d,0x5e}, {0x35,0x5d,0x01,0x8c}, {0x74,0x73,0xfa,0x87}, {0x41,0x2e,0xfb,0x0b}, 
+{0x1d,0x5a,0xb3,0x67}, {0xd2,0x52,0x92,0xdb}, {0x56,0x33,0xe9,0x10}, {0x47,0x13,0x6d,0xd6}, 
+{0x61,0x8c,0x9a,0xd7}, {0x0c,0x7a,0x37,0xa1}, {0x14,0x8e,0x59,0xf8}, {0x3c,0x89,0xeb,0x13}, 
+{0x27,0xee,0xce,0xa9}, {0xc9,0x35,0xb7,0x61}, {0xe5,0xed,0xe1,0x1c}, {0xb1,0x3c,0x7a,0x47}, 
+{0xdf,0x59,0x9c,0xd2}, {0x73,0x3f,0x55,0xf2}, {0xce,0x79,0x18,0x14}, {0x37,0xbf,0x73,0xc7}, 
+{0xcd,0xea,0x53,0xf7}, {0xaa,0x5b,0x5f,0xfd}, {0x6f,0x14,0xdf,0x3d}, {0xdb,0x86,0x78,0x44}, 
+{0xf3,0x81,0xca,0xaf}, {0xc4,0x3e,0xb9,0x68}, {0x34,0x2c,0x38,0x24}, {0x40,0x5f,0xc2,0xa3}, 
+{0xc3,0x72,0x16,0x1d}, {0x25,0x0c,0xbc,0xe2}, {0x49,0x8b,0x28,0x3c}, {0x95,0x41,0xff,0x0d}, 
+{0x01,0x71,0x39,0xa8}, {0xb3,0xde,0x08,0x0c}, {0xe4,0x9c,0xd8,0xb4}, {0xc1,0x90,0x64,0x56}, 
+{0x84,0x61,0x7b,0xcb}, {0xb6,0x70,0xd5,0x32}, {0x5c,0x74,0x48,0x6c}, {0x57,0x42,0xd0,0xb8},
+};
+
+static word8 T8[256][4] = {
+{0xf4,0xa7,0x50,0x51}, {0x41,0x65,0x53,0x7e}, {0x17,0xa4,0xc3,0x1a}, {0x27,0x5e,0x96,0x3a}, 
+{0xab,0x6b,0xcb,0x3b}, {0x9d,0x45,0xf1,0x1f}, {0xfa,0x58,0xab,0xac}, {0xe3,0x03,0x93,0x4b}, 
+{0x30,0xfa,0x55,0x20}, {0x76,0x6d,0xf6,0xad}, {0xcc,0x76,0x91,0x88}, {0x02,0x4c,0x25,0xf5}, 
+{0xe5,0xd7,0xfc,0x4f}, {0x2a,0xcb,0xd7,0xc5}, {0x35,0x44,0x80,0x26}, {0x62,0xa3,0x8f,0xb5}, 
+{0xb1,0x5a,0x49,0xde}, {0xba,0x1b,0x67,0x25}, {0xea,0x0e,0x98,0x45}, {0xfe,0xc0,0xe1,0x5d}, 
+{0x2f,0x75,0x02,0xc3}, {0x4c,0xf0,0x12,0x81}, {0x46,0x97,0xa3,0x8d}, {0xd3,0xf9,0xc6,0x6b}, 
+{0x8f,0x5f,0xe7,0x03}, {0x92,0x9c,0x95,0x15}, {0x6d,0x7a,0xeb,0xbf}, {0x52,0x59,0xda,0x95}, 
+{0xbe,0x83,0x2d,0xd4}, {0x74,0x21,0xd3,0x58}, {0xe0,0x69,0x29,0x49}, {0xc9,0xc8,0x44,0x8e}, 
+{0xc2,0x89,0x6a,0x75}, {0x8e,0x79,0x78,0xf4}, {0x58,0x3e,0x6b,0x99}, {0xb9,0x71,0xdd,0x27}, 
+{0xe1,0x4f,0xb6,0xbe}, {0x88,0xad,0x17,0xf0}, {0x20,0xac,0x66,0xc9}, {0xce,0x3a,0xb4,0x7d}, 
+{0xdf,0x4a,0x18,0x63}, {0x1a,0x31,0x82,0xe5}, {0x51,0x33,0x60,0x97}, {0x53,0x7f,0x45,0x62}, 
+{0x64,0x77,0xe0,0xb1}, {0x6b,0xae,0x84,0xbb}, {0x81,0xa0,0x1c,0xfe}, {0x08,0x2b,0x94,0xf9}, 
+{0x48,0x68,0x58,0x70}, {0x45,0xfd,0x19,0x8f}, {0xde,0x6c,0x87,0x94}, {0x7b,0xf8,0xb7,0x52}, 
+{0x73,0xd3,0x23,0xab}, {0x4b,0x02,0xe2,0x72}, {0x1f,0x8f,0x57,0xe3}, {0x55,0xab,0x2a,0x66}, 
+{0xeb,0x28,0x07,0xb2}, {0xb5,0xc2,0x03,0x2f}, {0xc5,0x7b,0x9a,0x86}, {0x37,0x08,0xa5,0xd3}, 
+{0x28,0x87,0xf2,0x30}, {0xbf,0xa5,0xb2,0x23}, {0x03,0x6a,0xba,0x02}, {0x16,0x82,0x5c,0xed}, 
+{0xcf,0x1c,0x2b,0x8a}, {0x79,0xb4,0x92,0xa7}, {0x07,0xf2,0xf0,0xf3}, {0x69,0xe2,0xa1,0x4e}, 
+{0xda,0xf4,0xcd,0x65}, {0x05,0xbe,0xd5,0x06}, {0x34,0x62,0x1f,0xd1}, {0xa6,0xfe,0x8a,0xc4}, 
+{0x2e,0x53,0x9d,0x34}, {0xf3,0x55,0xa0,0xa2}, {0x8a,0xe1,0x32,0x05}, {0xf6,0xeb,0x75,0xa4}, 
+{0x83,0xec,0x39,0x0b}, {0x60,0xef,0xaa,0x40}, {0x71,0x9f,0x06,0x5e}, {0x6e,0x10,0x51,0xbd}, 
+{0x21,0x8a,0xf9,0x3e}, {0xdd,0x06,0x3d,0x96}, {0x3e,0x05,0xae,0xdd}, {0xe6,0xbd,0x46,0x4d}, 
+{0x54,0x8d,0xb5,0x91}, {0xc4,0x5d,0x05,0x71}, {0x06,0xd4,0x6f,0x04}, {0x50,0x15,0xff,0x60}, 
+{0x98,0xfb,0x24,0x19}, {0xbd,0xe9,0x97,0xd6}, {0x40,0x43,0xcc,0x89}, {0xd9,0x9e,0x77,0x67}, 
+{0xe8,0x42,0xbd,0xb0}, {0x89,0x8b,0x88,0x07}, {0x19,0x5b,0x38,0xe7}, {0xc8,0xee,0xdb,0x79}, 
+{0x7c,0x0a,0x47,0xa1}, {0x42,0x0f,0xe9,0x7c}, {0x84,0x1e,0xc9,0xf8}, {0x00,0x00,0x00,0x00}, 
+{0x80,0x86,0x83,0x09}, {0x2b,0xed,0x48,0x32}, {0x11,0x70,0xac,0x1e}, {0x5a,0x72,0x4e,0x6c}, 
+{0x0e,0xff,0xfb,0xfd}, {0x85,0x38,0x56,0x0f}, {0xae,0xd5,0x1e,0x3d}, {0x2d,0x39,0x27,0x36}, 
+{0x0f,0xd9,0x64,0x0a}, {0x5c,0xa6,0x21,0x68}, {0x5b,0x54,0xd1,0x9b}, {0x36,0x2e,0x3a,0x24}, 
+{0x0a,0x67,0xb1,0x0c}, {0x57,0xe7,0x0f,0x93}, {0xee,0x96,0xd2,0xb4}, {0x9b,0x91,0x9e,0x1b}, 
+{0xc0,0xc5,0x4f,0x80}, {0xdc,0x20,0xa2,0x61}, {0x77,0x4b,0x69,0x5a}, {0x12,0x1a,0x16,0x1c}, 
+{0x93,0xba,0x0a,0xe2}, {0xa0,0x2a,0xe5,0xc0}, {0x22,0xe0,0x43,0x3c}, {0x1b,0x17,0x1d,0x12}, 
+{0x09,0x0d,0x0b,0x0e}, {0x8b,0xc7,0xad,0xf2}, {0xb6,0xa8,0xb9,0x2d}, {0x1e,0xa9,0xc8,0x14}, 
+{0xf1,0x19,0x85,0x57}, {0x75,0x07,0x4c,0xaf}, {0x99,0xdd,0xbb,0xee}, {0x7f,0x60,0xfd,0xa3}, 
+{0x01,0x26,0x9f,0xf7}, {0x72,0xf5,0xbc,0x5c}, {0x66,0x3b,0xc5,0x44}, {0xfb,0x7e,0x34,0x5b}, 
+{0x43,0x29,0x76,0x8b}, {0x23,0xc6,0xdc,0xcb}, {0xed,0xfc,0x68,0xb6}, {0xe4,0xf1,0x63,0xb8}, 
+{0x31,0xdc,0xca,0xd7}, {0x63,0x85,0x10,0x42}, {0x97,0x22,0x40,0x13}, {0xc6,0x11,0x20,0x84}, 
+{0x4a,0x24,0x7d,0x85}, {0xbb,0x3d,0xf8,0xd2}, {0xf9,0x32,0x11,0xae}, {0x29,0xa1,0x6d,0xc7}, 
+{0x9e,0x2f,0x4b,0x1d}, {0xb2,0x30,0xf3,0xdc}, {0x86,0x52,0xec,0x0d}, {0xc1,0xe3,0xd0,0x77}, 
+{0xb3,0x16,0x6c,0x2b}, {0x70,0xb9,0x99,0xa9}, {0x94,0x48,0xfa,0x11}, {0xe9,0x64,0x22,0x47}, 
+{0xfc,0x8c,0xc4,0xa8}, {0xf0,0x3f,0x1a,0xa0}, {0x7d,0x2c,0xd8,0x56}, {0x33,0x90,0xef,0x22}, 
+{0x49,0x4e,0xc7,0x87}, {0x38,0xd1,0xc1,0xd9}, {0xca,0xa2,0xfe,0x8c}, {0xd4,0x0b,0x36,0x98}, 
+{0xf5,0x81,0xcf,0xa6}, {0x7a,0xde,0x28,0xa5}, {0xb7,0x8e,0x26,0xda}, {0xad,0xbf,0xa4,0x3f}, 
+{0x3a,0x9d,0xe4,0x2c}, {0x78,0x92,0x0d,0x50}, {0x5f,0xcc,0x9b,0x6a}, {0x7e,0x46,0x62,0x54}, 
+{0x8d,0x13,0xc2,0xf6}, {0xd8,0xb8,0xe8,0x90}, {0x39,0xf7,0x5e,0x2e}, {0xc3,0xaf,0xf5,0x82}, 
+{0x5d,0x80,0xbe,0x9f}, {0xd0,0x93,0x7c,0x69}, {0xd5,0x2d,0xa9,0x6f}, {0x25,0x12,0xb3,0xcf}, 
+{0xac,0x99,0x3b,0xc8}, {0x18,0x7d,0xa7,0x10}, {0x9c,0x63,0x6e,0xe8}, {0x3b,0xbb,0x7b,0xdb}, 
+{0x26,0x78,0x09,0xcd}, {0x59,0x18,0xf4,0x6e}, {0x9a,0xb7,0x01,0xec}, {0x4f,0x9a,0xa8,0x83}, 
+{0x95,0x6e,0x65,0xe6}, {0xff,0xe6,0x7e,0xaa}, {0xbc,0xcf,0x08,0x21}, {0x15,0xe8,0xe6,0xef}, 
+{0xe7,0x9b,0xd9,0xba}, {0x6f,0x36,0xce,0x4a}, {0x9f,0x09,0xd4,0xea}, {0xb0,0x7c,0xd6,0x29}, 
+{0xa4,0xb2,0xaf,0x31}, {0x3f,0x23,0x31,0x2a}, {0xa5,0x94,0x30,0xc6}, {0xa2,0x66,0xc0,0x35}, 
+{0x4e,0xbc,0x37,0x74}, {0x82,0xca,0xa6,0xfc}, {0x90,0xd0,0xb0,0xe0}, {0xa7,0xd8,0x15,0x33}, 
+{0x04,0x98,0x4a,0xf1}, {0xec,0xda,0xf7,0x41}, {0xcd,0x50,0x0e,0x7f}, {0x91,0xf6,0x2f,0x17}, 
+{0x4d,0xd6,0x8d,0x76}, {0xef,0xb0,0x4d,0x43}, {0xaa,0x4d,0x54,0xcc}, {0x96,0x04,0xdf,0xe4}, 
+{0xd1,0xb5,0xe3,0x9e}, {0x6a,0x88,0x1b,0x4c}, {0x2c,0x1f,0xb8,0xc1}, {0x65,0x51,0x7f,0x46}, 
+{0x5e,0xea,0x04,0x9d}, {0x8c,0x35,0x5d,0x01}, {0x87,0x74,0x73,0xfa}, {0x0b,0x41,0x2e,0xfb}, 
+{0x67,0x1d,0x5a,0xb3}, {0xdb,0xd2,0x52,0x92}, {0x10,0x56,0x33,0xe9}, {0xd6,0x47,0x13,0x6d}, 
+{0xd7,0x61,0x8c,0x9a}, {0xa1,0x0c,0x7a,0x37}, {0xf8,0x14,0x8e,0x59}, {0x13,0x3c,0x89,0xeb}, 
+{0xa9,0x27,0xee,0xce}, {0x61,0xc9,0x35,0xb7}, {0x1c,0xe5,0xed,0xe1}, {0x47,0xb1,0x3c,0x7a}, 
+{0xd2,0xdf,0x59,0x9c}, {0xf2,0x73,0x3f,0x55}, {0x14,0xce,0x79,0x18}, {0xc7,0x37,0xbf,0x73}, 
+{0xf7,0xcd,0xea,0x53}, {0xfd,0xaa,0x5b,0x5f}, {0x3d,0x6f,0x14,0xdf}, {0x44,0xdb,0x86,0x78}, 
+{0xaf,0xf3,0x81,0xca}, {0x68,0xc4,0x3e,0xb9}, {0x24,0x34,0x2c,0x38}, {0xa3,0x40,0x5f,0xc2}, 
+{0x1d,0xc3,0x72,0x16}, {0xe2,0x25,0x0c,0xbc}, {0x3c,0x49,0x8b,0x28}, {0x0d,0x95,0x41,0xff}, 
+{0xa8,0x01,0x71,0x39}, {0x0c,0xb3,0xde,0x08}, {0xb4,0xe4,0x9c,0xd8}, {0x56,0xc1,0x90,0x64}, 
+{0xcb,0x84,0x61,0x7b}, {0x32,0xb6,0x70,0xd5}, {0x6c,0x5c,0x74,0x48}, {0xb8,0x57,0x42,0xd0},
+};
+
+static word8 S5[256] = {
+0x52,0x09,0x6a,0xd5,
+0x30,0x36,0xa5,0x38,
+0xbf,0x40,0xa3,0x9e,
+0x81,0xf3,0xd7,0xfb,
+0x7c,0xe3,0x39,0x82,
+0x9b,0x2f,0xff,0x87,
+0x34,0x8e,0x43,0x44,
+0xc4,0xde,0xe9,0xcb,
+0x54,0x7b,0x94,0x32,
+0xa6,0xc2,0x23,0x3d,
+0xee,0x4c,0x95,0x0b,
+0x42,0xfa,0xc3,0x4e,
+0x08,0x2e,0xa1,0x66,
+0x28,0xd9,0x24,0xb2,
+0x76,0x5b,0xa2,0x49,
+0x6d,0x8b,0xd1,0x25,
+0x72,0xf8,0xf6,0x64,
+0x86,0x68,0x98,0x16,
+0xd4,0xa4,0x5c,0xcc,
+0x5d,0x65,0xb6,0x92,
+0x6c,0x70,0x48,0x50,
+0xfd,0xed,0xb9,0xda,
+0x5e,0x15,0x46,0x57,
+0xa7,0x8d,0x9d,0x84,
+0x90,0xd8,0xab,0x00,
+0x8c,0xbc,0xd3,0x0a,
+0xf7,0xe4,0x58,0x05,
+0xb8,0xb3,0x45,0x06,
+0xd0,0x2c,0x1e,0x8f,
+0xca,0x3f,0x0f,0x02,
+0xc1,0xaf,0xbd,0x03,
+0x01,0x13,0x8a,0x6b,
+0x3a,0x91,0x11,0x41,
+0x4f,0x67,0xdc,0xea,
+0x97,0xf2,0xcf,0xce,
+0xf0,0xb4,0xe6,0x73,
+0x96,0xac,0x74,0x22,
+0xe7,0xad,0x35,0x85,
+0xe2,0xf9,0x37,0xe8,
+0x1c,0x75,0xdf,0x6e,
+0x47,0xf1,0x1a,0x71,
+0x1d,0x29,0xc5,0x89,
+0x6f,0xb7,0x62,0x0e,
+0xaa,0x18,0xbe,0x1b,
+0xfc,0x56,0x3e,0x4b,
+0xc6,0xd2,0x79,0x20,
+0x9a,0xdb,0xc0,0xfe,
+0x78,0xcd,0x5a,0xf4,
+0x1f,0xdd,0xa8,0x33,
+0x88,0x07,0xc7,0x31,
+0xb1,0x12,0x10,0x59,
+0x27,0x80,0xec,0x5f,
+0x60,0x51,0x7f,0xa9,
+0x19,0xb5,0x4a,0x0d,
+0x2d,0xe5,0x7a,0x9f,
+0x93,0xc9,0x9c,0xef,
+0xa0,0xe0,0x3b,0x4d,
+0xae,0x2a,0xf5,0xb0,
+0xc8,0xeb,0xbb,0x3c,
+0x83,0x53,0x99,0x61,
+0x17,0x2b,0x04,0x7e,
+0xba,0x77,0xd6,0x26,
+0xe1,0x69,0x14,0x63,
+0x55,0x21,0x0c,0x7d
+};
+
+static word8 U1[256][4] = {
+{0x00,0x00,0x00,0x00}, {0x0e,0x09,0x0d,0x0b}, {0x1c,0x12,0x1a,0x16}, {0x12,0x1b,0x17,0x1d}, 
+{0x38,0x24,0x34,0x2c}, {0x36,0x2d,0x39,0x27}, {0x24,0x36,0x2e,0x3a}, {0x2a,0x3f,0x23,0x31}, 
+{0x70,0x48,0x68,0x58}, {0x7e,0x41,0x65,0x53}, {0x6c,0x5a,0x72,0x4e}, {0x62,0x53,0x7f,0x45}, 
+{0x48,0x6c,0x5c,0x74}, {0x46,0x65,0x51,0x7f}, {0x54,0x7e,0x46,0x62}, {0x5a,0x77,0x4b,0x69}, 
+{0xe0,0x90,0xd0,0xb0}, {0xee,0x99,0xdd,0xbb}, {0xfc,0x82,0xca,0xa6}, {0xf2,0x8b,0xc7,0xad}, 
+{0xd8,0xb4,0xe4,0x9c}, {0xd6,0xbd,0xe9,0x97}, {0xc4,0xa6,0xfe,0x8a}, {0xca,0xaf,0xf3,0x81}, 
+{0x90,0xd8,0xb8,0xe8}, {0x9e,0xd1,0xb5,0xe3}, {0x8c,0xca,0xa2,0xfe}, {0x82,0xc3,0xaf,0xf5}, 
+{0xa8,0xfc,0x8c,0xc4}, {0xa6,0xf5,0x81,0xcf}, {0xb4,0xee,0x96,0xd2}, {0xba,0xe7,0x9b,0xd9}, 
+{0xdb,0x3b,0xbb,0x7b}, {0xd5,0x32,0xb6,0x70}, {0xc7,0x29,0xa1,0x6d}, {0xc9,0x20,0xac,0x66}, 
+{0xe3,0x1f,0x8f,0x57}, {0xed,0x16,0x82,0x5c}, {0xff,0x0d,0x95,0x41}, {0xf1,0x04,0x98,0x4a}, 
+{0xab,0x73,0xd3,0x23}, {0xa5,0x7a,0xde,0x28}, {0xb7,0x61,0xc9,0x35}, {0xb9,0x68,0xc4,0x3e}, 
+{0x93,0x57,0xe7,0x0f}, {0x9d,0x5e,0xea,0x04}, {0x8f,0x45,0xfd,0x19}, {0x81,0x4c,0xf0,0x12}, 
+{0x3b,0xab,0x6b,0xcb}, {0x35,0xa2,0x66,0xc0}, {0x27,0xb9,0x71,0xdd}, {0x29,0xb0,0x7c,0xd6}, 
+{0x03,0x8f,0x5f,0xe7}, {0x0d,0x86,0x52,0xec}, {0x1f,0x9d,0x45,0xf1}, {0x11,0x94,0x48,0xfa}, 
+{0x4b,0xe3,0x03,0x93}, {0x45,0xea,0x0e,0x98}, {0x57,0xf1,0x19,0x85}, {0x59,0xf8,0x14,0x8e}, 
+{0x73,0xc7,0x37,0xbf}, {0x7d,0xce,0x3a,0xb4}, {0x6f,0xd5,0x2d,0xa9}, {0x61,0xdc,0x20,0xa2}, 
+{0xad,0x76,0x6d,0xf6}, {0xa3,0x7f,0x60,0xfd}, {0xb1,0x64,0x77,0xe0}, {0xbf,0x6d,0x7a,0xeb}, 
+{0x95,0x52,0x59,0xda}, {0x9b,0x5b,0x54,0xd1}, {0x89,0x40,0x43,0xcc}, {0x87,0x49,0x4e,0xc7}, 
+{0xdd,0x3e,0x05,0xae}, {0xd3,0x37,0x08,0xa5}, {0xc1,0x2c,0x1f,0xb8}, {0xcf,0x25,0x12,0xb3}, 
+{0xe5,0x1a,0x31,0x82}, {0xeb,0x13,0x3c,0x89}, {0xf9,0x08,0x2b,0x94}, {0xf7,0x01,0x26,0x9f}, 
+{0x4d,0xe6,0xbd,0x46}, {0x43,0xef,0xb0,0x4d}, {0x51,0xf4,0xa7,0x50}, {0x5f,0xfd,0xaa,0x5b}, 
+{0x75,0xc2,0x89,0x6a}, {0x7b,0xcb,0x84,0x61}, {0x69,0xd0,0x93,0x7c}, {0x67,0xd9,0x9e,0x77}, 
+{0x3d,0xae,0xd5,0x1e}, {0x33,0xa7,0xd8,0x15}, {0x21,0xbc,0xcf,0x08}, {0x2f,0xb5,0xc2,0x03}, 
+{0x05,0x8a,0xe1,0x32}, {0x0b,0x83,0xec,0x39}, {0x19,0x98,0xfb,0x24}, {0x17,0x91,0xf6,0x2f}, 
+{0x76,0x4d,0xd6,0x8d}, {0x78,0x44,0xdb,0x86}, {0x6a,0x5f,0xcc,0x9b}, {0x64,0x56,0xc1,0x90}, 
+{0x4e,0x69,0xe2,0xa1}, {0x40,0x60,0xef,0xaa}, {0x52,0x7b,0xf8,0xb7}, {0x5c,0x72,0xf5,0xbc}, 
+{0x06,0x05,0xbe,0xd5}, {0x08,0x0c,0xb3,0xde}, {0x1a,0x17,0xa4,0xc3}, {0x14,0x1e,0xa9,0xc8}, 
+{0x3e,0x21,0x8a,0xf9}, {0x30,0x28,0x87,0xf2}, {0x22,0x33,0x90,0xef}, {0x2c,0x3a,0x9d,0xe4}, 
+{0x96,0xdd,0x06,0x3d}, {0x98,0xd4,0x0b,0x36}, {0x8a,0xcf,0x1c,0x2b}, {0x84,0xc6,0x11,0x20}, 
+{0xae,0xf9,0x32,0x11}, {0xa0,0xf0,0x3f,0x1a}, {0xb2,0xeb,0x28,0x07}, {0xbc,0xe2,0x25,0x0c}, 
+{0xe6,0x95,0x6e,0x65}, {0xe8,0x9c,0x63,0x6e}, {0xfa,0x87,0x74,0x73}, {0xf4,0x8e,0x79,0x78}, 
+{0xde,0xb1,0x5a,0x49}, {0xd0,0xb8,0x57,0x42}, {0xc2,0xa3,0x40,0x5f}, {0xcc,0xaa,0x4d,0x54}, 
+{0x41,0xec,0xda,0xf7}, {0x4f,0xe5,0xd7,0xfc}, {0x5d,0xfe,0xc0,0xe1}, {0x53,0xf7,0xcd,0xea}, 
+{0x79,0xc8,0xee,0xdb}, {0x77,0xc1,0xe3,0xd0}, {0x65,0xda,0xf4,0xcd}, {0x6b,0xd3,0xf9,0xc6}, 
+{0x31,0xa4,0xb2,0xaf}, {0x3f,0xad,0xbf,0xa4}, {0x2d,0xb6,0xa8,0xb9}, {0x23,0xbf,0xa5,0xb2}, 
+{0x09,0x80,0x86,0x83}, {0x07,0x89,0x8b,0x88}, {0x15,0x92,0x9c,0x95}, {0x1b,0x9b,0x91,0x9e}, 
+{0xa1,0x7c,0x0a,0x47}, {0xaf,0x75,0x07,0x4c}, {0xbd,0x6e,0x10,0x51}, {0xb3,0x67,0x1d,0x5a}, 
+{0x99,0x58,0x3e,0x6b}, {0x97,0x51,0x33,0x60}, {0x85,0x4a,0x24,0x7d}, {0x8b,0x43,0x29,0x76}, 
+{0xd1,0x34,0x62,0x1f}, {0xdf,0x3d,0x6f,0x14}, {0xcd,0x26,0x78,0x09}, {0xc3,0x2f,0x75,0x02}, 
+{0xe9,0x10,0x56,0x33}, {0xe7,0x19,0x5b,0x38}, {0xf5,0x02,0x4c,0x25}, {0xfb,0x0b,0x41,0x2e}, 
+{0x9a,0xd7,0x61,0x8c}, {0x94,0xde,0x6c,0x87}, {0x86,0xc5,0x7b,0x9a}, {0x88,0xcc,0x76,0x91}, 
+{0xa2,0xf3,0x55,0xa0}, {0xac,0xfa,0x58,0xab}, {0xbe,0xe1,0x4f,0xb6}, {0xb0,0xe8,0x42,0xbd}, 
+{0xea,0x9f,0x09,0xd4}, {0xe4,0x96,0x04,0xdf}, {0xf6,0x8d,0x13,0xc2}, {0xf8,0x84,0x1e,0xc9}, 
+{0xd2,0xbb,0x3d,0xf8}, {0xdc,0xb2,0x30,0xf3}, {0xce,0xa9,0x27,0xee}, {0xc0,0xa0,0x2a,0xe5}, 
+{0x7a,0x47,0xb1,0x3c}, {0x74,0x4e,0xbc,0x37}, {0x66,0x55,0xab,0x2a}, {0x68,0x5c,0xa6,0x21}, 
+{0x42,0x63,0x85,0x10}, {0x4c,0x6a,0x88,0x1b}, {0x5e,0x71,0x9f,0x06}, {0x50,0x78,0x92,0x0d}, 
+{0x0a,0x0f,0xd9,0x64}, {0x04,0x06,0xd4,0x6f}, {0x16,0x1d,0xc3,0x72}, {0x18,0x14,0xce,0x79}, 
+{0x32,0x2b,0xed,0x48}, {0x3c,0x22,0xe0,0x43}, {0x2e,0x39,0xf7,0x5e}, {0x20,0x30,0xfa,0x55}, 
+{0xec,0x9a,0xb7,0x01}, {0xe2,0x93,0xba,0x0a}, {0xf0,0x88,0xad,0x17}, {0xfe,0x81,0xa0,0x1c}, 
+{0xd4,0xbe,0x83,0x2d}, {0xda,0xb7,0x8e,0x26}, {0xc8,0xac,0x99,0x3b}, {0xc6,0xa5,0x94,0x30}, 
+{0x9c,0xd2,0xdf,0x59}, {0x92,0xdb,0xd2,0x52}, {0x80,0xc0,0xc5,0x4f}, {0x8e,0xc9,0xc8,0x44}, 
+{0xa4,0xf6,0xeb,0x75}, {0xaa,0xff,0xe6,0x7e}, {0xb8,0xe4,0xf1,0x63}, {0xb6,0xed,0xfc,0x68}, 
+{0x0c,0x0a,0x67,0xb1}, {0x02,0x03,0x6a,0xba}, {0x10,0x18,0x7d,0xa7}, {0x1e,0x11,0x70,0xac}, 
+{0x34,0x2e,0x53,0x9d}, {0x3a,0x27,0x5e,0x96}, {0x28,0x3c,0x49,0x8b}, {0x26,0x35,0x44,0x80}, 
+{0x7c,0x42,0x0f,0xe9}, {0x72,0x4b,0x02,0xe2}, {0x60,0x50,0x15,0xff}, {0x6e,0x59,0x18,0xf4}, 
+{0x44,0x66,0x3b,0xc5}, {0x4a,0x6f,0x36,0xce}, {0x58,0x74,0x21,0xd3}, {0x56,0x7d,0x2c,0xd8}, 
+{0x37,0xa1,0x0c,0x7a}, {0x39,0xa8,0x01,0x71}, {0x2b,0xb3,0x16,0x6c}, {0x25,0xba,0x1b,0x67}, 
+{0x0f,0x85,0x38,0x56}, {0x01,0x8c,0x35,0x5d}, {0x13,0x97,0x22,0x40}, {0x1d,0x9e,0x2f,0x4b}, 
+{0x47,0xe9,0x64,0x22}, {0x49,0xe0,0x69,0x29}, {0x5b,0xfb,0x7e,0x34}, {0x55,0xf2,0x73,0x3f}, 
+{0x7f,0xcd,0x50,0x0e}, {0x71,0xc4,0x5d,0x05}, {0x63,0xdf,0x4a,0x18}, {0x6d,0xd6,0x47,0x13}, 
+{0xd7,0x31,0xdc,0xca}, {0xd9,0x38,0xd1,0xc1}, {0xcb,0x23,0xc6,0xdc}, {0xc5,0x2a,0xcb,0xd7}, 
+{0xef,0x15,0xe8,0xe6}, {0xe1,0x1c,0xe5,0xed}, {0xf3,0x07,0xf2,0xf0}, {0xfd,0x0e,0xff,0xfb}, 
+{0xa7,0x79,0xb4,0x92}, {0xa9,0x70,0xb9,0x99}, {0xbb,0x6b,0xae,0x84}, {0xb5,0x62,0xa3,0x8f}, 
+{0x9f,0x5d,0x80,0xbe}, {0x91,0x54,0x8d,0xb5}, {0x83,0x4f,0x9a,0xa8}, {0x8d,0x46,0x97,0xa3}
+};
+
+static word8 U2[256][4] = {
+{0x00,0x00,0x00,0x00}, {0x0b,0x0e,0x09,0x0d}, {0x16,0x1c,0x12,0x1a}, {0x1d,0x12,0x1b,0x17}, 
+{0x2c,0x38,0x24,0x34}, {0x27,0x36,0x2d,0x39}, {0x3a,0x24,0x36,0x2e}, {0x31,0x2a,0x3f,0x23}, 
+{0x58,0x70,0x48,0x68}, {0x53,0x7e,0x41,0x65}, {0x4e,0x6c,0x5a,0x72}, {0x45,0x62,0x53,0x7f}, 
+{0x74,0x48,0x6c,0x5c}, {0x7f,0x46,0x65,0x51}, {0x62,0x54,0x7e,0x46}, {0x69,0x5a,0x77,0x4b}, 
+{0xb0,0xe0,0x90,0xd0}, {0xbb,0xee,0x99,0xdd}, {0xa6,0xfc,0x82,0xca}, {0xad,0xf2,0x8b,0xc7}, 
+{0x9c,0xd8,0xb4,0xe4}, {0x97,0xd6,0xbd,0xe9}, {0x8a,0xc4,0xa6,0xfe}, {0x81,0xca,0xaf,0xf3}, 
+{0xe8,0x90,0xd8,0xb8}, {0xe3,0x9e,0xd1,0xb5}, {0xfe,0x8c,0xca,0xa2}, {0xf5,0x82,0xc3,0xaf}, 
+{0xc4,0xa8,0xfc,0x8c}, {0xcf,0xa6,0xf5,0x81}, {0xd2,0xb4,0xee,0x96}, {0xd9,0xba,0xe7,0x9b}, 
+{0x7b,0xdb,0x3b,0xbb}, {0x70,0xd5,0x32,0xb6}, {0x6d,0xc7,0x29,0xa1}, {0x66,0xc9,0x20,0xac}, 
+{0x57,0xe3,0x1f,0x8f}, {0x5c,0xed,0x16,0x82}, {0x41,0xff,0x0d,0x95}, {0x4a,0xf1,0x04,0x98}, 
+{0x23,0xab,0x73,0xd3}, {0x28,0xa5,0x7a,0xde}, {0x35,0xb7,0x61,0xc9}, {0x3e,0xb9,0x68,0xc4}, 
+{0x0f,0x93,0x57,0xe7}, {0x04,0x9d,0x5e,0xea}, {0x19,0x8f,0x45,0xfd}, {0x12,0x81,0x4c,0xf0}, 
+{0xcb,0x3b,0xab,0x6b}, {0xc0,0x35,0xa2,0x66}, {0xdd,0x27,0xb9,0x71}, {0xd6,0x29,0xb0,0x7c}, 
+{0xe7,0x03,0x8f,0x5f}, {0xec,0x0d,0x86,0x52}, {0xf1,0x1f,0x9d,0x45}, {0xfa,0x11,0x94,0x48}, 
+{0x93,0x4b,0xe3,0x03}, {0x98,0x45,0xea,0x0e}, {0x85,0x57,0xf1,0x19}, {0x8e,0x59,0xf8,0x14}, 
+{0xbf,0x73,0xc7,0x37}, {0xb4,0x7d,0xce,0x3a}, {0xa9,0x6f,0xd5,0x2d}, {0xa2,0x61,0xdc,0x20}, 
+{0xf6,0xad,0x76,0x6d}, {0xfd,0xa3,0x7f,0x60}, {0xe0,0xb1,0x64,0x77}, {0xeb,0xbf,0x6d,0x7a}, 
+{0xda,0x95,0x52,0x59}, {0xd1,0x9b,0x5b,0x54}, {0xcc,0x89,0x40,0x43}, {0xc7,0x87,0x49,0x4e}, 
+{0xae,0xdd,0x3e,0x05}, {0xa5,0xd3,0x37,0x08}, {0xb8,0xc1,0x2c,0x1f}, {0xb3,0xcf,0x25,0x12}, 
+{0x82,0xe5,0x1a,0x31}, {0x89,0xeb,0x13,0x3c}, {0x94,0xf9,0x08,0x2b}, {0x9f,0xf7,0x01,0x26}, 
+{0x46,0x4d,0xe6,0xbd}, {0x4d,0x43,0xef,0xb0}, {0x50,0x51,0xf4,0xa7}, {0x5b,0x5f,0xfd,0xaa}, 
+{0x6a,0x75,0xc2,0x89}, {0x61,0x7b,0xcb,0x84}, {0x7c,0x69,0xd0,0x93}, {0x77,0x67,0xd9,0x9e}, 
+{0x1e,0x3d,0xae,0xd5}, {0x15,0x33,0xa7,0xd8}, {0x08,0x21,0xbc,0xcf}, {0x03,0x2f,0xb5,0xc2}, 
+{0x32,0x05,0x8a,0xe1}, {0x39,0x0b,0x83,0xec}, {0x24,0x19,0x98,0xfb}, {0x2f,0x17,0x91,0xf6}, 
+{0x8d,0x76,0x4d,0xd6}, {0x86,0x78,0x44,0xdb}, {0x9b,0x6a,0x5f,0xcc}, {0x90,0x64,0x56,0xc1}, 
+{0xa1,0x4e,0x69,0xe2}, {0xaa,0x40,0x60,0xef}, {0xb7,0x52,0x7b,0xf8}, {0xbc,0x5c,0x72,0xf5}, 
+{0xd5,0x06,0x05,0xbe}, {0xde,0x08,0x0c,0xb3}, {0xc3,0x1a,0x17,0xa4}, {0xc8,0x14,0x1e,0xa9}, 
+{0xf9,0x3e,0x21,0x8a}, {0xf2,0x30,0x28,0x87}, {0xef,0x22,0x33,0x90}, {0xe4,0x2c,0x3a,0x9d}, 
+{0x3d,0x96,0xdd,0x06}, {0x36,0x98,0xd4,0x0b}, {0x2b,0x8a,0xcf,0x1c}, {0x20,0x84,0xc6,0x11}, 
+{0x11,0xae,0xf9,0x32}, {0x1a,0xa0,0xf0,0x3f}, {0x07,0xb2,0xeb,0x28}, {0x0c,0xbc,0xe2,0x25}, 
+{0x65,0xe6,0x95,0x6e}, {0x6e,0xe8,0x9c,0x63}, {0x73,0xfa,0x87,0x74}, {0x78,0xf4,0x8e,0x79}, 
+{0x49,0xde,0xb1,0x5a}, {0x42,0xd0,0xb8,0x57}, {0x5f,0xc2,0xa3,0x40}, {0x54,0xcc,0xaa,0x4d}, 
+{0xf7,0x41,0xec,0xda}, {0xfc,0x4f,0xe5,0xd7}, {0xe1,0x5d,0xfe,0xc0}, {0xea,0x53,0xf7,0xcd}, 
+{0xdb,0x79,0xc8,0xee}, {0xd0,0x77,0xc1,0xe3}, {0xcd,0x65,0xda,0xf4}, {0xc6,0x6b,0xd3,0xf9}, 
+{0xaf,0x31,0xa4,0xb2}, {0xa4,0x3f,0xad,0xbf}, {0xb9,0x2d,0xb6,0xa8}, {0xb2,0x23,0xbf,0xa5}, 
+{0x83,0x09,0x80,0x86}, {0x88,0x07,0x89,0x8b}, {0x95,0x15,0x92,0x9c}, {0x9e,0x1b,0x9b,0x91}, 
+{0x47,0xa1,0x7c,0x0a}, {0x4c,0xaf,0x75,0x07}, {0x51,0xbd,0x6e,0x10}, {0x5a,0xb3,0x67,0x1d}, 
+{0x6b,0x99,0x58,0x3e}, {0x60,0x97,0x51,0x33}, {0x7d,0x85,0x4a,0x24}, {0x76,0x8b,0x43,0x29}, 
+{0x1f,0xd1,0x34,0x62}, {0x14,0xdf,0x3d,0x6f}, {0x09,0xcd,0x26,0x78}, {0x02,0xc3,0x2f,0x75}, 
+{0x33,0xe9,0x10,0x56}, {0x38,0xe7,0x19,0x5b}, {0x25,0xf5,0x02,0x4c}, {0x2e,0xfb,0x0b,0x41}, 
+{0x8c,0x9a,0xd7,0x61}, {0x87,0x94,0xde,0x6c}, {0x9a,0x86,0xc5,0x7b}, {0x91,0x88,0xcc,0x76}, 
+{0xa0,0xa2,0xf3,0x55}, {0xab,0xac,0xfa,0x58}, {0xb6,0xbe,0xe1,0x4f}, {0xbd,0xb0,0xe8,0x42}, 
+{0xd4,0xea,0x9f,0x09}, {0xdf,0xe4,0x96,0x04}, {0xc2,0xf6,0x8d,0x13}, {0xc9,0xf8,0x84,0x1e}, 
+{0xf8,0xd2,0xbb,0x3d}, {0xf3,0xdc,0xb2,0x30}, {0xee,0xce,0xa9,0x27}, {0xe5,0xc0,0xa0,0x2a}, 
+{0x3c,0x7a,0x47,0xb1}, {0x37,0x74,0x4e,0xbc}, {0x2a,0x66,0x55,0xab}, {0x21,0x68,0x5c,0xa6}, 
+{0x10,0x42,0x63,0x85}, {0x1b,0x4c,0x6a,0x88}, {0x06,0x5e,0x71,0x9f}, {0x0d,0x50,0x78,0x92}, 
+{0x64,0x0a,0x0f,0xd9}, {0x6f,0x04,0x06,0xd4}, {0x72,0x16,0x1d,0xc3}, {0x79,0x18,0x14,0xce}, 
+{0x48,0x32,0x2b,0xed}, {0x43,0x3c,0x22,0xe0}, {0x5e,0x2e,0x39,0xf7}, {0x55,0x20,0x30,0xfa}, 
+{0x01,0xec,0x9a,0xb7}, {0x0a,0xe2,0x93,0xba}, {0x17,0xf0,0x88,0xad}, {0x1c,0xfe,0x81,0xa0}, 
+{0x2d,0xd4,0xbe,0x83}, {0x26,0xda,0xb7,0x8e}, {0x3b,0xc8,0xac,0x99}, {0x30,0xc6,0xa5,0x94}, 
+{0x59,0x9c,0xd2,0xdf}, {0x52,0x92,0xdb,0xd2}, {0x4f,0x80,0xc0,0xc5}, {0x44,0x8e,0xc9,0xc8}, 
+{0x75,0xa4,0xf6,0xeb}, {0x7e,0xaa,0xff,0xe6}, {0x63,0xb8,0xe4,0xf1}, {0x68,0xb6,0xed,0xfc}, 
+{0xb1,0x0c,0x0a,0x67}, {0xba,0x02,0x03,0x6a}, {0xa7,0x10,0x18,0x7d}, {0xac,0x1e,0x11,0x70}, 
+{0x9d,0x34,0x2e,0x53}, {0x96,0x3a,0x27,0x5e}, {0x8b,0x28,0x3c,0x49}, {0x80,0x26,0x35,0x44}, 
+{0xe9,0x7c,0x42,0x0f}, {0xe2,0x72,0x4b,0x02}, {0xff,0x60,0x50,0x15}, {0xf4,0x6e,0x59,0x18}, 
+{0xc5,0x44,0x66,0x3b}, {0xce,0x4a,0x6f,0x36}, {0xd3,0x58,0x74,0x21}, {0xd8,0x56,0x7d,0x2c}, 
+{0x7a,0x37,0xa1,0x0c}, {0x71,0x39,0xa8,0x01}, {0x6c,0x2b,0xb3,0x16}, {0x67,0x25,0xba,0x1b}, 
+{0x56,0x0f,0x85,0x38}, {0x5d,0x01,0x8c,0x35}, {0x40,0x13,0x97,0x22}, {0x4b,0x1d,0x9e,0x2f}, 
+{0x22,0x47,0xe9,0x64}, {0x29,0x49,0xe0,0x69}, {0x34,0x5b,0xfb,0x7e}, {0x3f,0x55,0xf2,0x73}, 
+{0x0e,0x7f,0xcd,0x50}, {0x05,0x71,0xc4,0x5d}, {0x18,0x63,0xdf,0x4a}, {0x13,0x6d,0xd6,0x47}, 
+{0xca,0xd7,0x31,0xdc}, {0xc1,0xd9,0x38,0xd1}, {0xdc,0xcb,0x23,0xc6}, {0xd7,0xc5,0x2a,0xcb}, 
+{0xe6,0xef,0x15,0xe8}, {0xed,0xe1,0x1c,0xe5}, {0xf0,0xf3,0x07,0xf2}, {0xfb,0xfd,0x0e,0xff}, 
+{0x92,0xa7,0x79,0xb4}, {0x99,0xa9,0x70,0xb9}, {0x84,0xbb,0x6b,0xae}, {0x8f,0xb5,0x62,0xa3}, 
+{0xbe,0x9f,0x5d,0x80}, {0xb5,0x91,0x54,0x8d}, {0xa8,0x83,0x4f,0x9a}, {0xa3,0x8d,0x46,0x97}
+};
+
+static word8 U3[256][4] = {
+{0x00,0x00,0x00,0x00}, {0x0d,0x0b,0x0e,0x09}, {0x1a,0x16,0x1c,0x12}, {0x17,0x1d,0x12,0x1b}, 
+{0x34,0x2c,0x38,0x24}, {0x39,0x27,0x36,0x2d}, {0x2e,0x3a,0x24,0x36}, {0x23,0x31,0x2a,0x3f}, 
+{0x68,0x58,0x70,0x48}, {0x65,0x53,0x7e,0x41}, {0x72,0x4e,0x6c,0x5a}, {0x7f,0x45,0x62,0x53}, 
+{0x5c,0x74,0x48,0x6c}, {0x51,0x7f,0x46,0x65}, {0x46,0x62,0x54,0x7e}, {0x4b,0x69,0x5a,0x77}, 
+{0xd0,0xb0,0xe0,0x90}, {0xdd,0xbb,0xee,0x99}, {0xca,0xa6,0xfc,0x82}, {0xc7,0xad,0xf2,0x8b}, 
+{0xe4,0x9c,0xd8,0xb4}, {0xe9,0x97,0xd6,0xbd}, {0xfe,0x8a,0xc4,0xa6}, {0xf3,0x81,0xca,0xaf}, 
+{0xb8,0xe8,0x90,0xd8}, {0xb5,0xe3,0x9e,0xd1}, {0xa2,0xfe,0x8c,0xca}, {0xaf,0xf5,0x82,0xc3}, 
+{0x8c,0xc4,0xa8,0xfc}, {0x81,0xcf,0xa6,0xf5}, {0x96,0xd2,0xb4,0xee}, {0x9b,0xd9,0xba,0xe7}, 
+{0xbb,0x7b,0xdb,0x3b}, {0xb6,0x70,0xd5,0x32}, {0xa1,0x6d,0xc7,0x29}, {0xac,0x66,0xc9,0x20}, 
+{0x8f,0x57,0xe3,0x1f}, {0x82,0x5c,0xed,0x16}, {0x95,0x41,0xff,0x0d}, {0x98,0x4a,0xf1,0x04}, 
+{0xd3,0x23,0xab,0x73}, {0xde,0x28,0xa5,0x7a}, {0xc9,0x35,0xb7,0x61}, {0xc4,0x3e,0xb9,0x68}, 
+{0xe7,0x0f,0x93,0x57}, {0xea,0x04,0x9d,0x5e}, {0xfd,0x19,0x8f,0x45}, {0xf0,0x12,0x81,0x4c}, 
+{0x6b,0xcb,0x3b,0xab}, {0x66,0xc0,0x35,0xa2}, {0x71,0xdd,0x27,0xb9}, {0x7c,0xd6,0x29,0xb0}, 
+{0x5f,0xe7,0x03,0x8f}, {0x52,0xec,0x0d,0x86}, {0x45,0xf1,0x1f,0x9d}, {0x48,0xfa,0x11,0x94}, 
+{0x03,0x93,0x4b,0xe3}, {0x0e,0x98,0x45,0xea}, {0x19,0x85,0x57,0xf1}, {0x14,0x8e,0x59,0xf8}, 
+{0x37,0xbf,0x73,0xc7}, {0x3a,0xb4,0x7d,0xce}, {0x2d,0xa9,0x6f,0xd5}, {0x20,0xa2,0x61,0xdc}, 
+{0x6d,0xf6,0xad,0x76}, {0x60,0xfd,0xa3,0x7f}, {0x77,0xe0,0xb1,0x64}, {0x7a,0xeb,0xbf,0x6d}, 
+{0x59,0xda,0x95,0x52}, {0x54,0xd1,0x9b,0x5b}, {0x43,0xcc,0x89,0x40}, {0x4e,0xc7,0x87,0x49}, 
+{0x05,0xae,0xdd,0x3e}, {0x08,0xa5,0xd3,0x37}, {0x1f,0xb8,0xc1,0x2c}, {0x12,0xb3,0xcf,0x25}, 
+{0x31,0x82,0xe5,0x1a}, {0x3c,0x89,0xeb,0x13}, {0x2b,0x94,0xf9,0x08}, {0x26,0x9f,0xf7,0x01}, 
+{0xbd,0x46,0x4d,0xe6}, {0xb0,0x4d,0x43,0xef}, {0xa7,0x50,0x51,0xf4}, {0xaa,0x5b,0x5f,0xfd}, 
+{0x89,0x6a,0x75,0xc2}, {0x84,0x61,0x7b,0xcb}, {0x93,0x7c,0x69,0xd0}, {0x9e,0x77,0x67,0xd9}, 
+{0xd5,0x1e,0x3d,0xae}, {0xd8,0x15,0x33,0xa7}, {0xcf,0x08,0x21,0xbc}, {0xc2,0x03,0x2f,0xb5}, 
+{0xe1,0x32,0x05,0x8a}, {0xec,0x39,0x0b,0x83}, {0xfb,0x24,0x19,0x98}, {0xf6,0x2f,0x17,0x91}, 
+{0xd6,0x8d,0x76,0x4d}, {0xdb,0x86,0x78,0x44}, {0xcc,0x9b,0x6a,0x5f}, {0xc1,0x90,0x64,0x56}, 
+{0xe2,0xa1,0x4e,0x69}, {0xef,0xaa,0x40,0x60}, {0xf8,0xb7,0x52,0x7b}, {0xf5,0xbc,0x5c,0x72}, 
+{0xbe,0xd5,0x06,0x05}, {0xb3,0xde,0x08,0x0c}, {0xa4,0xc3,0x1a,0x17}, {0xa9,0xc8,0x14,0x1e}, 
+{0x8a,0xf9,0x3e,0x21}, {0x87,0xf2,0x30,0x28}, {0x90,0xef,0x22,0x33}, {0x9d,0xe4,0x2c,0x3a}, 
+{0x06,0x3d,0x96,0xdd}, {0x0b,0x36,0x98,0xd4}, {0x1c,0x2b,0x8a,0xcf}, {0x11,0x20,0x84,0xc6}, 
+{0x32,0x11,0xae,0xf9}, {0x3f,0x1a,0xa0,0xf0}, {0x28,0x07,0xb2,0xeb}, {0x25,0x0c,0xbc,0xe2}, 
+{0x6e,0x65,0xe6,0x95}, {0x63,0x6e,0xe8,0x9c}, {0x74,0x73,0xfa,0x87}, {0x79,0x78,0xf4,0x8e}, 
+{0x5a,0x49,0xde,0xb1}, {0x57,0x42,0xd0,0xb8}, {0x40,0x5f,0xc2,0xa3}, {0x4d,0x54,0xcc,0xaa}, 
+{0xda,0xf7,0x41,0xec}, {0xd7,0xfc,0x4f,0xe5}, {0xc0,0xe1,0x5d,0xfe}, {0xcd,0xea,0x53,0xf7}, 
+{0xee,0xdb,0x79,0xc8}, {0xe3,0xd0,0x77,0xc1}, {0xf4,0xcd,0x65,0xda}, {0xf9,0xc6,0x6b,0xd3}, 
+{0xb2,0xaf,0x31,0xa4}, {0xbf,0xa4,0x3f,0xad}, {0xa8,0xb9,0x2d,0xb6}, {0xa5,0xb2,0x23,0xbf}, 
+{0x86,0x83,0x09,0x80}, {0x8b,0x88,0x07,0x89}, {0x9c,0x95,0x15,0x92}, {0x91,0x9e,0x1b,0x9b}, 
+{0x0a,0x47,0xa1,0x7c}, {0x07,0x4c,0xaf,0x75}, {0x10,0x51,0xbd,0x6e}, {0x1d,0x5a,0xb3,0x67}, 
+{0x3e,0x6b,0x99,0x58}, {0x33,0x60,0x97,0x51}, {0x24,0x7d,0x85,0x4a}, {0x29,0x76,0x8b,0x43}, 
+{0x62,0x1f,0xd1,0x34}, {0x6f,0x14,0xdf,0x3d}, {0x78,0x09,0xcd,0x26}, {0x75,0x02,0xc3,0x2f}, 
+{0x56,0x33,0xe9,0x10}, {0x5b,0x38,0xe7,0x19}, {0x4c,0x25,0xf5,0x02}, {0x41,0x2e,0xfb,0x0b}, 
+{0x61,0x8c,0x9a,0xd7}, {0x6c,0x87,0x94,0xde}, {0x7b,0x9a,0x86,0xc5}, {0x76,0x91,0x88,0xcc}, 
+{0x55,0xa0,0xa2,0xf3}, {0x58,0xab,0xac,0xfa}, {0x4f,0xb6,0xbe,0xe1}, {0x42,0xbd,0xb0,0xe8}, 
+{0x09,0xd4,0xea,0x9f}, {0x04,0xdf,0xe4,0x96}, {0x13,0xc2,0xf6,0x8d}, {0x1e,0xc9,0xf8,0x84}, 
+{0x3d,0xf8,0xd2,0xbb}, {0x30,0xf3,0xdc,0xb2}, {0x27,0xee,0xce,0xa9}, {0x2a,0xe5,0xc0,0xa0}, 
+{0xb1,0x3c,0x7a,0x47}, {0xbc,0x37,0x74,0x4e}, {0xab,0x2a,0x66,0x55}, {0xa6,0x21,0x68,0x5c}, 
+{0x85,0x10,0x42,0x63}, {0x88,0x1b,0x4c,0x6a}, {0x9f,0x06,0x5e,0x71}, {0x92,0x0d,0x50,0x78}, 
+{0xd9,0x64,0x0a,0x0f}, {0xd4,0x6f,0x04,0x06}, {0xc3,0x72,0x16,0x1d}, {0xce,0x79,0x18,0x14}, 
+{0xed,0x48,0x32,0x2b}, {0xe0,0x43,0x3c,0x22}, {0xf7,0x5e,0x2e,0x39}, {0xfa,0x55,0x20,0x30}, 
+{0xb7,0x01,0xec,0x9a}, {0xba,0x0a,0xe2,0x93}, {0xad,0x17,0xf0,0x88}, {0xa0,0x1c,0xfe,0x81}, 
+{0x83,0x2d,0xd4,0xbe}, {0x8e,0x26,0xda,0xb7}, {0x99,0x3b,0xc8,0xac}, {0x94,0x30,0xc6,0xa5}, 
+{0xdf,0x59,0x9c,0xd2}, {0xd2,0x52,0x92,0xdb}, {0xc5,0x4f,0x80,0xc0}, {0xc8,0x44,0x8e,0xc9}, 
+{0xeb,0x75,0xa4,0xf6}, {0xe6,0x7e,0xaa,0xff}, {0xf1,0x63,0xb8,0xe4}, {0xfc,0x68,0xb6,0xed}, 
+{0x67,0xb1,0x0c,0x0a}, {0x6a,0xba,0x02,0x03}, {0x7d,0xa7,0x10,0x18}, {0x70,0xac,0x1e,0x11}, 
+{0x53,0x9d,0x34,0x2e}, {0x5e,0x96,0x3a,0x27}, {0x49,0x8b,0x28,0x3c}, {0x44,0x80,0x26,0x35}, 
+{0x0f,0xe9,0x7c,0x42}, {0x02,0xe2,0x72,0x4b}, {0x15,0xff,0x60,0x50}, {0x18,0xf4,0x6e,0x59}, 
+{0x3b,0xc5,0x44,0x66}, {0x36,0xce,0x4a,0x6f}, {0x21,0xd3,0x58,0x74}, {0x2c,0xd8,0x56,0x7d}, 
+{0x0c,0x7a,0x37,0xa1}, {0x01,0x71,0x39,0xa8}, {0x16,0x6c,0x2b,0xb3}, {0x1b,0x67,0x25,0xba}, 
+{0x38,0x56,0x0f,0x85}, {0x35,0x5d,0x01,0x8c}, {0x22,0x40,0x13,0x97}, {0x2f,0x4b,0x1d,0x9e}, 
+{0x64,0x22,0x47,0xe9}, {0x69,0x29,0x49,0xe0}, {0x7e,0x34,0x5b,0xfb}, {0x73,0x3f,0x55,0xf2}, 
+{0x50,0x0e,0x7f,0xcd}, {0x5d,0x05,0x71,0xc4}, {0x4a,0x18,0x63,0xdf}, {0x47,0x13,0x6d,0xd6}, 
+{0xdc,0xca,0xd7,0x31}, {0xd1,0xc1,0xd9,0x38}, {0xc6,0xdc,0xcb,0x23}, {0xcb,0xd7,0xc5,0x2a}, 
+{0xe8,0xe6,0xef,0x15}, {0xe5,0xed,0xe1,0x1c}, {0xf2,0xf0,0xf3,0x07}, {0xff,0xfb,0xfd,0x0e}, 
+{0xb4,0x92,0xa7,0x79}, {0xb9,0x99,0xa9,0x70}, {0xae,0x84,0xbb,0x6b}, {0xa3,0x8f,0xb5,0x62}, 
+{0x80,0xbe,0x9f,0x5d}, {0x8d,0xb5,0x91,0x54}, {0x9a,0xa8,0x83,0x4f}, {0x97,0xa3,0x8d,0x46}
+};
+
+static word8 U4[256][4] = {
+{0x00,0x00,0x00,0x00}, {0x09,0x0d,0x0b,0x0e}, {0x12,0x1a,0x16,0x1c}, {0x1b,0x17,0x1d,0x12}, 
+{0x24,0x34,0x2c,0x38}, {0x2d,0x39,0x27,0x36}, {0x36,0x2e,0x3a,0x24}, {0x3f,0x23,0x31,0x2a}, 
+{0x48,0x68,0x58,0x70}, {0x41,0x65,0x53,0x7e}, {0x5a,0x72,0x4e,0x6c}, {0x53,0x7f,0x45,0x62}, 
+{0x6c,0x5c,0x74,0x48}, {0x65,0x51,0x7f,0x46}, {0x7e,0x46,0x62,0x54}, {0x77,0x4b,0x69,0x5a}, 
+{0x90,0xd0,0xb0,0xe0}, {0x99,0xdd,0xbb,0xee}, {0x82,0xca,0xa6,0xfc}, {0x8b,0xc7,0xad,0xf2}, 
+{0xb4,0xe4,0x9c,0xd8}, {0xbd,0xe9,0x97,0xd6}, {0xa6,0xfe,0x8a,0xc4}, {0xaf,0xf3,0x81,0xca}, 
+{0xd8,0xb8,0xe8,0x90}, {0xd1,0xb5,0xe3,0x9e}, {0xca,0xa2,0xfe,0x8c}, {0xc3,0xaf,0xf5,0x82}, 
+{0xfc,0x8c,0xc4,0xa8}, {0xf5,0x81,0xcf,0xa6}, {0xee,0x96,0xd2,0xb4}, {0xe7,0x9b,0xd9,0xba}, 
+{0x3b,0xbb,0x7b,0xdb}, {0x32,0xb6,0x70,0xd5}, {0x29,0xa1,0x6d,0xc7}, {0x20,0xac,0x66,0xc9}, 
+{0x1f,0x8f,0x57,0xe3}, {0x16,0x82,0x5c,0xed}, {0x0d,0x95,0x41,0xff}, {0x04,0x98,0x4a,0xf1}, 
+{0x73,0xd3,0x23,0xab}, {0x7a,0xde,0x28,0xa5}, {0x61,0xc9,0x35,0xb7}, {0x68,0xc4,0x3e,0xb9}, 
+{0x57,0xe7,0x0f,0x93}, {0x5e,0xea,0x04,0x9d}, {0x45,0xfd,0x19,0x8f}, {0x4c,0xf0,0x12,0x81}, 
+{0xab,0x6b,0xcb,0x3b}, {0xa2,0x66,0xc0,0x35}, {0xb9,0x71,0xdd,0x27}, {0xb0,0x7c,0xd6,0x29}, 
+{0x8f,0x5f,0xe7,0x03}, {0x86,0x52,0xec,0x0d}, {0x9d,0x45,0xf1,0x1f}, {0x94,0x48,0xfa,0x11}, 
+{0xe3,0x03,0x93,0x4b}, {0xea,0x0e,0x98,0x45}, {0xf1,0x19,0x85,0x57}, {0xf8,0x14,0x8e,0x59}, 
+{0xc7,0x37,0xbf,0x73}, {0xce,0x3a,0xb4,0x7d}, {0xd5,0x2d,0xa9,0x6f}, {0xdc,0x20,0xa2,0x61}, 
+{0x76,0x6d,0xf6,0xad}, {0x7f,0x60,0xfd,0xa3}, {0x64,0x77,0xe0,0xb1}, {0x6d,0x7a,0xeb,0xbf}, 
+{0x52,0x59,0xda,0x95}, {0x5b,0x54,0xd1,0x9b}, {0x40,0x43,0xcc,0x89}, {0x49,0x4e,0xc7,0x87}, 
+{0x3e,0x05,0xae,0xdd}, {0x37,0x08,0xa5,0xd3}, {0x2c,0x1f,0xb8,0xc1}, {0x25,0x12,0xb3,0xcf}, 
+{0x1a,0x31,0x82,0xe5}, {0x13,0x3c,0x89,0xeb}, {0x08,0x2b,0x94,0xf9}, {0x01,0x26,0x9f,0xf7}, 
+{0xe6,0xbd,0x46,0x4d}, {0xef,0xb0,0x4d,0x43}, {0xf4,0xa7,0x50,0x51}, {0xfd,0xaa,0x5b,0x5f}, 
+{0xc2,0x89,0x6a,0x75}, {0xcb,0x84,0x61,0x7b}, {0xd0,0x93,0x7c,0x69}, {0xd9,0x9e,0x77,0x67}, 
+{0xae,0xd5,0x1e,0x3d}, {0xa7,0xd8,0x15,0x33}, {0xbc,0xcf,0x08,0x21}, {0xb5,0xc2,0x03,0x2f}, 
+{0x8a,0xe1,0x32,0x05}, {0x83,0xec,0x39,0x0b}, {0x98,0xfb,0x24,0x19}, {0x91,0xf6,0x2f,0x17}, 
+{0x4d,0xd6,0x8d,0x76}, {0x44,0xdb,0x86,0x78}, {0x5f,0xcc,0x9b,0x6a}, {0x56,0xc1,0x90,0x64}, 
+{0x69,0xe2,0xa1,0x4e}, {0x60,0xef,0xaa,0x40}, {0x7b,0xf8,0xb7,0x52}, {0x72,0xf5,0xbc,0x5c}, 
+{0x05,0xbe,0xd5,0x06}, {0x0c,0xb3,0xde,0x08}, {0x17,0xa4,0xc3,0x1a}, {0x1e,0xa9,0xc8,0x14}, 
+{0x21,0x8a,0xf9,0x3e}, {0x28,0x87,0xf2,0x30}, {0x33,0x90,0xef,0x22}, {0x3a,0x9d,0xe4,0x2c}, 
+{0xdd,0x06,0x3d,0x96}, {0xd4,0x0b,0x36,0x98}, {0xcf,0x1c,0x2b,0x8a}, {0xc6,0x11,0x20,0x84}, 
+{0xf9,0x32,0x11,0xae}, {0xf0,0x3f,0x1a,0xa0}, {0xeb,0x28,0x07,0xb2}, {0xe2,0x25,0x0c,0xbc}, 
+{0x95,0x6e,0x65,0xe6}, {0x9c,0x63,0x6e,0xe8}, {0x87,0x74,0x73,0xfa}, {0x8e,0x79,0x78,0xf4}, 
+{0xb1,0x5a,0x49,0xde}, {0xb8,0x57,0x42,0xd0}, {0xa3,0x40,0x5f,0xc2}, {0xaa,0x4d,0x54,0xcc}, 
+{0xec,0xda,0xf7,0x41}, {0xe5,0xd7,0xfc,0x4f}, {0xfe,0xc0,0xe1,0x5d}, {0xf7,0xcd,0xea,0x53}, 
+{0xc8,0xee,0xdb,0x79}, {0xc1,0xe3,0xd0,0x77}, {0xda,0xf4,0xcd,0x65}, {0xd3,0xf9,0xc6,0x6b}, 
+{0xa4,0xb2,0xaf,0x31}, {0xad,0xbf,0xa4,0x3f}, {0xb6,0xa8,0xb9,0x2d}, {0xbf,0xa5,0xb2,0x23}, 
+{0x80,0x86,0x83,0x09}, {0x89,0x8b,0x88,0x07}, {0x92,0x9c,0x95,0x15}, {0x9b,0x91,0x9e,0x1b}, 
+{0x7c,0x0a,0x47,0xa1}, {0x75,0x07,0x4c,0xaf}, {0x6e,0x10,0x51,0xbd}, {0x67,0x1d,0x5a,0xb3}, 
+{0x58,0x3e,0x6b,0x99}, {0x51,0x33,0x60,0x97}, {0x4a,0x24,0x7d,0x85}, {0x43,0x29,0x76,0x8b}, 
+{0x34,0x62,0x1f,0xd1}, {0x3d,0x6f,0x14,0xdf}, {0x26,0x78,0x09,0xcd}, {0x2f,0x75,0x02,0xc3}, 
+{0x10,0x56,0x33,0xe9}, {0x19,0x5b,0x38,0xe7}, {0x02,0x4c,0x25,0xf5}, {0x0b,0x41,0x2e,0xfb}, 
+{0xd7,0x61,0x8c,0x9a}, {0xde,0x6c,0x87,0x94}, {0xc5,0x7b,0x9a,0x86}, {0xcc,0x76,0x91,0x88}, 
+{0xf3,0x55,0xa0,0xa2}, {0xfa,0x58,0xab,0xac}, {0xe1,0x4f,0xb6,0xbe}, {0xe8,0x42,0xbd,0xb0}, 
+{0x9f,0x09,0xd4,0xea}, {0x96,0x04,0xdf,0xe4}, {0x8d,0x13,0xc2,0xf6}, {0x84,0x1e,0xc9,0xf8}, 
+{0xbb,0x3d,0xf8,0xd2}, {0xb2,0x30,0xf3,0xdc}, {0xa9,0x27,0xee,0xce}, {0xa0,0x2a,0xe5,0xc0}, 
+{0x47,0xb1,0x3c,0x7a}, {0x4e,0xbc,0x37,0x74}, {0x55,0xab,0x2a,0x66}, {0x5c,0xa6,0x21,0x68}, 
+{0x63,0x85,0x10,0x42}, {0x6a,0x88,0x1b,0x4c}, {0x71,0x9f,0x06,0x5e}, {0x78,0x92,0x0d,0x50}, 
+{0x0f,0xd9,0x64,0x0a}, {0x06,0xd4,0x6f,0x04}, {0x1d,0xc3,0x72,0x16}, {0x14,0xce,0x79,0x18}, 
+{0x2b,0xed,0x48,0x32}, {0x22,0xe0,0x43,0x3c}, {0x39,0xf7,0x5e,0x2e}, {0x30,0xfa,0x55,0x20}, 
+{0x9a,0xb7,0x01,0xec}, {0x93,0xba,0x0a,0xe2}, {0x88,0xad,0x17,0xf0}, {0x81,0xa0,0x1c,0xfe}, 
+{0xbe,0x83,0x2d,0xd4}, {0xb7,0x8e,0x26,0xda}, {0xac,0x99,0x3b,0xc8}, {0xa5,0x94,0x30,0xc6}, 
+{0xd2,0xdf,0x59,0x9c}, {0xdb,0xd2,0x52,0x92}, {0xc0,0xc5,0x4f,0x80}, {0xc9,0xc8,0x44,0x8e}, 
+{0xf6,0xeb,0x75,0xa4}, {0xff,0xe6,0x7e,0xaa}, {0xe4,0xf1,0x63,0xb8}, {0xed,0xfc,0x68,0xb6}, 
+{0x0a,0x67,0xb1,0x0c}, {0x03,0x6a,0xba,0x02}, {0x18,0x7d,0xa7,0x10}, {0x11,0x70,0xac,0x1e}, 
+{0x2e,0x53,0x9d,0x34}, {0x27,0x5e,0x96,0x3a}, {0x3c,0x49,0x8b,0x28}, {0x35,0x44,0x80,0x26}, 
+{0x42,0x0f,0xe9,0x7c}, {0x4b,0x02,0xe2,0x72}, {0x50,0x15,0xff,0x60}, {0x59,0x18,0xf4,0x6e}, 
+{0x66,0x3b,0xc5,0x44}, {0x6f,0x36,0xce,0x4a}, {0x74,0x21,0xd3,0x58}, {0x7d,0x2c,0xd8,0x56}, 
+{0xa1,0x0c,0x7a,0x37}, {0xa8,0x01,0x71,0x39}, {0xb3,0x16,0x6c,0x2b}, {0xba,0x1b,0x67,0x25}, 
+{0x85,0x38,0x56,0x0f}, {0x8c,0x35,0x5d,0x01}, {0x97,0x22,0x40,0x13}, {0x9e,0x2f,0x4b,0x1d}, 
+{0xe9,0x64,0x22,0x47}, {0xe0,0x69,0x29,0x49}, {0xfb,0x7e,0x34,0x5b}, {0xf2,0x73,0x3f,0x55}, 
+{0xcd,0x50,0x0e,0x7f}, {0xc4,0x5d,0x05,0x71}, {0xdf,0x4a,0x18,0x63}, {0xd6,0x47,0x13,0x6d}, 
+{0x31,0xdc,0xca,0xd7}, {0x38,0xd1,0xc1,0xd9}, {0x23,0xc6,0xdc,0xcb}, {0x2a,0xcb,0xd7,0xc5}, 
+{0x15,0xe8,0xe6,0xef}, {0x1c,0xe5,0xed,0xe1}, {0x07,0xf2,0xf0,0xf3}, {0x0e,0xff,0xfb,0xfd}, 
+{0x79,0xb4,0x92,0xa7}, {0x70,0xb9,0x99,0xa9}, {0x6b,0xae,0x84,0xbb}, {0x62,0xa3,0x8f,0xb5}, 
+{0x5d,0x80,0xbe,0x9f}, {0x54,0x8d,0xb5,0x91}, {0x4f,0x9a,0xa8,0x83}, {0x46,0x97,0xa3,0x8d}
+};
+
+static word32 rcon[30] = { 
+  0x01,0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91
+};

Added: experimental/j/Elphel333/rtp/daemon/rtp/btree.c
===================================================================
--- experimental/j/Elphel333/rtp/daemon/rtp/btree.c	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/daemon/rtp/btree.c	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,458 @@
+/*
+ * FILE:     btree.c
+ * PROGRAM:  RAT
+ * AUTHOR:   O.Hodson
+ * MODIFIED: C.Perkins
+ * 
+ * Binary tree implementation - Mostly verbatim from:
+ *
+ * Introduction to Algorithms by Corman, Leisserson, and Rivest,
+ * MIT Press / McGraw Hill, 1990.
+ *
+ */
+
+#include "config_unix.h"
+#include "config_win32.h"
+#include "debug.h"
+#include "memory.h"
+#include "btree.h"
+
+typedef struct s_btree_node {
+        uint32_t       		 key;
+        void         		*data;
+        struct s_btree_node 	*parent;
+        struct s_btree_node 	*left;
+        struct s_btree_node 	*right;
+	uint32_t		 magic;
+} btree_node_t;
+
+struct s_btree {
+        btree_node_t   *root;
+	uint32_t	magic;
+	int		count;
+};
+
+/*****************************************************************************/
+/* Debugging functions...                                                    */
+/*****************************************************************************/
+
+#define BTREE_MAGIC      0x10101010
+#define BTREE_NODE_MAGIC 0x01010101
+
+static int btree_count;
+
+static void
+btree_validate_node(btree_node_t *node, btree_node_t *parent)
+{
+	ASSERT(node->magic  == BTREE_NODE_MAGIC);
+	ASSERT(node->parent == parent);
+	btree_count++;
+	if (node->left != NULL) {
+		btree_validate_node(node->left, node);
+	}
+	if (node->right != NULL) {
+		btree_validate_node(node->right, node);
+	}
+}
+
+static void
+btree_validate(btree_t *t)
+{
+	ASSERT(t->magic == BTREE_MAGIC);
+#ifdef DEBUG
+	btree_count = 0;
+	if (t->root != NULL) {
+		btree_validate_node(t->root, NULL);
+	}
+	ASSERT(btree_count == t->count);
+#endif
+}
+
+/*****************************************************************************/
+/* Utility functions                                                         */
+/*****************************************************************************/
+
+static btree_node_t*
+btree_min(btree_node_t *x)
+{
+        if (x == NULL) {
+                return NULL;
+        }
+        while(x->left) {
+                x = x->left;
+        }
+        return x;
+}
+
+static btree_node_t*
+btree_max(btree_node_t *x)
+{
+        if (x == NULL) {
+                return NULL;
+        }
+        while(x->right) {
+                x = x->right;
+        }
+        return x;
+}
+
+static btree_node_t*
+btree_successor(btree_node_t *x)
+{
+        btree_node_t *y;
+
+        if (x->right != NULL) {
+                return btree_min(x->right);
+        }
+
+        y = x->parent;
+        while (y != NULL && x == y->right) {
+                x = y;
+                y = y->parent;
+        }
+
+        return y;
+}
+
+static btree_node_t*
+btree_search(btree_node_t *x, uint32_t key)
+{
+        while (x != NULL && key != x->key) {
+                if (key < x->key) {
+                        x = x->left;
+                } else {
+                        x = x->right;
+                }
+        }
+        return x; 
+}
+
+static void
+btree_insert_node(btree_t *tree, btree_node_t *z) {
+        btree_node_t *x, *y;
+
+	btree_validate(tree);
+        y = NULL;
+        x = tree->root;
+        while (x != NULL) {
+                y = x;
+                ASSERT(z->key != x->key);
+                if (z->key < x->key) {
+                        x = x->left;
+                } else {
+                        x = x->right;
+                }
+        }
+
+        z->parent = y;
+        if (y == NULL) {
+                tree->root = z;
+        } else if (z->key < y->key) {
+                y->left = z;
+        } else {
+                y->right = z;
+        }
+	tree->count++;
+	btree_validate(tree);
+}
+
+static btree_node_t*
+btree_delete_node(btree_t *tree, btree_node_t *z)
+{
+        btree_node_t *x, *y;
+
+	btree_validate(tree);
+        if (z->left == NULL || z->right == NULL) {
+                y = z;
+        } else {
+                y = btree_successor(z);
+        }
+
+        if (y->left != NULL) {
+                x = y->left;
+        } else {
+                x = y->right;
+        }
+
+        if (x != NULL) {
+                x->parent = y->parent;
+        }
+
+        if (y->parent == NULL) {
+                tree->root = x;
+        } else if (y == y->parent->left) {
+                y->parent->left = x;
+        } else {
+                y->parent->right = x;
+        }
+
+        z->key  = y->key;
+        z->data = y->data;
+
+	tree->count--;
+
+	btree_validate(tree);
+        return y;
+}
+
+/*****************************************************************************/
+/* Exported functions                                                        */
+/*****************************************************************************/
+
+int
+btree_create(btree_t **tree)
+{
+        btree_t *t = (btree_t*)xmalloc(sizeof(btree_t));
+        if (t) {
+		t->count = 0;
+		t->magic = BTREE_MAGIC;
+                t->root  = NULL;
+                *tree = t;
+                return TRUE;
+        }
+        return FALSE;
+}
+
+int
+btree_destroy(btree_t **tree)
+{
+        btree_t *t = *tree;
+
+	btree_validate(t);
+        if (t->root != NULL) {
+                debug_msg("Tree not empty - cannot destroy\n");
+                return FALSE;
+        }
+
+        xfree(t);
+        *tree = NULL;
+        return TRUE;
+}
+
+int
+btree_find(btree_t *tree, uint32_t key, void **d)
+{
+        btree_node_t *x;
+
+	btree_validate(tree);
+        x = btree_search(tree->root, key);
+        if (x != NULL) {
+                *d = x->data;
+                return TRUE;
+        }
+        return FALSE;
+}
+
+int 
+btree_add(btree_t *tree, uint32_t key, void *data)
+{
+        btree_node_t *x;
+
+	btree_validate(tree);
+        x = btree_search(tree->root, key);
+        if (x != NULL) {
+                debug_msg("Item already exists - key %ul\n", key);
+                return FALSE;
+        }
+
+        x = (btree_node_t *)xmalloc(sizeof(btree_node_t));
+        x->key    = key;
+        x->data   = data;
+        x->parent = NULL;
+	x->left   = NULL;
+	x->right  = NULL;
+	x->magic  = BTREE_NODE_MAGIC;
+        btree_insert_node(tree, x);
+
+        return TRUE;
+}
+
+int
+btree_remove(btree_t *tree, uint32_t key, void **data)
+{
+        btree_node_t *x;
+
+	btree_validate(tree);
+        x = btree_search(tree->root, key);
+        if (x == NULL) {
+                debug_msg("Item not on tree - key %ul\n", key);
+                *data = NULL;
+                return FALSE;
+        }
+
+        /* Note value that gets freed is not necessarily the the same
+         * as node that gets removed from tree since there is an
+         * optimization to avoid pointer updates in tree which means
+         * sometimes we just copy key and data from one node to
+         * another.  
+         */
+
+        *data = x->data;
+        x = btree_delete_node(tree, x);
+        xfree(x);
+
+        return TRUE;
+}
+
+int 
+btree_get_min_key(btree_t *tree, uint32_t *key)
+{
+        btree_node_t *x;
+
+	btree_validate(tree);
+        if (tree->root == NULL) {
+                return FALSE;
+        }
+
+        x = btree_min(tree->root);
+        if (x == NULL) {
+                return FALSE;
+        }
+        
+        *key = x->key;
+        return TRUE;
+}
+
+int 
+btree_get_max_key(btree_t *tree, uint32_t *key)
+{
+        btree_node_t *x;
+
+	btree_validate(tree);
+        if (tree->root == NULL) {
+                return FALSE;
+        }
+
+        x = btree_max(tree->root);
+        if (x == NULL) {
+                return FALSE;
+        }
+        
+        *key = x->key;
+        return TRUE;
+}
+
+int
+btree_get_next_key(btree_t *tree, uint32_t cur_key, uint32_t *next_key)
+{
+        btree_node_t *x;
+
+	btree_validate(tree);
+        x = btree_search(tree->root, cur_key);
+        if (x == NULL) {
+                return FALSE;
+        }
+        
+        x = btree_successor(x);
+        if (x == NULL) {
+                return FALSE;
+        }
+        
+        *next_key = x->key;
+        return TRUE;
+}
+
+/*****************************************************************************/
+/* Test code                                                                 */
+/*****************************************************************************/
+
+#ifdef TEST_BTREE
+
+static int
+btree_depth(btree_node_t *x)
+{
+        int l, r;
+
+        if (x == NULL) {
+                return 0;
+        }
+
+        l = btree_depth(x->left);
+        r = btree_depth(x->right);
+
+        if (l > r) {
+                return l + 1;
+        } else {
+                return r + 1;
+        }
+}
+
+#include <curses.h>
+
+static void
+btree_dump_node(btree_node_t *x, int depth, int c, int w)
+{
+        if (x == NULL) {
+                return;
+        }
+        
+        move(depth * 2, c);
+        printw("%lu", x->key);
+        refresh();
+
+        btree_dump_node(x->left,  depth + 1, c - w/2, w/2);
+        btree_dump_node(x->right, depth + 1, c + w/2, w/2);
+
+        return;
+}
+
+static void
+btree_dump(btree_t *b)
+{
+        initscr();
+        btree_dump_node(b->root, 0, 40, 48);
+        refresh();
+        endwin();
+}
+
+#include "stdlib.h"
+
+int 
+main()
+{
+        btree_t *b;
+        uint32_t i, *x;
+        uint32_t v[] = {15, 5, 16, 3, 12, 20, 10, 13, 18, 23, 6, 7}; 
+        uint32_t nv = sizeof(v) / sizeof(v[0]);
+
+        btree_create(&b);
+
+        for(i = 0; i < nv; i++) {
+                x = (uint32_t*)xmalloc(sizeof(uint32_t));
+                *x = (uint32_t)random();
+                if (btree_add(b, v[i], (void*)x) != TRUE) {
+                        printf("Fail Add %lu %lu\n", v[i], *x);
+                }
+        }
+    
+        printf("depth %d\n", btree_depth(b->root));
+        btree_dump(b);
+
+        sleep(3);
+        btree_remove(b, 5, (void*)&x);
+        btree_dump(b);
+        sleep(3);
+        btree_remove(b, 16, (void*)&x);
+        btree_dump(b);
+        sleep(3);
+        btree_remove(b, 13, (void*)&x);
+        btree_dump(b);
+
+        while (btree_get_root_key(b, &i)) {
+                if (btree_remove(b, i, (void*)&x) == FALSE) {
+                        fprintf(stderr, "Failed to remove %lu\n", i);
+                }
+                btree_dump(b);
+                sleep(1); 
+        }
+
+        if (btree_destroy(&b) == FALSE) {
+                printf("Failed to destroy \n");
+        }
+                
+        return 0;
+}
+
+#endif /* TEST_BTREE*/
+
+

Added: experimental/j/Elphel333/rtp/daemon/rtp/btree.h
===================================================================
--- experimental/j/Elphel333/rtp/daemon/rtp/btree.h	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/daemon/rtp/btree.h	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,63 @@
+/*
+ * FILE:    btree.h
+ * PROGRAM: RAT
+ * AUTHOR:  O.Hodson
+ * 
+ * Binary tree implementation - Mostly verbatim from:
+ *
+ * Introduction to Algorithms by Corman, Leisserson, and Rivest,
+ * MIT Press / McGraw Hill, 1990.
+ *
+ * Implementation assumes one data element per key is assigned.
+ *
+ * Thanks to Markus Geimeier <mager at tzi.de> for pointing out want
+ * btree_get_min_key and not btree_get_root_key for start point for tree
+ * iteration.
+ * 
+ */
+
+#ifndef __BTREE_H__
+#define __BTREE_H__
+
+typedef struct s_btree btree_t;
+
+/* btree_create fills the *tree with a new binary tree.  Returns TRUE on     */
+/* success and FALSE on failure.                                             */
+
+int  btree_create  (btree_t **tree);
+
+/* btree_destroy destroys tree.  If tree is not empty it cannot be destroyed */
+/* and call returns FALSE.  On success returns TRUE.                         */
+
+int btree_destroy (btree_t **tree);
+ 
+/* btree_add adds data for key to tree.  Returns TRUE on success, or FALSE   */
+/* if key is already on tree.  */
+
+int btree_add    (btree_t *tree, uint32_t key, void *data);
+
+/* btree_remove attempts to remove data from tree.  Returns TRUE on success  */
+/* and points *d at value stored for key.  FALSE is returned if key is not   */
+/* on tree.                                                                  */
+
+int btree_remove (btree_t *tree, uint32_t key, void **d);
+
+/* btree_find locates data for key and make *d point to it.  Returns TRUE if */
+/* data for key is found, FALSE otherwise.                                   */
+
+int btree_find   (btree_t *tree, uint32_t key, void **d);
+
+/* btree_get_min_key attempts to return minimum key of tree.  Function       */
+/* intended to help if list of keys is not stored elsewhere.  Returns TRUE   */
+/* and fills key with key if possible, FALSE otherwise                       */
+
+int btree_get_min_key (btree_t *tree, uint32_t *key);
+int btree_get_max_key (btree_t *tree, uint32_t *key);
+
+/* btree_get_next_key attempts to get the key above cur_key.  Returns        */
+/* TRUE and fills key with key if possible, FALSE otherwise.                 */
+
+int btree_get_next_key (btree_t *tree, uint32_t cur_key, uint32_t *next_key);
+
+#endif /* __BTREE_H__ */
+

Added: experimental/j/Elphel333/rtp/daemon/rtp/cdecl_ext.h
===================================================================
--- experimental/j/Elphel333/rtp/daemon/rtp/cdecl_ext.h	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/daemon/rtp/cdecl_ext.h	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 1999 WIDE Project.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+#ifndef HAVE_PORTABLE_PROTOTYPE
+
+#ifndef __P
+#if defined(__STDC__) || defined(__cplusplus) 
+#define	__P(protos)	protos		/* full-blown ANSI C */
+#else
+#define	__P(protos)	()		/* traditional C preprocessor */
+#endif
+#endif
+
+#endif /* !HAVE_PORTABLE_PROTOTYPE */

Added: experimental/j/Elphel333/rtp/daemon/rtp/common60.dsp
===================================================================
--- experimental/j/Elphel333/rtp/daemon/rtp/common60.dsp	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/daemon/rtp/common60.dsp	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,439 @@
+# Microsoft Developer Studio Project File - Name="common" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=common - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "common60.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "common60.mak" CFG="common - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "common - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "common - Win32 Debug IPv6" (based on "Win32 (x86) Static Library")
+!MESSAGE "common - Win32 Debug IPv6 Musica" (based on "Win32 (x86) Static Library")
+!MESSAGE "common - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "common - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\tcl-8.0\generic" /I "..\tk-8.0\generic" /I "..\tk-8.0\xlib" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "HAVE_INET_NTOP" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"Release\uclmm.lib"
+
+!ELSEIF  "$(CFG)" == "common - Win32 Debug IPv6"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "common___Win32_Debug_IPv6"
+# PROP BASE Intermediate_Dir "common___Win32_Debug_IPv6"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_IPv6"
+# PROP Intermediate_Dir "Debug_IPv6"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /ZI /Od /I "\src\tcl-8.0\generic" /I "\src\tk-8.0\generic" /I "\src\tk-8.0\xlib" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "DEBUG" /D "DEBUG_MEM" /FR /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "\src\tcl-8.0\generic" /I "\src\tk-8.0\generic" /I "\src\tk-8.0\xlib" /I "\DDK\inc" /I "\src\IPv6Kit\inc" /I "..\tcl-8.0\generic" /I "..\tk-8.0\generic" /I "..\tk-8.0\xlib" /I "..\ipv6kit\inc" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "DEBUG" /D "DEBUG_MEM" /D "HAVE_IPv6" /D "BUILD_tcl" /D "BUILD_tk" /D "NEED_IN6_IS_ADDR_MULTICAST" /D "HAVE_INET_PTON" /D "HAVE_INET_NTOP" /FR /YX /FD /GZ /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo /out:"Debug\uclmm.lib"
+# ADD LIB32 /nologo /out:"Debug_IPv6\uclmm.lib"
+
+!ELSEIF  "$(CFG)" == "common - Win32 Debug IPv6 Musica"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "common___Win32_Debug_IPv6_Musica"
+# PROP BASE Intermediate_Dir "common___Win32_Debug_IPv6_Musica"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_IPv6_Musica"
+# PROP Intermediate_Dir "Debug_IPv6_Musica"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /I "\src\tcl-8.0\generic" /I "\src\tk-8.0\generic" /I "\src\tk-8.0\xlib" /I "\DDK\inc" /I "\src\MSR_IPv6_1.3\inc" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "DEBUG" /D "DEBUG_MEM" /D "HAVE_IPv6" /D "BUILD_tcl" /D "BUILD_tk" /FR /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\tcl-8.0\generic" /I "..\tk-8.0\generic" /I "..\tk-8.0\xlib" /I "..\MUSICA\WINSOCK6" /D "_MBCS" /D "_LIB" /D "DEBUG_MEM" /D "BUILD_tcl" /D "BUILD_tk" /D "DEBUG" /D "WIN32" /D "_DEBUG" /D "HAVE_IPv6" /D "MUSICA_IPV6" /D "_WINNT" /D "_POSIX" /D "NEED_ADDRINFO_H" /D "NEED_IN_EXPERIMENTAL" /D "NEED_IN6_IS_ADDR_V4MAPPED" /FR /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo /out:"Debug\uclmm.lib"
+# ADD LIB32 /nologo /out:"Debug\uclmm.lib"
+
+!ELSEIF  "$(CFG)" == "common - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "..\tcl-8.0\generic" /I "..\tk-8.0\generic" /I "..\tk-8.0\xlib" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "DEBUG" /FR /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"Debug\uclmm.lib"
+
+!ENDIF 
+
+# Begin Target
+
+# Name "common - Win32 Release"
+# Name "common - Win32 Debug IPv6"
+# Name "common - Win32 Debug IPv6 Musica"
+# Name "common - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\asarray.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\base64.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\btree.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\crypt_random.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\debug.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\drand48.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\getaddrinfo.c
+
+!IF  "$(CFG)" == "common - Win32 Release"
+
+# PROP Exclude_From_Build 1
+
+!ELSEIF  "$(CFG)" == "common - Win32 Debug IPv6"
+
+# PROP Exclude_From_Build 1
+
+!ELSEIF  "$(CFG)" == "common - Win32 Debug IPv6 Musica"
+
+# ADD CPP /D "INET6" /D "HAVE_GETHOSTBYNAME2"
+
+!ELSEIF  "$(CFG)" == "common - Win32 Debug"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\gettimeofday.c
+
+!IF  "$(CFG)" == "common - Win32 Release"
+
+!ELSEIF  "$(CFG)" == "common - Win32 Debug IPv6"
+
+!ELSEIF  "$(CFG)" == "common - Win32 Debug IPv6 Musica"
+
+# ADD CPP /W4
+
+!ELSEIF  "$(CFG)" == "common - Win32 Debug"
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\hmac.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\inet_ntop.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\inet_pton.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mbus.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mbus_addr.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mbus_config.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mbus_parser.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\md5.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\memory.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\net_udp.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\ntp.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\qfDES.c
+
+!IF  "$(CFG)" == "common - Win32 Release"
+
+# SUBTRACT CPP /O<none>
+
+!ELSEIF  "$(CFG)" == "common - Win32 Debug IPv6"
+
+!ELSEIF  "$(CFG)" == "common - Win32 Debug IPv6 Musica"
+
+!ELSEIF  "$(CFG)" == "common - Win32 Debug"
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=".\rijndael-alg-fst.c"
+# End Source File
+# Begin Source File
+
+SOURCE=".\rijndael-api-fst.c"
+# End Source File
+# Begin Source File
+
+SOURCE=.\rtp.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\util.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\acconfig.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\addrinfo.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\addrsize.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\asarray.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\base64.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\bittypes.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\btree.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\cdecl_ext.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\config_win32.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\crypt_random.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\debug.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\drand48.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\gettimeofday.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\hmac.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inet_ntop.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inet_pton.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\mbus.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\mbus_addr.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\mbus_config.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\mbus_parser.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\md5.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\memory.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\net_udp.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ntp.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\qfDES.h
+# End Source File
+# Begin Source File
+
+SOURCE=".\rijndael-alg-fst.h"
+# End Source File
+# Begin Source File
+
+SOURCE=".\rijndael-api-fst.h"
+# End Source File
+# Begin Source File
+
+SOURCE=.\rtp.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\sockstorage.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\test_base64.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\test_des.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\test_mbus_addr.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\test_mbus_parser.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\test_md5.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\test_memory.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\test_net_udp.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\util.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\version.h
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\VERSION
+# End Source File
+# End Target
+# End Project

Added: experimental/j/Elphel333/rtp/daemon/rtp/config.guess
===================================================================
--- experimental/j/Elphel333/rtp/daemon/rtp/config.guess	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/daemon/rtp/config.guess	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,1317 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+#   Free Software Foundation, Inc.
+
+timestamp='2001-09-04'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Written by Per Bothner <bothner at cygnus.com>.
+# Please send patches to <config-patches at gnu.org>.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub.  If it succeeds, it prints the system name on stdout, and
+# exits with 0.  Otherwise, it exits with 1.
+#
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit build system type.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches at gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit 0 ;;
+    --version | -v )
+       echo "$version" ; exit 0 ;;
+    --help | --h* | -h )
+       echo "$usage"; exit 0 ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help" >&2
+       exit 1 ;;
+    * )
+       break ;;
+  esac
+done
+
+if test $# != 0; then
+  echo "$me: too many arguments$help" >&2
+  exit 1
+fi
+
+
+dummy=dummy-$$
+trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script.
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,)    echo "int dummy(){}" > $dummy.c ;
+	for c in cc gcc c89 ; do
+	  ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
+	  if test $? = 0 ; then
+	     CC_FOR_BUILD="$c"; break ;
+	  fi ;
+	done ;
+	rm -f $dummy.c $dummy.o $dummy.rel ;
+	if test x"$CC_FOR_BUILD" = x ; then
+	  CC_FOR_BUILD=no_compiler_found ;
+	fi
+	;;
+ ,,*)   CC_FOR_BUILD=$CC ;;
+ ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
+esac'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi at noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+	PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+    *:NetBSD:*:*)
+	# Netbsd (nbsd) targets should (where applicable) match one or
+	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
+	# switched to ELF, *-*-netbsd* would select the old
+	# object file format.  This provides both forward
+	# compatibility and a consistent mechanism for selecting the
+	# object file format.
+	# Determine the machine/vendor (is the vendor relevant).
+	case "${UNAME_MACHINE}" in
+	    amiga) machine=m68k-unknown ;;
+	    arm32) machine=arm-unknown ;;
+	    atari*) machine=m68k-atari ;;
+	    sun3*) machine=m68k-sun ;;
+	    mac68k) machine=m68k-apple ;;
+	    macppc) machine=powerpc-apple ;;
+	    hp3[0-9][05]) machine=m68k-hp ;;
+	    ibmrt|romp-ibm) machine=romp-ibm ;;
+	    *) machine=${UNAME_MACHINE}-unknown ;;
+	esac
+	# The Operating System including object format, if it has switched
+	# to ELF recently, or will in the future.
+	case "${UNAME_MACHINE}" in
+	    i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k)
+		eval $set_cc_for_build
+		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+			| grep __ELF__ >/dev/null
+		then
+		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+		    # Return netbsd for either.  FIX?
+		    os=netbsd
+		else
+		    os=netbsdelf
+		fi
+		;;
+	    *)
+	        os=netbsd
+		;;
+	esac
+	# The OS release
+	release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+	# contains redundant information, the shorter form:
+	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+	echo "${machine}-${os}${release}"
+	exit 0 ;;
+    alpha:OSF1:*:*)
+	if test $UNAME_RELEASE = "V4.0"; then
+		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+	fi
+	# A Vn.n version is a released version.
+	# A Tn.n version is a released field test version.
+	# A Xn.n version is an unreleased experimental baselevel.
+	# 1.2 uses "1.2" for uname -r.
+	cat <<EOF >$dummy.s
+	.data
+\$Lformat:
+	.byte 37,100,45,37,120,10,0	# "%d-%x\n"
+
+	.text
+	.globl main
+	.align 4
+	.ent main
+main:
+	.frame \$30,16,\$26,0
+	ldgp \$29,0(\$27)
+	.prologue 1
+	.long 0x47e03d80 # implver \$0
+	lda \$2,-1
+	.long 0x47e20c21 # amask \$2,\$1
+	lda \$16,\$Lformat
+	mov \$0,\$17
+	not \$1,\$18
+	jsr \$26,printf
+	ldgp \$29,0(\$26)
+	mov 0,\$16
+	jsr \$26,exit
+	.end main
+EOF
+	eval $set_cc_for_build
+	$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
+	if test "$?" = 0 ; then
+		case `./$dummy` in
+			0-0)
+				UNAME_MACHINE="alpha"
+				;;
+			1-0)
+				UNAME_MACHINE="alphaev5"
+				;;
+			1-1)
+				UNAME_MACHINE="alphaev56"
+				;;
+			1-101)
+				UNAME_MACHINE="alphapca56"
+				;;
+			2-303)
+				UNAME_MACHINE="alphaev6"
+				;;
+			2-307)
+				UNAME_MACHINE="alphaev67"
+				;;
+			2-1307)
+				UNAME_MACHINE="alphaev68"
+				;;
+		esac
+	fi
+	rm -f $dummy.s $dummy
+	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+	exit 0 ;;
+    Alpha\ *:Windows_NT*:*)
+	# How do we know it's Interix rather than the generic POSIX subsystem?
+	# Should we change UNAME_MACHINE based on the output of uname instead
+	# of the specific Alpha model?
+	echo alpha-pc-interix
+	exit 0 ;;
+    21064:Windows_NT:50:3)
+	echo alpha-dec-winnt3.5
+	exit 0 ;;
+    Amiga*:UNIX_System_V:4.0:*)
+	echo m68k-unknown-sysv4
+	exit 0;;
+    amiga:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    *:[Aa]miga[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-amigaos
+	exit 0 ;;
+    arc64:OpenBSD:*:*)
+	echo mips64el-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    arc:OpenBSD:*:*)
+	echo mipsel-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    hkmips:OpenBSD:*:*)
+	echo mips-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    pmax:OpenBSD:*:*)
+	echo mipsel-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    sgi:OpenBSD:*:*)
+	echo mips-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    wgrisc:OpenBSD:*:*)
+	echo mipsel-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    *:OS/390:*:*)
+	echo i370-ibm-openedition
+	exit 0 ;;
+    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+	echo arm-acorn-riscix${UNAME_RELEASE}
+	exit 0;;
+    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+	echo hppa1.1-hitachi-hiuxmpp
+	exit 0;;
+    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+	# akee at wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+	if test "`(/bin/universe) 2>/dev/null`" = att ; then
+		echo pyramid-pyramid-sysv3
+	else
+		echo pyramid-pyramid-bsd
+	fi
+	exit 0 ;;
+    NILE*:*:*:dcosx)
+	echo pyramid-pyramid-svr4
+	exit 0 ;;
+    sun4H:SunOS:5.*:*)
+	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit 0 ;;
+    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit 0 ;;
+    i86pc:SunOS:5.*:*)
+	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit 0 ;;
+    sun4*:SunOS:6*:*)
+	# According to config.sub, this is the proper way to canonicalize
+	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
+	# it's likely to be more like Solaris than SunOS4.
+	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit 0 ;;
+    sun4*:SunOS:*:*)
+	case "`/usr/bin/arch -k`" in
+	    Series*|S4*)
+		UNAME_RELEASE=`uname -v`
+		;;
+	esac
+	# Japanese Language versions have a version number like `4.1.3-JL'.
+	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+	exit 0 ;;
+    sun3*:SunOS:*:*)
+	echo m68k-sun-sunos${UNAME_RELEASE}
+	exit 0 ;;
+    sun*:*:4.2BSD:*)
+	UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+	case "`/bin/arch`" in
+	    sun3)
+		echo m68k-sun-sunos${UNAME_RELEASE}
+		;;
+	    sun4)
+		echo sparc-sun-sunos${UNAME_RELEASE}
+		;;
+	esac
+	exit 0 ;;
+    aushp:SunOS:*:*)
+	echo sparc-auspex-sunos${UNAME_RELEASE}
+	exit 0 ;;
+    sparc*:NetBSD:*)
+	echo `uname -p`-unknown-netbsd${UNAME_RELEASE}
+	exit 0 ;;
+    atari*:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    # The situation for MiNT is a little confusing.  The machine name
+    # can be virtually everything (everything which is not
+    # "atarist" or "atariste" at least should have a processor
+    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
+    # to the lowercase version "mint" (or "freemint").  Finally
+    # the system name "TOS" denotes a system which is actually not
+    # MiNT.  But MiNT is downward compatible to TOS, so this should
+    # be no problem.
+    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+	exit 0 ;;
+    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+	echo m68k-atari-mint${UNAME_RELEASE}
+        exit 0 ;;
+    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+	exit 0 ;;
+    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+        echo m68k-milan-mint${UNAME_RELEASE}
+        exit 0 ;;
+    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+        echo m68k-hades-mint${UNAME_RELEASE}
+        exit 0 ;;
+    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+        echo m68k-unknown-mint${UNAME_RELEASE}
+        exit 0 ;;
+    sun3*:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mac68k:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mvme68k:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mvme88k:OpenBSD:*:*)
+	echo m88k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    powerpc:machten:*:*)
+	echo powerpc-apple-machten${UNAME_RELEASE}
+	exit 0 ;;
+    RISC*:Mach:*:*)
+	echo mips-dec-mach_bsd4.3
+	exit 0 ;;
+    RISC*:ULTRIX:*:*)
+	echo mips-dec-ultrix${UNAME_RELEASE}
+	exit 0 ;;
+    VAX*:ULTRIX*:*:*)
+	echo vax-dec-ultrix${UNAME_RELEASE}
+	exit 0 ;;
+    2020:CLIX:*:* | 2430:CLIX:*:*)
+	echo clipper-intergraph-clix${UNAME_RELEASE}
+	exit 0 ;;
+    mips:*:*:UMIPS | mips:*:*:RISCos)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h>  /* for printf() prototype */
+	int main (int argc, char *argv[]) {
+#else
+	int main (argc, argv) int argc; char *argv[]; {
+#endif
+	#if defined (host_mips) && defined (MIPSEB)
+	#if defined (SYSTYPE_SYSV)
+	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+	#endif
+	#if defined (SYSTYPE_SVR4)
+	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+	#endif
+	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+	#endif
+	#endif
+	  exit (-1);
+	}
+EOF
+	$CC_FOR_BUILD $dummy.c -o $dummy \
+	  && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+	  && rm -f $dummy.c $dummy && exit 0
+	rm -f $dummy.c $dummy
+	echo mips-mips-riscos${UNAME_RELEASE}
+	exit 0 ;;
+    Motorola:PowerMAX_OS:*:*)
+	echo powerpc-motorola-powermax
+	exit 0 ;;
+    Night_Hawk:Power_UNIX:*:*)
+	echo powerpc-harris-powerunix
+	exit 0 ;;
+    m88k:CX/UX:7*:*)
+	echo m88k-harris-cxux7
+	exit 0 ;;
+    m88k:*:4*:R4*)
+	echo m88k-motorola-sysv4
+	exit 0 ;;
+    m88k:*:3*:R3*)
+	echo m88k-motorola-sysv3
+	exit 0 ;;
+    AViiON:dgux:*:*)
+        # DG/UX returns AViiON for all architectures
+        UNAME_PROCESSOR=`/usr/bin/uname -p`
+	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+	then
+	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+	       [ ${TARGET_BINARY_INTERFACE}x = x ]
+	    then
+		echo m88k-dg-dgux${UNAME_RELEASE}
+	    else
+		echo m88k-dg-dguxbcs${UNAME_RELEASE}
+	    fi
+	else
+	    echo i586-dg-dgux${UNAME_RELEASE}
+	fi
+ 	exit 0 ;;
+    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
+	echo m88k-dolphin-sysv3
+	exit 0 ;;
+    M88*:*:R3*:*)
+	# Delta 88k system running SVR3
+	echo m88k-motorola-sysv3
+	exit 0 ;;
+    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+	echo m88k-tektronix-sysv3
+	exit 0 ;;
+    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+	echo m68k-tektronix-bsd
+	exit 0 ;;
+    *:IRIX*:*:*)
+	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+	exit 0 ;;
+    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+	echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
+	exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
+    i*86:AIX:*:*)
+	echo i386-ibm-aix
+	exit 0 ;;
+    ia64:AIX:*:*)
+	if [ -x /usr/bin/oslevel ] ; then
+		IBM_REV=`/usr/bin/oslevel`
+	else
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+	fi
+	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+	exit 0 ;;
+    *:AIX:2:3)
+	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+		eval $set_cc_for_build
+		sed 's/^		//' << EOF >$dummy.c
+		#include <sys/systemcfg.h>
+
+		main()
+			{
+			if (!__power_pc())
+				exit(1);
+			puts("powerpc-ibm-aix3.2.5");
+			exit(0);
+			}
+EOF
+		$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
+		rm -f $dummy.c $dummy
+		echo rs6000-ibm-aix3.2.5
+	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+		echo rs6000-ibm-aix3.2.4
+	else
+		echo rs6000-ibm-aix3.2
+	fi
+	exit 0 ;;
+    *:AIX:*:[45])
+	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
+	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+		IBM_ARCH=rs6000
+	else
+		IBM_ARCH=powerpc
+	fi
+	if [ -x /usr/bin/oslevel ] ; then
+		IBM_REV=`/usr/bin/oslevel`
+	else
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+	fi
+	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+	exit 0 ;;
+    *:AIX:*:*)
+	echo rs6000-ibm-aix
+	exit 0 ;;
+    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+	echo romp-ibm-bsd4.4
+	exit 0 ;;
+    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
+	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
+	exit 0 ;;                           # report: romp-ibm BSD 4.3
+    *:BOSX:*:*)
+	echo rs6000-bull-bosx
+	exit 0 ;;
+    DPX/2?00:B.O.S.:*:*)
+	echo m68k-bull-sysv3
+	exit 0 ;;
+    9000/[34]??:4.3bsd:1.*:*)
+	echo m68k-hp-bsd
+	exit 0 ;;
+    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+	echo m68k-hp-bsd4.4
+	exit 0 ;;
+    9000/[34678]??:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	case "${UNAME_MACHINE}" in
+	    9000/31? )            HP_ARCH=m68000 ;;
+	    9000/[34]?? )         HP_ARCH=m68k ;;
+	    9000/[678][0-9][0-9])
+              case "${HPUX_REV}" in
+                11.[0-9][0-9])
+                  if [ -x /usr/bin/getconf ]; then
+                    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+                    case "${sc_cpu_version}" in
+                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+                      532)                      # CPU_PA_RISC2_0
+                        case "${sc_kernel_bits}" in
+                          32) HP_ARCH="hppa2.0n" ;;
+                          64) HP_ARCH="hppa2.0w" ;;
+                        esac ;;
+                    esac
+                  fi ;;
+              esac
+              if [ "${HP_ARCH}" = "" ]; then
+	      eval $set_cc_for_build
+              sed 's/^              //' << EOF >$dummy.c
+
+              #define _HPUX_SOURCE
+              #include <stdlib.h>
+              #include <unistd.h>
+
+              int main ()
+              {
+              #if defined(_SC_KERNEL_BITS)
+                  long bits = sysconf(_SC_KERNEL_BITS);
+              #endif
+                  long cpu  = sysconf (_SC_CPU_VERSION);
+
+                  switch (cpu)
+              	{
+              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+              	case CPU_PA_RISC2_0:
+              #if defined(_SC_KERNEL_BITS)
+              	    switch (bits)
+              		{
+              		case 64: puts ("hppa2.0w"); break;
+              		case 32: puts ("hppa2.0n"); break;
+              		default: puts ("hppa2.0"); break;
+              		} break;
+              #else  /* !defined(_SC_KERNEL_BITS) */
+              	    puts ("hppa2.0"); break;
+              #endif
+              	default: puts ("hppa1.0"); break;
+              	}
+                  exit (0);
+              }
+EOF
+	    (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
+	    if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
+	    rm -f $dummy.c $dummy
+	fi ;;
+	esac
+	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+	exit 0 ;;
+    ia64:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	echo ia64-hp-hpux${HPUX_REV}
+	exit 0 ;;
+    3050*:HI-UX:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#include <unistd.h>
+	int
+	main ()
+	{
+	  long cpu = sysconf (_SC_CPU_VERSION);
+	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
+	     results, however.  */
+	  if (CPU_IS_PA_RISC (cpu))
+	    {
+	      switch (cpu)
+		{
+		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+		  default: puts ("hppa-hitachi-hiuxwe2"); break;
+		}
+	    }
+	  else if (CPU_IS_HP_MC68K (cpu))
+	    puts ("m68k-hitachi-hiuxwe2");
+	  else puts ("unknown-hitachi-hiuxwe2");
+	  exit (0);
+	}
+EOF
+	$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
+	rm -f $dummy.c $dummy
+	echo unknown-hitachi-hiuxwe2
+	exit 0 ;;
+    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+	echo hppa1.1-hp-bsd
+	exit 0 ;;
+    9000/8??:4.3bsd:*:*)
+	echo hppa1.0-hp-bsd
+	exit 0 ;;
+    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+	echo hppa1.0-hp-mpeix
+	exit 0 ;;
+    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+	echo hppa1.1-hp-osf
+	exit 0 ;;
+    hp8??:OSF1:*:*)
+	echo hppa1.0-hp-osf
+	exit 0 ;;
+    i*86:OSF1:*:*)
+	if [ -x /usr/sbin/sysversion ] ; then
+	    echo ${UNAME_MACHINE}-unknown-osf1mk
+	else
+	    echo ${UNAME_MACHINE}-unknown-osf1
+	fi
+	exit 0 ;;
+    parisc*:Lites*:*:*)
+	echo hppa1.1-hp-lites
+	exit 0 ;;
+    hppa*:OpenBSD:*:*)
+	echo hppa-unknown-openbsd
+	exit 0 ;;
+    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+	echo c1-convex-bsd
+        exit 0 ;;
+    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+        exit 0 ;;
+    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+	echo c34-convex-bsd
+        exit 0 ;;
+    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+	echo c38-convex-bsd
+        exit 0 ;;
+    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+	echo c4-convex-bsd
+        exit 0 ;;
+    CRAY*X-MP:*:*:*)
+	echo xmp-cray-unicos
+        exit 0 ;;
+    CRAY*Y-MP:*:*:*)
+	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    CRAY*[A-Z]90:*:*:*)
+	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+	      -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    CRAY*TS:*:*:*)
+	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    CRAY*T3D:*:*:*)
+	echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    CRAY*T3E:*:*:*)
+	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    CRAY*SV1:*:*:*)
+	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    CRAY-2:*:*:*)
+	echo cray2-cray-unicos
+        exit 0 ;;
+    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+        exit 0 ;;
+    hp300:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+	exit 0 ;;
+    sparc*:BSD/OS:*:*)
+	echo sparc-unknown-bsdi${UNAME_RELEASE}
+	exit 0 ;;
+    *:BSD/OS:*:*)
+	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+	exit 0 ;;
+    *:FreeBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+	exit 0 ;;
+    *:OpenBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+	exit 0 ;;
+    i*:CYGWIN*:*)
+	echo ${UNAME_MACHINE}-pc-cygwin
+	exit 0 ;;
+    i*:MINGW*:*)
+	echo ${UNAME_MACHINE}-pc-mingw32
+	exit 0 ;;
+    i*:PW*:*)
+	echo ${UNAME_MACHINE}-pc-pw32
+	exit 0 ;;
+    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+	# How do we know it's Interix rather than the generic POSIX subsystem?
+	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+	# UNAME_MACHINE based on the output of uname instead of i386?
+	echo i386-pc-interix
+	exit 0 ;;
+    i*:UWIN*:*)
+	echo ${UNAME_MACHINE}-pc-uwin
+	exit 0 ;;
+    p*:CYGWIN*:*)
+	echo powerpcle-unknown-cygwin
+	exit 0 ;;
+    prep*:SunOS:5.*:*)
+	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit 0 ;;
+    *:GNU:*:*)
+	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+	exit 0 ;;
+    i*86:Minix:*:*)
+	echo ${UNAME_MACHINE}-pc-minix
+	exit 0 ;;
+    arm*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    ia64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux
+	exit 0 ;;
+    m68*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    mips:Linux:*:*)
+	case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in
+	  big)    echo mips-unknown-linux-gnu && exit 0 ;;
+	  little) echo mipsel-unknown-linux-gnu && exit 0 ;;
+	esac
+	;;
+    ppc:Linux:*:*)
+	echo powerpc-unknown-linux-gnu
+	exit 0 ;;
+    ppc64:Linux:*:*)
+	echo powerpc64-unknown-linux-gnu
+	exit 0 ;;
+    alpha:Linux:*:*)
+	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+	  EV5)   UNAME_MACHINE=alphaev5 ;;
+	  EV56)  UNAME_MACHINE=alphaev56 ;;
+	  PCA56) UNAME_MACHINE=alphapca56 ;;
+	  PCA57) UNAME_MACHINE=alphapca56 ;;
+	  EV6)   UNAME_MACHINE=alphaev6 ;;
+	  EV67)  UNAME_MACHINE=alphaev67 ;;
+	  EV68*) UNAME_MACHINE=alphaev68 ;;
+        esac
+	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+	exit 0 ;;
+    parisc:Linux:*:* | hppa:Linux:*:*)
+	# Look for CPU level
+	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
+	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
+	  *)    echo hppa-unknown-linux-gnu ;;
+	esac
+	exit 0 ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+	echo hppa64-unknown-linux-gnu
+	exit 0 ;;
+    s390:Linux:*:* | s390x:Linux:*:*)
+	echo ${UNAME_MACHINE}-ibm-linux
+	exit 0 ;;
+    sh*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    sparc:Linux:*:* | sparc64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    x86_64:Linux:*:*)
+	echo x86_64-unknown-linux-gnu
+	exit 0 ;;
+    i*86:Linux:*:*)
+	# The BFD linker knows what the default object file format is, so
+	# first see if it will tell us. cd to the root directory to prevent
+	# problems with other programs or directories called `ld' in the path.
+	ld_supported_targets=`cd /; ld --help 2>&1 \
+			 | sed -ne '/supported targets:/!d
+				    s/[ 	][ 	]*/ /g
+				    s/.*supported targets: *//
+				    s/ .*//
+				    p'`
+        case "$ld_supported_targets" in
+	  elf32-i386)
+		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
+		;;
+	  a.out-i386-linux)
+		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+		exit 0 ;;		
+	  coff-i386)
+		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+		exit 0 ;;
+	  "")
+		# Either a pre-BFD a.out linker (linux-gnuoldld) or
+		# one that does not give us useful --help.
+		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+		exit 0 ;;
+	esac
+	# Determine whether the default compiler is a.out or elf
+	eval $set_cc_for_build
+	cat >$dummy.c <<EOF
+#include <features.h>
+#ifdef __cplusplus
+#include <stdio.h>  /* for printf() prototype */
+	int main (int argc, char *argv[]) {
+#else
+	int main (argc, argv) int argc; char *argv[]; {
+#endif
+#ifdef __ELF__
+# ifdef __GLIBC__
+#  if __GLIBC__ >= 2
+    printf ("%s-pc-linux-gnu\n", argv[1]);
+#  else
+    printf ("%s-pc-linux-gnulibc1\n", argv[1]);
+#  endif
+# else
+   printf ("%s-pc-linux-gnulibc1\n", argv[1]);
+# endif
+#else
+  printf ("%s-pc-linux-gnuaout\n", argv[1]);
+#endif
+  return 0;
+}
+EOF
+	$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
+	rm -f $dummy.c $dummy
+	test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
+	;;
+    i*86:DYNIX/ptx:4*:*)
+	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+	# earlier versions are messed up and put the nodename in both
+	# sysname and nodename.
+	echo i386-sequent-sysv4
+	exit 0 ;;
+    i*86:UNIX_SV:4.2MP:2.*)
+        # Unixware is an offshoot of SVR4, but it has its own version
+        # number series starting with 2...
+        # I am not positive that other SVR4 systems won't match this,
+	# I just have to hope.  -- rms.
+        # Use sysv4.2uw... so that sysv4* matches it.
+	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+	exit 0 ;;
+    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+	else
+		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+	fi
+	exit 0 ;;
+    i*86:*:5:[78]*)
+	case `/bin/uname -X | grep "^Machine"` in
+	    *486*)	     UNAME_MACHINE=i486 ;;
+	    *Pentium)	     UNAME_MACHINE=i586 ;;
+	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+	esac
+	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+	exit 0 ;;
+    i*86:*:3.2:*)
+	if test -f /usr/options/cb.name; then
+		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+	elif /bin/uname -X 2>/dev/null >/dev/null ; then
+		UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
+		(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
+		(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
+			&& UNAME_MACHINE=i586
+		(/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
+			&& UNAME_MACHINE=i686
+		(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
+			&& UNAME_MACHINE=i686
+		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+	else
+		echo ${UNAME_MACHINE}-pc-sysv32
+	fi
+	exit 0 ;;
+    i*86:*DOS:*:*)
+	echo ${UNAME_MACHINE}-pc-msdosdjgpp
+	exit 0 ;;
+    pc:*:*:*)
+	# Left here for compatibility:
+        # uname -m prints for DJGPP always 'pc', but it prints nothing about
+        # the processor, so we play safe by assuming i386.
+	echo i386-pc-msdosdjgpp
+        exit 0 ;;
+    Intel:Mach:3*:*)
+	echo i386-pc-mach3
+	exit 0 ;;
+    paragon:*:*:*)
+	echo i860-intel-osf1
+	exit 0 ;;
+    i860:*:4.*:*) # i860-SVR4
+	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+	else # Add other i860-SVR4 vendors below as they are discovered.
+	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
+	fi
+	exit 0 ;;
+    mini*:CTIX:SYS*5:*)
+	# "miniframe"
+	echo m68010-convergent-sysv
+	exit 0 ;;
+    M68*:*:R3V[567]*:*)
+	test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+    3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
+	OS_REL=''
+	test -r /etc/.relid \
+	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+	  && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+	  && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
+    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+          && echo i486-ncr-sysv4 && exit 0 ;;
+    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+	echo m68k-unknown-lynxos${UNAME_RELEASE}
+	exit 0 ;;
+    mc68030:UNIX_System_V:4.*:*)
+	echo m68k-atari-sysv4
+	exit 0 ;;
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+	echo i386-unknown-lynxos${UNAME_RELEASE}
+	exit 0 ;;
+    TSUNAMI:LynxOS:2.*:*)
+	echo sparc-unknown-lynxos${UNAME_RELEASE}
+	exit 0 ;;
+    rs6000:LynxOS:2.*:*)
+	echo rs6000-unknown-lynxos${UNAME_RELEASE}
+	exit 0 ;;
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+	echo powerpc-unknown-lynxos${UNAME_RELEASE}
+	exit 0 ;;
+    SM[BE]S:UNIX_SV:*:*)
+	echo mips-dde-sysv${UNAME_RELEASE}
+	exit 0 ;;
+    RM*:ReliantUNIX-*:*:*)
+	echo mips-sni-sysv4
+	exit 0 ;;
+    RM*:SINIX-*:*:*)
+	echo mips-sni-sysv4
+	exit 0 ;;
+    *:SINIX-*:*:*)
+	if uname -p 2>/dev/null >/dev/null ; then
+		UNAME_MACHINE=`(uname -p) 2>/dev/null`
+		echo ${UNAME_MACHINE}-sni-sysv4
+	else
+		echo ns32k-sni-sysv
+	fi
+	exit 0 ;;
+    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+                      # says <Richard.M.Bartel at ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit 0 ;;
+    *:UNIX_System_V:4*:FTX*)
+	# From Gerald Hewes <hewes at openmarket.com>.
+	# How about differentiating between stratus architectures? -djm
+	echo hppa1.1-stratus-sysv4
+	exit 0 ;;
+    *:*:*:FTX*)
+	# From seanf at swdc.stratus.com.
+	echo i860-stratus-sysv4
+	exit 0 ;;
+    *:VOS:*:*)
+	# From Paul.Green at stratus.com.
+	echo hppa1.1-stratus-vos
+	exit 0 ;;
+    mc68*:A/UX:*:*)
+	echo m68k-apple-aux${UNAME_RELEASE}
+	exit 0 ;;
+    news*:NEWS-OS:6*:*)
+	echo mips-sony-newsos6
+	exit 0 ;;
+    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+	if [ -d /usr/nec ]; then
+	        echo mips-nec-sysv${UNAME_RELEASE}
+	else
+	        echo mips-unknown-sysv${UNAME_RELEASE}
+	fi
+        exit 0 ;;
+    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
+	echo powerpc-be-beos
+	exit 0 ;;
+    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
+	echo powerpc-apple-beos
+	exit 0 ;;
+    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
+	echo i586-pc-beos
+	exit 0 ;;
+    SX-4:SUPER-UX:*:*)
+	echo sx4-nec-superux${UNAME_RELEASE}
+	exit 0 ;;
+    SX-5:SUPER-UX:*:*)
+	echo sx5-nec-superux${UNAME_RELEASE}
+	exit 0 ;;
+    Power*:Rhapsody:*:*)
+	echo powerpc-apple-rhapsody${UNAME_RELEASE}
+	exit 0 ;;
+    *:Rhapsody:*:*)
+	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+	exit 0 ;;
+    *:Darwin:*:*)
+	echo `uname -p`-apple-darwin${UNAME_RELEASE}
+	exit 0 ;;
+    *:procnto*:*:* | *:QNX:[0123456789]*:*)
+	if test "${UNAME_MACHINE}" = "x86pc"; then
+		UNAME_MACHINE=pc
+	fi
+	echo `uname -p`-${UNAME_MACHINE}-nto-qnx
+	exit 0 ;;
+    *:QNX:*:4*)
+	echo i386-pc-qnx
+	exit 0 ;;
+    NSR-[KW]:NONSTOP_KERNEL:*:*)
+	echo nsr-tandem-nsk${UNAME_RELEASE}
+	exit 0 ;;
+    *:NonStop-UX:*:*)
+	echo mips-compaq-nonstopux
+	exit 0 ;;
+    BS2000:POSIX*:*:*)
+	echo bs2000-siemens-sysv
+	exit 0 ;;
+    DS/*:UNIX_System_V:*:*)
+	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+	exit 0 ;;
+    *:Plan9:*:*)
+	# "uname -m" is not consistent, so use $cputype instead. 386
+	# is converted to i386 for consistency with other x86
+	# operating systems.
+	if test "$cputype" = "386"; then
+	    UNAME_MACHINE=i386
+	else
+	    UNAME_MACHINE="$cputype"
+	fi
+	echo ${UNAME_MACHINE}-unknown-plan9
+	exit 0 ;;
+    i*86:OS/2:*:*)
+	# If we were able to find `uname', then EMX Unix compatibility
+	# is probably installed.
+	echo ${UNAME_MACHINE}-pc-os2-emx
+	exit 0 ;;
+    *:TOPS-10:*:*)
+	echo pdp10-unknown-tops10
+	exit 0 ;;
+    *:TENEX:*:*)
+	echo pdp10-unknown-tenex
+	exit 0 ;;
+    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+	echo pdp10-dec-tops20
+	exit 0 ;;
+    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+	echo pdp10-xkl-tops20
+	exit 0 ;;
+    *:TOPS-20:*:*)
+	echo pdp10-unknown-tops20
+	exit 0 ;;
+    *:ITS:*:*)
+	echo pdp10-unknown-its
+	exit 0 ;;
+    i*86:XTS-300:*:STOP)
+	echo ${UNAME_MACHINE}-unknown-stop
+	exit 0 ;;
+    i*86:atheos:*:*)
+	echo ${UNAME_MACHINE}-unknown-atheos
+	exit 0 ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
+     I don't know....  */
+  printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+  printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+          "4"
+#else
+	  ""
+#endif
+         ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+  printf ("arm-acorn-riscix"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+  printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+  int version;
+  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+  if (version < 4)
+    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+  else
+    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+  exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+  printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+  printf ("ns32k-encore-mach\n"); exit (0);
+#else
+  printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+  printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+  printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+  printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+    struct utsname un;
+
+    uname(&un);
+
+    if (strncmp(un.version, "V2", 2) == 0) {
+	printf ("i386-sequent-ptx2\n"); exit (0);
+    }
+    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+	printf ("i386-sequent-ptx1\n"); exit (0);
+    }
+    printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+#  include <sys/param.h>
+#  if defined (BSD)
+#   if BSD == 43
+      printf ("vax-dec-bsd4.3\n"); exit (0);
+#   else
+#    if BSD == 199006
+      printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#    else
+      printf ("vax-dec-bsd\n"); exit (0);
+#    endif
+#   endif
+#  else
+    printf ("vax-dec-bsd\n"); exit (0);
+#  endif
+# else
+    printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+  printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+  exit (1);
+}
+EOF
+
+$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
+rm -f $dummy.c $dummy
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+    case `getsysinfo -f cpu_type` in
+    c1*)
+	echo c1-convex-bsd
+	exit 0 ;;
+    c2*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+	exit 0 ;;
+    c34*)
+	echo c34-convex-bsd
+	exit 0 ;;
+    c38*)
+	echo c38-convex-bsd
+	exit 0 ;;
+    c4*)
+	echo c4-convex-bsd
+	exit 0 ;;
+    esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+    ftp://ftp.gnu.org/pub/gnu/config/
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches at gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo               = `(hostinfo) 2>/dev/null`
+/bin/universe          = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch              = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM  = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:


Property changes on: experimental/j/Elphel333/rtp/daemon/rtp/config.guess
___________________________________________________________________
Name: svn:executable
   + 

Added: experimental/j/Elphel333/rtp/daemon/rtp/config.h.in
===================================================================
--- experimental/j/Elphel333/rtp/daemon/rtp/config.h.in	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/daemon/rtp/config.h.in	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,174 @@
+/* config.h.in.  Generated from configure.in by autoheader.  */
+/*
+ * Define this if you have a /dev/urandom which can supply good random numbers.
+ */
+#undef HAVE_DEV_URANDOM
+
+/*
+ * Define this if you want IPv6 support.
+ */
+#undef HAVE_IPv6
+
+/*
+ * V6 structures that host may or may not be present.
+ */
+#undef HAVE_ST_ADDRINFO
+#undef HAVE_GETIPNODEBYNAME
+#undef HAVE_SIN6_LEN
+
+/*
+ * Define these if your C library is missing some functions...
+ */
+#undef NEED_VSNPRINTF
+#undef NEED_INET_PTON
+#undef NEED_INET_NTOP
+
+/*
+ * If you don't have these types in <inttypes.h>, #define these to be
+ * the types you do have.
+ */
+#undef int8_t
+#undef int16_t
+#undef int32_t
+#undef int64_t
+#undef uint8_t
+#undef uint16_t
+#undef uint32_t
+
+/*
+ * Debugging:
+ * DEBUG: general debugging
+ * DEBUG_MEM: debug memory allocation
+ */
+#undef DEBUG
+#undef DEBUG_MEM
+
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the `inet_aton' function. */
+#undef HAVE_INET_ATON
+
+/* Define to 1 if you have the `inet_ntop' function. */
+#undef HAVE_INET_NTOP
+
+/* Define to 1 if you have the `inet_pton' function. */
+#undef HAVE_INET_PTON
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <netinet6/in6.h> header file. */
+#undef HAVE_NETINET6_IN6_H
+
+/* Define to 1 if you have the <netinet/ip6.h> header file. */
+#undef HAVE_NETINET_IP6_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <stropts.h> header file. */
+#undef HAVE_STROPTS_H
+
+/* Define to 1 if you have the <sys/filio.h> header file. */
+#undef HAVE_SYS_FILIO_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
+#undef HAVE_SYS_WAIT_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the `vsnprintf' function. */
+#undef HAVE_VSNPRINTF
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
+/* Version number of package */
+#undef VERSION
+
+/* Define to 1 if your processor stores words with the most significant byte
+   first (like Motorola and SPARC, unlike Intel and VAX). */
+#undef WORDS_BIGENDIAN
+
+/* Define to 1 if type `char' is unsigned and you are not using gcc.  */
+#ifndef __CHAR_UNSIGNED__
+# undef __CHAR_UNSIGNED__
+#endif
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to `short' if <sys/types.h> does not define. */
+#undef int16_t
+
+/* Define to `long' if <sys/types.h> does not define. */
+#undef int32_t
+
+/* Define to `long long' if <sys/types.h> does not define. */
+#undef int64_t
+
+/* Define to `signed char' if <sys/types.h> does not define. */
+#undef int8_t
+
+/* Define to `unsigned' if <sys/types.h> does not define. */
+#undef size_t
+
+/* Define to `unsigned short' if <sys/types.h> does not define. */
+#undef uint16_t
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef uint32_t
+
+/* Define to `unsigned char' if <sys/types.h> does not define. */
+#undef uint8_t
+
+#ifndef WORDS_BIGENDIAN
+#define WORDS_SMALLENDIAN
+#endif
+
+

Added: experimental/j/Elphel333/rtp/daemon/rtp/config.sub
===================================================================
--- experimental/j/Elphel333/rtp/daemon/rtp/config.sub	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/daemon/rtp/config.sub	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,1411 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+#   Free Software Foundation, Inc.
+
+timestamp='2001-09-07'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine.  It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Please send patches to <config-patches at gnu.org>.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support.  The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+       $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches at gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit 0 ;;
+    --version | -v )
+       echo "$version" ; exit 0 ;;
+    --help | --h* | -h )
+       echo "$usage"; exit 0 ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help"
+       exit 1 ;;
+
+    *local*)
+       # First pass through any local machine types.
+       echo $1
+       exit 0;;
+
+    * )
+       break ;;
+  esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+    exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+    exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+  nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*)
+    os=-$maybe_os
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+    ;;
+  *)
+    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+    if [ $basic_machine != $1 ]
+    then os=`echo $1 | sed 's/.*-/-/'`
+    else os=; fi
+    ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work.  We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+	-sun*os*)
+		# Prevent following clause from handling this invalid input.
+		;;
+	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+	-apple | -axis)
+		os=
+		basic_machine=$1
+		;;
+	-sim | -cisco | -oki | -wec | -winbond)
+		os=
+		basic_machine=$1
+		;;
+	-scout)
+		;;
+	-wrs)
+		os=-vxworks
+		basic_machine=$1
+		;;
+	-chorusos*)
+		os=-chorusos
+		basic_machine=$1
+		;;
+ 	-chorusrdb)
+ 		os=-chorusrdb
+		basic_machine=$1
+ 		;;
+	-hiux*)
+		os=-hiuxwe2
+		;;
+	-sco5)
+		os=-sco3.2v5
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco4)
+		os=-sco3.2v4
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco3.2.[4-9]*)
+		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco3.2v[4-9]*)
+		# Don't forget version if it is 3.2v4 or newer.
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco*)
+		os=-sco3.2v2
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-udk*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-isc)
+		os=-isc2.2
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-clix*)
+		basic_machine=clipper-intergraph
+		;;
+	-isc*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-lynx*)
+		os=-lynxos
+		;;
+	-ptx*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+		;;
+	-windowsnt*)
+		os=`echo $os | sed -e 's/windowsnt/winnt/'`
+		;;
+	-psos*)
+		os=-psos
+		;;
+	-mint | -mint[0-9]*)
+		basic_machine=m68k-atari
+		os=-mint
+		;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+	# Recognize the basic CPU types without company name.
+	# Some are omitted here because they have special meanings below.
+	1750a | 580 \
+	| a29k \
+	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+	| c4x | clipper \
+	| d10v | d30v | dsp16xx \
+	| fr30 \
+	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+	| i370 | i860 | i960 | ia64 \
+	| m32r | m68000 | m68k | m88k | mcore \
+	| mips16 | mips64 | mips64el | mips64orion | mips64orionel \
+	| mips64vr4100 | mips64vr4100el | mips64vr4300 \
+	| mips64vr4300el | mips64vr5000 | mips64vr5000el \
+	| mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \
+	| mipsisa32 \
+	| mn10200 | mn10300 \
+	| ns16k | ns32k \
+	| openrisc \
+	| pdp10 | pdp11 | pj | pjl \
+	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+	| pyramid \
+	| s390 | s390x \
+	| sh | sh[34] | sh[34]eb | shbe | shle \
+	| sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \
+	| stormy16 | strongarm \
+	| tahoe | thumb | tic80 | tron \
+	| v850 \
+	| we32k \
+	| x86 | xscale \
+	| z8k)
+		basic_machine=$basic_machine-unknown
+		;;
+	m6811 | m68hc11 | m6812 | m68hc12)
+		# Motorola 68HC11/12.
+		basic_machine=$basic_machine-unknown
+		os=-none
+		;;
+	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+		;;
+
+	# We use `pc' rather than `unknown'
+	# because (1) that's what they normally are, and
+	# (2) the word "unknown" tends to confuse beginning users.
+	i*86 | x86_64)
+	  basic_machine=$basic_machine-pc
+	  ;;
+	# Object if more than one company name word.
+	*-*-*)
+		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+		exit 1
+		;;
+	# Recognize the basic CPU types with company name.
+	580-* \
+	| a29k-* \
+	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+	| alphapca5[67]-* | arc-* \
+	| arm-*  | armbe-* | armle-* | armv*-* \
+	| bs2000-* \
+	| c[123]* | c30-* | [cjt]90-* | c54x-* \
+	| clipper-* | cray2-* | cydra-* \
+	| d10v-* | d30v-* \
+	| elxsi-* \
+	| f30[01]-* | f700-* | fr30-* | fx80-* \
+	| h8300-* | h8500-* \
+	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+	| i*86-* | i860-* | i960-* | ia64-* \
+	| m32r-* \
+	| m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \
+	| m88110-* | m88k-* | mcore-* \
+	| mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \
+	| mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \
+	| mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \
+	| mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \
+	| none-* | np1-* | ns16k-* | ns32k-* \
+	| orion-* \
+	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+	| pyramid-* \
+	| romp-* | rs6000-* \
+	| s390-* | s390x-* \
+	| sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \
+	| sparc-* | sparc64-* | sparc86x-* | sparclite-* \
+	| sparcv9-* | sparcv9b-* | stormy16-* | strongarm-* | sv1-* \
+	| t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \
+	| v850-* | vax-* \
+	| we32k-* \
+	| x86-* | x86_64-* | xmp-* | xps100-* | xscale-* \
+	| ymp-* \
+	| z8k-*)
+		;;
+	# Recognize the various machine names and aliases which stand
+	# for a CPU type and a company and sometimes even an OS.
+	386bsd)
+		basic_machine=i386-unknown
+		os=-bsd
+		;;
+	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+		basic_machine=m68000-att
+		;;
+	3b*)
+		basic_machine=we32k-att
+		;;
+	a29khif)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	adobe68k)
+		basic_machine=m68010-adobe
+		os=-scout
+		;;
+	alliant | fx80)
+		basic_machine=fx80-alliant
+		;;
+	altos | altos3068)
+		basic_machine=m68k-altos
+		;;
+	am29k)
+		basic_machine=a29k-none
+		os=-bsd
+		;;
+	amdahl)
+		basic_machine=580-amdahl
+		os=-sysv
+		;;
+	amiga | amiga-*)
+		basic_machine=m68k-unknown
+		;;
+	amigaos | amigados)
+		basic_machine=m68k-unknown
+		os=-amigaos
+		;;
+	amigaunix | amix)
+		basic_machine=m68k-unknown
+		os=-sysv4
+		;;
+	apollo68)
+		basic_machine=m68k-apollo
+		os=-sysv
+		;;
+	apollo68bsd)
+		basic_machine=m68k-apollo
+		os=-bsd
+		;;
+	aux)
+		basic_machine=m68k-apple
+		os=-aux
+		;;
+	balance)
+		basic_machine=ns32k-sequent
+		os=-dynix
+		;;
+	convex-c1)
+		basic_machine=c1-convex
+		os=-bsd
+		;;
+	convex-c2)
+		basic_machine=c2-convex
+		os=-bsd
+		;;
+	convex-c32)
+		basic_machine=c32-convex
+		os=-bsd
+		;;
+	convex-c34)
+		basic_machine=c34-convex
+		os=-bsd
+		;;
+	convex-c38)
+		basic_machine=c38-convex
+		os=-bsd
+		;;
+	cray | ymp)
+		basic_machine=ymp-cray
+		os=-unicos
+		;;
+	cray2)
+		basic_machine=cray2-cray
+		os=-unicos
+		;;
+	[cjt]90)
+		basic_machine=${basic_machine}-cray
+		os=-unicos
+		;;
+	crds | unos)
+		basic_machine=m68k-crds
+		;;
+	cris | cris-* | etrax*)
+		basic_machine=cris-axis
+		;;
+	da30 | da30-*)
+		basic_machine=m68k-da30
+		;;
+	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+		basic_machine=mips-dec
+		;;
+	delta | 3300 | motorola-3300 | motorola-delta \
+	      | 3300-motorola | delta-motorola)
+		basic_machine=m68k-motorola
+		;;
+	delta88)
+		basic_machine=m88k-motorola
+		os=-sysv3
+		;;
+	dpx20 | dpx20-*)
+		basic_machine=rs6000-bull
+		os=-bosx
+		;;
+	dpx2* | dpx2*-bull)
+		basic_machine=m68k-bull
+		os=-sysv3
+		;;
+	ebmon29k)
+		basic_machine=a29k-amd
+		os=-ebmon
+		;;
+	elxsi)
+		basic_machine=elxsi-elxsi
+		os=-bsd
+		;;
+	encore | umax | mmax)
+		basic_machine=ns32k-encore
+		;;
+	es1800 | OSE68k | ose68k | ose | OSE)
+		basic_machine=m68k-ericsson
+		os=-ose
+		;;
+	fx2800)
+		basic_machine=i860-alliant
+		;;
+	genix)
+		basic_machine=ns32k-ns
+		;;
+	gmicro)
+		basic_machine=tron-gmicro
+		os=-sysv
+		;;
+	go32)
+		basic_machine=i386-pc
+		os=-go32
+		;;
+	h3050r* | hiux*)
+		basic_machine=hppa1.1-hitachi
+		os=-hiuxwe2
+		;;
+	h8300hms)
+		basic_machine=h8300-hitachi
+		os=-hms
+		;;
+	h8300xray)
+		basic_machine=h8300-hitachi
+		os=-xray
+		;;
+	h8500hms)
+		basic_machine=h8500-hitachi
+		os=-hms
+		;;
+	harris)
+		basic_machine=m88k-harris
+		os=-sysv3
+		;;
+	hp300-*)
+		basic_machine=m68k-hp
+		;;
+	hp300bsd)
+		basic_machine=m68k-hp
+		os=-bsd
+		;;
+	hp300hpux)
+		basic_machine=m68k-hp
+		os=-hpux
+		;;
+	hp3k9[0-9][0-9] | hp9[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hp9k2[0-9][0-9] | hp9k31[0-9])
+		basic_machine=m68000-hp
+		;;
+	hp9k3[2-9][0-9])
+		basic_machine=m68k-hp
+		;;
+	hp9k6[0-9][0-9] | hp6[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hp9k7[0-79][0-9] | hp7[0-79][0-9])
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k78[0-9] | hp78[0-9])
+		# FIXME: really hppa2.0-hp
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+		# FIXME: really hppa2.0-hp
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[0-9][13679] | hp8[0-9][13679])
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[0-9][0-9] | hp8[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hppa-next)
+		os=-nextstep3
+		;;
+	hppaosf)
+		basic_machine=hppa1.1-hp
+		os=-osf
+		;;
+	hppro)
+		basic_machine=hppa1.1-hp
+		os=-proelf
+		;;
+	i370-ibm* | ibm*)
+		basic_machine=i370-ibm
+		;;
+# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
+	i*86v32)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv32
+		;;
+	i*86v4*)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv4
+		;;
+	i*86v)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv
+		;;
+	i*86sol2)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-solaris2
+		;;
+	i386mach)
+		basic_machine=i386-mach
+		os=-mach
+		;;
+	i386-vsta | vsta)
+		basic_machine=i386-unknown
+		os=-vsta
+		;;
+	iris | iris4d)
+		basic_machine=mips-sgi
+		case $os in
+		    -irix*)
+			;;
+		    *)
+			os=-irix4
+			;;
+		esac
+		;;
+	isi68 | isi)
+		basic_machine=m68k-isi
+		os=-sysv
+		;;
+	m88k-omron*)
+		basic_machine=m88k-omron
+		;;
+	magnum | m3230)
+		basic_machine=mips-mips
+		os=-sysv
+		;;
+	merlin)
+		basic_machine=ns32k-utek
+		os=-sysv
+		;;
+	mingw32)
+		basic_machine=i386-pc
+		os=-mingw32
+		;;
+	miniframe)
+		basic_machine=m68000-convergent
+		;;
+	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+		basic_machine=m68k-atari
+		os=-mint
+		;;
+	mipsel*-linux*)
+		basic_machine=mipsel-unknown
+		os=-linux-gnu
+		;;
+	mips*-linux*)
+		basic_machine=mips-unknown
+		os=-linux-gnu
+		;;
+	mips3*-*)
+		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+		;;
+	mips3*)
+		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+		;;
+	mmix*)
+		basic_machine=mmix-knuth
+		os=-mmixware
+		;;
+	monitor)
+		basic_machine=m68k-rom68k
+		os=-coff
+		;;
+	msdos)
+		basic_machine=i386-pc
+		os=-msdos
+		;;
+	mvs)
+		basic_machine=i370-ibm
+		os=-mvs
+		;;
+	ncr3000)
+		basic_machine=i486-ncr
+		os=-sysv4
+		;;
+	netbsd386)
+		basic_machine=i386-unknown
+		os=-netbsd
+		;;
+	netwinder)
+		basic_machine=armv4l-rebel
+		os=-linux
+		;;
+	news | news700 | news800 | news900)
+		basic_machine=m68k-sony
+		os=-newsos
+		;;
+	news1000)
+		basic_machine=m68030-sony
+		os=-newsos
+		;;
+	news-3600 | risc-news)
+		basic_machine=mips-sony
+		os=-newsos
+		;;
+	necv70)
+		basic_machine=v70-nec
+		os=-sysv
+		;;
+	next | m*-next )
+		basic_machine=m68k-next
+		case $os in
+		    -nextstep* )
+			;;
+		    -ns2*)
+		      os=-nextstep2
+			;;
+		    *)
+		      os=-nextstep3
+			;;
+		esac
+		;;
+	nh3000)
+		basic_machine=m68k-harris
+		os=-cxux
+		;;
+	nh[45]000)
+		basic_machine=m88k-harris
+		os=-cxux
+		;;
+	nindy960)
+		basic_machine=i960-intel
+		os=-nindy
+		;;
+	mon960)
+		basic_machine=i960-intel
+		os=-mon960
+		;;
+	nonstopux)
+		basic_machine=mips-compaq
+		os=-nonstopux
+		;;
+	np1)
+		basic_machine=np1-gould
+		;;
+	nsr-tandem)
+		basic_machine=nsr-tandem
+		;;
+	op50n-* | op60c-*)
+		basic_machine=hppa1.1-oki
+		os=-proelf
+		;;
+	OSE68000 | ose68000)
+		basic_machine=m68000-ericsson
+		os=-ose
+		;;
+	os68k)
+		basic_machine=m68k-none
+		os=-os68k
+		;;
+	pa-hitachi)
+		basic_machine=hppa1.1-hitachi
+		os=-hiuxwe2
+		;;
+	paragon)
+		basic_machine=i860-intel
+		os=-osf
+		;;
+	pbd)
+		basic_machine=sparc-tti
+		;;
+	pbb)
+		basic_machine=m68k-tti
+		;;
+        pc532 | pc532-*)
+		basic_machine=ns32k-pc532
+		;;
+	pentium | p5 | k5 | k6 | nexgen)
+		basic_machine=i586-pc
+		;;
+	pentiumpro | p6 | 6x86 | athlon)
+		basic_machine=i686-pc
+		;;
+	pentiumii | pentium2)
+		basic_machine=i686-pc
+		;;
+	pentium-* | p5-* | k5-* | k6-* | nexgen-*)
+		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentiumpro-* | p6-* | 6x86-* | athlon-*)
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentiumii-* | pentium2-*)
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pn)
+		basic_machine=pn-gould
+		;;
+	power)	basic_machine=power-ibm
+		;;
+	ppc)	basic_machine=powerpc-unknown
+	        ;;
+	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppcle | powerpclittle | ppc-le | powerpc-little)
+		basic_machine=powerpcle-unknown
+	        ;;
+	ppcle-* | powerpclittle-*)
+		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppc64)	basic_machine=powerpc64-unknown
+	        ;;
+	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+		basic_machine=powerpc64le-unknown
+	        ;;
+	ppc64le-* | powerpc64little-*)
+		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ps2)
+		basic_machine=i386-ibm
+		;;
+	pw32)
+		basic_machine=i586-unknown
+		os=-pw32
+		;;
+	rom68k)
+		basic_machine=m68k-rom68k
+		os=-coff
+		;;
+	rm[46]00)
+		basic_machine=mips-siemens
+		;;
+	rtpc | rtpc-*)
+		basic_machine=romp-ibm
+		;;
+	sa29200)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	sequent)
+		basic_machine=i386-sequent
+		;;
+	sh)
+		basic_machine=sh-hitachi
+		os=-hms
+		;;
+	sparclite-wrs)
+		basic_machine=sparclite-wrs
+		os=-vxworks
+		;;
+	sps7)
+		basic_machine=m68k-bull
+		os=-sysv2
+		;;
+	spur)
+		basic_machine=spur-unknown
+		;;
+	st2000)
+		basic_machine=m68k-tandem
+		;;
+	stratus)
+		basic_machine=i860-stratus
+		os=-sysv4
+		;;
+	sun2)
+		basic_machine=m68000-sun
+		;;
+	sun2os3)
+		basic_machine=m68000-sun
+		os=-sunos3
+		;;
+	sun2os4)
+		basic_machine=m68000-sun
+		os=-sunos4
+		;;
+	sun3os3)
+		basic_machine=m68k-sun
+		os=-sunos3
+		;;
+	sun3os4)
+		basic_machine=m68k-sun
+		os=-sunos4
+		;;
+	sun4os3)
+		basic_machine=sparc-sun
+		os=-sunos3
+		;;
+	sun4os4)
+		basic_machine=sparc-sun
+		os=-sunos4
+		;;
+	sun4sol2)
+		basic_machine=sparc-sun
+		os=-solaris2
+		;;
+	sun3 | sun3-*)
+		basic_machine=m68k-sun
+		;;
+	sun4)
+		basic_machine=sparc-sun
+		;;
+	sun386 | sun386i | roadrunner)
+		basic_machine=i386-sun
+		;;
+	sv1)
+		basic_machine=sv1-cray
+		os=-unicos
+		;;
+	symmetry)
+		basic_machine=i386-sequent
+		os=-dynix
+		;;
+	t3e)
+		basic_machine=t3e-cray
+		os=-unicos
+		;;
+	tic54x | c54x*)
+		basic_machine=tic54x-unknown
+		os=-coff
+		;;
+	tx39)
+		basic_machine=mipstx39-unknown
+		;;
+	tx39el)
+		basic_machine=mipstx39el-unknown
+		;;
+	tower | tower-32)
+		basic_machine=m68k-ncr
+		;;
+	udi29k)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	ultra3)
+		basic_machine=a29k-nyu
+		os=-sym1
+		;;
+	v810 | necv810)
+		basic_machine=v810-nec
+		os=-none
+		;;
+	vaxv)
+		basic_machine=vax-dec
+		os=-sysv
+		;;
+	vms)
+		basic_machine=vax-dec
+		os=-vms
+		;;
+	vpp*|vx|vx-*)
+               basic_machine=f301-fujitsu
+               ;;
+	vxworks960)
+		basic_machine=i960-wrs
+		os=-vxworks
+		;;
+	vxworks68)
+		basic_machine=m68k-wrs
+		os=-vxworks
+		;;
+	vxworks29k)
+		basic_machine=a29k-wrs
+		os=-vxworks
+		;;
+	w65*)
+		basic_machine=w65-wdc
+		os=-none
+		;;
+	w89k-*)
+		basic_machine=hppa1.1-winbond
+		os=-proelf
+		;;
+	windows32)
+		basic_machine=i386-pc
+		os=-windows32-msvcrt
+		;;
+	xmp)
+		basic_machine=xmp-cray
+		os=-unicos
+		;;
+        xps | xps100)
+		basic_machine=xps100-honeywell
+		;;
+	z8k-*-coff)
+		basic_machine=z8k-unknown
+		os=-sim
+		;;
+	none)
+		basic_machine=none-none
+		os=-none
+		;;
+
+# Here we handle the default manufacturer of certain CPU types.  It is in
+# some cases the only manufacturer, in others, it is the most popular.
+	w89k)
+		basic_machine=hppa1.1-winbond
+		;;
+	op50n)
+		basic_machine=hppa1.1-oki
+		;;
+	op60c)
+		basic_machine=hppa1.1-oki
+		;;
+	mips)
+		if [ x$os = x-linux-gnu ]; then
+			basic_machine=mips-unknown
+		else
+			basic_machine=mips-mips
+		fi
+		;;
+	romp)
+		basic_machine=romp-ibm
+		;;
+	rs6000)
+		basic_machine=rs6000-ibm
+		;;
+	vax)
+		basic_machine=vax-dec
+		;;
+	pdp10)
+		# there are many clones, so DEC is not a safe bet
+		basic_machine=pdp10-unknown
+		;;
+	pdp11)
+		basic_machine=pdp11-dec
+		;;
+	we32k)
+		basic_machine=we32k-att
+		;;
+	sh3 | sh4 | sh3eb | sh4eb)
+		basic_machine=sh-unknown
+		;;
+	sparc | sparcv9 | sparcv9b)
+		basic_machine=sparc-sun
+		;;
+        cydra)
+		basic_machine=cydra-cydrome
+		;;
+	orion)
+		basic_machine=orion-highlevel
+		;;
+	orion105)
+		basic_machine=clipper-highlevel
+		;;
+	mac | mpw | mac-mpw)
+		basic_machine=m68k-apple
+		;;
+	pmac | pmac-mpw)
+		basic_machine=powerpc-apple
+		;;
+	c4x*)
+		basic_machine=c4x-none
+		os=-coff
+		;;
+	*-unknown)
+		# Make sure to match an already-canonicalized machine name.
+		;;
+	*)
+		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+		exit 1
+		;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+	*-digital*)
+		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+		;;
+	*-commodore*)
+		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+		;;
+	*)
+		;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+        # First match some system type aliases
+        # that might get confused with valid system types.
+	# -solaris* is a basic system type, with this one exception.
+	-solaris1 | -solaris1.*)
+		os=`echo $os | sed -e 's|solaris1|sunos4|'`
+		;;
+	-solaris)
+		os=-solaris2
+		;;
+	-svr4*)
+		os=-sysv4
+		;;
+	-unixware*)
+		os=-sysv4.2uw
+		;;
+	-gnu/linux*)
+		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+		;;
+	# First accept the basic system types.
+	# The portable systems comes first.
+	# Each alternative MUST END IN A *, to match a version number.
+	# -sysv* is not here because it comes later, after sysvr4.
+	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+	      | -aos* \
+	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+	      | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
+	      | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+	      | -chorusos* | -chorusrdb* \
+	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+	      | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
+	      | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
+	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+	      | -os2* | -vos*)
+	# Remember, each alternative MUST END IN *, to match a version number.
+		;;
+	-qnx*)
+		case $basic_machine in
+		    x86-* | i*86-*)
+			;;
+		    *)
+			os=-nto$os
+			;;
+		esac
+		;;
+	-nto*)
+		os=-nto-qnx
+		;;
+	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+		;;
+	-mac*)
+		os=`echo $os | sed -e 's|mac|macos|'`
+		;;
+	-linux*)
+		os=`echo $os | sed -e 's|linux|linux-gnu|'`
+		;;
+	-sunos5*)
+		os=`echo $os | sed -e 's|sunos5|solaris2|'`
+		;;
+	-sunos6*)
+		os=`echo $os | sed -e 's|sunos6|solaris3|'`
+		;;
+	-opened*)
+		os=-openedition
+		;;
+	-wince*)
+		os=-wince
+		;;
+	-osfrose*)
+		os=-osfrose
+		;;
+	-osf*)
+		os=-osf
+		;;
+	-utek*)
+		os=-bsd
+		;;
+	-dynix*)
+		os=-bsd
+		;;
+	-acis*)
+		os=-aos
+		;;
+	-386bsd)
+		os=-bsd
+		;;
+	-ctix* | -uts*)
+		os=-sysv
+		;;
+	-ns2 )
+	        os=-nextstep2
+		;;
+	-nsk*)
+		os=-nsk
+		;;
+	# Preserve the version number of sinix5.
+	-sinix5.*)
+		os=`echo $os | sed -e 's|sinix|sysv|'`
+		;;
+	-sinix*)
+		os=-sysv4
+		;;
+	-triton*)
+		os=-sysv3
+		;;
+	-oss*)
+		os=-sysv3
+		;;
+	-svr4)
+		os=-sysv4
+		;;
+	-svr3)
+		os=-sysv3
+		;;
+	-sysvr4)
+		os=-sysv4
+		;;
+	# This must come after -sysvr4.
+	-sysv*)
+		;;
+	-ose*)
+		os=-ose
+		;;
+	-es1800*)
+		os=-ose
+		;;
+	-xenix)
+		os=-xenix
+		;;
+        -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+	        os=-mint
+		;;
+	-none)
+		;;
+	*)
+		# Get rid of the `-' at the beginning of $os.
+		os=`echo $os | sed 's/[^-]*-//'`
+		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+		exit 1
+		;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system.  Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+	*-acorn)
+		os=-riscix1.2
+		;;
+	arm*-rebel)
+		os=-linux
+		;;
+	arm*-semi)
+		os=-aout
+		;;
+	pdp10-*)
+		os=-tops20
+		;;
+        pdp11-*)
+		os=-none
+		;;
+	*-dec | vax-*)
+		os=-ultrix4.2
+		;;
+	m68*-apollo)
+		os=-domain
+		;;
+	i386-sun)
+		os=-sunos4.0.2
+		;;
+	m68000-sun)
+		os=-sunos3
+		# This also exists in the configure program, but was not the
+		# default.
+		# os=-sunos4
+		;;
+	m68*-cisco)
+		os=-aout
+		;;
+	mips*-cisco)
+		os=-elf
+		;;
+	mips*-*)
+		os=-elf
+		;;
+	*-tti)	# must be before sparc entry or we get the wrong os.
+		os=-sysv3
+		;;
+	sparc-* | *-sun)
+		os=-sunos4.1.1
+		;;
+	*-be)
+		os=-beos
+		;;
+	*-ibm)
+		os=-aix
+		;;
+	*-wec)
+		os=-proelf
+		;;
+	*-winbond)
+		os=-proelf
+		;;
+	*-oki)
+		os=-proelf
+		;;
+	*-hp)
+		os=-hpux
+		;;
+	*-hitachi)
+		os=-hiux
+		;;
+	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+		os=-sysv
+		;;
+	*-cbm)
+		os=-amigaos
+		;;
+	*-dg)
+		os=-dgux
+		;;
+	*-dolphin)
+		os=-sysv3
+		;;
+	m68k-ccur)
+		os=-rtu
+		;;
+	m88k-omron*)
+		os=-luna
+		;;
+	*-next )
+		os=-nextstep
+		;;
+	*-sequent)
+		os=-ptx
+		;;
+	*-crds)
+		os=-unos
+		;;
+	*-ns)
+		os=-genix
+		;;
+	i370-*)
+		os=-mvs
+		;;
+	*-next)
+		os=-nextstep3
+		;;
+        *-gould)
+		os=-sysv
+		;;
+        *-highlevel)
+		os=-bsd
+		;;
+	*-encore)
+		os=-bsd
+		;;
+        *-sgi)
+		os=-irix
+		;;
+        *-siemens)
+		os=-sysv4
+		;;
+	*-masscomp)
+		os=-rtu
+		;;
+	f30[01]-fujitsu | f700-fujitsu)
+		os=-uxpv
+		;;
+	*-rom68k)
+		os=-coff
+		;;
+	*-*bug)
+		os=-coff
+		;;
+	*-apple)
+		os=-macos
+		;;
+	*-atari*)
+		os=-mint
+		;;
+	*)
+		os=-none
+		;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer.  We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+	*-unknown)
+		case $os in
+			-riscix*)
+				vendor=acorn
+				;;
+			-sunos*)
+				vendor=sun
+				;;
+			-aix*)
+				vendor=ibm
+				;;
+			-beos*)
+				vendor=be
+				;;
+			-hpux*)
+				vendor=hp
+				;;
+			-mpeix*)
+				vendor=hp
+				;;
+			-hiux*)
+				vendor=hitachi
+				;;
+			-unos*)
+				vendor=crds
+				;;
+			-dgux*)
+				vendor=dg
+				;;
+			-luna*)
+				vendor=omron
+				;;
+			-genix*)
+				vendor=ns
+				;;
+			-mvs* | -opened*)
+				vendor=ibm
+				;;
+			-ptx*)
+				vendor=sequent
+				;;
+			-vxsim* | -vxworks*)
+				vendor=wrs
+				;;
+			-aux*)
+				vendor=apple
+				;;
+			-hms*)
+				vendor=hitachi
+				;;
+			-mpw* | -macos*)
+				vendor=apple
+				;;
+			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+				vendor=atari
+				;;
+			-vos*)
+				vendor=stratus
+				;;
+		esac
+		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+		;;
+esac
+
+echo $basic_machine$os
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:


Property changes on: experimental/j/Elphel333/rtp/daemon/rtp/config.sub
___________________________________________________________________
Name: svn:executable
   + 

Added: experimental/j/Elphel333/rtp/daemon/rtp/config_unix.h
===================================================================
--- experimental/j/Elphel333/rtp/daemon/rtp/config_unix.h	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/daemon/rtp/config_unix.h	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,203 @@
+/*
+ *  config-unix.h
+ *
+ *  Unix specific definitions and includes
+ *  
+ *  $Revision: 1.1.1.1 $
+ *  $Date: 2005/03/18 09:18:43 $
+ *
+ * Copyright (c) 1995-2000 University College London
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, is permitted provided that the following conditions 
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *      This product includes software developed by the Computer Science
+ *      Department at University College London
+ * 4. Neither the name of the University nor of the Department may be used
+ *    to endorse or promote products derived from this software without
+ *    specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef WIN32
+#ifndef _CONFIG_UNIX_H
+#define _CONFIG_UNIX_H
+#undef VERSION
+#undef PACKAGE
+#include "uclconf.h"
+#undef VERSION
+#undef PACKAGE
+#include "win32_ver.h"
+#include <limits.h>
+#include <sys/types.h>
+#if TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
+#if HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+#endif
+#include <sys/resource.h>
+
+#include <pwd.h>
+#include <signal.h>
+#include <ctype.h>
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <memory.h>
+#include <errno.h>
+#include <math.h>
+#include <stdlib.h>   /* abs() */
+#include <string.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <sys/uio.h>
+#include <netinet/in.h>
+#include <unistd.h>
+#include <sys/param.h>
+
+#ifndef __QNXNTO__
+#include <sys/fcntl.h>
+#endif
+
+#include <sys/ioctl.h>
+#include <netdb.h>
+#include <arpa/inet.h>
+#include <syslog.h>
+#ifdef __APPLE__
+#define NEED_DRAND48
+#define srand48 srand
+#define lrand48 rand() * rand
+#endif
+
+#ifdef HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+#ifndef WEXITSTATUS
+#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+#endif
+#ifndef WIFEXITED
+#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif
+
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+
+#ifdef HAVE_STROPTS_H
+#include <stropts.h>
+#endif /* HAVE_STROPTS_H */
+
+#ifdef HAVE_SYS_FILIO_H
+#include <sys/filio.h>  
+#endif /* HAVE_SYS_FILIO_H */
+
+#ifdef HAVE_IPv6
+
+#ifdef HAVE_NETINET6_IN6_H
+/* Expect IPV6_{JOIN,LEAVE}_GROUP in in6.h, otherwise expect                 */
+/* IPV_{ADD,DROP}_MEMBERSHIP in in.h                                         */
+#include <netinet6/in6.h>
+#else
+#ifdef HAVE_NETINET_IP6_H
+#include <netinet/ip6.h>
+#else
+#include <netinet/in.h>
+#endif
+#endif /* HAVE_NETINET_IN6_H */
+
+#ifndef IPV6_ADD_MEMBERSHIP
+#ifdef  IPV6_JOIN_GROUP
+#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
+#else
+#error  No definition of IPV6_ADD_MEMBERSHIP, please report to mm-tools at cs.ucl.ac.uk.
+#endif /* IPV6_JOIN_GROUP     */
+#endif /* IPV6_ADD_MEMBERSHIP */
+
+#ifndef IPV6_DROP_MEMBERSHIP
+#ifdef  IPV6_LEAVE_GROUP
+#define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP
+#else
+#error  No definition of IPV6_LEAVE_GROUP, please report to mm-tools at cs.ucl.ac.uk.
+#endif  /* IPV6_LEAVE_GROUP     */
+#endif  /* IPV6_DROP_MEMBERSHIP */
+
+#endif /* HAVE_IPv6 */
+
+#include <net/if.h>
+
+typedef u_char	ttl_t;
+typedef int	fd_t;
+
+#ifndef FALSE
+#define FALSE	0
+#endif
+#ifndef TRUE
+#define	TRUE	1
+#endif /* TRUE */
+
+#define USERNAMELEN	8
+
+#ifndef max
+#define max(a, b)	(((a) > (b))? (a): (b))
+#endif
+#ifndef min
+#define min(a, b)	(((a) < (b))? (a): (b))
+#endif
+
+#if 1
+#define ASSERT(x) if ((x) == 0) fprintf(stderr, "%s:%u: failed assertion\n", __FILE__, __LINE__)
+#else
+#include <assert.h>
+#define ASSERT assert
+#endif
+
+#ifdef Solaris
+#ifdef __cplusplus
+extern "C" {
+#endif
+int gettimeofday(struct timeval *tp, void * );
+int gethostname(char *name, int namelen);
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+#ifndef EXIT_SUCCESS
+#define EXIT_SUCCESS 0
+#endif /* EXIT_SUCCESS */
+
+#ifndef EXIT_FAILURE
+#define EXIT_FAILURE 7
+#endif /* EXIT_FAILURE */
+
+#endif /* _CONFIG_UNIX_H_ */
+#endif /* WIN32 */

Added: experimental/j/Elphel333/rtp/daemon/rtp/config_win32.h
===================================================================
--- experimental/j/Elphel333/rtp/daemon/rtp/config_win32.h	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/daemon/rtp/config_win32.h	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,226 @@
+/*
+ *  config-win32.h
+ *
+ *  Windows specific definitions and includes.
+ *  
+ *  $Revision: 1.1.1.1 $
+ *  $Date: 2005/03/18 09:18:48 $
+ *
+ * Copyright (c) 1995-2000 University College London
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, is permitted provided that the following conditions 
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *      This product includes software developed by the Computer Science
+ *      Department at University College London
+ * 4. Neither the name of the University nor of the Department may be used
+ *    to endorse or promote products derived from this software without
+ *    specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifdef WIN32
+#ifndef _CONFIG_WIN32_H
+#define _CONFIG_WIN32_H
+
+#include <limits.h>
+#include <malloc.h>
+#include <stdio.h>
+#include <memory.h>
+#include <errno.h>
+#include <math.h>
+#include <stdlib.h>   /* abs() */
+#include <string.h>
+#include <winsock2.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#ifdef HAVE_IPv6
+#ifdef MUSICA_IPV6
+#include <winsock6.h>
+#else
+#ifdef WIN2K_IPV6
+#include <ws2tcpip.h>
+#include <tpipv6.h>
+#else
+#include <ws2ip6.h>
+#include <ws2tcpip.h>
+#endif
+#endif
+#endif
+
+#ifndef MUSICA_IPV6
+#include <ws2tcpip.h>
+#endif
+
+#include <mmreg.h>
+#include <msacm.h>
+#include <mmsystem.h>
+#include <windows.h>
+#include <io.h>
+#include <process.h>
+#include <fcntl.h>
+#include <time.h>
+#include <sys/timeb.h>
+
+typedef int		ttl_t;
+typedef unsigned int	fd_t;
+
+/*
+ * the definitions below are valid for 32-bit architectures and will have to
+ * be adjusted for 16- or 64-bit architectures
+ */
+typedef unsigned __int8		uint8_t;
+typedef unsigned __int16	uint16_t;
+typedef unsigned __int32	uint32_t;
+typedef unsigned __int64    uint64_t;
+typedef __int8		int8_t;
+typedef __int16		int16_t;
+typedef __int32		int32_t;
+typedef __int64		int64_t;
+typedef unsigned long	in_addr_t;
+
+#ifndef TRUE
+#define FALSE	0
+#define	TRUE	1
+#endif /* TRUE */
+
+#define USERNAMELEN	8
+
+#define WORDS_SMALLENDIAN
+#define NEED_INET_ATON
+#define NEED_DRAND48
+//#define NEED_GETTIMEOFDAY
+
+#ifdef NDEBUG
+#define ASSERT(x) if ((x) == 0) fprintf(stderr, "%s:%u: failed assertion\n", __FILE__, __LINE__)
+#else
+#define ASSERT assert
+#include <assert.h>
+#endif
+
+#include <time.h>		/* For clock_t */
+
+#define inline
+#define __inline     
+
+#define AUDIO_MICROPHONE	1
+#define AUDIO_LINE_IN		2
+#define AUDIO_CD            4
+#define AUDIO_SPEAKER		0
+#define AUDIO_HEADPHONE		1
+#define AUDIO_LINE_OUT		4
+
+#define srand48	srand
+#define lrand48 rand() * rand
+#define snprintf _snprintf
+
+#define IN_CLASSD(i)	(((long)(i) & 0xf0000000) == 0xe0000000)
+#define IN_MULTICAST(i)	IN_CLASSD(i)
+
+typedef char	*caddr_t;
+typedef int	ssize_t;
+
+typedef struct iovec {
+	caddr_t	iov_base;
+	ssize_t	iov_len;
+} iovec_t;
+
+struct msghdr {
+	caddr_t		msg_name;
+	int		msg_namelen;
+	struct iovec	*msg_iov;
+	int		msg_iovlen;
+	caddr_t		msg_accrights;
+	int		msg_accrightslen;
+};
+
+#ifndef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN	256
+#endif
+
+#define _SYS_NMLN	9
+struct utsname {
+	char sysname[_SYS_NMLN];
+	char nodename[_SYS_NMLN];
+	char release[_SYS_NMLN];
+	char version[_SYS_NMLN];
+	char machine[_SYS_NMLN];
+};
+
+struct timezone {
+	int tz_minuteswest;
+	int tz_dsttime;
+};
+
+typedef int pid_t;
+typedef int uid_t;
+typedef int gid_t;
+    
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+int uname(struct utsname *);
+int getopt(int, char * const *, const char *);
+int gethostid(void);
+int getuid(void);
+int getgid(void);
+#define getpid _getpid
+int nice(int);
+int usleep(unsigned int);
+
+
+const char * w32_make_version_info(char * rat_verion);
+
+#define strcasecmp  _stricmp
+#define strncasecmp _strnicmp
+
+int  RegGetValue(HKEY *, char *, char*, char*, int);
+void ShowMessage(int level, char *msg);
+
+#define bcopy(from,to,len) memcpy(to,from,len)
+
+#if defined(__cplusplus)
+}
+#endif
+
+#define ECONNREFUSED	WSAECONNREFUSED
+#define ENETUNREACH		WSAENETUNREACH
+#define EHOSTUNREACH	WSAEHOSTUNREACH
+#define EWOULDBLOCK		WSAEWOULDBLOCK
+
+#ifndef EAFNOSUPPORT
+#define EAFNOSUPPORT	WSAEAFNOSUPPORT
+#endif
+
+#define M_PI		3.14159265358979323846
+
+#endif 
+#define LOG_EMERG 0
+#define LOG_ALERT 1
+#define LOG_CRIT 2
+#define LOG_ERR 3
+#define LOG_WARNING 4
+#define LOG_NOTICE 5
+#define LOG_INFO 6
+#define LOG_DEBUG 7
+#endif

Added: experimental/j/Elphel333/rtp/daemon/rtp/configure
===================================================================
--- experimental/j/Elphel333/rtp/daemon/rtp/configure	2005-12-01 00:30:28 UTC (rev 10509)
+++ experimental/j/Elphel333/rtp/daemon/rtp/configure	2005-12-01 01:39:59 UTC (rev 10510)
@@ -0,0 +1,11748 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.57.
+#
+# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+# Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+
+# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)$' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\/\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
+  # Find who we are.  Look in the path if we contain no path at all
+  # relative or not.
+  case $0 in
+    *[\\/]* ) as_myself=$0 ;;
+    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+       ;;
+  esac
+  # We did not find ourselves, most probably we were run as `sh COMMAND'
+  # in which case we are not to be found in the path.
+  if test "x$as_myself" = x; then
+    as_myself=$0
+  fi
+  if test ! -f "$as_myself"; then
+    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+   { (exit 1); exit 1; }; }
+  fi
+  case $CONFIG_SHELL in
+  '')
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for as_base in sh bash ksh sh5; do
+	 case $as_dir in
+	 /*)
+	   if ("$as_dir/$as_base" -c '
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+	     CONFIG_SHELL=$as_dir/$as_base
+	     export CONFIG_SHELL
+	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+	   fi;;
+	 esac
+       done
+done
+;;
+  esac
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line before each line; the second 'sed' does the real
+  # work.  The second script uses 'N' to pair each line-number line
+  # with the numbered line, and appends trailing '-' during
+  # substitution so that $LINENO is not a special case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
+  sed '=' <$as_myself |
+    sed '
+      N
+      s,$,-,
+      : loop
+      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      t loop
+      s,-$,,
+      s,^['$as_cr_digits']*\n,,
+    ' >$as_me.lineno &&
+  chmod +x $as_me.lineno ||
+    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensible to this).
+  . ./$as_me.lineno
+  # Exit status is that of the last command.
+  exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='	' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+
+# Find the correct PATH separator.  Usually this is `:', but
+# DJGPP uses `;' like DOS.
+if test "X${PATH_SEPARATOR+set}" != Xset; then
+  UNAME=${UNAME-`uname 2>/dev/null`}
+  case X$UNAME in
+    *-DOS) lt_cv_sys_path_separator=';' ;;
+    *)     lt_cv_sys_path_separator=':' ;;
+  esac
+  PATH_SEPARATOR=$lt_cv_sys_path_separator
+fi
+
+
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+  # Remove one level of quotation (which was required for Make).
+  ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
+  ;;
+esac
+
+echo=${ECHO-echo}
+if test "X$1" = X--no-reexec; then
+  # Discard the --no-reexec flag, and continue.
+  shift
+elif test "X$1" = X--fallback-echo; then
+  # Avoid inline document here, it may be left over
+  :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
+  # Yippee, $echo works!
+  :
+else
+  # Restart under the correct shell.
+  exec $SHELL "$0" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+  # used as fallback echo
+  shift
+  cat <<EOF
+
+EOF
+  exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+if test -z "$ECHO"; then
+if test "X${echo_test_string+set}" != Xset; then
+# find a string as large as possible, as long as the shell can cope with it
+  for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
+    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
+       echo_test_string="`eval $cmd`" &&
+       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
+    then
+      break
+    fi
+  done
+fi
+
+if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+   test "X$echo_testing_string" = "X$echo_test_string"; then
+  :
+else
+  # The Solaris, AIX, and Digital Unix default echo programs unquote
+  # backslashes.  This makes it impossible to quote backslashes using
+  #   echo "$something" | sed 's/\\/\\\\/g'
+  #
+  # So, first we look for a working echo in the user's PATH.
+
+  IFS="${IFS= 	}"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for dir in $PATH /usr/ucb; do
+    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+       test "X$echo_testing_string" = "X$echo_test_string"; then
+      echo="$dir/echo"
+      break
+    fi
+  done
+  IFS="$save_ifs"
+
+  if test "X$echo" = Xecho; then
+    # We didn't find a better echo, so look for alternatives.
+    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
+       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
+       test "X$echo_testing_string" = "X$echo_test_string"; then
+      # This shell has a builtin print -r that does the trick.
+      echo='print -r'
+    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
+	 test "X$CONFIG_SHELL" != X/bin/ksh; then
+      # If we have ksh, try running configure again with it.
+      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+      export ORIGINAL_CONFIG_SHELL
+      CONFIG_SHELL=/bin/ksh
+      export CONFIG_SHELL
+      exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
+    else
+      # Try using printf.
+      echo='printf %s\n'
+      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+	 test "X$echo_testing_string" = "X$echo_test_string"; then
+	# Cool, printf works
+	:
+      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+	   test "X$echo_testing_string" = 'X\t' &&
+	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+	   test "X$echo_testing_string" = "X$echo_test_string"; then
+	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+	export CONFIG_SHELL
+	SHELL="$CONFIG_SHELL"
+	export SHELL
+	echo="$CONFIG_SHELL $0 --fallback-echo"
+      elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+	   test "X$echo_testing_string" = 'X\t' &&
+	   echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+	   test "X$echo_testing_string" = "X$echo_test_string"; then
+	echo="$CONFIG_SHELL $0 --fallback-echo"
+      else
+	# maybe with a smaller string...
+	prev=:
+
+	for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
+	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
+	  then
+	    break
+	  fi
+	  prev="$cmd"
+	done
+
+	if test "$prev" != 'sed 50q "$0"'; then
+	  echo_test_string=`eval $prev`
+	  export echo_test_string
+	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
+	else
+	  # Oops.  We lost completely, so just stick with echo.
+	  echo=echo
+	fi
+      fi
+    fi
+  fi
+fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
+   ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
+fi
+
+
+
+# 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=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+
+ac_unique_file="base64.c"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+#  include <stdint.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#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 build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP LN_S ECHO RANLIB ac_ct_RANLIB EGREP LIBTOOL LIBOBJS GTKDOC OPTDOC LTLIBOBJS'
+ac_subst_files=''
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+ac_prev=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval "$ac_prev=\$ac_option"
+    ac_prev=
+    continue
+  fi
+
+  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_option in
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+  | --da=*)
+    datadir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    eval "enable_$ac_feature=no" ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "enable_$ac_feature='$ac_optarg'" ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst \
+  | --locals | --local | --loca | --loc | --lo)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "with_$ac_package='$ac_optarg'" ;;
+
+  -without-* | --without-*)
+    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package | sed 's/-/_/g'`
+    eval "with_$ac_package=no" ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; }
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+    eval "$ac_envvar='$ac_optarg'"
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  { echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+              localstatedir libdir includedir oldincludedir infodir mandir
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then its parent.
+  ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+         X"$0" : 'X\(//\)[^/]' \| \
+         X"$0" : 'X\(//\)$' \| \
+         X"$0" : 'X\(/\)' \| \
+         .     : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r $srcdir/$ac_unique_file; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+  if test "$ac_srcdir_defaulted" = yes; then
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+   { (exit 1); exit 1; }; }
+  else
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+  fi
+fi
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+   { (exit 1); exit 1; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_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 this package to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+
+  cat <<_ACEOF
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR           user executables [EPREFIX/bin]
+  --sbindir=DIR          system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR       program executables [EPREFIX/libexec]
+  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
+  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
+  --libdir=DIR           object code libraries [EPREFIX/lib]
+  --includedir=DIR       C header files [PREFIX/include]
+  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
+  --infodir=DIR          info documentation [PREFIX/info]
+  --mandir=DIR           man documentation [PREFIX/man]
+_ACEOF
+
+  cat <<\_ACEOF
+
+Program names:
+  --program-prefix=PREFIX            prepend PREFIX to installed program names
+  --program-suffix=SUFFIX            append SUFFIX to installed program names
+  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+  --target=TARGET   configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-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
+  --enable-shared=PKGS  build shared libraries default=yes
+  --enable-static=PKGS  build static libraries default=yes
+  --enable-fast-install=PKGS  optimize for fast installation default=yes
+  --disable-libtool-lock  avoid locking (might break parallel builds)
+  --enable-profile        enable profiling
+  --enable-bounds         enable bounds checking
+  --enable-debug          enable debug messages and code
+  --enable-debug-mem      enable memory debugging code
+  --enable-ipv6           enable ipv6
+  --enable-kame-ipv6      enable kame implementation of ipv6
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-gnu-ld           assume the C compiler uses GNU ld default=no
+  --with-pic              try to use only PIC/non-PIC objects default=use both
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
+              headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_ACEOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  ac_popdir=`pwd`
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d $ac_dir || continue
+    ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+    cd $ac_dir
+    # Check for guested configure; otherwise get Cygnus style configure.
+    if test -f $ac_srcdir/configure.gnu; then
+      echo
+      $SHELL $ac_srcdir/configure.gnu  --help=recursive
+    elif test -f $ac_srcdir/configure; then
+      echo
+      $SHELL $ac_srcdir/configure  --help=recursive
+    elif test -f $ac_srcdir/configure.ac ||
+           test -f $ac_srcdir/configure.in; then
+      echo
+      $ac_configure --help
+    else
+      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi
+    cd $ac_popdir
+  done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+  cat <<\_ACEOF
+
+Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit 0
+fi
+exec 5>config.log
+cat >&5 <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by $as_me, which was
+generated by GNU Autoconf 2.57.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  echo "PATH: $as_dir"
+done
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_sep=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    2)
+      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+        ac_must_keep_next=false # Got value, back to normal.
+      else
+        case $ac_arg in
+          *=* | --config-cache | -C | -disable-* | --disable-* \
+          | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+          | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+          | -with-* | --with-* | -without-* | --without-* | --x)
+            case "$ac_configure_args0 " in
+              "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+            esac
+            ;;
+          -* ) ac_must_keep_next=true ;;
+        esac
+      fi
+      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+      # Get rid of the leading space.
+      ac_sep=" "
+      ;;
+    esac
+  done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+{
+  (set) 2>&1 |
+    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      sed -n \
+        "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+    	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+      ;;
+    *)
+      sed -n \
+        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+}
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=$`echo $ac_var`
+      echo "$ac_var='"'"'$ac_val'"'"'"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------- ##
+## Output files. ##
+## ------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=$`echo $ac_var`
+        echo "$ac_var='"'"'$ac_val'"'"'"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      sed "/^$/d" confdefs.h | sort
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      echo "$as_me: caught signal $ac_signal"
+    echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core core.* *.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 uclconf.h: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"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+        if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+          if test $ac_prog = install &&
+            grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+            # AIX install.  It has an incompatible calling convention.
+            :
+          elif test $ac_prog = install &&
+            grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+            # program-specific install script used by HP pwplus--don't use.
+            :
+          else
+            ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+            break 3
+          fi
+        fi
+      done
+    done
+    ;;
+esac
+done
+
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL=$ac_install_sh
+  fi
+fi
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+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
+
+ # 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=uclrtp
+ VERSION=1.2.8
+
+
+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.
+
+
+
+# Make sure we can run config.sub.
+$ac_config_sub sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
+echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+   { (exit 1); exit 1; }; }
+
+echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6
+if test "${ac_cv_build+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_build_alias=$build_alias
+test -z "$ac_cv_build_alias" &&
+  ac_cv_build_alias=`$ac_config_guess`
+test -z "$ac_cv_build_alias" &&
+  { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+   { (exit 1); exit 1; }; }
+ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6
+build=$ac_cv_build
+build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6
+if test "${ac_cv_host+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_host_alias=$host_alias
+test -z "$ac_cv_host_alias" &&
+  ac_cv_host_alias=$ac_cv_build_alias
+ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6
+host=$ac_cv_host
+host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking target system type" >&5
+echo $ECHO_N "checking target system type... $ECHO_C" >&6
+if test "${ac_cv_target+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_target_alias=$target_alias
+test "x$ac_cv_target_alias" = "x" &&
+  ac_cv_target_alias=$ac_cv_host_alias
+ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_target" >&5
+echo "${ECHO_T}$ac_cv_target" >&6
+target=$ac_cv_target
+target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+  test "$program_prefix$program_suffix$program_transform_name" = \
+    NONENONEs,x,x, &&
+  program_prefix=${target_alias}-
+
+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 </dev/null >&5\"") >&5
+  (eval $ac_compiler --version </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+  (eval $ac_compiler -v </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+  (eval $ac_compiler -V </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+echo "$as_me:$LINENO: checking for C compiler default output" >&5
+echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+  (eval $ac_link_default) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Find the output, starting from the most likely.  This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+        ;;
+    conftest.$ac_ext )
+        # This is the source file.
+        ;;
+    [ab].out )
+        # We found the default executable, but exeext='' is most
+        # certainly right.
+        break;;
+    *.* )
+        ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+        # FIXME: I believe we export ac_cv_exeext for Libtool,
+        # but it would be cool to find out if it's true.  Does anybody
+        # maintain Libtool? --akim.
+        export ac_cv_exeext
+        break;;
+    * )
+        break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+  if { ac_try='./$ac_file'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+          export ac_cv_exeext
+          break;;
+    * ) break;;
+  esac
+done
+else
+  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cc_g=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX			-qlanglvl=ansi
+# Ultrix and OSF/1	-std1
+# HP-UX 10.20 and later	-Ae
+# HP-UX older versions	-Aa -D_HPUX_SOURCE
+# SVR4			-Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+  x|xno)
+    echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+  *)
+    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+    CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# Some people use a C++ compiler to compile C.  Since we use `exit',
+# in C++ we need to declare it.  In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+  choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  for ac_declaration in \
+   ''\
+   '#include <stdlib.h>' \
+   'extern "C" void std::exit (int) throw (); using std::exit;' \
+   'extern "C" void std::exit (int); using std::exit;' \
+   'extern "C" void exit (int) throw ();' \
+   'extern "C" void exit (int);' \
+   'void exit (int);'
+do
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+$ac_declaration
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+  echo '#ifdef __cplusplus' >>confdefs.h
+  echo $ac_declaration      >>confdefs.h
+  echo '#endif'             >>confdefs.h
+fi
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+rm -f .deps 2>/dev/null
+mkdir .deps 2>/dev/null
+if test -d .deps; then
+  DEPDIR=.deps
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  DEPDIR=_deps
+fi
+rmdir .deps 2>/dev/null
+
+
+          ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+doit:
+	@echo done
+END
+# If we don't find an include directive, just comment out the code.
+echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+
+
+echo "$as_me:$LINENO: result: $_am_result" >&5
+echo "${ECHO_T}$_am_result" >&6
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+  enableval="$enable_dependency_tracking"
+
+fi;
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+
+
+if test "x$enable_dependency_tracking" != xno; then
+  AMDEP_TRUE=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
+fi
+
+
+
+
+depcc="$CC"   am_compiler_list=
+
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+
+  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
+    # 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.
+    echo '#include "conftest.h"' > conftest.c
+    echo 'int i;' > conftest.h
+    echo "${am__include} ${am__quote}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=conftest.c object=conftest.o \
+       depfile=conftest.Po tmpdepfile=conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o conftest.o conftest.c >/dev/null 2>&1 &&
+       grep conftest.h conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      am_cv_CC_dependencies_compiler_type=$depmode
+      break
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+
+
+if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
+ac_ext=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 <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                     Syntax error
+_ACEOF
+if { (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
+  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
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_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
+  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 <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                     Syntax error
+_ACEOF
+if { (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
+  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
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_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
+  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
+
+# Check whether --enable-shared or --disable-shared was given.
+if test "${enable_shared+set}" = set; then
+  enableval="$enable_shared"
+  p=${PACKAGE-default}
+case $enableval in
+yes) enable_shared=yes ;;
+no) enable_shared=no ;;
+*)
+  enable_shared=no
+  # Look at the argument we got.  We use all the common list separators.
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+  for pkg in $enableval; do
+    if test "X$pkg" = "X$p"; then
+      enable_shared=yes
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac
+else
+  enable_shared=yes
+fi;
+# Check whether --enable-static or --disable-static was given.
+if test "${enable_static+set}" = set; then
+  enableval="$enable_static"
+  p=${PACKAGE-default}
+case $enableval in
+yes) enable_static=yes ;;
+no) enable_static=no ;;
+*)
+  enable_static=no
+  # Look at the argument we got.  We use all the common list separators.
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+  for pkg in $enableval; do
+    if test "X$pkg" = "X$p"; then
+      enable_static=yes
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac
+else
+  enable_static=yes
+fi;
+# Check whether --enable-fast-install or --disable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+  enableval="$enable_fast_install"
+  p=${PACKAGE-default}
+case $enableval in
+yes) enable_fast_install=yes ;;
+no) enable_fast_install=no ;;
+*)
+  enable_fast_install=no
+  # Look at the argument we got.  We use all the common list separators.
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+  for pkg in $enableval; do
+    if test "X$pkg" = "X$p"; then
+      enable_fast_install=yes
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac
+else
+  enable_fast_install=yes
+fi;
+# Find the correct PATH separator.  Usually this is `:', but
+# DJGPP uses `;' like DOS.
+if test "X${PATH_SEPARATOR+set}" != Xset; then
+  UNAME=${UNAME-`uname 2>/dev/null`}
+  case X$UNAME in
+    *-DOS) lt_cv_sys_path_separator=';' ;;
+    *)     lt_cv_sys_path_separator=':' ;;
+  esac
+  PATH_SEPARATOR=$lt_cv_sys_path_separator
+fi
+
+
+# Check whether --with-gnu-ld or --without-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+  withval="$with_gnu_ld"
+  test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi;
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  echo "$as_me:$LINENO: checking for ld used by GCC" >&5
+echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [\\/]* | [A-Za-z]:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the path of ld
+      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
+else
+  echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -z "$LD"; then
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some GNU ld's only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+	test "$with_gnu_ld" != no && break
+      else
+	test "$with_gnu_ld" != yes && break
+      fi
+    fi
+  done
+  IFS="$ac_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+  lt_cv_prog_gnu_ld=yes
+else
+  lt_cv_prog_gnu_ld=no
+fi
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
+echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6
+if test "${lt_cv_ld_reload_flag+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_ld_reload_flag='-r'
+fi
+echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
+echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6
+reload_flag=$lt_cv_ld_reload_flag
+test -n "$reload_flag" && reload_flag=" $reload_flag"
+
+echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
+echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6
+if test "${lt_cv_path_NM+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+    test -z "$ac_dir" && ac_dir=.
+    tmp_nm=$ac_dir/${ac_tool_prefix}nm
+    if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
+      # Check to see if the nm accepts a BSD-compat flag.
+      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+      #   nm: unknown option "B" ignored
+      # Tru64's nm complains that /dev/null is an invalid object file
+      if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
+	lt_cv_path_NM="$tmp_nm -B"
+	break
+      elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+	lt_cv_path_NM="$tmp_nm -p"
+	break
+      else
+	lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	continue # so that we can try to find one that supports BSD flags
+      fi
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi
+fi
+
+NM="$lt_cv_path_NM"
+echo "$as_me:$LINENO: result: $NM" >&5
+echo "${ECHO_T}$NM" >&6
+
+echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
+echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6
+if test "${lt_cv_path_SED+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_executable_p="test -f"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+        _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
+      fi
+    done
+  done
+done
+
+  # Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+: ${TMPDIR=/tmp}
+{
+  tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=$TMPDIR/sed$$-$RANDOM
+  (umask 077 && mkdir $tmp)
+} ||
+{
+   echo "$me: cannot create a temporary directory in $TMPDIR" >&2
+   { (exit 1); exit 1; }
+}
+  _max=0
+  _count=0
+  # Add /usr/xpg4/bin/sed as it is typically found on Solaris
+  # along with /bin/sed that truncates output.
+  for _sed in $_sed_list /usr/xpg4/bin/sed; do
+    test ! -f ${_sed} && break
+    cat /dev/null > "$tmp/sed.in"
+    _count=0
+    echo ${ECHO_N-$ac_n} "0123456789${ECHO_C-$ac_c}" >"$tmp/sed.in"
+    # Check for GNU sed and select it if it is found.
+    if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
+      lt_cv_path_SED=${_sed}
+      break
+    fi
+    while true; do
+      cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
+      mv "$tmp/sed.tmp" "$tmp/sed.in"
+      cp "$tmp/sed.in" "$tmp/sed.nl"
+      echo >>"$tmp/sed.nl"
+      ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
+      cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
+      # 40000 chars as input seems more than enough
+      test $_count -gt 10 && break
+      _count=`expr $_count + 1`
+      if test $_count -gt $_max; then
+        _max=$_count
+        lt_cv_path_SED=$_sed
+      fi
+    done
+  done
+  rm -rf "$tmp"
+
+fi
+
+if test "X$SED" != "X"; then
+  lt_cv_path_SED=$SED
+else
+  SED=$lt_cv_path_SED
+fi
+echo "$as_me:$LINENO: result: $SED" >&5
+echo "${ECHO_T}$SED" >&6
+
+echo "$as_me:$LINENO: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+  echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6
+fi
+
+echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
+echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6
+if test "${lt_cv_deplibs_check_method+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given egrep regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix4* | aix5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi4*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin* | mingw* | pw32*)
+  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  case "$host_os" in
+  rhapsody* | darwin1.[012])
+    lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
+    ;;
+  *) # Darwin 1.3 on
+    lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
+    ;;
+  esac
+  ;;
+
+freebsd*)
+  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20*|hpux11*)
+  lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libc.sl
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+  irix5* | nonstopux*)
+    # this will be overridden with pass_all, but let us keep it just in case
+    lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
+    ;;
+  *)
+    case $LD in
+    *-32|*"-32 ") libmagic=32-bit;;
+    *-n32|*"-n32 ") libmagic=N32;;
+    *-64|*"-64 ") libmagic=64-bit;;
+    *) libmagic=never-match;;
+    esac
+    # this will be overridden with pass_all, but let us keep it just in case
+    lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
+    ;;
+  esac
+  lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be Linux ELF.
+linux*)
+  case $host_cpu in
+  alpha* | hppa* | i*86 | m68* | mips | mipsel | powerpc* | s390* | sparc* | ia64* | x86_64*)
+    lt_cv_deplibs_check_method=pass_all ;;
+  *)
+    # glibc up to 2.1.1 does not perform some relocations on ARM
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
+  esac
+  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+  ;;
+
+netbsd*)
+  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'
+  fi
+  ;;
+
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
+
+openbsd*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
+  else
+    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  # this will be overridden with pass_all, but let us keep it just in case
+  lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sco3.2v5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  lt_cv_file_magic_test_file=/lib/libc.so
+  ;;
+
+sysv5uw[78]* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
+esac
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
+echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+
+
+
+
+
+
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+echo "$as_me:$LINENO: checking command to parse $NM output" >&5
+echo $ECHO_N "checking command to parse $NM output... $ECHO_C" >&6
+if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Transform the above into a raw symbol and a C symbol.
+symxfrm='\1 \2\3 \3'
+
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[BCDT]'
+  ;;
+cygwin* | mingw* | pw32*)
+  symcode='[ABCDGISTW]'
+  ;;
+hpux*) # Its linker distinguishes data from code symbols
+  lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+  lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  ;;
+irix* | nonstopux*)
+  symcode='[BCDEGRST]'
+  ;;
+osf*)
+  symcode='[BCDEGQRST]'
+  ;;
+solaris* | sysv5*)
+  symcode='[BDT]'
+  ;;
+sysv4)
+  symcode='[DFNSTU]'
+  ;;
+esac
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $host_os in
+mingw*)
+  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
+  symcode='[ABCDGISTW]'
+fi
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Write the raw and C identifiers.
+lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ 	]\($symcode$symcode*\)[ 	][ 	]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+  rm -f conftest*
+  cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+EOF
+
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5
+  (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+	mv -f "$nlist"T "$nlist"
+      else
+	rm -f "$nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if egrep ' nm_test_var$' "$nlist" >/dev/null; then
+	if egrep ' nm_test_func$' "$nlist" >/dev/null; then
+	  cat <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+	  # Now generate the symbol file.
+	  eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
+
+	  cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr void *
+#else
+# define lt_ptr char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+  const char *name;
+  lt_ptr address;
+}
+lt_preloaded_symbols[] =
+{
+EOF
+	  sed "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
+	  cat <<\EOF >> conftest.$ac_ext
+  {0, (lt_ptr) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+	  # Now try linking the two files.
+	  mv conftest.$ac_objext conftstm.$ac_objext
+	  save_LIBS="$LIBS"
+	  save_CFLAGS="$CFLAGS"
+	  LIBS="conftstm.$ac_objext"
+	  CFLAGS="$CFLAGS$no_builtin_flag"
+	  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest$ac_exeext; then
+	    pipe_works=yes
+	  fi
+	  LIBS="$save_LIBS"
+	  CFLAGS="$save_CFLAGS"
+	else
+	  echo "cannot find nm_test_func in $nlist" >&5
+	fi
+      else
+	echo "cannot find nm_test_var in $nlist" >&5
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+    fi
+  else
+    echo "$progname: failed program was:" >&5
+    cat conftest.$ac_ext >&5
+  fi
+  rm -f conftest* conftst*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$pipe_works" = yes; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
+  fi
+done
+
+fi
+
+global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  global_symbol_to_cdecl=
+  global_symbol_to_c_name_address=
+else
+  global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
+  global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
+fi
+if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
+then
+  echo "$as_me:$LINENO: result: failed" >&5
+echo "${ECHO_T}failed" >&6
+else
+  echo "$as_me:$LINENO: result: ok" >&5
+echo "${ECHO_T}ok" >&6
+fi
+
+
+echo "$as_me:$LINENO: checking for 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
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_header_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.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                   (('a' <= (c) && (c) <= 'i') \
+                     || ('j' <= (c) && (c) <= 'r') \
+                     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+        || toupper (i) != TOUPPER (i))
+      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.* *.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
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  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.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+for ac_header in dlfcn.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  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.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* 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
+  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 in
+  yes:no )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf at gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+  no:yes )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf at gnu.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
+
+
+
+
+
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
+echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $MAGIC_CMD in
+  /*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+  ?:/*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
+  ;;
+  *)
+  ac_save_MAGIC_CMD="$MAGIC_CMD"
+  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="/usr/bin:$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/${ac_tool_prefix}file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+      if test -n "$file_magic_test_file"; then
+	case $deplibs_check_method in
+	"file_magic "*)
+	  file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+	    egrep "$file_magic_regex" > /dev/null; then
+	    :
+	  else
+	    cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  MAGIC_CMD="$ac_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    echo "$as_me:$LINENO: checking for file" >&5
+echo $ECHO_N "checking for file... $ECHO_C" >&6
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $MAGIC_CMD in
+  /*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+  ?:/*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
+  ;;
+  *)
+  ac_save_MAGIC_CMD="$MAGIC_CMD"
+  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="/usr/bin:$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/file"
+      if test -n "$file_magic_test_file"; then
+	case $deplibs_check_method in
+	"file_magic "*)
+	  file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+	    egrep "$file_magic_regex" > /dev/null; then
+	    :
+	  else
+	    cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  MAGIC_CMD="$ac_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  else
+    MAGIC_CMD=:
+  fi
+fi
+
+  fi
+  ;;
+esac
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  RANLIB=$ac_ct_RANLIB
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  STRIP=$ac_ct_STRIP
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+
+enable_dlopen=no
+enable_win32_dll=no
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+  enableval="$enable_libtool_lock"
+
+fi;
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '#line 4593 "configure"' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    case `/usr/bin/file conftest.$ac_objext` in
+    *32-bit*)
+      LD="${LD-ld} -32"
+      ;;
+    *N32*)
+      LD="${LD-ld} -n32"
+      ;;
+    *64-bit*)
+      LD="${LD-ld} -64"
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-linux*)
+  # Test if the compiler is 64bit
+  echo 'int i;' > conftest.$ac_ext
+  lt_cv_cc_64bit_output=no
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    case `/usr/bin/file conftest.$ac_objext` in
+    *"ELF 64"*)
+      lt_cv_cc_64bit_output=yes
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
+echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6
+if test "${lt_cv_cc_needs_belf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+     ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+     cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  lt_cv_cc_needs_belf=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+lt_cv_cc_needs_belf=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+     ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
+echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+
+
+esac
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e s/^X//'
+sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except M$VC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+need_locks="$enable_libtool_lock"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+if test x"$host" != x"$build"; then
+  ac_tool_prefix=${host_alias}-
+else
+  ac_tool_prefix=
+fi
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+    ;;
+  *)
+    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+# Allow CC to be a program name with arguments.
+set dummy $CC
+compiler="$2"
+
+echo "$as_me:$LINENO: checking for objdir" >&5
+echo $ECHO_N "checking for objdir... $ECHO_C" >&6
+rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+echo "$as_me:$LINENO: result: $objdir" >&5
+echo "${ECHO_T}$objdir" >&6
+
+
+
+# Check whether --with-pic or --without-pic was given.
+if test "${with_pic+set}" = set; then
+  withval="$with_pic"
+  pic_mode="$withval"
+else
+  pic_mode=default
+fi;
+test -z "$pic_mode" && pic_mode=default
+
+# We assume here that the value for lt_cv_prog_cc_pic will not be cached
+# in isolation, and that seeing it set (from the cache) indicates that
+# the associated values are set (in the cache) correctly too.
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+if test "${lt_cv_prog_cc_pic+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+   lt_cv_prog_cc_pic=
+  lt_cv_prog_cc_shlib=
+  lt_cv_prog_cc_wl=
+  lt_cv_prog_cc_static=
+  lt_cv_prog_cc_no_builtin=
+  lt_cv_prog_cc_can_build_shared=$can_build_shared
+
+  if test "$GCC" = yes; then
+    lt_cv_prog_cc_wl='-Wl,'
+    lt_cv_prog_cc_static='-static'
+
+    case $host_os in
+    aix*)
+      # Below there is a dirty hack to force normal static linking with -ldl
+      # The problem is because libdl dynamically linked with both libc and
+      # libC (AIX C++ library), which obviously doesn't included in libraries
+      # list by gcc. This cause undefined symbols with -static flags.
+      # This hack allows C programs to be linked with "-static -ldl", but
+      # not sure about C++ programs.
+      lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
+      ;;
+    amigaos*)
+      # FIXME: we need at least 68020 code to build shared libraries, but
+      # adding the `-m68020' flag to GCC prevents building anything better,
+      # like `-m68040'.
+      lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
+      ;;
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_cv_prog_cc_pic='-fno-common'
+      ;;
+    cygwin* | mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_cv_prog_cc_pic='-DDLL_EXPORT'
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	 lt_cv_prog_cc_pic=-Kconform_pic
+      fi
+      ;;
+    *)
+      lt_cv_prog_cc_pic='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for PIC flags for the system compiler.
+    case $host_os in
+    aix3* | aix4* | aix5*)
+      lt_cv_prog_cc_wl='-Wl,'
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_cv_prog_cc_static='-Bstatic'
+      else
+	lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
+      lt_cv_prog_cc_wl='-Wl,'
+      lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
+      lt_cv_prog_cc_pic='+Z'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_cv_prog_cc_wl='-Wl,'
+      lt_cv_prog_cc_static='-non_shared'
+      # PIC (with -KPIC) is the default.
+      ;;
+
+    cygwin* | mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_cv_prog_cc_pic='-DDLL_EXPORT'
+      ;;
+
+    newsos6)
+      lt_cv_prog_cc_pic='-KPIC'
+      lt_cv_prog_cc_static='-Bstatic'
+      ;;
+
+    osf3* | osf4* | osf5*)
+      # All OSF/1 code is PIC.
+      lt_cv_prog_cc_wl='-Wl,'
+      lt_cv_prog_cc_static='-non_shared'
+      ;;
+
+    sco3.2v5*)
+      lt_cv_prog_cc_pic='-Kpic'
+      lt_cv_prog_cc_static='-dn'
+      lt_cv_prog_cc_shlib='-belf'
+      ;;
+
+    solaris*)
+      lt_cv_prog_cc_pic='-KPIC'
+      lt_cv_prog_cc_static='-Bstatic'
+      lt_cv_prog_cc_wl='-Wl,'
+      ;;
+
+    sunos4*)
+      lt_cv_prog_cc_pic='-PIC'
+      lt_cv_prog_cc_static='-Bstatic'
+      lt_cv_prog_cc_wl='-Qoption ld '
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      lt_cv_prog_cc_pic='-KPIC'
+      lt_cv_prog_cc_static='-Bstatic'
+      lt_cv_prog_cc_wl='-Wl,'
+      ;;
+
+    uts4*)
+      lt_cv_prog_cc_pic='-pic'
+      lt_cv_prog_cc_static='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	lt_cv_prog_cc_pic='-Kconform_pic'
+	lt_cv_prog_cc_static='-Bstatic'
+      fi
+      ;;
+
+    *)
+      lt_cv_prog_cc_can_build_shared=no
+      ;;
+    esac
+  fi
+
+fi
+
+if test -z "$lt_cv_prog_cc_pic"; then
+  echo "$as_me:$LINENO: result: none" >&5
+echo "${ECHO_T}none" >&6
+else
+  echo "$as_me:$LINENO: result: $lt_cv_prog_cc_pic" >&5
+echo "${ECHO_T}$lt_cv_prog_cc_pic" >&6
+
+  # Check to make sure the pic_flag actually works.
+  echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_cv_prog_cc_pic works... $ECHO_C" >&6
+  if test "${lt_cv_prog_cc_pic_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      save_CFLAGS="$CFLAGS"
+    CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
+    cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+        case $host_os in
+      hpux9* | hpux10* | hpux11*)
+	# On HP-UX, both CC and GCC only warn that PIC is supported... then
+	# they create non-PIC objects.  So, if there were any warnings, we
+	# assume that PIC is not supported.
+	if test -s conftest.err; then
+	  lt_cv_prog_cc_pic_works=no
+	else
+	  lt_cv_prog_cc_pic_works=yes
+	fi
+	;;
+      *)
+	lt_cv_prog_cc_pic_works=yes
+	;;
+      esac
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+      lt_cv_prog_cc_pic_works=no
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+    CFLAGS="$save_CFLAGS"
+
+fi
+
+
+  if test "X$lt_cv_prog_cc_pic_works" = Xno; then
+    lt_cv_prog_cc_pic=
+    lt_cv_prog_cc_can_build_shared=no
+  else
+    lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
+  fi
+
+  echo "$as_me:$LINENO: result: $lt_cv_prog_cc_pic_works" >&5
+echo "${ECHO_T}$lt_cv_prog_cc_pic_works" >&6
+fi
+
+# Check for any special shared library compilation flags.
+if test -n "$lt_cv_prog_cc_shlib"; then
+  { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" >&5
+echo "$as_me: WARNING: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" >&2;}
+  if echo "$old_CC $old_CFLAGS " | egrep -e "[ 	]$lt_cv_prog_cc_shlib[ 	]" >/dev/null; then :
+  else
+   { echo "$as_me:$LINENO: WARNING: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5
+echo "$as_me: WARNING: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;}
+    lt_cv_prog_cc_can_build_shared=no
+  fi
+fi
+
+echo "$as_me:$LINENO: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_cv_prog_cc_static works... $ECHO_C" >&6
+if test "${lt_cv_prog_cc_static_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+    lt_cv_prog_cc_static_works=no
+  save_LDFLAGS="$LDFLAGS"
+  LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  lt_cv_prog_cc_static_works=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+  LDFLAGS="$save_LDFLAGS"
+
+fi
+
+
+# Belt *and* braces to stop my trousers falling down:
+test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
+echo "$as_me:$LINENO: result: $lt_cv_prog_cc_static_works" >&5
+echo "${ECHO_T}$lt_cv_prog_cc_static_works" >&6
+
+pic_flag="$lt_cv_prog_cc_pic"
+special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
+wl="$lt_cv_prog_cc_wl"
+link_static_flag="$lt_cv_prog_cc_static"
+no_builtin_flag="$lt_cv_prog_cc_no_builtin"
+can_build_shared="$lt_cv_prog_cc_can_build_shared"
+
+
+# Check to see if options -o and -c are simultaneously supported by compiler
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_compiler_c_o+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+$rm -r conftest 2>/dev/null
+mkdir conftest
+cd conftest
+echo "int some_variable = 0;" > conftest.$ac_ext
+mkdir out
+# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
+# that will create temporary files in the current directory regardless of
+# the output directory.  Thus, making CWD read-only will cause this test
+# to fail, enabling locking or at least warning the user not to do parallel
+# builds.
+chmod -w .
+save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
+compiler_c_o=no
+if { (eval echo configure:5134: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
+  # The compiler can only warn and ignore the option if not recognized
+  # So say no if there are warnings
+  if test -s out/conftest.err; then
+    lt_cv_compiler_c_o=no
+  else
+    lt_cv_compiler_c_o=yes
+  fi
+else
+  # Append any errors to the config.log.
+  cat out/conftest.err 1>&5
+  lt_cv_compiler_c_o=no
+fi
+CFLAGS="$save_CFLAGS"
+chmod u+w .
+$rm conftest* out/*
+rmdir out
+cd ..
+rmdir conftest
+$rm -r conftest 2>/dev/null
+
+fi
+
+compiler_c_o=$lt_cv_compiler_c_o
+echo "$as_me:$LINENO: result: $compiler_c_o" >&5
+echo "${ECHO_T}$compiler_c_o" >&6
+
+if test x"$compiler_c_o" = x"yes"; then
+  # Check to see if we can write to a .lo
+  echo "$as_me:$LINENO: checking if $compiler supports -c -o file.lo" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.lo... $ECHO_C" >&6
+  if test "${lt_cv_compiler_o_lo+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+  lt_cv_compiler_o_lo=no
+  save_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -c -o conftest.lo"
+  save_objext="$ac_objext"
+  ac_objext=lo
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+int some_variable = 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+      # The compiler can only warn and ignore the option if not recognized
+    # So say no if there are warnings
+    if test -s conftest.err; then
+      lt_cv_compiler_o_lo=no
+    else
+      lt_cv_compiler_o_lo=yes
+    fi
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+  ac_objext="$save_objext"
+  CFLAGS="$save_CFLAGS"
+
+fi
+
+  compiler_o_lo=$lt_cv_compiler_o_lo
+  echo "$as_me:$LINENO: result: $compiler_o_lo" >&5
+echo "${ECHO_T}$compiler_o_lo" >&6
+else
+  compiler_o_lo=no
+fi
+
+# Check to see if we can do hard links to lock some files if needed
+hard_links="nottested"
+if test "$compiler_c_o" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+  hard_links=yes
+  $rm conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+if test "$GCC" = yes; then
+  # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
+  echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
+  echo "int some_variable = 0;" > conftest.$ac_ext
+  save_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
+  compiler_rtti_exceptions=no
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+int some_variable = 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+      # The compiler can only warn and ignore the option if not recognized
+    # So say no if there are warnings
+    if test -s conftest.err; then
+      compiler_rtti_exceptions=no
+    else
+      compiler_rtti_exceptions=yes
+    fi
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+  CFLAGS="$save_CFLAGS"
+  echo "$as_me:$LINENO: result: $compiler_rtti_exceptions" >&5
+echo "${ECHO_T}$compiler_rtti_exceptions" >&6
+
+  if test "$compiler_rtti_exceptions" = "yes"; then
+    no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
+  else
+    no_builtin_flag=' -fno-builtin'
+  fi
+fi
+
+# See if the linker supports building shared libraries.
+echo "$as_me:$LINENO: checking whether the linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+allow_undefined_flag=
+no_undefined_flag=
+need_lib_prefix=unknown
+need_version=unknown
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+archive_cmds=
+archive_expsym_cmds=
+old_archive_from_new_cmds=
+old_archive_from_expsyms_cmds=
+export_dynamic_flag_spec=
+whole_archive_flag_spec=
+thread_safe_flag_spec=
+hardcode_into_libs=no
+hardcode_libdir_flag_spec=
+hardcode_libdir_separator=
+hardcode_direct=no
+hardcode_minus_L=no
+hardcode_shlibpath_var=unsupported
+runpath_var=
+link_all_deplibs=unknown
+always_export_symbols=no
+export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
+# include_expsyms should be a list of space-separated symbols to be *always*
+# included in the symbol list
+include_expsyms=
+# exclude_expsyms can be an egrep regular expression of symbols to exclude
+# it will be wrapped by ` (' and `)$', so one must not match beginning or
+# end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+# as well as any symbol that contains `d'.
+exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
+# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+# platforms (ab)use it in PIC code, but their linkers get confused if
+# the symbol is explicitly referenced.  Since portable code cannot
+# rely on this symbol name, it's probably fine to never include it in
+# preloaded symbol tables.
+extract_expsyms_cmds=
+
+case $host_os in
+cygwin* | mingw* | pw32*)
+  # FIXME: the MSVC++ port hasn't been tested in a loooong time
+  # When not using gcc, we currently assume that we are using
+  # Microsoft Visual C++.
+  if test "$GCC" != yes; then
+    with_gnu_ld=no
+  fi
+  ;;
+openbsd*)
+  with_gnu_ld=no
+  ;;
+esac
+
+ld_shlibs=yes
+if test "$with_gnu_ld" = yes; then
+  # If archive_cmds runs LD, not CC, wlarc should be empty
+  wlarc='${wl}'
+
+  # See if GNU ld supports shared libraries.
+  case $host_os in
+  aix3* | aix4* | aix5*)
+    # On AIX, the GNU linker is very broken
+    # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
+    ld_shlibs=no
+    cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+    ;;
+
+  amigaos*)
+    archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+    hardcode_libdir_flag_spec='-L$libdir'
+    hardcode_minus_L=yes
+
+    # Samuel A. Falvo II <kc5tja at dolphin.openprojects.net> reports
+    # that the semantics of dynamic libraries on AmigaOS, at least up
+    # to version 4, is to share data among multiple programs linked
+    # with the same dynamic library.  Since this doesn't match the
+    # behavior of shared libraries on other platforms, we can use
+    # them.
+    ld_shlibs=no
+    ;;
+
+  beos*)
+    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+      allow_undefined_flag=unsupported
+      # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+      # support --undefined.  This deserves some investigation.  FIXME
+      archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+    else
+      ld_shlibs=no
+    fi
+    ;;
+
+  cygwin* | mingw* | pw32*)
+    # hardcode_libdir_flag_spec is actually meaningless, as there is
+    # no search path for DLLs.
+    hardcode_libdir_flag_spec='-L$libdir'
+    allow_undefined_flag=unsupported
+    always_export_symbols=yes
+
+    extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
+      sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
+      test -f $output_objdir/impgen.exe || (cd $output_objdir && \
+      if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
+      else $CC -o impgen impgen.c ; fi)~
+      $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
+
+    old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
+
+    # cygwin and mingw dlls have different entry points and sets of symbols
+    # to exclude.
+    # FIXME: what about values for MSVC?
+    dll_entry=__cygwin_dll_entry at 12
+    dll_exclude_symbols=DllMain at 12,_cygwin_dll_entry at 12,_cygwin_noncygwin_dll_entry at 12~
+    case $host_os in
+    mingw*)
+      # mingw values
+      dll_entry=_DllMainCRTStartup at 12
+      dll_exclude_symbols=DllMain at 12,DllMainCRTStartup at 12,DllEntryPoint at 12~
+      ;;
+    esac
+
+    # mingw and cygwin differ, and it's simplest to just exclude the union
+    # of the two symbol sets.
+    dll_exclude_symbols=DllMain at 12,_cygwin_dll_entry at 12,_cygwin_noncygwin_dll_entry at 12,DllMainCRTStartup at 12,DllEntryPoint at 12
+
+    # recent cygwin and mingw systems supply a stub DllMain which the user
+    # can override, but on older systems we have to supply one (in ltdll.c)
+    if test "x$lt_cv_need_dllmain" = "xyes"; then
+      ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
+      ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~
+	test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
+    else
+      ltdll_obj=
+      ltdll_cmds=
+    fi
+
+    # Extract the symbol export list from an `--export-all' def file,
+    # then regenerate the def file from the symbol export list, so that
+    # the compiled dll only exports the symbol export list.
+    # Be careful not to strip the DATA tag left be newer dlltools.
+    export_symbols_cmds="$ltdll_cmds"'
+      $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
+      sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
+
+    # If the export-symbols file already is a .def file (1st line
+    # is EXPORTS), use it as is.
+    # If DATA tags from a recent dlltool are present, honour them!
+    archive_expsym_cmds='if test "x`sed 1q $export_symbols`" = xEXPORTS; then
+	cp $export_symbols $output_objdir/$soname-def;
+      else
+	echo EXPORTS > $output_objdir/$soname-def;
+	_lt_hint=1;
+	cat $export_symbols | while read symbol; do
+	 set dummy \$symbol;
+	 case \$# in
+	   2) echo "   \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
+	   4) echo "   \$2 \$3 \$4 ; " >> $output_objdir/$soname-def; _lt_hint=`expr \$_lt_hint - 1`;;
+	   *) echo "     \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;;
+	 esac;
+	 _lt_hint=`expr 1 + \$_lt_hint`;
+	done;
+      fi~
+      '"$ltdll_cmds"'
+      $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
+      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
+      $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
+      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~
+      $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
+    ;;
+
+  netbsd*)
+    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+      wlarc=
+    else
+      archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+    fi
+    ;;
+
+  solaris* | sysv5*)
+    if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
+      ld_shlibs=no
+      cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+    elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+    else
+      ld_shlibs=no
+    fi
+    ;;
+
+  sunos4*)
+    archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+    wlarc=
+    hardcode_direct=yes
+    hardcode_shlibpath_var=no
+    ;;
+
+  *)
+    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+    else
+      ld_shlibs=no
+    fi
+    ;;
+  esac
+
+  if test "$ld_shlibs" = yes; then
+    runpath_var=LD_RUN_PATH
+    hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec='${wl}--export-dynamic'
+    case $host_os in
+    cygwin* | mingw* | pw32*)
+      # dlltool doesn't understand --whole-archive et. al.
+      whole_archive_flag_spec=
+      ;;
+    *)
+      # ancient GNU ld didn't support --whole-archive et. al.
+      if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
+	whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+	whole_archive_flag_spec=
+      fi
+      ;;
+    esac
+  fi
+else
+  # PORTME fill in a description of your system's linker (not GNU ld)
+  case $host_os in
+  aix3*)
+    allow_undefined_flag=unsupported
+    always_export_symbols=yes
+    archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+    # Note: this linker hardcodes the directories in LIBPATH if there
+    # are no directories specified by -L.
+    hardcode_minus_L=yes
+    if test "$GCC" = yes && test -z "$link_static_flag"; then
+      # Neither direct hardcoding nor static linking is supported with a
+      # broken collect2.
+      hardcode_direct=unsupported
+    fi
+    ;;
+
+  aix4* | aix5*)
+    if test "$host_cpu" = ia64; then
+      # On IA64, the linker does run time linking by default, so we don't
+      # have to do anything special.
+      aix_use_runtimelinking=no
+      exp_sym_flag='-Bexport'
+      no_entry_flag=""
+    else
+      aix_use_runtimelinking=no
+
+      # Test if we are trying to use run time linking or normal
+      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+      # need to do runtime linking.
+      case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+	for ld_flag in $LDFLAGS; do
+	  case $ld_flag in
+	  *-brtl*)
+	    aix_use_runtimelinking=yes
+	    break
+	  ;;
+	  esac
+	done
+      esac
+
+      exp_sym_flag='-bexport'
+      no_entry_flag='-bnoentry'
+    fi
+
+    # When large executables or shared objects are built, AIX ld can
+    # have problems creating the table of contents.  If linking a library
+    # or program results in "error TOC overflow" add -mminimal-toc to
+    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+    hardcode_direct=yes
+    archive_cmds=''
+    hardcode_libdir_separator=':'
+    if test "$GCC" = yes; then
+      case $host_os in aix4.[012]|aix4.[012].*)
+	collect2name=`${CC} -print-prog-name=collect2`
+	if test -f "$collect2name" && \
+	  strings "$collect2name" | grep resolve_lib_name >/dev/null
+	then
+	  # We have reworked collect2
+	  hardcode_direct=yes
+	else
+	  # We have old collect2
+	  hardcode_direct=unsupported
+	  # It fails to find uninstalled libraries when the uninstalled
+	  # path is not listed in the libpath.  Setting hardcode_minus_L
+	  # to unsupported forces relinking
+	  hardcode_minus_L=yes
+	  hardcode_libdir_flag_spec='-L$libdir'
+	  hardcode_libdir_separator=
+	fi
+      esac
+
+      shared_flag='-shared'
+    else
+      # not using gcc
+      if test "$host_cpu" = ia64; then
+	shared_flag='${wl}-G'
+      else
+	if test "$aix_use_runtimelinking" = yes; then
+	  shared_flag='${wl}-G'
+	else
+	  shared_flag='${wl}-bM:SRE'
+	fi
+      fi
+    fi
+
+    # It seems that -bexpall can do strange things, so it is better to
+    # generate a list of symbols to export.
+    always_export_symbols=yes
+    if test "$aix_use_runtimelinking" = yes; then
+      # Warning - without using the other runtime loading flags (-brtl),
+      # -berok will link without error, but may produce a broken library.
+      allow_undefined_flag='-berok'
+      hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
+      archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+    else
+      if test "$host_cpu" = ia64; then
+	hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+	allow_undefined_flag="-z nodefs"
+	archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+      else
+	hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
+	# Warning - without using the other run time loading flags,
+	# -berok will link without error, but may produce a broken library.
+	allow_undefined_flag='${wl}-berok'
+	# This is a bit strange, but is similar to how AIX traditionally builds
+	# it's shared libraries.
+	archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname'
+      fi
+    fi
+    ;;
+
+  amigaos*)
+    archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+    hardcode_libdir_flag_spec='-L$libdir'
+    hardcode_minus_L=yes
+    # see comment about different semantics on the GNU ld section
+    ld_shlibs=no
+    ;;
+
+  cygwin* | mingw* | pw32*)
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    # hardcode_libdir_flag_spec is actually meaningless, as there is
+    # no search path for DLLs.
+    hardcode_libdir_flag_spec=' '
+    allow_undefined_flag=unsupported
+    # Tell ltmain to make .lib files, not .a files.
+    libext=lib
+    # FIXME: Setting linknames here is a bad hack.
+    archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
+    # The linker will automatically build a .lib file if we build a DLL.
+    old_archive_from_new_cmds='true'
+    # FIXME: Should let the user specify the lib program.
+    old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
+    fix_srcfile_path='`cygpath -w "$srcfile"`'
+    ;;
+
+  darwin* | rhapsody*)
+    case "$host_os" in
+    rhapsody* | darwin1.[012])
+      allow_undefined_flag='-undefined suppress'
+      ;;
+    *) # Darwin 1.3 on
+      allow_undefined_flag='-flat_namespace -undefined suppress'
+      ;;
+    esac
+    # FIXME: Relying on posixy $() will cause problems for
+    #        cross-compilation, but unfortunately the echo tests do not
+    #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
+    #	     `"' quotes if we put them in here... so don't!
+    archive_cmds='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs && $CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib ${lib}-master.o $deplibs$linker_flags $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)'
+    # We need to add '_' to the symbols in $export_symbols first
+    #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
+    hardcode_direct=yes
+    hardcode_shlibpath_var=no
+    whole_archive_flag_spec='-all_load $convenience'
+    ;;
+
+  freebsd1*)
+    ld_shlibs=no
+    ;;
+
+  # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+  # support.  Future versions do this automatically, but an explicit c++rt0.o
+  # does not break anything, and helps significantly (at the cost of a little
+  # extra space).
+  freebsd2.2*)
+    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+    hardcode_libdir_flag_spec='-R$libdir'
+    hardcode_direct=yes
+    hardcode_shlibpath_var=no
+    ;;
+
+  # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+  freebsd2*)
+    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+    hardcode_direct=yes
+    hardcode_minus_L=yes
+    hardcode_shlibpath_var=no
+    ;;
+
+  # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+  freebsd*)
+    archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+    hardcode_libdir_flag_spec='-R$libdir'
+    hardcode_direct=yes
+    hardcode_shlibpath_var=no
+    ;;
+
+  hpux9* | hpux10* | hpux11*)
+    case $host_os in
+    hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
+    *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
+    esac
+    hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+    hardcode_libdir_separator=:
+    hardcode_direct=yes
+    hardcode_minus_L=yes # Not in the search PATH, but as the default
+			 # location of the library.
+    export_dynamic_flag_spec='${wl}-E'
+    ;;
+
+  irix5* | irix6* | nonstopux*)
+    if test "$GCC" = yes; then
+      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+    else
+      archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      hardcode_libdir_flag_spec='-rpath $libdir'
+    fi
+    hardcode_libdir_separator=:
+    link_all_deplibs=yes
+    ;;
+
+  netbsd*)
+    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+    else
+      archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+    fi
+    hardcode_libdir_flag_spec='-R$libdir'
+    hardcode_direct=yes
+    hardcode_shlibpath_var=no
+    ;;
+
+  newsos6)
+    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+    hardcode_direct=yes
+    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+    hardcode_libdir_separator=:
+    hardcode_shlibpath_var=no
+    ;;
+
+  openbsd*)
+    hardcode_direct=yes
+    hardcode_shlibpath_var=no
+    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+      export_dynamic_flag_spec='${wl}-E'
+    else
+      case "$host_os" in
+      openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_libdir_flag_spec='-R$libdir'
+        ;;
+      *)
+        archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+        hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+        ;;
+      esac
+    fi
+    ;;
+
+  os2*)
+    hardcode_libdir_flag_spec='-L$libdir'
+    hardcode_minus_L=yes
+    allow_undefined_flag=unsupported
+    archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+    old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+    ;;
+
+  osf3*)
+    if test "$GCC" = yes; then
+      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+      archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+    else
+      allow_undefined_flag=' -expect_unresolved \*'
+      archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+    fi
+    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+    hardcode_libdir_separator=:
+    ;;
+
+  osf4* | osf5*)	# as osf3* with the addition of -msym flag
+    if test "$GCC" = yes; then
+      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+      archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+    else
+      allow_undefined_flag=' -expect_unresolved \*'
+      archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+      $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+
+      #Both c and cxx compiler support -rpath directly
+      hardcode_libdir_flag_spec='-rpath $libdir'
+    fi
+    hardcode_libdir_separator=:
+    ;;
+
+  sco3.2v5*)
+    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+    hardcode_shlibpath_var=no
+    runpath_var=LD_RUN_PATH
+    hardcode_runpath_var=yes
+    export_dynamic_flag_spec='${wl}-Bexport'
+    ;;
+
+  solaris*)
+    # gcc --version < 3.0 without binutils cannot create self contained
+    # shared libraries reliably, requiring libgcc.a to resolve some of
+    # the object symbols generated in some cases.  L