Index: /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/modem.flex.cpp
===================================================================
--- /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/modem.flex.cpp	(revision 4014)
+++ /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/modem.flex.cpp	(revision 4014)
@@ -0,0 +1,161 @@
+#include <math.h>
+//need to adjust math to account for data types and not losing precision
+//need to rotate the PSK constellation by pi/M for threshold testing with axis
+enum ConstellationMap {
+    bcd = 0,
+    gray = 1
+};
+
+enum ConstellationType {
+    psk = 0,
+    qam = 1
+};
+
+
+
+void Constellation(ConstellationType type, ConstellationMapping map, unsigned int M, signed short *I_const, signed short *Q_const, bool *symbolBits){
+    signed short I[M];
+    signed short Q[M];
+    unsigned short bitsPersymbol = log(M)/log(2);    
+    bool orderedSymbolBits[M][bitsPersymbol] = false;
+    unsigned short bitDownshifts[bitsPersymbol];
+    unsigned short bitIntervals[bitsPersymbol];
+    unsigned short bcdMSBpositions[bitsPersymbol];
+
+    //Ordered Counter Clockwise from positive real axis for PSK, top-to-bottom, left-to-right for QAM
+    if(map==0){//Binary Coded Decimal Ordered, reguardless of modulation
+	for(unsigned short i=0, i<bitsPersymbol, i++){
+	bitIntervals[i] = pow(2,i);
+	bitDownshifts[i] = bitIntervals[i];
+	}
+    } else if(map==1){//Gray Coded
+	if(type==0){
+	    //Gray coded PSK
+	    for(unsigned short i=0, i<bitsPersymbol, i++){
+		bitIntervals[i] = pow(2,(i+1));
+		bitDownshifts[i] = pow(2,i);
+	    }
+	    bitIntervals[bitsPersymbol] =  bitIntervals[bitsPersymbol-1];
+	    	
+	} else if(type==1){
+	    //Gray coded QAM
+	    //Only going to make this work with Square QAM constellations for now
+	    unsigned short bitsPersymbolaxis = bitsPersymbol/2;
+	    //do lower bits
+	    for(unsigned short i=0, i<bitsPersymbolaxis, i++){
+		bitIntervals[i] = pow(2,(i+1));
+		bitDownshifts[i] = pow(2,i);
+	    }
+	    bitIntervals[bitsPersymbolaxis] =  bitIntervals[bitsPersymbolaxis-1];
+	    //do upper bits
+	    for(unsigned short i=0, i<bitsPersymbolaxis, i++){
+		bitIntervals[i+bitsPersymbolaxis] = pow(2,(i+bitsPersymbolaxis));
+		bitDownshifts[i+bitsPersymbolaxis] = bitIntervals[i+bitsPersymbolaxis];
+	    }	    
+	}
+    }
+    //Actually assign the one's 
+    for(unsigned short i=0, i<bitsPersymbol, i++){
+	for(unsigned short j=bitDownshifts[i], j<M, j = j+bitIntervals[i]){
+	    for(unsigned short k=0, k<bitIntervals[i], k++){
+	    	orderedSymbolBits[j+k][i] = true;
+	    }
+	}
+    }
+    if(type==0){
+	//Assign the constellation points for PSK
+    	unsigned short mirrorCount = M/2;
+    	signed short unitInterval = (pi*2)/M;
+    	for(unsigned short symbolCount = 0, symbolCount<mirrorCount, symbolCount++){
+	    I[symbolCount] = cos(symbolCount*unitInterval);
+	    Q[symbolCount] = sin(symbolCount*unitInterval);
+	    I[symbolCount + mirrorCount] = -1*I[symbolCount];//Mirror Image
+	    Q[symbolCount + mirrorCount] = -1*Q[symbolCount];//Mirror Image
+        }
+    } else if(type==1){
+    	//Assign the constellation points for QAM
+    	unsigned short symbolCount = 0;
+    	signed short shiftUp = (bitsPersymbol-1)/2;
+    	signed short shiftLeft = (bitsPersymbol-1)/2;
+    	for(unsigned short column=0, column<bitsPersymbol/2, column++){
+	    for(unsigned short row=0, row<bitsPersymbol/2, row++){
+	    	I[symbolCount] =  column - shiftLeft;
+	    	Q[symbolCount] =  shiftUp - row;
+	    	symbolCount = symbolCount + 1;  
+	    }
+    	}
+    }	    
+}
+void RXconstellation(ConstellationType type, ConstellationMapping map, unsigned int M, signed short *I_const, signed short *Q_const){
+    Constellation(ConstellationType type, ConstellationMapping map, unsigned int M, signed short *I_const, signed short *Q_const)
+//now sort by symbols in constellation to ease searh by received samples
+//only modualtation type will determine what sorting will be done since mapping is done on the binary reresentations of the symbols    
+    if(type==0){
+	//do nothing since PSK symbols are generated counterclockwise
+    }
+    else if(type==1){
+	//shift from striped arrangement to recursive quadrants for recursive I and Q threshold comparisons
+	unsigned short bitsPersymbol = log(M)/log(2);
+	signed short I_temp[M];
+	signed short Q_temp[M];
+	unsigned short symbolReorder[M];
+	bool orderedSymbolBits_temp[M][bitsPersymbol];
+	unsigned short row_increment[pow(bitsPersymbol/2,2)];
+	unsigned short column_increment[pow(bitsPersymbol/2,2)];
+	unsigned int bit_increment;
+	
+	for(unsigned short bit = 0, bit<bitsPersymbol/2, bit++){	    
+	    bit_increment[bit] = pow(2,bit);
+	    for(unsigned short inc_count = bit_increment-1, inc_count<pow(bitsPersymbol/2,2)-1, inc_count = inc_count + bit_increment){
+		row_increment[inc_count+1] = row_increment[inc_count] + bit_increment;
+		column_increment[inc_count+1] = row_increment[inc_count]*2;
+	    }
+	}
+	
+	for(unsigned short column = 0, column<pow(bitsPersymbol/2,2)-1, column++){
+	    for(unsigned short row = 0, row<pow(bitsPersymbol/2,2)-1, row++){
+		symbolReorder[row+column*pow(bitsPersymbol/2,2)] = 1+row_increment[row]+column_increment[column];
+	    }
+	}
+	
+	for(unsigned int symbol = 0, symbol<M, symbol++){
+	    I_temp[symbol] = I_const[symbolReorder[symbol]];
+	    Q_temp[symbol] = Q_const[symbolReorder[symbol]];
+	}
+	//I don't think this will work, I will need to compile at some point...
+	I_const = I_temp;
+	Q_const = Q_temp;
+
+
+
+}
+
+void TXconstellation(ConstellationType type, ConstellationMapping map, unsigned int M, signed short *I_const, signed short *Q_const){
+    Constellation(ConstellationType type, ConstellationMapping map, unsigned int M, signed short *I_const, signed short *Q_const)
+//now sort by symbol bits to ease symbol mapping
+//only the mapping order will determine the sorting order for the transmitter side
+
+    if(map==0){
+	//do nothing since bcd is already sorted for quick recursive binary search
+    }
+    else if(map==1){
+	//need to reorder gray coded to bcd along with paired symbol points
+    }
+
+
+}
+
+void DemodQAM(unsigned int M, signed short X, signed short Y, DemodScheme scheme, signed char *bitsOut){
+    unsigned int bitsPersymbol = log(M)/log(2);
+
+
+
+}
+
+void DemodPSK(unsigned int M, signed short X, signed short Y, DemodScheme scheme, signed char *bitsOut){
+    unsigned int bitsPersymbol =  log(M)/log(2);
+
+
+
+}
+
Index: /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/fixed.c
===================================================================
--- /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/fixed.c	(revision 2275)
+++ /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/fixed.c	(revision 2275)
@@ -0,0 +1,87 @@
+/*
+ * libmad - MPEG audio decoder library
+ * Copyright (C) 2000-2004 Underbit Technologies, 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 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * $Id: fixed.c,v 1.13 2004/01/23 09:41:32 rob Exp $
+ */
+
+# ifdef HAVE_CONFIG_H
+#  include "config.h"
+# endif
+
+#if 0
+# include "global.h"
+#endif
+
+# include "fixed.h"
+
+#ifdef FPM
+
+/*
+ * NAME:	fixed->abs()
+ * DESCRIPTION:	return absolute value of a fixed-point number
+ */
+mad_fixed_t mad_f_abs(mad_fixed_t x)
+{
+  return x < 0 ? -x : x;
+}
+
+/*
+ * NAME:	fixed->div()
+ * DESCRIPTION:	perform division using fixed-point math
+ */
+mad_fixed_t mad_f_div(mad_fixed_t x, mad_fixed_t y)
+{
+  mad_fixed_t q, r;
+  unsigned int bits;
+
+  q = mad_f_abs(x / y);
+
+  if (x < 0) {
+    x = -x;
+    y = -y;
+  }
+
+  r = x % y;
+
+  if (y < 0) {
+    x = -x;
+    y = -y;
+  }
+
+  if (q > mad_f_intpart(MAD_F_MAX) &&
+      !(q == -mad_f_intpart(MAD_F_MIN) && r == 0 && (x < 0) != (y < 0)))
+    return 0;
+
+  for (bits = MAD_F_FRACBITS; bits && r; --bits) {
+    q <<= 1, r <<= 1;
+    if (r >= y)
+      r -= y, ++q;
+  }
+
+  /* round */
+  if (2 * r >= y)
+    ++q;
+
+  /* fix sign */
+  if ((x < 0) != (y < 0))
+    q = -q;
+
+  return q << bits;
+}
+
+#endif
Index: /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/sequencing.cpp
===================================================================
--- /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/sequencing.cpp	(revision 4844)
+++ /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/sequencing.cpp	(revision 4844)
@@ -0,0 +1,82 @@
+/**************************************************************************** 
+Copyright 2005,2006 Virginia Polytechnic Institute and State University
+
+This file is part of the OSSIE Signal Processing Library.
+
+OSSIE Signal Processing Library 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.
+
+OSSIE Signal Processing Library is distributed in the hope that it will be
+useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along
+with OSSIE Signal Processing Library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+****************************************************************************/
+
+/*! \file This file describes the bit sequencing classes and functions
+ *
+ */
+
+#include "SigProc.h"
+
+namespace SigProc {
+
+//-----------------------------------------------------------------------------
+//
+// P/N Sequence
+//
+//-----------------------------------------------------------------------------
+
+PNSequence::PNSequence(unsigned int _g, unsigned int _a) {
+    unsigned int i;
+    
+    // extract shift register length from generator polynomial
+    unsigned long g_tmp(_g);
+    m = 0;
+    // this loop effectively counts the placement of the MSB in _g
+    for (i=0; i<sizeof(unsigned long)*8; i++) {
+        if ( g_tmp & 0x0001 )
+            m = i;
+        g_tmp >>= 1;
+    }
+    
+    n = 1;
+    for (i=0; i<m; i++)
+        n <<= 1;
+    n--;
+    
+    // generating polynomial
+    g = new char[m];
+    for (i=0; i<m; i++) {
+        g[m-i-1] = ( _g & 0x0001 ) ? 1 : 0;
+        _g >>= 1;
+    }
+    
+    // initial polynomial state
+    a = new char[m];
+    for (i=0; i<m; i++) {
+        a[m-i-1] = ( _a & 0x0001 ) ? 1 : 0;
+        _a >>= 1;
+    }
+    
+    // output
+    s = new char[n];
+    memset(s, 0x00, n);
+
+}
+
+PNSequence::~PNSequence() {
+    delete [] g;
+    delete [] a;
+    delete [] s;
+}
+
+} // namespace SigProc
+
Index: /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/modem.cpp
===================================================================
--- /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/modem.cpp	(revision 5252)
+++ /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/modem.cpp	(revision 5252)
@@ -0,0 +1,429 @@
+/**************************************************************************** 
+Copyright 2005,2006 Virginia Polytechnic Institute and State University
+
+This file is part of the OSSIE Signal Processing Library.
+
+OSSIE Signal Processing Library 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.
+
+OSSIE Signal Processing Library is distributed in the hope that it will be
+useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along
+with OSSIE Signal Processing Library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+****************************************************************************/
+
+#include "SigProc.h"
+
+namespace SigProc {
+
+//
+// 0  1
+//
+void ModulateBPSK(
+    short symbol_in,
+    short &I_out,
+    short &Q_out)
+{
+    Q_out = 0;
+
+    switch ( symbol_in ) {
+    case 0:
+        I_out = -BPSK_LEVEL;
+        break;
+    case 1:
+        I_out =  BPSK_LEVEL;
+        break;
+    default:
+        std::cerr << "ERROR: Unknown symbol for BPSK: " << symbol_in << std::endl;
+        throw 0;
+    }
+}
+
+
+//
+//    10
+// 11    00
+//    01
+//
+void ModulateQPSK(
+    short symbol_in,
+    short &I_out,
+    short &Q_out)
+{
+    switch ( symbol_in ) {
+    case 0:
+        I_out =  QPSK_LEVEL;
+        Q_out =  0;
+        break;
+
+    case 1:
+        I_out =  0;
+        Q_out = -QPSK_LEVEL;
+        break;
+
+    case 2:
+        I_out =  0;
+        Q_out =  QPSK_LEVEL;
+        break;
+
+    case 3:
+        I_out = -QPSK_LEVEL;
+        Q_out =  0;
+        break;
+    default:
+        std::cerr << "ERROR: Unknown symbol for QPSK: " << symbol_in << std::endl;
+        throw 0;
+    }
+}
+
+
+
+//
+// 10  00
+// 11  01
+//
+void ModulateQAM4(
+    short symbol_in,
+    short &I_out,
+    short &Q_out)
+{
+    switch ( symbol_in ) {
+    case 0:
+        I_out =  QAM4_LEVEL;
+        Q_out =  QAM4_LEVEL;
+        break;
+
+    case 1:
+        I_out =  QAM4_LEVEL;
+        Q_out = -QAM4_LEVEL;
+        break;
+
+    case 2:
+        I_out = -QAM4_LEVEL;
+        Q_out =  QAM4_LEVEL;
+        break;
+
+    case 3:
+        I_out = -QAM4_LEVEL;
+        Q_out = -QAM4_LEVEL;
+        break;
+    default:
+        std::cerr << "ERROR: Unknown symbol for QAM4: " << symbol_in << std::endl;
+        throw 0;
+    }
+}
+
+//
+//       101
+//    100   001
+// 110         000
+//    111   010
+//       011
+//
+void Modulate8PSK(
+    short symbol_in,
+    short &I_out,
+    short &Q_out)
+{
+    switch ( symbol_in ) {
+    case 0:
+        I_out =  PSK8_LEVEL_2;
+        Q_out =  0;
+        break;
+
+    case 1:
+        I_out =  PSK8_LEVEL_1;
+        Q_out =  PSK8_LEVEL_1;
+        break;
+
+    case 2:
+        I_out =  PSK8_LEVEL_1;
+        Q_out = -PSK8_LEVEL_1;
+        break;
+
+    case 3:
+        I_out =  0;
+        Q_out = -PSK8_LEVEL_2;
+        break;
+
+    case 4:
+        I_out = -PSK8_LEVEL_1;
+        Q_out =  PSK8_LEVEL_1;
+        break;
+
+    case 5:
+        I_out =  0;
+        Q_out =  PSK8_LEVEL_2;
+        break;
+
+    case 6:
+        I_out = -PSK8_LEVEL_2;
+        Q_out =  0;
+        break;
+
+    case 7:
+        I_out = -PSK8_LEVEL_1;
+        Q_out = -PSK8_LEVEL_1;
+        break;
+    default:
+        std::cerr << "ERROR: Unknown symbol for 8-PSK: " << symbol_in << std::endl;
+        throw 0;
+    }
+}
+
+//
+//  0000    0100    1100    1000
+//  0001    0101    1101    1001
+//  0011    0111    1111    1011
+//  0010    0110    1110    1010
+//
+void Modulate16QAM(
+    short symbol_in,
+    short &I_out,
+    short &Q_out)
+{
+    switch ( symbol_in ) {
+    case 0:
+        I_out = -QAM16_LEVEL_2;
+        Q_out =  QAM16_LEVEL_2;
+        break;
+
+    case 1:
+        I_out = -QAM16_LEVEL_2;
+        Q_out =  QAM16_LEVEL_1;
+        break;
+
+    case 2:
+        I_out = -QAM16_LEVEL_2;
+        Q_out = -QAM16_LEVEL_2;
+        break;
+
+    case 3:
+        I_out = -QAM16_LEVEL_2;
+        Q_out = -QAM16_LEVEL_1;
+        break;
+
+    case 4:
+        I_out = -QAM16_LEVEL_1;
+        Q_out =  QAM16_LEVEL_2;
+        break;
+
+    case 5:
+        I_out = -QAM16_LEVEL_1;
+        Q_out =  QAM16_LEVEL_1;
+        break;
+
+    case 6:
+        I_out = -QAM16_LEVEL_1;
+        Q_out = -QAM16_LEVEL_2;
+        break;
+
+    case 7:
+        I_out = -QAM16_LEVEL_1;
+        Q_out = -QAM16_LEVEL_1;
+        break;
+
+    case 8:
+        I_out =  QAM16_LEVEL_2;
+        Q_out =  QAM16_LEVEL_2;
+        break;
+
+    case 9:
+        I_out =  QAM16_LEVEL_2;
+        Q_out =  QAM16_LEVEL_1;
+        break;
+
+    case 10:
+        I_out =  QAM16_LEVEL_2;
+        Q_out = -QAM16_LEVEL_2;
+        break;
+
+    case 11:
+        I_out =  QAM16_LEVEL_2;
+        Q_out = -QAM16_LEVEL_1;
+        break;
+
+    case 12:
+        I_out =  QAM16_LEVEL_1;
+        Q_out =  QAM16_LEVEL_2;
+        break;
+
+    case 13:
+        I_out =  QAM16_LEVEL_1;
+        Q_out =  QAM16_LEVEL_1;
+        break;
+
+    case 14:
+        I_out =  QAM16_LEVEL_1;
+        Q_out = -QAM16_LEVEL_2;
+        break;
+
+    case 15:
+        I_out =  QAM16_LEVEL_1;
+        Q_out = -QAM16_LEVEL_1;
+        break;
+    default:
+        std::cerr << "ERROR: Unknown symbol for 16-QAM: " << symbol_in << std::endl;
+        throw 0;
+    }
+}
+
+
+//
+// 10  11  01  00
+//
+void Modulate4PAM(
+    short symbol_in,
+    short &I_out,
+    short &Q_out)
+{
+    Q_out = 0;
+
+    switch ( symbol_in ) {
+    case 0:
+        I_out =  PAM4_LEVEL_2;
+        break;
+    case 1:
+        I_out =  PAM4_LEVEL_1;
+        break;
+    case 2:
+        I_out = -PAM4_LEVEL_2;
+        break;
+    case 3:
+        I_out = -PAM4_LEVEL_1;
+        break;
+    default:
+        std::cerr << "ERROR: Unknown symbol for 4-PAM: " << symbol_in << std::endl;
+        throw 0;
+    }
+}
+
+
+
+
+
+//
+// 0  1
+//
+void DemodulateBPSK(
+    short I_in,
+    short Q_in,
+    short &symbol_out)
+{
+    symbol_out = ( I_in > 0 ) ? 1 : 0;
+}
+
+
+//
+//    10
+// 11    00
+//    01
+//
+void DemodulateQPSK(
+    short I_in,
+    short Q_in,
+    short &symbol_out)
+{
+    // rotate constellation counter-clockwise by 45 degrees
+    // NOTE: pi/4 = 0.785398163397448
+    short I, Q;
+    rotate(I_in, Q_in, 0.785398f, &I, &Q);
+
+    DemodulateQAM4(I, Q, symbol_out);
+}
+
+//
+// 10  00
+// 11  01
+//
+void DemodulateQAM4(
+    short I_in,
+    short Q_in,
+    short &symbol_out)
+{
+    symbol_out = 0;
+    unsigned short b0, b1;
+    b0 = ( I_in > 0 ) ? 0 : 1;
+    b1 = ( Q_in > 0 ) ? 0 : 1;
+
+    symbol_out = (b0 << 1) + b1;
+}
+
+//
+//       101
+//    100   001
+// 110         000
+//    111   010
+//       011
+//
+void Demodulate8PSK(
+    short I_in,
+    short Q_in,
+    short &symbol_out)
+{
+    unsigned short b0, b1, b2;
+
+    // rotate constellation counter-clockwise by 22.5 degrees
+    // NOTE: pi/8 = 0.392699081698724
+    short I, Q;
+    rotate(I_in, Q_in, 0.392699f, &I, &Q);
+
+    b0 = ( I > 0 ) ? 0 : 1;
+    b1 = ( Q > 0 ) ? 0 : 1;
+    if ( ( Q>I && -I>Q ) || ( Q>-I && I>Q ) )
+        b2 = 0;
+    else
+        b2 = 1;
+
+    symbol_out = (b0 << 2) + (b1 << 1) + b2;
+}
+
+//
+//  0000    0100    1100    1000
+//  0001    0101    1101    1001
+//  0011    0111    1111    1011
+//  0010    0110    1110    1010
+//
+void Demodulate16QAM(
+    short I_in,
+    short Q_in,
+    short &symbol_out)
+{
+    unsigned short b0, b1, b2, b3;
+    b0 = ( I_in > 0 ) ? 1 : 0;
+    b1 = ( abs(I_in) > QAM16_THRESHOLD ) ? 0 : 1;
+    b2 = ( Q_in > 0 ) ? 0 : 1;
+    b3 = ( abs(Q_in) > QAM16_THRESHOLD ) ? 0 : 1;
+
+    symbol_out = (b0 << 3) + (b1 << 2) + (b2 << 1) + b3;
+}
+
+//
+// 10  11  01  00
+//
+void Demodulate4PAM(
+    short I_in,
+    short Q_in,
+    short &symbol_out)
+{
+    unsigned short b0, b1;
+    if ( I_in > 0 ) {
+        b0 = 0;
+        b1 = ( I_in >  PAM4_THRESHOLD ) ? 0 : 1;
+    } else {
+        b0 = 1;
+        b1 = ( I_in < -PAM4_THRESHOLD ) ? 0 : 1;
+    }
+
+    symbol_out = (b0 << 1) + b1;
+}
+
+} // namespace SigProc
Index: /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/Doxyfile
===================================================================
--- /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/Doxyfile	(revision 4528)
+++ /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/Doxyfile	(revision 4528)
@@ -0,0 +1,1246 @@
+# Doxyfile 1.4.6
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
+# by quotes) that should identify the project.
+
+PROJECT_NAME           = "Signal Processing Library"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
+# This could be handy for archiving the generated documentation or 
+# if some version control system is used.
+
+PROJECT_NUMBER         = 
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
+# base path where the generated documentation will be put. 
+# If a relative path is entered, it will be relative to the location 
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = documentation
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 
+# 4096 sub-directories (in 2 levels) under the output directory of each output 
+# format and will distribute the generated files over these directories. 
+# Enabling this option can be useful when feeding doxygen a huge amount of 
+# source files, where putting all generated files in the same directory would 
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS         = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
+# documentation generated by doxygen is written. Doxygen will use this 
+# information to generate all constant output in the proper language. 
+# The default language is English, other supported languages are: 
+# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, 
+# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, 
+# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, 
+# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, 
+# Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE        = English
+
+# This tag can be used to specify the encoding used in the generated output. 
+# The encoding is not always determined by the language that is chosen, 
+# but also whether or not the output is meant for Windows or non-Windows users. 
+# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES 
+# forces the Windows encoding (this is the default for the Windows binary), 
+# whereas setting the tag to NO uses a Unix-style encoding (the default for 
+# all platforms other than Windows).
+
+USE_WINDOWS_ENCODING   = NO
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
+# include brief member descriptions after the members that are listed in 
+# the file and class documentation (similar to JavaDoc). 
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
+# the brief description of a member or function before the detailed description. 
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator 
+# that is used to form the text in various listings. Each string 
+# in this list, if found as the leading text of the brief description, will be 
+# stripped from the text and the result after processing the whole list, is 
+# used as the annotated text. Otherwise, the brief description is used as-is. 
+# If left blank, the following values are used ("$name" is automatically 
+# replaced with the name of the entity): "The $name class" "The $name widget" 
+# "The $name file" "is" "provides" "specifies" "contains" 
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF       = 
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
+# Doxygen will generate a detailed section even if there is only a brief 
+# description.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all 
+# inherited members of a class in the documentation of that class as if those 
+# members were ordinary class members. Constructors, destructors and assignment 
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
+# path before files name in the file list and in the header files. If set 
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
+# can be used to strip a user-defined part of the path. Stripping is 
+# only done if one of the specified strings matches the left-hand part of 
+# the path. The tag can be used to show relative paths in the file list. 
+# If left blank the directory from which doxygen is run is used as the 
+# path to strip.
+
+STRIP_FROM_PATH        = 
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 
+# the path mentioned in the documentation of a class, which tells 
+# the reader which header file to include in order to use a class. 
+# If left blank only the name of the header file containing the class 
+# definition is used. Otherwise one should specify the include paths that 
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH    = 
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 
+# (but less readable) file names. This can be useful is your file systems 
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
+# will interpret the first line (until the first dot) of a JavaDoc-style 
+# comment as the brief description. If set to NO, the JavaDoc 
+# comments will behave just like the Qt-style comments (thus requiring an 
+# explicit @brief command for a brief description.
+
+JAVADOC_AUTOBRIEF      = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 
+# treat a multi-line C++ special comment block (i.e. a block of //! or /// 
+# comments) as a brief description. This used to be the default behaviour. 
+# The new default is to treat a multi-line C++ comment block as a detailed 
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the DETAILS_AT_TOP tag is set to YES then Doxygen 
+# will output the detailed description near the top, like JavaDoc.
+# If set to NO, the detailed description appears after the member 
+# documentation.
+
+DETAILS_AT_TOP         = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
+# member inherits the documentation from any documented member that it 
+# re-implements.
+
+INHERIT_DOCS           = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce 
+# a new page for each member. If set to NO, the documentation of a member will 
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES  = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 4
+
+# This tag can be used to specify a number of aliases that acts 
+# as commands in the documentation. An alias has the form "name=value". 
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to 
+# put the command \sideeffect (or @sideeffect) in the documentation, which 
+# will result in a user-defined paragraph with heading "Side Effects:". 
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                += "cite=\xrefitem cite \"Ref\" \"Bibliography\""
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C 
+# sources only. Doxygen will then generate output that is more tailored for C. 
+# For instance, some of the names that are used will be different. The list 
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java 
+# sources only. Doxygen will then generate output that is more tailored for Java. 
+# For instance, namespaces will be presented as packages, qualified scopes 
+# will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to 
+# include (a tag file for) the STL sources as input, then you should 
+# set this tag to YES in order to let doxygen match functions declarations and 
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. 
+# func(std::string) {}). This also make the inheritance and collaboration 
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT    = yes
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 
+# tag is set to YES, then doxygen will reuse the documentation of the first 
+# member in the group (if any) for the other members of the group. By default 
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of 
+# the same type (for instance a group of public functions) to be put as a 
+# subgroup of that type (e.g. under the Public Functions section). Set it to 
+# NO to prevent subgrouping. Alternatively, this can be done per class using 
+# the \nosubgrouping command.
+
+SUBGROUPING            = YES
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
+# documentation are documented, even if no documentation was available. 
+# Private class members and static file members will be hidden unless 
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file 
+# will be included in the documentation.
+
+EXTRACT_STATIC         = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 
+# defined locally in source files will be included in the documentation. 
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. When set to YES local 
+# methods, which are defined in the implementation section but not in 
+# the interface are included in the documentation. 
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS  = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
+# undocumented members of documented classes, files or namespaces. 
+# If set to NO (the default) these members will be included in the 
+# various overviews, but no documentation section is generated. 
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 
+# undocumented classes that are normally visible in the class hierarchy. 
+# If set to NO (the default) these classes will be included in the various 
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 
+# friend (class|struct|union) declarations. 
+# If set to NO (the default) these declarations will be included in the 
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 
+# documentation blocks found inside the body of a function. 
+# If set to NO (the default) these blocks will be appended to the 
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation 
+# that is typed after a \internal command is included. If the tag is set 
+# to NO (the default) then the documentation will be excluded. 
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 
+# file names in lower-case letters. If set to YES upper-case letters are also 
+# allowed. This is useful if you have classes or files whose names only differ 
+# in case and if your file system supports case sensitive file names. Windows 
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
+# will show members with their full class and namespace scopes in the 
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
+# will put a list of the files that are included by a file in the documentation 
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
+# will sort the (detailed) documentation of file and class members 
+# alphabetically by member name. If set to NO the members will appear in 
+# declaration order.
+
+SORT_MEMBER_DOCS       = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 
+# brief documentation of file, namespace and class members alphabetically 
+# by member name. If set to NO (the default) the members will appear in 
+# declaration order.
+
+SORT_BRIEF_DOCS        = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 
+# sorted by fully-qualified names, including namespaces. If set to 
+# NO (the default), the class list will be sorted only by class name, 
+# not including the namespace part. 
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the 
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or 
+# disable (NO) the todo list. This list is created by putting \todo 
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or 
+# disable (NO) the test list. This list is created by putting \test 
+# commands in the documentation.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or 
+# disable (NO) the bug list. This list is created by putting \bug 
+# commands in the documentation.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 
+# disable (NO) the deprecated list. This list is created by putting 
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional 
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS       = 
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
+# the initial value of a variable or define consists of for it to appear in 
+# the documentation. If the initializer consists of more lines than specified 
+# here it will be hidden. Use a value of 0 to hide initializers completely. 
+# The appearance of the initializer of individual variables and defines in the 
+# documentation can be controlled using \showinitializer or \hideinitializer 
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated 
+# at the bottom of the documentation of classes and structs. If set to YES the 
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = YES
+
+# If the sources in your project are distributed over multiple directories 
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES       = NO
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that 
+# doxygen should invoke to get the current version for each file (typically from the 
+# version control system). Doxygen will invoke the program by executing (via 
+# popen()) the command <command> <input-file>, where <command> is the value of 
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file 
+# provided by doxygen. Whatever the program writes to standard output 
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER    = 
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated 
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are 
+# generated by doxygen. Possible values are YES and NO. If left blank 
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 
+# potential errors in the documentation, such as not documenting some 
+# parameters in a documented function, or documenting parameters that 
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR      = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for 
+# functions that are documented, but have no documentation for their parameters 
+# or return value. If set to NO (the default) doxygen will only warn about 
+# wrong or incomplete parameter documentation, but not about the absence of 
+# documentation.
+
+WARN_NO_PARAMDOC       = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that 
+# doxygen can produce. The string should contain the $file, $line, and $text 
+# tags, which will be replaced by the file and line number from which the 
+# warning originated and the warning text. Optionally the format may contain 
+# $version, which will be replaced by the version of the file (if it could 
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning 
+# and error messages should be written. If left blank the output is written 
+# to stderr.
+
+WARN_LOGFILE           = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain 
+# documented source files. You may enter file names like "myfile.cpp" or 
+# directories like "/usr/src/myproject". Separate the files or directories 
+# with spaces.
+
+INPUT =                     \
+    documentation.txt       \
+    SigProc.h               \
+    fixed.h                 \
+    filters.cpp             \
+    pll.cpp                 \
+    scaling.cpp             \
+    sources.cpp             \
+    utility.cpp             \
+    modem.cpp
+
+# If the value of the INPUT tag contains directories, you can use the 
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank the following patterns are tested: 
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx 
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py
+
+FILE_PATTERNS          = 
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories 
+# should be searched for input files as well. Possible values are YES and NO. 
+# If left blank NO is used.
+
+RECURSIVE              = NO
+
+# The EXCLUDE tag can be used to specify files and/or directories that should 
+# excluded from the INPUT source files. This way you can easily exclude a 
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE                = 
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or 
+# directories that are symbolic links (a Unix filesystem feature) are excluded 
+# from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the 
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
+# certain files from those directories. Note that the wildcards are matched 
+# against the file with absolute path, so to exclude all test directories 
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS       = 
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or 
+# directories that contain example code fragments that are included (see 
+# the \include command).
+
+EXAMPLE_PATH           = 
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank all files are included.
+
+EXAMPLE_PATTERNS       = 
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
+# searched for input files to be used with the \include or \dontinclude 
+# commands irrespective of the value of the RECURSIVE tag. 
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or 
+# directories that contain image that are included in the documentation (see 
+# the \image command).
+
+IMAGE_PATH             = img/
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should 
+# invoke to filter for each input file. Doxygen will invoke the filter program 
+# by executing (via popen()) the command <filter> <input-file>, where <filter> 
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
+# input file. Doxygen will then use the output that the filter program writes 
+# to standard output.  If FILTER_PATTERNS is specified, this tag will be 
+# ignored.
+
+INPUT_FILTER           = 
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 
+# basis.  Doxygen will compare the file name with each pattern and apply the 
+# filter if there is a match.  The filters are a list of the form: 
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER 
+# is applied to all files.
+
+FILTER_PATTERNS        = 
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 
+# INPUT_FILTER) will be used to filter the input files when producing source 
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
+# be generated. Documented entities will be cross-referenced with these sources. 
+# Note: To get rid of all source code in the generated output, make sure also 
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER         = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body 
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
+# doxygen to hide any special comment blocks from generated source code 
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES (the default) 
+# then for each documented function all documented 
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES (the default) 
+# then for each documented function all documented entities 
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code 
+# will point to the HTML generated by the htags(1) tool instead of doxygen 
+# built-in source browser. The htags tool is part of GNU's global source 
+# tagging system (see http://www.gnu.org/software/global/global.html). You 
+# will need version 4.8.6 or higher.
+
+USE_HTAGS              = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
+# will generate a verbatim copy of the header file for each class for 
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 
+# of all compounds will be generated. Enable this if the project 
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = NO
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 5
+
+# In case all classes in a project start with a common prefix, all 
+# classes will be put under the same header in the alphabetical index. 
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for 
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank 
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard header.
+
+HTML_HEADER            = 
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard footer.
+
+HTML_FOOTER            = 
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading 
+# style sheet that is used by each HTML page. It can be used to 
+# fine-tune the look of the HTML output. If the tag is left blank doxygen 
+# will generate a default style sheet. Note that doxygen will try to copy 
+# the style sheet file to the HTML output directory, so don't put your own 
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET        =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 
+# files or namespaces will be aligned in HTML using tables. If set to 
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS     = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
+# will be generated that can be used as input for tools like the 
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) 
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 
+# be used to specify the file name of the resulting .chm file. You 
+# can add a path in front of the file if the result should not be 
+# written to the html output directory.
+
+CHM_FILE               = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 
+# be used to specify the location (absolute path including file name) of 
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 
+# controls if a separate .chi index file is generated (YES) or that 
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 
+# controls whether a binary table of contents is generated (YES) or a 
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members 
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at 
+# top of each HTML page. The value NO (the default) enables the index and 
+# the value YES disables it.
+
+DISABLE_INDEX          = NO
+
+# This tag can be used to set the number of enum values (range [1..20]) 
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that 
+# is generated for HTML Help). For this to work a browser that supports 
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, 
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are 
+# probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW      = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
+# used to set the initial width (in pixels) of the frame in which the tree 
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
+# generate Latex output.
+
+GENERATE_LATEX         = YES
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 
+# generate index for LaTeX. If left blank `makeindex' will be used as the 
+# default command name.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
+# LaTeX documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_LATEX          = YES
+
+# The PAPER_TYPE tag can be used to set the paper type that is used 
+# by the printer. Possible values are: a4, a4wide, letter, legal and 
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = letter
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         = 
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
+# the generated latex document. The header should contain everything until 
+# the first chapter. If it is left blank doxygen will generate a 
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           = 
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
+# contain links (just like the HTML output) instead of page references 
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
+# plain latex in the generated Makefile. Set this option to YES to get a 
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
+# command to the generated LaTeX files. This will instruct LaTeX to keep 
+# running if errors occur, instead of asking the user for help. 
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not 
+# include the index chapters (such as File Index, Compound Index, etc.) 
+# in the output.
+
+LATEX_HIDE_INDICES     = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
+# The RTF output is optimized for Word 97 and may not look very pretty with 
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
+# RTF documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
+# will contain hyperlink fields. The RTF file will 
+# contain links (just like the HTML output) instead of page references. 
+# This makes the output suitable for online browsing using WORD or other 
+# programs which support those fields. 
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's 
+# config file, i.e. a series of assignments. You only have to provide 
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    = 
+
+# Set optional variables used in the generation of an rtf document. 
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
+# generate man pages
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to 
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output, 
+# then it will generate one additional man file for each entity 
+# documented in the real man page(s). These additional files 
+# only source the real man page, but without them the man command 
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will 
+# generate an XML file that captures the structure of 
+# the code including all documentation.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT             = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_SCHEMA             = 
+
+# The XML_DTD tag can be used to specify an XML DTD, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_DTD                = 
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will 
+# dump the program listings (including syntax highlighting 
+# and cross-referencing information) to the XML output. Note that 
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 
+# generate an AutoGen Definitions (see autogen.sf.net) file 
+# that captures the structure of the code including all 
+# documentation. Note that this feature is still experimental 
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will 
+# generate a Perl module file that captures the structure of 
+# the code including all documentation. Note that this 
+# feature is still experimental and incomplete at the 
+# moment.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate 
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able 
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 
+# nicely formatted so it can be parsed by a human reader.  This is useful 
+# if you want to understand what is going on.  On the other hand, if this 
+# tag is set to NO the size of the Perl module output will be much smaller 
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file 
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 
+# This is useful so different doxyrules.make files included by the same 
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX = 
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
+# evaluate all C-preprocessor directives found in the sources and include 
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
+# names in the source code. If set to NO (the default) only conditional 
+# compilation will be performed. Macro expansion can be done in a controlled 
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
+# then the macro expansion is limited to the macros specified with the 
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that 
+# contain include files that are not input files but should be processed by 
+# the preprocessor.
+
+INCLUDE_PATH           = 
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
+# patterns (like *.h and *.hpp) to filter out the header-files in the 
+# directories. If left blank, the patterns specified with FILE_PATTERNS will 
+# be used.
+
+INCLUDE_FILE_PATTERNS  = 
+
+# The PREDEFINED tag can be used to specify one or more macro names that 
+# are defined before the preprocessor is started (similar to the -D option of 
+# gcc). The argument of the tag is a list of macros of the form: name 
+# or name=definition (no spaces). If the definition and the = are 
+# omitted =1 is assumed. To prevent a macro definition from being 
+# undefined via #undef or recursively expanded use the := operator 
+# instead of the = operator.
+
+PREDEFINED             = 
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 
+# this tag can be used to specify a list of macro names that should be expanded. 
+# The macro definition that is found in the sources will be used. 
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED      = 
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
+# doxygen's preprocessor will remove all function-like macros that are alone 
+# on a line, have an all uppercase name, and do not end with a semicolon. Such 
+# function macros are typically used for boiler-plate code, and will confuse 
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references   
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles. 
+# Optionally an initial location of the external documentation 
+# can be added for each tagfile. The format of a tag file without 
+# this location is as follows: 
+#   TAGFILES = file1 file2 ... 
+# Adding location for the tag files is done as follows: 
+#   TAGFILES = file1=loc1 "file2 = loc2" ... 
+# where "loc1" and "loc2" can be relative or absolute paths or 
+# URLs. If a location is present for each tag, the installdox tool 
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen 
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES               = 
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       = 
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
+# in the class index. If set to NO only the inherited external classes 
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 
+# in the modules index. If set to NO, only the current project's groups will 
+# be listed.
+
+EXTERNAL_GROUPS        = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script 
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base 
+# or super classes. Setting the tag to NO turns the diagrams off. Note that 
+# this option is superseded by the HAVE_DOT option below. This is only a 
+# fallback. It is recommended to install and use dot, since it yields more 
+# powerful graphs.
+
+CLASS_DIAGRAMS         = YES
+
+# If set to YES, the inheritance and collaboration graphs will hide 
+# inheritance and usage relations if the target is undocumented 
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
+# available from the path. This tool is part of Graphviz, a graph visualization 
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section 
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = NO
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect inheritance relations. Setting this tag to YES will force the 
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect implementation dependencies (inheritance, containment, and 
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS           = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and 
+# collaboration diagrams in a style similar to the OMG's Unified Modeling 
+# Language.
+
+UML_LOOK               = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the 
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
+# tags are set to YES then doxygen will generate a graph for each documented 
+# file showing the direct and indirect include dependencies of the file with 
+# other documented files.
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each 
+# documented header file showing the documented files that directly or 
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will 
+# generate a call dependency graph for every global function or class method. 
+# Note that enabling this option will significantly increase the time of a run. 
+# So in most cases it will be better to enable call graphs for selected 
+# functions only using the \callgraph command.
+
+CALL_GRAPH             = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES 
+# then doxygen will show the dependencies a directory has on other directories 
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH        = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT       = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be 
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH               = 
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that 
+# contain dot files that are included in the documentation (see the 
+# \dotfile command).
+
+DOTFILE_DIRS           = 
+
+# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width 
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
+# this value, doxygen will try to truncate the graph, so that it fits within 
+# the specified constraint. Beware that most browsers cannot cope with very 
+# large images.
+
+MAX_DOT_GRAPH_WIDTH    = 1024
+
+# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height 
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
+# this value, doxygen will try to truncate the graph, so that it fits within 
+# the specified constraint. Beware that most browsers cannot cope with very 
+# large images.
+
+MAX_DOT_GRAPH_HEIGHT   = 1024
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 
+# graphs generated by dot. A depth value of 3 means that only nodes reachable 
+# from the root by following a path via at most 3 edges will be shown. Nodes 
+# that lay further from the root node will be omitted. Note that setting this 
+# option to 1 or 2 may greatly reduce the computation time needed for large 
+# code bases. Also note that a graph may be further truncated if the graph's 
+# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH 
+# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default), 
+# the graph is not depth-constrained.
+
+MAX_DOT_GRAPH_DEPTH    = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent 
+# background. This is disabled by default, which results in a white background. 
+# Warning: Depending on the platform used, enabling this option may lead to 
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to 
+# read).
+
+DOT_TRANSPARENT        = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output 
+# files in one run (i.e. multiple -o and -T options on the command line). This 
+# makes dot run faster, but since only newer versions of dot (>1.8.10) 
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS      = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
+# generate a legend page explaining the meaning of the various boxes and 
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 
+# remove the intermediate dot files that are used to generate 
+# the various graphs.
+
+DOT_CLEANUP            = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine   
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be 
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE           = NO
Index: /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/utility.cpp
===================================================================
--- /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/utility.cpp	(revision 5533)
+++ /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/utility.cpp	(revision 5533)
@@ -0,0 +1,332 @@
+/**************************************************************************** 
+Copyright 2005,2006 Virginia Polytechnic Institute and State University
+
+This file is part of the OSSIE Signal Processing Library.
+
+OSSIE Signal Processing Library 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.
+
+OSSIE Signal Processing Library is distributed in the hope that it will be
+useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along
+with OSSIE Signal Processing Library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+****************************************************************************/
+
+#include "SigProc.h"
+
+namespace SigProc {
+
+//-----------------------------------------------------------------------------
+//
+// Dot product definitions
+//
+//-----------------------------------------------------------------------------
+/** \brief Calculate dot product between two floating point arrays
+ 
+    \f[ z = x \otimes y \f]
+ */
+void dot_product(float *x, float *y, unsigned int N, float &z)
+{
+    z = 0.0f;
+    for (unsigned int i=0; i<N; i++)
+        z += x[i]*y[i];
+}
+
+/** \brief Calculate dot product between two floating short integer arrays
+ 
+    \f[ z = x \otimes y \f]
+ */
+void dot_product(short *x, short *y, unsigned int N, short &z)
+{
+    float z_tmp(0.0f);
+    for (unsigned int i=0; i<N; i++)
+        z_tmp += float(x[i])*float(y[i]);
+    if ( z_tmp > SHRT_MAX )
+        z = SHRT_MAX;
+    else
+        z = short(z_tmp);
+
+}
+
+
+/** \brief Calculate dot product between a float and a short array
+ 
+    \f[ z = x \otimes y \f]
+ */
+void dot_product(float *x, short *y, unsigned int N, short &z)
+{
+    float z_tmp;
+
+    dot_product(x, y, N, z_tmp);
+
+    if ( z_tmp > SHRT_MAX )
+        z = SHRT_MAX;
+    else if ( z_tmp < SHRT_MIN )
+        z = SHRT_MIN;
+    else
+        z = short(z_tmp);
+}
+
+
+/** \brief Calculate dot product between a float and a short array
+ 
+    \f[ z = x \otimes y \f]
+ */
+void dot_product(float *x, short *y, unsigned int N, float &z)
+{
+    z = 0.0f;
+    for (unsigned int i=0; i<N; i++)
+        z += x[i]*float(y[i]);
+}
+
+
+
+//-----------------------------------------------------------------------------
+//
+// Trigonometric functions
+//
+//-----------------------------------------------------------------------------
+/** \brief Calculate inverse tangent
+ 
+    \f[ \theta = \arctan(y/x);\ \ 0\le\theta< 2\pi \f]
+ */
+void arctan(float &x, float &y, float &theta)
+{
+    if (x==0.0f) {
+        theta = ( y < 0 ) ? 3*PI/2 : PI/2;
+        return;
+    }
+
+    theta = atan(y/x);
+
+    // rotate angle to positive value
+    if (x>0 && y>=0) {
+        // Q1: do nothing
+    } else if (x<0 && y>=0) {
+        // Q2
+        theta += PI;
+    } else if (x<0 && y<=0) {
+        // Q3
+        theta += PI;
+    } else {
+        // Q4
+        theta += TWO_PI;
+    }
+}
+
+
+void rotate(short I_in, short Q_in, float theta, short *I_out, short *Q_out)
+{
+    ///\todo: use CORDIC mixer to perform this operation more efficiently
+    float c = cosf(theta);
+    float s = sinf(theta);
+
+    *I_out = (short)  ( (float) (I_in*c) - (float) (Q_in*s)  );
+    *Q_out = (short)  ( (float) (I_in*s) + (float) (Q_in*c)  );
+}
+
+
+//-----------------------------------------------------------------------------
+//
+// Random number generators
+//
+//-----------------------------------------------------------------------------
+
+float randf() {
+    float x = (float) rand();
+    return x / (float) RAND_MAX;
+}
+
+void randnf(float * i, float * q)
+{
+    // generate two uniform random numbers
+    float u1, u2;
+
+    // ensure u1 does not equal zero
+    do {
+        u1 = randf();
+    } while (u1 == 0.0f);
+
+    u2 = randf();
+
+    float x = sqrt(-2*logf(u1));
+    *i = x * sinf(2*PI*u2);
+    *q = x * cosf(2*PI*u2);
+}
+
+//-----------------------------------------------------------------------------
+//
+// Bitwise functions
+//
+//-----------------------------------------------------------------------------
+
+/** \brief packs octets with one bit of information into a byte
+
+ */
+void pack_bytes(
+    unsigned char * input,
+    unsigned int input_length,
+    unsigned char * output,
+    unsigned int output_length,
+    unsigned int * num_written)
+{
+    div_t d = div(input_length,8);
+    unsigned int req_output_length = d.quot;
+    req_output_length += ( d.rem > 0 ) ? 1 : 0;
+    if ( output_length < req_output_length ) {
+        perror("ERROR: SigProc::pack_bytes: output too short\n");
+        return;
+    }
+
+    unsigned int i;
+    unsigned int N = 0;         // number of bytes written to output
+    unsigned char byte = 0;
+
+    for (i=0; i<input_length; i++) {
+        byte |= input[i] & 0x01;
+
+        if ( (i+1)%8 == 0 ) {
+            output[N++] = byte;
+            byte = 0;
+        } else {
+            byte <<= 1;
+        }
+    }
+
+    if ( i%8 != 0 )
+        output[N++] = byte >> 1;
+
+    *num_written = N;
+}
+
+
+
+void unpack_bytes(
+    unsigned char * input,
+    unsigned int input_length,
+    unsigned char * output,
+    unsigned int output_length,
+    unsigned int * num_written)
+{
+    unsigned int i;
+    unsigned int N = 0;
+    unsigned char byte;
+
+    if ( output_length < 8*input_length ) {
+        perror("ERROR: SigProc::unpack_bytes: output too short\n");
+        return;
+    }
+
+    for (i=0; i<input_length; i++) {
+        byte = input[i];
+        output[N++] = (byte >> 7) & 0x01;
+        output[N++] = (byte >> 6) & 0x01;
+        output[N++] = (byte >> 5) & 0x01;
+        output[N++] = (byte >> 4) & 0x01;
+        output[N++] = (byte >> 3) & 0x01;
+        output[N++] = (byte >> 2) & 0x01;
+        output[N++] = (byte >> 1) & 0x01;
+        output[N++] =  byte       & 0x01;
+    }
+
+    *num_written = N;
+}
+
+void repack_bytes(
+    unsigned char * input,
+    unsigned int input_sym_size,
+    unsigned int input_length,
+    unsigned char * output,
+    unsigned int output_sym_size,
+    unsigned int output_length,
+    unsigned int * num_written)
+{
+    div_t d = div(input_length*input_sym_size,output_sym_size);
+    unsigned int req_output_length = d.quot;
+    req_output_length += ( d.rem > 0 ) ? 1 : 0;
+    if ( output_length < req_output_length ) {
+        perror("ERROR: SigProc::repack_bytes: output too short\n");
+        return;
+    }
+
+    unsigned int i;
+    unsigned char sym_in = 0;
+    unsigned char sym_out = 0;
+
+    // there is probably a more efficient way to do this, but...
+    unsigned int total_bits = input_length*input_sym_size;
+    unsigned int i_in = 0;  // input index
+    unsigned int i_out = 0; // output index
+    unsigned int k=0;       // input symbol enable
+    unsigned int n=0;       // output symbol enable
+    unsigned int v;         // bit mask
+
+    for (i=0; i<total_bits; i++) {
+        sym_out <<= 1;
+
+        // push input if necessary
+        if ( k == 0 )
+            sym_in = input[i_in++];
+
+        v = input_sym_size - k - 1;
+        sym_out |= (sym_in >> v) & 0x01;
+
+        // push output if available
+        if ( n == output_sym_size-1 ) {
+            output[i_out++] = sym_out;
+            sym_out = 0;
+        }
+
+        k = (k+1) % input_sym_size;
+        n = (n+1) % output_sym_size;
+    }
+
+    // condition: mode(input_sym_size*input_length, output_sym_size) != 0
+    // push last remaining bits of input into last output symbol
+    if (n != 0) {
+        output[i_out++] = sym_out << (output_sym_size-n);
+    }
+
+    *num_written = i_out;
+}
+
+
+
+dump_data::dump_data(const char *filename, long _start_sample, long _number_of_samples) : start_sample(_start_sample), stop_sample(_start_sample + _number_of_samples), current_sample(0)
+{
+
+    out_file = new std::ofstream(filename);
+
+}
+
+dump_data::~dump_data()
+{
+    delete out_file;
+}
+
+
+void dump_data::write_data(float data, const char *msg)
+{
+    if ((current_sample < stop_sample) && (current_sample > start_sample)) {
+	*out_file << msg << data << std::endl;
+    }
+    ++current_sample;
+}
+
+void dump_data::write_data(float a, float b, const char *msg)
+{
+    if ((current_sample < stop_sample) && (current_sample > start_sample)) {
+	*out_file << msg << a << "  " << b << std::endl;
+    }
+    ++current_sample;
+}
+
+} // namespace SigProc
Index: /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/fixed.h
===================================================================
--- /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/fixed.h	(revision 6686)
+++ /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/fixed.h	(revision 6686)
@@ -0,0 +1,506 @@
+/*
+ * libmad - MPEG audio decoder library
+ * Copyright (C) 2000-2004 Underbit Technologies, 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 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * $Id: fixed.h,v 1.38 2004/02/17 02:02:03 rob Exp $
+ */
+
+# ifndef LIBMAD_FIXED_H
+# define LIBMAD_FIXED_H
+
+// Only compile fixed point math on request for a specific arch
+// Otherwise include no code, also define FPM so other code knows
+// to use fpm routines, regardless of arch
+#if defined(FPM_INTEL) || defined(FPM_ARM) || defined(FPM_PPC)
+#define FPM
+
+# if SIZEOF_INT >= 4
+typedef   signed int mad_fixed_t;
+
+typedef   signed int mad_fixed64hi_t;
+typedef unsigned int mad_fixed64lo_t;
+# else
+typedef   signed long mad_fixed_t;
+
+typedef   signed long mad_fixed64hi_t;
+typedef unsigned long mad_fixed64lo_t;
+# endif
+
+# if defined(_MSC_VER)
+#  define mad_fixed64_t  signed __int64
+# elif 1 || defined(__GNUC__)
+#  define mad_fixed64_t  signed long long
+# endif
+
+# if defined(FPM_FLOAT)
+typedef double mad_sample_t;
+# else
+typedef mad_fixed_t mad_sample_t;
+# endif
+
+/*
+ * Fixed-point format: 0xABBBBBBB
+ * A == whole part      (sign + 3 bits)
+ * B == fractional part (28 bits)
+ *
+ * Values are signed two's complement, so the effective range is:
+ * 0x80000000 to 0x7fffffff
+ *       -8.0 to +7.9999999962747097015380859375
+ *
+ * The smallest representable value is:
+ * 0x00000001 == 0.0000000037252902984619140625 (i.e. about 3.725e-9)
+ *
+ * 28 bits of fractional accuracy represent about
+ * 8.6 digits of decimal accuracy.
+ *
+ * Fixed-point numbers can be added or subtracted as normal
+ * integers, but multiplication requires shifting the 64-bit result
+ * from 56 fractional bits back to 28 (and rounding.)
+ *
+ * Changing the definition of MAD_F_FRACBITS is only partially
+ * supported, and must be done with care.
+ */
+
+# define MAD_F_FRACBITS		28
+
+# if MAD_F_FRACBITS == 28
+#  define MAD_F(x)		((mad_fixed_t) (x##L))
+# else
+#  if MAD_F_FRACBITS < 28
+#   warning "MAD_F_FRACBITS < 28"
+#   define MAD_F(x)		((mad_fixed_t)  \
+				 (((x##L) +  \
+				   (1L << (28 - MAD_F_FRACBITS - 1))) >>  \
+				  (28 - MAD_F_FRACBITS)))
+#  elif MAD_F_FRACBITS > 28
+#   error "MAD_F_FRACBITS > 28 not currently supported"
+#   define MAD_F(x)		((mad_fixed_t)  \
+				 ((x##L) << (MAD_F_FRACBITS - 28)))
+#  endif
+# endif
+
+# define MAD_F_MIN		((mad_fixed_t) -0x80000000L)
+# define MAD_F_MAX		((mad_fixed_t) +0x7fffffffL)
+
+# define MAD_F_ONE		MAD_F(0x10000000)
+
+# define mad_f_tofixed(x)	((mad_fixed_t)  \
+				 ((x) * (double) (1L << MAD_F_FRACBITS) + 0.5))
+# define mad_f_todouble(x)	((double)  \
+				 ((x) / (double) (1L << MAD_F_FRACBITS)))
+
+# define mad_f_intpart(x)	((x) >> MAD_F_FRACBITS)
+# define mad_f_fracpart(x)	((x) & ((1L << MAD_F_FRACBITS) - 1))
+				/* (x should be positive) */
+
+# define mad_f_fromint(x)	((x) << MAD_F_FRACBITS)
+
+# define mad_f_add(x, y)	((x) + (y))
+# define mad_f_sub(x, y)	((x) - (y))
+
+# if defined(FPM_FLOAT)
+#  error "FPM_FLOAT not yet supported"
+
+#  undef MAD_F
+#  define MAD_F(x)		mad_f_todouble(x)
+
+#  define mad_f_mul(x, y)	((x) * (y))
+#  define mad_f_scale64
+
+#  undef ASO_ZEROCHECK
+
+# elif defined(FPM_64BIT)
+
+/*
+ * This version should be the most accurate if 64-bit types are supported by
+ * the compiler, although it may not be the most efficient.
+ */
+#  if defined(OPT_ACCURACY)
+#   define mad_f_mul(x, y)  \
+    ((mad_fixed_t)  \
+     ((((mad_fixed64_t) (x) * (y)) +  \
+       (1L << (MAD_F_SCALEBITS - 1))) >> MAD_F_SCALEBITS))
+#  else
+#   define mad_f_mul(x, y)  \
+    ((mad_fixed_t) (((mad_fixed64_t) (x) * (y)) >> MAD_F_SCALEBITS))
+#  endif
+
+#  define MAD_F_SCALEBITS  MAD_F_FRACBITS
+
+/* --- Intel --------------------------------------------------------------- */
+
+# elif defined(FPM_INTEL)
+
+#  if defined(_MSC_VER)
+#   pragma warning(push)
+#   pragma warning(disable: 4035)  /* no return value */
+static __forceinline
+mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
+{
+  enum {
+    fracbits = MAD_F_FRACBITS
+  };
+
+  __asm {
+    mov eax, x
+    imul y
+    shrd eax, edx, fracbits
+  }
+
+  /* implicit return of eax */
+}
+#   pragma warning(pop)
+
+#   define mad_f_mul		mad_f_mul_inline
+#   define mad_f_scale64
+#  else
+/*
+ * This Intel version is fast and accurate; the disposition of the least
+ * significant bit depends on OPT_ACCURACY via mad_f_scale64().
+ */
+#   define MAD_F_MLX(hi, lo, x, y)  \
+    asm ("imull %3"  \
+	 : "=a" (lo), "=d" (hi)  \
+	 : "%a" (x), "rm" (y)  \
+	 : "cc")
+
+#   if defined(OPT_ACCURACY)
+/*
+ * This gives best accuracy but is not very fast.
+ */
+#    define MAD_F_MLA(hi, lo, x, y)  \
+    ({ mad_fixed64hi_t __hi;  \
+       mad_fixed64lo_t __lo;  \
+       MAD_F_MLX(__hi, __lo, (x), (y));  \
+       asm ("addl %2,%0\n\t"  \
+	    "adcl %3,%1"  \
+	    : "=rm" (lo), "=rm" (hi)  \
+	    : "r" (__lo), "r" (__hi), "0" (lo), "1" (hi)  \
+	    : "cc");  \
+    })
+#   endif  /* OPT_ACCURACY */
+
+#   if defined(OPT_ACCURACY)
+/*
+ * Surprisingly, this is faster than SHRD followed by ADC.
+ */
+#    define mad_f_scale64(hi, lo)  \
+    ({ mad_fixed64hi_t __hi_;  \
+       mad_fixed64lo_t __lo_;  \
+       mad_fixed_t __result;  \
+       asm ("addl %4,%2\n\t"  \
+	    "adcl %5,%3"  \
+	    : "=rm" (__lo_), "=rm" (__hi_)  \
+	    : "0" (lo), "1" (hi),  \
+	      "ir" (1L << (MAD_F_SCALEBITS - 1)), "ir" (0)  \
+	    : "cc");  \
+       asm ("shrdl %3,%2,%1"  \
+	    : "=rm" (__result)  \
+	    : "0" (__lo_), "r" (__hi_), "I" (MAD_F_SCALEBITS)  \
+	    : "cc");  \
+       __result;  \
+    })
+#   elif defined(OPT_INTEL)
+/*
+ * Alternate Intel scaling that may or may not perform better.
+ */
+#    define mad_f_scale64(hi, lo)  \
+    ({ mad_fixed_t __result;  \
+       asm ("shrl %3,%1\n\t"  \
+	    "shll %4,%2\n\t"  \
+	    "orl %2,%1"  \
+	    : "=rm" (__result)  \
+	    : "0" (lo), "r" (hi),  \
+	      "I" (MAD_F_SCALEBITS), "I" (32 - MAD_F_SCALEBITS)  \
+	    : "cc");  \
+       __result;  \
+    })
+#   else
+#    define mad_f_scale64(hi, lo)  \
+    ({ mad_fixed_t __result;  \
+       asm ("shrdl %3,%2,%1"  \
+	    : "=rm" (__result)  \
+	    : "0" (lo), "r" (hi), "I" (MAD_F_SCALEBITS)  \
+	    : "cc");  \
+       __result;  \
+    })
+#   endif  /* OPT_ACCURACY */
+
+#   define MAD_F_SCALEBITS  MAD_F_FRACBITS
+#  endif
+
+/* --- ARM ----------------------------------------------------------------- */
+
+# elif defined(FPM_ARM)
+
+/* 
+ * This ARM V4 version is as accurate as FPM_64BIT but much faster. The
+ * least significant bit is properly rounded at no CPU cycle cost!
+ */
+# if 1
+/*
+ * This is faster than the default implementation via MAD_F_MLX() and
+ * mad_f_scale64().
+ */
+#  define mad_f_mul(x, y)  \
+    ({ mad_fixed64hi_t __hi;  \
+       mad_fixed64lo_t __lo;  \
+       mad_fixed_t __result;  \
+       asm ("smull	%0, %1, %3, %4\n\t"  \
+	    "movs	%0, %0, lsr %5\n\t"  \
+	    "adc	%2, %0, %1, lsl %6"  \
+	    : "=&r" (__lo), "=&r" (__hi), "=r" (__result)  \
+	    : "%r" (x), "r" (y),  \
+	      "M" (MAD_F_SCALEBITS), "M" (32 - MAD_F_SCALEBITS)  \
+	    : "cc");  \
+       __result;  \
+    })
+# endif
+
+#  define MAD_F_MLX(hi, lo, x, y)  \
+    asm ("smull	%0, %1, %2, %3"  \
+	 : "=&r" (lo), "=&r" (hi)  \
+	 : "%r" (x), "r" (y))
+
+#  define MAD_F_MLA(hi, lo, x, y)  \
+    asm ("smlal	%0, %1, %2, %3"  \
+	 : "+r" (lo), "+r" (hi)  \
+	 : "%r" (x), "r" (y))
+
+#  define MAD_F_MLN(hi, lo)  \
+    asm ("rsbs	%0, %2, #0\n\t"  \
+	 "rsc	%1, %3, #0"  \
+	 : "=r" (lo), "=r" (hi)  \
+	 : "0" (lo), "1" (hi)  \
+	 : "cc")
+
+#  define mad_f_scale64(hi, lo)  \
+    ({ mad_fixed_t __result;  \
+       asm ("movs	%0, %1, lsr %3\n\t"  \
+	    "adc	%0, %0, %2, lsl %4"  \
+	    : "=&r" (__result)  \
+	    : "r" (lo), "r" (hi),  \
+	      "M" (MAD_F_SCALEBITS), "M" (32 - MAD_F_SCALEBITS)  \
+	    : "cc");  \
+       __result;  \
+    })
+
+#  define MAD_F_SCALEBITS  MAD_F_FRACBITS
+
+/* --- MIPS ---------------------------------------------------------------- */
+
+# elif defined(FPM_MIPS)
+
+/*
+ * This MIPS version is fast and accurate; the disposition of the least
+ * significant bit depends on OPT_ACCURACY via mad_f_scale64().
+ */
+#  define MAD_F_MLX(hi, lo, x, y)  \
+    asm ("mult	%2,%3"  \
+	 : "=l" (lo), "=h" (hi)  \
+	 : "%r" (x), "r" (y))
+
+# if defined(HAVE_MADD_ASM)
+#  define MAD_F_MLA(hi, lo, x, y)  \
+    asm ("madd	%2,%3"  \
+	 : "+l" (lo), "+h" (hi)  \
+	 : "%r" (x), "r" (y))
+# elif defined(HAVE_MADD16_ASM)
+/*
+ * This loses significant accuracy due to the 16-bit integer limit in the
+ * multiply/accumulate instruction.
+ */
+#  define MAD_F_ML0(hi, lo, x, y)  \
+    asm ("mult	%2,%3"  \
+	 : "=l" (lo), "=h" (hi)  \
+	 : "%r" ((x) >> 12), "r" ((y) >> 16))
+#  define MAD_F_MLA(hi, lo, x, y)  \
+    asm ("madd16	%2,%3"  \
+	 : "+l" (lo), "+h" (hi)  \
+	 : "%r" ((x) >> 12), "r" ((y) >> 16))
+#  define MAD_F_MLZ(hi, lo)  ((mad_fixed_t) (lo))
+# endif
+
+# if defined(OPT_SPEED)
+#  define mad_f_scale64(hi, lo)  \
+    ((mad_fixed_t) ((hi) << (32 - MAD_F_SCALEBITS)))
+#  define MAD_F_SCALEBITS  MAD_F_FRACBITS
+# endif
+
+/* --- SPARC --------------------------------------------------------------- */
+
+# elif defined(FPM_SPARC)
+
+/*
+ * This SPARC V8 version is fast and accurate; the disposition of the least
+ * significant bit depends on OPT_ACCURACY via mad_f_scale64().
+ */
+#  define MAD_F_MLX(hi, lo, x, y)  \
+    asm ("smul %2, %3, %0\n\t"  \
+	 "rd %%y, %1"  \
+	 : "=r" (lo), "=r" (hi)  \
+	 : "%r" (x), "rI" (y))
+
+/* --- PowerPC ------------------------------------------------------------- */
+
+# elif defined(FPM_PPC)
+
+/*
+ * This PowerPC version is fast and accurate; the disposition of the least
+ * significant bit depends on OPT_ACCURACY via mad_f_scale64().
+ */
+#  define MAD_F_MLX(hi, lo, x, y)  \
+    do {  \
+      asm ("mullw %0,%1,%2"  \
+	   : "=r" (lo)  \
+	   : "%r" (x), "r" (y));  \
+      asm ("mulhw %0,%1,%2"  \
+	   : "=r" (hi)  \
+	   : "%r" (x), "r" (y));  \
+    }  \
+    while (0)
+
+#  if defined(OPT_ACCURACY)
+/*
+ * This gives best accuracy but is not very fast.
+ */
+#   define MAD_F_MLA(hi, lo, x, y)  \
+    ({ mad_fixed64hi_t __hi;  \
+       mad_fixed64lo_t __lo;  \
+       MAD_F_MLX(__hi, __lo, (x), (y));  \
+       asm ("addc %0,%2,%3\n\t"  \
+	    "adde %1,%4,%5"  \
+	    : "=r" (lo), "=r" (hi)  \
+	    : "%r" (lo), "r" (__lo),  \
+	      "%r" (hi), "r" (__hi)  \
+	    : "xer");  \
+    })
+#  endif
+
+#  if defined(OPT_ACCURACY)
+/*
+ * This is slower than the truncating version below it.
+ */
+#   define mad_f_scale64(hi, lo)  \
+    ({ mad_fixed_t __result, __round;  \
+       asm ("rotrwi %0,%1,%2"  \
+	    : "=r" (__result)  \
+	    : "r" (lo), "i" (MAD_F_SCALEBITS));  \
+       asm ("extrwi %0,%1,1,0"  \
+	    : "=r" (__round)  \
+	    : "r" (__result));  \
+       asm ("insrwi %0,%1,%2,0"  \
+	    : "+r" (__result)  \
+	    : "r" (hi), "i" (MAD_F_SCALEBITS));  \
+       asm ("add %0,%1,%2"  \
+	    : "=r" (__result)  \
+	    : "%r" (__result), "r" (__round));  \
+       __result;  \
+    })
+#  else
+#   define mad_f_scale64(hi, lo)  \
+    ({ mad_fixed_t __result;  \
+       asm ("rotrwi %0,%1,%2"  \
+	    : "=r" (__result)  \
+	    : "r" (lo), "i" (MAD_F_SCALEBITS));  \
+       asm ("insrwi %0,%1,%2,0"  \
+	    : "+r" (__result)  \
+	    : "r" (hi), "i" (MAD_F_SCALEBITS));  \
+       __result;  \
+    })
+#  endif
+
+#  define MAD_F_SCALEBITS  MAD_F_FRACBITS
+
+/* --- Default ------------------------------------------------------------- */
+
+# elif defined(FPM_DEFAULT)
+
+/*
+ * This version is the most portable but it loses significant accuracy.
+ * Furthermore, accuracy is biased against the second argument, so care
+ * should be taken when ordering operands.
+ *
+ * The scale factors are constant as this is not used with SSO.
+ *
+ * Pre-rounding is required to stay within the limits of compliance.
+ */
+#  if defined(OPT_SPEED)
+#   define mad_f_mul(x, y)	(((x) >> 12) * ((y) >> 16))
+#  else
+#   define mad_f_mul(x, y)	((((x) + (1L << 11)) >> 12) *  \
+				 (((y) + (1L << 15)) >> 16))
+#  endif
+
+/* ------------------------------------------------------------------------- */
+
+# else
+#  error "no FPM selected"
+# endif
+
+/* default implementations */
+
+# if !defined(mad_f_mul)
+#  define mad_f_mul(x, y)  \
+    ({ register mad_fixed64hi_t __hi;  \
+       register mad_fixed64lo_t __lo;  \
+       MAD_F_MLX(__hi, __lo, (x), (y));  \
+       mad_f_scale64(__hi, __lo);  \
+    })
+# endif
+
+# if !defined(MAD_F_MLA)
+#  define MAD_F_ML0(hi, lo, x, y)	((lo)  = mad_f_mul((x), (y)))
+#  define MAD_F_MLA(hi, lo, x, y)	((lo) += mad_f_mul((x), (y)))
+#  define MAD_F_MLN(hi, lo)		((lo)  = -(lo))
+#  define MAD_F_MLZ(hi, lo)		((void) (hi), (mad_fixed_t) (lo))
+# endif
+
+# if !defined(MAD_F_ML0)
+#  define MAD_F_ML0(hi, lo, x, y)	MAD_F_MLX((hi), (lo), (x), (y))
+# endif
+
+# if !defined(MAD_F_MLN)
+#  define MAD_F_MLN(hi, lo)		((hi) = ((lo) = -(lo)) ? ~(hi) : -(hi))
+# endif
+
+# if !defined(MAD_F_MLZ)
+#  define MAD_F_MLZ(hi, lo)		mad_f_scale64((hi), (lo))
+# endif
+
+# if !defined(mad_f_scale64)
+#  if defined(OPT_ACCURACY)
+#   define mad_f_scale64(hi, lo)  \
+    ((((mad_fixed_t)  \
+       (((hi) << (32 - (MAD_F_SCALEBITS - 1))) |  \
+	((lo) >> (MAD_F_SCALEBITS - 1)))) + 1) >> 1)
+#  else
+#   define mad_f_scale64(hi, lo)  \
+    ((mad_fixed_t)  \
+     (((hi) << (32 - MAD_F_SCALEBITS)) |  \
+      ((lo) >> MAD_F_SCALEBITS)))
+#  endif
+#  define MAD_F_SCALEBITS  MAD_F_FRACBITS
+# endif
+
+/* C routines */
+
+mad_fixed_t mad_f_abs(mad_fixed_t);
+mad_fixed_t mad_f_div(mad_fixed_t, mad_fixed_t);
+
+#endif
+# endif
Index: /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/butter.cpp
===================================================================
--- /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/butter.cpp	(revision 5571)
+++ /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/butter.cpp	(revision 5571)
@@ -0,0 +1,163 @@
+/*
+ *                            COPYRIGHT
+ *
+ *  bwlp - Butterworth lowpass filter coefficient calculator
+ *  Copyright (C) 2003, 2004, 2005 Exstrom Laboratories LLC
+ *
+ *  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.
+ *
+ *  A copy of the GNU General Public License is available on the internet at:
+ *
+ *  http://www.gnu.org/copyleft/gpl.html
+ *
+ *  or you can write to:
+ *
+ *  The Free Software Foundation, Inc.
+ *  675 Mass Ave
+ *  Cambridge, MA 02139, USA
+ *
+ *  You can contact Exstrom Laboratories LLC via Email at:
+ *
+ *  info(AT)exstrom.com
+ *
+ *  or you can write to:
+ *
+ *  Exstrom Laboratories LLC
+ *  P.O. Box 7651
+ *  Longmont, CO 80501, USA
+ *
+ */
+
+#include "SigProc.h"
+
+namespace SigProc {
+
+double *binomial_mult( int n, double *p );
+
+void design_butter_lowpass_filter(
+    unsigned int order,
+    float wc,
+    float *b,
+    float *a)
+{
+    int i, n;
+    double fcd, fca;
+    double *p;
+    double *d;
+    double pmr, pmi;
+    double ppr, ppi;
+    double ppmr, ppmi;
+    double d1, d2;
+
+    n = order;
+    fcd = M_PI * wc;
+    fca = tan( fcd / 2.0 );
+    p = (double *)calloc( 2 * n, sizeof(double) );
+
+    /* Calculate analog Butterworth coefficients */
+    for( i = 0; i < n; ++i )
+    {
+        p[2*i] = -fca * sin(M_PI*((double)i+0.5)/(double)n);
+        p[2*i+1] = fca * cos(M_PI*((double)i+0.5)/(double)n);
+    }
+
+    ppmr = 1.0;
+    ppmi = 0.0;
+
+    for( i = 0; i < n; ++i ) {
+        pmr = p[2*i] - 1.0;
+        pmi = p[2*i+1];
+        ppr = p[2*i] + 1.0;
+        ppi = p[2*i+1];
+        
+        d1 = pmr * pmr + pmi * pmi;
+        p[2*i] = (ppr * pmr + ppi * pmi) / d1;
+        p[2*i+1] = (ppi * pmr - ppr * pmi) / d1;
+
+        d1 = ppmr;
+        d2 = ppmi;
+        ppmr = -( d1 * pmr - d2 * pmi );
+        ppmi = -( d1 * pmi + d2 * pmr );
+    }
+
+    ppmr = pow( fca, (double)n ) / ppmr; /* scaling factor */
+
+    d = binomial_mult( n, p );
+
+    b[0] = (float) ppmr;
+
+    d1 = (double)n;
+    d2 = 1.0;
+    
+    for( i = 1; i <= n; ++i ) {
+        b[i] = (float) (ppmr*d1/d2);
+        d1 *= (double)(n - i);
+        d2 *= (double)(i + 1);
+    }
+
+    a[0] = 1.0f;
+
+    for( i = 0; i < n; ++i )
+        a[i+1] = (float) (d[2*i]);
+
+    free( p );
+    free( d );
+}
+
+/**********************************************************************
+  binomial_mult - multiplies a series of binomials together and returns
+  the coefficients of the resulting polynomial.
+  
+  The multiplication has the following form:
+  
+  (x+p[0])*(x+p[1])*...*(x+p[n-1])
+
+  The p[i] coefficients are assumed to be complex and are passed to the 
+  function as a pointer to an array of doubles of length 2n.
+
+  The resulting polynomial has the following form:
+  
+  x^n + a[0]*x^n-1 + a[1]*x^n-2 + ... +a[n-2]*x + a[n-1]
+  
+  The a[i] coefficients can in general be complex but should in most
+  cases turn out to be real. The a[i] coefficients are returned by the
+  function as a pointer to an array of doubles of length 2n. Storage
+  for the array is allocated by the function and should be freed by the
+  calling program when no longer needed.
+  
+  Function arguments:
+  
+  n  -  The number of binomials to multiply
+  p  -  Pointer to an array of doubles where p[2i] (i=0...n-1) is
+        assumed to be the real part of the coefficient of the ith binomial
+        and p[2i+1] is assumed to be the imaginary part. The overall size
+        of the array is then 2n.
+*/
+
+double *binomial_mult( int n, double *p )
+{
+    int i, j;
+    double *a;
+
+    a = (double *)calloc( 2 * n, sizeof(double) );
+
+    for( i = 0; i < n; ++i ) {
+        for( j = i; j > 0; --j ) {
+            a[2*j] += p[2*i] * a[2*(j-1)] - p[2*i+1] * a[2*(j-1)+1];
+            a[2*j+1] += p[2*i] * a[2*(j-1)+1] + p[2*i+1] * a[2*(j-1)];
+        }
+        a[0] += p[2*i];
+        a[1] += p[2*i+1];
+    }
+    return( a );
+}
+
+} // namespace SigProc
Index: /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/documentation.txt
===================================================================
--- /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/documentation.txt	(revision 4995)
+++ /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/documentation.txt	(revision 4995)
@@ -0,0 +1,94 @@
+/*=========================================================================
+
+         Documentation for the OSSIE Signal Processing Library
+
+=========================================================================*/
+
+/*! \mainpage Signal Processing Library
+
+\section description  Basic description
+The Signal Processing Library (SigProc) is intended to provide a library of
+DSP algorithms commonly used within radio communications.
+
+\section installation Installation
+
+\verbatim
+$ ./reconf
+$ ./configure
+$ make
+# make install
+\endverbatim
+
+If installing the libraries for the first time you will also need to link the
+libraries by running the following command with root permissions
+\verbatim
+# /sbin/ldconfig
+\endverbatim
+
+Additionally, you may verify that this version of SigProc passes the included
+autotest scripts by running cxxtest (http://cxxtest.sourceforge.net/), viz.
+
+\verbatim
+$ make check
+\endverbatim
+
+\subsection linking Linking to Components
+If generating a component with OWD, you will need to add the following to your
+\c configure.ac file between <tt>AC_LANG_PUSH([C++])</tt> and
+\c AC_LANG_POP,
+
+\verbatim
+AC_CHECK_LIB([sigproc], [main], [], [AC_MSG_ERROR([cannot find sigproc library])])
+AC_CHECK_HEADERS([sigproc/SigProc.h], [], [AC_MSG_ERROR([cannot find sigproc library header files])])
+\endverbatim
+
+\subsection dependencies Software Build Dependencies
+SigProc relies on the following external software packages...
+
+\section usage Usage
+
+Add the following to your class header file:
+\code
+#include "sigproc/SigProc.h"
+\endcode
+
+\subsection ExampleRRCFilter Example: design a root raised-cosine filter
+\code
+// A simple SigProc example: examplerrcfilter.cpp
+
+#include "sigproc/SigProc.h"
+
+int main() {
+    unsigned int k(4);              // samples per symbol
+    unsigned int m(3);              // filter delay (symbols)
+    float beta(0.3);                // excess bandwidth factor
+    
+    unsigned int h_len(2*k*m+1);    // filter length
+    float * h = new float[h_len];   // array for filter coefficients
+
+    // Calculate filter coefficients
+    SigProc::DesignRRCFilter(k, m, beta, h);
+
+    // Print filter coefficients to the screen
+    for (unsigned int i=0; i<h_len; i++) 
+        printf("h[%d] = %f\n", i, h[i]);
+    
+    // Clean up memory
+    delete [] h;
+    
+    return 0;
+}   
+\endcode
+
+Compile and run
+\verbatim
+$ g++ -lsigproc examplerrcfilter.cpp -o ExampleRRCFilter
+$ ./ExampleRRCFilter
+\endverbatim
+
+\section status Status and History
+
+\section references References
+For a complete list of references, please see the \ref cite page.
+*/
+
Index: /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/filters.cpp
===================================================================
--- /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/filters.cpp	(revision 6493)
+++ /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/filters.cpp	(revision 6493)
@@ -0,0 +1,641 @@
+/**************************************************************************** 
+Copyright 2005,2006 Virginia Polytechnic Institute and State University
+
+This file is part of the OSSIE Signal Processing Library.
+
+OSSIE Signal Processing Library 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.
+
+OSSIE Signal Processing Library is distributed in the hope that it will be
+useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along
+with OSSIE Signal Processing Library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+****************************************************************************/
+
+#include "SigProc.h"
+
+namespace SigProc {
+
+//-----------------------------------------------------------------------------
+//
+// Design root raised-cosine filter
+//
+//-----------------------------------------------------------------------------
+/** \brief Calculate square-root raised-cosine filter coefficients
+
+  DesignRRCFilter calculates the coefficients for a square-root raised-cosine
+  (RRC) finite impulse response (FIR) filter commonly used in digital
+  communications.  The input parameters are as follows
+
+    - \f$k\f$ : samples per symbol
+    - \f$m\f$ : sample delay
+    - \f$\beta\f$ : excess bandwidth (rolloff) factor
+
+  The function returns a pointer to the filter coefficients as well as an
+  integer value describing the length of the filter.  The length of the
+  filter is always
+
+  \f[
+    h_{len} = 2 k m + 1
+  \f]
+
+  The filter coefficients themselves are derived from the following equation
+
+  \f[ 
+    h\left[z\right] =
+      4\beta \frac{ \cos\left[(1+\beta)\pi z\right] +
+                    \sin\left[(1+\beta)\pi z\right] / (4\beta z) }
+                  { \pi \sqrt{T}\left[ 1-16\beta^2z^2\right] }
+  \f]
+
+  where \f$z=n/k-m\f$, and \f$T=1\f$ for most cases.
+
+  The function compensates for the two cases where \f$h[n]\f$ might be
+  undefined in the above equation, viz.
+
+  \f[
+    \mathop {\lim }\limits_{z \to 0 } h(z) =
+      \frac{ 4\beta \left[ 1 + \frac{1-\beta\pi }{ 4\beta } \right] }
+           { \pi\sqrt{T}\left( 1-16\beta^2 z^2 \right) }
+  \f]
+
+  and
+
+  \f[
+    \mathop {\lim }\limits_{z \to \pm \frac{1}{4\beta} } h(z) =
+        \frac{(1+\beta)}{2\pi}\sin\left[\frac{(1+\beta)\pi}{4\beta}\right]
+      - \frac{(1-\beta)}{2}\cos\left[\frac{(1-\beta)\pi}{4\beta}\right]
+      + \frac{2\beta}{\pi}\sin\left[\frac{(1-\beta)\pi}{4\beta}\right]
+
+  \f]
+
+  \param[in]  k         samples per symbol
+  \param[in]  m         symbol delay
+  \param[in]  beta      excess bandwidth/rolloff factor ( 0 < beta < 1 )
+  \param[in]  h         pointer to filter coefficients
+
+ */
+
+void DesignRRCFilter(
+  unsigned int k,      // samples per symbol
+  unsigned int m,      // delay
+  float beta,          // rolloff factor ( 0 < beta <= 1 )
+  float * h            // pointer to filter coefficients
+)
+{
+    unsigned int h_len;
+
+    if ( k < 1 ) {
+        std::cerr << "ERROR: SigProc::DesignRRCFilter: k must be greater than 0"
+                  << std::endl;
+        throw 0;
+    } else if ( m < 1 ) {
+        std::cerr << "ERROR: SigProc::DesignRRCFilter: m must be greater than 0"
+                  << std::endl;
+        throw 0;
+    } else if ( (beta < 0.0f) || (beta > 1.0f) ) {
+        std::cerr << "ERROR: SigProc::DesignRRCFilter: beta must be in [0,1]"
+                  << std::endl;
+        throw 0;
+    } else;
+
+    unsigned int n;
+    float z, t1, t2, t3, t4, T(1.0f);
+    float pi(3.14159265358979f);
+
+    h_len = 2*k*m+1;
+
+    // Calculate filter coefficients
+    for (n=0; n<h_len; n++) {
+
+        z = float(n)/float(k)-float(m);
+        t1 = cosf((1+beta)*pi*z);
+        t2 = sinf((1-beta)*pi*z);
+
+        // Check for special condition where z equals zero
+        if ( n == k*m ) {
+            t4 = 4*beta/(pi*sqrtf(T)*(1-(16*beta*beta*z*z)));
+            h[n] = t4*( 1 + (1-beta)*pi/(4*beta) );
+        } else {
+            t3 = 1/((4*beta*z));
+
+            float g = 1-16*beta*beta*z*z;
+            g *= g;
+
+            // Check for special condition where 16*beta^2*z^2 equals 1
+            if ( g < 1e-6 ) {
+                float g1, g2, g3, g4;
+                g1 = -(1+beta)*pi*sin((1+beta)*pi/(4*beta));
+                g2 = cos((1-beta)*pi/(4*beta))*(1-beta)*pi;
+                g3 = -sin((1-beta)*pi/(4*beta))*4*beta;
+                g4 = -2*pi;
+
+                h[n] = (g1+g2+g3)/g4;
+            } else {
+                t4 = 4*beta/(pi*sqrtf(T)*(1-(16*beta*beta*z*z)));
+                h[n] = t4*( t1 + (t2*t3) );
+            }
+        }
+    }
+}
+
+//-----------------------------------------------------------------------------
+//
+// Design Gaussian filter
+//
+//-----------------------------------------------------------------------------
+/** \brief Calculate Gaussian filter coefficients
+
+  DesignGaussianFilter calculates the coefficients for a square-root raised-cosine
+  (RRC) finite impulse response (FIR) filter commonly used in digital
+  communications.  The input parameters are as follows
+
+    - \f$k\f$ : samples per symbol
+    - \f$m\f$ : sample delay
+    - \f$\beta\f$ : excess bandwidth factor
+
+  The function returns a pointer to the filter coefficients as well as an
+  integer value describing the length of the filter.  The length of the
+  filter is always
+
+  \f[
+    h_{len} = 2 k m + 1
+  \f]
+
+  The filter coefficients themselves are derived from the following equation
+
+  \f[ 
+    h\left[z\right] = \frac{1}{\sqrt[4]{2\pi\sigma}}
+                      e^{\left(-z^2/{4\sigma^2}\right)}
+  \f]
+
+  where \f$z=n/k-m\f$ and \f$\sigma=\beta\f$.
+
+  \param[in]  k         samples per symbol
+  \param[in]  m         symbol delay
+  \param[in]  beta      excess bandwidth/rolloff factor ( 0 < beta < 1 )
+  \param[out] h         pointer to filter coefficients
+  \param[out] h_len     length of filter, h_len = 2*m*k+1
+
+ */
+
+void DesignGaussianFilter(
+  unsigned int k,      // samples per symbol
+  unsigned int m,      // delay
+  float beta,          // rolloff factor ( 0 < beta )
+  float *& h,          // pointer to filter coefficients
+  unsigned int & h_len // length of filter (len = 2*m*k+1)
+) {
+    h_len = 0;
+
+    if ( k < 1 ) {
+        std::cerr << "ERROR: SigProc::DesignGaussianFilter: k must be greater than 0"
+                  << std::endl;
+        throw 0;
+    } else if ( m < 1 ) {
+        std::cerr << "ERROR: SigProc::DesignGaussianFilter: m must be greater than 0"
+                  << std::endl;
+        throw 0;
+    } else if ( beta < 0.0f) {
+        std::cerr << "ERROR: SigProc::DesignGaussianFilter: beta must be greater than 0"
+                  << std::endl;
+        throw 0;
+    } else;
+
+    h_len = 2*k*m + 1;
+    h = new float[h_len];
+    float sigma(beta);  ///\todo determine how to calculate sigma from beta
+    float pi(3.14159265358979f);
+    float g1( 2*sigma*sigma );
+    float g2( 1/sqrtf(g1*pi) );
+    float z;
+
+    for (unsigned int n=0; n<h_len; n++) {
+        // Check for special condition where z equals zero
+        if ( n == k*m ) {
+            h[n] = g2;
+        } else {
+            z = float(n)/float(k)-float(m);
+            h[n] = expf(-z*z/g1)*g2;
+        }
+    }
+}
+
+//-----------------------------------------------------------------------------
+//
+// FIR polyphase filter bank
+//
+//-----------------------------------------------------------------------------
+
+// Initializing constructor
+FIRPolyphaseFilterBank::FIRPolyphaseFilterBank(
+        char * _type,       // type of filter
+        unsigned int _k,    // samples per symbol
+        unsigned int _m,    // delay
+        float _beta,        // excess bandwidth factor
+        unsigned int _Npfb  // number of filters
+        )
+{
+    k = _k;
+    m = _m;
+    beta = _beta;
+    Npfb = _Npfb;
+
+    H = NULL;
+
+    if ( strcmp(_type,"rrcos")==0 ) {
+        // Square-root raised-cosine filter
+        CalculateRRCFilterCoefficients();
+        TransposeCoefficientMatrix();
+    } else if ( strcmp(_type,"drrcos")==0 ) {
+        // Derivative square-root raised-cosine filter
+        CalculateRRCFilterCoefficients();
+        CalculateDerivativeFilterCoefficients();
+        TransposeCoefficientMatrix();
+    } else if ( strcmp(_type,"gaussian")==0 ) {
+        // Gaussian filter
+        CalculateGaussianFilterCoefficients();
+        TransposeCoefficientMatrix();
+    } else if ( strcmp(_type,"dgaussian")==0 ) {
+        // Derivative gaussian filter
+        CalculateGaussianFilterCoefficients();
+        CalculateDerivativeFilterCoefficients();
+        TransposeCoefficientMatrix();
+    } else {
+        std::cerr << "ERROR: FIRPolyphaseFilterBank: unknown filter type : " << _type << std::endl;
+        throw 0;
+    }
+
+    // At this point, H should be initialized and h_len should store
+    // the correct length of each filter in the bank.
+    v.SetBufferSize(h_len);
+
+    // memset input buffer to zeros
+    ResetBuffer();
+}
+
+// Initializing constructor
+FIRPolyphaseFilterBank::FIRPolyphaseFilterBank(
+        float * _H,         // filter bank coefficients
+        unsigned int _h_len,// length of each filter
+        unsigned int _Npfb  // number of filters
+        )
+{
+    /// \todo perform check on input?
+
+    h_len = _h_len;
+    Npfb = _Npfb;
+
+    // perform deep copy of memory
+    H = new float[Npfb*h_len];
+    for (unsigned int i=0; i<(Npfb*h_len); i++)
+        H[i] = _H[i];
+
+    v.SetBufferSize(h_len);
+
+    // memset input buffer to zeros
+    ResetBuffer();
+}
+
+// destructor
+FIRPolyphaseFilterBank::~FIRPolyphaseFilterBank()
+{
+    // delete filter bank coefficients matrix
+    if ( H != NULL )
+        delete [] H;
+
+}
+
+// push input value into buffer
+void FIRPolyphaseFilterBank::PushInput(short _x)
+{
+    // Add _x to input buffer
+    v.Push( _x );
+}
+
+// compute filter output from current buffer state using specific filter
+void FIRPolyphaseFilterBank::ComputeOutput(
+        short &y,           // output sample
+        unsigned int _b     // filter bank index
+        )
+{
+    // Ensure the requested filter bank index does not exceed the number
+    // of filters actually in the bank
+    if ( _b >= Npfb )
+    {
+        std::cerr << "ERROR: SigProc::FIRPolyphaseFitlerBank::ComputeOutput, "
+                  << " index exceeds filter bank size ("
+                  << _b << " > " << Npfb << ")" << std::endl;
+        throw 0;
+    }
+
+    // Set B to memory block in filter bank array
+    unsigned int B;
+    B = _b*h_len;
+
+    // Compute dot product
+    dot_product( H+B, v.GetHeadPtr(), h_len, y);
+
+}
+
+// compute filter output from current buffer state using specific filter
+void FIRPolyphaseFilterBank::ComputeOutput(
+        short &y,           // output sample
+        unsigned int _b,    // filter bank index
+        short *_v           // external memory buffer array
+        )
+{
+    // Ensure the requested filter bank index does not exceed the number
+    // of filters actually in the bank
+    if ( _b >= Npfb )
+    {
+        std::cerr << "ERROR: SigProc::FIRPolyphaseFitlerBank::ComputeOutput, "
+                  << " index exceeds filter bank size ("
+                  << _b << " > " << Npfb << ")" << std::endl;
+        throw 0;
+    }
+
+    // Set B to memory block in filter bank array
+    unsigned int B;
+    B = _b*h_len;
+
+    // Compute dot product
+    dot_product( H+B, _v, h_len, y);
+
+}
+
+// Reset filter buffer
+void FIRPolyphaseFilterBank::ResetBuffer()
+{
+    v.Release();
+
+    // Load buffer with zeros
+    for (unsigned int i=0; i<h_len; i++)
+        v.Push( 0 );
+}
+
+// Print filter buffer
+void FIRPolyphaseFilterBank::PrintBuffer()
+{
+    v.Print();
+}
+
+// Print filter bank coefficients to the screen
+void FIRPolyphaseFilterBank::PrintFilterBankCoefficients()
+{
+    if ( H == NULL )
+    {
+        std::cout << "ERROR: SigProc::FIRPolyphaseFilterBank: "
+                  << "cannot print filter coefficients (matrix empty)"
+                  << std::endl;
+        return;
+    }
+
+    unsigned int r, c, B;
+    std::cout << "H = [" << std::endl;
+    for (r=0; r<Npfb; r++ ) {
+        B = r*h_len;
+        printf("  ");
+
+        for (c=0; c<h_len; c++) {
+            printf("%E ", H[B + c]);
+        }
+        printf(";\n");
+    }
+    std::cout << "   ]" << std::endl;
+
+}
+
+//
+void FIRPolyphaseFilterBank::TransposeCoefficientMatrix()
+{
+    // create temporary pointer
+    float * H_tmp;
+    H_tmp = H;
+
+    // allocate new memory for filter bank coefficients
+    H = new float[h_len*Npfb];
+
+    // reshape matrix
+    unsigned int i(0), r, c;
+    for (r=0; r<Npfb; r++) {
+        for (c=0; c<h_len; c++)
+            H[i++] = H_tmp[c*Npfb + r];
+    }
+
+    delete [] H_tmp;
+}
+
+
+// Calculate root raised-cosine coefficients
+void FIRPolyphaseFilterBank::CalculateRRCFilterCoefficients()
+{
+    if ( H != NULL )
+        delete [] H;
+
+    // create over-sampled pulse
+    h_len = 2*k*m*Npfb+1;
+    H = new float[h_len];
+    DesignRRCFilter(Npfb*k, m, beta, H);
+
+    // Apply scaling factor to filter coefficients
+    float h_scale = float(k);
+    for (unsigned int i=0; i<h_len; i++)
+        H[i] /= h_scale;
+
+    // 
+    h_len = ( h_len - 1 ) / Npfb;
+
+}
+
+//
+void FIRPolyphaseFilterBank::CalculateGaussianFilterCoefficients()
+{
+    if ( H != NULL )
+        delete [] H;
+
+}
+
+// Calculate derivative filter coefficients
+void FIRPolyphaseFilterBank::CalculateDerivativeFilterCoefficients()
+{
+    unsigned int N = h_len*Npfb;
+
+    float * dH = new float[N];
+
+    for (unsigned int i=0; i<N; i++) {
+        if ( i==0 ) {
+            dH[0] = H[1] - H[N-1];
+        } else if ( i==N-1 ) {
+            dH[N-1] = H[0] - H[N-2];
+        } else {
+            dH[i] = H[i+1] - H[i-1];
+        }
+        dH[i] /= 2.0f;
+    }
+
+    delete [] H;
+    H = dH;
+}
+
+
+iir_filter::iir_filter(float a_coeff[], unsigned int len_a, float b_coeff[], unsigned int len_b) : len_A(len_a), len_B(len_b), next_v(0)
+{
+
+    A = new float[len_a];
+    B = new float[len_b];
+
+    for (unsigned int i = 0; i < len_a; ++i)
+        A[i] = a_coeff[i];
+
+    for (unsigned int i = 0; i < len_b; ++i)
+        B[i] = b_coeff[i];
+
+    if (len_A > len_B)
+        len_v = len_A;
+    else
+        len_v = len_B;
+
+    v = new float[len_v];
+
+    for (unsigned int i = 0; i < len_v; ++i)
+        v[i] = 0;
+
+}
+
+void iir_filter::ResetBuffer()
+{
+    for (unsigned int i = 0; i < len_v; ++i)
+        v[i] = 0;
+}
+
+void iir_filter::do_work(short x, short &y)
+{
+    // calculate new v[n]
+    int v_idx = next_v;
+
+    v[next_v] = x;
+
+    for (unsigned int i = 1; i < len_A; ++i) {
+
+        --v_idx;
+        if (v_idx < 0)
+            v_idx += len_v;
+
+        v[next_v] -= A[i] * v[v_idx];
+          
+    }
+
+    // Now calculate the output value
+    v_idx = next_v;
+    float out = 0;
+
+    for (unsigned int i = 0; i < len_B; ++i) {
+        out += (B[i] * v[v_idx]);
+
+        --v_idx;
+        if (v_idx < 0)
+            v_idx += len_v;
+    }
+
+    next_v = (++next_v) % len_v;
+
+    if (out < SHRT_MIN)
+        y = SHRT_MIN;
+    else if (out > SHRT_MAX)
+        y = SHRT_MAX;
+    else
+        y = (short) out;
+}
+
+
+fir_filter::fir_filter(float a_coeff[], unsigned int len_a) : len_A(len_a), len_v(len_a),next_v(0)
+ {
+#ifdef FPM
+    A = new mad_fixed_t[len_a];
+    v = new mad_fixed_t[len_v];
+#else
+    A = new float[len_a];
+    v = new short[len_v];
+#endif
+
+    for (unsigned int i = 0; i < len_a; ++i)
+#ifdef FPM
+        A[i] = mad_f_tofixed(a_coeff[i]);
+#else
+        A[i] = a_coeff[i];
+#endif
+
+
+    for (unsigned int i = 0; i < len_v; ++i)
+        v[i] = 0;
+
+
+}
+
+void fir_filter::do_work(bool run_filter, short x, short &y)
+{
+    // calculate new v[n]
+    int v_idx = next_v;
+
+    v[next_v] = x;
+    ++next_v;
+    if (next_v == len_v)
+	next_v = 0;
+
+    if (!run_filter) { // Do not create an output value
+        y = 0;
+        return;
+    }
+
+    // Now calculate the output value
+#ifdef FPM
+    mad_fixed_t out(0);
+#else
+    float out(0.0);
+#endif
+
+    for (unsigned int i = 0; i < len_A; ++i) {
+        if (v[v_idx]) {
+#ifdef FPM
+            out = mad_f_add(out, mad_f_mul(A[i], v[v_idx]));
+#else
+            out += (A[i] * v[v_idx]);
+#endif
+        }
+
+        --v_idx;
+        if (v_idx < 0)
+            v_idx += len_v;
+    }
+
+#ifdef FPM
+        y = (short) out;
+#else
+    if (out < SHRT_MIN)
+        y = SHRT_MIN;
+    else if (out > SHRT_MAX)
+        y = SHRT_MAX;
+    else
+        y = (short) out;
+#endif
+}
+
+void fir_filter::reset()
+{
+
+    for (unsigned int i = 0; i < len_v; ++i)
+        v[i] = 0;
+
+    next_v = 0;
+}
+
+} // namespace SigProc
Index: /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/SigProc.h
===================================================================
--- /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/SigProc.h	(revision 6686)
+++ /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/SigProc.h	(revision 6686)
@@ -0,0 +1,1063 @@
+/****************************************************************************
+
+Copyright 2005, 2006, 2008 Virginia Polytechnic Institute and State University
+
+This file is part of the OSSIE Signal Processing Library.
+
+OSSIE Signal Processing Library 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.
+
+OSSIE Signal Processing Library is distributed in the hope that it will be
+useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along
+with OSSIE Signal Processing Library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+****************************************************************************/
+
+#ifndef SIG_PROC_H
+#define SIG_PROC_H
+
+#include <iostream>
+#include <fstream>
+#include <string>
+#include <math.h>
+
+#include "fixed.h"
+
+#define PI      3.14159265358979f
+#define TWO_PI  6.28318530717959f
+
+namespace SigProc {
+//-----------------------------------------------------------------------------
+//
+// Convolutional coding definitions
+//
+//-----------------------------------------------------------------------------
+
+/** \brief Defines the basic entry for building the trellis at the decoder
+*/
+class TrellisEntry{
+    public:
+        ///Contructor
+        TrellisEntry();
+        ///Destructor
+        ~TrellisEntry();        
+        unsigned int previousState; ///< The state prior to the current state, used for tracing back the trellis
+        unsigned short int symbolNo; ///< The symbol that caused the change of state to the currrent state
+        signed int distance; ///< The total distance of the current state
+};
+
+/** \brief Includes all the necessary information for encoding and decoding the symbols
+ *
+ * The contructor has to be ALWAYS be used. The generator polynomials for each code rate have to be specified in DECIMAL, not OCTAL format
+ *
+ * For more information for the meaning of the symbols used and for generator polynomials look at
+ * Proakis Digital Communications book 4th Edition, pages 471 & 492 respectively.
+*/
+class trellisTable{
+    public:
+        /// The contructor has to be always used
+        trellisTable(unsigned int * generatorPolynomials, unsigned short int k, unsigned short int n, unsigned short K);
+
+        /// =The destructor
+        ~trellisTable();
+
+        unsigned short int k;///<the input bits at a time
+        unsigned short int n;///< the output bits at a time
+        unsigned short int K;///<the contraint length
+        unsigned short int numberOfInputStates;///< Based on k, how many different input states exist
+        unsigned int numberOfTrellisStates;///<Number of different trellis states, defined by k & K
+
+        unsigned int **output; ///< The rows are the trellis states and the columns the symbols, gives the output given the current state and symbol.
+        unsigned int **nextState;///< The sane as output, gives the the next state given the current state and synbol
+
+    protected:
+        ///Generates the trellis table given the generator polynomials in DECIMAL not OCTAL
+        void GenerateTrellisTable(unsigned int * generatorPolynomials);
+
+        ///Performs modulo 2 addition to the bits of the input number (symbol)
+        unsigned short int Modulo2BitWiseAdd(unsigned short int inputNumber);
+};
+
+/** \brief Defines the basic functionality for the convolution encoding/decoding
+*/
+
+class fec_conv{
+    public:
+        /// It accepts the pointer to the trellis Table
+        void SetTrellisTable(trellisTable *theTrellisTableIn);
+
+    protected:
+        /// It converts a decimal numnber (symbol) into a vector of bits
+        void Dec2Bin(unsigned int decNumber,unsigned short int * outputData,unsigned short int numberOfBits);
+
+        trellisTable * theTrellisTable;///< It holds the trellis table used for encoding/decoding
+};
+
+/** \brief It defines the encoding functionality
+ *
+ * To use this class, first pass the trellis table pointer
+ *
+ * To encode: reset the state, feed data & get encoded data, repeat for the next packet.
+ *
+ * To make the encoder to return at the zero state during encoding, feed K 0 symbols after the encoding of the data is done.
+*/
+class fec_conv_encoder : public fec_conv{
+    public:
+        ///Default constructor
+        fec_conv_encoder();
+
+        ///Default destructor
+        ~fec_conv_encoder();
+
+        /// Resets the state of the encoder to the zero state
+        void ResetState();
+
+        ///It gets the current state of the encoder
+        unsigned int GetState();
+
+        ///It accepts a vector of k bits and returns a vector of n bits
+        void Encode(unsigned short int * inputData,unsigned short int * outputData);
+
+    protected:
+        unsigned int currentState;///<The current state of the encoder
+};
+
+/** \brief It defines the decoding functionality
+ *
+ * The following cycle should be followed to use this class:
+ *
+ * 1. Set the trellis table
+ *
+ * 2. Set the traceback length
+ *
+ * 3. Set mode
+ *
+ * 4. Feed symbols into the decoder
+ *
+ * 5. Trace back trellis
+ *
+ * 6. Get the decoded symbols
+ *
+ * 7. Reset and repeat from 4 for the next packet. If the decoding parameters change, might need to repeat from 1.
+*/
+class fec_conv_decoder:public fec_conv {
+    public:
+        ///Default contructor
+        fec_conv_decoder();
+
+        ///Default destructor
+        ~fec_conv_decoder();
+
+        /// Set the numbers of the input symbols to be decoded, this equals to the total bits on the output of the encoder divided by k
+        void SetNoOfSymbols2TraceBack(unsigned int tracebackLength);
+
+        /// Feeds a symbol (in a vector of n bits) at time for decoding
+        void Symbol2Decode(unsigned short int * inputData);
+
+        /// After all symbols were fed in the decoder, it will tracesback the trellis to the begining.
+        void TraceBackTrellis();
+
+        ///After the trellis was traced back, it returns a decoded symbol, starting from the beggining each time is called.
+        void GetDecodedSymbol(unsigned short int * outputData);
+
+        ///It resets the state of the decoder in order to be able to start a new decoding session
+        void Reset();
+
+        ///Sets the mode of the decoder 0: the encoded data start from zero state 1: the encoded data start from the the zero state and end at the zero state.
+        void SetMode(unsigned short int mode);
+
+    protected:
+        ///Calculates the distance between the input bits (symbol) to the current trellis symbol
+        signed int CalculateDistance(unsigned short int inBits, unsigned short int symbol);
+
+        unsigned int currentTrellisIndex;///<The current trellis stage used when building and tracing back the trellis.
+        unsigned int decodedSymbolIndex;///<The next symbol to be returned when the GetDecodedSymbol is called.
+        unsigned int noOfSymbols2TraceBack;///<Number of symbols to trace back, should be equal to the symbols used in the encoding process.
+        unsigned int mode;///<The mode of the encoder
+
+        unsigned int *tracedBackSymbols;///<A vector array with the symbols traced back
+        TrellisEntry **theTrellis; ///<A two dimensional array making the trellis, states are rows, and columns are each trellis stage.
+};
+
+//-----------------------------------------------------------------------------
+//
+// Design root raised-cosine filter
+//
+//-----------------------------------------------------------------------------
+void DesignRRCFilter(
+  unsigned int k,      // samples per symbol
+  unsigned int m,      // delay
+  float beta,          // rolloff factor ( 0 < beta <= 1 )
+  float * h            // pointer to filter coefficients
+);
+
+//-----------------------------------------------------------------------------
+//
+// Design Gaussian filter
+//
+//-----------------------------------------------------------------------------
+void DesignGaussianFilter(
+  unsigned int k,      // samples per symbol
+  unsigned int m,      // delay
+  float beta,          // rolloff factor ( 0 < beta <= 1 )
+  float *& h,          // pointer to filter coefficients
+  unsigned int & h_len // length of filter (len = 2*m*k+1)
+);
+
+//-----------------------------------------------------------------------------
+//
+// Design low-pass butterworth filter
+//
+//-----------------------------------------------------------------------------
+void design_butter_lowpass_filter(
+  unsigned int order,   // filter order
+  float wc,             // cutoff frequency
+  float *b,             // feedback
+  float *a              // feedforward
+);
+
+//-----------------------------------------------------------------------------
+//
+// Circular buffer
+//
+//-----------------------------------------------------------------------------
+/** \brief Circlar buffer, template class
+ *
+ * \section CB_basic_description Basic Description
+ * The circular buffer template class implementation minimizes memory copies
+ * by wrapping the array around to its beginning.  Elements can be added
+ * and removed by invoking the Push() and Pop() methods, respectively.
+ *
+ * \section CB_creating Creating Buffers
+ * There are three ways to create a buffer...
+ * \code
+ * // 1. generate an empty buffer
+ * CircularBuffer <short> v1(100);
+ *
+ * // 2. wrap an existing array
+ * short * x = new short[100];
+ * for (unsigned int i=0; i<100; i++)
+ *     x[i] = i;
+ * CircularBuffer <short> v2(x, 100);
+ *
+ * // 3. copy from another CircularBuffer
+ * CircularBuffer <short> v3(v2);
+ * \endcode
+ *
+ * \section CB_resizing_buffers Resizing Buffers
+ * CircularBuffer supports dynamic memory allocation as well; if an instance
+ * of CircularBuffer is created of a particular size and then later it is
+ * determined that the size is too small, invoking SetBufferSize() can be used
+ * to increase the length without loss of data.  However, decreasing the buffer
+ * size beyond the number of elements in the buffer truncates the data.
+ *
+ * \section CB_wrapping Wrapping
+ * When the buffer is full and another element is pushed, the new element
+ * overwrites the last element in the buffer without warning.  Status of the
+ * buffer can be checked with the GetBufferSize() and GetNumElements()
+ * methods.
+ *
+ */
+template <class T>
+class CircularBuffer {
+  public:
+    /// Default constructor
+    CircularBuffer();
+
+    /// Initializing constructor (empty)
+    CircularBuffer(unsigned int _bufferSize);
+
+    /// Initializing constructor (array)
+    CircularBuffer(T * _v, unsigned int _bufferSize);
+
+    /// Copy constructor
+    CircularBuffer(CircularBuffer &);
+
+    /// destructor
+    ~CircularBuffer() { delete [] headPtr; }
+
+    /// \brief Overload the [] operator (indexing)
+    ///
+    /// Returns the value at the appropriate index as if the buffer were a
+    /// linear array
+    T operator[] (unsigned int i) {
+        return headPtr[(i_read + i) % bufferSize ];
+    }
+
+    /// Push value into the beginning of the buffer, overwrite existing element
+    /// if buffer is full
+    void Push(T _value) {
+
+        // OK to push value
+        headPtr[i_head++] = _value;
+
+        // Ensure head index does not equal or exceed bufferSize (wrap)
+        i_head = i_head % bufferSize;
+
+        // Check to see if buffer is full
+        if ( numElements < bufferSize )
+            numElements++;  // buffer not yet full
+        else
+            i_read++;       // overflow
+    }
+
+    /// Remove element from the end of the buffer
+    T Pop() {
+        if ( numElements == 0 ) {
+            std::cerr << "ERROR: SigProc::CircularBuffer::Pop() : buffer is empty!"
+                      << std::endl;
+            throw 0;
+        }
+
+        // read value
+        T retval = headPtr[i_read++];
+
+        // Ensure read index does not equal or exceed bufferSize (wrap)
+        i_read = i_read % bufferSize;
+
+        // Decrement number of elements
+        numElements--;
+
+        // RETURN value
+        return retval;
+    }
+
+    /// Releases entire buffer (resets values in buffer to zero)
+    void Release() {
+        i_head = 0;
+        i_read = 0;
+        numElements = 0;
+        memset(headPtr, 0, bufferSize*sizeof(T));
+    }
+
+    /// Releases _n elements from buffer
+    void Release( unsigned int _n ) {
+        if ( _n >= numElements ) {
+            Release();
+        } else {
+            numElements -= _n;
+            i_read = (i_read + _n) % bufferSize;
+        }
+    }
+
+    /// Return the number of memory slots allocated to the buffer
+    unsigned int GetBufferSize() { return bufferSize; }
+
+    /// Set the buffer size dynamically
+    void SetBufferSize(unsigned int _bufferSize);
+
+    /// Return the number of elements inside the buffer
+    unsigned int GetNumElements() { return numElements; }
+
+    /// \brief Get a pointer to the buffer
+    ///
+    /// This method actually shifts the elements inside the buffer so that instead
+    /// of being cyclical they are linear.
+    T * GetHeadPtr() {
+        Linearize();
+        return headPtr;
+    }
+
+    /// Prints buffer to screen
+    void Print() {
+        std::cout << " b : ";
+        for (unsigned int i=0; i<numElements; i++)
+            std::cout << " " << headPtr[(i_read+i) % bufferSize];
+        std::cout << std::endl;
+    }
+
+  protected:
+    /// Pointer to the beginning of the buffer
+    T * headPtr;
+
+    /// Head index
+    unsigned int i_head;
+
+    /// Read index
+    unsigned int i_read;
+
+    /// Memory slots allocated to the buffer
+    unsigned int bufferSize;
+
+    /// Number of elements currently in the buffer
+    unsigned int numElements;
+
+    /// \brief Linearize buffer array
+    ///
+    /// Shifts the elements in the buffer so that they are organized linearly
+    /// rather than circularly.  If the buffer is not empty, Linearize creates
+    /// a new array and copies the old values.
+    void Linearize();
+
+};
+
+//-----------------------------------------------------------------------------
+//
+// P/N Sequence
+//
+//-----------------------------------------------------------------------------
+
+/// P/N Sequence
+class PNSequence
+{
+  public:
+    /// initializing constructor
+    PNSequence(unsigned int _g, unsigned int _a);
+
+    /// destructor
+    ~PNSequence();
+
+    unsigned long m;    ///< shift register length
+    unsigned long n;    ///< output sequence length, \f$ n=2^m-1 \f$
+    char * g;           ///< generator polynomial
+    char * a;           ///< initial polynomial state
+    char * s;           ///< output sequence
+};
+
+//-----------------------------------------------------------------------------
+//
+// Automatic Gain Control class
+//
+//-----------------------------------------------------------------------------
+/** \brief Automatic gain control signal processor
+ *
+ * \cite  R. G. Lyons, Understanding Digital Signal Processing, 2nd ed. New Jersey:
+ * Prentice Hall, 2004.
+ */
+class AutomaticGainControl
+{
+  public:
+    /// default constructor
+    AutomaticGainControl();
+
+    /// Destructor
+    ~AutomaticGainControl();
+
+    /// Set signal processing values
+    void SetValues(
+            float _elo,
+            float _ehi,
+            float _ka,
+            float _kr,
+            float _gmin,
+            float _gmax);
+
+    /// Get signal processing values
+    void GetValues(
+            float & _elo,
+            float & _ehi,
+            float & _ka,
+            float & _kr,
+            float & _gmin,
+            float & _gmax);
+
+    /// Get status
+    void GetStatus(float & _gain, float & _energy);
+
+    /// track signal energy and apply gain (real)
+    void ApplyGain(short & I);
+
+    /// track signal energy and apply gain (complex)
+    void ApplyGain(short & I, short & Q);
+
+  private:
+    /// disallow copy constructor
+    AutomaticGainControl(AutomaticGainControl &);
+
+    /// compute necessary gain value from measured energy
+    void ComputeGain();
+
+    /// low energy threshold
+    float energy_lo;
+
+    /// high energy threshold
+    float energy_hi;
+
+    /// attack time constant
+    float ka;
+
+    /// release time constant
+    float kr;
+
+    /// minimum gain value
+    float gmin;
+
+    /// maximum gain value
+    float gmax;
+
+    /// actual tracking gain value
+    float gain;
+
+    /// actual tracking average energy value
+    float energy;
+
+    /// low-pass filter coefficient for estimating average energy
+    float zeta;
+
+    /// average energy threshold for smoother tracking
+    float energy_av;
+
+};
+
+class phase_detect {
+
+ public:
+    phase_detect(float scale_factor);
+
+    void do_work(short I_in, short Q_in, short I_nco, short Q_nco, short &out);
+
+ private:
+    phase_detect(const phase_detect &);
+
+    float scale_factor;
+};
+
+
+class nco {
+  public:
+    nco();
+    nco(unsigned int max_out);
+
+    void do_work(short control_voltage, short &sine, short &cosine);
+
+  private:
+    nco(const nco &);
+
+    int freq_index;
+    int max_out;
+};
+
+class gain {
+  public:
+    gain();
+
+    void do_work(float gain, short data_in, short &out);
+
+  private:
+    gain(const gain &);
+
+};
+
+class iir_filter {
+  public:
+    iir_filter(float a[], unsigned int len_a, float b[], unsigned int len_b);
+
+    void do_work(short x, short &y);
+
+    void ResetBuffer();
+
+  private:
+    iir_filter(const iir_filter &);
+
+    float *A;
+    float *B;
+    unsigned int len_A, len_B;
+
+    float *v;
+    unsigned int len_v;
+    unsigned int next_v;
+};
+
+
+//-----------------------------------------------------------------------------
+//
+// FIR polyphase filter bank
+//
+//-----------------------------------------------------------------------------
+/** \brief Finite impulse response (FIR) polyphase filter bank
+ *
+ * This class implementes a finite impulse response (FIR) polyphase filter
+ * bank useful for decimators that need to interpolate samples in digital
+ * receivers.
+ *
+ * The filter bank can automatically calculate filter coefficients for
+ * prototypes commonly used in communications systems. Currently, such
+ * supported filter prototypes are
+ *   - root raised-cosine
+ *
+ * Filter prototypes that will eventually be supported are
+ *   - raised-cosine
+ *   - gaussian
+ *   - triangular
+ *   - hamming
+ *
+ * The user can also load filter coefficients that have been calculated
+ * externally.
+ *
+ * \image latex polyphase_rcos_filter_k2_N4.eps "Example filter bank (1)"
+ * \image html polyphase_rcos_filter_k2_N4.png  "Example filter bank (1)"
+ *
+ * \image latex polyphase_rcos_filter_k4_N2.eps "Example filter bank (2)"
+ * \image html polyphase_rcos_filter_k4_N2.png  "Example filter bank (2)"
+ *
+ * \cite M. Rice and fred harris, "Polyphase Filterbanks for Symbol Timing
+ * Synchronization in Sampled Data Receivers," in MILCOMM Proceedings, vol.
+ * 2, October 2002, pp. 982--986.
+ *
+ */
+class FIRPolyphaseFilterBank {
+  public:
+    /// \brief Initializing constructor
+    ///
+    /// This constructor calculates the filter coefficients for several
+    /// different filter types using just a few parameters.  The filters
+    /// currently supported are:
+    ///   - 'rrcos'  : square-root raised-cosine (RRC)
+    ///   - 'drrcos' : derivative RRC
+    ///
+    FIRPolyphaseFilterBank(
+            char * _type,       // type of filter
+            unsigned int _k,    // samples per symbol
+            unsigned int _m,    // delay
+            float _beta,        // excess bandwidth factor
+            unsigned int _Npfb  // number of filters
+            );
+
+    /// \brief Initializing constructor
+    ///
+    /// This constructor loads filter bank coefficients which have
+    /// been generated externally.  The coefficients are copied from
+    /// the input array to a new buffer.
+    FIRPolyphaseFilterBank(
+            float * _H,         // filter bank coefficients
+            unsigned int _h_len,// length of each filter
+            unsigned int _Npfb  // number of filters
+            );
+
+    /// destructor
+    ~FIRPolyphaseFilterBank();
+
+    /// Push input value into buffer
+    void PushInput(short _x);
+
+    /// Compute filter output from current buffer state using specific
+    /// filter from filter bank matrix
+    void ComputeOutput(
+            short &y,           // output sample
+            unsigned int _b     // filter bank index
+            );
+
+    /// Compute filter output from current buffer state using specific
+    /// filter from filter bank matrix and an external memory buffer
+    void ComputeOutput(
+            short &y,           // output sample
+            unsigned int _b,    // filter bank index
+            short *_v           // external memory buffer array
+            );
+
+    /// Reset filter buffer
+    void ResetBuffer();
+
+    /// Print filter buffer
+    void PrintBuffer();
+
+    /// Prints filter bank coefficients to the screen
+    void PrintFilterBankCoefficients();
+
+    /// Get the length of each filter
+    unsigned int GetFilterLength() { return h_len; }
+
+    /// Get the number of filters in the bank
+    unsigned int GetNumFilters() { return Npfb; }
+
+    /// Return a pointer to the filter bank coefficients; this is intended
+    /// for debugging
+    float * GetFilterBankCoefficients() { return H; }
+
+  protected:
+
+    /// type of filter; can be one of the following
+    ///   - 'rrcos'
+    ///   - 'gaussian'
+    char * type;
+
+    /// samples per symbol
+    unsigned int k;
+
+    /// symbol delay
+    unsigned int m;
+
+    /// excess bandwidth factor
+    float beta;
+
+    /// number of filters in bank
+    unsigned int Npfb;
+
+    /// \brief filter bank coefficients matrix
+    ///
+    /// The coefficients are stored in a one-dimensional array which
+    /// is realized as a two-dimensional matrix.  The array is of
+    /// length Npfb*h_len (the number of filters in the bank times
+    /// the length of each filter).
+    float *H;
+
+    /// length of each filter
+    unsigned int h_len;
+
+    /// circular input buffer
+    CircularBuffer <short> v;
+
+    /// transpose filter bank coefficient matrix
+    void TransposeCoefficientMatrix();
+
+    // ----- calculate filter bank coefficients -----
+
+    /// Calculate root raised-cosine coefficients
+    void CalculateRRCFilterCoefficients();
+
+    /// Calculate Gaussian filter coefficients
+    void CalculateGaussianFilterCoefficients();
+
+    /// \brief Calculate derivative filter coefficients
+    ///
+    /// Approximates the derivative of the template filter
+    /// \f[ \dot{h}(nT) = \frac{\partial h(nT)}{\partial t} \f]
+    ///
+    /// using discrete samples, viz.
+    /// \f[ \dot{h}_m(nT)     = h_{m+1}(nT) - h_{m-1}(nT), \ \ m=1,2,\ldots,...M-2 \f]
+    /// \f[ \dot{h}_0(nT)     = h_{1}(nT) - h_{M-1}(nT)\f]
+    /// \f[ \dot{h}_{M-1}(nT) = h_{M-2}(nT) - h_{0}(nT)\f]
+    ///
+    void CalculateDerivativeFilterCoefficients();
+
+  private:
+
+    /// disallow copy constructor
+    FIRPolyphaseFilterBank(const FIRPolyphaseFilterBank&);
+
+};
+
+
+//-----------------------------------------------------------------------------
+//
+// Dot product definitions
+//
+//-----------------------------------------------------------------------------
+void dot_product(float *x, float *y, unsigned int N, float &z);
+void dot_product(short *x, short *y, unsigned int N, short &z);
+void dot_product(float *x, short *y, unsigned int N, short &z);
+void dot_product(float *x, short *y, unsigned int N, float &z);
+
+//-----------------------------------------------------------------------------
+//
+// Trigonometric functions
+//
+//-----------------------------------------------------------------------------
+void arctan(float &x, float &y, float &theta);
+
+/// Rotates a complex signal counter-clockwise by \f[\theta\f] radians
+/// \f[ \bar{y} = \bar{x} e^{j\theta} \f]
+void rotate(short I_in, short Q_in, float theta, short *I_out, short *Q_out);
+
+//-----------------------------------------------------------------------------
+//
+// Random number generators
+//
+//-----------------------------------------------------------------------------
+
+/// Uniform random number generator, (0,1]
+float randf();
+
+/// Gaussian random number generator, N(0,1)
+void randnf(float * i, float * q);
+
+//-----------------------------------------------------------------------------
+//
+// Byte packing functions
+//
+//-----------------------------------------------------------------------------
+void pack_bytes(
+    unsigned char * input,
+    unsigned int input_length,
+    unsigned char * output,
+    unsigned int output_length,
+    unsigned int *num_written);
+
+void unpack_bytes(
+    unsigned char * input,
+    unsigned int input_length,
+    unsigned char * output,
+    unsigned int output_length,
+    unsigned int *num_written);
+
+void repack_bytes(
+    unsigned char * input,
+    unsigned int input_sym_size,
+    unsigned int input_length,
+    unsigned char * output,
+    unsigned int output_sym_size,
+    unsigned int output_length,
+    unsigned int *num_written);
+
+
+
+
+class fir_filter {
+  public:
+    fir_filter(float a[], unsigned int len_a);
+
+    void do_work(bool run_filter, short in_sample, short &out_sample);
+    void reset();
+
+  private:
+    fir_filter(const fir_filter &);
+
+#ifdef FPM
+    mad_fixed_t *A;
+    mad_fixed_t *v;
+#else
+    float *A;
+    short *v;
+#endif
+    unsigned int len_A;
+
+    unsigned int len_v;
+    unsigned int next_v;
+};
+
+class dump_data {
+ public:
+  dump_data(const char *filename, long start_sample, long number_of_samples);
+  ~dump_data();
+
+  void write_data(float data, const char *msg = "");
+  void write_data(float a, float b, const char *msg = "");
+
+ private:
+  dump_data();
+  dump_data(const dump_data &);
+
+  std::ofstream *out_file;
+
+  long start_sample, stop_sample;
+  long current_sample;
+
+};
+
+class dc_block {
+  public:
+    dc_block(const float forget_factor);
+    ~dc_block();
+
+    void do_work(short in, short &out);
+
+  private:
+    dc_block();
+    dc_block(const dc_block &);
+
+    float forget_factor;
+    int prev_input, prev_output;
+
+};
+
+//-----------------------------------------------------------------------------
+//
+// Circular buffer definitions
+//
+//-----------------------------------------------------------------------------
+
+// Initializing constructor (empty)
+template <class T>
+CircularBuffer<T>::CircularBuffer()
+{
+    bufferSize = 1;
+    numElements = 0;
+    i_head = 0;
+    i_read = 0;
+    headPtr = new T[bufferSize];
+}
+
+// Initializing constructor (empty)
+template <class T>
+CircularBuffer<T>::CircularBuffer(unsigned int _bufferSize) {
+    bufferSize = _bufferSize;
+    numElements = 0;
+    i_head = 0;
+    i_read = 0;
+    headPtr = new T[bufferSize];
+}
+
+// Initializing constructor (array)
+template <class T>
+CircularBuffer<T>::CircularBuffer(T * _v, unsigned int _bufferSize) {
+    bufferSize = _bufferSize;
+    numElements = 0;
+    i_head = 0;
+    i_read = 0;
+    headPtr = new T[bufferSize];
+    for (unsigned int i=0; i<bufferSize; i++)
+        Push( _v[i] );
+}
+
+// Copy constructor
+template <class T>
+CircularBuffer<T>::CircularBuffer(CircularBuffer & _cb) {
+    bufferSize = _cb.bufferSize;
+    numElements = _cb.numElements;
+    i_head = _cb.i_head;
+    i_read = _cb.i_read;
+    headPtr = new T[bufferSize];
+    for (unsigned int i=0; i<bufferSize; i++)
+        headPtr[i] = _cb.headPtr[i];
+}
+
+// Set the buffer size dynamically
+template <class T>
+void CircularBuffer<T>::SetBufferSize(unsigned int _bufferSize) {
+    if ( _bufferSize < 1 ) {
+        std::cerr << "ERROR: SigProc::CircularBuffer::SetBufferSize()" << std::endl
+                  << "  => minimum buffer size is 1" << std::endl;
+        throw 0;
+    }
+
+    if ( _bufferSize == bufferSize ) {
+        // Nothing to do
+        return;
+    } else if ( _bufferSize < bufferSize && numElements > _bufferSize ) {
+        // New buffer is too small: copy only newest elements, discard oldest
+        i_read = ( i_read + numElements - _bufferSize ) % bufferSize;
+        numElements = _bufferSize;
+    } else {
+        // New buffer is sufficiently large: copy everything
+    }
+
+    // allocate new buffer memory
+    T * tmpHeadPtr = new T[_bufferSize];
+
+    for (unsigned int i=0; i<numElements; i++)
+        tmpHeadPtr[i] = headPtr[i_read++ % bufferSize];
+
+    // delete old buffer
+    delete [] headPtr;
+
+    headPtr = tmpHeadPtr;
+    i_head = numElements % bufferSize;
+    i_read = 0;
+
+    bufferSize = _bufferSize;
+}
+
+// Linearize buffer
+template <class T>
+void CircularBuffer<T>::Linearize() {
+    if ( numElements == 0 )
+        return;
+
+    T * tmpHeadPtr = new T[bufferSize];
+
+    for (unsigned int i=0; i<numElements; i++)
+        tmpHeadPtr[i] = headPtr[i_read++ % bufferSize];
+
+    delete [] headPtr;
+    headPtr = tmpHeadPtr;
+    i_head = numElements % bufferSize;
+    i_read = 0;
+}
+
+// enum DemodScheme {
+//     HARD = 0,
+//     SOFT_TRUE = 1,
+//     SOFT_STANDARD = 2,
+//     SOFT_HIGHSNR = 3
+// };
+
+// void DemodQAM(unsigned int M, signed short X, signed short Y, DemodScheme scheme, signed char *bitsOut);
+
+// void DemodPSK(unsigned int M, signed short X, signed short Y, DemodScheme scheme, signed char *bitsOut);
+
+
+///
+enum ModulationScheme {
+        UNKNOWN,                                // Unknown modulation scheme
+        BPSK,   QPSK,   PSK8,   PSK16,          // Phase shift keying
+        DBPSK,  DQPSK,  DPSK8,  DPSK16,         // Differential PSK
+        PAM4,   PAM8,   PAM16,  PAM32,          // Pulse amplitude modulation
+        BFSK,   FSK4,   FSK8,   FSK16,          // Frequency shift keying
+        QAM4, QAM16,  QAM32,  QAM64,  QAM128, QAM256  // Quadrature amplitude modulation
+        };
+
+#define BPSK_LEVEL      10000   ///< BPSK amplitude (RMS=10000)
+#define QPSK_LEVEL      10000   ///< QPSK amplitude (RMS=10000)
+#define QAM4_LEVEL      7071    ///< QAM4 amplitude (RMS=10000)
+#define PSK8_LEVEL_1    7071    ///< Low 8-PSK amplitude (RMS=10000)
+#define PSK8_LEVEL_2    10000   ///< High 8-PSK amplitude (RMS=10000)
+#define QAM16_LEVEL_1   3162    ///< Low 16-QAM amplitude (RMS=10000)
+#define QAM16_LEVEL_2   9487    ///< High 16-QAM amplitude (RMS=10000)
+#define PAM4_LEVEL_1    4472    ///< Low 4-PAM amplitude (RMS=10000)
+#define PAM4_LEVEL_2    13416   ///< High 4-PAM amplitude (RMS=10000)
+
+/// Modulates a symbol into an I/Q pair for binary phase shift keying
+///
+/// \image latex ConstellationBPSK.eps "BPSK constellation"
+/// \image html ConstellationBPSK.png "BPSK constellation"
+void ModulateBPSK(short symbol_in, short &I_out, short &Q_out);
+
+/// Modulates a symbol into an I/Q pair for quadrature phase shift keying
+///
+// \image latex ConstellationQPSK.eps "QPSK constellation"
+// \image html ConstellationQPSK.png "QPSK constellation"
+void ModulateQPSK(short symbol_in, short &I_out, short &Q_out);
+
+/// Modulates a symbol into an I/Q pair for quadrature amplitude shift keying
+///
+/// \image latex ConstellationQAM4.eps "QAM4 constellation"
+/// \image html ConstellationQAM4.png "QAM4 constellation"
+void ModulateQAM4(short symbol_in, short &I_out, short &Q_out);
+
+/// Modulates a symbol into an I/Q pair for 8-ary phase shift keying
+///
+/// \image latex Constellation8PSK.eps "8-PSK constellation"
+/// \image html Constellation8PSK.png "8-PSK constellation"
+void Modulate8PSK(short symbol_in, short &I_out, short &Q_out);
+
+/// Modulates a symbol into an I/Q pair for 16-point quadrature
+/// amplitude modulation
+///
+/// \image latex Constellation16QAM.eps "16-QAM constellation"
+/// \image html Constellation16QAM.png "16-QAM constellation"
+void Modulate16QAM(short symbol_in, short &I_out, short &Q_out);
+
+/// Modulates a symbol into an I/Q pair for 4-ary pulse amplitude
+/// modulation
+///
+/// \image latex Constellation4PAM.eps "4-PAM constellation"
+/// \image html Constellation4PAM.png "4-PAM constellation"
+void Modulate4PAM(short symbol_in, short &I_out, short &Q_out);
+
+
+#define DEMOD_COS_22_5 0.923879532511287
+#define DEMOD_SIN_22_5 0.382683432365090
+
+#define QAM16_THRESHOLD 6324    ///< 16-QAM threshold for RMS=10000 signal
+#define PAM4_THRESHOLD  8944    ///< 4-PAM threshold for RMS=10000 signal
+
+///
+void DemodulateBPSK(short I_in, short Q_in, short &symbol_out);
+
+///
+void DemodulateQPSK(short I_in, short Q_in, short &symbol_out);
+
+///
+void DemodulateQAM4(short I_in, short Q_in, short &symbol_out);
+
+///
+void Demodulate8PSK(short I_in, short Q_in, short &symbol_out);
+
+///
+void Demodulate16QAM(short I_in, short Q_in, short &symbol_out);
+
+///
+void Demodulate4PAM(short I_in, short Q_in, short &symbol_out);
+
+}
+#endif
+
+
Index: /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/ltmain.sh
===================================================================
--- /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/ltmain.sh	(revision 2275)
+++ /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/ltmain.sh	(revision 2275)
@@ -0,0 +1,6425 @@
+# ltmain.sh - Provide generalized library-building support services.
+# NOTE: Changing this file will not affect anything until you rerun configure.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
+# Free Software Foundation, Inc.
+# Originally by Gordon Matzigkeit <gord@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.
+
+basename="s,^.*/,,g"
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
+
+# RH: define SED for historic ltconfig's generated by Libtool 1.3
+[ -z "$SED" ] && SED=sed
+
+# The name of this program:
+progname=`echo "$progpath" | $SED $basename`
+modename="$progname"
+
+# Global variables:
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+
+PROGRAM=ltmain.sh
+PACKAGE=libtool
+VERSION=1.5.6
+TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42)"
+
+
+# Check that we have a working $echo.
+if test "X$1" = X--no-reexec; then
+  # Discard the --no-reexec flag, and continue.
+  shift
+elif test "X$1" = X--fallback-echo; then
+  # Avoid inline document here, it may be left over
+  :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
+  # Yippee, $echo works!
+  :
+else
+  # Restart under the correct shell, and then maybe $echo will work.
+  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+  # used as fallback echo
+  shift
+  cat <<EOF
+$*
+EOF
+  exit $EXIT_SUCCESS
+fi
+
+default_mode=
+help="Try \`$progname --help' for more information."
+magic="%%%MAGIC variable%%%"
+mkdir="mkdir"
+mv="mv -f"
+rm="rm -f"
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed="${SED}"' -e 1s/^X//'
+sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
+# test EBCDIC or ASCII
+case `echo A|tr A '\301'` in
+ A) # EBCDIC based system
+  SP2NL="tr '\100' '\n'"
+  NL2SP="tr '\r\n' '\100\100'"
+  ;;
+ *) # Assume ASCII based system
+  SP2NL="tr '\040' '\012'"
+  NL2SP="tr '\015\012' '\040\040'"
+  ;;
+esac
+
+# NLS nuisances.
+# Only set LANG and LC_ALL to C if already set.
+# These must not be set unconditionally because not all systems understand
+# e.g. LANG=C (notably SCO).
+# We save the old values to restore during execute mode.
+if test "${LC_ALL+set}" = set; then
+  save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
+fi
+if test "${LANG+set}" = set; then
+  save_LANG="$LANG"; LANG=C; export LANG
+fi
+
+# Make sure IFS has a sensible default
+: ${IFS=" 	
+"}
+
+if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+  $echo "$modename: not configured to build any kind of library" 1>&2
+  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
+  exit $EXIT_FAILURE
+fi
+
+# Global variables.
+mode=$default_mode
+nonopt=
+prev=
+prevopt=
+run=
+show="$echo"
+show_help=
+execute_dlfiles=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+
+#####################################
+# Shell function definitions:
+# This seems to be the best place for them
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+func_win32_libid () {
+  win32_libid_type="unknown"
+  win32_fileres=`file -L $1 2>/dev/null`
+  case $win32_fileres in
+  *ar\ archive\ import\ library*) # definitely import
+    win32_libid_type="x86 archive import"
+    ;;
+  *ar\ archive*) # could be an import, or static
+    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
+      $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
+      win32_nmres=`eval $NM -f posix -A $1 | \
+	sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
+      if test "X$win32_nmres" = "Ximport" ; then
+        win32_libid_type="x86 archive import"
+      else
+        win32_libid_type="x86 archive static"
+      fi
+    fi
+    ;;
+  *DLL*)
+    win32_libid_type="x86 DLL"
+    ;;
+  *executable*) # but shell scripts are "executable" too...
+    case $win32_fileres in
+    *MS\ Windows\ PE\ Intel*)
+      win32_libid_type="x86 DLL"
+      ;;
+    esac
+    ;;
+  esac
+  $echo $win32_libid_type
+}
+
+
+# func_infer_tag arg
+# Infer tagged configuration to use if any are available and
+# if one wasn't chosen via the "--tag" command line option.
+# Only attempt this if the compiler in the base compile
+# command doesn't match the default compiler.
+# arg is usually of the form 'gcc ...'
+func_infer_tag () {
+    if test -n "$available_tags" && test -z "$tagname"; then
+      CC_quoted=
+      for arg in $CC; do
+	case $arg in
+	  *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	  arg="\"$arg\""
+	  ;;
+	esac
+	CC_quoted="$CC_quoted $arg"
+      done
+      case $@ in
+      # Blanks in the command may have been stripped by the calling shell,
+      # but not from the CC environment variable when configure was run.
+      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
+      # Blanks at the start of $base_compile will cause this to fail
+      # if we don't check for them as well.
+      *)
+	for z in $available_tags; do
+	  if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+	    # Evaluate the configuration.
+	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+	    CC_quoted=
+	    for arg in $CC; do
+	    # Double-quote args containing other shell metacharacters.
+	    case $arg in
+	      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	      arg="\"$arg\""
+	      ;;
+	    esac
+	    CC_quoted="$CC_quoted $arg"
+	  done
+	    case "$@ " in
+	      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
+	      # The compiler in the base compile command matches
+	      # the one in the tagged configuration.
+	      # Assume this is the tagged configuration we want.
+	      tagname=$z
+	      break
+	      ;;
+	    esac
+	  fi
+	done
+	# If $tagname still isn't set, then no tagged configuration
+	# was found and let the user know that the "--tag" command
+	# line option must be used.
+	if test -z "$tagname"; then
+	  $echo "$modename: unable to infer tagged configuration"
+	  $echo "$modename: specify a tag with \`--tag'" 1>&2
+	  exit $EXIT_FAILURE
+#        else
+#          $echo "$modename: using $tagname tagged configuration"
+	fi
+	;;
+      esac
+    fi
+}
+# End of Shell function definitions
+#####################################
+
+# Darwin sucks
+eval std_shrext=\"$shrext_cmds\"
+
+# Parse our command line options once, thoroughly.
+while test "$#" -gt 0
+do
+  arg="$1"
+  shift
+
+  case $arg in
+  -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
+  *) optarg= ;;
+  esac
+
+  # If the previous option needs an argument, assign it.
+  if test -n "$prev"; then
+    case $prev in
+    execute_dlfiles)
+      execute_dlfiles="$execute_dlfiles $arg"
+      ;;
+    tag)
+      tagname="$arg"
+      preserve_args="${preserve_args}=$arg"
+
+      # Check whether tagname contains only valid characters
+      case $tagname in
+      *[!-_A-Za-z0-9,/]*)
+	$echo "$progname: invalid tag name: $tagname" 1>&2
+	exit $EXIT_FAILURE
+	;;
+      esac
+
+      case $tagname in
+      CC)
+	# Don't test for the "default" C tag, as we know, it's there, but
+	# not specially marked.
+	;;
+      *)
+	if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
+	  taglist="$taglist $tagname"
+	  # Evaluate the configuration.
+	  eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
+	else
+	  $echo "$progname: ignoring unknown tag $tagname" 1>&2
+	fi
+	;;
+      esac
+      ;;
+    *)
+      eval "$prev=\$arg"
+      ;;
+    esac
+
+    prev=
+    prevopt=
+    continue
+  fi
+
+  # Have we seen a non-optional argument yet?
+  case $arg in
+  --help)
+    show_help=yes
+    ;;
+
+  --version)
+    $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
+    $echo
+    $echo "Copyright (C) 2003  Free Software Foundation, Inc."
+    $echo "This is free software; see the source for copying conditions.  There is NO"
+    $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+    exit $EXIT_SUCCESS
+    ;;
+
+  --config)
+    ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
+    # Now print the configurations for the tags.
+    for tagname in $taglist; do
+      ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
+    done
+    exit $EXIT_SUCCESS
+    ;;
+
+  --debug)
+    $echo "$progname: enabling shell trace mode"
+    set -x
+    preserve_args="$preserve_args $arg"
+    ;;
+
+  --dry-run | -n)
+    run=:
+    ;;
+
+  --features)
+    $echo "host: $host"
+    if test "$build_libtool_libs" = yes; then
+      $echo "enable shared libraries"
+    else
+      $echo "disable shared libraries"
+    fi
+    if test "$build_old_libs" = yes; then
+      $echo "enable static libraries"
+    else
+      $echo "disable static libraries"
+    fi
+    exit $EXIT_SUCCESS
+    ;;
+
+  --finish) mode="finish" ;;
+
+  --mode) prevopt="--mode" prev=mode ;;
+  --mode=*) mode="$optarg" ;;
+
+  --preserve-dup-deps) duplicate_deps="yes" ;;
+
+  --quiet | --silent)
+    show=:
+    preserve_args="$preserve_args $arg"
+    ;;
+
+  --tag) prevopt="--tag" prev=tag ;;
+  --tag=*)
+    set tag "$optarg" ${1+"$@"}
+    shift
+    prev=tag
+    preserve_args="$preserve_args --tag"
+    ;;
+
+  -dlopen)
+    prevopt="-dlopen"
+    prev=execute_dlfiles
+    ;;
+
+  -*)
+    $echo "$modename: unrecognized option \`$arg'" 1>&2
+    $echo "$help" 1>&2
+    exit $EXIT_FAILURE
+    ;;
+
+  *)
+    nonopt="$arg"
+    break
+    ;;
+  esac
+done
+
+if test -n "$prevopt"; then
+  $echo "$modename: option \`$prevopt' requires an argument" 1>&2
+  $echo "$help" 1>&2
+  exit $EXIT_FAILURE
+fi
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end.  This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+if test -z "$show_help"; then
+
+  # Infer the operation mode.
+  if test -z "$mode"; then
+    $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
+    $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
+    case $nonopt in
+    *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
+      mode=link
+      for arg
+      do
+	case $arg in
+	-c)
+	   mode=compile
+	   break
+	   ;;
+	esac
+      done
+      ;;
+    *db | *dbx | *strace | *truss)
+      mode=execute
+      ;;
+    *install*|cp|mv)
+      mode=install
+      ;;
+    *rm)
+      mode=uninstall
+      ;;
+    *)
+      # If we have no mode, but dlfiles were specified, then do execute mode.
+      test -n "$execute_dlfiles" && mode=execute
+
+      # Just use the default operation mode.
+      if test -z "$mode"; then
+	if test -n "$nonopt"; then
+	  $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
+	else
+	  $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
+	fi
+      fi
+      ;;
+    esac
+  fi
+
+  # Only execute mode is allowed to have -dlopen flags.
+  if test -n "$execute_dlfiles" && test "$mode" != execute; then
+    $echo "$modename: unrecognized option \`-dlopen'" 1>&2
+    $echo "$help" 1>&2
+    exit $EXIT_FAILURE
+  fi
+
+  # Change the help message to a mode-specific one.
+  generic_help="$help"
+  help="Try \`$modename --help --mode=$mode' for more information."
+
+  # These modes are in order of execution frequency so that they run quickly.
+  case $mode in
+  # libtool compile mode
+  compile)
+    modename="$modename: compile"
+    # Get the compilation command and the source file.
+    base_compile=
+    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
+    suppress_opt=yes
+    suppress_output=
+    arg_mode=normal
+    libobj=
+    later=
+
+    for arg
+    do
+      case "$arg_mode" in
+      arg  )
+	# do not "continue".  Instead, add this to base_compile
+	lastarg="$arg"
+	arg_mode=normal
+	;;
+
+      target )
+	libobj="$arg"
+	arg_mode=normal
+	continue
+	;;
+
+      normal )
+	# Accept any command-line options.
+	case $arg in
+	-o)
+	  if test -n "$libobj" ; then
+	    $echo "$modename: you cannot specify \`-o' more than once" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+	  arg_mode=target
+	  continue
+	  ;;
+
+	-static | -prefer-pic | -prefer-non-pic)
+	  later="$later $arg"
+	  continue
+	  ;;
+
+	-no-suppress)
+	  suppress_opt=no
+	  continue
+	  ;;
+
+	-Xcompiler)
+	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
+	  continue      #  The current "srcfile" will either be retained or
+	  ;;            #  replaced later.  I would guess that would be a bug.
+
+	-Wc,*)
+	  args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
+	  lastarg=
+	  save_ifs="$IFS"; IFS=','
+ 	  for arg in $args; do
+	    IFS="$save_ifs"
+
+	    # Double-quote args containing other shell metacharacters.
+	    # Many Bourne shells cannot handle close brackets correctly
+	    # in scan sets, so we specify it separately.
+	    case $arg in
+	      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	      arg="\"$arg\""
+	      ;;
+	    esac
+	    lastarg="$lastarg $arg"
+	  done
+	  IFS="$save_ifs"
+	  lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
+
+	  # Add the arguments to base_compile.
+	  base_compile="$base_compile $lastarg"
+	  continue
+	  ;;
+
+	* )
+	  # Accept the current argument as the source file.
+	  # The previous "srcfile" becomes the current argument.
+	  #
+	  lastarg="$srcfile"
+	  srcfile="$arg"
+	  ;;
+	esac  #  case $arg
+	;;
+      esac    #  case $arg_mode
+
+      # Aesthetically quote the previous argument.
+      lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
+
+      case $lastarg in
+      # Double-quote args containing other shell metacharacters.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	lastarg="\"$lastarg\""
+	;;
+      esac
+
+      base_compile="$base_compile $lastarg"
+    done # for arg
+
+    case $arg_mode in
+    arg)
+      $echo "$modename: you must specify an argument for -Xcompile"
+      exit $EXIT_FAILURE
+      ;;
+    target)
+      $echo "$modename: you must specify a target with \`-o'" 1>&2
+      exit $EXIT_FAILURE
+      ;;
+    *)
+      # Get the name of the library object.
+      [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
+      ;;
+    esac
+
+    # Recognize several different file suffixes.
+    # If the user specifies -o file.o, it is replaced with file.lo
+    xform='[cCFSifmso]'
+    case $libobj in
+    *.ada) xform=ada ;;
+    *.adb) xform=adb ;;
+    *.ads) xform=ads ;;
+    *.asm) xform=asm ;;
+    *.c++) xform=c++ ;;
+    *.cc) xform=cc ;;
+    *.ii) xform=ii ;;
+    *.class) xform=class ;;
+    *.cpp) xform=cpp ;;
+    *.cxx) xform=cxx ;;
+    *.f90) xform=f90 ;;
+    *.for) xform=for ;;
+    *.java) xform=java ;;
+    esac
+
+    libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
+
+    case $libobj in
+    *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
+    *)
+      $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
+      exit $EXIT_FAILURE
+      ;;
+    esac
+
+    func_infer_tag $base_compile
+
+    for arg in $later; do
+      case $arg in
+      -static)
+	build_old_libs=yes
+	continue
+	;;
+
+      -prefer-pic)
+	pic_mode=yes
+	continue
+	;;
+
+      -prefer-non-pic)
+	pic_mode=no
+	continue
+	;;
+      esac
+    done
+
+    objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+    xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
+    if test "X$xdir" = "X$obj"; then
+      xdir=
+    else
+      xdir=$xdir/
+    fi
+    lobj=${xdir}$objdir/$objname
+
+    if test -z "$base_compile"; then
+      $echo "$modename: you must specify a compilation command" 1>&2
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
+
+    # Delete any leftover library objects.
+    if test "$build_old_libs" = yes; then
+      removelist="$obj $lobj $libobj ${libobj}T"
+    else
+      removelist="$lobj $libobj ${libobj}T"
+    fi
+
+    $run $rm $removelist
+    trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
+
+    # On Cygwin there's no "real" PIC flag so we must build both object types
+    case $host_os in
+    cygwin* | mingw* | pw32* | os2*)
+      pic_mode=default
+      ;;
+    esac
+    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+      # non-PIC code in shared libraries is not supported
+      pic_mode=default
+    fi
+
+    # Calculate the filename of the output object if compiler does
+    # not support -o with -c
+    if test "$compiler_c_o" = no; then
+      output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
+      lockfile="$output_obj.lock"
+      removelist="$removelist $output_obj $lockfile"
+      trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
+    else
+      output_obj=
+      need_locks=no
+      lockfile=
+    fi
+
+    # Lock this critical section if it is needed
+    # We use this script file to make the link, it avoids creating a new file
+    if test "$need_locks" = yes; then
+      until $run ln "$progpath" "$lockfile" 2>/dev/null; do
+	$show "Waiting for $lockfile to be removed"
+	sleep 2
+      done
+    elif test "$need_locks" = warn; then
+      if test -f "$lockfile"; then
+	$echo "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$run $rm $removelist
+	exit $EXIT_FAILURE
+      fi
+      $echo $srcfile > "$lockfile"
+    fi
+
+    if test -n "$fix_srcfile_path"; then
+      eval srcfile=\"$fix_srcfile_path\"
+    fi
+
+    $run $rm "$libobj" "${libobj}T"
+
+    # Create a libtool object file (analogous to a ".la" file),
+    # but don't create it if we're doing a dry run.
+    test -z "$run" && cat > ${libobj}T <<EOF
+# $libobj - a libtool object file
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+EOF
+
+    # Only build a PIC object if we are building libtool libraries.
+    if test "$build_libtool_libs" = yes; then
+      # Without this assignment, base_compile gets emptied.
+      fbsd_hideous_sh_bug=$base_compile
+
+      if test "$pic_mode" != no; then
+	command="$base_compile $srcfile $pic_flag"
+      else
+	# Don't build PIC code
+	command="$base_compile $srcfile"
+      fi
+
+      if test ! -d "${xdir}$objdir"; then
+	$show "$mkdir ${xdir}$objdir"
+	$run $mkdir ${xdir}$objdir
+	status=$?
+	if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
+	  exit $status
+	fi
+      fi
+
+      if test -z "$output_obj"; then
+	# Place PIC objects in $objdir
+	command="$command -o $lobj"
+      fi
+
+      $run $rm "$lobj" "$output_obj"
+
+      $show "$command"
+      if $run eval "$command"; then :
+      else
+	test -n "$output_obj" && $run $rm $removelist
+	exit $EXIT_FAILURE
+      fi
+
+      if test "$need_locks" = warn &&
+	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+	$echo "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$run $rm $removelist
+	exit $EXIT_FAILURE
+      fi
+
+      # Just move the object if needed, then go on to compile the next one
+      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+	$show "$mv $output_obj $lobj"
+	if $run $mv $output_obj $lobj; then :
+	else
+	  error=$?
+	  $run $rm $removelist
+	  exit $error
+	fi
+      fi
+
+      # Append the name of the PIC object to the libtool object file.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+pic_object='$objdir/$objname'
+
+EOF
+
+      # Allow error messages only from the first compilation.
+      if test "$suppress_opt" = yes; then
+        suppress_output=' >/dev/null 2>&1'
+      fi
+    else
+      # No PIC object so indicate it doesn't exist in the libtool
+      # object file.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+pic_object=none
+
+EOF
+    fi
+
+    # Only build a position-dependent object if we build old libraries.
+    if test "$build_old_libs" = yes; then
+      if test "$pic_mode" != yes; then
+	# Don't build PIC code
+	command="$base_compile $srcfile"
+      else
+	command="$base_compile $srcfile $pic_flag"
+      fi
+      if test "$compiler_c_o" = yes; then
+	command="$command -o $obj"
+      fi
+
+      # Suppress compiler output if we already did a PIC compilation.
+      command="$command$suppress_output"
+      $run $rm "$obj" "$output_obj"
+      $show "$command"
+      if $run eval "$command"; then :
+      else
+	$run $rm $removelist
+	exit $EXIT_FAILURE
+      fi
+
+      if test "$need_locks" = warn &&
+	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+	$echo "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$run $rm $removelist
+	exit $EXIT_FAILURE
+      fi
+
+      # Just move the object if needed
+      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+	$show "$mv $output_obj $obj"
+	if $run $mv $output_obj $obj; then :
+	else
+	  error=$?
+	  $run $rm $removelist
+	  exit $error
+	fi
+      fi
+
+      # Append the name of the non-PIC object the libtool object file.
+      # Only append if the libtool object file exists.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+# Name of the non-PIC object.
+non_pic_object='$objname'
+
+EOF
+    else
+      # Append the name of the non-PIC object the libtool object file.
+      # Only append if the libtool object file exists.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+# Name of the non-PIC object.
+non_pic_object=none
+
+EOF
+    fi
+
+    $run $mv "${libobj}T" "${libobj}"
+
+    # Unlock the critical section if it was locked
+    if test "$need_locks" != no; then
+      $run $rm "$lockfile"
+    fi
+
+    exit $EXIT_SUCCESS
+    ;;
+
+  # libtool link mode
+  link | relink)
+    modename="$modename: link"
+    case $host in
+    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+      # It is impossible to link a dll without this setting, and
+      # we shouldn't force the makefile maintainer to figure out
+      # which system we are compiling for in order to pass an extra
+      # flag for every libtool invocation.
+      # allow_undefined=no
+
+      # FIXME: Unfortunately, there are problems with the above when trying
+      # to make a dll which has undefined symbols, in which case not
+      # even a static library is built.  For now, we need to specify
+      # -no-undefined on the libtool link line when we can be certain
+      # that all symbols are satisfied, otherwise we get a static library.
+      allow_undefined=yes
+      ;;
+    *)
+      allow_undefined=yes
+      ;;
+    esac
+    libtool_args="$nonopt"
+    base_compile="$nonopt $@"
+    compile_command="$nonopt"
+    finalize_command="$nonopt"
+
+    compile_rpath=
+    finalize_rpath=
+    compile_shlibpath=
+    finalize_shlibpath=
+    convenience=
+    old_convenience=
+    deplibs=
+    old_deplibs=
+    compiler_flags=
+    linker_flags=
+    dllsearchpath=
+    lib_search_path=`pwd`
+    inst_prefix_dir=
+
+    avoid_version=no
+    dlfiles=
+    dlprefiles=
+    dlself=no
+    export_dynamic=no
+    export_symbols=
+    export_symbols_regex=
+    generated=
+    libobjs=
+    ltlibs=
+    module=no
+    no_install=no
+    objs=
+    non_pic_objects=
+    precious_files_regex=
+    prefer_static_libs=no
+    preload=no
+    prev=
+    prevarg=
+    release=
+    rpath=
+    xrpath=
+    perm_rpath=
+    temp_rpath=
+    thread_safe=no
+    vinfo=
+    vinfo_number=no
+
+    func_infer_tag $base_compile
+
+    # We need to know -static, to get the right output filenames.
+    for arg
+    do
+      case $arg in
+      -all-static | -static)
+	if test "X$arg" = "X-all-static"; then
+	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+	    $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
+	  fi
+	  if test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	else
+	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	fi
+	build_libtool_libs=no
+	build_old_libs=yes
+	prefer_static_libs=yes
+	break
+	;;
+      esac
+    done
+
+    # See if our shared archives depend on static archives.
+    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+    # Go through the arguments, transforming them on the way.
+    while test "$#" -gt 0; do
+      arg="$1"
+      shift
+      case $arg in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
+	;;
+      *) qarg=$arg ;;
+      esac
+      libtool_args="$libtool_args $qarg"
+
+      # If the previous option needs an argument, assign it.
+      if test -n "$prev"; then
+	case $prev in
+	output)
+	  compile_command="$compile_command @OUTPUT@"
+	  finalize_command="$finalize_command @OUTPUT@"
+	  ;;
+	esac
+
+	case $prev in
+	dlfiles|dlprefiles)
+	  if test "$preload" = no; then
+	    # Add the symbol object into the linking commands.
+	    compile_command="$compile_command @SYMFILE@"
+	    finalize_command="$finalize_command @SYMFILE@"
+	    preload=yes
+	  fi
+	  case $arg in
+	  *.la | *.lo) ;;  # We handle these cases below.
+	  force)
+	    if test "$dlself" = no; then
+	      dlself=needless
+	      export_dynamic=yes
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  self)
+	    if test "$prev" = dlprefiles; then
+	      dlself=yes
+	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+	      dlself=yes
+	    else
+	      dlself=needless
+	      export_dynamic=yes
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  *)
+	    if test "$prev" = dlfiles; then
+	      dlfiles="$dlfiles $arg"
+	    else
+	      dlprefiles="$dlprefiles $arg"
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  esac
+	  ;;
+	expsyms)
+	  export_symbols="$arg"
+	  if test ! -f "$arg"; then
+	    $echo "$modename: symbol file \`$arg' does not exist"
+	    exit $EXIT_FAILURE
+	  fi
+	  prev=
+	  continue
+	  ;;
+	expsyms_regex)
+	  export_symbols_regex="$arg"
+	  prev=
+	  continue
+	  ;;
+	inst_prefix)
+	  inst_prefix_dir="$arg"
+	  prev=
+	  continue
+	  ;;
+	precious_regex)
+	  precious_files_regex="$arg"
+	  prev=
+	  continue
+	  ;;
+	release)
+	  release="-$arg"
+	  prev=
+	  continue
+	  ;;
+	objectlist)
+	  if test -f "$arg"; then
+	    save_arg=$arg
+	    moreargs=
+	    for fil in `cat $save_arg`
+	    do
+#	      moreargs="$moreargs $fil"
+	      arg=$fil
+	      # A libtool-controlled object.
+
+	      # Check to see that this really is a libtool object.
+	      if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+		pic_object=
+		non_pic_object=
+
+		# Read the .lo file
+		# If there is no directory component, then add one.
+		case $arg in
+		*/* | *\\*) . $arg ;;
+		*) . ./$arg ;;
+		esac
+
+		if test -z "$pic_object" || \
+		   test -z "$non_pic_object" ||
+		   test "$pic_object" = none && \
+		   test "$non_pic_object" = none; then
+		  $echo "$modename: cannot find name of object for \`$arg'" 1>&2
+		  exit $EXIT_FAILURE
+		fi
+
+		# Extract subdirectory from the argument.
+		xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+		if test "X$xdir" = "X$arg"; then
+		  xdir=
+		else
+		  xdir="$xdir/"
+		fi
+
+		if test "$pic_object" != none; then
+		  # Prepend the subdirectory the object is found in.
+		  pic_object="$xdir$pic_object"
+
+		  if test "$prev" = dlfiles; then
+		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+		      dlfiles="$dlfiles $pic_object"
+		      prev=
+		      continue
+		    else
+		      # If libtool objects are unsupported, then we need to preload.
+		      prev=dlprefiles
+		    fi
+		  fi
+
+		  # CHECK ME:  I think I busted this.  -Ossama
+		  if test "$prev" = dlprefiles; then
+		    # Preload the old-style object.
+		    dlprefiles="$dlprefiles $pic_object"
+		    prev=
+		  fi
+
+		  # A PIC object.
+		  libobjs="$libobjs $pic_object"
+		  arg="$pic_object"
+		fi
+
+		# Non-PIC object.
+		if test "$non_pic_object" != none; then
+		  # Prepend the subdirectory the object is found in.
+		  non_pic_object="$xdir$non_pic_object"
+
+		  # A standard non-PIC object
+		  non_pic_objects="$non_pic_objects $non_pic_object"
+		  if test -z "$pic_object" || test "$pic_object" = none ; then
+		    arg="$non_pic_object"
+		  fi
+		fi
+	      else
+		# Only an error if not doing a dry-run.
+		if test -z "$run"; then
+		  $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
+		  exit $EXIT_FAILURE
+		else
+		  # Dry-run case.
+
+		  # Extract subdirectory from the argument.
+		  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+		  if test "X$xdir" = "X$arg"; then
+		    xdir=
+		  else
+		    xdir="$xdir/"
+		  fi
+
+		  pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
+		  non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+		  libobjs="$libobjs $pic_object"
+		  non_pic_objects="$non_pic_objects $non_pic_object"
+		fi
+	      fi
+	    done
+	  else
+	    $echo "$modename: link input file \`$save_arg' does not exist"
+	    exit $EXIT_FAILURE
+	  fi
+	  arg=$save_arg
+	  prev=
+	  continue
+	  ;;
+	rpath | xrpath)
+	  # We need an absolute path.
+	  case $arg in
+	  [\\/]* | [A-Za-z]:[\\/]*) ;;
+	  *)
+	    $echo "$modename: only absolute run-paths are allowed" 1>&2
+	    exit $EXIT_FAILURE
+	    ;;
+	  esac
+	  if test "$prev" = rpath; then
+	    case "$rpath " in
+	    *" $arg "*) ;;
+	    *) rpath="$rpath $arg" ;;
+	    esac
+	  else
+	    case "$xrpath " in
+	    *" $arg "*) ;;
+	    *) xrpath="$xrpath $arg" ;;
+	    esac
+	  fi
+	  prev=
+	  continue
+	  ;;
+	xcompiler)
+	  compiler_flags="$compiler_flags $qarg"
+	  prev=
+	  compile_command="$compile_command $qarg"
+	  finalize_command="$finalize_command $qarg"
+	  continue
+	  ;;
+	xlinker)
+	  linker_flags="$linker_flags $qarg"
+	  compiler_flags="$compiler_flags $wl$qarg"
+	  prev=
+	  compile_command="$compile_command $wl$qarg"
+	  finalize_command="$finalize_command $wl$qarg"
+	  continue
+	  ;;
+	xcclinker)
+	  linker_flags="$linker_flags $qarg"
+	  compiler_flags="$compiler_flags $qarg"
+	  prev=
+	  compile_command="$compile_command $qarg"
+	  finalize_command="$finalize_command $qarg"
+	  continue
+	  ;;
+	shrext)
+  	  shrext_cmds="$arg"
+	  prev=
+	  continue
+	  ;;
+	*)
+	  eval "$prev=\"\$arg\""
+	  prev=
+	  continue
+	  ;;
+	esac
+      fi # test -n "$prev"
+
+      prevarg="$arg"
+
+      case $arg in
+      -all-static)
+	if test -n "$link_static_flag"; then
+	  compile_command="$compile_command $link_static_flag"
+	  finalize_command="$finalize_command $link_static_flag"
+	fi
+	continue
+	;;
+
+      -allow-undefined)
+	# FIXME: remove this flag sometime in the future.
+	$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
+	continue
+	;;
+
+      -avoid-version)
+	avoid_version=yes
+	continue
+	;;
+
+      -dlopen)
+	prev=dlfiles
+	continue
+	;;
+
+      -dlpreopen)
+	prev=dlprefiles
+	continue
+	;;
+
+      -export-dynamic)
+	export_dynamic=yes
+	continue
+	;;
+
+      -export-symbols | -export-symbols-regex)
+	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+	  $echo "$modename: more than one -exported-symbols argument is not allowed"
+	  exit $EXIT_FAILURE
+	fi
+	if test "X$arg" = "X-export-symbols"; then
+	  prev=expsyms
+	else
+	  prev=expsyms_regex
+	fi
+	continue
+	;;
+
+      -inst-prefix-dir)
+	prev=inst_prefix
+	continue
+	;;
+
+      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+      # so, if we see these flags be careful not to treat them like -L
+      -L[A-Z][A-Z]*:*)
+	case $with_gcc/$host in
+	no/*-*-irix* | /*-*-irix*)
+	  compile_command="$compile_command $arg"
+	  finalize_command="$finalize_command $arg"
+	  ;;
+	esac
+	continue
+	;;
+
+      -L*)
+	dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
+	# We need an absolute path.
+	case $dir in
+	[\\/]* | [A-Za-z]:[\\/]*) ;;
+	*)
+	  absdir=`cd "$dir" && pwd`
+	  if test -z "$absdir"; then
+	    $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+	  dir="$absdir"
+	  ;;
+	esac
+	case "$deplibs " in
+	*" -L$dir "*) ;;
+	*)
+	  deplibs="$deplibs -L$dir"
+	  lib_search_path="$lib_search_path $dir"
+	  ;;
+	esac
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+	  case :$dllsearchpath: in
+	  *":$dir:"*) ;;
+	  *) dllsearchpath="$dllsearchpath:$dir";;
+	  esac
+	  ;;
+	esac
+	continue
+	;;
+
+      -l*)
+	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+	  case $host in
+	  *-*-cygwin* | *-*-pw32* | *-*-beos*)
+	    # These systems don't actually have a C or math library (as such)
+	    continue
+	    ;;
+	  *-*-mingw* | *-*-os2*)
+	    # These systems don't actually have a C library (as such)
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  *-*-openbsd* | *-*-freebsd*)
+	    # Do not include libc due to us having libc/libc_r.
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  *-*-rhapsody* | *-*-darwin1.[012])
+	    # Rhapsody C and math libraries are in the System framework
+	    deplibs="$deplibs -framework System"
+	    continue
+	  esac
+	elif test "X$arg" = "X-lc_r"; then
+	 case $host in
+	 *-*-openbsd* | *-*-freebsd*)
+	   # Do not include libc_r directly, use -pthread flag.
+	   continue
+	   ;;
+	 esac
+	fi
+	deplibs="$deplibs $arg"
+	continue
+	;;
+
+     -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
+	deplibs="$deplibs $arg"
+	continue
+	;;
+
+      -module)
+	module=yes
+	continue
+	;;
+
+      # gcc -m* arguments should be passed to the linker via $compiler_flags
+      # in order to pass architecture information to the linker
+      # (e.g. 32 vs 64-bit).  This may also be accomplished via -Wl,-mfoo
+      # but this is not reliable with gcc because gcc may use -mfoo to
+      # select a different linker, different libraries, etc, while
+      # -Wl,-mfoo simply passes -mfoo to the linker.
+      -m*)
+	# Unknown arguments in both finalize_command and compile_command need
+	# to be aesthetically quoted because they are evaled later.
+	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+	case $arg in
+	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	  arg="\"$arg\""
+	  ;;
+	esac
+        compile_command="$compile_command $arg"
+        finalize_command="$finalize_command $arg"
+        if test "$with_gcc" = "yes" ; then
+          compiler_flags="$compiler_flags $arg"
+        fi
+        continue
+        ;;
+
+      -shrext)
+	prev=shrext
+	continue
+	;;
+
+      -no-fast-install)
+	fast_install=no
+	continue
+	;;
+
+      -no-install)
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+	  # The PATH hackery in wrapper scripts is required on Windows
+	  # in order for the loader to find any dlls it needs.
+	  $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
+	  $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
+	  fast_install=no
+	  ;;
+	*) no_install=yes ;;
+	esac
+	continue
+	;;
+
+      -no-undefined)
+	allow_undefined=no
+	continue
+	;;
+
+      -objectlist)
+	prev=objectlist
+	continue
+	;;
+
+      -o) prev=output ;;
+
+      -precious-files-regex)
+	prev=precious_regex
+	continue
+	;;
+
+      -release)
+	prev=release
+	continue
+	;;
+
+      -rpath)
+	prev=rpath
+	continue
+	;;
+
+      -R)
+	prev=xrpath
+	continue
+	;;
+
+      -R*)
+	dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
+	# We need an absolute path.
+	case $dir in
+	[\\/]* | [A-Za-z]:[\\/]*) ;;
+	*)
+	  $echo "$modename: only absolute run-paths are allowed" 1>&2
+	  exit $EXIT_FAILURE
+	  ;;
+	esac
+	case "$xrpath " in
+	*" $dir "*) ;;
+	*) xrpath="$xrpath $dir" ;;
+	esac
+	continue
+	;;
+
+      -static)
+	# The effects of -static are defined in a previous loop.
+	# We used to do the same as -all-static on platforms that
+	# didn't have a PIC flag, but the assumption that the effects
+	# would be equivalent was wrong.  It would break on at least
+	# Digital Unix and AIX.
+	continue
+	;;
+
+      -thread-safe)
+	thread_safe=yes
+	continue
+	;;
+
+      -version-info)
+	prev=vinfo
+	continue
+	;;
+      -version-number)
+	prev=vinfo
+	vinfo_number=yes
+	continue
+	;;
+
+      -Wc,*)
+	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
+	arg=
+	save_ifs="$IFS"; IFS=','
+	for flag in $args; do
+	  IFS="$save_ifs"
+	  case $flag in
+	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	    flag="\"$flag\""
+	    ;;
+	  esac
+	  arg="$arg $wl$flag"
+	  compiler_flags="$compiler_flags $flag"
+	done
+	IFS="$save_ifs"
+	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
+	;;
+
+      -Wl,*)
+	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
+	arg=
+	save_ifs="$IFS"; IFS=','
+	for flag in $args; do
+	  IFS="$save_ifs"
+	  case $flag in
+	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	    flag="\"$flag\""
+	    ;;
+	  esac
+	  arg="$arg $wl$flag"
+	  compiler_flags="$compiler_flags $wl$flag"
+	  linker_flags="$linker_flags $flag"
+	done
+	IFS="$save_ifs"
+	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
+	;;
+
+      -Xcompiler)
+	prev=xcompiler
+	continue
+	;;
+
+      -Xlinker)
+	prev=xlinker
+	continue
+	;;
+
+      -XCClinker)
+	prev=xcclinker
+	continue
+	;;
+
+      # Some other compiler flag.
+      -* | +*)
+	# Unknown arguments in both finalize_command and compile_command need
+	# to be aesthetically quoted because they are evaled later.
+	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+	case $arg in
+	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	  arg="\"$arg\""
+	  ;;
+	esac
+	;;
+
+      *.$objext)
+	# A standard object.
+	objs="$objs $arg"
+	;;
+
+      *.lo)
+	# A libtool-controlled object.
+
+	# Check to see that this really is a libtool object.
+	if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	  pic_object=
+	  non_pic_object=
+
+	  # Read the .lo file
+	  # If there is no directory component, then add one.
+	  case $arg in
+	  */* | *\\*) . $arg ;;
+	  *) . ./$arg ;;
+	  esac
+
+	  if test -z "$pic_object" || \
+	     test -z "$non_pic_object" ||
+	     test "$pic_object" = none && \
+	     test "$non_pic_object" = none; then
+	    $echo "$modename: cannot find name of object for \`$arg'" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+
+	  # Extract subdirectory from the argument.
+	  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+	  if test "X$xdir" = "X$arg"; then
+	    xdir=
+ 	  else
+	    xdir="$xdir/"
+	  fi
+
+	  if test "$pic_object" != none; then
+	    # Prepend the subdirectory the object is found in.
+	    pic_object="$xdir$pic_object"
+
+	    if test "$prev" = dlfiles; then
+	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+		dlfiles="$dlfiles $pic_object"
+		prev=
+		continue
+	      else
+		# If libtool objects are unsupported, then we need to preload.
+		prev=dlprefiles
+	      fi
+	    fi
+
+	    # CHECK ME:  I think I busted this.  -Ossama
+	    if test "$prev" = dlprefiles; then
+	      # Preload the old-style object.
+	      dlprefiles="$dlprefiles $pic_object"
+	      prev=
+	    fi
+
+	    # A PIC object.
+	    libobjs="$libobjs $pic_object"
+	    arg="$pic_object"
+	  fi
+
+	  # Non-PIC object.
+	  if test "$non_pic_object" != none; then
+	    # Prepend the subdirectory the object is found in.
+	    non_pic_object="$xdir$non_pic_object"
+
+	    # A standard non-PIC object
+	    non_pic_objects="$non_pic_objects $non_pic_object"
+	    if test -z "$pic_object" || test "$pic_object" = none ; then
+	      arg="$non_pic_object"
+	    fi
+	  fi
+	else
+	  # Only an error if not doing a dry-run.
+	  if test -z "$run"; then
+	    $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
+	    exit $EXIT_FAILURE
+	  else
+	    # Dry-run case.
+
+	    # Extract subdirectory from the argument.
+	    xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+	    if test "X$xdir" = "X$arg"; then
+	      xdir=
+	    else
+	      xdir="$xdir/"
+	    fi
+
+	    pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
+	    non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+	    libobjs="$libobjs $pic_object"
+	    non_pic_objects="$non_pic_objects $non_pic_object"
+	  fi
+	fi
+	;;
+
+      *.$libext)
+	# An archive.
+	deplibs="$deplibs $arg"
+	old_deplibs="$old_deplibs $arg"
+	continue
+	;;
+
+      *.la)
+	# A libtool-controlled library.
+
+	if test "$prev" = dlfiles; then
+	  # This library was specified with -dlopen.
+	  dlfiles="$dlfiles $arg"
+	  prev=
+	elif test "$prev" = dlprefiles; then
+	  # The library was specified with -dlpreopen.
+	  dlprefiles="$dlprefiles $arg"
+	  prev=
+	else
+	  deplibs="$deplibs $arg"
+	fi
+	continue
+	;;
+
+      # Some other compiler argument.
+      *)
+	# Unknown arguments in both finalize_command and compile_command need
+	# to be aesthetically quoted because they are evaled later.
+	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+	case $arg in
+	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	  arg="\"$arg\""
+	  ;;
+	esac
+	;;
+      esac # arg
+
+      # Now actually substitute the argument into the commands.
+      if test -n "$arg"; then
+	compile_command="$compile_command $arg"
+	finalize_command="$finalize_command $arg"
+      fi
+    done # argument parsing loop
+
+    if test -n "$prev"; then
+      $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
+
+    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+      eval arg=\"$export_dynamic_flag_spec\"
+      compile_command="$compile_command $arg"
+      finalize_command="$finalize_command $arg"
+    fi
+
+    oldlibs=
+    # calculate the name of the file, without its directory
+    outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
+    libobjs_save="$libobjs"
+
+    if test -n "$shlibpath_var"; then
+      # get the directories listed in $shlibpath_var
+      eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
+    else
+      shlib_search_path=
+    fi
+    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+    output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
+    if test "X$output_objdir" = "X$output"; then
+      output_objdir="$objdir"
+    else
+      output_objdir="$output_objdir/$objdir"
+    fi
+    # Create the object directory.
+    if test ! -d "$output_objdir"; then
+      $show "$mkdir $output_objdir"
+      $run $mkdir $output_objdir
+      status=$?
+      if test "$status" -ne 0 && test ! -d "$output_objdir"; then
+	exit $status
+      fi
+    fi
+
+    # Determine the type of output
+    case $output in
+    "")
+      $echo "$modename: you must specify an output file" 1>&2
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+      ;;
+    *.$libext) linkmode=oldlib ;;
+    *.lo | *.$objext) linkmode=obj ;;
+    *.la) linkmode=lib ;;
+    *) linkmode=prog ;; # Anything else should be a program.
+    esac
+
+    case $host in
+    *cygwin* | *mingw* | *pw32*)
+      # don't eliminate duplications in $postdeps and $predeps
+      duplicate_compiler_generated_deps=yes
+      ;;
+    *)
+      duplicate_compiler_generated_deps=$duplicate_deps
+      ;;
+    esac
+    specialdeplibs=
+
+    libs=
+    # Find all interdependent deplibs by searching for libraries
+    # that are linked more than once (e.g. -la -lb -la)
+    for deplib in $deplibs; do
+      if test "X$duplicate_deps" = "Xyes" ; then
+	case "$libs " in
+	*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	esac
+      fi
+      libs="$libs $deplib"
+    done
+
+    if test "$linkmode" = lib; then
+      libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+      # Compute libraries that are listed more than once in $predeps
+      # $postdeps and mark them as special (i.e., whose duplicates are
+      # not to be eliminated).
+      pre_post_deps=
+      if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
+	for pre_post_dep in $predeps $postdeps; do
+	  case "$pre_post_deps " in
+	  *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
+	  esac
+	  pre_post_deps="$pre_post_deps $pre_post_dep"
+	done
+      fi
+      pre_post_deps=
+    fi
+
+    deplibs=
+    newdependency_libs=
+    newlib_search_path=
+    need_relink=no # whether we're linking any uninstalled libtool libraries
+    notinst_deplibs= # not-installed libtool libraries
+    notinst_path= # paths that contain not-installed libtool libraries
+    case $linkmode in
+    lib)
+	passes="conv link"
+	for file in $dlfiles $dlprefiles; do
+	  case $file in
+	  *.la) ;;
+	  *)
+	    $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
+	    exit $EXIT_FAILURE
+	    ;;
+	  esac
+	done
+	;;
+    prog)
+	compile_deplibs=
+	finalize_deplibs=
+	alldeplibs=no
+	newdlfiles=
+	newdlprefiles=
+	passes="conv scan dlopen dlpreopen link"
+	;;
+    *)  passes="conv"
+	;;
+    esac
+    for pass in $passes; do
+      if test "$linkmode,$pass" = "lib,link" ||
+	 test "$linkmode,$pass" = "prog,scan"; then
+	libs="$deplibs"
+	deplibs=
+      fi
+      if test "$linkmode" = prog; then
+	case $pass in
+	dlopen) libs="$dlfiles" ;;
+	dlpreopen) libs="$dlprefiles" ;;
+	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+	esac
+      fi
+      if test "$pass" = dlopen; then
+	# Collect dlpreopened libraries
+	save_deplibs="$deplibs"
+	deplibs=
+      fi
+      for deplib in $libs; do
+	lib=
+	found=no
+	case $deplib in
+	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
+	  if test "$linkmode,$pass" = "prog,link"; then
+	    compile_deplibs="$deplib $compile_deplibs"
+	    finalize_deplibs="$deplib $finalize_deplibs"
+	  else
+	    deplibs="$deplib $deplibs"
+	  fi
+	  continue
+	  ;;
+	-l*)
+	  if test "$linkmode" != lib && test "$linkmode" != prog; then
+	    $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
+	    continue
+	  fi
+	  if test "$pass" = conv; then
+	    deplibs="$deplib $deplibs"
+	    continue
+	  fi
+	  name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
+	  for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
+	    for search_ext in .la $std_shrext .so .a; do
+	      # Search the libtool library
+	      lib="$searchdir/lib${name}${search_ext}"
+	      if test -f "$lib"; then
+		if test "$search_ext" = ".la"; then
+		  found=yes
+		else
+		  found=no
+		fi
+		break 2
+	      fi
+	    done
+	  done
+	  if test "$found" != yes; then
+	    # deplib doesn't seem to be a libtool library
+	    if test "$linkmode,$pass" = "prog,link"; then
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    else
+	      deplibs="$deplib $deplibs"
+	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	    continue
+	  else # deplib is a libtool library
+	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+	    # We need to do some special things here, and not later.
+	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	      case " $predeps $postdeps " in
+	      *" $deplib "*)
+		if (${SED} -e '2q' $lib |
+                    grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+		  library_names=
+		  old_library=
+		  case $lib in
+		  */* | *\\*) . $lib ;;
+		  *) . ./$lib ;;
+		  esac
+		  for l in $old_library $library_names; do
+		    ll="$l"
+		  done
+		  if test "X$ll" = "X$old_library" ; then # only static version available
+		    found=no
+		    ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
+		    test "X$ladir" = "X$lib" && ladir="."
+		    lib=$ladir/$old_library
+		    if test "$linkmode,$pass" = "prog,link"; then
+		      compile_deplibs="$deplib $compile_deplibs"
+		      finalize_deplibs="$deplib $finalize_deplibs"
+		    else
+		      deplibs="$deplib $deplibs"
+		      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+		    fi
+		    continue
+		  fi
+		fi
+	        ;;
+	      *) ;;
+	      esac
+	    fi
+	  fi
+	  ;; # -l
+	-L*)
+	  case $linkmode in
+	  lib)
+	    deplibs="$deplib $deplibs"
+	    test "$pass" = conv && continue
+	    newdependency_libs="$deplib $newdependency_libs"
+	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+	    ;;
+	  prog)
+	    if test "$pass" = conv; then
+	      deplibs="$deplib $deplibs"
+	      continue
+	    fi
+	    if test "$pass" = scan; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    fi
+	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+	    ;;
+	  *)
+	    $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
+	    ;;
+	  esac # linkmode
+	  continue
+	  ;; # -L
+	-R*)
+	  if test "$pass" = link; then
+	    dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
+	    # Make sure the xrpath contains only unique directories.
+	    case "$xrpath " in
+	    *" $dir "*) ;;
+	    *) xrpath="$xrpath $dir" ;;
+	    esac
+	  fi
+	  deplibs="$deplib $deplibs"
+	  continue
+	  ;;
+	*.la) lib="$deplib" ;;
+	*.$libext)
+	  if test "$pass" = conv; then
+	    deplibs="$deplib $deplibs"
+	    continue
+	  fi
+	  case $linkmode in
+	  lib)
+	    if test "$deplibs_check_method" != pass_all; then
+	      $echo
+	      $echo "*** Warning: Trying to link with static lib archive $deplib."
+	      $echo "*** I have the capability to make that library automatically link in when"
+	      $echo "*** you link to this library.  But I can only do this if you have a"
+	      $echo "*** shared version of the library, which you do not appear to have"
+	      $echo "*** because the file extensions .$libext of this argument makes me believe"
+	      $echo "*** that it is just a static archive that I should not used here."
+	    else
+	      $echo
+	      $echo "*** Warning: Linking the shared library $output against the"
+	      $echo "*** static library $deplib is not portable!"
+	      deplibs="$deplib $deplibs"
+	    fi
+	    continue
+	    ;;
+	  prog)
+	    if test "$pass" != link; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    fi
+	    continue
+	    ;;
+	  esac # linkmode
+	  ;; # *.$libext
+	*.lo | *.$objext)
+	  if test "$pass" = conv; then
+	    deplibs="$deplib $deplibs"
+	  elif test "$linkmode" = prog; then
+	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+	      # If there is no dlopen support or we're linking statically,
+	      # we need to preload.
+	      newdlprefiles="$newdlprefiles $deplib"
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    else
+	      newdlfiles="$newdlfiles $deplib"
+	    fi
+	  fi
+	  continue
+	  ;;
+	%DEPLIBS%)
+	  alldeplibs=yes
+	  continue
+	  ;;
+	esac # case $deplib
+	if test "$found" = yes || test -f "$lib"; then :
+	else
+	  $echo "$modename: cannot find the library \`$lib'" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+
+	# Check to see that this really is a libtool archive.
+	if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+	else
+	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+
+	ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
+	test "X$ladir" = "X$lib" && ladir="."
+
+	dlname=
+	dlopen=
+	dlpreopen=
+	libdir=
+	library_names=
+	old_library=
+	# If the library was installed with an old release of libtool,
+	# it will not redefine variables installed, or shouldnotlink
+	installed=yes
+	shouldnotlink=no
+
+	# Read the .la file
+	case $lib in
+	*/* | *\\*) . $lib ;;
+	*) . ./$lib ;;
+	esac
+
+	if test "$linkmode,$pass" = "lib,link" ||
+	   test "$linkmode,$pass" = "prog,scan" ||
+	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+	  test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
+	  test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
+	fi
+
+	if test "$pass" = conv; then
+	  # Only check for convenience libraries
+	  deplibs="$lib $deplibs"
+	  if test -z "$libdir"; then
+	    if test -z "$old_library"; then
+	      $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
+	      exit $EXIT_FAILURE
+	    fi
+	    # It is a libtool convenience library, so add in its objects.
+	    convenience="$convenience $ladir/$objdir/$old_library"
+	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
+	    tmp_libs=
+	    for deplib in $dependency_libs; do
+	      deplibs="$deplib $deplibs"
+              if test "X$duplicate_deps" = "Xyes" ; then
+	        case "$tmp_libs " in
+	        *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	        esac
+              fi
+	      tmp_libs="$tmp_libs $deplib"
+	    done
+	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
+	    $echo "$modename: \`$lib' is not a convenience library" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+	  continue
+	fi # $pass = conv
+
+
+	# Get the name of the library we link against.
+	linklib=
+	for l in $old_library $library_names; do
+	  linklib="$l"
+	done
+	if test -z "$linklib"; then
+	  $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+
+	# This library was specified with -dlopen.
+	if test "$pass" = dlopen; then
+	  if test -z "$libdir"; then
+	    $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+	  if test -z "$dlname" ||
+	     test "$dlopen_support" != yes ||
+	     test "$build_libtool_libs" = no; then
+	    # If there is no dlname, no dlopen support or we're linking
+	    # statically, we need to preload.  We also need to preload any
+	    # dependent libraries so libltdl's deplib preloader doesn't
+	    # bomb out in the load deplibs phase.
+	    dlprefiles="$dlprefiles $lib $dependency_libs"
+	  else
+	    newdlfiles="$newdlfiles $lib"
+	  fi
+	  continue
+	fi # $pass = dlopen
+
+	# We need an absolute path.
+	case $ladir in
+	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+	*)
+	  abs_ladir=`cd "$ladir" && pwd`
+	  if test -z "$abs_ladir"; then
+	    $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
+	    $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
+	    abs_ladir="$ladir"
+	  fi
+	  ;;
+	esac
+	laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+
+	# Find the relevant object directory and library name.
+	if test "X$installed" = Xyes; then
+	  if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+	    $echo "$modename: warning: library \`$lib' was moved." 1>&2
+	    dir="$ladir"
+	    absdir="$abs_ladir"
+	    libdir="$abs_ladir"
+	  else
+	    dir="$libdir"
+	    absdir="$libdir"
+	  fi
+	else
+	  dir="$ladir/$objdir"
+	  absdir="$abs_ladir/$objdir"
+	  # Remove this search path later
+	  notinst_path="$notinst_path $abs_ladir"
+	fi # $installed = yes
+	name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+
+	# This library was specified with -dlpreopen.
+	if test "$pass" = dlpreopen; then
+	  if test -z "$libdir"; then
+	    $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+	  # Prefer using a static library (so that no silly _DYNAMIC symbols
+	  # are required to link).
+	  if test -n "$old_library"; then
+	    newdlprefiles="$newdlprefiles $dir/$old_library"
+	  # Otherwise, use the dlname, so that lt_dlopen finds it.
+	  elif test -n "$dlname"; then
+	    newdlprefiles="$newdlprefiles $dir/$dlname"
+	  else
+	    newdlprefiles="$newdlprefiles $dir/$linklib"
+	  fi
+	fi # $pass = dlpreopen
+
+	if test -z "$libdir"; then
+	  # Link the convenience library
+	  if test "$linkmode" = lib; then
+	    deplibs="$dir/$old_library $deplibs"
+	  elif test "$linkmode,$pass" = "prog,link"; then
+	    compile_deplibs="$dir/$old_library $compile_deplibs"
+	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
+	  else
+	    deplibs="$lib $deplibs" # used for prog,scan pass
+	  fi
+	  continue
+	fi
+
+
+	if test "$linkmode" = prog && test "$pass" != link; then
+	  newlib_search_path="$newlib_search_path $ladir"
+	  deplibs="$lib $deplibs"
+
+	  linkalldeplibs=no
+	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
+	     test "$build_libtool_libs" = no; then
+	    linkalldeplibs=yes
+	  fi
+
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    case $deplib in
+	    -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
+	    esac
+	    # Need to link against all dependency_libs?
+	    if test "$linkalldeplibs" = yes; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      # Need to hardcode shared library paths
+	      # or/and link against static libraries
+	      newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	    if test "X$duplicate_deps" = "Xyes" ; then
+	      case "$tmp_libs " in
+	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	      esac
+	    fi
+	    tmp_libs="$tmp_libs $deplib"
+	  done # for deplib
+	  continue
+	fi # $linkmode = prog...
+
+	if test "$linkmode,$pass" = "prog,link"; then
+	  if test -n "$library_names" &&
+	     { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+	    # We need to hardcode the library path
+	    if test -n "$shlibpath_var"; then
+	      # Make sure the rpath contains only unique directories.
+	      case "$temp_rpath " in
+	      *" $dir "*) ;;
+	      *" $absdir "*) ;;
+	      *) temp_rpath="$temp_rpath $dir" ;;
+	      esac
+	    fi
+
+	    # Hardcode the library path.
+	    # Skip directories that are in the system default run-time
+	    # search path.
+	    case " $sys_lib_dlsearch_path " in
+	    *" $absdir "*) ;;
+	    *)
+	      case "$compile_rpath " in
+	      *" $absdir "*) ;;
+	      *) compile_rpath="$compile_rpath $absdir"
+	      esac
+	      ;;
+	    esac
+	    case " $sys_lib_dlsearch_path " in
+	    *" $libdir "*) ;;
+	    *)
+	      case "$finalize_rpath " in
+	      *" $libdir "*) ;;
+	      *) finalize_rpath="$finalize_rpath $libdir"
+	      esac
+	      ;;
+	    esac
+	  fi # $linkmode,$pass = prog,link...
+
+	  if test "$alldeplibs" = yes &&
+	     { test "$deplibs_check_method" = pass_all ||
+	       { test "$build_libtool_libs" = yes &&
+		 test -n "$library_names"; }; }; then
+	    # We only need to search for static libraries
+	    continue
+	  fi
+	fi
+
+	link_static=no # Whether the deplib will be linked statically
+	if test -n "$library_names" &&
+	   { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+	  if test "$installed" = no; then
+	    notinst_deplibs="$notinst_deplibs $lib"
+	    need_relink=yes
+	  fi
+	  # This is a shared library
+
+	  # Warn about portability, can't link against -module's on
+	  # some systems (darwin)
+	  if test "$shouldnotlink" = yes && test "$pass" = link ; then
+	    $echo
+	    if test "$linkmode" = prog; then
+	      $echo "*** Warning: Linking the executable $output against the loadable module"
+	    else
+	      $echo "*** Warning: Linking the shared library $output against the loadable module"
+	    fi
+	    $echo "*** $linklib is not portable!"
+	  fi
+	  if test "$linkmode" = lib &&
+	     test "$hardcode_into_libs" = yes; then
+	    # Hardcode the library path.
+	    # Skip directories that are in the system default run-time
+	    # search path.
+	    case " $sys_lib_dlsearch_path " in
+	    *" $absdir "*) ;;
+	    *)
+	      case "$compile_rpath " in
+	      *" $absdir "*) ;;
+	      *) compile_rpath="$compile_rpath $absdir"
+	      esac
+	      ;;
+	    esac
+	    case " $sys_lib_dlsearch_path " in
+	    *" $libdir "*) ;;
+	    *)
+	      case "$finalize_rpath " in
+	      *" $libdir "*) ;;
+	      *) finalize_rpath="$finalize_rpath $libdir"
+	      esac
+	      ;;
+	    esac
+	  fi
+
+	  if test -n "$old_archive_from_expsyms_cmds"; then
+	    # figure out the soname
+	    set dummy $library_names
+	    realname="$2"
+	    shift; shift
+	    libname=`eval \\$echo \"$libname_spec\"`
+	    # use dlname if we got it. it's perfectly good, no?
+	    if test -n "$dlname"; then
+	      soname="$dlname"
+	    elif test -n "$soname_spec"; then
+	      # bleh windows
+	      case $host in
+	      *cygwin* | mingw*)
+		major=`expr $current - $age`
+		versuffix="-$major"
+		;;
+	      esac
+	      eval soname=\"$soname_spec\"
+	    else
+	      soname="$realname"
+	    fi
+
+	    # Make a new name for the extract_expsyms_cmds to use
+	    soroot="$soname"
+	    soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
+	    newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
+
+	    # If the library has no export list, then create one now
+	    if test -f "$output_objdir/$soname-def"; then :
+	    else
+	      $show "extracting exported symbol list from \`$soname'"
+	      save_ifs="$IFS"; IFS='~'
+	      cmds=$extract_expsyms_cmds
+	      for cmd in $cmds; do
+		IFS="$save_ifs"
+		eval cmd=\"$cmd\"
+		$show "$cmd"
+		$run eval "$cmd" || exit $?
+	      done
+	      IFS="$save_ifs"
+	    fi
+
+	    # Create $newlib
+	    if test -f "$output_objdir/$newlib"; then :; else
+	      $show "generating import library for \`$soname'"
+	      save_ifs="$IFS"; IFS='~'
+	      cmds=$old_archive_from_expsyms_cmds
+	      for cmd in $cmds; do
+		IFS="$save_ifs"
+		eval cmd=\"$cmd\"
+		$show "$cmd"
+		$run eval "$cmd" || exit $?
+	      done
+	      IFS="$save_ifs"
+	    fi
+	    # make sure the library variables are pointing to the new library
+	    dir=$output_objdir
+	    linklib=$newlib
+	  fi # test -n "$old_archive_from_expsyms_cmds"
+
+	  if test "$linkmode" = prog || test "$mode" != relink; then
+	    add_shlibpath=
+	    add_dir=
+	    add=
+	    lib_linked=yes
+	    case $hardcode_action in
+	    immediate | unsupported)
+	      if test "$hardcode_direct" = no; then
+		add="$dir/$linklib"
+		case $host in
+		  *-*-sco3.2v5* ) add_dir="-L$dir" ;;
+		  *-*-darwin* )
+		    # if the lib is a module then we can not link against
+		    # it, someone is ignoring the new warnings I added
+		    if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
+		      $echo "** Warning, lib $linklib is a module, not a shared library"
+		      if test -z "$old_library" ; then
+		        $echo
+		        $echo "** And there doesn't seem to be a static archive available"
+		        $echo "** The link will probably fail, sorry"
+		      else
+		        add="$dir/$old_library"
+		      fi
+		    fi
+		esac
+	      elif test "$hardcode_minus_L" = no; then
+		case $host in
+		*-*-sunos*) add_shlibpath="$dir" ;;
+		esac
+		add_dir="-L$dir"
+		add="-l$name"
+	      elif test "$hardcode_shlibpath_var" = no; then
+		add_shlibpath="$dir"
+		add="-l$name"
+	      else
+		lib_linked=no
+	      fi
+	      ;;
+	    relink)
+	      if test "$hardcode_direct" = yes; then
+		add="$dir/$linklib"
+	      elif test "$hardcode_minus_L" = yes; then
+		add_dir="-L$dir"
+		# Try looking first in the location we're being installed to.
+		if test -n "$inst_prefix_dir"; then
+		  case "$libdir" in
+		    [\\/]*)
+		      add_dir="$add_dir -L$inst_prefix_dir$libdir"
+		      ;;
+		  esac
+		fi
+		add="-l$name"
+	      elif test "$hardcode_shlibpath_var" = yes; then
+		add_shlibpath="$dir"
+		add="-l$name"
+	      else
+		lib_linked=no
+	      fi
+	      ;;
+	    *) lib_linked=no ;;
+	    esac
+
+	    if test "$lib_linked" != yes; then
+	      $echo "$modename: configuration error: unsupported hardcode properties"
+	      exit $EXIT_FAILURE
+	    fi
+
+	    if test -n "$add_shlibpath"; then
+	      case :$compile_shlibpath: in
+	      *":$add_shlibpath:"*) ;;
+	      *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
+	      esac
+	    fi
+	    if test "$linkmode" = prog; then
+	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
+	    else
+	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
+	      test -n "$add" && deplibs="$add $deplibs"
+	      if test "$hardcode_direct" != yes && \
+		 test "$hardcode_minus_L" != yes && \
+		 test "$hardcode_shlibpath_var" = yes; then
+		case :$finalize_shlibpath: in
+		*":$libdir:"*) ;;
+		*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+		esac
+	      fi
+	    fi
+	  fi
+
+	  if test "$linkmode" = prog || test "$mode" = relink; then
+	    add_shlibpath=
+	    add_dir=
+	    add=
+	    # Finalize command for both is simple: just hardcode it.
+	    if test "$hardcode_direct" = yes; then
+	      add="$libdir/$linklib"
+	    elif test "$hardcode_minus_L" = yes; then
+	      add_dir="-L$libdir"
+	      add="-l$name"
+	    elif test "$hardcode_shlibpath_var" = yes; then
+	      case :$finalize_shlibpath: in
+	      *":$libdir:"*) ;;
+	      *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+	      esac
+	      add="-l$name"
+	    elif test "$hardcode_automatic" = yes; then
+	      if test -n "$inst_prefix_dir" &&
+		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
+	        add="$inst_prefix_dir$libdir/$linklib"
+	      else
+	        add="$libdir/$linklib"
+	      fi
+	    else
+	      # We cannot seem to hardcode it, guess we'll fake it.
+	      add_dir="-L$libdir"
+	      # Try looking first in the location we're being installed to.
+	      if test -n "$inst_prefix_dir"; then
+		case "$libdir" in
+		  [\\/]*)
+		    add_dir="$add_dir -L$inst_prefix_dir$libdir"
+		    ;;
+		esac
+	      fi
+	      add="-l$name"
+	    fi
+
+	    if test "$linkmode" = prog; then
+	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+	    else
+	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
+	      test -n "$add" && deplibs="$add $deplibs"
+	    fi
+	  fi
+	elif test "$linkmode" = prog; then
+	  # Here we assume that one of hardcode_direct or hardcode_minus_L
+	  # is not unsupported.  This is valid on all known static and
+	  # shared platforms.
+	  if test "$hardcode_direct" != unsupported; then
+	    test -n "$old_library" && linklib="$old_library"
+	    compile_deplibs="$dir/$linklib $compile_deplibs"
+	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
+	  else
+	    compile_deplibs="-l$name -L$dir $compile_deplibs"
+	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+	  fi
+	elif test "$build_libtool_libs" = yes; then
+	  # Not a shared library
+	  if test "$deplibs_check_method" != pass_all; then
+	    # We're trying link a shared library against a static one
+	    # but the system doesn't support it.
+
+	    # Just print a warning and add the library to dependency_libs so
+	    # that the program can be linked against the static library.
+	    $echo
+	    $echo "*** Warning: This system can not link to static lib archive $lib."
+	    $echo "*** I have the capability to make that library automatically link in when"
+	    $echo "*** you link to this library.  But I can only do this if you have a"
+	    $echo "*** shared version of the library, which you do not appear to have."
+	    if test "$module" = yes; then
+	      $echo "*** But as you try to build a module library, libtool will still create "
+	      $echo "*** a static module, that should work as long as the dlopening application"
+	      $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+	      if test -z "$global_symbol_pipe"; then
+		$echo
+		$echo "*** However, this would only work if libtool was able to extract symbol"
+		$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+		$echo "*** not find such a program.  So, this module is probably useless."
+		$echo "*** \`nm' from GNU binutils and a full rebuild may help."
+	      fi
+	      if test "$build_old_libs" = no; then
+		build_libtool_libs=module
+		build_old_libs=yes
+	      else
+		build_libtool_libs=no
+	      fi
+	    fi
+	  else
+	    convenience="$convenience $dir/$old_library"
+	    old_convenience="$old_convenience $dir/$old_library"
+	    deplibs="$dir/$old_library $deplibs"
+	    link_static=yes
+	  fi
+	fi # link shared/static library?
+
+	if test "$linkmode" = lib; then
+	  if test -n "$dependency_libs" &&
+	     { test "$hardcode_into_libs" != yes ||
+	       test "$build_old_libs" = yes ||
+	       test "$link_static" = yes; }; then
+	    # Extract -R from dependency_libs
+	    temp_deplibs=
+	    for libdir in $dependency_libs; do
+	      case $libdir in
+	      -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
+		   case " $xrpath " in
+		   *" $temp_xrpath "*) ;;
+		   *) xrpath="$xrpath $temp_xrpath";;
+		   esac;;
+	      *) temp_deplibs="$temp_deplibs $libdir";;
+	      esac
+	    done
+	    dependency_libs="$temp_deplibs"
+	  fi
+
+	  newlib_search_path="$newlib_search_path $absdir"
+	  # Link against this library
+	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+	  # ... and its dependency_libs
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    newdependency_libs="$deplib $newdependency_libs"
+	    if test "X$duplicate_deps" = "Xyes" ; then
+	      case "$tmp_libs " in
+	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	      esac
+	    fi
+	    tmp_libs="$tmp_libs $deplib"
+	  done
+
+	  if test "$link_all_deplibs" != no; then
+	    # Add the search paths of all dependency libraries
+	    for deplib in $dependency_libs; do
+	      case $deplib in
+	      -L*) path="$deplib" ;;
+	      *.la)
+		dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
+		test "X$dir" = "X$deplib" && dir="."
+		# We need an absolute path.
+		case $dir in
+		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+		*)
+		  absdir=`cd "$dir" && pwd`
+		  if test -z "$absdir"; then
+		    $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
+		    absdir="$dir"
+		  fi
+		  ;;
+		esac
+		if grep "^installed=no" $deplib > /dev/null; then
+		  path="$absdir/$objdir"
+		else
+		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		  if test -z "$libdir"; then
+		    $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
+		    exit $EXIT_FAILURE
+		  fi
+		  if test "$absdir" != "$libdir"; then
+		    $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
+		  fi
+		  path="$absdir"
+		fi
+		depdepl=
+		case $host in
+		*-*-darwin*)
+		  # we do not want to link against static libs,
+		  # but need to link against shared
+		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+		  if test -n "$deplibrary_names" ; then
+		    for tmp in $deplibrary_names ; do
+		      depdepl=$tmp
+		    done
+		    if test -f "$path/$depdepl" ; then
+		      depdepl="$path/$depdepl"
+		    fi
+		    # do not add paths which are already there
+		    case " $newlib_search_path " in
+		    *" $path "*) ;;
+		    *) newlib_search_path="$newlib_search_path $path";;
+		    esac
+		  fi
+		  path=""
+		  ;;
+		*)
+		  path="-L$path"
+		  ;;
+		esac
+		;;
+	      -l*)
+		case $host in
+		*-*-darwin*)
+		  # Again, we only want to link against shared libraries
+		  eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
+		  for tmp in $newlib_search_path ; do
+		    if test -f "$tmp/lib$tmp_libs.dylib" ; then
+		      eval depdepl="$tmp/lib$tmp_libs.dylib"
+		      break
+		    fi
+		  done
+		  path=""
+		  ;;
+		*) continue ;;
+		esac
+		;;
+	      *) continue ;;
+	      esac
+	      case " $deplibs " in
+	      *" $depdepl "*) ;;
+	      *) deplibs="$depdepl $deplibs" ;;
+	      esac
+	      case " $deplibs " in
+	      *" $path "*) ;;
+	      *) deplibs="$deplibs $path" ;;
+	      esac
+	    done
+	  fi # link_all_deplibs != no
+	fi # linkmode = lib
+      done # for deplib in $libs
+      dependency_libs="$newdependency_libs"
+      if test "$pass" = dlpreopen; then
+	# Link the dlpreopened libraries before other libraries
+	for deplib in $save_deplibs; do
+	  deplibs="$deplib $deplibs"
+	done
+      fi
+      if test "$pass" != dlopen; then
+	if test "$pass" != conv; then
+	  # Make sure lib_search_path contains only unique directories.
+	  lib_search_path=
+	  for dir in $newlib_search_path; do
+	    case "$lib_search_path " in
+	    *" $dir "*) ;;
+	    *) lib_search_path="$lib_search_path $dir" ;;
+	    esac
+	  done
+	  newlib_search_path=
+	fi
+
+	if test "$linkmode,$pass" != "prog,link"; then
+	  vars="deplibs"
+	else
+	  vars="compile_deplibs finalize_deplibs"
+	fi
+	for var in $vars dependency_libs; do
+	  # Add libraries to $var in reverse order
+	  eval tmp_libs=\"\$$var\"
+	  new_libs=
+	  for deplib in $tmp_libs; do
+	    # FIXME: Pedantically, this is the right thing to do, so
+	    #        that some nasty dependency loop isn't accidentally
+	    #        broken:
+	    #new_libs="$deplib $new_libs"
+	    # Pragmatically, this seems to cause very few problems in
+	    # practice:
+	    case $deplib in
+	    -L*) new_libs="$deplib $new_libs" ;;
+	    -R*) ;;
+	    *)
+	      # And here is the reason: when a library appears more
+	      # than once as an explicit dependence of a library, or
+	      # is implicitly linked in more than once by the
+	      # compiler, it is considered special, and multiple
+	      # occurrences thereof are not removed.  Compare this
+	      # with having the same library being listed as a
+	      # dependency of multiple other libraries: in this case,
+	      # we know (pedantically, we assume) the library does not
+	      # need to be listed more than once, so we keep only the
+	      # last copy.  This is not always right, but it is rare
+	      # enough that we require users that really mean to play
+	      # such unportable linking tricks to link the library
+	      # using -Wl,-lname, so that libtool does not consider it
+	      # for duplicate removal.
+	      case " $specialdeplibs " in
+	      *" $deplib "*) new_libs="$deplib $new_libs" ;;
+	      *)
+		case " $new_libs " in
+		*" $deplib "*) ;;
+		*) new_libs="$deplib $new_libs" ;;
+		esac
+		;;
+	      esac
+	      ;;
+	    esac
+	  done
+	  tmp_libs=
+	  for deplib in $new_libs; do
+	    case $deplib in
+	    -L*)
+	      case " $tmp_libs " in
+	      *" $deplib "*) ;;
+	      *) tmp_libs="$tmp_libs $deplib" ;;
+	      esac
+	      ;;
+	    *) tmp_libs="$tmp_libs $deplib" ;;
+	    esac
+	  done
+	  eval $var=\"$tmp_libs\"
+	done # for var
+      fi
+      # Last step: remove runtime libs from dependency_libs
+      # (they stay in deplibs)
+      tmp_libs=
+      for i in $dependency_libs ; do
+	case " $predeps $postdeps $compiler_lib_search_path " in
+	*" $i "*)
+	  i=""
+	  ;;
+	esac
+	if test -n "$i" ; then
+	  tmp_libs="$tmp_libs $i"
+	fi
+      done
+      dependency_libs=$tmp_libs
+    done # for pass
+    if test "$linkmode" = prog; then
+      dlfiles="$newdlfiles"
+      dlprefiles="$newdlprefiles"
+    fi
+
+    case $linkmode in
+    oldlib)
+      if test -n "$deplibs"; then
+	$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
+      fi
+
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$rpath"; then
+	$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$xrpath"; then
+	$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$vinfo"; then
+	$echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$release"; then
+	$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+	$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
+      fi
+
+      # Now set the variables for building old libraries.
+      build_libtool_libs=no
+      oldlibs="$output"
+      objs="$objs$old_deplibs"
+      ;;
+
+    lib)
+      # Make sure we only generate libraries of the form `libNAME.la'.
+      case $outputname in
+      lib*)
+	name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+	eval shared_ext=\"$shrext_cmds\"
+	eval libname=\"$libname_spec\"
+	;;
+      *)
+	if test "$module" = no; then
+	  $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
+	  $echo "$help" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+	if test "$need_lib_prefix" != no; then
+	  # Add the "lib" prefix for modules if required
+	  name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+	  eval shared_ext=\"$shrext_cmds\"
+	  eval libname=\"$libname_spec\"
+	else
+	  libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+	fi
+	;;
+      esac
+
+      if test -n "$objs"; then
+	if test "$deplibs_check_method" != pass_all; then
+	  $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
+	  exit $EXIT_FAILURE
+	else
+	  $echo
+	  $echo "*** Warning: Linking the shared library $output against the non-libtool"
+	  $echo "*** objects $objs is not portable!"
+	  libobjs="$libobjs $objs"
+	fi
+      fi
+
+      if test "$dlself" != no; then
+	$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
+      fi
+
+      set dummy $rpath
+      if test "$#" -gt 2; then
+	$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
+      fi
+      install_libdir="$2"
+
+      oldlibs=
+      if test -z "$rpath"; then
+	if test "$build_libtool_libs" = yes; then
+	  # Building a libtool convenience library.
+	  # Some compilers have problems with a `.al' extension so
+	  # convenience libraries should have the same extension an
+	  # archive normally would.
+	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
+	  build_libtool_libs=convenience
+	  build_old_libs=yes
+	fi
+
+	if test -n "$vinfo"; then
+	  $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
+	fi
+
+	if test -n "$release"; then
+	  $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
+	fi
+      else
+
+	# Parse the version information argument.
+	save_ifs="$IFS"; IFS=':'
+	set dummy $vinfo 0 0 0
+	IFS="$save_ifs"
+
+	if test -n "$8"; then
+	  $echo "$modename: too many parameters to \`-version-info'" 1>&2
+	  $echo "$help" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+
+	# convert absolute version numbers to libtool ages
+	# this retains compatibility with .la files and attempts
+	# to make the code below a bit more comprehensible
+
+	case $vinfo_number in
+	yes)
+	  number_major="$2"
+	  number_minor="$3"
+	  number_revision="$4"
+	  #
+	  # There are really only two kinds -- those that
+	  # use the current revision as the major version
+	  # and those that subtract age and use age as
+	  # a minor version.  But, then there is irix
+	  # which has an extra 1 added just for fun
+	  #
+	  case $version_type in
+	  darwin|linux|osf|windows)
+	    current=`expr $number_major + $number_minor`
+	    age="$number_minor"
+	    revision="$number_revision"
+	    ;;
+	  freebsd-aout|freebsd-elf|sunos)
+	    current="$number_major"
+	    revision="$number_minor"
+	    age="0"
+	    ;;
+	  irix|nonstopux)
+	    current=`expr $number_major + $number_minor - 1`
+	    age="$number_minor"
+	    revision="$number_minor"
+	    ;;
+	  esac
+	  ;;
+	no)
+	  current="$2"
+	  revision="$3"
+	  age="$4"
+	  ;;
+	esac
+
+	# Check that each of the things are valid numbers.
+	case $current in
+	[0-9]*) ;;
+	*)
+	  $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
+	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+	  exit $EXIT_FAILURE
+	  ;;
+	esac
+
+	case $revision in
+	[0-9]*) ;;
+	*)
+	  $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
+	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+	  exit $EXIT_FAILURE
+	  ;;
+	esac
+
+	case $age in
+	[0-9]*) ;;
+	*)
+	  $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
+	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+	  exit $EXIT_FAILURE
+	  ;;
+	esac
+
+	if test "$age" -gt "$current"; then
+	  $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
+	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+
+	# Calculate the version variables.
+	major=
+	versuffix=
+	verstring=
+	case $version_type in
+	none) ;;
+
+	darwin)
+	  # Like Linux, but with the current version available in
+	  # verstring for coding it into the library header
+	  major=.`expr $current - $age`
+	  versuffix="$major.$age.$revision"
+	  # Darwin ld doesn't like 0 for these options...
+	  minor_current=`expr $current + 1`
+	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+	  ;;
+
+	freebsd-aout)
+	  major=".$current"
+	  versuffix=".$current.$revision";
+	  ;;
+
+	freebsd-elf)
+	  major=".$current"
+	  versuffix=".$current";
+	  ;;
+
+	irix | nonstopux)
+	  major=`expr $current - $age + 1`
+
+	  case $version_type in
+	    nonstopux) verstring_prefix=nonstopux ;;
+	    *)         verstring_prefix=sgi ;;
+	  esac
+	  verstring="$verstring_prefix$major.$revision"
+
+	  # Add in all the interfaces that we are compatible with.
+	  loop=$revision
+	  while test "$loop" -ne 0; do
+	    iface=`expr $revision - $loop`
+	    loop=`expr $loop - 1`
+	    verstring="$verstring_prefix$major.$iface:$verstring"
+	  done
+
+	  # Before this point, $major must not contain `.'.
+	  major=.$major
+	  versuffix="$major.$revision"
+	  ;;
+
+	linux)
+	  major=.`expr $current - $age`
+	  versuffix="$major.$age.$revision"
+	  ;;
+
+	osf)
+	  major=.`expr $current - $age`
+	  versuffix=".$current.$age.$revision"
+	  verstring="$current.$age.$revision"
+
+	  # Add in all the interfaces that we are compatible with.
+	  loop=$age
+	  while test "$loop" -ne 0; do
+	    iface=`expr $current - $loop`
+	    loop=`expr $loop - 1`
+	    verstring="$verstring:${iface}.0"
+	  done
+
+	  # Make executables depend on our current version.
+	  verstring="$verstring:${current}.0"
+	  ;;
+
+	sunos)
+	  major=".$current"
+	  versuffix=".$current.$revision"
+	  ;;
+
+	windows)
+	  # Use '-' rather than '.', since we only want one
+	  # extension on DOS 8.3 filesystems.
+	  major=`expr $current - $age`
+	  versuffix="-$major"
+	  ;;
+
+	*)
+	  $echo "$modename: unknown library version type \`$version_type'" 1>&2
+	  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
+	  exit $EXIT_FAILURE
+	  ;;
+	esac
+
+	# Clear the version info if we defaulted, and they specified a release.
+	if test -z "$vinfo" && test -n "$release"; then
+	  major=
+	  case $version_type in
+	  darwin)
+	    # we can't check for "0.0" in archive_cmds due to quoting
+	    # problems, so we reset it completely
+	    verstring=
+	    ;;
+	  *)
+	    verstring="0.0"
+	    ;;
+	  esac
+	  if test "$need_version" = no; then
+	    versuffix=
+	  else
+	    versuffix=".0.0"
+	  fi
+	fi
+
+	# Remove version info from name if versioning should be avoided
+	if test "$avoid_version" = yes && test "$need_version" = no; then
+	  major=
+	  versuffix=
+	  verstring=""
+	fi
+
+	# Check to see if the archive will have undefined symbols.
+	if test "$allow_undefined" = yes; then
+	  if test "$allow_undefined_flag" = unsupported; then
+	    $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
+	    build_libtool_libs=no
+	    build_old_libs=yes
+	  fi
+	else
+	  # Don't allow undefined symbols.
+	  allow_undefined_flag="$no_undefined_flag"
+	fi
+      fi
+
+      if test "$mode" != relink; then
+	# Remove our outputs, but don't remove object files since they
+	# may have been created when compiling PIC objects.
+	removelist=
+	tempremovelist=`$echo "$output_objdir/*"`
+	for p in $tempremovelist; do
+	  case $p in
+	    *.$objext)
+	       ;;
+	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+	       if test "X$precious_files_regex" != "X"; then
+	         if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+	         then
+		   continue
+		 fi
+	       fi
+	       removelist="$removelist $p"
+	       ;;
+	    *) ;;
+	  esac
+	done
+	if test -n "$removelist"; then
+	  $show "${rm}r $removelist"
+	  $run ${rm}r $removelist
+	fi
+      fi
+
+      # Now set the variables for building old libraries.
+      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+	oldlibs="$oldlibs $output_objdir/$libname.$libext"
+
+	# Transform .lo files to .o files.
+	oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
+      fi
+
+      # Eliminate all temporary directories.
+      for path in $notinst_path; do
+	lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
+	deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
+	dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
+      done
+
+      if test -n "$xrpath"; then
+	# If the user specified any rpath flags, then add them.
+	temp_xrpath=
+	for libdir in $xrpath; do
+	  temp_xrpath="$temp_xrpath -R$libdir"
+	  case "$finalize_rpath " in
+	  *" $libdir "*) ;;
+	  *) finalize_rpath="$finalize_rpath $libdir" ;;
+	  esac
+	done
+	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+	  dependency_libs="$temp_xrpath $dependency_libs"
+	fi
+      fi
+
+      # Make sure dlfiles contains only unique files that won't be dlpreopened
+      old_dlfiles="$dlfiles"
+      dlfiles=
+      for lib in $old_dlfiles; do
+	case " $dlprefiles $dlfiles " in
+	*" $lib "*) ;;
+	*) dlfiles="$dlfiles $lib" ;;
+	esac
+      done
+
+      # Make sure dlprefiles contains only unique files
+      old_dlprefiles="$dlprefiles"
+      dlprefiles=
+      for lib in $old_dlprefiles; do
+	case "$dlprefiles " in
+	*" $lib "*) ;;
+	*) dlprefiles="$dlprefiles $lib" ;;
+	esac
+      done
+
+      if test "$build_libtool_libs" = yes; then
+	if test -n "$rpath"; then
+	  case $host in
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
+	    # these systems don't actually have a c library (as such)!
+	    ;;
+	  *-*-rhapsody* | *-*-darwin1.[012])
+	    # Rhapsody C library is in the System framework
+	    deplibs="$deplibs -framework System"
+	    ;;
+	  *-*-netbsd*)
+	    # Don't link with libc until the a.out ld.so is fixed.
+	    ;;
+	  *-*-openbsd* | *-*-freebsd*)
+	    # Do not include libc due to us having libc/libc_r.
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+ 	  *)
+	    # Add libc to deplibs on all other systems if necessary.
+	    if test "$build_libtool_need_lc" = "yes"; then
+	      deplibs="$deplibs -lc"
+	    fi
+	    ;;
+	  esac
+	fi
+
+	# Transform deplibs into only deplibs that can be linked in shared.
+	name_save=$name
+	libname_save=$libname
+	release_save=$release
+	versuffix_save=$versuffix
+	major_save=$major
+	# I'm not sure if I'm treating the release correctly.  I think
+	# release should show up in the -l (ie -lgmp5) so we don't want to
+	# add it in twice.  Is that correct?
+	release=""
+	versuffix=""
+	major=""
+	newdeplibs=
+	droppeddeps=no
+	case $deplibs_check_method in
+	pass_all)
+	  # Don't check for shared/static.  Everything works.
+	  # This might be a little naive.  We might want to check
+	  # whether the library exists or not.  But this is on
+	  # osf3 & osf4 and I'm not really sure... Just
+	  # implementing what was already the behavior.
+	  newdeplibs=$deplibs
+	  ;;
+	test_compile)
+	  # This code stresses the "libraries are programs" paradigm to its
+	  # limits. Maybe even breaks it.  We compile a program, linking it
+	  # against the deplibs as a proxy for the library.  Then we can check
+	  # whether they linked in statically or dynamically with ldd.
+	  $rm conftest.c
+	  cat > conftest.c <<EOF
+	  int main() { return 0; }
+EOF
+	  $rm conftest
+	  $LTCC -o conftest conftest.c $deplibs
+	  if test "$?" -eq 0 ; then
+	    ldd_output=`ldd conftest`
+	    for i in $deplibs; do
+	      name="`expr $i : '-l\(.*\)'`"
+	      # If $name is empty we are operating on a -L argument.
+              if test "$name" != "" && test "$name" -ne "0"; then
+		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		  case " $predeps $postdeps " in
+		  *" $i "*)
+		    newdeplibs="$newdeplibs $i"
+		    i=""
+		    ;;
+		  esac
+	        fi
+		if test -n "$i" ; then
+		  libname=`eval \\$echo \"$libname_spec\"`
+		  deplib_matches=`eval \\$echo \"$library_names_spec\"`
+		  set dummy $deplib_matches
+		  deplib_match=$2
+		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		    newdeplibs="$newdeplibs $i"
+		  else
+		    droppeddeps=yes
+		    $echo
+		    $echo "*** Warning: dynamic linker does not accept needed library $i."
+		    $echo "*** I have the capability to make that library automatically link in when"
+		    $echo "*** you link to this library.  But I can only do this if you have a"
+		    $echo "*** shared version of the library, which I believe you do not have"
+		    $echo "*** because a test_compile did reveal that the linker did not use it for"
+		    $echo "*** its dynamic dependency list that programs get resolved with at runtime."
+		  fi
+		fi
+	      else
+		newdeplibs="$newdeplibs $i"
+	      fi
+	    done
+	  else
+	    # Error occurred in the first compile.  Let's try to salvage
+	    # the situation: Compile a separate program for each library.
+	    for i in $deplibs; do
+	      name="`expr $i : '-l\(.*\)'`"
+	      # If $name is empty we are operating on a -L argument.
+              if test "$name" != "" && test "$name" != "0"; then
+		$rm conftest
+		$LTCC -o conftest conftest.c $i
+		# Did it work?
+		if test "$?" -eq 0 ; then
+		  ldd_output=`ldd conftest`
+		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		    case " $predeps $postdeps " in
+		    *" $i "*)
+		      newdeplibs="$newdeplibs $i"
+		      i=""
+		      ;;
+		    esac
+		  fi
+		  if test -n "$i" ; then
+		    libname=`eval \\$echo \"$libname_spec\"`
+		    deplib_matches=`eval \\$echo \"$library_names_spec\"`
+		    set dummy $deplib_matches
+		    deplib_match=$2
+		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		      newdeplibs="$newdeplibs $i"
+		    else
+		      droppeddeps=yes
+		      $echo
+		      $echo "*** Warning: dynamic linker does not accept needed library $i."
+		      $echo "*** I have the capability to make that library automatically link in when"
+		      $echo "*** you link to this library.  But I can only do this if you have a"
+		      $echo "*** shared version of the library, which you do not appear to have"
+		      $echo "*** because a test_compile did reveal that the linker did not use this one"
+		      $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+		    fi
+		  fi
+		else
+		  droppeddeps=yes
+		  $echo
+		  $echo "*** Warning!  Library $i is needed by this library but I was not able to"
+		  $echo "***  make it link in!  You will probably need to install it or some"
+		  $echo "*** library that it depends on before this library will be fully"
+		  $echo "*** functional.  Installing it before continuing would be even better."
+		fi
+	      else
+		newdeplibs="$newdeplibs $i"
+	      fi
+	    done
+	  fi
+	  ;;
+	file_magic*)
+	  set dummy $deplibs_check_method
+	  file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+	  for a_deplib in $deplibs; do
+	    name="`expr $a_deplib : '-l\(.*\)'`"
+	    # If $name is empty we are operating on a -L argument.
+            if test "$name" != "" && test  "$name" != "0"; then
+	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		case " $predeps $postdeps " in
+		*" $a_deplib "*)
+		  newdeplibs="$newdeplibs $a_deplib"
+		  a_deplib=""
+		  ;;
+		esac
+	      fi
+	      if test -n "$a_deplib" ; then
+		libname=`eval \\$echo \"$libname_spec\"`
+		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+		  for potent_lib in $potential_libs; do
+		      # Follow soft links.
+		      if ls -lLd "$potent_lib" 2>/dev/null \
+			 | grep " -> " >/dev/null; then
+			continue
+		      fi
+		      # The statement above tries to avoid entering an
+		      # endless loop below, in case of cyclic links.
+		      # We might still enter an endless loop, since a link
+		      # loop can be closed while we follow links,
+		      # but so what?
+		      potlib="$potent_lib"
+		      while test -h "$potlib" 2>/dev/null; do
+			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+			case $potliblink in
+			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+			*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
+			esac
+		      done
+		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
+			 | ${SED} 10q \
+			 | $EGREP "$file_magic_regex" > /dev/null; then
+			newdeplibs="$newdeplibs $a_deplib"
+			a_deplib=""
+			break 2
+		      fi
+		  done
+		done
+	      fi
+	      if test -n "$a_deplib" ; then
+		droppeddeps=yes
+		$echo
+		$echo "*** Warning: linker path does not have real file for library $a_deplib."
+		$echo "*** I have the capability to make that library automatically link in when"
+		$echo "*** you link to this library.  But I can only do this if you have a"
+		$echo "*** shared version of the library, which you do not appear to have"
+		$echo "*** because I did check the linker path looking for a file starting"
+		if test -z "$potlib" ; then
+		  $echo "*** with $libname but no candidates were found. (...for file magic test)"
+		else
+		  $echo "*** with $libname and none of the candidates passed a file format test"
+		  $echo "*** using a file magic. Last file checked: $potlib"
+		fi
+	      fi
+	    else
+	      # Add a -L argument.
+	      newdeplibs="$newdeplibs $a_deplib"
+	    fi
+	  done # Gone through all deplibs.
+	  ;;
+	match_pattern*)
+	  set dummy $deplibs_check_method
+	  match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+	  for a_deplib in $deplibs; do
+	    name="`expr $a_deplib : '-l\(.*\)'`"
+	    # If $name is empty we are operating on a -L argument.
+	    if test -n "$name" && test "$name" != "0"; then
+	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		case " $predeps $postdeps " in
+		*" $a_deplib "*)
+		  newdeplibs="$newdeplibs $a_deplib"
+		  a_deplib=""
+		  ;;
+		esac
+	      fi
+	      if test -n "$a_deplib" ; then
+		libname=`eval \\$echo \"$libname_spec\"`
+		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+		  for potent_lib in $potential_libs; do
+		    potlib="$potent_lib" # see symlink-check above in file_magic test
+		    if eval $echo \"$potent_lib\" 2>/dev/null \
+		        | ${SED} 10q \
+		        | $EGREP "$match_pattern_regex" > /dev/null; then
+		      newdeplibs="$newdeplibs $a_deplib"
+		      a_deplib=""
+		      break 2
+		    fi
+		  done
+		done
+	      fi
+	      if test -n "$a_deplib" ; then
+		droppeddeps=yes
+		$echo
+		$echo "*** Warning: linker path does not have real file for library $a_deplib."
+		$echo "*** I have the capability to make that library automatically link in when"
+		$echo "*** you link to this library.  But I can only do this if you have a"
+		$echo "*** shared version of the library, which you do not appear to have"
+		$echo "*** because I did check the linker path looking for a file starting"
+		if test -z "$potlib" ; then
+		  $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
+		else
+		  $echo "*** with $libname and none of the candidates passed a file format test"
+		  $echo "*** using a regex pattern. Last file checked: $potlib"
+		fi
+	      fi
+	    else
+	      # Add a -L argument.
+	      newdeplibs="$newdeplibs $a_deplib"
+	    fi
+	  done # Gone through all deplibs.
+	  ;;
+	none | unknown | *)
+	  newdeplibs=""
+	  tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
+	    -e 's/ -[LR][^ ]*//g'`
+	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	    for i in $predeps $postdeps ; do
+	      # can't use Xsed below, because $i might contain '/'
+	      tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
+	    done
+	  fi
+	  if $echo "X $tmp_deplibs" | $Xsed -e 's/[ 	]//g' \
+	    | grep . >/dev/null; then
+	    $echo
+	    if test "X$deplibs_check_method" = "Xnone"; then
+	      $echo "*** Warning: inter-library dependencies are not supported in this platform."
+	    else
+	      $echo "*** Warning: inter-library dependencies are not known to be supported."
+	    fi
+	    $echo "*** All declared inter-library dependencies are being dropped."
+	    droppeddeps=yes
+	  fi
+	  ;;
+	esac
+	versuffix=$versuffix_save
+	major=$major_save
+	release=$release_save
+	libname=$libname_save
+	name=$name_save
+
+	case $host in
+	*-*-rhapsody* | *-*-darwin1.[012])
+	  # On Rhapsody replace the C library is the System framework
+	  newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
+	  ;;
+	esac
+
+	if test "$droppeddeps" = yes; then
+	  if test "$module" = yes; then
+	    $echo
+	    $echo "*** Warning: libtool could not satisfy all declared inter-library"
+	    $echo "*** dependencies of module $libname.  Therefore, libtool will create"
+	    $echo "*** a static module, that should work as long as the dlopening"
+	    $echo "*** application is linked with the -dlopen flag."
+	    if test -z "$global_symbol_pipe"; then
+	      $echo
+	      $echo "*** However, this would only work if libtool was able to extract symbol"
+	      $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+	      $echo "*** not find such a program.  So, this module is probably useless."
+	      $echo "*** \`nm' from GNU binutils and a full rebuild may help."
+	    fi
+	    if test "$build_old_libs" = no; then
+	      oldlibs="$output_objdir/$libname.$libext"
+	      build_libtool_libs=module
+	      build_old_libs=yes
+	    else
+	      build_libtool_libs=no
+	    fi
+	  else
+	    $echo "*** The inter-library dependencies that have been dropped here will be"
+	    $echo "*** automatically added whenever a program is linked with this library"
+	    $echo "*** or is declared to -dlopen it."
+
+	    if test "$allow_undefined" = no; then
+	      $echo
+	      $echo "*** Since this library must not contain undefined symbols,"
+	      $echo "*** because either the platform does not support them or"
+	      $echo "*** it was explicitly requested with -no-undefined,"
+	      $echo "*** libtool will only create a static version of it."
+	      if test "$build_old_libs" = no; then
+		oldlibs="$output_objdir/$libname.$libext"
+		build_libtool_libs=module
+		build_old_libs=yes
+	      else
+		build_libtool_libs=no
+	      fi
+	    fi
+	  fi
+	fi
+	# Done checking deplibs!
+	deplibs=$newdeplibs
+      fi
+
+      # All the library-specific variables (install_libdir is set above).
+      library_names=
+      old_library=
+      dlname=
+
+      # Test again, we may have decided not to build it any more
+      if test "$build_libtool_libs" = yes; then
+	if test "$hardcode_into_libs" = yes; then
+	  # Hardcode the library paths
+	  hardcode_libdirs=
+	  dep_rpath=
+	  rpath="$finalize_rpath"
+	  test "$mode" != relink && rpath="$compile_rpath$rpath"
+	  for libdir in $rpath; do
+	    if test -n "$hardcode_libdir_flag_spec"; then
+	      if test -n "$hardcode_libdir_separator"; then
+		if test -z "$hardcode_libdirs"; then
+		  hardcode_libdirs="$libdir"
+		else
+		  # Just accumulate the unique libdirs.
+		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		    ;;
+		  *)
+		    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		    ;;
+		  esac
+		fi
+	      else
+		eval flag=\"$hardcode_libdir_flag_spec\"
+		dep_rpath="$dep_rpath $flag"
+	      fi
+	    elif test -n "$runpath_var"; then
+	      case "$perm_rpath " in
+	      *" $libdir "*) ;;
+	      *) perm_rpath="$perm_rpath $libdir" ;;
+	      esac
+	    fi
+	  done
+	  # Substitute the hardcoded libdirs into the rpath.
+	  if test -n "$hardcode_libdir_separator" &&
+	     test -n "$hardcode_libdirs"; then
+	    libdir="$hardcode_libdirs"
+	    if test -n "$hardcode_libdir_flag_spec_ld"; then
+	      eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
+	    else
+	      eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+	    fi
+	  fi
+	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
+	    # We should set the runpath_var.
+	    rpath=
+	    for dir in $perm_rpath; do
+	      rpath="$rpath$dir:"
+	    done
+	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+	  fi
+	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+	fi
+
+	shlibpath="$finalize_shlibpath"
+	test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+	if test -n "$shlibpath"; then
+	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+	fi
+
+	# Get the real and link names of the library.
+	eval shared_ext=\"$shrext_cmds\"
+	eval library_names=\"$library_names_spec\"
+	set dummy $library_names
+	realname="$2"
+	shift; shift
+
+	if test -n "$soname_spec"; then
+	  eval soname=\"$soname_spec\"
+	else
+	  soname="$realname"
+	fi
+	if test -z "$dlname"; then
+	  dlname=$soname
+	fi
+
+	lib="$output_objdir/$realname"
+	for link
+	do
+	  linknames="$linknames $link"
+	done
+
+	# Use standard objects if they are pic
+	test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+
+	# Prepare the list of exported symbols
+	if test -z "$export_symbols"; then
+	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+	    $show "generating symbol list for \`$libname.la'"
+	    export_symbols="$output_objdir/$libname.exp"
+	    $run $rm $export_symbols
+	    cmds=$export_symbols_cmds
+	    save_ifs="$IFS"; IFS='~'
+	    for cmd in $cmds; do
+	      IFS="$save_ifs"
+	      eval cmd=\"$cmd\"
+	      if len=`expr "X$cmd" : ".*"` &&
+	       test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	        $show "$cmd"
+	        $run eval "$cmd" || exit $?
+	        skipped_export=false
+	      else
+	        # The command line is too long to execute in one step.
+	        $show "using reloadable object file for export list..."
+	        skipped_export=:
+	      fi
+	    done
+	    IFS="$save_ifs"
+	    if test -n "$export_symbols_regex"; then
+	      $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
+	      $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+	      $show "$mv \"${export_symbols}T\" \"$export_symbols\""
+	      $run eval '$mv "${export_symbols}T" "$export_symbols"'
+	    fi
+	  fi
+	fi
+
+	if test -n "$export_symbols" && test -n "$include_expsyms"; then
+	  $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
+	fi
+
+	tmp_deplibs=
+	for test_deplib in $deplibs; do
+		case " $convenience " in
+		*" $test_deplib "*) ;;
+		*)
+			tmp_deplibs="$tmp_deplibs $test_deplib"
+			;;
+		esac
+	done
+	deplibs="$tmp_deplibs"
+
+	if test -n "$convenience"; then
+	  if test -n "$whole_archive_flag_spec"; then
+	    save_libobjs=$libobjs
+	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+	  else
+	    gentop="$output_objdir/${outputname}x"
+	    $show "${rm}r $gentop"
+	    $run ${rm}r "$gentop"
+	    $show "$mkdir $gentop"
+	    $run $mkdir "$gentop"
+	    status=$?
+	    if test "$status" -ne 0 && test ! -d "$gentop"; then
+	      exit $status
+	    fi
+	    generated="$generated $gentop"
+
+	    for xlib in $convenience; do
+	      # Extract the objects.
+	      case $xlib in
+	      [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+	      *) xabs=`pwd`"/$xlib" ;;
+	      esac
+	      xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
+	      xdir="$gentop/$xlib"
+
+	      $show "${rm}r $xdir"
+	      $run ${rm}r "$xdir"
+	      $show "$mkdir $xdir"
+	      $run $mkdir "$xdir"
+	      status=$?
+	      if test "$status" -ne 0 && test ! -d "$xdir"; then
+		exit $status
+	      fi
+	      # We will extract separately just the conflicting names and we will no
+	      # longer touch any unique names. It is faster to leave these extract
+	      # automatically by $AR in one run.
+	      $show "(cd $xdir && $AR x $xabs)"
+	      $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+	      if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
+		:
+	      else
+		$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
+		$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
+		$AR t "$xabs" | sort | uniq -cd | while read -r count name
+		do
+		  i=1
+		  while test "$i" -le "$count"
+		  do
+		   # Put our $i before any first dot (extension)
+		   # Never overwrite any file
+		   name_to="$name"
+		   while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
+		   do
+		     name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
+		   done
+		   $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
+		   $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
+		   i=`expr $i + 1`
+		  done
+		done
+	      fi
+
+	      libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+	    done
+	  fi
+	fi
+
+	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+	  eval flag=\"$thread_safe_flag_spec\"
+	  linker_flags="$linker_flags $flag"
+	fi
+
+	# Make a backup of the uninstalled library when relinking
+	if test "$mode" = relink; then
+	  $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
+	fi
+
+	# Do each of the archive commands.
+	if test "$module" = yes && test -n "$module_cmds" ; then
+	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+	    eval test_cmds=\"$module_expsym_cmds\"
+	    cmds=$module_expsym_cmds
+	  else
+	    eval test_cmds=\"$module_cmds\"
+	    cmds=$module_cmds
+	  fi
+	else
+	if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+	  eval test_cmds=\"$archive_expsym_cmds\"
+	  cmds=$archive_expsym_cmds
+	else
+	  eval test_cmds=\"$archive_cmds\"
+	  cmds=$archive_cmds
+	  fi
+	fi
+
+	if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
+	   test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	  :
+	else
+	  # The command line is too long to link in one step, link piecewise.
+	  $echo "creating reloadable object files..."
+
+	  # Save the value of $output and $libobjs because we want to
+	  # use them later.  If we have whole_archive_flag_spec, we
+	  # want to use save_libobjs as it was before
+	  # whole_archive_flag_spec was expanded, because we can't
+	  # assume the linker understands whole_archive_flag_spec.
+	  # This may have to be revisited, in case too many
+	  # convenience libraries get linked in and end up exceeding
+	  # the spec.
+	  if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+	    save_libobjs=$libobjs
+	  fi
+	  save_output=$output
+
+	  # Clear the reloadable object creation command queue and
+	  # initialize k to one.
+	  test_cmds=
+	  concat_cmds=
+	  objlist=
+	  delfiles=
+	  last_robj=
+	  k=1
+	  output=$output_objdir/$save_output-${k}.$objext
+	  # Loop over the list of objects to be linked.
+	  for obj in $save_libobjs
+	  do
+	    eval test_cmds=\"$reload_cmds $objlist $last_robj\"
+	    if test "X$objlist" = X ||
+	       { len=`expr "X$test_cmds" : ".*"` &&
+		 test "$len" -le "$max_cmd_len"; }; then
+	      objlist="$objlist $obj"
+	    else
+	      # The command $test_cmds is almost too long, add a
+	      # command to the queue.
+	      if test "$k" -eq 1 ; then
+		# The first file doesn't have a previous command to add.
+		eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
+	      else
+		# All subsequent reloadable object files will link in
+		# the last one created.
+		eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
+	      fi
+	      last_robj=$output_objdir/$save_output-${k}.$objext
+	      k=`expr $k + 1`
+	      output=$output_objdir/$save_output-${k}.$objext
+	      objlist=$obj
+	      len=1
+	    fi
+	  done
+	  # Handle the remaining objects by creating one last
+	  # reloadable object file.  All subsequent reloadable object
+	  # files will link in the last one created.
+	  test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	  eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
+
+	  if ${skipped_export-false}; then
+	    $show "generating symbol list for \`$libname.la'"
+	    export_symbols="$output_objdir/$libname.exp"
+	    $run $rm $export_symbols
+	    libobjs=$output
+	    # Append the command to create the export file.
+	    eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
+          fi
+
+	  # Set up a command to remove the reloadale object files
+	  # after they are used.
+	  i=0
+	  while test "$i" -lt "$k"
+	  do
+	    i=`expr $i + 1`
+	    delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
+	  done
+
+	  $echo "creating a temporary reloadable object file: $output"
+
+	  # Loop through the commands generated above and execute them.
+	  save_ifs="$IFS"; IFS='~'
+	  for cmd in $concat_cmds; do
+	    IFS="$save_ifs"
+	    $show "$cmd"
+	    $run eval "$cmd" || exit $?
+	  done
+	  IFS="$save_ifs"
+
+	  libobjs=$output
+	  # Restore the value of output.
+	  output=$save_output
+
+	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+	  fi
+	  # Expand the library linking commands again to reset the
+	  # value of $libobjs for piecewise linking.
+
+	  # Do each of the archive commands.
+	  if test "$module" = yes && test -n "$module_cmds" ; then
+	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+	      cmds=$module_expsym_cmds
+	    else
+	      cmds=$module_cmds
+	    fi
+	  else
+	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+	    cmds=$archive_expsym_cmds
+	  else
+	    cmds=$archive_cmds
+	    fi
+	  fi
+
+	  # Append the command to remove the reloadable object files
+	  # to the just-reset $cmds.
+	  eval cmds=\"\$cmds~\$rm $delfiles\"
+	fi
+	save_ifs="$IFS"; IFS='~'
+	for cmd in $cmds; do
+	  IFS="$save_ifs"
+	  eval cmd=\"$cmd\"
+	  $show "$cmd"
+	  $run eval "$cmd" || exit $?
+	done
+	IFS="$save_ifs"
+
+	# Restore the uninstalled library and exit
+	if test "$mode" = relink; then
+	  $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
+	  exit $EXIT_SUCCESS
+	fi
+
+	# Create links to the real library.
+	for linkname in $linknames; do
+	  if test "$realname" != "$linkname"; then
+	    $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
+	    $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
+	  fi
+	done
+
+	# If -module or -export-dynamic was specified, set the dlname.
+	if test "$module" = yes || test "$export_dynamic" = yes; then
+	  # On all known operating systems, these are identical.
+	  dlname="$soname"
+	fi
+      fi
+      ;;
+
+    obj)
+      if test -n "$deplibs"; then
+	$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
+      fi
+
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
+      fi
+
+      if test -n "$rpath"; then
+	$echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
+      fi
+
+      if test -n "$xrpath"; then
+	$echo "$modename: warning: \`-R' is ignored for objects" 1>&2
+      fi
+
+      if test -n "$vinfo"; then
+	$echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
+      fi
+
+      if test -n "$release"; then
+	$echo "$modename: warning: \`-release' is ignored for objects" 1>&2
+      fi
+
+      case $output in
+      *.lo)
+	if test -n "$objs$old_deplibs"; then
+	  $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+	libobj="$output"
+	obj=`$echo "X$output" | $Xsed -e "$lo2o"`
+	;;
+      *)
+	libobj=
+	obj="$output"
+	;;
+      esac
+
+      # Delete the old objects.
+      $run $rm $obj $libobj
+
+      # Objects from convenience libraries.  This assumes
+      # single-version convenience libraries.  Whenever we create
+      # different ones for PIC/non-PIC, this we'll have to duplicate
+      # the extraction.
+      reload_conv_objs=
+      gentop=
+      # reload_cmds runs $LD directly, so let us get rid of
+      # -Wl from whole_archive_flag_spec
+      wl=
+
+      if test -n "$convenience"; then
+	if test -n "$whole_archive_flag_spec"; then
+	  eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
+	else
+	  gentop="$output_objdir/${obj}x"
+	  $show "${rm}r $gentop"
+	  $run ${rm}r "$gentop"
+	  $show "$mkdir $gentop"
+	  $run $mkdir "$gentop"
+	  status=$?
+	  if test "$status" -ne 0 && test ! -d "$gentop"; then
+	    exit $status
+	  fi
+	  generated="$generated $gentop"
+
+	  for xlib in $convenience; do
+	    # Extract the objects.
+	    case $xlib in
+	    [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+	    *) xabs=`pwd`"/$xlib" ;;
+	    esac
+	    xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
+	    xdir="$gentop/$xlib"
+
+	    $show "${rm}r $xdir"
+	    $run ${rm}r "$xdir"
+	    $show "$mkdir $xdir"
+	    $run $mkdir "$xdir"
+	    status=$?
+	    if test "$status" -ne 0 && test ! -d "$xdir"; then
+	      exit $status
+	    fi
+	    # We will extract separately just the conflicting names and we will no
+	    # longer touch any unique names. It is faster to leave these extract
+	    # automatically by $AR in one run.
+	    $show "(cd $xdir && $AR x $xabs)"
+	    $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+	    if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
+	      :
+	    else
+	      $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
+	      $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
+	      $AR t "$xabs" | sort | uniq -cd | while read -r count name
+	      do
+		i=1
+		while test "$i" -le "$count"
+		do
+		 # Put our $i before any first dot (extension)
+		 # Never overwrite any file
+		 name_to="$name"
+		 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
+		 do
+		   name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
+		 done
+		 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
+		 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
+		 i=`expr $i + 1`
+		done
+	      done
+	    fi
+
+	    reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+	  done
+	fi
+      fi
+
+      # Create the old-style object.
+      reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+      output="$obj"
+      cmds=$reload_cmds
+      save_ifs="$IFS"; IFS='~'
+      for cmd in $cmds; do
+	IFS="$save_ifs"
+	eval cmd=\"$cmd\"
+	$show "$cmd"
+	$run eval "$cmd" || exit $?
+      done
+      IFS="$save_ifs"
+
+      # Exit if we aren't doing a library object file.
+      if test -z "$libobj"; then
+	if test -n "$gentop"; then
+	  $show "${rm}r $gentop"
+	  $run ${rm}r $gentop
+	fi
+
+	exit $EXIT_SUCCESS
+      fi
+
+      if test "$build_libtool_libs" != yes; then
+	if test -n "$gentop"; then
+	  $show "${rm}r $gentop"
+	  $run ${rm}r $gentop
+	fi
+
+	# Create an invalid libtool object if no PIC, so that we don't
+	# accidentally link it into a program.
+	# $show "echo timestamp > $libobj"
+	# $run eval "echo timestamp > $libobj" || exit $?
+	exit $EXIT_SUCCESS
+      fi
+
+      if test -n "$pic_flag" || test "$pic_mode" != default; then
+	# Only do commands if we really have different PIC objects.
+	reload_objs="$libobjs $reload_conv_objs"
+	output="$libobj"
+	cmds=$reload_cmds
+	save_ifs="$IFS"; IFS='~'
+	for cmd in $cmds; do
+	  IFS="$save_ifs"
+	  eval cmd=\"$cmd\"
+	  $show "$cmd"
+	  $run eval "$cmd" || exit $?
+	done
+	IFS="$save_ifs"
+      fi
+
+      if test -n "$gentop"; then
+	$show "${rm}r $gentop"
+	$run ${rm}r $gentop
+      fi
+
+      exit $EXIT_SUCCESS
+      ;;
+
+    prog)
+      case $host in
+	*cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
+      esac
+      if test -n "$vinfo"; then
+	$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
+      fi
+
+      if test -n "$release"; then
+	$echo "$modename: warning: \`-release' is ignored for programs" 1>&2
+      fi
+
+      if test "$preload" = yes; then
+	if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
+	   test "$dlopen_self_static" = unknown; then
+	  $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
+	fi
+      fi
+
+      case $host in
+      *-*-rhapsody* | *-*-darwin1.[012])
+	# On Rhapsody replace the C library is the System framework
+	compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
+	finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
+	;;
+      esac
+
+      case $host in
+      *darwin*)
+        # Don't allow lazy linking, it breaks C++ global constructors
+        if test "$tagname" = CXX ; then
+        compile_command="$compile_command ${wl}-bind_at_load"
+        finalize_command="$finalize_command ${wl}-bind_at_load"
+        fi
+        ;;
+      esac
+
+      compile_command="$compile_command $compile_deplibs"
+      finalize_command="$finalize_command $finalize_deplibs"
+
+      if test -n "$rpath$xrpath"; then
+	# If the user specified any rpath flags, then add them.
+	for libdir in $rpath $xrpath; do
+	  # This is the magic to use -rpath.
+	  case "$finalize_rpath " in
+	  *" $libdir "*) ;;
+	  *) finalize_rpath="$finalize_rpath $libdir" ;;
+	  esac
+	done
+      fi
+
+      # Now hardcode the library paths
+      rpath=
+      hardcode_libdirs=
+      for libdir in $compile_rpath $finalize_rpath; do
+	if test -n "$hardcode_libdir_flag_spec"; then
+	  if test -n "$hardcode_libdir_separator"; then
+	    if test -z "$hardcode_libdirs"; then
+	      hardcode_libdirs="$libdir"
+	    else
+	      # Just accumulate the unique libdirs.
+	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		;;
+	      *)
+		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		;;
+	      esac
+	    fi
+	  else
+	    eval flag=\"$hardcode_libdir_flag_spec\"
+	    rpath="$rpath $flag"
+	  fi
+	elif test -n "$runpath_var"; then
+	  case "$perm_rpath " in
+	  *" $libdir "*) ;;
+	  *) perm_rpath="$perm_rpath $libdir" ;;
+	  esac
+	fi
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+	  case :$dllsearchpath: in
+	  *":$libdir:"*) ;;
+	  *) dllsearchpath="$dllsearchpath:$libdir";;
+	  esac
+	  ;;
+	esac
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+	 test -n "$hardcode_libdirs"; then
+	libdir="$hardcode_libdirs"
+	eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      compile_rpath="$rpath"
+
+      rpath=
+      hardcode_libdirs=
+      for libdir in $finalize_rpath; do
+	if test -n "$hardcode_libdir_flag_spec"; then
+	  if test -n "$hardcode_libdir_separator"; then
+	    if test -z "$hardcode_libdirs"; then
+	      hardcode_libdirs="$libdir"
+	    else
+	      # Just accumulate the unique libdirs.
+	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		;;
+	      *)
+		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		;;
+	      esac
+	    fi
+	  else
+	    eval flag=\"$hardcode_libdir_flag_spec\"
+	    rpath="$rpath $flag"
+	  fi
+	elif test -n "$runpath_var"; then
+	  case "$finalize_perm_rpath " in
+	  *" $libdir "*) ;;
+	  *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
+	  esac
+	fi
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+	 test -n "$hardcode_libdirs"; then
+	libdir="$hardcode_libdirs"
+	eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      finalize_rpath="$rpath"
+
+      if test -n "$libobjs" && test "$build_old_libs" = yes; then
+	# Transform all the library objects into standard objects.
+	compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+	finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+      fi
+
+      dlsyms=
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	if test -n "$NM" && test -n "$global_symbol_pipe"; then
+	  dlsyms="${outputname}S.c"
+	else
+	  $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
+	fi
+      fi
+
+      if test -n "$dlsyms"; then
+	case $dlsyms in
+	"") ;;
+	*.c)
+	  # Discover the nlist of each of the dlfiles.
+	  nlist="$output_objdir/${outputname}.nm"
+
+	  $show "$rm $nlist ${nlist}S ${nlist}T"
+	  $run $rm "$nlist" "${nlist}S" "${nlist}T"
+
+	  # Parse the name list into a source file.
+	  $show "creating $output_objdir/$dlsyms"
+
+	  test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
+/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
+/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+/* Prevent the only kind of declaration conflicts we can make. */
+#define lt_preloaded_symbols some_other_symbol
+
+/* External symbol declarations for the compiler. */\
+"
+
+	  if test "$dlself" = yes; then
+	    $show "generating symbol list for \`$output'"
+
+	    test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
+
+	    # Add our own program objects to the symbol list.
+	    progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+	    for arg in $progfiles; do
+	      $show "extracting global C symbols from \`$arg'"
+	      $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+	    done
+
+	    if test -n "$exclude_expsyms"; then
+	      $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+	      $run eval '$mv "$nlist"T "$nlist"'
+	    fi
+
+	    if test -n "$export_symbols_regex"; then
+	      $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+	      $run eval '$mv "$nlist"T "$nlist"'
+	    fi
+
+	    # Prepare the list of exported symbols
+	    if test -z "$export_symbols"; then
+	      export_symbols="$output_objdir/$output.exp"
+	      $run $rm $export_symbols
+	      $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+	    else
+	      $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
+	      $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
+	      $run eval 'mv "$nlist"T "$nlist"'
+	    fi
+	  fi
+
+	  for arg in $dlprefiles; do
+	    $show "extracting global C symbols from \`$arg'"
+	    name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
+	    $run eval '$echo ": $name " >> "$nlist"'
+	    $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+	  done
+
+	  if test -z "$run"; then
+	    # Make sure we have at least an empty file.
+	    test -f "$nlist" || : > "$nlist"
+
+	    if test -n "$exclude_expsyms"; then
+	      $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+	      $mv "$nlist"T "$nlist"
+	    fi
+
+	    # Try sorting and uniquifying the output.
+	    if grep -v "^: " < "$nlist" |
+		if sort -k 3 </dev/null >/dev/null 2>&1; then
+		  sort -k 3
+		else
+		  sort +2
+		fi |
+		uniq > "$nlist"S; then
+	      :
+	    else
+	      grep -v "^: " < "$nlist" > "$nlist"S
+	    fi
+
+	    if test -f "$nlist"S; then
+	      eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
+	    else
+	      $echo '/* NONE */' >> "$output_objdir/$dlsyms"
+	    fi
+
+	    $echo >> "$output_objdir/$dlsyms" "\
+
+#undef lt_preloaded_symbols
+
+#if defined (__STDC__) && __STDC__
+# define lt_ptr void *
+#else
+# define lt_ptr char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+  const char *name;
+  lt_ptr address;
+}
+lt_preloaded_symbols[] =
+{\
+"
+
+	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
+
+	    $echo >> "$output_objdir/$dlsyms" "\
+  {0, (lt_ptr) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+	  fi
+
+	  pic_flag_for_symtable=
+	  case $host in
+	  # compiling the symbol table file with pic_flag works around
+	  # a FreeBSD bug that causes programs to crash when -lm is
+	  # linked before any other PIC object.  But we must not use
+	  # pic_flag when linking with -static.  The problem exists in
+	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+	    case "$compile_command " in
+	    *" -static "*) ;;
+	    *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
+	    esac;;
+	  *-*-hpux*)
+	    case "$compile_command " in
+	    *" -static "*) ;;
+	    *) pic_flag_for_symtable=" $pic_flag";;
+	    esac
+	  esac
+
+	  # Now compile the dynamic symbol file.
+	  $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
+	  $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
+
+	  # Clean up the generated files.
+	  $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
+	  $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
+
+	  # Transform the symbol file into the correct name.
+	  compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+	  finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+	  ;;
+	*)
+	  $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
+	  exit $EXIT_FAILURE
+	  ;;
+	esac
+      else
+	# We keep going just in case the user didn't refer to
+	# lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
+	# really was required.
+
+	# Nullify the symbol file.
+	compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
+	finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+      fi
+
+      if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+	# Replace the output file specification.
+	compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+	link_command="$compile_command$compile_rpath"
+
+	# We have no uninstalled library dependencies, so finalize right now.
+	$show "$link_command"
+	$run eval "$link_command"
+	status=$?
+
+	# Delete the generated files.
+	if test -n "$dlsyms"; then
+	  $show "$rm $output_objdir/${outputname}S.${objext}"
+	  $run $rm "$output_objdir/${outputname}S.${objext}"
+	fi
+
+	exit $status
+      fi
+
+      if test -n "$shlibpath_var"; then
+	# We should set the shlibpath_var
+	rpath=
+	for dir in $temp_rpath; do
+	  case $dir in
+	  [\\/]* | [A-Za-z]:[\\/]*)
+	    # Absolute path.
+	    rpath="$rpath$dir:"
+	    ;;
+	  *)
+	    # Relative path: add a thisdir entry.
+	    rpath="$rpath\$thisdir/$dir:"
+	    ;;
+	  esac
+	done
+	temp_rpath="$rpath"
+      fi
+
+      if test -n "$compile_shlibpath$finalize_shlibpath"; then
+	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+      fi
+      if test -n "$finalize_shlibpath"; then
+	finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+      fi
+
+      compile_var=
+      finalize_var=
+      if test -n "$runpath_var"; then
+	if test -n "$perm_rpath"; then
+	  # We should set the runpath_var.
+	  rpath=
+	  for dir in $perm_rpath; do
+	    rpath="$rpath$dir:"
+	  done
+	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+	fi
+	if test -n "$finalize_perm_rpath"; then
+	  # We should set the runpath_var.
+	  rpath=
+	  for dir in $finalize_perm_rpath; do
+	    rpath="$rpath$dir:"
+	  done
+	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+	fi
+      fi
+
+      if test "$no_install" = yes; then
+	# We don't need to create a wrapper script.
+	link_command="$compile_var$compile_command$compile_rpath"
+	# Replace the output file specification.
+	link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+	# Delete the old output file.
+	$run $rm $output
+	# Link the executable and exit
+	$show "$link_command"
+	$run eval "$link_command" || exit $?
+	exit $EXIT_SUCCESS
+      fi
+
+      if test "$hardcode_action" = relink; then
+	# Fast installation is not supported
+	link_command="$compile_var$compile_command$compile_rpath"
+	relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+	$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
+	$echo "$modename: \`$output' will be relinked during installation" 1>&2
+      else
+	if test "$fast_install" != no; then
+	  link_command="$finalize_var$compile_command$finalize_rpath"
+	  if test "$fast_install" = yes; then
+	    relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
+	  else
+	    # fast_install is set to needless
+	    relink_command=
+	  fi
+	else
+	  link_command="$compile_var$compile_command$compile_rpath"
+	  relink_command="$finalize_var$finalize_command$finalize_rpath"
+	fi
+      fi
+
+      # Replace the output file specification.
+      link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+      # Delete the old output files.
+      $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+      $show "$link_command"
+      $run eval "$link_command" || exit $?
+
+      # Now create the wrapper script.
+      $show "creating $output"
+
+      # Quote the relink command for shipping.
+      if test -n "$relink_command"; then
+	# Preserve any variables that may affect compiler behavior
+	for var in $variables_saved_for_relink; do
+	  if eval test -z \"\${$var+set}\"; then
+	    relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
+	  elif eval var_value=\$$var; test -z "$var_value"; then
+	    relink_command="$var=; export $var; $relink_command"
+	  else
+	    var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
+	    relink_command="$var=\"$var_value\"; export $var; $relink_command"
+	  fi
+	done
+	relink_command="(cd `pwd`; $relink_command)"
+	relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+      fi
+
+      # Quote $echo for shipping.
+      if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
+	case $progpath in
+	[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
+	*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
+	esac
+	qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
+      else
+	qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
+      fi
+
+      # Only actually do things if our run command is non-null.
+      if test -z "$run"; then
+	# win32 will think the script is a binary if it has
+	# a .exe suffix, so we strip it off here.
+	case $output in
+	  *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
+	esac
+	# test for cygwin because mv fails w/o .exe extensions
+	case $host in
+	  *cygwin*)
+	    exeext=.exe
+	    outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
+	  *) exeext= ;;
+	esac
+	case $host in
+	  *cygwin* | *mingw* )
+	    cwrappersource=`$echo ${objdir}/lt-${output}.c`
+	    cwrapper=`$echo ${output}.exe`
+	    $rm $cwrappersource $cwrapper
+	    trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+	    cat > $cwrappersource <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+   Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+
+   The $output program cannot be directly executed until all the libtool
+   libraries that it depends on are installed.
+
+   This wrapper executable should never be moved out of the build directory.
+   If it is, it will not operate correctly.
+
+   Currently, it simply execs the wrapper *script* "/bin/sh $output",
+   but could eventually absorb all of the scripts functionality and
+   exec $objdir/$outputname directly.
+*/
+EOF
+	    cat >> $cwrappersource<<"EOF"
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef DIR_SEPARATOR
+#define DIR_SEPARATOR '/'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+  defined (__OS2__)
+#define HAVE_DOS_BASED_FILE_SYSTEM
+#ifndef DIR_SEPARATOR_2
+#define DIR_SEPARATOR_2 '\\'
+#endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+        (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+  if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+const char *program_name = NULL;
+
+void * xmalloc (size_t num);
+char * xstrdup (const char *string);
+char * basename (const char *name);
+char * fnqualify(const char *path);
+char * strendzap(char *str, const char *pat);
+void lt_fatal (const char *message, ...);
+
+int
+main (int argc, char *argv[])
+{
+  char **newargz;
+  int i;
+
+  program_name = (char *) xstrdup ((char *) basename (argv[0]));
+  newargz = XMALLOC(char *, argc+2);
+EOF
+
+	    cat >> $cwrappersource <<EOF
+  newargz[0] = "$SHELL";
+EOF
+
+	    cat >> $cwrappersource <<"EOF"
+  newargz[1] = fnqualify(argv[0]);
+  /* we know the script has the same name, without the .exe */
+  /* so make sure newargz[1] doesn't end in .exe */
+  strendzap(newargz[1],".exe");
+  for (i = 1; i < argc; i++)
+    newargz[i+1] = xstrdup(argv[i]);
+  newargz[argc+1] = NULL;
+EOF
+
+	    cat >> $cwrappersource <<EOF
+  execv("$SHELL",newargz);
+EOF
+
+	    cat >> $cwrappersource <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+  void * p = (void *) malloc (num);
+  if (!p)
+    lt_fatal ("Memory exhausted");
+
+  return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+  return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
+;
+}
+
+char *
+basename (const char *name)
+{
+  const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  /* Skip over the disk name in MSDOS pathnames. */
+  if (isalpha (name[0]) && name[1] == ':')
+    name += 2;
+#endif
+
+  for (base = name; *name; name++)
+    if (IS_DIR_SEPARATOR (*name))
+      base = name + 1;
+  return (char *) base;
+}
+
+char *
+fnqualify(const char *path)
+{
+  size_t size;
+  char *p;
+  char tmp[LT_PATHMAX + 1];
+
+  assert(path != NULL);
+
+  /* Is it qualified already? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  if (isalpha (path[0]) && path[1] == ':')
+    return xstrdup (path);
+#endif
+  if (IS_DIR_SEPARATOR (path[0]))
+    return xstrdup (path);
+
+  /* prepend the current directory */
+  /* doesn't handle '~' */
+  if (getcwd (tmp, LT_PATHMAX) == NULL)
+    lt_fatal ("getcwd failed");
+  size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
+  p = XMALLOC(char, size);
+  sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
+  return p;
+}
+
+char *
+strendzap(char *str, const char *pat)
+{
+  size_t len, patlen;
+
+  assert(str != NULL);
+  assert(pat != NULL);
+
+  len = strlen(str);
+  patlen = strlen(pat);
+
+  if (patlen <= len)
+  {
+    str += len - patlen;
+    if (strcmp(str, pat) == 0)
+      *str = '\0';
+  }
+  return str;
+}
+
+static void
+lt_error_core (int exit_status, const char * mode,
+          const char * message, va_list ap)
+{
+  fprintf (stderr, "%s: %s: ", program_name, mode);
+  vfprintf (stderr, message, ap);
+  fprintf (stderr, ".\n");
+
+  if (exit_status >= 0)
+    exit (exit_status);
+}
+
+void
+lt_fatal (const char *message, ...)
+{
+  va_list ap;
+  va_start (ap, message);
+  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
+  va_end (ap);
+}
+EOF
+	  # we should really use a build-platform specific compiler
+	  # here, but OTOH, the wrappers (shell script and this C one)
+	  # are only useful if you want to execute the "real" binary.
+	  # Since the "real" binary is built for $host, then this
+	  # wrapper might as well be built for $host, too.
+	  $run $LTCC -s -o $cwrapper $cwrappersource
+	  ;;
+	esac
+	$rm $output
+	trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
+
+	$echo > $output "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='${SED} -e 1s/^X//'
+sed_quote_subst='$sed_quote_subst'
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+  # install mode needs the following variable:
+  notinst_deplibs='$notinst_deplibs'
+else
+  # When we are sourced in execute mode, \$file and \$echo are already set.
+  if test \"\$libtool_execute_magic\" != \"$magic\"; then
+    echo=\"$qecho\"
+    file=\"\$0\"
+    # Make sure echo works.
+    if test \"X\$1\" = X--no-reexec; then
+      # Discard the --no-reexec flag, and continue.
+      shift
+    elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
+      # Yippee, \$echo works!
+      :
+    else
+      # Restart under the correct shell, and then maybe \$echo will work.
+      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
+    fi
+  fi\
+"
+	$echo >> $output "\
+
+  # Find the directory that this script lives in.
+  thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
+  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+  # Follow symbolic links until we get to the real thisdir.
+  file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
+  while test -n \"\$file\"; do
+    destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+
+    # If there was a directory component, then change thisdir.
+    if test \"x\$destdir\" != \"x\$file\"; then
+      case \"\$destdir\" in
+      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+      *) thisdir=\"\$thisdir/\$destdir\" ;;
+      esac
+    fi
+
+    file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
+    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
+  done
+
+  # Try to get the absolute directory name.
+  absdir=\`cd \"\$thisdir\" && pwd\`
+  test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+	if test "$fast_install" = yes; then
+	  $echo >> $output "\
+  program=lt-'$outputname'$exeext
+  progdir=\"\$thisdir/$objdir\"
+
+  if test ! -f \"\$progdir/\$program\" || \\
+     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+    file=\"\$\$-\$program\"
+
+    if test ! -d \"\$progdir\"; then
+      $mkdir \"\$progdir\"
+    else
+      $rm \"\$progdir/\$file\"
+    fi"
+
+	  $echo >> $output "\
+
+    # relink executable if necessary
+    if test -n \"\$relink_command\"; then
+      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+      else
+	$echo \"\$relink_command_output\" >&2
+	$rm \"\$progdir/\$file\"
+	exit $EXIT_FAILURE
+      fi
+    fi
+
+    $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+    { $rm \"\$progdir/\$program\";
+      $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+    $rm \"\$progdir/\$file\"
+  fi"
+	else
+	  $echo >> $output "\
+  program='$outputname'
+  progdir=\"\$thisdir/$objdir\"
+"
+	fi
+
+	$echo >> $output "\
+
+  if test -f \"\$progdir/\$program\"; then"
+
+	# Export our shlibpath_var if we have one.
+	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+	  $echo >> $output "\
+    # Add our own library path to $shlibpath_var
+    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+    # Some systems cannot cope with colon-terminated $shlibpath_var
+    # The second colon is a workaround for a bug in BeOS R4 sed
+    $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
+
+    export $shlibpath_var
+"
+	fi
+
+	# fixup the dll searchpath if we need to.
+	if test -n "$dllsearchpath"; then
+	  $echo >> $output "\
+    # Add the dll search path components to the executable PATH
+    PATH=$dllsearchpath:\$PATH
+"
+	fi
+
+	$echo >> $output "\
+    if test \"\$libtool_execute_magic\" != \"$magic\"; then
+      # Run the actual program with our arguments.
+"
+	case $host in
+	# Backslashes separate directories on plain windows
+	*-*-mingw | *-*-os2*)
+	  $echo >> $output "\
+      exec \$progdir\\\\\$program \${1+\"\$@\"}
+"
+	  ;;
+
+	*)
+	  $echo >> $output "\
+      exec \$progdir/\$program \${1+\"\$@\"}
+"
+	  ;;
+	esac
+	$echo >> $output "\
+      \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
+      exit $EXIT_FAILURE
+    fi
+  else
+    # The program doesn't exist.
+    \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
+    \$echo \"This script is just a wrapper for \$program.\" 1>&2
+    $echo \"See the $PACKAGE documentation for more information.\" 1>&2
+    exit $EXIT_FAILURE
+  fi
+fi\
+"
+	chmod +x $output
+      fi
+      exit $EXIT_SUCCESS
+      ;;
+    esac
+
+    # See if we need to build an old-fashioned archive.
+    for oldlib in $oldlibs; do
+
+      if test "$build_libtool_libs" = convenience; then
+	oldobjs="$libobjs_save"
+	addlibs="$convenience"
+	build_libtool_libs=no
+      else
+	if test "$build_libtool_libs" = module; then
+	  oldobjs="$libobjs_save"
+	  build_libtool_libs=no
+	else
+	  oldobjs="$old_deplibs $non_pic_objects"
+	fi
+	addlibs="$old_convenience"
+      fi
+
+      if test -n "$addlibs"; then
+	gentop="$output_objdir/${outputname}x"
+	$show "${rm}r $gentop"
+	$run ${rm}r "$gentop"
+	$show "$mkdir $gentop"
+	$run $mkdir "$gentop"
+	status=$?
+	if test "$status" -ne 0 && test ! -d "$gentop"; then
+	  exit $status
+	fi
+	generated="$generated $gentop"
+
+	# Add in members from convenience archives.
+	for xlib in $addlibs; do
+	  # Extract the objects.
+	  case $xlib in
+	  [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+	  *) xabs=`pwd`"/$xlib" ;;
+	  esac
+	  xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
+	  xdir="$gentop/$xlib"
+
+	  $show "${rm}r $xdir"
+	  $run ${rm}r "$xdir"
+	  $show "$mkdir $xdir"
+	  $run $mkdir "$xdir"
+	  status=$?
+	  if test "$status" -ne 0 && test ! -d "$xdir"; then
+	    exit $status
+	  fi
+	  # We will extract separately just the conflicting names and we will no
+	  # longer touch any unique names. It is faster to leave these extract
+	  # automatically by $AR in one run.
+	  $show "(cd $xdir && $AR x $xabs)"
+	  $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+	  if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
+	    :
+	  else
+	    $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
+	    $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
+	    $AR t "$xabs" | sort | uniq -cd | while read -r count name
+	    do
+	      i=1
+	      while test "$i" -le "$count"
+	      do
+	       # Put our $i before any first dot (extension)
+	       # Never overwrite any file
+	       name_to="$name"
+	       while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
+	       do
+		 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
+	       done
+	       $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
+	       $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
+	       i=`expr $i + 1`
+	      done
+	    done
+	  fi
+
+	  oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
+	done
+      fi
+
+      # Do each command in the archive commands.
+      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+       cmds=$old_archive_from_new_cmds
+      else
+	eval cmds=\"$old_archive_cmds\"
+
+	if len=`expr "X$cmds" : ".*"` &&
+	     test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	  cmds=$old_archive_cmds
+	else
+	  # the command line is too long to link in one step, link in parts
+	  $echo "using piecewise archive linking..."
+	  save_RANLIB=$RANLIB
+	  RANLIB=:
+	  objlist=
+	  concat_cmds=
+	  save_oldobjs=$oldobjs
+	  # GNU ar 2.10+ was changed to match POSIX; thus no paths are
+	  # encoded into archives.  This makes 'ar r' malfunction in
+	  # this piecewise linking case whenever conflicting object
+	  # names appear in distinct ar calls; check, warn and compensate.
+	    if (for obj in $save_oldobjs
+	    do
+	      $echo "X$obj" | $Xsed -e 's%^.*/%%'
+	    done | sort | sort -uc >/dev/null 2>&1); then
+	    :
+	  else
+	    $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
+	    $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
+	    AR_FLAGS=cq
+	  fi
+	  # Is there a better way of finding the last object in the list?
+	  for obj in $save_oldobjs
+	  do
+	    last_oldobj=$obj
+	  done
+	  for obj in $save_oldobjs
+	  do
+	    oldobjs="$objlist $obj"
+	    objlist="$objlist $obj"
+	    eval test_cmds=\"$old_archive_cmds\"
+	    if len=`expr "X$test_cmds" : ".*"` &&
+	       test "$len" -le "$max_cmd_len"; then
+	      :
+	    else
+	      # the above command should be used before it gets too long
+	      oldobjs=$objlist
+	      if test "$obj" = "$last_oldobj" ; then
+	        RANLIB=$save_RANLIB
+	      fi
+	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+	      objlist=
+	    fi
+	  done
+	  RANLIB=$save_RANLIB
+	  oldobjs=$objlist
+	  if test "X$oldobjs" = "X" ; then
+	    eval cmds=\"\$concat_cmds\"
+	  else
+	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+	  fi
+	fi
+      fi
+      save_ifs="$IFS"; IFS='~'
+      for cmd in $cmds; do
+        eval cmd=\"$cmd\"
+	IFS="$save_ifs"
+	$show "$cmd"
+	$run eval "$cmd" || exit $?
+      done
+      IFS="$save_ifs"
+    done
+
+    if test -n "$generated"; then
+      $show "${rm}r$generated"
+      $run ${rm}r$generated
+    fi
+
+    # Now create the libtool archive.
+    case $output in
+    *.la)
+      old_library=
+      test "$build_old_libs" = yes && old_library="$libname.$libext"
+      $show "creating $output"
+
+      # Preserve any variables that may affect compiler behavior
+      for var in $variables_saved_for_relink; do
+	if eval test -z \"\${$var+set}\"; then
+	  relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
+	elif eval var_value=\$$var; test -z "$var_value"; then
+	  relink_command="$var=; export $var; $relink_command"
+	else
+	  var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
+	  relink_command="$var=\"$var_value\"; export $var; $relink_command"
+	fi
+      done
+      # Quote the link command for shipping.
+      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+      relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+      if test "$hardcode_automatic" = yes ; then
+	relink_command=
+      fi
+
+
+      # Only create the output if not a dry run.
+      if test -z "$run"; then
+	for installed in no yes; do
+	  if test "$installed" = yes; then
+	    if test -z "$install_libdir"; then
+	      break
+	    fi
+	    output="$output_objdir/$outputname"i
+	    # Replace all uninstalled libtool libraries with the installed ones
+	    newdependency_libs=
+	    for deplib in $dependency_libs; do
+	      case $deplib in
+	      *.la)
+		name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
+		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		if test -z "$libdir"; then
+		  $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
+		  exit $EXIT_FAILURE
+		fi
+		newdependency_libs="$newdependency_libs $libdir/$name"
+		;;
+	      *) newdependency_libs="$newdependency_libs $deplib" ;;
+	      esac
+	    done
+	    dependency_libs="$newdependency_libs"
+	    newdlfiles=
+	    for lib in $dlfiles; do
+	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+	      if test -z "$libdir"; then
+		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+		exit $EXIT_FAILURE
+	      fi
+	      newdlfiles="$newdlfiles $libdir/$name"
+	    done
+	    dlfiles="$newdlfiles"
+	    newdlprefiles=
+	    for lib in $dlprefiles; do
+	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+	      if test -z "$libdir"; then
+		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+		exit $EXIT_FAILURE
+	      fi
+	      newdlprefiles="$newdlprefiles $libdir/$name"
+	    done
+	    dlprefiles="$newdlprefiles"
+	  else
+	    newdlfiles=
+	    for lib in $dlfiles; do
+	      case $lib in
+		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+		*) abs=`pwd`"/$lib" ;;
+	      esac
+	      newdlfiles="$newdlfiles $abs"
+	    done
+	    dlfiles="$newdlfiles"
+	    newdlprefiles=
+	    for lib in $dlprefiles; do
+	      case $lib in
+		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+		*) abs=`pwd`"/$lib" ;;
+	      esac
+	      newdlprefiles="$newdlprefiles $abs"
+	    done
+	    dlprefiles="$newdlprefiles"
+	  fi
+	  $rm $output
+	  # place dlname in correct position for cygwin
+	  tdlname=$dlname
+	  case $host,$output,$installed,$module,$dlname in
+	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
+	  esac
+	  $echo > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$tdlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+	  if test "$installed" = no && test "$need_relink" = yes; then
+	    $echo >> $output "\
+relink_command=\"$relink_command\""
+	  fi
+	done
+      fi
+
+      # Do a symbolic link so that the libtool archive can be found in
+      # LD_LIBRARY_PATH before the program is installed.
+      $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
+      $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
+      ;;
+    esac
+    exit $EXIT_SUCCESS
+    ;;
+
+  # libtool install mode
+  install)
+    modename="$modename: install"
+
+    # There may be an optional sh(1) argument at the beginning of
+    # install_prog (especially on Windows NT).
+    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+       # Allow the use of GNU shtool's install command.
+       $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
+      # Aesthetically quote it.
+      arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
+      case $arg in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
+	arg="\"$arg\""
+	;;
+      esac
+      install_prog="$arg "
+      arg="$1"
+      shift
+    else
+      install_prog=
+      arg="$nonopt"
+    fi
+
+    # The real first argument should be the name of the installation program.
+    # Aesthetically quote it.
+    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+    case $arg in
+    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
+      arg="\"$arg\""
+      ;;
+    esac
+    install_prog="$install_prog$arg"
+
+    # We need to accept at least all the BSD install flags.
+    dest=
+    files=
+    opts=
+    prev=
+    install_type=
+    isdir=no
+    stripme=
+    for arg
+    do
+      if test -n "$dest"; then
+	files="$files $dest"
+	dest="$arg"
+	continue
+      fi
+
+      case $arg in
+      -d) isdir=yes ;;
+      -f) prev="-f" ;;
+      -g) prev="-g" ;;
+      -m) prev="-m" ;;
+      -o) prev="-o" ;;
+      -s)
+	stripme=" -s"
+	continue
+	;;
+      -*) ;;
+
+      *)
+	# If the previous option needed an argument, then skip it.
+	if test -n "$prev"; then
+	  prev=
+	else
+	  dest="$arg"
+	  continue
+	fi
+	;;
+      esac
+
+      # Aesthetically quote the argument.
+      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+      case $arg in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
+	arg="\"$arg\""
+	;;
+      esac
+      install_prog="$install_prog $arg"
+    done
+
+    if test -z "$install_prog"; then
+      $echo "$modename: you must specify an install program" 1>&2
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
+
+    if test -n "$prev"; then
+      $echo "$modename: the \`$prev' option requires an argument" 1>&2
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
+
+    if test -z "$files"; then
+      if test -z "$dest"; then
+	$echo "$modename: no file or destination specified" 1>&2
+      else
+	$echo "$modename: you must specify a destination" 1>&2
+      fi
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
+
+    # Strip any trailing slash from the destination.
+    dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
+
+    # Check to see that the destination is a directory.
+    test -d "$dest" && isdir=yes
+    if test "$isdir" = yes; then
+      destdir="$dest"
+      destname=
+    else
+      destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
+      test "X$destdir" = "X$dest" && destdir=.
+      destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
+
+      # Not a directory, so check to see that there is only one file specified.
+      set dummy $files
+      if test "$#" -gt 2; then
+	$echo "$modename: \`$dest' is not a directory" 1>&2
+	$echo "$help" 1>&2
+	exit $EXIT_FAILURE
+      fi
+    fi
+    case $destdir in
+    [\\/]* | [A-Za-z]:[\\/]*) ;;
+    *)
+      for file in $files; do
+	case $file in
+	*.lo) ;;
+	*)
+	  $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
+	  $echo "$help" 1>&2
+	  exit $EXIT_FAILURE
+	  ;;
+	esac
+      done
+      ;;
+    esac
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic="$magic"
+
+    staticlibs=
+    future_libdirs=
+    current_libdirs=
+    for file in $files; do
+
+      # Do each installation.
+      case $file in
+      *.$libext)
+	# Do the static libraries later.
+	staticlibs="$staticlibs $file"
+	;;
+
+      *.la)
+	# Check to see that this really is a libtool archive.
+	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+	else
+	  $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
+	  $echo "$help" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+
+	library_names=
+	old_library=
+	relink_command=
+	# If there is no directory component, then add one.
+	case $file in
+	*/* | *\\*) . $file ;;
+	*) . ./$file ;;
+	esac
+
+	# Add the libdir to current_libdirs if it is the destination.
+	if test "X$destdir" = "X$libdir"; then
+	  case "$current_libdirs " in
+	  *" $libdir "*) ;;
+	  *) current_libdirs="$current_libdirs $libdir" ;;
+	  esac
+	else
+	  # Note the libdir as a future libdir.
+	  case "$future_libdirs " in
+	  *" $libdir "*) ;;
+	  *) future_libdirs="$future_libdirs $libdir" ;;
+	  esac
+	fi
+
+	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
+	test "X$dir" = "X$file/" && dir=
+	dir="$dir$objdir"
+
+	if test -n "$relink_command"; then
+	  # Determine the prefix the user has applied to our future dir.
+	  inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
+
+	  # Don't allow the user to place us outside of our expected
+	  # location b/c this prevents finding dependent libraries that
+	  # are installed to the same prefix.
+	  # At present, this check doesn't affect windows .dll's that
+	  # are installed into $libdir/../bin (currently, that works fine)
+	  # but it's something to keep an eye on.
+	  if test "$inst_prefix_dir" = "$destdir"; then
+	    $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+
+	  if test -n "$inst_prefix_dir"; then
+	    # Stick the inst_prefix_dir data into the link command.
+	    relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+	  else
+	    relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+	  fi
+
+	  $echo "$modename: warning: relinking \`$file'" 1>&2
+	  $show "$relink_command"
+	  if $run eval "$relink_command"; then :
+	  else
+	    $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+	fi
+
+	# See the names of the shared library.
+	set dummy $library_names
+	if test -n "$2"; then
+	  realname="$2"
+	  shift
+	  shift
+
+	  srcname="$realname"
+	  test -n "$relink_command" && srcname="$realname"T
+
+	  # Install the shared library and build the symlinks.
+	  $show "$install_prog $dir/$srcname $destdir/$realname"
+	  $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
+	  if test -n "$stripme" && test -n "$striplib"; then
+	    $show "$striplib $destdir/$realname"
+	    $run eval "$striplib $destdir/$realname" || exit $?
+	  fi
+
+	  if test "$#" -gt 0; then
+	    # Delete the old symlinks, and create new ones.
+	    for linkname
+	    do
+	      if test "$linkname" != "$realname"; then
+		$show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
+		$run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
+	      fi
+	    done
+	  fi
+
+	  # Do each command in the postinstall commands.
+	  lib="$destdir/$realname"
+	  cmds=$postinstall_cmds
+	  save_ifs="$IFS"; IFS='~'
+	  for cmd in $cmds; do
+	    IFS="$save_ifs"
+	    eval cmd=\"$cmd\"
+	    $show "$cmd"
+	    $run eval "$cmd" || exit $?
+	  done
+	  IFS="$save_ifs"
+	fi
+
+	# Install the pseudo-library for information purposes.
+	name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+	instname="$dir/$name"i
+	$show "$install_prog $instname $destdir/$name"
+	$run eval "$install_prog $instname $destdir/$name" || exit $?
+
+	# Maybe install the static library, too.
+	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+	;;
+
+      *.lo)
+	# Install (i.e. copy) a libtool object.
+
+	# Figure out destination file name, if it wasn't already specified.
+	if test -n "$destname"; then
+	  destfile="$destdir/$destname"
+	else
+	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+	  destfile="$destdir/$destfile"
+	fi
+
+	# Deduce the name of the destination old-style object file.
+	case $destfile in
+	*.lo)
+	  staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
+	  ;;
+	*.$objext)
+	  staticdest="$destfile"
+	  destfile=
+	  ;;
+	*)
+	  $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
+	  $echo "$help" 1>&2
+	  exit $EXIT_FAILURE
+	  ;;
+	esac
+
+	# Install the libtool object if requested.
+	if test -n "$destfile"; then
+	  $show "$install_prog $file $destfile"
+	  $run eval "$install_prog $file $destfile" || exit $?
+	fi
+
+	# Install the old object if enabled.
+	if test "$build_old_libs" = yes; then
+	  # Deduce the name of the old-style object file.
+	  staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
+
+	  $show "$install_prog $staticobj $staticdest"
+	  $run eval "$install_prog \$staticobj \$staticdest" || exit $?
+	fi
+	exit $EXIT_SUCCESS
+	;;
+
+      *)
+	# Figure out destination file name, if it wasn't already specified.
+	if test -n "$destname"; then
+	  destfile="$destdir/$destname"
+	else
+	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+	  destfile="$destdir/$destfile"
+	fi
+
+	# If the file is missing, and there is a .exe on the end, strip it
+	# because it is most likely a libtool script we actually want to
+	# install
+	stripped_ext=""
+	case $file in
+	  *.exe)
+	    if test ! -f "$file"; then
+	      file=`$echo $file|${SED} 's,.exe$,,'`
+	      stripped_ext=".exe"
+	    fi
+	    ;;
+	esac
+
+	# Do a test to see if this is really a libtool program.
+	case $host in
+	*cygwin*|*mingw*)
+	    wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
+	    ;;
+	*)
+	    wrapper=$file
+	    ;;
+	esac
+	if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
+	  notinst_deplibs=
+	  relink_command=
+
+	  # To insure that "foo" is sourced, and not "foo.exe",
+	  # finese the cygwin/MSYS system by explicitly sourcing "foo."
+	  # which disallows the automatic-append-.exe behavior.
+	  case $build in
+	  *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
+	  *) wrapperdot=${wrapper} ;;
+	  esac
+	  # If there is no directory component, then add one.
+	  case $file in
+	  */* | *\\*) . ${wrapperdot} ;;
+	  *) . ./${wrapperdot} ;;
+	  esac
+
+	  # Check the variables that should have been set.
+	  if test -z "$notinst_deplibs"; then
+	    $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+
+	  finalize=yes
+	  for lib in $notinst_deplibs; do
+	    # Check to see that each library is installed.
+	    libdir=
+	    if test -f "$lib"; then
+	      # If there is no directory component, then add one.
+	      case $lib in
+	      */* | *\\*) . $lib ;;
+	      *) . ./$lib ;;
+	      esac
+	    fi
+	    libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
+	    if test -n "$libdir" && test ! -f "$libfile"; then
+	      $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
+	      finalize=no
+	    fi
+	  done
+
+	  relink_command=
+	  # To insure that "foo" is sourced, and not "foo.exe",
+	  # finese the cygwin/MSYS system by explicitly sourcing "foo."
+	  # which disallows the automatic-append-.exe behavior.
+	  case $build in
+	  *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
+	  *) wrapperdot=${wrapper} ;;
+	  esac
+	  # If there is no directory component, then add one.
+	  case $file in
+	  */* | *\\*) . ${wrapperdot} ;;
+	  *) . ./${wrapperdot} ;;
+	  esac
+
+	  outputname=
+	  if test "$fast_install" = no && test -n "$relink_command"; then
+	    if test "$finalize" = yes && test -z "$run"; then
+	      tmpdir="/tmp"
+	      test -n "$TMPDIR" && tmpdir="$TMPDIR"
+	      tmpdir="$tmpdir/libtool-$$"
+	      save_umask=`umask`
+	      umask 0077
+	      if $mkdir "$tmpdir"; then
+	        umask $save_umask
+	      else
+	        umask $save_umask
+		$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
+		continue
+	      fi
+	      file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
+	      outputname="$tmpdir/$file"
+	      # Replace the output file specification.
+	      relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+
+	      $show "$relink_command"
+	      if $run eval "$relink_command"; then :
+	      else
+		$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+		${rm}r "$tmpdir"
+		continue
+	      fi
+	      file="$outputname"
+	    else
+	      $echo "$modename: warning: cannot relink \`$file'" 1>&2
+	    fi
+	  else
+	    # Install the binary that we compiled earlier.
+	    file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+	  fi
+	fi
+
+	# remove .exe since cygwin /usr/bin/install will append another
+	# one anyways
+	case $install_prog,$host in
+	*/usr/bin/install*,*cygwin*)
+	  case $file:$destfile in
+	  *.exe:*.exe)
+	    # this is ok
+	    ;;
+	  *.exe:*)
+	    destfile=$destfile.exe
+	    ;;
+	  *:*.exe)
+	    destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
+	    ;;
+	  esac
+	  ;;
+	esac
+	$show "$install_prog$stripme $file $destfile"
+	$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
+	test -n "$outputname" && ${rm}r "$tmpdir"
+	;;
+      esac
+    done
+
+    for file in $staticlibs; do
+      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+
+      # Set up the ranlib parameters.
+      oldlib="$destdir/$name"
+
+      $show "$install_prog $file $oldlib"
+      $run eval "$install_prog \$file \$oldlib" || exit $?
+
+      if test -n "$stripme" && test -n "$old_striplib"; then
+	$show "$old_striplib $oldlib"
+	$run eval "$old_striplib $oldlib" || exit $?
+      fi
+
+      # Do each command in the postinstall commands.
+      cmds=$old_postinstall_cmds
+      save_ifs="$IFS"; IFS='~'
+      for cmd in $cmds; do
+	IFS="$save_ifs"
+	eval cmd=\"$cmd\"
+	$show "$cmd"
+	$run eval "$cmd" || exit $?
+      done
+      IFS="$save_ifs"
+    done
+
+    if test -n "$future_libdirs"; then
+      $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
+    fi
+
+    if test -n "$current_libdirs"; then
+      # Maybe just do a dry run.
+      test -n "$run" && current_libdirs=" -n$current_libdirs"
+      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+    else
+      exit $EXIT_SUCCESS
+    fi
+    ;;
+
+  # libtool finish mode
+  finish)
+    modename="$modename: finish"
+    libdirs="$nonopt"
+    admincmds=
+
+    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+      for dir
+      do
+	libdirs="$libdirs $dir"
+      done
+
+      for libdir in $libdirs; do
+	if test -n "$finish_cmds"; then
+	  # Do each command in the finish commands.
+	  cmds=$finish_cmds
+	  save_ifs="$IFS"; IFS='~'
+	  for cmd in $cmds; do
+	    IFS="$save_ifs"
+	    eval cmd=\"$cmd\"
+	    $show "$cmd"
+	    $run eval "$cmd" || admincmds="$admincmds
+       $cmd"
+	  done
+	  IFS="$save_ifs"
+	fi
+	if test -n "$finish_eval"; then
+	  # Do the single finish_eval.
+	  eval cmds=\"$finish_eval\"
+	  $run eval "$cmds" || admincmds="$admincmds
+       $cmds"
+	fi
+      done
+    fi
+
+    # Exit here if they wanted silent mode.
+    test "$show" = : && exit $EXIT_SUCCESS
+
+    $echo "----------------------------------------------------------------------"
+    $echo "Libraries have been installed in:"
+    for libdir in $libdirs; do
+      $echo "   $libdir"
+    done
+    $echo
+    $echo "If you ever happen to want to link against installed libraries"
+    $echo "in a given directory, LIBDIR, you must either use libtool, and"
+    $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+    $echo "flag during linking and do at least one of the following:"
+    if test -n "$shlibpath_var"; then
+      $echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
+      $echo "     during execution"
+    fi
+    if test -n "$runpath_var"; then
+      $echo "   - add LIBDIR to the \`$runpath_var' environment variable"
+      $echo "     during linking"
+    fi
+    if test -n "$hardcode_libdir_flag_spec"; then
+      libdir=LIBDIR
+      eval flag=\"$hardcode_libdir_flag_spec\"
+
+      $echo "   - use the \`$flag' linker flag"
+    fi
+    if test -n "$admincmds"; then
+      $echo "   - have your system administrator run these commands:$admincmds"
+    fi
+    if test -f /etc/ld.so.conf; then
+      $echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+    fi
+    $echo
+    $echo "See any operating system documentation about shared libraries for"
+    $echo "more information, such as the ld(1) and ld.so(8) manual pages."
+    $echo "----------------------------------------------------------------------"
+    exit $EXIT_SUCCESS
+    ;;
+
+  # libtool execute mode
+  execute)
+    modename="$modename: execute"
+
+    # The first argument is the command name.
+    cmd="$nonopt"
+    if test -z "$cmd"; then
+      $echo "$modename: you must specify a COMMAND" 1>&2
+      $echo "$help"
+      exit $EXIT_FAILURE
+    fi
+
+    # Handle -dlopen flags immediately.
+    for file in $execute_dlfiles; do
+      if test ! -f "$file"; then
+	$echo "$modename: \`$file' is not a file" 1>&2
+	$echo "$help" 1>&2
+	exit $EXIT_FAILURE
+      fi
+
+      dir=
+      case $file in
+      *.la)
+	# Check to see that this really is a libtool archive.
+	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+	else
+	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+	  $echo "$help" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+
+	# Read the libtool library.
+	dlname=
+	library_names=
+
+	# If there is no directory component, then add one.
+	case $file in
+	*/* | *\\*) . $file ;;
+	*) . ./$file ;;
+	esac
+
+	# Skip this library if it cannot be dlopened.
+	if test -z "$dlname"; then
+	  # Warn if it was a shared library.
+	  test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
+	  continue
+	fi
+
+	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+	test "X$dir" = "X$file" && dir=.
+
+	if test -f "$dir/$objdir/$dlname"; then
+	  dir="$dir/$objdir"
+	else
+	  $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+	;;
+
+      *.lo)
+	# Just add the directory containing the .lo file.
+	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+	test "X$dir" = "X$file" && dir=.
+	;;
+
+      *)
+	$echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
+	continue
+	;;
+      esac
+
+      # Get the absolute pathname.
+      absdir=`cd "$dir" && pwd`
+      test -n "$absdir" && dir="$absdir"
+
+      # Now add the directory to shlibpath_var.
+      if eval "test -z \"\$$shlibpath_var\""; then
+	eval "$shlibpath_var=\"\$dir\""
+      else
+	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+      fi
+    done
+
+    # This variable tells wrapper scripts just to set shlibpath_var
+    # rather than running their programs.
+    libtool_execute_magic="$magic"
+
+    # Check if any of the arguments is a wrapper script.
+    args=
+    for file
+    do
+      case $file in
+      -*) ;;
+      *)
+	# Do a test to see if this is really a libtool program.
+	if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	  # If there is no directory component, then add one.
+	  case $file in
+	  */* | *\\*) . $file ;;
+	  *) . ./$file ;;
+	  esac
+
+	  # Transform arg to wrapped name.
+	  file="$progdir/$program"
+	fi
+	;;
+      esac
+      # Quote arguments (to preserve shell metacharacters).
+      file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
+      args="$args \"$file\""
+    done
+
+    if test -z "$run"; then
+      if test -n "$shlibpath_var"; then
+	# Export the shlibpath_var.
+	eval "export $shlibpath_var"
+      fi
+
+      # Restore saved environment variables
+      if test "${save_LC_ALL+set}" = set; then
+	LC_ALL="$save_LC_ALL"; export LC_ALL
+      fi
+      if test "${save_LANG+set}" = set; then
+	LANG="$save_LANG"; export LANG
+      fi
+
+      # Now prepare to actually exec the command.
+      exec_cmd="\$cmd$args"
+    else
+      # Display what would be done.
+      if test -n "$shlibpath_var"; then
+	eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
+	$echo "export $shlibpath_var"
+      fi
+      $echo "$cmd$args"
+      exit $EXIT_SUCCESS
+    fi
+    ;;
+
+  # libtool clean and uninstall mode
+  clean | uninstall)
+    modename="$modename: $mode"
+    rm="$nonopt"
+    files=
+    rmforce=
+    exit_status=0
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic="$magic"
+
+    for arg
+    do
+      case $arg in
+      -f) rm="$rm $arg"; rmforce=yes ;;
+      -*) rm="$rm $arg" ;;
+      *) files="$files $arg" ;;
+      esac
+    done
+
+    if test -z "$rm"; then
+      $echo "$modename: you must specify an RM program" 1>&2
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
+
+    rmdirs=
+
+    origobjdir="$objdir"
+    for file in $files; do
+      dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+      if test "X$dir" = "X$file"; then
+	dir=.
+	objdir="$origobjdir"
+      else
+	objdir="$dir/$origobjdir"
+      fi
+      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+      test "$mode" = uninstall && objdir="$dir"
+
+      # Remember objdir for removal later, being careful to avoid duplicates
+      if test "$mode" = clean; then
+	case " $rmdirs " in
+	  *" $objdir "*) ;;
+	  *) rmdirs="$rmdirs $objdir" ;;
+	esac
+      fi
+
+      # Don't error if the file doesn't exist and rm -f was used.
+      if (test -L "$file") >/dev/null 2>&1 \
+	|| (test -h "$file") >/dev/null 2>&1 \
+	|| test -f "$file"; then
+	:
+      elif test -d "$file"; then
+	exit_status=1
+	continue
+      elif test "$rmforce" = yes; then
+	continue
+      fi
+
+      rmfiles="$file"
+
+      case $name in
+      *.la)
+	# Possibly a libtool archive, so verify it.
+	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	  . $dir/$name
+
+	  # Delete the libtool libraries and symlinks.
+	  for n in $library_names; do
+	    rmfiles="$rmfiles $objdir/$n"
+	  done
+	  test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
+	  test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+
+	  if test "$mode" = uninstall; then
+	    if test -n "$library_names"; then
+	      # Do each command in the postuninstall commands.
+	      cmds=$postuninstall_cmds
+	      save_ifs="$IFS"; IFS='~'
+	      for cmd in $cmds; do
+		IFS="$save_ifs"
+		eval cmd=\"$cmd\"
+		$show "$cmd"
+		$run eval "$cmd"
+		if test "$?" -ne 0 && test "$rmforce" != yes; then
+		  exit_status=1
+		fi
+	      done
+	      IFS="$save_ifs"
+	    fi
+
+	    if test -n "$old_library"; then
+	      # Do each command in the old_postuninstall commands.
+	      cmds=$old_postuninstall_cmds
+	      save_ifs="$IFS"; IFS='~'
+	      for cmd in $cmds; do
+		IFS="$save_ifs"
+		eval cmd=\"$cmd\"
+		$show "$cmd"
+		$run eval "$cmd"
+		if test "$?" -ne 0 && test "$rmforce" != yes; then
+		  exit_status=1
+		fi
+	      done
+	      IFS="$save_ifs"
+	    fi
+	    # FIXME: should reinstall the best remaining shared library.
+	  fi
+	fi
+	;;
+
+      *.lo)
+	# Possibly a libtool object, so verify it.
+	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+
+	  # Read the .lo file
+	  . $dir/$name
+
+	  # Add PIC object to the list of files to remove.
+	  if test -n "$pic_object" \
+	     && test "$pic_object" != none; then
+	    rmfiles="$rmfiles $dir/$pic_object"
+	  fi
+
+	  # Add non-PIC object to the list of files to remove.
+	  if test -n "$non_pic_object" \
+	     && test "$non_pic_object" != none; then
+	    rmfiles="$rmfiles $dir/$non_pic_object"
+	  fi
+	fi
+	;;
+
+      *)
+	if test "$mode" = clean ; then
+	  noexename=$name
+	  case $file in
+	  *.exe)
+	    file=`$echo $file|${SED} 's,.exe$,,'`
+	    noexename=`$echo $name|${SED} 's,.exe$,,'`
+	    # $file with .exe has already been added to rmfiles,
+	    # add $file without .exe
+	    rmfiles="$rmfiles $file"
+	    ;;
+	  esac
+	  # Do a test to see if this is a libtool program.
+	  if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	    relink_command=
+	    . $dir/$noexename
+
+	    # note $name still contains .exe if it was in $file originally
+	    # as does the version of $file that was added into $rmfiles
+	    rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
+	    if test "$fast_install" = yes && test -n "$relink_command"; then
+	      rmfiles="$rmfiles $objdir/lt-$name"
+	    fi
+	    if test "X$noexename" != "X$name" ; then
+	      rmfiles="$rmfiles $objdir/lt-${noexename}.c"
+	    fi
+	  fi
+	fi
+	;;
+      esac
+      $show "$rm $rmfiles"
+      $run $rm $rmfiles || exit_status=1
+    done
+    objdir="$origobjdir"
+
+    # Try to remove the ${objdir}s in the directories where we deleted files
+    for dir in $rmdirs; do
+      if test -d "$dir"; then
+	$show "rmdir $dir"
+	$run rmdir $dir >/dev/null 2>&1
+      fi
+    done
+
+    exit $exit_status
+    ;;
+
+  "")
+    $echo "$modename: you must specify a MODE" 1>&2
+    $echo "$generic_help" 1>&2
+    exit $EXIT_FAILURE
+    ;;
+  esac
+
+  if test -z "$exec_cmd"; then
+    $echo "$modename: invalid operation mode \`$mode'" 1>&2
+    $echo "$generic_help" 1>&2
+    exit $EXIT_FAILURE
+  fi
+fi # test -z "$show_help"
+
+if test -n "$exec_cmd"; then
+  eval exec $exec_cmd
+  exit $EXIT_FAILURE
+fi
+
+# We need to display help for each of the modes.
+case $mode in
+"") $echo \
+"Usage: $modename [OPTION]... [MODE-ARG]...
+
+Provide generalized library-building support services.
+
+    --config          show all configuration variables
+    --debug           enable verbose shell tracing
+-n, --dry-run         display commands without modifying any files
+    --features        display basic configuration information and exit
+    --finish          same as \`--mode=finish'
+    --help            display this help message and exit
+    --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
+    --quiet           same as \`--silent'
+    --silent          don't print informational messages
+    --tag=TAG         use configuration variables from tag TAG
+    --version         print version information
+
+MODE must be one of the following:
+
+      clean           remove files from the build directory
+      compile         compile a source file into a libtool object
+      execute         automatically set library path, then run a program
+      finish          complete the installation of libtool libraries
+      install         install libraries or executables
+      link            create a library or an executable
+      uninstall       remove libraries from an installed directory
+
+MODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
+a more detailed description of MODE.
+
+Report bugs to <bug-libtool@gnu.org>."
+  exit $EXIT_SUCCESS
+  ;;
+
+clean)
+  $echo \
+"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+  ;;
+
+compile)
+  $echo \
+"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
+  -prefer-pic       try to building PIC objects only
+  -prefer-non-pic   try to building non-PIC objects only
+  -static           always build a \`.o' file suitable for static linking
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+  ;;
+
+execute)
+  $echo \
+"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+  -dlopen FILE      add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+  ;;
+
+finish)
+  $echo \
+"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges.  Use
+the \`--dry-run' option if you just want to see what would be executed."
+  ;;
+
+install)
+  $echo \
+"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command.  The first component should be
+either the \`install' or \`cp' program.
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+  ;;
+
+link)
+  $echo \
+"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+  -all-static       do not do any dynamic linking at all
+  -avoid-version    do not add a version suffix if possible
+  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
+  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
+  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+  -export-symbols SYMFILE
+		    try to export only the symbols listed in SYMFILE
+  -export-symbols-regex REGEX
+		    try to export only the symbols matching REGEX
+  -LLIBDIR          search LIBDIR for required installed libraries
+  -lNAME            OUTPUT-FILE requires the installed library libNAME
+  -module           build a library that can dlopened
+  -no-fast-install  disable the fast-install mode
+  -no-install       link a not-installable executable
+  -no-undefined     declare that a library does not refer to external symbols
+  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
+  -objectlist FILE  Use a list of object files found in FILE to specify objects
+  -precious-files-regex REGEX
+                    don't remove output files matching REGEX
+  -release RELEASE  specify package release information
+  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
+  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
+  -static           do not do any dynamic linking of libtool libraries
+  -version-info CURRENT[:REVISION[:AGE]]
+		    specify library version info [each variable defaults to 0]
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename.  Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+  ;;
+
+uninstall)
+  $echo \
+"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+  ;;
+
+*)
+  $echo "$modename: invalid operation mode \`$mode'" 1>&2
+  $echo "$help" 1>&2
+  exit $EXIT_FAILURE
+  ;;
+esac
+
+$echo
+$echo "Try \`$modename --help' for more information about other modes."
+
+exit $EXIT_SUCCESS
+
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries.  Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them.  This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration.  But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+build_libtool_libs=no
+build_old_libs=yes
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
Index: /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/scaling.cpp
===================================================================
--- /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/scaling.cpp	(revision 4528)
+++ /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/scaling.cpp	(revision 4528)
@@ -0,0 +1,244 @@
+/**************************************************************************** 
+Copyright 2005,2006 Virginia Polytechnic Institute and State University
+
+This file is part of the OSSIE Signal Processing Library.
+
+OSSIE Signal Processing Library 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.
+
+OSSIE Signal Processing Library is distributed in the hope that it will be
+useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along
+with OSSIE Signal Processing Library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+****************************************************************************/
+
+#include "SigProc.h"
+
+namespace SigProc {
+
+//-----------------------------------------------------------------------------
+//
+// Automatic Gain Control class
+//
+//-----------------------------------------------------------------------------
+
+// default constructor
+AutomaticGainControl::AutomaticGainControl()
+{
+    energy_lo = 8192.0f;
+    energy_hi = 8192.0f;
+    energy_av = 8192.0f;
+    ka = 0.0001f;
+    kr = 0.000025f;
+    gmin = 0.0f;
+    gmax = 32768.0f;
+
+    gain = 1.0f;
+    energy = 0.0f;
+    zeta = 0.05;
+}
+
+// destructor
+AutomaticGainControl::~AutomaticGainControl()
+{
+}
+
+// set signal processing values
+void AutomaticGainControl::SetValues(
+  float _elo,
+  float _ehi,
+  float _ka,
+  float _kr,
+  float _gmin,
+  float _gmax)
+{
+    energy_lo = (_elo<0.0f) ? 0.0f : _elo;
+    energy_hi = (_ehi>32768.0f) ? 32768.0f : _ehi;
+    ka = _ka;
+    kr = _kr;
+    gmin = (_gmin<0.0f) ? 0.0f : _gmin;
+    gmax = (_gmax>32768.0f) ? 32768.0f : _gmax;
+
+    if ( gmin > gmax )
+    {
+        std::cout << "WARNING: SigProc::AutomaticGainControl: minimum gain "
+                  << "must be less than maximum gain"
+                  << std::endl;
+    }
+
+    if ( energy_lo > energy_hi )
+    {
+        std::cout << "WARNING: SigProc::AutomaticGainControl: low energy threshold "
+                  << "must be less than high energy threshold"
+                  << std::endl;
+    }
+
+    energy_av = 0.5*( energy_hi + energy_lo );
+}
+
+// get signal processing values
+void AutomaticGainControl::GetValues(
+  float & _elo,
+  float & _ehi,
+  float & _ka,
+  float & _kr,
+  float & _gmin,
+  float & _gmax)
+{
+    _elo = energy_lo;
+    _ehi = energy_hi;
+    _ka = ka;
+    _kr = kr;
+    _gmin = gmin;
+    _gmax = gmax;
+}
+
+// get status
+void AutomaticGainControl::GetStatus(float & _gain, float & _energy)
+{
+    _gain = gain;
+    _energy = energy;
+}
+
+// track signal energy and apply gain (real)
+void AutomaticGainControl::ApplyGain(short & I)
+{
+    // update energy value
+    // TODO: implement IIR low-pass filter
+    energy = (1-zeta)*energy + zeta*gain*abs(I);
+
+    // update gain value
+    ComputeGain();
+
+    // apply gain
+    I = short( I*gain );
+}
+
+// track signal energy and apply gain (complex)
+void AutomaticGainControl::ApplyGain(short & I, short & Q)
+{
+    short abs_I, abs_Q;
+    float energy_this, I_tmp, Q_tmp;
+
+    // update energy
+    // TODO: implement IIR low-pass filter
+    // NOTE: A good approximation to A=sqrt(I^2 + Q^2) is
+    //   A ~= max(|I|,|Q|) + 0.30059*min(|I|,|Q|)
+    // This yields a MSE of about -30dB
+    abs_I = abs(I);
+    abs_Q = abs(Q);
+    if ( abs_I > abs_Q )
+        energy_this = float(abs_I) + 0.30059f*float(abs_Q);
+    else
+        energy_this = float(abs_Q) + 0.30059f*float(abs_I);
+
+    energy = (1-zeta)*energy + zeta*gain*energy_this;
+
+    // update gain value
+    ComputeGain();
+
+    // apply gain to I-channel, prevent clipping
+    I_tmp = float(I)*gain;
+    if ( I_tmp > float(SHRT_MAX) )
+        I = SHRT_MAX;
+    else if ( I_tmp < -float(SHRT_MAX) )
+        I = -SHRT_MAX;
+    else
+        I = short(I_tmp);
+
+    // apply gain to Q-channel, prevent clipping
+    Q_tmp = float(Q)*gain;
+    if ( Q_tmp > float(SHRT_MAX) )
+        Q = SHRT_MAX;
+    else if ( Q_tmp < -float(SHRT_MAX) )
+        Q = -SHRT_MAX;
+    else
+        Q = short(Q_tmp);
+
+}
+
+// compute gain value from energy
+void AutomaticGainControl::ComputeGain()
+{
+    if (energy > energy_hi)
+    {
+        // energy too high; attack (decrease gain)
+        gain *= 1 - ka*(energy - energy_lo)/energy;
+    }
+    else if (energy < energy_lo)
+    {
+        // energy too low; release (increase gain)
+        gain *= 1 + kr*(energy_hi - energy)/energy_hi;
+    }
+    else if ( energy > energy_av )
+    {
+        gain *= 1 - ka*(energy - energy_av)/energy_av;
+    }
+    else if ( energy < energy_av )
+    {
+        gain *= 1 + kr*(energy_av - energy)/energy_av;
+    }
+    else
+    {
+        // energy is within acceptable limits; do nothing
+    }
+
+    // hard limit gain values
+    gain = (gain>gmax) ? gmax : gain;
+    gain = (gain<gmin) ? gmin : gain;
+}
+
+
+gain::gain()
+
+{
+
+}
+
+void gain::do_work(float gain, short data_in, short &out)
+{
+
+    float result = gain * data_in;
+
+    if (result > SHRT_MAX)
+	out = SHRT_MAX;
+    else if (result < SHRT_MIN)
+	out = SHRT_MIN;
+    else
+	out = (short) result;
+}
+
+dc_block::dc_block(float _f) : forget_factor(_f), prev_input(0), prev_output(0)
+{
+
+}
+
+void dc_block::do_work(short in, short &out)
+
+{
+
+    int diff = in - prev_input;
+    prev_input = in;
+
+    int out_val = diff + prev_output * forget_factor;
+    prev_output = out_val;
+
+    out_val *= 10;
+
+    if (out_val > SHRT_MAX)
+	out = SHRT_MAX;
+    else if (out_val < SHRT_MIN)
+	out = SHRT_MIN;
+    else
+	out = out_val;
+}
+
+} // namespace SigProc
Index: /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/.ignore
===================================================================
--- /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/.ignore	(revision 4528)
+++ /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/.ignore	(revision 4528)
@@ -0,0 +1,24 @@
+sigproc.pc
+libtool
+autotest
+autotest.cpp
+documentation
+html
+latex
+aclocal.m4
+install-sh
+missing
+.libs
+.deps
+config.guess
+config.sub
+Makefile
+config.log
+depcomp
+Makefile.in
+configure
+config.status
+autom4te.cache
+*.swp
+*.bak
+manual.pdf
Index: /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/configure.ac
===================================================================
--- /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/configure.ac	(revision 2275)
+++ /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/configure.ac	(revision 2275)
@@ -0,0 +1,38 @@
+AC_INIT(sigproc, 0.7.0)
+AC_PREREQ(2.59)
+
+AM_INIT_AUTOMAKE(nostdinc)
+
+AC_PROG_CXX
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+AC_PROG_LIBTOOL
+
+AC_ARG_ENABLE(fpm, AC_HELP_STRING([--enable-fpm=ARCH],
+                   [use ARCH-specific fixed-point math routines
+                    (one of: intel, arm, mips, sparc, ppc, 64bit, default)]),
+[
+    case "$enableval" in
+        yes)                             ;;
+        no|default|approx) FPM="DEFAULT" ;;
+        intel|i?86)        FPM="INTEL"   ;;
+        arm)               FPM="ARM"     ;;
+        mips)              FPM="MIPS"    ;;
+        sparc)             FPM="SPARC"   ;;
+        ppc|powerpc)       FPM="PPC"     ;;
+        64bit)             FPM="64BIT"   ;;
+        float)             FPM="FLOAT"   ;;
+        *)
+            AC_MSG_RESULT(failed)
+            AC_MSG_ERROR([bad --enable-fpm option])
+            ;;
+    esac
+
+    FPM="-DFPM_$FPM"
+
+])
+
+AC_SUBST(FPM)
+
+AC_CONFIG_FILES(Makefile sigproc.pc)
+AC_OUTPUT
Index: /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/fec_conv.cpp
===================================================================
--- /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/fec_conv.cpp	(revision 4766)
+++ /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/fec_conv.cpp	(revision 4766)
@@ -0,0 +1,436 @@
+/**************************************************************************** 
+Copyright 2005,2006 Virginia Polytechnic Institute and State University
+
+This file is part of the OSSIE Signal Processing Library.
+
+OSSIE Signal Processing Library 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.
+
+OSSIE Signal Processing Library is distributed in the hope that it will be
+useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along
+with OSSIE Signal Processing Library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+****************************************************************************/
+
+#include "SigProc.h"
+
+namespace SigProc {
+
+//----------------------------Trellis Entry-------------------------------------
+TrellisEntry::TrellisEntry()
+{
+    previousState=0;
+    symbolNo=0;
+    distance=-1;
+}
+
+TrellisEntry::~TrellisEntry()
+{
+
+
+}
+
+//----------------------------trellisTable--------------------------------------
+
+trellisTable::trellisTable(
+    unsigned int * generatorPolynomials,
+    unsigned short int k_in,
+    unsigned short int n_in,
+    unsigned short K_in)
+{
+    //Build trellis table
+    trellisTable::k=k_in;
+    trellisTable::n=n_in;
+    trellisTable::K=K_in;
+
+    //std::cout<<"Constructor, generatorPolynomials:";
+   // for (int i=0;i<n;i++){
+
+     //   std::cout<<generatorPolynomials[i]<<" ";
+    //}
+    //std::cout<<std::endl;
+
+    //std::cout<<"Input bits:"<<k<<" Contraint Length:"<<K<<std::endl;
+    trellisTable::nextState=NULL;
+    trellisTable::output=NULL;
+    trellisTable::GenerateTrellisTable(generatorPolynomials);
+}
+
+trellisTable::~trellisTable()
+{
+    //Deallocate memory
+    if (trellisTable::nextState!=NULL){
+        for (unsigned int i = 0; i < trellisTable::numberOfTrellisStates; i++){
+            delete []trellisTable::nextState[i];
+        }
+        delete []trellisTable::nextState;
+    }
+
+    if (trellisTable::output!=NULL){
+        for (unsigned int i = 0; i < trellisTable::numberOfTrellisStates; i++){
+            delete []trellisTable::output[i];
+        }
+        delete []trellisTable::output;
+    }
+}
+
+
+void trellisTable::GenerateTrellisTable(unsigned int * generatorPolynomials)
+{
+    numberOfTrellisStates=int(pow(2,(k*(K-1))));
+    numberOfInputStates=int(pow(2,k));
+
+    //std::cout<<"NumberOfTrellisStates="<<numberOfTrellisStates<<std::endl;
+    //std::cout<<"numberOfInputStates="<<numberOfInputStates<<std::endl;
+
+    nextState = new unsigned int *[numberOfTrellisStates];
+
+    for (unsigned int i = 0; i < numberOfTrellisStates; i++){
+        nextState[i] = new unsigned int[numberOfInputStates];
+    }
+
+
+    output = new unsigned int *[numberOfTrellisStates];
+    for (unsigned int i = 0; i < numberOfTrellisStates; i++){
+        output[i] = new unsigned int[numberOfInputStates];
+    }
+
+    unsigned int ENCregister=0, tempOut=0;
+
+    for (unsigned int tstate=0;tstate<numberOfTrellisStates;tstate++){
+        //std::cout<<tstate<<":";
+        for (unsigned short int inputIdx=0;inputIdx<numberOfInputStates;inputIdx++){
+
+            ENCregister=inputIdx*numberOfTrellisStates+tstate;
+            nextState[tstate][inputIdx]=(unsigned int)floor(ENCregister/pow(2,k));
+            tempOut=0;
+
+            for (unsigned short int bitNo=0;bitNo<n;bitNo++){
+                // std::cout<<"\nBitNo:"<<bitNo<<" ENCregister:"<<ENCregister<<" g:"<<generatorPolynomials[bitNo]<<" &:"<<(ENCregister&generatorPolynomials[bitNo])
+                //	<<"power:"<<(unsigned short int)pow(2,n-bitNo-1)<<"tempOut:"<<tempOut<<"\n";
+                // std::cout<<"Mod2add:"<<Modulo2BitWiseAdd((ENCregister&generatorPolynomials[bitNo])*(unsigned short int)pow(2,n-bitNo-1))<<"\n";
+
+                tempOut+=Modulo2BitWiseAdd(ENCregister&generatorPolynomials[bitNo])* (unsigned short int)pow(2,n-bitNo-1);
+            }
+            output[tstate][inputIdx]=tempOut;
+            //std::cout<<output[tstate][inputIdx]<<" ("<<nextState[tstate][inputIdx]<<") ";
+
+
+        }
+        //std::cout<<std::endl;
+    }
+}
+
+unsigned short int trellisTable::Modulo2BitWiseAdd(unsigned short int inputNumber)
+{
+    //std::cout<<"IN:"<<inputNumber;
+    unsigned int tempOut=0;
+    tempOut=inputNumber % 2;
+    inputNumber>>=1;
+
+    while (inputNumber>0){
+        tempOut^=inputNumber % 2;
+        inputNumber>>=1;
+    }
+    // std::cout<<" Out:"<<tempOut<<" ";
+    return tempOut;
+}
+
+
+//-------------------------------fec_conv--------------------------------------
+
+void fec_conv::SetTrellisTable(trellisTable *theTrellisTableIn)
+{
+    theTrellisTable=theTrellisTableIn;
+}
+
+void fec_conv::Dec2Bin(unsigned int decNumber,unsigned short int * outputData,unsigned short int numberOfBits)
+{
+    unsigned short int i;
+    for (i=numberOfBits;i>0;i--){
+        outputData[i-1]=decNumber % 2;
+
+        if (decNumber>0) decNumber>>=1;
+    }
+}
+
+fec_conv_encoder::fec_conv_encoder()
+{
+    currentState=0;
+}
+
+fec_conv_encoder::~fec_conv_encoder()
+{
+
+}
+
+void fec_conv_encoder::ResetState()
+{
+    currentState=0;
+}
+
+unsigned int fec_conv_encoder::GetState()
+{
+    return currentState;
+}
+
+void fec_conv_encoder::Encode(unsigned short int * inputData,unsigned short int * outputData)
+{
+    unsigned int inbits=0,tmp=0,outbits=0;
+
+    for (unsigned short int i=0;i<theTrellisTable->k;i++)    {
+        tmp=inputData[i];
+        //std::cout<<"inputData:"<<tmp<<"\n";
+        tmp<<=theTrellisTable->k-i-1;
+        //std::cout<<"temp"<<tmp<<"\n";
+        inbits+=tmp;
+    }
+    
+    if (inbits>(unsigned int)(theTrellisTable->numberOfInputStates-1)){
+        std::cout<<"ERROR:fec_conv_encoder::Encode inbits>numberOfInputStates-1";
+        std::cout<<"inbits:"<<inbits<<" numberOfInputStates:"<<theTrellisTable->numberOfInputStates;
+        throw 0;
+    };
+
+    //std::cout<<"state:"<<currentState<<" inbits:"<<inbits<<" outbits:"<<outbits<<"\n";
+    outbits=theTrellisTable->output[currentState][inbits];
+
+    currentState=theTrellisTable->nextState[currentState][inbits];
+    Dec2Bin(outbits,outputData,theTrellisTable->n);
+
+}
+
+//------------------------------Decoder-----------------------------------------
+fec_conv_decoder::fec_conv_decoder()
+{
+    tracedBackSymbols=NULL;
+    theTrellis=NULL;
+    decodedSymbolIndex=0;
+    currentTrellisIndex=0;
+    mode=0;
+}
+
+fec_conv_decoder::~fec_conv_decoder()
+{
+    if (tracedBackSymbols!=NULL) delete  []tracedBackSymbols;
+
+    if (theTrellis!=NULL){
+        for (unsigned int i = 0; i < theTrellisTable->numberOfTrellisStates; i++){
+            delete []theTrellis[i];
+        };
+        
+        delete []theTrellis;
+    }
+
+};
+void fec_conv_decoder::SetMode(unsigned short int mode)
+{
+    fec_conv_decoder::mode=mode;
+};
+
+void fec_conv_decoder::Reset()
+{
+    decodedSymbolIndex=0;
+    currentTrellisIndex=0;
+     for (unsigned int i=0;i<theTrellisTable->numberOfTrellisStates;i++)
+        for (unsigned int j=0;j<=noOfSymbols2TraceBack;j++){
+            theTrellis[i][j].previousState=0;
+            theTrellis[i][j].symbolNo=0;
+            theTrellis[i][j].distance=(signed int)-1;
+        }
+    theTrellis[0][0].distance=0;
+};
+
+void fec_conv_decoder::SetNoOfSymbols2TraceBack(unsigned int traceBackLength){
+    //std::cout<<theTrellis;
+
+    if (fec_conv_decoder::noOfSymbols2TraceBack!=traceBackLength){
+         fec_conv_decoder::noOfSymbols2TraceBack=traceBackLength;
+        if (theTrellis!=NULL){
+            for (unsigned int i = 0; i < theTrellisTable->numberOfTrellisStates; i++){
+                delete []theTrellis[i];
+            };
+            delete []theTrellis;
+            theTrellis=NULL;
+        }
+        //std::cout<<theTrellis;
+        //int dummy;
+        //std::cin>>dummy;
+
+    
+
+        theTrellis= new TrellisEntry*[theTrellisTable->numberOfTrellisStates];
+        for (unsigned int i = 0; i < theTrellisTable->numberOfTrellisStates; i++){
+         theTrellis[i] =new TrellisEntry[noOfSymbols2TraceBack+1];
+        };
+
+        if (tracedBackSymbols!=NULL){
+            delete []tracedBackSymbols;
+            tracedBackSymbols=NULL;
+        };
+    tracedBackSymbols = new unsigned int [noOfSymbols2TraceBack];
+
+    }
+/*
+    currentTrellisIndex=0;
+    for (unsigned int i=0;i<theTrellisTable->numberOfTrellisStates;i++)
+        for (unsigned int j=0;j<=noOfSymbols2TraceBack;j++){
+            theTrellis[i][j].previousState=0;
+            theTrellis[i][j].symbolNo=0;
+            theTrellis[i][j].distance=(signed int)-1;
+        }
+    theTrellis[0][0].distance=0;
+*/
+    fec_conv_decoder::Reset();
+}
+
+void fec_conv_decoder::Symbol2Decode(unsigned short int * inputData)
+{
+
+    unsigned int inbits=0,tmp=0,newState=0;
+    unsigned short int symbol;
+    signed int distance;
+
+   // inbits=0;
+    for (unsigned short int i=0;i<theTrellisTable->n;i++){
+        tmp=inputData[i];
+        //std::cout<<"inputData:"<<tmp<<"\n";
+        tmp<<=theTrellisTable->n-i-1;
+        //std::cout<<"temp"<<tmp<<"\n";
+        inbits+=tmp;
+    }
+
+   
+    //std::cout<<"inbits:"<<inbits<<"\n";
+    currentTrellisIndex++;
+
+    if (currentTrellisIndex>noOfSymbols2TraceBack){
+         std::cout<<"ERROR:fec_conv_decoder::Symbol2Decode currentTrellisIndex>Traceback length";
+        throw 0;
+    };
+
+     if (inbits>(unsigned int)(pow(2.0,(float)theTrellisTable->n)-1)){
+        std::cout<<"ERROR:fec_conv_decoder::Symbol2Decode inbits>2^n-1\n";
+        std::cout<<"inbits:"<<inbits<<"   2^n-1: "<<(unsigned int)pow(2.0,(float)theTrellisTable->n)-1
+            <<"n="<<theTrellisTable->n<<"\n";
+        throw 0;
+    };
+
+    //std::cout<<"currentTrellisIndex:"<<currentTrellisIndex<<"\n";
+    for (unsigned int tstate=0;tstate<theTrellisTable->numberOfTrellisStates;tstate++){
+        if (theTrellis[tstate][currentTrellisIndex-1].distance!=-1){
+            for (unsigned short int inputBits=0;inputBits<theTrellisTable->numberOfInputStates;inputBits++){
+                newState=theTrellisTable->nextState[tstate][inputBits];
+                symbol=theTrellisTable->output[tstate][inputBits];
+
+                distance=CalculateDistance(inbits,symbol)+theTrellis[tstate][currentTrellisIndex-1].distance; //Have to calculate;
+                if ((theTrellis[newState][currentTrellisIndex].distance==-1)||
+                        ((distance<theTrellis[newState][currentTrellisIndex].distance))||
+                        (theTrellis[newState][currentTrellisIndex].distance<0)){
+                    theTrellis[newState][currentTrellisIndex].distance=distance;
+                    theTrellis[newState][currentTrellisIndex].previousState=tstate;
+                    theTrellis[newState][currentTrellisIndex].symbolNo=inputBits;
+                };
+            };
+        }
+        else{
+        };
+
+    }
+
+    /*
+        for (unsigned int tstate=0;tstate<numberOfTrellisStates;tstate++)
+        {
+                    std::cout<<"["<<tstate<<"]["<<currentTrellisIndex<<"].previousState:"
+                       <<theTrellis[tstate][currentTrellisIndex].previousState<<".distance:"
+                        <<theTrellis[tstate][currentTrellisIndex].distance<<".symbol:"<<
+                        theTrellis[tstate][currentTrellisIndex].symbolNo<<"\n";
+        };
+    */
+};
+
+signed int fec_conv_decoder::CalculateDistance(unsigned short int inBits, unsigned short int symbol)
+{
+    unsigned short int tmp;
+    signed int distance=0;
+    tmp=inBits^symbol;
+
+    while (tmp>0){
+        distance+=(signed int)(tmp % 2);
+        tmp>>=1;
+    };
+    return distance;
+
+}
+
+void fec_conv_decoder::TraceBackTrellis(){
+    //std::cout<<"cTi:"<<currentTrellisIndex<<"; cS:"<<currentState<<";";
+    unsigned int currentState;
+    signed int minDistance=9999;
+    unsigned int minDistState=0;
+
+    if (currentTrellisIndex==noOfSymbols2TraceBack){
+        if (mode==1){
+            currentState=0;
+        } else{
+            for (unsigned int tstate=0;tstate<theTrellisTable->numberOfTrellisStates;tstate++)
+                if ((theTrellis[tstate][currentTrellisIndex].distance!=-1)
+                        &&(theTrellis[tstate][currentTrellisIndex].distance<minDistance)){
+                    minDistance=theTrellis[tstate][currentTrellisIndex].distance;
+                    minDistState=tstate;
+                };
+
+            currentState=minDistState;
+        }
+       // std::cout<<"\nMinDistance:"<<minDistance<<" minDistState:"<<minDistState<<"\n";
+
+
+        unsigned short int symbol;
+        while (currentTrellisIndex>0)
+        {
+            symbol=theTrellis[currentState][currentTrellisIndex].symbolNo;
+            currentState=theTrellis[currentState][currentTrellisIndex].previousState;
+            currentTrellisIndex--;
+            //Dec2Bin(symbol,outputData,k);
+            tracedBackSymbols[currentTrellisIndex]=symbol;
+            // std::cout<<"\nsymbol:"<<symbol<<"outputData"<<outputData[0]<<"\n";
+        }
+
+        decodedSymbolIndex=0;
+    }
+}
+
+void fec_conv_decoder::GetDecodedSymbol(unsigned short int * outputData)
+{
+    if (currentTrellisIndex==0){
+
+        if (decodedSymbolIndex<noOfSymbols2TraceBack){
+            Dec2Bin(tracedBackSymbols[decodedSymbolIndex],
+            outputData,
+            theTrellisTable->k);
+        } else {
+        std::cout<<"ERROR: fec_conv_decoder::GetDecodedSymbol attempt to get more symbols of what is available\n";
+        throw 0;
+    
+        }
+        
+        decodedSymbolIndex++;
+        
+    } else {
+        std::cout<<"ERROR: fec_conv_decoder::GetDecodedSymbol trellis wasnt traced back properly\n";
+        throw 0;
+    }
+}
+
+
+
+} // namespace SigProc
+
Index: /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/sources.cpp
===================================================================
--- /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/sources.cpp	(revision 4766)
+++ /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/sources.cpp	(revision 4766)
@@ -0,0 +1,59 @@
+/**************************************************************************** 
+Copyright 2005,2006 Virginia Polytechnic Institute and State University
+
+This file is part of the OSSIE Signal Processing Library.
+
+OSSIE Signal Processing Library 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.
+
+OSSIE Signal Processing Library is distributed in the hope that it will be
+useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along
+with OSSIE Signal Processing Library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+****************************************************************************/
+
+#include "SigProc.h"
+
+namespace SigProc {
+
+nco::nco(unsigned int max) : freq_index(0), max_out(max)
+{
+
+}
+
+nco::nco() : freq_index(0), max_out(-SHRT_MIN)
+{
+
+}
+
+void nco::do_work(short cv, short &sine, short &cosine)
+{
+    const int max_freq_index = 62832;
+    const double twopi = 6.2831853;
+
+    // cv allowed to be -USHRT_MAX/4 < cv < USHRT_MAX/4
+    // For large cv this gives four samples per cycle output
+    if (cv > USHRT_MAX/4)
+	cv = USHRT_MAX/4;
+    else if (cv < -USHRT_MAX/4)
+	cv = -USHRT_MAX/4;
+
+    freq_index += cv;
+    if (freq_index > max_freq_index)
+	freq_index = freq_index - max_freq_index;
+    else if (freq_index < 0)
+	freq_index = freq_index + max_freq_index;
+
+    sine = (short) (max_out * sin(twopi * freq_index / max_freq_index));
+    cosine = (short) (max_out * cos(twopi * freq_index / max_freq_index));
+}
+
+} // namespace SigProc
Index: /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/pll.cpp
===================================================================
--- /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/pll.cpp	(revision 4528)
+++ /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/pll.cpp	(revision 4528)
@@ -0,0 +1,53 @@
+/**************************************************************************** 
+Copyright 2005,2006 Virginia Polytechnic Institute and State University
+
+This file is part of the OSSIE Signal Processing Library.
+
+OSSIE Signal Processing Library 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.
+
+OSSIE Signal Processing Library is distributed in the hope that it will be
+useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along
+with OSSIE Signal Processing Library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+****************************************************************************/
+
+#include "SigProc.h"
+
+namespace SigProc {
+
+phase_detect::phase_detect(float _scale_factor) : scale_factor(_scale_factor)
+
+{
+
+}
+
+
+void phase_detect::do_work(short I_in, short Q_in, short I_nco, short Q_nco, short &out)
+
+{
+
+    float A, B; // temps for mixer output
+
+    A = I_in * Q_nco;
+    B = Q_in * I_nco;
+
+    int out_i = (A - B) / scale_factor * SHRT_MAX;
+
+    if (out_i > SHRT_MAX)
+	out = SHRT_MAX;
+    else if (out_i < SHRT_MIN)
+	out = SHRT_MIN;
+    else
+	out = (short) out_i;
+}
+
+} // namespace SigProc
Index: /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/genDocs.py
===================================================================
--- /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/genDocs.py	(revision 4394)
+++ /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/genDocs.py	(revision 4394)
@@ -0,0 +1,32 @@
+#!/usr/bin/env python
+
+import os
+
+def convertEPStoPNG(imgfilename):
+    '''converts .eps file to .png'''
+    # Try using command-line "convert"
+    epsfilename = imgfilename
+    pngfilename = os.path.splitext(imgfilename)[0] + '.png'
+    if os.system('convert ' + epsfilename + ' ' + pngfilename) != 0:
+        print "could not convert " + epsfilename + " using ImageMagick"
+        return False
+    return True
+
+def convertDirectoryEPStoPNG(imgdir):
+    '''converts .eps files to .png for a given directory'''
+    for i in os.listdir(imgdir):
+        imgfile = os.path.splitext(i)
+        if imgfile[1].lower() == ".eps":
+            print "converting " + imgdir + i + "..."
+            if convertEPStoPNG(imgdir + i) != True:
+                print "error"
+
+if __name__ == "__main__":
+    print "generating documentation..."
+
+    # convert all .eps files in directory to .png
+    convertDirectoryEPStoPNG('img/')
+
+    # run doxygen on default Doxyfile
+    os.system('doxygen Doxyfile')
+
Index: /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/Makefile.am
===================================================================
--- /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/Makefile.am	(revision 5571)
+++ /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/Makefile.am	(revision 5571)
@@ -0,0 +1,61 @@
+lib_LTLIBRARIES = libsigproc.la
+libsigproc_la_SOURCES =             \
+    filters.cpp                     \
+    butter.cpp                      \
+    pll.cpp                         \
+    scaling.cpp                     \
+    sequencing.cpp                  \
+    sources.cpp                     \
+    utility.cpp                     \
+    fec_conv.cpp                    \
+    fixed.c                         \
+    modem.cpp
+
+pkginclude_HEADERS = SigProc.h fixed.h
+
+libsigproc_la_LDFLAGS = -version-info 0:7:0
+
+AM_CXXFLAGS = -Wall -g -O3 $(FPM)
+AM_CFLAGS = -Wall -g -O3 $(FPM)
+
+pkgconfigdir = $(libdir)/pkgconfig
+dist_pkgconfig_DATA = sigproc.pc
+
+
+# --- autotest ---
+
+check_PROGRAMS = cxxtest autotest
+autotest_SOURCES = autotest.cpp
+autotest_LDADD =                    \
+    filters.o                       \
+    butter.o                        \
+    pll.o                           \
+    scaling.o                       \
+    sequencing.o                    \
+    sources.o                       \
+    utility.o                       \
+    modem.o                         \
+    fec_conv.o
+
+TESTS = autotest
+
+cxxtest:
+	cxxtestgen.py --error-printer -o autotest.cpp \
+	autotest_sources/FIRPolyphaseFilterBank_testsuite.h \
+	autotest_sources/IIRFilter_testsuite.h \
+	autotest_sources/CircularBuffer_testsuite.h \
+	autotest_sources/Modem_testsuite.h \
+	autotest_sources/DesignRRCFilter_testsuite.h \
+	autotest_sources/dot_product_testsuite.h \
+	autotest_sources/trig_testsuite.h \
+	autotest_sources/butter_testsuite.h \
+	autotest_sources/sequencing_testsuite.h \
+	autotest_sources/pack_testsuite.h \
+	autotest_sources/Fec_conv_testsuite.h
+
+# --- documentation ---
+.PHONY: docs documentation
+
+docs :
+	./genDocs.py
+
Index: /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/autotest_sources/Modem_testsuite.h
===================================================================
--- /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/autotest_sources/Modem_testsuite.h	(revision 5247)
+++ /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/autotest_sources/Modem_testsuite.h	(revision 5247)
@@ -0,0 +1,462 @@
+#ifndef __MODEMTEST_H__
+#define __MODEMTEST_H__
+
+#include <cxxtest/TestSuite.h>
+#include "../SigProc.h"
+
+using namespace SigProc;
+
+//
+// A simple test suite: Just inherit CxxTest::TestSuite and write tests!
+//
+
+// NOTE: " : public CxxTest::TestSuite" must be on the same line as the class
+//       definition, otherwise the python script does not recognize it
+//       as a test class
+class Modulator_testsuite1 : public CxxTest::TestSuite
+{
+public:
+
+    void test_ModulateBPSK() {
+        char bitsIn[2] = {0, 1};
+        short I_test[2] = {-BPSK_LEVEL, BPSK_LEVEL};
+        short Q_test[2] = {0, 0};
+        
+        short * I = new short[2];
+        short * Q = new short[2];
+
+        short symbol;
+        for (unsigned int i=0; i<2; i++) {
+            symbol = short(bitsIn[i]);
+            ModulateBPSK(symbol, I[i], Q[i]);
+        }
+
+        for (unsigned int i=0; i<2; i++) {
+            TS_ASSERT_EQUALS(I[i], I_test[i]);
+            TS_ASSERT_EQUALS(Q[i], Q_test[i]);
+        }
+
+        delete [] I;
+        delete [] Q;
+    }
+
+    void test_ModulateQPSK() {
+        char bitsIn[8] = {0, 0, 0, 1, 1, 0, 1, 1};
+        short I_test[4] = {QPSK_LEVEL,           0,           0, -QPSK_LEVEL};
+        short Q_test[4] = {         0, -QPSK_LEVEL,  QPSK_LEVEL,           0};
+        
+        short * I = new short[4];
+        short * Q = new short[4];
+
+        short symbol;
+        unsigned int j(0);
+        for (unsigned int i=0; i<8; i+=2, ++j) {
+            symbol = bitsIn[i+1] + (bitsIn[i] << 1);
+            ModulateQPSK(symbol, I[j], Q[j]);
+        }
+
+        for (unsigned int i=0; i<4; i++) {
+            TS_ASSERT_EQUALS(I[i], I_test[i]);
+            TS_ASSERT_EQUALS(Q[i], Q_test[i]);
+        }
+
+        delete [] I;
+        delete [] Q;
+    }
+
+
+
+    void test_ModulateQAM4() {
+        char bitsIn[8] = {0, 0, 0, 1, 1, 0, 1, 1};
+        short I_test[4] = {QAM4_LEVEL,  QAM4_LEVEL, -QAM4_LEVEL, -QAM4_LEVEL};
+        short Q_test[4] = {QAM4_LEVEL, -QAM4_LEVEL,  QAM4_LEVEL, -QAM4_LEVEL};
+        
+        short * I = new short[4];
+        short * Q = new short[4];
+
+        short symbol;
+        unsigned int j(0);
+        for (unsigned int i=0; i<8; i+=2, ++j) {
+            symbol = bitsIn[i+1] + (bitsIn[i] << 1);
+            ModulateQAM4(symbol, I[j], Q[j]);
+        }
+
+        for (unsigned int i=0; i<4; i++) {
+            TS_ASSERT_EQUALS(I[i], I_test[i]);
+            TS_ASSERT_EQUALS(Q[i], Q_test[i]);
+        }
+
+        delete [] I;
+        delete [] Q;
+    }
+
+
+    void test_Modulate8PSK() {
+        char bitsIn[24] = {0, 0, 0,
+                           0, 0, 1,
+                           0, 1, 0,
+                           0, 1, 1,
+                           1, 0, 0,
+                           1, 0, 1,
+                           1, 1, 0,
+                           1, 1, 1};
+
+        short I_test[8] = { PSK8_LEVEL_2,
+                            PSK8_LEVEL_1,
+                            PSK8_LEVEL_1,
+                                       0,
+                           -PSK8_LEVEL_1,
+                                       0,
+                           -PSK8_LEVEL_2,
+                           -PSK8_LEVEL_1};
+                           
+        short Q_test[8] = {            0,
+                            PSK8_LEVEL_1,
+                           -PSK8_LEVEL_1,
+                           -PSK8_LEVEL_2,
+                            PSK8_LEVEL_1,
+                            PSK8_LEVEL_2,
+                                       0,
+                           -PSK8_LEVEL_1};
+        
+        short * I = new short[8];
+        short * Q = new short[8];
+
+        short symbol;
+        unsigned int j(0);
+        for (unsigned int i=0; i<24; i+=3, ++j) {
+            symbol = bitsIn[i+2] + (bitsIn[i+1] << 1) + (bitsIn[i] << 2);
+            Modulate8PSK(symbol, I[j], Q[j]);
+        }
+
+        for (unsigned int i=0; i<8; i++) {
+            TS_ASSERT_EQUALS(I[i], I_test[i]);
+            TS_ASSERT_EQUALS(Q[i], Q_test[i]);
+        }
+
+        delete [] I;
+        delete [] Q;
+    }
+
+    void test_Modulate16QAM() {
+        short symbolsIn[16] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
+        short I_test[16] = {
+            -QAM16_LEVEL_2, // 0
+            -QAM16_LEVEL_2, // 1
+            -QAM16_LEVEL_2, // 2
+            -QAM16_LEVEL_2, // 3
+            -QAM16_LEVEL_1, // 4
+            -QAM16_LEVEL_1, // 5
+            -QAM16_LEVEL_1, // 6
+            -QAM16_LEVEL_1, // 7
+             QAM16_LEVEL_2, // 8
+             QAM16_LEVEL_2, // 9
+             QAM16_LEVEL_2, // 10
+             QAM16_LEVEL_2, // 11
+             QAM16_LEVEL_1, // 12
+             QAM16_LEVEL_1, // 13
+             QAM16_LEVEL_1, // 14
+             QAM16_LEVEL_1, // 15
+        };
+
+        short Q_test[16] = {
+             QAM16_LEVEL_2, // 0
+             QAM16_LEVEL_1, // 1
+            -QAM16_LEVEL_2, // 2
+            -QAM16_LEVEL_1, // 3
+             QAM16_LEVEL_2, // 4
+             QAM16_LEVEL_1, // 5
+            -QAM16_LEVEL_2, // 6
+            -QAM16_LEVEL_1, // 7
+             QAM16_LEVEL_2, // 8
+             QAM16_LEVEL_1, // 9
+            -QAM16_LEVEL_2, // 10
+            -QAM16_LEVEL_1, // 11
+             QAM16_LEVEL_2, // 12
+             QAM16_LEVEL_1, // 13
+            -QAM16_LEVEL_2, // 14
+            -QAM16_LEVEL_1, // 15
+        };
+        
+        short * I = new short[16];
+        short * Q = new short[16];
+
+        for (unsigned int i=0; i<16; i++) {
+            Modulate16QAM(symbolsIn[i], I[i], Q[i]);
+        }
+
+        for (unsigned int i=0; i<16; i++) {
+            TS_ASSERT_EQUALS(I[i], I_test[i]);
+            TS_ASSERT_EQUALS(Q[i], Q_test[i]);
+        }
+
+        delete [] I;
+        delete [] Q;
+    }
+
+    void test_Modulate4PAM() {
+        short symbolsIn[4] = {0, 1 ,2, 3};
+        short I_test[4] = {PAM4_LEVEL_2,  PAM4_LEVEL_1, -PAM4_LEVEL_2, -PAM4_LEVEL_1};
+        short Q_test[4] = {0, 0, 0, 0};
+        
+        short * I = new short[4];
+        short * Q = new short[4];
+
+        for (unsigned int i=0; i<4; i++) {
+            Modulate4PAM(symbolsIn[i], I[i], Q[i]);
+            TS_ASSERT_EQUALS(I[i], I_test[i]);
+            TS_ASSERT_EQUALS(Q[i], Q_test[i]);
+        }
+
+        delete [] I;
+        delete [] Q;
+    }
+
+};
+
+class Demodulator_testsuite1 : public CxxTest::TestSuite
+{
+public:    
+
+    void test_DemodulateBPSK() {
+        short I_in[2] = {-10, 10};
+        short Q_in[2] = {0, 0};
+
+        short symbols_test[2] = {0, 1};
+
+        short * symbols = new short[2];
+
+        for (unsigned int i=0; i<2; i++) {
+            DemodulateBPSK(I_in[i], Q_in[i], symbols[i]);
+            TS_ASSERT_EQUALS(symbols[i], symbols_test[i]);
+        }
+
+        delete [] symbols;
+    }
+
+    void test_DemodulateQPSK() {
+        short I_in[4] = {
+             10,    // 0
+              0,    // 1
+              0,    // 2
+            -10     // 3
+        };
+
+        short Q_in[4] = {
+              0,    // 0
+            -10,    // 1
+             10,    // 2
+              0     // 3
+        };
+
+        short symbols_test[4] = {0, 1, 2, 3};
+
+        short * symbols = new short[4];
+
+        for (unsigned int i=0; i<4; i++) {
+            DemodulateQPSK(I_in[i], Q_in[i], symbols[i]);
+            TS_ASSERT_EQUALS(symbols[i], symbols_test[i]);
+        }
+
+        delete [] symbols;
+    }
+    
+    void test_DemodulateQAM4() {
+        short I_in[4] = {
+             10,    // 0
+             10,    // 1
+            -10,    // 2
+            -10     // 3
+        };
+
+        short Q_in[4] = {
+             10,    // 0
+            -10,    // 1
+             10,    // 2
+            -10     // 3
+        };
+
+        short symbols_test[4] = {0, 1, 2, 3};
+
+        short * symbols = new short[4];
+
+        for (unsigned int i=0; i<4; i++) {
+            DemodulateQAM4(I_in[i], Q_in[i], symbols[i]);
+            TS_ASSERT_EQUALS(symbols[i], symbols_test[i]);
+        }
+
+        delete [] symbols;
+    }
+
+    void test_Demodulate8PSK() {
+        short I_in[8] = {
+             PSK8_LEVEL_2,  // 0
+             PSK8_LEVEL_1,  // 1
+             PSK8_LEVEL_1,  // 2
+                        0,  // 3
+            -PSK8_LEVEL_1,  // 4
+                        0,  // 5
+            -PSK8_LEVEL_2,  // 6
+            -PSK8_LEVEL_1,  // 7
+        };
+
+        short Q_in[8] = {
+                        0,  // 0
+             PSK8_LEVEL_1,  // 1
+            -PSK8_LEVEL_1,  // 2
+            -PSK8_LEVEL_2,  // 3
+             PSK8_LEVEL_1,  // 4
+             PSK8_LEVEL_2,  // 5
+                        0,  // 6
+            -PSK8_LEVEL_1,  // 7
+        };
+
+        short symbols_test[8] = {0, 1, 2, 3, 4, 5, 6, 7};
+
+        short * symbols = new short[8];
+
+        for (unsigned int i=0; i<8; i++) {
+            Demodulate8PSK(I_in[i], Q_in[i], symbols[i]);
+            TS_ASSERT_EQUALS(symbols[i], symbols_test[i]);
+        }
+
+        delete [] symbols;
+    }
+
+    void test_Demodulate16QAM() {
+        short I_in[16] = {
+            -QAM16_LEVEL_2, // 0
+            -QAM16_LEVEL_2, // 1
+            -QAM16_LEVEL_2, // 2
+            -QAM16_LEVEL_2, // 3
+            -QAM16_LEVEL_1, // 4
+            -QAM16_LEVEL_1, // 5
+            -QAM16_LEVEL_1, // 6
+            -QAM16_LEVEL_1, // 7
+             QAM16_LEVEL_2, // 8
+             QAM16_LEVEL_2, // 9
+             QAM16_LEVEL_2, // 10
+             QAM16_LEVEL_2, // 11
+             QAM16_LEVEL_1, // 12
+             QAM16_LEVEL_1, // 13
+             QAM16_LEVEL_1, // 14
+             QAM16_LEVEL_1, // 15
+        };
+
+        short Q_in[16] = {
+             QAM16_LEVEL_2, // 0
+             QAM16_LEVEL_1, // 1
+            -QAM16_LEVEL_2, // 2
+            -QAM16_LEVEL_1, // 3
+             QAM16_LEVEL_2, // 4
+             QAM16_LEVEL_1, // 5
+            -QAM16_LEVEL_2, // 6
+            -QAM16_LEVEL_1, // 7
+             QAM16_LEVEL_2, // 8
+             QAM16_LEVEL_1, // 9
+            -QAM16_LEVEL_2, // 10
+            -QAM16_LEVEL_1, // 11
+             QAM16_LEVEL_2, // 12
+             QAM16_LEVEL_1, // 13
+            -QAM16_LEVEL_2, // 14
+            -QAM16_LEVEL_1, // 15
+        };
+
+        short symbols_test[16] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
+
+        short * symbols = new short[16];
+
+        for (unsigned int i=0; i<16; i++) {
+            Demodulate16QAM(I_in[i], Q_in[i], symbols[i]);
+            TS_ASSERT_EQUALS(symbols[i], symbols_test[i]);
+        }
+
+        delete [] symbols;
+    }
+
+    void test_Demodulate4PAM() {
+        short I_in[4] = {
+             PAM4_LEVEL_2,    // 0
+             PAM4_LEVEL_1,    // 1
+            -PAM4_LEVEL_2,    // 2
+            -PAM4_LEVEL_1     // 3
+        };
+
+        short Q_in[4] = {0, 0, 0, 0};
+
+        short symbols_test[4] = {0, 1, 2, 3};
+
+        short * symbols = new short[4];
+
+        for (unsigned int i=0; i<4; i++) {
+            Demodulate4PAM(I_in[i], Q_in[i], symbols[i]);
+            TS_ASSERT_EQUALS(symbols[i], symbols_test[i]);
+        }
+
+        delete [] symbols;
+    }
+
+};
+
+class Modem_testsuite1 : public CxxTest::TestSuite
+{
+public:
+
+    void test_ModemBPSK() {
+        short I, Q, s;
+        for (unsigned int i=0; i<2; i++) {
+            ModulateBPSK(i, I, Q);
+            DemodulateBPSK(I, Q, s);
+            TS_ASSERT_EQUALS(i, s);
+        }
+    }
+
+    void test_ModemQPSK() {
+        short I, Q, s;
+        for (unsigned int i=0; i<4; i++) {
+            ModulateQPSK(i, I, Q);
+            DemodulateQPSK(I, Q, s);
+            TS_ASSERT_EQUALS(i, s);
+        }
+    }
+
+    void test_ModemQAM4() {
+        short I, Q, s;
+        for (unsigned int i=0; i<4; i++) {
+            ModulateQAM4(i, I, Q);
+            DemodulateQAM4(I, Q, s);
+            TS_ASSERT_EQUALS(i, s);
+        }
+    }
+
+    void test_Modem8PSK() {
+        short I, Q, s;
+        for (unsigned int i=0; i<8; i++) {
+            Modulate8PSK(i, I, Q);
+            Demodulate8PSK(I, Q, s);
+            TS_ASSERT_EQUALS(i, s);
+        }
+    }
+
+    void test_Modem16QAM() {
+        short I, Q, s;
+        for (unsigned int i=0; i<16; i++) {
+            Modulate16QAM(i, I, Q);
+            Demodulate16QAM(I, Q, s);
+            TS_ASSERT_EQUALS(i, s);
+        }
+    }
+
+    void test_Modem4PAM() {
+        short I, Q, s;
+        for (unsigned int i=0; i<4; i++) {
+            Modulate4PAM(i, I, Q);
+            Demodulate4PAM(I, Q, s);
+            TS_ASSERT_EQUALS(i, s);
+        }
+    }
+
+};
+
+#endif 
+
Index: /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/autotest_sources/sequencing_testsuite.h
===================================================================
--- /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/autotest_sources/sequencing_testsuite.h	(revision 4844)
+++ /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/autotest_sources/sequencing_testsuite.h	(revision 4844)
@@ -0,0 +1,39 @@
+#ifndef __SEQUENCING_TEST_H__
+#define __SEQUENCING_TEST_H__
+
+#include <cxxtest/TestSuite.h>
+#include "../SigProc.h"
+
+//
+// A simple test suite: Just inherit CxxTest::TestSuite and write tests!
+//
+
+class PNSequence_Testsuite : public CxxTest::TestSuite
+{
+public:
+
+    void test_constructor_01() {
+        unsigned long g(0x0007);
+        unsigned long a(0x0001);
+        SigProc::PNSequence pn(g, a);
+        TS_ASSERT_EQUALS(pn.m, 2);
+        TS_ASSERT_EQUALS(pn.n, 3);
+
+        // TODO: Generate output sequence
+    }
+
+    void test_constructor_02() {
+        unsigned long g(0x0043);
+        unsigned long a(0x0001);
+        SigProc::PNSequence pn(g, a);
+        TS_ASSERT_EQUALS(pn.m, 6);
+        TS_ASSERT_EQUALS(pn.n, 63);
+
+        // TODO: Generate output sequence
+    }
+
+};
+
+
+#endif // __SEQUENCING_TEST_H__
+
Index: /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/autotest_sources/Fec_conv_testsuite.h
===================================================================
--- /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/autotest_sources/Fec_conv_testsuite.h	(revision 4351)
+++ /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/autotest_sources/Fec_conv_testsuite.h	(revision 4351)
@@ -0,0 +1,289 @@
+#ifndef __FECCONVTEST_H__
+#define __FECCONVTEST_H__
+
+#include <cxxtest/TestSuite.h>
+#include "../SigProc.h"
+
+
+//
+// A simple test suite: Just inherit CxxTest::TestSuite and write tests!
+//
+
+// NOTE: " : public CxxTest::TestSuite" must be on the same line as the class
+//       definition, otherwise the python script does not recognize it
+//       as a test class
+class Fec_conv_Testsuite : public CxxTest::TestSuite
+{
+public:
+
+    void test_TrellisTable() {
+      unsigned int testVectorNextState[64] [4] = {{0,16,32,48},{0,16,32,48},{0,16,32,48},{0,16,32,48},{1,17,33,49},{1,17,33,49},{1,17,33,49},{1,17,33,49},{2,18,34,50},{2,18,34,50},{2,18,34,50},{2,18,34,50},{3,19,35,51},{3,19,35,51},{3,19,35,51},{3,19,35,51},{4,20,36,52},{4,20,36,52},{4,20,36,52},{4,20,36,52},{5,21,37,53},{5,21,37,53},{5,21,37,53},{5,21,37,53},{6,22,38,54},{6,22,38,54},{6,22,38,54},{6,22,38,54},{7,23,39,55},{7,23,39,55},{7,23,39,55},{7,23,39,55},{8,24,40,56,},{8,24,40,56},{8,24,40,56},{8,24,40,56},{9,25,41,57},{9,25,41,57},{9,25,41,57},{9,25,41,57},{10,26,42,58},{10,26,42,58},{10,26,42,58},{10,26,42,58},{11,27,43,59},{11,27,43,59},{11,27,43,59},{11,27,43,59},{12,28,44,60},{12,28,44,60},{12,28,44,60},{12,28,44,60},{13,29,45,61},{13,29,45,61},{13,29,45,61},{13,29,45,61},{14,30,46,62},{14,30,46,62},{14,30,46,62},{14,30,46,62},{15,31,47,63},{15,31,47,63},{15,31,47,63},{15,31,47,63}};
+
+        unsigned int testVectorOutput[64][4]={{0,3,5,6},{3,0,6,5},{5,6,0,3},{6,5,3,0},{7,4,2,1},{4,7,1,2},{2,1,7,4},{1,2,4,7},{7,4,2,1},{4,7,1,2},{2,1,7,4},{1,2,4,7},{0,3,5,6},{3,0,6,5},{5,6,0,3},{6,5,3,0},{5,6,0,3},{6,5,3,0},{0,3,5,6},{3,0,6,5},{2,1,7,4},{1,2,4,7},{7,4,2,1},{4,7,1,2},{2,1,7,4},{1,2,4,7},{7,4,2,1},{4,7,1,2},{5,6,0,3},{6,5,3,0},{0,3,5,6},{3,0,6,5},{2,1,7,4},{1,2,4,7},{7,4,2,1},{4,7,1,2},{5,6,0,3},{6,5,3,0},{0,3,5,6},{3,0,6,5},{5,6,0,3},{6,5,3,0},{0,3,5,6},{3,0,6,5},{2,1,7,4},{1,2,4,7},{7,4,2,1},{4,7,1,2},{7,4,2,1},{4,7,1,2},{2,1,7,4},{1,2,4,7},{0,3,5,6},{3,0,6,5},{5,6,0,3},{6,5,3,0},{0,3,5,6},{3,0,6,5},{5,6,0,3},{6,5,3,0},{7,4,2,1},{4,7,1,2},{2,1,7,4},{1,2,4,7},};
+        unsigned int genPoly[3];
+        genPoly[0]=158;
+        genPoly[1]=109;
+        genPoly[2]=223;
+        SigProc::trellisTable *theTrellisTable;
+        theTrellisTable=new SigProc::trellisTable(genPoly,
+                (short unsigned int)2,
+                (short unsigned int)3,
+                (short unsigned int)4);
+
+        //std::cout<<std::endl;
+
+        TS_ASSERT_EQUALS(theTrellisTable->numberOfTrellisStates,64);
+        TS_ASSERT_EQUALS(theTrellisTable->numberOfInputStates,4);
+        
+        for (unsigned int i=0; i<theTrellisTable->numberOfTrellisStates;i++){
+            //std::cout<<i<<"|";
+           // std::cout<<"{";
+            for (unsigned int j=0; j<theTrellisTable->numberOfInputStates;j++){
+
+                //std::cout<<theTrellisTable->nextState[i][j];
+              //  std::cout<<theTrellisTable->output[i][j];
+                //if (j!=3) std::cout<<",";
+
+            };
+
+           //std::cout<<"}"<<",";//std::endl;
+           TS_ASSERT_SAME_DATA(theTrellisTable->nextState[i],testVectorNextState[i],4*sizeof(unsigned int));
+           TS_ASSERT_SAME_DATA(theTrellisTable->output[i],testVectorOutput[i],4*sizeof(unsigned int));
+        };
+            
+       // TS_ASSERT_SAME_DATA(theTrellisTable->nextState[0],testVector1,4*sizeof(unsigned int));
+
+        //TS_ASSERT_EQUALS(1, 2);        
+        
+        delete theTrellisTable;
+
+    };
+
+    void testEncoder(){
+        unsigned int inputVector[20]={1,0,0,0,1,0,0,1,1,1,0,1,1,0,1,0,1,1,1,0};
+        unsigned int outputVector[35];
+        unsigned int outputVectorTest[35]={1,1,0,1,1,1,1,1,0,1,0,1,0,1,1,0,0,1,1,0,1,1,0,1,0,1,0,1,0,1,0,0,0,0,0};
+        unsigned short int data2Enc[20],encData[20],noOfSymbols=0;
+        signed short int tmp;
+        unsigned short int numberOfBits=0, numberOfOutBits=0;
+        unsigned int genPoly[5];
+        genPoly[0]=159;
+        genPoly[1]=188;
+        genPoly[2]=110;
+        genPoly[3]=173;
+        genPoly[4]=223;
+        SigProc::trellisTable *theTrellisTable;
+        theTrellisTable=new SigProc::trellisTable(genPoly,
+                (short unsigned int)4,
+                (short unsigned int)5,
+                (short unsigned int)2);
+        SigProc::fec_conv_encoder  * encoder;
+        encoder=new SigProc::fec_conv_encoder();
+        encoder->SetTrellisTable(theTrellisTable);
+ 
+        
+        numberOfBits=20;
+        noOfSymbols=numberOfBits/theTrellisTable->k;
+        unsigned short int mode =1;
+
+            ///Adjust the output lengh according to the encoding mode
+            switch (mode){
+                case 0:
+                    ///The encoder starts from zero state
+                    numberOfOutBits=noOfSymbols*theTrellisTable->n;
+                    break;
+                case 1:
+                    ///The encoder starts and ends at the zero state        
+                    numberOfOutBits=(noOfSymbols+theTrellisTable->K)*theTrellisTable->n;
+                    break;
+            };
+            
+            encoder->ResetState();
+            
+            for (unsigned int i=0;i<noOfSymbols;i++){
+                 for (unsigned int j=0;j<theTrellisTable->k;j++){
+                    data2Enc[j]=inputVector[i*theTrellisTable->k+j];
+                 };
+            
+               
+            
+                encoder->Encode(data2Enc,encData);
+        
+                for (int j=0;j<theTrellisTable->n;j++){
+                     tmp=(short int )encData[j];
+                   outputVector[i*theTrellisTable->n+j]=tmp;
+                  // std::cout<<tmp<<",";
+                 };
+            };
+
+            ///If mode=1 add additional symbols to make the last state of the encoder zero
+            if (mode==1){
+                    
+                 for (unsigned int j=0;j<theTrellisTable->k;j++){
+                    data2Enc[j]=0;
+                 };
+
+                  for (unsigned int i=noOfSymbols;i<noOfSymbols+theTrellisTable->K;i++){
+                            
+                         encoder->Encode(data2Enc,encData);
+        
+                        for (int j=0;j<theTrellisTable->n;j++){
+                         tmp=(short int )encData[j];
+                         outputVector[i*theTrellisTable->n+j]=tmp;
+                          //std::cout<<tmp<<",";
+                        };
+                       
+                };
+
+            }; //end if mode==1
+                       
+        TS_ASSERT_SAME_DATA(outputVector,outputVectorTest,numberOfOutBits*sizeof(unsigned int));
+        
+        delete theTrellisTable;
+        delete encoder;
+    };
+
+    void testEncoderAndDecoder(){
+        unsigned int inputVector[20]={1,0,0,0,1,0,0,1,1,1,0,1,1,0,1,0,1,1,1,0};
+        unsigned int outputVector[216];
+        unsigned int outputVectorTest[216]={1,1,1,1,1,1,1,1,1,0,1,1,0,0,1,0,0,0,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,0,0,0,0,0,1,0,0,0,0,1,1,1,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,1,1,0,0,0,1,0,1,1,1,0,0,0,1,1,1,0,1,0,1,1,0,1,0,0,1,1,0,0,0,0,0,0,1,0,1,1,0,0,1,1,0,0,1,1,0,0,0,1,1,1,0,0,1,1,1,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0,0,1,0,1,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,1,1,0,0,0,0,0,1,1,0,0,0,0,1,0,1,0,0,0,0,1,1,0,1,1,0,1,1,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+        unsigned short int data2Enc[20],encData[20],noOfSymbols=0;
+        signed short int tmp;
+        unsigned short int numberOfBits=0, numberOfOutBits=0;
+        unsigned int genPoly[8];
+        genPoly[0]=107;
+        genPoly[1]=73;
+        genPoly[2]=117;
+        genPoly[3]=123;
+        genPoly[4]=93;
+        genPoly[5]=93;
+        genPoly[6]=103;
+        genPoly[7]=95;
+        SigProc::trellisTable *theTrellisTable;
+        theTrellisTable=new SigProc::trellisTable(genPoly,
+                (short unsigned int)1,
+                (short unsigned int)8,
+                (short unsigned int)7);
+        SigProc::fec_conv_encoder  * encoder;
+        encoder=new SigProc::fec_conv_encoder();
+        encoder->SetTrellisTable(theTrellisTable);
+ 
+        
+        numberOfBits=20;
+        noOfSymbols=numberOfBits/theTrellisTable->k;
+        unsigned short int mode =1;
+
+            ///Adjust the output lengh according to the encoding mode
+            switch (mode){
+                case 0:
+                    ///The encoder starts from zero state
+                    numberOfOutBits=noOfSymbols*theTrellisTable->n;
+                    break;
+                case 1:
+                    ///The encoder starts and ends at the zero state        
+                    numberOfOutBits=(noOfSymbols+theTrellisTable->K)*theTrellisTable->n;
+                    break;
+            };
+            
+            encoder->ResetState();
+            
+            for (unsigned int i=0;i<noOfSymbols;i++){
+                 for (unsigned int j=0;j<theTrellisTable->k;j++){
+                    data2Enc[j]=inputVector[i*theTrellisTable->k+j];
+                 };
+            
+               
+            
+                encoder->Encode(data2Enc,encData);
+        
+                for (int j=0;j<theTrellisTable->n;j++){
+                     tmp=(short int )encData[j];
+                   outputVector[i*theTrellisTable->n+j]=tmp;
+                   //std::cout<<tmp<<",";
+                 };
+            };
+
+            ///If mode=1 add additional symbols to make the last state of the encoder zero
+            if (mode==1){
+                    
+                 for (unsigned int j=0;j<theTrellisTable->k;j++){
+                    data2Enc[j]=0;
+                 };
+
+                  for (unsigned int i=noOfSymbols;i<noOfSymbols+theTrellisTable->K;i++){
+                            
+                         encoder->Encode(data2Enc,encData);
+        
+                        for (int j=0;j<theTrellisTable->n;j++){
+                         tmp=(short int )encData[j];
+                         outputVector[i*theTrellisTable->n+j]=tmp;
+                          //std::cout<<tmp<<",";
+                        };
+                       
+                };
+
+            }; //end if mode==1
+                       
+        TS_ASSERT_SAME_DATA(outputVector,outputVectorTest,numberOfOutBits*sizeof(unsigned int));
+        
+        //DECODER PART
+        unsigned short int data2Dec[20],decData[20];
+        
+        SigProc::fec_conv_decoder  * decoder;
+        decoder=new SigProc::fec_conv_decoder();
+        decoder->SetTrellisTable(theTrellisTable);
+        
+
+        
+        numberOfBits=numberOfOutBits;
+        noOfSymbols=numberOfBits/theTrellisTable->n;
+ 
+        
+        ///Adjust the output lengh according to the encoding mode
+            switch (mode){
+                case 0:
+                    ///The encoder starts from zero state
+                    numberOfOutBits=noOfSymbols*theTrellisTable->k;
+                    decoder->SetMode(0);
+                    break;
+                case 1:
+                    ///The encoder starts and ends at the zero state        
+                    numberOfOutBits=(noOfSymbols-theTrellisTable->K)*theTrellisTable->k;
+                    decoder->SetMode(1);
+                    break;
+            };
+ 
+        decoder->SetNoOfSymbols2TraceBack(noOfSymbols);
+ 
+        for (unsigned int i=0;i<noOfSymbols;i++){
+            for (unsigned int j=0;j<theTrellisTable->n;j++){
+                data2Dec[j]=outputVector[i*theTrellisTable->n +j];
+
+            }
+            decoder->Symbol2Decode(data2Dec);
+        }
+        
+        decoder->TraceBackTrellis();
+
+        for (int i=0;i<numberOfOutBits/theTrellisTable->k;i++){
+            decoder->GetDecodedSymbol(decData);
+ 
+           for (int j=0;j<theTrellisTable->k;j++){
+            outputVector[i*theTrellisTable->k+j]=(short int )decData[j];
+            }
+        }
+
+        TS_ASSERT_SAME_DATA(outputVector,inputVector,numberOfOutBits*sizeof(unsigned int));
+        
+        
+        delete theTrellisTable;
+        delete encoder;
+    };
+};
+
+
+
+
+
+#endif 
+
Index: /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/autotest_sources/butter_testsuite.h
===================================================================
--- /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/autotest_sources/butter_testsuite.h	(revision 5571)
+++ /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/autotest_sources/butter_testsuite.h	(revision 5571)
@@ -0,0 +1,96 @@
+#ifndef __BUTTER_TEST_H__
+#define __BUTTER_TEST_H__
+
+#include <cxxtest/TestSuite.h>
+#include "../SigProc.h"
+
+//
+// A simple test suite: Just inherit CxxTest::TestSuite and write tests!
+//
+
+class design_butter_lowpass_filter_Testsuite : public CxxTest::TestSuite
+{
+public:
+
+    //
+    // Design 10th order low-pass filter
+    // MATLAB: [b, a] = butter(10, 0.25);
+    //
+    void test_01() {
+        float b_test[11] = {
+            1.105590991735961e-005,
+            1.105590991735961e-004,
+            4.975159462811823e-004,
+            1.326709190083153e-003,
+            2.321741082645518e-003,
+            2.786089299174621e-003,
+            2.321741082645518e-003,
+            1.326709190083153e-003,
+            4.975159462811823e-004,
+            1.105590991735961e-004,
+            1.105590991735961e-005};
+
+        float a_test[11] = {
+            1.000000000000000e+000,
+           -4.986985260650191e+000,
+            1.193643683523469e+001,
+           -1.774237180961925e+001,
+            1.797322796966024e+001,
+           -1.288624174593428e+001,
+            6.593202212793411e+000,
+           -2.369091691148871e+000,
+            5.706327055500219e-001,
+           -8.301767850386463e-002,
+            5.529714373462724e-003};
+        
+        float b[11];
+        float a[11];
+        
+        SigProc::design_butter_lowpass_filter(10, 0.25f, b, a);
+
+        for (unsigned int i=0; i<11; i++) {
+            TS_ASSERT_DELTA( b[i], b_test[i], 1E-08 );
+            TS_ASSERT_DELTA( a[i], a_test[i], 1E-08 );
+        }
+    }
+
+    //
+    // Design 7th order low-pass filter
+    // MATLAB: [b, a] = butter(7, 0.5);
+    //
+    void test_02() {
+        float b_test[8] = {
+            1.656529381997260e-002,
+            1.159570567398082e-001,
+            3.478711702194247e-001,
+            5.797852836990410e-001,
+            5.797852836990410e-001,
+            3.478711702194247e-001,
+            1.159570567398082e-001,
+            1.656529381997260e-002};
+
+        float a_test[8] = {
+            1.000000000000000e+000,
+           -8.430756093247283e-016,
+            9.199730030568897e-001,
+           -5.625706272110748e-016,
+            1.927011550380281e-001,
+           -9.603779416448762e-017,
+            7.683450861576624e-003,
+           -4.265172027549182e-019};
+
+        float b[8];
+        float a[8];
+        
+        SigProc::design_butter_lowpass_filter(7, 0.5f, b, a);
+
+        for (unsigned int i=0; i<8; i++) {
+            TS_ASSERT_DELTA( b[i], b_test[i], 1E-08 );
+            TS_ASSERT_DELTA( a[i], a_test[i], 1E-08 );
+        }
+    }
+};
+
+
+#endif // __BUTTER_TEST_H__
+
Index: /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/autotest_sources/trig_testsuite.h
===================================================================
--- /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/autotest_sources/trig_testsuite.h	(revision 5251)
+++ /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/autotest_sources/trig_testsuite.h	(revision 5251)
@@ -0,0 +1,122 @@
+#ifndef __TRIG_TEST_H__
+#define __TRIG_TEST_H__
+
+#include <cxxtest/TestSuite.h>
+#include "../SigProc.h"
+
+//
+// A simple test suite: Just inherit CxxTest::TestSuite and write tests!
+//
+
+class arctan_Testsuite : public CxxTest::TestSuite
+{
+public:
+
+    //
+    // arctan( float&, float&, float&)
+    //
+    
+    void test_float_float_float_limits() {
+        float x, y, theta;
+
+        x = 0.0f;
+        y = 1.0f;
+        arctan(x, y, theta);
+        TS_ASSERT_DELTA(theta, PI/2, 1e-9);
+
+        x = 0.0f;
+        y = -1.0f;
+        arctan(x, y, theta);
+        TS_ASSERT_DELTA(theta, 3*PI/2, 1e-9);
+
+        x = 0.0f;
+        y = 0.0f;
+        arctan(x, y, theta);
+        TS_ASSERT_DELTA(theta, PI/2, 1e-9);
+
+        x = 1.0;
+        y = 0.0f;
+        arctan(x, y, theta);
+        TS_ASSERT_DELTA(theta, 0, 1e-9);
+
+    }
+
+
+    void test_float_float_float_quadrants() {
+        float x, y, theta;
+
+        // Q1
+        x = 1.0f;
+        y = 1.0f;
+        arctan(x, y, theta);
+        TS_ASSERT_DELTA(theta, PI/4, 1e-9);
+
+        // Q2
+        x = -1.0f;
+        y = 1.0f;
+        arctan(x, y, theta);
+        TS_ASSERT_DELTA(theta, 3*PI/4, 1e-9);
+
+        // Q3
+        x = -1.0f;
+        y = -1.0f;
+        arctan(x, y, theta);
+        TS_ASSERT_DELTA(theta, 5*PI/4, 1e-9);
+
+        // Q4
+        x = 1.0f;
+        y = -1.0f;
+        arctan(x, y, theta);
+        TS_ASSERT_DELTA(theta, 7*PI/4, 1e-9);
+
+    }
+
+
+};
+
+class rotate_Testsuite : public CxxTest::TestSuite
+{
+  public:
+    void test_rotate_01() {
+        short I_out, Q_out;
+
+        // rotate by 180 degrees
+        rotate(1000, 0, PI, &I_out, &Q_out);
+        TS_ASSERT_DELTA(I_out, -1000, 1);
+        TS_ASSERT_DELTA(Q_out,     0, 1);
+
+        // rotate by 90 degrees
+        rotate(1000, 0, PI/2, &I_out, &Q_out);
+        TS_ASSERT_DELTA(I_out,     0, 1);
+        TS_ASSERT_DELTA(Q_out,  1000, 1);
+
+        // rotate by -90 degrees
+        rotate(1000, 0, -PI/2, &I_out, &Q_out);
+        TS_ASSERT_DELTA(I_out,     0, 1);
+        TS_ASSERT_DELTA(Q_out, -1000, 1);
+
+        // rotate by 45 degrees
+        rotate(1000, 0, PI/4, &I_out, &Q_out);
+        TS_ASSERT_DELTA(I_out, 707, 1);
+        TS_ASSERT_DELTA(Q_out, 707, 1);
+
+        // rotate by 135 degrees
+        rotate(1000, 0, 3*PI/4, &I_out, &Q_out);
+        TS_ASSERT_DELTA(I_out, -707, 1);
+        TS_ASSERT_DELTA(Q_out,  707, 1);
+
+        // rotate by 10 degrees
+        rotate(1000, 0, 10.0f*PI/180.0f, &I_out, &Q_out);
+        TS_ASSERT_DELTA(I_out, 985, 1);
+        TS_ASSERT_DELTA(Q_out, 174, 1);
+
+        // rotate by 112 degrees
+        rotate(1000, 0, -112.0f*PI/180.0f, &I_out, &Q_out);
+        TS_ASSERT_DELTA(I_out, -375, 1);
+        TS_ASSERT_DELTA(Q_out, -927, 1);
+
+    }
+};
+
+#endif // __TRIG_TEST_H__
+
Index: /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/autotest_sources/DesignRRCFilter_testsuite.h
===================================================================
--- /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/autotest_sources/DesignRRCFilter_testsuite.h	(revision 4995)
+++ /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/autotest_sources/DesignRRCFilter_testsuite.h	(revision 4995)
@@ -0,0 +1,94 @@
+#ifndef __DESIGNRRCFILTERTEST_H
+#define __DESIGNRRCFILTERTEST_H
+
+#include <cxxtest/TestSuite.h>
+#include "../SigProc.h"
+
+//
+// A simple test suite: Just inherit CxxTest::TestSuite and write tests!
+//
+
+class DesignRRCFilter_Testsuite : public CxxTest::TestSuite
+{
+public:
+    
+    void testRRCCoefficientGeneration1() {
+
+        // Initialize variables
+        unsigned int k(2), m(3);
+        float beta(0.3f);
+
+        // Initialize pre-determined coefficient arrays
+        float h0[13] = { -0.0331158, 0.0450158, 0.0565969, -0.1536039, -0.0750015,  0.6153450,
+               1.0819719, 0.6153450, -0.0750015, -0.1536039, 0.0565969, 0.0450158, -0.0331158};
+        
+        // Initialize output pointer and length variables
+        unsigned int h_len(2*k*m+1);
+        float * h = new float[h_len];
+        
+        // Generate filter coefficients
+        SigProc::DesignRRCFilter(k, m, beta, h);
+        
+        // Assert arrays are the same length
+        TS_ASSERT_EQUALS( h_len, 13 );
+        
+        // Ensure data are equal
+        for (unsigned int i=0; i<13; i++)
+            TS_ASSERT_DELTA( h[i], h0[i], 0.00001f );
+    }
+
+    void testRRCCoefficientGeneration2() {
+
+        // Initialize variables
+        unsigned int k(3), m(4);
+        float beta(0.25f);
+
+        // Initialize pre-determined coefficient arrays
+        float h0[25] = {
+           0.02122065907773706,
+           0.00168745629037681,
+          -0.03670787615581981,
+          -0.03751317973855786,
+           0.02604353638820331,
+           0.09088339559460432,
+           0.05305164737789306,
+          -0.09698416497476189,
+          -0.20462778400826262,
+          -0.06423715229557071,
+           0.36324068835899959,
+           0.85232463635308764,
+           1.06830988618379075,
+           0.85232463393678559,
+           0.36324068527424419,
+          -0.06423714516381475,
+          -0.20462778394232523,
+          -0.09698416398029090,
+           0.05305164801670376,
+           0.09088339542845345,
+           0.02604353589641688,
+          -0.03751317994120094,
+          -0.03670787597812086,
+           0.00168745650837126,
+           0.02122065908010170};
+
+        
+        // Initialize output pointer and length variables
+        unsigned int h_len(2*k*m+1);
+        float * h = new float[h_len];
+
+        // Generate filter coefficients
+        SigProc::DesignRRCFilter(k, m, beta, h);
+        
+        // Assert arrays are the same length
+        TS_ASSERT_EQUALS( h_len, 25 );
+        
+        // Ensure data are equal
+        for (unsigned int i=0; i<25; i++)
+            TS_ASSERT_DELTA( h[i], h0[i], 0.00001f );
+    }
+
+};
+
+
+#endif // __DESIGNRRCFILTERTEST_H
+
Index: /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/autotest_sources/dot_product_testsuite.h
===================================================================
--- /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/autotest_sources/dot_product_testsuite.h	(revision 4756)
+++ /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/autotest_sources/dot_product_testsuite.h	(revision 4756)
@@ -0,0 +1,135 @@
+#ifndef __DOT_PRODUCT_TEST_H__
+#define __DOT_PRODUCT_TEST_H__
+
+#include <cxxtest/TestSuite.h>
+#include "../SigProc.h"
+
+//
+// A simple test suite: Just inherit CxxTest::TestSuite and write tests!
+//
+
+class dot_product_Testsuite : public CxxTest::TestSuite
+{
+public:
+
+    //
+    // dot_product( float*, float*, unsigned int, float&)
+    //
+
+    void test_float_float_float_01() {
+        float x[4] = {0.0f, 0.0f, 0.0f, 0.0f};
+        float y[4] = {0.0f, 0.0f, 0.0f, 0.0f};
+        float z;
+        dot_product(x, y, 4, z);
+        TS_ASSERT_EQUALS(z, 0.0f);
+    }
+
+    void test_float_float_float_02() {
+        float x[4] = {100.0f, 100.0f, 100.0f, 100.0f};
+        float y[4] = {100.0f, 100.0f, 100.0f, 100.0f};
+        float z;
+        dot_product(x, y, 4, z);
+        TS_ASSERT_EQUALS(z, 40e3f);
+    }
+
+    void test_float_float_float_03() {
+        float x[4] = { 10.0f, -10.0f,  10.0f, -10.0f};
+        float y[4] = { 10.0f, -10.0f,  10.0f, -10.0f};
+        float z;
+        dot_product(x, y, 4, z);
+        TS_ASSERT_EQUALS(z, 400);
+    }
+
+    void test_float_float_float_04() {
+        float x[4] = {-10.0f,  10.0f, -10.0f,  10.0f};
+        float y[4] = { 10.0f, -10.0f,  10.0f, -10.0f};
+        float z;
+        dot_product(x, y, 4, z);
+        TS_ASSERT_EQUALS(z, -400.0f);
+    }
+
+    void test_float_float_float_05() {
+        float x[4] = { 10.0f,  10.0f, -10.0f, -10.0f};
+        float y[4] = { 10.0f,  10.0f,  10.0f,  10.0f};
+        float z;
+        dot_product(x, y, 4, z);
+        TS_ASSERT_EQUALS(z, 0.0f);
+    }
+
+
+    //
+    // dot_product( short*, short*, unsigned int, short&)
+    //
+
+    void test_short_short_short_01() {
+        short x[4] = {0, 0, 0, 0};
+        short y[4] = {0, 0, 0, 0};
+        short z;
+        dot_product(x, y, 4, z);
+        TS_ASSERT_EQUALS(z, 0);
+    }
+
+    void test_short_short_short_02() {
+        short x[4] = {100, 100, 100, 100};
+        short y[4] = {100, 100, 100, 100};
+        short z;
+        dot_product(x, y, 4, z);
+        TS_ASSERT_EQUALS(z, SHRT_MAX);
+    }
+
+    void test_short_short_short_03() {
+        short x[4] = { 10, -10,  10, -10};
+        short y[4] = { 10, -10,  10, -10};
+        short z;
+        dot_product(x, y, 4, z);
+        TS_ASSERT_EQUALS(z, 400);
+    }
+
+    void test_short_short_short_04() {
+        short x[4] = {-10,  10, -10,  10};
+        short y[4] = { 10, -10,  10, -10};
+        short z;
+        dot_product(x, y, 4, z);
+        TS_ASSERT_EQUALS(z, -400);
+    }
+
+    void test_short_short_short_05() {
+        short x[4] = { 10,  10, -10, -10};
+        short y[4] = { 10,  10,  10,  10};
+        short z;
+        dot_product(x, y, 4, z);
+        TS_ASSERT_EQUALS(z, 0);
+    }
+
+    //
+    // dot_product( float*, short*, unsigned int, short&)
+    //
+
+    void test_float_short_short_01() {
+        float x[4] = {100.0f, 100.0f, 100.0f, 100.0f};
+        short y[4] = {100,    100,    100,    100   };
+        short z;
+        dot_product(x, y, 4, z);
+        TS_ASSERT_EQUALS(z, SHRT_MAX);
+    }
+
+    //
+    // dot_product( float*, short*, unsigned int, float&)
+    //
+
+    void test_float_short_float_01() {
+        float x[4] = {100.0f, 100.0f, 100.0f, 100.0f};
+        short y[4] = {100,    100,    100,    100   };
+        float z;
+        dot_product(x, y, 4, z);
+        TS_ASSERT_EQUALS(z, 40e3f);
+    }
+
+
+
+
+};
+
+
+#endif // __DOT_PRODUCT_TEST_H__
+
Index: /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/autotest_sources/FIRPolyphaseFilterBank_testsuite.h
===================================================================
--- /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/autotest_sources/FIRPolyphaseFilterBank_testsuite.h	(revision 4759)
+++ /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/autotest_sources/FIRPolyphaseFilterBank_testsuite.h	(revision 4759)
@@ -0,0 +1,314 @@
+#ifndef __FIRPOLYPHASEFILTERBANKTEST_H
+#define __FIRPOLYPHASEFILTERBANKTEST_H
+
+#include <cxxtest/TestSuite.h>
+#include "../SigProc.h"
+
+//
+// A simple test suite: Just inherit CxxTest::TestSuite and write tests!
+//
+
+class FIRPolyphaseFilterBank_Testsuite : public CxxTest::TestSuite
+{
+public:
+
+    void testRRCCoefficientGeneration() {
+
+        // Initialize variables
+        unsigned int k(2), m(3), N(4);
+        float beta(0.3f);
+
+        // Initialize pre-determined coefficient arrays
+        float f0[12] = { -0.0331158, 0.0450158, 0.0565969, -0.1536039, -0.0750015, 0.6153450,
+                          1.0819719, 0.6153450, -0.0750015, -0.1536039, 0.0565969, 0.0450158};
+
+        float f1[12] = { -0.0241806, 0.0680333, 0.0164026,-0.1899441, 0.0545106, 0.8003868,
+                          1.0480679, 0.4157985, -0.1583851, -0.0986099, 0.0781768, 0.0182609};
+
+        float f2[12] = { -0.0062840, 0.0809189, -0.0381061, -0.1948991, 0.2226868, 0.9503798,
+                          0.9503798, 0.2226868, -0.1948991, -0.0381061, 0.0809189, -0.0062840};
+
+        float f3[12] = { 0.0182609, 0.0781768, -0.0986099, -0.1583851, 0.4157985, 1.0480679,
+                         0.8003868, 0.0545106, -0.1899441, 0.0164026, 0.0680333, -0.0241806};
+        
+        SigProc::FIRPolyphaseFilterBank f("rrcos", k, m, beta, N);
+        
+        TS_ASSERT_EQUALS( f.GetNumFilters(), N );
+        
+        // 12 = 2*k*m
+        TS_ASSERT_EQUALS( f.GetFilterLength(), 12 );
+        
+        float * H = f.GetFilterBankCoefficients();
+        
+        for (unsigned int i=0; i<12; i++) {
+            // Need to multiply by 'k' to compensate for filterbank scaling
+            TS_ASSERT_DELTA( H[0 +i]*k, f0[i], 0.00001f );
+            TS_ASSERT_DELTA( H[12+i]*k, f1[i], 0.00001f );
+            TS_ASSERT_DELTA( H[24+i]*k, f2[i], 0.00001f );
+            TS_ASSERT_DELTA( H[36+i]*k, f3[i], 0.00001f );
+        }
+    }
+
+    void testDerivativeRRCCoefficientGeneration() {
+        // Initialize variables
+        unsigned int k(2), m(3), N(4);
+        float beta(0.3f);
+
+        // Initialize pre-determined coefficient arrays
+        float f0[12] = { 1.0888e-10,  2.4886e-02, -3.0887e-02, -4.5667e-02,  1.0645e-01,  1.9229e-01,
+                        -5.3702e-10, -1.9229e-01, -1.0645e-01,  4.5667e-02,  3.0887e-02, -2.4886e-02};
+
+        float f1[12] = { 1.3416e-02,  1.7952e-02, -4.7352e-02, -2.0648e-02,  1.4884e-01,  1.6752e-01,
+                        -6.5796e-02, -1.9633e-01, -5.9949e-02,  5.7749e-02 , 1.2161e-02, -2.5650e-02};
+
+        float f2[12] = { 2.1221e-02,  5.0718e-03, -5.7506e-02,  1.5779e-02,  1.8064e-01,  1.2384e-01,
+                        -1.2384e-01, -1.8064e-01, -1.5779e-02,  5.7506e-02, -5.0718e-03, -2.1221e-02};
+
+        float f3[12] = { 2.5650e-02, -1.2161e-02, -5.7749e-02,  5.9949e-02,  1.9633e-01,  6.5796e-02,
+                        -1.6752e-01, -1.4884e-01,  2.0648e-02,  4.7352e-02, -1.7952e-02, -1.3416e-02};
+
+        SigProc::FIRPolyphaseFilterBank f("drrcos", k, m, beta, N);
+
+        TS_ASSERT_EQUALS( f.GetNumFilters(), N );
+
+        // 12 = 2*k*m
+        TS_ASSERT_EQUALS( f.GetFilterLength(), 12 );
+
+        float * H = f.GetFilterBankCoefficients();
+        
+        for (unsigned int i=0; i<12; i++) {
+            // Need to multiply by 'k' to compensate for filterbank scaling
+            TS_ASSERT_DELTA( H[0 +i]*k, f0[i], 0.00001f );
+            TS_ASSERT_DELTA( H[12+i]*k, f1[i], 0.00001f );
+            TS_ASSERT_DELTA( H[24+i]*k, f2[i], 0.00001f );
+            TS_ASSERT_DELTA( H[36+i]*k, f3[i], 0.00001f );
+        }
+
+    }
+    
+    void testLowSignalLevel() {
+        // Precision underflow
+    }
+
+    void testHighSignalLevel() {
+        // Precision overflow
+
+        // Initialize variables
+        float h[1] = {2*float(SHRT_MAX)};
+        short y;        // output
+
+        // Load filter coefficients externally
+        SigProc::FIRPolyphaseFilterBank f(h, 1, 1);
+
+        f.PushInput(10);
+        f.ComputeOutput(y, 0);
+        TS_ASSERT_EQUALS(y, SHRT_MAX);
+
+        f.ResetBuffer();
+
+        f.PushInput(-10);
+        f.ComputeOutput(y, 0);
+        TS_ASSERT_EQUALS(y, SHRT_MIN);
+    }
+
+    void testImpulseResponse() {
+        
+        // Initialize variables
+        float h[10] = {0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0};
+        short c(10000); // impulse amplitude
+        short y;        // output
+
+        // Load filter coefficients externally
+        SigProc::FIRPolyphaseFilterBank f(h, 10, 1);
+
+        TS_ASSERT_EQUALS( f.GetNumFilters(), 1 );
+
+        TS_ASSERT_EQUALS( f.GetFilterLength(), 10 );
+
+        // Hit the filter with an impulse
+        f.PushInput(c);
+
+        // Resulting output should be equal to filter coefficients
+        for (unsigned int i=0; i<10; i++) {
+            f.ComputeOutput(y, 0);
+            TS_ASSERT_DELTA( h[10-i-1]*float(c), float(y), 2.0f );
+            f.PushInput(0);
+        }
+
+        // Impulse response should be finite
+        for (unsigned int i=0; i<10; i++) {
+            f.ComputeOutput(y, 0);
+            TS_ASSERT_DELTA( 0.0f, float(y), 0.001 );
+            f.PushInput(0);
+        }
+
+    }
+    
+    void testFilterBankSelection1() {
+        
+        // Initialize variables
+        float h[15] = {1.0,  2.0,  3.0,  4.0,  5.0,     // bank 0
+                       6.0,  7.0,  8.0,  9.0,  0.0,     // bank 1
+                      -1.0, -2.0, -3.0, -4.0, -5.0};    // bank 2
+        short c(1000); // impulse amplitude
+        short y;        // output
+        unsigned int b; // filter bank index
+
+        // Load filter coefficients externally
+        SigProc::FIRPolyphaseFilterBank f(h, 5, 3);
+
+        TS_ASSERT_EQUALS( f.GetNumFilters(), 3 );
+
+        TS_ASSERT_EQUALS( f.GetFilterLength(), 5 );
+
+        for (unsigned int k=0; k<25; k++) {
+            // Hit the filter with an impulse
+            f.PushInput(c);
+
+            // Resulting output should be equal to filter coefficients at
+            // randomly-chosen index 'b'
+            for (unsigned int i=0; i<5; i++) {
+                b = rand() % 3;
+                f.ComputeOutput(y, b);
+                TS_ASSERT_EQUALS( short(h[b*5+5-i-1])*c, y );
+                f.PushInput(0);
+            }
+        }
+
+    }
+
+    void testFilterBankSelection2() {
+        
+        // Initialize variables
+        float h[15] = {1.0,  1.0,  1.0,  1.0,     // bank 0
+                       1.0, -1.0,  1.0, -1.0,     // bank 1
+                       1.0,  2.0,  3.0,  4.0};    // bank 1
+        short y;        // output
+
+        // Load filter coefficients externally
+        SigProc::FIRPolyphaseFilterBank f(h, 4, 3);
+
+        TS_ASSERT_EQUALS( f.GetNumFilters(), 3 );
+
+        TS_ASSERT_EQUALS( f.GetFilterLength(), 4 );
+        
+        // test input 1
+        f.PushInput(10);
+        f.PushInput(10);
+        f.PushInput(10);
+        f.PushInput(10);
+
+        f.ComputeOutput(y, 0);
+        TS_ASSERT_EQUALS(y, 40);
+
+        f.ComputeOutput(y, 1);
+        TS_ASSERT_EQUALS(y, 0);
+
+        f.ComputeOutput(y, 2);
+        TS_ASSERT_EQUALS(y, 100);
+        
+        // test input 2
+        f.PushInput(10);
+        f.PushInput(-10);
+        f.PushInput(10);
+        f.PushInput(-10);
+
+        f.ComputeOutput(y, 0);
+        TS_ASSERT_EQUALS(y, 0);
+
+        f.ComputeOutput(y, 1);
+        TS_ASSERT_EQUALS(y, 40);
+
+        f.ComputeOutput(y, 2);
+        TS_ASSERT_EQUALS(y, -20);
+
+        // test input 3
+        f.PushInput(10);
+        f.PushInput(10);
+        f.PushInput(-10);
+        f.PushInput(-10);
+
+        f.ComputeOutput(y, 0);
+        TS_ASSERT_EQUALS(y, 0);
+
+        f.ComputeOutput(y, 1);
+        TS_ASSERT_EQUALS(y, 0);
+
+        f.ComputeOutput(y, 2);
+        TS_ASSERT_EQUALS(y, -40);
+
+    }
+
+
+    void testFilterBankSelectionExternalBuffer() {
+        
+        // Initialize variables
+        float h[15] = {1.0,  1.0,  1.0,  1.0,     // bank 0
+                       1.0, -1.0,  1.0, -1.0,     // bank 1
+                       1.0,  2.0,  3.0,  4.0};    // bank 1
+        short y;        // output
+
+        // Load filter coefficients externally
+        SigProc::FIRPolyphaseFilterBank f(h, 4, 3);
+
+        // Create circular buffer for external array
+        SigProc::CircularBuffer <short> v(4);
+
+        TS_ASSERT_EQUALS( f.GetNumFilters(), 3 );
+
+        TS_ASSERT_EQUALS( f.GetFilterLength(), 4 );
+
+        TS_ASSERT_EQUALS( f.GetFilterLength(), v.GetBufferSize() );
+        
+        // test input 1
+        v.Push(10);
+        v.Push(10);
+        v.Push(10);
+        v.Push(10);
+
+        f.ComputeOutput(y, 0, v.GetHeadPtr());
+        TS_ASSERT_EQUALS(y, 40);
+
+        f.ComputeOutput(y, 1, v.GetHeadPtr());
+        TS_ASSERT_EQUALS(y, 0);
+
+        f.ComputeOutput(y, 2, v.GetHeadPtr());
+        TS_ASSERT_EQUALS(y, 100);
+        
+        // test input 2
+        v.Push(10);
+        v.Push(-10);
+        v.Push(10);
+        v.Push(-10);
+
+        f.ComputeOutput(y, 0, v.GetHeadPtr());
+        TS_ASSERT_EQUALS(y, 0);
+
+        f.ComputeOutput(y, 1, v.GetHeadPtr());
+        TS_ASSERT_EQUALS(y, 40);
+
+        f.ComputeOutput(y, 2, v.GetHeadPtr());
+        TS_ASSERT_EQUALS(y, -20);
+
+        // test input 3
+        v.Push(10);
+        v.Push(10);
+        v.Push(-10);
+        v.Push(-10);
+
+        f.ComputeOutput(y, 0, v.GetHeadPtr());
+        TS_ASSERT_EQUALS(y, 0);
+
+        f.ComputeOutput(y, 1, v.GetHeadPtr());
+        TS_ASSERT_EQUALS(y, 0);
+
+        f.ComputeOutput(y, 2, v.GetHeadPtr());
+        TS_ASSERT_EQUALS(y, -40);
+
+    }
+
+};
+
+
+#endif // __FIRPOLYPHASEFILTERBANKTEST_H
+
Index: /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/autotest_sources/IIRFilter_testsuite.h
===================================================================
--- /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/autotest_sources/IIRFilter_testsuite.h	(revision 3446)
+++ /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/autotest_sources/IIRFilter_testsuite.h	(revision 3446)
@@ -0,0 +1,205 @@
+#ifndef __IIRFILTERTEST_H
+#define __IIRFILTERTEST_H
+
+#include <cxxtest/TestSuite.h>
+#include "../SigProc.h"
+
+//
+// A simple test suite: Just inherit CxxTest::TestSuite and write tests!
+//
+
+class IIRFilter_Testsuite : public CxxTest::TestSuite
+{
+public:
+
+    void testResponse2ndOrderButterworthFilter() {
+
+        // initialize filter with 2nd-order low-pass butterworth filter
+        float a[3] = {1.000000000000000, -0.942809041582063,  0.333333333333333};
+        float b[3] = {0.0976310729378175, 0.1952621458756350, 0.0976310729378175};
+        SigProc::iir_filter f(a, 3, b, 3);
+
+        // initialize oracle; expected output (generated with octave)
+        float v_impulse[15] = {
+           9.76310729378175e-02,
+           2.87309604180767e-01,
+           3.35965474513536e-01,
+           2.20981418970514e-01,
+           9.63547883225231e-02,
+           1.71836926400291e-02,
+          -1.59173219853878e-02,
+          -2.07348926322729e-02,
+          -1.42432702548109e-02,
+          -6.51705310050832e-03,
+          -1.39657983602602e-03,
+           8.55642936806248e-04,
+           1.27223450919543e-03,
+           9.14259886013424e-04,
+           4.37894317157432e-04};
+
+        float v_step[15] = {
+           0.0976310729378175,
+           0.3849406771185847,
+           0.7209061516321208,
+           0.9418875706026352,
+           1.0382423589251584,
+           1.0554260515651877,
+           1.0395087295798000,
+           1.0187738369475272,
+           1.0045305666927162,
+           0.9980135135922078,
+           0.9966169337561817,
+           0.9974725766929878,
+           0.9987448112021832,
+           0.9996590710881966,
+           1.0000969654053542};
+    
+        short x, y(0);
+        short c(1000);
+
+        // hit filter with impulse, compare output
+        for (unsigned int i=0; i<15; i++) {
+            if (i==0)
+                x = c;
+            else
+                x = 0;
+
+            f.do_work(x, y);
+
+            TS_ASSERT_DELTA( v_impulse[i]*float(c), float(y), 0.002f*float(c) );
+        }
+
+        // reset filter buffer
+        f.ResetBuffer();
+
+        // hit filter with step, compare output
+        for (unsigned int i=0; i<15; i++) {
+            x = c;
+
+            f.do_work(x, y);
+
+            TS_ASSERT_DELTA( v_step[i]*float(c), float(y), 0.002f*float(c) );
+        }
+
+    }
+
+    void testResponse10thOrderButterworthFilter() {
+
+        // initialize filter with 2nd-order low-pass butterworth filter
+        float a[11] = {
+           1.0000e+00,
+          -9.9601e-01,
+           1.7596e+00,
+          -1.1121e+00,
+           8.7474e-01,
+          -3.4745e-01,
+           1.4416e-01,
+          -3.3071e-02,
+           6.6919e-03,
+          -6.7989e-04,
+           3.9147e-05};
+
+        float b[11] = {
+           0.0012655,
+           0.0126552,
+           0.0569483,
+           0.1518622,
+           0.2657588,
+           0.3189105,
+           0.2657588,
+           0.1518622,
+           0.0569483,
+           0.0126552,
+           0.0012655};
+
+        SigProc::iir_filter f(a, 11, b, 11);
+
+        // initialize oracle; expected output (generated with octave)
+        float v_impulse[25] = {
+           0.00126551797777455,
+           0.01391564815803274,
+           0.06858167841372356,
+           0.19709216347010877,
+           0.35575957570588063,
+           0.39099194423428957,
+           0.19305765066333802,
+          -0.09872513808128125,
+          -0.19841222279283660,
+          -0.04120117582379802,
+           0.12130889908269875,
+           0.08022920306602907,
+          -0.05725352799770276,
+          -0.07794813251871005,
+           0.01619603266767225,
+           0.06173727420236504,
+           0.00666683404765441,
+          -0.04309614882499248,
+          -0.01717209444283530,
+           0.02665484847082815,
+           0.01997555516149800,
+          -0.01397262483135252,
+          -0.01845322199397569,
+           0.00517259064735178,
+           0.01491729899923814};
+
+        float v_step[25] = {
+           0.00126551797777455,
+           0.01518116613580729,
+           0.08376284454953085,
+           0.28085500801963964,
+           0.63661458372552027,
+           1.02760652795980989,
+           1.22066417862314780,
+           1.12193904054186633,
+           0.92352681774902989,
+           0.88232564192523222,
+           1.00363454100793081,
+           1.08386374407395958,
+           1.02661021607625691,
+           0.94866208355754733,
+           0.96485811622521966,
+           1.02659539042758419,
+           1.03326222447523830,
+           0.99016607565024617,
+           0.97299398120741132,
+           0.99964882967823954,
+           1.01962438483973705,
+           1.00565176000838430,
+           0.98719853801440893,
+           0.99237112866176069,
+           1.00728842766099858};
+
+        short x, y(0);
+        short c(5000);
+
+        // hit filter with impulse, compare output
+        for (unsigned int i=0; i<25; i++) {
+            if (i==0)
+                x = c;
+            else
+                x = 0;
+
+            f.do_work(x, y);
+
+            TS_ASSERT_DELTA( v_impulse[i]*float(c), float(y), 0.002f*float(c) );
+        }
+
+        // reset filter buffer
+        f.ResetBuffer();
+
+        // hit filter with step, compare output
+        for (unsigned int i=0; i<25; i++) {
+            x = c;
+
+            f.do_work(x, y);
+
+            TS_ASSERT_DELTA( v_step[i]*float(c), float(y), 0.002f*float(c) );
+        }
+
+    }
+
+};
+
+
+#endif // __IIRFILTERTEST_H
+
Index: /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/autotest_sources/CircularBuffer_testsuite.h
===================================================================
--- /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/autotest_sources/CircularBuffer_testsuite.h	(revision 3446)
+++ /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/autotest_sources/CircularBuffer_testsuite.h	(revision 3446)
@@ -0,0 +1,221 @@
+#ifndef __CIRCULARBUFFERTEST_H
+#define __CIRCULARBUFFERTEST_H
+
+#include <cxxtest/TestSuite.h>
+#include "../SigProc.h"
+
+//
+// A simple test suite: Just inherit CxxTest::TestSuite and write tests!
+//
+
+class CircularBuffer_Testsuite : public CxxTest::TestSuite
+{
+public:
+
+    void testDefaultConstructor() {
+        // Initialize buffer
+        SigProc::CircularBuffer <int> b;
+
+        TS_ASSERT_EQUALS( b.GetNumElements(), 0 );
+        TS_ASSERT_EQUALS( b.GetBufferSize(), 1 );
+    }
+
+    void testInitializingEmptyConstructor() {
+        // Initialize buffer
+        SigProc::CircularBuffer <int> b(10);
+
+        TS_ASSERT_EQUALS( b.GetNumElements(), 0 );
+        TS_ASSERT_EQUALS( b.GetBufferSize(), 10 );
+    }
+
+    void testInitializingArrayConstructor() {
+        // Initialize array
+        float a[6] = {0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f};
+        SigProc::CircularBuffer <float> b(a, 6);
+
+        TS_ASSERT_EQUALS( b.GetNumElements(), 6 );
+        TS_ASSERT_EQUALS( b.GetBufferSize(), 6 );
+
+        // Get buffer pointer and ensure it does not equal initial array
+        float * p = b.GetHeadPtr();
+        TS_ASSERT_DIFFERS( a, p );
+
+        // Ensure data are equal
+        TS_ASSERT_SAME_DATA( a, p, 6*sizeof(float) );
+
+    }
+
+    void testInitializingCopyConstructor() {
+        // Initialize first buffer
+        SigProc::CircularBuffer <float> b1(10);
+
+        // Push 4 elements
+        b1.Push(  0.123f );
+        b1.Push(  2.843f );
+        b1.Push(  12.22f );
+        b1.Push( -2.333f );
+        
+        SigProc::CircularBuffer <float> b2(b1);
+
+        TS_ASSERT_EQUALS( b2.GetNumElements(), 4 );
+        TS_ASSERT_EQUALS( b2.GetBufferSize(), 10 );
+
+        // Get data from buffers
+        float * p1, * p2;
+        p1 = b1.GetHeadPtr();
+        p2 = b2.GetHeadPtr();
+
+        TS_ASSERT_SAME_DATA( p1, p2, 4*sizeof(float) );
+    }
+
+    void xtestFunctionsWhichThrowExceptions() {
+
+        // Initialize buffer
+        SigProc::CircularBuffer <int> b(5);
+
+        TS_ASSERT_THROWS_NOTHING( b.Push(0) );
+        TS_ASSERT_THROWS_NOTHING( b.Push(1) );
+        TS_ASSERT_THROWS_NOTHING( b.Push(2) );
+        TS_ASSERT_THROWS_NOTHING( b.Push(3) );
+        TS_ASSERT_THROWS_NOTHING( b.Push(4) );
+        TS_ASSERT_THROWS_NOTHING( b.Push(5) );
+        TS_ASSERT_THROWS_NOTHING( b.Push(6) );
+
+        TS_ASSERT_THROWS_NOTHING( b.Pop() );
+
+        TS_ASSERT_THROWS_NOTHING( b.Push(0) );
+
+        b.Release();
+
+        // Buffer should be empty
+        TS_ASSERT_THROWS( b.Pop(), int );
+    }
+
+    void testBufferFunctions() {
+
+        // Initialize variables
+        int testVector[15] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14};
+        int zeroVector[15] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+        int * testBuffer, testValue;
+
+        // Initialize buffer
+        SigProc::CircularBuffer <int> b(10);
+
+        // Check size of buffer
+        TS_ASSERT_EQUALS( b.GetBufferSize(), 10 );
+
+        // Push values into buffer
+        for (int i=0; i<10; i++)
+            b.Push( testVector[i] );
+
+        testBuffer = b.GetHeadPtr();
+
+        // Data should be equal
+        TS_ASSERT_SAME_DATA( testBuffer, testVector, 10*sizeof(int) );
+
+        // Data length should be equal to 10
+        TS_ASSERT_EQUALS( b.GetNumElements(), 10 );
+
+        // Release the buffer
+        b.Release();
+
+        // Buffer should be empty
+        TS_ASSERT_EQUALS( b.GetNumElements(), 0 );
+
+        testBuffer = b.GetHeadPtr();
+
+        // Buffer should be full of zeros
+        TS_ASSERT_SAME_DATA( testBuffer, zeroVector, 10*sizeof(int) );
+
+        for (int i=0; i<5; i++) {
+            b.Push( testVector[i] );
+            testValue = b.Pop();
+            TS_ASSERT_EQUALS( testVector[i], testValue );
+        }
+        
+        // Buffer should be empty
+        TS_ASSERT_EQUALS( b.GetNumElements(), 0 );
+        
+        for (int i=0; i<10; i++)
+            b.Push( testVector[i+3] );
+        
+        // Buffer should have exactly 10 values
+        TS_ASSERT_EQUALS( b.GetNumElements(), 10 );
+
+        testBuffer = b.GetHeadPtr();
+
+        // Data should be equal
+        TS_ASSERT_SAME_DATA( testBuffer, testVector+3, 10*sizeof(int) );
+
+        // Release 4 values
+        b.Release(4);
+        
+        // Buffer should have exactly 6 values
+        TS_ASSERT_EQUALS( b.GetNumElements(), 6 );
+
+    }
+    
+    void testDynamicBufferSizeFunctions() {
+
+        // Initialize variables
+        int testVector[15] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14};
+        int * testBuffer;
+
+        // Initialize buffer
+        SigProc::CircularBuffer <int> b(5);
+
+        TS_ASSERT_EQUALS( b.GetBufferSize(), 5 );
+
+        for (int i=0; i<5; i++)
+            b.Push(testVector[i]);
+
+        b.SetBufferSize(10);
+
+        TS_ASSERT_EQUALS( b.GetBufferSize(), 10 );
+
+        testBuffer = b.GetHeadPtr();
+        
+        // Data should be equal
+        TS_ASSERT_SAME_DATA( testBuffer, testVector, 5*sizeof(int) );
+
+        // Reset
+        b.Release();
+
+        // Push 10 values into buffer
+        for (int i=0; i<10; i++)
+            b.Push(testVector[i]);
+
+        // Downsize buffer to only 6 elements (this should drop the first 4)
+        b.SetBufferSize(6);
+
+        testBuffer = b.GetHeadPtr();
+
+        // Data should be equal
+        TS_ASSERT_SAME_DATA( testBuffer, testVector+4, 6*sizeof(int) );
+
+    }
+
+    void testOperatorOverloads() {
+
+        int testVector[15] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14};
+        
+        // initialize buffer to number unequal to testVector length
+        SigProc::CircularBuffer <int> b(24);
+
+        for (int i=0; i<4; i++) {
+            for (int j=0; j<15; j++)
+                b.Push( testVector[j] );
+
+            for (int j=0; j<15; j++)
+                TS_ASSERT_EQUALS( b[j], testVector[j] );
+
+            for (int j=0; j<15; j++)
+                b.Pop();
+        }
+    }
+
+};
+
+
+#endif // __CIRCULARBUFFERTEST_H
+
Index: /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/autotest_sources/pack_testsuite.h
===================================================================
--- /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/autotest_sources/pack_testsuite.h	(revision 5531)
+++ /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/autotest_sources/pack_testsuite.h	(revision 5531)
@@ -0,0 +1,308 @@
+#ifndef __PACK_BYTE_TEST_H__
+#define __PACK_BYTE_TEST_H__
+
+#include <cxxtest/TestSuite.h>
+#include "../SigProc.h"
+
+using namespace SigProc;
+
+//
+// A simple test suite: Just inherit CxxTest::TestSuite and write tests!
+//
+
+class pack_bytes_Testsuite : public CxxTest::TestSuite
+{
+public:
+
+    //
+    // pack_bytes
+    //
+    
+    void test_pack_bytes_01() {
+        unsigned char output[8];
+        unsigned int N;
+        
+        unsigned char input[36] = {
+            0, 0, 0, 0, 0, 0, 0, 0, // 0:   0000 0000
+            1, 1, 1, 1, 1, 1, 1, 1, // 255: 1111 1111
+            0, 0, 0, 0, 1, 1, 1, 1, // 15:  0000 1111
+            1, 0, 1, 0, 1, 0, 1, 0  // 170: 1010 1010
+        };
+
+        // Test packing entire array
+        char output_test_01[4] = {0x00, 0xFF, 0x0F, 0xAA};
+        pack_bytes( input, 32, output, 8, &N );
+        TS_ASSERT_EQUALS( N, 4 );
+        TS_ASSERT_SAME_DATA( output, output_test_01, 4 );
+
+        // Test packing only 28 elements
+        char output_test_02[4] = {0x00, 0xFF, 0x0F, 0x0A};
+        pack_bytes( input, 28, output, 8, &N );
+        TS_ASSERT_EQUALS( N, 4 );
+        TS_ASSERT_SAME_DATA( output, output_test_02, 4 );
+        
+        // Test packing only 25 elements
+        char output_test_03[4] = {0x00, 0xFF, 0x0F, 0x01};
+        pack_bytes( input, 25, output, 8, &N );
+        TS_ASSERT_EQUALS( N, 4 );
+        TS_ASSERT_SAME_DATA( output, output_test_03, 4 );
+
+        // Test packing only 24 elements (3 bytes)
+        char output_test_04[3] = {0x00, 0xFF, 0x0F};
+        pack_bytes( input, 24, output, 8, &N );
+        TS_ASSERT_EQUALS( N, 3 );
+        TS_ASSERT_SAME_DATA( output, output_test_04, 3 );
+
+    }
+    
+    
+    //
+    // unpack_bytes
+    //
+    
+    void test_unpack_bytes_01() {
+        unsigned char input[5] = {0x00, 0x01, 0xFF, 0x0F, 0xAA};
+        
+        unsigned char output[64];
+        unsigned int N;
+
+        char output_test[40] = {
+            0, 0, 0, 0, 0, 0, 0, 0, // 0:   0000 0000
+            0, 0, 0, 0, 0, 0, 0, 1, // 1:   0000 0001
+            1, 1, 1, 1, 1, 1, 1, 1, // 255: 1111 1111
+            0, 0, 0, 0, 1, 1, 1, 1, // 15:  0000 1111
+            1, 0, 1, 0, 1, 0, 1, 0  // 170: 1010 1010
+        };
+        
+        // Test packing entire array
+        unpack_bytes( input, 4, output, 40, &N );
+        TS_ASSERT_EQUALS( N, 32 );
+        TS_ASSERT_SAME_DATA( output, output_test, 32 );
+
+    }
+
+
+    //
+    // repack_bytes
+    //
+    
+    void test_repack_bytes_01() {
+        // (3, 2)
+        unsigned char input[] = {
+            0x07,   // 111
+            0x00,   // 000
+            0x06,   // 110
+            0x07    // 111
+        };
+
+        char output_test[] = {
+            0x03,   // 11
+            0x02,   // 10
+            0x00,   // 00
+            0x03,   // 11
+            0x01,   // 01
+            0x03    // 11
+        };
+
+        unsigned char output[8];
+        unsigned int N;
+
+        repack_bytes( input, 3, 4, output, 2, 8, &N );
+
+        TS_ASSERT_EQUALS( N, 6 );
+        TS_ASSERT_SAME_DATA( output, output_test, 6 );
+    }
+   
+    void test_repack_bytes_02() {
+        // (5, 3)
+        unsigned char input[] = {
+            0x01,   // 00001
+            0x02,   // 00010
+            0x04    // 00100
+        };
+
+        char output_test[] = {
+            0x00,   // 000
+            0x02,   // 010
+            0x01,   // 001
+            0x00,   // 000
+            0x04    // 100
+        };
+
+        unsigned char output[8];
+        unsigned int N;
+
+        repack_bytes( input, 5, 3, output, 3, 8, &N );
+
+        TS_ASSERT_EQUALS( N, 5 );
+        TS_ASSERT_SAME_DATA( output, output_test, 5 );
+    }
+
+    void test_repack_bytes_03() {
+        // (3, 5)
+        unsigned char input[] = {
+            0x00,   // 000
+            0x02,   // 010
+            0x01,   // 001
+            0x00,   // 000
+            0x04    // 100
+        };
+
+        char output_test[] = {
+            0x01,   // 00001
+            0x02,   // 00010
+            0x04    // 00100
+        };
+
+        unsigned char output[8];
+        unsigned int N;
+
+        repack_bytes( input, 3, 5, output, 5, 8, &N );
+
+        TS_ASSERT_EQUALS( N, 3 );
+        TS_ASSERT_SAME_DATA( output, output_test, 3 );
+    }
+
+    void test_repack_bytes_04() {
+        // (4, 8)
+        unsigned char input[] = {
+            0x00,   // 0000
+            0x01,   // 0001
+            0x02,   // 0010
+            0x04,   // 0100
+            0x04,   // 0100
+            0x08    // 1000
+        };
+
+        char output_test[] = {
+            0x01,   // 0000 0001
+            0x24,   // 0010 0100
+            0x48    // 0100 1000
+        };
+
+        unsigned char output[8];
+        unsigned int N;
+
+        repack_bytes( input, 4, 6, output, 8, 8, &N );
+
+        TS_ASSERT_EQUALS( N, 3 );
+        TS_ASSERT_SAME_DATA( output, output_test, 3 );
+    }
+    
+    void test_repack_bytes_05() {
+        // (1, 4)
+        unsigned char input[] = {
+            0x00,   // 0
+            0x01,   // 1
+            0x01,   // 1
+            0x00,   // 0
+            0x00,   // 0
+            0x00,   // 0
+            0x00,   // 0
+            0x01    // 1
+        };
+
+        char output_test[] = {
+            0x06,   // 0110
+            0x01    // 0001
+        };
+
+        unsigned char output[8];
+        unsigned int N;
+
+        repack_bytes( input, 1, 8, output, 4, 8, &N );
+
+        TS_ASSERT_EQUALS( N, 2 );
+        TS_ASSERT_SAME_DATA( output, output_test, 2 );
+    }
+    
+    void test_repack_bytes_06() {
+        // (4, 1)
+        unsigned char input[] = {
+            0x06,   // 0110
+            0x01    // 0001
+        };
+
+        char output_test[] = {
+            0x00,   // 0
+            0x01,   // 1
+            0x01,   // 1
+            0x00,   // 0
+            0x00,   // 0
+            0x00,   // 0
+            0x00,   // 0
+            0x01    // 1
+        };
+
+        unsigned char output[8];
+        unsigned int N;
+
+        repack_bytes( input, 4, 2, output, 1, 10, &N );
+
+        TS_ASSERT_EQUALS( N, 8 );
+        TS_ASSERT_SAME_DATA( output, output_test, 8 );
+    }
+
+    //
+    //  Test packing bytes where input symbo/buffer size is
+    //  uneven with output
+    //
+    void test_repack_bytes_07() {
+        // (1, 4)
+        unsigned char input[] = {
+            0x01,   // 1
+            0x00,   // 0
+            0x00,   // 0
+            0x01,   // 1
+            0x01    // 1
+        };
+
+        char output_test[] = {
+            0x09,   // 1001
+            0x08    // 1[000]
+        };
+
+        unsigned char output[8];
+        unsigned int N;
+
+        repack_bytes( input, 1, 5, output, 4, 8, &N );
+
+        TS_ASSERT_EQUALS( N, 2 );
+        TS_ASSERT_SAME_DATA( output, output_test, 2 );
+    }
+
+    //
+    //  Test packing bytes where input symbo/buffer size is
+    //  uneven with output
+    //
+    void test_repack_bytes_08() {
+        // (3, 4)
+        unsigned char input[] = {
+            0x01,   // 001
+            0x02,   // 010
+            0x03,   // 011
+            0x04,   // 100
+            0x05    // 101
+        };
+
+        char output_test[] = {
+            0x02,   // 0010
+            0x09,   // 1001
+            0x0C,   // 1100
+            0x0A    // 101[0]
+        };
+
+        unsigned char output[8];
+        unsigned int N;
+
+        repack_bytes( input, 3, 5, output, 4, 8, &N );
+
+        TS_ASSERT_EQUALS( N, 4 );
+        TS_ASSERT_SAME_DATA( output, output_test, 4 );
+    }
+
+};
+
+
+#endif // __PACK_BYTE_TEST_H__
+
Index: /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/reconf
===================================================================
--- /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/reconf	(revision 3081)
+++ /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/reconf	(revision 3081)
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+rm -f config.cache
+aclocal
+autoconf
+automake --foreign --add-missing
Index: /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/sigproc.pc.in
===================================================================
--- /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/sigproc.pc.in	(revision 2275)
+++ /ossiedev/branches/hvolos/ossie-sdrf2007/SigProc/sigproc.pc.in	(revision 2275)
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: sigproc
+Description: OSSIE Signal Processing Library
+Requires:
+Version: @VERSION@
+Libs: -L${libdir} -lsigproc
+Cflags: -I${includedir}
