#!/bin/sh
if false; then
arfile=SharArcive
outdir=${ROOTDIR}/usr/mst

PATH=${PATH}:/sbin:/usr/bin:/bin
kpver=`uname -r`
mach=`uname -m | sed -e 's/ //g'`

ex()
{
    echo "$@"
    "$@"
}
drv_failed()
{
    echo ""
    echo ""
    echo "MST driver installation did not succeed"
    echo "---------------------------------------"
    echo ""
    exit 1
}
perl_failed()
{
    echo ""
    echo ""
    echo "MST driver is OK"
    echo "----------------"
    echo ""
    echo "MTCR perl library installation did not complete."
    echo "        This will not affect MST driver"
    echo ""
    exit 0
}

if [ `id -u` -ne 0 ]; then
    echo "You must be root to do that"
    exit 1
fi

# Output directory
#if [ -e $outdir ]; then
#    echo -n "Directory \"$outdir\" already exists. Continue ? "
#    read ack
#    if [ "${ack}" != "y" ]; then
#        exit 0
#    fi
#fi

# Open distribution
#rm -fr ${outdir}
umask 022
mkdir -p ${outdir}
mkdir -p ${outdir}/src
mkdir -p ${outdir}/bin
mkdir -p ${outdir}/include
mkdir -p ${outdir}/lib
mkdir -p ${outdir}/etc
mkdir -p ${outdir}/share

mkdir -p ${outdir}/lib/${kpver}

if [ $? -ne 0 ]; then
    drv_failed
fi

echo 4.2.0 > ${outdir}/etc/BUILD_ID

# The following line places if 0..fi around the START, END section, 
# then places first_param=-c line before "# This is a shell archive"
cat $0 | sed -e 's/^#START___/if false; then/' | sed -e 's/^#END___/fi/' -e 's/^# This is a shell archive[^\[]/first_param=-c\
&/' > ${outdir}/src/${arfile}
if [ $? -ne 0 ]; then
    drv_failed
fi
cd ${outdir}/src
sh $arfile


# make and install
make MST_CPU=x86_64 MST_NO_USB=
if [ $? -ne 0 ]; then
    make rhconfig_exists=  MST_CPU=x86_64 MST_NO_USB=
    if [ $? -ne 0 ]; then
        drv_failed
    fi
fi
make MST_CPU=x86_64 MST_NO_USB= install

if [ -d $outdir/man ]; then
  if [ -d $outdir/share/man ]; then
    cp -rf $outdir/man/* $outdir/share/man/
  else
    mv $outdir/man $outdir/share/
  fi
else
  mkdir -p $outdir/share/man
fi

# Install Device-mtcr perl module
cd Device-mtcr
perl Makefile.PL
if [ $? -ne 0 ]; then perl_failed; fi
make
if [ $? -ne 0 ]; then perl_failed; fi
#make test
#if [ $? -ne 0 ]; then perl_failed; fi
make PREFIX=$outdir INSTALLDIRS=perl install
if [ $? -ne 0 ]; then perl_failed; fi

echo ""
echo ""
echo "MST driver is OK, MTCR perl library is OK"
echo "-----------------------------------------"
echo ""

exit
fi
#!/bin/sh
first_param=-c
# This is a shell archive (produced by GNU sharutils 4.2c).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
# Made on 2005-07-05 15:29 IDT by <orenk@swlab68>.
# Source directory was `/tmp/tools_build.21655/driver'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
# This format requires very little intelligence at unshar time.
# "if test", "echo", "mkdir", and "sed" may be needed.
#
# This shar contains:
# length mode       name
# ------ ---------- ------------------------------------------
#   5109 -rwxrwxr-x dimax_init.c
#   5009 -rw-rw-r-- driver_common.c
#    605 -rw-rw-r-- grst.c
#  12434 -rw-rw-r-- i2c-8xx_mod.c
#   5416 -rw-rw-r-- mdevices.c
#   6773 -rw-rw-r-- minit.c
#  24156 -rw-rw-r-- mod_i2c.c
#   1279 -rw-rw-r-- mread.c
#   1839 -rw-rw-r-- mremote.c
#   3948 -rw-rw-r-- mst_calbr_mod.c
#  12342 -rw-rw-r-- mst_irq_mod.c
#  12108 -rw-rw-r-- mst_pci_mod.c
#   7140 -rw-rw-r-- mst_pciconf_mod.c
#  13993 -rw-rw-r-- mst_ppc_mod.c
#   1667 -rw-rw-r-- mstop.c
#  33258 -rw-rw-r-- mtcr.c
#  14590 -rw-rw-r-- mtcr_i2c.c
#   6968 -rw-rw-r-- mtcr_ib.c
#   2006 -rw-rw-r-- mtest.c
#   7208 -rw-rw-r-- mtserver.c
#   8794 -rw-rw-r-- mtusb-1_test.c
#   1112 -rw-rw-r-- mwrite.c
#   8231 -rw-rw-r-- tcp.c
#   1908 -rw-rw-r-- testusb.c
#   2581 -rw-rw-r-- testusbwr.c
#  11643 -rw-rw-r-- usbioctl.c
#   5755 -rw-rw-r-- i2c.h
#   1094 -rw-rw-r-- mst_calbr.h
#    548 -rw-rw-r-- mst_irq.h
#    533 -rw-rw-r-- mst_pci.h
#   1013 -rw-rw-r-- mst_pciconf.h
#    608 -rw-rw-r-- mst_ppc.h
#   5844 -rw-rw-r-- mtcr.h
#    570 -rw-rw-r-- mtcr_i2c.h
#    535 -rw-rw-r-- mtcr_ib.h
#   2454 -rw-rw-r-- mtcr_ib_private.h
#    460 -rw-rw-r-- mtcr_mif.h
#    488 -rw-rw-r-- mtcr_types.h
#   1665 -rw-rw-r-- tcp.h
#   1440 -rw-rw-r-- usbdescriptor.h
#    932 -rw-rw-r-- usbioctl.h
#  36913 -rwxrwxr-x mst
#  10956 -rw-rw-r-- Makefile
#  10860 -rw-rw-r-- compat/linux/usb_ch9.h
#      1 -rw-rw-r-- compat/linux/syscalls.h
#     67 -rw-rw-r-- compat/asm/ioctl32.h
#  17800 -rw-rw-r-- ezusb_fw/0abf03e8_6.hex
#     80 -rw-rw-r-- libusb-0.1.8/AUTHORS
#  26428 -rw-rw-r-- libusb-0.1.8/COPYING
#    189 -rw-rw-r-- libusb-0.1.8/ChangeLog
#   2041 -rw-rw-r-- libusb-0.1.8/INSTALL.libusb
#   2063 -rw-rw-r-- libusb-0.1.8/INSTALL.libusb.in
#   2248 -rw-rw-r-- libusb-0.1.8/LICENSE
#   1338 -rw-rw-r-- libusb-0.1.8/Makefile.am
#  27314 -rw-rw-r-- libusb-0.1.8/Makefile.in
#      8 -rw-rw-r-- libusb-0.1.8/NEWS
#   1911 -rw-rw-r-- libusb-0.1.8/README
#   1922 -rw-rw-r-- libusb-0.1.8/README.in
# 244630 -rw-rw-r-- libusb-0.1.8/aclocal.m4
#  16796 -rw-rw-r-- libusb-0.1.8/bsd.c
#  38504 -rwxrwxr-x libusb-0.1.8/config.guess
#   2282 -rw-rw-r-- libusb-0.1.8/config.h.in
#  28224 -rwxrwxr-x libusb-0.1.8/config.sub
# 710215 -rwxrwxr-x libusb-0.1.8/configure
#   6531 -rw-rw-r-- libusb-0.1.8/configure.in
#  34451 -rw-rw-r-- libusb-0.1.8/darwin.c
#  12117 -rwxrwxr-x libusb-0.1.8/depcomp
#  13760 -rw-rw-r-- libusb-0.1.8/descriptors.c
#    759 -rw-rw-r-- libusb-0.1.8/error.c
#    716 -rw-rw-r-- libusb-0.1.8/error.h
#   5598 -rwxrwxr-x libusb-0.1.8/install-sh
#   1267 -rw-rw-r-- libusb-0.1.8/libusb-config.in
#   1240 -rw-rw-r-- libusb-0.1.8/libusb.spec
#   1244 -rw-rw-r-- libusb-0.1.8/libusb.spec.in
#  15854 -rw-rw-r-- libusb-0.1.8/linux.c
#   2764 -rw-rw-r-- libusb-0.1.8/linux.h
# 141554 -rw-rw-r-- libusb-0.1.8/ltmain.sh
#   6472 -rwxrwxr-x libusb-0.1.8/missing
#    726 -rwxrwxr-x libusb-0.1.8/mkinstalldirs
#   6220 -rw-rw-r-- libusb-0.1.8/usb.c
#   7995 -rw-rw-r-- libusb-0.1.8/usb.h.in
#   1268 -rw-rw-r-- libusb-0.1.8/usbi.h
#    812 -rw-rw-r-- libusb-0.1.8/doc/Makefile.am
#   9024 -rw-rw-r-- libusb-0.1.8/doc/Makefile.in
#   1901 -rw-rw-r-- libusb-0.1.8/doc/api.sgml
#   2790 -rw-rw-r-- libusb-0.1.8/doc/examples.sgml
#  25786 -rw-rw-r-- libusb-0.1.8/doc/functions.sgml
#   1591 -rw-rw-r-- libusb-0.1.8/doc/intro.sgml
#   2155 -rw-rw-r-- libusb-0.1.8/doc/manual.sgml
#   3706 -rw-rw-r-- libusb-0.1.8/doc/website.dsl
#    114 -rw-rw-r-- libusb-0.1.8/tests/Makefile.am
#  13395 -rw-rw-r-- libusb-0.1.8/tests/Makefile.in
#   4301 -rw-rw-r-- libusb-0.1.8/tests/testlibusb.c
#  18007 -rw-rw-r-- fxload-2002_04_11/COPYING
#  22494 -rw-rw-r-- fxload-2002_04_11/ezusb.c
#   7697 -rw-rw-r-- fxload-2002_04_11/main.c
#   2836 -rw-rw-r-- fxload-2002_04_11/ezusb.h
#   2411 -rw-rw-r-- fxload-2002_04_11/Makefile
#   1517 -rw-rw-r-- fxload-2002_04_11/README.txt
#   8863 -rw-rw-r-- fxload-2002_04_11/fxload.8
#   4025 -rw-rw-r-- fxload-2002_04_11/a3load.hex
#    108 -rwxrwxr-x Device-mtcr/Changes
#    542 -rwxrwxr-x Device-mtcr/LICENSE
#     75 -rwxrwxr-x Device-mtcr/MANIFEST
#    804 -rwxrwxr-x Device-mtcr/Makefile.PL
#    414 -rwxrwxr-x Device-mtcr/README
#    275 -rwxrwxr-x Device-mtcr/mtcr.h
#   1946 -rwxrwxr-x Device-mtcr/mtcr.pm
#   1163 -rwxrwxr-x Device-mtcr/mtcr.xs
#    548 -rwxrwxr-x Device-mtcr/test.pl
#     75 -rw-rw-r-- build2.6/Makefile
#
echo=echo
shar_tty= shar_n= shar_c='
'
mkdir _sh25994 || ( echo 'failed to create locking directory' '_sh25994'; exit 1 )
# ============= dimax_init.c ==============
if test -f 'dimax_init.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'dimax_init.c' '(file already exists)'
else
  $echo 'x -' extracting 'dimax_init.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'dimax_init.c' &&
X#include <stdio.h>
X#include <unistd.h>
X#include <stdlib.h>
X#include <string.h>
X#include <fcntl.h>
X#include <errno.h>
X
X#include <sys/ioctl.h>
X#include <sys/types.h> /*This header likes to sit before linux/ headers*/
X#include <sys/stat.h>
X
X/*  Linux USB Support */
X#include <linux/types.h>
X#include <linux/usb.h>
X#include <linux/usbdevice_fs.h>
X
X#include "usbdescriptor.h"
X
X#define __DIMAX__
X#ifdef __DIMAX__
X#define DIMAX_V 0x0abf
X#define DIMAX_P 0x3370
X#else
X#define DIMAX_V 0x0abf
X#define DIMAX_P	0x03e9
X#endif
X
X#define STRLEN 100
X#define BUS 	"Bus="
X#define DEV 	"Dev#="
X#define VENID   "Vendor="
X#define PRDID   "ProdID="
X
X#define DIMAX_IF   		0x00
X#define DIMAX_ALTIF		0x01
X#define DIMAX_CONF 		0x01
X#define DIMAX_IN_EP		0x84
X#define DIMAX_OUT_EP	0x02
X
X
Xint main( int argc, char *argv[] )
X{
X	int 	rc=0;
X	char* 	devf;
X	int 	fd = -1;
X	unsigned int tmp;
X	struct usbdevfs_setinterface setif_st;
X        struct usbdevfs_bulktransfer bulk_st;
X        char buf[300];
X        char resbuf[300];
X  struct usb_device_descriptor desc;
X
X	
X	/*  Find device */
X	
X	if (argc <= 1)
X	{
X		printf("Device Vend=0x%04x Prod=0x%04x not found\n", DIMAX_V, DIMAX_P ); 
X		return -1;
X	}
X
X	devf = argv[1];
X	if( devf )
X		printf( "Device file: \"%s\"\n", devf );
X
X	
X	/*  Open Device File */
X	
X	fd = open( devf, O_RDWR | O_SYNC );
X	if( fd == -1 )
X	{
X		rc = errno;
X		printf( "Device File open error. rc=%d, \"%s\"\n", rc, strerror(rc) );
X		goto cleanup;
X	}
X
X//Do it in mst now  
X//        fchmod( fd, 0666 );
X	
X        
X  rc=usb_get_device_descriptor( fd, & desc);
X	if( rc )
X	{
X		rc = errno;
X		printf( "GET DESCRIPTOR ioctl error. rc=%d, \"%s\"\n", rc, strerror(rc) );
X		goto cleanup;
X	}
X  
X  if (desc.idVendor != DIMAX_V ||
X      desc.idProduct != DIMAX_P) {
X    rc=1;
X		printf("Device Vendor/Product id mismatch: Expected %x/%x Detected %x/%x\n",
X       DIMAX_V, DIMAX_P, desc.idVendor, desc.idProduct);
X		goto cleanup;
X  }
X  
X
X
X	/*  Select configuration */
X	
X	tmp = DIMAX_CONF;
X	rc = ioctl( fd, USBDEVFS_SETCONFIGURATION, &tmp );
X	if( rc )
X	{
X		rc = errno;
X		printf( "SETCONFIGURATION ioctl error. rc=%d, \"%s\"\n", rc, strerror(rc) );
X		goto cleanup;
X	}
X
X	
X	/*  Claim Interface */
X	
X	tmp = DIMAX_IF;
X	rc = ioctl( fd, USBDEVFS_CLAIMINTERFACE, &tmp );
X	if( rc )
X	{
X		rc = errno;
X		printf( "CLAIMINTERFACE ioctl error. rc=%d, \"%s\"\n", rc, strerror(rc) );
X                if( rc == EBUSY )
X                    printf( "Please rmmod ezusb2131. This can be a reason\n" );
X		goto cleanup;
X	}
X
X	
X	/*  Set Alternative Configuration for Interface */
X	
X	setif_st.interface = DIMAX_IF;
X	setif_st.altsetting = DIMAX_ALTIF;
X
X	rc = ioctl( fd, USBDEVFS_SETINTERFACE, &setif_st );
X	if( rc )
X	{
X		rc = errno;
X		printf( "SETINTERFACE ioctl error. rc=%d, \"%s\"\n", rc, strerror(rc) );
X		goto cleanup1;
X	}
X
X
X        /* Try to read FW version */
X        tmp = 5;
X        while( tmp )
X        {
X            tmp--;
X
X            buf[0]=0x0a;
X            bulk_st.data = buf;
X            bulk_st.ep = DIMAX_OUT_EP;
X            bulk_st.len = 1;
X            bulk_st.timeout = 100;  /*  ms */
X            rc = ioctl( fd, USBDEVFS_BULK, &bulk_st );
X            if( rc != 1 )
X            {
X                rc = errno;
X                sprintf( resbuf,  "BULK ioctl OUT error. rc=%d, \"%s\"\n", rc, strerror(rc) );
X                continue;
X            }
X
X            bulk_st.data = buf;
X            bulk_st.ep = DIMAX_IN_EP;
X            bulk_st.len = 3;
X            bulk_st.timeout = 200;  /*  ms */
X            rc = ioctl( fd, USBDEVFS_BULK, &bulk_st );
X            if( rc != 3 )
X            {
X                rc = errno;
X                sprintf( resbuf, "BULK ioctl IN error. rc=%d, \"%s\"\n", rc, strerror(rc) );
X                continue;
X            }
X            sprintf( resbuf, "MTUSB-1 FW Version %u.%u\n", (int)buf[0], (int)buf[1] );
X            break;
X        }
X        printf( "%s", resbuf);
X	
X	/*  Cleanup and Exit */
Xcleanup1:
X        /* Release Interface */
X	tmp = DIMAX_IF;
X	rc = ioctl( fd, USBDEVFS_RELEASEINTERFACE, &tmp );
X	if( rc )
X	{
X		rc = errno;
X		printf( "RELEASEINTERFACE ioctl error. rc=%d, \"%s\"\n", rc, strerror(rc) );
X	}
Xcleanup:            
X	if( fd != -1 )
X		close( fd );
X	return rc;
X}
X
X#if 0
Xstatic char *get_usb_dev()
X{
X	FILE         *fp;
X	char         str[STRLEN], *p;
X	static char  buf[50];
X	unsigned int venid=0, prdid=0, bus=0, dev=0;
X
X	if ((fp = fopen("/proc/bus/usb/devices", "r")) == NULL)
X		return NULL;
X	while (fgets(str, STRLEN, fp))
X	{
X		if (!strncmp(str, "T:", 2))
X		{
X			if ((p = strstr(str, BUS)) != NULL)
X			{
X				p += strlen(BUS);
X				sscanf(p, "%d", &bus);
X			}
X			if ((p = strstr(str, DEV)) != NULL)
X			{
X				p += strlen(DEV);
X				sscanf(p, "%d", &dev);
X			}
X		}
X		if (!strncmp(str, "P:", 2))
X		{
X			if ((p = strstr(str, VENID)) != NULL)
X			{
X				p += strlen(VENID);
X				venid = strtoul(p, NULL, 16);
X			}
X			if ((p = strstr(str, PRDID)) != NULL)
X			{
X				p += strlen(PRDID);
X				prdid = strtoul(p, NULL, 16);
X			}
X			if( (venid == DIMAX_V    &&  prdid == DIMAX_P) )
X
X				{
X					sprintf(buf, "/proc/bus/usb/%03d/%03d", bus, dev);
X					fclose(fp);
X					return buf;
X				}
X		}
X	}
X	fclose(fp);
X	return NULL;
X}
X#endif
X
SHAR_EOF
  : || $echo 'restore of' 'dimax_init.c' 'failed'
fi
# ============= driver_common.c ==============
if test -f 'driver_common.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'driver_common.c' '(file already exists)'
else
  $echo 'x -' extracting 'driver_common.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'driver_common.c' &&
X#include <linux/fs.h>
X#include <linux/version.h>
X#include <linux/netdevice.h>
X#include <linux/config.h>
X#include <asm/semaphore.h>
X
X#if CONFIG_COMPAT && ! MST_NO_CONFIG_COMPAT && !HAVE_COMPAT_IOCTL
X#include <asm/ioctl32.h>
X#endif
X/* Note that MST_NO_CONFIG_COMPAT can get defined by asm/ioctl32.h */
X#if CONFIG_COMPAT && ! MST_NO_CONFIG_COMPAT && !HAVE_COMPAT_IOCTL
X#include <linux/syscalls.h>
Xtypedef int (*mst_ioctl_trans_handler_t)(unsigned int, unsigned int, unsigned long, struct file *);
X#endif
X
X#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
X#include <linux/init.h>
X#include <linux/moduleparam.h>
X#endif
X
Xstatic int major=-1;
X
X#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
Xmodule_param(name, charp, 0);
X#else
XMODULE_PARM(name,"s");
X#endif
X#ifdef MODULE_LICENSE
XMODULE_LICENSE("GPL");
X#endif
X
X/* TODO: 
X * implement READ4/WRITE4 IOCTLS
X * (+more sizes?)
X * implement lseek?
X * http://www.tldp.org/LDP/khg/HyperNews/get/devices/addrxlate.html
X */
X
Xstatic int open (struct inode *inode, struct file *file)
X{
X  int minor=MINOR(inode->i_rdev);
X  int ret=0;
X
X  if (down_interruptible(&devices[minor].sem)) {
X    return -ERESTARTSYS;
X  }
X
X  file->private_data=&devices[minor];
X
X  /* Truncate to 0 length on open for writing */
X  if (file->f_flags & O_APPEND) {
X    file->f_pos=devices[minor].bufused;
X  } else if ( (file->f_flags & O_TRUNC) || (file->f_flags & O_WRONLY ) ) {
X    devices[minor].bufused=0;
X  } 
X
X  /*fin:*/
X  up(&devices[minor].sem);
X  return ret;
X}
X
X
Xstatic  int release (struct inode *inode, struct file *file)
X{
X  return 0;
X}
X
Xstatic ssize_t read (struct file * file, char *buf, size_t count, loff_t *f_pos)
X{
X  struct dev_data* dev=(struct dev_data*) file->private_data;
X   if (down_interruptible(&dev->sem))
X     return -ERESTARTSYS;
X
X  if (*f_pos >= dev->bufused) {
X      count=0;
X      goto fin;
X  }
X  if (*f_pos + count > dev->bufused)
X    count = dev->bufused - *f_pos;
X
X  if (copy_to_user(buf,dev->buf+*f_pos, count)) {
X    count=-EFAULT;
X    goto fin;
X  }
X  *f_pos+=count;
X
X  fin:
X  up(&dev->sem);
X  return count;
X}
X
Xstatic ssize_t write (struct file *file, const char * buf, size_t count, loff_t *f_pos)
X{
X  struct dev_data* dev=(struct dev_data*) file->private_data;
X   if (down_interruptible(&dev->sem))
X     return -ERESTARTSYS;
X
X  if (*f_pos >= BUFFER_SIZE) {
X    count=0;
X    goto fin;
X  }
X  if (*f_pos + count > BUFFER_SIZE)
X    count = BUFFER_SIZE - *f_pos;
X
X  if (copy_from_user(dev->buf+*f_pos, buf, count)) {
X    count=-EFAULT;
X    goto fin;
X  }
X  *f_pos+=count;
X  if (dev->bufused < *f_pos) dev->bufused=*f_pos;
X
X  fin:
X  up(&dev->sem);
X  return count;
X}
X
X#if HAVE_COMPAT_IOCTL
Xstatic long compat_ioctl (struct file *f, unsigned int o, unsigned long d)
X{
X	struct inode *n = f->f_dentry->d_inode;
X	return ioctl(n, f, o, d);
X}
X#endif
X
X/* implement lseek ? */
X
Xstatic struct file_operations fops = {
X /*llseek:  scull_llseek,*/
X read:  read,
X write:  write,
X ioctl:  ioctl,
X open:  open,
X release: release,
X#ifdef SUPPORT_MMAP
X mmap: mmap,
X#endif
X#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
X owner: THIS_MODULE,
X#endif
X#if HAVE_COMPAT_IOCTL
X compat_ioctl: compat_ioctl,
X#endif
X};
X
X
X#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
Xstatic int mst_init_module(void)
X#else
Xint init_module(void)
X#endif
X{
X int i;
X major=register_chrdev(0, name, &fops);
X if (major<=0) {
X   printk("Unable to register character device %s\n",name);
X   return -1;
X }
X
X#if CONFIG_COMPAT && ! MST_NO_CONFIG_COMPAT && !HAVE_COMPAT_IOCTL
X {
X   int j;
X   int rc=0;
X   for(i=0;i<sizeof(ioctl_cmds)/sizeof(ioctl_cmds[0]);++i)
X   {
X     rc=register_ioctl32_conversion(ioctl_cmds[i],
X		     ((mst_ioctl_trans_handler_t)sys_ioctl));
X     if (rc)
X     {
X       printk("Unable to register compatibility ioctl %d[%d] for device %s\n",
X		       i, ioctl_cmds[i], name);
X       for(j=0;j<i;++j)
X       {
X         unregister_ioctl32_conversion(ioctl_cmds[j]);
X       }
X       unregister_chrdev(major, name);
X       return rc;
X     }
X   }
X }
X#endif
X 
X 
X
X for(i=0;i<MAXMINOR;++i)  {
X   sema_init(&devices[i].sem,1);
X#ifdef MST_PPC_DRIVER
X   devices[i].cs=(unsigned int)(-1);   
X#endif   
X } 
X#if 0
X printk("MST Driver initialised\n");
X printk("Device name:%s\n",name);
X printk("Major number:%d\n",major);
X printk("Minor numbers:%d\n",MAXMINOR);
X printk("IOCTL numbers:\n");
X printk("INIT:0x%x\n", INIT);
X printk("STOP:0x%x\n", STOP);
X#ifdef WRITE4
X printk("WRITE4:0x%x\n", WRITE4);
X printk("READ4:0x%x\n",  READ4);
X printk("MODIFY:0x%x\n", MODIFY);
X#endif
X#endif
X
X
X return 0;
X}
X
X#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
Xstatic void mst_cleanup_module(void)
X#else
Xvoid cleanup_module(void)
X#endif
X{
X  /* don't have to destroy semaphores in linux */
X
X#if CONFIG_COMPAT && ! MST_NO_CONFIG_COMPAT && !HAVE_COMPAT_IOCTL
X  int i;
X  for(i=0;i<sizeof(ioctl_cmds)/sizeof(ioctl_cmds[0]);++i)
X  {
X    unregister_ioctl32_conversion(ioctl_cmds[i]);
X  }
X#endif
X  unregister_chrdev(major, name);
X}
X
X#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
Xmodule_init(mst_init_module);
Xmodule_exit(mst_cleanup_module);
X#endif
SHAR_EOF
  : || $echo 'restore of' 'driver_common.c' 'failed'
fi
# ============= grst.c ==============
if test -f 'grst.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'grst.c' '(file already exists)'
else
  $echo 'x -' extracting 'grst.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'grst.c' &&
X/* This utility can reset Gamla with mst tools */
X
X#include <unistd.h>
X#include <stdio.h>
X#include <errno.h>
X#include <sys/types.h>
X#include <sys/stat.h>
X#include <fcntl.h>
X#include <sys/mman.h>
X
X
Xint main(int argc, char**argv)
X{
X  int fd;
X  void* p;
X
X  if (argc <= 1) {
X    fprintf(stderr,"grst [filename]\n");
X    exit(2);
X  }
X  fd=open(argv[1], O_RDWR | O_SYNC);
X    if (fd < 0)
X    {
X      fprintf(stderr,"Unable to open %s\n",argv[1]);
X      exit(errno);
X    }
X    p=  mmap(NULL, 0x10000 , PROT_READ | PROT_WRITE,
X                       MAP_SHARED, fd, 0);
X    *(int*)(p+0x3010)=-1;
X
X    return 0;
X}
SHAR_EOF
  : || $echo 'restore of' 'grst.c' 'failed'
fi
# ============= i2c-8xx_mod.c ==============
if test -f 'i2c-8xx_mod.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'i2c-8xx_mod.c' '(file already exists)'
else
  $echo 'x -' extracting 'i2c-8xx_mod.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'i2c-8xx_mod.c' &&
X /* Copyright (C) June 2000, Mellanox Technologies Ltd.  ALL RIGHTS RESERVED.
X *
X * Except as specifically permitted herein, no portion of the information,
X * including but not limited to object code and source code, may be reproduced,
X * modified, distributed, republished or otherwise exploited in any form or by
X * any means for any purpose without the prior written permission of Mellanox
X * Technologies Ltd. Use of software subject to the terms and conditions
X * detailed in the file "LICENSE.txt".
X *
X * End of legal section ......................................................
X *
X */ 
X
X
X
X#include <linux/kernel.h>
X#include <linux/module.h>
X#include <linux/slab.h>
X#include <linux/version.h>
X#include <linux/init.h>
X#include <linux/errno.h>
X#include <linux/sched.h>
X#include <linux/ioctl.h>
X#include <linux/fs.h>
X
X#include <asm/uaccess.h>
X#include <asm/mpc8xx.h>
X#include <asm/commproc.h>
X
X/*  Hack to avoid sys/type from loading from mtcr.h */
X#define _SYS_TYPES_H 1
X
X#include "mtcr.h"
X#include "mtcr_mif.h"
X
X#define CPU_FREQ_MHZ 80
X
X/*
X * Maximum number of times to poll for ACK after EEPROM write.
X */
X#define MAX_ACKNOWLEDGE_POLLS  10
X#define _8XX_MAX_I2C_LEN       64
X#define MAX_I2C_RETRY         100
X
X/*
X * Bit rate in bits per second
X */
X#define XI2C_BITRATE 200000
X
X/* we don't want to keep recalculating this each time we wiggle SCL or SDA */
Xstatic volatile cpm8xx_t* cp;
X
X/* number of cycles per bit time (calculated by xi2c_init()) */
Xstatic int machine_cycles_per_bit;
X
Xint i2c_8xx_debug = 0;
X
X
X
X#define SCL_UP() (cp->cp_pbdat |=  (0x80000000 >> 26))
X#define SCL_DOWN() (cp->cp_pbdat &= ~(0x80000000 >> 26))
X#define SDA_UP() (cp->cp_pbdat |=  (0x80000000 >> 27))
X#define SDA_DOWN() (cp->cp_pbdat &= ~(0x80000000 >> 27))
X#define SDA_INPUT() (cp->cp_pbdir &= ~(0x80000000 >> 27))
X#define SDA_OUTPUT() (cp->cp_pbdir |=  (0x80000000 >> 27))
X#define SDA_VAL() (cp->cp_pbdat & (0x80000000 >> 27))
X
X
X#define WAIT_90()                             do {  \
X    volatile int i = machine_cycles_per_bit >> 3;   \
X    while (i--) ;                                   \
X/*    schedule(); */                                \
X} while(0)
X#define WAIT_180() WAIT_90(); WAIT_90()
X
X
X#define WIGGLE()                                \
XSDA_OUTPUT();                                   \
XSDA_DOWN();                                     \
XSCL_DOWN();                                     \
XWAIT_90();                                      \
XSDA_UP();                                       \
XWAIT_90();                                      \
XSDA_DOWN();                                     \
XWAIT_90();
X
X
Xstatic void init_sda(void)
X{
X    /* SDA is port B pin 27 (see 34-8 of MPC860UM) */
X    SDA_OUTPUT();
X    cp->cp_pbpar &= ~(0x80000000 >> 27);
X    cp->cp_pbodr |=  (0x8000 >> (27-16));
X    SDA_UP();
X}
X
Xstatic void init_scl(void)
X{
X
X    /* SCL is port B pin 26 (see 34-8 of MPC860UM) */
X    cp->cp_pbdir |=  (0x80000000 >> 26);
X    cp->cp_pbpar &= ~(0x80000000 >> 26);
X    cp->cp_pbodr |=  (0x8000 >> (26-16));
X    SCL_UP();
X}
X
Xstatic void send_start_cond(void)
X{
X    SDA_OUTPUT();
X    SDA_UP();
X    SCL_UP();
X
X    WAIT_180();
X
X    SDA_DOWN();
X
X    WAIT_90();
X
X    SCL_DOWN();
X
X    WAIT_90();
X
X    /* SCL must be low at this point */
X}
X
Xstatic void send_stop_cond(void)
X{
X    /* SCL must be low at this point */
X
X    SCL_DOWN();
X    SDA_OUTPUT();
X    SDA_DOWN();
X
X    WAIT_90();
X
X    SCL_UP();
X
X    WAIT_90();
X
X    SDA_UP();
X
X    WAIT_180();
X}
X
X/* returns after all bytes sent, or after a byte has not been acknowledged */
X/* returns 0 if all n acknowledged, or -1 if one byte not acknowledged */
Xstatic int send_bytes(char *b, int n)
X{
X    int nack = 0;
X
X    /* SCL must be low at this point */
X    SCL_DOWN();
X    SDA_OUTPUT();
X
X    while (n--)
X    {
X        /* send *b */
X        unsigned char ch = (unsigned char) *b++;
X        unsigned char bitmsk = 0x80;
X
X
X        while (bitmsk)
X        {
X            (ch & bitmsk)? SDA_UP() : SDA_DOWN();
X            WAIT_90();
X            SCL_UP();
X            WAIT_180();
X            SCL_DOWN();
X            WAIT_90();
X            bitmsk >>=1;
X        }
X
X
X
X        /* recv ack */
X        SDA_INPUT();
X        WAIT_90();
X        SCL_UP();
X	
X        WAIT_180();
X        nack = SDA_VAL();
X	if( !nack)
X		goto got_ack;
X        WAIT_180();
X        nack = SDA_VAL();
X	if( !nack)
X		goto got_ack;
X        WAIT_180();
X        nack = SDA_VAL();
X	if( !nack)
X		goto got_ack;
X        WAIT_180();
X        nack = SDA_VAL();
Xgot_ack:	
X        WAIT_90();
X        SCL_DOWN();
X        WAIT_90();
X        SDA_OUTPUT();
X
X        if (nack)
X        {
X            if(i2c_8xx_debug) printk("%s: Nack was received n=%x\n",__func__, n );
X            break;
X        }
X    }
X
X    return nack?(-1):0;
X
X    /* SCL must be low at this point */
X}
X
Xstatic void recv_bytes(char *b, int n)
X{
X    /* SCL must be low at this point */
X
X
X    while (n--)
X    {
X        int i;
X        unsigned char ch = 0;
X
X        SDA_INPUT();
X
X        /* recv byte */
X        for (i = 0; i < 8; i++)
X        {
X            unsigned char bit;
X            WAIT_90();
X            SCL_UP();
X            WAIT_90();
X            bit = (unsigned char)(SDA_VAL()?1:0);
X            ch = bit | (ch<<1);
X            WAIT_90();
X            SCL_DOWN();
X            WAIT_90();
X        }
X        *b++ = ch;
X
X
X
X        /* acknowledge if we want more data still */
X        SDA_OUTPUT();
X
X        if (n)
X            SDA_DOWN(); /* send ack */
X        else
X            SDA_UP(); /* don't send ack */
X
X        WAIT_90();
X        SCL_UP();
X        WAIT_180();
X        SCL_DOWN();
X        WAIT_90();
X    }
X
X    /* SCL must be low at this point */
X}
X
Xint send_iic_addr(char abyte)
X{
X    int rc;
X    int retry = MAX_I2C_RETRY;
X
X
X    while(1)
X    {
X            send_start_cond();
X            rc = send_bytes(&abyte,1);
X            if (rc == 0)
X                    break;
X
X            send_stop_cond();
X
X            WAIT_180();
X
X            retry--;
X
X            if(retry == 0)
X            {
X               if(i2c_8xx_debug) printk("%s: error :  addr = %x.\n", __func__, abyte & 0xff);
X               return(-1);
X            }
X    }
X
X    return(0);
X}
X
X
X
X
X/* Read from IIC...
X * abyte = address byte, with r/w flag already set
X */
Xstatic int
Xi2c_8xx_recv(u_char abyte, char *buf, int count)
X{
X    if (i2c_8xx_debug) printk("read(abyte=0x%x)\n", abyte);
X
X
X    if(send_iic_addr((abyte<<1)|1))
X    {
X            if(i2c_8xx_debug) printk("%s: read operation failed\n", __func__);
X            return(-1);
X    }
X
X    recv_bytes(buf, count);  /*  last byte not acknowledged */
X    send_stop_cond();
X
X    return count;
X}
X
X
X
X/* Write to IIC...
X * addr = address byte, with r/w flag already set
X */
Xstatic int
Xi2c_8xx_send(u_char abyte, char *buf,int count)
X{
X    int rc = 0;
X
X    if (count > _8XX_MAX_I2C_LEN+4)
X        return -EINVAL;
X
X    send_start_cond();
X
X    if(send_iic_addr((abyte<<1)&0xfe))
X    {
X            if(i2c_8xx_debug) printk("%s: write operation (%x)\n", __func__, 0xff & abyte);
X            return(-1);
X    }
X
X    rc = send_bytes(buf, count);
X    send_stop_cond();
X
X    return rc?(-EFAULT):count;
X}
X
Xstatic int 
Xi2c_8xx_read(u_char addr, char * outbuf, unsigned int offset, unsigned int count, DType dtype)
X{
X        int rc;
X        char ee[4];
X
X        ee[0] = (offset >> 24) & 0xff;
X        ee[1] = (offset >> 16) & 0xff;
X        ee[2] = (offset >>  8) & 0xff;
X        ee[3] = offset & 0xff;
X
X        /*  Send address */
X	switch(dtype)
X	{
X		
X        case MST_TAVOR:
X                rc = i2c_8xx_send(addr, ee, 4);
X
X                if(rc != 4)
X                {
X			if(i2c_8xx_debug) printk("%s: failed sending 4-byte address.\n", __func__);
X                        return(-1);
X                }
X                break;
X		
X	case MST_GAMLA:
X		rc = i2c_8xx_send(addr, ee+2, 2);
X
X		if(rc != 2)
X		{
X			if(i2c_8xx_debug) printk("%s: failed sending 2-byte address.\n", __func__);
X			return(-1);
X		}
X		break;
X
X        case MST_DIMM:
X                rc = i2c_8xx_send(addr, ee+3, 1);
X
X                if(rc != 1)
X                {
X			if(i2c_8xx_debug) printk("%s: failed sending 1-byte address.\n", __func__);
X			return(-1);
X                }
X                break;		
X		
X	case MST_NOADDR:
X		break;
X
X	default:
X		return(-1);
X	}
X
X        /*  Receive bytes */
X        rc = i2c_8xx_recv(addr, outbuf, count);
X        if(rc != count)
X        {
X                if(i2c_8xx_debug) printk("%s: failed reading from I2C.\n", __func__);
X                return(-1);
X        }
X
X        return(count);
X}
X
Xstatic int 
Xi2c_8xx_write(u_char addr, char * outbuf, unsigned int offset, unsigned int count, DType dtype)
X{
X        int rc;
X
X        outbuf[0] = (offset >> 24) & 0xff;
X        outbuf[1] = (offset >> 16) & 0xff;
X        outbuf[2] = (offset >>  8) & 0xff;
X        outbuf[3] = offset & 0xff;
X
X        /*  Send  */
X	switch(dtype)
X	{
X        case MST_TAVOR:
X                rc = i2c_8xx_send(addr, outbuf, count+4);
X
X                if(rc != (count+4))
X                {
X			if(i2c_8xx_debug) printk("%s: failed 4-byte addr write\n", __func__);
X			return(-1);
X		}
X                break;		
X		
X	case MST_GAMLA:
X            	rc = i2c_8xx_send(addr, outbuf+2, count+2);
X
X		if(rc != (count+2))
X		{
X			if(i2c_8xx_debug) printk("%s: failed 2-byte addr write\n", __func__);
X			return(-1);
X		}
X		break;
X
X        case MST_DIMM:
X                rc = i2c_8xx_send(addr, outbuf+3, count+1);
X                if(rc != (count+1))
X		{
X			if(i2c_8xx_debug) printk("%s: failed 1-byte addr write\n", __func__);
X			return(-1);
X		}
X                break;
X		
X	case MST_NOADDR:
X                rc = i2c_8xx_send(addr, outbuf+4, count);
X
X		if(rc != count)
X		{
X			if(i2c_8xx_debug) printk("%s: failed --byte addr write\n", __func__);
X			return(-1);
X		}
X		break;
X
X	default:
X		return(-1);
X	}
X
X        return(count);
X}
X
X
X
Xstatic int __init i2c_8xx_init(void)
X{
X    /***bd_t* bd = (bd_t*)__res;***/
X    /***unsigned int system_clock = bd->bi_busfreq * 1000000;***/
X    unsigned int system_clock = CPU_FREQ_MHZ * 1000000;
X    machine_cycles_per_bit = system_clock/XI2C_BITRATE;
X    if( i2c_8xx_debug )
X	    printk( "machine_cycles_per_bit=%d, I2C_BitRate=%d\n", machine_cycles_per_bit, XI2C_BITRATE ); 
X
X    cp = cpmp;
X
X
X    init_sda();
X    init_scl();
X
X    return 0;
X}
X
X
Xstatic int major;
X
Xstatic int gen_dev_open(struct inode *inode, struct file *pfile);
Xstatic int gen_dev_ioctl(struct inode* pinode, struct file * pfile,
X                         unsigned int cmd, unsigned long arg);
Xstatic int gen_dev_close(struct inode *inode, struct file *pfile);
X
Xstruct file_operations fops = {
X    ioctl   :       gen_dev_ioctl,
X    open    :       gen_dev_open,
X    release :       gen_dev_close,
X};
X
X
Xstatic int gen_dev_close(struct inode *inode, struct file *pfile)
X{
X    MOD_DEC_USE_COUNT;
X
X    return(-1);
X}
X
X
X
Xstatic int gen_dev_open(struct inode *inode, struct file *pfile)
X{
X    MOD_INC_USE_COUNT;
X    return(0);
X}
X
Xint gen_dev_ioctl(struct inode* pinode, struct file * pfile, 
X                  unsigned int cmd, unsigned long arg)
X{
X    int rc=0;
X    mif_param_t * p = (mif_param_t *)arg;
X    char buf[0x80];
X    
X    switch ( cmd )
X    {
X    case MACCELERATE:
X        printk("ACCELERATE: mode acceleration no supported.\n");
X        return(ENOTTY);
X        
X
X    case MRESTORE:
X        printk("RESTORE: mode resotre no supported.\n");
X        return(ENOTTY);
X
X        
X    case MREAD64:
X    case MREAD4:
X        rc = i2c_8xx_read(p->addr, buf, p->offset, p->len, p->dtype);
X        if(rc != p->len)
X        {
X                if(i2c_8xx_debug) printk("%s: failed in MREAD.\n", __func__);
X                return(-1);
X        }
X        copy_to_user(p->buf, buf, p->len);
X        return(p->len);
X        
X    case MWRITE64:
X    case MWRITE4:
X        copy_from_user(buf + 4, p->buf, p->len);
X        rc = i2c_8xx_write(p->addr, buf, p->offset, p->len, p->dtype);
X        if(rc != p->len)
X        {
X                if(i2c_8xx_debug) printk("%s: failed in MWRITE.\n", __func__);
X                return(-1);
X        }
X        return(p->len);
X
X    default:
X        rc = ENOTTY;
X    }
X
X    return(rc);
X}
X
X
X
Xint init_module(void)
X{
X    int rc;
X
X
X    rc = i2c_8xx_init();
X    if(rc)
X    {
X        printk("%s: failed in init.\n", __func__);
X        return(rc);
X    }
X
X    major = register_chrdev(0, "mif-i2c-8xx", &fops);
X
X    if ( major < 0)
X    {
X        return major;
X    }
X
X
X    printk( "Loaded ppc-8xx driver\n" );
X    return(0);
X}
X
X
Xvoid cleanup_module(void)
X{
X    int rc;
X
X    rc=unregister_chrdev(major, "mif-i2c-8xx");
X
X}
X
X
X
SHAR_EOF
  : || $echo 'restore of' 'i2c-8xx_mod.c' 'failed'
fi
# ============= mdevices.c ==============
if test -f 'mdevices.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'mdevices.c' '(file already exists)'
else
  $echo 'x -' extracting 'mdevices.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'mdevices.c' &&
X/*
X *
X *  minit.c - CR Space access init
X *
X */
X
X#include <errno.h>
X#include <stdio.h>
X#include <stdlib.h>
X#include <string.h>
X#include <unistd.h>
X
X#include "mtcr.h"
X
X#define PRINT_DEV_BOARD(DEV,MT_TARGET,NICK) do { printf("%-32s --> %-15s (%s)\n",(DEV),(MT_TARGET),(NICK)); }while(0)
X
Xvoid usage(const char *n)
X{
X    printf( "USAGE %s [MST_DEVICE]\n", n);  
X    printf( "\tList mst device(s) with connection target\n");
X    printf( "DESCRIPTION\n" );
X    printf( "\tIf device not specifyed lists all existing mst devices\n" );
X    exit(1);
X}
X
Xint target_auto_detect( char* devname )
X{
X    mfile* mf;
X    int rc=0;
X    unsigned tmp;
X
X    /*  Open MST device */
X    mf=mopen( devname );
X    if( ! mf )
X    {
X        /*printf( "Can't open \"%s\" (%s)\n", devname, strerror(errno) );*/
X        return -1;
X    }
X
X    switch( mf->tp )
X    {
X    case MST_PCI:
X    case MST_PCICONF:
X    case MST_PPC:
X        if( ! mf->is_i2cm )
X        {
X            if( strstr( devname, "mt43132" ) )
X                PRINT_DEV_BOARD( devname, "mt43132", "anafa1" );
X            else if( strstr( devname, "mt47396" ) )
X                PRINT_DEV_BOARD( devname, "mt47396", "anafa2" );
X            else if( strstr( devname, "mt21108" ) )
X                PRINT_DEV_BOARD( devname, "mt21108", "gamla" );
X            else if( strstr( devname, "mt23108" ) )
X                PRINT_DEV_BOARD( devname, "mt23108", "tavor" );
X            else if( strstr( devname, "mt25208" ) )
X                PRINT_DEV_BOARD( devname, "mt25208", "arbel" );
X            else if( strstr( devname, "mt25218" ) )
X                PRINT_DEV_BOARD( devname, "mt25218", "arbel1" );
X            else if( strstr( devname, "mt25228" ) )
X                PRINT_DEV_BOARD( devname, "mt25228", "arbel2" );
X            else if( strstr( devname, "mt25238" ) )
X                PRINT_DEV_BOARD( devname, "mt25238", "arbel3" );
X            else if( strstr( devname, "mt24204" ) )
X                PRINT_DEV_BOARD( devname, "mt24204", "sinai" );
X            else if( strstr( devname, "mt24204" ) )
X                PRINT_DEV_BOARD( devname, "mt25204", "sinai8" );
X            else
X            {
X                PRINT_DEV_BOARD( devname, "unknown", "???" );
X                rc=-1;
X            }
X            break;
X        }
X        else;   /*  No break!!! Pass to I2C devices  */
X
X    case MST_CALBR:
X    case MST_USB:
X    case MST_USB_DIMAX:
X    case MST_IF:
X#ifdef ENABLE_MST_DEV_I2C
X    case MST_DEV_I2C:
X#endif
X
X        mf->dtype = MST_NOADDR;
X        mf->i2c_slave = 0x70;
X        rc=mread64( mf, 0, &tmp, 1 );   /* Try 0x70 */
X        if( rc==1 )
X        {
X            /* 0x70-yes */
X            mf->i2c_slave = 0x71;
X            rc=mread64( mf, 0, &tmp, 1 );   /* Try 0x71 */
X            if( rc==1 )
X            {
X                /* 0x70-yes 0x71-yes */
X                mf->i2c_slave = 0x73;
X                rc=mread64( mf, 0, &tmp, 1 );   /* Try 0x73 */
X                if( rc==1 )
X                {
X                    /* 0x70-yes 0x71-yes 0x73-yes */
X                    PRINT_DEV_BOARD( devname, "MT31000", "gazelle" );
X                    rc=0;
X                    break;
X                }
X                /* 0x70-yes 0x71-yes 0x73-no */
X            }
X            /* 0x70-yes 0x71-no */
X            PRINT_DEV_BOARD( devname, "MT34000", "rhino" );
X            rc=0;
X            break;
X        }
X        else
X        {
X            /* 0x70-no */
X            mf->i2c_slave = 0x71;
X            rc=mread64( mf, 0, &tmp, 1 );   /* Try 0x71 */
X            if( rc==1 )
X            {
X                /* 0x70-no 0x71-yes */
X                PRINT_DEV_BOARD( devname, "MT34000", "rhino" );
X                rc=0;
X                break;
X            }
X            /* 0x70-no 0x71-no */
X            /* Try other */    
X        } 
X
X        /*  Try Reindeer */
X        mf->dtype = MST_NOADDR;
X        mf->i2c_slave = 0x77;
X        rc=mread64( mf, 0, &tmp, 1 );
X        if( rc==1 )
X        {
X            PRINT_DEV_BOARD( devname, "MT33000", "reindeer" );
X            rc=0;
X            break;
X        }
X
X        /*  Try Anafa2 EVB */
X        mf->dtype = MST_DIMM;
X        mf->i2c_slave = 0x20;
X        rc=mread64( mf, 0, &tmp, 1 );
X        if( rc==1 )
X        {
X            PRINT_DEV_BOARD( devname, "MT11020", "EVB_anafa2" );
X            rc=0;
X            break;
X        }
X
X        /*  Try Anafa1 */
X        mf->dtype = MST_GAMLA;
X        mf->i2c_slave = 0x5a;
X        rc=mread4(mf, 0x2800, &tmp );
X        if( rc==4 && (((tmp & 0xffff0000) >> 16) == 43132) )
X        {
X            PRINT_DEV_BOARD( devname, "mt43132", "anafa1" );
X            rc=0;
X            break;
X        }
X
X        /*  Unknown */
X        PRINT_DEV_BOARD( devname, "unknown", "???" );
X        rc=0;
X        break;
X
X    case MST_IB:
X        break;   /*  TBD */
X    }
X
X    return rc;
X}
X
Xint main(int ac, char *av[])
X{
X    char          *devname;
X    int           rc = 0;
X    char          buf[2000];  
X    char*         pb;
X    int           i;
X    int           len;
X
X    if (ac > 2)
X        usage(av[0]);
X
X    if( ac == 2 )
X    {
X        if( av[1][0] == '-' )
X            usage(av[0]);
X        devname = av[1];
X        rc = target_auto_detect(devname);
X    }
X    else
X    {
X        pb=buf;
X        i = mdevices( pb, 2000, (int)(-1));
X        if( i < 0 )
X            return i;
X
X        while( (len=strlen(pb)) && i-- )
X        {
X            target_auto_detect(pb);
X            pb+=(len+1);
X        }
X    }
X
X    return rc;
X}
X
SHAR_EOF
  : || $echo 'restore of' 'mdevices.c' 'failed'
fi
# ============= minit.c ==============
if test -f 'minit.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'minit.c' '(file already exists)'
else
  $echo 'x -' extracting 'minit.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'minit.c' &&
X/*
X *
X *  minit.c - CR Space access init
X *
X */
X
X#include <errno.h>
X#include <stdio.h>
X#include <stdlib.h>
X#include <string.h>
X#include <sys/ioctl.h>
X#include <sys/types.h>
X#include <sys/stat.h>
X#include <sys/pci.h>
X#include <fcntl.h>
X#include <unistd.h>
X
X#include "mst_pci.h"
X#include "mst_pciconf.h"
X#include "mst_calbr.h"
X#ifdef MST_CPU_ppc_8xx
X  #include "mst_ppc.h"
X#endif
X
X#define CLEAR(st) memset(&(st), 0, sizeof(st))
X
Xvoid usage(const char *n)
X{
X
X    printf("\nFor PCI devices:\n\t%s <device> <busdevfn> <bar#>\n\n",n);
X    printf("For PCICONF devices:\n\t%s <device> <busdevfn> <addr_reg> <data_reg>\n\n",n);
X    printf("For CALIBRE\n\t%s <device> <base> <own> <clk>\n\n",n);
X#ifdef MST_CPU_ppc_8xx
X    printf("For PPC    \n\t%s <device> <cs>\n\n",n);
X#endif
X    exit(1);
X}
X
Xchar *printpci(unsigned int bus, unsigned int devfn)
X{
X    static char buf[10];
X    sprintf(buf, "%02x:%02x.%1x", bus, devfn >> 3, devfn & 0x7);
X    return buf;
X}
X
Xvoid getpci(char *str, unsigned int *bus, unsigned int *devfn)
X{
X    unsigned int dev, fn;
X    char         *p1 = strchr(str, ':');
X    char         *p2 = strchr(str, '.');
X
X    if (!p1 || !p2)
X    {
X        printf("Invalid \"busdevfn\" specification. Should be XX:XX.X\n");
X        exit(1);
X    }
X    *p1++ = '\0';
X    *p2++ = '\0';
X    *bus = strtol(str, NULL, 16);
X    dev = strtol(p1, NULL, 16);
X    fn = strtol(p2, NULL, 16);
X    *devfn = PCI_DEVFN(dev, fn);
X}
X
Xint main(int ac, char *av[])
X{
X    char          *devname;
X    int           rc = 0, fd = 0;
X
X    if (ac < 2)
X        usage(av[0]);
X
X    devname = av[1];
X    if (strstr(devname, "pciconf"))
X    {
X        /* PCICONF initialization */
X        struct mst_pciconf_init_st pciconf_init;
X        int                        use_as_i2cm = ! !strstr(devname,"i2cm");
X        CLEAR(pciconf_init);
X
X        if (ac < 5)
X            usage(av[0]);
X        if ((fd = open(devname, O_RDWR | O_SYNC)) < 0)
X        {
X            perror("open");
X            return 1;
X        }
X        getpci(av[2], &pciconf_init.bus, &pciconf_init.devfn);
X        pciconf_init.addr_reg = strtol(av[3], NULL, 0);
X        pciconf_init.data_reg = strtol(av[4], NULL, 0);
X        rc = ioctl(fd, PCICONF_INIT, &pciconf_init);
X        if (rc >= 0)
X        {
X            char buf[256];
X            sprintf(buf, "%-32s - PCI configuration cycles access%s.\n"
X                    "%34s bus:dev.fn=%s addr.reg=%d data.reg=%d\n",
X                    devname, use_as_i2cm?" (use as I2C master only) ":"", " ",
X                    printpci(pciconf_init.bus, pciconf_init.devfn),
X                    pciconf_init.addr_reg, pciconf_init.data_reg);
X            rc = (write(fd, buf, strlen(buf)) != strlen(buf));
X            if (rc)
X                perror("write");
X        }
X        else
X            perror("ioctl (PCICONF_INIT)");
X    }
X    else if (strstr(devname, "pci"))
X    {
X        /* PCI initialization */
X        struct mst_pci_init_st pci_init;
X        int                    use_as_i2cm = ! !strstr(devname,"i2cm");
X        CLEAR(pci_init);
X
X        if (ac < 4)
X            usage(av[0]);
X        if ((fd = open(devname, O_RDWR | O_SYNC)) < 0)
X        {
X            perror("open");
X            return 1;
X        }
X        getpci(av[2], &pci_init.bus, &pci_init.devfn);
X        pci_init.bar = strtol(av[3], NULL, 0);
X        rc = ioctl(fd, PCI_INIT, &pci_init);
X        if (rc >= 0)
X        {
X            struct mst_pci_params_st pars;
X            CLEAR(pars);
X            rc = ioctl(fd, PCI_PARAMS, &pars);
X            if (rc >= 0)
X            {
X                char buf[256];
X                sprintf(buf, "%-32s - PCI direct access%s.\n"
X                        "%34s bus:dev.fn=%s bar=0x%08llx size=0x%llx\n",
X                        devname, use_as_i2cm?" (use as I2C master only) ":"", " ",
X                        printpci(pci_init.bus, pci_init.devfn),
X                        pars.bar, pars.size);
X                rc = (write(fd, buf, strlen(buf)) != strlen(buf));
X                if (rc)
X                    perror("write");
X            }
X            else
X                perror("ioctl (PCI_PARAMS)");
X        }
X        else
X            perror("ioctl (PCI_INIT)");
X    }
X    else if (strstr(devname, "calbr") || strstr(devname, "calibre"))
X    {
X        /* Calibre initialization */
X        struct mst_calbr_init_st calbr_init;
X        CLEAR(calbr_init);
X
X        if (ac < 5)
X            usage(av[0]);
X        if ((fd = open(devname, O_RDWR | O_SYNC)) < 0)
X        {
X            perror("open");
X            return 1;
X        }
X        calbr_init.base = strtol(av[2], NULL, 0);
X        calbr_init.own  = strtol(av[3], NULL, 0);
X        calbr_init.clk_rate  = (calbr_i2c_clk_rate_t)strtol(av[4], NULL, 0);
X        rc = ioctl(fd, CALBR_INIT, &calbr_init);
X        if (rc >= 0)
X        {
X            char buf[256];
X            sprintf(buf, "%-32s - Calibre board as I2C master\n"
X                    "%34s base:0x%x own:0x%x clk_rate_idx:%d\n",
X                    devname, " ",
X                    calbr_init.base, calbr_init.own, calbr_init.clk_rate);
X            write(fd, buf, strlen(buf));
X        }
X    }
X    else if (strstr(devname, "vtop"))
X    {
X        char buf[256];
X
X        if ((fd = open(devname, O_RDWR | O_SYNC)) < 0)
X        {
X            perror("open");
X            return 1;
X        }
X        sprintf(buf, "%-32s - Virtual to physical addresses translation driver\n",
X                devname);
X        write(fd, buf, strlen(buf));
X    }
X    else if (strstr(devname, "usb"))
X    {
X      /* Nothing has to be done about usb devices */
X    }
X#ifdef MST_CPU_ppc_8xx
X    else if (strstr(devname, "ppc"))
X    {
X		struct mst_ppc_init_st ppc_init;
X        if (ac < 3)
X            usage(av[0]);
X        if ((fd = open(devname, O_RDWR | O_SYNC)) < 0)
X        {
X            perror("open");
X            return 1;
X        }
X        ppc_init.cs = strtol(av[2], NULL, 0);
X        ppc_init.size = strstr(devname, "47396") ? 0x200000 : 0x10000;
X        rc = ioctl(fd, PPC_INIT, &ppc_init);
X        if (rc >= 0)
X        {
X            struct mst_ppc_params_st pars;
X            CLEAR(pars);
X            rc = ioctl(fd, PPC_PARAMS, &pars);
X            if (rc >= 0)
X            {
X                char buf[256];
X                sprintf(buf, "%-32s - PPC direct access.\n"
X                        "%34s cs=%d addr=0x%08x size=0x%x\n",
X                        devname, " ", pars.cs, pars.addr, pars.size);
X                rc = (write(fd, buf, strlen(buf)) != strlen(buf));
X                if (rc)
X                    perror("write");
X            }
X            else
X                perror("ioctl (PCI_PARAMS)");
X        }
X        else
X            perror("ioctl (PCI_INIT)");
X    }
X#endif
X    else
X    {
X        printf("Invalid device name. Use that:\n");
X        usage(av[0]);
X    }
X    return rc;
X}
SHAR_EOF
  : || $echo 'restore of' 'minit.c' 'failed'
fi
# ============= mod_i2c.c ==============
if test -f 'mod_i2c.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'mod_i2c.c' '(file already exists)'
else
  $echo 'x -' extracting 'mod_i2c.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'mod_i2c.c' &&
X/*
X *  i2c.c - implementation of an i2c driver for the Calibre ISA card
X *
X *  Copyright (C) Mellanox Techniologies Ltd.
X *
X *  Creation date: 30-5-2000
X *
X *  Description: This file contains the implementation of a driver for the Calibre ISA card.
X *               It uses two IO addresses, one for control and one for data.
X *
X *  Changes:
X *
X */
X
X
X
X/* #define __SMP__   */ /* put in comment if compiling in single CPU machine */
X
X#include <linux/module.h>
X/* #include <linux/modversions.h> */
X#include <linux/kernel.h>
X#include <linux/ioport.h>
X#include <asm/io.h>
X#include <asm/uaccess.h>
X#include <linux/slab.h>
X#include <mtcr_types.h>
X#include <i2c.h>
X#include <linux/init.h>
X#include <linux/version.h>
X
X#ifndef KERNEL_VERSION
X#define KERNEL_VERSION(a, b, c) ((a)*65536+(b)*256+(c))
X#endif
X#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
X#include <linux/jiffies.h>
X#endif
X
X#define MTL_ERROR3 printk
X
X/* Deal with CONFIG_MODVERSIONS */
X/* #if CONFIG_MODVERSIONS==1 */
X/* #define MODVERSIONS */
X/* #include <linux/modversions.h> */
X/* #endif */
X
X/*========= macro definitions ====================================================*/
X
X#define I2C_LOCK_TIMEOUT_SEC 1
X
X#define I2C_TIMEOUT_JIFFIES (I2C_LOCK_TIMEOUT_SEC * HZ)
X
X
X/* bits definitions in control register */
X#define I2C_PIN  0x80
X#define ES0  0x40
X#define ES1  0x20
X#define ES2  0x10
X#define ENI  0x08
X#define STA  0x04
X#define STO  0x02
X#define ACK  0x01
X
X/* bits definitions in status register */
X#define I2C_PIN  0x80
X#define STS  0x20
X#define BER  0x10
X#define AD0  0x08
X#define LRB  0x08
X#define AAS  0x04
X#define LAB  0x02
X#define BB_  0x01
X
X
X/* allowable internal clock frequencies */
X#define CLK_3M    0x00
X#define CLK_4M33  0x10
X#define CLK_6M    0x14
X#define CLK_8M    0x18
X#define CLK_12M   0x1c
X
X#define CARD_I_CLK CLK_12M   /* the card uses 12Mhz internal clock frequency */
X
X/* serial clock frequencies */
X#define SCLK_90K    0x00
X#define SCLK_45K    0x01
X#define SCLK_11K    0x02
X#define SCLK_1K5    0x03
X
X
X#define MAX_DELAY_ITER 20000 /* max number of delay iterations in functions that poll */
X
XMODULE_AUTHOR("Eli Cohen - Mellanox Technologies LTD");
XMODULE_DESCRIPTION("I2C driver for Calibre ISA I2C card");
XMODULE_SUPPORTED_DEVICE("ICA93LV");
X
X
X/*========= exported symbols =====================================================*/
XEXPORT_SYMBOL(i2c_setup);
XEXPORT_SYMBOL(i2c_master_transmit);
XEXPORT_SYMBOL(i2c_master_receive);
XEXPORT_SYMBOL(i2c_send_stop);
XEXPORT_SYMBOL(i2c_present);
X
X
X/*========= static variables declarations ========================================*/
X/* indicates whether the module has been initialized and is ready to e used */
Xstatic bool module_opened = FALSE;
X
Xstatic u_int16_t card_base_address; /* base address of the card in io space */
Xstatic u_int16_t card_conf_address; /* the address of the control/status register */
Xstatic u_int8_t card_i2c_address; /* the I2C own address of the card */
Xstatic clk_rate_t card_ser_clock; /* the serial clock rate selected for the device */
X
X/* determines whether to insert a system call to interface with teh driver */
Xstatic bool use_syscall;
X
X/* a key used to allow access to the I2C bus when in a middle of a transaction
X   requiring repeated start. */
Xstatic u_int32_t access_key;
X
X/* flag that when set indicates that there is a transaction going on */
Xstatic bool transaction_on;
X
X/* the last time when the bus was locked */
Xstatic u_int32_t lock_time;
X
X
X
X/* define macros that allow to pass parameters from insmod */
X#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)
XMODULE_PARM(card_base_address, "i");
XMODULE_PARM(card_i2c_address, "i");
XMODULE_PARM(card_ser_clock, "i");
XMODULE_PARM(use_syscall, "i");
X#endif
X#ifdef MODULE_LICENSE
XMODULE_LICENSE("GPL");
X#endif
X
X
X/* pointer to hold original handler for the system call number we use */
X#ifdef SYSCALL_SUPPORT
Xstatic void *sys_old;
X#endif
X
X/*========= static functions prototypes ==========================================*/
Xstatic call_result_t wait_bus_free(u_int32_t count);
Xstatic call_result_t wait_PIN_low(u_int32_t count);
Xstatic u_int8_t get_status(void);
Xstatic void short_delay(void);
X#ifdef SYSCALL_SUPPORT
Xstatic asmlinkage int i2c_syscall(u_int32_t command, void *param_p);
X#endif
Xstatic u_int32_t new_key(void);
Xvoid check_timeout_and_release(void);
X
X
X
X
X/*========= external definitions =================================================*/
Xextern void *sys_call_table[]; /* the system call handlers table */
X
X
X
X#ifndef BINDKERNEL
X
Xstatic call_result_t __init init_ica93lv_module(void)
X{
X    char s[20];
X    call_result_t ret = MT_OK;
X
X    if ( (card_base_address == 0) |
X            (card_i2c_address == 0) |
X            ( card_ser_clock > clk_rate_90k ) ) {
X        return MT_OK; /* we let the module to be loaded but all the functions will fail
X                         because 'module_started' is FALSE */
X    }
X    else {
X        switch ( card_ser_clock ) {
X            case clk_rate_90k:
X                strcpy(s, "90 kbps");
X                break;
X
X            case clk_rate_45k:
X                strcpy(s, "45 kbps");
X                break;
X
X            case clk_rate_11k:
X                strcpy(s, "11 kbps");
X                break;
X
X            case clk_rate_1k5:
X                strcpy(s, "1.5 kbps");
X                break;
X
X            default:
X                strcpy(s, "invalid serial clock rate");
X                return MT_EINVAL;
X        }
X    }
X
X
X    if ( use_syscall ) {
X        /* only use syscalls if reqested */
X        /* when the module is intended to be used by kernel code the it is
X           not necessary to insert a system call */
X#ifdef SYSCALL_SUPPORT
X        sys_old = sys_call_table[__NR_i2c_syscall];
X        sys_call_table[__NR_i2c_syscall] = i2c_syscall;
X#endif
X    }
X
X
X    access_key = 0; /* initialize access key */
X    transaction_on = FALSE; /* no transacion in progress */
X    lock_time = jiffies;
X
X
X/*    if ( check_region(card_base_address, 2) < 0 ) return MT_ENORSC; */
X    if (request_region(card_base_address, 2, "mod_i2c") == NULL) return MT_ENORSC;
X
X    ret = i2c_setup(card_base_address, card_i2c_address, card_ser_clock);
X
X    if(ret != MT_OK)
X    {
X        release_region(card_base_address, 2);
X        card_base_address = 0;
X    }
X
X    return MT_OK;
X}
X
Xstatic void __exit cleanup_ica93lv_module(void)
X{
X    if(card_base_address != 0)
X        release_region(card_base_address, 2);
X#ifdef SYSCALL_SUPPORT
X    sys_call_table[__NR_i2c_syscall] = sys_old;
X#endif
X}
X
Xmodule_init(init_ica93lv_module);
Xmodule_exit(cleanup_ica93lv_module);
X
X#endif
X
X/*
X *  i2c_setup()
X */
Xcall_result_t i2c_setup(u_int16_t base, u_int8_t own, clk_rate_t sclk)
X{
X    u_int8_t S2, data;
X    int i;
X
X
X    /* check that the clock rate is valid */
X    switch (sclk) {
X        case clk_rate_90k:
X            card_ser_clock = clk_rate_90k;
X            S2 = SCLK_90K | CARD_I_CLK;
X            break;
X
X        case clk_rate_45k:
X            card_ser_clock = clk_rate_45k;
X            S2 = SCLK_45K | CARD_I_CLK;
X            break;
X
X
X        case clk_rate_11k:
X            card_ser_clock = clk_rate_11k;
X            S2 = SCLK_11K | CARD_I_CLK;
X            break;
X
X        case clk_rate_1k5:
X            card_ser_clock = clk_rate_1k5;
X            S2 = SCLK_1K5 | CARD_I_CLK;
X            break;
X
X
X        default:
X            return MT_EINVAL;
X    }
X
X
X    /* check that the i2c address is valid */
X    if ( own & '\x80' ) {
X        /* this card supports only 7 bits address */
X        return MT_EINVAL;
X    } else {
X        card_i2c_address = own;
X    }
X
X
X    /* card's addresses in the io space */
X    card_base_address = base;
X    card_conf_address = card_base_address + 1;
X
X
X    /* set the cards own address */
X
X    outb_p(I2C_PIN, card_conf_address);
X    for (i=0; i<50; ++i) short_delay();
X    outb_p(card_i2c_address, card_base_address);
X    for (i=0; i<50; ++i) short_delay();
X
X    data = inb_p(card_base_address);
X    for (i=0; i<50; ++i) short_delay();
X    if ( data != card_i2c_address ) {
X        if(card_base_address != 0)
X            printk("<1>cannot read back card i2c address\n");
X        return MT_ERROR;
X    }
X
X    /* set serial clock frequency */
X    outb_p(I2C_PIN | ES1, card_conf_address);
X    for (i=0; i<50; ++i) short_delay();
X    outb_p(S2, card_base_address);
X    for (i=0; i<50; ++i) short_delay();
X
X    /* enable the i2c lines */
X    outb_p(I2C_PIN | ES0 | ACK, card_conf_address);
X    for (i=0; i<50; ++i) short_delay();
X
X
X    /* mark module as initialized */
X    module_opened = TRUE;
X
X    return MT_OK;
X}
X
X
X
X
X
X/*
X *  i2c_master_transmit()
X */
Xcall_result_t i2c_master_transmit(unsigned char slv_addr, void *buffer, int count, int *bytes_sent_p,
X        bool sendSTOP, u_int32_t *const key_p)
X{
X    unsigned char status, data;
X    int sent, i;
X
X    if ( module_opened == FALSE ) {
X        return MT_ENOINIT;
X    }
X
X
X    if ( slv_addr & 0x80 ) {
X        /* invalid slave address */
X        check_timeout_and_release();
X        MTL_ERROR3("%s(%d): Invalid slave address.\n", __func__, __LINE__);
X        return MT_EINVAL;
X    }
X
X    if ( key_p == NULL ) {
X        return MT_EINVAL;
X    }
X
X    if ( transaction_on == FALSE ) {
X        /* no transaction in progress */
X        if ( *key_p != 0 ) {
X            /* tried to continue a transaction when there is no transaction in progress */
X            MTL_ERROR3("%s(%d): Invalid outstanding transaction.\n", __func__, __LINE__);
X            return MT_EI2CNOTRAN;
X        }
X    }
X    else {
X        /* a transaction is already in progress */
X        check_timeout_and_release();
X        MTL_ERROR3("%s(%d): Device busy.\n", __func__, __LINE__);
X        return MT_EBUSY;
X    }
X
X    /* wait for the bus to become free */
X    if ( wait_bus_free(MAX_DELAY_ITER) == MT_EBUSBUSY ) {
X        MTL_ERROR3("%s(%d): Bus busy.\n", __func__, __LINE__);
X        return MT_EBUSBUSY;
X    }
X
X
X
X    /* load slave address to S0 register */
X    outb_p( slv_addr << 1, card_base_address);
X
X    /*  Retry first transaction */
X    for(i = 0; i < MAX_DELAY_ITER; i++)
X    {
X
X        /* generate START and clock out the slave address */
X        outb_p(I2C_PIN | ES0 | STA | ACK, card_conf_address);
X
X        if ( wait_PIN_low(MAX_DELAY_ITER) == MT_EI2PINHI ) {
X            MTL_ERROR3("%s(%d): Pin signal doens't becomes low.\n", __func__, __LINE__);
X            return MT_EI2PINHI;
X        }
X
X
X        status = get_status();
X
X        if ( ! (status & LRB) )
X            break;
X    }
X
X
X    for (i=0, sent=0; i<=count; ++i) {
X
X        if ( wait_PIN_low(MAX_DELAY_ITER) == MT_EI2PINHI ) {
X            MTL_ERROR3("%s(%d): Pin signal doens't becomes low.\n", __func__, __LINE__);
X            return MT_EI2PINHI;
X        }
X
X
X        status = get_status();
X
X        if ( status & LRB ) {
X            /* NACK received */
X
X            outb_p(I2C_PIN | ES0 | STO | ACK, card_conf_address); /* send STOP */
X            *bytes_sent_p = sent;
X            transaction_on = FALSE;
X            MTL_ERROR3("%s(%d): Nack received after sending %x bytes.\n", __func__, __LINE__, sent);
X            return MT_EI2CNACK;
X        }
X
X        if ( sent >= count ) {
X            break;
X        }
X
X        data = *((u_int8_t *)buffer+i);
X        outb_p(data, card_base_address);
X        sent++;
X    }
X
X    /* only send STOP if explicitly requested */
X    if ( sendSTOP == TRUE ) {
X        outb_p(I2C_PIN | ES0 | STO | ACK, card_conf_address); /* send STOP */
X    }
X    else {
X        /* we are not sending STOP => transaction becomes on */
X        access_key = new_key(); /* allocate new key */
X        *key_p = access_key;
X        transaction_on = TRUE;
X        lock_time = jiffies; /* record the time the bus was locked */
X    }
X
X
X    *bytes_sent_p = sent;
X    return MT_OK;
X}
X
X
X/*
X *  i2c_master_receive()
X */
Xcall_result_t i2c_master_receive(u_int8_t slv_addr, void *buffer, u_int16_t count,
X        u_int32_t *bytes_received_p, bool sendSTOP,
X        const u_int32_t key)
X{
X    u_int16_t received;
X    u_int8_t status, data;
X    bool first = TRUE;
X
X    if ( module_opened == FALSE ){
X        return MT_ENOINIT;
X    }
X
X
X
X
X    if ( transaction_on == FALSE ) {
X        /* no transaction in progress */
X        if ( key != 0 ) {
X            /* tried to continue a transaction when there is no transaction in progress */
X            return MT_EI2CNOTRAN;
X        }
X        else {
X
X            /* wait for the I2C bus to become free */
X            if ( wait_bus_free(MAX_DELAY_ITER) == MT_EBUSBUSY ) {
X                /*         outb_p(I2C_PIN | ES0 | STO | ACK, card_conf_address);  */ /* send STOP */
X                return MT_EBUSBUSY;
X            }
X
X            /* make sure the bus is enabled and can address S0 */
X            outb_p(I2C_PIN | ES0, card_conf_address);
X        }
X    }
X    else {
X        /* a transaction is already in progress */
X        if ( key != access_key ) {
X            /* key mismatch, request rejected */
X            check_timeout_and_release();
X            return MT_EBUSY;
X        }
X        else {
X            /* repeated start */
X            outb_p(ES0 | STA | ACK, card_conf_address);
X        }
X    }
X
X
X
X
X
X    /* load slave adddress + read */
X    outb_p((slv_addr << 1) | 0x01, card_base_address);
X
X
X
X
X
X    /* generate START and clock out the slave address */
X    outb_p(I2C_PIN | ES0 | STA | ACK, card_conf_address);
X
X    received = 0;
X
X    while ( 1 ) {
X
X        if ( wait_PIN_low(MAX_DELAY_ITER) == MT_EI2PINHI ) {
X            return MT_EI2PINHI;
X        }
X
X        status = get_status();
X
X        if ( status & LRB ) {
X            /* NACK received */
X            outb_p(I2C_PIN | ES0 | STO | ACK, card_conf_address); /* send STOP */
X            data = inb_p(card_base_address); /* read byte */
X            *((char *)buffer+received) = data;
X            *bytes_received_p = received;
X            return MT_EI2CNACK;
X        }
X
X        if ( received == (count-1) ) {
X            break;
X        }
X
X        data = inb_p(card_base_address);
X        if ( first == TRUE ) {
X            first = FALSE;
X        } else {
X            *((char *)buffer+received-1) = data;
X        }
X
X        received++;
X    }
X
X    /* send NACK to terminate reception */
X    outb_p(ES0, card_conf_address);
X
X    data = inb_p(card_base_address);
X    *((u_int8_t *)buffer+received-1) = data;
X
X    received++;
X
X    if ( wait_PIN_low(MAX_DELAY_ITER) == MT_EI2PINHI ) {
X        return MT_EI2PINHI;
X    }
X
X
X    if ( sendSTOP == TRUE ) {
X        /* send STOP */
X        outb_p(I2C_PIN | ES0 | STO | ACK, card_conf_address);
X        transaction_on = FALSE; /* finish transaction */
X    }
X
X
X    data = inb_p(card_base_address);
X    *((char *)buffer+received-1) = data;
X
X
X    *bytes_received_p = received;
X
X    return MT_OK;
X}
X
X
X
X/*
X *  i2c_send_stop()
X */
Xcall_result_t i2c_send_stop(const u_int32_t key)
X{
X
X    if ( module_opened == FALSE ) {
X        return MT_ENOINIT;
X    }
X
X
X    if ( key != access_key ) {
X        /* no access writes to caller */
X        check_timeout_and_release();
X        return MT_EBUSY;
X    }
X
X    outb_p(I2C_PIN | ES0 | STO | ACK, card_conf_address); /* send STOP */
X
X    transaction_on = FALSE;
X    return MT_OK;
X}
X
X
X/*
X * i2c_present()
X *    Since the module can be loaded even if it was not passed the parameters
X *    This function can be used to verify if the module is usable.
X *    It should be noted however that even if the function returns TRUE it does not
X *    imply that the hardware really exists
X */
Xbool i2c_present(void)
X{
X    return module_opened;
X}
X
X
X
X
X
X/*===================== static fucntions declarations ==================*/
X
X
X
X
X/***************************************************************************************************
X * Function: wait_bus_free
X *
X * Description: wait for the bus to become free
X *
X * Parameters: count(IN): max number of iterations of short_delay() before the function returns
X *                        MT_EBUSBUSY
X *
X * Returns: MT_OK or MT_EBUSBUSY
X *
X * Notes:
X *
X **************************************************************************************************/
Xstatic call_result_t wait_bus_free(u_int32_t count)
X{
X    u_int8_t status;
X    u_int32_t i;
X    static u_int32_t busy_time_stamp;
X    static bool counting = FALSE;
X
X    status = inb_p(card_conf_address);
X    /* wait until bus is free */
X    for (i=0; i<count; ++i ) {
X        if ( (status & BB_) == BB_ ) {
X            return MT_OK;
X        }
X        short_delay();
X        status = inb_p(card_conf_address);
X    }
X
X
X    if ( counting == TRUE ) {
X        if ( (jiffies - busy_time_stamp) > (5 * 100) ) {
X            i2c_send_stop(access_key);
X            counting = FALSE;
X        }
X    }
X    else {
X        busy_time_stamp = jiffies;
X        counting = TRUE;
X    }
X
X    return MT_EBUSBUSY;
X}
X
X
X
X
X#ifdef SYSCALL_SUPPORT
X/***************************************************************************************************
X * Function: i2c_syscall
X *
X * Description: this function runs in kernel space and identifies the operation code
X *              required by the user
X *
X * Parameters: command(IN): the code of the operation required
X *             param_p(IN/OUT): this is a void pointer whose type depends on the type of operation
X *                              required
X *
X * Returns: MT_OK - success
X *          MT_ERROR - error
X *
X * Notes:
X *
X **************************************************************************************************/
Xstatic asmlinkage call_result_t i2c_syscall(u_int32_t command, void *param_p)
X{
X    i2c_op_init_st init_var;
X    i2c_op_master_transmit_st master_transmit_var;
X    i2c_op_master_receive_st master_receive_var;
X    i2c_op_send_stop_st send_stop_var;
X    u_int8_t *k_buf;
X    u_int32_t bytes_sent, bytes_received, l_key;
X    call_result_t rc;
X
X
X    switch ( command ) {
X        case I2C_OP_INIT:
X            /* copy param_p to local variable */
X            copy_from_user(&init_var, param_p, sizeof(init_var));
X
X            rc = i2c_setup(init_var.base, init_var.own, init_var.sclk);
X            copy_to_user(&((i2c_op_init_st *)param_p)->ret_val, &rc, sizeof(rc));
X            return rc;
X
X        case I2C_OP_MASTER_TRANSMIT:
X            /* copy param_p to local variable */
X            copy_from_user(&master_transmit_var, param_p, sizeof(master_transmit_var));
X
X            /* allocate buffer in kernel space where to put the data to be transmitted */
X            k_buf = kmalloc(master_transmit_var.count, GFP_KERNEL);
X            if ( k_buf == NULL ) {
X                /* failure allocating buffer */
X                rc = MT_EKMALLOC;
X                copy_to_user(&((i2c_op_master_transmit_st *)param_p)->ret_val, &rc, sizeof(rc));
X                return rc;
X            }
X
X            /* copy contents of buffer from user to kernel space */
X            copy_from_user(k_buf, master_transmit_var.buffer, master_transmit_var.count);
X
X            copy_from_user(&l_key, master_transmit_var.key_p, sizeof(u_int32_t));
X
X            rc = i2c_master_transmit(master_transmit_var.slv_addr,
X                    k_buf,
X                    master_transmit_var.count,
X                    &bytes_sent,
X                    master_transmit_var.sendSTOP,
X                    &l_key);
X
X            /* free allocated buffer */
X            kfree(k_buf);
X
X            /* return to user number of bytes transmitted */
X            copy_to_user(((i2c_op_master_transmit_st *)param_p)->bytes_sent_p, &bytes_sent, sizeof(int));
X            copy_to_user(&(((i2c_op_master_transmit_st *)param_p)->ret_val), &rc, sizeof(rc));
X            copy_to_user(((i2c_op_master_transmit_st *)param_p)->key_p, &l_key, sizeof(u_int32_t));
X
X            return rc;
X
X
X        case I2C_OP_MASTER_RECEIVE:
X            /* copy param_p to local variable */
X            copy_from_user(&master_receive_var, param_p, sizeof(master_receive_var));
X
X            /* allocate buffer in kernel space where to put the data read */
X            k_buf = kmalloc(master_receive_var.count, GFP_KERNEL);
X            if ( k_buf == NULL ) {
X                /* failure allocating buffer */
X                rc = MT_EKMALLOC;
X                copy_to_user(&((i2c_op_master_receive_st *)param_p)->ret_val, &rc, sizeof(rc));
X                return rc;
X            }
X
X
X            rc = i2c_master_receive(master_receive_var.slv_addr,
X                    k_buf,
X                    master_receive_var.count,
X                    &bytes_received,
X                    master_receive_var.sendSTOP,
X                    master_receive_var.key);
X
X
X            /* copy contents of buffer from user to kernel space */
X            copy_to_user(master_receive_var.buffer, k_buf, bytes_received);
X
X            /* free allocated buffer */
X            kfree(k_buf);
X
X            /* return to user number of bytes received */
X            copy_to_user(master_receive_var.bytes_received_p, &bytes_received, sizeof(int));
X            copy_to_user(&((i2c_op_master_receive_st *)param_p)->ret_val, &rc, sizeof(rc));
X
X            return rc;
X
X        case I2C_OP_SEND_STOP:
X            copy_from_user(&send_stop_var, param_p, sizeof(send_stop_var));
X
X            rc = i2c_send_stop(send_stop_var.key);
X            copy_to_user(&((i2c_op_send_stop_st *)param_p)->ret_val, &rc, sizeof(rc));
X            return rc;
X
X        default:
X            rc = MT_ERROR;
X            copy_to_user(&((i2c_op_send_stop_st *)param_p)->ret_val, &rc, sizeof(rc));
X            return rc;
X    }
X}
X#endif
X
X
X
X/***************************************************************************************************
X * Function: wait_PIN_low
X *
X * Description: wait for the I2C_PIN (Pending Interrupt Not) bit to low, signifying that the device
X *              needs service due to character transmitted, received etc.
X *
X * Parameters: count(IN): max number of iterations of short_delay() before the function returns
X *                        MT_ERROR
X *
X * Returns: MT_OK or MT_ERROR
X *
X * Notes:
X *
X **************************************************************************************************/
Xstatic call_result_t wait_PIN_low(u_int32_t count)
X{
X    u_int8_t status;
X    u_int32_t i;
X
X    status = inb_p(card_conf_address);
X    /* wait until I2C_PIN becomes low */
X    for (i=0; i<count; ++i ) {
X        if ( (status & I2C_PIN) == 0 ) {
X            return MT_OK;
X        }
X        short_delay();
X        status = inb_p(card_conf_address);
X    }
X    return MT_EI2PINHI;
X}
X
X
X
X/***************************************************************************************************
X * Function: get_status
X *
X * Description: get the status of the I2C
X *
X * Parameters:
X *
X * Returns: the staus byte of the device
X *
X * Notes:
X *
X **************************************************************************************************/
Xstatic unsigned char get_status(void)
X{
X    return inb_p(card_conf_address);
X}
X
X
X
X
X/***************************************************************************************************
X * Function: short_delay
X *
X * Description: do a short delay. this is needed to do efficient polling of the chip's
X *              status flags
X *
X * Parameters:
X *
X * Returns:
X *
X * Notes:
X *
X **************************************************************************************************/
Xstatic void short_delay(void)
X{
X    schedule();
X}
X
X
X
X
X
X/***************************************************************************************************
X * Function: new_key
X *
X * Description: return a new, random non zero, 32 bit number to be used as a key
X *
X * Parameters:
X *
X * Returns:
X *
X * Notes:
X *
X **************************************************************************************************/
Xstatic u_int32_t new_key(void)
X{
X    return 0x12345678; /* do real implementation ??????? */
X}
X
X
X
X/***************************************************************************************************
X * Function: check_timeout_and_release
X *
X * Description: check if the bus is locked (transactio_on) for too much time and release it.
X *
X * Parameters:
X *
X * Returns:
X *
X * Notes:
X *
X **************************************************************************************************/
Xvoid check_timeout_and_release(void)
X{
X    if ( (jiffies - lock_time) >= I2C_TIMEOUT_JIFFIES ) {
X        i2c_send_stop(access_key);
X
X        i2c_setup(card_base_address, card_i2c_address, card_ser_clock);
X    }
X}
SHAR_EOF
  : || $echo 'restore of' 'mod_i2c.c' 'failed'
fi
# ============= mread.c ==============
if test -f 'mread.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'mread.c' '(file already exists)'
else
  $echo 'x -' extracting 'mread.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'mread.c' &&
X/*
X *
X *  mread.c - CR Space read access
X *
X */
X
X#include <stdio.h>
X#include <stdlib.h>
X#include <string.h>
X
X#include "mtcr.h"
X
Xvoid usage(const char *n)
X{
X    printf("%s <device> <addr> [<i2c_slave>]\n", n);
X    exit(1);
X}
X
Xint main(int ac, char *av[])
X{
X    char          *endp;
X    int           rc=0;
X    unsigned int  addr, val;
X    mfile         *mf;
X    DType         dtype = MST_TAVOR;
X
X#if 0
X    int  i, rc1;
X    char buf[1024], *p=buf;
X    rc1 = mdevices(buf, 1024);
X    for (i=0; i<rc1; i++)
X    {
X        printf("Found: \"%s\"\n", p);
X        p += strlen(p)+1;
X    }
X    exit(0);
X#endif
X
X    if (ac < 3)
X        usage(av[0]);
X    addr = strtoul(av[2], &endp, 0);
X    if (*endp)
X        usage(av[0]);
X
X    if (strstr(av[1], "mt21108_pci") && !strstr(av[1], "i2cm"))
X        dtype = MST_GAMLA;
X    mf = mopend(av[1], dtype);
X    if (!mf)
X    {
X        perror("mopen");
X        return 1;
X    }
X
X    if (ac >= 4)
X        mset_i2c_slave(mf, strtoul(av[3],0,0));
X
X    if ((rc = mread4(mf, addr, &val)) < 0)
X    {
X        mclose(mf);
X        perror("mread");
X        return 1;
X    }
X    if (rc < 4)
X    {
X        mclose(mf);
X        printf("Read only %d bytes\n", rc);
X        return 1;
X    }
X
X    mclose(mf);
X    printf("Read 0x%08x:0x%08x\n", addr, val);
X    return rc;
X}
SHAR_EOF
  : || $echo 'restore of' 'mread.c' 'failed'
fi
# ============= mremote.c ==============
if test -f 'mremote.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'mremote.c' '(file already exists)'
else
  $echo 'x -' extracting 'mremote.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'mremote.c' &&
X/*
X *
X *  mremoet.c - mtcr remote agent
X *
X */
X#include <stdio.h>
X#include <stdlib.h>
X#include <string.h>
X#include <unistd.h>
X
X#include "mtcr.h"
X#include "tcp.h"
X
Xvoid usage(const char *n)
X{
X
X    printf("%s <host:port> <command>\n", n);
X    exit(1);
X}
X
Xint main(int ac, char *av[])
X{
X    int  ic, port, con;
X    char *host_p, *port_p, buf[1024];;
X
X    if (ac < 3)
X        usage(av[0]);
X
X    /*  Device and port pointers */
X    host_p = av[1];
X    port_p = strchr(host_p, ':');
X    if (!port_p)
X        usage(av[0]);
X    *port_p = '\0';
X    port_p++;
X
X    /*  Open connection */
X    port = strtol(port_p, 0, 10);
X    con = open_cli_connection(host_p, port);
X    if (con < 0)
X    {
X        perror("Open connection (client side)");
X        exit(1);
X    }
X
X    for (ic = 2; ic < ac; ic++)
X    {
X        char *cmd = av[ic];
X
X        /*  Send command */
X        if (writes(con, cmd) < 0)
X        {
X            perror("Write to socket");
X            exit(1);
X        }
X
X        /*  Get answer */
X        if (reads(con, buf, 1024) < 0)
X        {
X            perror("Read from socket");
X            exit(1);
X        }
X
X        if (*buf != 'O')
X        {
X            printf("%s\n", buf);
X            exit(1);
X        }
X
X        if (*cmd == 'L')
X        {
X            /*  List command - special treatment */
X            int i, ndevs = strtol(buf+2, 0, 10);
X            for (i=0; i<ndevs; i++)
X            {
X                if (reads(con, buf, 1024) < 0)
X                {
X                    perror("Read from socket");
X                    exit(1);
X                }
X                printf("%s ", buf);
X            }
X            printf("\n");
X        }
X        else
X        {
X            /*  Other command - just print result */
X            if (strlen(buf) > 2)
X                printf("%s\n", buf+2);
X        }
X    }
X
X    close(con);
X    return 0;
X}
SHAR_EOF
  : || $echo 'restore of' 'mremote.c' 'failed'
fi
# ============= mst_calbr_mod.c ==============
if test -f 'mst_calbr_mod.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'mst_calbr_mod.c' '(file already exists)'
else
  $echo 'x -' extracting 'mst_calbr_mod.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'mst_calbr_mod.c' &&
X#include <linux/kernel.h>
X#include <linux/module.h>
X#include <asm/io.h>
X#include <asm/uaccess.h>
X#include <linux/pci.h>
X#include "mst_calbr.h"
X
X/* #include "calbr_i2c.h" */
X#include "i2c.h"
X#define  INIT   CALBR_INIT
X#define  STOP   CALBR_STOP
X#define  TRANS  CALBR_TRANS
X
Xstatic char* name="mst_calbr";
X
X#if CONFIG_COMPAT && !HAVE_COMPAT_IOCTL
Xstatic unsigned int
Xioctl_cmds[] ={
X  TRANS
X};
X#endif
X
X/* Allow minor numbers 0-255 */
X#define MAXMINOR 256
X#define BUFFER_SIZE 256
X
Xstruct dev_data {
X	unsigned short base;
X	unsigned char  own;
X	calbr_i2c_clk_rate_t  clk_rate; /*Pass enum clk_rate_t as a value*/
X  volatile int valid;
X  struct semaphore sem;
X  char buf[BUFFER_SIZE];
X  int bufused;
X};
X
Xstatic struct dev_data devices[MAXMINOR];
X
X/* #include "calbr_i2c.c" */
X
Xstatic int ioctl (struct inode *inode, struct file *file, unsigned int opcode, unsigned long udata_l)
X{
X  void* udata=(void*)udata_l;
X  int minor=MINOR(inode->i_rdev);
X  struct dev_data* dev=&devices[minor];
X  int ret=0;
X
X  /* By convention, any user gets read access
X   * and is allowed to use the device.
X   * Commands with no direction are administration
X   * commands, and you need write permission
X   * for this */
X
X  if ( _IOC_DIR(opcode) == _IOC_NONE ) {
X    if (! ( file->f_mode & FMODE_WRITE) ) return -EPERM;
X  } else {
X    if (! ( file->f_mode & FMODE_READ) ) return -EPERM;
X  }
X
X  if (down_interruptible(&devices[minor].sem)) {
X    return -ERESTARTSYS;
X  }
X
X
X  switch (opcode) {
X
X    case INIT:
X      {
X        struct mst_calbr_init_st initd;
X        /* Now have to init the new device */
X
X        if (copy_from_user(&initd, udata, sizeof(initd))) {
X          ret=-EFAULT;
X          goto fin;
X        }
X
X#if 0
X        /*Init global vars */
X        access_key = 0; /* initialize access key */
X        transaction_on = 0; /* no transacion in progress */
X        lock_time = jiffies;
X
X
X        /* Return busy ? */
X        if ( check_region(initd.base, 2) < 0 ) return -ENXIO;
X        printk("REQUEST region name %s\n", name);
X
X        request_region(initd.base, 2, name);
X
X        if ((ret=i2c_setup(initd.base, initd.own, initd.clk_rate)) )
X          goto fin;
X#endif
X
X        if (! i2c_present()) {
X          ret=-EINVAL;
X          goto fin;
X        }
X
X        dev->base=initd.base;
X
X        dev->own=initd.own;
X        dev->clk_rate=initd.clk_rate;
X
X        dev->valid=1;
X
X        goto fin;
X      }
X
X    case STOP:
X#if 0
X      release_region(dev->base, 2);
X#endif
X      dev->valid=0;
X      goto fin;
X
X
X    case TRANS:
X      {
X        struct mst_trans_st transd;
X        u_int32_t key=0;
X        /*We don't actually need to copy the read buffer etc */
X        if (copy_from_user(&transd, udata, sizeof(transd))) {
X          ret=-EFAULT;
X          goto fin;
X        }
X
X        if (!dev->valid) {
X          ret=-ENOTTY;
X          goto fin;
X        }
X
X        if (transd.wr_size > MAX_WR_TRANS_SIZE || transd.rd_size > MAX_RD_TRANS_SIZE) {
X          ret=-EOVERFLOW;
X          goto fin;
X        }
X
X        if (transd.wr_size) {
X          if ((ret=i2c_master_transmit(transd.slv_addr, transd.wr_buff,transd.wr_size, & transd.wr_count, transd.rd_size == 0,  & key))) {
X            goto trans_fin;
X          }
X
X          if (transd.wr_count != transd.wr_size) {
X            i2c_send_stop(key);
X            ret=-ENOLINK;
X            goto trans_fin;
X          }
X        }
X
X        if (transd.rd_size) {
X          if ((ret=i2c_master_receive(transd.slv_addr, transd.rd_buff,transd.rd_size, & transd.rd_count, 1, key))) {
X            goto trans_fin;
X          }
X
X          if (transd.rd_count != transd.rd_size) {
X            ret=-ENOLINK;
X            goto trans_fin;
X          }
X        } else {
X          transd.rd_count =0;
X        }
X
Xtrans_fin:
X	if (copy_to_user(udata, &transd, sizeof(transd))) {
X		ret=ret?ret:-EFAULT;
X	}
X        goto fin;
X      }
X    default:
X      ret= -ENOTTY;
X      goto fin;
X
X  }
X
X
Xfin:
X  up(&dev->sem);
X  return ret;
X}
X
X#include "driver_common.c"
X
SHAR_EOF
  : || $echo 'restore of' 'mst_calbr_mod.c' 'failed'
fi
# ============= mst_irq_mod.c ==============
if test -f 'mst_irq_mod.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'mst_irq_mod.c' '(file already exists)'
else
  $echo 'x -' extracting 'mst_irq_mod.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'mst_irq_mod.c' &&
X#include <linux/kernel.h>
X#include <linux/module.h>
X#include <asm/io.h>
X#include <asm/uaccess.h>
X#include <linux/pci.h>
X
X#include "mst_irq.h"
X#define  INIT   IRQ_INIT
X#define  STOP   IRQ_STOP
X#define  PARAMS IRQ_PARAMS
X#define  BLOCK IRQ_BLOCK
X
Xstatic char* name="mst_irq";
X
X#define GPIO_OFF 0xF0080
X#define GPIO_SIZE 0x60
X#define GPIO_INT_DATA  (0xF0080-GPIO_OFF)
X#define GPIO_INT_CLEAR (0xF00D0-GPIO_OFF)
X
X/* Allow minor numbers 0-255 */
X#define MAXMINOR 256
X#define BUFFER_SIZE 256
X
XMODULE_AUTHOR("Michael S. Tsirkin - Mellanox Technologies LTD");
XMODULE_DESCRIPTION("Mellanox Software Tools driver for accessing Tavor PCI memory");
XMODULE_SUPPORTED_DEVICE("MT23108");
X
Xstruct dev_data {
X  unsigned long bar;
X  volatile ssize_t size;
X  struct semaphore sem;
X  char buf[BUFFER_SIZE];
X  int bufused;
X
X  int irq;
X  char* addr;
X  unsigned int data;
X  volatile int last_data;
X  struct semaphore irq_sem;
X};
X
Xstatic struct dev_data devices[MAXMINOR];
X
X/* Some buggy 2.4 kernels seem to have trash in pciconf headers */
X/* #define OLD_PCI_METHOD */
X
X#ifdef OLD_PCI_METHOD
X/*Prevent the user from extending the area with
X * mremap */
Xstatic const unsigned int addresses[] = {
X  IRQ_BASE_ADDRESS_0,
X  IRQ_BASE_ADDRESS_1,
X  IRQ_BASE_ADDRESS_2,
X  IRQ_BASE_ADDRESS_3,
X  IRQ_BASE_ADDRESS_4,
X  IRQ_BASE_ADDRESS_5,
X  0
X};
X
Xstatic unsigned long mst_pci_resource_start(struct pci_dev *dev, int bar)
X{
X unsigned int curr=0;
X pci_read_config_dword(dev, addresses[bar],&curr);
X if (curr & IRQ_BASE_ADDRESS_SPACE_IO) {
X   curr &= IRQ_BASE_ADDRESS_IO_MASK;
X } else {
X   /* 32-bit specific. For 64 bit, don't mask the MSB?*/
X   curr &= IRQ_BASE_ADDRESS_MEM_MASK;
X }
X return curr;
X}
X
Xstatic unsigned long mst_pci_resource_end(struct pci_dev *dev, int bar)
X{
X  unsigned int curr=0, mask=0, size;
X
X  pci_read_config_dword(dev, addresses[bar],&curr);
X  cli();
X  pci_write_config_dword(dev, addresses[bar],~0);
X  pci_read_config_dword(dev, addresses[bar],&mask);
X  pci_write_config_dword(dev, addresses[bar],curr);
X  sti();
X
X  if (!mask) return 0;
X
X  /*
X   * apply the I/O or memory mask to current position.
X   * note that I/O is limited to 0xffff, and 64-bit is not
X   * supported by this simple implementation
X   */
X  if (curr & IRQ_BASE_ADDRESS_SPACE_IO) {
X    curr &= IRQ_BASE_ADDRESS_IO_MASK;
X  } else {
X    curr &= IRQ_BASE_ADDRESS_MEM_MASK;
X  }
X
X  /* extract the type, and the programmable bits */
X  if (mask & IRQ_BASE_ADDRESS_SPACE_IO) {
X    mask &= IRQ_BASE_ADDRESS_IO_MASK;
X    size = (~mask + 1) & 0xffff; /* Bleah */
X  } else {
X    mask &= IRQ_BASE_ADDRESS_MEM_MASK;
X    size = ~mask + 1;
X  }
X
X  return size?curr+size-1:curr;
X}
X
Xstatic inline unsigned long mst_pci_resource_len(struct pci_dev *dev, int bar)
X{
X
X  unsigned long start;
X  unsigned long end;
X
X  start=mst_pci_resource_start(dev,bar);
X  end=mst_pci_resource_end(dev,bar);
X
X  return (start==0 && start==end) ? 0: end - start + 1;
X}
X#else /* OLD_IRQ_METHOD */
X
X#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
X#if 0
Xstatic struct page *
Xnopage(struct vm_area_struct *vma,
X                           unsigned long address, int write_access)
X{ return NOPAGE_SIGBUS; /* send a SIGBUS */}
X#endif
X#else
X#if 0
X/* Before 2.4 we had to do ugly tricks to get bar size */
Xstatic unsigned long
Xnopage(struct vm_area_struct *vma,
X                           unsigned long address, int write_access)
X{ return 0; /* send a SIGBUS */}
X#endif
Xstatic const unsigned int addresses[] = {
X  IRQ_BASE_ADDRESS_0,
X  IRQ_BASE_ADDRESS_1,
X  IRQ_BASE_ADDRESS_2,
X  IRQ_BASE_ADDRESS_3,
X  IRQ_BASE_ADDRESS_4,
X  IRQ_BASE_ADDRESS_5,
X  0
X};
X
X/* Emulate Linux 2.4 on 2.2 */
X/* The code originally comes from "Linux Device Drivers" by Alessandro
XRubini,   published by   O'Reilly & Associates.  Ch. 15*/
Xstatic unsigned long pci_resource_start(struct pci_dev *dev, int bar)
X{
X unsigned int curr=0;
X pci_read_config_dword(dev, addresses[bar],&curr);
X if (curr & IRQ_BASE_ADDRESS_SPACE_IO) {
X   curr &= IRQ_BASE_ADDRESS_IO_MASK;
X } else {
X   /* 32-bit specific. For 64 bit, don't mask the MSB?*/
X   curr &= IRQ_BASE_ADDRESS_MEM_MASK;
X }
X return curr;
X}
X
X#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,17)
Xstatic unsigned long pci_resource_end(struct pci_dev *dev, int bar)
X{
X  unsigned int curr=0, mask=0, size;
X
X  pci_read_config_dword(dev, addresses[bar],&curr);
X  cli();
X  pci_write_config_dword(dev, addresses[bar],~0);
X  pci_read_config_dword(dev, addresses[bar],&mask);
X  pci_write_config_dword(dev, addresses[bar],curr);
X  sti();
X
X  if (!mask) return 0;
X
X  /*
X   * apply the I/O or memory mask to current position.
X   * note that I/O is limited to 0xffff, and 64-bit is not
X   * supported by this simple implementation
X   */
X  if (curr & IRQ_BASE_ADDRESS_SPACE_IO) {
X    curr &= IRQ_BASE_ADDRESS_IO_MASK;
X  } else {
X    curr &= IRQ_BASE_ADDRESS_MEM_MASK;
X  }
X
X  /* extract the type, and the programmable bits */
X  if (mask & IRQ_BASE_ADDRESS_SPACE_IO) {
X    mask &= IRQ_BASE_ADDRESS_IO_MASK;
X    size = (~mask + 1) & 0xffff; /* Bleah */
X  } else {
X    mask &= IRQ_BASE_ADDRESS_MEM_MASK;
X    size = ~mask + 1;
X  }
X
X  return curr+size;
X}
X
Xstatic inline unsigned long pci_resource_len(struct pci_dev *dev, int bar)
X{
X
X  unsigned long start;
X  unsigned long end;
X
X  start=pci_resource_start(dev,bar);
X  end=pci_resource_end(dev,bar);
X
X  return (start==0 && start==end) ? 0: end - start + 1;
X}
X
X#endif /*2.2.17*/
X
X#endif
X
X#endif /* OLD_PCI_METHOD */
X
Xstatic void mst_irq_handler(int irq, void *dev_id, struct pt_regs *regs)
X{
X  struct dev_data* dev=(struct dev_data*)dev_id;
X  if (!dev->addr) return;
X  dev->last_data=readl(dev->addr+GPIO_INT_DATA);
X  if (! (dev->last_data & dev->data) ) return;
X  up(&dev->irq_sem);
X  writel(dev->data,dev->addr+GPIO_INT_CLEAR);
X}
X
Xstatic int ioctl (struct inode *inode, struct file *file, unsigned int opcode, unsigned long udata_l)
X{
X  void* udata=(void*)udata_l;
X  int minor=MINOR(inode->i_rdev);
X  struct dev_data* dev=&devices[minor];
X  int ret=0;
X
X  /* By convention, any user gets read access
X   * and is allowed to use the device.
X   * Commands with no direction are administration
X   * commands, and you need write permission
X   * for this */
X
X  if ( _IOC_DIR(opcode) == _IOC_NONE ) {
X    if (! ( file->f_mode & FMODE_WRITE) ) return -EPERM;
X  } else {
X    if (! ( file->f_mode & FMODE_READ) ) return -EPERM;
X  }
X
X  if (down_interruptible(&devices[minor].sem)) {
X    return -ERESTARTSYS;
X  }
X
X
X  switch (opcode) {
X
X    case INIT:
X      {
X        struct mst_irq_init_st initd;
X        struct pci_dev* pci_dev;
X        unsigned int off;
X        unsigned long vsize;
X        off=GPIO_OFF;
X        vsize=GPIO_SIZE;
X
X        /* Now have to init the new device */
X
X        /* printk("<1> --------------------- ioctl INIT: copy_from_user(%p, %p/%lx/, %d)\n", */
X        /*        &initd, udata, udata_l, (int)sizeof(initd)); */
X        /* printk("<1> --------------------- copy_from_user:%d\n", */
X        /*        (int)copy_from_user(&initd, udata, (int)sizeof(initd))); */
X        if (copy_from_user(&initd, udata, sizeof(initd))) {
X          ret=-EFAULT;
X          goto fin;
X        }
X
X        printk("<1> --------------------- ioctl INIT: pci_find_slot(%d, %d)\n",
X               initd.bus, initd.devfn);
X        pci_dev=pci_find_slot (initd.bus, initd.devfn);
X        if (!pci_dev)  {
X          ret=-ENXIO;
X          goto fin;
X        }
X
X#ifdef OLD_IRQ_METHOD
X        dev->size=mst_pci_resource_len(pci_dev, initd.bar);
X        dev->bar=mst_pci_resource_start(pci_dev, initd.bar);
X#else
X        dev->size=pci_resource_len(pci_dev, initd.bar);
X        dev->bar=pci_resource_start(pci_dev, initd.bar);
X#endif
X        dev->bufused=0;
X        dev->data=initd.gpio_val;
X        dev->addr=0;
X        dev->irq=pci_dev->irq;
X        dev->last_data=0;
X        if ((dev->size <= off) || (dev->size < off+vsize)) {
X          ret=-EINVAL;
X          goto fin;
X        }
X
X
X        if ((ret= request_irq(dev->irq, mst_irq_handler, SA_SHIRQ, name, dev) ))
X        {
X          goto fin;
X        }
X
X        sema_init(&dev->irq_sem,0);
X
X        dev->addr=ioremap(dev->bar+off,vsize);
X
X        goto fin;
X      }
X
X    case STOP:
X      free_irq(dev->irq,dev);
X      iounmap(dev->addr);
X      devices[minor].size=0;
X      goto fin;
X
X    case BLOCK:
X      {
X        if (down_interruptible(&dev->irq_sem)) {
X          ret=-ERESTARTSYS;
X          goto fin;
X        }
X        if (udata)
X          ret=put_user(dev->last_data,(unsigned int*)udata)?-EFAULT:0;
X      }
X
X    case PARAMS:
X      {
X        struct mst_irq_params_st paramsd;
X        paramsd.bar=dev->bar;
X        paramsd.size=dev->size;
X
X        if (copy_to_user(udata, &paramsd, sizeof(paramsd))) {
X          ret=-EFAULT;
X        }
X        goto fin;
X      }
X    default:
X      ret= -ENOTTY;
X      goto fin;
X  }
X
X  fin:
X  up(&devices[minor].sem);
X  return ret;
X}
X
X/* from drivers/char/mem.c */
X#ifndef pgprot_noncached
X
X/*
X * This should probably be per-architecture in <asm/pgtable.h>
X */
Xstatic inline pgprot_t pgprot_noncached(pgprot_t _prot)
X{
X	unsigned long prot = pgprot_val(_prot);
X
X#if defined(__i386__) || defined(__x86_64__)
X	/* On PPro and successors, PCD alone doesn't always mean
X	    uncached because of interactions with the MTRRs. PCD | PWT
X	    means definitely uncached. */
X	if (boot_cpu_data.x86 > 3)
X		prot |= _PAGE_PCD | _PAGE_PWT;
X#elif defined(__powerpc__)
X	prot |= _PAGE_NO_CACHE | _PAGE_GUARDED;
X#elif defined(__mc68000__)
X#ifdef SUN3_PAGE_NOCACHE
X	if (MMU_IS_SUN3)
X		prot |= SUN3_PAGE_NOCACHE;
X	else
X#endif
X	if (MMU_IS_851 || MMU_IS_030)
X		prot |= _PAGE_NOCACHE030;
X	/* Use no-cache mode, serialized */
X	else if (MMU_IS_040 || MMU_IS_060)
X		prot = (prot & _CACHEMASK040) | _PAGE_NOCACHE_S;
X#endif
X
X	return __pgprot(prot);
X}
X#endif /* !pgprot_noncached */
X/*
X * Architectures vary in how they handle caching for addresses
X * outside of main memory.
X */
Xstatic inline int noncached_address(unsigned long addr)
X{
X#if defined(__i386__)
X	/*
X	 * On the PPro and successors, the MTRRs are used to set
X	 * memory types for physical addresses outside main memory,
X	 * so blindly setting PCD or PWT on those pages is wrong.
X	 * For Pentiums and earlier, the surround logic should disable
X	 * caching for the high addresses through the KEN pin, but
X	 * we maintain the tradition of paranoia in this code.
X	 */
X 	return !( test_bit(X86_FEATURE_MTRR, &boot_cpu_data.x86_capability) ||
X		  test_bit(X86_FEATURE_K6_MTRR, &boot_cpu_data.x86_capability) ||
X		  test_bit(X86_FEATURE_CYRIX_ARR, &boot_cpu_data.x86_capability) ||
X		  test_bit(X86_FEATURE_CENTAUR_MCR, &boot_cpu_data.x86_capability) )
X	  && addr >= __pa(high_memory);
X#else
X	return addr >= __pa(high_memory);
X#endif
X}
X
Xstatic int mmap(struct file *file, struct vm_area_struct *vma)
X{
X
X  int ret=0;
X  unsigned long off;
X  unsigned long vsize;
X  unsigned long offset;
X  struct dev_data* dev=(struct dev_data*) file->private_data;
X
X  if (!dev) return -ENOTTY; /*Shouldn't happend, as open assigns it
X                              but just in case */
X
X  if (down_interruptible(&dev->sem))
X    return -ERESTARTSYS;
X
X#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
X  off = vma->vm_pgoff << PAGE_SHIFT;
X#else
X  off = vma->vm_offset;
X#endif
X
X
X  vsize = vma->vm_end - vma->vm_start;
X
X  if ((dev->size <= off) || (dev->size < off+vsize)) {
X    ret=-EINVAL;
X    goto fin;
X  }
X
X  offset = dev->bar+off;
X  /*
X   *    * Accessing memory above the top the kernel knows about or
X   *    * through a file pointer that was marked O_SYNC will be
X   *    * done non-cached.
X   *    */
X  if (noncached_address(offset) || (file->f_flags & O_SYNC))
X    vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
X
X
X  /* Mark this area as I/O, that is non-cacheable.
X   * Don't do it by default for regular memory  */
X  if (offset >= __pa(high_memory) || (file->f_flags & O_SYNC)) {
X    vma->vm_flags |= VM_IO;
X  }
X
X	/* Don't try to swap out physical pages.. */
X#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
X  vma->vm_flags |= VM_RESERVED; /* Why do I insist on reserved? is locked ok? */
X#else
X  vma->vm_flags |= VM_LOCKED;
X#endif
X /* vma->vm_ops->nopage=nopage;*/
X
X#if LINUX_VERSION_CODE - KERNEL_VERSION(2,4,9)
X#define REMAP_PREFIX
X#else
X#define REMAP_PREFIX current->mm->mmap,
X#endif
X
X  ret=remap_page_range(REMAP_PREFIX vma->vm_start, offset,
X                       vsize, vma->vm_page_prot);
X  if (ret) goto fin;
X
Xfin:
X  up(&dev->sem);
X  return ret;
X}
X
X#define SUPPORT_MMAP 1
X#include "driver_common.c"
X
X
SHAR_EOF
  : || $echo 'restore of' 'mst_irq_mod.c' 'failed'
fi
# ============= mst_pci_mod.c ==============
if test -f 'mst_pci_mod.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'mst_pci_mod.c' '(file already exists)'
else
  $echo 'x -' extracting 'mst_pci_mod.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'mst_pci_mod.c' &&
X#include <linux/kernel.h>
X#include <linux/module.h>
X#include <asm/io.h>
X#include <asm/uaccess.h>
X#include <linux/pci.h>
X#include <linux/version.h>
X
X#include "mst_pci.h"
X
X//Compatibility for old userspace (we had a bug in PCI_PARAMS
X//documentation + the interface was not 32/64 bit compatible)
X#define PCI_PARAMS_OLD _IOR(PCI_MAGIC,2,struct mst_pci_init_st)
Xstruct mst_pci_params_old_st {
X	unsigned int bar;
X	unsigned int size;
X};
X#define PARAMS_OLD PCI_PARAMS_OLD
X
X#define  INIT   PCI_INIT
X#define  STOP   PCI_STOP
X#define  PARAMS PCI_PARAMS
X
Xstatic char* name="mst_pci";
X
X#if CONFIG_COMPAT && !HAVE_COMPAT_IOCTL
Xstatic unsigned int
Xioctl_cmds[] ={
X  PARAMS_OLD,
X  PARAMS
X};
X#endif
X
X/* Allow minor numbers 0-255 */
X#define MAXMINOR 256
X#define BUFFER_SIZE 256
X
XMODULE_AUTHOR("Michael S. Tsirkin - Mellanox Technologies LTD");
XMODULE_DESCRIPTION("Mellanox Software Tools driver for accessing Tavor PCI memory");
XMODULE_SUPPORTED_DEVICE("MT23108");
X
Xstruct dev_data {
X  unsigned long bar;
X  volatile ssize_t size;
X  struct semaphore sem;
X  char buf[BUFFER_SIZE];
X  int bufused;
X};
X
Xstatic struct dev_data devices[MAXMINOR];
X
X/* Some buggy 2.4 kernels seem to have trash in pciconf headers */
X/* #define OLD_PCI_METHOD */
X
X#ifdef OLD_PCI_METHOD
X/*Prevent the user from extending the area with
X * mremap */
Xstatic const unsigned int addresses[] = {
X  PCI_BASE_ADDRESS_0,
X  PCI_BASE_ADDRESS_1,
X  PCI_BASE_ADDRESS_2,
X  PCI_BASE_ADDRESS_3,
X  PCI_BASE_ADDRESS_4,
X  PCI_BASE_ADDRESS_5,
X  0
X};
X
Xstatic unsigned long mst_pci_resource_start(struct pci_dev *dev, int bar)
X{
X unsigned int curr=0;
X pci_read_config_dword(dev, addresses[bar],&curr);
X if (curr & PCI_BASE_ADDRESS_SPACE_IO) {
X   curr &= PCI_BASE_ADDRESS_IO_MASK;
X } else {
X   /* 32-bit specific. For 64 bit, don't mask the MSB?*/
X   curr &= PCI_BASE_ADDRESS_MEM_MASK;
X }
X return curr;
X}
X
Xstatic unsigned long mst_pci_resource_end(struct pci_dev *dev, int bar)
X{
X  unsigned int curr=0, mask=0, size;
X
X  pci_read_config_dword(dev, addresses[bar],&curr);
X  cli();
X  pci_write_config_dword(dev, addresses[bar],~0);
X  pci_read_config_dword(dev, addresses[bar],&mask);
X  pci_write_config_dword(dev, addresses[bar],curr);
X  sti();
X
X  if (!mask) return 0;
X
X  /*
X   * apply the I/O or memory mask to current position.
X   * note that I/O is limited to 0xffff, and 64-bit is not
X   * supported by this simple implementation
X   */
X  if (curr & PCI_BASE_ADDRESS_SPACE_IO) {
X    curr &= PCI_BASE_ADDRESS_IO_MASK;
X  } else {
X    curr &= PCI_BASE_ADDRESS_MEM_MASK;
X  }
X
X  /* extract the type, and the programmable bits */
X  if (mask & PCI_BASE_ADDRESS_SPACE_IO) {
X    mask &= PCI_BASE_ADDRESS_IO_MASK;
X    size = (~mask + 1) & 0xffff; /* Bleah */
X  } else {
X    mask &= PCI_BASE_ADDRESS_MEM_MASK;
X    size = ~mask + 1;
X  }
X
X  return size?curr+size-1:curr;
X}
X
Xstatic inline unsigned long mst_pci_resource_len(struct pci_dev *dev, int bar)
X{
X
X  unsigned long start;
X  unsigned long end;
X
X  start=mst_pci_resource_start(dev,bar);
X  end=mst_pci_resource_end(dev,bar);
X
X  return (start==0 && start==end) ? 0: end - start + 1;
X}
X#else /* OLD_PCI_METHOD */
X
X#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
X#if 0
Xstatic struct page *
Xnopage(struct vm_area_struct *vma,
X                           unsigned long address, int write_access)
X{ return NOPAGE_SIGBUS; /* send a SIGBUS */}
X#endif
X#else
X#if 0
X/* Before 2.4 we had to do ugly tricks to get bar size */
Xstatic unsigned long
Xnopage(struct vm_area_struct *vma,
X                           unsigned long address, int write_access)
X{ return 0; /* send a SIGBUS */}
X#endif
Xstatic const unsigned int addresses[] = {
X  PCI_BASE_ADDRESS_0,
X  PCI_BASE_ADDRESS_1,
X  PCI_BASE_ADDRESS_2,
X  PCI_BASE_ADDRESS_3,
X  PCI_BASE_ADDRESS_4,
X  PCI_BASE_ADDRESS_5,
X  0
X};
X
X/* Emulate Linux 2.4 on 2.2 */
X/* The code originally comes from "Linux Device Drivers" by Alessandro
XRubini,   published by   O'Reilly & Associates.  Ch. 15*/
Xstatic unsigned long pci_resource_start(struct pci_dev *dev, int bar)
X{
X unsigned int curr=0;
X pci_read_config_dword(dev, addresses[bar],&curr);
X if (curr & PCI_BASE_ADDRESS_SPACE_IO) {
X   curr &= PCI_BASE_ADDRESS_IO_MASK;
X } else {
X   /* 32-bit specific. For 64 bit, don't mask the MSB?*/
X   curr &= PCI_BASE_ADDRESS_MEM_MASK;
X }
X return curr;
X}
X
X#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,17)
Xstatic unsigned long pci_resource_end(struct pci_dev *dev, int bar)
X{
X  unsigned int curr=0, mask=0, size;
X
X  pci_read_config_dword(dev, addresses[bar],&curr);
X  cli();
X  pci_write_config_dword(dev, addresses[bar],~0);
X  pci_read_config_dword(dev, addresses[bar],&mask);
X  pci_write_config_dword(dev, addresses[bar],curr);
X  sti();
X
X  if (!mask) return 0;
X
X  /*
X   * apply the I/O or memory mask to current position.
X   * note that I/O is limited to 0xffff, and 64-bit is not
X   * supported by this simple implementation
X   */
X  if (curr & PCI_BASE_ADDRESS_SPACE_IO) {
X    curr &= PCI_BASE_ADDRESS_IO_MASK;
X  } else {
X    curr &= PCI_BASE_ADDRESS_MEM_MASK;
X  }
X
X  /* extract the type, and the programmable bits */
X  if (mask & PCI_BASE_ADDRESS_SPACE_IO) {
X    mask &= PCI_BASE_ADDRESS_IO_MASK;
X    size = (~mask + 1) & 0xffff; /* Bleah */
X  } else {
X    mask &= PCI_BASE_ADDRESS_MEM_MASK;
X    size = ~mask + 1;
X  }
X
X  return curr+size;
X}
X
Xstatic inline unsigned long pci_resource_len(struct pci_dev *dev, int bar)
X{
X
X  unsigned long start;
X  unsigned long end;
X
X  start=pci_resource_start(dev,bar);
X  end=pci_resource_end(dev,bar);
X
X  return (start==0 && start==end) ? 0: end - start + 1;
X}
X
X#endif /*2.2.17*/
X
X#endif
X
X#endif /* OLD_PCI_METHOD */
X
X
X
Xstatic int ioctl (struct inode *inode, struct file *file, unsigned int opcode, unsigned long udata_l)
X{
X  void* udata=(void*)udata_l;
X  int minor=MINOR(inode->i_rdev);
X  struct dev_data* dev=&devices[minor];
X  int ret=0;
X
X  /* By convention, any user gets read access
X   * and is allowed to use the device.
X   * Commands with no direction are administration
X   * commands, and you need write permission
X   * for this */
X
X  if ( _IOC_DIR(opcode) == _IOC_NONE ) {
X    if (! ( file->f_mode & FMODE_WRITE) ) return -EPERM;
X  } else {
X    if (! ( file->f_mode & FMODE_READ) ) return -EPERM;
X  }
X
X  if (down_interruptible(&devices[minor].sem)) {
X    return -ERESTARTSYS;
X  }
X
X
X  switch (opcode) {
X
X    case INIT:
X      {
X        struct mst_pci_init_st initd;
X        struct pci_dev* pci_dev;
X        /* Now have to init the new device */
X
X        /* printk("<1> --------------------- ioctl INIT: copy_from_user(%p, %p/%lx/, %d)\n", */
X        /*        &initd, udata, udata_l, (int)sizeof(initd)); */
X        /* printk("<1> --------------------- copy_from_user:%d\n", */
X        /*        (int)copy_from_user(&initd, udata, (int)sizeof(initd))); */
X        if (copy_from_user(&initd, udata, sizeof(initd))) {
X          ret=-EFAULT;
X          goto fin;
X        }
X
X        printk("<1> --------------------- ioctl INIT: pci_find_slot(%d, %d)\n",
X               initd.bus, initd.devfn);
X        pci_dev=pci_find_slot (initd.bus, initd.devfn);
X        if (!pci_dev)  {
X          ret=-ENXIO;
X          goto fin;
X        }
X
X#ifdef OLD_PCI_METHOD
X        dev->size=mst_pci_resource_len(pci_dev, initd.bar);
X        dev->bar=mst_pci_resource_start(pci_dev, initd.bar);
X#else
X        dev->size=pci_resource_len(pci_dev, initd.bar);
X        dev->bar=pci_resource_start(pci_dev, initd.bar);
X#endif
X        dev->bufused=0;
X
X
X        goto fin;
X      }
X
X    case STOP:
X      devices[minor].size=0;
X      goto fin;
X
X    case PARAMS:
X      {
X        struct mst_pci_params_st paramsd;
X        paramsd.bar=dev->bar;
X        paramsd.size=dev->size;
X
X        if (copy_to_user(udata, &paramsd, sizeof(paramsd))) {
X          ret=-EFAULT;
X        }
X        goto fin;
X      }
X    case PARAMS_OLD:
X      {
X        struct mst_pci_params_old_st paramsd;
X        paramsd.bar=dev->bar;
X        paramsd.size=dev->size;
X
X        if (copy_to_user(udata, &paramsd, sizeof(paramsd))) {
X          ret=-EFAULT;
X        }
X        goto fin;
X      }
X
X    default:
X      ret= -ENOTTY;
X      goto fin;
X  }
X
X  fin:
X  up(&devices[minor].sem);
X  return ret;
X}
X
X/* from drivers/char/mem.c */
X#ifndef pgprot_noncached
X
X/*
X * This should probably be per-architecture in <asm/pgtable.h>
X */
Xstatic inline pgprot_t pgprot_noncached(pgprot_t _prot)
X{
X	unsigned long prot = pgprot_val(_prot);
X
X#if defined(__i386__) || defined(__x86_64__)
X	/* On PPro and successors, PCD alone doesn't always mean
X	    uncached because of interactions with the MTRRs. PCD | PWT
X	    means definitely uncached. */
X	if (boot_cpu_data.x86 > 3)
X		prot |= _PAGE_PCD | _PAGE_PWT;
X#elif defined(__powerpc__)
X	prot |= _PAGE_NO_CACHE | _PAGE_GUARDED;
X#elif defined(__mc68000__)
X#ifdef SUN3_PAGE_NOCACHE
X	if (MMU_IS_SUN3)
X		prot |= SUN3_PAGE_NOCACHE;
X	else
X#endif
X	if (MMU_IS_851 || MMU_IS_030)
X		prot |= _PAGE_NOCACHE030;
X	/* Use no-cache mode, serialized */
X	else if (MMU_IS_040 || MMU_IS_060)
X		prot = (prot & _CACHEMASK040) | _PAGE_NOCACHE_S;
X#endif
X
X	return __pgprot(prot);
X}
X#endif /* !pgprot_noncached */
X/*
X * Architectures vary in how they handle caching for addresses
X * outside of main memory.
X */
Xstatic inline int noncached_address(unsigned long addr)
X{
X#if defined(__i386__)
X	/*
X	 * On the PPro and successors, the MTRRs are used to set
X	 * memory types for physical addresses outside main memory,
X	 * so blindly setting PCD or PWT on those pages is wrong.
X	 * For Pentiums and earlier, the surround logic should disable
X	 * caching for the high addresses through the KEN pin, but
X	 * we maintain the tradition of paranoia in this code.
X	 */
X 	return !( test_bit(X86_FEATURE_MTRR, (void *)&boot_cpu_data.x86_capability) ||
X		  test_bit(X86_FEATURE_K6_MTRR, (void *)&boot_cpu_data.x86_capability) ||
X		  test_bit(X86_FEATURE_CYRIX_ARR, (void *)&boot_cpu_data.x86_capability) ||
X		  test_bit(X86_FEATURE_CENTAUR_MCR, (void *)&boot_cpu_data.x86_capability) )
X	  && addr >= __pa(high_memory);
X#else
X	return addr >= __pa(high_memory);
X#endif
X}
X
Xstatic int mmap(struct file *file, struct vm_area_struct *vma)
X{
X
X  int ret=0;
X  unsigned long off;
X  unsigned long vsize;
X  unsigned long offset;
X  struct dev_data* dev=(struct dev_data*) file->private_data;
X
X  if (!dev) return -ENOTTY; /*Shouldn't happend, as open assigns it
X                              but just in case */
X
X  if (down_interruptible(&dev->sem))
X    return -ERESTARTSYS;
X
X#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
X  off = vma->vm_pgoff << PAGE_SHIFT;
X#else
X  off = vma->vm_offset;
X#endif
X
X
X  vsize = vma->vm_end - vma->vm_start;
X
X  if ((dev->size <= off) || (dev->size < off+vsize)) {
X    ret=-EINVAL;
X    goto fin;
X  }
X
X  offset = dev->bar+off;
X  /*
X   *    * Accessing memory above the top the kernel knows about or
X   *    * through a file pointer that was marked O_SYNC will be
X   *    * done non-cached.
X   *    */
X  if (noncached_address(offset) || (file->f_flags & O_SYNC))
X    vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
X
X
X  /* Mark this area as I/O, that is non-cacheable.
X   * Don't do it by default for regular memory  */
X  if (offset >= __pa(high_memory) || (file->f_flags & O_SYNC)) {
X    vma->vm_flags |= VM_IO;
X  }
X
X	/* Don't try to swap out physical pages.. */
X#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
X  vma->vm_flags |= VM_RESERVED; /* Why do I insist on reserved? is locked ok? */
X#else
X  vma->vm_flags |= VM_LOCKED;
X#endif
X /* vma->vm_ops->nopage=nopage;*/
X
X#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10))
X  ret=remap_pfn_range(vma, vma->vm_start, offset >> PAGE_SHIFT,
X                       vsize, vma->vm_page_prot);
X#else
X#if defined(RED_HAT_LINUX_KERNEL) && ( \
X    (LINUX_VERSION_CODE == KERNEL_VERSION(2,4,9)) ||\
X    (LINUX_VERSION_CODE == KERNEL_VERSION(2,4,20)) ||\
X    (LINUX_VERSION_CODE == KERNEL_VERSION(2,4,21)) ||\
X    0 )
X#define REMAP_PREFIX current->mm->mmap,
X#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
X#define REMAP_PREFIX current->mm->mmap,
X#else
X#define REMAP_PREFIX
X#endif
X
X  ret=remap_page_range(REMAP_PREFIX vma->vm_start, offset,
X                       vsize, vma->vm_page_prot);
X#endif
X  if (ret) goto fin;
X
Xfin:
X  up(&dev->sem);
X  return ret;
X}
X
X#define SUPPORT_MMAP 1
X
X#include "driver_common.c"
X
X
SHAR_EOF
  : || $echo 'restore of' 'mst_pci_mod.c' 'failed'
fi
# ============= mst_pciconf_mod.c ==============
if test -f 'mst_pciconf_mod.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'mst_pciconf_mod.c' '(file already exists)'
else
  $echo 'x -' extracting 'mst_pciconf_mod.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'mst_pciconf_mod.c' &&
X#include <linux/kernel.h>
X#include <linux/module.h>
X#include <asm/io.h>
X#include <asm/uaccess.h>
X#include <linux/pci.h>
X
X#include "mst_pciconf.h"
X#define  INIT   PCICONF_INIT
X#define  STOP   PCICONF_STOP
X#define  READ4  PCICONF_READ4
X#define  WRITE4 PCICONF_WRITE4
X#define  MODIFY PCICONF_MODIFY
X
X#define PCICONF_READ4_OLD  _IOR (PCICONF_MAGIC,1,struct mst_read4_old_st)
Xstruct mst_read4_old_st {
X        unsigned long long __attribute__((packed)) offset;
X        unsigned long long __attribute__((packed)) data; /*OUT*/
X};
X
X#define PCICONF_WRITE4_OLD _IOW (PCICONF_MAGIC,2,struct mst_write4_old_st)
Xstruct mst_write4_old_st {
X        unsigned long long __attribute__((packed)) offset;
X        unsigned long long __attribute__((packed)) data;
X};
X
X#define PCICONF_MODIFY_OLD _IOWR(PCICONF_MAGIC,3,struct mst_modify_old_st)
Xstruct mst_modify_old_st {
X        unsigned long long __attribute__((packed)) offset;
X        unsigned long long __attribute__((packed)) data;
X        unsigned long long __attribute__((packed)) mask;
X        unsigned long long __attribute__((packed)) old_data; /*OUT*/
X};
X#define  READ4_OLD  PCICONF_READ4_OLD
X#define  WRITE4_OLD PCICONF_WRITE4_OLD
X#define  MODIFY_OLD PCICONF_MODIFY_OLD
X
Xstatic char* name="mst_pciconf";
X
X#if CONFIG_COMPAT && !HAVE_COMPAT_IOCTL
Xstatic unsigned int
Xioctl_cmds[] ={
X    READ4,
X    WRITE4,
X    MODIFY,
X    READ4_OLD,
X    WRITE4_OLD,
X    MODIFY_OLD
X};
X#endif
X
X/* Allow minor numbers 0-255 */
X#define MAXMINOR 256
X#define BUFFER_SIZE 256
X
XMODULE_AUTHOR("Michael S. Tsirkin - Mellanox Technologies LTD");
XMODULE_DESCRIPTION("Mellanox Software Tools driver for accessing Tavor Configuration");
XMODULE_SUPPORTED_DEVICE("MT23109");
X
Xstruct dev_data {
X  struct pci_dev* pci_dev;
X  int addr_reg;
X  int data_reg;
X  volatile int valid;
X  struct semaphore sem;
X  char buf[BUFFER_SIZE];
X  int bufused;
X};
X
Xstatic struct dev_data devices[MAXMINOR];
X
X
Xstatic int ioctl (struct inode *inode, struct file *file, unsigned int opcode, unsigned long udata_l)
X{
X  void* udata=(void*)udata_l;
X  int minor=MINOR(inode->i_rdev);
X  struct dev_data* dev=&devices[minor];
X  int ret=0;
X  unsigned int d;
X
X  /* By convention, any user gets read access
X   * and is allowed to use the device.
X   * Commands with no direction are administration
X   * commands, and you need write permission
X   * for this */
X
X  if ( _IOC_DIR(opcode) == _IOC_NONE ) {
X    if (! ( file->f_mode & FMODE_WRITE) ) return -EPERM;
X  } else {
X    if (! ( file->f_mode & FMODE_READ) ) return -EPERM;
X  }
X
X  if (down_interruptible(&devices[minor].sem)) {
X    return -ERESTARTSYS;
X  }
X
X
X  switch (opcode) {
X
X    case INIT: 
X      {
X        struct mst_pciconf_init_st initd;
X        /* Now have to init the new device */
X
X        if (copy_from_user(&initd, udata, sizeof(initd))) {
X          ret=-EFAULT;
X          goto fin;
X        }
X        dev->pci_dev=pci_find_slot (initd.bus, initd.devfn);
X        if (!dev->pci_dev)  {
X          ret=-ENXIO;
X          goto fin;
X        }
X
X        dev->bufused=0;
X
X        dev->valid=1;
X
X		dev->addr_reg=initd.addr_reg;
X		dev->data_reg=initd.data_reg;
X
X        goto fin;
X      }
X
X    case STOP:
X      dev->valid=0;
X      goto fin;
X
X
X    case WRITE4:
X      {
X        struct mst_write4_st write4d;
X        if (copy_from_user(&write4d, udata, sizeof(write4d))) {
X          ret=-EFAULT;
X          goto fin;
X        }
X
X        if (!dev->valid) {
X          ret=-ENOTTY;
X          goto fin;
X        }
X        ret=pci_write_config_dword(dev->pci_dev, dev->addr_reg, write4d.offset);
X        if (ret) goto fin;
X
X        ret=pci_write_config_dword(dev->pci_dev, dev->data_reg, write4d.data);
X        goto fin;
X      }
X    case READ4:
X      {
X        struct mst_read4_st read4d;
X        struct mst_read4_st* r_udata=(struct mst_read4_st*)udata;
X        if (copy_from_user(&read4d, udata, sizeof(read4d))) {
X          ret=-EFAULT;
X          goto fin;
X        }
X
X        if (!dev->valid) {
X          ret=-ENOTTY;
X          goto fin;
X        }
X
X        ret=pci_write_config_dword(dev->pci_dev, dev->addr_reg, read4d.offset);
X        if (ret) goto fin;
X
X        ret=pci_read_config_dword(dev->pci_dev, dev->data_reg, &d);
X        if (ret) goto fin;
X
X        ret=put_user(d,&(r_udata->data))?-EFAULT:0;
X        goto fin;
X      }
X    case MODIFY:
X      {
X        struct mst_modify_st modifyd;
X        struct mst_modify_st* m_udata=(struct mst_modify_st*)udata;
X        if (copy_from_user(&modifyd, udata, sizeof(modifyd))) {
X          ret=-EFAULT;
X          goto fin;
X        }
X
X        if (!dev->valid) {
X          ret=-ENOTTY;
X          goto fin;
X        }
X
X        ret=pci_write_config_dword(dev->pci_dev, dev->addr_reg, modifyd.offset);
X        if (ret) goto fin;
X
X        ret=pci_read_config_dword(dev->pci_dev, dev->data_reg, &d);
X        if (ret) goto fin;
X
X        d= (d & ~modifyd.mask) | (modifyd.data & modifyd.mask);
X
X        ret=pci_write_config_dword(dev->pci_dev, dev->data_reg, d);
X        if (ret) goto fin;
X
X        ret=put_user(d,&(m_udata->old_data))?-EFAULT:0;
X        goto fin;
X      }
X    case WRITE4_OLD:
X      {
X        struct mst_write4_old_st write4d;
X        if (copy_from_user(&write4d, udata, sizeof(write4d))) {
X          ret=-EFAULT;
X          goto fin;
X        }
X
X        if (!dev->valid) {
X          ret=-ENOTTY;
X          goto fin;
X        }
X        ret=pci_write_config_dword(dev->pci_dev, dev->addr_reg, write4d.offset);
X        if (ret) goto fin;
X
X        ret=pci_write_config_dword(dev->pci_dev, dev->data_reg, write4d.data);
X        goto fin;
X      }
X    case READ4_OLD:
X      {
X        struct mst_read4_old_st read4d;
X        struct mst_read4_old_st* r_udata=(struct mst_read4_old_st*)udata;
X        if (copy_from_user(&read4d, udata, sizeof(read4d))) {
X          ret=-EFAULT;
X          goto fin;
X        }
X
X        if (!dev->valid) {
X          ret=-ENOTTY;
X          goto fin;
X        }
X
X        ret=pci_write_config_dword(dev->pci_dev, dev->addr_reg, read4d.offset);
X        if (ret) goto fin;
X
X        ret=pci_read_config_dword(dev->pci_dev, dev->data_reg, &d);
X        if (ret) goto fin;
X
X	read4d.data=d;
X
X        ret=copy_to_user(&(r_udata->data),&(read4d.data),sizeof(read4d.data))?
X		-EFAULT:0;
X        goto fin;
X      }
X    case MODIFY_OLD:
X      {
X        struct mst_modify_old_st modifyd;
X        struct mst_modify_old_st* m_udata=(struct mst_modify_old_st*)udata;
X        if (copy_from_user(&modifyd, udata, sizeof(modifyd))) {
X          ret=-EFAULT;
X          goto fin;
X        }
X
X        if (!dev->valid) {
X          ret=-ENOTTY;
X          goto fin;
X        }
X
X        ret=pci_write_config_dword(dev->pci_dev, dev->addr_reg, modifyd.offset);
X        if (ret) goto fin;
X
X        ret=pci_read_config_dword(dev->pci_dev, dev->data_reg, &d);
X        if (ret) goto fin;
X
X        d= (d & ~modifyd.mask) | (modifyd.data & modifyd.mask);
X
X        ret=pci_write_config_dword(dev->pci_dev, dev->data_reg, d);
X        if (ret) goto fin;
X
X        ret=copy_to_user(&(m_udata->data),&(modifyd.data),sizeof(modifyd.data))?
X		-EFAULT:0;
X        goto fin;
X      }
X    default:
X      ret= -ENOTTY;
X      goto fin;
X  }
X
X  fin:
X  up(&dev->sem);
X  return ret;
X}
X
X#include "driver_common.c"
X
X
SHAR_EOF
  : || $echo 'restore of' 'mst_pciconf_mod.c' 'failed'
fi
# ============= mst_ppc_mod.c ==============
if test -f 'mst_ppc_mod.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'mst_ppc_mod.c' '(file already exists)'
else
  $echo 'x -' extracting 'mst_ppc_mod.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'mst_ppc_mod.c' &&
X#include <linux/kernel.h>
X#include <linux/module.h>
X#include <linux/version.h>
X#include <linux/ioctl.h>
X#include <linux/mm.h>
X
X#include <asm/io.h>
X#include <asm/uaccess.h>
X#include <asm/mpc8xx.h>
X
X#include "mst_ppc.h"
X#define  INIT   PPC_INIT
X#define  STOP   PPC_STOP
X#define  PARAMS PPC_PARAMS
X
Xstatic char name[]="mst_ppc";
X
X/* #define MST_PPC_DEBUG */
X
X/* Allow minor numbers 0-255 */
X#define MAXMINOR 256
X#define BUFFER_SIZE 256
X
XMODULE_AUTHOR("Alex Kholodenko - Mellanox Technologies LTD");
XMODULE_DESCRIPTION("Mellanox Software Tools driver for accessing Anafa via PPC IF");
XMODULE_SUPPORTED_DEVICE("MT43132");
X
Xstruct dev_data {
X      unsigned int cs;
X	  unsigned int addr;
X      volatile ssize_t size;
X      struct semaphore sem;
X      char buf[BUFFER_SIZE];
X      int bufused;
X};
X
Xstatic struct dev_data devices[MAXMINOR];
X
Xstatic unsigned int get_immr(void);
Xstatic int _8xx_cs_map( unsigned int cs_num, unsigned int size);
Xstatic int _8xx_cs_unmap( unsigned int cs_num );
Xstatic unsigned int _8xx_find_free_segment(unsigned int size);
Xstatic unsigned int mst_virt_to_phys (unsigned long va);
Xstatic void mst_vm_close (struct vm_area_struct *vma);
X
Xstatic struct vm_operations_struct mst_vm_ops = {
X        close:&mst_vm_close,
X};
X
X/*
X * Translate a virtual address to physical address
X * Assume we always work with mapped user-space memory here.
X * For kernel we'd need passing &init_mm instead of current->mm
X */
Xstatic unsigned int
Xmst_virt_to_phys (va)
X        unsigned long va;
X{
X#if LINUX_VERSION_CODE - KERNEL_VERSION(2,4,9)
X
X        pgd_t *pgd;
X        pmd_t *pmd;
X        pte_t *pte;
X        unsigned int pa = 0;
X
X#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
X        spin_lock (&current->mm->page_table_lock);
X#else
X#ifdef __SMP__
X        lock_kernel ();
X#endif
X#endif
X
X        pgd = pgd_offset (current->mm, va);
X        pmd = pmd_offset (pgd, va);
X        if (!pmd_present (*pmd))
X                goto fin;
X        pte = pte_offset (pmd, va);
X
X        if (!pte_present (*pte))
X                goto fin;
X
X#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
X        pa = __pa ((unsigned int) page_address (pte_page (*pte)));
X#else
X        pa = __pa ((unsigned int) pte_page (*pte));
X#endif
X
X        pa |= ((PAGE_SIZE - 1) & (unsigned int) va);
X      fin:
X#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
X        spin_unlock (&current->mm->page_table_lock);
X#else
X#ifdef __SMP__
X        unlock_kernel ();
X#endif
X#endif
X
X        return pa;
X
X#else
X        return 0;
X#endif
X}
X
Xstatic int ioctl (struct inode *inode, struct file *file, unsigned int opcode, unsigned long udata_l)
X{
X  void* udata=(void*)udata_l;
X  int minor=MINOR(inode->i_rdev);
X  struct dev_data* dev=&devices[minor];
X  int ret=0;
X
X  /* By convention, any user gets read access
X   * and is allowed to use the device.
X   * Commands with no direction are administration
X   * commands, and you need write permission
X   * for this */
X
X  if ( _IOC_DIR(opcode) == _IOC_NONE ) {
X    if (! ( file->f_mode & FMODE_WRITE) ) return -EPERM;
X  } else {
X    if (! ( file->f_mode & FMODE_READ) ) return -EPERM;
X  }
X
X  if (down_interruptible(&devices[minor].sem)) {
X    return -ERESTARTSYS;
X  }
X
X
X  switch (opcode) {
X
X    case INIT:
X      {
X        struct mst_ppc_init_st initd;
X		unsigned int addr;
X#ifdef MST_PPC_DEBUG
X		printk( "%s: INIT IOCTL\n", __func__ );  
X#endif
X        if (copy_from_user(&initd, udata, sizeof(initd))) {
X          ret=-EFAULT;
X          goto fin;
X        }
X        if( dev->cs != (unsigned int)(-1) ){
X			if( dev->cs != initd.cs)
X                ret=-EINVAL;
X            goto fin;             /*  Device already initialized */
X		}
X		if( (addr=_8xx_cs_map( initd.cs, initd.size )) == (unsigned int)(-1) ) {
X			ret=-EAGAIN;
X			goto fin;
X		}
X		dev->cs = initd.cs;
X		dev->size = initd.size;
X		dev->addr = addr;
X		goto fin;
X      }
X
X    case STOP:
X#ifdef MST_PPC_DEBUG
X		printk( "%s: STOP IOCTL\n", __func__ );  
X#endif
X      if( dev->cs == (unsigned int)(-1) )
X	   	  goto fin;
X	   _8xx_cs_unmap( dev->cs );
X	   dev->cs = (unsigned int)(-1);
X      goto fin;
X
X    case PARAMS:
X      {
X        struct mst_ppc_params_st paramsd;
X#ifdef MST_PPC_DEBUG
X		printk( "%s: PARAMS IOCTL\n", __func__ );  
X#endif
X		paramsd.cs = dev->cs;
X		paramsd.size = dev->size;
X		paramsd.addr = dev->addr;
X        if (copy_to_user(udata, &paramsd, sizeof(paramsd))) {
X          ret=-EFAULT;
X        }
X        goto fin;
X      }
X    case PPC_VTOP:
X      {
X        struct mst_ppc_vtop vtop;
X        if (copy_from_user(&vtop, udata, sizeof(vtop))) {
X            ret = -EFAULT;
X            goto fin;
X        }
X
X        vtop.pa = mst_virt_to_phys ((unsigned long) vtop.va);
X
X        if (copy_to_user (udata, &vtop, sizeof (vtop))) {
X            ret = -EFAULT;
X            goto fin;
X        }
X        break;
X      }
X
X    default:
X      ret= -ENOTTY;
X      goto fin;
X  }
X
X  fin:
X  up(&devices[minor].sem);
X  return ret;
X}
X
X
X/*
X*
X* Code from drivers/char/mem.c (XOL)
X*
X*/
X#ifndef pgprot_noncached
X
X/*
X * This should probably be per-architecture in <asm/pgtable.h>
X */
Xstatic inline pgprot_t pgprot_noncached(pgprot_t _prot)
X{
X	unsigned long prot = pgprot_val(_prot);
X
X#if defined(__i386__) || defined(__x86_64__)
X	/* On PPro and successors, PCD alone doesn't always mean 
X	    uncached because of interactions with the MTRRs. PCD | PWT
X	    means definitely uncached. */ 
X	if (boot_cpu_data.x86 > 3)
X		prot |= _PAGE_PCD | _PAGE_PWT;
X#elif defined(__powerpc__)
X	prot |= _PAGE_NO_CACHE | _PAGE_GUARDED;
X#elif defined(__mc68000__)
X#ifdef SUN3_PAGE_NOCACHE
X	if (MMU_IS_SUN3)
X		prot |= SUN3_PAGE_NOCACHE;
X	else
X#endif
X	if (MMU_IS_851 || MMU_IS_030)
X		prot |= _PAGE_NOCACHE030;
X	/* Use no-cache mode, serialized */
X	else if (MMU_IS_040 || MMU_IS_060)
X		prot = (prot & _CACHEMASK040) | _PAGE_NOCACHE_S;
X#endif
X
X	return __pgprot(prot);
X}
X
X#endif /* !pgprot_noncached */
X
X/*
X * Architectures vary in how they handle caching for addresses 
X * outside of main memory.
X */
Xstatic inline int noncached_address(unsigned long addr)
X{
X#if defined(__i386__)
X	/* 
X	 * On the PPro and successors, the MTRRs are used to set
X	 * memory types for physical addresses outside main memory, 
X	 * so blindly setting PCD or PWT on those pages is wrong.
X	 * For Pentiums and earlier, the surround logic should disable 
X	 * caching for the high addresses through the KEN pin, but
X	 * we maintain the tradition of paranoia in this code.
X	 */
X 	return !( test_bit(X86_FEATURE_MTRR, &boot_cpu_data.x86_capability) ||
X		  test_bit(X86_FEATURE_K6_MTRR, &boot_cpu_data.x86_capability) ||
X		  test_bit(X86_FEATURE_CYRIX_ARR, &boot_cpu_data.x86_capability) ||
X		  test_bit(X86_FEATURE_CENTAUR_MCR, &boot_cpu_data.x86_capability) )
X	  && addr >= __pa(high_memory);
X#else
X	return addr >= __pa(high_memory);
X#endif
X}
X
X
Xstatic int
Xmmap_gfp (struct file *file, struct vm_area_struct *vma)
X{
X        char *kva;
X        char *pageva;
X        int error = 0;
X        unsigned int ksize = vma->vm_end - vma->vm_start;
X
X        /* make it non cacheable */
X        vma->vm_page_prot = pgprot_noncached (vma->vm_page_prot);
X
X        /* Don't try to swap out physical pages */
X        vma->vm_flags |= VM_RESERVED;
X
X        /* Don't dump to a core file  */
X        vma->vm_flags |= VM_IO;
X
X        /* Allocate memory */
X        /*  kva = kmalloc (ksize, GFP_KERNEL); */
X        kva = (void *) __get_free_pages (GFP_KERNEL, get_order (ksize));
X
X        if (!kva)
X                return -ENOMEM;
X
X        for (pageva = kva; pageva < (kva + ksize); pageva += PAGE_SIZE)
X                SetPageReserved (virt_to_page (pageva));
X
X        if (remap_page_range (vma->vm_start, __pa (kva),
X                              vma->vm_end - vma->vm_start, vma->vm_page_prot))
X                error = -EAGAIN;
X
X        if (error) {
X                for (pageva = kva; pageva < (kva + ksize); pageva += PAGE_SIZE)
X                        ClearPageReserved (virt_to_page (pageva));
X                free_pages ((unsigned long) kva, get_order (ksize));
X
X        } else {
X                vma->vm_pgoff = ((unsigned int) kva) >> PAGE_SHIFT;
X                vma->vm_ops = &mst_vm_ops;
X        }
X
X        return error;
X}
X
Xstatic int
Xmmap_cr (struct dev_data * dev, struct file * file, struct vm_area_struct * vma)
X{
X	unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;
X
X	unsigned long vsize;
X
X	vsize = vma->vm_end - vma->vm_start;
X	if ((dev->size <= offset) || (dev->size < offset+vsize)) {
X	  return -EINVAL;
X	}
X	offset += dev->addr;
X
X	/*
X	 * Accessing memory above the top the kernel knows about or
X	 * through a file pointer that was marked O_SYNC will be
X	 * done non-cached.
X	 */
X	if (noncached_address(offset) || (file->f_flags & O_SYNC))
X		vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
X
X	/* Don't try to swap out physical pages.. */
X	vma->vm_flags |= VM_RESERVED;
X
X	/*
X	 * Don't dump addresses that are not real memory to a core file.
X	 */
X	if (offset >= __pa(high_memory) || (file->f_flags & O_SYNC))
X		vma->vm_flags |= VM_IO;
X
X	if (remap_page_range(vma->vm_start, offset, vma->vm_end-vma->vm_start,
X			     vma->vm_page_prot))
X		return -EAGAIN;
X
X        return 0;
X
X}
X
Xstatic int
Xmmap (struct file *file, struct vm_area_struct *vma)
X{
X        int rc;
X
X	struct dev_data* dev=(struct dev_data*) file->private_data;
X	if (!dev) return -ENOTTY; /*Shouldn't happend, as open assigns it
X                                    but just in case */
X	if (down_interruptible(&dev->sem))
X	  return -ERESTARTSYS;
X
X        if (vma->vm_pgoff)
X                rc = mmap_gfp (file, vma);
X        else
X                rc = mmap_cr (dev, file, vma);
X
X        up(&dev->sem);
X        return rc;
X}
X
Xstatic void
Xmst_vm_close (vma)
X        struct vm_area_struct *vma;
X{
X        char *kva = (char *) (vma->vm_pgoff << PAGE_SHIFT);
X        unsigned int ksize = vma->vm_end - vma->vm_start;
X        char *pageva;
X
X        for (pageva = kva; pageva < (kva + ksize); pageva += PAGE_SIZE)
X                ClearPageReserved (virt_to_page (pageva));
X        free_pages ((unsigned long) kva, get_order (ksize));
X}
X
X
X/*
X* PPC 8xx MMU operations
X*
X*/
Xstatic unsigned int get_immr(void)
X{
X    unsigned int result;
X    asm ( "mfspr 3, 638");
X    asm ( "stw 3, %0" : "=m"(result) );
X    return result;
X}                                               
X
X#define NUM_OF_CS 8
X#define ADDR_MASK		0xFFFF8000
X
Xstruct mmu_regs_st
X{
X	struct 
X	{
X		unsigned int BR;	/*  Base Register */
X		unsigned int OR;	/*  Options Register */
X	} bank[NUM_OF_CS];	/*  Banks */
X} *mmu_regs;
X
X#define __BR_VALID 		0x00000001	/*  Bank CS Valid */
X#define __BR_PORT16		0x00000800	/*  Port is 16 bit port */
X
X#define __OR_BIH		0x00000100	/*  Burst Mode not supported */
X#define __OR_SCY		0x000000F0	/*  Cycle length is 16 wait states */
X#define __OR_SETA		0x00000008  /*  Peripheral generates Transport ACK */
X
X#define MIN_MAP_SIZE 0x00008000
X
Xstatic int _8xx_cs_map( unsigned int cs_num, unsigned int size)
X{
X    unsigned int segment;
X
X	mmu_regs = (struct mmu_regs_st*)(ioremap_nocache((get_immr() & 0xffff0000)+0x100, sizeof(struct mmu_regs_st)));
X	if( ! mmu_regs )
X	{
X		printk( "%s: MMU registers ioremap_nocache failed\n", __func__ );
X		return -1;
X	}
X
X    /*  Check that requested chip selected if free */
X    if( mmu_regs->bank[cs_num].BR & __BR_VALID )
X    {
X        printk("%s: Chip select (cs = %d) allready active.\n", __func__, cs_num);
X        iounmap(mmu_regs);
X        return(-1);
X    }
X    /*  It is possible to map only a minimum of 32K */
X    if(size < MIN_MAP_SIZE)
X    {
X        printk("%s: region size is too small ( 0x%08x < 0x%08x )\n", __func__, size, MIN_MAP_SIZE);
X        iounmap(mmu_regs);
X        return(-1);
X    }
X    
X	segment = _8xx_find_free_segment(size);
X    if(segment == (unsigned int)(-1))
X    {
X		iounmap(mmu_regs);
X        return(-1);
X    }
X    printk("%s: Allocating segment(0x%08x) for chipselect %x\n", __func__, segment, cs_num);
X    /* initialize chip of ppc to work */
X	mmu_regs->bank[cs_num].OR = ((~(size-1)) & ADDR_MASK) | __OR_BIH | __OR_SCY | __OR_SETA;
X	mmu_regs->bank[cs_num].BR = (segment & ADDR_MASK)  | __BR_PORT16 | __BR_VALID;
X#ifdef MST_PPC_DEBUG
X	printk("%s: Region CS=%d BR=%08x OR=%08x\n", __func__, cs_num, 
X										mmu_regs->bank[cs_num].BR, mmu_regs->bank[cs_num].OR );
X#endif
X	iounmap(mmu_regs);
X    return(segment);
X}     
X
Xstatic int _8xx_cs_unmap( unsigned int cs_num )
X{
X	mmu_regs = (struct mmu_regs_st*)(ioremap_nocache((get_immr() & 0xffff0000)+0x100, sizeof(struct mmu_regs_st)));
X	if( ! mmu_regs )
X	{
X		printk( "%s: MMU registers ioremap_nocache failed\n", __func__ );
X		return -1;
X	}
X
X	mmu_regs->bank[cs_num].BR &= (~(__BR_VALID));
X    printk("%s: Chip select (cs = %d) now not valid\n", __func__, cs_num);
X    iounmap(mmu_regs);
X	return 0;
X}     
X
Xstatic unsigned int _8xx_find_free_segment(unsigned int size)
X{
X	int i;
X	unsigned int addr, naddr, mask, umask;
X	struct 
X	{
X		unsigned int addr;
X		unsigned int mask;
X	} map[NUM_OF_CS+1];
X
X	/*  Fill CS Info */
X	for( i=0; i<NUM_OF_CS; i++ )
X	{
X		if( mmu_regs->bank[i].BR & __BR_VALID )
X		{
X			map[i].addr = mmu_regs->bank[i].BR & ADDR_MASK;
X			map[i].mask = mmu_regs->bank[i].OR & ADDR_MASK;
X#ifdef MST_PPC_DEBUG
X			printk( " CS%d BR=%08x OR=%08x\n", i, 
X										mmu_regs->bank[i].BR, mmu_regs->bank[i].OR );
X#endif
X		}
X		else
X		{	/*  Not Valid segment */
X			map[i].addr = (unsigned int)(-1);
X			map[i].mask = (unsigned int)(-1);
X		}
X	}
X    map[NUM_OF_CS].addr = (get_immr() & 0xffff0000);	/*  Put IMMR region  */
X	map[NUM_OF_CS].mask = 0xFFFF0000;
X#ifdef MST_PPC_DEBUG
X	printk( " IMMR A=%08x  M=%08x\n", map[NUM_OF_CS].addr, map[NUM_OF_CS].mask );  
X#endif
X
X	/*  Look for first suitable segment */
X	addr=0;
X	mask=~(size-1);
X	while( 1 )
X	{
X		for( i=0; i<NUM_OF_CS+1; i++ )
X        {
X            umask = mask & map[i].mask;
X
X			if( (addr & umask) == (map[i].addr & umask) )
X			{
X				naddr = addr + (~umask)+1;
X				if( naddr < addr )
X					return -1;
X				addr = naddr;
X				break;
X			}
X        }
X		if( i == NUM_OF_CS+1 )
X			return addr;
X	}
X}
X
X/*
X* Common MST Driver code
X*
X*/
X#define SUPPORT_MMAP 1
X#define MST_PPC_DRIVER
X#include "driver_common.c"
X
SHAR_EOF
  : || $echo 'restore of' 'mst_ppc_mod.c' 'failed'
fi
# ============= mstop.c ==============
if test -f 'mstop.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'mstop.c' '(file already exists)'
else
  $echo 'x -' extracting 'mstop.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'mstop.c' &&
X/*
X *
X *  mstop.c - CR Space access stop
X *
X */
X
X#include <stdio.h>
X#include <stdlib.h>
X#include <string.h>
X#include <sys/ioctl.h>
X#include <sys/types.h>
X#include <sys/stat.h>
X#include <fcntl.h>
X
X#include "mst_pci.h"
X#include "mst_pciconf.h"
X#include "mst_calbr.h"
X#ifdef MST_CPU_ppc_8xx
X  #include "mst_ppc.h"
X#endif
X
Xvoid usage(const char *n)
X{
X    
X    printf("\n\t%s <device>\n",n);
X    exit(1);
X}
X
Xint main(int ac, char *av[])
X{
X    char          *devname;
X    int           rc = 0, fd;
X
X    if (ac < 2)
X        usage(av[0]);
X
X    devname = av[1];
X    if (strstr(devname, "pciconf"))
X    {
X        /* PCICONF stop */
X        if ((fd = open(devname, O_RDWR | O_SYNC)) < 0)
X        {
X            perror("open");
X            return 1;
X        }
X        rc = ioctl(fd, PCICONF_STOP, NULL);
X    }
X    else if (strstr(devname, "pci"))
X    {
X        /* PCI stop */
X        if ((fd = open(devname, O_RDWR | O_SYNC)) < 0)
X        {
X            perror("open");
X            return 1;
X        }
X        rc = ioctl(fd, PCI_STOP, NULL);
X    }
X    else if (strstr(devname, "calbr") || strstr(devname, "calibre"))
X    {
X        /* Calibre stop */
X        if ((fd = open(devname, O_RDWR | O_SYNC)) < 0)
X        {
X            perror("open");
X            return 1;
X        }
X        rc = ioctl(fd, CALBR_STOP, NULL);
X    }
X#ifdef MST_CPU_ppc_8xx
X	else if (strstr(devname, "ppc"))
X	{
X		/* PPC Stop */
X        if ((fd = open(devname, O_RDWR | O_SYNC)) < 0)
X        {
X            perror("open");
X            return 1;
X		}
X        rc = ioctl(fd, PPC_STOP, NULL);
X	}
X#endif
X    else
X    {
X        printf("Invalid device name. Use that:\n");
X        usage(av[0]);
X    }
X    return rc;
X}
SHAR_EOF
  : || $echo 'restore of' 'mstop.c' 'failed'
fi
# ============= mtcr.c ==============
if test -f 'mtcr.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'mtcr.c' '(file already exists)'
else
  $echo 'x -' extracting 'mtcr.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'mtcr.c' &&
X/*
X *
X *  mtcr.c - Mellanox Software tools (mst) driver implementation
X *
X */
X
X#include <stdio.h>
X
X#include <arpa/inet.h>
X#include <asm/byteorder.h>
X#include <dirent.h>
X#include <endian.h>
X#include <errno.h>
X#include <fcntl.h>
X#include <netdb.h>
X#include <netinet/in.h>
X#include <signal.h>
X#include <stdarg.h>
X#include <stdlib.h>
X#include <string.h>
X#include <sys/ioctl.h>
X#include <sys/mman.h>
X#include <sys/socket.h>
X#include <sys/stat.h>
X#include <sys/types.h>
X#include <sys/un.h>
X#include <unistd.h>
X
X#ifndef MST_CPU_ppc_8xx
X#include "usbdescriptor.h"
X#endif
X#include "mtcr.h"
X#include "mtcr_types.h"
X#include "mtcr_mif.h"
X
X#include "mtcr_ib.h"
X#include "mtcr_i2c.h"
X#include "mst_pci.h"
X#include "mst_pciconf.h"
X#include "mst_calbr.h"
X#include "usbioctl.h"
X
X#ifdef MST_CPU_ppc_8xx
X #include "mst_ppc.h"
X#endif
X
X#ifdef ENABLE_MST_DEV_I2C
X #include <linux/i2c.h>
X #include <linux/i2c-dev.h>
X#endif 
X
X#define CLEAR(st) memset(&(st), 0, sizeof(st))
X#define MST_DIR   "/dev/mst"
X#define DEVASYS_V 0x0abf
X#define DEVASYS_P 0x3e9
X#define DIMAX_V   0x0abf
X#define DIMAX_P   0x3370
X#define VENID     "Vendor="
X#define PRDID     "ProdID="
X#define BUS       "Bus="
X#define DEV       "Dev#="
X#define STRLEN    512
X#define MAX_USB_RD_RETRY 10
X
X/*
X * We do this ugly trick here just
X * not to export names from tcp.c
X */
X#define INSIDE_MTCR static
X#include "tcp.c"
X
X
Xstatic void  sig_pipe(int signo);
Xstatic int get_device_flags(const char *name);
X
X
X/*
X * This function is never called.
X * It needs tio shutup stupid compiler warnings
X * "defined but not used" for static functions
X */
Xvoid mst_dummy()
X{
X    readn(-1, 0, 0);
X    readnl(-1, 0, 0);
X    writenl(-1, "");
X    open_serv_connection(0);
X}
X
Xstatic int remote_open(const char *name, mfile *mf, DType dtype)
X{
X    int  con, port, i;
X    char buf[40], *name_p, nameb[1024];
X    char *dev_p, *port_p;
X      
X    /*  Skip path */
X    if ((name_p = strrchr(name, '/')) == 0)
X        name_p = (char *)name;
X    else
X        name_p++;
X
X    /*  Copy remote name, change '@' to '/' */
X    for (i=0; i<1022 && name_p[i]; i++)
X        nameb[i] = (name_p[i] == '@') ? '/' : name_p[i];
X    nameb[i] = '\0';
X
X    /*  Device and port pointers */
X    dev_p = strchr(nameb, ',');
X    port_p = strchr(nameb, ':');
X    if (!dev_p || !port_p)
X    {
X        errno = EINVAL;
X        return -1;
X    }
X    *port_p = '\0';
X    port_p++;
X    dev_p++;
X
X    /*  Non-verbose */
X    logset(0);
X
X    /*  Open connection */
X    port = strtol(port_p, 0, 10);
X    con = open_cli_connection(nameb, port);
X    if (con < 0)
X        return -1;
X
X    /*  Open device */
X
X    sprintf(buf, "O 0x%08x ", dtype);
X    if (writen(con, buf, 13) < 0)
X        return -1;
X
X    if (writes(con, dev_p) < 0)
X        return -1;
X    if (reads(con, buf, 10) < 0)
X        return -1;
X    if (*buf != 'O')
X    {
X        errno = ENOENT;
X        return -1;
X    }
X
X    if(signal(SIGPIPE, sig_pipe) == SIG_ERR)
X    {
X        printf("Error installing signal handler\n");
X        exit(1);
X    }
X
X    mf->sock = con;
X    mf->dtype = dtype;
X    mf->flags=get_device_flags(name);
X    return 0;
X}
X
X#define PUTC(c) do {     \
X    *p++ = (c);        \
X     if (++cnt >= len) { \
X         closedir(dir);  \
X         return -1;      \
X     } } while(0)
X#define PUTS(s) do { for(i=0; (s)[i]; i++) PUTC((s)[i]); } while (0)
X
Xchar* find_tavor(const char* name)
X{
X  char* ret;
X  ret=strstr(name, "23108");
X  if (ret) return ret;
X  ret=strstr(name, "25208");
X  if (ret) return ret;
X  ret=strstr(name, "25218");
X  if (ret) return ret;
X  ret=strstr(name, "25228");
X  if (ret) return ret;
X  ret=strstr(name, "25238");
X  if (ret) return ret;
X  ret=strstr(name, "24204");
X  if (ret) return ret;
X  ret=strstr(name, "25204");
X  if (ret) return ret;
X  return ret;
X}
X
X
Xstatic int get_device_flags(const char *name)
X{
X  int mask=0;
X  if ( find_tavor(name) && strstr(name, "pci_ddr") ) mask|=MDEVS_TAVOR_DDR;
X  if ( find_tavor(name) && strstr(name, "pci_uar") ) mask|=MDEVS_TAVOR_UAR;
X  if ( find_tavor(name) && strstr(name, "pci_cr") ) mask|=MDEVS_TAVOR_CR;
X  if ( strstr(name, "mt23108_pciconf") ) mask|=MDEVS_TAVOR_CR;
X  if ( strstr(name, "mt25208_pciconf") ) mask|=MDEVS_TAVOR_CR;
X  if ( strstr(name, "mt25218_pciconf") ) mask|=MDEVS_TAVOR_CR;
X  if ( strstr(name, "mt25228_pciconf") ) mask|=MDEVS_TAVOR_CR;
X  if ( strstr(name, "mt25238_pciconf") ) mask|=MDEVS_TAVOR_CR;
X  if ( strstr(name, "mt24204_pciconf") ) mask|=MDEVS_TAVOR_CR;
X  if ( strstr(name, "mt25204_pciconf") ) mask|=MDEVS_TAVOR_CR;
X  if ( strstr(name, "mt21108") ) mask|=MDEVS_GAMLA;
X  if ( strstr(name, "vtop")  ) mask|=MDEVS_MEM;
X  if ( strstr(name, "calbr") ) mask|=MDEVS_I2CM;
X  if ( strstr(name, "calibre") ) mask|=MDEVS_I2CM;
X  if ( strstr(name, "mtusb") ) mask|=MDEVS_I2CM;
X  if ( strstr(name, "mif") ) mask|=MDEVS_IF;
X  if ( strstr(name, "dev-i2c") ) mask|=MDEVS_DEV_I2C;
X  if ( strstr(name, "ppc") ) mask|=MDEVS_PPC;
X  if ( strstr(name, "i2cm") ) mask|=MDEVS_I2CM;
X  if ( strstr(name, ":") ) mask|=MDEVS_REM;
X  return mask;
X}
X
Xint mdevices(char *buf, int len, int mask)
X{
X    DIR           *dir;
X    struct dirent *dirent;
X    int           i, rc=0, cnt=0;
X    char         *p = buf;
X
X    /* Regular devices */
X    if ((dir = opendir(MST_DIR)) != NULL)
X    {
X
X        while ((dirent = readdir(dir)) != NULL)
X        {
X            char *name = dirent->d_name;
X
X            /* Skip "." and ".." */
X            if (name[0] == '.')
X                continue;
X
X            /* According to mask */
X            if (get_device_flags(name)&mask)
X            {
X                PUTS(MST_DIR);
X                PUTC('/');
X                PUTS(name);
X                PUTC('\0');
X                rc++;
X            }
X        }
X        closedir(dir);
X    }
X
X    return rc;
X}
X
Xmfile *mopen(const char *name)
X{
X    return mopend(name, MST_TAVOR);
X}
X
Xmfile *mopend(const char *name, DType dtype)
X{
X    int  err;
X    char *real_name = (char *)name;
X    char *p;
X
X
X    /*  Local open */
X    /* allocate mfile struct */
X    mfile *mf = malloc(sizeof(mfile));
X    if (!mf)
X    {
X        errno = ENOMEM;
X        return 0;
X    }
X
X
X    /*  Remote connection? - Special open */
X    if (strchr(name, ':'))
X    {
X        mf->is_i2cm = 0;
X        if (remote_open(name, mf, dtype) < 0)
X            return 0;
X        else
X            return mf;
X
X    }
X
X    /*  IB device? special open */
X    if ((p = strstr(name, "IB-")) != 0)
X    {
X        if (mib_open(p+3, mf) < 0)
X            return 0;
X        else
X            return mf;
X    }
X
X
X    mf->sock = -1;
X
X    /* Type of device */
X    mf->dtype = dtype;
X    if (dtype == MST_TAVOR)
X        mf->i2c_slave = 0x48;
X    else
X        mf->i2c_slave = 0x5a;
X
X
X    /* Use the device as I2C master? */
X    mf->is_i2cm = strstr(name, "i2cm") ? 1 : 0;
X
X    /* Type of interface (relevant when is_i2cm==1 or target==MST_DIMM,
X       unused otherwise */
X    if (find_tavor(name))
X        mf->itype = MST_TAVOR;
X    else if (strstr(name, "mt47396"))
X        mf->itype = MST_TAVOR;         /*  Anafa-2 like Tavor!!! */
X    else if (strstr(name, "mt21108"))
X        mf->itype = MST_GAMLA;
X
X
X    /* Type of file */
X    if (strstr(name, "pciconf"))
X        mf->tp = MST_PCICONF;
X    else if (strstr(name, "pci"))
X        mf->tp = MST_PCI;
X    else if (strstr(name, "mtusb"))
X        mf->tp = MST_USB;
X    else if (strstr(name, "calbr") || strstr(name, "calibre"))
X        mf->tp = MST_CALBR;
X    else if (strstr(name, "mif") != 0)
X        mf->tp = MST_IF;
X#ifdef ENABLE_MST_DEV_I2C
X    else if (strstr(name, "dev-i2c") != 0)
X        mf->tp = MST_DEV_I2C;
X#endif
X    else if (strstr(name, "ppc") != 0)
X        mf->tp = MST_PPC;       /*  PPC CPU Interface ( PowerQuick ) */
X    else
X    {
X        free(mf);
X        errno = ENOENT;
X        return 0;
X    }
X
X    /* Open it */
X    if ((mf->fd = open(real_name, O_RDWR | O_SYNC)) < 0)
X    {
X        err = errno;
X        free(mf);
X        errno = err;
X        return 0;
X    }
X
X    /* Post open actions */
X    switch (mf->tp)
X    {
X    case MST_PCI:
X    {
X        /* Map memory for PCI interface */
X        struct mst_pci_params_st pars;
X        int rc;
X        CLEAR(pars);
X
X        rc=ioctl(mf->fd, PCI_PARAMS, &pars);
X        if (rc < 0)
X        {
X            err = errno;
X            close(mf->fd);
X            free(mf);
X            errno = err;
X            return 0;
X        }
X
X
X        mf->ptr = mmap(NULL, pars.size, PROT_READ | PROT_WRITE,
X                       MAP_SHARED, mf->fd, 0);
X
X        if (mf->ptr == MAP_FAILED)
X        {
X            err = errno;
X            close(mf->fd);
X            free(mf);
X            errno = err;
X            return 0;
X        }
X        break;
X    }
X    case MST_CALBR:
X    /* { */
X     /* Dummy transaction (first transaction may fail) */
X    /*     u_int32_t val; */
X    /*     mread4(mf, mf->dtype == MST_TAVOR ? 0xf0014 : 0x2800, &val); */
X          break;
X    /* } */
X    case MST_PCICONF:
X          break;
X
X#ifndef MST_CPU_ppc_8xx
X    case MST_USB:
X    {
X      int rc;
X      struct usb_device_descriptor desc;
X      rc=usb_get_device_descriptor(mf->fd, &desc);
X      if (rc) {
X        err = errno;
X        close(mf->fd);
X        free(mf);
X        errno = err;
X        return 0;
X      }
X      if (desc.idVendor == DEVASYS_V && desc.idProduct == DEVASYS_P)
X      {
X        mf->tp = MST_USB;
X      }
X      else if (desc.idVendor ==  DIMAX_V && desc.idProduct == DIMAX_P)
X      {
X        mf->tp = MST_USB_DIMAX;
X      }
X      else
X      {
X        close(mf->fd);
X        free(mf);
X        errno = ENOTTY;
X        return 0;
X      }
X
X    }
X#endif
X    case MST_IB:
X    case MST_IF:
X#ifdef ENABLE_MST_DEV_I2C
X    case MST_DEV_I2C:
X#endif
X        break;
X
X    case MST_PPC:
X    {
X#ifdef MST_CPU_ppc_8xx
X        /* Map memory for PCI interface */
X        struct mst_ppc_params_st pars;
X        CLEAR(pars);
X
X        if (ioctl(mf->fd, PPC_PARAMS, &pars) < 0)
X        {
X            err = errno;
X            close(mf->fd);
X            free(mf);
X            errno = err;
X            return 0;
X        }
X        mf->ptr = mmap(NULL, pars.size, PROT_READ | PROT_WRITE,
X                       MAP_SHARED, mf->fd, 0);
X        if (mf->ptr == MAP_FAILED)
X        {
X            err = errno;
X            close(mf->fd);
X            free(mf);
X            errno = err;
X            return 0;
X        }
X#endif
X        break;
X    }
X
X    default:
X      close(mf->fd);
X      free(mf);
X      errno = EINVAL;
X      return 0;
X    }
X
X    mf->flags=get_device_flags(name);
X    /* OK */
X    return mf;
X}
X
Xint mclose(mfile *mf)
X{
X    int rc;
X
X    if (mf->tp == MST_IB)
X        return mib_close(mf);
X
X    if (mf->sock != -1)
X    {
X        /*  Remote connection */
X        writes(mf->sock, "C");
X        close(mf->sock);
X        mf->sock = -1;
X        return 0;
X    }
X
X    rc = close(mf->fd);
X    free(mf);
X    return rc;
X}
X
Xvoid maccelerate(mfile *mf)
X{
X    if (mf->is_i2cm)
X        i2c_master_set(mf);
X}
X
Xvoid mrestore(mfile *mf)
X{
X    if (mf->is_i2cm)
X        i2c_master_restore(mf);
X}
X
Xstatic
Xint prepare_i2c_buf(void* maddr, DType dtype, u_int32_t offset)
X{
X        switch(dtype)
X        {
X        case MST_TAVOR:
X        {
X            u_int32_t offs = __cpu_to_be32(offset);
X            memcpy(maddr, &offs, 4);
X            return 4;
X        }
X        case MST_GAMLA:
X        {
X            u_int16_t offs = offset & 0xffff;
X            offs = __cpu_to_be16(offs);
X            memcpy(maddr, &offs, 2);
X            return 2;
X        }
X        case MST_DIMM:
X        {
X            u_int8_t offs1 = offset & 0xff;
X            memcpy(maddr, &offs1, 1);
X            return 1;
X        }
X        default:
X            return 0;
X        }
X}
X
Xstatic inline
Xint prepare_i2c_data(char* buf, DType dtype, u_int32_t offset, void* data,
X    int data_length)
X{
X  int len;
X  len=prepare_i2c_buf(buf,dtype,offset);
X  memcpy(buf+len,data, data_length);
X  return data_length+len;
X}
X
Xint mread4(mfile *mf, unsigned int offset, u_int32_t *value)
X{
X    int rc;
X    mif_param_t param;
X
X    if (mf->sock != -1)
X    {
X        /*  Remote connection */
X        char buf[20];
X
X        sprintf(buf, "R 0x%08x", offset);
X        writes(mf->sock, buf);
X        reads(mf->sock, buf, 20);
X        if (*buf == 'O')
X        {
X            *value = strtoul(buf+2, 0, 0);
X            return 4;
X        }
X        else
X        {
X            errno = EIO;
X            return -1;
X        }
X    }
X
X    switch(mf->tp)
X    {
X    case MST_IB:
X        return mib_read4(mf, offset, value);
X
X    case MST_IF:
X        param.cmd = MREAD4;
X        param.buf = value;
X        param.len = 4;
X        param.addr  = mf->i2c_slave;
X        param.offset = offset;
X        param.dtype = mf->dtype;
X        return(ioctl(mf->fd, param.cmd, &param));
X
X
X#ifdef ENABLE_MST_DEV_I2C
X    case MST_DEV_I2C:
X    {
X        struct i2c_rdwr_ioctl_data i2c_rdwr;
X        struct i2c_msg i2c_msg[2];
X        char    maddr[4];
X        char    data[4];
X        
X        i2c_msg[0].addr = mf->i2c_slave;
X        i2c_msg[0].flags = 0;
X        i2c_msg[0].buf = &maddr[0];
X        i2c_msg[1].addr = mf->i2c_slave;
X        i2c_msg[1].flags = I2C_M_RD;
X        i2c_msg[1].len = 4;
X        i2c_msg[1].buf = data;
X        i2c_rdwr.msgs = i2c_msg;
X        i2c_rdwr.nmsgs = 2;
X
X        i2c_msg[0].len = prepare_i2c_buf(maddr, mf->dtype, offset);
X
X        if (!i2c_msg[0].len)
X        {
X            i2c_msg[0].flags = I2C_M_RD;
X            i2c_msg[0].len = 4;
X            i2c_msg[0].buf = data;
X            i2c_rdwr.nmsgs = 1;
X        }
X
X        rc=ioctl( mf->fd, I2C_RDWR, &i2c_rdwr );
X        if( rc<0 ) return rc;
X        *value = __be32_to_cpu(*((u_int32_t *)&data[0]));
X        return 4;
X        return -1;
X    }/*MST_DEV_I2C*/
X#endif
X
X    case MST_PCI:
X    case MST_PPC:
X        if (!mf->ptr)
X        {
X            errno = EFAULT;
X            return -1;
X        }
X        if (mf->is_i2cm)
X            return i2c_master_read_cr(mf, value, offset, 4);
X
X        if (mf->dtype == MST_TAVOR)
X            *value = __be32_to_cpu(*((u_int32_t *)((char *)mf->ptr + offset)));
X        else
X            *value = __le32_to_cpu(*((u_int32_t *)((char *)mf->ptr + offset)));
X        break;
X    case MST_PCICONF:
X    {
X        struct mst_read4_st r4;
X
X        if (mf->is_i2cm)
X            return i2c_master_read_cr(mf, value, offset, 4);
X
X        CLEAR(r4);
X        r4.offset = offset;
X        if ((rc = ioctl(mf->fd, PCICONF_READ4, &r4)) < 0)
X            return rc;
X        *value = r4.data;
X        break;
X    }
X    case MST_USB:
X    case MST_USB_DIMAX:
X    {
X        int i;
X        int addr_transaction = 1;
X
X        for (i=0; i<MAX_USB_RD_RETRY; i++)
X        {
X            I2C_TRANS tr;
X
X            tr.byTransType = I2C_TRANS_NOADR;
X            tr.bySlvDevAddr = mf->i2c_slave << 1;
X            switch(mf->dtype)
X            {
X            case MST_TAVOR:
X            {
X                u_int32_t offs = __cpu_to_be32(offset);
X                memcpy(tr.Data, &offs, 4);
X                tr.wCount = 4;
X                break;
X            }
X            case MST_GAMLA:
X            {
X                u_int16_t offs = offset & 0xffff;
X                offs = __cpu_to_be16(offs);
X                memcpy(tr.Data, &offs, 2);
X                tr.wCount = 2;
X                break;
X            }
X            case MST_DIMM:
X            {
X                u_int8_t offs1 = offset & 0xff;
X                memcpy(tr.Data, &offs1, 1);
X                tr.wCount = 1;
X                break;
X            }
X            case MST_NOADDR:
X                addr_transaction = 0;
X                tr.wCount = 4;
X                break;
X
X            }
X
X            if( mf->tp == MST_USB_DIMAX )
X            {
X                /*  Dimax Device */
X                if( ! addr_transaction )
X                    tr.wCount = 0;
X                rc = dimax_ReadI2c( mf->fd, &tr, 4 );
X                if( rc )
X                    return -1;
X                *value = __be32_to_cpu(*((u_int32_t *)&tr.Data[0]));
X                return 4;
X            }
X            else
X            {
X                /*  Write address if neccesary */
X                rc = addr_transaction ? mst_WriteI2c(mf->fd, &tr) : 4;
X                if (rc > 0)
X                {
X                    if (rc != tr.wCount)
X                    {
X                        errno = EIO;
X                        return -1;
X                    }
X
X                    /*  Read result */
X                    tr.wCount = 4;
X                    if ((rc = mst_ReadI2c(mf->fd, &tr)) > 0)
X                    {
X                        if (rc != tr.wCount)
X                        {
X                            errno = EIO;
X                            return -1;
X                        }
X
X                        *value = __be32_to_cpu(*((u_int32_t *)&tr.Data[0]));
X                        return 4;
X                    }
X                }
X            }
X        }
X        errno = EPIPE;
X        return -1;
X    }
X    case MST_CALBR:
X    {
X        struct mst_trans_st tr;
X        CLEAR(tr);
X
X        tr.slv_addr = mf->i2c_slave;
X        tr.wr_size = prepare_i2c_buf(tr.wr_buff, mf->dtype, offset);
X        tr.rd_size = sizeof(u_int32_t);
X
X        if ((rc = ioctl(mf->fd, CALBR_TRANS, &tr)) < 0)
X            return -1;
X        if (tr.rd_count <  sizeof(u_int32_t))
X            return tr.rd_count;
X        *value = __be32_to_cpu(*((u_int32_t *)&tr.rd_buff[0]));
X        break;
X    }
X    }
X    return 4;
X}
X
Xint mwrite4(mfile *mf, unsigned int offset, u_int32_t value)
X{
X    int rc;
X    mif_param_t param;
X
X    if (mf->sock != -1)
X    {
X        /*  Remote connection */
X        char buf[40];
X
X        sprintf(buf, "W 0x%08x 0x%08x", offset, value);
X        /* printf("W 0x%08x 0x%08x", offset, value); */
X        writes(mf->sock, buf);
X        reads(mf->sock, buf, 40);
X        if (*buf == 'O')
X            return 4;
X        else
X        {
X            errno = EIO;
X            return -1;
X        }
X    }
X
X    switch(mf->tp)
X    {
X    case MST_IB:
X        return mib_write4(mf, offset, value);
X
X    case MST_IF:
X        param.cmd = MWRITE4;
X        param.buf = &value;
X        param.len = 4;
X        param.addr = mf->i2c_slave;
X        param.offset = offset;
X        param.dtype = mf->dtype;
X        return(ioctl(mf->fd, param.cmd, &param));
X
X#ifdef ENABLE_MST_DEV_I2C
X    case MST_DEV_I2C:
X    {
X        struct i2c_rdwr_ioctl_data i2c_rdwr;
X        struct i2c_msg i2c_msg[1];
X        char data[8];
X        
X        i2c_msg[0].addr = mf->i2c_slave;
X        i2c_msg[0].flags = 0;
X        i2c_msg[0].buf = data;
X        i2c_rdwr.msgs = i2c_msg;
X        i2c_rdwr.nmsgs = 1;
X
X        value = __cpu_to_be32(value);
X        i2c_msg[0].len = prepare_i2c_data(data, mf->dtype, offset,
X            &value, sizeof(value));
X
X        rc=ioctl( mf->fd, I2C_RDWR, &i2c_rdwr );
X        if( rc<0 ) return rc;
X        return 4;
X    } /*MST_DEV_I2C*/
X#endif
X
X    case MST_PCI:
X    case MST_PPC:
X        if (!mf->ptr)
X        {
X            errno = EFAULT;
X            return -1;
X        }
X        if (mf->is_i2cm)
X            return i2c_master_write_cr(mf, value, offset, 4);
X
X        if (mf->dtype == MST_TAVOR)
X            *((u_int32_t *)((char *)mf->ptr + offset)) = __cpu_to_be32(value);
X        else
X            *((u_int32_t *)((char *)mf->ptr + offset)) = __cpu_to_le32(value);
X        break;
X    case MST_PCICONF:
X    {
X        struct mst_write4_st r4;
X
X        if (mf->is_i2cm)
X            return i2c_master_write_cr(mf, value, offset, 4);
X
X        CLEAR(r4);
X        r4.offset = offset;
X        r4.data = value;
X        if ((rc = ioctl(mf->fd, PCICONF_WRITE4, &r4)) < 0)
X            return rc;
X        break;
X    }
X    case MST_USB:
X    case MST_USB_DIMAX:
X    {
X        int i;
X        for (i=0; i<MAX_USB_RD_RETRY; i++)
X        {
X            I2C_TRANS tr;
X
X            tr.byTransType = I2C_TRANS_NOADR;
X            tr.bySlvDevAddr = mf->i2c_slave << 1;
X            value = __cpu_to_be32(value);
X            tr.wCount = prepare_i2c_data(tr.Data, mf->dtype, offset,
X                &value, sizeof(value));
X
X            if( mf->tp == MST_USB_DIMAX )
X            {
X                tr.wCount -= sizeof(value);     /*  leave only address size */
X                rc = dimax_WriteI2c( mf->fd, &tr, 4 );
X                if( rc )
X                    return -1;
X                return 4;
X            }
X            else
X            {
X                /*  Write address and data */
X                if ((rc = mst_WriteI2c(mf->fd, &tr)) > 0)
X                {
X                    if (rc != tr.wCount)
X                    {
X                        errno = EIO;
X                        return -1;
X                    }
X                    return 4;
X                }
X            }
X        }
X        errno = EPIPE;
X        return -1;
X    }
X    case MST_CALBR:
X    {
X        struct mst_trans_st tr;
X        CLEAR(tr);
X
X        tr.slv_addr = mf->i2c_slave;
X        value = __cpu_to_be32(value);
X        tr.wr_size=prepare_i2c_data( tr.wr_buff, mf->dtype, offset, &value,
X            sizeof(value));
X
X        tr.rd_size = 0;
X
X        if ((rc = ioctl(mf->fd, CALBR_TRANS, &tr)) < 0)
X            return -1;
X        if (tr.wr_count <  sizeof(u_int32_t))
X            return tr.wr_count;
X        break;
X    }
X    }
X    return 4;
X}
X
Xint mread64(mfile *mf, unsigned int offset, void *data, int length)
X{
X    int                 rc;
X    mif_param_t         param;
X
X    if (length > MAX_TRANS_SIZE)
X    {
X        errno = EINVAL;
X        return -1;
X    }
X
X    switch(mf->tp)
X    {
X    case MST_IB:
X        return mib_read64(mf, offset, data, length);
X
X
X    case MST_IF:
X        param.cmd = MREAD64;
X        param.buf = data;
X        param.len    = length;
X        param.addr   = mf->i2c_slave;
X        param.offset = offset;
X        param.dtype = mf->dtype;
X        return(ioctl(mf->fd, param.cmd, &param));
X
X#ifdef ENABLE_MST_DEV_I2C
X    case MST_DEV_I2C:
X    {
X        struct i2c_rdwr_ioctl_data i2c_rdwr;
X        struct i2c_msg i2c_msg[2];
X        char    maddr[4];
X        
X        i2c_msg[0].addr = mf->i2c_slave;
X        i2c_msg[0].flags = 0;
X        i2c_msg[0].buf = &maddr[0];
X        i2c_msg[1].addr = mf->i2c_slave;
X        i2c_msg[1].flags = I2C_M_RD;
X        i2c_msg[1].len = length;
X        i2c_msg[1].buf = data;
X        i2c_rdwr.msgs = i2c_msg;
X        i2c_rdwr.nmsgs = 2;
X        i2c_msg[0].len=prepare_i2c_buf(maddr,mf->dtype,offset);
X
X        if (!i2c_msg[0].len)
X        {
X            i2c_msg[0].flags = I2C_M_RD;
X            i2c_msg[0].len = length;
X            i2c_msg[0].buf = data;
X            i2c_rdwr.nmsgs = 1;
X        }
X
X        rc=ioctl( mf->fd, I2C_RDWR, &i2c_rdwr );
X        if( rc<0 ) return rc;
X        return length;
X        }/*MST_DEV_I2C*/
X#endif
X
X    case MST_CALBR:
X    {
X        struct mst_trans_st tr;
X        CLEAR(tr);
X
X        tr.slv_addr = mf->i2c_slave;
X        tr.wr_size =prepare_i2c_buf(tr.wr_buff, mf->dtype, offset);
X        tr.rd_size = length;
X
X        if ((rc = ioctl(mf->fd, CALBR_TRANS, &tr)) < 0)
X            return -1;
X        memcpy(data, tr.rd_buff, tr.rd_count);
X        return tr.rd_count;
X    }
X    case MST_USB:
X    case MST_USB_DIMAX:
X    {
X        int       addr_transaction = 1;
X        I2C_TRANS tr;
X        CLEAR(tr);
X
X        tr.byTransType = I2C_TRANS_NOADR;
X        tr.bySlvDevAddr = mf->i2c_slave << 1;
X        tr.wCount = prepare_i2c_buf(tr.Data, mf->dtype, offset);
X        if (!tr.wCount)
X        {
X            addr_transaction = 0;
X            tr.wCount = 4;
X        }
X
X        if( mf->tp == MST_USB_DIMAX )
X        {
X            /*  Dimax Device */
X            if( addr_transaction == 0 )
X                tr.wCount = 0;
X            rc = dimax_ReadI2c( mf->fd, &tr, length );
X            if( rc )
X                return -1;
X            memcpy(data, &tr.Data[0], length);
X            return length;
X        }
X        else
X        {
X            /*  Write address */
X            rc = addr_transaction ? mst_WriteI2c(mf->fd, &tr) : 4;
X            if (rc < 0)
X                return -1;
X            /*  Read result */
X            tr.wCount = length;
X            if ((rc = mst_ReadI2c(mf->fd, &tr)) < 0)
X                return -1;
X            memcpy(data, &tr.Data[0], length);
X            return length;
X        }
X    }
X    case MST_PCI:
X    case MST_PCICONF:
X    {
X        int i;
X        unsigned char *cdata = (unsigned char *)data;
X
X        for (i=0; i<length; i++)
X        {
X            rc = i2c_master_read_cr(mf, cdata++, offset++, 1);
X            if (rc < 0)
X                return rc;
X            else if (rc < 1)
X                return i;
X        }
X        return length;
X    }
X    case MST_PPC:
X        errno = ECANCELED;
X        return -1;
X    }
X
X    errno = EPERM;
X    return -1;
X}
X
Xint mwrite64(mfile *mf, unsigned int offset, void *data, int length)
X{
X    int                 rc;
X    mif_param_t param;
X
X    if (length > MAX_TRANS_SIZE)
X    {
X        errno = EINVAL;
X        return -1;
X    }
X
X
X    switch(mf->tp)
X    {
X    case MST_IB:
X        return mib_write64(mf, offset, data, length);
X
X
X    case MST_IF:
X        param.cmd = MWRITE64;
X        param.buf = data;
X        param.offset= offset;
X        param.len   = length;
X        param.addr  = mf->i2c_slave;
X        param.dtype = mf->dtype;
X        return(ioctl(mf->fd, param.cmd, &param));
X
X#ifdef ENABLE_MST_DEV_I2C
X    case MST_DEV_I2C:
X    {
X        struct i2c_rdwr_ioctl_data i2c_rdwr;
X        struct i2c_msg i2c_msg[1];
X        char buf[64+4];
X        i2c_msg[0].addr = mf->i2c_slave;
X        i2c_msg[0].flags = 0;
X        i2c_msg[0].buf = buf;
X        i2c_rdwr.msgs = i2c_msg;
X        i2c_rdwr.nmsgs = 1;
X
X        i2c_msg[0].len = prepare_i2c_data(buf, mf->dtype, offset, data, length);
X        rc=ioctl( mf->fd, I2C_RDWR, &i2c_rdwr );
X        if( rc<0 ) return rc;
X        return length;
X    }/*MST_DEV_I2C*/
X#endif
X
X    case MST_CALBR:
X    {
X        struct mst_trans_st tr;
X        int                 offs_size=0;
X        CLEAR(tr);
X
X        tr.slv_addr = mf->i2c_slave;
X        tr.wr_size = prepare_i2c_data( tr.wr_buff, mf->dtype, offset, data,
X            length);
X
X        tr.rd_size = 0;
X
X	offs_size=tr.wr_size-length;
X
X        if ((rc = ioctl(mf->fd, CALBR_TRANS, &tr)) < 0)
X            return -1;
X        return (tr.wr_count < offs_size) ? 0 : tr.wr_count - offs_size;
X    }
X    case MST_USB:
X    case MST_USB_DIMAX:
X    {
X        I2C_TRANS tr;
X        CLEAR(tr);
X
X        tr.byTransType = I2C_TRANS_NOADR;
X        tr.bySlvDevAddr = mf->i2c_slave << 1;
X        tr.wCount = prepare_i2c_data(tr.Data, mf->dtype, offset, data, length);
X
X        if( mf->tp == MST_USB_DIMAX )
X        {
X            tr.wCount -= length;        /*  leave only address size */
X            rc = dimax_WriteI2c( mf->fd, &tr, length );
X            if( rc )
X                return -1;
X            return length;
X        }
X        
X        /*  Write address and data */
X        if ((rc = mst_WriteI2c(mf->fd, &tr)) < 0)
X            return -1;
X        return length;
X    }
X    case MST_PCI:
X    case MST_PCICONF:
X    {
X        int i;
X        unsigned char *cdata = (unsigned char *)data;
X
X        for (i=0; i<length; i++)
X        {
X            rc = i2c_master_write_cr(mf, *cdata++, offset++, 1);
X            if (rc < 0)
X                return rc;
X            else if (rc < 1)
X                return i;
X        }
X        return length;
X    }
X    case MST_PPC:
X        errno = ECANCELED;
X        return -1;
X
X    }
X
X    errno = EPERM;
X    return -1;
X}
X
X//Read up to length
X//Length is guaranteed to be up to what get_chunk_size returns
Xstatic int 
Xmread_chunk(mfile *mf, unsigned int offset, void *data, int length)
X{
X  int                 rc;
X  mif_param_t         param;
X
X  if (mf->sock != -1)
X  {
X    u_int32_t value;
X    /*  Remote connection */
X    char buf[20];
X
X    sprintf(buf, "R 0x%08x", offset);
X    writes(mf->sock, buf);
X    reads(mf->sock, buf, 20);
X    if (*buf != 'O')
X    {
X      errno = EIO;
X      return -1;
X    }
X    value = strtoul(buf+2, 0, 0);
X    value = __cpu_to_be32(value);
X    memcpy(data,&value,length);
X    return length;
X  }
X
X  if (mf->is_i2cm) return i2c_master_read(mf, data, offset, length);
X
X  switch(mf->tp)
X  {
X    case MST_IB:
X      return mib_read64(mf, offset, data, length);
X
X
X    case MST_IF:
X      param.cmd = MREAD64;
X      param.buf = data;
X      param.len    = length;
X      param.addr   = mf->i2c_slave;
X      param.offset = offset;
X      param.dtype = mf->dtype;
X      return(ioctl(mf->fd, param.cmd, &param));
X
X#ifdef ENABLE_MST_DEV_I2C
X    case MST_DEV_I2C:
X      return 0;
X#endif
X
X    case MST_CALBR:
X      {
X        struct mst_trans_st tr;
X        CLEAR(tr);
X
X        tr.slv_addr = mf->i2c_slave;
X        tr.wr_size = prepare_i2c_buf(tr.wr_buff, mf->dtype, offset);
X        tr.rd_size = length;
X
X        if ((rc = ioctl(mf->fd, CALBR_TRANS, &tr)) < 0)
X          return -1;
X        memcpy(data, tr.rd_buff, tr.rd_count);
X        return tr.rd_count;
X      }
X    case MST_USB:
X    case MST_USB_DIMAX:
X      {
X        int i;
X        int       addr_transaction = 1;
X        for (i=0; i<MAX_USB_RD_RETRY; i++)
X        {
X          I2C_TRANS tr;
X          CLEAR(tr);
X
X          tr.byTransType = I2C_TRANS_NOADR;
X          tr.bySlvDevAddr = mf->i2c_slave << 1;
X          tr.wCount = prepare_i2c_buf(tr.Data, mf->dtype, offset);
X          if (!tr.wCount)
X          {
X            addr_transaction = 0;
X            tr.wCount = 4;
X          }
X
X          if( mf->tp == MST_USB_DIMAX )
X          {
X            /*  Dimax Device */
X            if( addr_transaction == 0 )
X              tr.wCount = 0;
X            rc = dimax_ReadI2c( mf->fd, &tr, length );
X            if( rc )
X              return -1;
X            memcpy(data, &tr.Data[0], length);
X            return length;
X          }
X          else
X          {
X            /*  Write address */
X            rc = addr_transaction ? mst_WriteI2c(mf->fd, &tr) : 4;
X            if (rc < 0)
X              return -1;
X            /*  Read result */
X            tr.wCount = length;
X            if ((rc = mst_ReadI2c(mf->fd, &tr)) < 0)
X              return -1;
X            memcpy(data, &tr.Data[0], length);
X            return length;
X          }
X        }
X        errno = EPIPE;
X        return -1;
X      }
X    case MST_PCI:
X    case MST_PPC:
X      {
X        memcpy(data,(char *)mf->ptr + offset,length);
X        return length;
X      }
X    case MST_PCICONF:
X      {
X        struct mst_read4_st r4;
X        CLEAR(r4);
X        r4.offset = offset;
X        if ((rc = ioctl(mf->fd, PCICONF_READ4, &r4)) < 0)
X          return rc;
X        //PCI CONF returns data in CPU format, put it back to original.
X        r4.data=__cpu_to_be32(r4.data);
X        memcpy(data,&r4.data,length);
X        return rc;
X      }
X
X    default:
X      errno = EPERM;
X      return -1;
X  }
X}
X
Xstatic int get_chunk_size(mfile *mf)
X{
X	/*  Remote connection */
X    if (mf->sock != -1) return 4;
X    switch(mf->tp)
X    {
X    case MST_IB:
X    case MST_IF:
X    case MST_CALBR:
X    case MST_USB:
X        return 64;
X    case MST_USB_DIMAX:
X        return 256; //DIMAX FW uses 8-bit counters, thats why.
X#ifdef ENABLE_MST_DEV_I2C
X    case MST_DEV_I2C:
X        return 0;   /* Will be 8K after it will be implemented in mread_by_chunks */
X#endif
X    default:
X	//TODO: for i2c masters we can also
X	//implement speedups by doing bursts
X	return 4;
X    }
X}
X
Xint mread_by_chunks(mfile *mf_cr,
X		unsigned offset, void* dest, int size)
X{
X	int chunk_size;
X	int left_size;
X	int bytes;
X	void* dest_ptr=dest;
X
X	chunk_size=get_chunk_size(mf_cr);
X	
X	for (left_size=size;left_size>0;left_size-=chunk_size)
X	{
X		int toread;
X		toread=(left_size>=chunk_size)?chunk_size:left_size;
X		bytes=mread_chunk (mf_cr, offset, dest_ptr, toread);
X		if (bytes!=toread) {
X			return size-left_size;
X		}
X
X		offset += chunk_size;
X		dest_ptr+=chunk_size;
X	}
X	return size;
X
X}
X
X
X
X/*
X * Get signal and do nothing.
X *
X */
Xstatic void
Xsig_pipe(int signo)
X{
X    printf("Got SIGPIPE...\n");
X    return;
X}
X
Xunsigned char mset_i2c_slave(mfile *mf, unsigned char new_i2c_slave)
X{
X    unsigned char ret;
X    if (mf)
X    {
X       ret = mf->i2c_slave;
X       mf->i2c_slave = new_i2c_slave;
X    }
X    else
X       ret = 0xff;
X    return ret;
X}
X
Xvoid *
Xmget_free_pages(mfile *mf, unsigned int order)
X{
X    unsigned page_size = 4096;
X
X    if (mf->sock != -1)
X    {
X        /* unsupported on remote connection */
X        errno = -EOPNOTSUPP;
X        return 0;
X    }
X
X    switch(mf->tp)
X    {
X    case MST_PPC:
X        {
X            unsigned int *addr;
X            addr = mmap (0, page_size << order, PROT_READ | PROT_WRITE,
X                        MAP_SHARED, mf->fd, page_size);
X
X            if (addr == MAP_FAILED)
X                    return 0;
X            else
X                    return addr;
X        }
X
X    default:
X        errno = -EOPNOTSUPP;
X        return 0;
X    }
X}
X
Xint
Xmfree_pages(mfile *mf, void *addr, unsigned int order)
X{
X    unsigned page_size = 4096;
X
X    if (mf->sock != -1)
X    {
X        /* unsupported on remote connection */
X        errno = -EOPNOTSUPP;
X        return -1;
X    }
X
X    switch (mf->tp)
X    {
X    case MST_PPC:
X        {
X            return munmap (addr, page_size << order);
X        }
X
X    default:
X        errno = -EOPNOTSUPP;
X        return -1;
X    }
X}
X
Xunsigned long
Xmvtop (mfile *mf, void *va)
X{
X#ifdef MST_CPU_ppc_8xx
X    struct mst_ppc_vtop vtop;
X
X    vtop.va = va;
X#endif
X
X    switch(mf->tp)
X    {
X#ifdef MST_CPU_ppc_8xx
X    case MST_PPC:
X        if (ioctl (mf->fd, PPC_VTOP, &vtop) < 0) {
X                return 0;
X        } else {
X                return vtop.pa;
X        }
X#endif
X    default:
X        errno = -EOPNOTSUPP;
X        return 0;
X    }
X}
X
X
SHAR_EOF
  : || $echo 'restore of' 'mtcr.c' 'failed'
fi
# ============= mtcr_i2c.c ==============
if test -f 'mtcr_i2c.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'mtcr_i2c.c' '(file already exists)'
else
  $echo 'x -' extracting 'mtcr_i2c.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'mtcr_i2c.c' &&
X/*
X *
X *  mtcr_i2c.c - Mellanox Software tools (mst) driver: I2C master routines
X *
X */
X
X#include <stdio.h>
X
X#include <asm/byteorder.h>
X#include <errno.h>
X#include <unistd.h>
X#include <string.h>
X#include <stdlib.h>
X#include <sys/ioctl.h>
X#include <endian.h>
X
X#include "mtcr.h"
X#include "mtcr_i2c.h"
X#include "mst_pci.h"
X#include "mst_pciconf.h"
X
X#define REPEAT_WRITE_IF_NACK
X/* #define LOWR_LEVEL_DEBUG */
X/* #define LOWW_LEVEL_DEBUG */
X/* #define MID_LEVEL_DEBUG */
X/* #define HIGH_LEVEL_DEBUG */
X
Xenum CONSTANTS {
X    EPROM_PRIMARY_COUNT = 5000,  /*  Amount of "fast" check */
X    EPROM_SECONDARY_COUNT = 10,  /*  Amount of "slow" check */
X    EPROM_REQUEST_PAUSE = 100,   /*  Microseconds for pause */
X    MAX_REPETITION = 100,        /*  Maximal number of transaction repet. */
X    ST_IN_TRANSACTION = 7,       /*  Status: cycle in transaction completed OK */
X    ST_TIMEOUT = 6,              /*  Status: transaction timeout */
X    ST_IDLE = 0                  /*  Status: IDLE */
X};
X
X/*  SPM registers offset */
X#define SPM_OFFS ((mf->itype == MST_TAVOR) ? 0xf0180 : 0x3180)
X
X#define CLEAR(st) memset(&(st), 0, sizeof(st))
X
X/*  Like mread4, but only for PCI/PCICONF interfaces and doesn't check is_i2cm */
Xstatic int mread4_(mfile *mf, unsigned int offset, unsigned int *value)
X{
X    int                 rc = 4;
X    struct mst_read4_st r4;
X
X#ifdef LOWR_LEVEL_DEBUG
X    printf("mread4_: tp=%d,itype=%d - try read offs=0x%x\n",
X           mf->tp, mf->itype, offset);
X#endif
X
X    switch(mf->tp)
X    {
X    case MST_PCI:
X        if (!mf->ptr)
X        {
X            errno = EFAULT;
X            return -1;
X        }
X
X        if (mf->itype == MST_TAVOR)
X            *value = __be32_to_cpu(*((unsigned int *)((char *)mf->ptr + offset)));
X        else
X            *value = *((unsigned int *)((char *)mf->ptr + offset));
X        break;
X    case MST_PCICONF:
X        CLEAR(r4);
X        r4.offset = offset;
X        if ((rc = ioctl(mf->fd, PCICONF_READ4, &r4)) < 0)
X            return rc;
X        *value = r4.data;
X        rc = 4;
X        break;
X    default:
X        errno = EINVAL;
X        rc = -1;
X    }
X
X#ifdef LOWR_LEVEL_DEBUG
X    printf("    mread4_: rc=%d,offs=0x%x val=0x%08x\n", rc, offset, *value);
X#endif
X
X    return rc;
X}
X
X/*  Like mwrite4, but only for PCI/PCICONF interfaces and doesn't check is_i2cm */
Xstatic int mwrite4_(mfile *mf, unsigned int offset, unsigned int value)
X{
X    int                  rc = 4;
X    struct mst_write4_st r4;
X
X#ifdef LOWW_LEVEL_DEBUG
X    printf("mwrite4_: tp=%d,itype=%d - try write offs=0x%x val=0x%08x\n",
X           mf->tp, mf->itype, offset, value);
X#endif
X
X    switch(mf->tp)
X    {
X    case MST_PCI:
X        if (!mf->ptr)
X        {
X            errno = EFAULT;
X            return -1;
X        }
X
X        if (mf->itype == MST_TAVOR)
X            *((unsigned int *)((char *)mf->ptr + offset)) = __cpu_to_be32(value);
X        else
X            *((unsigned int *)((char *)mf->ptr + offset)) = value;
X        break;
X    case MST_PCICONF:
X        CLEAR(r4);
X        r4.offset = offset;
X        r4.data = value;
X        if ((rc = ioctl(mf->fd, PCICONF_WRITE4, &r4)) < 0)
X            return rc;
X        rc = 4;
X        break;
X    default:
X        errno = EINVAL;
X        rc = -1;
X    }
X
X#ifdef LOWW_LEVEL_DEBUG
X    printf("    mwrite4_: rc=%d\n", rc);
X#endif
X
X    return rc;
X}
X
X
X/*  Return -1 when I/O error or cmd doesn't become zero */
X/*  Return status field otherwise */
Xstatic int wait_trans(mfile *mf)
X{
X    u_int32_t     val;
X    u_int32_t     cnt = 0;
X
X    while(1)
X    {
X        if (mread4_(mf, SPM_OFFS, &val) != 4)
X            return -1;
X        if (!(val >> 29))
X            break;
X        if (cnt > EPROM_PRIMARY_COUNT)
X            usleep(EPROM_REQUEST_PAUSE);
X        if (cnt > EPROM_PRIMARY_COUNT+EPROM_SECONDARY_COUNT)
X        {
X            errno = EBUSY;
X            return -1;
X        }
X        cnt++;
X    }
X    return (val>>16) & 0x07;
X}
X
X/*  Return status field or -1 on fatal failure */
Xstatic int w_trans(mfile *mf, void *data_, int len)
X{
X    char         *data = (char *)data_;
X    int           vbt = -1;
X    u_int32_t     val = 0;
X
X#ifdef MID_LEVEL_DEBUG
X    printf("w_trans: data=0x%08x, len:%d\n", *(unsigned int *)data, len);
X#endif
X
X    switch (len)
X    {
X    case 1:
X        vbt = 0;
X        val = (*data << 24) & 0xff000000;
X        break;
X    case 2:
X        vbt = 1;
X        val = ((*data << 24) & 0xff000000) | ((data[1] << 16) & 0xff0000);
X        break;
X    case 3:
X        vbt = 2;
X        val = ((*data << 24) & 0xff000000) | ((data[1] << 16) & 0xff0000) |
X            ((data[2] << 8) & 0xff00);
X        break;
X    case 4:
X        vbt = 3;
X        val = ((*data << 24) & 0xff000000) | ((data[1] << 16) & 0xff0000) |
X            ((data[2] << 8) & 0xff00) | (data[3] & 0xff);
X        break;
X    default:
X        return -1;
X    }
X    if (mwrite4_(mf, SPM_OFFS + 4, val) != 4)
X        return -1;
X    if (mwrite4_(mf, SPM_OFFS, (2<<29) | (vbt << 22) | (mf->i2c_slave & 0x7f)) != 4)
X        return -1;
X
X    return wait_trans(mf);
X}
X
X
X/*  Return status field or -1 on fatal failure */
Xstatic int r_trans(mfile *mf, void *data_, int len)
X{
X    char         *data = (char *)data_;
X    int           vbt = -1, rc;
X    u_int32_t     val = 0;
X
X#ifdef MID_LEVEL_DEBUG
X    printf("r_trans: len:%d\n", len);
X#endif
X
X    switch (len)
X    {
X    case 1:
X        vbt = 0;
X        break;
X    case 2:
X        vbt = 1;
X        break;
X    case 3:
X        vbt = 2;
X        break;
X    case 4:
X        vbt = 3;
X        break;
X    default:
X        return -1;
X    }
X
X    if (mwrite4_(mf, SPM_OFFS, (1<<29) | (vbt << 22) | (mf->i2c_slave & 0x7f)) != 4)
X        return -1;
X    rc = wait_trans(mf);
X    if (rc != 7)
X        return rc;
X
X    if (mread4_(mf, SPM_OFFS + 4, &val) != 4)
X        return -1;
X
X    switch (len)
X    {
X    case 1:
X        *data = (val >> 24) & 0xff;
X        break;
X    case 2:
X        *data++ = (val >> 24) & 0xff;
X        *data   = (val >> 16) & 0xff;
X        break;
X    case 3:
X        *data++ = (val >> 24) & 0xff;
X        *data++ = (val >> 16) & 0xff;
X        *data   = (val >> 8)  & 0xff;
X        break;
X    case 4:
X        *data++ = (val >> 24) & 0xff;
X        *data++ = (val >> 16) & 0xff;
X        *data++ = (val >> 8)  & 0xff;
X        *data   = val         & 0xff;
X        break;
X    default:
X        return -1;
X    }
X    return 7;
X}
X
X/*  Return status field or -1 on fatal failure */
Xstatic int end_trans(mfile *mf)
X{
X    if (mwrite4_(mf, SPM_OFFS, (3<<29) | (mf->i2c_slave & 0x7f)) != 4)
X        return -1;
X    return wait_trans(mf);
X}
X
Xint i2c_master_write_cr(mfile *mf, unsigned int value, unsigned int offset,
X                        int len)
X{
X    unsigned int   ivalue = __cpu_to_be32(value);
X    unsigned short svalue = __cpu_to_be16((unsigned short)(value & 0xffff));
X    unsigned char  cvalue = value & 0xff;
X    int            rc=0, repeat=1;
X    unsigned short offs = __cpu_to_be16(offset & 0xffff);
X    unsigned char  off1 = offset & 0xff;
X
X#ifdef HIGH_LEVEL_DEBUG
X    printf("i2c_master_write_cr i2c:0x%x, offs:0x%x, val:0x%x, len:%d\n",
X           mf->i2c_slave, offset, value, len);
X#endif
X
X    offset = __cpu_to_be32(offset);
X
X    while (repeat)
X    {
X        /*  Write address (1byte for DIMM, 2bytes for Gamla and 4bytes for Tavor) */
X        switch(mf->dtype)
X        {
X        case MST_TAVOR:
X            rc = w_trans(mf, &offset, sizeof(offset));
X            break;
X        case MST_GAMLA:
X            rc = w_trans(mf, &offs, sizeof(offs));
X            break;
X        case MST_DIMM:
X            rc = w_trans(mf, &off1, sizeof(off1));
X            break;
X        case MST_NOADDR:
X            rc = ST_IN_TRANSACTION;  /*  FAKE! No address transaction */
X            break;
X        }
X
X        /*  Write data */
X        if (rc == ST_IN_TRANSACTION)
X            switch(len)
X            {
X            case 1:
X                rc = w_trans(mf, &cvalue, sizeof(cvalue));
X                break;
X            case 2:
X                rc = w_trans(mf, &svalue, sizeof(svalue));
X                break;
X            case 4:
X                rc = w_trans(mf, &ivalue, sizeof(ivalue));
X                break;
X            default:
X                errno = EINVAL;
X                return -1;
X            }
X
X        /*  End transaction (anyway, even it was an error)s */
X        if (end_trans(mf) < 0)
X            return -1;
X
X        /*  Now check Gw status and repeat transaction if timeout */
X        switch (rc)
X        {
X        case ST_IN_TRANSACTION:
X            repeat = 0;
X            break;
X#ifdef REPEAT_WRITE_IF_NACK
X        default:
X            if (++repeat > MAX_REPETITION)
X            {
X                errno = EIO;
X                return -1;
X            }
X#else
X        case ST_TIMEOUT:
X            if (++repeat > MAX_REPETITION)
X                return -1;
X            /* printf("i2c_master_write_cr: repeat:%d\n", repeat); */
X            break;
X        default:
X            errno = EIO;
X            return -1;
X#endif
X        }
X    }
X
X#ifdef HIGH_LEVEL_DEBUG
X    printf("    i2c_master_write_cr: rc=%d\n", len);
X#endif
X
X    return len;
X}
X
Xint i2c_master_read_cr(mfile *mf, void *value, unsigned int offset, int len)
X{
X    unsigned int   *ivalue = (unsigned int *)value;
X    unsigned short *svalue = (unsigned short *)value;
X    unsigned char  *cvalue = (unsigned char *)value;
X    int            rc=0, repeat=1;
X    unsigned short offs = __cpu_to_be16(offset & 0xffff);
X    unsigned char  off1 = offset & 0xff;
X
X#ifdef HIGH_LEVEL_DEBUG
X    printf("i2c_master_read_cr i2c:0x%x, offs:0x%x, len:%d\n",
X           mf->i2c_slave, offset, len);
X#endif
X
X    offset = __cpu_to_be32(offset);
X
X    while (repeat)
X    {
X        /*  Write address (1byte for DIMM, 2bytes for Gamla and 4bytes for Tavor) */
X        switch(mf->dtype)
X        {
X        case MST_TAVOR:
X            rc  = w_trans(mf, &offset, sizeof(offset));
X            break;
X        case MST_GAMLA:
X            rc = w_trans(mf, &offs, sizeof(offs));
X            break;
X        case MST_DIMM:
X            rc = w_trans(mf, &off1, sizeof(off1));
X            break;
X        case MST_NOADDR:
X            rc = ST_IN_TRANSACTION;  /*  FAKE! No address transaction */
X            break;
X        }
X
X        /*  Read data */
X        if (rc == ST_IN_TRANSACTION)
X            switch(len)
X            {
X            case 1:
X                rc = r_trans(mf, cvalue, 1);
X                break;
X            case 2:
X                rc = r_trans(mf, svalue, 2);
X                break;
X            case 4:
X                rc = r_trans(mf, ivalue, 4);
X                break;
X            default:
X                errno = EINVAL;
X                return -1;
X            }
X
X        /*  End transaction (anyway, even it was an error)s */
X        if (end_trans(mf) < 0)
X            return -1;
X
X        /*  Now check Gw status and repeat transaction if timeout */
X        switch (rc)
X        {
X        case ST_IN_TRANSACTION:
X            repeat = 0;
X            break;
X        case ST_TIMEOUT:
X            if (++repeat > MAX_REPETITION)
X                return -1;
X            /* printf("i2c_master_read_cr: repeat:%d\n", repeat); */
X            break;
X        default:
X            errno = EIO;
X            return -1;
X        }
X    }
X
X    /*  Convert output value */
X    switch(len)
X    {
X    case 2:
X        *svalue = __be16_to_cpu(*svalue);
X        break;
X    case 4:
X        *ivalue = __be32_to_cpu(*ivalue);
X        break;
X    }
X
X#ifdef HIGH_LEVEL_DEBUG
X    printf("    i2c_master_read_cr: val:0x%x rc=%d\n", *ivalue, len);
X#endif
X
X    return len;
X}
Xint i2c_master_read(mfile *mf, void *value, unsigned int offset, int len)
X{
X    unsigned int   *ivalue = (unsigned int *)value;
X    unsigned short *svalue = (unsigned short *)value;
X    unsigned char  *cvalue = (unsigned char *)value;
X    int            rc=0, repeat=1;
X    unsigned short offs = __cpu_to_be16(offset & 0xffff);
X    unsigned char  off1 = offset & 0xff;
X
X#ifdef HIGH_LEVEL_DEBUG
X    printf("i2c_master_read_cr i2c:0x%x, offs:0x%x, len:%d\n",
X           mf->i2c_slave, offset, len);
X#endif
X
X    offset = __cpu_to_be32(offset);
X
X    while (repeat)
X    {
X        /*  Write address (1byte for DIMM, 2bytes for Gamla and 4bytes for Tavor) */
X        switch(mf->dtype)
X        {
X        case MST_TAVOR:
X            rc  = w_trans(mf, &offset, sizeof(offset));
X            break;
X        case MST_GAMLA:
X            rc = w_trans(mf, &offs, sizeof(offs));
X            break;
X        case MST_DIMM:
X            rc = w_trans(mf, &off1, sizeof(off1));
X            break;
X        case MST_NOADDR:
X            rc = ST_IN_TRANSACTION;  /*  FAKE! No address transaction */
X            break;
X        }
X
X        /*  Read data */
X        if (rc == ST_IN_TRANSACTION)
X            switch(len)
X            {
X            case 1:
X                rc = r_trans(mf, cvalue, 1);
X                break;
X            case 2:
X                rc = r_trans(mf, svalue, 2);
X                break;
X            case 3:
X                rc = r_trans(mf, svalue, 3);
X                break;
X            case 4:
X                rc = r_trans(mf, ivalue, 4);
X                break;
X            default:
X                errno = EINVAL;
X                return -1;
X            }
X
X        /*  End transaction (anyway, even it was an error)s */
X        if (end_trans(mf) < 0)
X            return -1;
X
X        /*  Now check Gw status and repeat transaction if timeout */
X        switch (rc)
X        {
X        case ST_IN_TRANSACTION:
X            repeat = 0;
X            break;
X        case ST_TIMEOUT:
X            if (++repeat > MAX_REPETITION)
X                return -1;
X            /* printf("i2c_master_read_cr: repeat:%d\n", repeat); */
X            break;
X        default:
X            errno = EIO;
X            return -1;
X        }
X    }
X
X#ifdef HIGH_LEVEL_DEBUG
X    printf("    i2c_master_read_cr: val:0x%x rc=%d\n", *ivalue, len);
X#endif
X
X    return len;
X}
X
Xvoid i2c_master_set(mfile *mf)
X{
X    unsigned int val;
X    int          i;
X
X    if (mf->itype == MST_GAMLA)
X    {
X        /*  Screw up SPM clock. Works w/ Gamla only */
X        mread4_(mf, SPM_OFFS + 12, &val);
X        mf->i2c_RESERVED = val;
X        val &= 0xffff0000;
X        val |= 0x100;
X        mwrite4_(mf, SPM_OFFS + 12, val);
X    }
X
X    /*  Tavor I2C bug workaround */
X    if (mf->dtype == MST_TAVOR)
X    {
X        for (i=0; i<9; i++)
X            end_trans(mf);
X
X        i2c_master_read_cr(mf, &val, 0xf0014, 4);
X
X        for (i=0; i<9; i++)
X            end_trans(mf);
X    }
X    else
X        i2c_master_read_cr(mf, &val, 0x2800, 4);
X}
X
Xvoid i2c_master_restore(mfile *mf)
X{
X    if (mf->itype == MST_GAMLA)
X        /*  Restore SPM clock. */
X        mwrite4_(mf, SPM_OFFS + 12, mf->i2c_RESERVED);
X}
SHAR_EOF
  : || $echo 'restore of' 'mtcr_i2c.c' 'failed'
fi
# ============= mtcr_ib.c ==============
if test -f 'mtcr_ib.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'mtcr_ib.c' '(file already exists)'
else
  $echo 'x -' extracting 'mtcr_ib.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'mtcr_ib.c' &&
X/*
X *
X *  mtcr_ib.c - Mellanox Software tools (mst) IB related driver implementation
X *
X */
X#include <errno.h>
X
X#include "mtcr.h"
X#include "mtcr_ib.h"
X
X#ifndef USE_IB_MGT
X/*
X * Stabs for IB interface
X * ----------------------
X */
X
Xint mib_open(const char *name, mfile *mf)
X{
X    errno = ENOSYS;
X    return -1;
X}
X
Xint mib_close(mfile *mf)
X{
X    errno = ENOSYS;
X    return -1;
X}
X
Xint mib_read4(mfile *mf, unsigned int offset, u_int32_t *value)
X{
X    errno = ENOSYS;
X    return -1;
X}
X
Xint mib_write4(mfile *mf, unsigned int offset, u_int32_t value)
X{
X    errno = ENOSYS;
X    return -1;
X}
X
Xint mib_read64(mfile *mf, unsigned int offset, void *data, int length)
X{
X    errno = ENOSYS;
X    return -1;
X}
X
Xint mib_write64(mfile *mf, unsigned int offset, void *data, int length)
X{
X    errno = ENOSYS;
X    return -1;
X}
X
X#else
X
X/**********************************************************************/
X#include <stdio.h>
X#include <stdlib.h>
X#include <unistd.h>
X#include <asm/byteorder.h>
X
X#define CPU_TO_BE32(b, c) do {      \
X    u_int32_t *p = (u_int32_t*)(b); \
X    int        n = (c);             \
X    int i;                          \
X    for (i=0; i<n; i++,p++)         \
X        *p = __cpu_to_be32(*p);     \
X    } while(0)
X#define BE32_TO_CPU(b, c) do {      \
X    u_int32_t *p = (u_int32_t*)(b); \
X    int        n = (c);             \
X    int i;                          \
X    for (i=0; i<n; i++,p++)         \
X        *p = __be32_to_cpu(*p);     \
X    } while(0)
X
X#ifdef MIB_DEBUG
X#define RC_CHECK(s, r) do {                         \
X    IB_MGT_ret_t  rc = (r);                         \
X    if (rc != IB_MGT_OK) {                          \
X        printf(s " error: %s\n", mtl_strerror(rc)); \
X        errno = EIO;                                \
X        return -1;                                  \
X    }                                               \
X    } while(0)
X/***********
X#define RC_CHECK(s, r) do {                         \
X    IB_MGT_ret_t  rc;                               \
X    printf("before " s " .. \n");                   \
X    rc = r;                                         \
X    printf("after " s " rc=%d\n\n", rc);            \
X    if (rc != IB_MGT_OK) {                          \
X        printf(s " error: %s\n", mtl_strerror(rc)); \
X        errno = EIO;                                \
X        return -1;                                  \
X    }                                               \
X    } while(0)
X***********/
X#else
X#define RC_CHECK(s, r)
X#endif
X
X/*
X * Real IB interface
X * ----------------------
X */
Xstatic u_int64_t    wait_trid;
Xstatic volatile int wait_flag;
Xstatic u_int32_t    wait_value;
X
Xvoid mib_recv(IB_MGT_mad_hndl_t        mad_hndl,
X              void*                    private_ctx_p,
X              void*                    payload_p,
X              IB_MGT_mad_rcv_desc_t    *rcv_remote_info_p)
X{
X    MAD_payload  p;
X    memcpy(&p, payload_p, sizeof(MAD_payload));
X    BE32_TO_CPU(&p, sizeof(MAD_payload)/4);
X    if (p.r  &&  !p.Status  &&  p.TransactionID == wait_trid)
X    {
X        wait_value = p.Data[0];
X        wait_flag = 1;
X    }
X}
X
Xint mib_open(const char *name, mfile *mf)
X{
X    char *endp;
X
X    /* This is IB connection */
X    mf->tp = MST_IB;
X    mf->sock = -1;
X
X    /* Initialize miscellaneous MIB_Private fields */
X    mf->mib.trid = 1;
X
X    /* determine target lid */
X    mf->mib.udav.dlid = strtol(name, &endp, 10);
X    if (*endp)
X    {
X        errno = ENXIO;
X        return -1;
X    }
X
X    /* Prepare other udav fields */
X    mf->mib.udav.sl            = 0;
X    mf->mib.udav.src_path_bits = 0;
X    mf->mib.udav.static_rate   = 0;
X    mf->mib.udav.grh_flag      = 0;
X
X    RC_CHECK("IB_MGT_get_handle",
X             IB_MGT_get_handle(DEVICE_NAME, DEVICE_PORT, IB_MGT_GSI, &mf->mib.hndl));
X    RC_CHECK("IB_MGT_bind_gsi_class",
X             IB_MGT_bind_gsi_class(mf->mib.hndl, VENDOR_CLASS));
X    RC_CHECK("IB_MGT_reg_cb",
X             IB_MGT_reg_cb(mf->mib.hndl, mib_recv, 0, 0, 0, IB_MGT_RCV_CB_MASK));
X
X    return 0;
X}
X
Xint mib_close(mfile *mf)
X{
X    RC_CHECK("IB_MGT_reg_cb",
X             IB_MGT_reg_cb(mf->mib.hndl, 0, 0, 0, 0, IB_MGT_RCV_CB_MASK));
X    RC_CHECK("IB_MGT_unbind_gsi_class",
X             IB_MGT_unbind_gsi_class(mf->mib.hndl, VENDOR_CLASS));
X    RC_CHECK("IB_MGT_release_handle",
X             IB_MGT_release_handle(mf->mib.hndl));
X    return 0;
X}
X
Xint mib_read4(mfile *mf, unsigned int offset, u_int32_t *value)
X{
X    int          cnt_repl, cnt_resend;
X    MAD_payload  p;
X
X    /* Prepare read request */
X    memset(&p, 0, sizeof(MAD_payload));
X    p.BaseVersion = 1;
X    p.MgmtClass = VENDOR_CLASS;
X    p.ClassVersion = 1;
X    p.method = VENDOR_GET;
X    p.TransactionID = mf->mib.trid;
X    p.AttributeID = 0x50;
X    p.Mode = 0;
X    p.Count = 1;
X    p.BurstAddress = offset;
X
X    CPU_TO_BE32(&p, sizeof(MAD_payload)/4);
X    for (cnt_resend=0; cnt_resend < RESEND_TRIES; cnt_resend++)
X    {
X        /* Send read request */
X        wait_trid = mf->mib.trid++;
X        wait_flag = 0;
X        RC_CHECK("IB_MGT_send_mad",
X                 IB_MGT_send_mad(mf->mib.hndl, &p, &mf->mib.udav, 0, SEND_TIMEOUT));
X
X        /* Wait for response */
X        for (cnt_repl=0; cnt_repl <= FAST_CHECKS + SLOW_CHECKS; cnt_repl++)
X        {
X            if (wait_flag)
X            {
X                *value = wait_value;
X                return 4;
X            }
X            if (cnt_repl > FAST_CHECKS)
X                usleep(SLOW_PAUSE);
X        }
X    }
X    errno = ETIMEDOUT;
X    return -1;
X}
X
Xint mib_write4(mfile *mf, unsigned int offset, u_int32_t value)
X{
X    int          cnt_repl, cnt_resend;
X    MAD_payload  p;
X
X    /* Prepare read request */
X    memset(&p, 0, sizeof(MAD_payload));
X    p.BaseVersion = 1;
X    p.MgmtClass = VENDOR_CLASS;
X    p.ClassVersion = 1;
X    p.method = VENDOR_SET;
X    p.TransactionID = mf->mib.trid;
X    p.AttributeID = 0x50;
X    p.Mode = 0;
X    p.Count = 1;
X    p.BurstAddress = offset;
X    p.Data[0] = value;
X
X    CPU_TO_BE32(&p, sizeof(MAD_payload)/4);
X    for (cnt_resend=0; cnt_resend < RESEND_TRIES; cnt_resend++)
X    {
X        /* Send read request */
X        wait_trid = mf->mib.trid++;
X        wait_flag = 0;
X        RC_CHECK("IB_MGT_send_mad",
X                 IB_MGT_send_mad(mf->mib.hndl, &p, &mf->mib.udav, 0, SEND_TIMEOUT));
X
X        /* Wait for response */
X        for (cnt_repl=0; cnt_repl <= FAST_CHECKS + SLOW_CHECKS; cnt_repl++)
X        {
X            if (wait_flag)
X            {
X                if (value == wait_value)
X                    return 4;
X                else
X                {
X                    errno = EIO;
X                    return -1;
X                }
X            }
X            if (cnt_repl > FAST_CHECKS)
X                usleep(SLOW_PAUSE);
X        }
X    }
X    errno = ETIMEDOUT;
X    return -1;
X}
X
Xint mib_read64(mfile *mf, unsigned int offset, void *data, int length)
X{
X    errno = ENOSYS;
X    return -1;
X}
X
Xint mib_write64(mfile *mf, unsigned int offset, void *data, int length)
X{
X    errno = ENOSYS;
X    return -1;
X}
X
X#endif
SHAR_EOF
  : || $echo 'restore of' 'mtcr_ib.c' 'failed'
fi
# ============= mtest.c ==============
if test -f 'mtest.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'mtest.c' '(file already exists)'
else
  $echo 'x -' extracting 'mtest.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'mtest.c' &&
X/*
X *
X *  mread.c - CR Space read access
X *
X */
X
X#include <stdio.h>
X#include <stdlib.h>
X#include <string.h>
X
X#include "mtcr.h"
X
Xvoid usage(const char *n)
X{
X    printf("%s <device> <addr> <i2c_slave> <iter> <len>\n", n);
X    exit(1);
X}
X
Xint main(int ac, char *av[])
X{
X    char          *endp;
X    int           rc=0;
X    unsigned int  addr, val, iter, count;
X    unsigned int  len, real_len;
X    mfile         *mf = 0;
X    DType         dtype = MST_GAMLA;
X    int  i, rc1;
X    char buf[1024], *p=buf;
X    char ibuf[64];
X    char obuf[64];
X
X    if (ac != 6)
X        usage(av[0]);
X 
X    rc1 = mdevices(buf, 1024, MDEVS_ALL);
X    for (i=0; i<rc1; i++)
X    {
X        printf("Found: \"%s\"\n", p);
X        p += strlen(p)+1;
X    }
X
X    addr = strtoul(av[2], &endp, 0);
X    if (*endp)
X        usage(av[0]);
X
X    if (strstr(av[1], "mt21108_pci") && !strstr(av[1], "i2cm"))
X	    dtype = MST_GAMLA;
X
X    mf = mopend(av[1], dtype);
X    if (!mf)
X    {
X        perror("mopen");
X        return 1;
X    }
X
X    for(count = 0; count < 64; count++)
X	    ibuf[count] = count;
X
X    mf->i2c_slave = strtoul(av[3], &endp, 0);
X    if (*endp)
X	    usage(av[0]);
X
X    iter = strtoul(av[4], &endp, 0);
X    if (*endp)
X	 usage(av[0]);
X   
X    len = strtoul(av[5], &endp, 0);
X    if (*endp)
X	 usage(av[0]);
X
X
X   
X
X    for(count = 0; count < iter; count++)
X    {
X	    switch(len)
X	    {
X		    case 0:
X			    if(rand() & 1)
X				    real_len = 4;
X			    else 
X				    real_len = 64;
X			    break;
X		    case 4:
X			    real_len = 4;
X			    break;
X		    case 64: 
X			    real_len = 64;
X			    break;
X		    default:
X		            usage(av[0]);
X			    return(-1);
X	    }
X
X	    if(real_len == 4)
X		    rc = mread4(mf, addr, (u_int32_t*)obuf);
X	    else 
X		    rc = mread64(mf, addr, obuf, real_len);
X
X	    if (rc < 0)
X	    {
X		    mclose(mf);
X		    perror("mread");
X		    return 1;
X	    }
X
X	    if (rc < real_len)
X	    {
X		    mclose(mf);
X		    printf("Read only %d bytes\n", rc);
X		    return 1;
X	    }
X
X    }
X
X    mclose(mf);
X    return rc;
X}
SHAR_EOF
  : || $echo 'restore of' 'mtest.c' 'failed'
fi
# ============= mtserver.c ==============
if test -f 'mtserver.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'mtserver.c' '(file already exists)'
else
  $echo 'x -' extracting 'mtserver.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'mtserver.c' &&
X/*
X *
X *  mtserver.c - Mellanox Software tools (mst) server (remote mtcr calls)
X *
X */
X
X#include <stdio.h>
X#include <errno.h>
X#include <string.h>
X#include <stdlib.h>
X#include <signal.h>
X
X#include "mtcr.h"
X#include "tcp.h"
X
X/*
X * Constants
X */
X#define DEF_PORT 23108
X#define BUF_LEN  256
X#define DEV_LEN  2048
X
Xint sdebug = 0;
Xint port = DEF_PORT;    /* Default port */
X
X/* ////////////////////////////////////////////////////////////////////// */
Xvoid usage(const char *s)
X{
X    printf("Usage:\n\t%s [switches]\n\n", s);
X    printf("Switches may be:\n");
X    printf("\t-p[ort] <port> - Listen to specify port (default is %d).\n", port);
X    printf("\t-d[ebug]       - Print all socket traffic (for debuging only).\n");
X    printf("\t-h[elp]        - Print help message.\n");
X    exit (1);
X}
X
X/* ////////////////////////////////////////////////////////////////////// */
Xstatic void writes_deb(int con, char *s)
X{
X    writes(con, s);
X    if (sdebug)
X        printf("-> %s\n", s);
X}
X
X/* ////////////////////////////////////////////////////////////////////// */
Xvoid write_err(int con)
X{
X    writen(con, "E ", 2);
X    writes(con, strerror(errno));
X    if (sdebug)
X        printf("-> E %s\n", strerror(errno));
X}
X
X/* ////////////////////////////////////////////////////////////////////// */
Xvoid write_ok(int con)
X{
X    writes_deb(con, "O");
X}
X
X/* ////////////////////////////////////////////////////////////////////// */
Xvoid mySignal()
X{
X    exit(0);
X}
X
X/* ////////////////////////////////////////////////////////////////////// */
X#define CHK(f)    do { if ((f) < 0) { perror(""); exit(1); } } while(0)
X#define CHK2(f,m) do { if ((f) < 0) { perror(m); exit(1); } } while(0)
Xint main (int ac, char *av[])
X{
X    char *end;
X    char  buf[BUF_LEN], dev_buf[DEV_LEN];
X    int   i, con, rc;
X    mfile *mf = 0;
X
X    /* Command line parsing. */
X    for (i=1; i<ac; i++)
X    {
X        switch (*av[i])
X        {
X        case '-':
X            ++av[i];
X            if (!strcmp(av[i], "p")  ||  !strcmp(av[i], "port"))
X            {
X                if (++i >= ac)
X                {
X                    printf("After switch \"%s\" port number is expected.\n",av[--i]);
X                    printf("Type \"%s -h\" for help.\n", av[0]);
X                    exit(1);
X                }
X                port = (int)strtol(av[i], &end, 0);
X                if (*end)
X                {
X                    printf("Invalid port: \"%s\" -- ?\n", end);
X                    printf("Type \"%s -h\" for help.\n", av[0]);
X                    exit(1);
X                }
X            }
X            else if (!strcmp(av[i], "d")  ||  !strcmp(av[i], "debug"))
X            {
X                sdebug = 1;
X            }
X            else if (!strcmp(av[i], "h")  ||  !strcmp(av[i], "help"))
X            {
X                usage(av[0]);
X            }
X            else
X            {
X                printf("Invalid switch \"%s\".\n", av[i]);
X                printf("Type \"%s -h\" for help.\n", av[0]);
X                exit(1);
X            }
X            break;
X        case '?':
X            usage(av[0]);
X            break;
X        default:
X            printf("Invalid parameter \"%s\".\n", av[i]);
X            printf("Type \"%s -h\" for help.\n", av[0]);
X            exit(1);
X        }
X    }
X
X    signal(SIGPIPE, mySignal);
X
X    /* Now open and start work */
X    logset(1);
X    con = open_serv_connection(port);
X    CHK2(con, "Open connection (server side)");
X    for (;;)
X    {
X        memset(buf, 0, BUF_LEN);
X        rc = reads(con, buf, BUF_LEN);
X        CHK(rc);
X        if (!rc)
X            break;   /*  EOF */
X        if (sdebug)
X            printf("<- %s\n", buf);
X        switch(*buf)
X        {
X        case 'O':   /*  Open mfile */
X            if (mf)
X                writes_deb(con, "E Already opened");
X            else
X            {
X                DType dtype = strtoul (buf+2, &end, 0);
X                if (*end != ' ')
X                    /*  Old style (O DEV_NAME) */
X                    mf = mopen(buf+2);
X                else
X                    /*  New style (O FLAG DEV_NAME) */
X                    mf = mopend (end+1, dtype);
X
X                if (mf)
X                    write_ok(con);
X                else
X                    write_err(con);
X            }
X            break;
X        case 'C':  /*  Close mfile */
X            if (!mf)
X                writes_deb(con, "E Not opened");
X            else
X            {
X                if (mclose(mf) < 0)
X                    write_err(con);
X                else
X                {
X                    write_ok(con);
X                    mf = 0;
X                }
X            }
X            break;
X        case 'L':   /*  Get devices list */
X            rc = mdevices(dev_buf, DEV_LEN, MDEVS_ALL);
X            if (rc < 0)
X                write_err(con);
X            else
X            {
X                char *p = &dev_buf[0], vbuf[16];
X                sprintf(vbuf, "O %d", rc);
X                writes_deb(con, vbuf);
X                for (i = 0; i < rc; i++, p += strlen(p)+1)
X                    writes_deb(con, p);
X            }
X            break;
X        case 'R':   /*  Read word */
X            if (!mf)
X                writes_deb(con, "E Not opened");
X            else
X            {
X                unsigned int offset;
X                u_int32_t    value;
X                offset = strtoul(buf+2, &end, 0);
X                if (*end)
X                    writes_deb(con, "E Invalid offset");
X                else
X                {
X                    if (mread4(mf, offset, &value) < 4)
X                        write_err(con);
X                    else
X                    {
X                        char vbuf[16];
X                        sprintf(vbuf, "O 0x%08x", value);
X                        writes_deb(con, vbuf);
X                    }
X                }
X            }
X            break;
X        case 'W':   /*  Write word */
X            if (!mf)
X                writes_deb(con, "E Not opened");
X            else
X            {
X                unsigned int offset;
X                u_int32_t    value;
X                char *p = strchr(buf+2, ' ');
X                if (!p)
X                    writes_deb(con, "E Invalid format (should be OFFS DATA)");
X                else
X                {
X                    *p = '\0';
X                    p++;
X                    offset = strtoul(buf+2, &end, 0);
X                    if (*end)
X                        writes_deb(con, "E Invalid offset");
X                    else
X                    {
X                        value = strtoul(p, &end, 0);
X                        if (*end)
X                            writes_deb(con, "E Invalid data");
X                        else
X                        {
X                            if (mwrite4(mf, offset, value) < 4)
X                                write_err(con);
X                            else
X                                write_ok(con);
X                        }
X                    }
X                }
X            }
X            break;
X        default:
X            writes(con, "E Invalid command");
X            if (sdebug)
X                printf("-> E Invalid command (len:%d cmd:\"%s\")\n",
X                       (int)strlen(buf), buf);
X            break;
X        }
X    }
X
X    return 0;
X}
SHAR_EOF
  : || $echo 'restore of' 'mtserver.c' 'failed'
fi
# ============= mtusb-1_test.c ==============
if test -f 'mtusb-1_test.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'mtusb-1_test.c' '(file already exists)'
else
  $echo 'x -' extracting 'mtusb-1_test.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'mtusb-1_test.c' &&
X#include <stdio.h>
X#include <errno.h>
X#include <string.h>
X#include <sys/ioctl.h>
X
X#include "mtcr.h"
X
X/*  Linux USB Support */
X#include <linux/types.h>
X#include <linux/usb.h>
X#include <linux/usbdevice_fs.h>
X
X#define DIMAX_MST_DEV   "/dev/mst/mtusb-1"
X#define DIMAX_IN_EP     0x84
X#define DIMAX_OUT_EP    0x02
X#define DIMAX_FW_MAJOR  2
X#define DIMAX_FW_MINOR  8
X#define DIMAX_IF        0x00
X
Xstatic int bulk_transaction( int fd, char cmd, int out_len, int in_len, char* buf );
Xstatic void print_line_status( unsigned char status, char* line );
X
X
Xint main( int argc, char*argv[] )
X{
X    mfile* mf;
X    char dev_name[40] = DIMAX_MST_DEV;
X    char buf[300];
X    int rc, i, tmp;
X
X       
X    // Open device via mtcr
X    mf = mopen(  dev_name );
X    if( ! mf )
X    {
X        if( ! errno ) errno =-1;
X        printf( "Can't open \"%s\" (%s)\n", dev_name, strerror(errno) );
X        return errno;
X    }
X
X    /*  Claim Interface */
X    tmp = DIMAX_IF;
X    rc = ioctl( mf->fd, USBDEVFS_CLAIMINTERFACE, &tmp );
X    if( rc )
X    {
X        rc = errno;
X        printf( "CLAIMINTERFACE ioctl error. rc=%d, \"%s\"\n", rc, strerror(rc) );
X        return -1;
X    }
X
X    // Test1 Check FW version
X    printf( "Check FW Version             : " );
X    rc = bulk_transaction( mf->fd, 0x0a, 1, 3, buf );
X    if( rc ) return rc;
X    if( buf[0] < DIMAX_FW_MAJOR )
X    {
X        printf( "Version is %d.%d but must be at least %d.0\n",
X                    (int)buf[0], (int)buf[1], (int)DIMAX_FW_MAJOR );
X        return -1;
X    }
X    printf( " %d.%d ", (int)buf[0], (int)buf[1] );
X    printf( "PASSED\n" );
X
X    // Seconf claim Interface
X    tmp = DIMAX_IF;
X    rc = ioctl( mf->fd, USBDEVFS_RELEASEINTERFACE, &i ); 
X    if( rc )
X    {
X        rc = errno;
X        printf( "RELEASEINTERFACE ioctl error. rc=%d, \"%s\"\n", rc, strerror(rc) );
X        return -1;
X    }
X    tmp = DIMAX_IF;
X    rc = ioctl( mf->fd, USBDEVFS_CLAIMINTERFACE, &tmp );
X    if( rc )
X    {
X        rc = errno;
X        printf( "Second CLAIMINTERFACE ioctl error. rc=%d, \"%s\"\n", rc, strerror(rc) );
X        return -1;
X    }
X
X    // Test SDA, SCL Idle status
X    printf( "Please disconnect I2C cable from target device. Press Enter... " );
X    getchar();
X    printf( "\rSDA Lines Idle status test   : " );
X    rc = bulk_transaction( mf->fd, 0x08, 1, 2, buf );   // Read SDA
X    if( rc ) return rc;
X    if( buf[0] != (char)0xC0 )
X    {
X        printf( "FAILED\n" );
X        print_line_status( buf[0], "SDA" );
X        return -1;
X    }
X    printf( "PASSED\n" );
X
X    printf( "\rSCL Lines Idle status test   : " );
X    rc = bulk_transaction( mf->fd, 0x09, 1, 2, buf );   // Read SCL
X    if( rc ) return rc;
X    if( buf[0] != (char)0xC0 )
X    {
X        printf( "FAILED\n" );
X        print_line_status( buf[0], "SCL" );
X        return -1;
X    }
X    printf( "PASSED\n" );
X   
X 
X    // Test SDA, SCL High/Low
X    printf( "\rSDA HI/LOW transition test   : " );
X    rc = bulk_transaction( mf->fd, 0x06, 1, 1, buf );   // Drop SDA
X    if( rc ) return rc;
X    rc = bulk_transaction( mf->fd, 0x08, 1, 2, buf );   // Read SDA
X    if( rc ) return rc;
X    if( buf[0] != (char)0x00 )
X    {
X        printf( "SDA LOW problem\n" );
X        print_line_status( buf[0], "SDA" );
X        return -1;
X    }
X    rc = bulk_transaction( mf->fd, 0x04, 1, 1, buf );   // Release SDA
X    if( rc ) return rc;
X    rc = bulk_transaction( mf->fd, 0x08, 1, 2, buf );   // Read SDA
X    if( rc ) return rc;
X    if( buf[0] != (char)0xC0 )
X    {
X        printf( "SDA HIGH problem\n" );
X        print_line_status( buf[0], "SDA" );
X        return -1;
X    }
X    printf( "PASSED\n" );
X    
X    printf( "\rSCL HI/LOW transition test   : " );
X    rc = bulk_transaction( mf->fd, 0x07, 1, 1, buf );   // Drop SCL
X    if( rc ) return rc;
X    rc = bulk_transaction( mf->fd, 0x09, 1, 2, buf );   // Read SCL
X    if( rc ) return rc;
X    if( buf[0] != (char)0x00 )
X    {
X        printf( "SCL LOW problem\n" );
X        print_line_status( buf[0], "SCL" );
X        return -1;
X    }
X    rc = bulk_transaction( mf->fd, 0x05, 1, 1, buf );   // Release SCL
X    if( rc ) return rc;
X    rc = bulk_transaction( mf->fd, 0x09, 1, 2, buf );   // Read SCL
X    if( rc ) return rc;
X    if( buf[0] != (char)0xC0 )
X    {
X        printf( "SCL HIGH problem\n" );
X        print_line_status( buf[0], "SCL" );
X        return -1;
X    }
X    printf( "PASSED\n" );
X    
X    
X    // Test SDA, SCL Target status
X    printf( "Please Connect I2C cable to target device. Press Enter... " );
X    getchar();
X    printf( "\rSDA Line Target test         : " );
X    rc = bulk_transaction( mf->fd, 0x08, 1, 2, buf );   // Read SDA
X    if( rc ) return rc;
X    if( buf[0] != (char)0xC0 )
X    {
X        printf( "SDA Target Line Idle problem\n" );
X        print_line_status( buf[0], "SDA" );
X        return -1;
X    }
X    printf( "PASSED\n" );
X
X    printf( "\rSCL Line Target test         : " );
X    rc = bulk_transaction( mf->fd, 0x09, 1, 2, buf );   // Read SCL
X    if( rc ) return rc;
X    if( buf[0] != (char)0xC0 )
X    {
X        printf( "SCL Target Line Idle problem\n" );
X        print_line_status( buf[0], "SCL" );
X        return -1;
X    }
X    printf( "PASSED\n" );
X   
X 
X    // Test Target SDA, SCL High/Low
X    printf( "\rSDA HI/LOW Target test       : " );
X    rc = bulk_transaction( mf->fd, 0x06, 1, 1, buf );   // Drop SDA
X    if( rc ) return rc;
X    rc = bulk_transaction( mf->fd, 0x08, 1, 2, buf );   // Read SDA
X    if( rc ) return rc;
X    if( buf[0] != (char)0x00 )
X    {
X        printf( "SDA Target LOW problem\n" );
X        print_line_status( buf[0], "SDA" );
X        return -1;
X    }
X    rc = bulk_transaction( mf->fd, 0x04, 1, 1, buf );   // Release SDA
X    if( rc ) return rc;
X    rc = bulk_transaction( mf->fd, 0x08, 1, 2, buf );   // Read SDA
X    if( rc ) return rc;
X    if( buf[0] != (char)0xC0 )
X    {
X        printf( "SDA Target HIGH problem\n" );
X        print_line_status( buf[0], "SDA" );
X        return -1;
X    }
X    printf( "PASSED\n" );
X
X    printf( "\rSCL HI/LOW Target test       : " );
X    rc = bulk_transaction( mf->fd, 0x07, 1, 1, buf );   // Drop SCL
X    if( rc ) return rc;
X    rc = bulk_transaction( mf->fd, 0x09, 1, 2, buf );   // Read SCL
X    if( rc ) return rc;
X    if( buf[0] != (char)0x00 )
X    {
X        printf( "SCL Target LOW problem\n" );
X        print_line_status( buf[0], "SCL" );
X        return -1;
X    }
X    rc = bulk_transaction( mf->fd, 0x05, 1, 1, buf );   // Release SCL
X    if( rc ) return rc;
X    rc = bulk_transaction( mf->fd, 0x09, 1, 2, buf );   // Read SCL
X    if( rc ) return rc;
X    if( buf[0] != (char)0xC0 )
X    {
X        printf( "SCL Target HIGH problem\n" );
X        print_line_status( buf[0], "SCL" );
X        return -1;
X    }
X    printf( "PASSED\n" );
X
X    // Send stop to target
X    printf( "\rSend I2C STOP to Target      : " );
X    rc = bulk_transaction( mf->fd, 0x0d, 1, 1, buf );   // I2C Stop
X    if( rc ) return rc;
X    printf( "PASSED\n" );
X
X    // Detect all present slave devices
X    printf( "\rI2C Slave devices Scan. Found devices: " );
X    rc = bulk_transaction( mf->fd, 0x03, 1, sizeof(buf), buf );   // I2C Scan
X    for( i=0; i<rc-1; i++ )
X        printf( "0x%02x ", (int)((buf[i]>>1)&0x7F) );
X    printf( "\n" );
X     
X    printf( "Test PASSED\n" );
X    return 0;
X}
X     
Xstatic int bulk_transaction( int fd, char cmd, int out_len, int in_len, char* buf )
X{
X    int rc;
X    struct usbdevfs_bulktransfer bulk_st;
X
X    errno=0;
X
X    buf[0]=cmd;
X    bulk_st.data = buf;
X    bulk_st.ep = DIMAX_OUT_EP;
X    bulk_st.len = out_len;
X    bulk_st.timeout = 100;  /*  ms */
X    rc = ioctl( fd, USBDEVFS_BULK, &bulk_st );
X    if( rc != out_len )
X    {
X        if( ! errno ) errno=-1;
X        printf( "BULK OUT error (\"%s\") rc=%d\n", strerror(errno), rc );
X        return errno;
X    }
X    bulk_st.data = buf;
X    bulk_st.ep = DIMAX_IN_EP;
X    bulk_st.len = in_len;
X    bulk_st.timeout = 100;  /*  ms */
X    rc = ioctl( fd, USBDEVFS_BULK, &bulk_st );
X    if( rc != in_len || errno )
X    {
X        if( cmd == 3 && !errno && rc>0 )
X            return rc;  // Special case. Reply size unknown before
X        if( ! errno ) errno=-1;
X        printf( "BULK IN error (\"%s\") rc=%d\n", strerror(errno), rc );
X        return errno;
X    }
X    return 0;
X}
X
Xstatic void print_line_status( unsigned char status, char* line )
X{
X    switch( status )
X    {
X    case 0x00:
X        printf( "%s Line is dropped by MTUSB-1 signal is LOW\n", line );
X        break;
X    case 0x80:
X        printf( "%s Line is dropped by MTUSB-1 but signal is HIGH\n", line );
X        break;
X    case 0x40:
X        printf( "%s Line is released by MTUSB-1 but signal is LOW\n", line );
X        break;
X    case 0xCC:
X        printf( "%s Line is released by MTUSB-1 signal is HIGH\n", line );
X        break;
X    default:
X        printf( "%s Line has unknown status=0x%x\n", line, (unsigned int)(status) );
X    }
X}
X
SHAR_EOF
  : || $echo 'restore of' 'mtusb-1_test.c' 'failed'
fi
# ============= mwrite.c ==============
if test -f 'mwrite.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'mwrite.c' '(file already exists)'
else
  $echo 'x -' extracting 'mwrite.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'mwrite.c' &&
X/*
X *
X *  mwrite.c - CR Space write access
X *
X */
X
X#include <stdio.h>
X#include <stdlib.h>
X#include <string.h>
X
X#include "mtcr.h"
X
Xvoid usage(const char *n)
X{
X    printf("%s <device> <addr> <value> [<i2c_slave>]\n", n);
X    exit(1);
X}
X
Xint main(int ac, char *av[])
X{
X    char          *endp;
X    int           rc=0;
X    unsigned int  addr, val;
X    mfile         *mf;
X    DType         dtype = MST_TAVOR;
X
X    if (ac < 4)
X        usage(av[0]);
X    addr = strtoul(av[2], &endp, 0);
X    if (*endp)
X        usage(av[0]);
X    val = strtoul(av[3], &endp, 0);
X    if (*endp)
X        usage(av[0]);
X
X    if (strstr(av[1], "mt21108_pci") && !strstr(av[1], "i2cm"))
X        dtype = MST_GAMLA;
X    mf = mopend(av[1], dtype);
X    if ( !mf )
X    {
X        perror("mopen");
X        return 1;
X    }
X
X    if (ac >= 5)
X        mset_i2c_slave(mf, strtoul(av[4],0,0));
X
X    if ((rc = mwrite4(mf, addr, val)) < 0)
X    {
X        mclose(mf);
X        perror("mwrite");
X        return 1;
X    }
X    if (rc < 4)
X    {
X        mclose(mf);
X        printf("Write only %d bytes\n", rc);
X        return 1;
X    }
X    mclose(mf);
X    return 0;
X}
SHAR_EOF
  : || $echo 'restore of' 'mwrite.c' 'failed'
fi
# ============= tcp.c ==============
if test -f 'tcp.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'tcp.c' '(file already exists)'
else
  $echo 'x -' extracting 'tcp.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'tcp.c' &&
X/*
X *
X *  tcp.c - simple socket library routines
X *
X */
X
X#ifndef INSIDE_MTCR
X#define INSIDE_MTCR
X
X#include <arpa/inet.h>
X#include <errno.h>
X#include <fcntl.h>
X#include <memory.h>
X#include <netdb.h>
X#include <netinet/in.h>
X#include <signal.h>
X#include <stdarg.h>
X#include <stdio.h>
X#include <stdlib.h>
X#include <string.h>
X#include <sys/socket.h>
X#include <sys/un.h>
X#include <sys/types.h>
X#include <sys/wait.h>
X#include <unistd.h>
X
X#ifdef linux
X#include <sys/ioctl.h>
X#else
X#include <sys/filio.h>
X#endif
X
X#include "tcp.h"
X
X#endif
X
X/* ----------------------------------------------------- */
X/* ------------------------------ Log all socket traffic */
X/* ----------------------------------------------------- */
X/* ////////////////////////////////////////////////////////////////////// */
Xstatic int log_ena=0;
XINSIDE_MTCR void logset(const int ena) { log_ena = ena; }
XINSIDE_MTCR int  plog(const char *fmt, ...)
X{
X    va_list ap;
X    int     rc=0;
X
X    if (log_ena)
X    {
X        va_start (ap, fmt);
X        rc = vprintf (fmt, ap);
X        va_end (ap);
X    }
X    return rc;
X}
X
X/* --------------------------------------------------- */
X/* ------------------------------ Base socket routines */
X/* --------------------------------------------------- */
X
X/* ////////////////////////////////////////////////////////////////////// */
X/*
X** readn - read n bytes from the socket "fd"
X**
X** Attempt to read "nbytes" bytes from socket "fd" into "ptr".
X** Returns number of bytes read, or -1 if an error occurs.
X** Will read less than the specified count *only* if the peer sends
X** EOF
X*/
XINSIDE_MTCR int readn(int fd, void *vptr, int nbytes)
X{
X    int     nleft, nread;
X    char    *ptr = (char *)vptr;
X
X    nleft = nbytes;
X    while (nleft > 0)
X    {
X        do
X            nread = read(fd, ptr, nleft);
X        while (nread < 0 && errno == EINTR);
X
X        if (nread < 0)
X            return -1;              /*  error, return -1 */
X        else if (nread == 0)
X            break;                  /*  EOF */
X
X        nleft -= nread;
X        ptr   += nread;
X    }
X    return(nbytes - nleft);         /*  return >= 0 */
X}
X
X/* ////////////////////////////////////////////////////////////////////// */
X/*
X** reads - reads string (till \0)  from the socket "fd"
X*/
XINSIDE_MTCR int reads(int fd, char *ptr, int maxlen)
X{
X    int     n, done=0, rc;
X    char    c;
X
X    for (n = 0; n <= maxlen && !done; n++)
X    {
X        do
X            rc = read(fd, &c, 1);
X	while (rc < 0 && errno == EINTR);
X
X        switch(rc)
X        {
X        case 1:
X            *ptr++ = c;
X            if (c == '\0')
X                done=1;
X            break;
X        case 0:
X            done=1;
X            break;
X        default:
X            return -1;     /*  error */
X        }
X    }
X    return n-1;
X}
X
X/* ////////////////////////////////////////////////////////////////////// */
X/*
X** readnl - reads till till newline  from the socket "fd"
X*/
XINSIDE_MTCR int readnl(int fd, char *ptr, int maxlen)
X{
X    int     n, done=0, rc;
X    char    c;
X
X    for (n = 0; n <= maxlen-1 && !done; n++)
X    {
X        do
X        {
X            rc = read(fd, &c, 1);
X        }
X	while (rc < 0 && errno == EINTR);
X
X        switch(rc)
X        {
X        case 1:
X            *ptr++ = c;
X            if (c == '\n')
X            {
X                *ptr = '\0';
X                done=1;
X            }
X            break;
X        case 0:
X            done=1;
X            break;
X        default:
X            return -1;     /*  error */
X        }
X    }
X    return n-1;
X}
X
X/* ////////////////////////////////////////////////////////////////////// */
X/*
X** writen - write n bytes to the socket "fd"
X**
X** Attempt to write "nbytes" bytes to socket "fd" from "ptr".
X** Returns number of bytes written, or -1 if an error occurs.
X** Return value will always be either -1 or "nbytes"
X*/
XINSIDE_MTCR int writen(int fd, void *vptr, int nbytes)
X{
X    int     nleft, nwritten;
X    char    *ptr = (char *)vptr;
X
X    nleft = nbytes;
X    while (nleft > 0)
X    {
X        do
X            nwritten = write(fd, ptr, nleft);
X        while (nwritten < 0 && errno == EINTR);
X
X        if (nwritten < 0)
X            return -1;
X
X        nleft -= nwritten;
X        ptr   += nwritten;
X    }
X    return(nbytes - nleft);
X}
X
X/* ////////////////////////////////////////////////////////////////////// */
X/*
X** writes - write string (null ternminated buffer) to the socket "fd"
X*/
XINSIDE_MTCR int writes(int fd, char *ptr)
X{
X    return writen(fd, ptr, strlen(ptr)+1);
X}
X
X/* ////////////////////////////////////////////////////////////////////// */
X/*
X** writenl - write newline ternminated buffer to the socket "fd"
X*/
XINSIDE_MTCR int writenl(int fd, char *ptr)
X{
X    char *last = strchr(ptr, '\n');
X    if (last)
X        return writen(fd, ptr, last - ptr + 1);
X    return 0;
X}
X
X/* ////////////////////////////////////////////////////////////////////// */
X/*
X** open_cli_connection - open client TCP connection and return socket fd
X*/
XINSIDE_MTCR int open_cli_connection(const char *host, const int port)
X{
X    int                 SockFD;
X    struct sockaddr_in  serv_addr;
X    struct hostent      *hent;
X
X    plog("open_connection(%s, %d)\n", host, port);
X
X    /*  Try to determinate server IP address */
X    if ((hent = gethostbyname(host)) == NULL)
X        return -1;
X
X    /*
X     * Fill in the structure "serv_addr" with the address of the
X     * server that we want to connect with.
X     */
X    memset((char *) &serv_addr, 0, sizeof(serv_addr));
X    serv_addr.sin_family      = AF_INET;
X    memcpy(&serv_addr.sin_addr, (*(hent->h_addr_list)), sizeof(struct in_addr));
X    serv_addr.sin_port        = htons(port);
X
X    /*  Open a TCP socket (an Internet stream socket). */
X    if ( (SockFD = socket(AF_INET, SOCK_STREAM, 0)) < 0)
X        return -1;
X    /*
X     * Connect to the server.
X     */
X    if (connect(SockFD, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0)
X        return -1;
X
X    /*  All OK */
X    return SockFD;
X}
X
X/* ////////////////////////////////////////////////////////////////////// */
X/*
X** open_serv_connection - open server TCP connection and return socket fd
X*/
XINSIDE_MTCR int open_serv_connection(const int port)
X{
X    struct hostent     *hent;
X    struct sockaddr_in serv_addr;
X    struct sockaddr_in cli_inet_addr;
X    int                SockFD, newsockfd;
X    int                clilen = sizeof(cli_inet_addr);
X    int                childpid;
X
X    if (signal(SIGCHLD, SIG_IGN) == SIG_ERR)
X        return -1;
X    if ((SockFD = socket(AF_INET, SOCK_STREAM, 0)) < 0)
X        return -1;
X
X    /*  Bind our local address so that the client can send to us. */
X    memset((char *) &serv_addr, 0, sizeof(serv_addr));
X    serv_addr.sin_family      = AF_INET;
X    serv_addr.sin_addr.s_addr = htonl(INADDR_ANY);
X    serv_addr.sin_port        = htons(port);
X    if (bind(SockFD, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0)
X    {
X        close(SockFD);
X        return -1;
X    }
X
X    /*  Get ready to accept connection */
X    if (listen(SockFD, 1) < 0)
X    {
X        close(SockFD);
X        return -1;
X    }
X
X    /*  Accept connection */
X    for (;;)
X    {
X        plog("Waiting for connection on port %d\n", port);
X
X        while ((newsockfd = accept(SockFD, (struct sockaddr *)&cli_inet_addr,
X                                   (socklen_t *)&clilen)) < 0)
X        {
X            if (errno != EINTR)
X            {
X                close(SockFD);
X                return -1;
X            }
X        }
X        if ((childpid = fork()) < 0)
X            return -1;
X        if (childpid)
X        {
X            /*  We are parent */
X            close(newsockfd);
X            /*   ... and try accept next connection */
X        }
X        else
X        {
X            /*  We are child */
X            close(SockFD);
X
X            /*  Determine the client host name */
X            hent = gethostbyaddr((char *)&cli_inet_addr.sin_addr,
X                                 sizeof(cli_inet_addr.sin_addr), AF_INET);
X            plog("Accepted connection from host \"%s\" ", 
X                hent ? hent->h_name : "????");
X
X            /*  Determine the client host address */
X            plog(" (%s)", inet_ntoa(cli_inet_addr.sin_addr));
X
X            plog(", port %d\n", port);
X            return newsockfd;
X        }
X    }
X}
SHAR_EOF
  : || $echo 'restore of' 'tcp.c' 'failed'
fi
# ============= testusb.c ==============
if test -f 'testusb.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'testusb.c' '(file already exists)'
else
  $echo 'x -' extracting 'testusb.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'testusb.c' &&
X#include <unistd.h>
X#include <fcntl.h>
X#include "usbioctl.h"
X
Xint main(int argc, char** argv)
X{
X  int cnt=0;
X  int ret;
X  int expected;
X  I2C_TRANS rtrans={
X    byTransType:I2C_TRANS_NOADR,
X    bySlvDevAddr:0x48<<1, /* Gamla, fix for Tavor */
X    /* wMemoryAddr:0, */
X    wCount:4,
X    Data:{0x14,00,0x0f,0x00},
X  };
X  I2C_TRANS wtrans={
X    byTransType:I2C_TRANS_NOADR,
X    bySlvDevAddr:0x48<<1, /* Gamla, fix for Tavor */
X    /* wMemoryAddr:_be16(0x2800), */
X    wCount:4,
X    Data:{0x00,0x0f,0x00,0x14},
X  };
X  I2C_TRANS dtrans = {
X	  wCount:64,
X	  Data:{}
X	  ,
X  };
X
X  int fd= open(argv[1], O_RDWR);
X  if (fd<0) {
X    perror();
X    printf("fd=%d\n", fd);
X    return -10;
X  }
Xretry_first:
X  ret=mst_WriteI2c(fd,&wtrans);
X  if (ret<=0) goto retry_first;
X
X  if (ret!=4){
X    perror();
X    printf("1. ret=%d\n", ret);
X    goto error;
X  }
X  ret=mst_ReadI2c(fd,&rtrans);
X  if (ret<=0) goto retry_first;
X  if (ret!=4) {
X    perror();
X    printf("2. ret=%d\n", ret);
X    goto error;
X  }
X  expected=*(int*)rtrans.Data;
X
X  printf("0x%x%x%x%x\n",rtrans.Data[0],rtrans.Data[1],rtrans.Data[2],rtrans.Data[3]);
X
X  /*  Now test */
X  for(;;) {
Xretry:
X	  ret=mst_WriteI2c(fd,&wtrans);
X          if (ret<=0) goto retry;
X	  if (ret!=4){
X	    perror();
X	    printf("3. ret=%d\n", ret);
X            goto error;
X	  }
X
X	  ret=mst_ReadI2c(fd,&rtrans);
X          if (ret<=0) goto retry;
X	  if (ret!=4) {
X	    perror();
X	    printf("4. ret=%d\n", ret);
X            goto error;
X	  }
X
X	  if (expected!=*(int*)rtrans.Data) {
X	    printf("cnt=%d, expected=%x, actual=%x\n", cnt, expected, *(int*)rtrans.Data);
X             goto error;
X          }
X           printf("%7d\b\b\b\b\b\b\b", cnt);
X           cnt++;
X  }
X  return ret;
X
Xerror:
X    do {
X	    ret=mst_Debug(fd,&dtrans);
X	    dtrans.Data[ret]=0;
X	    if (ret >0) printf("%64s",dtrans.Data);
X    } while (ret == 64);
X    printf("\n");
X    printf("---------\n");
X
X  return ret;
X}
SHAR_EOF
  : || $echo 'restore of' 'testusb.c' 'failed'
fi
# ============= testusbwr.c ==============
if test -f 'testusbwr.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'testusbwr.c' '(file already exists)'
else
  $echo 'x -' extracting 'testusbwr.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'testusbwr.c' &&
X#include <unistd.h>
X#include <fcntl.h>
X#include "usbioctl.h"
X
Xint main(int argc, char** argv)
X{
X  int cnt=0;
X  int ret;
X  int expected;
X  I2C_TRANS rtrans={
X    byTransType:I2C_TRANS_NOADR,
X    bySlvDevAddr:0x48<<1, /* Gamla, fix for Tavor */
X    /* wMemoryAddr:0, */
X    wCount:4,
X    Data:{0x00,00,0x00,0x00},
X  };
X  I2C_TRANS rwtrans={
X    byTransType:I2C_TRANS_NOADR,
X    bySlvDevAddr:0x48<<1, /* Gamla, fix for Tavor */
X    /* wMemoryAddr:0, */
X    wCount:8,
X    Data:{0x00,0x08,0x20,0x00,0,0,0,0},
X  };
X  I2C_TRANS wtrans={
X    byTransType:I2C_TRANS_NOADR,
X    bySlvDevAddr:0x48<<1, /* Gamla, fix for Tavor */
X    /* wMemoryAddr:_be16(0x2800), */
X    wCount:4,
X    Data:{0x00,0x08,0x20,0x00},
X  };
X  I2C_TRANS dtrans = {
X	  wCount:64,
X	  Data:{}
X	  ,
X  };
X
X  int fd= open(argv[1], O_RDWR);
X  if (fd<0) {
X    perror();
X    printf("fd=%d\n", fd);
X    return -10;
X  }
X  *(int*)(rwtrans.Data+4)=expected;
Xretry_firstwrite:
X  ret=mst_WriteI2c(fd,&rwtrans);
X  if (ret<=0){ goto retry_firstwrite; }
X  if (ret!=8){
X    perror();
X    printf("ret=%d\n", ret);
X    goto error;
X  }
Xretry_first:
X  ret=mst_WriteI2c(fd,&wtrans);
X  if (ret<=0){ goto retry_first; }
X  if (ret!=4){
X    perror();
X    printf("ret=%d\n", ret);
X    goto error;
X  }
X  ret=mst_ReadI2c(fd,&rtrans);
X  if (ret<=0){ goto retry_first; }
X  if (ret!=4) {
X    perror();
X    printf("ret=%d\n", ret);
X    goto error;
X  }
X  expected=*(int*)rtrans.Data;
X
X  printf("0x%x%x%x%x\n",rtrans.Data[0],rtrans.Data[1],rtrans.Data[2],rtrans.Data[3]);
X
X  /*  Now test */
X  for(;;) {
X    retry_write:
X          expected++;
X          *(int*)(rwtrans.Data+4)=expected;
X	  ret=mst_WriteI2c(fd,&rwtrans);
X          if (ret<=0) { goto retry_write; }
X	  if (ret!=8){
X	    perror();
X	    printf("ret=%d\n", ret);
X              goto error;
X	  }
X
Xretry:
X          *(int*)rtrans.Data=-16;
X
X	  ret=mst_WriteI2c(fd,&wtrans);
X          if (ret<=0) { goto retry; }
X	  if (ret!=4){
X	    perror();
X	    printf("ret=%d\n", ret);
X              goto error;
X	  }
X
X	  ret=mst_ReadI2c(fd,&rtrans);
X          if (ret<=0) { goto retry; }
X	  if (ret!=4) {
X	    perror();
X	    printf("ret=%d\n", ret);
X              goto error;
X	  }
X
X	  if (expected!=*(int*)rtrans.Data) {
X	    printf("cnt=%d, expected=%x, actual=%x\n", cnt, expected, *(int*)rtrans.Data);
X              ret=-7;
X              goto error;
X          }
X           printf("%7d\b\b\b\b\b\b\b", cnt);
X           cnt++;
X  }
X
Xerror:
X    do {
X	    ret=mst_Debug(fd,&dtrans);
X	    dtrans.Data[ret]=0;
X	    if (ret >0) printf("%64s",dtrans.Data);
X    } while (ret == 64);
X    printf("\n");
X
X  return ret;
X}
SHAR_EOF
  : || $echo 'restore of' 'testusbwr.c' 'failed'
fi
# ============= usbioctl.c ==============
if test -f 'usbioctl.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'usbioctl.c' '(file already exists)'
else
  $echo 'x -' extracting 'usbioctl.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'usbioctl.c' &&
X#include <stdio.h>
X#include <unistd.h>
X#include <sys/ioctl.h>
X#include <sys/types.h> /*This header likes to sit before linux/ headers*/
X#include <linux/types.h>
X#include <linux/usb.h>
X#include <linux/usbdevice_fs.h>
X#include <asm/byteorder.h>
X#include <sys/stat.h>
X#include <fcntl.h>
X#include <string.h>
X#include <stdlib.h>
X#include <errno.h>
X#include <signal.h>
X
X#include "usbioctl.h"
X
X#if 0
Xstruct usbdevfs_ctrltransfer {
X	__u8 requesttype;
X	__u8 request;
X	__u16 value;
X	__u16 index;
X	__u16 length;
X	__u32 timeout;  /* in milliseconds */
X 	void *data;
X};
X#endif
X
X/* USB 2.0: bmRequestType - Characteristics of request: 
X * D7: Data transfer direction 0 = Host-to-device 1 = Device-to-host 
X * D6...5: Type 0 = Standard 1 = Class 2 = Vendor 3 = Reserved 
X * D4...0: Recipient 0 = Device 1 = Interface 2 = Endpoint 3 = Other 4...31 = Reserved
X * */
X
X#define WRITE_I2C (USB_DIR_OUT|USB_TYPE_VENDOR)
X#define READ_I2C (USB_DIR_IN|USB_TYPE_VENDOR)
X#define PORTS_REQUEST 0xF1
X#define I2C_REQUEST 0xF2
X#define DEBUG_REQUEST 0xFF
X
Xint mst_WriteI2c(int fd, PI2C_TRANS tr) {
X  struct usbdevfs_ctrltransfer ctrl={
X     WRITE_I2C,     /* requesttype */
X     I2C_REQUEST,   /* request */
X     tr->byTransType << 0 | tr->bySlvDevAddr << 8, /* value: bytes 2 and 3 -LE? */
X     tr->wMemoryAddr,/* index */
X     tr->wCount,    /* length */
X     5000,          /* timeout */
X     tr->Data,      /* data */
X  };
X  return ioctl(fd,USBDEVFS_CONTROL, &ctrl);
X}
Xint mst_ReadIoPorts(int fd, PI2C_TRANS tr) {
X  struct usbdevfs_ctrltransfer ctrl={
X     READ_I2C,      /* requesttype */
X     PORTS_REQUEST, /* request */
X     0,             /* value */
X     0,             /* index */
X     4,             /* length */
X     5000,          /* timeout */
X     tr->Data,      /* data */
X  };
X  return ioctl(fd,USBDEVFS_CONTROL, &ctrl);
X}
Xint mst_WriteIoPorts(int fd, PI2C_TRANS tr) {
X  struct usbdevfs_ctrltransfer ctrl={
X     WRITE_I2C,     /* requesttype */
X     PORTS_REQUEST, /* request */
X     0,             /* value */
X     0,             /* index */
X     8,             /* length */
X     5000,          /* timeout */
X     tr->Data,      /* data */
X  };
X  return ioctl(fd,USBDEVFS_CONTROL, &ctrl);
X}
X
Xint mst_ReadI2c(int fd, PI2C_TRANS tr) {
X  struct usbdevfs_ctrltransfer ctrl={
X     READ_I2C,      /* requesttype */
X     I2C_REQUEST,   /* request */
X     tr->byTransType << 0 | tr->bySlvDevAddr << 8,/* value:bytes 2 and 3 -LE? */
X     tr->wMemoryAddr,/* index */
X     tr->wCount,    /* length */
X     5000,          /* timeout */
X     tr->Data,      /* data */
X  };
X  return ioctl(fd,USBDEVFS_CONTROL, &ctrl);
X}
X
Xint mst_Debug(int fd, PI2C_TRANS tr) {
X  struct usbdevfs_ctrltransfer ctrl={
X     READ_I2C,      /* requesttype */
X     DEBUG_REQUEST, /* request */
X     0,             /* value */
X     0,             /* index */
X     tr->wCount,    /* length */
X     5000,          /* timeout */
X     tr->Data,      /* data */
X  };
X  return ioctl(fd,USBDEVFS_CONTROL, &ctrl);
X}
X
X
X/*  DiMax support */
X
X#define dimax_debug	0
X#define DIMAX_IN_EP		0x84
X#define DIMAX_OUT_EP	0x02
X#define DIMAX_IF   		0x00
X
X
X/*
XInput:
X   size  - read data size
X   tr->wCount - address size
X   tr->Data - memory address
XOutput:
X   0-ok, else error code
X*/   
Xint dimax_ReadI2c( int fd, PI2C_TRANS tr, int size )
X{
X/*
XRead transaction Format ( non zero address )
X1 : Command = 1
X1 : M - Addr Size
X1 : wsa - Write Slave Address
XM : memory address M bytes
X1 : rsa - Read Slave Address
X1 : N - read data size
X
XRead transaction Format ( zero address )
X1 : Command = 1
X1 : Addr Size = 0
X1 : rsa - Read Slave Address
X1 : N - read data size
X
XRead Reply Format
XN : Read Data
X1 : Status, 0-ok, else error
X*/
X
X	unsigned char cbuf[12];
X	unsigned int i,sz=0;
X	struct usbdevfs_bulktransfer bulk_st;
X	int rc=0,sent,recv=0;
X    sigset_t set, oldset; 
X
X	/*  Fill command */
X	if( tr->wCount )
X	{
X		cbuf[sz++] = 1;								/*  Read Command Code */
X		cbuf[sz++] = tr->wCount;					/*  Address Size */
X		cbuf[sz++] = tr->bySlvDevAddr & 0xFE;		/*  Device Slave Address for Write */
X		memcpy( cbuf+sz, tr->Data, tr->wCount );    /*  Memory address */
X		sz+=tr->wCount;
X		cbuf[sz++] = tr->bySlvDevAddr|0x01; 		/*  Device Slave Address for Read */
X		cbuf[sz++] = size; 							/*  Read Size */
X	}
X	else
X	{
X		cbuf[sz++] = 1;
X		cbuf[sz++] = 0;
X		cbuf[sz++] = tr->bySlvDevAddr|0x01;
X		cbuf[sz++] = size;
X	}
X
X	/*  Claim Interface */
X	i = DIMAX_IF;
X	rc = ioctl( fd, USBDEVFS_CLAIMINTERFACE, &i );
X	if( rc )
X	{
X		rc = errno;
X		if( dimax_debug )
X            printf( "CLAIMINTERFACE ioctl error. rc=%d, \"%s\"\n", rc, strerror(rc) );
X		return rc;
X	}
X
X    /* Block signals to make transaction atomic */
X    memset( &set, 0xFF, sizeof(sigset_t) );
X    sigprocmask(SIG_BLOCK, &set, &oldset);
X
X	/*  OUT Command */
X    bulk_st.data = cbuf;
X	bulk_st.ep = DIMAX_OUT_EP;
X	bulk_st.len = sz;
X	bulk_st.timeout = 100;			/*  ms */
X
X	sent = ioctl( fd, USBDEVFS_BULK, &bulk_st );
X	if( sent != sz )
X	{
X		rc = errno;
X        if( !rc ) rc=-1; 
X		if( dimax_debug )
X			printf( "%s : BULK ioctl OUT error. rc=%d, \"%s\"\n", __func__, rc, strerror(rc) );
X		goto cleanup;
X	}
X
X	/*  Bulk IN. Read Result */
X	bulk_st.ep = DIMAX_IN_EP;
X	bulk_st.len = size+1;
X	bulk_st.timeout = 100;			/*  ms */
X	bulk_st.data = tr->Data;
X
X	recv = ioctl( fd, USBDEVFS_BULK, &bulk_st );
X	if( recv != size+1 )
X	{
X		rc = errno;
X        if( !rc ) rc=-1; 
X		if( dimax_debug )
X			printf( "%s : BULK ioctl IN error. rc=%d, \"%s\"\n", __func__, rc, strerror(rc) );
X		goto cleanup;
X	}
X	/*  Check Status */
X	if( tr->Data[size] != 0 )
X	{
X		rc = 200+tr->Data[size];
X		if( dimax_debug )
X			printf( "%s : Status error %d\n", __func__, tr->Data[size] );
X		goto cleanup;
X	}
X	rc=0; 
X
Xcleanup:
X    /* Unblock signals which was not blocked */
X    for( i=0; i<sizeof(sigset_t); i++ )
X        ((char*)(&set))[i]=~((char*)(&oldset))[i];
X    sigprocmask(SIG_UNBLOCK, &set, &oldset);
X
X	/*  Unclaim Interface */
X	i = DIMAX_IF;
X	if( ioctl( fd, USBDEVFS_RELEASEINTERFACE, &i ) )
X	{
X		if( dimax_debug )
X			printf( "UNCLAIMINTERFACE ioctl error. rc=%d, \"%s\"\n", errno, strerror(errno) );
X	}
X
X	if( dimax_debug )
X	{
X		printf( "%s : BULK ioctl OUT %d bytes sent\n", __func__, sent );
X		for( i=0; i<sz; i++ )
X			printf( "0x%02x ", cbuf[i] );
X		printf( "\n" );
X		if( rc==0 )
X		{
X			printf( "%s: BULK ioctl IN %d bytes received\n", __func__, recv ); 
X			if( recv > 0 )
X                for( i=0; i<recv; i++ )
X                    printf( "0x%02x ", tr->Data[i] );
X			printf( "\n" );
X		}
X	}
X	return rc;
X}
X
X/*
XInput:
X   size  - write data size
X   tr->wCount - address size
X   tr->Data - memory address followed by write data
XOutput
X   0-ok, else error code
X*/   
Xint dimax_WriteI2c( int fd, PI2C_TRANS tr, int size )
X{
X/*
XWrite transaction Format ( non zero address )
X1 : Command = 2
X1 : M - Addr Size
X1 : wsa - Write Slave Address
XM : memory address M bytes
X1 : N - write data size (up to 63 bytes)
XN : Data
X
XRead transaction Format ( zero address )
X1 : Command = 2
X1 : Addr Size = 0
X1 : wsa - Write Slave Address
X1 : N - write data size (up to 63 bytes)
XN : Data
X
XWrite Reply Format
X1 : Status, 0-ok, else error
X*/
X	unsigned char cbuf[80];
X	unsigned int i,sz=0;
X	struct usbdevfs_bulktransfer bulk_st;
X	int rc=0,sent,recv=0;
X    sigset_t set, oldset; 
X
X	/*  Fill command */
X	if( tr->wCount )
X	{
X		cbuf[sz++] = 2;								/*  Write Command Code */
X		cbuf[sz++] = tr->wCount;					/*  Address Size */
X		cbuf[sz++] = tr->bySlvDevAddr & 0xFE;		/*  Device Slave Address for Write */
X		memcpy( cbuf+sz, tr->Data, tr->wCount );    /*  memory address */
X		sz+=tr->wCount;
X		cbuf[sz++] = size; 								/*  Write Size */
X		memcpy( cbuf+sz, tr->Data+tr->wCount, size );	/*  Data */
X		sz+=size;
X	}
X	else
X	{
X		cbuf[sz++] = 2;		
X		cbuf[sz++] = 0;		
X		cbuf[sz++] = tr->bySlvDevAddr & 0xFE;
X		cbuf[sz++] = size;
X		memcpy( cbuf+sz, tr->Data, size );
X		sz+=size;
X	}
X
X	/*  Claim Interface */
X	i = DIMAX_IF;
X	rc = ioctl( fd, USBDEVFS_CLAIMINTERFACE, &i );
X	if( rc )
X	{
X		rc = errno;
X		if( dimax_debug )
X            printf( "CLAIMINTERFACE ioctl error. rc=%d, \"%s\"\n", rc, strerror(rc) );
X		return rc;
X	}
X
X    /* Block signals to make transaction atomic */
X    memset( &set, 0xFF, sizeof(sigset_t) );
X    sigprocmask(SIG_BLOCK, &set, &oldset);
X
X	/*  OUT Command */
X    bulk_st.data = cbuf;
X	bulk_st.ep = DIMAX_OUT_EP;
X	bulk_st.len = sz;
X	bulk_st.timeout = 100;			/*  ms */
X
X	sent = ioctl( fd, USBDEVFS_BULK, &bulk_st );
X	if( sent != sz )
X	{
X		rc = errno;
X        if( !rc ) rc=-1; 
X		if( dimax_debug )
X			printf( "%s: BULK ioctl OUT error. rc=%d, \"%s\"\n", __func__, rc, strerror(rc) );
X		goto cleanup;
X	}
X
X	/*  Bulk IN. Read Result */
X	bulk_st.ep = DIMAX_IN_EP;
X	bulk_st.len = 1;
X	bulk_st.timeout = 100;			/*  ms */
X	bulk_st.data = tr->Data;
X
X	recv = ioctl( fd, USBDEVFS_BULK, &bulk_st );
X	if( recv != 1 )
X	{
X		rc = errno;
X        if( !rc ) rc=-1; 
X		if( dimax_debug )
X			printf( "%s: BULK ioctl IN error. rc=%d, \"%s\"\n", __func__, rc, strerror(rc) );
X		goto cleanup;
X	}
X	/*  Check Status */
X	if( tr->Data[0] != 0 )
X	{
X		rc = 200+tr->Data[size];
X		if( dimax_debug )
X			printf( "%s: Status error %d\n", __func__, tr->Data[0] );
X		goto cleanup;
X	}
X	rc=0; 
X
Xcleanup:
X    /* Unblock signals which was not blocked */
X    for( i=0; i<sizeof(sigset_t); i++ )
X        ((char*)(&set))[i]=~((char*)(&oldset))[i];
X    sigprocmask(SIG_UNBLOCK, &set, &oldset);
X
X	/*  Unclaim Interface */
X	i = DIMAX_IF;
X	if( ioctl( fd, USBDEVFS_RELEASEINTERFACE, &i ) )
X	{
X		if( dimax_debug )
X			printf( "UNCLAIMINTERFACE ioctl error. rc=%d, \"%s\"\n", errno, strerror(errno) );
X	}
X
X	if( dimax_debug )
X	{
X		printf( "%s: BULK ioctl OUT %d bytes sent\n", __func__, sent );
X		for( i=0; i<sz; i++ )
X			printf( "0x%02x ", cbuf[i] );
X		printf( "\n" );
X		if( rc==0 )
X		{
X			printf( "%s: BULK ioctl IN %d bytes received\n", __func__, recv ); 
X			if( recv > 0 )
X                for( i=0; i<recv; i++ )
X                    printf( "0x%02x ", tr->Data[i] );
X			printf( "\n" );
X		}
X	}
X	return rc;
X}
X
X#ifdef MAIN
Xint main(int argc, char** argv)
X{
X  int fd;
X  int ret;
X  unsigned int buf=0;
X  unsigned int slave;
X  /* unsigned int mask=-1; */
X  I2C_TRANS rtrans={
X    byTransType:I2C_TRANS_16ADR,
X    bySlvDevAddr:0x5a<<1, /* Gamla, fix for Tavor */
X    wMemoryAddr:0,
X    wCount:4,
X    Data:{},
X  };
X#ifdef DOWRITE
X  I2C_TRANS wtrans={
X    byTransType:I2C_TRANS_16ADR,
X    bySlvDevAddr:0x5a<<1, /* Gamla, fix for Tavor */
X    wMemoryAddr:_be16(0x2800),
X    wCount:4,
X    Data:{0,28,0,0},
X  };
X#endif
X  I2C_TRANS dtrans={
X    wCount:64,
X    Data:{},
X  };
X
X  fd=open(argv[1],O_WRONLY);
X  perror("OPEN");
X
X  sscanf(argv[2]+2,"%x",&slave);
X  {
X    unsigned addr;
X  sscanf(argv[3]+2,"%x",&addr);
X  rtrans.wMemoryAddr=addr;
X
X  }
X
X#ifdef DOWRITE
X  ret=mst_WriteI2c(fd,&wtrans);
X  printf("fd=%d, ret=%d\n",fd, ret);
X  perror("WRITE");
X#endif
X
X  rtrans.bySlvDevAddr=slave;
X  printf("SLAVE:0x%x\n", slave);
X  printf("ADDR:0x%x\n", rtrans.wMemoryAddr);
X
X#if 0
X  ret=mst_ReadIoPorts(fd,&rtrans);
X  memcpy(&buf,rtrans.Data,4);
X  printf("fd=%d, ret=%d, result=%x\n",fd, ret, buf);
X  perror("READ PORTS");
X
X  buf=0x000bff0f;
X  memcpy(rtrans.Data,&buf,4);
X  memcpy(rtrans.Data+4,&mask,4);
X  ret=mst_WriteIoPorts(fd,&rtrans);
X  printf("fd=%d, ret=%d, result=%x\n",fd, ret, buf);
X  perror("WRITE PORTS");
X
X  ret=mst_ReadIoPorts(fd,&rtrans);
X  memcpy(&buf,rtrans.Data,4);
X  printf("fd=%d, ret=%d, result=%x\n",fd, ret, buf);
X  perror("READ PORTS2");
X#endif
X
X  ret=mst_ReadI2c(fd,&rtrans);
X  memcpy(&buf,rtrans.Data,4);
X  printf("fd=%d, ret=%d, result=%x\n",fd, ret, buf);
X  perror("READ");
X
X  printf("DEBUG>\n");
X  do {
X  ret=mst_Debug(fd,&dtrans);
X  dtrans.Data[ret]=0;
X  if (ret >0) printf("%64s",dtrans.Data);
X  } while (ret == 64);
X  printf("<DEBUG\n");
X
X
X  return ret;
X}
X#endif
SHAR_EOF
  : || $echo 'restore of' 'usbioctl.c' 'failed'
fi
# ============= i2c.h ==============
if test -f 'i2c.h' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'i2c.h' '(file already exists)'
else
  $echo 'x -' extracting 'i2c.h' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'i2c.h' &&
X/*
X *  i2c.h - i2c driver header file
X *
X *
X *  Copyright (C) Mellanox Techniologies Ltd.
X *
X *  Creation date: 30-5-2000
X *
X *  Description: header file for i2c driver. Te card is base on the PCF8584
X *               I2C bus controller.
X *
X *  Changes:
X */
X
X
X#ifndef H_I2C_H
X#define H_I2C_H
X
X#include <mtcr_types.h>
X
X
X
X/*============== type definitions =========================*/
X
X/* define all supported serial clock rates */
Xtypedef enum {
X  clk_rate_90k,
X  clk_rate_45k,
X  clk_rate_11k,
X  clk_rate_1k5
X}
Xclk_rate_t;
X
X
X/*============= macro definitions =========================*/
X
X#define __NR_i2c_syscall 31 /* the system call which will be substituted by our system call */
X
X#define MT_EI2CNOTRAN  -1402 /* remove when updated in cvs !!! */
X
X
X/* for each operation code there is an associated struct that defines the data that should
X   be passed which is relevant to the required operation */
X
X/* operation codes passed to the susyem call */
X#define I2C_OP_INIT 0
X#define I2C_OP_MASTER_TRANSMIT 1
X#define I2C_OP_MASTER_RECEIVE  2
X#define I2C_OP_SEND_STOP       3
X
X
X
X
X/* struct definition for I2C_OP_INIT */
Xtypedef struct
X{
X  call_result_t ret_val; /* return value */
X  u_int16_t base; /* base address of card */
X  u_int8_t  own; /* own address of the card */
X  clk_rate_t sclk;   /* the required serial clock rate */
X}
Xi2c_op_init_st;
X
X
X/* struct definition for I2C_OP_MASTER_TRANSMIT */
Xtypedef struct
X{
X  call_result_t ret_val; /* return value */
X  u_int8_t slv_addr;
X  void *buffer;
X  u_int32_t count;
X  u_int32_t *bytes_sent_p;
X  bool sendSTOP;
X  u_int32_t *key_p;
X}
Xi2c_op_master_transmit_st;
X
X
X/* struct definition for I2C_OP_MASTER_RECEIVE */
Xtypedef struct
X{
X  call_result_t ret_val; /* return value */
X  u_int8_t slv_addr;
X  void *buffer;
X  u_int32_t count;
X  u_int32_t *bytes_received_p;
X  bool sendSTOP;
X  u_int32_t key;
X}
Xi2c_op_master_receive_st;
X
X
X/* struct definition for I2C_OP_SEND_STOP */
Xtypedef struct
X{
X  call_result_t ret_val; /* return value */
X  u_int32_t key;
X}
Xi2c_op_send_stop_st;
X
X
X
X
X
X
X/* functions prototypes */
X
X
X/***************************************************************************************************
X * Function: i2c_setup
X *
X * Description: sets up and initializes the card
X *
X * Parameters: base(IN): the base address of the card in the io space
X *             own (IN): the own address of the card in the i2c bus
X *             sclck(IN):the required serial clock rate
X *
X * Returns: MT_OK    success
X *          MT_ERROR failure to initialize
X *
X * Notes:
X *
X **************************************************************************************************/
Xcall_result_t i2c_setup(u_int16_t base, u_int8_t own, clk_rate_t sclk);
X
X
X
X
X
X/***************************************************************************************************
X * Function: i2c_master_transmit
X *
X * Description: master transmit data
X *
X * Parameters: slv_addr(IN): the address of the receipent
X *             buffer (IN): pointer to data to be transmitted
X *             count(IN): number of bytes to be sent
X *             bytes_sent_p(OUT): pointer to var to receive number of bytes sent
X *             sendSTOP(IN): flag when 1 send STOP - otherwise don't send STOP
X *             key_p(IN/OUT): pointer to key. If the bus is not locked the caller must set
X *                            it to zero, and upon return should save the value for future call
X *                            to i2c_master_receive.
X *
X * Returns: MT_OK    success
X *          MT_ERROR failure to initialize
X *
X * Notes:
X *
X **************************************************************************************************/
Xcall_result_t i2c_master_transmit(unsigned char slv_addr, void *buffer, int count, int *bytes_sent_p,
X                                  bool sendSTOP, u_int32_t *const key_p);
X
X
X
X
X
X
X/***************************************************************************************************
X * Function: i2c_master_receive
X *
X * Description: master receive data
X *
X * Parameters: slv_addr(IN): the address of the receipent
X *             buffer (OUT): pointer where to put data received
X *             count(IN): number of bytes to be receive
X *             bytes_received_p(OUT): pointer to var to receive number of bytes received
X *             key(IN): key to autenticate the caller.
X *
X * Returns: MT_OK    success
X *          MT_ERROR failure to initialize
X *
X * Notes:
X *
X **************************************************************************************************/
Xcall_result_t i2c_master_receive(u_int8_t slv_addr, void *buffer, u_int16_t count,
X                                 u_int32_t *bytes_received_p, bool sendSTOP,
X                                 const u_int32_t key);
X
X
X
X
X/***************************************************************************************************
X * Function: i2c_send_stop
X *
X * Description: send STOP to the i2c bus
X *
X * Parameters: key(IN): pointer to a key previously received from master transmit
X *             key(IN): key to autenticate the caller.
X *
X * Returns: MT_OK    success
X *          MT_ERROR failure to initialize
X *
X * Notes:
X *
X **************************************************************************************************/
Xcall_result_t i2c_send_stop(const u_int32_t key);
X
X
X
X/***************************************************************************************************
X * Function: i2c_present
X *
X * Description: check if the module is preperly installed
X *
X * Parameters:
X *
X * Returns: TRUE - module properly installed
X *          FALSE - module was not properly installed
X *
X * Notes:
X *
X **************************************************************************************************/
Xbool i2c_present(void);
X
X
X#endif  /* H_I2C_H */
SHAR_EOF
  : || $echo 'restore of' 'i2c.h' 'failed'
fi
# ============= mst_calbr.h ==============
if test -f 'mst_calbr.h' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'mst_calbr.h' '(file already exists)'
else
  $echo 'x -' extracting 'mst_calbr.h' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'mst_calbr.h' &&
X#ifndef H_MST_CALBR_H
X#define H_MST_CALBR_H
X
X#include <linux/ioctl.h>
X
X/* These will be specific for calibr */
X#define CALBR_MAGIC 0xD3
X
Xtypedef enum {
X  calbr_i2c_clk_rate_90k,
X  calbr_i2c_clk_rate_45k,
X  calbr_i2c_clk_rate_11k,
X  calbr_i2c_clk_rate_1k5
X} calbr_i2c_clk_rate_t;
X
X#define CALBR_INIT _IOC(_IOC_NONE,CALBR_MAGIC,0,sizeof(struct mst_calbr_init_st))
Xstruct mst_calbr_init_st {
X	unsigned short base;
X	unsigned char  own;
X	unsigned int   clk_rate; /*Pass enum clk_rate_t as a value*/
X};
X
X#define CALBR_STOP _IOC(_IOC_NONE,CALBR_MAGIC,1,0)
X
X#define CALBR_TRANS _IOWR(CALBR_MAGIC,3,struct mst_trans_st)
X#define MAX_TRANS_SIZE 64
X#define MAX_WR_TRANS_SIZE (MAX_TRANS_SIZE+4)
X#define MAX_RD_TRANS_SIZE MAX_TRANS_SIZE
Xstruct mst_trans_st {
X  unsigned char slv_addr;
X  unsigned char wr_buff[MAX_WR_TRANS_SIZE]; /*Actual supported size may be less,
X                                              depending on the device */
X  unsigned int wr_size;
X  unsigned char rd_buff[MAX_RD_TRANS_SIZE];
X  unsigned int rd_size;
X  unsigned int wr_count; /*OUT*/
X  unsigned int rd_count; /*OUT*/
X};
X
X#endif
SHAR_EOF
  : || $echo 'restore of' 'mst_calbr.h' 'failed'
fi
# ============= mst_irq.h ==============
if test -f 'mst_irq.h' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'mst_irq.h' '(file already exists)'
else
  $echo 'x -' extracting 'mst_irq.h' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'mst_irq.h' &&
X#ifndef H_MST_IRQ_H
X#define H_MST_IRQ_H
X
X#include <linux/ioctl.h>
X
X/* These will be specific for PCI */
X#define IRQ_MAGIC 0xE1
X
X#define IRQ_INIT _IOC(_IOC_NONE,IRQ_MAGIC,0,sizeof(struct mst_irq_init_st))
Xstruct mst_irq_init_st {
X  unsigned int bus;
X  unsigned int devfn;
X  int bar;
X  unsigned int gpio_val;
X};
X
X#define IRQ_STOP _IOC(_IOC_NONE,IRQ_MAGIC,1,0)
X
X#define IRQ_PARAMS _IOR(IRQ_MAGIC,2,struct mst_irq_init_st)
Xstruct mst_irq_params_st {
X	unsigned long bar;
X	unsigned long size;
X};
X
X#define IRQ_BLOCK _IOR(IRQ_MAGIC,3,unsigned int)
X
X#endif
SHAR_EOF
  : || $echo 'restore of' 'mst_irq.h' 'failed'
fi
# ============= mst_pci.h ==============
if test -f 'mst_pci.h' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'mst_pci.h' '(file already exists)'
else
  $echo 'x -' extracting 'mst_pci.h' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'mst_pci.h' &&
X#ifndef H_MST_PCI_H
X#define H_MST_PCI_H
X
X#include <linux/ioctl.h>
X
X/* These will be specific for PCI */
X#define PCI_MAGIC 0xD1
X
X#define PCI_INIT _IOC(_IOC_NONE,PCI_MAGIC,0,sizeof(struct mst_pci_init_st))
Xstruct mst_pci_init_st {
X  unsigned int bus;
X  unsigned int devfn;
X  int bar;
X};
X
X#define PCI_STOP _IOC(_IOC_NONE,PCI_MAGIC,1,0)
X
X#define PCI_PARAMS _IOR(PCI_MAGIC,2,struct mst_pci_params_st)
Xstruct mst_pci_params_st {
X	unsigned long long __attribute__((packed)) bar;
X	unsigned long long __attribute__((packed)) size;
X};
X
X#endif
SHAR_EOF
  : || $echo 'restore of' 'mst_pci.h' 'failed'
fi
# ============= mst_pciconf.h ==============
if test -f 'mst_pciconf.h' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'mst_pciconf.h' '(file already exists)'
else
  $echo 'x -' extracting 'mst_pciconf.h' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'mst_pciconf.h' &&
X#ifndef H_TEMT_PCICONF_H
X#define H_TEMT_PCICONF_H
X
X#include <linux/ioctl.h>
X
X/* These will be specific for PCI CONF*/
X#define PCICONF_MAGIC 0xD2
X
X#define PCICONF_INIT _IOC(_IOC_NONE,PCICONF_MAGIC,0,sizeof(struct mst_pciconf_init_st))
Xstruct mst_pciconf_init_st {
X        unsigned int bus;
X        unsigned int devfn;
X  /* Byte offsets in configuration space */
X        unsigned int addr_reg;
X        unsigned int data_reg;
X};
X
X#define PCICONF_STOP _IOC(_IOC_NONE,PCICONF_MAGIC,1,0)
X
X#define PCICONF_READ4  _IOR (PCICONF_MAGIC,1,struct mst_read4_st)
Xstruct mst_read4_st {
X        unsigned int offset;
X        unsigned int data; /*OUT*/
X};
X
X#define PCICONF_WRITE4 _IOW (PCICONF_MAGIC,2,struct mst_write4_st)
Xstruct mst_write4_st {
X        unsigned int offset;
X        unsigned int data;
X};
X
X#define PCICONF_MODIFY _IOWR(PCICONF_MAGIC,3,struct mst_modify_st)
Xstruct mst_modify_st {
X        unsigned int offset;
X        unsigned int data;
X        unsigned int mask;
X        unsigned int old_data; /*OUT*/
X};
X
X
X#endif
SHAR_EOF
  : || $echo 'restore of' 'mst_pciconf.h' 'failed'
fi
# ============= mst_ppc.h ==============
if test -f 'mst_ppc.h' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'mst_ppc.h' '(file already exists)'
else
  $echo 'x -' extracting 'mst_ppc.h' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'mst_ppc.h' &&
X#ifndef H_MST_PPC_H
X#define H_MST_PPC_H
X
X#include <linux/ioctl.h>
X
X/* These will be specific for PPC */
X#define PPC_MAGIC 0xD2
X
X#define PPC_INIT _IOC(_IOC_NONE,PPC_MAGIC,0,sizeof(struct mst_ppc_init_st))
Xstruct mst_ppc_init_st {
X  unsigned int cs;
X  unsigned int size;
X};
X
X#define PPC_STOP _IOC(_IOC_NONE,PPC_MAGIC,1,0)
X
Xstruct mst_ppc_params_st {
X	unsigned int  cs;
X	unsigned int size;
X	unsigned int addr;
X};
X#define PPC_PARAMS _IOR(PPC_MAGIC,2,struct mst_ppc_init_st)
X
X
Xstruct mst_ppc_vtop {
X        unsigned int pa;
X        void *va;
X};
X
X#define PPC_VTOP _IOWR (PPC_MAGIC, 3, struct mst_ppc_vtop)
X
X#endif
SHAR_EOF
  : || $echo 'restore of' 'mst_ppc.h' 'failed'
fi
# ============= mtcr.h ==============
if test -f 'mtcr.h' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'mtcr.h' '(file already exists)'
else
  $echo 'x -' extracting 'mtcr.h' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'mtcr.h' &&
X/*
X *
X *  mtcr.h - Mellanox Software tools (mst) driver definitions
X *
X */
X
X#ifndef _MST_H
X#define _MST_H
X
X
X#ifdef __WIN__
X
X#ifdef MTCR_EXPORTS
X#define MTCR_API __declspec(dllexport)
X#else
X#define MTCR_API __declspec(dllimport)
X#endif
X
Xtypedef unsigned __int8  u_int8_t;
Xtypedef __int8           int8_t;
Xtypedef unsigned __int16 u_int16_t;
Xtypedef __int16          int16_t;
Xtypedef unsigned __int32 u_int32_t;
Xtypedef __int32          int32_t;
Xtypedef unsigned __int64 u_int64_t;
Xtypedef __int64          int64_t;
X#if defined(_WIN64)
X    typedef __int64 MT_long_ptr_t;
X    typedef unsigned __int64 MT_ulong_ptr_t;
X#else
X    typedef long MT_long_ptr_t;
X    typedef unsigned long MT_ulong_ptr_t;
X#endif
X	
X#else  /* UNIX */
X
X#include <sys/types.h>
X#define MTCR_API
X
X#endif
X
X
X#ifdef __cplusplus
Xextern "C" {
X#endif
X
X#ifndef USE_IB_MGT
Xtypedef struct mib_private_t {
X    int  dummy;
X} MIB_Private;
X#else
X#include "mtcr_ib_private.h"
X#endif
X
Xtypedef enum MType_t {MST_PCI, MST_PCICONF, MST_CALBR, MST_USB, 
X                        MST_IB, MST_IF, MST_PPC, MST_USB_DIMAX
X#ifdef ENABLE_MST_DEV_I2C
X                        ,MST_DEV_I2C
X#endif
X} MType;
Xtypedef enum DType_t {MST_GAMLA, MST_TAVOR, MST_DIMM, MST_NOADDR} DType;
X#define MST_ANAFA2 MST_TAVOR
X#define MST_EEPROM MST_GAMLA
Xenum Mdevs_t {
X    MDEVS_GAMLA     = 0x01, /*  Each device that actually is a Gamla */
X    MDEVS_I2CM      = 0x02, /*  Each device that can work as I2C master */
X    MDEVS_MEM       = 0x04, /*  Each device that is a memory driver (vtop) */
X    MDEVS_TAVOR_DDR = 0x08, /*  Each device that maps to Tavor DDR */
X    MDEVS_TAVOR_UAR = 0x10, /*  Each device that maps to Tavor UAR */
X    MDEVS_TAVOR_CR  = 0x20, /*  Each device that maps to Tavor CR */
X    MDEVS_IF        = 0x40, /*  Standard device  interface */
X    MDEVS_REM       = 0x80, /*  Remote devices */
X    MDEVS_PPC       = 0x100, /*  PPC devices */
X    MDEVS_DEV_I2C   = 0x200, /* Generic linux kernel i2c device */
X    MDEVS_TAVOR     = (MDEVS_TAVOR_DDR|MDEVS_TAVOR_UAR|MDEVS_TAVOR_CR),
X    MDEVS_ALL       = 0xffffffff
X};
X
X/*  All fields in follow structure are not supposed to be used */
X/*  or modified by user programs. Except i2c_slave that may be */
X/*  modified before each access to target I2C slave address */
Xtypedef struct mfile_t {
X    MType         tp;           /*  type of driver */
X    DType         dtype;        /*  target device to access to */
X    DType         itype;        /*  interface device to access via */
X    int           is_i2cm;      /*  use device as I2C master */
X    unsigned char i2c_slave;
X#ifdef __WIN__    
X    MT_ulong_ptr_t fd;
X#else
X    int           fd;
X#endif
X    int           sock;         /*  in not -1 - remote interface */
X    void          *ptr;
X    MIB_Private   mib;          /*  Data for IB interface (if relevant) */
X    unsigned int  i2c_RESERVED; /*  Reserved for internal usage (i2c internal) */
X    enum Mdevs_t  flags;
X} mfile;
X
X#ifdef __WIN__
X#define FromHandle(h)	((MT_ulong_ptr_t)(h))
X#define ToHandle(h)		((HANDLE)(h))
X#else
X#define FromHandle(h)	((int)(h))
X#define ToHandle(h)		((HANDLE)(h))
X#endif
X
X/*
X * Get list of MST (Mellanox Software Tools) devices.
X * Put all device names as null-terminated strings to buf.
X *
X * Return number of devices found or -1 if buf overflow
X */
XMTCR_API int mdevices(char *buf, int len, int mask);
X
X/*
X * Open Mellanox Software tools (mst) driver.
X * Return valid mfile ptr or 0 on failure
X */
XMTCR_API mfile *mopend(const char *name, DType dtype);
X
X/*
X * Open Mellanox Software tools (mst) driver. Device type==TAVOR
X * Return valid mfile ptr or 0 on failure
X */
XMTCR_API mfile *mopen(const char *name);
X
X/*
X * Close Mellanox driver
X * req. descriptor
X */
XMTCR_API int mclose(mfile *mf);
X
X/*
X * Accelerate device if possible.
X * When device is I2C master - overclock it
X */
XMTCR_API void maccelerate(mfile *mf);
X
X/*
X * Restore normal settings, if device was accelerated.
X */
XMTCR_API void mrestore(mfile *mf);
X
X/*
X * Read 4 bytes, return number of succ. read bytes or -1 on failure
X */
XMTCR_API int mread4(mfile *mf, unsigned int offset, u_int32_t *value);
X
X/*
X * Write 4 bytes, return number of succ. written bytes or -1 on failure
X */
XMTCR_API int mwrite4(mfile *mf, unsigned int offset, u_int32_t value);
X
X/*
X * Read lots of bytes, return number of succ. read bytes or -1 on failure
X *
X * Works for any interface, but important for long bursts.
X */
XMTCR_API int mread_by_chunks(mfile *mf, unsigned int offset, void *data, int length);
X
X/*
X * Read up to 64 bytes, return number of succ. read bytes or -1 on failure
X *
X * This makes sense only w/ CALIBRE/DevaSys interfaces *to EEPROM reading only*
X */
XMTCR_API int mread64(mfile *mf, unsigned int offset, void *data, int length);
X
X/*
X * Write up to 64 bytes, return number of succ. written bytes or -1 on failure
X *
X * This makes sense only w/ CALIBRE/DevaSys interfaces *to EEPROM burning only*
X */
XMTCR_API int mwrite64(mfile *mf, unsigned int offset, void *data, int length);
X
X/*
X * Set a new value for i2c_slave
X * Return previous value
X */
XMTCR_API unsigned char mset_i2c_slave(mfile *mf, unsigned char new_i2c_slave);
X
X/*
X * get free phys. contigous pages 
X * order should be in range [0..9]
X * the size of allocated memory will be (2^order * 4096)
X * return pointer to virtual address mapped to the allocated area
X * on failure returns 0 and errno is set
X */
XMTCR_API void *mget_free_pages (mfile *mf, unsigned int order);
X
X/*
X * free phys. contigous pages 
X * order should be in range [0..9]
X * vma is freed
X * on success returns 0
X * on failure returns -1 and errno is set
X */
XMTCR_API int mfree_pages (mfile *mf, void *addr, unsigned int order);
X
X
X
X/*
X * translate virtual address to physical address
X * return physical address on success, or 0 on error
X */
XMTCR_API unsigned long mvtop (mfile *mf, void *va);
X
X#ifdef __cplusplus
X}
X#endif
X
X
X#endif
SHAR_EOF
  : || $echo 'restore of' 'mtcr.h' 'failed'
fi
# ============= mtcr_i2c.h ==============
if test -f 'mtcr_i2c.h' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'mtcr_i2c.h' '(file already exists)'
else
  $echo 'x -' extracting 'mtcr_i2c.h' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'mtcr_i2c.h' &&
X/*
X *
X *  mtcr_i2c.h - Mellanox Software tools (mst) driver: I2C master routines
X *
X */
X
X#ifndef _MTCR_I2C_H
X#define _MTCR_I2C_H
X
X#ifdef __cplusplus
Xextern "C" {
X#endif
X
Xint  i2c_master_write_cr(mfile *mf, unsigned int value, unsigned int offset, int len);
Xint  i2c_master_read_cr(mfile *mf, void *value, unsigned int offset, int len);
X//No endian-ness conversions. Supports 3 byte reads.
Xint  i2c_master_read(mfile *mf, void *value, unsigned int offset, int len);
Xvoid i2c_master_restore(mfile *mf);
Xvoid i2c_master_set(mfile *mf);
X
X#ifdef __cplusplus
X}
X#endif
X
X#endif
SHAR_EOF
  : || $echo 'restore of' 'mtcr_i2c.h' 'failed'
fi
# ============= mtcr_ib.h ==============
if test -f 'mtcr_ib.h' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'mtcr_ib.h' '(file already exists)'
else
  $echo 'x -' extracting 'mtcr_ib.h' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'mtcr_ib.h' &&
X/*
X *
X *  mtcr_ib.h - Mellanox Software tools (mst) IB related driver definitions
X *
X */
X
X#ifndef _MTCR_IB_H
X#define _MTCR_IB_H
X
XMTCR_API int mib_open(const char *name, mfile *mf);
XMTCR_API int mib_close(mfile *mf);
XMTCR_API int mib_read4(mfile *mf, unsigned int offset, u_int32_t *value);
XMTCR_API int mib_write4(mfile *mf, unsigned int offset, u_int32_t value);
XMTCR_API int mib_read64(mfile *mf, unsigned int offset, void *data, int length);
XMTCR_API int mib_write64(mfile *mf, unsigned int offset, void *data, int length);
X
X#endif
SHAR_EOF
  : || $echo 'restore of' 'mtcr_ib.h' 'failed'
fi
# ============= mtcr_ib_private.h ==============
if test -f 'mtcr_ib_private.h' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'mtcr_ib_private.h' '(file already exists)'
else
  $echo 'x -' extracting 'mtcr_ib_private.h' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'mtcr_ib_private.h' &&
X/*
X *
X *  mtcr_ib_private.h - Mellanox Software tools (mst) IB related data definitions
X *
X */
X
X#ifndef _MTCR_IB_PRIVATE_H
X#define _MTCR_IB_PRIVATE_H
X
X#include <asm/byteorder.h>
X#include <endian.h>
X
X#include <mtl_common.h>
X#include <ib_mgt.h>
X
X#define DEVICE_NAME     "InfiniHost0"
X#define DEVICE_PORT     2
X#define VENDOR_CLASS    0x09
X#define VENDOR_GET      0x01
X#define VENDOR_SET      0x02
X#define SEND_TIMEOUT    100
X#define FAST_CHECKS     100
X#define SLOW_CHECKS     10
X#define SLOW_PAUSE      1000 /* usecs */
X#define RESEND_TRIES    10
X
Xtypedef struct mad_payload_t {
X#if __BYTE_ORDER == __LITTLE_ENDIAN
X    /* -------------------------------*/
X    u_int32_t method:7;         /* 0  */
X    u_int32_t r:1;
X    u_int32_t ClassVersion:8;
X    u_int32_t MgmtClass:8;
X    u_int32_t BaseVersion:8;
X    /* -------------------------------*/
X    u_int16_t ClassSpecific;    /* 4  */
X    u_int16_t Status;
X    /* -------------------------------*/
X    u_int64_t TransactionID;    /* 8  */
X    /* -------------------------------*/
X    u_int16_t RESERVED1;        /* 16 */
X    u_int16_t AttributeID;
X    /* -------------------------------*/
X    u_int32_t BurstAddress:16;  /* AttributeModifier 20 */
X    u_int32_t Count:6;
X    u_int32_t Mode:2;
X    u_int32_t RESERVED2:8;
X    /* -------------------------------*/
X    u_int64_t VendorKey;        /* Data (24 - 28)  */
X    u_int32_t Data[58];         /* Data (32 - 252) */
X
X#elif __BYTE_ORDER == __BIG_ENDIAN
X
X    /* -------------------------------*/
X    u_int32_t BaseVersion:8;    /* 0  */
X    u_int32_t MgmtClass:8;
X    u_int32_t ClassVersion:8;
X    u_int32_t r:1;
X    u_int32_t method:7;
X    /* -------------------------------*/
X    u_int16_t Status;           /* 4  */
X    u_int16_t ClassSpecific;
X    /* -------------------------------*/
X    u_int64_t TransactionID;    /* 8  */
X    /* -------------------------------*/
X    u_int16_t AttributeID;      /* 16 */
X    u_int16_t RESERVED1;
X    /* -------------------------------*/
X    u_int32_t RESERVED2:8;      /* AttributeModifier 20 */
X    u_int32_t Mode:2;
X    u_int32_t Count:6;
X    u_int32_t BurstAddress:16;
X    /* -------------------------------*/
X    u_int64_t VendorKey;        /* Data (24 - 28)  */
X    u_int32_t Data[56];         /* Data (32 - 252) */
X
X#else
X#error "Wrong endianess"
X#endif
X} MAD_payload;
X
Xtypedef struct mib_private_t {
X    IB_MGT_mad_hndl_t hndl;
X    IB_ud_av_t        udav;
X    u_int64_t         trid;
X} MIB_Private;
X
X#endif
SHAR_EOF
  : || $echo 'restore of' 'mtcr_ib_private.h' 'failed'
fi
# ============= mtcr_mif.h ==============
if test -f 'mtcr_mif.h' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'mtcr_mif.h' '(file already exists)'
else
  $echo 'x -' extracting 'mtcr_mif.h' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'mtcr_mif.h' &&
X/*
X *
X *  mtcr_ib.h - Mellanox Software tools (mst) IB related driver definitions
X *
X */
X
X#ifndef _MTCR_MIF_H
X#define _MTCR_MIF_H
X
X/*
X * Device driver paramters
X *
X */
Xtypedef enum { MACCELERATE, MRESTORE, MREAD4, MWRITE4, MREAD64, MWRITE64 } mif_ioctl_cmd_t;
X
Xtypedef struct mif_param_st {
X       mif_ioctl_cmd_t cmd;
X
X        DType dtype;
X
X        char addr;
X        int len;
X        int imm;
X        int offset;
X
X        void * buf;
X
X} mif_param_t;
X
X#endif
SHAR_EOF
  : || $echo 'restore of' 'mtcr_mif.h' 'failed'
fi
# ============= mtcr_types.h ==============
if test -f 'mtcr_types.h' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'mtcr_types.h' '(file already exists)'
else
  $echo 'x -' extracting 'mtcr_types.h' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'mtcr_types.h' &&
X/* Backward compatibility types */
X#ifndef H_MTL_TYPES_H
X#define H_MTL_TYPES_H
X
Xtypedef int call_result_t;
Xtypedef int bool;
X#define FALSE 0
X#define TRUE 1
X
X#endif /* H_MTL_TYPES_H */
X
X#ifndef H_MTL_ERRNO_H
X#define H_MTL_ERRNO_H
X
X#define MT_OK 0
X#define MT_EINVAL -EINVAL
X#define MT_ENORSC -EBUSY
X#define MT_ERROR -ENOTTY
X#define MT_ENOINIT -ENOTTY
X#define MT_EBUSY -EBUSY
X#define MT_EBUSBUSY -EBUSY
X#define MT_EI2PINHI -ETIME
X#define MT_EI2CNACK -EIO
X#define MT_EKMALLOC -ENOMEM
X
X#endif
SHAR_EOF
  : || $echo 'restore of' 'mtcr_types.h' 'failed'
fi
# ============= tcp.h ==============
if test -f 'tcp.h' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'tcp.h' '(file already exists)'
else
  $echo 'x -' extracting 'tcp.h' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'tcp.h' &&
X/*
X *
X *  tcp.h - simple socket library definitions
X *
X */
X
X#ifndef _MST_SOCKETS_H
X#define _MST_SOCKETS_H
X
X/*
X** logset - call it w/ non-zero to see output via log.
X**          Otherwise all log calls will be ignored
X*/
Xvoid logset(const int ena);
X
X/*
X** plog - debug printouts (like printf). Set 1 via logset to see output
X*/
Xint plog(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
X
X/*
X** open_cli_connection - open client TCP connection and return socket fd
X*/
Xint open_cli_connection(const char *host, const int port);
X
X/*
X** open_serv_connection - open server TCP connection and return socket fd
X*/
Xint open_serv_connection(const int port);
X
X/*
X** readn - read n bytes from the socket "fd"
X**
X** Attempt to read "nbytes" bytes from socket "fd" into "ptr".
X** Returns number of bytes read, or -1 if an error occurs.
X** Will read less than the specified count *only* if the peer sends
X** EOF
X*/
Xint readn(int fd, void *vptr, int nbytes);
X
X/*
X** reads - reads string (till \0)  from the socket "fd"
X*/
Xint reads(int fd, char *ptr, int maxlen);
X
X/*
X** readnl - reads till till newline  from the socket "fd"
X*/
Xint readnl(int fd, char *ptr, int maxlen);
X
X/*
X** writen - write n bytes to the socket "fd"
X**
X** Attempt to write "nbytes" bytes to socket "fd" from "ptr".
X** Returns number of bytes written, or -1 if an error occurs.
X** Return value will always be either -1 or "nbytes"
X*/
Xint writen(int fd, void *vptr, int nbytes);
X
X/*
X** writes - write string (null ternminated buffer) to the socket "fd"
X*/
Xint writes(int fd, char *ptr);
X
X/*
X** writenl - write newline ternminated buffer to the socket "fd"
X*/
Xint writenl(int fd, char *ptr);
X
X#endif
SHAR_EOF
  : || $echo 'restore of' 'tcp.h' 'failed'
fi
# ============= usbdescriptor.h ==============
if test -f 'usbdescriptor.h' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'usbdescriptor.h' '(file already exists)'
else
  $echo 'x -' extracting 'usbdescriptor.h' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'usbdescriptor.h' &&
X#include <sys/ioctl.h>
X#include <sys/types.h> /*This header likes to sit before linux/ headers*/
X
X#include <linux/version.h>
X/*  Linux USB Support */
X#include <linux/usb_ch9.h>
X#include <linux/usbdevice_fs.h>
X#include <asm/byteorder.h>
X
X
Xstatic inline int usb_control_msg(int fd, int requesttype, int request,
X  int value, int index, char *bytes, int size, int timeout)
X{
X  struct usbdevfs_ctrltransfer ctrl;
X  int ret;
X
X#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
X  ctrl.requesttype = requesttype;
X  ctrl.request = request;
X  ctrl.value = value;
X  ctrl.index = index;
X  ctrl.length = size;
X#else
X  ctrl.bRequestType = requesttype;
X  ctrl.bRequest = request;
X  ctrl.wValue = value;
X  ctrl.wIndex = index;
X  ctrl.wLength = size;
X#endif
X
X  ctrl.data = bytes;
X  ctrl.timeout = timeout;
X
X  ret = ioctl(fd, USBDEVFS_CONTROL, &ctrl);
X
X  //return ret<0?ret:0;
X  return ret<0?ret:0;
X}
X        
Xstatic inline int usb_get_descriptor(int fd, unsigned char type,
X  unsigned char index, void *buf, int size)
X{
X  memset(buf, 0, size);
X
X  return usb_control_msg(fd, USB_DIR_IN|USB_TYPE_STANDARD, 
X      USB_REQ_GET_DESCRIPTOR, (type << 8) + index, 0, buf, size, 1000);
X}
X
Xstatic inline int usb_get_device_descriptor(int fd, struct usb_device_descriptor* buf)
X{
X  int rc=usb_get_descriptor(fd, USB_DT_DEVICE, 0,
X      buf, USB_DT_DEVICE_SIZE);
X  buf->idVendor=__le16_to_cpu(buf->idVendor);
X  buf->idProduct=__le16_to_cpu(buf->idProduct);
X  return rc;
X}
SHAR_EOF
  : || $echo 'restore of' 'usbdescriptor.h' 'failed'
fi
# ============= usbioctl.h ==============
if test -f 'usbioctl.h' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'usbioctl.h' '(file already exists)'
else
  $echo 'x -' extracting 'usbioctl.h' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'usbioctl.h' &&
X/*
X *
X *  mtcr.h - Mellanox Software tools (mst) driver definitions
X *
X */
X
X#ifndef _USBIOCTL_H
X#define _USBIOCTL_H
X
Xtypedef enum {
X  /*  supported transaction types */
X  I2C_TRANS_NOADR,          /*  read or write with no address cycle */
X  I2C_TRANS_8ADR,           /*  read or write with 8 bit address cycle */
X  I2C_TRANS_16ADR           /*  read or write with 16 bit address cycle */
X} I2C_TRANS_TYPE;
X
Xtypedef struct _I2C_TRANS {
X  unsigned char byTransType;
X  unsigned char bySlvDevAddr;
X  unsigned int wMemoryAddr;
X  int wCount;
X  unsigned char Data[256];
X} I2C_TRANS, *PI2C_TRANS;
X
Xint mst_WriteI2c(int fd, PI2C_TRANS tr);
Xint mst_ReadI2c(int fd, PI2C_TRANS tr);
Xint mst_ReadIoPorts(int fd, PI2C_TRANS tr);
Xint mst_WriteIoPorts(int fd, PI2C_TRANS tr);
Xint mst_Debug(int fd, PI2C_TRANS tr);
X
X
X/*  Dimax */
X
Xint dimax_ReadI2c( int fd, PI2C_TRANS tr, int size );
Xint dimax_WriteI2c( int fd, PI2C_TRANS tr, int size );
X
X#endif
SHAR_EOF
  : || $echo 'restore of' 'usbioctl.h' 'failed'
fi
# ============= mst ==============
if test -f 'mst' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'mst' '(file already exists)'
else
  $echo 'x -' extracting 'mst' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'mst' &&
X#!/bin/bash
X#
X# mst        This starts and stops mst (Mellanox Software tools) drivers
X#
X
X#insmod_flags="-f"
Xprefix="/usr/mst" # Directory where MST is located
X
X# Source function library.
Xif test -e /etc/init.d/functions
Xthen
XPATH_TMP="$PATH"        
X. /etc/init.d/functions # Change $PATH
XPATH="$PATH_TMP:$PATH"  # Have to restore original $PATH 
Xelse
Xaction() {
X  STRING=$1
X  echo -n "$STRING"
X  shift
X  $*
X  rc=$?
X  if test $rc -ne 0
X  then
X    echo " - Failure: $rc"
X  else
X    echo " - Success"
X  fi
X  return $rc
X}
Xecho_success() {
X    echo " - Success"
X}
Xecho_failure() {
X    echo " - Failure: $?"
X}
Xfailure() {
X  echo -n "$* - Failure"
X}
Xfi
X
XRETVAL=0
X
X# Mellanox dev directory
Xmdir="/dev/mst"        # Directory where MST devices created
Xmbindir="$prefix/bin" # Binary directory where MST-utils and modules are located
Xpcidir="$prefix/etc/pci" # Directory where PCI info should be saved
X
X# device prefixes
Xmpcidev="mt23108_"     # Prefix for PCI devices
Xmpciconfdev="mt23108_" # Prefix for PCICONF devices # live fish: 23109
Xmbridgedev="mt23108_"  # PCI to PCI bridge (virtual bus) # bridge: 23110
Xmpcuromdev="mt23108_"  # Prefix for PCUROM devices # pcu rom: 23120
Xmgamladev="mt21108_"   # Prefix for PCI devices (Gamla)
Xmanafadev="mt43132_"   # Prefix for PCI devices (Anafa)
Xmarbeldev="mt25208_"   # Prefix for PCI devices (Arbel - Tavor compatible mode)
Xmarbeldev1="mt25218_"  # Prefix for PCI devices (Arbel - Arbel mode 1)
Xmarbeldev2="mt25228_"  # Prefix for PCI devices (Arbel - Arbel mode 2)
Xmarbeldev3="mt25238_"  # Prefix for PCI devices (Arbel - Arbel mode 3)
Xmsinai4dev="mt24204_"  # Prefix for PCI devices (Sinai - Sinai mode 1)
Xmsinai8dev="mt25204_"  # Prefix for PCI devices (Sinai - Sinai mode 2)
X
X# Default permission
Xperm="666"
X
X# Vendor / Device IDs
Xvenid="15b3"         # Mellanox vendor ID
Xdevid_pci="5a44"     # MT23108 PCI device ID
Xdevid_bridge="5a46"  # MT23108 PCI to PCI bridge device ID
Xdevid_pciconf="5a45" # MT23108 PCI conf device ID
Xdevid_pcurom="5a50"  # MT23108 PCIROM device ID
X
Xdevid_gamla="5274"    #  MT21108 (Gamla)
Xdevid_anafa="a87c"    #  MT21108 (Anafa)
X#devid_pci="5274"     #  Debug (gamla)
X#devid_pciconf="5274" #  Debug (gamla)
X#devid_pcurom="5274"  #  Debug (gamla)
X
X#Arbel
Xdevid_apciconf="6279" # MT25209 ROM BURN device ID
Xdevid_apci="6278"     # MT25208 PCI device ID
Xdevid_apci1="6282"     # MT25218 PCI device ID
Xdevid_apci2="628c"     # MT25228 PCI device ID
Xdevid_apci3="6296"     # MT25238 PCI device ID
X
Xdevid_s4pciconf="5e8d" # MT24204 ROM BURN device ID
Xdevid_s8pciconf="6275" # MT25204 ROM BURN device ID
X
Xdevid_s4pci="5e8c" # MT24204 PCI device ID
Xdevid_s8pci="6274" # MT25204 PCI device ID
X
X
X# Title
Xprog="MST (Mellanox Software Tools) driver set"
X
X# USB pause (seconds)
Xusb_pause=1
X
X# USB tries
Xusb_tries=10
X
XPATH=.:${PATH}:/sbin:/usr/bin:/bin:${mbindir}
X
Xkver=`uname -r`
Xmodir="$prefix/lib/$kver"
X
Xif [ -f /proc/cpuinfo ]; then
X    cat /proc/cpuinfo 2>&1 | grep 8xx > /dev/null;
X    if [ $? == 0 ]; then
X        mstplat=8xx
X    fi
Xfi
X
Xif [ -r /etc/mst.conf ]; then
X. /etc/mst.conf
Xfi
X
X####
X#### MST VIRT TO PHYS
X#### -------
X####
X#create_vtop_dev()
X#{
X#    major=$1
X#    mknod -m ${perm} ${mdir}/vtop c ${major} 0
X#    ${mbindir}/minit ${mdir}/vtop
X#    if [ $? -ne 0 ]; then
X#        rm -f ${mdir}/vtop
X#    fi
X#}
X#
X###
X### CALIBRE
X### -------
X###
Xcreate_calibre_dev()
X{
X    major=$1
X    mknod -m ${perm} ${mdir}/calibre c ${major} 0
X    ${mbindir}/minit ${mdir}/calibre 0x310 0x44 0
X    if [ $? -ne 0 ]; then
X        rm ${mdir}/calibre
X    fi
X}
X
X###
X### PCI / PCICONF PCUROM
X### --------------------
X###
X
X### create group of PCI devices per one instance of tavor (ddr,cr,uar)
X### ------------------------------------------------------------------
Xcreate_pci_dev()
X{
X    ## For IA64 - do not create PCI devices
X    #if [ "`uname -m`" = "ia64" ]; then
X    #    return
X    #fi
X
X    local devname=$1
X    local busdevfn=$2
X    local devnum=$3
X    local major=$4
X    local minor=$5
X#    local c_major=$6
X#    local c_minor=$7
X    local bar_step=$6
X    shift 6
X
X    local bar=0
X
X    # PCI group of devices
X    #     "_cr", "_uar"  and "_ddr" for Tavor
X    #     ""     "_i2cm"            for Gamla
X    for name
X    do
X        mknod -m ${perm} ${mdir}/${devname}pci$name${devnum} c ${major} ${minor}
X        ${mbindir}/minit ${mdir}/${devname}pci$name${devnum} $busdevfn $bar
X        if [ $? -ne 0 ]; then
X            rm ${mdir}/${devname}pci$name${devnum}
X        fi
X        minor=$(( $minor + 1 ))
X        bar=$(( $bar + $bar_step ))
X    done
X}
X
X### create a PCICONF device per one instance of tavor
X### -------------------------------------------------
Xcreate_pciconf_dev()
X{
X    local devname=$1
X    local busdevfn=$2
X    local devnum=$3
X    local major=$4
X    local minor=$5
X    local name=$6
X
X    # PCICONF
X    mknod -m ${perm} ${mdir}/${devname}pciconf$name${minor} c ${major} ${minor}
X    ${mbindir}/minit ${mdir}/${devname}pciconf$name${minor} ${busdevfn} 88 92
X    if [ $? -ne 0 ]; then
X        rm ${mdir}/${devname}pciconf$name${minor}
X    fi
X    minor=$((  $minor + 1 ))
X}
X
X#write all-ones to PCI Vital Product Data(VPD) capability register
X#wait till top bit read as 0
Xclear_VPD()
X{
X   busdevfn=$1
X   reg_vpd=0
X   stat=`setpci -s $busdevfn 06`
X   if (($stat & 0x10 ));then #if there is a capabilities list
X     reg=`setpci -s $busdevfn 34.L`	#get 1st capability reg
X     while (( $reg != 0 )); do
X       regval=0x`setpci -s $busdevfn ${reg}.L`
X       if (($((regval & 0xff)) == 0x03)); then
X	 reg_vpd=$reg
X	 break;
X       fi
X       reg=${regval:6:2}
X     done
X     #echo reg_vpd=$reg_vpd
X
X     if (($reg_vpd)); then
X	 setpci -s $busdevfn ${reg_vpd}.L=ffffffff
X	 regval=0x`setpci -s $busdevfn ${reg_vpd}.L`
X	 while (( $regval & 0x80000000 )); do
X	   regval=`setpci -s $busdevfn ${reg_vpd}.L`
X	 done
X     fi
X   fi
X}
X
X# create all devices
Xcreate_devices()
X{
X    echo "$1"
X
X    #    mstr=`cat /proc/devices | grep 'mst_info$'`
X    #    if [ $? -ne 0 ]; then
X    #        echo
X    #        echo "mst_info driver not found"
X    #        return 1
X    #    fi
X    #    set -- $mstr
X    #    vtopmajor=$1
X    #    create_vtop_dev $vtopmajor
X    #
X    #
X    # Determine PCI/PCICONF major numbers.
X    # Initialize PCI/PCICONF minor numbers.
X    # ------------------------------------
X    #
X    mstr=`cat /proc/devices | grep 'mst_pci$'`
X    if [ $? -ne 0 ]; then
X        echo
X        echo "mst_pci driver not found"
X        return 1
X    fi
X    set -- $mstr
X    pcimajor=$1
X    mstr=`cat /proc/devices | grep 'mst_pciconf$'`
X    if [ $? -ne 0 ]; then
X        echo
X        echo "mst_pciconf driver not found"
X        return 1
X    fi
X    set -- $mstr
X    pciconfmajor=$1
X    pciminor=0
X    pciconfminor=0
X
X
X    #
X    # PCI DEVICES
X    # -----------
X    #
X    devnum=0
X    pciminor=`(
X    echo $pciminor
X    lspci -m -n -d ${venid}:${devid_pci} | sort | while read str
X    do
X        set -- $str
X        busdevfn=$1
X 
X	#write all-ones to PCI Vital Product Data(VPD) capability register
X	clear_VPD $busdevfn
X
X        create_pci_dev $mpcidev $busdevfn $devnum $pcimajor $pciminor 2 _cr _uar _ddr
X
X        devnum=$((  $devnum + 1 ))
X        pciminor=$((  $pciminor + 3 ))  #3PCI bars
X
X        echo $pciminor
X    done
X    )| tail -1`
X
X    #
X    # Gamla PCI DEVICES
X    # -----------------
X    #
X    devnum=0
X    pciminor=`(
X    echo $pciminor
X    lspci -m -n -d ${venid}:${devid_gamla} | sort | while read str
X    do
X        set -- $str
X        busdevfn=$1
X
X        create_pci_dev $mgamladev $busdevfn $devnum $pcimajor $pciminor 0 "" _i2cm
X
X        devnum=$((  $devnum + 1 ))
X        pciminor=$((  $pciminor + 1 ))
X
X        echo $pciminor
X    done
X    )| tail -1`
X
X    #
X    # Anafa PCI DEVICES
X    # -----------------
X    #
X    devnum=0
X    pciminor=`(
X    echo $pciminor
X    lspci -m -n -d ${venid}:${devid_anafa} | sort | while read str
X    do
X        set -- $str
X        busdevfn=$1
X
X        create_pci_dev $manafadev $busdevfn $devnum $pcimajor $pciminor 0 "" _i2cm
X
X        devnum=$((  $devnum + 1 ))
X        pciminor=$((  $pciminor + 1 ))
X
X        echo $pciminor
X    done
X    )| tail -1`
X
X
X    #
X    # Arbel PCI DEVICES
X    # -----------------
X    #
X    devnum=0
X    pci_pciconf_minor=`(
X    echo $pciminor $pciconfminor
X    lspci -m -n -d ${venid}:${devid_apci} | sort | while read str
X    do
X        set -- $str
X        busdevfn=$1
X
X	#write all-ones to PCI Vital Product Data(VPD) capability register
X	clear_VPD $busdevfn
X
X        create_pci_dev $marbeldev $busdevfn $devnum $pcimajor $pciminor 2 _cr _uar _ddr
X        create_pciconf_dev $marbeldev $busdevfn $devnum $pciconfmajor $pciconfminor
X
X        devnum=$((  $devnum + 1 ))
X        pciminor=$((  $pciminor + 3 ))
X        pciconfminor=$((  $pciconfminor + 1 ))
X
X        echo $pciminor $pciconfminor
X    done
X    )| tail -1`
X    set -- $pci_pciconf_minor
X    pciminor=$1
X    pciconfminor=$2
X
X    #
X    devnum=0
X    pci_pciconf_minor=`(
X    echo $pciminor $pciconfminor
X    lspci -m -n -d ${venid}:${devid_apci1} | sort | while read str
X    do
X        set -- $str
X        busdevfn=$1
X
X	#write all-ones to PCI Vital Product Data(VPD) capability register
X	clear_VPD $busdevfn
X
X        create_pci_dev $marbeldev1 $busdevfn $devnum $pcimajor $pciminor 2 _cr _uar _ddr
X        create_pciconf_dev $marbeldev1 $busdevfn $devnum $pciconfmajor $pciconfminor
X
X        devnum=$((  $devnum + 1 ))
X        pciminor=$((  $pciminor + 3 ))
X        pciconfminor=$((  $pciconfminor + 1 ))
X
X        echo $pciminor $pciconfminor
X    done
X    )| tail -1`
X    set -- $pci_pciconf_minor
X    pciminor=$1
X    pciconfminor=$2
X
X    #
X    devnum=0
X    pci_pciconf_minor=`(
X    echo $pciminor $pciconfminor
X    lspci -m -n -d ${venid}:${devid_apci2} | sort | while read str
X    do
X        set -- $str
X        busdevfn=$1
X
X	#write all-ones to PCI Vital Product Data(VPD) capability register
X	clear_VPD $busdevfn
X
X        create_pci_dev $marbeldev2 $busdevfn $devnum $pcimajor $pciminor $pciconfmajor $pciconfminor 2 _cr _uar _ddr
X        create_pciconf_dev $marbeldev2 $busdevfn $devnum $pciconfmajor $pciconfminor
X
X        devnum=$((  $devnum + 1 ))
X        pciminor=$((  $pciminor + 1 ))
X        pciconfminor=$((  $pciconfminor + 1 ))
X
X        echo $pciminor $pciconfminor
X    done
X    )| tail -1`
X    set -- $pci_pciconf_minor
X    pciminor=$1
X    pciconfminor=$2
X
X    #
X    devnum=0
X    pci_pciconf_minor=`(
X    echo $pciminor $pciconfminor
X    lspci -m -n -d ${venid}:${devid_apci3} | sort | while read str
X    do
X        set -- $str
X        busdevfn=$1
X
X	#write all-ones to PCI Vital Product Data(VPD) capability register
X	clear_VPD $busdevfn
X
X        create_pci_dev $marbeldev3 $busdevfn $devnum $pcimajor $pciminor 2 _cr _uar _ddr
X        create_pciconf_dev $marbeldev3 $busdevfn $devnum $pciconfmajor $pciconfminor
X
X        devnum=$((  $devnum + 1 ))
X        pciminor=$((  $pciminor + 1 ))
X        pciconfminor=$((  $pciconfminor + 1 ))
X
X        echo $pciminor $pciconfminor
X    done
X    )| tail -1`
X    set -- $pci_pciconf_minor
X    pciminor=$1
X    pciconfminor=$2
X
X    # Sinai devices
X    devnum=0
X    pci_pciconf_minor=`(
X    echo $pciminor $pciconfminor
X    lspci -m -n -d ${venid}:${devid_s4pci} | sort | while read str
X    do
X        set -- $str
X        busdevfn=$1
X
X	#write all-ones to PCI Vital Product Data(VPD) capability register
X	clear_VPD $busdevfn
X
X        create_pci_dev $msinai4dev $busdevfn $devnum $pcimajor $pciminor 2 _cr _uar _ddr
X        create_pciconf_dev $msinai4dev $busdevfn $devnum $pciconfmajor $pciconfminor
X
X        devnum=$((  $devnum + 1 ))
X        pciminor=$((  $pciminor + 3 ))
X        pciconfminor=$((  $pciconfminor + 1 ))
X
X        echo $pciminor $pciconfminor
X    done
X    )| tail -1`
X    set -- $pci_pciconf_minor
X    pciminor=$1
X    pciconfminor=$2
X
X    devnum=0
X    pci_pciconf_minor=`(
X    echo $pciminor $pciconfminor
X    lspci -m -n -d ${venid}:${devid_s8pci} | sort | while read str
X    do
X        set -- $str
X        busdevfn=$1
X
X	#write all-ones to PCI Vital Product Data(VPD) capability register
X	clear_VPD $busdevfn
X
X        create_pci_dev $msinai8dev $busdevfn $devnum $pcimajor $pciminor 2 _cr _uar
X        create_pciconf_dev $msinai8dev $busdevfn $devnum $pciconfmajor $pciconfminor
X
X        devnum=$((  $devnum + 1 ))
X        pciminor=$((  $pciminor + 3 ))
X        pciconfminor=$((  $pciconfminor + 1 ))
X
X        echo $pciminor $pciconfminor
X    done
X    )| tail -1`
X    set -- $pci_pciconf_minor
X    pciminor=$1
X    pciconfminor=$2
X
X    #
X    # PCICONF DEVICES
X    # ---------------
X    #
X    devnum=0
X    pciconfminor=`(
X    echo $pciconfminor
X    lspci -m -n -d ${venid}:${devid_pciconf} | sort | while read str
X    do
X        set -- $str
X        busdevfn=$1
X
X        create_pciconf_dev $mpciconfdev $busdevfn $devnum $pciconfmajor $pciconfminor
X
X        devnum=$((  $devnum + 1 ))
X        pciconfminor=$((  $pciconfminor + 1 ))
X        echo $pciconfminor
X    done
X    )| tail -1`
X
X    #
X    # BRIDGE DEVICES
X    # ---------------
X    #
X    devnum=0
X    pciconfminor=`(
X    echo $pciconfminor
X    lspci -m -n -d ${venid}:${devid_bridge} | sort | while read str
X    do
X        set -- $str
X        busdevfn=$1
X
X        create_pciconf_dev $mbridgedev $busdevfn $devnum $pciconfmajor $pciconfminor
X
X        devnum=$((  $devnum + 1 ))
X        pciconfminor=$((  $pciconfminor + 1 ))
X        echo $pciconfminor
X    done
X    )| tail -1`
X
X    #
X    # PCUROM DEVICES
X    # --------------
X    #
X    devnum=0
X    pci_pciconf_minor=`(
X    echo $pciminor $pciconfminor
X    lspci -m -n -d ${venid}:${devid_pcurom} | sort | while read str
X    do
X        set -- $str
X        busdevfn=$1
X
X        create_pci_dev $mpcuromdev $busdevfn $devnum $pcimajor $pciminor _bar0_ _bar1_ _bar2_
X        create_pciconf_dev $mpcuromdev $busdevfn $devnum $pciconfmajor $pciconfminor
X
X        devnum=$((  $devnum + 1 ))
X        pciminor=$((  $pciminor + 3 ))
X        pciconfminor=$((  $pciconfminor + 1 ))
X        echo $pciminor $pciconfminor
X    done
X    )| tail -1`
X    set -- $pci_pciconf_minor
X    pciminor=$1
X    pciconfminor=$2
X
X    #
X    # ARBEL PCICONF DEVICES
X    # ---------------
X    #
X    devnum=0
X    pciconfminor=`(
X    echo $pciconfminor
X    lspci -m -n -d ${venid}:${devid_apciconf} | sort | while read str
X    do
X        set -- $str
X        busdevfn=$1
X
X        create_pciconf_dev $marbeldev $busdevfn $devnum $pciconfmajor $pciconfminor
X
X        devnum=$((  $devnum + 1 ))
X        pciconfminor=$((  $pciconfminor + 1 ))
X        echo $pciconfminor
X    done
X    )| tail -1`
X
X    #
X    # SINAI PCICONF DEVICES
X    # ---------------
X    #
X    devnum=0
X    pciconfminor=`(
X    echo $pciconfminor
X    lspci -m -n -d ${venid}:${devid_s4pciconf} | sort | while read str
X    do
X        set -- $str
X        busdevfn=$1
X
X        create_pciconf_dev $msinai4dev $busdevfn $devnum $pciconfmajor $pciconfminor
X
X        devnum=$((  $devnum + 1 ))
X        pciconfminor=$((  $pciconfminor + 1 ))
X        echo $pciconfminor
X    done
X    )| tail -1`
X
X    devnum=0
X    pciconfminor=`(
X    echo $pciconfminor
X    lspci -m -n -d ${venid}:${devid_s8pciconf} | sort | while read str
X    do
X        set -- $str
X        busdevfn=$1
X
X        create_pciconf_dev $msinai8dev $busdevfn $devnum $pciconfmajor $pciconfminor
X
X        devnum=$((  $devnum + 1 ))
X        pciconfminor=$((  $pciconfminor + 1 ))
X        echo $pciconfminor
X    done
X    )| tail -1`
X
X    #
X    # CALIBRE DEVICE
X    # --------------
X    #
X    devnum=0
X    mstr=`cat /proc/devices | grep 'mst_calbr$'`
X    if [ $? -eq 0 ]; then
X        set -- $mstr
X        calbrmajor=$1
X        create_calibre_dev $calbrmajor
X    else 
X        echo
X    #    echo "mst_calbr driver not found"
X    #    return 1
X    fi
X
X  if test -x ${mbindir}/listusb; then
X    #
X    # MTUSB (devasys) and MTUSB-1 (dimax)
X    # ---------------------------------------
X    #
X    local dimax_vend=0x0abf
X    local dimax_prod=0x3370
X    local def_vend=0x0547
X    local def_prod=0x2131 
X    local devasys_vend=0x0abf
X    local devasys_prod=0x03e8
X    local devasys_working_prod=0x03e9
X    local max_devasys_tries=7
X    local devasys_try=0
X    local devasys_ok=0
X
X    local mst_usb_dev=""
X    for name in `${mbindir}/listusb $dimax_vend $dimax_prod`;
X    do
X      chmod 0666 /proc/bus/usb/$name
X      if ${mbindir}/dimax_init /proc/bus/usb/$name > /dev/null ; then
X        action "MTUSB-1 USB to I2C Bridge" ln -fs /proc/bus/usb/$name ${mdir}/${mst_usb_dev}mtusb-1
X        mst_usb_dev=X$mst_usb_dev
X      else
X        echo_failure
X        failure "Can't initialize MTUSB-1 USB to I2C Bridge"
X      fi
X    done
X
X    #Load FW for Devasys (EZ USB) I2C devices
X    if test -x ${prefix}/sbin/fxload; then
X      for name in `${mbindir}/listusb $def_vend $def_prod` \
X        `${mbindir}/listusb $devasys_vend $devasys_prod`;
X      do
X        action "MTUSB Loading FW for USB to I2C Bridge" ${prefix}/sbin/fxload -D /proc/bus/usb/$name -I ${prefix}/etc/0abf03e8_6.hex
X        while [ "$devasys_try" -lt "$max_devasys_tries" ]
X        do
X          echo -n "."
X          sleep 1
X          working_list=`${mbindir}/listusb $devasys_vend $devasys_working_prod`
X          if test $working_list;
X          then
X            devasys_ok=1
X            break
X          fi
X          devasys_try=$((  $devasys_try + 1 ))
X        done
X        if [ "$devasys_ok" -eq "1" ]
X        then
X          echo_success
X        else
X          echo_failure
X          echo
X          echo
X          echo "MTUSB USB device didn't start correctly."
X          echo "Please unplug the device from USB and I2C,"
X          echo "wait several seconds, plug it back and run"
X          echo "\"mst restart\""
X          echo
X          echo
X        fi
X      done
X    fi
X
X    for name in `${mbindir}/listusb $devasys_vend $devasys_working_prod`;
X    do
X      action "MTUSB USB to I2C Bridge" ln -fs /proc/bus/usb/$name ${mdir}/${mst_usb_dev}mtusb
X      mst_usb_dev=X$mst_usb_dev
X    done
X  fi
X}
X
Xcreate_devices_8xx()
X{
X    echo $1
X
X    #
X    # I2C DEVICES
X    # -----------
X    #
X    if mstr=`cat /proc/devices | grep 'i2c-8xx$'` ; then
X        set -- $mstr
X        i2c8xxm=$1
X        mknod -m ${perm} ${mdir}/mif-i2c-8xx c ${i2c8xxm} 0
X        local I2C_DEV="${mdir}/mif-i2c-8xx"
X    else
X        if [ -r /dev/i2c/0 ] ; then
X            rm -f ${mdir}/dev-i2c-8xx
X            ln -s /dev/i2c/0 ${mdir}/dev-i2c-8xx
X            I2C_DEV=${mdir}/dev-i2c-8xx
X        else
X            echo "8xx i2c driver not found"
X            return -1
X        fi
X    fi
X             
X
X    board_cs="2 5" ; A1=1 ; A2=1
X    
X    # Board auto detection & configuration
X    board=`${mbindir}/mdevices ${I2C_DEV} | sed -n 's/^.*--> \(MT[^ ]*\) .*$/\1/p'`
X    #echo "Board=[$board]"
X    case $board in
X        MT31000)        # Gazelle1
X        ;;
X        MT33000)        # Reindeer. Enable PPC Bus
X            i2c -a 0 ${I2C_DEV} w 0x77 0x00 0x90       # Open Swithch
X            tmp=0x`i2c -a 1 ${I2C_DEV} r 0x27 0x07`
X            tmp=`printf "0x%x" $(( tmp & 0xDF ))`
X            i2c -a 1 ${I2C_DEV} w 0x27 0x07 $tmp       # Set Direction
X            tmp=0x`i2c -a 1 ${I2C_DEV} r 0x27 0x03`
X            tmp=`printf "0x%x" $(( tmp & 0xDF ))`
X            i2c -a 1 ${I2C_DEV} w 0x27 0x03 $tmp       # Open PPC bus buffer
X            i2c -a 4 ${I2C_DEV} w 0x6C 0x60150 0x01    # Fix strapping bit
X            board_cs="2" ; A1=0
X        ;;
X        MT11020)        # Anafa2 EVB
X            i2c -a 4 -d 4 ${I2C_DEV} w 0x6C 0x60150 0x01    # Fix strapping bit
X            board_cs="2" ; A1=0
X    esac
X    #
X    # PPC DEVICES
X    # -----------
X    #
X    mstr=`cat /proc/devices | grep 'mst_ppc$'`
X    if [ $? -ne 0 ]; then
X        echo "mst_ppc driver not found"
X        return 1
X    fi
X    set -- $mstr
X    ppcm=$1
X    devn=0
X    for cs in $board_cs
X    do
X        if [ "$A1" == "1" ]; then
X            # Try Anafa-1
X            mknod -m ${perm} ${mdir}/mt43132_ppc$devn c ${ppcm} $devn
X            ${mbindir}/minit ${mdir}/mt43132_ppc$devn $cs
X            if [ $? -ne 0 ]; then
X                rm ${mdir}/mt43132_ppc$devn
X            else
X                real_devid=`mread ${mdir}/mt43132_ppc$devn 0x41c`
X                real_devid=${real_devid:22:4}
X#real_devid=$((  substr "$real_devid" 23 4 ))
X                if [ "$real_devid" != "a87c" ]; then
X                    ${mbindir}/mstop ${mdir}/mt43132_ppc$devn
X                    rm ${mdir}/mt43132_ppc$devn
X                else
X                    devn=$((  $devn + 1 ))
X                    continue
X                fi
X            fi
X        fi     
X        if [ "$A2" == "1" ]; then
X            # Try Anafa-2
X            mknod -m ${perm} ${mdir}/mt47396_ppc$devn c ${ppcm} $devn
X            ${mbindir}/minit ${mdir}/mt47396_ppc$devn $cs
X            if [ $? -ne 0 ]; then
X                rm ${mdir}/mt47396_ppc$devn
X            else
X                real_devid=`mread ${mdir}/mt47396_ppc$devn 0x60014`
X#real_devid=$((  substr "$real_devid" 23 4 ))
X                real_devid=${real_devid:22:4}
X                if [ "$real_devid" != "b924" ]; then
X                    ${mbindir}/mstop ${mdir}/mt47396_ppc$devn
X                    rm ${mdir}/mt47396_ppc$devn
X                else
X                    devn=$((  $devn + 1 ))
X                    continue
X                fi
X            fi
X        fi
X    done
X}
X
X# Main function
Xstart()
X{
X    echo "    Starting $prog: "
X
X    # Create empty MST devices directory
X    rm -fr ${mdir}
X    mkdir ${mdir}
X
X
X    #8xx start
X    if [ "$mstplat" == "8xx" ]; then
X            if [ -r ${modir}/i2c-8xx.o ]; then
X                action "Loading 8xx i2c modules" insmod ${insmod_flags} ${modir}/i2c-8xx.o
X            fi
X            action "Loading PPC CPU Bus modules" insmod ${insmod_flags} ${modir}/mst_ppc.o
X
X            create_devices_8xx "Create devices"
X            if [ $? -ne 0 ]; then
X                return 1
X            fi
X            return $?
X     fi
X
X    # Load all related modules
X    # action "Loading MST Info module" insmod ${insmod_flags} ${modir}/mst_info.o
X
X    action "Loading MST PCI module" insmod ${insmod_flags} ${modir}/mst_pci.o
X    action "Loading MST PCI configuration module" insmod ${insmod_flags} ${modir}/mst_pciconf.o
X    if  lsmod | grep mod_i2c > /dev/null
X    then
X        :
X    else
X        #Loading may fail if MDDK is in use
X        #action "Loading MDDK Calibre (I2C) module" insmod ${insmod_flags} ${modir}/mod_i2c.o card_base_address=0x310 card_i2c_address=0x44 card_ser_clock=0 use_syscall=1
X        insmod ${insmod_flags} ${modir}/mod_i2c.o card_base_address=0x310 card_i2c_address=0x44 card_ser_clock=0 use_syscall=1  > /dev/null 2>&1
X    fi
X    if [ -r ${modir}/mst_calbr.o ]; then
X      action "Loading MST Calibre (I2C) module" insmod ${insmod_flags} ${modir}/mst_calbr.o
X    fi
X    if uname -r | cut -c1-3 | grep -e "^2\.[6789]" -e "^3" > /dev/null; then
X        :
X    else
X      if [ -r ${modir}/ezusb2131.o ]; then
X          insmod ${insmod_flags} ${modir}/ezusb2131.o > /dev/null 2>&1
X      fi
X    fi
X
X    save_pci
X
X    # create all related devices
X    create_devices "Create devices"
X    if [ $? -ne 0 ]; then
X        return 1
X    fi
X
X    # Unload unused modules
X    if  ls ${mdir}| grep -e ${mpcuromdev} -e ${mbridgedev} -e ${mpciconfdev} \
X	    -e ${manafadev} \
X        -e ${marbeldev} -e ${marbeldev1} -e ${marbeldev2} -e ${marbeldev3} \
X	-e ${msinai4dev} -e ${msinai8dev} >/dev/null 2>&1
X    then
X        :
X    else
X        action "Unloading MST PCI configuration module (unused)" rmmod mst_pciconf
X    fi
X
X    if  ls ${mdir}| grep -e ${mpcuromdev} -e ${mpcidev} -e ${mgamladev}\
X	    -e ${manafadev} \
X		    -e ${marbeldev} -e ${marbeldev1} \
X		    -e ${marbeldev2} -e ${marbeldev3} \
X		    -e ${msinai4dev} -e ${msinai8dev} >/dev/null 2>&1
X    then
X        :
X    else
X        action "Unloading MST PCI module (unused)" rmmod mst_pci
X    fi
X
X    if [ ! -e ${mdir}/calibre ]; then
X       if grep "mst_calbr" /proc/modules; then
X          action "Unloading MST Calibre (I2C) module (unused)" rmmod mst_calbr
X          rmmod mod_i2c > /dev/null 2>&1     # It fails when MDDK is loaded
X       fi
X    fi
X    if [ ! -e ${mdir}/mtusb ]; then
X#Unloading seems to fail for some reason if a device is present
X#action "Unloading Ezusb2131 USB module (unused)" rmmod ezusb2131
X        rmmod ezusb2131 > /dev/null 2>&1
X    fi
X}
X
Xstop()
X{
X    echo "Stopping $prog"
X
X    serv_stop
X
X    for dev in ${mdir}/*
X    do
X        if [ -e "$dev" ]; then
X          ${mbindir}/mstop "$dev" >/dev/null 2>&1
X        fi
X    done
X
X    #if  lsmod | grep mst_info > /dev/null
X    #then
X    #    action "Unloading MST Info module" rmmod mst_info
X    #fi
X    if  lsmod | grep mst_pciconf > /dev/null
X    then
X        action "Unloading MST PCI configuration module" rmmod mst_pciconf
X    fi
X    if  lsmod | grep mst_pci | grep -v mst_pciconf> /dev/null
X    then
X        action "Unloading MST PCI module" rmmod mst_pci
X    fi
X    if lsmod | grep mst_calbr > /dev/null
X    then
X        action "Unloading MST Calibre (I2C) module" rmmod mst_calbr
X    fi
X    rmmod mod_i2c > /dev/null 2>&1     # It fails when MDDK is loaded
X
X    if  lsmod | grep ezusb2131  > /dev/null
X    then
X#Unloading seems to fail for some reason if a device is present
X        #action "Unloading Ezusb2131 USB module" rmmod ezusb2131
X        rmmod ezusb2131 > /dev/null 2>&1
X    fi
X
X    if lsmod | grep i2c-8xx > /dev/null
X    then
X         action "Unloading 8xx i2c driver" rmmod i2c-8xx
X    fi
X
X    if lsmod | grep ppc > /dev/null
X    then
X         action "Unloading 8xx ppc driver" rmmod mst_ppc
X    fi
X
X    rm -fr ${mdir}
X}
X
Xprint_chip_rev_internal()
X{
X    local val=`${mbindir}/mread $1 0xF0014`
X#local str=`expr substr "$val" 21 2`
X    local str=${val:20:2}
X    str=`echo $str | tr a-z A-Z`
X    echo "                                   Chip revision is: $str"
X}
X
Xprint_chip_rev()
X{
X    local dev=$1
X    if expr match "$dev" ".*_pci_cr" > /dev/null 2>&1
X    then
X        print_chip_rev_internal $dev
X    fi
X    if expr match "$dev" ".*_pciconf" > /dev/null 2>&1
X    then
X        print_chip_rev_internal $dev
X    fi
X}
X
Xprint_status()
X{
X    # Check modules
X    echo "MST modules:"
X    echo "------------"
X    if  lsmod | grep mst_pci | grep -v mst_pciconf > /dev/null
X    then
X        echo "    MST PCI module loaded"
X    else
X        echo "    MST PCI module is not loaded"
X    fi
X    if  lsmod | grep mst_pciconf > /dev/null
X    then
X        echo "    MST PCI configuration module loaded"
X    else
X        echo "    MST PCI configuration module is not loaded"
X    fi
X    if  lsmod | grep mst_calbr > /dev/null
X    then
X        echo "    MST Calibre (I2C) module loaded"
X    else
X        echo "    MST Calibre (I2C) module is not loaded"
X    fi
X
X    if  cat /proc/devices | grep i2c-8xx > /dev/null
X    then
X       echo  "    MST 8xx module loaded"
X    fi
X
X    if  cat /proc/devices | grep mst_ppc > /dev/null
X    then
X       echo  "    MST PPC Bus module loaded"
X    fi
X
X    # Devices
X    devcnt=0
X    rcnt=0
X    rdevs=""
X    echo
X    echo "MST devices:"
X    echo "------------"
X    for dev in ${mdir}/*
X    do
X        if [ -r "$dev" ]; then
X            if expr $dev : '.*:' > /dev/null 2>&1
X            then
X                rdevs=$rdevs" $dev"
X                rcnt=$((  $rcnt + 1 ))
X            elif expr match "$dev" ".*dev-i2c-8xx" > /dev/null 2>&1
X            then
X                    echo -e "$dev:\t- MPC8xx CPM I2C master"
X            elif expr match "$dev" ".*mif-i2c-8xx" > /dev/null 2>&1
X            then
X                    echo -e "$dev:\t- MPC860 Motorola I2C master"
X            elif expr match "$dev" ".*usb.*" > /dev/null 2>&1
X            then
X                    echo -e "$dev:\t- USB to I2C adapter as I2C master"
X            else
X                cat $dev
X                if expr match "$dev" ".*_pci_cr" > /dev/null 2>&1
X                then
X                    print_chip_rev $dev
X                fi
X                if expr match "$dev" ".*_pciconf" > /dev/null 2>&1
X                then
X                    print_chip_rev $dev
X                fi
X            fi
X            devcnt=$((  $devcnt + 1 ))
X        fi
X    done
X    if [ ${rcnt} -ne 0 ]; then
X        echo
X        echo "Remote MST devices:"
X        echo "-------------------"
X        for dev in $rdevs
X        do
X            echo $dev
X            print_chip_rev $dev
X        done
X    fi
X
X    if [ ${devcnt} -eq 0 ]; then
X        echo "    No MST devices found"
X    fi
X}
X
Xsave_pci()
X{
X    rm -fr $pcidir
X    mkdir -p $pcidir
X    lspci -m | grep Mellanox | while read str
X    do
X        bus=`echo $str | cut -c 1-2`
X        devfn=`echo $str | cut -c 4-7`
X        echo -n "Saving configuration for PCI device $bus:$devfn"
X        if cp /proc/bus/pci/$bus/$devfn $pcidir/$bus:$devfn
X        then
X            echo_success
X        else
X            echo_failure
X        fi
X        echo
X    done
X}
X
Xload_pci()
X{
X    lspci -m | grep Mellanox | while read str
X    do
X        bus=`echo $str | cut -c 1-2`
X        devfn=`echo $str | cut -c 4-7`
X        echo -n "Restore configuration for PCI device $bus:$devfn"
X        if cp $pcidir/$bus:$devfn /proc/bus/pci/$bus/$devfn
X        then
X            echo_success
X        else
X            echo_failure
X        fi
X        echo
X    done
X}
X
Xreset_pci()
X{
X    local orig_device=$1
X    local device=$1
X    local raddr
X
X    if [ ! -e $device ]; then
X        device="$mdir/$device"
X        if [ ! -e $device ]; then
X            echo "Device \"$orig_device\" (or \"$device\") doesn't exist"
X            return 1
X        fi
X    fi
X    if expr $device : '.*21108_pci' > /dev/null 2>&1
X    then
X        echo -n "Reset device $device (MT21108)"
X        raddr=0x3010
X    elif expr $device : '.*23108_pci'> /dev/null 2>&1
X    then
X        echo -n "Reset device $device (MT23108)"
X        raddr=0xf0010
X    elif expr $device : '.*25208_pci'> /dev/null 2>&1
X    then
X        echo -n "Reset device $device (MT25208)"
X        raddr=0xf0010
X    elif expr $device : '.*25218_pci'> /dev/null 2>&1
X    then
X        echo -n "Reset device $device (MT25218)"
X        raddr=0xf0010
X    elif expr $device : '.*25228_pci'> /dev/null 2>&1
X    then
X        echo -n "Reset device $device (MT25228)"
X        raddr=0xf0010
X    elif expr $device : '.*25238_pci'> /dev/null 2>&1
X    then
X        echo -n "Reset device $device (MT25238)"
X        raddr=0xf0010
X    elif expr $device : '.*24204_pci'> /dev/null 2>&1
X    then
X        echo -n "Reset device $device (MT24204)"
X        raddr=0xf0010
X    elif expr $device : '.*25204_pci'> /dev/null 2>&1
X    then
X        echo -n "Reset device $device (MT25204)"
X        raddr=0xf0010
X    else
X        echo "$device is a wrong device to reset"
X        return 1
X    fi
X    if ${mbindir}/mwrite $device $raddr 1
X    then
X        sleep 1
X        echo_success
X        echo
X        return 0
X    else
X        echo_failure
X        echo
X        return 1
X    fi
X}
X
Xradd()
X{
X    local host=$1
X    local port=23108
X    if expr $host : '.*:' > /dev/null 2>&1
X    then
X        set -- $(IFS=:; set -- $host; echo "$@")
X        host=$1
X        port=$2
X    fi
X    local devs=`${mbindir}/mremote $host:$port L`
X    for dev in $devs
X    do
X      if ! echo $dev | grep '@' > /dev/null 2>&1; then
X        local fname=${mdir}/$host:$port,`echo $dev | sed -e 's/\//@/g'`
X        #echo "$fname - Remote connection" > $fname
X        touch $fname
X      fi
X    done
X}
X
Xrdel()
X{
X    local host=$1
X    local port=23108
X    if expr $host : '.*:' > /dev/null 2>&1
X    then
X        set -- $(IFS=:; set -- $host; echo "$@")
X        host=$1
X        port=$2
X    fi
X    rm -f ${mdir}/$host:$port,*
X}
X
Xserv_start()
X{
X    local port=$1
X    ${mbindir}/mtserver -p $port &
X}
X
Xserv_stop()
X{
X    if [ "$mstplat" == "8xx" ]; then
X        killall mtserver > /dev/null 2>&1
X        return
X    fi        
X    ps -efa | grep ${mbindir}/mtserver | grep -v grep | while read str
X    do
X        set -- $str
X        kill $2
X    done
X}
X
X# See how we were called.
Xcase "$1" in
X    help)
X        cat <<END
X
X        MST (Mellanox Software Tools) service
X        =====================================
X
X   This script is used to start MST service, to stop it,
X   and for some other operations with Mellanox devices
X   like reset or enabling remote access.
X
X   The mst commands are:
X   -----------------------
X
X   mst start
X
X       Create special files that represent Mellanox devices in
X       directory ${mdir}. Load appropriate kernel modules and
X       saves PCI configuration headers in directory ${pcidir}.
X       After successfully completion of this command the MST driver
X       is ready to work and you can invoke other Mellanox
X       tools like Infiniburn or tdevmon.
X
X   mst stop
X
X       Stop Mellanox MST driver service, remove all special files/directories
X       and unload kernel modules.
X
X   mst restart
X
X       Just like "mst stop" followed by  "mst start"
X
X   mst server start [port]
X       Start MST server to allow incoming connection.
X       Default port is 23108
X
X   mst server stop
X       Stop MST server.
X
X   mst remote add <hostname>[:port]
X       Establish connection with specified host on specified port
X       (default port is 23108). Add devices on remote peer to local
X       devices list. <hostname> may be host name as well as an IP address.
X
X   mst remote del <hostname>[:port]
X       Remove all remote devices on specified hostname. <hostname>[:port] should
X       be specified exactly as in the "mst remote add" command.
X
X   mst status
X
X       Print current status of Mellanox devices
X
X   mst save
X
X       Save PCI configuration headers in directory ${pcidir}.
X       Invoked automatically by "mst start"
X
X   mst load
X
X        Load PCI configuration headers from directory ${pcidir}.
X        Invoked automatically by "mst reset"
X
X   mst reset <device_name>
X
X       Reset device <device_name> and then do "mst load".
X       For list of currently available Mellanox devices
X       type "ls ${mdir}" or "mst status". Note that it
X       may hang your device/computer when used inappropriately.
X
XEND
X        ;;
X    save)
X        if [ `id -u` -ne 0 ]; then
X            echo "You must be root to do that"
X            exit 1
X        fi
X        save_pci
X	;;
X    load)
X        if [ `id -u` -ne 0 ]; then
X            echo "You must be root to do that"
X            exit 1
X        fi
X        load_pci
X	;;
X    reset)
X        # We are expecting for device name
X        if [ $# -lt 2 ]; then
X            echo "Please specify device name"
X            devcnt=0
X            echo
X            echo "Available devices are:"
X            echo "----------------------"
X            echo
X            for dev in ${mdir}/*
X            do
X                if [ -r "$dev" ]; then
X                    if ! expr "$dev" : '.*\(vtop\|ddr\|uar\)' > /dev/null 2>&1
X                    then
X                        cat $dev | head -n 1
X                        devcnt=$((  $devcnt + 1 ))
X                    fi
X                fi
X            done
X            if [ ${devcnt} -eq 0 ]; then
X                echo "    Sorry, no available devices found."
X            fi
X            exit 1
X        fi
X
X        # Check that we are root
X        if [ `id -u` -ne 0 ]; then
X            echo "You must be root to do that"
X            exit 1
X        fi
X
X        if reset_pci $2
X        then
X            load_pci
X        else
X            exit 1
X        fi
X        ;;
X    server)
X        # We are expecting subsommand here
X        if [ $# -lt 2 ]; then
X            echo "Please specify subcommand (start or stop)"
X            exit 1
X        fi
X        case "$2" in
X            start)
X                cat /proc/devices | grep 'mst' > /dev/null
X                if [ $? -ne 0 ]; then
X                    mst start || exit 1
X                fi
X
X                if [ $# -lt 3 ]; then
X                    serv_start 23108
X                else
X                    serv_start $3
X                fi
X            ;;
X            stop)
X                serv_stop
X            ;;
X            *)
X                echo "Subcommand should be start or stop"
X            ;;
X        esac
X        ;;
X    remote)
X        # We are expecting command and host name
X        if [ $# -lt 3 ]; then
X            echo "Please specify subcommand (add or del) and remote host name or its IP address"
X            exit 1
X        fi
X        case "$2" in
X            add)
X                radd $3
X            ;;
X            del)
X                rdel $3
X            ;;
X            *)
X                echo "Subcommand should be add or del"
X            ;;
X        esac
X	;;
X    start)
X        if [ `id -u` -ne 0 ]; then
X            echo "You must be root to do that"
X            exit 1
X        fi
X        start
X	;;
X    stop)
X        if [ `id -u` -ne 0 ]; then
X            echo "You must be root to do that"
X            exit 1
X        fi
X	stop
X        rm -fr $pcidir
X	;;
X    status)
X	print_status
X	;;
X    restart)
X        if [ `id -u` -ne 0 ]; then
X            echo "You must be root to do that"
X            exit 1
X        fi
X        stop
X        start
X	;;
X    *)
X        echo "Usage:"
X        echo "    $0 {start|stop|status|remote|server|restart|save|load|reset|help}"
X        echo
X        echo "Type \"$0 help\" for detailed help"
X	RETVAL=1
Xesac
Xexit $RETVAL
SHAR_EOF
  : || $echo 'restore of' 'mst' 'failed'
fi
# ============= Makefile ==============
if test -f 'Makefile' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'Makefile' '(file already exists)'
else
  $echo 'x -' extracting 'Makefile' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'Makefile' &&
Xifndef KPVER
XKPVER := $(shell uname -r)
Xendif
XTKPVER26 := $(findstring 2.6,$(KPVER))
X#TKPVER26 := $(strip $(shell echo $KPVER|cut -c1-3|grep "2\.[6789]"))
XPWD=`pwd`
Xifndef MST_CPU
XMST_CPU   := $(shell uname -m)
Xendif
X
X#mst_devasys.o
Xifneq (${MST_CPU},ppc_8xx)
Xall: mst_pci.o mst_pciconf.o
Xendif
X
Xall: libmtcr.a \
X     minit mstop mread mwrite mtserver mremote mdevices
X
Xifeq (${TKPVER26},)
Xall: mst_calbr.o mod_i2c.o
X.IGNORE: mst_calbr.o mod_i2c.o
Xendif
X
Xifneq (${MST_NO_USB},1)
Xall: buildusb
X#all: ezusb
Xendif
X
Xifeq (${MST_CPU},ppc_8xx)
XVPATH += ppc_utils/
Xall: mst_ppc.o mppctest i2c_8xx
X ifeq (${KPVER},2.4.18)
X all: i2c-8xx.o         # New kernels have buildin CPM i2c driver 
X endif    
XMST_DISTFILES += ppc_utils/mppctest.c
Xelse 
Xall: dimax_init mtusb-1_test
Xendif
X
X
X#all: c-mif-gen.o
X
X
X#all: usbioctl
XSMP = $(shell if uname -a | grep SMP > /dev/null; then echo -D__SMP__; fi)
Xexport SMP
X
X#Old pci way is to check size by writing to BARs.
X# This is best avoided if possible.
Xifeq (${MST_CPU},ppc_8xx)
XOLD_PCI_DEF = $(shell if [ "`uname -m`" = "ppc" ]; then echo -DOLD_PCI_METHOD; else echo ""; fi)
Xexport OLD_PCI_DEF
Xendif
X
XMODFL += $(SMP) $(OLD_PCI_DEF)
Xmst_calbr.o: MODFL += -I.
Xmod_i2c.o:   MODFL +=-I.  -DEXPORT_SYMTAB
X
Xprefix = ${ROOTDIR}/usr/mst
X
XCC    = $(CROSS_COMPILE)gcc
XLD    = $(CROSS_COMPILE)ld
XAR    = $(CROSS_COMPILE)ar
X
X#changes for kernel 2.6+
XMODFL += -fno-strict-aliasing -I/lib/modules/$(KPVER)/build/include/asm/mach-default/
X
Xifdef USE_IB_MGT
X#
X### Build with IB_MGT library
XCFLAGS += -DMST_CPU_$(MST_CPU) -DUSE_IB_MGT -DMIB_DEBUG -MD -g -O2 -Wall -Werror -I. -I/usr/mellanox/include
XLDFLAGS += -lmtl_common -lmosal -lpthread -lib_mgt -L/usr/mellanox/lib
X#
Xelse
X#
X### Regular build
XCFLAGS += -DMST_CPU_$(MST_CPU) -MD -g -O2 -Wall -Werror -I.
X#
Xendif
X
Xifdef PLATINC
XCFLAGS += -I${PLATINC}
Xendif
X
XCFLAGS+=-idirafter compat
XMODFL+=-idirafter compat
X
Xifeq ($(MST_CPU),x86_64)
XCFLAGS += -fPIC
XMODFL += -mcmodel=kernel
XMODFL += -mno-red-zone
Xendif
X
Xifeq (${MST_CPU},ppc_8xx)
XCFLAGS += -DENABLE_MST_DEV_I2C
Xendif
X
XMODFL += -MD -g -D__KERNEL__ -DMODULE -D__LINUX__ -DMST_CPU_${MST_CPU} \
X	-Wall -Wstrict-prototypes                                  \
X	-I$(KINCPATH)                                                \
X	-fomit-frame-pointer -fno-strength-reduce   \
X	-pipe  -O2 -Wno-unused
X
X#special case removes -Werror due to unused vars in system includes in ia64, RH AS 3.0 2.4.21-4.EL
Xifneq (ia64,${MST_CPU})
X  MODFL += -Werror
Xelse
X  ifneq "$(shell cat /etc/redhat-release 2> /dev/null | grep Taroon | sed -e 's/.*Taroon/Taroon/' | sed -e 's/Taroon.*/Taroon/')" "Taroon"
X    MODFL += -Werror
X  endif 
Xendif
X
Xifndef KINCPATH
XKINCPATH1 = /lib/modules/$(KPVER)/build/include
XKINCPATH2 = /usr/src/linux/include
XKINCPATH3 = /usr/src/linux-$(KPVER)/include
X
XKINCPATH = $(firstword $(foreach path, ${KINCPATH0} ${KINCPATH1} ${KINCPATH2} ${KINCPATH3},$(shell if test -e "${path}"; then echo "${path}"; fi)))
X
X
Xifeq ($(strip $(KINCPATH)),)
Xdefine err_message
X Linux kernels source headers which are required for MST installation
X were not detected in any of the following directories:
X ${KINCPATH0}
X ${KINCPATH1}
X ${KINCPATH2}
X ${KINCPATH3}
X
X Please install the kernel source headers in one of these directories
X or point the environment variable KINCPATH0 to the directory
X where these headers can be found.
X
X Kernel source for RedHat 7.2 can be found in the following RPM
X on RedHat CDROM 2:
X    /mnt/cdrom/RedHat/RPMS/kernel-source-2.4.7-10.i386.rpm
X
Xendef
X
X$(error $(err_message))
Xendif
Xendif
X
X
Xifndef BINDKERNEL
Xmod_versions_exists=$(shell if test -e $(KINCPATH)/linux/modversions.h ; then echo 1; fi)
Xifneq ($(mod_versions_exists),)
XMODFL += -DMODVERSIONS -include $(KINCPATH)/linux/modversions.h
Xexport MODVERSIONS = -DMODVERSIONS
Xendif
Xendif
X
Xrhconfig_exists=$(shell if test -e $(KINCPATH)/linux/rhconfig.h ; then echo 1; fi)
Xifneq ($(rhconfig_exists),)
XMODFL += -include $(KINCPATH)/linux/rhconfig.h
Xendif
X
XMODLD += -r
X
X#Hack for Eli's old I2C module
Xmod_%.o:	mod_%.c
X		$(CC) -DKBUILD_MODNAME=$(@:.o=) -c $(MODFL) -o $@ $<
X
X#mst_info_mod.o:	mst_info_mod.c
X#		$(CC) -DKBUILD_MODNAME=$(@:_mod.o=) -c $(MODFL) -o $@ $<
X
Xifeq (${TKPVER26},)
X%_mod.o:	%_mod.c
X		$(CC) -DKBUILD_MODNAME=$(@:_mod.o=) -c $(MODFL) -o $@ $<
Xendif
X
X%.o:		%.c
X		$(CC) $(CFLAGS) -c -o $@ $<
X
Xifeq (${TKPVER26},)
X%.o:	%_mod.o driver_common.c
X	$(LD) $(MODLD) -o $@ $<
Xelse
X%.o:	%_mod.c driver_common.c
X	make -C $(dir $(KINCPATH)) SUBDIRS=${PWD}/build2.6 mst_module:=$@ modules
X	cp -f build2.6/$(@:.o=.ko) $@
Xendif
X
Xm%: m%.o
X	$(CC) $(LDFLAGS) -o $@ $^
X
Xlib%.a: %.o
X	$(AR) cr $@ $^
X
Xmtcr.o: usbdescriptor.h
Xdimax_init.o: usbdescriptor.h
X
Xlibmtcr.a: mtcr.o mtcr_ib.o mtcr_i2c.o usbioctl.o
Xlibmtcr.a dimax_init: CFLAGS += -Wno-error
X
Xmremote: mremote.o tcp.o
X
Xmread: mread.o libmtcr.a
X
Xmwrite:	mwrite.o libmtcr.a
X
Xmdevices: mdevices.o libmtcr.a
X
Xmtusb-1_test: mtusb-1_test.o libmtcr.a
X	$(CC) $(LDFLAGS) -o $@ $^
X
Xmtserver: mtserver.o tcp.o libmtcr.a
X
Xifeq (${MST_CPU},ppc_8xx)
Xmppctest: mppctest.o libmtcr.a
Xendif
X
Xbuildusb: ./libusb-0.1.8/tests/testlibusb ./fxload-2002_04_11/fxload
X
X./libusb-0.1.8/tests/testlibusb:
X	-(cd libusb-0.1.8; sh ./configure --prefix=${prefix}; make)
X
X./fxload-2002_04_11/fxload:
X	-(make -C fxload-2002_04_11 prefix=${prefix})
X
Xezusb:
X	-(cd Ezusb2131; ${MAKE} INCLUDEDIR=${KINCPATH})
X
X#usbioctl: CFLAGS+=-DMAIN
X#usbioctl: ioctl.c
X
X%: %.c
X	$(CC) $(CFLAGS) -o $@ $<
X%: %.o
X	$(LD) $(LDFLAGS) -o $@ $<
X
Xclean:
X	rm -f *.o *.a *.d Ezusb2131/*.o minit mread mwrite mstop usbioctl mremote mtserver mdevices drvinstall dimax_init mtusb-1_test
X	rm -rf *.ko build2.6/*.ko build2.6/*.o build2.6/*.o.cmd build2.6/.*.*o.cmd build2.6/.tmp_versions/ build2.6/*.c
Xifneq (${MST_CPU},ppc_8xx)
X	make -C libusb-0.1.8 clean
X	make -C fxload-2002_04_11 clean
X	#rm -f $(filter-out Makefile CVS,$(shell ls build2.6))
Xendif
Xifneq ($(strip $(wildcard *.d)),)
X-include *.d
Xendif
X
Xprint:
X	@echo '${${VAR}}'
X
X
Xinstall:
X	mkdir -p ${prefix}/lib/${KPVER}
X	mkdir -p ${prefix}/bin
X	mkdir -p ${prefix}/include
Xifneq (${MST_CPU},ppc_8xx)
X	install -m 644 mst_pci.o mst_pciconf.o \
X	           ${prefix}/lib/${KPVER}
X	if test -e ./mst_calbr.o ; then \
X		install -m 644 mst_calbr.o ${prefix}/lib/${KPVER}; \
X	fi
X	if test -e ./mod_i2c.o ; then \
X		install -m 644 mod_i2c.o ${prefix}/lib/${KPVER}; \
X	fi
X	mkdir -p ${prefix}/etc
X	install -m 644 ezusb_fw/0abf03e8_6.hex ${prefix}/etc
X	mkdir -p ${prefix}/bin
X	install -m 755 minit dimax_init mtusb-1_test mstop mread mwrite mremote mtserver ${prefix}/bin
X	install -m 644 mtcr.h mtcr_ib_private.h ${prefix}/include
X	install -m 644 libmtcr.a ${prefix}/lib
X	rm -f ${ROOTDIR}/etc/init.d/mst
X	install -m 755 mst ${ROOTDIR}/etc/init.d
X#	install  mst_info.o ${prefix}/lib/${KPVER}
Xelse
X ifeq (${KPVER},2.4.18)
X	install -m 644 -D i2c-8xx.o ${prefix}/lib/${KPVER}/i2c-8xx.o
X endif
X	install -m 644 -D mst_ppc.o ${prefix}/lib/${KPVER}/mst_ppc.o
X	install -m 755 minit mstop mread mwrite mremote mtserver mdevices ${prefix}/bin
X	install -m 644 mtcr.h mtcr_ib_private.h ${prefix}/include
X	install -m 644 libmtcr.a ${prefix}/lib
X	rm -f ${ROOTDIR}/etc/init.d/mst
X	install -m 755 mst ${ROOTDIR}/etc/init.d
Xendif
X	rm -f ${ROOTDIR}/usr/bin/mst
X	ln -s ${ROOTDIR}/etc/init.d/mst ${ROOTDIR}/usr/bin/mst
X	touch ${ROOTDIR}/etc/mst.conf
Xifneq (${MST_CPU},ppc_8xx)
X	if test -e ./libusb-0.1.8/tests/.libs/testlibusb; then \
X	  make -C libusb-0.1.8 install; \
X	fi
X	if test -e ./libusb-0.1.8/tests/.libs/testlibusb; then \
X	  mkdir -p ${prefix}/bin; \
X	  install -m 755 ./libusb-0.1.8/tests/.libs/testlibusb ${prefix}/bin/listusb; \
X	fi
X	if test -e ./fxload-2002_04_11/fxload; then \
X	  make -C fxload-2002_04_11 prefix=${prefix} install; \
X	fi
Xendif
X
X
X
Xmakedist: dist
Xmakedist: MST_CPU_VALUE=$(MST_CPU)
Xmakedist: MST_NO_USB_VALUE=$(MST_NO_USB)
X
Xdist:
X	cat install.sh | sed -e 's/MST_CPU_VALUE/$(MST_CPU_VALUE)/' | sed -e 's/MST_NO_USB_VALUE/$(MST_NO_USB_VALUE)/' | sed -e 's/BUILD_ID_VALUE/$(BUILD_ID)/' > drvinstall
X	shar -V *.c *.h mst Makefile \
X		   ${MST_DISTFILES}       \
X       compat/linux/usb_ch9.h \
X       compat/linux/syscalls.h \
X       compat/asm/ioctl32.h \
X       ezusb_fw/0abf03e8_6.hex \
X       libusb-0.1.8/AUTHORS\
X       libusb-0.1.8/COPYING\
X       libusb-0.1.8/ChangeLog\
X       libusb-0.1.8/INSTALL.libusb\
X       libusb-0.1.8/INSTALL.libusb.in\
X       libusb-0.1.8/LICENSE\
X       libusb-0.1.8/Makefile.am\
X       libusb-0.1.8/Makefile.in\
X       libusb-0.1.8/NEWS\
X       libusb-0.1.8/README\
X       libusb-0.1.8/README.in\
X       libusb-0.1.8/aclocal.m4\
X       libusb-0.1.8/bsd.c\
X       libusb-0.1.8/config.guess\
X       libusb-0.1.8/config.h.in\
X       libusb-0.1.8/config.sub\
X       libusb-0.1.8/configure\
X       libusb-0.1.8/configure.in\
X       libusb-0.1.8/darwin.c\
X       libusb-0.1.8/depcomp\
X       libusb-0.1.8/descriptors.c\
X       libusb-0.1.8/error.c\
X       libusb-0.1.8/error.h\
X       libusb-0.1.8/install-sh\
X       libusb-0.1.8/libusb-config.in\
X       libusb-0.1.8/libusb.spec\
X       libusb-0.1.8/libusb.spec.in\
X       libusb-0.1.8/linux.c\
X       libusb-0.1.8/linux.h\
X       libusb-0.1.8/ltmain.sh\
X       libusb-0.1.8/missing\
X       libusb-0.1.8/mkinstalldirs\
X       libusb-0.1.8/usb.c\
X       libusb-0.1.8/usb.h.in\
X       libusb-0.1.8/usbi.h\
X       libusb-0.1.8/doc/Makefile.am\
X       libusb-0.1.8/doc/Makefile.in\
X       libusb-0.1.8/doc/api.sgml\
X       libusb-0.1.8/doc/examples.sgml\
X       libusb-0.1.8/doc/functions.sgml\
X       libusb-0.1.8/doc/intro.sgml\
X       libusb-0.1.8/doc/manual.sgml\
X       libusb-0.1.8/doc/website.dsl\
X       libusb-0.1.8/tests/Makefile.am\
X       libusb-0.1.8/tests/Makefile.in\
X       libusb-0.1.8/tests/testlibusb.c\
X       fxload-2002_04_11/COPYING\
X       fxload-2002_04_11/*.c\
X       fxload-2002_04_11/*.h\
X       fxload-2002_04_11/Makefile\
X       fxload-2002_04_11/README.txt\
X       fxload-2002_04_11/fxload.8\
X       fxload-2002_04_11/a3load.hex\
X                Device-mtcr/Changes \
X                Device-mtcr/LICENSE \
X                Device-mtcr/MANIFEST \
X                Device-mtcr/Makefile.PL \
X                Device-mtcr/README \
X                Device-mtcr/mtcr.h \
X                Device-mtcr/mtcr.pm \
X                Device-mtcr/mtcr.xs \
X                Device-mtcr/test.pl \
X                build2.6/Makefile \
X         >> drvinstall
X	chmod 755 drvinstall
X
X#dist makedist:
X#	cat install.sh | sed -e 's/MST_CPU_VALUE/$(MST_CPU)/' | sed -e 's/MST_NO_USB_VALUE/$(MST_NO_USB)/' > drvinstall
X#	shar -V *.c *.h mst Makefile \
X#	     Ezusb2131/Makefile Ezusb2131/ezusb2131.c \
X#	     Ezusb2131/Examples/*.hex \
X#                Device-mtcr/Changes \
X#                Device-mtcr/LICENSE \
X#                Device-mtcr/MANIFEST \
X#                Device-mtcr/Makefile.PL \
X#                Device-mtcr/README \
X#                Device-mtcr/mtcr.h \
X#                Device-mtcr/mtcr.pm \
X#                Device-mtcr/mtcr.xs \
X#                Device-mtcr/test.pl \
X#                build2.6/Makefile \
X#         >> drvinstall
X#	chmod 755 drvinstall
SHAR_EOF
  : || $echo 'restore of' 'Makefile' 'failed'
fi
# ============= compat/linux/usb_ch9.h ==============
if test ! -d 'compat'; then
  $echo $echo_n 'x -' 'compat: '$echo_c
  if mkdir 'compat'; then $echo 'created'; else $echo 'failed to create'; fi
fi
if test ! -d 'compat/linux'; then
  $echo $echo_n 'x -' 'compat/linux: '$echo_c
  if mkdir 'compat/linux'; then $echo 'created'; else $echo 'failed to create'; fi
fi
if test -f 'compat/linux/usb_ch9.h' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'compat/linux/usb_ch9.h' '(file already exists)'
else
  $echo 'x -' extracting 'compat/linux/usb_ch9.h' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'compat/linux/usb_ch9.h' &&
X/* Copied from linux 2.6.7 */
X/*
X * This file holds USB constants and structures that are needed for USB
X * device APIs.  These are used by the USB device model, which is defined
X * in chapter 9 of the USB 2.0 specification.  Linux has several APIs in C
X * that need these:
X *
X * - the master/host side Linux-USB kernel driver API;
X * - the "usbfs" user space API; and
X * - (eventually) a Linux "gadget" slave/device side driver API.
X *
X * USB 2.0 adds an additional "On The Go" (OTG) mode, which lets systems
X * act either as a USB master/host or as a USB slave/device.  That means
X * the master and slave side APIs will benefit from working well together.
X */
X
X#ifndef __LINUX_USB_CH9_H
X#define __LINUX_USB_CH9_H
X
X#include <asm/types.h>		/* __u8 etc */
X
X/*-------------------------------------------------------------------------*/
X
X/* CONTROL REQUEST SUPPORT */
X
X/*
X * USB directions
X *
X * This bit flag is used in endpoint descriptors' bEndpointAddress field.
X * It's also one of three fields in control requests bRequestType.
X */
X#define USB_DIR_OUT			0		/* to device */
X#define USB_DIR_IN			0x80		/* to host */
X
X/*
X * USB types, the second of three bRequestType fields
X */
X#define USB_TYPE_MASK			(0x03 << 5)
X#define USB_TYPE_STANDARD		(0x00 << 5)
X#define USB_TYPE_CLASS			(0x01 << 5)
X#define USB_TYPE_VENDOR			(0x02 << 5)
X#define USB_TYPE_RESERVED		(0x03 << 5)
X
X/*
X * USB recipients, the third of three bRequestType fields
X */
X#define USB_RECIP_MASK			0x1f
X#define USB_RECIP_DEVICE		0x00
X#define USB_RECIP_INTERFACE		0x01
X#define USB_RECIP_ENDPOINT		0x02
X#define USB_RECIP_OTHER			0x03
X
X/*
X * Standard requests, for the bRequest field of a SETUP packet.
X *
X * These are qualified by the bRequestType field, so that for example
X * TYPE_CLASS or TYPE_VENDOR specific feature flags could be retrieved
X * by a GET_STATUS request.
X */
X#define USB_REQ_GET_STATUS		0x00
X#define USB_REQ_CLEAR_FEATURE		0x01
X#define USB_REQ_SET_FEATURE		0x03
X#define USB_REQ_SET_ADDRESS		0x05
X#define USB_REQ_GET_DESCRIPTOR		0x06
X#define USB_REQ_SET_DESCRIPTOR		0x07
X#define USB_REQ_GET_CONFIGURATION	0x08
X#define USB_REQ_SET_CONFIGURATION	0x09
X#define USB_REQ_GET_INTERFACE		0x0A
X#define USB_REQ_SET_INTERFACE		0x0B
X#define USB_REQ_SYNCH_FRAME		0x0C
X
X/*
X * USB feature flags are written using USB_REQ_{CLEAR,SET}_FEATURE, and
X * are read as a bit array returned by USB_REQ_GET_STATUS.  (So there
X * are at most sixteen features of each type.)
X */
X#define USB_DEVICE_SELF_POWERED		0	/* (read only) */
X#define USB_DEVICE_REMOTE_WAKEUP	1	/* dev may initiate wakeup */
X#define USB_DEVICE_TEST_MODE		2	/* (high speed only) */
X#define USB_DEVICE_B_HNP_ENABLE		3	/* dev may initiate HNP */
X#define USB_DEVICE_A_HNP_SUPPORT	4	/* RH port supports HNP */
X#define USB_DEVICE_A_ALT_HNP_SUPPORT	5	/* other RH port does */
X
X#define USB_ENDPOINT_HALT		0	/* IN/OUT will STALL */
X
X
X/**
X * struct usb_ctrlrequest - SETUP data for a USB device control request
X * @bRequestType: matches the USB bmRequestType field
X * @bRequest: matches the USB bRequest field
X * @wValue: matches the USB wValue field (le16 byte order)
X * @wIndex: matches the USB wIndex field (le16 byte order)
X * @wLength: matches the USB wLength field (le16 byte order)
X *
X * This structure is used to send control requests to a USB device.  It matches
X * the different fields of the USB 2.0 Spec section 9.3, table 9-2.  See the
X * USB spec for a fuller description of the different fields, and what they are
X * used for.
X *
X * Note that the driver for any interface can issue control requests.
X * For most devices, interfaces don't coordinate with each other, so
X * such requests may be made at any time.
X */
Xstruct usb_ctrlrequest {
X	__u8 bRequestType;
X	__u8 bRequest;
X	__u16 wValue;
X	__u16 wIndex;
X	__u16 wLength;
X} __attribute__ ((packed));
X
X/*-------------------------------------------------------------------------*/
X
X/*
X * STANDARD DESCRIPTORS ... as returned by GET_DESCRIPTOR, or
X * (rarely) accepted by SET_DESCRIPTOR.
X *
X * Note that all multi-byte values here are encoded in little endian
X * byte order "on the wire".  But when exposed through Linux-USB APIs,
X * they've been converted to cpu byte order.
X */
X
X/*
X * Descriptor types ... USB 2.0 spec table 9.5
X */
X#define USB_DT_DEVICE			0x01
X#define USB_DT_CONFIG			0x02
X#define USB_DT_STRING			0x03
X#define USB_DT_INTERFACE		0x04
X#define USB_DT_ENDPOINT			0x05
X#define USB_DT_DEVICE_QUALIFIER		0x06
X#define USB_DT_OTHER_SPEED_CONFIG	0x07
X#define USB_DT_INTERFACE_POWER		0x08
X/* these are from a minor usb 2.0 revision (ECN) */
X#define USB_DT_OTG			0x09
X#define USB_DT_DEBUG			0x0a
X#define USB_DT_INTERFACE_ASSOCIATION	0x0b
X
X/* conventional codes for class-specific descriptors */
X#define USB_DT_CS_DEVICE		0x21
X#define USB_DT_CS_CONFIG		0x22
X#define USB_DT_CS_STRING		0x23
X#define USB_DT_CS_INTERFACE		0x24
X#define USB_DT_CS_ENDPOINT		0x25
X
X/* All standard descriptors have these 2 fields at the beginning */
Xstruct usb_descriptor_header {
X	__u8  bLength;
X	__u8  bDescriptorType;
X} __attribute__ ((packed));
X
X
X/*-------------------------------------------------------------------------*/
X
X/* USB_DT_DEVICE: Device descriptor */
Xstruct usb_device_descriptor {
X	__u8  bLength;
X	__u8  bDescriptorType;
X
X	__u16 bcdUSB;
X	__u8  bDeviceClass;
X	__u8  bDeviceSubClass;
X	__u8  bDeviceProtocol;
X	__u8  bMaxPacketSize0;
X	__u16 idVendor;
X	__u16 idProduct;
X	__u16 bcdDevice;
X	__u8  iManufacturer;
X	__u8  iProduct;
X	__u8  iSerialNumber;
X	__u8  bNumConfigurations;
X} __attribute__ ((packed));
X
X#define USB_DT_DEVICE_SIZE		18
X
X
X/*
X * Device and/or Interface Class codes
X * as found in bDeviceClass or bInterfaceClass
X * and defined by www.usb.org documents
X */
X#define USB_CLASS_PER_INTERFACE		0	/* for DeviceClass */
X#define USB_CLASS_AUDIO			1
X#define USB_CLASS_COMM			2
X#define USB_CLASS_HID			3
X#define USB_CLASS_PHYSICAL		5
X#define USB_CLASS_STILL_IMAGE		6
X#define USB_CLASS_PRINTER		7
X#define USB_CLASS_MASS_STORAGE		8
X#define USB_CLASS_HUB			9
X#define USB_CLASS_CDC_DATA		0x0a
X#define USB_CLASS_CSCID			0x0b	/* chip+ smart card */
X#define USB_CLASS_CONTENT_SEC		0x0d	/* content security */
X#define USB_CLASS_VIDEO			0x0e
X#define USB_CLASS_APP_SPEC		0xfe
X#define USB_CLASS_VENDOR_SPEC		0xff
X
X/*-------------------------------------------------------------------------*/
X
X/* USB_DT_CONFIG: Configuration descriptor information.
X *
X * USB_DT_OTHER_SPEED_CONFIG is the same descriptor, except that the
X * descriptor type is different.  Highspeed-capable devices can look
X * different depending on what speed they're currently running.  Only
X * devices with a USB_DT_DEVICE_QUALIFIER have any OTHER_SPEED_CONFIG
X * descriptors.
X */
Xstruct usb_config_descriptor {
X	__u8  bLength;
X	__u8  bDescriptorType;
X
X	__u16 wTotalLength;
X	__u8  bNumInterfaces;
X	__u8  bConfigurationValue;
X	__u8  iConfiguration;
X	__u8  bmAttributes;
X	__u8  bMaxPower;
X} __attribute__ ((packed));
X
X#define USB_DT_CONFIG_SIZE		9
X
X/* from config descriptor bmAttributes */
X#define USB_CONFIG_ATT_ONE		(1 << 7)	/* must be set */
X#define USB_CONFIG_ATT_SELFPOWER	(1 << 6)	/* self powered */
X#define USB_CONFIG_ATT_WAKEUP		(1 << 5)	/* can wakeup */
X
X/*-------------------------------------------------------------------------*/
X
X/* USB_DT_STRING: String descriptor */
Xstruct usb_string_descriptor {
X	__u8  bLength;
X	__u8  bDescriptorType;
X
X	__u16 wData[1];		/* UTF-16LE encoded */
X} __attribute__ ((packed));
X
X/* note that "string" zero is special, it holds language codes that
X * the device supports, not Unicode characters.
X */
X
X/*-------------------------------------------------------------------------*/
X
X/* USB_DT_INTERFACE: Interface descriptor */
Xstruct usb_interface_descriptor {
X	__u8  bLength;
X	__u8  bDescriptorType;
X
X	__u8  bInterfaceNumber;
X	__u8  bAlternateSetting;
X	__u8  bNumEndpoints;
X	__u8  bInterfaceClass;
X	__u8  bInterfaceSubClass;
X	__u8  bInterfaceProtocol;
X	__u8  iInterface;
X} __attribute__ ((packed));
X
X#define USB_DT_INTERFACE_SIZE		9
X
X/*-------------------------------------------------------------------------*/
X
X/* USB_DT_ENDPOINT: Endpoint descriptor */
Xstruct usb_endpoint_descriptor {
X	__u8  bLength;
X	__u8  bDescriptorType;
X
X	__u8  bEndpointAddress;
X	__u8  bmAttributes;
X	__u16 wMaxPacketSize;
X	__u8  bInterval;
X
X	// NOTE:  these two are _only_ in audio endpoints.
X	// use USB_DT_ENDPOINT*_SIZE in bLength, not sizeof.
X	__u8  bRefresh;
X	__u8  bSynchAddress;
X} __attribute__ ((packed));
X
X#define USB_DT_ENDPOINT_SIZE		7
X#define USB_DT_ENDPOINT_AUDIO_SIZE	9	/* Audio extension */
X
X
X/*
X * Endpoints
X */
X#define USB_ENDPOINT_NUMBER_MASK	0x0f	/* in bEndpointAddress */
X#define USB_ENDPOINT_DIR_MASK		0x80
X
X#define USB_ENDPOINT_XFERTYPE_MASK	0x03	/* in bmAttributes */
X#define USB_ENDPOINT_XFER_CONTROL	0
X#define USB_ENDPOINT_XFER_ISOC		1
X#define USB_ENDPOINT_XFER_BULK		2
X#define USB_ENDPOINT_XFER_INT		3
X
X
X/*-------------------------------------------------------------------------*/
X
X/* USB_DT_DEVICE_QUALIFIER: Device Qualifier descriptor */
Xstruct usb_qualifier_descriptor {
X	__u8  bLength;
X	__u8  bDescriptorType;
X
X	__u16 bcdUSB;
X	__u8  bDeviceClass;
X	__u8  bDeviceSubClass;
X	__u8  bDeviceProtocol;
X	__u8  bMaxPacketSize0;
X	__u8  bNumConfigurations;
X	__u8  bRESERVED;
X} __attribute__ ((packed));
X
X
X/*-------------------------------------------------------------------------*/
X
X/* USB_DT_OTG (from OTG 1.0a supplement) */
Xstruct usb_otg_descriptor {
X	__u8  bLength;
X	__u8  bDescriptorType;
X
X	__u8  bmAttributes;	/* support for HNP, SRP, etc */
X} __attribute__ ((packed));
X
X/* from usb_otg_descriptor.bmAttributes */
X#define USB_OTG_SRP		(1 << 0)
X#define USB_OTG_HNP		(1 << 1)	/* swap host/device roles */
X
X/*-------------------------------------------------------------------------*/
X
X/* USB_DT_INTERFACE_ASSOCIATION: groups interfaces */
Xstruct usb_interface_assoc_descriptor {
X	__u8  bLength;
X	__u8  bDescriptorType;
X
X	__u8  bFirstInterface;
X	__u8  bInterfaceCount;
X	__u8  bFunctionClass;
X	__u8  bFunctionSubClass;
X	__u8  bFunctionProtocol;
X	__u8  iFunction;
X} __attribute__ ((packed));
X
X
X/*-------------------------------------------------------------------------*/
X
X/* USB 2.0 defines three speeds, here's how Linux identifies them */
X
Xenum usb_device_speed {
X	USB_SPEED_UNKNOWN = 0,			/* enumerating */
X	USB_SPEED_LOW, USB_SPEED_FULL,		/* usb 1.1 */
X	USB_SPEED_HIGH				/* usb 2.0 */
X};
X
Xenum usb_device_state {
X	/* NOTATTACHED isn't in the USB spec, and this state acts
X	 * the same as ATTACHED ... but it's clearer this way.
X	 */
X	USB_STATE_NOTATTACHED = 0,
X
X	/* the chapter 9 device states */
X	USB_STATE_ATTACHED,
X	USB_STATE_POWERED,
X	USB_STATE_DEFAULT,			/* limited function */
X	USB_STATE_ADDRESS,
X	USB_STATE_CONFIGURED,			/* most functions */
X
X	USB_STATE_SUSPENDED
X
X	/* NOTE:  there are actually four different SUSPENDED
X	 * states, returning to POWERED, DEFAULT, ADDRESS, or
X	 * CONFIGURED respectively when SOF tokens flow again.
X	 */
X};
X
X#endif	/* __LINUX_USB_CH9_H */
SHAR_EOF
  : || $echo 'restore of' 'compat/linux/usb_ch9.h' 'failed'
fi
# ============= compat/linux/syscalls.h ==============
if test -f 'compat/linux/syscalls.h' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'compat/linux/syscalls.h' '(file already exists)'
else
  $echo 'x -' extracting 'compat/linux/syscalls.h' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'compat/linux/syscalls.h' &&
X
SHAR_EOF
  : || $echo 'restore of' 'compat/linux/syscalls.h' 'failed'
fi
# ============= compat/asm/ioctl32.h ==============
if test ! -d 'compat/asm'; then
  $echo $echo_n 'x -' 'compat/asm: '$echo_c
  if mkdir 'compat/asm'; then $echo 'created'; else $echo 'failed to create'; fi
fi
if test -f 'compat/asm/ioctl32.h' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'compat/asm/ioctl32.h' '(file already exists)'
else
  $echo 'x -' extracting 'compat/asm/ioctl32.h' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'compat/asm/ioctl32.h' &&
X#ifndef MST_NO_CONFIG_COMPAT
X#define MST_NO_CONFIG_COMPAT 1
X#endif
SHAR_EOF
  : || $echo 'restore of' 'compat/asm/ioctl32.h' 'failed'
fi
# ============= ezusb_fw/0abf03e8_6.hex ==============
if test ! -d 'ezusb_fw'; then
  $echo $echo_n 'x -' 'ezusb_fw: '$echo_c
  if mkdir 'ezusb_fw'; then $echo 'created'; else $echo 'failed to create'; fi
fi
if test -f 'ezusb_fw/0abf03e8_6.hex' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'ezusb_fw/0abf03e8_6.hex' '(file already exists)'
else
  $echo 'x -' extracting 'ezusb_fw/0abf03e8_6.hex' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'ezusb_fw/0abf03e8_6.hex' &&
X:0300000002004EAD
X:10004E0078FFE4F6D8FD907FA1E404F090200090B4
X:10005E0020007F007E08E4F0A3DFFCDEFA75814805
X:03006E000200ACE1
X:03004300020100B7
X:1014DB007400F58690FDA57C05A3E582458370F924
X:0114EB0022DE
X:0514EC0074EF52912293
X:1014F100907FD6E04480F043870100000000002285
X:100DFD001201100100000040BF0AE90302000000CB
X:100E0D00000109022E00010100C032090400000496
X:100E1D00FF000000070581024000000705010240A8
X:100E2D000000070582024000000705020240000095
X:100E3D0004030904100344006500560061005300CB
X:100E4D0079007300380344006500560061005300BB
X:100E5D007900730020002D0020004900320043006E
X:100E6D002B0049002F004F00200049006E00740038
X:0E0E7D00650072006600610063006500000001
X:1017330012177D120E8B2003033001031212F712CE
X:0417430000F180F23F
X:1011F20049276D206120557362493263496F20622D
X:101202006F61726420616E642049276D20616C6990
X:10121200766521202049276D2020616161616C6C17
X:101222006C6C696969696976767676656565656506
X:051232002121210A004A
X:10106400D202E4907F93F0907F94F0907F95740780
X:10107400F0E4907F9CF0907F9DF0907F9E7408F048
X:10108400E4907F96F0907F97F0907F987408F01228
X:10109400148CC20A1216BD907FB27400F0A374F1CE
X:1010A400F0907FAFE04402F0E04404F07BFF7A115B
X:0710B40079F2E4FD02166968
X:0E00F1003006031216F0E53F600312143222AF
X:030FFA007F012252
X:030FFD007F01224F
X:09179800C106C105013F00C104B6
X:07000300EF25E02443F82281
X:10148C00C2A9C28C5389F0438901758AE0758CB16D
X:10149C00E4FF120003E4F608F674402FF876010F0F
X:0714AC00BF03EFD28CD2A9AF
X:0114B3002216
X:10176D0074402FF8E6B4020576017F01227F002236
X:10174700C28C120003A60408A60574402FF8E4F61D
X:03175700D28C220F
X:03000B00021237A7
X:0D123700C0E0C0D075D000C000C004C007EA
X:10124400C28C758AE0758CB1D28C7F031F74402FD9
X:10125400F8E6701612000308E616187001161486D4
X:0D126400044C700674402FF87602EF70DF26
X:0B127100D007D004D000D0D0D0E03275
X:10168900300402B20A907F9BE054F7F53E200A032A
X:09169900433E08907F98E53EF005
X:0116A2002225
X:1016F000E53F70127D08FC7F01121747753F01D24C
X:071700000A121689C206223D
X:101432007F0112176DEF6024E53F24FE60110470F6
X:10144200137D087C007F01121747753F028008E474
X:0D145200F53F8003E4F53FC20A121689221F
X:10111200907FECE0F45480FFC4540FFFE054072F9B
X:1011220025E024B4F582E4347FF58322907FB4E095
X:101132004401F022E4907F00F0A3F0907FB57402A6
X:10114200F022E0FCA3E0FDEC907FD4F0ED907FD59F
X:0C115200F022E4F525F524F523F5222217
X:100E8B00121154C201C202C200C203902100740DA0
X:100E9B00F0A374FDF0A3740EF0A3740FF0A3740E03
X:100EAB00F0A3743DF0121064D2E843D820907FAFCA
X:100EBB00E0440154F7F0907FAEE0441DF0D2AF2038
X:100ECB00033F2003057F011211AA1211547F407EAC
X:100EDB00927D047C00AB25AA24A923A822C312036C
X:100EEB000450DC2003D9AF25AE24AD23AC22E47B28
X:100EFB0001FAF9F81202F78F258E248D238C2280AC
X:040F0B00CC538EF83D
X:010F0F0022BF
X:1012F700300307D20612132EC203300129C201128E
X:101307000FFAEF6021C204C20A1216891214F120E3
X:101317000207907FD6E020E7F31216A3120FFDD243
X:071327000A121689D204220C
X:10132E00907FE8E0546024E0602524E0601924E01A
X:10133E00601D24607016907FE8E030E70512053CD2
X:10134E00800D120C4680081217A2800312112E90E7
X:07135E007FB4E04402F0221D
X:10053C00907FE9E07002C12424F87002C12124FEEE
X:10054C007002C11E24046002C1501217BAEF60027F
X:10055C00C153907FEBE024FE600F14601224026004
X:10056C0002C11B90210002114490210202114490FF
X:10057C007FEAE0FF1213CFEF4E7002C1188E228F6C
X:10058C00238F828E83E493F524907FEEE0FFE524A5
X:10059C00D39F4003E0F524E5246065E4FFFEE524E9
X:1005AC00C394405004AD2480027D40C3EF9DEE9473
X:1005BC0000501FE5232FF582E5223EF583E0FD7404
X:1005CC00002FF582E4347FF583EDF00FBF00010EB0
X:1005DC0080CCE524C394405004AF2480027F40902B
X:1005EC007FB5EFF0E524C394405004AF2480027F24
X:1005FC0040C3E5249FF524907FB4E030E29980F766
X:10060C00E4907FB5F0907FB47402F02202112E02B8
X:10061C00112E0217AC0207F71217BDEF6029907F5D
X:10062C00E8E0247F600A14600A2402701402113678
X:10063C00021136121112E05401907F00F0E4021105
X:07064C003B02112E12112EDA
X:010653002284
X:100C4600907FE9E014601224FE605524FA600724C0
X:100C5600FE707C02178D0200361217C0EF6073908B
X:100C66007FE8E024FE601124027067907FEAE0B41A
X:100C76000103C2022202112E907FEAE0701F1211B8
X:100C860012E4F0907FECE05480FF131313541FFF1F
X:100C9600E054072F907FD7F0E04420F02202112E77
X:100CA6001217C3EF602C907FE8E024FE6011240247
X:100CB6007020907FEAE0B40103D2022202112E9046
X:100CC6007FEAE070071211127401F02202112E124F
X:030CD600112E22BA
X:0A17A200120758EF700312112E22F7
X:0300330002004682
X:0400460053D8EF326A
X:1011AA00907FD6E04408F0E054FBF0E04408F0EF0A
X:1011BA006004E04402F07FDC7E05121707907F92FC
X:1011CA00E030E3077FDC7E05121707907FAB74FFE0
X:1011DA00F0907FA9F0907FAAF05391EF907FD6E02C
X:0811EA0054F7F0E04404F02288
X:101707008E268F27E5271527AE26700215264E60F1
X:07171700051214DB80EE2235
X:1016A300907FD6E030E712E04401F07F147E001211
X:0A16B3001707907FD6E054FEF022E6
X:0213CF00A9076C
X:1013D100902104E0FEA3E0FF8F828E837401936469
X:1013E100037018AD0119ED7001228F828E83E49391
X:0F13F1007C002FFDEC3EFEAF0580DD7E007F000F
X:0114000022C9
X:10013F004572726F72202D2056525F476574203DB5
X:10014F002064656661756C742063617365202D2072
X:10015F003078000A004572726F72202D2056525F60
X:10016F00536574203D2064656661756C742063610E
X:10017F007365202D2030780056525F476574496FA4
X:10018F00436F6E6669672829202D203078005652FC
X:10019F005F536574496F436F6E6669672829202D19
X:1001AF002030780056525F47657452656164496F1D
X:1001BF00506F7274732829202D20307830300056FC
X:1001CF00525F5365745772697465496F506F7274DB
X:1001DF00732829207B3078007D207B3078002C20FD
X:1001EF003078007D0A0020496E76616C6964207753
X:1001FF00436F756E742076616C75652C2000207BC3
X:10020F005245414420444154417D0020646566615C
X:10021F00756C742063617365206572726F72002054
X:10022F00496E76616C69642064617461206C656EDF
X:10023F00677468732C2077493263436F756E743D12
X:10024F0000202C206263203D0056525F5365745787
X:10025F00726974654932433A0056525F476574526A
X:10026F006561644932433A00204932435F54524139
X:10027F004E535F4E4F414452203078002049324355
X:10028F005F5452414E535F38414452203078002022
X:10029F00307800204932435F5452414E535F31361C
X:1002AF0041445220307800204932435F5452414E2E
X:0D02BF00535F4E5320307800207B007D00FF
X:100F1000907FEAE0F511A3E0F50C7E7F7FEC7DEC9D
X:100F20007C7F05828C83E0FBA3E0F50DEBF50E7E64
X:100F30007F7FEE7C7F7DEE8D828C83E0FBA3E022C1
X:100F4000907F00F07BFF7A0179627D0122E0F50855
X:100F50005509F50B420AE508F44509F50B520A223A
X:100F60007BFF7A02791A7D0122E0907F00F0907F6A
X:100F7000B57401F0FF22AA12A9137B0122AA14A9B9
X:0B0F8000157B01227D01AF10AE0F2297
X:0317BA007F00228B
X:0D003600D204907FEAE0902107F07F0122C4
X:0707F700902107120F692297
X:0B178D00907FEAE0902106F07F01222F
X:0717AC00902106120F6922D3
X:0317BD007F012287
X:0317C0007F012284
X:0317C3007F012281
X:10075800E4F522907FE8E030E750A3E0240F60152D
X:1007680014601914602324F46026240F702B1210CF
X:10077800008F22E1E51210BB8F22E1E5758E04128D
X:1007880006548F22758E0180541217C68F22804D11
X:10079800120CD98F22C20680447BFF7A01793F125E
X:1007A80007E8120F441216698033907FE9E0240F9E
X:1007B800600E14601224027015120F8B8F22801D98
X:1007C800120ACE8F2280161208008F22800F7BFF1C
X:0F07D8007A0179641207E8120F44121669AF22F2
X:1007E700227D01121669907FE9E0FF7D0102127CEC
X:101000007BFF7A0179877D011216697D017FFF12CE
X:10101000127C907F0374FFF0907F9EE054F0FFC439
X:10102000540FF4F5237D01FF12127C907F02E5231B
X:10103000F0907F9DE0F4FF7D0112127C907F9DE097
X:10104000F4907F01F0907F9CE0F4FF7D0112127C10
X:10105000907F9CE0F4120F40121669907FB57404E3
X:03106000F07F011D
X:01106300226A
X:100F8B007BFF7A01799D7D01121669907FB4E02079
X:100F9B00E3F9907FC5E0F523907EC3120FF3907EAB
X:100FAB00C2120FF3907EC1E0FF7D0112127C907E86
X:100FBB00C0E0FF7D0112127C120F44121669907E65
X:100FCB00C0E0F4907F9CF0907EC1E0F4907F9DF0A8
X:100FDB00907EC2E0F4FFC454F0FF4307085307F8B8
X:070FEB00907F9EEFF07F01F3
X:080FF20022E0FF7D0102127CE8
X:1010BB007BFF7A0179B37D01121669E4907F03F00F
X:1010CB00907F9BE054F0FFC4540FF5237D01FF127A
X:1010DB00127C907F02E523F0907F9AE0FF7D011256
X:1010EB00127C907F9AE0907F01F0907F99E0FF7DDA
X:1010FB000112127C907F99E0120F40121669907FBB
X:06110B00B57404F07F0141
X:0111110022BB
X:100ACE00907FB4E020E3F9907FC5E0F5237BFF7AB9
X:100ADE000179CE7D011216697D01AF2312127C7B46
X:100AEE00FF7A0179E77D01121669907EC3120B9B86
X:100AFE00907EC2120B9B907EC1120BA2907EC012F2
X:100B0E000BA27BFF7A0179ED7D01121669907EC7EB
X:100B1E00120BA9907EC6120BA9907EC5E0FF7D0137
X:100B2E0012127C907EC4E0FF7D0112127C7BFF7A54
X:100B3E000179F27D01121669907F99E0F50A907E97
X:100B4E00C0E0F509907EC4120F4D907F96E50AF035
X:100B5E00907F9AE0F50A907EC1E0F509907EC5126D
X:100B6E000F4D907F97E50AF0907F9BE0FFC4540FE6
X:100B7E00F50A907EC2E0F509907EC6E0540F120F82
X:0C0B8E004EE50AC454F0907F98F07F01FF
X:100B9A0022E0FF7D0102127CE0FF7D0102127CE06F
X:060BAA00FF7D0102127C38
X:10065400E4F523752405120F10F50FEBF5107E7FDA
X:100664007F0075127F751300E4FF1208F3E510454F
X:100674000F600BD3E5109440E50F9400401A7BFF04
X:100684007A0179F57D01121669120F8412175A1234
X:100694000F44121669AF2322E51114602614604139
X:1006A40014605E24037076AF241524EF6075120F76
X:1006B40076851034AD0C7F03120407BF01E91207DD
X:1006C4003AE127AF241524EF6059120F76E50EF5B1
X:1006D4002985102AAD0C12145FBF01E712073A8076
X:1006E40042AF241524EF603B120F76850D29850E49
X:1006F4002A85102BAD0C121365BF01E51207498042
X:1007040022AF241524EF601B120F76851034AD0C34
X:100714007F04120407BF01E91207498006120F6023
X:10072400121669E5236006907FB5E510F0120F44B8
X:05073400121669AF235D
X:10073900227BFF7A02790D7D011216697523012248
X:0F0749007BFF7A02790D7D01121669752301225B
X:10080000E4F523752505120F10F50FEBF510907F19
X:10081000B4E020E3F97F011208F3907FC5E0F524EE
X:10082000B51009D39440E50F9400402C7BFF7A0269
X:10083000792E7D01121669120F8412175A7BFF7AE6
X:100840000279507D011216697D01AF2412127C12CB
X:100850000F44121669AF23227E7E7FC075147E7509
X:1008600015C0E51114602614604014605B24037009
X:1008700073AF251525EF6072120F7D851034AD0C16
X:10088000E4FF120407BF01E9752301805DAF251560
X:1008900025EF6056E50EFD120F7D85102BAF0C1273
X:1008A0001401BF01E87523018040AF251525EF60D5
X:1008B00039120F7D85102CAD0EAC0DAF0C12139AB2
X:1008C000BF01E77523018022AF251525EF601B12BC
X:1008D0000F7D851034AD0C7F01120407BF01E9754F
X:1008E00023018006120F60121669120F4412166956
X:0208F000AF2334
X:0108F20022E3
X:0208F3008F264E
X:1008F5007A7E79C075270175287E7529C0E5266041
X:100905000D7BFF7A0279587D01121669800B7BFFFA
X:100915007A0279687D01121669E511146015146073
X:10092500241460352403703C7BFF7A027977120921
X:10093500D580377BFF7A02798B1209BEAF0E7D0118
X:1009450012127C80257BFF7A0279A21209BE7D01F5
X:10095500AF0EAE0D12175A80117BFF7A0279B612CF
X:1009650009D58006120F601216697BFF7A02799EFF
X:100975007D01121669120F8412175AE52660397B1C
X:10098500FF7A0279C77D01121669E4F52AC3E52AC3
X:100995009510E4950F50167827E475F001120315AC
X:1009A5001202CCFF7D0112127C052A80E07BFF7AC2
X:0809B5000279CA7D01121669E6
X:1009BD00227D011216697D01AF0C12127C7BFF7A2C
X:1009CD0002799E7D010216697D011216697D01AFC6
X:0409DD000C02127C7A
X:0317C6007F00227F
X:100CD900907FEEE0752300F524A3E0FFE41217D21C
X:100CE900EF7011F523F524907FB5F0907FB4E030D3
X:100CF900E21680F71217D2C3EF9524E49523500822
X:100D09001217D27523008F24E5244523604CC3E5CF
X:100D1900249440E5239400500885232585242680C2
X:100D2900067525007526407E7F7F00AA06A9077BE8
X:100D390001AD26120D6B7525008F26907FB5EFF05A
X:100D4900C3E5249526F524E5239525F523907FB45D
X:100D5900E020E2F9E526452570AEE4907FB5F07F05
X:010D69000188
X:010D6A002266
X:10115E002074696D656F7574310020627573790046
X:10116E0020696E76616C696420706172616D657460
X:10117E006572002074696D656F75743200206E6142
X:10118E006B0020627573206572726F720020696E3B
X:0C119E0076616C696420737461746500F4
X:1016D700907FA5E04440F0227817E475F0011203EB
X:0916E700151202CC907FA6F0223E
X:1016BD00C2E9A20A920792F9A20A92F9E4F51AF583
X:0A16CD0017F518F519F516C20822EA
X:03004B000209E1C6
X:1009E100C0E0C0F0C083C082C085C084C086758667
X:1009F10000C0D075D000C000C001C002C003C00754
X:100A0100907FA5E030E205751A018010907FA5E086
X:100A110020E109E51A64066003751A02E51A24FC4F
X:100A2100500D601214602014603F14606D41A812D3
X:100A310016D7C2E941B01216DFAF161516EF6401E1
X:100A4100706D751A078068907FA6E0AB17AA18A988
X:100A5100191202E5751A06AF161516EF6401704FEB
X:100A6100907FA5E04420F08046E516B40109907F0F
X:100A7100A5E04420F0800DE5167009300903121637
X:100A8100D7751A00907FA6E0FF7817E475F0011280
X:100A91000315EF1202E5151680153009031216D75A
X:100AA100751A00C2E980081216D7751A03C2E953F4
X:100AB10091DFD007D003D002D001D000D0D0D086B2
X:0D0AC100D084D085D082D083D0F0D0E03238
X:081365008B258A2689278D28BB
X:10136D00E529F52CE52AF52D7B007A00792C7534CD
X:10137D00027F01120407EF6401600122AB25AA264A
X:0C138D00A927852B34AD287F031204072C
X:011399002231
X:08139A008F268B298A2A892B7A
X:1013A200ECF52DEDF52E7B007A00792D753402AD2A
X:1013B200267F01120407EF6401600122AB29AA2AE9
X:0C13C200A92B852C34AD267F02120407F5
X:0113CE0022FC
X:08145F008B258A2689278D28C0
X:101467007B007A0079297534017F01120407EF6444
X:1014770001600122AB25AA26A927852A34AD287F3A
X:041487000312040741
X:01148B00223E
X:0A1401008F268D278B288A29892A5F
X:10140B007B007A007927753401AD267F0112040722
X:10141B00EF6401600122AB28AA29A92A852B34ADE0
X:06142B00267F02120407F7
X:011431002298
X:100407008F2F8D308B318A3289337D147C007F02A8
X:10041700121747907FA5E030E61B7F0212176DEF9A
X:1004270060F1C20A1216BD7BFF7A11795E7D011257
X:1004370016697FFE22E51A600E7BFF7A1179687DC7
X:10044700011216697FFF22E52F64026007907FA5DE
X:10045700E04480F0D2098534168531178532188536
X:100467003319E52F601D14601814603014600514EB
X:100477007041C209E5304401907FA6F0751A0580E6
X:1004870040C209E53054FE907FA6F0E516700830AB
X:100497000905751A07802A751A048025E51660056F
X:1004A7001216DF1516E5167005751A078013751AEB
X:1004B70004800E7BFF7A11796E7D011216697FFA2F
X:1004C70022D2E97D287C007F02121747E51AD394D0
X:1004D7000340207F0212176DEF60F1C20A1216BDAA
X:1004E7007BFF7A1179817D011216691216D7C2E94D
X:1004F7007FFE22E51A14601B146007240270257F13
X:100507000122E4F51A7BFF7A11798B7D01121669B6
X:100517007FFC22E4F51A7BFF7A1179907D01121690
X:10052700697FFD22E4F51A7BFF7A11799B7D011221
X:0505370016697FFB22A4
X:0717B3007586005391EF223F
X:030100000212BA2E
X:1012BA00C0E0C083C082C085C084C08675860090A5
X:1012CA007FE8E020E70F907FEEE07004A3E060057E
X:1012DA00907FC5E4F0D2035391EF907FAB7401F095
X:0D12EA00D086D084D085D082D083D0E03271
X:0301040002164799
X:10164700C0E0C083C082C085C084C0861217B39033
X:101657007FAB7402F0D086D084D085D082D083D07F
X:02166700E0326F
X:0301080002000EE4
X:10000E00C0E0C083C082C085C084C0861217B39082
X:10001E007FAB7404F0D206D086D084D085D082D047
X:04002E0083D0E03269
X:03010C000214B426
X:1014B400C0E0C083C082C085C084C086758600D267
X:1014C400015391EF907FAB7408F0D086D084D0851F
X:0714D400D082D083D0E0328A
X:03011000021501D4
X:10150100C0E0C083C082C085C084C0861217B3907A
X:101511007FAB7410F0C204D206D086D084D085D0BF
X:0615210082D083D0E0320D
X:030114000217C906
X:0317C900D2063213
X:030118000217CCFF
X:0317CC00D2063210
X:03011C000217CFF8
X:0317CF00D206320D
X:030120000215279E
X:10152700C0E0C083C082C085C084C0861217B39054
X:101537007FA97402F0D206D086D084D085D082D01D
X:0415470083D0E0323B
X:0301240002154B76
X:10154B00C0E0C083C082C085C084C0861217B39030
X:10155B007FAA7402F0D206D086D084D085D082D0F8
X:04156B0083D0E03217
X:0301280002156F4E
X:10156F00C0E0C083C082C085C084C0861217B3900C
X:10157F007FA97404F0D206D086D084D085D082D0D3
X:04158F0083D0E032F3
X:03012C0002159326
X:10159300C0E0C083C082C085C084C0861217B390E8
X:1015A3007FAA7404F0D206D086D084D085D082D0AE
X:0415B30083D0E032CF
X:030130000215B7FE
X:1015B700C0E0C083C082C085C084C0861217B390C4
X:1015C7007FA97408F0D206D086D084D085D082D087
X:0415D70083D0E032AB
X:030134000215DBD6
X:1015DB00C0E0C083C082C085C084C0861217B390A0
X:1015EB007FAA7408F0D206D086D084D085D082D062
X:0415FB0083D0E03287
X:030138000215FFAE
X:1015FF00C0E0C083C082C085C084C0861217B3907C
X:10160F007FA97410F0D206D086D084D085D082D036
X:04161F0083D0E03262
X:03013C0002162385
X:10162300C0E0C083C082C085C084C0861217B39057
X:101633007FAA7410F0D206D086D084D085D082D011
X:0416430083D0E0323E
X:101669008B358A368937ED700312177DAB35AA366B
X:10167900A93712171EAD07AB35AA36A937020BB029
X:10127C00EFC4540FFEEF540FFFEEC3940A500674E4
X:10128C00302EFE800474372EFEEFC3940A50067481
X:10129C00302FFF800474372FFF8E2E8F2FED7003AD
X:0E12AC0012177D7B007A00792E7D02020BB0B6
X:10175A008E2B8F2C8D2DE52BFF12127CAF2CAD2DED
X:03176A0002127CEC
X:10177D007E207F008E1B8F1C8E1D8F1EE4F51F2279
X:0317D200AF1F2224
X:080BB0008B388A39893A8D3B2C
X:100BB800AE1BC37400951CF53CE53BC3953C50083F
X:100BC800853B3DE4F53C800A853C3DC3E53B953CCF
X:100BD800F53CAF3D7E00A81CAC1B7D01AB38AA39A3
X:100BE800A93A1203E1AF3D7E00EF251CF51CEE3556
X:100BF8001BF51BE53C602DFD7C00C004C005AB382F
X:100C0800E53A2FF9EE3539FA78007C207D01D007D6
X:100C1800D0061203E17400253CF582E43420AF824B
X:100C2800F51B8F1CE53B251FF51FD39400E49401A9
X:0D0C38004009851B1D851C1EE4F51FAF3B08
X:010C4500228C
X:080D6B008B278A2889298D2AB3
X:100D7300E52AD3951F4003851F2AAE1DC374009532
X:100D83001EF52BE52AC3952B5008852A2CE4F52B59
X:100D9300800A852B2CC3E52A952BF52BAF2C7E00DF
X:100DA300AA1DA91E7B01A829AC28AD271203E1AF18
X:100DB3002C7E00EF251EF51EEE351DF51DE52B607F
X:100DC3002FFD7C00C004C005E5292FF9EE3528A8C6
X:100DD30001FCAD277B017A207900D007D0061203EE
X:100DE300E17400252BF582E43420AF82F51D8F1EBC
X:090DF300C3E51F952AF51FAF2A84
X:010DFC0022D4
X:10007100021733E493A3F8E493A34003F68001F25B
X:1000810008DFF48029E493A3F85407240CC8C33390
X:10009100C4540F4420C8834004F456800146F6DF5F
X:1000A100E4800B0102040810204080901798E47E40
X:1000B100019360BCA3FF543F30E509541FFEE49354
X:1000C100A360010ECF54C025E060A840B8E493A31B
X:1000D100FAE493A3F8E493A3C8C582C8CAC583CA46
X:1000E100F0A3C8C582C8CAC583CADFE9DEE780BEFE
X:0117A1000047
X:1002CC00BB010689828A83E0225002E722BBFE0230
X:0902DC00E32289828A83E4932263
X:1002E500BB010689828A83F0225002F722BBFE01F8
X:0202F500F322F2
X:0D02F700EF2BFFEE3AFEED39FDEC38FC2256
X:10030400EB9FF5F0EA9E42F0E99D42F0E89C45F04F
X:0103140022C6
X:10031500FAE6FB0808E6F925F0F618E6CA3AF622E9
X:10171E00E4FFFE1202CC600C0FEF70010E09E970AF
X:05172E00F20A80EF2229
X:10032500E709F608DFFA8046E709F208DFFA803EBA
X:1003350088828C83E709F0A3DFFA8032E309F608A7
X:10034500DFFA806EE309F208DFFA806688828C8323
X:10035500E309F0A3DFFA805A89828A83E0A3F608CD
X:10036500DFFA804E89828A83E0A3F208DFFA8042B1
X:1003750080D280FA80C680D4805580F28029801092
X:1003850080A680EA809A80A880DA80E280CA8029E7
X:1003950088848C8589828A83E493A30586F0A305E6
X:1003A50086DFF5DEF3800B89828A83E493A3F60862
X:1003B500DFF9ECFAA9F0EDFB2288848C8589828A25
X:1003C50083E0A30586F0A30586DFF6DEF480E389E6
X:1003D500828A83E493A3F208DFF980D688F0EF6080
X:1003E500010E4E60CD88F0ED2402B4040050C3F533
X:1003F50082EB2402B4040050B923234582239003E1
X:0204050075730D
X:00000001FF
SHAR_EOF
  : || $echo 'restore of' 'ezusb_fw/0abf03e8_6.hex' 'failed'
fi
# ============= libusb-0.1.8/AUTHORS ==============
if test ! -d 'libusb-0.1.8'; then
  $echo $echo_n 'x -' 'libusb-0.1.8: '$echo_c
  if mkdir 'libusb-0.1.8'; then $echo 'created'; else $echo 'failed to create'; fi
fi
if test -f 'libusb-0.1.8/AUTHORS' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/AUTHORS' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/AUTHORS' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/AUTHORS' &&
XJohannes Erdfelt, <johannes@erdfelt.com>
XThomas Sailer, <sailer@ife.ee.ethz.ch>
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/AUTHORS' 'failed'
fi
# ============= libusb-0.1.8/COPYING ==============
if test -f 'libusb-0.1.8/COPYING' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/COPYING' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/COPYING' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/COPYING' &&
X		  GNU LESSER GENERAL PUBLIC LICENSE
X		       Version 2.1, February 1999
X
X Copyright (C) 1991, 1999 Free Software Foundation, Inc.
X     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
X Everyone is permitted to copy and distribute verbatim copies
X of this license document, but changing it is not allowed.
X
X[This is the first released version of the Lesser GPL.  It also counts
X as the successor of the GNU Library Public License, version 2, hence
X the version number 2.1.]
X
X			    Preamble
X
X  The licenses for most software are designed to take away your
Xfreedom to share and change it.  By contrast, the GNU General Public
XLicenses are intended to guarantee your freedom to share and change
Xfree software--to make sure the software is free for all its users.
X
X  This license, the Lesser General Public License, applies to some
Xspecially designated software packages--typically libraries--of the
XFree Software Foundation and other authors who decide to use it.  You
Xcan use it too, but we suggest you first think carefully about whether
Xthis license or the ordinary General Public License is the better
Xstrategy to use in any particular case, based on the explanations below.
X
X  When we speak of free software, we are referring to freedom of use,
Xnot price.  Our General Public Licenses are designed to make sure that
Xyou have the freedom to distribute copies of free software (and charge
Xfor this service if you wish); that you receive source code or can get
Xit if you want it; that you can change the software and use pieces of
Xit in new free programs; and that you are informed that you can do
Xthese things.
X
X  To protect your rights, we need to make restrictions that forbid
Xdistributors to deny you these rights or to ask you to surrender these
Xrights.  These restrictions translate to certain responsibilities for
Xyou if you distribute copies of the library or if you modify it.
X
X  For example, if you distribute copies of the library, whether gratis
Xor for a fee, you must give the recipients all the rights that we gave
Xyou.  You must make sure that they, too, receive or can get the source
Xcode.  If you link other code with the library, you must provide
Xcomplete object files to the recipients, so that they can relink them
Xwith the library after making changes to the library and recompiling
Xit.  And you must show them these terms so they know their rights.
X
X  We protect your rights with a two-step method: (1) we copyright the
Xlibrary, and (2) we offer you this license, which gives you legal
Xpermission to copy, distribute and/or modify the library.
X
X  To protect each distributor, we want to make it very clear that
Xthere is no warranty for the free library.  Also, if the library is
Xmodified by someone else and passed on, the recipients should know
Xthat what they have is not the original version, so that the original
Xauthor's reputation will not be affected by problems that might be
Xintroduced by others.
X
X  Finally, software patents pose a constant threat to the existence of
Xany free program.  We wish to make sure that a company cannot
Xeffectively restrict the users of a free program by obtaining a
Xrestrictive license from a patent holder.  Therefore, we insist that
Xany patent license obtained for a version of the library must be
Xconsistent with the full freedom of use specified in this license.
X
X  Most GNU software, including some libraries, is covered by the
Xordinary GNU General Public License.  This license, the GNU Lesser
XGeneral Public License, applies to certain designated libraries, and
Xis quite different from the ordinary General Public License.  We use
Xthis license for certain libraries in order to permit linking those
Xlibraries into non-free programs.
X
X  When a program is linked with a library, whether statically or using
Xa shared library, the combination of the two is legally speaking a
Xcombined work, a derivative of the original library.  The ordinary
XGeneral Public License therefore permits such linking only if the
Xentire combination fits its criteria of freedom.  The Lesser General
XPublic License permits more lax criteria for linking other code with
Xthe library.
X
X  We call this license the "Lesser" General Public License because it
Xdoes Less to protect the user's freedom than the ordinary General
XPublic License.  It also provides other free software developers Less
Xof an advantage over competing non-free programs.  These disadvantages
Xare the reason we use the ordinary General Public License for many
Xlibraries.  However, the Lesser license provides advantages in certain
Xspecial circumstances.
X
X  For example, on rare occasions, there may be a special need to
Xencourage the widest possible use of a certain library, so that it becomes
Xa de-facto standard.  To achieve this, non-free programs must be
Xallowed to use the library.  A more frequent case is that a free
Xlibrary does the same job as widely used non-free libraries.  In this
Xcase, there is little to gain by limiting the free library to free
Xsoftware only, so we use the Lesser General Public License.
X
X  In other cases, permission to use a particular library in non-free
Xprograms enables a greater number of people to use a large body of
Xfree software.  For example, permission to use the GNU C Library in
Xnon-free programs enables many more people to use the whole GNU
Xoperating system, as well as its variant, the GNU/Linux operating
Xsystem.
X
X  Although the Lesser General Public License is Less protective of the
Xusers' freedom, it does ensure that the user of a program that is
Xlinked with the Library has the freedom and the wherewithal to run
Xthat program using a modified version of the Library.
X
X  The precise terms and conditions for copying, distribution and
Xmodification follow.  Pay close attention to the difference between a
X"work based on the library" and a "work that uses the library".  The
Xformer contains code derived from the library, whereas the latter must
Xbe combined with the library in order to run.
X
X		  GNU LESSER GENERAL PUBLIC LICENSE
X   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
X
X  0. This License Agreement applies to any software library or other
Xprogram which contains a notice placed by the copyright holder or
Xother authorized party saying it may be distributed under the terms of
Xthis Lesser General Public License (also called "this License").
XEach licensee is addressed as "you".
X
X  A "library" means a collection of software functions and/or data
Xprepared so as to be conveniently linked with application programs
X(which use some of those functions and data) to form executables.
X
X  The "Library", below, refers to any such software library or work
Xwhich has been distributed under these terms.  A "work based on the
XLibrary" means either the Library or any derivative work under
Xcopyright law: that is to say, a work containing the Library or a
Xportion of it, either verbatim or with modifications and/or translated
Xstraightforwardly into another language.  (Hereinafter, translation is
Xincluded without limitation in the term "modification".)
X
X  "Source code" for a work means the preferred form of the work for
Xmaking modifications to it.  For a library, complete source code means
Xall the source code for all modules it contains, plus any associated
Xinterface definition files, plus the scripts used to control compilation
Xand installation of the library.
X
X  Activities other than copying, distribution and modification are not
Xcovered by this License; they are outside its scope.  The act of
Xrunning a program using the Library is not restricted, and output from
Xsuch a program is covered only if its contents constitute a work based
Xon the Library (independent of the use of the Library in a tool for
Xwriting it).  Whether that is true depends on what the Library does
Xand what the program that uses the Library does.
X  
X  1. You may copy and distribute verbatim copies of the Library's
Xcomplete source code as you receive it, in any medium, provided that
Xyou conspicuously and appropriately publish on each copy an
Xappropriate copyright notice and disclaimer of warranty; keep intact
Xall the notices that refer to this License and to the absence of any
Xwarranty; and distribute a copy of this License along with the
XLibrary.
X
X  You may charge a fee for the physical act of transferring a copy,
Xand you may at your option offer warranty protection in exchange for a
Xfee.
X
X  2. You may modify your copy or copies of the Library or any portion
Xof it, thus forming a work based on the Library, and copy and
Xdistribute such modifications or work under the terms of Section 1
Xabove, provided that you also meet all of these conditions:
X
X    a) The modified work must itself be a software library.
X
X    b) You must cause the files modified to carry prominent notices
X    stating that you changed the files and the date of any change.
X
X    c) You must cause the whole of the work to be licensed at no
X    charge to all third parties under the terms of this License.
X
X    d) If a facility in the modified Library refers to a function or a
X    table of data to be supplied by an application program that uses
X    the facility, other than as an argument passed when the facility
X    is invoked, then you must make a good faith effort to ensure that,
X    in the event an application does not supply such function or
X    table, the facility still operates, and performs whatever part of
X    its purpose remains meaningful.
X
X    (For example, a function in a library to compute square roots has
X    a purpose that is entirely well-defined independent of the
X    application.  Therefore, Subsection 2d requires that any
X    application-supplied function or table used by this function must
X    be optional: if the application does not supply it, the square
X    root function must still compute square roots.)
X
XThese requirements apply to the modified work as a whole.  If
Xidentifiable sections of that work are not derived from the Library,
Xand can be reasonably considered independent and separate works in
Xthemselves, then this License, and its terms, do not apply to those
Xsections when you distribute them as separate works.  But when you
Xdistribute the same sections as part of a whole which is a work based
Xon the Library, the distribution of the whole must be on the terms of
Xthis License, whose permissions for other licensees extend to the
Xentire whole, and thus to each and every part regardless of who wrote
Xit.
X
XThus, it is not the intent of this section to claim rights or contest
Xyour rights to work written entirely by you; rather, the intent is to
Xexercise the right to control the distribution of derivative or
Xcollective works based on the Library.
X
XIn addition, mere aggregation of another work not based on the Library
Xwith the Library (or with a work based on the Library) on a volume of
Xa storage or distribution medium does not bring the other work under
Xthe scope of this License.
X
X  3. You may opt to apply the terms of the ordinary GNU General Public
XLicense instead of this License to a given copy of the Library.  To do
Xthis, you must alter all the notices that refer to this License, so
Xthat they refer to the ordinary GNU General Public License, version 2,
Xinstead of to this License.  (If a newer version than version 2 of the
Xordinary GNU General Public License has appeared, then you can specify
Xthat version instead if you wish.)  Do not make any other change in
Xthese notices.
X
X  Once this change is made in a given copy, it is irreversible for
Xthat copy, so the ordinary GNU General Public License applies to all
Xsubsequent copies and derivative works made from that copy.
X
X  This option is useful when you wish to copy part of the code of
Xthe Library into a program that is not a library.
X
X  4. You may copy and distribute the Library (or a portion or
Xderivative of it, under Section 2) in object code or executable form
Xunder the terms of Sections 1 and 2 above provided that you accompany
Xit with the complete corresponding machine-readable source code, which
Xmust be distributed under the terms of Sections 1 and 2 above on a
Xmedium customarily used for software interchange.
X
X  If distribution of object code is made by offering access to copy
Xfrom a designated place, then offering equivalent access to copy the
Xsource code from the same place satisfies the requirement to
Xdistribute the source code, even though third parties are not
Xcompelled to copy the source along with the object code.
X
X  5. A program that contains no derivative of any portion of the
XLibrary, but is designed to work with the Library by being compiled or
Xlinked with it, is called a "work that uses the Library".  Such a
Xwork, in isolation, is not a derivative work of the Library, and
Xtherefore falls outside the scope of this License.
X
X  However, linking a "work that uses the Library" with the Library
Xcreates an executable that is a derivative of the Library (because it
Xcontains portions of the Library), rather than a "work that uses the
Xlibrary".  The executable is therefore covered by this License.
XSection 6 states terms for distribution of such executables.
X
X  When a "work that uses the Library" uses material from a header file
Xthat is part of the Library, the object code for the work may be a
Xderivative work of the Library even though the source code is not.
XWhether this is true is especially significant if the work can be
Xlinked without the Library, or if the work is itself a library.  The
Xthreshold for this to be true is not precisely defined by law.
X
X  If such an object file uses only numerical parameters, data
Xstructure layouts and accessors, and small macros and small inline
Xfunctions (ten lines or less in length), then the use of the object
Xfile is unrestricted, regardless of whether it is legally a derivative
Xwork.  (Executables containing this object code plus portions of the
XLibrary will still fall under Section 6.)
X
X  Otherwise, if the work is a derivative of the Library, you may
Xdistribute the object code for the work under the terms of Section 6.
XAny executables containing that work also fall under Section 6,
Xwhether or not they are linked directly with the Library itself.
X
X  6. As an exception to the Sections above, you may also combine or
Xlink a "work that uses the Library" with the Library to produce a
Xwork containing portions of the Library, and distribute that work
Xunder terms of your choice, provided that the terms permit
Xmodification of the work for the customer's own use and reverse
Xengineering for debugging such modifications.
X
X  You must give prominent notice with each copy of the work that the
XLibrary is used in it and that the Library and its use are covered by
Xthis License.  You must supply a copy of this License.  If the work
Xduring execution displays copyright notices, you must include the
Xcopyright notice for the Library among them, as well as a reference
Xdirecting the user to the copy of this License.  Also, you must do one
Xof these things:
X
X    a) Accompany the work with the complete corresponding
X    machine-readable source code for the Library including whatever
X    changes were used in the work (which must be distributed under
X    Sections 1 and 2 above); and, if the work is an executable linked
X    with the Library, with the complete machine-readable "work that
X    uses the Library", as object code and/or source code, so that the
X    user can modify the Library and then relink to produce a modified
X    executable containing the modified Library.  (It is understood
X    that the user who changes the contents of definitions files in the
X    Library will not necessarily be able to recompile the application
X    to use the modified definitions.)
X
X    b) Use a suitable shared library mechanism for linking with the
X    Library.  A suitable mechanism is one that (1) uses at run time a
X    copy of the library already present on the user's computer system,
X    rather than copying library functions into the executable, and (2)
X    will operate properly with a modified version of the library, if
X    the user installs one, as long as the modified version is
X    interface-compatible with the version that the work was made with.
X
X    c) Accompany the work with a written offer, valid for at
X    least three years, to give the same user the materials
X    specified in Subsection 6a, above, for a charge no more
X    than the cost of performing this distribution.
X
X    d) If distribution of the work is made by offering access to copy
X    from a designated place, offer equivalent access to copy the above
X    specified materials from the same place.
X
X    e) Verify that the user has already received a copy of these
X    materials or that you have already sent this user a copy.
X
X  For an executable, the required form of the "work that uses the
XLibrary" must include any data and utility programs needed for
Xreproducing the executable from it.  However, as a special exception,
Xthe materials to be distributed need not include anything that is
Xnormally distributed (in either source or binary form) with the major
Xcomponents (compiler, kernel, and so on) of the operating system on
Xwhich the executable runs, unless that component itself accompanies
Xthe executable.
X
X  It may happen that this requirement contradicts the license
Xrestrictions of other proprietary libraries that do not normally
Xaccompany the operating system.  Such a contradiction means you cannot
Xuse both them and the Library together in an executable that you
Xdistribute.
X
X  7. You may place library facilities that are a work based on the
XLibrary side-by-side in a single library together with other library
Xfacilities not covered by this License, and distribute such a combined
Xlibrary, provided that the separate distribution of the work based on
Xthe Library and of the other library facilities is otherwise
Xpermitted, and provided that you do these two things:
X
X    a) Accompany the combined library with a copy of the same work
X    based on the Library, uncombined with any other library
X    facilities.  This must be distributed under the terms of the
X    Sections above.
X
X    b) Give prominent notice with the combined library of the fact
X    that part of it is a work based on the Library, and explaining
X    where to find the accompanying uncombined form of the same work.
X
X  8. You may not copy, modify, sublicense, link with, or distribute
Xthe Library except as expressly provided under this License.  Any
Xattempt otherwise to copy, modify, sublicense, link with, or
Xdistribute the Library is void, and will automatically terminate your
Xrights under this License.  However, parties who have received copies,
Xor rights, from you under this License will not have their licenses
Xterminated so long as such parties remain in full compliance.
X
X  9. You are not required to accept this License, since you have not
Xsigned it.  However, nothing else grants you permission to modify or
Xdistribute the Library or its derivative works.  These actions are
Xprohibited by law if you do not accept this License.  Therefore, by
Xmodifying or distributing the Library (or any work based on the
XLibrary), you indicate your acceptance of this License to do so, and
Xall its terms and conditions for copying, distributing or modifying
Xthe Library or works based on it.
X
X  10. Each time you redistribute the Library (or any work based on the
XLibrary), the recipient automatically receives a license from the
Xoriginal licensor to copy, distribute, link with or modify the Library
Xsubject to these terms and conditions.  You may not impose any further
Xrestrictions on the recipients' exercise of the rights granted herein.
XYou are not responsible for enforcing compliance by third parties with
Xthis License.
X
X  11. If, as a consequence of a court judgment or allegation of patent
Xinfringement or for any other reason (not limited to patent issues),
Xconditions are imposed on you (whether by court order, agreement or
Xotherwise) that contradict the conditions of this License, they do not
Xexcuse you from the conditions of this License.  If you cannot
Xdistribute so as to satisfy simultaneously your obligations under this
XLicense and any other pertinent obligations, then as a consequence you
Xmay not distribute the Library at all.  For example, if a patent
Xlicense would not permit royalty-free redistribution of the Library by
Xall those who receive copies directly or indirectly through you, then
Xthe only way you could satisfy both it and this License would be to
Xrefrain entirely from distribution of the Library.
X
XIf any portion of this section is held invalid or unenforceable under any
Xparticular circumstance, the balance of the section is intended to apply,
Xand the section as a whole is intended to apply in other circumstances.
X
XIt is not the purpose of this section to induce you to infringe any
Xpatents or other property right claims or to contest validity of any
Xsuch claims; this section has the sole purpose of protecting the
Xintegrity of the free software distribution system which is
Ximplemented by public license practices.  Many people have made
Xgenerous contributions to the wide range of software distributed
Xthrough that system in reliance on consistent application of that
Xsystem; it is up to the author/donor to decide if he or she is willing
Xto distribute software through any other system and a licensee cannot
Ximpose that choice.
X
XThis section is intended to make thoroughly clear what is believed to
Xbe a consequence of the rest of this License.
X
X  12. If the distribution and/or use of the Library is restricted in
Xcertain countries either by patents or by copyrighted interfaces, the
Xoriginal copyright holder who places the Library under this License may add
Xan explicit geographical distribution limitation excluding those countries,
Xso that distribution is permitted only in or among countries not thus
Xexcluded.  In such case, this License incorporates the limitation as if
Xwritten in the body of this License.
X
X  13. The Free Software Foundation may publish revised and/or new
Xversions of the Lesser General Public License from time to time.
XSuch new versions will be similar in spirit to the present version,
Xbut may differ in detail to address new problems or concerns.
X
XEach version is given a distinguishing version number.  If the Library
Xspecifies a version number of this License which applies to it and
X"any later version", you have the option of following the terms and
Xconditions either of that version or of any later version published by
Xthe Free Software Foundation.  If the Library does not specify a
Xlicense version number, you may choose any version ever published by
Xthe Free Software Foundation.
X
X  14. If you wish to incorporate parts of the Library into other free
Xprograms whose distribution conditions are incompatible with these,
Xwrite to the author to ask for permission.  For software which is
Xcopyrighted by the Free Software Foundation, write to the Free
XSoftware Foundation; we sometimes make exceptions for this.  Our
Xdecision will be guided by the two goals of preserving the free status
Xof all derivatives of our free software and of promoting the sharing
Xand reuse of software generally.
X
X			    NO WARRANTY
X
X  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
XWARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
XEXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
XOTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
XKIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
XIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
XPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
XLIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
XTHE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
X
X  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
XWRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
XAND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
XFOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
XCONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
XLIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
XRENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
XFAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
XSUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
XDAMAGES.
X
X		     END OF TERMS AND CONDITIONS
X
X           How to Apply These Terms to Your New Libraries
X
X  If you develop a new library, and you want it to be of the greatest
Xpossible use to the public, we recommend making it free software that
Xeveryone can redistribute and change.  You can do so by permitting
Xredistribution under these terms (or, alternatively, under the terms of the
Xordinary General Public License).
X
X  To apply these terms, attach the following notices to the library.  It is
Xsafest to attach them to the start of each source file to most effectively
Xconvey the exclusion of warranty; and each file should have at least the
X"copyright" line and a pointer to where the full notice is found.
X
X    <one line to give the library's name and a brief idea of what it does.>
X    Copyright (C) <year>  <name of author>
X
X    This library is free software; you can redistribute it and/or
X    modify it under the terms of the GNU Lesser General Public
X    License as published by the Free Software Foundation; either
X    version 2 of the License, or (at your option) any later version.
X
X    This library is distributed in the hope that it will be useful,
X    but WITHOUT ANY WARRANTY; without even the implied warranty of
X    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
X    Lesser General Public License for more details.
X
X    You should have received a copy of the GNU Lesser General Public
X    License along with this library; if not, write to the Free Software
X    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
X
XAlso add information on how to contact you by electronic and paper mail.
X
XYou should also get your employer (if you work as a programmer) or your
Xschool, if any, to sign a "copyright disclaimer" for the library, if
Xnecessary.  Here is a sample; alter the names:
X
X  Yoyodyne, Inc., hereby disclaims all copyright interest in the
X  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
X
X  <signature of Ty Coon>, 1 April 1990
X  Ty Coon, President of Vice
X
XThat's all there is to it!
X
X
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/COPYING' 'failed'
fi
# ============= libusb-0.1.8/ChangeLog ==============
if test -f 'libusb-0.1.8/ChangeLog' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/ChangeLog' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/ChangeLog' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/ChangeLog' &&
X2001-08-26  Johannes Erdfelt  <jerdfelt@valinux.com>
X
X	* Remove Docdir from spec file to meet LHS. Thanks to Daniel Resare
X
X2000-02-15  Johannes Erdfelt  <jerdfelt@valinux.com>
X
X	* Created
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/ChangeLog' 'failed'
fi
# ============= libusb-0.1.8/INSTALL.libusb ==============
if test -f 'libusb-0.1.8/INSTALL.libusb' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/INSTALL.libusb' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/INSTALL.libusb' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/INSTALL.libusb' &&
XSimple install procedure
X========================
X
X  % gzip -cd libusb-0.1.8.tar.gz | tar xvf -  # unpack the sources
X  % cd libusb-0.1.8                           # change to the toplevel directory
X  % ./configure                             # run the `configure' script
X  % make                                    # build libusb
X  [ Become root if necessary ]
X  % make install                            # install libusb
X
XThe Nitty-Gritty
X================
X
XThe 'configure' script can be given a number of options to enable
Xand disable various features. For a complete list, type:
X
X  ./configure --help
X
XA few of the more important ones:
X
X*  --prefix=PREFIX         install architecture-independent files in PREFIX
X                           [ Defaults to /usr/local ]
X
X*  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
X                           [ Defaults to the value given to --prefix ]
X
XOptions can be given to the compiler and linker by setting
Xenvironment variables before running configure. A few of the more
Ximportant ones:
X
X CC       : The C compiler to use
X CPPFLAGS : Flags for the C preprocesser such as -I and -D
X CFLAGS   : C compiler flags
X
XThe most important use of this is to set the
Xoptimization/debugging flags. For instance, to compile with no
Xdebugging information at all, run configure as:
X
X CFLAGS=-O2 ./configure           # Bourne compatible shells (sh/bash/zsh)
X
Xor,
X
X setenv CFLAGS -O2 ; ./configure  # csh and variants
X
X
XInstallation directories
X========================
X
XThe location of the installed files is determined by the --prefix
Xand --exec-prefix options given to configure. There are also more
Xdetailed flags to control individual directories. However, the
Xuse of these flags is not tested.
X
XA shell script libusb-config is created during the configure
Xprocess, and installed in the bin/ directory
X($exec_prefix/bin). This is used to determine the location of libusb
Xwhen building applications.  If you move libusb after installation,
Xit will be necessary to edit this file.
X
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/INSTALL.libusb' 'failed'
fi
# ============= libusb-0.1.8/INSTALL.libusb.in ==============
if test -f 'libusb-0.1.8/INSTALL.libusb.in' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/INSTALL.libusb.in' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/INSTALL.libusb.in' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/INSTALL.libusb.in' &&
XSimple install procedure
X========================
X
X  % gzip -cd libusb-@LIBUSB_VERSION@.tar.gz | tar xvf -  # unpack the sources
X  % cd libusb-@LIBUSB_VERSION@                           # change to the toplevel directory
X  % ./configure                             # run the `configure' script
X  % make                                    # build libusb
X  [ Become root if necessary ]
X  % make install                            # install libusb
X
XThe Nitty-Gritty
X================
X
XThe 'configure' script can be given a number of options to enable
Xand disable various features. For a complete list, type:
X
X  ./configure --help
X
XA few of the more important ones:
X
X*  --prefix=PREFIX         install architecture-independent files in PREFIX
X                           [ Defaults to /usr/local ]
X
X*  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
X                           [ Defaults to the value given to --prefix ]
X
XOptions can be given to the compiler and linker by setting
Xenvironment variables before running configure. A few of the more
Ximportant ones:
X
X CC       : The C compiler to use
X CPPFLAGS : Flags for the C preprocesser such as -I and -D
X CFLAGS   : C compiler flags
X
XThe most important use of this is to set the
Xoptimization/debugging flags. For instance, to compile with no
Xdebugging information at all, run configure as:
X
X CFLAGS=-O2 ./configure           # Bourne compatible shells (sh/bash/zsh)
X
Xor,
X
X setenv CFLAGS -O2 ; ./configure  # csh and variants
X
X
XInstallation directories
X========================
X
XThe location of the installed files is determined by the --prefix
Xand --exec-prefix options given to configure. There are also more
Xdetailed flags to control individual directories. However, the
Xuse of these flags is not tested.
X
XA shell script libusb-config is created during the configure
Xprocess, and installed in the bin/ directory
X($exec_prefix/bin). This is used to determine the location of libusb
Xwhen building applications.  If you move libusb after installation,
Xit will be necessary to edit this file.
X
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/INSTALL.libusb.in' 'failed'
fi
# ============= libusb-0.1.8/LICENSE ==============
if test -f 'libusb-0.1.8/LICENSE' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/LICENSE' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/LICENSE' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/LICENSE' &&
Xlibusb is covered by the LGPL:
X
XThis library is free software; you can redistribute it and/or
Xmodify it under the terms of the GNU Lesser General Public
XLicense as published by the Free Software Foundation; either
Xversion 2 of the License, or (at your option) any later version.
X
XThis library is distributed in the hope that it will be useful,
Xbut WITHOUT ANY WARRANTY; without even the implied warranty of
XMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
XLesser General Public License for more details.
X
XYou should have received a copy of the GNU Lesser General Public
XLicense along with this library; if not, write to the
XFree Software Foundation, Inc., 59 Temple Place - Suite 330,
XBoston, MA 02111-1307, USA.
X
X----
X
XAlternatively, the files usb.h.in and/or usb.h may be licensed under the
XBSD license:
X
XCopyright (c) 2000-2003 Johannes Erdfelt <johannes@erdfelt.com>
XAll rights reserved.
X
XRedistribution and use in source and binary forms, with or without
Xmodification, are permitted provided that the following conditions
Xare met:
X1. Redistributions of source code must retain the above copyright
X   notice, this list of conditions and the following disclaimer.
X2. Redistributions in binary form must reproduce the above copyright
X   notice, this list of conditions and the following disclaimer in the
X   documentation and/or other materials provided with the distribution.
X3. The name of the author may not be used to endorse or promote products
X   derived from this software without specific prior written permission.
X
XTHIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
XIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
XOF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
XIN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
XINCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
XNOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
XDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
XTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
X(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
XTHIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
X
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/LICENSE' 'failed'
fi
# ============= libusb-0.1.8/Makefile.am ==============
if test -f 'libusb-0.1.8/Makefile.am' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/Makefile.am' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/Makefile.am' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/Makefile.am' &&
X## Process this file with automake to produce Makefile.in
X
X# require automake 1.4
X# gnu strictness chokes on README being autogenerated
XAUTOMAKE_OPTIONS = 1.4 foreign
X
XSUBDIRS = . tests doc
X
XCFLAGS=
X
Xconfigincludedir = $(pkglibdir)/include
X
Xbin_SCRIPTS = libusb-config
X
XEXTRA_DIST = LICENSE libusb.spec.in libusb.spec libusb-config.in README.in README INSTALL.libusb.in INSTALL.libusb
XEXTRA_libusb_la_SOURCE = linux.c linux.h bsd.c darwin.c
X
Xlib_LTLIBRARIES = libusb.la
X
Xif LINUX_API
XOS_SUPPORT = linux.c linux.h
Xelse
Xif BSD_API
XOS_SUPPORT = bsd.c
Xelse
Xif DARWIN_API
XOS_SUPPORT = darwin.c
XCFLAGS_EXT = -no-cpp-precomp
XLDADDS = -framework IOKit -framework CoreFoundation
Xelse
XOS_SUPPORT = 
Xendif
Xendif
Xendif
X
XCFLAGS+=$(CFLAGS_EXT)
X
Xlibusb_la_SOURCES = usb.c usbi.h error.c error.h descriptors.c $(OS_SUPPORT)
X
X# Do not add usb.h to *_SOURCES, regardless of dependencies.
X# It would be added to the dist tarball, which it shouldn't be.
Xnodist_include_HEADERS = usb.h
X
Xlibusb_la_LDFLAGS = \
X	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
X	-release $(LT_RELEASE) \
X	-export-dynamic \
X	$(LDADDS)
X
X.PHONY: files release snapshot
X
Xfiles:
X	@files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \
X	  echo $$p; \
X	done
X
Xrelease:
X	rm -rf .deps */.deps
X	$(MAKE) distcheck
X
Xsnapshot:
X	$(MAKE) dist distdir=$(PACKAGE)-`date +"%Y%m%d"`
X
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/Makefile.am' 'failed'
fi
# ============= libusb-0.1.8/Makefile.in ==============
if test -f 'libusb-0.1.8/Makefile.in' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/Makefile.in' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/Makefile.in' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/Makefile.in' &&
X# Makefile.in generated by automake 1.7.8 from Makefile.am.
X# @configure_input@
X
X# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
X# Free Software Foundation, Inc.
X# This Makefile.in is free software; the Free Software Foundation
X# gives unlimited permission to copy and/or distribute it,
X# with or without modifications, as long as this notice is preserved.
X
X# This program is distributed in the hope that it will be useful,
X# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
X# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
X# PARTICULAR PURPOSE.
X
X@SET_MAKE@
X
Xsrcdir = @srcdir@
Xtop_srcdir = @top_srcdir@
XVPATH = @srcdir@
Xpkgdatadir = $(datadir)/@PACKAGE@
Xpkglibdir = $(libdir)/@PACKAGE@
Xpkgincludedir = $(includedir)/@PACKAGE@
Xtop_builddir = .
X
Xam__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
XINSTALL = @INSTALL@
Xinstall_sh_DATA = $(install_sh) -c -m 644
Xinstall_sh_PROGRAM = $(install_sh) -c
Xinstall_sh_SCRIPT = $(install_sh) -c
XINSTALL_HEADER = $(INSTALL_DATA)
Xtransform = $(program_transform_name)
XNORMAL_INSTALL = :
XPRE_INSTALL = :
XPOST_INSTALL = :
XNORMAL_UNINSTALL = :
XPRE_UNINSTALL = :
XPOST_UNINSTALL = :
Xhost_triplet = @host@
XACLOCAL = @ACLOCAL@
XAMDEP_FALSE = @AMDEP_FALSE@
XAMDEP_TRUE = @AMDEP_TRUE@
XAMTAR = @AMTAR@
XAR = @AR@
XAUTOCONF = @AUTOCONF@
XAUTOHEADER = @AUTOHEADER@
XAUTOMAKE = @AUTOMAKE@
XAWK = @AWK@
XBIGENDIAN = @BIGENDIAN@
XBSD_API = @BSD_API@
XBSD_API_FALSE = @BSD_API_FALSE@
XBSD_API_TRUE = @BSD_API_TRUE@
XBUILD_DOCS_FALSE = @BUILD_DOCS_FALSE@
XBUILD_DOCS_TRUE = @BUILD_DOCS_TRUE@
XCC = @CC@
XCCDEPMODE = @CCDEPMODE@
X
XCFLAGS = $(CFLAGS_EXT)
XCPP = @CPP@
XCPPFLAGS = @CPPFLAGS@
XCXX = @CXX@
XCXXCPP = @CXXCPP@
XCXXDEPMODE = @CXXDEPMODE@
XCXXFLAGS = @CXXFLAGS@
XCYGPATH_W = @CYGPATH_W@
XDARWIN_API = @DARWIN_API@
XDARWIN_API_FALSE = @DARWIN_API_FALSE@
XDARWIN_API_TRUE = @DARWIN_API_TRUE@
XDEFS = @DEFS@
XDEPDIR = @DEPDIR@
XECHO = @ECHO@
XECHO_C = @ECHO_C@
XECHO_N = @ECHO_N@
XECHO_T = @ECHO_T@
XEGREP = @EGREP@
XEXEEXT = @EXEEXT@
XF77 = @F77@
XFFLAGS = @FFLAGS@
XINSTALL_DATA = @INSTALL_DATA@
XINSTALL_PROGRAM = @INSTALL_PROGRAM@
XINSTALL_SCRIPT = @INSTALL_SCRIPT@
XINSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
XJADE = @JADE@
XLDFLAGS = @LDFLAGS@
XLIBOBJS = @LIBOBJS@
XLIBS = @LIBS@
XLIBTOOL = @LIBTOOL@
XLIBUSB_BINARY_AGE = @LIBUSB_BINARY_AGE@
XLIBUSB_INTERFACE_AGE = @LIBUSB_INTERFACE_AGE@
XLIBUSB_MAJOR_VERSION = @LIBUSB_MAJOR_VERSION@
XLIBUSB_MICRO_VERSION = @LIBUSB_MICRO_VERSION@
XLIBUSB_MINOR_VERSION = @LIBUSB_MINOR_VERSION@
XLIBUSB_VERSION = @LIBUSB_VERSION@
XLINUX_API = @LINUX_API@
XLINUX_API_FALSE = @LINUX_API_FALSE@
XLINUX_API_TRUE = @LINUX_API_TRUE@
XLN_S = @LN_S@
XLTLIBOBJS = @LTLIBOBJS@
XLT_AGE = @LT_AGE@
XLT_CURRENT = @LT_CURRENT@
XLT_RELEASE = @LT_RELEASE@
XLT_REVISION = @LT_REVISION@
XMAINT = @MAINT@
XMAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
XMAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
XMAKEINFO = @MAKEINFO@
XOBJEXT = @OBJEXT@
XOSLIBS = @OSLIBS@
XPACKAGE = @PACKAGE@
XPACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
XPACKAGE_NAME = @PACKAGE_NAME@
XPACKAGE_STRING = @PACKAGE_STRING@
XPACKAGE_TARNAME = @PACKAGE_TARNAME@
XPACKAGE_VERSION = @PACKAGE_VERSION@
XPATH_SEPARATOR = @PATH_SEPARATOR@
XRANLIB = @RANLIB@
XSET_MAKE = @SET_MAKE@
XSHELL = @SHELL@
XSTRIP = @STRIP@
XVERSION = @VERSION@
Xac_ct_AR = @ac_ct_AR@
Xac_ct_CC = @ac_ct_CC@
Xac_ct_CXX = @ac_ct_CXX@
Xac_ct_F77 = @ac_ct_F77@
Xac_ct_RANLIB = @ac_ct_RANLIB@
Xac_ct_STRIP = @ac_ct_STRIP@
Xam__fastdepCC_FALSE = @am__fastdepCC_FALSE@
Xam__fastdepCC_TRUE = @am__fastdepCC_TRUE@
Xam__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
Xam__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
Xam__include = @am__include@
Xam__leading_dot = @am__leading_dot@
Xam__quote = @am__quote@
Xbindir = @bindir@
Xbuild = @build@
Xbuild_alias = @build_alias@
Xbuild_cpu = @build_cpu@
Xbuild_os = @build_os@
Xbuild_vendor = @build_vendor@
Xdatadir = @datadir@
Xexec_prefix = @exec_prefix@
Xhost = @host@
Xhost_alias = @host_alias@
Xhost_cpu = @host_cpu@
Xhost_os = @host_os@
Xhost_vendor = @host_vendor@
Xincludedir = @includedir@
Xinfodir = @infodir@
Xinstall_sh = @install_sh@
Xlibdir = @libdir@
Xlibexecdir = @libexecdir@
Xlocalstatedir = @localstatedir@
Xmandir = @mandir@
Xoldincludedir = @oldincludedir@
Xprefix = @prefix@
Xprogram_transform_name = @program_transform_name@
Xsbindir = @sbindir@
Xsharedstatedir = @sharedstatedir@
Xsysconfdir = @sysconfdir@
Xtarget_alias = @target_alias@
X
X# require automake 1.4
X# gnu strictness chokes on README being autogenerated
XAUTOMAKE_OPTIONS = 1.4 foreign
X
XSUBDIRS = . tests doc
X
Xconfigincludedir = $(pkglibdir)/include
X
Xbin_SCRIPTS = libusb-config
X
XEXTRA_DIST = LICENSE libusb.spec.in libusb.spec libusb-config.in README.in README INSTALL.libusb.in INSTALL.libusb
XEXTRA_libusb_la_SOURCE = linux.c linux.h bsd.c darwin.c
X
Xlib_LTLIBRARIES = libusb.la
X@BSD_API_FALSE@@DARWIN_API_FALSE@@LINUX_API_FALSE@OS_SUPPORT = 
X@BSD_API_TRUE@@LINUX_API_FALSE@OS_SUPPORT = bsd.c
X
X@LINUX_API_TRUE@OS_SUPPORT = linux.c linux.h
X@BSD_API_FALSE@@DARWIN_API_TRUE@@LINUX_API_FALSE@OS_SUPPORT = darwin.c
X@BSD_API_FALSE@@DARWIN_API_TRUE@@LINUX_API_FALSE@CFLAGS_EXT = -no-cpp-precomp
X@BSD_API_FALSE@@DARWIN_API_TRUE@@LINUX_API_FALSE@LDADDS = -framework IOKit -framework CoreFoundation
X
Xlibusb_la_SOURCES = usb.c usbi.h error.c error.h descriptors.c $(OS_SUPPORT)
X
X# Do not add usb.h to *_SOURCES, regardless of dependencies.
X# It would be added to the dist tarball, which it shouldn't be.
Xnodist_include_HEADERS = usb.h
X
Xlibusb_la_LDFLAGS = \
X	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
X	-release $(LT_RELEASE) \
X	-export-dynamic \
X	$(LDADDS)
X
Xsubdir = .
XACLOCAL_M4 = $(top_srcdir)/aclocal.m4
Xmkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
XCONFIG_HEADER = config.h
XCONFIG_CLEAN_FILES = libusb.spec libusb-config README INSTALL.libusb \
X	usb.h
XLTLIBRARIES = $(lib_LTLIBRARIES)
X
Xlibusb_la_LIBADD =
Xam__libusb_la_SOURCES_DIST = usb.c usbi.h error.c error.h descriptors.c \
X	bsd.c linux.c linux.h darwin.c
X@BSD_API_FALSE@@DARWIN_API_FALSE@@LINUX_API_FALSE@am__objects_1 =
X@BSD_API_FALSE@@DARWIN_API_TRUE@@LINUX_API_FALSE@am__objects_1 = \
X@BSD_API_FALSE@@DARWIN_API_TRUE@@LINUX_API_FALSE@	darwin.lo
X@BSD_API_TRUE@@LINUX_API_FALSE@am__objects_1 = bsd.lo
X@LINUX_API_TRUE@am__objects_1 = linux.lo
Xam_libusb_la_OBJECTS = usb.lo error.lo descriptors.lo $(am__objects_1)
Xlibusb_la_OBJECTS = $(am_libusb_la_OBJECTS)
XSCRIPTS = $(bin_SCRIPTS)
X
X
XDEFAULT_INCLUDES =  -I. -I$(srcdir) -I.
Xdepcomp = $(SHELL) $(top_srcdir)/depcomp
Xam__depfiles_maybe = depfiles
X@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/bsd.Plo ./$(DEPDIR)/darwin.Plo \
X@AMDEP_TRUE@	./$(DEPDIR)/descriptors.Plo ./$(DEPDIR)/error.Plo \
X@AMDEP_TRUE@	./$(DEPDIR)/linux.Plo ./$(DEPDIR)/usb.Plo
XCOMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
X	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
XLTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
X	$(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
XCCLD = $(CC)
XLINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
X	$(AM_LDFLAGS) $(LDFLAGS) -o $@
XDIST_SOURCES = $(am__libusb_la_SOURCES_DIST)
XHEADERS = $(nodist_include_HEADERS)
X
X
XRECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \
X	ps-recursive install-info-recursive uninstall-info-recursive \
X	all-recursive install-data-recursive install-exec-recursive \
X	installdirs-recursive install-recursive uninstall-recursive \
X	check-recursive installcheck-recursive
XDIST_COMMON = README $(srcdir)/Makefile.in $(srcdir)/configure AUTHORS \
X	COPYING ChangeLog INSTALL.libusb.in Makefile.am NEWS README.in \
X	aclocal.m4 config.guess config.h.in config.sub configure \
X	configure.in depcomp install-sh libusb-config.in libusb.spec.in \
X	ltmain.sh missing mkinstalldirs usb.h.in
XDIST_SUBDIRS = $(SUBDIRS)
XSOURCES = $(libusb_la_SOURCES)
X
Xall: config.h
X	$(MAKE) $(AM_MAKEFLAGS) all-recursive
X
X.SUFFIXES:
X.SUFFIXES: .c .lo .o .obj
X
Xam__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
X configure.lineno
X$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am  $(top_srcdir)/configure.in $(ACLOCAL_M4)
X	cd $(top_srcdir) && \
X	  $(AUTOMAKE) --foreign  Makefile
XMakefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in  $(top_builddir)/config.status
X	cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)
X
X$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
X	$(SHELL) ./config.status --recheck
X$(srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
X	cd $(srcdir) && $(AUTOCONF)
X
X$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in 
X	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
X
Xconfig.h: stamp-h1
X	@if test ! -f $@; then \
X	  rm -f stamp-h1; \
X	  $(MAKE) stamp-h1; \
X	else :; fi
X
Xstamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
X	@rm -f stamp-h1
X	cd $(top_builddir) && $(SHELL) ./config.status config.h
X
X$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(top_srcdir)/configure.in $(ACLOCAL_M4) 
X	cd $(top_srcdir) && $(AUTOHEADER)
X	touch $(srcdir)/config.h.in
X
Xdistclean-hdr:
X	-rm -f config.h stamp-h1
Xlibusb.spec: $(top_builddir)/config.status libusb.spec.in
X	cd $(top_builddir) && $(SHELL) ./config.status $@
Xlibusb-config: $(top_builddir)/config.status libusb-config.in
X	cd $(top_builddir) && $(SHELL) ./config.status $@
XREADME: $(top_builddir)/config.status README.in
X	cd $(top_builddir) && $(SHELL) ./config.status $@
XINSTALL.libusb: $(top_builddir)/config.status INSTALL.libusb.in
X	cd $(top_builddir) && $(SHELL) ./config.status $@
Xusb.h: $(top_builddir)/config.status usb.h.in
X	cd $(top_builddir) && $(SHELL) ./config.status $@
XlibLTLIBRARIES_INSTALL = $(INSTALL)
Xinstall-libLTLIBRARIES: $(lib_LTLIBRARIES)
X	@$(NORMAL_INSTALL)
X	$(mkinstalldirs) $(DESTDIR)$(libdir)
X	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
X	  if test -f $$p; then \
X	    f="`echo $$p | sed -e 's|^.*/||'`"; \
X	    echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \
X	    $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \
X	  else :; fi; \
X	done
X
Xuninstall-libLTLIBRARIES:
X	@$(NORMAL_UNINSTALL)
X	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
X	    p="`echo $$p | sed -e 's|^.*/||'`"; \
X	  echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \
X	  $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
X	done
X
Xclean-libLTLIBRARIES:
X	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
X	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
X	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
X	  test "$$dir" = "$$p" && dir=.; \
X	  echo "rm -f \"$${dir}/so_locations\""; \
X	  rm -f "$${dir}/so_locations"; \
X	done
Xlibusb.la: $(libusb_la_OBJECTS) $(libusb_la_DEPENDENCIES) 
X	$(LINK) -rpath $(libdir) $(libusb_la_LDFLAGS) $(libusb_la_OBJECTS) $(libusb_la_LIBADD) $(LIBS)
XbinSCRIPT_INSTALL = $(INSTALL_SCRIPT)
Xinstall-binSCRIPTS: $(bin_SCRIPTS)
X	@$(NORMAL_INSTALL)
X	$(mkinstalldirs) $(DESTDIR)$(bindir)
X	@list='$(bin_SCRIPTS)'; for p in $$list; do \
X	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
X	  if test -f $$d$$p; then \
X	    f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
X	    echo " $(binSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(bindir)/$$f"; \
X	    $(binSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(bindir)/$$f; \
X	  else :; fi; \
X	done
X
Xuninstall-binSCRIPTS:
X	@$(NORMAL_UNINSTALL)
X	@list='$(bin_SCRIPTS)'; for p in $$list; do \
X	  f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
X	  echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
X	  rm -f $(DESTDIR)$(bindir)/$$f; \
X	done
X
Xmostlyclean-compile:
X	-rm -f *.$(OBJEXT) core *.core
X
Xdistclean-compile:
X	-rm -f *.tab.c
X
X@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd.Plo@am__quote@
X@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/darwin.Plo@am__quote@
X@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/descriptors.Plo@am__quote@
X@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Plo@am__quote@
X@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linux.Plo@am__quote@
X@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/usb.Plo@am__quote@
X
X.c.o:
X@am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
X@am__fastdepCC_TRUE@	  -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
X@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
X@am__fastdepCC_TRUE@	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
X@am__fastdepCC_TRUE@	fi
X@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
X@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
X@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
X@am__fastdepCC_FALSE@	$(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
X
X.c.obj:
X@am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
X@am__fastdepCC_TRUE@	  -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
X@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
X@am__fastdepCC_TRUE@	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
X@am__fastdepCC_TRUE@	fi
X@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
X@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
X@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
X@am__fastdepCC_FALSE@	$(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
X
X.c.lo:
X@am__fastdepCC_TRUE@	if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
X@am__fastdepCC_TRUE@	  -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
X@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \
X@am__fastdepCC_TRUE@	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
X@am__fastdepCC_TRUE@	fi
X@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
X@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
X@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
X@am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
X
Xmostlyclean-libtool:
X	-rm -f *.lo
X
Xclean-libtool:
X	-rm -rf .libs _libs
X
Xdistclean-libtool:
X	-rm -f libtool
Xuninstall-info-am:
Xnodist_includeHEADERS_INSTALL = $(INSTALL_HEADER)
Xinstall-nodist_includeHEADERS: $(nodist_include_HEADERS)
X	@$(NORMAL_INSTALL)
X	$(mkinstalldirs) $(DESTDIR)$(includedir)
X	@list='$(nodist_include_HEADERS)'; for p in $$list; do \
X	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
X	  f="`echo $$p | sed -e 's|^.*/||'`"; \
X	  echo " $(nodist_includeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(includedir)/$$f"; \
X	  $(nodist_includeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(includedir)/$$f; \
X	done
X
Xuninstall-nodist_includeHEADERS:
X	@$(NORMAL_UNINSTALL)
X	@list='$(nodist_include_HEADERS)'; for p in $$list; do \
X	  f="`echo $$p | sed -e 's|^.*/||'`"; \
X	  echo " rm -f $(DESTDIR)$(includedir)/$$f"; \
X	  rm -f $(DESTDIR)$(includedir)/$$f; \
X	done
X
X# This directory's subdirectories are mostly independent; you can cd
X# into them and run `make' without going through this Makefile.
X# To change the values of `make' variables: instead of editing Makefiles,
X# (1) if the variable is set in `config.status', edit `config.status'
X#     (which will cause the Makefiles to be regenerated when you run `make');
X# (2) otherwise, pass the desired values on the `make' command line.
X$(RECURSIVE_TARGETS):
X	@set fnord $$MAKEFLAGS; amf=$$2; \
X	dot_seen=no; \
X	target=`echo $@ | sed s/-recursive//`; \
X	list='$(SUBDIRS)'; for subdir in $$list; do \
X	  echo "Making $$target in $$subdir"; \
X	  if test "$$subdir" = "."; then \
X	    dot_seen=yes; \
X	    local_target="$$target-am"; \
X	  else \
X	    local_target="$$target"; \
X	  fi; \
X	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
X	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
X	done; \
X	if test "$$dot_seen" = "no"; then \
X	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
X	fi; test -z "$$fail"
X
Xmostlyclean-recursive clean-recursive distclean-recursive \
Xmaintainer-clean-recursive:
X	@set fnord $$MAKEFLAGS; amf=$$2; \
X	dot_seen=no; \
X	case "$@" in \
X	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
X	  *) list='$(SUBDIRS)' ;; \
X	esac; \
X	rev=''; for subdir in $$list; do \
X	  if test "$$subdir" = "."; then :; else \
X	    rev="$$subdir $$rev"; \
X	  fi; \
X	done; \
X	rev="$$rev ."; \
X	target=`echo $@ | sed s/-recursive//`; \
X	for subdir in $$rev; do \
X	  echo "Making $$target in $$subdir"; \
X	  if test "$$subdir" = "."; then \
X	    local_target="$$target-am"; \
X	  else \
X	    local_target="$$target"; \
X	  fi; \
X	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
X	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
X	done && test -z "$$fail"
Xtags-recursive:
X	list='$(SUBDIRS)'; for subdir in $$list; do \
X	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
X	done
Xctags-recursive:
X	list='$(SUBDIRS)'; for subdir in $$list; do \
X	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
X	done
X
XETAGS = etags
XETAGSFLAGS =
X
XCTAGS = ctags
XCTAGSFLAGS =
X
Xtags: TAGS
X
XID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
X	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
X	unique=`for i in $$list; do \
X	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
X	  done | \
X	  $(AWK) '    { files[$$0] = 1; } \
X	       END { for (i in files) print i; }'`; \
X	mkid -fID $$unique
X
XTAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
X		$(TAGS_FILES) $(LISP)
X	tags=; \
X	here=`pwd`; \
X	if (etags --etags-include --version) >/dev/null 2>&1; then \
X	  include_option=--etags-include; \
X	else \
X	  include_option=--include; \
X	fi; \
X	list='$(SUBDIRS)'; for subdir in $$list; do \
X	  if test "$$subdir" = .; then :; else \
X	    test -f $$subdir/TAGS && \
X	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
X	  fi; \
X	done; \
X	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
X	unique=`for i in $$list; do \
X	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
X	  done | \
X	  $(AWK) '    { files[$$0] = 1; } \
X	       END { for (i in files) print i; }'`; \
X	test -z "$(ETAGS_ARGS)$$tags$$unique" \
X	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
X	     $$tags $$unique
X
Xctags: CTAGS
XCTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
X		$(TAGS_FILES) $(LISP)
X	tags=; \
X	here=`pwd`; \
X	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
X	unique=`for i in $$list; do \
X	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
X	  done | \
X	  $(AWK) '    { files[$$0] = 1; } \
X	       END { for (i in files) print i; }'`; \
X	test -z "$(CTAGS_ARGS)$$tags$$unique" \
X	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
X	     $$tags $$unique
X
XGTAGS:
X	here=`$(am__cd) $(top_builddir) && pwd` \
X	  && cd $(top_srcdir) \
X	  && gtags -i $(GTAGS_ARGS) $$here
X
Xdistclean-tags:
X	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
XDISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
X
Xtop_distdir = .
Xdistdir = $(PACKAGE)-$(VERSION)
X
Xam__remove_distdir = \
X  { test ! -d $(distdir) \
X    || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
X         && rm -fr $(distdir); }; }
X
XGZIP_ENV = --best
Xdistuninstallcheck_listfiles = find . -type f -print
Xdistcleancheck_listfiles = find . -type f -print
X
Xdistdir: $(DISTFILES)
X	$(am__remove_distdir)
X	mkdir $(distdir)
X	$(mkinstalldirs) $(distdir)/.
X	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
X	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
X	list='$(DISTFILES)'; for file in $$list; do \
X	  case $$file in \
X	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
X	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
X	  esac; \
X	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
X	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
X	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
X	    dir="/$$dir"; \
X	    $(mkinstalldirs) "$(distdir)$$dir"; \
X	  else \
X	    dir=''; \
X	  fi; \
X	  if test -d $$d/$$file; then \
X	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
X	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
X	    fi; \
X	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
X	  else \
X	    test -f $(distdir)/$$file \
X	    || cp -p $$d/$$file $(distdir)/$$file \
X	    || exit 1; \
X	  fi; \
X	done
X	list='$(SUBDIRS)'; for subdir in $$list; do \
X	  if test "$$subdir" = .; then :; else \
X	    test -d $(distdir)/$$subdir \
X	    || mkdir $(distdir)/$$subdir \
X	    || exit 1; \
X	    (cd $$subdir && \
X	      $(MAKE) $(AM_MAKEFLAGS) \
X	        top_distdir="$(top_distdir)" \
X	        distdir=../$(distdir)/$$subdir \
X	        distdir) \
X	      || exit 1; \
X	  fi; \
X	done
X	-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
X	  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
X	  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
X	  ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
X	|| chmod -R a+r $(distdir)
Xdist-gzip: distdir
X	$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
X	$(am__remove_distdir)
X
Xdist dist-all: distdir
X	$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
X	$(am__remove_distdir)
X
X# This target untars the dist file and tries a VPATH configuration.  Then
X# it guarantees that the distribution is self-contained by making another
X# tarfile.
Xdistcheck: dist
X	$(am__remove_distdir)
X	GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
X	chmod -R a-w $(distdir); chmod a+w $(distdir)
X	mkdir $(distdir)/_build
X	mkdir $(distdir)/_inst
X	chmod a-w $(distdir)
X	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
X	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
X	  && cd $(distdir)/_build \
X	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
X	    $(DISTCHECK_CONFIGURE_FLAGS) \
X	  && $(MAKE) $(AM_MAKEFLAGS) \
X	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
X	  && $(MAKE) $(AM_MAKEFLAGS) check \
X	  && $(MAKE) $(AM_MAKEFLAGS) install \
X	  && $(MAKE) $(AM_MAKEFLAGS) installcheck \
X	  && $(MAKE) $(AM_MAKEFLAGS) uninstall \
X	  && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
X	        distuninstallcheck \
X	  && chmod -R a-w "$$dc_install_base" \
X	  && ({ \
X	       (cd ../.. && $(mkinstalldirs) "$$dc_destdir") \
X	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
X	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
X	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
X	            distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
X	      } || { rm -rf "$$dc_destdir"; exit 1; }) \
X	  && rm -rf "$$dc_destdir" \
X	  && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \
X	  && rm -f $(distdir).tar.gz \
X	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
X	$(am__remove_distdir)
X	@echo "$(distdir).tar.gz is ready for distribution" | \
X	  sed 'h;s/./=/g;p;x;p;x'
Xdistuninstallcheck:
X	@cd $(distuninstallcheck_dir) \
X	&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
X	   || { echo "ERROR: files left after uninstall:" ; \
X	        if test -n "$(DESTDIR)"; then \
X	          echo "  (check DESTDIR support)"; \
X	        fi ; \
X	        $(distuninstallcheck_listfiles) ; \
X	        exit 1; } >&2
Xdistcleancheck: distclean
X	@if test '$(srcdir)' = . ; then \
X	  echo "ERROR: distcleancheck can only run from a VPATH build" ; \
X	  exit 1 ; \
X	fi
X	@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
X	  || { echo "ERROR: files left in build directory after distclean:" ; \
X	       $(distcleancheck_listfiles) ; \
X	       exit 1; } >&2
Xcheck-am: all-am
Xcheck: check-recursive
Xall-am: Makefile $(LTLIBRARIES) $(SCRIPTS) $(HEADERS) config.h
Xinstalldirs: installdirs-recursive
Xinstalldirs-am:
X	$(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(bindir) $(DESTDIR)$(includedir)
X
Xinstall: install-recursive
Xinstall-exec: install-exec-recursive
Xinstall-data: install-data-recursive
Xuninstall: uninstall-recursive
X
Xinstall-am: all-am
X	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
X
Xinstallcheck: installcheck-recursive
Xinstall-strip:
X	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
X	  INSTALL_STRIP_FLAG=-s \
X	  `test -z '$(STRIP)' || \
X	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
Xmostlyclean-generic:
X
Xclean-generic:
X
Xdistclean-generic:
X	-rm -f $(CONFIG_CLEAN_FILES)
X
Xmaintainer-clean-generic:
X	@echo "This command is intended for maintainers to use"
X	@echo "it deletes files that may require special tools to rebuild."
Xclean: clean-recursive
X
Xclean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
X	mostlyclean-am
X
Xdistclean: distclean-recursive
X	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
X	-rm -rf ./$(DEPDIR)
X	-rm -f Makefile
Xdistclean-am: clean-am distclean-compile distclean-generic distclean-hdr \
X	distclean-libtool distclean-tags
X
Xdvi: dvi-recursive
X
Xdvi-am:
X
Xinfo: info-recursive
X
Xinfo-am:
X
Xinstall-data-am: install-nodist_includeHEADERS
X
Xinstall-exec-am: install-binSCRIPTS install-libLTLIBRARIES
X
Xinstall-info: install-info-recursive
X
Xinstall-man:
X
Xinstallcheck-am:
X
Xmaintainer-clean: maintainer-clean-recursive
X	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
X	-rm -rf $(top_srcdir)/autom4te.cache
X	-rm -rf ./$(DEPDIR)
X	-rm -f Makefile
Xmaintainer-clean-am: distclean-am maintainer-clean-generic
X
Xmostlyclean: mostlyclean-recursive
X
Xmostlyclean-am: mostlyclean-compile mostlyclean-generic \
X	mostlyclean-libtool
X
Xpdf: pdf-recursive
X
Xpdf-am:
X
Xps: ps-recursive
X
Xps-am:
X
Xuninstall-am: uninstall-binSCRIPTS uninstall-info-am \
X	uninstall-libLTLIBRARIES uninstall-nodist_includeHEADERS
X
Xuninstall-info: uninstall-info-recursive
X
X.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \
X	clean-generic clean-libLTLIBRARIES clean-libtool \
X	clean-recursive ctags ctags-recursive dist dist-all dist-gzip \
X	distcheck distclean distclean-compile distclean-generic \
X	distclean-hdr distclean-libtool distclean-recursive \
X	distclean-tags distcleancheck distdir distuninstallcheck dvi \
X	dvi-am dvi-recursive info info-am info-recursive install \
X	install-am install-binSCRIPTS install-data install-data-am \
X	install-data-recursive install-exec install-exec-am \
X	install-exec-recursive install-info install-info-am \
X	install-info-recursive install-libLTLIBRARIES install-man \
X	install-nodist_includeHEADERS install-recursive install-strip \
X	installcheck installcheck-am installdirs installdirs-am \
X	installdirs-recursive maintainer-clean maintainer-clean-generic \
X	maintainer-clean-recursive mostlyclean mostlyclean-compile \
X	mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \
X	pdf pdf-am pdf-recursive ps ps-am ps-recursive tags \
X	tags-recursive uninstall uninstall-am uninstall-binSCRIPTS \
X	uninstall-info-am uninstall-info-recursive \
X	uninstall-libLTLIBRARIES uninstall-nodist_includeHEADERS \
X	uninstall-recursive
X
X
X.PHONY: files release snapshot
X
Xfiles:
X	@files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \
X	  echo $$p; \
X	done
X
Xrelease:
X	rm -rf .deps */.deps
X	$(MAKE) distcheck
X
Xsnapshot:
X	$(MAKE) dist distdir=$(PACKAGE)-`date +"%Y%m%d"`
X# Tell versions [3.59,3.63) of GNU make to not export all variables.
X# Otherwise a system limit (for SysV at least) may be exceeded.
X.NOEXPORT:
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/Makefile.in' 'failed'
fi
# ============= libusb-0.1.8/NEWS ==============
if test -f 'libusb-0.1.8/NEWS' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/NEWS' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/NEWS' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/NEWS' &&
XCreated
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/NEWS' 'failed'
fi
# ============= libusb-0.1.8/README ==============
if test -f 'libusb-0.1.8/README' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/README' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/README' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/README' &&
XGeneral Information
X===================
X
XThis is libusb version 0.1.8. libusb is a library which allows
Xuserspace application access to USB devices.
X
XThe official ftp site is:
X  ftp://ftp.libusb.sourceforge.net/pub/libusb/
X
XThe official web site is:
X  http://libusb.sourceforge.net/
X
XA mailing list is located at:
X  libusb-devel@sourceforge.net
X
XInstallation
X============
X
XSee the file 'INSTALL'
X
XHow to report bugs
X==================
X
XTo report a bug, visit http://www.sourceforge.net/projects/libusb/ and fill
Xout a bug report form.
X
XPlease make sure to include:
X
X* The version of libusb
X
X* Information about your system. For instance:
X
X   - What operating system and version
X   - For Linux, what version of the C library
X
X  And anything else you think is relevant.
X
X* How to reproduce the bug. 
X
X  If you can reproduce it with the testlibusb program that is built 
X  in the libusb/ directory, that will be most convenient.  Otherwise, 
X  please include a short test program that exhibits the behavior. 
X  As a last resort, you can also provide a pointer to a larger piece 
X  of software that can be downloaded.
X
X* If the bug was a crash, the exact text that was printed out
X  when the crash occured.
X
X* Further information such as stack traces may be useful, but
X  is not necessary.
X
XPatches
X=======
X
XPatches can be sent to libusb-devel@sourceforge.net.
X
XIf the patch fixes a bug, it is usually a good idea to include
Xall the information described in "How to Report Bugs".
X
XBuilding
X========
X
XIt should be as simple as running these two commands:
X
X./configure
Xmake
X
XOne common problem is building the SGML documentation. On some systems,
Xlike SuSE, you will need to set the SGML_CATALOG_FILES environment
Xvariable to something similar to this (actual paths may vary):
X
XSGML_CATALOG_FILES="/usr/share/sgml/CATALOG.docbook_3:/usr/share/sgml/CATALOG.docbook-dsssl-stylesheets:/usr/share/sgml/openjade/catalog"
X
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/README' 'failed'
fi
# ============= libusb-0.1.8/README.in ==============
if test -f 'libusb-0.1.8/README.in' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/README.in' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/README.in' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/README.in' &&
XGeneral Information
X===================
X
XThis is libusb version @LIBUSB_VERSION@. libusb is a library which allows
Xuserspace application access to USB devices.
X
XThe official ftp site is:
X  ftp://ftp.libusb.sourceforge.net/pub/libusb/
X
XThe official web site is:
X  http://libusb.sourceforge.net/
X
XA mailing list is located at:
X  libusb-devel@sourceforge.net
X
XInstallation
X============
X
XSee the file 'INSTALL'
X
XHow to report bugs
X==================
X
XTo report a bug, visit http://www.sourceforge.net/projects/libusb/ and fill
Xout a bug report form.
X
XPlease make sure to include:
X
X* The version of libusb
X
X* Information about your system. For instance:
X
X   - What operating system and version
X   - For Linux, what version of the C library
X
X  And anything else you think is relevant.
X
X* How to reproduce the bug. 
X
X  If you can reproduce it with the testlibusb program that is built 
X  in the libusb/ directory, that will be most convenient.  Otherwise, 
X  please include a short test program that exhibits the behavior. 
X  As a last resort, you can also provide a pointer to a larger piece 
X  of software that can be downloaded.
X
X* If the bug was a crash, the exact text that was printed out
X  when the crash occured.
X
X* Further information such as stack traces may be useful, but
X  is not necessary.
X
XPatches
X=======
X
XPatches can be sent to libusb-devel@sourceforge.net.
X
XIf the patch fixes a bug, it is usually a good idea to include
Xall the information described in "How to Report Bugs".
X
XBuilding
X========
X
XIt should be as simple as running these two commands:
X
X./configure
Xmake
X
XOne common problem is building the SGML documentation. On some systems,
Xlike SuSE, you will need to set the SGML_CATALOG_FILES environment
Xvariable to something similar to this (actual paths may vary):
X
XSGML_CATALOG_FILES="/usr/share/sgml/CATALOG.docbook_3:/usr/share/sgml/CATALOG.docbook-dsssl-stylesheets:/usr/share/sgml/openjade/catalog"
X
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/README.in' 'failed'
fi
# ============= libusb-0.1.8/aclocal.m4 ==============
if test -f 'libusb-0.1.8/aclocal.m4' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/aclocal.m4' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/aclocal.m4' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/aclocal.m4' &&
X# generated automatically by aclocal 1.7.8 -*- Autoconf -*-
X
X# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
X# Free Software Foundation, Inc.
X# This file is free software; the Free Software Foundation
X# gives unlimited permission to copy and/or distribute it,
X# with or without modifications, as long as this notice is preserved.
X
X# This program is distributed in the hope that it will be useful,
X# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
X# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
X# PARTICULAR PURPOSE.
X
X# Do all the work for Automake.                            -*- Autoconf -*-
X
X# This macro actually does too much some checks are only needed if
X# your package does certain things.  But this isn't really a big deal.
X
X# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
X# Free Software Foundation, Inc.
X
X# This program is free software; you can redistribute it and/or modify
X# it under the terms of the GNU General Public License as published by
X# the Free Software Foundation; either version 2, or (at your option)
X# any later version.
X
X# This program is distributed in the hope that it will be useful,
X# but WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X# GNU General Public License for more details.
X
X# You should have received a copy of the GNU General Public License
X# along with this program; if not, write to the Free Software
X# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
X# 02111-1307, USA.
X
X# serial 10
X
XAC_PREREQ([2.54])
X
X# Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
X# the ones we care about.
Xm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
X
X# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
X# AM_INIT_AUTOMAKE([OPTIONS])
X# -----------------------------------------------
X# The call with PACKAGE and VERSION arguments is the old style
X# call (pre autoconf-2.50), which is being phased out.  PACKAGE
X# and VERSION should now be passed to AC_INIT and removed from
X# the call to AM_INIT_AUTOMAKE.
X# We support both call styles for the transition.  After
X# the next Automake release, Autoconf can make the AC_INIT
X# arguments mandatory, and then we can depend on a new Autoconf
X# release and drop the old call support.
XAC_DEFUN([AM_INIT_AUTOMAKE],
X[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
X AC_REQUIRE([AC_PROG_INSTALL])dnl
X# test to see if srcdir already configured
Xif test "`cd $srcdir && pwd`" != "`pwd`" &&
X   test -f $srcdir/config.status; then
X  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
Xfi
X
X# test whether we have cygpath
Xif test -z "$CYGPATH_W"; then
X  if (cygpath --version) >/dev/null 2>/dev/null; then
X    CYGPATH_W='cygpath -w'
X  else
X    CYGPATH_W=echo
X  fi
Xfi
XAC_SUBST([CYGPATH_W])
X
X# Define the identity of the package.
Xdnl Distinguish between old-style and new-style calls.
Xm4_ifval([$2],
X[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
X AC_SUBST([PACKAGE], [$1])dnl
X AC_SUBST([VERSION], [$2])],
X[_AM_SET_OPTIONS([$1])dnl
X AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
X AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
X
X_AM_IF_OPTION([no-define],,
X[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
X AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
X
X# Some tools Automake needs.
XAC_REQUIRE([AM_SANITY_CHECK])dnl
XAC_REQUIRE([AC_ARG_PROGRAM])dnl
XAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
XAM_MISSING_PROG(AUTOCONF, autoconf)
XAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
XAM_MISSING_PROG(AUTOHEADER, autoheader)
XAM_MISSING_PROG(MAKEINFO, makeinfo)
XAM_MISSING_PROG(AMTAR, tar)
XAM_PROG_INSTALL_SH
XAM_PROG_INSTALL_STRIP
X# We need awk for the "check" target.  The system "awk" is bad on
X# some platforms.
XAC_REQUIRE([AC_PROG_AWK])dnl
XAC_REQUIRE([AC_PROG_MAKE_SET])dnl
XAC_REQUIRE([AM_SET_LEADING_DOT])dnl
X
X_AM_IF_OPTION([no-dependencies],,
X[AC_PROVIDE_IFELSE([AC_PROG_CC],
X                  [_AM_DEPENDENCIES(CC)],
X                  [define([AC_PROG_CC],
X                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
XAC_PROVIDE_IFELSE([AC_PROG_CXX],
X                  [_AM_DEPENDENCIES(CXX)],
X                  [define([AC_PROG_CXX],
X                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
X])
X])
X
X
X# When config.status generates a header, we must update the stamp-h file.
X# This file resides in the same directory as the config header
X# that is generated.  The stamp files are numbered to have different names.
X
X# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
X# loop where config.status creates the headers, so we can generate
X# our stamp files there.
XAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
X[# Compute $1's index in $config_headers.
X_am_stamp_count=1
Xfor _am_header in $config_headers :; do
X  case $_am_header in
X    $1 | $1:* )
X      break ;;
X    * )
X      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
X  esac
Xdone
Xecho "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
X
X# Copyright 2002  Free Software Foundation, Inc.
X
X# This program is free software; you can redistribute it and/or modify
X# it under the terms of the GNU General Public License as published by
X# the Free Software Foundation; either version 2, or (at your option)
X# any later version.
X
X# This program is distributed in the hope that it will be useful,
X# but WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X# GNU General Public License for more details.
X
X# You should have received a copy of the GNU General Public License
X# along with this program; if not, write to the Free Software
X# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
X
X# AM_AUTOMAKE_VERSION(VERSION)
X# ----------------------------
X# Automake X.Y traces this macro to ensure aclocal.m4 has been
X# generated from the m4 files accompanying Automake X.Y.
XAC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
X
X# AM_SET_CURRENT_AUTOMAKE_VERSION
X# -------------------------------
X# Call AM_AUTOMAKE_VERSION so it can be traced.
X# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
XAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
X	 [AM_AUTOMAKE_VERSION([1.7.8])])
X
X# Helper functions for option handling.                    -*- Autoconf -*-
X
X# Copyright 2001, 2002  Free Software Foundation, Inc.
X
X# This program is free software; you can redistribute it and/or modify
X# it under the terms of the GNU General Public License as published by
X# the Free Software Foundation; either version 2, or (at your option)
X# any later version.
X
X# This program is distributed in the hope that it will be useful,
X# but WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X# GNU General Public License for more details.
X
X# You should have received a copy of the GNU General Public License
X# along with this program; if not, write to the Free Software
X# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
X# 02111-1307, USA.
X
X# serial 2
X
X# _AM_MANGLE_OPTION(NAME)
X# -----------------------
XAC_DEFUN([_AM_MANGLE_OPTION],
X[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
X
X# _AM_SET_OPTION(NAME)
X# ------------------------------
X# Set option NAME.  Presently that only means defining a flag for this option.
XAC_DEFUN([_AM_SET_OPTION],
X[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
X
X# _AM_SET_OPTIONS(OPTIONS)
X# ----------------------------------
X# OPTIONS is a space-separated list of Automake options.
XAC_DEFUN([_AM_SET_OPTIONS],
X[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
X
X# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
X# -------------------------------------------
X# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
XAC_DEFUN([_AM_IF_OPTION],
X[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
X
X#
X# Check to make sure that the build environment is sane.
X#
X
X# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
X
X# This program is free software; you can redistribute it and/or modify
X# it under the terms of the GNU General Public License as published by
X# the Free Software Foundation; either version 2, or (at your option)
X# any later version.
X
X# This program is distributed in the hope that it will be useful,
X# but WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X# GNU General Public License for more details.
X
X# You should have received a copy of the GNU General Public License
X# along with this program; if not, write to the Free Software
X# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
X# 02111-1307, USA.
X
X# serial 3
X
X# AM_SANITY_CHECK
X# ---------------
XAC_DEFUN([AM_SANITY_CHECK],
X[AC_MSG_CHECKING([whether build environment is sane])
X# Just in case
Xsleep 1
Xecho timestamp > conftest.file
X# Do `set' in a subshell so we don't clobber the current shell's
X# arguments.  Must try -L first in case configure is actually a
X# symlink; some systems play weird games with the mod time of symlinks
X# (eg FreeBSD returns the mod time of the symlink's containing
X# directory).
Xif (
X   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
X   if test "$[*]" = "X"; then
X      # -L didn't work.
X      set X `ls -t $srcdir/configure conftest.file`
X   fi
X   rm -f conftest.file
X   if test "$[*]" != "X $srcdir/configure conftest.file" \
X      && test "$[*]" != "X conftest.file $srcdir/configure"; then
X
X      # If neither matched, then we have a broken ls.  This can happen
X      # if, for instance, CONFIG_SHELL is bash and it inherits a
X      # broken ls alias from the environment.  This has actually
X      # happened.  Such a system could not be considered "sane".
X      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
Xalias in your environment])
X   fi
X
X   test "$[2]" = conftest.file
X   )
Xthen
X   # Ok.
X   :
Xelse
X   AC_MSG_ERROR([newly created file is older than distributed files!
XCheck your system clock])
Xfi
XAC_MSG_RESULT(yes)])
X
X#  -*- Autoconf -*-
X
X
X# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
X
X# This program is free software; you can redistribute it and/or modify
X# it under the terms of the GNU General Public License as published by
X# the Free Software Foundation; either version 2, or (at your option)
X# any later version.
X
X# This program is distributed in the hope that it will be useful,
X# but WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X# GNU General Public License for more details.
X
X# You should have received a copy of the GNU General Public License
X# along with this program; if not, write to the Free Software
X# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
X# 02111-1307, USA.
X
X# serial 3
X
X# AM_MISSING_PROG(NAME, PROGRAM)
X# ------------------------------
XAC_DEFUN([AM_MISSING_PROG],
X[AC_REQUIRE([AM_MISSING_HAS_RUN])
X$1=${$1-"${am_missing_run}$2"}
XAC_SUBST($1)])
X
X
X# AM_MISSING_HAS_RUN
X# ------------------
X# Define MISSING if not defined so far and test if it supports --run.
X# If it does, set am_missing_run to use it, otherwise, to nothing.
XAC_DEFUN([AM_MISSING_HAS_RUN],
X[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
Xtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
X# Use eval to expand $SHELL
Xif eval "$MISSING --run true"; then
X  am_missing_run="$MISSING --run "
Xelse
X  am_missing_run=
X  AC_MSG_WARN([`missing' script is too old or missing])
Xfi
X])
X
X# AM_AUX_DIR_EXPAND
X
X# Copyright 2001 Free Software Foundation, Inc.
X
X# This program is free software; you can redistribute it and/or modify
X# it under the terms of the GNU General Public License as published by
X# the Free Software Foundation; either version 2, or (at your option)
X# any later version.
X
X# This program is distributed in the hope that it will be useful,
X# but WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X# GNU General Public License for more details.
X
X# You should have received a copy of the GNU General Public License
X# along with this program; if not, write to the Free Software
X# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
X# 02111-1307, USA.
X
X# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
X# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
X# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
X#
X# Of course, Automake must honor this variable whenever it calls a
X# tool from the auxiliary directory.  The problem is that $srcdir (and
X# therefore $ac_aux_dir as well) can be either absolute or relative,
X# depending on how configure is run.  This is pretty annoying, since
X# it makes $ac_aux_dir quite unusable in subdirectories: in the top
X# source directory, any form will work fine, but in subdirectories a
X# relative path needs to be adjusted first.
X#
X# $ac_aux_dir/missing
X#    fails when called from a subdirectory if $ac_aux_dir is relative
X# $top_srcdir/$ac_aux_dir/missing
X#    fails if $ac_aux_dir is absolute,
X#    fails when called from a subdirectory in a VPATH build with
X#          a relative $ac_aux_dir
X#
X# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
X# are both prefixed by $srcdir.  In an in-source build this is usually
X# harmless because $srcdir is `.', but things will broke when you
X# start a VPATH build or use an absolute $srcdir.
X#
X# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
X# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
X#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
X# and then we would define $MISSING as
X#   MISSING="\${SHELL} $am_aux_dir/missing"
X# This will work as long as MISSING is not called from configure, because
X# unfortunately $(top_srcdir) has no meaning in configure.
X# However there are other variables, like CC, which are often used in
X# configure, and could therefore not use this "fixed" $ac_aux_dir.
X#
X# Another solution, used here, is to always expand $ac_aux_dir to an
X# absolute PATH.  The drawback is that using absolute paths prevent a
X# configured tree to be moved without reconfiguration.
X
X# Rely on autoconf to set up CDPATH properly.
XAC_PREREQ([2.50])
X
XAC_DEFUN([AM_AUX_DIR_EXPAND], [
X# expand $ac_aux_dir to an absolute path
Xam_aux_dir=`cd $ac_aux_dir && pwd`
X])
X
X# AM_PROG_INSTALL_SH
X# ------------------
X# Define $install_sh.
X
X# Copyright 2001 Free Software Foundation, Inc.
X
X# This program is free software; you can redistribute it and/or modify
X# it under the terms of the GNU General Public License as published by
X# the Free Software Foundation; either version 2, or (at your option)
X# any later version.
X
X# This program is distributed in the hope that it will be useful,
X# but WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X# GNU General Public License for more details.
X
X# You should have received a copy of the GNU General Public License
X# along with this program; if not, write to the Free Software
X# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
X# 02111-1307, USA.
X
XAC_DEFUN([AM_PROG_INSTALL_SH],
X[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
Xinstall_sh=${install_sh-"$am_aux_dir/install-sh"}
XAC_SUBST(install_sh)])
X
X# AM_PROG_INSTALL_STRIP
X
X# Copyright 2001 Free Software Foundation, Inc.
X
X# This program is free software; you can redistribute it and/or modify
X# it under the terms of the GNU General Public License as published by
X# the Free Software Foundation; either version 2, or (at your option)
X# any later version.
X
X# This program is distributed in the hope that it will be useful,
X# but WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X# GNU General Public License for more details.
X
X# You should have received a copy of the GNU General Public License
X# along with this program; if not, write to the Free Software
X# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
X# 02111-1307, USA.
X
X# One issue with vendor `install' (even GNU) is that you can't
X# specify the program used to strip binaries.  This is especially
X# annoying in cross-compiling environments, where the build's strip
X# is unlikely to handle the host's binaries.
X# Fortunately install-sh will honor a STRIPPROG variable, so we
X# always use install-sh in `make install-strip', and initialize
X# STRIPPROG with the value of the STRIP variable (set by the user).
XAC_DEFUN([AM_PROG_INSTALL_STRIP],
X[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
X# Installed binaries are usually stripped using `strip' when the user
X# run `make install-strip'.  However `strip' might not be the right
X# tool to use in cross-compilation environments, therefore Automake
X# will honor the `STRIP' environment variable to overrule this program.
Xdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
Xif test "$cross_compiling" != no; then
X  AC_CHECK_TOOL([STRIP], [strip], :)
Xfi
XINSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
XAC_SUBST([INSTALL_STRIP_PROGRAM])])
X
X#                                                          -*- Autoconf -*-
X# Copyright (C) 2003  Free Software Foundation, Inc.
X
X# This program is free software; you can redistribute it and/or modify
X# it under the terms of the GNU General Public License as published by
X# the Free Software Foundation; either version 2, or (at your option)
X# any later version.
X
X# This program is distributed in the hope that it will be useful,
X# but WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X# GNU General Public License for more details.
X
X# You should have received a copy of the GNU General Public License
X# along with this program; if not, write to the Free Software
X# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
X# 02111-1307, USA.
X
X# serial 1
X
X# Check whether the underlying file-system supports filenames
X# with a leading dot.  For instance MS-DOS doesn't.
XAC_DEFUN([AM_SET_LEADING_DOT],
X[rm -rf .tst 2>/dev/null
Xmkdir .tst 2>/dev/null
Xif test -d .tst; then
X  am__leading_dot=.
Xelse
X  am__leading_dot=_
Xfi
Xrmdir .tst 2>/dev/null
XAC_SUBST([am__leading_dot])])
X
X# serial 5						-*- Autoconf -*-
X
X# Copyright (C) 1999, 2000, 2001, 2002, 2003  Free Software Foundation, Inc.
X
X# This program is free software; you can redistribute it and/or modify
X# it under the terms of the GNU General Public License as published by
X# the Free Software Foundation; either version 2, or (at your option)
X# any later version.
X
X# This program is distributed in the hope that it will be useful,
X# but WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X# GNU General Public License for more details.
X
X# You should have received a copy of the GNU General Public License
X# along with this program; if not, write to the Free Software
X# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
X# 02111-1307, USA.
X
X
X# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
X# written in clear, in which case automake, when reading aclocal.m4,
X# will think it sees a *use*, and therefore will trigger all it's
X# C support machinery.  Also note that it means that autoscan, seeing
X# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
X
X
X
X# _AM_DEPENDENCIES(NAME)
X# ----------------------
X# See how the compiler implements dependency checking.
X# NAME is "CC", "CXX", "GCJ", or "OBJC".
X# We try a few techniques and use that to set a single cache variable.
X#
X# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
X# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
X# dependency, and given that the user is not expected to run this macro,
X# just rely on AC_PROG_CC.
XAC_DEFUN([_AM_DEPENDENCIES],
X[AC_REQUIRE([AM_SET_DEPDIR])dnl
XAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
XAC_REQUIRE([AM_MAKE_INCLUDE])dnl
XAC_REQUIRE([AM_DEP_TRACK])dnl
X
Xifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
X       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
X       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
X       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
X                   [depcc="$$1"   am_compiler_list=])
X
XAC_CACHE_CHECK([dependency style of $depcc],
X               [am_cv_$1_dependencies_compiler_type],
X[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
X  # We make a subdir and do the tests there.  Otherwise we can end up
X  # making bogus files that we don't know about and never remove.  For
X  # instance it was reported that on HP-UX the gcc test will end up
X  # making a dummy file named `D' -- because `-MD' means `put the output
X  # in D'.
X  mkdir conftest.dir
X  # Copy depcomp to subdir because otherwise we won't find it if we're
X  # using a relative directory.
X  cp "$am_depcomp" conftest.dir
X  cd conftest.dir
X  # We will build objects and dependencies in a subdirectory because
X  # it helps to detect inapplicable dependency modes.  For instance
X  # both Tru64's cc and ICC support -MD to output dependencies as a
X  # side effect of compilation, but ICC will put the dependencies in
X  # the current directory while Tru64 will put them in the object
X  # directory.
X  mkdir sub
X
X  am_cv_$1_dependencies_compiler_type=none
X  if test "$am_compiler_list" = ""; then
X     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
X  fi
X  for depmode in $am_compiler_list; do
X    # Setup a source with many dependencies, because some compilers
X    # like to wrap large dependency lists on column 80 (with \), and
X    # we should not choose a depcomp mode which is confused by this.
X    #
X    # We need to recreate these files for each test, as the compiler may
X    # overwrite some of them when testing with obscure command lines.
X    # This happens at least with the AIX C compiler.
X    : > sub/conftest.c
X    for i in 1 2 3 4 5 6; do
X      echo '#include "conftst'$i'.h"' >> sub/conftest.c
X      : > sub/conftst$i.h
X    done
X    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
X
X    case $depmode in
X    nosideeffect)
X      # after this tag, mechanisms are not by side-effect, so they'll
X      # only be used when explicitly requested
X      if test "x$enable_dependency_tracking" = xyes; then
X	continue
X      else
X	break
X      fi
X      ;;
X    none) break ;;
X    esac
X    # We check with `-c' and `-o' for the sake of the "dashmstdout"
X    # mode.  It turns out that the SunPro C++ compiler does not properly
X    # handle `-M -o', and we need to detect this.
X    if depmode=$depmode \
X       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
X       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
X       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
X         >/dev/null 2>conftest.err &&
X       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
X       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
X       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
X      # icc doesn't choke on unknown options, it will just issue warnings
X      # (even with -Werror).  So we grep stderr for any message
X      # that says an option was ignored.
X      if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
X        am_cv_$1_dependencies_compiler_type=$depmode
X        break
X      fi
X    fi
X  done
X
X  cd ..
X  rm -rf conftest.dir
Xelse
X  am_cv_$1_dependencies_compiler_type=none
Xfi
X])
XAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
XAM_CONDITIONAL([am__fastdep$1], [
X  test "x$enable_dependency_tracking" != xno \
X  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
X])
X
X
X# AM_SET_DEPDIR
X# -------------
X# Choose a directory name for dependency files.
X# This macro is AC_REQUIREd in _AM_DEPENDENCIES
XAC_DEFUN([AM_SET_DEPDIR],
X[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
XAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
X])
X
X
X# AM_DEP_TRACK
X# ------------
XAC_DEFUN([AM_DEP_TRACK],
X[AC_ARG_ENABLE(dependency-tracking,
X[  --disable-dependency-tracking Speeds up one-time builds
X  --enable-dependency-tracking  Do not reject slow dependency extractors])
Xif test "x$enable_dependency_tracking" != xno; then
X  am_depcomp="$ac_aux_dir/depcomp"
X  AMDEPBACKSLASH='\'
Xfi
XAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
XAC_SUBST([AMDEPBACKSLASH])
X])
X
X# Generate code to set up dependency tracking.   -*- Autoconf -*-
X
X# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
X
X# This program is free software; you can redistribute it and/or modify
X# it under the terms of the GNU General Public License as published by
X# the Free Software Foundation; either version 2, or (at your option)
X# any later version.
X
X# This program is distributed in the hope that it will be useful,
X# but WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X# GNU General Public License for more details.
X
X# You should have received a copy of the GNU General Public License
X# along with this program; if not, write to the Free Software
X# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
X# 02111-1307, USA.
X
X#serial 2
X
X# _AM_OUTPUT_DEPENDENCY_COMMANDS
X# ------------------------------
XAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
X[for mf in $CONFIG_FILES; do
X  # Strip MF so we end up with the name of the file.
X  mf=`echo "$mf" | sed -e 's/:.*$//'`
X  # Check whether this is an Automake generated Makefile or not.
X  # We used to match only the files named `Makefile.in', but
X  # some people rename them; so instead we look at the file content.
X  # Grep'ing the first line is not enough: some people post-process
X  # each Makefile.in and add a new line on top of each file to say so.
X  # So let's grep whole file.
X  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
X    dirpart=`AS_DIRNAME("$mf")`
X  else
X    continue
X  fi
X  grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
X  # Extract the definition of DEP_FILES from the Makefile without
X  # running `make'.
X  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
X  test -z "$DEPDIR" && continue
X  # When using ansi2knr, U may be empty or an underscore; expand it
X  U=`sed -n -e '/^U = / s///p' < "$mf"`
X  test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
X  # We invoke sed twice because it is the simplest approach to
X  # changing $(DEPDIR) to its actual value in the expansion.
X  for file in `sed -n -e '
X    /^DEP_FILES = .*\\\\$/ {
X      s/^DEP_FILES = //
X      :loop
X	s/\\\\$//
X	p
X	n
X	/\\\\$/ b loop
X      p
X    }
X    /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
X       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
X    # Make sure the directory exists.
X    test -f "$dirpart/$file" && continue
X    fdir=`AS_DIRNAME(["$file"])`
X    AS_MKDIR_P([$dirpart/$fdir])
X    # echo "creating $dirpart/$file"
X    echo '# dummy' > "$dirpart/$file"
X  done
Xdone
X])# _AM_OUTPUT_DEPENDENCY_COMMANDS
X
X
X# AM_OUTPUT_DEPENDENCY_COMMANDS
X# -----------------------------
X# This macro should only be invoked once -- use via AC_REQUIRE.
X#
X# This code is only required when automatic dependency tracking
X# is enabled.  FIXME.  This creates each `.P' file that we will
X# need in order to bootstrap the dependency handling code.
XAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
X[AC_CONFIG_COMMANDS([depfiles],
X     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
X     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
X])
X
X# Check to see how 'make' treats includes.	-*- Autoconf -*-
X
X# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
X
X# This program is free software; you can redistribute it and/or modify
X# it under the terms of the GNU General Public License as published by
X# the Free Software Foundation; either version 2, or (at your option)
X# any later version.
X
X# This program is distributed in the hope that it will be useful,
X# but WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X# GNU General Public License for more details.
X
X# You should have received a copy of the GNU General Public License
X# along with this program; if not, write to the Free Software
X# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
X# 02111-1307, USA.
X
X# serial 2
X
X# AM_MAKE_INCLUDE()
X# -----------------
X# Check to see how make treats includes.
XAC_DEFUN([AM_MAKE_INCLUDE],
X[am_make=${MAKE-make}
Xcat > confinc << 'END'
Xam__doit:
X	@echo done
X.PHONY: am__doit
XEND
X# If we don't find an include directive, just comment out the code.
XAC_MSG_CHECKING([for style of include used by $am_make])
Xam__include="#"
Xam__quote=
X_am_result=none
X# First try GNU make style include.
Xecho "include confinc" > confmf
X# We grep out `Entering directory' and `Leaving directory'
X# messages which can occur if `w' ends up in MAKEFLAGS.
X# In particular we don't look at `^make:' because GNU make might
X# be invoked under some other name (usually "gmake"), in which
X# case it prints its new name instead of `make'.
Xif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
X   am__include=include
X   am__quote=
X   _am_result=GNU
Xfi
X# Now try BSD make style include.
Xif test "$am__include" = "#"; then
X   echo '.include "confinc"' > confmf
X   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
X      am__include=.include
X      am__quote="\""
X      _am_result=BSD
X   fi
Xfi
XAC_SUBST([am__include])
XAC_SUBST([am__quote])
XAC_MSG_RESULT([$_am_result])
Xrm -f confinc confmf
X])
X
X# AM_CONDITIONAL                                              -*- Autoconf -*-
X
X# Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
X
X# This program is free software; you can redistribute it and/or modify
X# it under the terms of the GNU General Public License as published by
X# the Free Software Foundation; either version 2, or (at your option)
X# any later version.
X
X# This program is distributed in the hope that it will be useful,
X# but WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X# GNU General Public License for more details.
X
X# You should have received a copy of the GNU General Public License
X# along with this program; if not, write to the Free Software
X# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
X# 02111-1307, USA.
X
X# serial 5
X
XAC_PREREQ(2.52)
X
X# AM_CONDITIONAL(NAME, SHELL-CONDITION)
X# -------------------------------------
X# Define a conditional.
XAC_DEFUN([AM_CONDITIONAL],
X[ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
X        [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
XAC_SUBST([$1_TRUE])
XAC_SUBST([$1_FALSE])
Xif $2; then
X  $1_TRUE=
X  $1_FALSE='#'
Xelse
X  $1_TRUE='#'
X  $1_FALSE=
Xfi
XAC_CONFIG_COMMANDS_PRE(
X[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
X  AC_MSG_ERROR([conditional "$1" was never defined.
XUsually this means the macro was only invoked conditionally.])
Xfi])])
X
X# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
X
X# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
X
X# This program is free software; you can redistribute it and/or modify
X# it under the terms of the GNU General Public License as published by
X# the Free Software Foundation; either version 2, or (at your option)
X# any later version.
X
X# This program is distributed in the hope that it will be useful,
X# but WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X# GNU General Public License for more details.
X
X# You should have received a copy of the GNU General Public License
X# along with this program; if not, write to the Free Software
X# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
X# 02111-1307, USA.
X
XAC_PREREQ([2.52])
X
X# serial 6
X
X# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
XAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
X
X# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
X
X# serial 47 AC_PROG_LIBTOOL
X
X
X# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
X# -----------------------------------------------------------
X# If this macro is not defined by Autoconf, define it here.
Xm4_ifdef([AC_PROVIDE_IFELSE],
X         [],
X         [m4_define([AC_PROVIDE_IFELSE],
X	         [m4_ifdef([AC_PROVIDE_$1],
X		           [$2], [$3])])])
X
X
X# AC_PROG_LIBTOOL
X# ---------------
XAC_DEFUN([AC_PROG_LIBTOOL],
X[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
Xdnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
Xdnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
X  AC_PROVIDE_IFELSE([AC_PROG_CXX],
X    [AC_LIBTOOL_CXX],
X    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
X  ])])
Xdnl And a similar setup for Fortran 77 support
X  AC_PROVIDE_IFELSE([AC_PROG_F77],
X    [AC_LIBTOOL_F77],
X    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
X])])
X
Xdnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
Xdnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
Xdnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
X  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
X    [AC_LIBTOOL_GCJ],
X    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
X      [AC_LIBTOOL_GCJ],
X      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
X	[AC_LIBTOOL_GCJ],
X      [ifdef([AC_PROG_GCJ],
X	     [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
X       ifdef([A][M_PROG_GCJ],
X	     [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
X       ifdef([LT_AC_PROG_GCJ],
X	     [define([LT_AC_PROG_GCJ],
X		defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
X])])# AC_PROG_LIBTOOL
X
X
X# _AC_PROG_LIBTOOL
X# ----------------
XAC_DEFUN([_AC_PROG_LIBTOOL],
X[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
XAC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
XAC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
XAC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
X
X# This can be used to rebuild libtool when needed
XLIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
X
X# Always use our own libtool.
XLIBTOOL='$(SHELL) $(top_builddir)/libtool'
XAC_SUBST(LIBTOOL)dnl
X
X# Prevent multiple expansion
Xdefine([AC_PROG_LIBTOOL], [])
X])# _AC_PROG_LIBTOOL
X
X
X# AC_LIBTOOL_SETUP
X# ----------------
XAC_DEFUN([AC_LIBTOOL_SETUP],
X[AC_PREREQ(2.50)dnl
XAC_REQUIRE([AC_ENABLE_SHARED])dnl
XAC_REQUIRE([AC_ENABLE_STATIC])dnl
XAC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
XAC_REQUIRE([AC_CANONICAL_HOST])dnl
XAC_REQUIRE([AC_CANONICAL_BUILD])dnl
XAC_REQUIRE([AC_PROG_CC])dnl
XAC_REQUIRE([AC_PROG_LD])dnl
XAC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
XAC_REQUIRE([AC_PROG_NM])dnl
X
XAC_REQUIRE([AC_PROG_LN_S])dnl
XAC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
X# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
XAC_REQUIRE([AC_OBJEXT])dnl
XAC_REQUIRE([AC_EXEEXT])dnl
Xdnl
X
XAC_LIBTOOL_SYS_MAX_CMD_LEN
XAC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
XAC_LIBTOOL_OBJDIR
X
XAC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
X_LT_AC_PROG_ECHO_BACKSLASH
X
Xcase $host_os in
Xaix3*)
X  # AIX sometimes has problems with the GCC collect2 program.  For some
X  # reason, if we set the COLLECT_NAMES environment variable, the problems
X  # vanish in a puff of smoke.
X  if test "X${COLLECT_NAMES+set}" != Xset; then
X    COLLECT_NAMES=
X    export COLLECT_NAMES
X  fi
X  ;;
Xesac
X
X# Sed substitution that helps us do robust quoting.  It backslashifies
X# metacharacters that are still active within double-quoted strings.
XXsed='sed -e s/^X//'
X[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
X
X# Same as above, but do not quote variable references.
X[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
X
X# Sed substitution to delay expansion of an escaped shell variable in a
X# double_quote_subst'ed string.
Xdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
X
X# Sed substitution to avoid accidental globbing in evaled expressions
Xno_glob_subst='s/\*/\\\*/g'
X
X# Constants:
Xrm="rm -f"
X
X# Global variables:
Xdefault_ofile=libtool
Xcan_build_shared=yes
X
X# All known linkers require a `.a' archive for static linking (except M$VC,
X# which needs '.lib').
Xlibext=a
Xltmain="$ac_aux_dir/ltmain.sh"
Xofile="$default_ofile"
Xwith_gnu_ld="$lt_cv_prog_gnu_ld"
X
XAC_CHECK_TOOL(AR, ar, false)
XAC_CHECK_TOOL(RANLIB, ranlib, :)
XAC_CHECK_TOOL(STRIP, strip, :)
X
Xold_CC="$CC"
Xold_CFLAGS="$CFLAGS"
X
X# Set sane defaults for various variables
Xtest -z "$AR" && AR=ar
Xtest -z "$AR_FLAGS" && AR_FLAGS=cru
Xtest -z "$AS" && AS=as
Xtest -z "$CC" && CC=cc
Xtest -z "$LTCC" && LTCC=$CC
Xtest -z "$DLLTOOL" && DLLTOOL=dlltool
Xtest -z "$LD" && LD=ld
Xtest -z "$LN_S" && LN_S="ln -s"
Xtest -z "$MAGIC_CMD" && MAGIC_CMD=file
Xtest -z "$NM" && NM=nm
Xtest -z "$SED" && SED=sed
Xtest -z "$OBJDUMP" && OBJDUMP=objdump
Xtest -z "$RANLIB" && RANLIB=:
Xtest -z "$STRIP" && STRIP=:
Xtest -z "$ac_objext" && ac_objext=o
X
X# Determine commands to create old-style static archives.
Xold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
Xold_postinstall_cmds='chmod 644 $oldlib'
Xold_postuninstall_cmds=
X
Xif test -n "$RANLIB"; then
X  case $host_os in
X  openbsd*)
X    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
X    ;;
X  *)
X    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
X    ;;
X  esac
X  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
Xfi
X
X# Only perform the check for file, if the check method requires it
Xcase $deplibs_check_method in
Xfile_magic*)
X  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
X    AC_PATH_MAGIC
X  fi
X  ;;
Xesac
X
XAC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
XAC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
Xenable_win32_dll=yes, enable_win32_dll=no)
X
XAC_ARG_ENABLE([libtool-lock],
X    [AC_HELP_STRING([--disable-libtool-lock],
X	[avoid locking (might break parallel builds)])])
Xtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
X
XAC_ARG_WITH([pic],
X    [AC_HELP_STRING([--with-pic],
X	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
X    [pic_mode="$withval"],
X    [pic_mode=default])
Xtest -z "$pic_mode" && pic_mode=default
X
X# Use C for the default configuration in the libtool script
Xtagname=
XAC_LIBTOOL_LANG_C_CONFIG
X_LT_AC_TAGCONFIG
X])# AC_LIBTOOL_SETUP
X
X
X# _LT_AC_SYS_COMPILER
X# -------------------
XAC_DEFUN([_LT_AC_SYS_COMPILER],
X[AC_REQUIRE([AC_PROG_CC])dnl
X
X# If no C compiler was specified, use CC.
XLTCC=${LTCC-"$CC"}
X
X# Allow CC to be a program name with arguments.
Xcompiler=$CC
X])# _LT_AC_SYS_COMPILER
X
X
X# _LT_AC_SYS_LIBPATH_AIX
X# ----------------------
X# Links a minimal program and checks the executable
X# for the system default hardcoded library path. In most cases,
X# this is /usr/lib:/lib, but when the MPI compilers are used
X# the location of the communication and MPI libs are included too.
X# If we don't find anything, use the default library path according
X# to the aix ld manual.
XAC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
X[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
Xaix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
X}'`
X# Check for a 64-bit object if we didn't find anything.
Xif test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
X}'`; fi],[])
Xif test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
X])# _LT_AC_SYS_LIBPATH_AIX
X
X
X# _LT_AC_SHELL_INIT(ARG)
X# ----------------------
XAC_DEFUN([_LT_AC_SHELL_INIT],
X[ifdef([AC_DIVERSION_NOTICE],
X	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
X	 [AC_DIVERT_PUSH(NOTICE)])
X$1
XAC_DIVERT_POP
X])# _LT_AC_SHELL_INIT
X
X
X# _LT_AC_PROG_ECHO_BACKSLASH
X# --------------------------
X# Add some code to the start of the generated configure script which
X# will find an echo command which doesn't interpret backslashes.
XAC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
X[_LT_AC_SHELL_INIT([
X# Check that we are running under the correct shell.
XSHELL=${CONFIG_SHELL-/bin/sh}
X
Xcase X$ECHO in
XX*--fallback-echo)
X  # Remove one level of quotation (which was required for Make).
X  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
X  ;;
Xesac
X
Xecho=${ECHO-echo}
Xif test "X[$]1" = X--no-reexec; then
X  # Discard the --no-reexec flag, and continue.
X  shift
Xelif test "X[$]1" = X--fallback-echo; then
X  # Avoid inline document here, it may be left over
X  :
Xelif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
X  # Yippee, $echo works!
X  :
Xelse
X  # Restart under the correct shell.
X  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
Xfi
X
Xif test "X[$]1" = X--fallback-echo; then
X  # used as fallback echo
X  shift
X  cat <<EOF
X[$]*
XEOF
X  exit 0
Xfi
X
X# The HP-UX ksh and POSIX shell print the target directory to stdout
X# if CDPATH is set.
Xif test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
X
Xif test -z "$ECHO"; then
Xif test "X${echo_test_string+set}" != Xset; then
X# find a string as large as possible, as long as the shell can cope with it
X  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
X    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
X    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
X       echo_test_string="`eval $cmd`" &&
X       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
X    then
X      break
X    fi
X  done
Xfi
X
Xif test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
X   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
X   test "X$echo_testing_string" = "X$echo_test_string"; then
X  :
Xelse
X  # The Solaris, AIX, and Digital Unix default echo programs unquote
X  # backslashes.  This makes it impossible to quote backslashes using
X  #   echo "$something" | sed 's/\\/\\\\/g'
X  #
X  # So, first we look for a working echo in the user's PATH.
X
X  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
X  for dir in $PATH /usr/ucb; do
X    IFS="$lt_save_ifs"
X    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
X       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
X       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
X       test "X$echo_testing_string" = "X$echo_test_string"; then
X      echo="$dir/echo"
X      break
X    fi
X  done
X  IFS="$lt_save_ifs"
X
X  if test "X$echo" = Xecho; then
X    # We didn't find a better echo, so look for alternatives.
X    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
X       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
X       test "X$echo_testing_string" = "X$echo_test_string"; then
X      # This shell has a builtin print -r that does the trick.
X      echo='print -r'
X    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
X	 test "X$CONFIG_SHELL" != X/bin/ksh; then
X      # If we have ksh, try running configure again with it.
X      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
X      export ORIGINAL_CONFIG_SHELL
X      CONFIG_SHELL=/bin/ksh
X      export CONFIG_SHELL
X      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
X    else
X      # Try using printf.
X      echo='printf %s\n'
X      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
X	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
X	 test "X$echo_testing_string" = "X$echo_test_string"; then
X	# Cool, printf works
X	:
X      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
X	   test "X$echo_testing_string" = 'X\t' &&
X	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
X	   test "X$echo_testing_string" = "X$echo_test_string"; then
X	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
X	export CONFIG_SHELL
X	SHELL="$CONFIG_SHELL"
X	export SHELL
X	echo="$CONFIG_SHELL [$]0 --fallback-echo"
X      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
X	   test "X$echo_testing_string" = 'X\t' &&
X	   echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
X	   test "X$echo_testing_string" = "X$echo_test_string"; then
X	echo="$CONFIG_SHELL [$]0 --fallback-echo"
X      else
X	# maybe with a smaller string...
X	prev=:
X
X	for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
X	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
X	  then
X	    break
X	  fi
X	  prev="$cmd"
X	done
X
X	if test "$prev" != 'sed 50q "[$]0"'; then
X	  echo_test_string=`eval $prev`
X	  export echo_test_string
X	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
X	else
X	  # Oops.  We lost completely, so just stick with echo.
X	  echo=echo
X	fi
X      fi
X    fi
X  fi
Xfi
Xfi
X
X# Copy echo and quote the copy suitably for passing to libtool from
X# the Makefile, instead of quoting the original, which is used later.
XECHO=$echo
Xif test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
X   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
Xfi
X
XAC_SUBST(ECHO)
X])])# _LT_AC_PROG_ECHO_BACKSLASH
X
X
X# _LT_AC_LOCK
X# -----------
XAC_DEFUN([_LT_AC_LOCK],
X[AC_ARG_ENABLE([libtool-lock],
X    [AC_HELP_STRING([--disable-libtool-lock],
X	[avoid locking (might break parallel builds)])])
Xtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
X
X# Some flags need to be propagated to the compiler or linker for good
X# libtool support.
Xcase $host in
Xia64-*-hpux*)
X  # Find out which ABI we are using.
X  echo 'int i;' > conftest.$ac_ext
X  if AC_TRY_EVAL(ac_compile); then
X    case `/usr/bin/file conftest.$ac_objext` in
X    *ELF-32*)
X      HPUX_IA64_MODE="32"
X      ;;
X    *ELF-64*)
X      HPUX_IA64_MODE="64"
X      ;;
X    esac
X  fi
X  rm -rf conftest*
X  ;;
X*-*-irix6*)
X  # Find out which ABI we are using.
X  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
X  if AC_TRY_EVAL(ac_compile); then
X   if test "$lt_cv_prog_gnu_ld" = yes; then
X    case `/usr/bin/file conftest.$ac_objext` in
X    *32-bit*)
X      LD="${LD-ld} -melf32bsmip"
X      ;;
X    *N32*)
X      LD="${LD-ld} -melf32bmipn32"
X      ;;
X    *64-bit*)
X      LD="${LD-ld} -melf64bmip"
X      ;;
X    esac
X   else
X    case `/usr/bin/file conftest.$ac_objext` in
X    *32-bit*)
X      LD="${LD-ld} -32"
X      ;;
X    *N32*)
X      LD="${LD-ld} -n32"
X      ;;
X    *64-bit*)
X      LD="${LD-ld} -64"
X      ;;
X    esac
X   fi
X  fi
X  rm -rf conftest*
X  ;;
X
Xx86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
X  # Find out which ABI we are using.
X  echo 'int i;' > conftest.$ac_ext
X  if AC_TRY_EVAL(ac_compile); then
X    case "`/usr/bin/file conftest.o`" in
X    *32-bit*)
X      case $host in
X        x86_64-*linux*)
X          LD="${LD-ld} -m elf_i386"
X          ;;
X        ppc64-*linux*)
X          LD="${LD-ld} -m elf32ppclinux"
X          ;;
X        s390x-*linux*)
X          LD="${LD-ld} -m elf_s390"
X          ;;
X        sparc64-*linux*)
X          LD="${LD-ld} -m elf32_sparc"
X          ;;
X      esac
X      ;;
X    *64-bit*)
X      case $host in
X        x86_64-*linux*)
X          LD="${LD-ld} -m elf_x86_64"
X          ;;
X        ppc*-*linux*|powerpc*-*linux*)
X          LD="${LD-ld} -m elf64ppc"
X          ;;
X        s390*-*linux*)
X          LD="${LD-ld} -m elf64_s390"
X          ;;
X        sparc*-*linux*)
X          LD="${LD-ld} -m elf64_sparc"
X          ;;
X      esac
X      ;;
X    esac
X  fi
X  rm -rf conftest*
X  ;;
X
X*-*-sco3.2v5*)
X  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
X  SAVE_CFLAGS="$CFLAGS"
X  CFLAGS="$CFLAGS -belf"
X  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
X    [AC_LANG_PUSH(C)
X     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
X     AC_LANG_POP])
X  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
X    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
X    CFLAGS="$SAVE_CFLAGS"
X  fi
X  ;;
XAC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
X[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
X  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
X  AC_CHECK_TOOL(AS, as, false)
X  AC_CHECK_TOOL(OBJDUMP, objdump, false)
X  ;;
X  ])
Xesac
X
Xneed_locks="$enable_libtool_lock"
X
X])# _LT_AC_LOCK
X
X
X# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
X#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
X# ----------------------------------------------------------------
X# Check whether the given compiler option works
XAC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
X[AC_CACHE_CHECK([$1], [$2],
X  [$2=no
X  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
X   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
X   lt_compiler_flag="$3"
X   # Insert the option either (1) after the last *FLAGS variable, or
X   # (2) before a word containing "conftest.", or (3) at the end.
X   # Note that $ac_compile itself does not contain backslashes and begins
X   # with a dollar sign (not a hyphen), so the echo should work correctly.
X   # The option is referenced via a variable to avoid confusing sed.
X   lt_compile=`echo "$ac_compile" | $SED \
X   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
X   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
X   -e 's:$: $lt_compiler_flag:'`
X   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
X   (eval "$lt_compile" 2>conftest.err)
X   ac_status=$?
X   cat conftest.err >&AS_MESSAGE_LOG_FD
X   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
X   if (exit $ac_status) && test -s "$ac_outfile"; then
X     # The compiler can only warn and ignore the option if not recognized
X     # So say no if there are warnings
X     if test ! -s conftest.err; then
X       $2=yes
X     fi
X   fi
X   $rm conftest*
X])
X
Xif test x"[$]$2" = xyes; then
X    ifelse([$5], , :, [$5])
Xelse
X    ifelse([$6], , :, [$6])
Xfi
X])# AC_LIBTOOL_COMPILER_OPTION
X
X
X# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
X#                          [ACTION-SUCCESS], [ACTION-FAILURE])
X# ------------------------------------------------------------
X# Check whether the given compiler option works
XAC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
X[AC_CACHE_CHECK([$1], [$2],
X  [$2=no
X   save_LDFLAGS="$LDFLAGS"
X   LDFLAGS="$LDFLAGS $3"
X   printf "$lt_simple_link_test_code" > conftest.$ac_ext
X   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
X     # The compiler can only warn and ignore the option if not recognized
X     # So say no if there are warnings
X     if test -s conftest.err; then
X       # Append any errors to the config.log.
X       cat conftest.err 1>&AS_MESSAGE_LOG_FD
X     else
X       $2=yes
X     fi
X   fi
X   $rm conftest*
X   LDFLAGS="$save_LDFLAGS"
X])
X
Xif test x"[$]$2" = xyes; then
X    ifelse([$4], , :, [$4])
Xelse
X    ifelse([$5], , :, [$5])
Xfi
X])# AC_LIBTOOL_LINKER_OPTION
X
X
X# AC_LIBTOOL_SYS_MAX_CMD_LEN
X# --------------------------
XAC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
X[# find the maximum length of command line arguments
XAC_MSG_CHECKING([the maximum length of command line arguments])
XAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
X  i=0
X  testring="ABCD"
X
X  case $build_os in
X  msdosdjgpp*)
X    # On DJGPP, this test can blow up pretty badly due to problems in libc
X    # (any single argument exceeding 2000 bytes causes a buffer overrun
X    # during glob expansion).  Even if it were fixed, the result of this
X    # check would be larger than it should be.
X    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
X    ;;
X
X  gnu*)
X    # Under GNU Hurd, this test is not required because there is
X    # no limit to the length of command line arguments.
X    # Libtool will interpret -1 as no limit whatsoever
X    lt_cv_sys_max_cmd_len=-1;
X    ;;
X
X  cygwin* | mingw*)
X    # On Win9x/ME, this test blows up -- it succeeds, but takes
X    # about 5 minutes as the teststring grows exponentially.
X    # Worse, since 9x/ME are not pre-emptively multitasking,
X    # you end up with a "frozen" computer, even though with patience
X    # the test eventually succeeds (with a max line length of 256k).
X    # Instead, let's just punt: use the minimum linelength reported by
X    # all of the supported platforms: 8192 (on NT/2K/XP).
X    lt_cv_sys_max_cmd_len=8192;
X    ;;
X
X *)
X    # If test is not a shell built-in, we'll probably end up computing a
X    # maximum length that is only half of the actual maximum length, but
X    # we can't tell.
X    while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \
X	       = "XX$testring") >/dev/null 2>&1 &&
X	    new_result=`expr "X$testring" : ".*" 2>&1` &&
X	    lt_cv_sys_max_cmd_len=$new_result &&
X	    test $i != 17 # 1/2 MB should be enough
X    do
X      i=`expr $i + 1`
X      testring=$testring$testring
X    done
X    testring=
X    # Add a significant safety factor because C++ compilers can tack on massive
X    # amounts of additional arguments before passing them to the linker.
X    # It appears as though 1/2 is a usable value.
X    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
X    ;;
X  esac
X])
Xif test -n $lt_cv_sys_max_cmd_len ; then
X  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
Xelse
X  AC_MSG_RESULT(none)
Xfi
X])# AC_LIBTOOL_SYS_MAX_CMD_LEN
X
X
X# _LT_AC_CHECK_DLFCN
X# --------------------
XAC_DEFUN([_LT_AC_CHECK_DLFCN],
X[AC_CHECK_HEADERS(dlfcn.h)dnl
X])# _LT_AC_CHECK_DLFCN
X
X
X# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
X#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
X# ------------------------------------------------------------------
XAC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
X[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
Xif test "$cross_compiling" = yes; then :
X  [$4]
Xelse
X  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
X  lt_status=$lt_dlunknown
X  cat > conftest.$ac_ext <<EOF
X[#line __oline__ "configure"
X#include "confdefs.h"
X
X#if HAVE_DLFCN_H
X#include <dlfcn.h>
X#endif
X
X#include <stdio.h>
X
X#ifdef RTLD_GLOBAL
X#  define LT_DLGLOBAL		RTLD_GLOBAL
X#else
X#  ifdef DL_GLOBAL
X#    define LT_DLGLOBAL		DL_GLOBAL
X#  else
X#    define LT_DLGLOBAL		0
X#  endif
X#endif
X
X/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
X   find out it does not work in some platform. */
X#ifndef LT_DLLAZY_OR_NOW
X#  ifdef RTLD_LAZY
X#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
X#  else
X#    ifdef DL_LAZY
X#      define LT_DLLAZY_OR_NOW		DL_LAZY
X#    else
X#      ifdef RTLD_NOW
X#        define LT_DLLAZY_OR_NOW	RTLD_NOW
X#      else
X#        ifdef DL_NOW
X#          define LT_DLLAZY_OR_NOW	DL_NOW
X#        else
X#          define LT_DLLAZY_OR_NOW	0
X#        endif
X#      endif
X#    endif
X#  endif
X#endif
X
X#ifdef __cplusplus
Xextern "C" void exit (int);
X#endif
X
Xvoid fnord() { int i=42;}
Xint main ()
X{
X  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
X  int status = $lt_dlunknown;
X
X  if (self)
X    {
X      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
X      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
X      /* dlclose (self); */
X    }
X
X    exit (status);
X}]
XEOF
X  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
X    (./conftest; exit; ) 2>/dev/null
X    lt_status=$?
X    case x$lt_status in
X      x$lt_dlno_uscore) $1 ;;
X      x$lt_dlneed_uscore) $2 ;;
X      x$lt_unknown|x*) $3 ;;
X    esac
X  else :
X    # compilation failed
X    $3
X  fi
Xfi
Xrm -fr conftest*
X])# _LT_AC_TRY_DLOPEN_SELF
X
X
X# AC_LIBTOOL_DLOPEN_SELF
X# -------------------
XAC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
X[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
Xif test "x$enable_dlopen" != xyes; then
X  enable_dlopen=unknown
X  enable_dlopen_self=unknown
X  enable_dlopen_self_static=unknown
Xelse
X  lt_cv_dlopen=no
X  lt_cv_dlopen_libs=
X
X  case $host_os in
X  beos*)
X    lt_cv_dlopen="load_add_on"
X    lt_cv_dlopen_libs=
X    lt_cv_dlopen_self=yes
X    ;;
X
X  mingw* | pw32*)
X    lt_cv_dlopen="LoadLibrary"
X    lt_cv_dlopen_libs=
X   ;;
X
X  cygwin*)
X    lt_cv_dlopen="dlopen"
X    lt_cv_dlopen_libs=
X   ;;
X
X  darwin*)
X  # if libdl is installed we need to link against it
X    AC_CHECK_LIB([dl], [dlopen],
X		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
X    lt_cv_dlopen="dyld"
X    lt_cv_dlopen_libs=
X    lt_cv_dlopen_self=yes
X    ])
X   ;;
X    
X  *)
X    AC_CHECK_FUNC([shl_load],
X	  [lt_cv_dlopen="shl_load"],
X      [AC_CHECK_LIB([dld], [shl_load],
X	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
X	[AC_CHECK_FUNC([dlopen],
X	      [lt_cv_dlopen="dlopen"],
X	  [AC_CHECK_LIB([dl], [dlopen],
X		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
X	    [AC_CHECK_LIB([svld], [dlopen],
X		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
X	      [AC_CHECK_LIB([dld], [dld_link],
X		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
X	      ])
X	    ])
X	  ])
X	])
X      ])
X    ;;
X  esac
X
X  if test "x$lt_cv_dlopen" != xno; then
X    enable_dlopen=yes
X  else
X    enable_dlopen=no
X  fi
X
X  case $lt_cv_dlopen in
X  dlopen)
X    save_CPPFLAGS="$CPPFLAGS"
X    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
X
X    save_LDFLAGS="$LDFLAGS"
X    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
X
X    save_LIBS="$LIBS"
X    LIBS="$lt_cv_dlopen_libs $LIBS"
X
X    AC_CACHE_CHECK([whether a program can dlopen itself],
X	  lt_cv_dlopen_self, [dnl
X	  _LT_AC_TRY_DLOPEN_SELF(
X	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
X	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
X    ])
X
X    if test "x$lt_cv_dlopen_self" = xyes; then
X      LDFLAGS="$LDFLAGS $link_static_flag"
X      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
X    	  lt_cv_dlopen_self_static, [dnl
X	  _LT_AC_TRY_DLOPEN_SELF(
X	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
X	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
X      ])
X    fi
X
X    CPPFLAGS="$save_CPPFLAGS"
X    LDFLAGS="$save_LDFLAGS"
X    LIBS="$save_LIBS"
X    ;;
X  esac
X
X  case $lt_cv_dlopen_self in
X  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
X  *) enable_dlopen_self=unknown ;;
X  esac
X
X  case $lt_cv_dlopen_self_static in
X  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
X  *) enable_dlopen_self_static=unknown ;;
X  esac
Xfi
X])# AC_LIBTOOL_DLOPEN_SELF
X
X
X# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
X# ---------------------------------
X# Check to see if options -c and -o are simultaneously supported by compiler
XAC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
X[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
XAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
X  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
X  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
X   $rm -r conftest 2>/dev/null
X   mkdir conftest
X   cd conftest
X   mkdir out
X   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
X
X   # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
X   # that will create temporary files in the current directory regardless of
X   # the output directory.  Thus, making CWD read-only will cause this test
X   # to fail, enabling locking or at least warning the user not to do parallel
X   # builds.
X   chmod -w .
X
X   lt_compiler_flag="-o out/conftest2.$ac_objext"
X   # Insert the option either (1) after the last *FLAGS variable, or
X   # (2) before a word containing "conftest.", or (3) at the end.
X   # Note that $ac_compile itself does not contain backslashes and begins
X   # with a dollar sign (not a hyphen), so the echo should work correctly.
X   lt_compile=`echo "$ac_compile" | $SED \
X   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
X   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
X   -e 's:$: $lt_compiler_flag:'`
X   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
X   (eval "$lt_compile" 2>out/conftest.err)
X   ac_status=$?
X   cat out/conftest.err >&AS_MESSAGE_LOG_FD
X   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
X   if (exit $ac_status) && test -s out/conftest2.$ac_objext
X   then
X     # The compiler can only warn and ignore the option if not recognized
X     # So say no if there are warnings
X     if test ! -s out/conftest.err; then
X       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
X     fi
X   fi
X   chmod u+w .
X   $rm conftest* out/*
X   rmdir out
X   cd ..
X   rmdir conftest
X   $rm conftest*
X])
X])# AC_LIBTOOL_PROG_CC_C_O
X
X
X# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
X# -----------------------------------------
X# Check to see if we can do hard links to lock some files if needed
XAC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
X[AC_REQUIRE([_LT_AC_LOCK])dnl
X
Xhard_links="nottested"
Xif test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
X  # do not overwrite the value of need_locks provided by the user
X  AC_MSG_CHECKING([if we can lock with hard links])
X  hard_links=yes
X  $rm conftest*
X  ln conftest.a conftest.b 2>/dev/null && hard_links=no
X  touch conftest.a
X  ln conftest.a conftest.b 2>&5 || hard_links=no
X  ln conftest.a conftest.b 2>/dev/null && hard_links=no
X  AC_MSG_RESULT([$hard_links])
X  if test "$hard_links" = no; then
X    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
X    need_locks=warn
X  fi
Xelse
X  need_locks=no
Xfi
X])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
X
X
X# AC_LIBTOOL_OBJDIR
X# -----------------
XAC_DEFUN([AC_LIBTOOL_OBJDIR],
X[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
X[rm -f .libs 2>/dev/null
Xmkdir .libs 2>/dev/null
Xif test -d .libs; then
X  lt_cv_objdir=.libs
Xelse
X  # MS-DOS does not allow filenames that begin with a dot.
X  lt_cv_objdir=_libs
Xfi
Xrmdir .libs 2>/dev/null])
Xobjdir=$lt_cv_objdir
X])# AC_LIBTOOL_OBJDIR
X
X
X# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
X# ----------------------------------------------
X# Check hardcoding attributes.
XAC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
X[AC_MSG_CHECKING([how to hardcode library paths into programs])
X_LT_AC_TAGVAR(hardcode_action, $1)=
Xif test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
X   test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \
X   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then
X
X  # We can hardcode non-existant directories.
X  if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
X     # If the only mechanism to avoid hardcoding is shlibpath_var, we
X     # have to relink, otherwise we might link with an installed library
X     # when we should be linking with a yet-to-be-installed one
X     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
X     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
X    # Linking always hardcodes the temporary library directory.
X    _LT_AC_TAGVAR(hardcode_action, $1)=relink
X  else
X    # We can link without hardcoding, and we can hardcode nonexisting dirs.
X    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
X  fi
Xelse
X  # We cannot hardcode anything, or else we can only hardcode existing
X  # directories.
X  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
Xfi
XAC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
X
Xif test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
X  # Fast installation is not supported
X  enable_fast_install=no
Xelif test "$shlibpath_overrides_runpath" = yes ||
X     test "$enable_shared" = no; then
X  # Fast installation is not necessary
X  enable_fast_install=needless
Xfi
X])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
X
X
X# AC_LIBTOOL_SYS_LIB_STRIP
X# ------------------------
XAC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
X[striplib=
Xold_striplib=
XAC_MSG_CHECKING([whether stripping libraries is possible])
Xif test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
X  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
X  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
X  AC_MSG_RESULT([yes])
Xelse
X# FIXME - insert some real tests, host_os isn't really good enough
X  case $host_os in
X   darwin*)
X       if test -n "$STRIP" ; then
X         striplib="$STRIP -x"
X         AC_MSG_RESULT([yes])
X       else
X  AC_MSG_RESULT([no])
Xfi
X       ;;
X   *)
X  AC_MSG_RESULT([no])
X    ;;
X  esac  
Xfi
X])# AC_LIBTOOL_SYS_LIB_STRIP
X
X
X# AC_LIBTOOL_SYS_DYNAMIC_LINKER
X# -----------------------------
X# PORTME Fill in your ld.so characteristics
XAC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
X[AC_MSG_CHECKING([dynamic linker characteristics])
Xlibrary_names_spec=
Xlibname_spec='lib$name'
Xsoname_spec=
Xshrext=".so"
Xpostinstall_cmds=
Xpostuninstall_cmds=
Xfinish_cmds=
Xfinish_eval=
Xshlibpath_var=
Xshlibpath_overrides_runpath=unknown
Xversion_type=none
Xdynamic_linker="$host_os ld.so"
Xsys_lib_dlsearch_path_spec="/lib /usr/lib"
Xif test "$GCC" = yes; then
X  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
X  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
X    # if the path contains ";" then we assume it to be the separator
X    # otherwise default to the standard path separator (i.e. ":") - it is
X    # assumed that no part of a normal pathname contains ";" but that should
X    # okay in the real world where ";" in dirpaths is itself problematic.
X    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
X  else
X    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
X  fi
Xelse
X  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
Xfi
Xneed_lib_prefix=unknown
Xhardcode_into_libs=no
X
X# when you set need_version to no, make sure it does not cause -set_version
X# flags to be left without arguments
Xneed_version=unknown
X
Xcase $host_os in
Xaix3*)
X  version_type=linux
X  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
X  shlibpath_var=LIBPATH
X
X  # AIX 3 has no versioning support, so we append a major version to the name.
X  soname_spec='${libname}${release}${shared_ext}$major'
X  ;;
X
Xaix4* | aix5*)
X  version_type=linux
X  need_lib_prefix=no
X  need_version=no
X  hardcode_into_libs=yes
X  if test "$host_cpu" = ia64; then
X    # AIX 5 supports IA64
X    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
X    shlibpath_var=LD_LIBRARY_PATH
X  else
X    # With GCC up to 2.95.x, collect2 would create an import file
X    # for dependence libraries.  The import file would start with
X    # the line `#! .'.  This would cause the generated library to
X    # depend on `.', always an invalid library.  This was fixed in
X    # development snapshots of GCC prior to 3.0.
X    case $host_os in
X      aix4 | aix4.[[01]] | aix4.[[01]].*)
X      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
X	   echo ' yes '
X	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
X	:
X      else
X	can_build_shared=no
X      fi
X      ;;
X    esac
X    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
X    # soname into executable. Probably we can add versioning support to
X    # collect2, so additional links can be useful in future.
X    if test "$aix_use_runtimelinking" = yes; then
X      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
X      # instead of lib<name>.a to let people know that these are not
X      # typical AIX shared libraries.
X      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X    else
X      # We preserve .a as extension for shared libraries through AIX4.2
X      # and later when we are not doing run time linking.
X      library_names_spec='${libname}${release}.a $libname.a'
X      soname_spec='${libname}${release}${shared_ext}$major'
X    fi
X    shlibpath_var=LIBPATH
X  fi
X  ;;
X
Xamigaos*)
X  library_names_spec='$libname.ixlibrary $libname.a'
X  # Create ${libname}_ixlibrary.a entries in /sys/libs.
X  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
X  ;;
X
Xbeos*)
X  library_names_spec='${libname}${shared_ext}'
X  dynamic_linker="$host_os ld.so"
X  shlibpath_var=LIBRARY_PATH
X  ;;
X
Xbsdi4*)
X  version_type=linux
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
X  shlibpath_var=LD_LIBRARY_PATH
X  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
X  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
X  # the default ld.so.conf also contains /usr/contrib/lib and
X  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
X  # libtool to hard-code these into programs
X  ;;
X
Xcygwin* | mingw* | pw32*)
X  version_type=windows
X  shrext=".dll"
X  need_version=no
X  need_lib_prefix=no
X
X  case $GCC,$host_os in
X  yes,cygwin* | yes,mingw* | yes,pw32*)
X    library_names_spec='$libname.dll.a'
X    # DLL is installed to $(libdir)/../bin by postinstall_cmds
X    postinstall_cmds='base_file=`basename \${file}`~
X      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
X      dldir=$destdir/`dirname \$dlpath`~
X      test -d \$dldir || mkdir -p \$dldir~
X      $install_prog $dir/$dlname \$dldir/$dlname'
X    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
X      dlpath=$dir/\$dldll~
X       $rm \$dlpath'
X    shlibpath_overrides_runpath=yes
X
X    case $host_os in
X    cygwin*)
X      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
X      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
X      sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib"
X      ;;
X    mingw*)
X      # MinGW DLLs use traditional 'lib' prefix
X      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
X      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
X      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
X        # It is most probably a Windows format PATH printed by
X        # mingw gcc, but we are running on Cygwin. Gcc prints its search
X        # path with ; separators, and with drive letters. We can handle the
X        # drive letters (cygwin fileutils understands them), so leave them,
X        # especially as we might pass files found there to a mingw objdump,
X        # which wouldn't understand a cygwinified path. Ahh.
X        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
X      else
X        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
X      fi
X      ;;
X    pw32*)
X      # pw32 DLLs use 'pw' prefix rather than 'lib'
X      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
X      ;;
X    esac
X    ;;
X
X  *)
X    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
X    ;;
X  esac
X  dynamic_linker='Win32 ld.exe'
X  # FIXME: first we should search . and the directory the executable is in
X  shlibpath_var=PATH
X  ;;
X
Xdarwin* | rhapsody*)
X  dynamic_linker="$host_os dyld"
X  version_type=darwin
X  need_lib_prefix=no
X  need_version=no
X  # FIXME: Relying on posixy $() will cause problems for
X  #        cross-compilation, but unfortunately the echo tests do not
X  #        yet detect zsh echo's removal of \ escapes.
X  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
X  soname_spec='${libname}${release}${major}$shared_ext'
X  shlibpath_overrides_runpath=yes
X  shlibpath_var=DYLD_LIBRARY_PATH
X  shrext='$(test .$module = .yes && echo .so || echo .dylib)'
X  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
X  if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then 
X  sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
X  fi
X  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
X  ;;
X
Xdgux*)
X  version_type=linux
X  need_lib_prefix=no
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  shlibpath_var=LD_LIBRARY_PATH
X  ;;
X
Xfreebsd1*)
X  dynamic_linker=no
X  ;;
X
Xfreebsd*)
X  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
X  version_type=freebsd-$objformat
X  case $version_type in
X    freebsd-elf*)
X      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
X      need_version=no
X      need_lib_prefix=no
X      ;;
X    freebsd-*)
X      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
X      need_version=yes
X      ;;
X  esac
X  shlibpath_var=LD_LIBRARY_PATH
X  case $host_os in
X  freebsd2*)
X    shlibpath_overrides_runpath=yes
X    ;;
X  freebsd3.[01]* | freebsdelf3.[01]*)
X    shlibpath_overrides_runpath=yes
X    hardcode_into_libs=yes
X    ;;
X  *) # from 3.2 on
X    shlibpath_overrides_runpath=no
X    hardcode_into_libs=yes
X    ;;
X  esac
X  ;;
X
Xgnu*)
X  version_type=linux
X  need_lib_prefix=no
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  shlibpath_var=LD_LIBRARY_PATH
X  hardcode_into_libs=yes
X  ;;
X
Xhpux9* | hpux10* | hpux11*)
X  # Give a soname corresponding to the major version so that dld.sl refuses to
X  # link against other versions.
X  version_type=sunos
X  need_lib_prefix=no
X  need_version=no
X  case "$host_cpu" in
X  ia64*)
X    shrext='.so'
X    hardcode_into_libs=yes
X    dynamic_linker="$host_os dld.so"
X    shlibpath_var=LD_LIBRARY_PATH
X    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
X    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X    soname_spec='${libname}${release}${shared_ext}$major'
X    if test "X$HPUX_IA64_MODE" = X32; then
X      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
X    else
X      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
X    fi
X    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
X    ;;
X   hppa*64*)
X     shrext='.sl'
X     hardcode_into_libs=yes
X     dynamic_linker="$host_os dld.sl"
X     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
X     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
X     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X     soname_spec='${libname}${release}${shared_ext}$major'
X     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
X     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
X     ;;
X   *)
X    shrext='.sl'
X    dynamic_linker="$host_os dld.sl"
X    shlibpath_var=SHLIB_PATH
X    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
X    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X    soname_spec='${libname}${release}${shared_ext}$major'
X    ;;
X  esac
X  # HP-UX runs *really* slowly unless shared libraries are mode 555.
X  postinstall_cmds='chmod 555 $lib'
X  ;;
X
Xirix5* | irix6* | nonstopux*)
X  case $host_os in
X    nonstopux*) version_type=nonstopux ;;
X    *)
X	if test "$lt_cv_prog_gnu_ld" = yes; then
X		version_type=linux
X	else
X		version_type=irix
X	fi ;;
X  esac
X  need_lib_prefix=no
X  need_version=no
X  soname_spec='${libname}${release}${shared_ext}$major'
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
X  case $host_os in
X  irix5* | nonstopux*)
X    libsuff= shlibsuff=
X    ;;
X  *)
X    case $LD in # libtool.m4 will add one of these switches to LD
X    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
X      libsuff= shlibsuff= libmagic=32-bit;;
X    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
X      libsuff=32 shlibsuff=N32 libmagic=N32;;
X    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
X      libsuff=64 shlibsuff=64 libmagic=64-bit;;
X    *) libsuff= shlibsuff= libmagic=never-match;;
X    esac
X    ;;
X  esac
X  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
X  shlibpath_overrides_runpath=no
X  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
X  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
X  hardcode_into_libs=yes
X  ;;
X
X# No shared lib support for Linux oldld, aout, or coff.
Xlinux*oldld* | linux*aout* | linux*coff*)
X  dynamic_linker=no
X  ;;
X
X# This must be Linux ELF.
Xlinux*)
X  version_type=linux
X  need_lib_prefix=no
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
X  shlibpath_var=LD_LIBRARY_PATH
X  shlibpath_overrides_runpath=no
X  # This implies no fast_install, which is unacceptable.
X  # Some rework will be needed to allow for fast_install
X  # before this can be enabled.
X  hardcode_into_libs=yes
X
X  # We used to test for /lib/ld.so.1 and disable shared libraries on
X  # powerpc, because MkLinux only supported shared libraries with the
X  # GNU dynamic linker.  Since this was broken with cross compilers,
X  # most powerpc-linux boxes support dynamic linking these days and
X  # people can always --disable-shared, the test was removed, and we
X  # assume the GNU/Linux dynamic linker is in use.
X  dynamic_linker='GNU/Linux ld.so'
X
X  # Find out which ABI we are using (multilib Linux x86_64 hack).
X  libsuff=
X  case "$host_cpu" in
X  x86_64*|s390x*|powerpc64*)
X    echo '[#]line __oline__ "configure"' > conftest.$ac_ext
X    if AC_TRY_EVAL(ac_compile); then
X      case `/usr/bin/file conftest.$ac_objext` in
X      *64-bit*)
X        libsuff=64
X        ;;
X      esac
X    fi
X    rm -rf conftest*
X    ;;
X  *)
X    ;;
X  esac
X  sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
X  sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
X  ;;
X
Xnetbsd*)
X  version_type=sunos
X  need_lib_prefix=no
X  need_version=no
X  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
X    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
X    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
X    dynamic_linker='NetBSD (a.out) ld.so'
X  else
X    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}'
X    soname_spec='${libname}${release}${shared_ext}$major'
X    dynamic_linker='NetBSD ld.elf_so'
X  fi
X  shlibpath_var=LD_LIBRARY_PATH
X  shlibpath_overrides_runpath=yes
X  hardcode_into_libs=yes
X  ;;
X
Xnewsos6)
X  version_type=linux
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  shlibpath_var=LD_LIBRARY_PATH
X  shlibpath_overrides_runpath=yes
X  ;;
X
Xnto-qnx)
X  version_type=linux
X  need_lib_prefix=no
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  shlibpath_var=LD_LIBRARY_PATH
X  shlibpath_overrides_runpath=yes
X  ;;
X
Xopenbsd*)
X  version_type=sunos
X  need_lib_prefix=no
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
X  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
X  shlibpath_var=LD_LIBRARY_PATH
X  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
X    case $host_os in
X      openbsd2.[[89]] | openbsd2.[[89]].*)
X	shlibpath_overrides_runpath=no
X	;;
X      *)
X	shlibpath_overrides_runpath=yes
X	;;
X      esac
X  else
X    shlibpath_overrides_runpath=yes
X  fi
X  ;;
X
Xos2*)
X  libname_spec='$name'
X  shrext=".dll"
X  need_lib_prefix=no
X  library_names_spec='$libname${shared_ext} $libname.a'
X  dynamic_linker='OS/2 ld.exe'
X  shlibpath_var=LIBPATH
X  ;;
X
Xosf3* | osf4* | osf5*)
X  version_type=osf
X  need_lib_prefix=no
X  need_version=no
X  soname_spec='${libname}${release}${shared_ext}$major'
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  shlibpath_var=LD_LIBRARY_PATH
X  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
X  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
X  ;;
X
Xsco3.2v5*)
X  version_type=osf
X  soname_spec='${libname}${release}${shared_ext}$major'
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  shlibpath_var=LD_LIBRARY_PATH
X  ;;
X
Xsolaris*)
X  version_type=linux
X  need_lib_prefix=no
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  shlibpath_var=LD_LIBRARY_PATH
X  shlibpath_overrides_runpath=yes
X  hardcode_into_libs=yes
X  # ldd complains unless libraries are executable
X  postinstall_cmds='chmod +x $lib'
X  ;;
X
Xsunos4*)
X  version_type=sunos
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
X  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
X  shlibpath_var=LD_LIBRARY_PATH
X  shlibpath_overrides_runpath=yes
X  if test "$with_gnu_ld" = yes; then
X    need_lib_prefix=no
X  fi
X  need_version=yes
X  ;;
X
Xsysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
X  version_type=linux
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  shlibpath_var=LD_LIBRARY_PATH
X  case $host_vendor in
X    sni)
X      shlibpath_overrides_runpath=no
X      need_lib_prefix=no
X      export_dynamic_flag_spec='${wl}-Blargedynsym'
X      runpath_var=LD_RUN_PATH
X      ;;
X    siemens)
X      need_lib_prefix=no
X      ;;
X    motorola)
X      need_lib_prefix=no
X      need_version=no
X      shlibpath_overrides_runpath=no
X      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
X      ;;
X  esac
X  ;;
X
Xsysv4*MP*)
X  if test -d /usr/nec ;then
X    version_type=linux
X    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
X    soname_spec='$libname${shared_ext}.$major'
X    shlibpath_var=LD_LIBRARY_PATH
X  fi
X  ;;
X
Xuts4*)
X  version_type=linux
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  shlibpath_var=LD_LIBRARY_PATH
X  ;;
X
X*)
X  dynamic_linker=no
X  ;;
Xesac
XAC_MSG_RESULT([$dynamic_linker])
Xtest "$dynamic_linker" = no && can_build_shared=no
X])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
X
X
X# _LT_AC_TAGCONFIG
X# ----------------
XAC_DEFUN([_LT_AC_TAGCONFIG],
X[AC_ARG_WITH([tags],
X    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
X        [include additional configurations @<:@automatic@:>@])],
X    [tagnames="$withval"])
X
Xif test -f "$ltmain" && test -n "$tagnames"; then
X  if test ! -f "${ofile}"; then
X    AC_MSG_WARN([output file `$ofile' does not exist])
X  fi
X
X  if test -z "$LTCC"; then
X    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
X    if test -z "$LTCC"; then
X      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
X    else
X      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
X    fi
X  fi
X
X  # Extract list of available tagged configurations in $ofile.
X  # Note that this assumes the entire list is on one line.
X  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
X
X  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
X  for tagname in $tagnames; do
X    IFS="$lt_save_ifs"
X    # Check whether tagname contains only valid characters
X    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
X    "") ;;
X    *)  AC_MSG_ERROR([invalid tag name: $tagname])
X	;;
X    esac
X
X    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
X    then
X      AC_MSG_ERROR([tag name \"$tagname\" already exists])
X    fi
X
X    # Update the list of available tags.
X    if test -n "$tagname"; then
X      echo appending configuration tag \"$tagname\" to $ofile
X
X      case $tagname in
X      CXX)
X	if test -n "$CXX" && test "X$CXX" != "Xno"; then
X	  AC_LIBTOOL_LANG_CXX_CONFIG
X	else
X	  tagname=""
X	fi
X	;;
X
X      F77)
X	if test -n "$F77" && test "X$F77" != "Xno"; then
X	  AC_LIBTOOL_LANG_F77_CONFIG
X	else
X	  tagname=""
X	fi
X	;;
X
X      GCJ)
X	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
X	  AC_LIBTOOL_LANG_GCJ_CONFIG
X	else
X	  tagname=""
X	fi
X	;;
X
X      RC)
X	AC_LIBTOOL_LANG_RC_CONFIG
X	;;
X
X      *)
X	AC_MSG_ERROR([Unsupported tag name: $tagname])
X	;;
X      esac
X
X      # Append the new tag name to the list of available tags.
X      if test -n "$tagname" ; then
X      available_tags="$available_tags $tagname"
X    fi
X    fi
X  done
X  IFS="$lt_save_ifs"
X
X  # Now substitute the updated list of available tags.
X  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
X    mv "${ofile}T" "$ofile"
X    chmod +x "$ofile"
X  else
X    rm -f "${ofile}T"
X    AC_MSG_ERROR([unable to update list of available tagged configurations.])
X  fi
Xfi
X])# _LT_AC_TAGCONFIG
X
X
X# AC_LIBTOOL_DLOPEN
X# -----------------
X# enable checks for dlopen support
XAC_DEFUN([AC_LIBTOOL_DLOPEN],
X [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
X])# AC_LIBTOOL_DLOPEN
X
X
X# AC_LIBTOOL_WIN32_DLL
X# --------------------
X# declare package support for building win32 dll's
XAC_DEFUN([AC_LIBTOOL_WIN32_DLL],
X[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
X])# AC_LIBTOOL_WIN32_DLL
X
X
X# AC_ENABLE_SHARED([DEFAULT])
X# ---------------------------
X# implement the --enable-shared flag
X# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
XAC_DEFUN([AC_ENABLE_SHARED],
X[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
XAC_ARG_ENABLE([shared],
X    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
X	[build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
X    [p=${PACKAGE-default}
X    case $enableval in
X    yes) enable_shared=yes ;;
X    no) enable_shared=no ;;
X    *)
X      enable_shared=no
X      # Look at the argument we got.  We use all the common list separators.
X      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
X      for pkg in $enableval; do
X	IFS="$lt_save_ifs"
X	if test "X$pkg" = "X$p"; then
X	  enable_shared=yes
X	fi
X      done
X      IFS="$lt_save_ifs"
X      ;;
X    esac],
X    [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
X])# AC_ENABLE_SHARED
X
X
X# AC_DISABLE_SHARED
X# -----------------
X#- set the default shared flag to --disable-shared
XAC_DEFUN([AC_DISABLE_SHARED],
X[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
XAC_ENABLE_SHARED(no)
X])# AC_DISABLE_SHARED
X
X
X# AC_ENABLE_STATIC([DEFAULT])
X# ---------------------------
X# implement the --enable-static flag
X# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
XAC_DEFUN([AC_ENABLE_STATIC],
X[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
XAC_ARG_ENABLE([static],
X    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
X	[build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
X    [p=${PACKAGE-default}
X    case $enableval in
X    yes) enable_static=yes ;;
X    no) enable_static=no ;;
X    *)
X     enable_static=no
X      # Look at the argument we got.  We use all the common list separators.
X      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
X      for pkg in $enableval; do
X	IFS="$lt_save_ifs"
X	if test "X$pkg" = "X$p"; then
X	  enable_static=yes
X	fi
X      done
X      IFS="$lt_save_ifs"
X      ;;
X    esac],
X    [enable_static=]AC_ENABLE_STATIC_DEFAULT)
X])# AC_ENABLE_STATIC
X
X
X# AC_DISABLE_STATIC
X# -----------------
X# set the default static flag to --disable-static
XAC_DEFUN([AC_DISABLE_STATIC],
X[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
XAC_ENABLE_STATIC(no)
X])# AC_DISABLE_STATIC
X
X
X# AC_ENABLE_FAST_INSTALL([DEFAULT])
X# ---------------------------------
X# implement the --enable-fast-install flag
X# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
XAC_DEFUN([AC_ENABLE_FAST_INSTALL],
X[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
XAC_ARG_ENABLE([fast-install],
X    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
X    [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
X    [p=${PACKAGE-default}
X    case $enableval in
X    yes) enable_fast_install=yes ;;
X    no) enable_fast_install=no ;;
X    *)
X      enable_fast_install=no
X      # Look at the argument we got.  We use all the common list separators.
X      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
X      for pkg in $enableval; do
X	IFS="$lt_save_ifs"
X	if test "X$pkg" = "X$p"; then
X	  enable_fast_install=yes
X	fi
X      done
X      IFS="$lt_save_ifs"
X      ;;
X    esac],
X    [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
X])# AC_ENABLE_FAST_INSTALL
X
X
X# AC_DISABLE_FAST_INSTALL
X# -----------------------
X# set the default to --disable-fast-install
XAC_DEFUN([AC_DISABLE_FAST_INSTALL],
X[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
XAC_ENABLE_FAST_INSTALL(no)
X])# AC_DISABLE_FAST_INSTALL
X
X
X# AC_LIBTOOL_PICMODE([MODE])
X# --------------------------
X# implement the --with-pic flag
X# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
XAC_DEFUN([AC_LIBTOOL_PICMODE],
X[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
Xpic_mode=ifelse($#,1,$1,default)
X])# AC_LIBTOOL_PICMODE
X
X
X# AC_PROG_EGREP
X# -------------
X# This is predefined starting with Autoconf 2.54, so this conditional
X# definition can be removed once we require Autoconf 2.54 or later.
Xm4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
X[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
X   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
X    then ac_cv_prog_egrep='grep -E'
X    else ac_cv_prog_egrep='egrep'
X    fi])
X EGREP=$ac_cv_prog_egrep
X AC_SUBST([EGREP])
X])])
X
X
X# AC_PATH_TOOL_PREFIX
X# -------------------
X# find a file program which can recognise shared library
XAC_DEFUN([AC_PATH_TOOL_PREFIX],
X[AC_REQUIRE([AC_PROG_EGREP])dnl
XAC_MSG_CHECKING([for $1])
XAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
X[case $MAGIC_CMD in
X[[\\/*] |  ?:[\\/]*])
X  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
X  ;;
X*)
X  lt_save_MAGIC_CMD="$MAGIC_CMD"
X  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
Xdnl $ac_dummy forces splitting on constant user-supplied paths.
Xdnl POSIX.2 word splitting is done only on the output of word expansions,
Xdnl not every word.  This closes a longstanding sh security hole.
X  ac_dummy="ifelse([$2], , $PATH, [$2])"
X  for ac_dir in $ac_dummy; do
X    IFS="$lt_save_ifs"
X    test -z "$ac_dir" && ac_dir=.
X    if test -f $ac_dir/$1; then
X      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
X      if test -n "$file_magic_test_file"; then
X	case $deplibs_check_method in
X	"file_magic "*)
X	  file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
X	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
X	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
X	    $EGREP "$file_magic_regex" > /dev/null; then
X	    :
X	  else
X	    cat <<EOF 1>&2
X
X*** Warning: the command libtool uses to detect shared libraries,
X*** $file_magic_cmd, produces output that libtool cannot recognize.
X*** The result is that libtool may fail to recognize shared libraries
X*** as such.  This will affect the creation of libtool libraries that
X*** depend on shared libraries, but programs linked with such libtool
X*** libraries will work regardless of this problem.  Nevertheless, you
X*** may want to report the problem to your system manager and/or to
X*** bug-libtool@gnu.org
X
XEOF
X	  fi ;;
X	esac
X      fi
X      break
X    fi
X  done
X  IFS="$lt_save_ifs"
X  MAGIC_CMD="$lt_save_MAGIC_CMD"
X  ;;
Xesac])
XMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
Xif test -n "$MAGIC_CMD"; then
X  AC_MSG_RESULT($MAGIC_CMD)
Xelse
X  AC_MSG_RESULT(no)
Xfi
X])# AC_PATH_TOOL_PREFIX
X
X
X# AC_PATH_MAGIC
X# -------------
X# find a file program which can recognise a shared library
XAC_DEFUN([AC_PATH_MAGIC],
X[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
Xif test -z "$lt_cv_path_MAGIC_CMD"; then
X  if test -n "$ac_tool_prefix"; then
X    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
X  else
X    MAGIC_CMD=:
X  fi
Xfi
X])# AC_PATH_MAGIC
X
X
X# AC_PROG_LD
X# ----------
X# find the path to the GNU or non-GNU linker
XAC_DEFUN([AC_PROG_LD],
X[AC_ARG_WITH([gnu-ld],
X    [AC_HELP_STRING([--with-gnu-ld],
X	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
X    [test "$withval" = no || with_gnu_ld=yes],
X    [with_gnu_ld=no])
XAC_REQUIRE([LT_AC_PROG_SED])dnl
XAC_REQUIRE([AC_PROG_CC])dnl
XAC_REQUIRE([AC_CANONICAL_HOST])dnl
XAC_REQUIRE([AC_CANONICAL_BUILD])dnl
Xac_prog=ld
Xif test "$GCC" = yes; then
X  # Check if gcc -print-prog-name=ld gives a path.
X  AC_MSG_CHECKING([for ld used by $CC])
X  case $host in
X  *-*-mingw*)
X    # gcc leaves a trailing carriage return which upsets mingw
X    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
X  *)
X    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
X  esac
X  case $ac_prog in
X    # Accept absolute paths.
X    [[\\/]]* | ?:[[\\/]]*)
X      re_direlt='/[[^/]][[^/]]*/\.\./'
X      # Canonicalize the path of ld
X      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
X      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
X	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
X      done
X      test -z "$LD" && LD="$ac_prog"
X      ;;
X  "")
X    # If it fails, then pretend we aren't using GCC.
X    ac_prog=ld
X    ;;
X  *)
X    # If it is relative, then search for the first ld in PATH.
X    with_gnu_ld=unknown
X    ;;
X  esac
Xelif test "$with_gnu_ld" = yes; then
X  AC_MSG_CHECKING([for GNU ld])
Xelse
X  AC_MSG_CHECKING([for non-GNU ld])
Xfi
XAC_CACHE_VAL(lt_cv_path_LD,
X[if test -z "$LD"; then
X  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
X  for ac_dir in $PATH; do
X    IFS="$lt_save_ifs"
X    test -z "$ac_dir" && ac_dir=.
X    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
X      lt_cv_path_LD="$ac_dir/$ac_prog"
X      # Check to see if the program is GNU ld.  I'd rather use --version,
X      # but apparently some GNU ld's only accept -v.
X      # Break only if it was the GNU/non-GNU ld that we prefer.
X      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
X      *GNU* | *'with BFD'*)
X	test "$with_gnu_ld" != no && break
X	;;
X      *)
X	test "$with_gnu_ld" != yes && break
X	;;
X      esac
X    fi
X  done
X  IFS="$lt_save_ifs"
Xelse
X  lt_cv_path_LD="$LD" # Let the user override the test with a path.
Xfi])
XLD="$lt_cv_path_LD"
Xif test -n "$LD"; then
X  AC_MSG_RESULT($LD)
Xelse
X  AC_MSG_RESULT(no)
Xfi
Xtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
XAC_PROG_LD_GNU
X])# AC_PROG_LD
X
X
X# AC_PROG_LD_GNU
X# --------------
XAC_DEFUN([AC_PROG_LD_GNU],
X[AC_REQUIRE([AC_PROG_EGREP])dnl
XAC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
X[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
Xcase `$LD -v 2>&1 </dev/null` in
X*GNU* | *'with BFD'*)
X  lt_cv_prog_gnu_ld=yes
X  ;;
X*)
X  lt_cv_prog_gnu_ld=no
X  ;;
Xesac])
Xwith_gnu_ld=$lt_cv_prog_gnu_ld
X])# AC_PROG_LD_GNU
X
X
X# AC_PROG_LD_RELOAD_FLAG
X# ----------------------
X# find reload flag for linker
X#   -- PORTME Some linkers may need a different reload flag.
XAC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
X[AC_CACHE_CHECK([for $LD option to reload object files],
X  lt_cv_ld_reload_flag,
X  [lt_cv_ld_reload_flag='-r'])
Xreload_flag=$lt_cv_ld_reload_flag
Xcase $reload_flag in
X"" | " "*) ;;
X*) reload_flag=" $reload_flag" ;;
Xesac
Xreload_cmds='$LD$reload_flag -o $output$reload_objs'
X])# AC_PROG_LD_RELOAD_FLAG
X
X
X# AC_DEPLIBS_CHECK_METHOD
X# -----------------------
X# how to check for library dependencies
X#  -- PORTME fill in with the dynamic library characteristics
XAC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
X[AC_CACHE_CHECK([how to recognise dependent libraries],
Xlt_cv_deplibs_check_method,
X[lt_cv_file_magic_cmd='$MAGIC_CMD'
Xlt_cv_file_magic_test_file=
Xlt_cv_deplibs_check_method='unknown'
X# Need to set the preceding variable on all platforms that support
X# interlibrary dependencies.
X# 'none' -- dependencies not supported.
X# `unknown' -- same as none, but documents that we really don't know.
X# 'pass_all' -- all dependencies passed with no checks.
X# 'test_compile' -- check by making test program.
X# 'file_magic [[regex]]' -- check by looking for files in library path
X# which responds to the $file_magic_cmd with a given extended regex.
X# If you have `file' or equivalent on your system and you're not sure
X# whether `pass_all' will *always* work, you probably want this one.
X
Xcase $host_os in
Xaix4* | aix5*)
X  lt_cv_deplibs_check_method=pass_all
X  ;;
X
Xbeos*)
X  lt_cv_deplibs_check_method=pass_all
X  ;;
X
Xbsdi4*)
X  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
X  lt_cv_file_magic_cmd='/usr/bin/file -L'
X  lt_cv_file_magic_test_file=/shlib/libc.so
X  ;;
X
Xcygwin* | mingw* | pw32*)
X  # win32_libid is a shell function defined in ltmain.sh
X  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
X  lt_cv_file_magic_cmd='win32_libid'
X  ;;
X
Xdarwin* | rhapsody*)
X  # this will be overwritten by pass_all, but leave it in just in case
X  lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
X  lt_cv_file_magic_cmd='/usr/bin/file -L'
X  case "$host_os" in
X  rhapsody* | darwin1.[[012]])
X    lt_cv_file_magic_test_file=`/System/Library/Frameworks/System.framework/System`
X    ;;
X  *) # Darwin 1.3 on
X    lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
X    ;;
X  esac
X  lt_cv_deplibs_check_method=pass_all
X  ;;
X
Xfreebsd*)
X  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
X    case $host_cpu in
X    i*86 )
X      # Not sure whether the presence of OpenBSD here was a mistake.
X      # Let's accept both of them until this is cleared up.
X      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'
X      lt_cv_file_magic_cmd=/usr/bin/file
X      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
X      ;;
X    esac
X  else
X    lt_cv_deplibs_check_method=pass_all
X  fi
X  ;;
X
Xgnu*)
X  lt_cv_deplibs_check_method=pass_all
X  ;;
X
Xhpux10.20* | hpux11*)
X  lt_cv_file_magic_cmd=/usr/bin/file
X  case "$host_cpu" in
X  ia64*)
X    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
X    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
X    ;;
X  hppa*64*)
X    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
X    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
X    ;;
X  *)
X    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
X    lt_cv_file_magic_test_file=/usr/lib/libc.sl
X    ;;
X  esac
X  ;;
X
Xirix5* | irix6* | nonstopux*)
X  case $host_os in
X  irix5* | nonstopux*)
X    # this will be overridden with pass_all, but let us keep it just in case
X    lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
X    ;;
X  *)
X    case $LD in
X    *-32|*"-32 ") libmagic=32-bit;;
X    *-n32|*"-n32 ") libmagic=N32;;
X    *-64|*"-64 ") libmagic=64-bit;;
X    *) libmagic=never-match;;
X    esac
X    # this will be overridden with pass_all, but let us keep it just in case
X    lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
X    ;;
X  esac
X  lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
X  lt_cv_deplibs_check_method=pass_all
X  ;;
X
X# This must be Linux ELF.
Xlinux*)
X  case $host_cpu in
X  alpha* | hppa* | i*86 | ia64* | m68* | mips | mipsel | powerpc* | sparc* | s390* | sh* | x86_64*)
X    lt_cv_deplibs_check_method=pass_all ;;
X  *)
X    # glibc up to 2.1.1 does not perform some relocations on ARM
X    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
X  esac
X  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
X  ;;
X
Xnetbsd*)
X  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
X    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
X  else
X    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
X  fi
X  ;;
X
Xnewos6*)
X  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
X  lt_cv_file_magic_cmd=/usr/bin/file
X  lt_cv_file_magic_test_file=/usr/lib/libnls.so
X  ;;
X
Xnto-qnx)
X  lt_cv_deplibs_check_method=unknown
X  ;;
X
Xopenbsd*)
X  lt_cv_file_magic_cmd=/usr/bin/file
X  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
X  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
X    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
X  else
X    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
X  fi
X  ;;
X
Xosf3* | osf4* | osf5*)
X  # this will be overridden with pass_all, but let us keep it just in case
X  lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
X  lt_cv_file_magic_test_file=/shlib/libc.so
X  lt_cv_deplibs_check_method=pass_all
X  ;;
X
Xsco3.2v5*)
X  lt_cv_deplibs_check_method=pass_all
X  ;;
X
Xsolaris*)
X  lt_cv_deplibs_check_method=pass_all
X  lt_cv_file_magic_test_file=/lib/libc.so
X  ;;
X
Xsysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
X  case $host_vendor in
X  motorola)
X    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
X    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
X    ;;
X  ncr)
X    lt_cv_deplibs_check_method=pass_all
X    ;;
X  sequent)
X    lt_cv_file_magic_cmd='/bin/file'
X    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
X    ;;
X  sni)
X    lt_cv_file_magic_cmd='/bin/file'
X    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
X    lt_cv_file_magic_test_file=/lib/libc.so
X    ;;
X  siemens)
X    lt_cv_deplibs_check_method=pass_all
X    ;;
X  esac
X  ;;
X
Xsysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
X  lt_cv_deplibs_check_method=pass_all
X  ;;
Xesac
X])
Xfile_magic_cmd=$lt_cv_file_magic_cmd
Xdeplibs_check_method=$lt_cv_deplibs_check_method
Xtest -z "$deplibs_check_method" && deplibs_check_method=unknown
X])# AC_DEPLIBS_CHECK_METHOD
X
X
X# AC_PROG_NM
X# ----------
X# find the path to a BSD-compatible name lister
XAC_DEFUN([AC_PROG_NM],
X[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
X[if test -n "$NM"; then
X  # Let the user override the test.
X  lt_cv_path_NM="$NM"
Xelse
X  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
X  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
X    IFS="$lt_save_ifs"
X    test -z "$ac_dir" && ac_dir=.
X    tmp_nm="$ac_dir/${ac_tool_prefix}nm"
X    if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
X      # Check to see if the nm accepts a BSD-compat flag.
X      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
X      #   nm: unknown option "B" ignored
X      # Tru64's nm complains that /dev/null is an invalid object file
X      case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
X      */dev/null* | *'Invalid file or object type'*)
X	lt_cv_path_NM="$tmp_nm -B"
X	break
X        ;;
X      *)
X	case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
X	*/dev/null*)
X	  lt_cv_path_NM="$tmp_nm -p"
X	  break
X	  ;;
X	*)
X	  lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
X	  continue # so that we can try to find one that supports BSD flags
X	  ;;
X	esac
X      esac
X    fi
X  done
X  IFS="$lt_save_ifs"
X  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
Xfi])
XNM="$lt_cv_path_NM"
X])# AC_PROG_NM
X
X
X# AC_CHECK_LIBM
X# -------------
X# check for math library
XAC_DEFUN([AC_CHECK_LIBM],
X[AC_REQUIRE([AC_CANONICAL_HOST])dnl
XLIBM=
Xcase $host in
X*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
X  # These system don't have libm, or don't need it
X  ;;
X*-ncr-sysv4.3*)
X  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
X  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
X  ;;
X*)
X  AC_CHECK_LIB(m, cos, LIBM="-lm")
X  ;;
Xesac
X])# AC_CHECK_LIBM
X
X
X# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
X# -----------------------------------
X# sets LIBLTDL to the link flags for the libltdl convenience library and
X# LTDLINCL to the include flags for the libltdl header and adds
X# --enable-ltdl-convenience to the configure arguments.  Note that LIBLTDL
X# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
X# DIRECTORY is not provided, it is assumed to be `libltdl'.  LIBLTDL will
X# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with
X# '${top_srcdir}/' (note the single quotes!).  If your package is not
X# flat and you're not using automake, define top_builddir and
X# top_srcdir appropriately in the Makefiles.
XAC_DEFUN([AC_LIBLTDL_CONVENIENCE],
X[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
X  case $enable_ltdl_convenience in
X  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
X  "") enable_ltdl_convenience=yes
X      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
X  esac
X  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
X  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
X  # For backwards non-gettext consistent compatibility...
X  INCLTDL="$LTDLINCL"
X])# AC_LIBLTDL_CONVENIENCE
X
X
X# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
X# -----------------------------------
X# sets LIBLTDL to the link flags for the libltdl installable library and
X# LTDLINCL to the include flags for the libltdl header and adds
X# --enable-ltdl-install to the configure arguments.  Note that LIBLTDL
X# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
X# DIRECTORY is not provided and an installed libltdl is not found, it is
X# assumed to be `libltdl'.  LIBLTDL will be prefixed with '${top_builddir}/'
X# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single
X# quotes!).  If your package is not flat and you're not using automake,
X# define top_builddir and top_srcdir appropriately in the Makefiles.
X# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
XAC_DEFUN([AC_LIBLTDL_INSTALLABLE],
X[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
X  AC_CHECK_LIB(ltdl, lt_dlinit,
X  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
X  [if test x"$enable_ltdl_install" = xno; then
X     AC_MSG_WARN([libltdl not installed, but installation disabled])
X   else
X     enable_ltdl_install=yes
X   fi
X  ])
X  if test x"$enable_ltdl_install" = x"yes"; then
X    ac_configure_args="$ac_configure_args --enable-ltdl-install"
X    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
X    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
X  else
X    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
X    LIBLTDL="-lltdl"
X    LTDLINCL=
X  fi
X  # For backwards non-gettext consistent compatibility...
X  INCLTDL="$LTDLINCL"
X])# AC_LIBLTDL_INSTALLABLE
X
X
X# AC_LIBTOOL_CXX
X# --------------
X# enable support for C++ libraries
XAC_DEFUN([AC_LIBTOOL_CXX],
X[AC_REQUIRE([_LT_AC_LANG_CXX])
X])# AC_LIBTOOL_CXX
X
X
X# _LT_AC_LANG_CXX
X# ---------------
XAC_DEFUN([_LT_AC_LANG_CXX],
X[AC_REQUIRE([AC_PROG_CXX])
XAC_REQUIRE([AC_PROG_CXXCPP])
X_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,CXX" | sed 's/^,//'`])
X])# _LT_AC_LANG_CXX
X
X
X# AC_LIBTOOL_F77
X# --------------
X# enable support for Fortran 77 libraries
XAC_DEFUN([AC_LIBTOOL_F77],
X[AC_REQUIRE([_LT_AC_LANG_F77])
X])# AC_LIBTOOL_F77
X
X
X# _LT_AC_LANG_F77
X# ---------------
XAC_DEFUN([_LT_AC_LANG_F77],
X[AC_REQUIRE([AC_PROG_F77])
X_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,F77" | sed 's/^,//'`])
X])# _LT_AC_LANG_F77
X
X
X# AC_LIBTOOL_GCJ
X# --------------
X# enable support for GCJ libraries
XAC_DEFUN([AC_LIBTOOL_GCJ],
X[AC_REQUIRE([_LT_AC_LANG_GCJ])
X])# AC_LIBTOOL_GCJ
X
X
X# _LT_AC_LANG_GCJ
X# ---------------
XAC_DEFUN([_LT_AC_LANG_GCJ],
X[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
X  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
X    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
X      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
X	 [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
X	   [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
X_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,GCJ" | sed 's/^,//'`])
X])# _LT_AC_LANG_GCJ
X
X
X# AC_LIBTOOL_RC
X# --------------
X# enable support for Windows resource files
XAC_DEFUN([AC_LIBTOOL_RC],
X[AC_REQUIRE([LT_AC_PROG_RC])
X_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,RC" | sed 's/^,//'`])
X])# AC_LIBTOOL_RC
X
X
X# AC_LIBTOOL_LANG_C_CONFIG
X# ------------------------
X# Ensure that the configuration vars for the C compiler are
X# suitably defined.  Those variables are subsequently used by
X# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
XAC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
XAC_DEFUN([_LT_AC_LANG_C_CONFIG],
X[lt_save_CC="$CC"
XAC_LANG_PUSH(C)
X
X# Source file extension for C test sources.
Xac_ext=c
X
X# Object file extension for compiled C test sources.
Xobjext=o
X_LT_AC_TAGVAR(objext, $1)=$objext
X
X# Code to be used in simple compile tests
Xlt_simple_compile_test_code="int some_variable = 0;\n"
X
X# Code to be used in simple link tests
Xlt_simple_link_test_code='int main(){return(0);}\n'
X
X_LT_AC_SYS_COMPILER
X
X#
X# Check for any special shared library compilation flags.
X#
X_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
Xif test "$GCC" = no; then
X  case $host_os in
X  sco3.2v5*)
X    _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
X    ;;
X  esac
Xfi
Xif test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
X  AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
X  if echo "$old_CC $old_CFLAGS " | grep "[[ 	]]$]_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[[ 	]]" >/dev/null; then :
X  else
X    AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
X    _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
X  fi
Xfi
X
X
X#
X# Check to make sure the static flag actually works.
X#
XAC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
X  _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
X  $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
X  [],
X  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
X
X
XAC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
XAC_LIBTOOL_PROG_COMPILER_PIC($1)
XAC_LIBTOOL_PROG_CC_C_O($1)
XAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
XAC_LIBTOOL_PROG_LD_SHLIBS($1)
XAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
XAC_LIBTOOL_SYS_LIB_STRIP
XAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
XAC_LIBTOOL_DLOPEN_SELF($1)
X
X# Report which librarie types wil actually be built
XAC_MSG_CHECKING([if libtool supports shared libraries])
XAC_MSG_RESULT([$can_build_shared])
X
XAC_MSG_CHECKING([whether to build shared libraries])
Xtest "$can_build_shared" = "no" && enable_shared=no
X
X# On AIX, shared libraries and static libraries use the same namespace, and
X# are all built from PIC.
Xcase "$host_os" in
Xaix3*)
X  test "$enable_shared" = yes && enable_static=no
X  if test -n "$RANLIB"; then
X    archive_cmds="$archive_cmds~\$RANLIB \$lib"
X    postinstall_cmds='$RANLIB $lib'
X  fi
X  ;;
X
Xaix4*)
X  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
X    test "$enable_shared" = yes && enable_static=no
X  fi
X  ;;
X  darwin* | rhapsody*)
X  if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then 
X    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
X    case "$host_os" in
X    rhapsody* | darwin1.[[012]])
X      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
X      ;;
X    *) # Darwin 1.3 on
X      test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
X      ;;
X    esac
X    # FIXME: Relying on posixy $() will cause problems for
X    #        cross-compilation, but unfortunately the echo tests do not
X    #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
X    #	       `"' quotes if we put them in here... so don't!
X		output_verbose_link_cmd='echo'
X    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring'
X    _LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags'
X    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
X		  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag  -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
X		  _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag  -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
X    _LT_AC_TAGVAR(hardcode_direct, $1)=no
X    _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
X    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
X    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
X    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
X    fi
X    ;;  
Xesac
XAC_MSG_RESULT([$enable_shared])
X
XAC_MSG_CHECKING([whether to build static libraries])
X# Make sure either enable_shared or enable_static is yes.
Xtest "$enable_shared" = yes || enable_static=yes
XAC_MSG_RESULT([$enable_static])
X
XAC_LIBTOOL_CONFIG($1)
X
XAC_LANG_POP
XCC="$lt_save_CC"
X])# AC_LIBTOOL_LANG_C_CONFIG
X
X
X# AC_LIBTOOL_LANG_CXX_CONFIG
X# --------------------------
X# Ensure that the configuration vars for the C compiler are
X# suitably defined.  Those variables are subsequently used by
X# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
XAC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
XAC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
X[AC_LANG_PUSH(C++)
XAC_REQUIRE([AC_PROG_CXX])
XAC_REQUIRE([AC_PROG_CXXCPP])
X
X_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
X_LT_AC_TAGVAR(allow_undefined_flag, $1)=
X_LT_AC_TAGVAR(always_export_symbols, $1)=no
X_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
X_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
X_LT_AC_TAGVAR(hardcode_direct, $1)=no
X_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
X_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
X_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
X_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
X_LT_AC_TAGVAR(hardcode_automatic, $1)=no
X_LT_AC_TAGVAR(module_cmds, $1)=
X_LT_AC_TAGVAR(module_expsym_cmds, $1)=
X_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
X_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
X_LT_AC_TAGVAR(no_undefined_flag, $1)=
X_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
X_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
X
X# Dependencies to place before and after the object being linked:
X_LT_AC_TAGVAR(predep_objects, $1)=
X_LT_AC_TAGVAR(postdep_objects, $1)=
X_LT_AC_TAGVAR(predeps, $1)=
X_LT_AC_TAGVAR(postdeps, $1)=
X_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
X
X# Source file extension for C++ test sources.
Xac_ext=cc
X
X# Object file extension for compiled C++ test sources.
Xobjext=o
X_LT_AC_TAGVAR(objext, $1)=$objext
X
X# Code to be used in simple compile tests
Xlt_simple_compile_test_code="int some_variable = 0;\n"
X
X# Code to be used in simple link tests
Xlt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
X
X# ltmain only uses $CC for tagged configurations so make sure $CC is set.
X_LT_AC_SYS_COMPILER
X
X# Allow CC to be a program name with arguments.
Xlt_save_CC=$CC
Xlt_save_LD=$LD
Xlt_save_GCC=$GCC
XGCC=$GXX
Xlt_save_with_gnu_ld=$with_gnu_ld
Xlt_save_path_LD=$lt_cv_path_LD
Xif test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
X  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
Xelse
X  unset lt_cv_prog_gnu_ld
Xfi
Xif test -n "${lt_cv_path_LDCXX+set}"; then
X  lt_cv_path_LD=$lt_cv_path_LDCXX
Xelse
X  unset lt_cv_path_LD
Xfi
Xtest -z "${LDCXX+set}" || LD=$LDCXX
XCC=${CXX-"c++"}
Xcompiler=$CC
X_LT_AC_TAGVAR(compiler, $1)=$CC
Xcc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
X
X# We don't want -fno-exception wen compiling C++ code, so set the
X# no_builtin_flag separately
Xif test "$GXX" = yes; then
X  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
Xelse
X  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
Xfi
X
Xif test "$GXX" = yes; then
X  # Set up default GNU C++ configuration
X
X  AC_PROG_LD
X
X  # Check if GNU C++ uses GNU ld as the underlying linker, since the
X  # archiving commands below assume that GNU ld is being used.
X  if test "$with_gnu_ld" = yes; then
X    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
X    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
X
X    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
X    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
X
X    # If archive_cmds runs LD, not CC, wlarc should be empty
X    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
X    #     investigate it a little bit more. (MM)
X    wlarc='${wl}'
X
X    # ancient GNU ld didn't support --whole-archive et. al.
X    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
X	grep 'no-whole-archive' > /dev/null; then
X      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
X    else
X      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
X    fi
X  else
X    with_gnu_ld=no
X    wlarc=
X
X    # A generic and very simple default shared library creation
X    # command for GNU C++ for the case where it uses the native
X    # linker, instead of GNU ld.  If possible, this setting should
X    # overridden to take advantage of the native linker features on
X    # the platform it is being used on.
X    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
X  fi
X
X  # Commands to make compiler produce verbose output that lists
X  # what "hidden" libraries, object files and flags are used when
X  # linking a shared library.
X  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
X
Xelse
X  GXX=no
X  with_gnu_ld=no
X  wlarc=
Xfi
X
X# PORTME: fill in a description of your system's C++ link characteristics
XAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
X_LT_AC_TAGVAR(ld_shlibs, $1)=yes
Xcase $host_os in
X  aix3*)
X    # FIXME: insert proper C++ library support
X    _LT_AC_TAGVAR(ld_shlibs, $1)=no
X    ;;
X  aix4* | aix5*)
X    if test "$host_cpu" = ia64; then
X      # On IA64, the linker does run time linking by default, so we don't
X      # have to do anything special.
X      aix_use_runtimelinking=no
X      exp_sym_flag='-Bexport'
X      no_entry_flag=""
X    else
X      aix_use_runtimelinking=no
X
X      # Test if we are trying to use run time linking or normal
X      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
X      # need to do runtime linking.
X      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
X	for ld_flag in $LDFLAGS; do
X	  case $ld_flag in
X	  *-brtl*)
X	    aix_use_runtimelinking=yes
X	    break
X	    ;;
X	  esac
X	done
X      esac
X
X      exp_sym_flag='-bexport'
X      no_entry_flag='-bnoentry'
X    fi
X
X    # When large executables or shared objects are built, AIX ld can
X    # have problems creating the table of contents.  If linking a library
X    # or program results in "error TOC overflow" add -mminimal-toc to
X    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
X    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
X
X    _LT_AC_TAGVAR(archive_cmds, $1)=''
X    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
X    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
X    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
X
X    if test "$GXX" = yes; then
X      case $host_os in aix4.[012]|aix4.[012].*)
X      # We only want to do this on AIX 4.2 and lower, the check
X      # below for broken collect2 doesn't work under 4.3+
X	collect2name=`${CC} -print-prog-name=collect2`
X	if test -f "$collect2name" && \
X	   strings "$collect2name" | grep resolve_lib_name >/dev/null
X	then
X	  # We have reworked collect2
X	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
X	else
X	  # We have old collect2
X	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
X	  # It fails to find uninstalled libraries when the uninstalled
X	  # path is not listed in the libpath.  Setting hardcode_minus_L
X	  # to unsupported forces relinking
X	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
X	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
X	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
X	fi
X      esac
X      shared_flag='-shared'
X    else
X      # not using gcc
X      if test "$host_cpu" = ia64; then
X	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
X	# chokes on -Wl,-G. The following line is correct:
X	shared_flag='-G'
X      else
X	if test "$aix_use_runtimelinking" = yes; then
X	  shared_flag='${wl}-G'
X	else
X	  shared_flag='${wl}-bM:SRE'
X	fi
X      fi
X    fi
X
X    # It seems that -bexpall does not export symbols beginning with
X    # underscore (_), so it is better to generate a list of symbols to export.
X    _LT_AC_TAGVAR(always_export_symbols, $1)=yes
X    if test "$aix_use_runtimelinking" = yes; then
X      # Warning - without using the other runtime loading flags (-brtl),
X      # -berok will link without error, but may produce a broken library.
X      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
X      # Determine the default libpath from the value encoded in an empty executable.
X      _LT_AC_SYS_LIBPATH_AIX
X      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
X
X      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
X     else
X      if test "$host_cpu" = ia64; then
X	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
X	_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
X	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
X      else
X	# Determine the default libpath from the value encoded in an empty executable.
X	_LT_AC_SYS_LIBPATH_AIX
X	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
X	# Warning - without using the other run time loading flags,
X	# -berok will link without error, but may produce a broken library.
X	_LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
X	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
X	# -bexpall does not export symbols beginning with underscore (_)
X	_LT_AC_TAGVAR(always_export_symbols, $1)=yes
X	# Exported symbols can be pulled into shared objects from archives
X	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
X	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
X	# This is similar to how AIX traditionally builds it's shared libraries.
X	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
X      fi
X    fi
X    ;;
X  chorus*)
X    case $cc_basename in
X      *)
X	# FIXME: insert proper C++ library support
X	_LT_AC_TAGVAR(ld_shlibs, $1)=no
X	;;
X    esac
X    ;;
X
X  cygwin* | mingw* | pw32*)
X    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
X    # as there is no search path for DLLs.
X    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
X    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
X    _LT_AC_TAGVAR(always_export_symbols, $1)=no
X    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
X
X    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
X      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
X      # If the export-symbols file already is a .def file (1st line
X      # is EXPORTS), use it as is; otherwise, prepend...
X      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
X	cp $export_symbols $output_objdir/$soname.def;
X      else
X	echo EXPORTS > $output_objdir/$soname.def;
X	cat $export_symbols >> $output_objdir/$soname.def;
X      fi~
X      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
X    else
X      _LT_AC_TAGVAR(ld_shlibs, $1)=no
X    fi
X  ;;
X
X  darwin* | rhapsody*)
X   if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then 
X    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
X    case "$host_os" in
X    rhapsody* | darwin1.[[012]])
X      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
X      ;;
X    *) # Darwin 1.3 on
X      test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
X      ;;
X    esac
X    	lt_int_apple_cc_single_mod=no
X    	output_verbose_link_cmd='echo'
X    	if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
X    	  lt_int_apple_cc_single_mod=yes
X    	fi
X    	if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
X    	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
X    	else
X        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
X      fi
X      _LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags'
X
X    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
X      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
X        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
X      else
X        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
X      fi
X        _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag  -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
X    _LT_AC_TAGVAR(hardcode_direct, $1)=no
X    _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
X    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
X    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
X    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
X   fi 
X    ;;
X
X  dgux*)
X    case $cc_basename in
X      ec++)
X	# FIXME: insert proper C++ library support
X	_LT_AC_TAGVAR(ld_shlibs, $1)=no
X	;;
X      ghcx)
X	# Green Hills C++ Compiler
X	# FIXME: insert proper C++ library support
X	_LT_AC_TAGVAR(ld_shlibs, $1)=no
X	;;
X      *)
X	# FIXME: insert proper C++ library support
X	_LT_AC_TAGVAR(ld_shlibs, $1)=no
X	;;
X    esac
X    ;;
X  freebsd[12]*)
X    # C++ shared libraries reported to be fairly broken before switch to ELF
X    _LT_AC_TAGVAR(ld_shlibs, $1)=no
X    ;;
X  freebsd-elf*)
X    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
X    ;;
X  freebsd*)
X    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
X    # conventions
X    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
X    ;;
X  gnu*)
X    ;;
X  hpux9*)
X    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
X    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
X    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
X    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
X    _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
X				# but as the default
X				# location of the library.
X
X    case $cc_basename in
X    CC)
X      # FIXME: insert proper C++ library support
X      _LT_AC_TAGVAR(ld_shlibs, $1)=no
X      ;;
X    aCC)
X      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
X      # Commands to make compiler produce verbose output that lists
X      # what "hidden" libraries, object files and flags are used when
X      # linking a shared library.
X      #
X      # There doesn't appear to be a way to prevent this compiler from
X      # explicitly linking system object files so we need to strip them
X      # from the output so that they don't get included in the library
X      # dependencies.
X      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
X      ;;
X    *)
X      if test "$GXX" = yes; then
X        _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
X      else
X        # FIXME: insert proper C++ library support
X        _LT_AC_TAGVAR(ld_shlibs, $1)=no
X      fi
X      ;;
X    esac
X    ;;
X  hpux10*|hpux11*)
X    if test $with_gnu_ld = no; then
X      case "$host_cpu" in
X      hppa*64*)
X	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
X	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
X	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
X        ;;
X      ia64*)
X	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
X        ;;
X      *)
X	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
X	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
X	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
X        ;;
X      esac
X    fi
X    case "$host_cpu" in
X    hppa*64*)
X      _LT_AC_TAGVAR(hardcode_direct, $1)=no
X      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
X      ;;
X    ia64*)
X      _LT_AC_TAGVAR(hardcode_direct, $1)=no
X      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
X      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
X					      # but as the default
X					      # location of the library.
X      ;;
X    *)
X      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
X      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
X					      # but as the default
X					      # location of the library.
X      ;;
X    esac
X
X    case $cc_basename in
X      CC)
X	# FIXME: insert proper C++ library support
X	_LT_AC_TAGVAR(ld_shlibs, $1)=no
X	;;
X      aCC)
X	case "$host_cpu" in
X	hppa*64*|ia64*)
X	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
X	  ;;
X	*)
X	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
X	  ;;
X	esac
X	# Commands to make compiler produce verbose output that lists
X	# what "hidden" libraries, object files and flags are used when
X	# linking a shared library.
X	#
X	# There doesn't appear to be a way to prevent this compiler from
X	# explicitly linking system object files so we need to strip them
X	# from the output so that they don't get included in the library
X	# dependencies.
X	output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
X	;;
X      *)
X	if test "$GXX" = yes; then
X	  if test $with_gnu_ld = no; then
X	    case "$host_cpu" in
X	    ia64*|hppa*64*)
X	      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
X	      ;;
X	    *)
X	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
X	      ;;
X	    esac
X	  fi
X	else
X	  # FIXME: insert proper C++ library support
X	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
X	fi
X	;;
X    esac
X    ;;
X  irix5* | irix6*)
X    case $cc_basename in
X      CC)
X	# SGI C++
X	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
X
X	# Archives containing C++ object files must be created using
X	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
X	# necessary to make sure instantiated templates are included
X	# in the archive.
X	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
X	;;
X      *)
X	if test "$GXX" = yes; then
X	  if test "$with_gnu_ld" = no; then
X	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
X	  else
X	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
X	  fi
X	fi
X	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
X	;;
X    esac
X    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
X    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
X    ;;
X  linux*)
X    case $cc_basename in
X      KCC)
X	# Kuck and Associates, Inc. (KAI) C++ Compiler
X
X	# KCC will only create a shared library if the output file
X	# ends with ".so" (or ".sl" for HP-UX), so rename the library
X	# to its proper name (with version) after linking.
X	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
X	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
X	# Commands to make compiler produce verbose output that lists
X	# what "hidden" libraries, object files and flags are used when
X	# linking a shared library.
X	#
X	# There doesn't appear to be a way to prevent this compiler from
X	# explicitly linking system object files so we need to strip them
X	# from the output so that they don't get included in the library
X	# dependencies.
X	output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
X
X	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
X	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
X
X	# Archives containing C++ object files must be created using
X	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
X	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
X	;;
X      icpc)
X	# Intel C++
X	with_gnu_ld=yes
X	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
X	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
X	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
X	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
X	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
X	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
X	;;
X      cxx)
X	# Compaq C++
X	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
X	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
X
X	runpath_var=LD_RUN_PATH
X	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
X	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
X
X	# Commands to make compiler produce verbose output that lists
X	# what "hidden" libraries, object files and flags are used when
X	# linking a shared library.
X	#
X	# There doesn't appear to be a way to prevent this compiler from
X	# explicitly linking system object files so we need to strip them
X	# from the output so that they don't get included in the library
X	# dependencies.
X	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
X	;;
X    esac
X    ;;
X  lynxos*)
X    # FIXME: insert proper C++ library support
X    _LT_AC_TAGVAR(ld_shlibs, $1)=no
X    ;;
X  m88k*)
X    # FIXME: insert proper C++ library support
X    _LT_AC_TAGVAR(ld_shlibs, $1)=no
X    ;;
X  mvs*)
X    case $cc_basename in
X      cxx)
X	# FIXME: insert proper C++ library support
X	_LT_AC_TAGVAR(ld_shlibs, $1)=no
X	;;
X      *)
X	# FIXME: insert proper C++ library support
X	_LT_AC_TAGVAR(ld_shlibs, $1)=no
X	;;
X    esac
X    ;;
X  netbsd*)
X    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
X      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
X      wlarc=
X      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
X      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
X      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
X    fi
X    # Workaround some broken pre-1.5 toolchains
X    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
X    ;;
X  osf3*)
X    case $cc_basename in
X      KCC)
X	# Kuck and Associates, Inc. (KAI) C++ Compiler
X
X	# KCC will only create a shared library if the output file
X	# ends with ".so" (or ".sl" for HP-UX), so rename the library
X	# to its proper name (with version) after linking.
X	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
X
X	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
X	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
X
X	# Archives containing C++ object files must be created using
X	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
X	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
X
X	;;
X      RCC)
X	# Rational C++ 2.4.1
X	# FIXME: insert proper C++ library support
X	_LT_AC_TAGVAR(ld_shlibs, $1)=no
X	;;
X      cxx)
X	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
X	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
X
X	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
X	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
X
X	# Commands to make compiler produce verbose output that lists
X	# what "hidden" libraries, object files and flags are used when
X	# linking a shared library.
X	#
X	# There doesn't appear to be a way to prevent this compiler from
X	# explicitly linking system object files so we need to strip them
X	# from the output so that they don't get included in the library
X	# dependencies.
X	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
X	;;
X      *)
X	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
X	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
X	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
X
X	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
X	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
X
X	  # Commands to make compiler produce verbose output that lists
X	  # what "hidden" libraries, object files and flags are used when
X	  # linking a shared library.
X	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
X
X	else
X	  # FIXME: insert proper C++ library support
X	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
X	fi
X	;;
X    esac
X    ;;
X  osf4* | osf5*)
X    case $cc_basename in
X      KCC)
X	# Kuck and Associates, Inc. (KAI) C++ Compiler
X
X	# KCC will only create a shared library if the output file
X	# ends with ".so" (or ".sl" for HP-UX), so rename the library
X	# to its proper name (with version) after linking.
X	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
X
X	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
X	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
X
X	# Archives containing C++ object files must be created using
X	# the KAI C++ compiler.
X	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
X	;;
X      RCC)
X	# Rational C++ 2.4.1
X	# FIXME: insert proper C++ library support
X	_LT_AC_TAGVAR(ld_shlibs, $1)=no
X	;;
X      cxx)
X	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
X	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
X	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
X	  echo "-hidden">> $lib.exp~
X	  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version	$verstring` -update_registry $objdir/so_locations -o $lib~
X	  $rm $lib.exp'
X
X	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
X	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
X
X	# Commands to make compiler produce verbose output that lists
X	# what "hidden" libraries, object files and flags are used when
X	# linking a shared library.
X	#
X	# There doesn't appear to be a way to prevent this compiler from
X	# explicitly linking system object files so we need to strip them
X	# from the output so that they don't get included in the library
X	# dependencies.
X	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
X	;;
X      *)
X	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
X	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
X	 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
X
X	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
X	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
X
X	  # Commands to make compiler produce verbose output that lists
X	  # what "hidden" libraries, object files and flags are used when
X	  # linking a shared library.
X	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
X
X	else
X	  # FIXME: insert proper C++ library support
X	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
X	fi
X	;;
X    esac
X    ;;
X  psos*)
X    # FIXME: insert proper C++ library support
X    _LT_AC_TAGVAR(ld_shlibs, $1)=no
X    ;;
X  sco*)
X    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
X    case $cc_basename in
X      CC)
X	# FIXME: insert proper C++ library support
X	_LT_AC_TAGVAR(ld_shlibs, $1)=no
X	;;
X      *)
X	# FIXME: insert proper C++ library support
X	_LT_AC_TAGVAR(ld_shlibs, $1)=no
X	;;
X    esac
X    ;;
X  sunos4*)
X    case $cc_basename in
X      CC)
X	# Sun C++ 4.x
X	# FIXME: insert proper C++ library support
X	_LT_AC_TAGVAR(ld_shlibs, $1)=no
X	;;
X      lcc)
X	# Lucid
X	# FIXME: insert proper C++ library support
X	_LT_AC_TAGVAR(ld_shlibs, $1)=no
X	;;
X      *)
X	# FIXME: insert proper C++ library support
X	_LT_AC_TAGVAR(ld_shlibs, $1)=no
X	;;
X    esac
X    ;;
X  solaris*)
X    case $cc_basename in
X      CC)
X	# Sun C++ 4.2, 5.x and Centerline C++
X	_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
X	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
X	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
X	$CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
X
X	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
X	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
X	case $host_os in
X	  solaris2.[0-5] | solaris2.[0-5].*) ;;
X	  *)
X	    # The C++ compiler is used as linker so we must use $wl
X	    # flag to pass the commands to the underlying system
X	    # linker.
X	    # Supported since Solaris 2.6 (maybe 2.5.1?)
X	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
X	    ;;
X	esac
X	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
X
X	# Commands to make compiler produce verbose output that lists
X	# what "hidden" libraries, object files and flags are used when
X	# linking a shared library.
X	#
X	# There doesn't appear to be a way to prevent this compiler from
X	# explicitly linking system object files so we need to strip them
X	# from the output so that they don't get included in the library
X	# dependencies.
X	output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
X
X	# Archives containing C++ object files must be created using
X	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
X	# necessary to make sure instantiated templates are included
X	# in the archive.
X	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
X	;;
X      gcx)
X	# Green Hills C++ Compiler
X	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
X
X	# The C++ compiler must be used to create the archive.
X	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
X	;;
X      *)
X	# GNU C++ compiler with Solaris linker
X	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
X	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
X	  if $CC --version | grep -v '^2\.7' > /dev/null; then
X	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
X	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
X		$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
X
X	    # Commands to make compiler produce verbose output that lists
X	    # what "hidden" libraries, object files and flags are used when
X	    # linking a shared library.
X	    output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
X	  else
X	    # g++ 2.7 appears to require `-G' NOT `-shared' on this
X	    # platform.
X	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
X	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
X		$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
X
X	    # Commands to make compiler produce verbose output that lists
X	    # what "hidden" libraries, object files and flags are used when
X	    # linking a shared library.
X	    output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
X	  fi
X
X	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
X	fi
X	;;
X    esac
X    ;;
X  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
X    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
X    ;;
X  tandem*)
X    case $cc_basename in
X      NCC)
X	# NonStop-UX NCC 3.20
X	# FIXME: insert proper C++ library support
X	_LT_AC_TAGVAR(ld_shlibs, $1)=no
X	;;
X      *)
X	# FIXME: insert proper C++ library support
X	_LT_AC_TAGVAR(ld_shlibs, $1)=no
X	;;
X    esac
X    ;;
X  vxworks*)
X    # FIXME: insert proper C++ library support
X    _LT_AC_TAGVAR(ld_shlibs, $1)=no
X    ;;
X  *)
X    # FIXME: insert proper C++ library support
X    _LT_AC_TAGVAR(ld_shlibs, $1)=no
X    ;;
Xesac
XAC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
Xtest "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
X
X_LT_AC_TAGVAR(GCC, $1)="$GXX"
X_LT_AC_TAGVAR(LD, $1)="$LD"
X
XAC_LIBTOOL_POSTDEP_PREDEP($1)
XAC_LIBTOOL_PROG_COMPILER_PIC($1)
XAC_LIBTOOL_PROG_CC_C_O($1)
XAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
XAC_LIBTOOL_PROG_LD_SHLIBS($1)
XAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
XAC_LIBTOOL_SYS_LIB_STRIP
XAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
XAC_LIBTOOL_DLOPEN_SELF($1)
X
XAC_LIBTOOL_CONFIG($1)
X
XAC_LANG_POP
XCC=$lt_save_CC
XLDCXX=$LD
XLD=$lt_save_LD
XGCC=$lt_save_GCC
Xwith_gnu_ldcxx=$with_gnu_ld
Xwith_gnu_ld=$lt_save_with_gnu_ld
Xlt_cv_path_LDCXX=$lt_cv_path_LD
Xlt_cv_path_LD=$lt_save_path_LD
Xlt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
Xlt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
X])# AC_LIBTOOL_LANG_CXX_CONFIG
X
X# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
X# ------------------------
X# Figure out "hidden" library dependencies from verbose
X# compiler output when linking a shared library.
X# Parse the compiler output and extract the necessary
X# objects, libraries and library flags.
XAC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
Xdnl we can't use the lt_simple_compile_test_code here,
Xdnl because it contains code intended for an executable,
Xdnl not a library.  It's possible we should let each
Xdnl tag define a new lt_????_link_test_code variable,
Xdnl but it's only used here...
Xifelse([$1],[],[cat > conftest.$ac_ext <<EOF
Xint a;
Xvoid foo (void) { a = 0; }
XEOF
X],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
Xclass Foo
X{
Xpublic:
X  Foo (void) { a = 0; }
Xprivate:
X  int a;
X};
XEOF
X],[$1],[F77],[cat > conftest.$ac_ext <<EOF
X      subroutine foo
X      implicit none
X      integer*4 a
X      a=0
X      return
X      end
XEOF
X],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
Xpublic class foo {
X  private int a;
X  public void bar (void) {
X    a = 0;
X  }
X};
XEOF
X])
Xdnl Parse the compiler output and extract the necessary
Xdnl objects, libraries and library flags.
Xif AC_TRY_EVAL(ac_compile); then
X  # Parse the compiler output and extract the necessary
X  # objects, libraries and library flags.
X
X  # Sentinel used to keep track of whether or not we are before
X  # the conftest object file.
X  pre_test_object_deps_done=no
X
X  # The `*' in the case matches for architectures that use `case' in
X  # $output_verbose_cmd can trigger glob expansion during the loop
X  # eval without this substitution.
X  output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
X
X  for p in `eval $output_verbose_link_cmd`; do
X    case $p in
X
X    -L* | -R* | -l*)
X       # Some compilers place space between "-{L,R}" and the path.
X       # Remove the space.
X       if test $p = "-L" \
X	  || test $p = "-R"; then
X	 prev=$p
X	 continue
X       else
X	 prev=
X       fi
X
X       if test "$pre_test_object_deps_done" = no; then
X	 case $p in
X	 -L* | -R*)
X	   # Internal compiler library paths should come after those
X	   # provided the user.  The postdeps already come after the
X	   # user supplied libs so there is no need to process them.
X	   if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
X	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
X	   else
X	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
X	   fi
X	   ;;
X	 # The "-l" case would never come before the object being
X	 # linked, so don't bother handling this case.
X	 esac
X       else
X	 if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
X	   _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
X	 else
X	   _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
X	 fi
X       fi
X       ;;
X
X    *.$objext)
X       # This assumes that the test object file only shows up
X       # once in the compiler output.
X       if test "$p" = "conftest.$objext"; then
X	 pre_test_object_deps_done=yes
X	 continue
X       fi
X
X       if test "$pre_test_object_deps_done" = no; then
X	 if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
X	   _LT_AC_TAGVAR(predep_objects, $1)="$p"
X	 else
X	   _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
X	 fi
X       else
X	 if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
X	   _LT_AC_TAGVAR(postdep_objects, $1)="$p"
X	 else
X	   _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
X	 fi
X       fi
X       ;;
X
X    *) ;; # Ignore the rest.
X
X    esac
X  done
X
X  # Clean up.
X  rm -f a.out a.exe
Xelse
X  echo "libtool.m4: error: problem compiling $1 test program"
Xfi
X
X$rm -f confest.$objext
X
Xcase " $_LT_AC_TAGVAR(postdeps, $1) " in
X*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
Xesac
X])# AC_LIBTOOL_POSTDEP_PREDEP
X
X# AC_LIBTOOL_LANG_F77_CONFIG
X# ------------------------
X# Ensure that the configuration vars for the C compiler are
X# suitably defined.  Those variables are subsequently used by
X# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
XAC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
XAC_DEFUN([_LT_AC_LANG_F77_CONFIG],
X[AC_REQUIRE([AC_PROG_F77])
XAC_LANG_PUSH(Fortran 77)
X
X_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
X_LT_AC_TAGVAR(allow_undefined_flag, $1)=
X_LT_AC_TAGVAR(always_export_symbols, $1)=no
X_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
X_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
X_LT_AC_TAGVAR(hardcode_direct, $1)=no
X_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
X_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
X_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
X_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
X_LT_AC_TAGVAR(hardcode_automatic, $1)=no
X_LT_AC_TAGVAR(module_cmds, $1)=
X_LT_AC_TAGVAR(module_expsym_cmds, $1)=
X_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
X_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
X_LT_AC_TAGVAR(no_undefined_flag, $1)=
X_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
X_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
X
X# Source file extension for f77 test sources.
Xac_ext=f
X
X# Object file extension for compiled f77 test sources.
Xobjext=o
X_LT_AC_TAGVAR(objext, $1)=$objext
X
X# Code to be used in simple compile tests
Xlt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
X
X# Code to be used in simple link tests
Xlt_simple_link_test_code="      program t\n      end\n"
X
X# ltmain only uses $CC for tagged configurations so make sure $CC is set.
X_LT_AC_SYS_COMPILER
X
X# Allow CC to be a program name with arguments.
Xlt_save_CC="$CC"
XCC=${F77-"f77"}
Xcompiler=$CC
X_LT_AC_TAGVAR(compiler, $1)=$CC
Xcc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
X
XAC_MSG_CHECKING([if libtool supports shared libraries])
XAC_MSG_RESULT([$can_build_shared])
X
XAC_MSG_CHECKING([whether to build shared libraries])
Xtest "$can_build_shared" = "no" && enable_shared=no
X
X# On AIX, shared libraries and static libraries use the same namespace, and
X# are all built from PIC.
Xcase "$host_os" in
Xaix3*)
X  test "$enable_shared" = yes && enable_static=no
X  if test -n "$RANLIB"; then
X    archive_cmds="$archive_cmds~\$RANLIB \$lib"
X    postinstall_cmds='$RANLIB $lib'
X  fi
X  ;;
Xaix4*)
X  test "$enable_shared" = yes && enable_static=no
X  ;;
Xesac
XAC_MSG_RESULT([$enable_shared])
X
XAC_MSG_CHECKING([whether to build static libraries])
X# Make sure either enable_shared or enable_static is yes.
Xtest "$enable_shared" = yes || enable_static=yes
XAC_MSG_RESULT([$enable_static])
X
Xtest "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
X
X_LT_AC_TAGVAR(GCC, $1)="$G77"
X_LT_AC_TAGVAR(LD, $1)="$LD"
X
XAC_LIBTOOL_PROG_COMPILER_PIC($1)
XAC_LIBTOOL_PROG_CC_C_O($1)
XAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
XAC_LIBTOOL_PROG_LD_SHLIBS($1)
XAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
XAC_LIBTOOL_SYS_LIB_STRIP
XAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
X
XAC_LIBTOOL_CONFIG($1)
X
XAC_LANG_POP
XCC="$lt_save_CC"
X])# AC_LIBTOOL_LANG_F77_CONFIG
X
X
X# AC_LIBTOOL_LANG_GCJ_CONFIG
X# --------------------------
X# Ensure that the configuration vars for the C compiler are
X# suitably defined.  Those variables are subsequently used by
X# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
XAC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
XAC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
X[AC_LANG_SAVE
X
X# Source file extension for Java test sources.
Xac_ext=java
X
X# Object file extension for compiled Java test sources.
Xobjext=o
X_LT_AC_TAGVAR(objext, $1)=$objext
X
X# Code to be used in simple compile tests
Xlt_simple_compile_test_code="class foo {}\n"
X
X# Code to be used in simple link tests
Xlt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
X
X# ltmain only uses $CC for tagged configurations so make sure $CC is set.
X_LT_AC_SYS_COMPILER
X
X# Allow CC to be a program name with arguments.
Xlt_save_CC="$CC"
XCC=${GCJ-"gcj"}
Xcompiler=$CC
X_LT_AC_TAGVAR(compiler, $1)=$CC
X
X# GCJ did not exist at the time GCC didn't implicitly link libc in.
X_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
X
XAC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
XAC_LIBTOOL_PROG_COMPILER_PIC($1)
XAC_LIBTOOL_PROG_CC_C_O($1)
XAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
XAC_LIBTOOL_PROG_LD_SHLIBS($1)
XAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
XAC_LIBTOOL_SYS_LIB_STRIP
XAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
XAC_LIBTOOL_DLOPEN_SELF($1)
X
XAC_LIBTOOL_CONFIG($1)
X
XAC_LANG_RESTORE
XCC="$lt_save_CC"
X])# AC_LIBTOOL_LANG_GCJ_CONFIG
X
X
X# AC_LIBTOOL_LANG_RC_CONFIG
X# --------------------------
X# Ensure that the configuration vars for the Windows resource compiler are
X# suitably defined.  Those variables are subsequently used by
X# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
XAC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
XAC_DEFUN([_LT_AC_LANG_RC_CONFIG],
X[AC_LANG_SAVE
X
X# Source file extension for RC test sources.
Xac_ext=rc
X
X# Object file extension for compiled RC test sources.
Xobjext=o
X_LT_AC_TAGVAR(objext, $1)=$objext
X
X# Code to be used in simple compile tests
Xlt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
X
X# Code to be used in simple link tests
Xlt_simple_link_test_code="$lt_simple_compile_test_code"
X
X# ltmain only uses $CC for tagged configurations so make sure $CC is set.
X_LT_AC_SYS_COMPILER
X
X# Allow CC to be a program name with arguments.
Xlt_save_CC="$CC"
XCC=${RC-"windres"}
Xcompiler=$CC
X_LT_AC_TAGVAR(compiler, $1)=$CC
X_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
X
XAC_LIBTOOL_CONFIG($1)
X
XAC_LANG_RESTORE
XCC="$lt_save_CC"
X])# AC_LIBTOOL_LANG_RC_CONFIG
X
X
X# AC_LIBTOOL_CONFIG([TAGNAME])
X# ----------------------------
X# If TAGNAME is not passed, then create an initial libtool script
X# with a default configuration from the untagged config vars.  Otherwise
X# add code to config.status for appending the configuration named by
X# TAGNAME from the matching tagged config vars.
XAC_DEFUN([AC_LIBTOOL_CONFIG],
X[# The else clause should only fire when bootstrapping the
X# libtool distribution, otherwise you forgot to ship ltmain.sh
X# with your package, and you will get complaints that there are
X# no rules to generate ltmain.sh.
Xif test -f "$ltmain"; then
X  # See if we are running on zsh, and set the options which allow our commands through
X  # without removal of \ escapes.
X  if test -n "${ZSH_VERSION+set}" ; then
X    setopt NO_GLOB_SUBST
X  fi  
X  # Now quote all the things that may contain metacharacters while being
X  # careful not to overquote the AC_SUBSTed values.  We take copies of the
X  # variables and quote the copies for generation of the libtool script.
X  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \
X    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
X    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
X    deplibs_check_method reload_flag reload_cmds need_locks \
X    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
X    lt_cv_sys_global_symbol_to_c_name_address \
X    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
X    old_postinstall_cmds old_postuninstall_cmds \
X    _LT_AC_TAGVAR(compiler, $1) \
X    _LT_AC_TAGVAR(CC, $1) \
X    _LT_AC_TAGVAR(LD, $1) \
X    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
X    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
X    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
X    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
X    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
X    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
X    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
X    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
X    _LT_AC_TAGVAR(old_archive_cmds, $1) \
X    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
X    _LT_AC_TAGVAR(predep_objects, $1) \
X    _LT_AC_TAGVAR(postdep_objects, $1) \
X    _LT_AC_TAGVAR(predeps, $1) \
X    _LT_AC_TAGVAR(postdeps, $1) \
X    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
X    _LT_AC_TAGVAR(archive_cmds, $1) \
X    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
X    _LT_AC_TAGVAR(postinstall_cmds, $1) \
X    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
X    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
X    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
X    _LT_AC_TAGVAR(no_undefined_flag, $1) \
X    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
X    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
X    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
X    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
X    _LT_AC_TAGVAR(hardcode_automatic, $1) \
X    _LT_AC_TAGVAR(module_cmds, $1) \
X    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
X    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
X    _LT_AC_TAGVAR(exclude_expsyms, $1) \
X    _LT_AC_TAGVAR(include_expsyms, $1); do
X
X    case $var in
X    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
X    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
X    _LT_AC_TAGVAR(archive_cmds, $1) | \
X    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
X    _LT_AC_TAGVAR(module_cmds, $1) | \
X    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \   
X    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
X    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
X    extract_expsyms_cmds | reload_cmds | finish_cmds | \
X    postinstall_cmds | postuninstall_cmds | \
X    old_postinstall_cmds | old_postuninstall_cmds | \
X    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
X      # Double-quote double-evaled strings.
X      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
X      ;;
X    *)
X      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
X      ;;
X    esac
X  done
X
X  case $lt_echo in
X  *'\[$]0 --fallback-echo"')
X    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
X    ;;
X  esac
X
Xifelse([$1], [],
X  [cfgfile="${ofile}T"
X  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
X  $rm -f "$cfgfile"
X  AC_MSG_NOTICE([creating $ofile])],
X  [cfgfile="$ofile"])
X
X  cat <<__EOF__ >> "$cfgfile"
Xifelse([$1], [],
X[#! $SHELL
X
X# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
X# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
X# NOTE: Changes made to this file will be lost: look at ltmain.sh.
X#
X# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
X# Free Software Foundation, Inc.
X#
X# This file is part of GNU Libtool:
X# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
X#
X# This program is free software; you can redistribute it and/or modify
X# it under the terms of the GNU General Public License as published by
X# the Free Software Foundation; either version 2 of the License, or
X# (at your option) any later version.
X#
X# This program is distributed in the hope that it will be useful, but
X# WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
X# General Public License for more details.
X#
X# You should have received a copy of the GNU General Public License
X# along with this program; if not, write to the Free Software
X# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
X#
X# As a special exception to the GNU General Public License, if you
X# distribute this file as part of a program that contains a
X# configuration script generated by Autoconf, you may include it under
X# the same distribution terms that you use for the rest of that program.
X
X# A sed program that does not truncate output.
XSED=$lt_SED
X
X# Sed that helps us avoid accidentally triggering echo(1) options like -n.
XXsed="$SED -e s/^X//"
X
X# The HP-UX ksh and POSIX shell print the target directory to stdout
X# if CDPATH is set.
Xif test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
X
X# The names of the tagged configurations supported by this script.
Xavailable_tags=
X
X# ### BEGIN LIBTOOL CONFIG],
X[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
X
X# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
X
X# Shell to use when invoking shell scripts.
XSHELL=$lt_SHELL
X
X# Whether or not to build shared libraries.
Xbuild_libtool_libs=$enable_shared
X
X# Whether or not to build static libraries.
Xbuild_old_libs=$enable_static
X
X# Whether or not to add -lc for building shared libraries.
Xbuild_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
X
X# Whether or not to disallow shared libs when runtime libs are static
Xallow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
X
X# Whether or not to optimize for fast installation.
Xfast_install=$enable_fast_install
X
X# The host system.
Xhost_alias=$host_alias
Xhost=$host
X
X# An echo program that does not interpret backslashes.
Xecho=$lt_echo
X
X# The archiver.
XAR=$lt_AR
XAR_FLAGS=$lt_AR_FLAGS
X
X# A C compiler.
XLTCC=$lt_LTCC
X
X# A language-specific compiler.
XCC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
X
X# Is the compiler the GNU C compiler?
Xwith_gcc=$_LT_AC_TAGVAR(GCC, $1)
X
X# An ERE matcher.
XEGREP=$lt_EGREP
X
X# The linker used to build libraries.
XLD=$lt_[]_LT_AC_TAGVAR(LD, $1)
X
X# Whether we need hard or soft links.
XLN_S=$lt_LN_S
X
X# A BSD-compatible nm program.
XNM=$lt_NM
X
X# A symbol stripping program
XSTRIP=$STRIP
X
X# Used to examine libraries when file_magic_cmd begins "file"
XMAGIC_CMD=$MAGIC_CMD
X
X# Used on cygwin: DLL creation program.
XDLLTOOL="$DLLTOOL"
X
X# Used on cygwin: object dumper.
XOBJDUMP="$OBJDUMP"
X
X# Used on cygwin: assembler.
XAS="$AS"
X
X# The name of the directory that contains temporary libtool files.
Xobjdir=$objdir
X
X# How to create reloadable object files.
Xreload_flag=$lt_reload_flag
Xreload_cmds=$lt_reload_cmds
X
X# How to pass a linker flag through the compiler.
Xwl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
X
X# Object file suffix (normally "o").
Xobjext="$ac_objext"
X
X# Old archive suffix (normally "a").
Xlibext="$libext"
X
X# Shared library suffix (normally ".so").
Xshrext='$shrext'
X
X# Executable file suffix (normally "").
Xexeext="$exeext"
X
X# Additional compiler flags for building library objects.
Xpic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
Xpic_mode=$pic_mode
X
X# What is the maximum length of a command?
Xmax_cmd_len=$lt_cv_sys_max_cmd_len
X
X# Does compiler simultaneously support -c and -o options?
Xcompiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
X
X# Must we lock files when doing compilation ?
Xneed_locks=$lt_need_locks
X
X# Do we need the lib prefix for modules?
Xneed_lib_prefix=$need_lib_prefix
X
X# Do we need a version for libraries?
Xneed_version=$need_version
X
X# Whether dlopen is supported.
Xdlopen_support=$enable_dlopen
X
X# Whether dlopen of programs is supported.
Xdlopen_self=$enable_dlopen_self
X
X# Whether dlopen of statically linked programs is supported.
Xdlopen_self_static=$enable_dlopen_self_static
X
X# Compiler flag to prevent dynamic linking.
Xlink_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
X
X# Compiler flag to turn off builtin functions.
Xno_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
X
X# Compiler flag to allow reflexive dlopens.
Xexport_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
X
X# Compiler flag to generate shared objects directly from archives.
Xwhole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
X
X# Compiler flag to generate thread-safe objects.
Xthread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
X
X# Library versioning type.
Xversion_type=$version_type
X
X# Format of library name prefix.
Xlibname_spec=$lt_libname_spec
X
X# List of archive names.  First name is the real one, the rest are links.
X# The last name is the one that the linker finds with -lNAME.
Xlibrary_names_spec=$lt_library_names_spec
X
X# The coded name of the library, if different from the real name.
Xsoname_spec=$lt_soname_spec
X
X# Commands used to build and install an old-style archive.
XRANLIB=$lt_RANLIB
Xold_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
Xold_postinstall_cmds=$lt_old_postinstall_cmds
Xold_postuninstall_cmds=$lt_old_postuninstall_cmds
X
X# Create an old-style archive from a shared archive.
Xold_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
X
X# Create a temporary old-style archive to link instead of a shared archive.
Xold_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
X
X# Commands used to build and install a shared archive.
Xarchive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
Xarchive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
Xpostinstall_cmds=$lt_postinstall_cmds
Xpostuninstall_cmds=$lt_postuninstall_cmds
X
X# Commands used to build a loadable module (assumed same as above if empty)
Xmodule_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
Xmodule_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
X
X# Commands to strip libraries.
Xold_striplib=$lt_old_striplib
Xstriplib=$lt_striplib
X
X# Dependencies to place before the objects being linked to create a
X# shared library.
Xpredep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
X
X# Dependencies to place after the objects being linked to create a
X# shared library.
Xpostdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
X
X# Dependencies to place before the objects being linked to create a
X# shared library.
Xpredeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
X
X# Dependencies to place after the objects being linked to create a
X# shared library.
Xpostdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
X
X# The library search path used internally by the compiler when linking
X# a shared library.
Xcompiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
X
X# Method to check whether dependent libraries are shared objects.
Xdeplibs_check_method=$lt_deplibs_check_method
X
X# Command to use when deplibs_check_method == file_magic.
Xfile_magic_cmd=$lt_file_magic_cmd
X
X# Flag that allows shared libraries with undefined symbols to be built.
Xallow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
X
X# Flag that forces no undefined symbols.
Xno_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
X
X# Commands used to finish a libtool library installation in a directory.
Xfinish_cmds=$lt_finish_cmds
X
X# Same as above, but a single script fragment to be evaled but not shown.
Xfinish_eval=$lt_finish_eval
X
X# Take the output of nm and produce a listing of raw symbols and C names.
Xglobal_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
X
X# Transform the output of nm in a proper C declaration
Xglobal_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
X
X# Transform the output of nm in a C name address pair
Xglobal_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
X
X# This is the shared library runtime path variable.
Xrunpath_var=$runpath_var
X
X# This is the shared library path variable.
Xshlibpath_var=$shlibpath_var
X
X# Is shlibpath searched before the hard-coded library search path?
Xshlibpath_overrides_runpath=$shlibpath_overrides_runpath
X
X# How to hardcode a shared library path into an executable.
Xhardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
X
X# Whether we should hardcode library paths into libraries.
Xhardcode_into_libs=$hardcode_into_libs
X
X# Flag to hardcode \$libdir into a binary during linking.
X# This must work even if \$libdir does not exist.
Xhardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
X
X# If ld is used when linking, flag to hardcode \$libdir into
X# a binary during linking. This must work even if \$libdir does
X# not exist.
Xhardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
X
X# Whether we need a single -rpath flag with a separated argument.
Xhardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
X
X# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
X# resulting binary.
Xhardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
X
X# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
X# resulting binary.
Xhardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
X
X# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
X# the resulting binary.
Xhardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
X
X# Set to yes if building a shared library automatically hardcodes DIR into the library
X# and all subsequent libraries and executables linked against it.
Xhardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
X
X# Variables whose values should be saved in libtool wrapper scripts and
X# restored at relink time.
Xvariables_saved_for_relink="$variables_saved_for_relink"
X
X# Whether libtool must link a program against all its dependency libraries.
Xlink_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
X
X# Compile-time system search path for libraries
Xsys_lib_search_path_spec=$lt_sys_lib_search_path_spec
X
X# Run-time system search path for libraries
Xsys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
X
X# Fix the shell variable \$srcfile for the compiler.
Xfix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
X
X# Set to yes if exported symbols are required.
Xalways_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
X
X# The commands to list exported symbols.
Xexport_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
X
X# The commands to extract the exported symbol list from a shared archive.
Xextract_expsyms_cmds=$lt_extract_expsyms_cmds
X
X# Symbols that should not be listed in the preloaded symbols.
Xexclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
X
X# Symbols that must always be exported.
Xinclude_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
X
Xifelse([$1],[],
X[# ### END LIBTOOL CONFIG],
X[# ### END LIBTOOL TAG CONFIG: $tagname])
X
X__EOF__
X
Xifelse([$1],[], [
X  case $host_os in
X  aix3*)
X    cat <<\EOF >> "$cfgfile"
X
X# AIX sometimes has problems with the GCC collect2 program.  For some
X# reason, if we set the COLLECT_NAMES environment variable, the problems
X# vanish in a puff of smoke.
Xif test "X${COLLECT_NAMES+set}" != Xset; then
X  COLLECT_NAMES=
X  export COLLECT_NAMES
Xfi
XEOF
X    ;;
X  esac
X
X  # We use sed instead of cat because bash on DJGPP gets confused if
X  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
X  # text mode, it properly converts lines to CR/LF.  This bash problem
X  # is reportedly fixed, but why not run on old versions too?
X  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
X
X  mv -f "$cfgfile" "$ofile" || \
X    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
X  chmod +x "$ofile"
X])
Xelse
X  # If there is no Makefile yet, we rely on a make rule to execute
X  # `config.status --recheck' to rerun these tests and create the
X  # libtool script then.
X  test -f Makefile && make "$ltmain"
Xfi
X])# AC_LIBTOOL_CONFIG
X
X
X# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
X# -------------------------------------------
XAC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
X[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
X
X_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
X
Xif test "$GCC" = yes; then
X  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
X
X  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
X    lt_cv_prog_compiler_rtti_exceptions,
X    [-fno-rtti -fno-exceptions], [],
X    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
Xfi
X])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
X
X
X# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
X# ---------------------------------
XAC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
X[AC_REQUIRE([AC_CANONICAL_HOST])
XAC_REQUIRE([AC_PROG_NM])
XAC_REQUIRE([AC_OBJEXT])
X# Check for command to grab the raw symbol name followed by C symbol from nm.
XAC_MSG_CHECKING([command to parse $NM output from $compiler object])
XAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
X[
X# These are sane defaults that work on at least a few old systems.
X# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
X
X# Character class describing NM global symbol codes.
Xsymcode='[[BCDEGRST]]'
X
X# Regexp to match symbols that can be accessed directly from C.
Xsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
X
X# Transform the above into a raw symbol and a C symbol.
Xsymxfrm='\1 \2\3 \3'
X
X# Transform an extracted symbol line into a proper C declaration
Xlt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
X
X# Transform an extracted symbol line into symbol name and symbol address
Xlt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
X
X# Define system-specific variables.
Xcase $host_os in
Xaix*)
X  symcode='[[BCDT]]'
X  ;;
Xcygwin* | mingw* | pw32*)
X  symcode='[[ABCDGISTW]]'
X  ;;
Xhpux*) # Its linker distinguishes data from code symbols
X  if test "$host_cpu" = ia64; then
X    symcode='[[ABCDEGRST]]'
X  fi
X  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
X  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
X  ;;
Xirix* | nonstopux*)
X  symcode='[[BCDEGRST]]'
X  ;;
Xosf*)
X  symcode='[[BCDEGQRST]]'
X  ;;
Xsolaris* | sysv5*)
X  symcode='[[BDRT]]'
X  ;;
Xsysv4)
X  symcode='[[DFNSTU]]'
X  ;;
Xesac
X
X# Handle CRLF in mingw tool chain
Xopt_cr=
Xcase $build_os in
Xmingw*)
X  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
X  ;;
Xesac
X
X# If we're using GNU nm, then use its standard symbol codes.
Xcase `$NM -V 2>&1` in
X*GNU* | *'with BFD'*)
X  symcode='[[ABCDGIRSTW]]' ;;
Xesac
X
X# Try without a prefix undercore, then with it.
Xfor ac_symprfx in "" "_"; do
X
X  # Write the raw and C identifiers.
X  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
X
X  # Check to see that the pipe works correctly.
X  pipe_works=no
X
X  rm -f conftest*
X  cat > conftest.$ac_ext <<EOF
X#ifdef __cplusplus
Xextern "C" {
X#endif
Xchar nm_test_var;
Xvoid nm_test_func(){}
X#ifdef __cplusplus
X}
X#endif
Xint main(){nm_test_var='a';nm_test_func();return(0);}
XEOF
X
X  if AC_TRY_EVAL(ac_compile); then
X    # Now try to grab the symbols.
X    nlist=conftest.nm
X    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
X      # Try sorting and uniquifying the output.
X      if sort "$nlist" | uniq > "$nlist"T; then
X	mv -f "$nlist"T "$nlist"
X      else
X	rm -f "$nlist"T
X      fi
X
X      # Make sure that we snagged all the symbols we need.
X      if grep ' nm_test_var$' "$nlist" >/dev/null; then
X	if grep ' nm_test_func$' "$nlist" >/dev/null; then
X	  cat <<EOF > conftest.$ac_ext
X#ifdef __cplusplus
Xextern "C" {
X#endif
X
XEOF
X	  # Now generate the symbol file.
X	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
X
X	  cat <<EOF >> conftest.$ac_ext
X#if defined (__STDC__) && __STDC__
X# define lt_ptr_t void *
X#else
X# define lt_ptr_t char *
X# define const
X#endif
X
X/* The mapping between symbol names and symbols. */
Xconst struct {
X  const char *name;
X  lt_ptr_t address;
X}
Xlt_preloaded_symbols[[]] =
X{
XEOF
X	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
X	  cat <<\EOF >> conftest.$ac_ext
X  {0, (lt_ptr_t) 0}
X};
X
X#ifdef __cplusplus
X}
X#endif
XEOF
X	  # Now try linking the two files.
X	  mv conftest.$ac_objext conftstm.$ac_objext
X	  lt_save_LIBS="$LIBS"
X	  lt_save_CFLAGS="$CFLAGS"
X	  LIBS="conftstm.$ac_objext"
X	  CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
X	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
X	    pipe_works=yes
X	  fi
X	  LIBS="$lt_save_LIBS"
X	  CFLAGS="$lt_save_CFLAGS"
X	else
X	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
X	fi
X      else
X	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
X      fi
X    else
X      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
X    fi
X  else
X    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
X    cat conftest.$ac_ext >&5
X  fi
X  rm -f conftest* conftst*
X
X  # Do not use the global_symbol_pipe unless it works.
X  if test "$pipe_works" = yes; then
X    break
X  else
X    lt_cv_sys_global_symbol_pipe=
X  fi
Xdone
X])
Xif test -z "$lt_cv_sys_global_symbol_pipe"; then
X  lt_cv_sys_global_symbol_to_cdecl=
Xfi
Xif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
X  AC_MSG_RESULT(failed)
Xelse
X  AC_MSG_RESULT(ok)
Xfi
X]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
X
X
X# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
X# ---------------------------------------
XAC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
X[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
X_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
X_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
X
XAC_MSG_CHECKING([for $compiler option to produce PIC])
X ifelse([$1],[CXX],[
X  # C++ specific cases for pic, static, wl, etc.
X  if test "$GXX" = yes; then
X    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
X    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
X
X    case $host_os in
X    aix*)
X      # All AIX code is PIC.
X      if test "$host_cpu" = ia64; then
X	# AIX 5 now supports IA64 processor
X	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
X      fi
X      ;;
X    amigaos*)
X      # FIXME: we need at least 68020 code to build shared libraries, but
X      # adding the `-m68020' flag to GCC prevents building anything better,
X      # like `-m68040'.
X      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
X      ;;
X    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
X      # PIC is the default for these OSes.
X      ;;
X    mingw* | os2* | pw32*)
X      # This hack is so that the source file can tell whether it is being
X      # built for inclusion in a dll (and should export symbols for example).
X      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
X      ;;
X    darwin* | rhapsody*)
X      # PIC is the default on this platform
X      # Common symbols not allowed in MH_DYLIB files
X      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
X      ;;
X    *djgpp*)
X      # DJGPP does not support shared libraries at all
X      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
X      ;;
X    sysv4*MP*)
X      if test -d /usr/nec; then
X	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
X      fi
X      ;;
X    hpux*)
X      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
X      # not for PA HP-UX.
X      case "$host_cpu" in
X      hppa*64*|ia64*)
X	;;
X      *)
X	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
X	;;
X      esac
X      ;;
X    *)
X      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
X      ;;
X    esac
X  else
X    case $host_os in
X      aix4* | aix5*)
X	# All AIX code is PIC.
X	if test "$host_cpu" = ia64; then
X	  # AIX 5 now supports IA64 processor
X	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
X	else
X	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
X	fi
X	;;
X      chorus*)
X	case $cc_basename in
X	cxch68)
X	  # Green Hills C++ Compiler
X	  # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
X	  ;;
X	esac
X	;;
X      dgux*)
X	case $cc_basename in
X	  ec++)
X	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
X	    ;;
X	  ghcx)
X	    # Green Hills C++ Compiler
X	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
X	    ;;
X	  *)
X	    ;;
X	esac
X	;;
X      freebsd*)
X	# FreeBSD uses GNU C++
X	;;
X      hpux9* | hpux10* | hpux11*)
X	case $cc_basename in
X	  CC)
X	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
X	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
X	    if test "$host_cpu" != ia64; then
X	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
X	    fi
X	    ;;
X	  aCC)
X	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
X	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
X	    case "$host_cpu" in
X	    hppa*64*|ia64*)
X	      # +Z the default
X	      ;;
X	    *)
X	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
X	      ;;
X	    esac
X	    ;;
X	  *)
X	    ;;
X	esac
X	;;
X      irix5* | irix6* | nonstopux*)
X	case $cc_basename in
X	  CC)
X	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
X	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
X	    # CC pic flag -KPIC is the default.
X	    ;;
X	  *)
X	    ;;
X	esac
X	;;
X      linux*)
X	case $cc_basename in
X	  KCC)
X	    # KAI C++ Compiler
X	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
X	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
X	    ;;
X	  icpc)
X	    # Intel C++
X	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
X	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
X	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
X	    ;; 
X	  cxx)
X	    # Compaq C++
X	    # Make sure the PIC flag is empty.  It appears that all Alpha
X	    # Linux and Compaq Tru64 Unix objects are PIC.
X	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
X	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
X	    ;;
X	  *)
X	    ;;
X	esac
X	;;
X      lynxos*)
X	;;
X      m88k*)
X	;;
X      mvs*)
X	case $cc_basename in
X	  cxx)
X	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
X	    ;;
X	  *)
X	    ;;
X	esac
X	;;
X      netbsd*)
X	;;
X      osf3* | osf4* | osf5*)
X	case $cc_basename in
X	  KCC)
X	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
X	    ;;
X	  RCC)
X	    # Rational C++ 2.4.1
X	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
X	    ;;
X	  cxx)
X	    # Digital/Compaq C++
X	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
X	    # Make sure the PIC flag is empty.  It appears that all Alpha
X	    # Linux and Compaq Tru64 Unix objects are PIC.
X	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
X	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
X	    ;;
X	  *)
X	    ;;
X	esac
X	;;
X      psos*)
X	;;
X      sco*)
X	case $cc_basename in
X	  CC)
X	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
X	    ;;
X	  *)
X	    ;;
X	esac
X	;;
X      solaris*)
X	case $cc_basename in
X	  CC)
X	    # Sun C++ 4.2, 5.x and Centerline C++
X	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
X	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
X	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
X	    ;;
X	  gcx)
X	    # Green Hills C++ Compiler
X	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
X	    ;;
X	  *)
X	    ;;
X	esac
X	;;
X      sunos4*)
X	case $cc_basename in
X	  CC)
X	    # Sun C++ 4.x
X	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
X	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
X	    ;;
X	  lcc)
X	    # Lucid
X	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
X	    ;;
X	  *)
X	    ;;
X	esac
X	;;
X      tandem*)
X	case $cc_basename in
X	  NCC)
X	    # NonStop-UX NCC 3.20
X	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
X	    ;;
X	  *)
X	    ;;
X	esac
X	;;
X      unixware*)
X	;;
X      vxworks*)
X	;;
X      *)
X	_LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
X	;;
X    esac
X  fi
X],
X[
X  if test "$GCC" = yes; then
X    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
X    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
X
X    case $host_os in
X      aix*)
X      # All AIX code is PIC.
X      if test "$host_cpu" = ia64; then
X	# AIX 5 now supports IA64 processor
X	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
X      fi
X      ;;
X
X    amigaos*)
X      # FIXME: we need at least 68020 code to build shared libraries, but
X      # adding the `-m68020' flag to GCC prevents building anything better,
X      # like `-m68040'.
X      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
X      ;;
X
X    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
X      # PIC is the default for these OSes.
X      ;;
X
X    mingw* | pw32* | os2*)
X      # This hack is so that the source file can tell whether it is being
X      # built for inclusion in a dll (and should export symbols for example).
X      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
X      ;;
X
X    darwin* | rhapsody*)
X      # PIC is the default on this platform
X      # Common symbols not allowed in MH_DYLIB files
X      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
X      ;;
X
X    msdosdjgpp*)
X      # Just because we use GCC doesn't mean we suddenly get shared libraries
X      # on systems that don't support them.
X      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
X      enable_shared=no
X      ;;
X
X    sysv4*MP*)
X      if test -d /usr/nec; then
X	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
X      fi
X      ;;
X
X    hpux*)
X      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
X      # not for PA HP-UX.
X      case "$host_cpu" in
X      hppa*64*|ia64*)
X	# +Z the default
X	;;
X      *)
X	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
X	;;
X      esac
X      ;;
X
X    *)
X      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
X      ;;
X    esac
X  else
X    # PORTME Check for flag to pass linker flags through the system compiler.
X    case $host_os in
X    aix*)
X      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
X      if test "$host_cpu" = ia64; then
X	# AIX 5 now supports IA64 processor
X	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
X      else
X	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
X      fi
X      ;;
X
X    mingw* | pw32* | os2*)
X      # This hack is so that the source file can tell whether it is being
X      # built for inclusion in a dll (and should export symbols for example).
X      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
X      ;;
X
X    hpux9* | hpux10* | hpux11*)
X      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
X      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
X      # not for PA HP-UX.
X      case "$host_cpu" in
X      hppa*64*|ia64*)
X	# +Z the default
X	;;
X      *)
X	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
X	;;
X      esac
X      # Is there a better lt_prog_compiler_static that works with the bundled CC?
X      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
X      ;;
X
X    irix5* | irix6* | nonstopux*)
X      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
X      # PIC (with -KPIC) is the default.
X      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
X      ;;
X
X    newsos6)
X      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
X      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
X      ;;
X
X    linux*)
X      case $CC in
X      icc|ecc)
X	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
X	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
X	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
X        ;;
X      ccc)
X        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
X        # All Alpha code is PIC.
X        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
X        ;;
X      esac
X      ;;
X
X    osf3* | osf4* | osf5*)
X      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
X      # All OSF/1 code is PIC.
X      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
X      ;;
X
X    sco3.2v5*)
X      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
X      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
X      ;;
X
X    solaris*)
X      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
X      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
X      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
X      ;;
X
X    sunos4*)
X      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
X      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
X      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
X      ;;
X
X    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
X      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
X      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
X      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
X      ;;
X
X    sysv4*MP*)
X      if test -d /usr/nec ;then
X	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
X	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
X      fi
X      ;;
X
X    uts4*)
X      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
X      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
X      ;;
X
X    *)
X      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
X      ;;
X    esac
X  fi
X])
XAC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
X
X#
X# Check to make sure the PIC flag actually works.
X#
Xif test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
X  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
X    _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
X    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
X    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
X     "" | " "*) ;;
X     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
X     esac],
X    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
X     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
Xfi
Xcase "$host_os" in
X  # For platforms which do not support PIC, -DPIC is meaningless:
X  *djgpp*)
X    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
X    ;;
X  *)
X    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
X    ;;
Xesac
X])
X
X
X# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
X# ------------------------------------
X# See if the linker supports building shared libraries.
XAC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
X[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
Xifelse([$1],[CXX],[
X  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
X  case $host_os in
X  aix4* | aix5*)
X    # If we're using GNU nm, then we don't want the "-C" option.
X    # -C means demangle to AIX nm, but means don't demangle with GNU nm
X    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
X      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
X    else
X      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
X    fi
X    ;;
X  pw32*)
X    _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
X  ;;
X  cygwin* | mingw*)
X    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
X  ;;
X  *)
X    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
X  ;;
X  esac
X],[
X  runpath_var=
X  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
X  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
X  _LT_AC_TAGVAR(archive_cmds, $1)=
X  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
X  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
X  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
X  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
X  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
X  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
X  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
X  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
X  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
X  _LT_AC_TAGVAR(hardcode_direct, $1)=no
X  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
X  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
X  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
X  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
X  _LT_AC_TAGVAR(module_cmds, $1)=
X  _LT_AC_TAGVAR(module_expsym_cmds, $1)=  
X  _LT_AC_TAGVAR(always_export_symbols, $1)=no
X  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
X  # include_expsyms should be a list of space-separated symbols to be *always*
X  # included in the symbol list
X  _LT_AC_TAGVAR(include_expsyms, $1)=
X  # exclude_expsyms can be an extended regexp of symbols to exclude
X  # it will be wrapped by ` (' and `)$', so one must not match beginning or
X  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
X  # as well as any symbol that contains `d'.
X  _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
X  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
X  # platforms (ab)use it in PIC code, but their linkers get confused if
X  # the symbol is explicitly referenced.  Since portable code cannot
X  # rely on this symbol name, it's probably fine to never include it in
X  # preloaded symbol tables.
X  extract_expsyms_cmds=
X
X  case $host_os in
X  cygwin* | mingw* | pw32*)
X    # FIXME: the MSVC++ port hasn't been tested in a loooong time
X    # When not using gcc, we currently assume that we are using
X    # Microsoft Visual C++.
X    if test "$GCC" != yes; then
X      with_gnu_ld=no
X    fi
X    ;;
X  openbsd*)
X    with_gnu_ld=no
X    ;;
X  esac
X
X  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
X  if test "$with_gnu_ld" = yes; then
X    # If archive_cmds runs LD, not CC, wlarc should be empty
X    wlarc='${wl}'
X
X    # See if GNU ld supports shared libraries.
X    case $host_os in
X    aix3* | aix4* | aix5*)
X      # On AIX/PPC, the GNU linker is very broken
X      if test "$host_cpu" != ia64; then
X	_LT_AC_TAGVAR(ld_shlibs, $1)=no
X	cat <<EOF 1>&2
X
X*** Warning: the GNU linker, at least up to release 2.9.1, is reported
X*** to be unable to reliably create shared libraries on AIX.
X*** Therefore, libtool is disabling shared libraries support.  If you
X*** really care for shared libraries, you may want to modify your PATH
X*** so that a non-GNU linker is found, and then restart.
X
XEOF
X      fi
X      ;;
X
X    amigaos*)
X      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
X      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
X      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
X
X      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
X      # that the semantics of dynamic libraries on AmigaOS, at least up
X      # to version 4, is to share data among multiple programs linked
X      # with the same dynamic library.  Since this doesn't match the
X      # behavior of shared libraries on other platforms, we can't use
X      # them.
X      _LT_AC_TAGVAR(ld_shlibs, $1)=no
X      ;;
X
X    beos*)
X      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
X	_LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
X	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
X	# support --undefined.  This deserves some investigation.  FIXME
X	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
X      else
X	_LT_AC_TAGVAR(ld_shlibs, $1)=no
X      fi
X      ;;
X
X    cygwin* | mingw* | pw32*)
X      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
X      # as there is no search path for DLLs.
X      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
X      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
X      _LT_AC_TAGVAR(always_export_symbols, $1)=no
X      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
X      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
X
X      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
X        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
X	# If the export-symbols file already is a .def file (1st line
X	# is EXPORTS), use it as is; otherwise, prepend...
X	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
X	  cp $export_symbols $output_objdir/$soname.def;
X	else
X	  echo EXPORTS > $output_objdir/$soname.def;
X	  cat $export_symbols >> $output_objdir/$soname.def;
X	fi~
X	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
X      else
X	ld_shlibs=no
X      fi
X      ;;
X
X    netbsd*)
X      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
X	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
X	wlarc=
X      else
X	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
X	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
X      fi
X      ;;
X
X    solaris* | sysv5*)
X      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
X	_LT_AC_TAGVAR(ld_shlibs, $1)=no
X	cat <<EOF 1>&2
X
X*** Warning: The releases 2.8.* of the GNU linker cannot reliably
X*** create shared libraries on Solaris systems.  Therefore, libtool
X*** is disabling shared libraries support.  We urge you to upgrade GNU
X*** binutils to release 2.9.1 or newer.  Another option is to modify
X*** your PATH or compiler configuration so that the native linker is
X*** used, and then restart.
X
XEOF
X      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
X	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
X	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
X      else
X	_LT_AC_TAGVAR(ld_shlibs, $1)=no
X      fi
X      ;;
X
X    sunos4*)
X      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
X      wlarc=
X      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
X      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
X      ;;
X
X  linux*)
X    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
X        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
X	_LT_AC_TAGVAR(archive_cmds, $1)="$tmp_archive_cmds"
X      supports_anon_versioning=no
X      case `$LD -v 2>/dev/null` in
X        *\ [01].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
X        *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
X        *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
X        *\ 2.11.*) ;; # other 2.11 versions
X        *) supports_anon_versioning=yes ;;
X      esac
X      if test $supports_anon_versioning = yes; then
X        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
Xcat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
X$echo "local: *; };" >> $output_objdir/$libname.ver~
X        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
X      else
X        _LT_AC_TAGVAR(archive_expsym_cmds, $1)="$tmp_archive_cmds"
X      fi
X    else
X      _LT_AC_TAGVAR(ld_shlibs, $1)=no
X    fi
X    ;;
X
X    *)
X      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
X	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
X	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
X      else
X	_LT_AC_TAGVAR(ld_shlibs, $1)=no
X      fi
X      ;;
X    esac
X
X    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then
X      runpath_var=LD_RUN_PATH
X      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
X      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
X      # ancient GNU ld didn't support --whole-archive et. al.
X      if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
X 	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
X      else
X  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
X      fi
X    fi
X  else
X    # PORTME fill in a description of your system's linker (not GNU ld)
X    case $host_os in
X    aix3*)
X      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
X      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
X      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
X      # Note: this linker hardcodes the directories in LIBPATH if there
X      # are no directories specified by -L.
X      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
X      if test "$GCC" = yes && test -z "$link_static_flag"; then
X	# Neither direct hardcoding nor static linking is supported with a
X	# broken collect2.
X	_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
X      fi
X      ;;
X
X    aix4* | aix5*)
X      if test "$host_cpu" = ia64; then
X	# On IA64, the linker does run time linking by default, so we don't
X	# have to do anything special.
X	aix_use_runtimelinking=no
X	exp_sym_flag='-Bexport'
X	no_entry_flag=""
X      else
X	# If we're using GNU nm, then we don't want the "-C" option.
X	# -C means demangle to AIX nm, but means don't demangle with GNU nm
X	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
X	  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
X	else
X	  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
X	fi
X	aix_use_runtimelinking=no
X
X	# Test if we are trying to use run time linking or normal
X	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
X	# need to do runtime linking.
X	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
X	  for ld_flag in $LDFLAGS; do
X  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
X  	    aix_use_runtimelinking=yes
X  	    break
X  	  fi
X	  done
X	esac
X
X	exp_sym_flag='-bexport'
X	no_entry_flag='-bnoentry'
X      fi
X
X      # When large executables or shared objects are built, AIX ld can
X      # have problems creating the table of contents.  If linking a library
X      # or program results in "error TOC overflow" add -mminimal-toc to
X      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
X      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
X
X      _LT_AC_TAGVAR(archive_cmds, $1)=''
X      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
X      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
X      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
X
X      if test "$GCC" = yes; then
X	case $host_os in aix4.[012]|aix4.[012].*)
X	# We only want to do this on AIX 4.2 and lower, the check
X	# below for broken collect2 doesn't work under 4.3+
X	  collect2name=`${CC} -print-prog-name=collect2`
X	  if test -f "$collect2name" && \
X  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
X	  then
X  	  # We have reworked collect2
X  	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
X	  else
X  	  # We have old collect2
X  	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
X  	  # It fails to find uninstalled libraries when the uninstalled
X  	  # path is not listed in the libpath.  Setting hardcode_minus_L
X  	  # to unsupported forces relinking
X  	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
X  	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
X  	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
X	  fi
X	esac
X	shared_flag='-shared'
X      else
X	# not using gcc
X	if test "$host_cpu" = ia64; then
X  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
X  	# chokes on -Wl,-G. The following line is correct:
X	  shared_flag='-G'
X	else
X  	if test "$aix_use_runtimelinking" = yes; then
X	    shared_flag='${wl}-G'
X	  else
X	    shared_flag='${wl}-bM:SRE'
X  	fi
X	fi
X      fi
X
X      # It seems that -bexpall does not export symbols beginning with
X      # underscore (_), so it is better to generate a list of symbols to export.
X      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
X      if test "$aix_use_runtimelinking" = yes; then
X	# Warning - without using the other runtime loading flags (-brtl),
X	# -berok will link without error, but may produce a broken library.
X	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
X       # Determine the default libpath from the value encoded in an empty executable.
X       _LT_AC_SYS_LIBPATH_AIX
X       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
X	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
X       else
X	if test "$host_cpu" = ia64; then
X	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
X	  _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
X	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
X	else
X	 # Determine the default libpath from the value encoded in an empty executable.
X	 _LT_AC_SYS_LIBPATH_AIX
X	 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
X	  # Warning - without using the other run time loading flags,
X	  # -berok will link without error, but may produce a broken library.
X	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
X	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
X	  # -bexpall does not export symbols beginning with underscore (_)
X	  _LT_AC_TAGVAR(always_export_symbols, $1)=yes
X	  # Exported symbols can be pulled into shared objects from archives
X	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
X	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
X	  # This is similar to how AIX traditionally builds it's shared libraries.
X	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
X	fi
X      fi
X      ;;
X
X    amigaos*)
X      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
X      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
X      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
X      # see comment about different semantics on the GNU ld section
X      _LT_AC_TAGVAR(ld_shlibs, $1)=no
X      ;;
X
X    bsdi4*)
X      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
X      ;;
X
X    cygwin* | mingw* | pw32*)
X      # When not using gcc, we currently assume that we are using
X      # Microsoft Visual C++.
X      # hardcode_libdir_flag_spec is actually meaningless, as there is
X      # no search path for DLLs.
X      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
X      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
X      # Tell ltmain to make .lib files, not .a files.
X      libext=lib
X      # Tell ltmain to make .dll files, not .so files.
X      shrext=".dll"
X      # FIXME: Setting linknames here is a bad hack.
X      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
X      # The linker will automatically build a .lib file if we build a DLL.
X      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
X      # FIXME: Should let the user specify the lib program.
X      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
X      fix_srcfile_path='`cygpath -w "$srcfile"`'
X      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
X      ;;
X
X    darwin* | rhapsody*)
X    if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then 
X      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
X      case "$host_os" in
X      rhapsody* | darwin1.[[012]])
X	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
X	;;
X      *) # Darwin 1.3 on
X	test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
X	;;
X      esac
X      # FIXME: Relying on posixy $() will cause problems for
X      #        cross-compilation, but unfortunately the echo tests do not
X      #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
X      #	       `"' quotes if we put them in here... so don't!
X    	lt_int_apple_cc_single_mod=no
X    	output_verbose_link_cmd='echo'
X    	if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
X    	  lt_int_apple_cc_single_mod=yes
X    	fi
X    	if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
X    	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
X    	else
X        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
X      fi
X      _LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags'
X      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
X        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
X          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
X        else
X          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
X        fi
X          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag  -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
X      _LT_AC_TAGVAR(hardcode_direct, $1)=no
X      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
X      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
X      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
X      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
X    fi  
X      ;;
X
X    dgux*)
X      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
X      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
X      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
X      ;;
X
X    freebsd1*)
X      _LT_AC_TAGVAR(ld_shlibs, $1)=no
X      ;;
X
X    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
X    # support.  Future versions do this automatically, but an explicit c++rt0.o
X    # does not break anything, and helps significantly (at the cost of a little
X    # extra space).
X    freebsd2.2*)
X      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
X      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
X      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
X      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
X      ;;
X
X    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
X    freebsd2*)
X      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
X      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
X      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
X      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
X      ;;
X
X    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
X    freebsd*)
X      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
X      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
X      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
X      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
X      ;;
X
X    hpux9*)
X      if test "$GCC" = yes; then
X	_LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
X      else
X	_LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
X      fi
X      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
X      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
X      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
X
X      # hardcode_minus_L: Not really in the search PATH,
X      # but as the default location of the library.
X      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
X      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
X      ;;
X
X    hpux10* | hpux11*)
X      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
X	case "$host_cpu" in
X	hppa*64*|ia64*)
X	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
X	  ;;
X	*)
X	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
X	  ;;
X	esac
X      else
X	case "$host_cpu" in
X	hppa*64*|ia64*)
X	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
X	  ;;
X	*)
X	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
X	  ;;
X	esac
X      fi
X      if test "$with_gnu_ld" = no; then
X	case "$host_cpu" in
X	hppa*64*)
X	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
X	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
X	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
X	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
X	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
X	  ;;
X	ia64*)
X	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
X	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
X	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
X
X	  # hardcode_minus_L: Not really in the search PATH,
X	  # but as the default location of the library.
X	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
X	  ;;
X	*)
X	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
X	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
X	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
X	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
X
X	  # hardcode_minus_L: Not really in the search PATH,
X	  # but as the default location of the library.
X	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
X	  ;;
X	esac
X      fi
X      ;;
X
X    irix5* | irix6* | nonstopux*)
X      if test "$GCC" = yes; then
X	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
X      else
X	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
X	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
X      fi
X      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
X      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
X      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
X      ;;
X
X    netbsd*)
X      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
X	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
X      else
X	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
X      fi
X      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
X      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
X      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
X      ;;
X
X    newsos6)
X      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
X      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
X      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
X      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
X      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
X      ;;
X
X    openbsd*)
X      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
X      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
X      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
X	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
X	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
X	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
X      else
X       case $host_os in
X	 openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
X	   _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
X	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
X	   ;;
X	 *)
X	   _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
X	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
X	   ;;
X       esac
X      fi
X      ;;
X
X    os2*)
X      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
X      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
X      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
X      _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
X      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
X      ;;
X
X    osf3*)
X      if test "$GCC" = yes; then
X	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
X	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
X      else
X	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
X	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
X      fi
X      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
X      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
X      ;;
X
X    osf4* | osf5*)	# as osf3* with the addition of -msym flag
X      if test "$GCC" = yes; then
X	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
X	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
X	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
X      else
X	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
X	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
X	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
X	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
X
X	# Both c and cxx compiler support -rpath directly
X	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
X      fi
X      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
X      ;;
X
X    sco3.2v5*)
X      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
X      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
X      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
X      runpath_var=LD_RUN_PATH
X      hardcode_runpath_var=yes
X      ;;
X
X    solaris*)
X      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
X      if test "$GCC" = yes; then
X	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
X	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
X	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
X      else
X	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
X	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
X  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
X      fi
X      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
X      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
X      case $host_os in
X      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
X      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
X	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
X      esac
X      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
X      ;;
X
X    sunos4*)
X      if test "x$host_vendor" = xsequent; then
X	# Use $CC to link under sequent, because it throws in some extra .o
X	# files that make .init and .fini sections work.
X	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
X      else
X	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
X      fi
X      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
X      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
X      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
X      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
X      ;;
X
X    sysv4)
X      case $host_vendor in
X	sni)
X	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
X	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
X	;;
X	siemens)
X	  ## LD is ld it makes a PLAMLIB
X	  ## CC just makes a GrossModule.
X	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
X	  _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
X	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
X        ;;
X	motorola)
X	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
X	  _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
X	;;
X      esac
X      runpath_var='LD_RUN_PATH'
X      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
X      ;;
X
X    sysv4.3*)
X      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
X      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
X      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
X      ;;
X
X    sysv4*MP*)
X      if test -d /usr/nec; then
X	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
X	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
X	runpath_var=LD_RUN_PATH
X	hardcode_runpath_var=yes
X	_LT_AC_TAGVAR(ld_shlibs, $1)=yes
X      fi
X      ;;
X
X    sysv4.2uw2*)
X      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
X      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
X      _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
X      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
X      hardcode_runpath_var=yes
X      runpath_var=LD_RUN_PATH
X      ;;
X
X   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[[78]]* | unixware7*)
X      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
X      if test "$GCC" = yes; then
X	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
X      else
X	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
X      fi
X      runpath_var='LD_RUN_PATH'
X      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
X      ;;
X
X    sysv5*)
X      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
X      # $CC -shared without GNU ld will not create a library from C++
X      # object files and a static libstdc++, better avoid it by now
X      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
X      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
X  		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
X      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
X      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
X      runpath_var='LD_RUN_PATH'
X      ;;
X
X    uts4*)
X      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
X      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
X      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
X      ;;
X
X    *)
X      _LT_AC_TAGVAR(ld_shlibs, $1)=no
X      ;;
X    esac
X  fi
X])
XAC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
Xtest "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
X
Xvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
Xif test "$GCC" = yes; then
X  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
Xfi
X
X#
X# Do we need to explicitly link libc?
X#
Xcase "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
Xx|xyes)
X  # Assume -lc should be added
X  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
X
X  if test "$enable_shared" = yes && test "$GCC" = yes; then
X    case $_LT_AC_TAGVAR(archive_cmds, $1) in
X    *'~'*)
X      # FIXME: we may have to deal with multi-command sequences.
X      ;;
X    '$CC '*)
X      # Test whether the compiler implicitly links with -lc since on some
X      # systems, -lgcc has to come before -lc. If gcc already passes -lc
X      # to ld, don't add -lc before -lgcc.
X      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
X      $rm conftest*
X      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
X  
X      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
X        soname=conftest
X        lib=conftest
X        libobjs=conftest.$ac_objext
X        deplibs=
X        wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
X        compiler_flags=-v
X        linker_flags=-v
X        verstring=
X        output_objdir=.
X        libname=conftest
X        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
X        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
X        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
X        then
X	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
X        else
X	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
X        fi
X        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
X      else
X        cat conftest.err 1>&5
X      fi
X      $rm conftest*
X      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
X      ;;
X    esac
X  fi
X  ;;
Xesac
X])# AC_LIBTOOL_PROG_LD_SHLIBS
X
X
X# _LT_AC_FILE_LTDLL_C
X# -------------------
X# Be careful that the start marker always follows a newline.
XAC_DEFUN([_LT_AC_FILE_LTDLL_C], [
X# /* ltdll.c starts here */
X# #define WIN32_LEAN_AND_MEAN
X# #include <windows.h>
X# #undef WIN32_LEAN_AND_MEAN
X# #include <stdio.h>
X#
X# #ifndef __CYGWIN__
X# #  ifdef __CYGWIN32__
X# #    define __CYGWIN__ __CYGWIN32__
X# #  endif
X# #endif
X#
X# #ifdef __cplusplus
X# extern "C" {
X# #endif
X# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
X# #ifdef __cplusplus
X# }
X# #endif
X#
X# #ifdef __CYGWIN__
X# #include <cygwin/cygwin_dll.h>
X# DECLARE_CYGWIN_DLL( DllMain );
X# #endif
X# HINSTANCE __hDllInstance_base;
X#
X# BOOL APIENTRY
X# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
X# {
X#   __hDllInstance_base = hInst;
X#   return TRUE;
X# }
X# /* ltdll.c ends here */
X])# _LT_AC_FILE_LTDLL_C
X
X
X# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
X# ---------------------------------
XAC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
X
X
X# old names
XAC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
XAC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
XAC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
XAC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
XAC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
XAC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
XAC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
X
X# This is just to silence aclocal about the macro not being used
Xifelse([AC_DISABLE_FAST_INSTALL])
X
XAC_DEFUN([LT_AC_PROG_GCJ],
X[AC_CHECK_TOOL(GCJ, gcj, no)
X  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
X  AC_SUBST(GCJFLAGS)
X])
X
XAC_DEFUN([LT_AC_PROG_RC],
X[AC_CHECK_TOOL(RC, windres, no)
X])
X
X# NOTE: This macro has been submitted for inclusion into   #
X#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
X#  a released version of Autoconf we should remove this    #
X#  macro and use it instead.                               #
X# LT_AC_PROG_SED
X# --------------
X# Check for a fully-functional sed program, that truncates
X# as few characters as possible.  Prefer GNU sed if found.
XAC_DEFUN([LT_AC_PROG_SED],
X[AC_MSG_CHECKING([for a sed that does not truncate output])
XAC_CACHE_VAL(lt_cv_path_SED,
X[# Loop through the user's path and test for sed and gsed.
X# Then use that list of sed's as ones to test for truncation.
Xas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  for lt_ac_prog in sed gsed; do
X    for ac_exec_ext in '' $ac_executable_extensions; do
X      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
X        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
X      fi
X    done
X  done
Xdone
Xlt_ac_max=0
Xlt_ac_count=0
X# Add /usr/xpg4/bin/sed as it is typically found on Solaris
X# along with /bin/sed that truncates output.
Xfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
X  test ! -f $lt_ac_sed && break
X  cat /dev/null > conftest.in
X  lt_ac_count=0
X  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
X  # Check for GNU sed and select it if it is found.
X  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
X    lt_cv_path_SED=$lt_ac_sed
X    break
X  fi
X  while true; do
X    cat conftest.in conftest.in >conftest.tmp
X    mv conftest.tmp conftest.in
X    cp conftest.in conftest.nl
X    echo >>conftest.nl
X    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
X    cmp -s conftest.out conftest.nl || break
X    # 10000 chars as input seems more than enough
X    test $lt_ac_count -gt 10 && break
X    lt_ac_count=`expr $lt_ac_count + 1`
X    if test $lt_ac_count -gt $lt_ac_max; then
X      lt_ac_max=$lt_ac_count
X      lt_cv_path_SED=$lt_ac_sed
X    fi
X  done
Xdone
XSED=$lt_cv_path_SED
X])
XAC_MSG_RESULT([$SED])
X])
X
X# Add --enable-maintainer-mode option to configure.
X# From Jim Meyering
X
X# Copyright 1996, 1998, 2000, 2001, 2002  Free Software Foundation, Inc.
X
X# This program is free software; you can redistribute it and/or modify
X# it under the terms of the GNU General Public License as published by
X# the Free Software Foundation; either version 2, or (at your option)
X# any later version.
X
X# This program is distributed in the hope that it will be useful,
X# but WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X# GNU General Public License for more details.
X
X# You should have received a copy of the GNU General Public License
X# along with this program; if not, write to the Free Software
X# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
X# 02111-1307, USA.
X
X# serial 2
X
XAC_DEFUN([AM_MAINTAINER_MODE],
X[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
X  dnl maintainer-mode is disabled by default
X  AC_ARG_ENABLE(maintainer-mode,
X[  --enable-maintainer-mode enable make rules and dependencies not useful
X                          (and sometimes confusing) to the casual installer],
X      USE_MAINTAINER_MODE=$enableval,
X      USE_MAINTAINER_MODE=no)
X  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
X  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
X  MAINT=$MAINTAINER_MODE_TRUE
X  AC_SUBST(MAINT)dnl
X]
X)
X
XAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
X
X
X# Copyright 1996, 1997, 1999, 2000, 2001, 2002  Free Software Foundation, Inc.
X
X# This program is free software; you can redistribute it and/or modify
X# it under the terms of the GNU General Public License as published by
X# the Free Software Foundation; either version 2, or (at your option)
X# any later version.
X
X# This program is distributed in the hope that it will be useful,
X# but WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X# GNU General Public License for more details.
X
X# You should have received a copy of the GNU General Public License
X# along with this program; if not, write to the Free Software
X# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
X# 02111-1307, USA.
X
X# serial 2
X
X# @defmac AC_PROG_CC_STDC
X# @maindex PROG_CC_STDC
X# @ovindex CC
X# If the C compiler in not in ANSI C mode by default, try to add an option
X# to output variable @code{CC} to make it so.  This macro tries various
X# options that select ANSI C on some system or another.  It considers the
X# compiler to be in ANSI C mode if it handles function prototypes correctly.
X#
X# If you use this macro, you should check after calling it whether the C
X# compiler has been set to accept ANSI C; if not, the shell variable
X# @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
X# code in ANSI C, you can make an un-ANSIfied copy of it by using the
X# program @code{ansi2knr}, which comes with Ghostscript.
X# @end defmac
X
XAC_DEFUN([AM_PROG_CC_STDC],
X[AC_REQUIRE([AC_PROG_CC])
XAC_BEFORE([$0], [AC_C_INLINE])
XAC_BEFORE([$0], [AC_C_CONST])
Xdnl Force this before AC_PROG_CPP.  Some cpp's, eg on HPUX, require
Xdnl a magic option to avoid problems with ANSI preprocessor commands
Xdnl like #elif.
Xdnl FIXME: can't do this because then AC_AIX won't work due to a
Xdnl circular dependency.
Xdnl AC_BEFORE([$0], [AC_PROG_CPP])
XAC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
XAC_CACHE_VAL(am_cv_prog_cc_stdc,
X[am_cv_prog_cc_stdc=no
Xac_save_CC="$CC"
X# Don't try gcc -ansi; that turns off useful extensions and
X# breaks some systems' header files.
X# AIX			-qlanglvl=ansi
X# Ultrix and OSF/1	-std1
X# HP-UX 10.20 and later	-Ae
X# HP-UX older versions	-Aa -D_HPUX_SOURCE
X# SVR4			-Xc -D__EXTENSIONS__
Xfor ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
Xdo
X  CC="$ac_save_CC $ac_arg"
X  AC_TRY_COMPILE(
X[#include <stdarg.h>
X#include <stdio.h>
X#include <sys/types.h>
X#include <sys/stat.h>
X/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
Xstruct buf { int x; };
XFILE * (*rcsopen) (struct buf *, struct stat *, int);
Xstatic char *e (p, i)
X     char **p;
X     int i;
X{
X  return p[i];
X}
Xstatic char *f (char * (*g) (char **, int), char **p, ...)
X{
X  char *s;
X  va_list v;
X  va_start (v,p);
X  s = g (p, va_arg (v,int));
X  va_end (v);
X  return s;
X}
Xint test (int i, double x);
Xstruct s1 {int (*f) (int a);};
Xstruct s2 {int (*f) (double a);};
Xint pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
Xint argc;
Xchar **argv;
X], [
Xreturn f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
X],
X[am_cv_prog_cc_stdc="$ac_arg"; break])
Xdone
XCC="$ac_save_CC"
X])
Xif test -z "$am_cv_prog_cc_stdc"; then
X  AC_MSG_RESULT([none needed])
Xelse
X  AC_MSG_RESULT([$am_cv_prog_cc_stdc])
Xfi
Xcase "x$am_cv_prog_cc_stdc" in
X  x|xno) ;;
X  *) CC="$CC $am_cv_prog_cc_stdc" ;;
Xesac
X])
X
XAU_DEFUN([fp_PROG_CC_STDC], [AM_PROG_CC_STDC])
X
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/aclocal.m4' 'failed'
fi
# ============= libusb-0.1.8/bsd.c ==============
if test -f 'libusb-0.1.8/bsd.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/bsd.c' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/bsd.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/bsd.c' &&
X/*
X * (Free|Open|Net)BSD USB support
X *
X * Derived from Linux version by Richard Tobin.
X *
X * $Id: bsd.c,v 1.1 2004/05/27 07:11:23 mtsirkin Exp $
X * $Name:  $
X *
X * This library is covered by the LGPL, read LICENSE for details.
X */
X
X/*
X * Note: I don't have a clue what I'm doing.  I just looked at the
X * man pages and source to try and find things that did the same as
X * the Linux version. -- Richard
X *
X * johnjen@reynoldsnet.org - minor fixes with debug mode output. Consistent brace
X * use as well as indenting. More error messages put in to test for failure
X * modes with /dev/ permissions (when it happens). Note: I, like Richard, have
X * no clue what I'm doing. Patches to increase/fix functionality happily
X * accepted!
X */
X
X/* dirkx@webweaving.org - minor changes to make things actually work
X * 	for both read and write.
X */
X
X#include <stdlib.h>
X#include <unistd.h>
X#include <string.h>
X#include <stdio.h>
X#include <fcntl.h>
X#include <errno.h>
X#include <assert.h>
X#include <sys/time.h>
X#include <sys/ioctl.h>
X
X#include <dev/usb/usb.h>
X
X#include "usbi.h"
X#ifdef HAVE_CONFIG_H
X#include "config.h"
X#endif
X
X#ifdef HAVE_OLD_DEV_USB_USB_H
X/*
X * It appears some of the BSD's (OpenBSD atleast) have switched over to a
X * new naming convention, so we setup some macro's for backward
X * compability with older versions --jerdfelt
X */
X
X/* struct usb_ctl_request */
X#define ucr_addr		addr
X#define ucr_request		request
X#define ucr_data		data
X#define ucr_flags		flags
X#define ucr_actlen		actlen
X
X/* struct usb_alt_interface */
X#define uai_config_index	config_index
X#define uai_interface_index	interface_index
X#define uai_alt_no		alt_no
X
X/* struct usb_config_desc */
X#define ucd_config_index	config_index
X#define ucd_desc		desc
X
X/* struct usb_interface_desc */
X#define uid_config_index	config_index
X#define uid_interface_index	interface_index
X#define uid_alt_index		alt_index
X#define uid_desc		desc
X
X/* struct usb_endpoint_desc */
X#define ued_config_index	config_index
X#define ued_interface_index	interface_index
X#define ued_alt_index		alt_index
X#define ued_endpoint_index	endpoint_index
X#define ued_desc		desc
X
X/* struct usb_full_desc */
X#define ufd_config_index	config_index
X#define ufd_size		size
X#define ufd_data		data
X
X/* struct usb_string_desc */
X#define usd_string_index	string_index
X#define usd_language_id		language_id
X#define usd_desc		desc
X
X/* struct usb_ctl_report_desc */
X#define ucrd_size		size
X#define ucrd_data		data
X
X/* struct usb_device_info */
X#define udi_bus			bus
X#define udi_addr		addr
X#define udi_cookie		cookie
X#define udi_product		product
X#define udi_vendor		vendor
X#define udi_release		release
X#define udi_productNo		productNo
X#define udi_vendorNo		vendorNo
X#define udi_releaseNo		releaseNo
X#define udi_class		class
X#define udi_subclass		subclass
X#define udi_protocol		protocol
X#define udi_config		config
X#define udi_lowspeed		lowspeed
X#define udi_power		power
X#define udi_nports		nports
X#define udi_devnames		devnames
X#define udi_ports		ports
X
X/* struct usb_ctl_report */
X#define ucr_report		report
X#define ucr_data		data
X
X/* struct usb_device_stats */
X#define uds_requests		requests
X#endif
X
Xstatic int ensure_ep_open(usb_dev_handle *dev, int ep, int mode);
X
X#define MAX_CONTROLLERS 10
X
X/* This records the file descriptors for the endpoints.  It doesn't seem
X   to work to re-open them for each read (as well as being inefficient). */
X
Xstruct bsd_usb_dev_handle_info {
X    int ep_fd[USB_MAX_ENDPOINTS];
X};
X
Xint usb_os_open(usb_dev_handle *dev)
X{
X  int i;
X  struct bsd_usb_dev_handle_info *info;
X  char ctlpath[PATH_MAX + 1];
X
X  info = malloc(sizeof(struct bsd_usb_dev_handle_info));
X  if (!info)
X    USB_ERROR(-ENOMEM);
X  dev->impl_info = info;
X
X#if __FreeBSD__
X  snprintf(ctlpath, PATH_MAX, "%s", dev->device->filename);
X#else
X  snprintf(ctlpath, PATH_MAX, "%s.00", dev->device->filename);
X#endif
X  dev->fd = open(ctlpath, O_RDWR);
X  if (dev->fd < 0) {
X    dev->fd = open(ctlpath, O_RDONLY);
X    if (dev->fd < 0) {
X      free(info);
X      USB_ERROR_STR(-errno, "failed to open %s: %s",
X                    ctlpath, strerror(errno));
X    }
X  }
X
X  /* Mark the endpoints as not yet open */
X  for (i = 0; i < USB_MAX_ENDPOINTS; i++)
X    info->ep_fd[i] = -1;
X
X  return 0;
X}
X
Xint usb_os_close(usb_dev_handle *dev)
X{
X  struct bsd_usb_dev_handle_info *info = dev->impl_info;
X  int i;
X
X  /* Close any open endpoints */
X
X  for (i = 0; i < USB_MAX_ENDPOINTS; i++)
X    if (info->ep_fd[i] >= 0) {
X      if (usb_debug >= 2)
X        fprintf(stderr, "usb_os_close: closing endpoint %d\n", info->ep_fd[i]);
X      close(info->ep_fd[i]);
X    }
X
X  free(info);
X
X  if (dev->fd <= 0)
X    return 0;
X
X  if (close(dev->fd) == -1)
X    /* Failing trying to close a file really isn't an error, so return 0 */
X    USB_ERROR_STR(0, "tried to close device fd %d: %s", dev->fd,
X                  strerror(errno));
X
X  return 0;
X}
X
Xint usb_set_configuration(usb_dev_handle *dev, int configuration)
X{
X  int ret;
X
X  ret = ioctl(dev->fd, USB_SET_CONFIG, &configuration);
X  if (ret < 0)
X    USB_ERROR_STR(-errno, "could not set config %d: %s", configuration,
X                  strerror(errno));
X
X  dev->config = configuration;
X
X  return 0;
X}
X
Xint usb_claim_interface(usb_dev_handle *dev, int interface)
X{
X  /* BSD doesn't have the corresponding ioctl.  It seems to
X     be sufficient to open the relevant endpoints as needed. */
X
X  dev->interface = interface;
X
X  return 0;
X}
X
Xint usb_release_interface(usb_dev_handle *dev, int interface)
X{
X  /* See above */
X  return 0;
X}
X
Xint usb_set_altinterface(usb_dev_handle *dev, int alternate)
X{
X  int ret;
X  struct usb_alt_interface intf;
X
X  if (dev->interface < 0)
X    USB_ERROR(-EINVAL);
X
X  intf.uai_interface_index = dev->interface;
X  intf.uai_alt_no = alternate;
X
X  ret = ioctl(dev->fd, USB_SET_ALTINTERFACE, &intf);
X  if (ret < 0)
X    USB_ERROR_STR(-errno, "could not set alt intf %d/%d: %s",
X                  dev->interface, alternate, strerror(errno));
X
X  dev->altsetting = alternate;
X
X  return 0;
X}
X
Xstatic int ensure_ep_open(usb_dev_handle *dev, int ep, int mode)
X{
X  struct bsd_usb_dev_handle_info *info = dev->impl_info;
X  int fd;
X  char buf[20];
X
X  /* Get the address for this endpoint; we could check
X   * the mode against the direction; but we've done that
X   * already in the usb_bulk_read/write.
X   */
X  ep = UE_GET_ADDR(ep);
X
X  if (info->ep_fd[ep] < 0) {
X#if __FreeBSD__
X    snprintf(buf, sizeof(buf) - 1, "%s.%d", dev->device->filename, ep);
X#else
X    snprintf(buf, sizeof(buf) - 1, "%s.%02d", dev->device->filename, ep);
X#endif
X    /* Try to open it O_RDWR first for those devices which have in and out
X     * endpoints with the same address (eg 0x02 and 0x82)
X     */
X    fd = open(buf, O_RDWR);
X    if (fd < 0 && errno == ENXIO)
X      fd = open(buf, mode);
X    if (fd < 0)
X      USB_ERROR_STR(-errno, "can't open %s for bulk read: %s",
X                    buf, strerror(errno));
X    info->ep_fd[ep] = fd;
X  }
X
X  return info->ep_fd[ep];
X}
X
Xint usb_bulk_write(usb_dev_handle *dev, int ep, char *bytes, int size,
X                   int timeout)
X{
X  int fd, ret, sent = 0;
X
X  /* Ensure the endpoint address is correct */
X  ep &= ~USB_ENDPOINT_IN;
X
X  fd = ensure_ep_open(dev, ep, O_WRONLY);
X  if (fd < 0) {
X    if (usb_debug >= 2) {
X#if __FreeBSD__
X      fprintf (stderr, "usb_bulk_write: got negative open file descriptor for endpoint %d\n", UE_GET_ADDR(ep));
X#else
X      fprintf (stderr, "usb_bulk_write: got negative open file descriptor for endpoint %02d\n", UE_GET_ADDR(ep));
X#endif
X    }
X    return fd;
X  }
X
X  ret = ioctl(fd, USB_SET_TIMEOUT, &timeout);
X  if (ret < 0)
X    USB_ERROR_STR(-errno, "error setting timeout: %s",
X                  strerror(errno));
X
X  do {
X    ret = write(fd, bytes+sent, size-sent);
X    if (ret < 0)
X#if __FreeBSD__
X      USB_ERROR_STR(-errno, "error writing to bulk endpoint %s.%d: %s",
X                    dev->device->filename, UE_GET_ADDR(ep), strerror(errno));
X#else
X      USB_ERROR_STR(-errno, "error writing to bulk endpoint %s.%02d: %s",
X                  dev->device->filename, UE_GET_ADDR(ep), strerror(errno));
X#endif
X
X    sent += ret;
X  } while (ret > 0 && sent < size);
X
X  return sent;
X}
X
Xint usb_bulk_read(usb_dev_handle *dev, int ep, char *bytes, int size,
X                  int timeout)
X{
X  int fd, ret, retrieved = 0, one = 1;
X
X  /* Ensure the endpoint address is correct */
X  ep |= USB_ENDPOINT_IN;
X
X  fd = ensure_ep_open(dev, ep, O_RDONLY);
X  if (fd < 0) {
X    if (usb_debug >= 2) {
X#if __FreeBSD__
X      fprintf (stderr, "usb_bulk_read: got negative open file descriptor for endpoint %d\n", UE_GET_ADDR(ep));
X#else
X      fprintf (stderr, "usb_bulk_read: got negative open file descriptor for endpoint %02d\n", UE_GET_ADDR(ep));
X#endif
X    }
X    return fd;
X  }
X
X  ret = ioctl(fd, USB_SET_TIMEOUT, &timeout);
X  if (ret < 0)
X    USB_ERROR_STR(-errno, "error setting timeout: %s", strerror(errno));
X
X  ret = ioctl(fd, USB_SET_SHORT_XFER, &one);
X  if (ret < 0)
X    USB_ERROR_STR(-errno, "error setting short xfer: %s", strerror(errno));
X
X  do {
X    ret = read(fd, bytes+retrieved, size-retrieved);
X    if (ret < 0)
X#if __FreeBSD__
X      USB_ERROR_STR(-errno, "error reading from bulk endpoint %s.%d: %s",
X                    dev->device->filename, UE_GET_ADDR(ep), strerror(errno));
X#else
X      USB_ERROR_STR(-errno, "error reading from bulk endpoint %s.%02d: %s",
X                  dev->device->filename, UE_GET_ADDR(ep), strerror(errno));
X#endif
X    retrieved += ret;
X  } while (ret > 0 && retrieved < size);
X
X  return retrieved;
X}
X
Xint usb_interrupt_write(usb_dev_handle *dev, int ep, char *bytes, int size,
X                        int timeout)
X{
X  int fd, ret, sent = 0;
X
X  /* Ensure the endpoint address is correct */
X  ep &= ~USB_ENDPOINT_IN;
X
X  fd = ensure_ep_open(dev, ep, O_WRONLY);
X  if (fd < 0) {
X    if (usb_debug >= 2) {
X#if __FreeBSD__
X      fprintf (stderr, "usb_interrupt_write: got negative open file descriptor for endpoint %d\n", UE_GET_ADDR(ep));
X#else
X      fprintf (stderr, "usb_interrupt_write: got negative open file descriptor for endpoint %02d\n", UE_GET_ADDR(ep));
X#endif
X    }
X    return fd;
X  }
X
X  ret = ioctl(fd, USB_SET_TIMEOUT, &timeout);
X  if (ret < 0)
X    USB_ERROR_STR(-errno, "error setting timeout: %s",
X                  strerror(errno));
X
X  do {
X    ret = write(fd, bytes+sent, size-sent);
X    if (ret < 0)
X#if __FreeBSD__
X      USB_ERROR_STR(-errno, "error writing to interrupt endpoint %s.%d: %s",
X                    dev->device->filename, UE_GET_ADDR(ep), strerror(errno));
X#else
X      USB_ERROR_STR(-errno, "error writing to interrupt endpoint %s.%02d: %s",
X                  dev->device->filename, UE_GET_ADDR(ep), strerror(errno));
X#endif
X
X    sent += ret;
X  } while (ret > 0 && sent < size);
X
X  return sent;
X}
X
Xint usb_interrupt_read(usb_dev_handle *dev, int ep, char *bytes, int size,
X                       int timeout)
X{
X  int fd, ret, retrieved = 0, one = 1;
X
X  /* Ensure the endpoint address is correct */
X  ep |= USB_ENDPOINT_IN;
X
X  fd = ensure_ep_open(dev, ep, O_RDONLY);
X  if (fd < 0) {
X    if (usb_debug >= 2) {
X#if __FreeBSD__
X      fprintf (stderr, "usb_interrupt_read: got negative open file descriptor for endpoint %d\n", UE_GET_ADDR(ep));
X#else
X      fprintf (stderr, "usb_interrupt_read: got negative open file descriptor for endpoint %02d\n", UE_GET_ADDR(ep));
X#endif
X    }
X    return fd;
X  }
X
X  ret = ioctl(fd, USB_SET_TIMEOUT, &timeout);
X  if (ret < 0)
X    USB_ERROR_STR(-errno, "error setting timeout: %s", strerror(errno));
X
X  ret = ioctl(fd, USB_SET_SHORT_XFER, &one);
X  if (ret < 0)
X    USB_ERROR_STR(-errno, "error setting short xfer: %s", strerror(errno));
X
X  do {
X    ret = read(fd, bytes+retrieved, size-retrieved);
X    if (ret < 0)
X#if __FreeBSD__
X      USB_ERROR_STR(-errno, "error reading from interrupt endpoint %s.%d: %s",
X                    dev->device->filename, UE_GET_ADDR(ep), strerror(errno));
X#else
X      USB_ERROR_STR(-errno, "error reading from interrupt endpoint %s.%02d: %s",
X                  dev->device->filename, UE_GET_ADDR(ep), strerror(errno));
X#endif
X    retrieved += ret;
X  } while (ret > 0 && retrieved < size);
X
X  return retrieved;
X}
X
Xint usb_control_msg(usb_dev_handle *dev, int requesttype, int request,
X                     int value, int index, char *bytes, int size, int timeout)
X{
X  struct usb_ctl_request req;
X  int ret;
X
X  if (usb_debug >= 3)
X    fprintf(stderr, "usb_control_msg: %d %d %d %d %p %d %d\n",
X            requesttype, request, value, index, bytes, size, timeout);
X
X  req.ucr_request.bmRequestType = requesttype;
X  req.ucr_request.bRequest = request;
X  USETW(req.ucr_request.wValue, value);
X  USETW(req.ucr_request.wIndex, index);
X  USETW(req.ucr_request.wLength, size);
X
X  req.ucr_data = bytes;
X  req.ucr_flags = 0;
X
X  ret = ioctl(dev->fd, USB_SET_TIMEOUT, &timeout);
X#if (__NetBSD__ || __OpenBSD__)
X  if (ret < 0 && errno != EINVAL)
X#else
X  if (ret < 0)
X#endif
X    USB_ERROR_STR(-errno, "error setting timeout: %s",
X                  strerror(errno));
X
X  ret = ioctl(dev->fd, USB_DO_REQUEST, &req);
X  if (ret < 0)
X    USB_ERROR_STR(-errno, "error sending control message: %s",
X                  strerror(errno));
X
X  return UGETW(req.ucr_request.wLength);
X}
X
Xint usb_os_find_busses(struct usb_bus **busses)
X{
X  struct usb_bus *fbus = NULL;
X  int controller;
X  int fd;
X  char buf[20];
X
X  for (controller = 0; controller < MAX_CONTROLLERS; controller++) {
X    struct usb_bus *bus;
X
X    snprintf(buf, sizeof(buf) - 1, "/dev/usb%d", controller);
X    fd = open(buf, O_RDWR);
X    if (fd < 0) {
X      if (usb_debug >= 2)
X        if (errno != ENXIO && errno != ENOENT)
X          fprintf(stderr, "usb_os_find_busses: can't open %s: %s\n",
X                  buf, strerror(errno));
X      continue;
X    }
X    close(fd);
X
X    bus = malloc(sizeof(*bus));
X    if (!bus)
X      USB_ERROR(-ENOMEM);
X
X    memset((void *)bus, 0, sizeof(*bus));
X
X    strncpy(bus->dirname, buf, sizeof(bus->dirname) - 1);
X    bus->dirname[sizeof(bus->dirname) - 1] = 0;
X
X    LIST_ADD(fbus, bus);
X
X    if (usb_debug >= 2)
X      fprintf(stderr, "usb_os_find_busses: Found %s\n", bus->dirname);
X  }
X
X  *busses = fbus;
X
X  return 0;
X}
X
Xint usb_os_find_devices(struct usb_bus *bus, struct usb_device **devices)
X{
X  struct usb_device *fdev = NULL;
X  int cfd, dfd;
X  int device;
X
X  cfd = open(bus->dirname, O_RDONLY);
X  if (cfd < 0)
X    USB_ERROR_STR(-errno, "couldn't open(%s): %s", bus->dirname,
X                  strerror(errno));
X
X  for (device = 1; device < USB_MAX_DEVICES; device++) {
X    struct usb_device_info di;
X    struct usb_device *dev;
X    char buf[20];
X
X    di.udi_addr = device;
X    if (ioctl(cfd, USB_DEVICEINFO, &di) < 0)
X      continue;
X
X    /* There's a device; is it one we should mess with? */
X
X    if (strncmp(di.udi_devnames[0], "ugen", 4) != 0)
X      /* best not to play with things we don't understand */
X      continue;
X
X#if __FreeBSD__
X    snprintf(buf, sizeof(buf) - 1, "/dev/%s", di.udi_devnames[0]);
X#else
X    snprintf(buf, sizeof(buf) - 1, "/dev/%s.00", di.udi_devnames[0]);
X#endif
X
X    /* Open its control endpoint */
X    dfd = open(buf, O_RDONLY);
X    if (dfd < 0) {
X      if (usb_debug >= 2)
X        fprintf(stderr, "usb_os_find_devices: couldn't open device %s: %s\n",
X                buf, strerror(errno));
X      continue;
X    }
X
X    dev = malloc(sizeof(*dev));
X    if (!dev)
X      USB_ERROR(-ENOMEM);
X
X    memset((void *)dev, 0, sizeof(*dev));
X
X    dev->bus = bus;
X
X    /* we need to report the device name as /dev/ugenx NOT /dev/ugenx.00
X     * This seemed easier than having 2 variables...
X     */
X#if (__NetBSD__ || __OpenBSD__)
X    snprintf(buf, sizeof(buf) - 1, "/dev/%s", di.udi_devnames[0]);
X#endif
X
X    strncpy(dev->filename, buf, sizeof(dev->filename) - 1);
X    dev->filename[sizeof(dev->filename) - 1] = 0;
X
X    if (ioctl(dfd, USB_GET_DEVICE_DESC, &dev->descriptor) < 0)
X      USB_ERROR_STR(-errno, "couldn't get device descriptor for %s: %s",
X                    buf, strerror(errno));
X
X    close(dfd);
X
X    USB_LE16_TO_CPU(dev->descriptor.bcdUSB);
X    USB_LE16_TO_CPU(dev->descriptor.idVendor);
X    USB_LE16_TO_CPU(dev->descriptor.idProduct);
X    USB_LE16_TO_CPU(dev->descriptor.bcdDevice);
X
X    LIST_ADD(fdev, dev);
X
X    if (usb_debug >= 2)
X      fprintf(stderr, "usb_os_find_devices: Found %s on %s\n",
X              dev->filename, bus->dirname);
X  }
X
X  close(cfd);
X
X  *devices = fdev;
X
X  return 0;
X}
X
Xvoid usb_os_init(void)
X{
X  /* nothing */
X}
X
Xint usb_resetep(usb_dev_handle *dev, unsigned int ep)
X{
X  /* Not yet done, because I haven't needed it. */
X
X  USB_ERROR_STR(-ENOSYS, "usb_resetep called, unimplemented on BSD");
X}
X
Xint usb_clear_halt(usb_dev_handle *dev, unsigned int ep)
X{
X  /* Not yet done, because I haven't needed it. */
X
X  USB_ERROR_STR(-ENOSYS, "usb_clear_halt called, unimplemented on BSD");
X}
X
Xint usb_reset(usb_dev_handle *dev)
X{
X  /* Not yet done, because I haven't needed it. */
X
X  USB_ERROR_STR(-ENOSYS, "usb_reset called, unimplemented on BSD");
X}
X
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/bsd.c' 'failed'
fi
# ============= libusb-0.1.8/config.guess ==============
if test -f 'libusb-0.1.8/config.guess' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/config.guess' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/config.guess' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/config.guess' &&
X#! /bin/sh
X# Attempt to guess a canonical system name.
X#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
X#   Free Software Foundation, Inc.
X
Xtimestamp='2001-09-04'
X
X# This file is free software; you can redistribute it and/or modify it
X# under the terms of the GNU General Public License as published by
X# the Free Software Foundation; either version 2 of the License, or
X# (at your option) any later version.
X#
X# This program is distributed in the hope that it will be useful, but
X# WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
X# General Public License for more details.
X#
X# You should have received a copy of the GNU General Public License
X# along with this program; if not, write to the Free Software
X# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
X#
X# As a special exception to the GNU General Public License, if you
X# distribute this file as part of a program that contains a
X# configuration script generated by Autoconf, you may include it under
X# the same distribution terms that you use for the rest of that program.
X
X# Written by Per Bothner <bothner@cygnus.com>.
X# Please send patches to <config-patches@gnu.org>.
X#
X# This script attempts to guess a canonical system name similar to
X# config.sub.  If it succeeds, it prints the system name on stdout, and
X# exits with 0.  Otherwise, it exits with 1.
X#
X# The plan is that this can be called by configure scripts if you
X# don't specify an explicit build system type.
X
Xme=`echo "$0" | sed -e 's,.*/,,'`
X
Xusage="\
XUsage: $0 [OPTION]
X
XOutput the configuration name of the system \`$me' is run on.
X
XOperation modes:
X  -h, --help         print this help, then exit
X  -t, --time-stamp   print date of last modification, then exit
X  -v, --version      print version number, then exit
X
XReport bugs and patches to <config-patches@gnu.org>."
X
Xversion="\
XGNU config.guess ($timestamp)
X
XOriginally written by Per Bothner.
XCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
XFree Software Foundation, Inc.
X
XThis is free software; see the source for copying conditions.  There is NO
Xwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
X
Xhelp="
XTry \`$me --help' for more information."
X
X# Parse command line
Xwhile test $# -gt 0 ; do
X  case $1 in
X    --time-stamp | --time* | -t )
X       echo "$timestamp" ; exit 0 ;;
X    --version | -v )
X       echo "$version" ; exit 0 ;;
X    --help | --h* | -h )
X       echo "$usage"; exit 0 ;;
X    -- )     # Stop option processing
X       shift; break ;;
X    - )	# Use stdin as input.
X       break ;;
X    -* )
X       echo "$me: invalid option $1$help" >&2
X       exit 1 ;;
X    * )
X       break ;;
X  esac
Xdone
X
Xif test $# != 0; then
X  echo "$me: too many arguments$help" >&2
X  exit 1
Xfi
X
X
Xdummy=dummy-$$
Xtrap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
X
X# CC_FOR_BUILD -- compiler used by this script.
X# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
X# use `HOST_CC' if defined, but it is deprecated.
X
Xset_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
X ,,)    echo "int dummy(){}" > $dummy.c ;
X	for c in cc gcc c89 ; do
X	  ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
X	  if test $? = 0 ; then
X	     CC_FOR_BUILD="$c"; break ;
X	  fi ;
X	done ;
X	rm -f $dummy.c $dummy.o $dummy.rel ;
X	if test x"$CC_FOR_BUILD" = x ; then
X	  CC_FOR_BUILD=no_compiler_found ;
X	fi
X	;;
X ,,*)   CC_FOR_BUILD=$CC ;;
X ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
Xesac'
X
X# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
X# (ghazi@noc.rutgers.edu 1994-08-24)
Xif (test -f /.attbin/uname) >/dev/null 2>&1 ; then
X	PATH=$PATH:/.attbin ; export PATH
Xfi
X
XUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
XUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
XUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
XUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
X
X# Note: order is significant - the case branches are not exclusive.
X
Xcase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
X    *:NetBSD:*:*)
X	# Netbsd (nbsd) targets should (where applicable) match one or
X	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
X	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
X	# switched to ELF, *-*-netbsd* would select the old
X	# object file format.  This provides both forward
X	# compatibility and a consistent mechanism for selecting the
X	# object file format.
X	# Determine the machine/vendor (is the vendor relevant).
X	case "${UNAME_MACHINE}" in
X	    amiga) machine=m68k-unknown ;;
X	    arm32) machine=arm-unknown ;;
X	    atari*) machine=m68k-atari ;;
X	    sun3*) machine=m68k-sun ;;
X	    mac68k) machine=m68k-apple ;;
X	    macppc) machine=powerpc-apple ;;
X	    hp3[0-9][05]) machine=m68k-hp ;;
X	    ibmrt|romp-ibm) machine=romp-ibm ;;
X	    *) machine=${UNAME_MACHINE}-unknown ;;
X	esac
X	# The Operating System including object format, if it has switched
X	# to ELF recently, or will in the future.
X	case "${UNAME_MACHINE}" in
X	    i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k)
X		eval $set_cc_for_build
X		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
X			| grep __ELF__ >/dev/null
X		then
X		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
X		    # Return netbsd for either.  FIX?
X		    os=netbsd
X		else
X		    os=netbsdelf
X		fi
X		;;
X	    *)
X	        os=netbsd
X		;;
X	esac
X	# The OS release
X	release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
X	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
X	# contains redundant information, the shorter form:
X	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
X	echo "${machine}-${os}${release}"
X	exit 0 ;;
X    alpha:OSF1:*:*)
X	if test $UNAME_RELEASE = "V4.0"; then
X		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
X	fi
X	# A Vn.n version is a released version.
X	# A Tn.n version is a released field test version.
X	# A Xn.n version is an unreleased experimental baselevel.
X	# 1.2 uses "1.2" for uname -r.
X	cat <<EOF >$dummy.s
X	.data
X\$Lformat:
X	.byte 37,100,45,37,120,10,0	# "%d-%x\n"
X
X	.text
X	.globl main
X	.align 4
X	.ent main
Xmain:
X	.frame \$30,16,\$26,0
X	ldgp \$29,0(\$27)
X	.prologue 1
X	.long 0x47e03d80 # implver \$0
X	lda \$2,-1
X	.long 0x47e20c21 # amask \$2,\$1
X	lda \$16,\$Lformat
X	mov \$0,\$17
X	not \$1,\$18
X	jsr \$26,printf
X	ldgp \$29,0(\$26)
X	mov 0,\$16
X	jsr \$26,exit
X	.end main
XEOF
X	eval $set_cc_for_build
X	$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
X	if test "$?" = 0 ; then
X		case `./$dummy` in
X			0-0)
X				UNAME_MACHINE="alpha"
X				;;
X			1-0)
X				UNAME_MACHINE="alphaev5"
X				;;
X			1-1)
X				UNAME_MACHINE="alphaev56"
X				;;
X			1-101)
X				UNAME_MACHINE="alphapca56"
X				;;
X			2-303)
X				UNAME_MACHINE="alphaev6"
X				;;
X			2-307)
X				UNAME_MACHINE="alphaev67"
X				;;
X			2-1307)
X				UNAME_MACHINE="alphaev68"
X				;;
X		esac
X	fi
X	rm -f $dummy.s $dummy
X	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
X	exit 0 ;;
X    Alpha\ *:Windows_NT*:*)
X	# How do we know it's Interix rather than the generic POSIX subsystem?
X	# Should we change UNAME_MACHINE based on the output of uname instead
X	# of the specific Alpha model?
X	echo alpha-pc-interix
X	exit 0 ;;
X    21064:Windows_NT:50:3)
X	echo alpha-dec-winnt3.5
X	exit 0 ;;
X    Amiga*:UNIX_System_V:4.0:*)
X	echo m68k-unknown-sysv4
X	exit 0;;
X    amiga:OpenBSD:*:*)
X	echo m68k-unknown-openbsd${UNAME_RELEASE}
X	exit 0 ;;
X    *:[Aa]miga[Oo][Ss]:*:*)
X	echo ${UNAME_MACHINE}-unknown-amigaos
X	exit 0 ;;
X    arc64:OpenBSD:*:*)
X	echo mips64el-unknown-openbsd${UNAME_RELEASE}
X	exit 0 ;;
X    arc:OpenBSD:*:*)
X	echo mipsel-unknown-openbsd${UNAME_RELEASE}
X	exit 0 ;;
X    hkmips:OpenBSD:*:*)
X	echo mips-unknown-openbsd${UNAME_RELEASE}
X	exit 0 ;;
X    pmax:OpenBSD:*:*)
X	echo mipsel-unknown-openbsd${UNAME_RELEASE}
X	exit 0 ;;
X    sgi:OpenBSD:*:*)
X	echo mips-unknown-openbsd${UNAME_RELEASE}
X	exit 0 ;;
X    wgrisc:OpenBSD:*:*)
X	echo mipsel-unknown-openbsd${UNAME_RELEASE}
X	exit 0 ;;
X    *:OS/390:*:*)
X	echo i370-ibm-openedition
X	exit 0 ;;
X    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
X	echo arm-acorn-riscix${UNAME_RELEASE}
X	exit 0;;
X    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
X	echo hppa1.1-hitachi-hiuxmpp
X	exit 0;;
X    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
X	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
X	if test "`(/bin/universe) 2>/dev/null`" = att ; then
X		echo pyramid-pyramid-sysv3
X	else
X		echo pyramid-pyramid-bsd
X	fi
X	exit 0 ;;
X    NILE*:*:*:dcosx)
X	echo pyramid-pyramid-svr4
X	exit 0 ;;
X    sun4H:SunOS:5.*:*)
X	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
X	exit 0 ;;
X    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
X	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
X	exit 0 ;;
X    i86pc:SunOS:5.*:*)
X	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
X	exit 0 ;;
X    sun4*:SunOS:6*:*)
X	# According to config.sub, this is the proper way to canonicalize
X	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
X	# it's likely to be more like Solaris than SunOS4.
X	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
X	exit 0 ;;
X    sun4*:SunOS:*:*)
X	case "`/usr/bin/arch -k`" in
X	    Series*|S4*)
X		UNAME_RELEASE=`uname -v`
X		;;
X	esac
X	# Japanese Language versions have a version number like `4.1.3-JL'.
X	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
X	exit 0 ;;
X    sun3*:SunOS:*:*)
X	echo m68k-sun-sunos${UNAME_RELEASE}
X	exit 0 ;;
X    sun*:*:4.2BSD:*)
X	UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
X	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
X	case "`/bin/arch`" in
X	    sun3)
X		echo m68k-sun-sunos${UNAME_RELEASE}
X		;;
X	    sun4)
X		echo sparc-sun-sunos${UNAME_RELEASE}
X		;;
X	esac
X	exit 0 ;;
X    aushp:SunOS:*:*)
X	echo sparc-auspex-sunos${UNAME_RELEASE}
X	exit 0 ;;
X    sparc*:NetBSD:*)
X	echo `uname -p`-unknown-netbsd${UNAME_RELEASE}
X	exit 0 ;;
X    atari*:OpenBSD:*:*)
X	echo m68k-unknown-openbsd${UNAME_RELEASE}
X	exit 0 ;;
X    # The situation for MiNT is a little confusing.  The machine name
X    # can be virtually everything (everything which is not
X    # "atarist" or "atariste" at least should have a processor
X    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
X    # to the lowercase version "mint" (or "freemint").  Finally
X    # the system name "TOS" denotes a system which is actually not
X    # MiNT.  But MiNT is downward compatible to TOS, so this should
X    # be no problem.
X    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
X        echo m68k-atari-mint${UNAME_RELEASE}
X	exit 0 ;;
X    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
X	echo m68k-atari-mint${UNAME_RELEASE}
X        exit 0 ;;
X    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
X        echo m68k-atari-mint${UNAME_RELEASE}
X	exit 0 ;;
X    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
X        echo m68k-milan-mint${UNAME_RELEASE}
X        exit 0 ;;
X    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
X        echo m68k-hades-mint${UNAME_RELEASE}
X        exit 0 ;;
X    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
X        echo m68k-unknown-mint${UNAME_RELEASE}
X        exit 0 ;;
X    sun3*:OpenBSD:*:*)
X	echo m68k-unknown-openbsd${UNAME_RELEASE}
X	exit 0 ;;
X    mac68k:OpenBSD:*:*)
X	echo m68k-unknown-openbsd${UNAME_RELEASE}
X	exit 0 ;;
X    mvme68k:OpenBSD:*:*)
X	echo m68k-unknown-openbsd${UNAME_RELEASE}
X	exit 0 ;;
X    mvme88k:OpenBSD:*:*)
X	echo m88k-unknown-openbsd${UNAME_RELEASE}
X	exit 0 ;;
X    powerpc:machten:*:*)
X	echo powerpc-apple-machten${UNAME_RELEASE}
X	exit 0 ;;
X    RISC*:Mach:*:*)
X	echo mips-dec-mach_bsd4.3
X	exit 0 ;;
X    RISC*:ULTRIX:*:*)
X	echo mips-dec-ultrix${UNAME_RELEASE}
X	exit 0 ;;
X    VAX*:ULTRIX*:*:*)
X	echo vax-dec-ultrix${UNAME_RELEASE}
X	exit 0 ;;
X    2020:CLIX:*:* | 2430:CLIX:*:*)
X	echo clipper-intergraph-clix${UNAME_RELEASE}
X	exit 0 ;;
X    mips:*:*:UMIPS | mips:*:*:RISCos)
X	eval $set_cc_for_build
X	sed 's/^	//' << EOF >$dummy.c
X#ifdef __cplusplus
X#include <stdio.h>  /* for printf() prototype */
X	int main (int argc, char *argv[]) {
X#else
X	int main (argc, argv) int argc; char *argv[]; {
X#endif
X	#if defined (host_mips) && defined (MIPSEB)
X	#if defined (SYSTYPE_SYSV)
X	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
X	#endif
X	#if defined (SYSTYPE_SVR4)
X	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
X	#endif
X	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
X	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
X	#endif
X	#endif
X	  exit (-1);
X	}
XEOF
X	$CC_FOR_BUILD $dummy.c -o $dummy \
X	  && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
X	  && rm -f $dummy.c $dummy && exit 0
X	rm -f $dummy.c $dummy
X	echo mips-mips-riscos${UNAME_RELEASE}
X	exit 0 ;;
X    Motorola:PowerMAX_OS:*:*)
X	echo powerpc-motorola-powermax
X	exit 0 ;;
X    Night_Hawk:Power_UNIX:*:*)
X	echo powerpc-harris-powerunix
X	exit 0 ;;
X    m88k:CX/UX:7*:*)
X	echo m88k-harris-cxux7
X	exit 0 ;;
X    m88k:*:4*:R4*)
X	echo m88k-motorola-sysv4
X	exit 0 ;;
X    m88k:*:3*:R3*)
X	echo m88k-motorola-sysv3
X	exit 0 ;;
X    AViiON:dgux:*:*)
X        # DG/UX returns AViiON for all architectures
X        UNAME_PROCESSOR=`/usr/bin/uname -p`
X	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
X	then
X	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
X	       [ ${TARGET_BINARY_INTERFACE}x = x ]
X	    then
X		echo m88k-dg-dgux${UNAME_RELEASE}
X	    else
X		echo m88k-dg-dguxbcs${UNAME_RELEASE}
X	    fi
X	else
X	    echo i586-dg-dgux${UNAME_RELEASE}
X	fi
X 	exit 0 ;;
X    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
X	echo m88k-dolphin-sysv3
X	exit 0 ;;
X    M88*:*:R3*:*)
X	# Delta 88k system running SVR3
X	echo m88k-motorola-sysv3
X	exit 0 ;;
X    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
X	echo m88k-tektronix-sysv3
X	exit 0 ;;
X    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
X	echo m68k-tektronix-bsd
X	exit 0 ;;
X    *:IRIX*:*:*)
X	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
X	exit 0 ;;
X    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
X	echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
X	exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
X    i*86:AIX:*:*)
X	echo i386-ibm-aix
X	exit 0 ;;
X    ia64:AIX:*:*)
X	if [ -x /usr/bin/oslevel ] ; then
X		IBM_REV=`/usr/bin/oslevel`
X	else
X		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
X	fi
X	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
X	exit 0 ;;
X    *:AIX:2:3)
X	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
X		eval $set_cc_for_build
X		sed 's/^		//' << EOF >$dummy.c
X		#include <sys/systemcfg.h>
X
X		main()
X			{
X			if (!__power_pc())
X				exit(1);
X			puts("powerpc-ibm-aix3.2.5");
X			exit(0);
X			}
XEOF
X		$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
X		rm -f $dummy.c $dummy
X		echo rs6000-ibm-aix3.2.5
X	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
X		echo rs6000-ibm-aix3.2.4
X	else
X		echo rs6000-ibm-aix3.2
X	fi
X	exit 0 ;;
X    *:AIX:*:[45])
X	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
X	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
X		IBM_ARCH=rs6000
X	else
X		IBM_ARCH=powerpc
X	fi
X	if [ -x /usr/bin/oslevel ] ; then
X		IBM_REV=`/usr/bin/oslevel`
X	else
X		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
X	fi
X	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
X	exit 0 ;;
X    *:AIX:*:*)
X	echo rs6000-ibm-aix
X	exit 0 ;;
X    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
X	echo romp-ibm-bsd4.4
X	exit 0 ;;
X    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
X	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
X	exit 0 ;;                           # report: romp-ibm BSD 4.3
X    *:BOSX:*:*)
X	echo rs6000-bull-bosx
X	exit 0 ;;
X    DPX/2?00:B.O.S.:*:*)
X	echo m68k-bull-sysv3
X	exit 0 ;;
X    9000/[34]??:4.3bsd:1.*:*)
X	echo m68k-hp-bsd
X	exit 0 ;;
X    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
X	echo m68k-hp-bsd4.4
X	exit 0 ;;
X    9000/[34678]??:HP-UX:*:*)
X	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
X	case "${UNAME_MACHINE}" in
X	    9000/31? )            HP_ARCH=m68000 ;;
X	    9000/[34]?? )         HP_ARCH=m68k ;;
X	    9000/[678][0-9][0-9])
X              case "${HPUX_REV}" in
X                11.[0-9][0-9])
X                  if [ -x /usr/bin/getconf ]; then
X                    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
X                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
X                    case "${sc_cpu_version}" in
X                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
X                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
X                      532)                      # CPU_PA_RISC2_0
X                        case "${sc_kernel_bits}" in
X                          32) HP_ARCH="hppa2.0n" ;;
X                          64) HP_ARCH="hppa2.0w" ;;
X                        esac ;;
X                    esac
X                  fi ;;
X              esac
X              if [ "${HP_ARCH}" = "" ]; then
X	      eval $set_cc_for_build
X              sed 's/^              //' << EOF >$dummy.c
X
X              #define _HPUX_SOURCE
X              #include <stdlib.h>
X              #include <unistd.h>
X
X              int main ()
X              {
X              #if defined(_SC_KERNEL_BITS)
X                  long bits = sysconf(_SC_KERNEL_BITS);
X              #endif
X                  long cpu  = sysconf (_SC_CPU_VERSION);
X
X                  switch (cpu)
X              	{
X              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
X              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
X              	case CPU_PA_RISC2_0:
X              #if defined(_SC_KERNEL_BITS)
X              	    switch (bits)
X              		{
X              		case 64: puts ("hppa2.0w"); break;
X              		case 32: puts ("hppa2.0n"); break;
X              		default: puts ("hppa2.0"); break;
X              		} break;
X              #else  /* !defined(_SC_KERNEL_BITS) */
X              	    puts ("hppa2.0"); break;
X              #endif
X              	default: puts ("hppa1.0"); break;
X              	}
X                  exit (0);
X              }
XEOF
X	    (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
X	    if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
X	    rm -f $dummy.c $dummy
X	fi ;;
X	esac
X	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
X	exit 0 ;;
X    ia64:HP-UX:*:*)
X	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
X	echo ia64-hp-hpux${HPUX_REV}
X	exit 0 ;;
X    3050*:HI-UX:*:*)
X	eval $set_cc_for_build
X	sed 's/^	//' << EOF >$dummy.c
X	#include <unistd.h>
X	int
X	main ()
X	{
X	  long cpu = sysconf (_SC_CPU_VERSION);
X	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
X	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
X	     results, however.  */
X	  if (CPU_IS_PA_RISC (cpu))
X	    {
X	      switch (cpu)
X		{
X		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
X		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
X		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
X		  default: puts ("hppa-hitachi-hiuxwe2"); break;
X		}
X	    }
X	  else if (CPU_IS_HP_MC68K (cpu))
X	    puts ("m68k-hitachi-hiuxwe2");
X	  else puts ("unknown-hitachi-hiuxwe2");
X	  exit (0);
X	}
XEOF
X	$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
X	rm -f $dummy.c $dummy
X	echo unknown-hitachi-hiuxwe2
X	exit 0 ;;
X    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
X	echo hppa1.1-hp-bsd
X	exit 0 ;;
X    9000/8??:4.3bsd:*:*)
X	echo hppa1.0-hp-bsd
X	exit 0 ;;
X    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
X	echo hppa1.0-hp-mpeix
X	exit 0 ;;
X    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
X	echo hppa1.1-hp-osf
X	exit 0 ;;
X    hp8??:OSF1:*:*)
X	echo hppa1.0-hp-osf
X	exit 0 ;;
X    i*86:OSF1:*:*)
X	if [ -x /usr/sbin/sysversion ] ; then
X	    echo ${UNAME_MACHINE}-unknown-osf1mk
X	else
X	    echo ${UNAME_MACHINE}-unknown-osf1
X	fi
X	exit 0 ;;
X    parisc*:Lites*:*:*)
X	echo hppa1.1-hp-lites
X	exit 0 ;;
X    hppa*:OpenBSD:*:*)
X	echo hppa-unknown-openbsd
X	exit 0 ;;
X    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
X	echo c1-convex-bsd
X        exit 0 ;;
X    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
X	if getsysinfo -f scalar_acc
X	then echo c32-convex-bsd
X	else echo c2-convex-bsd
X	fi
X        exit 0 ;;
X    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
X	echo c34-convex-bsd
X        exit 0 ;;
X    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
X	echo c38-convex-bsd
X        exit 0 ;;
X    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
X	echo c4-convex-bsd
X        exit 0 ;;
X    CRAY*X-MP:*:*:*)
X	echo xmp-cray-unicos
X        exit 0 ;;
X    CRAY*Y-MP:*:*:*)
X	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
X	exit 0 ;;
X    CRAY*[A-Z]90:*:*:*)
X	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
X	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
X	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
X	      -e 's/\.[^.]*$/.X/'
X	exit 0 ;;
X    CRAY*TS:*:*:*)
X	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
X	exit 0 ;;
X    CRAY*T3D:*:*:*)
X	echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
X	exit 0 ;;
X    CRAY*T3E:*:*:*)
X	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
X	exit 0 ;;
X    CRAY*SV1:*:*:*)
X	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
X	exit 0 ;;
X    CRAY-2:*:*:*)
X	echo cray2-cray-unicos
X        exit 0 ;;
X    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
X	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
X        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
X        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
X        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
X        exit 0 ;;
X    hp300:OpenBSD:*:*)
X	echo m68k-unknown-openbsd${UNAME_RELEASE}
X	exit 0 ;;
X    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
X	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
X	exit 0 ;;
X    sparc*:BSD/OS:*:*)
X	echo sparc-unknown-bsdi${UNAME_RELEASE}
X	exit 0 ;;
X    *:BSD/OS:*:*)
X	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
X	exit 0 ;;
X    *:FreeBSD:*:*)
X	echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
X	exit 0 ;;
X    *:OpenBSD:*:*)
X	echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
X	exit 0 ;;
X    i*:CYGWIN*:*)
X	echo ${UNAME_MACHINE}-pc-cygwin
X	exit 0 ;;
X    i*:MINGW*:*)
X	echo ${UNAME_MACHINE}-pc-mingw32
X	exit 0 ;;
X    i*:PW*:*)
X	echo ${UNAME_MACHINE}-pc-pw32
X	exit 0 ;;
X    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
X	# How do we know it's Interix rather than the generic POSIX subsystem?
X	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
X	# UNAME_MACHINE based on the output of uname instead of i386?
X	echo i386-pc-interix
X	exit 0 ;;
X    i*:UWIN*:*)
X	echo ${UNAME_MACHINE}-pc-uwin
X	exit 0 ;;
X    p*:CYGWIN*:*)
X	echo powerpcle-unknown-cygwin
X	exit 0 ;;
X    prep*:SunOS:5.*:*)
X	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
X	exit 0 ;;
X    *:GNU:*:*)
X	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
X	exit 0 ;;
X    i*86:Minix:*:*)
X	echo ${UNAME_MACHINE}-pc-minix
X	exit 0 ;;
X    arm*:Linux:*:*)
X	echo ${UNAME_MACHINE}-unknown-linux-gnu
X	exit 0 ;;
X    ia64:Linux:*:*)
X	echo ${UNAME_MACHINE}-unknown-linux
X	exit 0 ;;
X    m68*:Linux:*:*)
X	echo ${UNAME_MACHINE}-unknown-linux-gnu
X	exit 0 ;;
X    mips:Linux:*:*)
X	case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in
X	  big)    echo mips-unknown-linux-gnu && exit 0 ;;
X	  little) echo mipsel-unknown-linux-gnu && exit 0 ;;
X	esac
X	;;
X    ppc:Linux:*:*)
X	echo powerpc-unknown-linux-gnu
X	exit 0 ;;
X    ppc64:Linux:*:*)
X	echo powerpc64-unknown-linux-gnu
X	exit 0 ;;
X    alpha:Linux:*:*)
X	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
X	  EV5)   UNAME_MACHINE=alphaev5 ;;
X	  EV56)  UNAME_MACHINE=alphaev56 ;;
X	  PCA56) UNAME_MACHINE=alphapca56 ;;
X	  PCA57) UNAME_MACHINE=alphapca56 ;;
X	  EV6)   UNAME_MACHINE=alphaev6 ;;
X	  EV67)  UNAME_MACHINE=alphaev67 ;;
X	  EV68*) UNAME_MACHINE=alphaev68 ;;
X        esac
X	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
X	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
X	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
X	exit 0 ;;
X    parisc:Linux:*:* | hppa:Linux:*:*)
X	# Look for CPU level
X	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
X	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
X	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
X	  *)    echo hppa-unknown-linux-gnu ;;
X	esac
X	exit 0 ;;
X    parisc64:Linux:*:* | hppa64:Linux:*:*)
X	echo hppa64-unknown-linux-gnu
X	exit 0 ;;
X    s390:Linux:*:* | s390x:Linux:*:*)
X	echo ${UNAME_MACHINE}-ibm-linux
X	exit 0 ;;
X    sh*:Linux:*:*)
X	echo ${UNAME_MACHINE}-unknown-linux-gnu
X	exit 0 ;;
X    sparc:Linux:*:* | sparc64:Linux:*:*)
X	echo ${UNAME_MACHINE}-unknown-linux-gnu
X	exit 0 ;;
X    x86_64:Linux:*:*)
X	echo x86_64-unknown-linux-gnu
X	exit 0 ;;
X    i*86:Linux:*:*)
X	# The BFD linker knows what the default object file format is, so
X	# first see if it will tell us. cd to the root directory to prevent
X	# problems with other programs or directories called `ld' in the path.
X	ld_supported_targets=`cd /; ld --help 2>&1 \
X			 | sed -ne '/supported targets:/!d
X				    s/[ 	][ 	]*/ /g
X				    s/.*supported targets: *//
X				    s/ .*//
X				    p'`
X        case "$ld_supported_targets" in
X	  elf32-i386)
X		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
X		;;
X	  a.out-i386-linux)
X		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
X		exit 0 ;;		
X	  coff-i386)
X		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
X		exit 0 ;;
X	  "")
X		# Either a pre-BFD a.out linker (linux-gnuoldld) or
X		# one that does not give us useful --help.
X		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
X		exit 0 ;;
X	esac
X	# Determine whether the default compiler is a.out or elf
X	eval $set_cc_for_build
X	cat >$dummy.c <<EOF
X#include <features.h>
X#ifdef __cplusplus
X#include <stdio.h>  /* for printf() prototype */
X	int main (int argc, char *argv[]) {
X#else
X	int main (argc, argv) int argc; char *argv[]; {
X#endif
X#ifdef __ELF__
X# ifdef __GLIBC__
X#  if __GLIBC__ >= 2
X    printf ("%s-pc-linux-gnu\n", argv[1]);
X#  else
X    printf ("%s-pc-linux-gnulibc1\n", argv[1]);
X#  endif
X# else
X   printf ("%s-pc-linux-gnulibc1\n", argv[1]);
X# endif
X#else
X  printf ("%s-pc-linux-gnuaout\n", argv[1]);
X#endif
X  return 0;
X}
XEOF
X	$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
X	rm -f $dummy.c $dummy
X	test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
X	;;
X    i*86:DYNIX/ptx:4*:*)
X	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
X	# earlier versions are messed up and put the nodename in both
X	# sysname and nodename.
X	echo i386-sequent-sysv4
X	exit 0 ;;
X    i*86:UNIX_SV:4.2MP:2.*)
X        # Unixware is an offshoot of SVR4, but it has its own version
X        # number series starting with 2...
X        # I am not positive that other SVR4 systems won't match this,
X	# I just have to hope.  -- rms.
X        # Use sysv4.2uw... so that sysv4* matches it.
X	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
X	exit 0 ;;
X    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
X	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
X	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
X		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
X	else
X		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
X	fi
X	exit 0 ;;
X    i*86:*:5:[78]*)
X	case `/bin/uname -X | grep "^Machine"` in
X	    *486*)	     UNAME_MACHINE=i486 ;;
X	    *Pentium)	     UNAME_MACHINE=i586 ;;
X	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
X	esac
X	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
X	exit 0 ;;
X    i*86:*:3.2:*)
X	if test -f /usr/options/cb.name; then
X		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
X		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
X	elif /bin/uname -X 2>/dev/null >/dev/null ; then
X		UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
X		(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
X		(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
X			&& UNAME_MACHINE=i586
X		(/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
X			&& UNAME_MACHINE=i686
X		(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
X			&& UNAME_MACHINE=i686
X		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
X	else
X		echo ${UNAME_MACHINE}-pc-sysv32
X	fi
X	exit 0 ;;
X    i*86:*DOS:*:*)
X	echo ${UNAME_MACHINE}-pc-msdosdjgpp
X	exit 0 ;;
X    pc:*:*:*)
X	# Left here for compatibility:
X        # uname -m prints for DJGPP always 'pc', but it prints nothing about
X        # the processor, so we play safe by assuming i386.
X	echo i386-pc-msdosdjgpp
X        exit 0 ;;
X    Intel:Mach:3*:*)
X	echo i386-pc-mach3
X	exit 0 ;;
X    paragon:*:*:*)
X	echo i860-intel-osf1
X	exit 0 ;;
X    i860:*:4.*:*) # i860-SVR4
X	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
X	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
X	else # Add other i860-SVR4 vendors below as they are discovered.
X	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
X	fi
X	exit 0 ;;
X    mini*:CTIX:SYS*5:*)
X	# "miniframe"
X	echo m68010-convergent-sysv
X	exit 0 ;;
X    M68*:*:R3V[567]*:*)
X	test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
X    3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
X	OS_REL=''
X	test -r /etc/.relid \
X	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
X	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
X	  && echo i486-ncr-sysv4.3${OS_REL} && exit 0
X	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
X	  && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
X    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
X        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
X          && echo i486-ncr-sysv4 && exit 0 ;;
X    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
X	echo m68k-unknown-lynxos${UNAME_RELEASE}
X	exit 0 ;;
X    mc68030:UNIX_System_V:4.*:*)
X	echo m68k-atari-sysv4
X	exit 0 ;;
X    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
X	echo i386-unknown-lynxos${UNAME_RELEASE}
X	exit 0 ;;
X    TSUNAMI:LynxOS:2.*:*)
X	echo sparc-unknown-lynxos${UNAME_RELEASE}
X	exit 0 ;;
X    rs6000:LynxOS:2.*:*)
X	echo rs6000-unknown-lynxos${UNAME_RELEASE}
X	exit 0 ;;
X    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
X	echo powerpc-unknown-lynxos${UNAME_RELEASE}
X	exit 0 ;;
X    SM[BE]S:UNIX_SV:*:*)
X	echo mips-dde-sysv${UNAME_RELEASE}
X	exit 0 ;;
X    RM*:ReliantUNIX-*:*:*)
X	echo mips-sni-sysv4
X	exit 0 ;;
X    RM*:SINIX-*:*:*)
X	echo mips-sni-sysv4
X	exit 0 ;;
X    *:SINIX-*:*:*)
X	if uname -p 2>/dev/null >/dev/null ; then
X		UNAME_MACHINE=`(uname -p) 2>/dev/null`
X		echo ${UNAME_MACHINE}-sni-sysv4
X	else
X		echo ns32k-sni-sysv
X	fi
X	exit 0 ;;
X    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
X                      # says <Richard.M.Bartel@ccMail.Census.GOV>
X        echo i586-unisys-sysv4
X        exit 0 ;;
X    *:UNIX_System_V:4*:FTX*)
X	# From Gerald Hewes <hewes@openmarket.com>.
X	# How about differentiating between stratus architectures? -djm
X	echo hppa1.1-stratus-sysv4
X	exit 0 ;;
X    *:*:*:FTX*)
X	# From seanf@swdc.stratus.com.
X	echo i860-stratus-sysv4
X	exit 0 ;;
X    *:VOS:*:*)
X	# From Paul.Green@stratus.com.
X	echo hppa1.1-stratus-vos
X	exit 0 ;;
X    mc68*:A/UX:*:*)
X	echo m68k-apple-aux${UNAME_RELEASE}
X	exit 0 ;;
X    news*:NEWS-OS:6*:*)
X	echo mips-sony-newsos6
X	exit 0 ;;
X    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
X	if [ -d /usr/nec ]; then
X	        echo mips-nec-sysv${UNAME_RELEASE}
X	else
X	        echo mips-unknown-sysv${UNAME_RELEASE}
X	fi
X        exit 0 ;;
X    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
X	echo powerpc-be-beos
X	exit 0 ;;
X    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
X	echo powerpc-apple-beos
X	exit 0 ;;
X    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
X	echo i586-pc-beos
X	exit 0 ;;
X    SX-4:SUPER-UX:*:*)
X	echo sx4-nec-superux${UNAME_RELEASE}
X	exit 0 ;;
X    SX-5:SUPER-UX:*:*)
X	echo sx5-nec-superux${UNAME_RELEASE}
X	exit 0 ;;
X    Power*:Rhapsody:*:*)
X	echo powerpc-apple-rhapsody${UNAME_RELEASE}
X	exit 0 ;;
X    *:Rhapsody:*:*)
X	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
X	exit 0 ;;
X    *:Darwin:*:*)
X	echo `uname -p`-apple-darwin${UNAME_RELEASE}
X	exit 0 ;;
X    *:procnto*:*:* | *:QNX:[0123456789]*:*)
X	if test "${UNAME_MACHINE}" = "x86pc"; then
X		UNAME_MACHINE=pc
X	fi
X	echo `uname -p`-${UNAME_MACHINE}-nto-qnx
X	exit 0 ;;
X    *:QNX:*:4*)
X	echo i386-pc-qnx
X	exit 0 ;;
X    NSR-[KW]:NONSTOP_KERNEL:*:*)
X	echo nsr-tandem-nsk${UNAME_RELEASE}
X	exit 0 ;;
X    *:NonStop-UX:*:*)
X	echo mips-compaq-nonstopux
X	exit 0 ;;
X    BS2000:POSIX*:*:*)
X	echo bs2000-siemens-sysv
X	exit 0 ;;
X    DS/*:UNIX_System_V:*:*)
X	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
X	exit 0 ;;
X    *:Plan9:*:*)
X	# "uname -m" is not consistent, so use $cputype instead. 386
X	# is converted to i386 for consistency with other x86
X	# operating systems.
X	if test "$cputype" = "386"; then
X	    UNAME_MACHINE=i386
X	else
X	    UNAME_MACHINE="$cputype"
X	fi
X	echo ${UNAME_MACHINE}-unknown-plan9
X	exit 0 ;;
X    i*86:OS/2:*:*)
X	# If we were able to find `uname', then EMX Unix compatibility
X	# is probably installed.
X	echo ${UNAME_MACHINE}-pc-os2-emx
X	exit 0 ;;
X    *:TOPS-10:*:*)
X	echo pdp10-unknown-tops10
X	exit 0 ;;
X    *:TENEX:*:*)
X	echo pdp10-unknown-tenex
X	exit 0 ;;
X    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
X	echo pdp10-dec-tops20
X	exit 0 ;;
X    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
X	echo pdp10-xkl-tops20
X	exit 0 ;;
X    *:TOPS-20:*:*)
X	echo pdp10-unknown-tops20
X	exit 0 ;;
X    *:ITS:*:*)
X	echo pdp10-unknown-its
X	exit 0 ;;
X    i*86:XTS-300:*:STOP)
X	echo ${UNAME_MACHINE}-unknown-stop
X	exit 0 ;;
X    i*86:atheos:*:*)
X	echo ${UNAME_MACHINE}-unknown-atheos
X	exit 0 ;;
Xesac
X
X#echo '(No uname command or uname output not recognized.)' 1>&2
X#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
X
Xeval $set_cc_for_build
Xcat >$dummy.c <<EOF
X#ifdef _SEQUENT_
X# include <sys/types.h>
X# include <sys/utsname.h>
X#endif
Xmain ()
X{
X#if defined (sony)
X#if defined (MIPSEB)
X  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
X     I don't know....  */
X  printf ("mips-sony-bsd\n"); exit (0);
X#else
X#include <sys/param.h>
X  printf ("m68k-sony-newsos%s\n",
X#ifdef NEWSOS4
X          "4"
X#else
X	  ""
X#endif
X         ); exit (0);
X#endif
X#endif
X
X#if defined (__arm) && defined (__acorn) && defined (__unix)
X  printf ("arm-acorn-riscix"); exit (0);
X#endif
X
X#if defined (hp300) && !defined (hpux)
X  printf ("m68k-hp-bsd\n"); exit (0);
X#endif
X
X#if defined (NeXT)
X#if !defined (__ARCHITECTURE__)
X#define __ARCHITECTURE__ "m68k"
X#endif
X  int version;
X  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
X  if (version < 4)
X    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
X  else
X    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
X  exit (0);
X#endif
X
X#if defined (MULTIMAX) || defined (n16)
X#if defined (UMAXV)
X  printf ("ns32k-encore-sysv\n"); exit (0);
X#else
X#if defined (CMU)
X  printf ("ns32k-encore-mach\n"); exit (0);
X#else
X  printf ("ns32k-encore-bsd\n"); exit (0);
X#endif
X#endif
X#endif
X
X#if defined (__386BSD__)
X  printf ("i386-pc-bsd\n"); exit (0);
X#endif
X
X#if defined (sequent)
X#if defined (i386)
X  printf ("i386-sequent-dynix\n"); exit (0);
X#endif
X#if defined (ns32000)
X  printf ("ns32k-sequent-dynix\n"); exit (0);
X#endif
X#endif
X
X#if defined (_SEQUENT_)
X    struct utsname un;
X
X    uname(&un);
X
X    if (strncmp(un.version, "V2", 2) == 0) {
X	printf ("i386-sequent-ptx2\n"); exit (0);
X    }
X    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
X	printf ("i386-sequent-ptx1\n"); exit (0);
X    }
X    printf ("i386-sequent-ptx\n"); exit (0);
X
X#endif
X
X#if defined (vax)
X# if !defined (ultrix)
X#  include <sys/param.h>
X#  if defined (BSD)
X#   if BSD == 43
X      printf ("vax-dec-bsd4.3\n"); exit (0);
X#   else
X#    if BSD == 199006
X      printf ("vax-dec-bsd4.3reno\n"); exit (0);
X#    else
X      printf ("vax-dec-bsd\n"); exit (0);
X#    endif
X#   endif
X#  else
X    printf ("vax-dec-bsd\n"); exit (0);
X#  endif
X# else
X    printf ("vax-dec-ultrix\n"); exit (0);
X# endif
X#endif
X
X#if defined (alliant) && defined (i860)
X  printf ("i860-alliant-bsd\n"); exit (0);
X#endif
X
X  exit (1);
X}
XEOF
X
X$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
Xrm -f $dummy.c $dummy
X
X# Apollos put the system type in the environment.
X
Xtest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
X
X# Convex versions that predate uname can use getsysinfo(1)
X
Xif [ -x /usr/convex/getsysinfo ]
Xthen
X    case `getsysinfo -f cpu_type` in
X    c1*)
X	echo c1-convex-bsd
X	exit 0 ;;
X    c2*)
X	if getsysinfo -f scalar_acc
X	then echo c32-convex-bsd
X	else echo c2-convex-bsd
X	fi
X	exit 0 ;;
X    c34*)
X	echo c34-convex-bsd
X	exit 0 ;;
X    c38*)
X	echo c38-convex-bsd
X	exit 0 ;;
X    c4*)
X	echo c4-convex-bsd
X	exit 0 ;;
X    esac
Xfi
X
Xcat >&2 <<EOF
X$0: unable to guess system type
X
XThis script, last modified $timestamp, has failed to recognize
Xthe operating system you are using. It is advised that you
Xdownload the most up to date version of the config scripts from
X
X    ftp://ftp.gnu.org/pub/gnu/config/
X
XIf the version you run ($0) is already up to date, please
Xsend the following data and any information you think might be
Xpertinent to <config-patches@gnu.org> in order to provide the needed
Xinformation to handle your system.
X
Xconfig.guess timestamp = $timestamp
X
Xuname -m = `(uname -m) 2>/dev/null || echo unknown`
Xuname -r = `(uname -r) 2>/dev/null || echo unknown`
Xuname -s = `(uname -s) 2>/dev/null || echo unknown`
Xuname -v = `(uname -v) 2>/dev/null || echo unknown`
X
X/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
X/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
X
Xhostinfo               = `(hostinfo) 2>/dev/null`
X/bin/universe          = `(/bin/universe) 2>/dev/null`
X/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
X/bin/arch              = `(/bin/arch) 2>/dev/null`
X/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
X/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
X
XUNAME_MACHINE = ${UNAME_MACHINE}
XUNAME_RELEASE = ${UNAME_RELEASE}
XUNAME_SYSTEM  = ${UNAME_SYSTEM}
XUNAME_VERSION = ${UNAME_VERSION}
XEOF
X
Xexit 1
X
X# Local variables:
X# eval: (add-hook 'write-file-hooks 'time-stamp)
X# time-stamp-start: "timestamp='"
X# time-stamp-format: "%:y-%02m-%02d"
X# time-stamp-end: "'"
X# End:
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/config.guess' 'failed'
fi
# ============= libusb-0.1.8/config.h.in ==============
if test -f 'libusb-0.1.8/config.h.in' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/config.h.in' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/config.h.in' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/config.h.in' &&
X/* config.h.in.  Generated from configure.in by autoheader.  */
X
X#undef LINUX_API
X#undef BSD_API
X#undef DARWIN_API
X
X#undef HAVE_OLD_DEV_USB_USB_H
X
X#undef HAVE_LIMITS_H
X#undef HAVE_UNISTD_H
X#undef HAVE_VALUES_H
X
X#undef LIBUSB_MAJOR_VERSION
X#undef LIBUSB_MINOR_VERSION
X#undef LIBUSB_MICRO_VERSION
X#undef LIBUSB_INTERFACE_AGE
X#undef LIBUSB_BINARY_AGE
X
X
X/* Define to 1 if you have the <dlfcn.h> header file. */
X#undef HAVE_DLFCN_H
X
X/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
X#undef HAVE_DOPRNT
X
X/* Define to 1 if you have the <inttypes.h> header file. */
X#undef HAVE_INTTYPES_H
X
X/* Define to 1 if you have the <limits.h> header file. */
X#undef HAVE_LIMITS_H
X
X/* Define to 1 if you have the `memmove' function. */
X#undef HAVE_MEMMOVE
X
X/* Define to 1 if you have the <memory.h> header file. */
X#undef HAVE_MEMORY_H
X
X/* Define to 1 if you have the <stdint.h> header file. */
X#undef HAVE_STDINT_H
X
X/* Define to 1 if you have the <stdlib.h> header file. */
X#undef HAVE_STDLIB_H
X
X/* Define to 1 if you have the <strings.h> header file. */
X#undef HAVE_STRINGS_H
X
X/* Define to 1 if you have the <string.h> header file. */
X#undef HAVE_STRING_H
X
X/* Define to 1 if you have the <sys/stat.h> header file. */
X#undef HAVE_SYS_STAT_H
X
X/* Define to 1 if you have the <sys/types.h> header file. */
X#undef HAVE_SYS_TYPES_H
X
X/* Define to 1 if you have the <unistd.h> header file. */
X#undef HAVE_UNISTD_H
X
X/* Define to 1 if you have the <values.h> header file. */
X#undef HAVE_VALUES_H
X
X/* Define to 1 if you have the `vprintf' function. */
X#undef HAVE_VPRINTF
X
X/* Define to the address where bug reports for this package should be sent. */
X#undef PACKAGE_BUGREPORT
X
X/* Define to the full name of this package. */
X#undef PACKAGE_NAME
X
X/* Define to the full name and version of this package. */
X#undef PACKAGE_STRING
X
X/* Define to the one symbol short name of this package. */
X#undef PACKAGE_TARNAME
X
X/* Define to the version of this package. */
X#undef PACKAGE_VERSION
X
X/* Define to 1 if you have the ANSI C header files. */
X#undef STDC_HEADERS
X
X/* Define to 1 if your processor stores words with the most significant byte
X   first (like Motorola and SPARC, unlike Intel and VAX). */
X#undef WORDS_BIGENDIAN
X
X/* Define to empty if `const' does not conform to ANSI C. */
X#undef const
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/config.h.in' 'failed'
fi
# ============= libusb-0.1.8/config.sub ==============
if test -f 'libusb-0.1.8/config.sub' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/config.sub' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/config.sub' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/config.sub' &&
X#! /bin/sh
X# Configuration validation subroutine script.
X#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
X#   Free Software Foundation, Inc.
X
Xtimestamp='2001-09-07'
X
X# This file is (in principle) common to ALL GNU software.
X# The presence of a machine in this file suggests that SOME GNU software
X# can handle that machine.  It does not imply ALL GNU software can.
X#
X# This file is free software; you can redistribute it and/or modify
X# it under the terms of the GNU General Public License as published by
X# the Free Software Foundation; either version 2 of the License, or
X# (at your option) any later version.
X#
X# This program is distributed in the hope that it will be useful,
X# but WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X# GNU General Public License for more details.
X#
X# You should have received a copy of the GNU General Public License
X# along with this program; if not, write to the Free Software
X# Foundation, Inc., 59 Temple Place - Suite 330,
X# Boston, MA 02111-1307, USA.
X
X# As a special exception to the GNU General Public License, if you
X# distribute this file as part of a program that contains a
X# configuration script generated by Autoconf, you may include it under
X# the same distribution terms that you use for the rest of that program.
X
X# Please send patches to <config-patches@gnu.org>.
X#
X# Configuration subroutine to validate and canonicalize a configuration type.
X# Supply the specified configuration type as an argument.
X# If it is invalid, we print an error message on stderr and exit with code 1.
X# Otherwise, we print the canonical config type on stdout and succeed.
X
X# This file is supposed to be the same for all GNU packages
X# and recognize all the CPU types, system types and aliases
X# that are meaningful with *any* GNU software.
X# Each package is responsible for reporting which valid configurations
X# it does not support.  The user should be able to distinguish
X# a failure to support a valid configuration from a meaningless
X# configuration.
X
X# The goal of this file is to map all the various variations of a given
X# machine specification into a single specification in the form:
X#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
X# or in some cases, the newer four-part form:
X#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
X# It is wrong to echo any other type of specification.
X
Xme=`echo "$0" | sed -e 's,.*/,,'`
X
Xusage="\
XUsage: $0 [OPTION] CPU-MFR-OPSYS
X       $0 [OPTION] ALIAS
X
XCanonicalize a configuration name.
X
XOperation modes:
X  -h, --help         print this help, then exit
X  -t, --time-stamp   print date of last modification, then exit
X  -v, --version      print version number, then exit
X
XReport bugs and patches to <config-patches@gnu.org>."
X
Xversion="\
XGNU config.sub ($timestamp)
X
XCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
XFree Software Foundation, Inc.
X
XThis is free software; see the source for copying conditions.  There is NO
Xwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
X
Xhelp="
XTry \`$me --help' for more information."
X
X# Parse command line
Xwhile test $# -gt 0 ; do
X  case $1 in
X    --time-stamp | --time* | -t )
X       echo "$timestamp" ; exit 0 ;;
X    --version | -v )
X       echo "$version" ; exit 0 ;;
X    --help | --h* | -h )
X       echo "$usage"; exit 0 ;;
X    -- )     # Stop option processing
X       shift; break ;;
X    - )	# Use stdin as input.
X       break ;;
X    -* )
X       echo "$me: invalid option $1$help"
X       exit 1 ;;
X
X    *local*)
X       # First pass through any local machine types.
X       echo $1
X       exit 0;;
X
X    * )
X       break ;;
X  esac
Xdone
X
Xcase $# in
X 0) echo "$me: missing argument$help" >&2
X    exit 1;;
X 1) ;;
X *) echo "$me: too many arguments$help" >&2
X    exit 1;;
Xesac
X
X# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
X# Here we must recognize all the valid KERNEL-OS combinations.
Xmaybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
Xcase $maybe_os in
X  nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*)
X    os=-$maybe_os
X    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
X    ;;
X  *)
X    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
X    if [ $basic_machine != $1 ]
X    then os=`echo $1 | sed 's/.*-/-/'`
X    else os=; fi
X    ;;
Xesac
X
X### Let's recognize common machines as not being operating systems so
X### that things like config.sub decstation-3100 work.  We also
X### recognize some manufacturers as not being operating systems, so we
X### can provide default operating systems below.
Xcase $os in
X	-sun*os*)
X		# Prevent following clause from handling this invalid input.
X		;;
X	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
X	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
X	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
X	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
X	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
X	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
X	-apple | -axis)
X		os=
X		basic_machine=$1
X		;;
X	-sim | -cisco | -oki | -wec | -winbond)
X		os=
X		basic_machine=$1
X		;;
X	-scout)
X		;;
X	-wrs)
X		os=-vxworks
X		basic_machine=$1
X		;;
X	-chorusos*)
X		os=-chorusos
X		basic_machine=$1
X		;;
X 	-chorusrdb)
X 		os=-chorusrdb
X		basic_machine=$1
X 		;;
X	-hiux*)
X		os=-hiuxwe2
X		;;
X	-sco5)
X		os=-sco3.2v5
X		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
X		;;
X	-sco4)
X		os=-sco3.2v4
X		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
X		;;
X	-sco3.2.[4-9]*)
X		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
X		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
X		;;
X	-sco3.2v[4-9]*)
X		# Don't forget version if it is 3.2v4 or newer.
X		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
X		;;
X	-sco*)
X		os=-sco3.2v2
X		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
X		;;
X	-udk*)
X		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
X		;;
X	-isc)
X		os=-isc2.2
X		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
X		;;
X	-clix*)
X		basic_machine=clipper-intergraph
X		;;
X	-isc*)
X		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
X		;;
X	-lynx*)
X		os=-lynxos
X		;;
X	-ptx*)
X		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
X		;;
X	-windowsnt*)
X		os=`echo $os | sed -e 's/windowsnt/winnt/'`
X		;;
X	-psos*)
X		os=-psos
X		;;
X	-mint | -mint[0-9]*)
X		basic_machine=m68k-atari
X		os=-mint
X		;;
Xesac
X
X# Decode aliases for certain CPU-COMPANY combinations.
Xcase $basic_machine in
X	# Recognize the basic CPU types without company name.
X	# Some are omitted here because they have special meanings below.
X	1750a | 580 \
X	| a29k \
X	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
X	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
X	| c4x | clipper \
X	| d10v | d30v | dsp16xx \
X	| fr30 \
X	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
X	| i370 | i860 | i960 | ia64 \
X	| m32r | m68000 | m68k | m88k | mcore \
X	| mips16 | mips64 | mips64el | mips64orion | mips64orionel \
X	| mips64vr4100 | mips64vr4100el | mips64vr4300 \
X	| mips64vr4300el | mips64vr5000 | mips64vr5000el \
X	| mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \
X	| mipsisa32 \
X	| mn10200 | mn10300 \
X	| ns16k | ns32k \
X	| openrisc \
X	| pdp10 | pdp11 | pj | pjl \
X	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
X	| pyramid \
X	| s390 | s390x \
X	| sh | sh[34] | sh[34]eb | shbe | shle \
X	| sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \
X	| stormy16 | strongarm \
X	| tahoe | thumb | tic80 | tron \
X	| v850 \
X	| we32k \
X	| x86 | xscale \
X	| z8k)
X		basic_machine=$basic_machine-unknown
X		;;
X	m6811 | m68hc11 | m6812 | m68hc12)
X		# Motorola 68HC11/12.
X		basic_machine=$basic_machine-unknown
X		os=-none
X		;;
X	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
X		;;
X
X	# We use `pc' rather than `unknown'
X	# because (1) that's what they normally are, and
X	# (2) the word "unknown" tends to confuse beginning users.
X	i*86 | x86_64)
X	  basic_machine=$basic_machine-pc
X	  ;;
X	# Object if more than one company name word.
X	*-*-*)
X		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
X		exit 1
X		;;
X	# Recognize the basic CPU types with company name.
X	580-* \
X	| a29k-* \
X	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
X	| alphapca5[67]-* | arc-* \
X	| arm-*  | armbe-* | armle-* | armv*-* \
X	| bs2000-* \
X	| c[123]* | c30-* | [cjt]90-* | c54x-* \
X	| clipper-* | cray2-* | cydra-* \
X	| d10v-* | d30v-* \
X	| elxsi-* \
X	| f30[01]-* | f700-* | fr30-* | fx80-* \
X	| h8300-* | h8500-* \
X	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
X	| i*86-* | i860-* | i960-* | ia64-* \
X	| m32r-* \
X	| m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \
X	| m88110-* | m88k-* | mcore-* \
X	| mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \
X	| mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \
X	| mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \
X	| mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \
X	| none-* | np1-* | ns16k-* | ns32k-* \
X	| orion-* \
X	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
X	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
X	| pyramid-* \
X	| romp-* | rs6000-* \
X	| s390-* | s390x-* \
X	| sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \
X	| sparc-* | sparc64-* | sparc86x-* | sparclite-* \
X	| sparcv9-* | sparcv9b-* | stormy16-* | strongarm-* | sv1-* \
X	| t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \
X	| v850-* | vax-* \
X	| we32k-* \
X	| x86-* | x86_64-* | xmp-* | xps100-* | xscale-* \
X	| ymp-* \
X	| z8k-*)
X		;;
X	# Recognize the various machine names and aliases which stand
X	# for a CPU type and a company and sometimes even an OS.
X	386bsd)
X		basic_machine=i386-unknown
X		os=-bsd
X		;;
X	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
X		basic_machine=m68000-att
X		;;
X	3b*)
X		basic_machine=we32k-att
X		;;
X	a29khif)
X		basic_machine=a29k-amd
X		os=-udi
X		;;
X	adobe68k)
X		basic_machine=m68010-adobe
X		os=-scout
X		;;
X	alliant | fx80)
X		basic_machine=fx80-alliant
X		;;
X	altos | altos3068)
X		basic_machine=m68k-altos
X		;;
X	am29k)
X		basic_machine=a29k-none
X		os=-bsd
X		;;
X	amdahl)
X		basic_machine=580-amdahl
X		os=-sysv
X		;;
X	amiga | amiga-*)
X		basic_machine=m68k-unknown
X		;;
X	amigaos | amigados)
X		basic_machine=m68k-unknown
X		os=-amigaos
X		;;
X	amigaunix | amix)
X		basic_machine=m68k-unknown
X		os=-sysv4
X		;;
X	apollo68)
X		basic_machine=m68k-apollo
X		os=-sysv
X		;;
X	apollo68bsd)
X		basic_machine=m68k-apollo
X		os=-bsd
X		;;
X	aux)
X		basic_machine=m68k-apple
X		os=-aux
X		;;
X	balance)
X		basic_machine=ns32k-sequent
X		os=-dynix
X		;;
X	convex-c1)
X		basic_machine=c1-convex
X		os=-bsd
X		;;
X	convex-c2)
X		basic_machine=c2-convex
X		os=-bsd
X		;;
X	convex-c32)
X		basic_machine=c32-convex
X		os=-bsd
X		;;
X	convex-c34)
X		basic_machine=c34-convex
X		os=-bsd
X		;;
X	convex-c38)
X		basic_machine=c38-convex
X		os=-bsd
X		;;
X	cray | ymp)
X		basic_machine=ymp-cray
X		os=-unicos
X		;;
X	cray2)
X		basic_machine=cray2-cray
X		os=-unicos
X		;;
X	[cjt]90)
X		basic_machine=${basic_machine}-cray
X		os=-unicos
X		;;
X	crds | unos)
X		basic_machine=m68k-crds
X		;;
X	cris | cris-* | etrax*)
X		basic_machine=cris-axis
X		;;
X	da30 | da30-*)
X		basic_machine=m68k-da30
X		;;
X	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
X		basic_machine=mips-dec
X		;;
X	delta | 3300 | motorola-3300 | motorola-delta \
X	      | 3300-motorola | delta-motorola)
X		basic_machine=m68k-motorola
X		;;
X	delta88)
X		basic_machine=m88k-motorola
X		os=-sysv3
X		;;
X	dpx20 | dpx20-*)
X		basic_machine=rs6000-bull
X		os=-bosx
X		;;
X	dpx2* | dpx2*-bull)
X		basic_machine=m68k-bull
X		os=-sysv3
X		;;
X	ebmon29k)
X		basic_machine=a29k-amd
X		os=-ebmon
X		;;
X	elxsi)
X		basic_machine=elxsi-elxsi
X		os=-bsd
X		;;
X	encore | umax | mmax)
X		basic_machine=ns32k-encore
X		;;
X	es1800 | OSE68k | ose68k | ose | OSE)
X		basic_machine=m68k-ericsson
X		os=-ose
X		;;
X	fx2800)
X		basic_machine=i860-alliant
X		;;
X	genix)
X		basic_machine=ns32k-ns
X		;;
X	gmicro)
X		basic_machine=tron-gmicro
X		os=-sysv
X		;;
X	go32)
X		basic_machine=i386-pc
X		os=-go32
X		;;
X	h3050r* | hiux*)
X		basic_machine=hppa1.1-hitachi
X		os=-hiuxwe2
X		;;
X	h8300hms)
X		basic_machine=h8300-hitachi
X		os=-hms
X		;;
X	h8300xray)
X		basic_machine=h8300-hitachi
X		os=-xray
X		;;
X	h8500hms)
X		basic_machine=h8500-hitachi
X		os=-hms
X		;;
X	harris)
X		basic_machine=m88k-harris
X		os=-sysv3
X		;;
X	hp300-*)
X		basic_machine=m68k-hp
X		;;
X	hp300bsd)
X		basic_machine=m68k-hp
X		os=-bsd
X		;;
X	hp300hpux)
X		basic_machine=m68k-hp
X		os=-hpux
X		;;
X	hp3k9[0-9][0-9] | hp9[0-9][0-9])
X		basic_machine=hppa1.0-hp
X		;;
X	hp9k2[0-9][0-9] | hp9k31[0-9])
X		basic_machine=m68000-hp
X		;;
X	hp9k3[2-9][0-9])
X		basic_machine=m68k-hp
X		;;
X	hp9k6[0-9][0-9] | hp6[0-9][0-9])
X		basic_machine=hppa1.0-hp
X		;;
X	hp9k7[0-79][0-9] | hp7[0-79][0-9])
X		basic_machine=hppa1.1-hp
X		;;
X	hp9k78[0-9] | hp78[0-9])
X		# FIXME: really hppa2.0-hp
X		basic_machine=hppa1.1-hp
X		;;
X	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
X		# FIXME: really hppa2.0-hp
X		basic_machine=hppa1.1-hp
X		;;
X	hp9k8[0-9][13679] | hp8[0-9][13679])
X		basic_machine=hppa1.1-hp
X		;;
X	hp9k8[0-9][0-9] | hp8[0-9][0-9])
X		basic_machine=hppa1.0-hp
X		;;
X	hppa-next)
X		os=-nextstep3
X		;;
X	hppaosf)
X		basic_machine=hppa1.1-hp
X		os=-osf
X		;;
X	hppro)
X		basic_machine=hppa1.1-hp
X		os=-proelf
X		;;
X	i370-ibm* | ibm*)
X		basic_machine=i370-ibm
X		;;
X# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
X	i*86v32)
X		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
X		os=-sysv32
X		;;
X	i*86v4*)
X		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
X		os=-sysv4
X		;;
X	i*86v)
X		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
X		os=-sysv
X		;;
X	i*86sol2)
X		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
X		os=-solaris2
X		;;
X	i386mach)
X		basic_machine=i386-mach
X		os=-mach
X		;;
X	i386-vsta | vsta)
X		basic_machine=i386-unknown
X		os=-vsta
X		;;
X	iris | iris4d)
X		basic_machine=mips-sgi
X		case $os in
X		    -irix*)
X			;;
X		    *)
X			os=-irix4
X			;;
X		esac
X		;;
X	isi68 | isi)
X		basic_machine=m68k-isi
X		os=-sysv
X		;;
X	m88k-omron*)
X		basic_machine=m88k-omron
X		;;
X	magnum | m3230)
X		basic_machine=mips-mips
X		os=-sysv
X		;;
X	merlin)
X		basic_machine=ns32k-utek
X		os=-sysv
X		;;
X	mingw32)
X		basic_machine=i386-pc
X		os=-mingw32
X		;;
X	miniframe)
X		basic_machine=m68000-convergent
X		;;
X	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
X		basic_machine=m68k-atari
X		os=-mint
X		;;
X	mipsel*-linux*)
X		basic_machine=mipsel-unknown
X		os=-linux-gnu
X		;;
X	mips*-linux*)
X		basic_machine=mips-unknown
X		os=-linux-gnu
X		;;
X	mips3*-*)
X		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
X		;;
X	mips3*)
X		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
X		;;
X	mmix*)
X		basic_machine=mmix-knuth
X		os=-mmixware
X		;;
X	monitor)
X		basic_machine=m68k-rom68k
X		os=-coff
X		;;
X	msdos)
X		basic_machine=i386-pc
X		os=-msdos
X		;;
X	mvs)
X		basic_machine=i370-ibm
X		os=-mvs
X		;;
X	ncr3000)
X		basic_machine=i486-ncr
X		os=-sysv4
X		;;
X	netbsd386)
X		basic_machine=i386-unknown
X		os=-netbsd
X		;;
X	netwinder)
X		basic_machine=armv4l-rebel
X		os=-linux
X		;;
X	news | news700 | news800 | news900)
X		basic_machine=m68k-sony
X		os=-newsos
X		;;
X	news1000)
X		basic_machine=m68030-sony
X		os=-newsos
X		;;
X	news-3600 | risc-news)
X		basic_machine=mips-sony
X		os=-newsos
X		;;
X	necv70)
X		basic_machine=v70-nec
X		os=-sysv
X		;;
X	next | m*-next )
X		basic_machine=m68k-next
X		case $os in
X		    -nextstep* )
X			;;
X		    -ns2*)
X		      os=-nextstep2
X			;;
X		    *)
X		      os=-nextstep3
X			;;
X		esac
X		;;
X	nh3000)
X		basic_machine=m68k-harris
X		os=-cxux
X		;;
X	nh[45]000)
X		basic_machine=m88k-harris
X		os=-cxux
X		;;
X	nindy960)
X		basic_machine=i960-intel
X		os=-nindy
X		;;
X	mon960)
X		basic_machine=i960-intel
X		os=-mon960
X		;;
X	nonstopux)
X		basic_machine=mips-compaq
X		os=-nonstopux
X		;;
X	np1)
X		basic_machine=np1-gould
X		;;
X	nsr-tandem)
X		basic_machine=nsr-tandem
X		;;
X	op50n-* | op60c-*)
X		basic_machine=hppa1.1-oki
X		os=-proelf
X		;;
X	OSE68000 | ose68000)
X		basic_machine=m68000-ericsson
X		os=-ose
X		;;
X	os68k)
X		basic_machine=m68k-none
X		os=-os68k
X		;;
X	pa-hitachi)
X		basic_machine=hppa1.1-hitachi
X		os=-hiuxwe2
X		;;
X	paragon)
X		basic_machine=i860-intel
X		os=-osf
X		;;
X	pbd)
X		basic_machine=sparc-tti
X		;;
X	pbb)
X		basic_machine=m68k-tti
X		;;
X        pc532 | pc532-*)
X		basic_machine=ns32k-pc532
X		;;
X	pentium | p5 | k5 | k6 | nexgen)
X		basic_machine=i586-pc
X		;;
X	pentiumpro | p6 | 6x86 | athlon)
X		basic_machine=i686-pc
X		;;
X	pentiumii | pentium2)
X		basic_machine=i686-pc
X		;;
X	pentium-* | p5-* | k5-* | k6-* | nexgen-*)
X		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
X		;;
X	pentiumpro-* | p6-* | 6x86-* | athlon-*)
X		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
X		;;
X	pentiumii-* | pentium2-*)
X		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
X		;;
X	pn)
X		basic_machine=pn-gould
X		;;
X	power)	basic_machine=power-ibm
X		;;
X	ppc)	basic_machine=powerpc-unknown
X	        ;;
X	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
X		;;
X	ppcle | powerpclittle | ppc-le | powerpc-little)
X		basic_machine=powerpcle-unknown
X	        ;;
X	ppcle-* | powerpclittle-*)
X		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
X		;;
X	ppc64)	basic_machine=powerpc64-unknown
X	        ;;
X	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
X		;;
X	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
X		basic_machine=powerpc64le-unknown
X	        ;;
X	ppc64le-* | powerpc64little-*)
X		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
X		;;
X	ps2)
X		basic_machine=i386-ibm
X		;;
X	pw32)
X		basic_machine=i586-unknown
X		os=-pw32
X		;;
X	rom68k)
X		basic_machine=m68k-rom68k
X		os=-coff
X		;;
X	rm[46]00)
X		basic_machine=mips-siemens
X		;;
X	rtpc | rtpc-*)
X		basic_machine=romp-ibm
X		;;
X	sa29200)
X		basic_machine=a29k-amd
X		os=-udi
X		;;
X	sequent)
X		basic_machine=i386-sequent
X		;;
X	sh)
X		basic_machine=sh-hitachi
X		os=-hms
X		;;
X	sparclite-wrs)
X		basic_machine=sparclite-wrs
X		os=-vxworks
X		;;
X	sps7)
X		basic_machine=m68k-bull
X		os=-sysv2
X		;;
X	spur)
X		basic_machine=spur-unknown
X		;;
X	st2000)
X		basic_machine=m68k-tandem
X		;;
X	stratus)
X		basic_machine=i860-stratus
X		os=-sysv4
X		;;
X	sun2)
X		basic_machine=m68000-sun
X		;;
X	sun2os3)
X		basic_machine=m68000-sun
X		os=-sunos3
X		;;
X	sun2os4)
X		basic_machine=m68000-sun
X		os=-sunos4
X		;;
X	sun3os3)
X		basic_machine=m68k-sun
X		os=-sunos3
X		;;
X	sun3os4)
X		basic_machine=m68k-sun
X		os=-sunos4
X		;;
X	sun4os3)
X		basic_machine=sparc-sun
X		os=-sunos3
X		;;
X	sun4os4)
X		basic_machine=sparc-sun
X		os=-sunos4
X		;;
X	sun4sol2)
X		basic_machine=sparc-sun
X		os=-solaris2
X		;;
X	sun3 | sun3-*)
X		basic_machine=m68k-sun
X		;;
X	sun4)
X		basic_machine=sparc-sun
X		;;
X	sun386 | sun386i | roadrunner)
X		basic_machine=i386-sun
X		;;
X	sv1)
X		basic_machine=sv1-cray
X		os=-unicos
X		;;
X	symmetry)
X		basic_machine=i386-sequent
X		os=-dynix
X		;;
X	t3e)
X		basic_machine=t3e-cray
X		os=-unicos
X		;;
X	tic54x | c54x*)
X		basic_machine=tic54x-unknown
X		os=-coff
X		;;
X	tx39)
X		basic_machine=mipstx39-unknown
X		;;
X	tx39el)
X		basic_machine=mipstx39el-unknown
X		;;
X	tower | tower-32)
X		basic_machine=m68k-ncr
X		;;
X	udi29k)
X		basic_machine=a29k-amd
X		os=-udi
X		;;
X	ultra3)
X		basic_machine=a29k-nyu
X		os=-sym1
X		;;
X	v810 | necv810)
X		basic_machine=v810-nec
X		os=-none
X		;;
X	vaxv)
X		basic_machine=vax-dec
X		os=-sysv
X		;;
X	vms)
X		basic_machine=vax-dec
X		os=-vms
X		;;
X	vpp*|vx|vx-*)
X               basic_machine=f301-fujitsu
X               ;;
X	vxworks960)
X		basic_machine=i960-wrs
X		os=-vxworks
X		;;
X	vxworks68)
X		basic_machine=m68k-wrs
X		os=-vxworks
X		;;
X	vxworks29k)
X		basic_machine=a29k-wrs
X		os=-vxworks
X		;;
X	w65*)
X		basic_machine=w65-wdc
X		os=-none
X		;;
X	w89k-*)
X		basic_machine=hppa1.1-winbond
X		os=-proelf
X		;;
X	windows32)
X		basic_machine=i386-pc
X		os=-windows32-msvcrt
X		;;
X	xmp)
X		basic_machine=xmp-cray
X		os=-unicos
X		;;
X        xps | xps100)
X		basic_machine=xps100-honeywell
X		;;
X	z8k-*-coff)
X		basic_machine=z8k-unknown
X		os=-sim
X		;;
X	none)
X		basic_machine=none-none
X		os=-none
X		;;
X
X# Here we handle the default manufacturer of certain CPU types.  It is in
X# some cases the only manufacturer, in others, it is the most popular.
X	w89k)
X		basic_machine=hppa1.1-winbond
X		;;
X	op50n)
X		basic_machine=hppa1.1-oki
X		;;
X	op60c)
X		basic_machine=hppa1.1-oki
X		;;
X	mips)
X		if [ x$os = x-linux-gnu ]; then
X			basic_machine=mips-unknown
X		else
X			basic_machine=mips-mips
X		fi
X		;;
X	romp)
X		basic_machine=romp-ibm
X		;;
X	rs6000)
X		basic_machine=rs6000-ibm
X		;;
X	vax)
X		basic_machine=vax-dec
X		;;
X	pdp10)
X		# there are many clones, so DEC is not a safe bet
X		basic_machine=pdp10-unknown
X		;;
X	pdp11)
X		basic_machine=pdp11-dec
X		;;
X	we32k)
X		basic_machine=we32k-att
X		;;
X	sh3 | sh4 | sh3eb | sh4eb)
X		basic_machine=sh-unknown
X		;;
X	sparc | sparcv9 | sparcv9b)
X		basic_machine=sparc-sun
X		;;
X        cydra)
X		basic_machine=cydra-cydrome
X		;;
X	orion)
X		basic_machine=orion-highlevel
X		;;
X	orion105)
X		basic_machine=clipper-highlevel
X		;;
X	mac | mpw | mac-mpw)
X		basic_machine=m68k-apple
X		;;
X	pmac | pmac-mpw)
X		basic_machine=powerpc-apple
X		;;
X	c4x*)
X		basic_machine=c4x-none
X		os=-coff
X		;;
X	*-unknown)
X		# Make sure to match an already-canonicalized machine name.
X		;;
X	*)
X		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
X		exit 1
X		;;
Xesac
X
X# Here we canonicalize certain aliases for manufacturers.
Xcase $basic_machine in
X	*-digital*)
X		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
X		;;
X	*-commodore*)
X		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
X		;;
X	*)
X		;;
Xesac
X
X# Decode manufacturer-specific aliases for certain operating systems.
X
Xif [ x"$os" != x"" ]
Xthen
Xcase $os in
X        # First match some system type aliases
X        # that might get confused with valid system types.
X	# -solaris* is a basic system type, with this one exception.
X	-solaris1 | -solaris1.*)
X		os=`echo $os | sed -e 's|solaris1|sunos4|'`
X		;;
X	-solaris)
X		os=-solaris2
X		;;
X	-svr4*)
X		os=-sysv4
X		;;
X	-unixware*)
X		os=-sysv4.2uw
X		;;
X	-gnu/linux*)
X		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
X		;;
X	# First accept the basic system types.
X	# The portable systems comes first.
X	# Each alternative MUST END IN A *, to match a version number.
X	# -sysv* is not here because it comes later, after sysvr4.
X	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
X	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
X	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
X	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
X	      | -aos* \
X	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
X	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
X	      | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
X	      | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
X	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
X	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
X	      | -chorusos* | -chorusrdb* \
X	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
X	      | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
X	      | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
X	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
X	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
X	      | -os2* | -vos*)
X	# Remember, each alternative MUST END IN *, to match a version number.
X		;;
X	-qnx*)
X		case $basic_machine in
X		    x86-* | i*86-*)
X			;;
X		    *)
X			os=-nto$os
X			;;
X		esac
X		;;
X	-nto*)
X		os=-nto-qnx
X		;;
X	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
X	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
X	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
X		;;
X	-mac*)
X		os=`echo $os | sed -e 's|mac|macos|'`
X		;;
X	-linux*)
X		os=`echo $os | sed -e 's|linux|linux-gnu|'`
X		;;
X	-sunos5*)
X		os=`echo $os | sed -e 's|sunos5|solaris2|'`
X		;;
X	-sunos6*)
X		os=`echo $os | sed -e 's|sunos6|solaris3|'`
X		;;
X	-opened*)
X		os=-openedition
X		;;
X	-wince*)
X		os=-wince
X		;;
X	-osfrose*)
X		os=-osfrose
X		;;
X	-osf*)
X		os=-osf
X		;;
X	-utek*)
X		os=-bsd
X		;;
X	-dynix*)
X		os=-bsd
X		;;
X	-acis*)
X		os=-aos
X		;;
X	-386bsd)
X		os=-bsd
X		;;
X	-ctix* | -uts*)
X		os=-sysv
X		;;
X	-ns2 )
X	        os=-nextstep2
X		;;
X	-nsk*)
X		os=-nsk
X		;;
X	# Preserve the version number of sinix5.
X	-sinix5.*)
X		os=`echo $os | sed -e 's|sinix|sysv|'`
X		;;
X	-sinix*)
X		os=-sysv4
X		;;
X	-triton*)
X		os=-sysv3
X		;;
X	-oss*)
X		os=-sysv3
X		;;
X	-svr4)
X		os=-sysv4
X		;;
X	-svr3)
X		os=-sysv3
X		;;
X	-sysvr4)
X		os=-sysv4
X		;;
X	# This must come after -sysvr4.
X	-sysv*)
X		;;
X	-ose*)
X		os=-ose
X		;;
X	-es1800*)
X		os=-ose
X		;;
X	-xenix)
X		os=-xenix
X		;;
X        -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
X	        os=-mint
X		;;
X	-none)
X		;;
X	*)
X		# Get rid of the `-' at the beginning of $os.
X		os=`echo $os | sed 's/[^-]*-//'`
X		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
X		exit 1
X		;;
Xesac
Xelse
X
X# Here we handle the default operating systems that come with various machines.
X# The value should be what the vendor currently ships out the door with their
X# machine or put another way, the most popular os provided with the machine.
X
X# Note that if you're going to try to match "-MANUFACTURER" here (say,
X# "-sun"), then you have to tell the case statement up towards the top
X# that MANUFACTURER isn't an operating system.  Otherwise, code above
X# will signal an error saying that MANUFACTURER isn't an operating
X# system, and we'll never get to this point.
X
Xcase $basic_machine in
X	*-acorn)
X		os=-riscix1.2
X		;;
X	arm*-rebel)
X		os=-linux
X		;;
X	arm*-semi)
X		os=-aout
X		;;
X	pdp10-*)
X		os=-tops20
X		;;
X        pdp11-*)
X		os=-none
X		;;
X	*-dec | vax-*)
X		os=-ultrix4.2
X		;;
X	m68*-apollo)
X		os=-domain
X		;;
X	i386-sun)
X		os=-sunos4.0.2
X		;;
X	m68000-sun)
X		os=-sunos3
X		# This also exists in the configure program, but was not the
X		# default.
X		# os=-sunos4
X		;;
X	m68*-cisco)
X		os=-aout
X		;;
X	mips*-cisco)
X		os=-elf
X		;;
X	mips*-*)
X		os=-elf
X		;;
X	*-tti)	# must be before sparc entry or we get the wrong os.
X		os=-sysv3
X		;;
X	sparc-* | *-sun)
X		os=-sunos4.1.1
X		;;
X	*-be)
X		os=-beos
X		;;
X	*-ibm)
X		os=-aix
X		;;
X	*-wec)
X		os=-proelf
X		;;
X	*-winbond)
X		os=-proelf
X		;;
X	*-oki)
X		os=-proelf
X		;;
X	*-hp)
X		os=-hpux
X		;;
X	*-hitachi)
X		os=-hiux
X		;;
X	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
X		os=-sysv
X		;;
X	*-cbm)
X		os=-amigaos
X		;;
X	*-dg)
X		os=-dgux
X		;;
X	*-dolphin)
X		os=-sysv3
X		;;
X	m68k-ccur)
X		os=-rtu
X		;;
X	m88k-omron*)
X		os=-luna
X		;;
X	*-next )
X		os=-nextstep
X		;;
X	*-sequent)
X		os=-ptx
X		;;
X	*-crds)
X		os=-unos
X		;;
X	*-ns)
X		os=-genix
X		;;
X	i370-*)
X		os=-mvs
X		;;
X	*-next)
X		os=-nextstep3
X		;;
X        *-gould)
X		os=-sysv
X		;;
X        *-highlevel)
X		os=-bsd
X		;;
X	*-encore)
X		os=-bsd
X		;;
X        *-sgi)
X		os=-irix
X		;;
X        *-siemens)
X		os=-sysv4
X		;;
X	*-masscomp)
X		os=-rtu
X		;;
X	f30[01]-fujitsu | f700-fujitsu)
X		os=-uxpv
X		;;
X	*-rom68k)
X		os=-coff
X		;;
X	*-*bug)
X		os=-coff
X		;;
X	*-apple)
X		os=-macos
X		;;
X	*-atari*)
X		os=-mint
X		;;
X	*)
X		os=-none
X		;;
Xesac
Xfi
X
X# Here we handle the case where we know the os, and the CPU type, but not the
X# manufacturer.  We pick the logical manufacturer.
Xvendor=unknown
Xcase $basic_machine in
X	*-unknown)
X		case $os in
X			-riscix*)
X				vendor=acorn
X				;;
X			-sunos*)
X				vendor=sun
X				;;
X			-aix*)
X				vendor=ibm
X				;;
X			-beos*)
X				vendor=be
X				;;
X			-hpux*)
X				vendor=hp
X				;;
X			-mpeix*)
X				vendor=hp
X				;;
X			-hiux*)
X				vendor=hitachi
X				;;
X			-unos*)
X				vendor=crds
X				;;
X			-dgux*)
X				vendor=dg
X				;;
X			-luna*)
X				vendor=omron
X				;;
X			-genix*)
X				vendor=ns
X				;;
X			-mvs* | -opened*)
X				vendor=ibm
X				;;
X			-ptx*)
X				vendor=sequent
X				;;
X			-vxsim* | -vxworks*)
X				vendor=wrs
X				;;
X			-aux*)
X				vendor=apple
X				;;
X			-hms*)
X				vendor=hitachi
X				;;
X			-mpw* | -macos*)
X				vendor=apple
X				;;
X			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
X				vendor=atari
X				;;
X			-vos*)
X				vendor=stratus
X				;;
X		esac
X		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
X		;;
Xesac
X
Xecho $basic_machine$os
Xexit 0
X
X# Local variables:
X# eval: (add-hook 'write-file-hooks 'time-stamp)
X# time-stamp-start: "timestamp='"
X# time-stamp-format: "%:y-%02m-%02d"
X# time-stamp-end: "'"
X# End:
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/config.sub' 'failed'
fi
# ============= libusb-0.1.8/configure ==============
if test -f 'libusb-0.1.8/configure' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/configure' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/configure' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/configure' &&
X#! /bin/sh
X# Guess values for system-dependent variables and create Makefiles.
X# Generated by GNU Autoconf 2.57.
X#
X# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
X# Free Software Foundation, Inc.
X# This configure script is free software; the Free Software Foundation
X# gives unlimited permission to copy, distribute and modify it.
X## --------------------- ##
X## M4sh Initialization.  ##
X## --------------------- ##
X
X# Be Bourne compatible
Xif test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
X  emulate sh
X  NULLCMD=:
X  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
X  # is contrary to our usage.  Disable this feature.
X  alias -g '${1+"$@"}'='"$@"'
Xelif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
X  set -o posix
Xfi
X
X# Support unset when possible.
Xif (FOO=FOO; unset FOO) >/dev/null 2>&1; then
X  as_unset=unset
Xelse
X  as_unset=false
Xfi
X
X
X# Work around bugs in pre-3.0 UWIN ksh.
X$as_unset ENV MAIL MAILPATH
XPS1='$ '
XPS2='> '
XPS4='+ '
X
X# NLS nuisances.
Xfor as_var in \
X  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
X  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
X  LC_TELEPHONE LC_TIME
Xdo
X  if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
X    eval $as_var=C; export $as_var
X  else
X    $as_unset $as_var
X  fi
Xdone
X
X# Required to use basename.
Xif expr a : '\(a\)' >/dev/null 2>&1; then
X  as_expr=expr
Xelse
X  as_expr=false
Xfi
X
Xif (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
X  as_basename=basename
Xelse
X  as_basename=false
Xfi
X
X
X# Name of the executable.
Xas_me=`$as_basename "$0" ||
X$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X	 X"$0" : 'X\(//\)$' \| \
X	 X"$0" : 'X\(/\)$' \| \
X	 .     : '\(.\)' 2>/dev/null ||
Xecho X/"$0" |
X    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
X  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
X  	  /^X\/\(\/\).*/{ s//\1/; q; }
X  	  s/.*/./; q'`
X
X
X# PATH needs CR, and LINENO needs CR and PATH.
X# Avoid depending upon Character Ranges.
Xas_cr_letters='abcdefghijklmnopqrstuvwxyz'
Xas_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
Xas_cr_Letters=$as_cr_letters$as_cr_LETTERS
Xas_cr_digits='0123456789'
Xas_cr_alnum=$as_cr_Letters$as_cr_digits
X
X# The user is always right.
Xif test "${PATH_SEPARATOR+set}" != set; then
X  echo "#! /bin/sh" >conf$$.sh
X  echo  "exit 0"   >>conf$$.sh
X  chmod +x conf$$.sh
X  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
X    PATH_SEPARATOR=';'
X  else
X    PATH_SEPARATOR=:
X  fi
X  rm -f conf$$.sh
Xfi
X
X
X  as_lineno_1=$LINENO
X  as_lineno_2=$LINENO
X  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
X  test "x$as_lineno_1" != "x$as_lineno_2" &&
X  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
X  # Find who we are.  Look in the path if we contain no path at all
X  # relative or not.
X  case $0 in
X    *[\\/]* ) as_myself=$0 ;;
X    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
Xdone
X
X       ;;
X  esac
X  # We did not find ourselves, most probably we were run as `sh COMMAND'
X  # in which case we are not to be found in the path.
X  if test "x$as_myself" = x; then
X    as_myself=$0
X  fi
X  if test ! -f "$as_myself"; then
X    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
X   { (exit 1); exit 1; }; }
X  fi
X  case $CONFIG_SHELL in
X  '')
X    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  for as_base in sh bash ksh sh5; do
X	 case $as_dir in
X	 /*)
X	   if ("$as_dir/$as_base" -c '
X  as_lineno_1=$LINENO
X  as_lineno_2=$LINENO
X  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
X  test "x$as_lineno_1" != "x$as_lineno_2" &&
X  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
X	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
X	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
X	     CONFIG_SHELL=$as_dir/$as_base
X	     export CONFIG_SHELL
X	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
X	   fi;;
X	 esac
X       done
Xdone
X;;
X  esac
X
X  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
X  # uniformly replaced by the line number.  The first 'sed' inserts a
X  # line-number line before each line; the second 'sed' does the real
X  # work.  The second script uses 'N' to pair each line-number line
X  # with the numbered line, and appends trailing '-' during
X  # substitution so that $LINENO is not a special case at line end.
X  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
X  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
X  sed '=' <$as_myself |
X    sed '
X      N
X      s,$,-,
X      : loop
X      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
X      t loop
X      s,-$,,
X      s,^['$as_cr_digits']*\n,,
X    ' >$as_me.lineno &&
X  chmod +x $as_me.lineno ||
X    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
X   { (exit 1); exit 1; }; }
X
X  # Don't try to exec as it changes $[0], causing all sort of problems
X  # (the dirname of $[0] is not the place where we might find the
X  # original and so on.  Autoconf is especially sensible to this).
X  . ./$as_me.lineno
X  # Exit status is that of the last command.
X  exit
X}
X
X
Xcase `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
X  *c*,-n*) ECHO_N= ECHO_C='
X' ECHO_T='	' ;;
X  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
X  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
Xesac
X
Xif expr a : '\(a\)' >/dev/null 2>&1; then
X  as_expr=expr
Xelse
X  as_expr=false
Xfi
X
Xrm -f conf$$ conf$$.exe conf$$.file
Xecho >conf$$.file
Xif ln -s conf$$.file conf$$ 2>/dev/null; then
X  # We could just check for DJGPP; but this test a) works b) is more generic
X  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
X  if test -f conf$$.exe; then
X    # Don't use ln at all; we don't have any links
X    as_ln_s='cp -p'
X  else
X    as_ln_s='ln -s'
X  fi
Xelif ln conf$$.file conf$$ 2>/dev/null; then
X  as_ln_s=ln
Xelse
X  as_ln_s='cp -p'
Xfi
Xrm -f conf$$ conf$$.exe conf$$.file
X
Xif mkdir -p . 2>/dev/null; then
X  as_mkdir_p=:
Xelse
X  as_mkdir_p=false
Xfi
X
Xas_executable_p="test -f"
X
X# Sed expression to map a string onto a valid CPP name.
Xas_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
X
X# Sed expression to map a string onto a valid variable name.
Xas_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
X
X
X# IFS
X# We need space, tab and new line, in precisely that order.
Xas_nl='
X'
XIFS=" 	$as_nl"
X
X# CDPATH.
X$as_unset CDPATH
X
X
X
X#
X# The following version number definitions apply to libusb
X# as a whole, so if changes occoured in any of them, they are all
X# treated with the same interface and binary age.
X#
X# Making releases:
X#   LIBUSB_MICRO_VERSION += 1;
X#   LIBUSB_INTERFACE_AGE += 1;
X#   LIBUSB_BINARY_AGE += 1;
X# if any functions have been added, set LIBUSB_INTERFACE_AGE to 0.
X# if backwards compatibility has been broken,
X# set LIBUSB_BINARY_AGE _and_ LIBUSB_INTERFACE_AGE to 0.
X#
XLIBUSB_MAJOR_VERSION=0
XLIBUSB_MINOR_VERSION=1
XLIBUSB_MICRO_VERSION=8
XLIBUSB_INTERFACE_AGE=0
XLIBUSB_BINARY_AGE=4
XLIBUSB_VERSION=$LIBUSB_MAJOR_VERSION.$LIBUSB_MINOR_VERSION.$LIBUSB_MICRO_VERSION
X
X
X# Check that we are running under the correct shell.
XSHELL=${CONFIG_SHELL-/bin/sh}
X
Xcase X$ECHO in
XX*--fallback-echo)
X  # Remove one level of quotation (which was required for Make).
X  ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
X  ;;
Xesac
X
Xecho=${ECHO-echo}
Xif test "X$1" = X--no-reexec; then
X  # Discard the --no-reexec flag, and continue.
X  shift
Xelif test "X$1" = X--fallback-echo; then
X  # Avoid inline document here, it may be left over
X  :
Xelif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
X  # Yippee, $echo works!
X  :
Xelse
X  # Restart under the correct shell.
X  exec $SHELL "$0" --no-reexec ${1+"$@"}
Xfi
X
Xif test "X$1" = X--fallback-echo; then
X  # used as fallback echo
X  shift
X  cat <<EOF
X$*
XEOF
X  exit 0
Xfi
X
X# The HP-UX ksh and POSIX shell print the target directory to stdout
X# if CDPATH is set.
Xif test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
X
Xif test -z "$ECHO"; then
Xif test "X${echo_test_string+set}" != Xset; then
X# find a string as large as possible, as long as the shell can cope with it
X  for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
X    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
X    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
X       echo_test_string="`eval $cmd`" &&
X       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
X    then
X      break
X    fi
X  done
Xfi
X
Xif test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
X   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
X   test "X$echo_testing_string" = "X$echo_test_string"; then
X  :
Xelse
X  # The Solaris, AIX, and Digital Unix default echo programs unquote
X  # backslashes.  This makes it impossible to quote backslashes using
X  #   echo "$something" | sed 's/\\/\\\\/g'
X  #
X  # So, first we look for a working echo in the user's PATH.
X
X  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
X  for dir in $PATH /usr/ucb; do
X    IFS="$lt_save_ifs"
X    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
X       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
X       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
X       test "X$echo_testing_string" = "X$echo_test_string"; then
X      echo="$dir/echo"
X      break
X    fi
X  done
X  IFS="$lt_save_ifs"
X
X  if test "X$echo" = Xecho; then
X    # We didn't find a better echo, so look for alternatives.
X    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
X       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
X       test "X$echo_testing_string" = "X$echo_test_string"; then
X      # This shell has a builtin print -r that does the trick.
X      echo='print -r'
X    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
X	 test "X$CONFIG_SHELL" != X/bin/ksh; then
X      # If we have ksh, try running configure again with it.
X      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
X      export ORIGINAL_CONFIG_SHELL
X      CONFIG_SHELL=/bin/ksh
X      export CONFIG_SHELL
X      exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
X    else
X      # Try using printf.
X      echo='printf %s\n'
X      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
X	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
X	 test "X$echo_testing_string" = "X$echo_test_string"; then
X	# Cool, printf works
X	:
X      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
X	   test "X$echo_testing_string" = 'X\t' &&
X	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
X	   test "X$echo_testing_string" = "X$echo_test_string"; then
X	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
X	export CONFIG_SHELL
X	SHELL="$CONFIG_SHELL"
X	export SHELL
X	echo="$CONFIG_SHELL $0 --fallback-echo"
X      elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
X	   test "X$echo_testing_string" = 'X\t' &&
X	   echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
X	   test "X$echo_testing_string" = "X$echo_test_string"; then
X	echo="$CONFIG_SHELL $0 --fallback-echo"
X      else
X	# maybe with a smaller string...
X	prev=:
X
X	for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
X	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
X	  then
X	    break
X	  fi
X	  prev="$cmd"
X	done
X
X	if test "$prev" != 'sed 50q "$0"'; then
X	  echo_test_string=`eval $prev`
X	  export echo_test_string
X	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
X	else
X	  # Oops.  We lost completely, so just stick with echo.
X	  echo=echo
X	fi
X      fi
X    fi
X  fi
Xfi
Xfi
X
X# Copy echo and quote the copy suitably for passing to libtool from
X# the Makefile, instead of quoting the original, which is used later.
XECHO=$echo
Xif test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
X   ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
Xfi
X
X
X
X
Xtagnames=`echo "$tagnames,CXX" | sed 's/^,//'`
X
Xtagnames=`echo "$tagnames,F77" | sed 's/^,//'`
X
Xif test `expr $LIBUSB_MINOR_VERSION \% 2` = 1 ; then
X  debug_default=yes
Xelse
X  debug_default=minimum
Xfi
X
X# Name of the host.
X# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
X# so uname gets run too.
Xac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
X
Xexec 6>&1
X
X#
X# Initializations.
X#
Xac_default_prefix=/usr/local
Xac_config_libobj_dir=.
Xcross_compiling=no
Xsubdirs=
XMFLAGS=
XMAKEFLAGS=
XSHELL=${CONFIG_SHELL-/bin/sh}
X
X# Maximum number of lines to put in a shell here document.
X# This variable seems obsolete.  It should probably be removed, and
X# only ac_max_sed_lines should be used.
X: ${ac_max_here_lines=38}
X
X# Identity of this package.
XPACKAGE_NAME=
XPACKAGE_TARNAME=
XPACKAGE_VERSION=
XPACKAGE_STRING=
XPACKAGE_BUGREPORT=
X
Xac_unique_file="usb.c"
X# Factoring default headers for most tests.
Xac_includes_default="\
X#include <stdio.h>
X#if HAVE_SYS_TYPES_H
X# include <sys/types.h>
X#endif
X#if HAVE_SYS_STAT_H
X# include <sys/stat.h>
X#endif
X#if STDC_HEADERS
X# include <stdlib.h>
X# include <stddef.h>
X#else
X# if HAVE_STDLIB_H
X#  include <stdlib.h>
X# endif
X#endif
X#if HAVE_STRING_H
X# if !STDC_HEADERS && HAVE_MEMORY_H
X#  include <memory.h>
X# endif
X# include <string.h>
X#endif
X#if HAVE_STRINGS_H
X# include <strings.h>
X#endif
X#if HAVE_INTTYPES_H
X# include <inttypes.h>
X#else
X# if HAVE_STDINT_H
X#  include <stdint.h>
X# endif
X#endif
X#if HAVE_UNISTD_H
X# include <unistd.h>
X#endif"
X
Xac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS LIBUSB_MAJOR_VERSION LIBUSB_MINOR_VERSION LIBUSB_MICRO_VERSION LIBUSB_VERSION LIBUSB_INTERFACE_AGE LIBUSB_BINARY_AGE LT_RELEASE LT_CURRENT LT_REVISION LT_AGE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT DARWIN_API LINUX_API BSD_API LINUX_API_TRUE LINUX_API_FALSE BSD_API_TRUE BSD_API_FALSE DARWIN_API_TRUE DARWIN_API_FALSE OSLIBS BIGENDIAN JADE BUILD_DOCS_TRUE BUILD_DOCS_FALSE LIBOBJS LTLIBOBJS'
Xac_subst_files=''
X
X# Initialize some variables set by options.
Xac_init_help=
Xac_init_version=false
X# The variables have the same names as the options, with
X# dashes changed to underlines.
Xcache_file=/dev/null
Xexec_prefix=NONE
Xno_create=
Xno_recursion=
Xprefix=NONE
Xprogram_prefix=NONE
Xprogram_suffix=NONE
Xprogram_transform_name=s,x,x,
Xsilent=
Xsite=
Xsrcdir=
Xverbose=
Xx_includes=NONE
Xx_libraries=NONE
X
X# Installation directory options.
X# These are left unexpanded so users can "make install exec_prefix=/foo"
X# and all the variables that are supposed to be based on exec_prefix
X# by default will actually change.
X# Use braces instead of parens because sh, perl, etc. also accept them.
Xbindir='${exec_prefix}/bin'
Xsbindir='${exec_prefix}/sbin'
Xlibexecdir='${exec_prefix}/libexec'
Xdatadir='${prefix}/share'
Xsysconfdir='${prefix}/etc'
Xsharedstatedir='${prefix}/com'
Xlocalstatedir='${prefix}/var'
Xlibdir='${exec_prefix}/lib'
Xincludedir='${prefix}/include'
Xoldincludedir='/usr/include'
Xinfodir='${prefix}/info'
Xmandir='${prefix}/man'
X
Xac_prev=
Xfor ac_option
Xdo
X  # If the previous option needs an argument, assign it.
X  if test -n "$ac_prev"; then
X    eval "$ac_prev=\$ac_option"
X    ac_prev=
X    continue
X  fi
X
X  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
X
X  # Accept the important Cygnus configure options, so we can diagnose typos.
X
X  case $ac_option in
X
X  -bindir | --bindir | --bindi | --bind | --bin | --bi)
X    ac_prev=bindir ;;
X  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
X    bindir=$ac_optarg ;;
X
X  -build | --build | --buil | --bui | --bu)
X    ac_prev=build_alias ;;
X  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
X    build_alias=$ac_optarg ;;
X
X  -cache-file | --cache-file | --cache-fil | --cache-fi \
X  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
X    ac_prev=cache_file ;;
X  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
X  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
X    cache_file=$ac_optarg ;;
X
X  --config-cache | -C)
X    cache_file=config.cache ;;
X
X  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
X    ac_prev=datadir ;;
X  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
X  | --da=*)
X    datadir=$ac_optarg ;;
X
X  -disable-* | --disable-*)
X    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
X    # Reject names that are not valid shell variable names.
X    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
X      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
X   { (exit 1); exit 1; }; }
X    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
X    eval "enable_$ac_feature=no" ;;
X
X  -enable-* | --enable-*)
X    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
X    # Reject names that are not valid shell variable names.
X    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
X      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
X   { (exit 1); exit 1; }; }
X    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
X    case $ac_option in
X      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
X      *) ac_optarg=yes ;;
X    esac
X    eval "enable_$ac_feature='$ac_optarg'" ;;
X
X  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
X  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
X  | --exec | --exe | --ex)
X    ac_prev=exec_prefix ;;
X  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
X  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
X  | --exec=* | --exe=* | --ex=*)
X    exec_prefix=$ac_optarg ;;
X
X  -gas | --gas | --ga | --g)
X    # Obsolete; use --with-gas.
X    with_gas=yes ;;
X
X  -help | --help | --hel | --he | -h)
X    ac_init_help=long ;;
X  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
X    ac_init_help=recursive ;;
X  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
X    ac_init_help=short ;;
X
X  -host | --host | --hos | --ho)
X    ac_prev=host_alias ;;
X  -host=* | --host=* | --hos=* | --ho=*)
X    host_alias=$ac_optarg ;;
X
X  -includedir | --includedir | --includedi | --included | --include \
X  | --includ | --inclu | --incl | --inc)
X    ac_prev=includedir ;;
X  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
X  | --includ=* | --inclu=* | --incl=* | --inc=*)
X    includedir=$ac_optarg ;;
X
X  -infodir | --infodir | --infodi | --infod | --info | --inf)
X    ac_prev=infodir ;;
X  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
X    infodir=$ac_optarg ;;
X
X  -libdir | --libdir | --libdi | --libd)
X    ac_prev=libdir ;;
X  -libdir=* | --libdir=* | --libdi=* | --libd=*)
X    libdir=$ac_optarg ;;
X
X  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
X  | --libexe | --libex | --libe)
X    ac_prev=libexecdir ;;
X  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
X  | --libexe=* | --libex=* | --libe=*)
X    libexecdir=$ac_optarg ;;
X
X  -localstatedir | --localstatedir | --localstatedi | --localstated \
X  | --localstate | --localstat | --localsta | --localst \
X  | --locals | --local | --loca | --loc | --lo)
X    ac_prev=localstatedir ;;
X  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
X  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
X  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
X    localstatedir=$ac_optarg ;;
X
X  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
X    ac_prev=mandir ;;
X  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
X    mandir=$ac_optarg ;;
X
X  -nfp | --nfp | --nf)
X    # Obsolete; use --without-fp.
X    with_fp=no ;;
X
X  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
X  | --no-cr | --no-c | -n)
X    no_create=yes ;;
X
X  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
X  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
X    no_recursion=yes ;;
X
X  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
X  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
X  | --oldin | --oldi | --old | --ol | --o)
X    ac_prev=oldincludedir ;;
X  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
X  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
X  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
X    oldincludedir=$ac_optarg ;;
X
X  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
X    ac_prev=prefix ;;
X  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
X    prefix=$ac_optarg ;;
X
X  -program-prefix | --program-prefix | --program-prefi | --program-pref \
X  | --program-pre | --program-pr | --program-p)
X    ac_prev=program_prefix ;;
X  -program-prefix=* | --program-prefix=* | --program-prefi=* \
X  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
X    program_prefix=$ac_optarg ;;
X
X  -program-suffix | --program-suffix | --program-suffi | --program-suff \
X  | --program-suf | --program-su | --program-s)
X    ac_prev=program_suffix ;;
X  -program-suffix=* | --program-suffix=* | --program-suffi=* \
X  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
X    program_suffix=$ac_optarg ;;
X
X  -program-transform-name | --program-transform-name \
X  | --program-transform-nam | --program-transform-na \
X  | --program-transform-n | --program-transform- \
X  | --program-transform | --program-transfor \
X  | --program-transfo | --program-transf \
X  | --program-trans | --program-tran \
X  | --progr-tra | --program-tr | --program-t)
X    ac_prev=program_transform_name ;;
X  -program-transform-name=* | --program-transform-name=* \
X  | --program-transform-nam=* | --program-transform-na=* \
X  | --program-transform-n=* | --program-transform-=* \
X  | --program-transform=* | --program-transfor=* \
X  | --program-transfo=* | --program-transf=* \
X  | --program-trans=* | --program-tran=* \
X  | --progr-tra=* | --program-tr=* | --program-t=*)
X    program_transform_name=$ac_optarg ;;
X
X  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
X  | -silent | --silent | --silen | --sile | --sil)
X    silent=yes ;;
X
X  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
X    ac_prev=sbindir ;;
X  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
X  | --sbi=* | --sb=*)
X    sbindir=$ac_optarg ;;
X
X  -sharedstatedir | --sharedstatedir | --sharedstatedi \
X  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
X  | --sharedst | --shareds | --shared | --share | --shar \
X  | --sha | --sh)
X    ac_prev=sharedstatedir ;;
X  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
X  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
X  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
X  | --sha=* | --sh=*)
X    sharedstatedir=$ac_optarg ;;
X
X  -site | --site | --sit)
X    ac_prev=site ;;
X  -site=* | --site=* | --sit=*)
X    site=$ac_optarg ;;
X
X  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
X    ac_prev=srcdir ;;
X  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
X    srcdir=$ac_optarg ;;
X
X  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
X  | --syscon | --sysco | --sysc | --sys | --sy)
X    ac_prev=sysconfdir ;;
X  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
X  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
X    sysconfdir=$ac_optarg ;;
X
X  -target | --target | --targe | --targ | --tar | --ta | --t)
X    ac_prev=target_alias ;;
X  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
X    target_alias=$ac_optarg ;;
X
X  -v | -verbose | --verbose | --verbos | --verbo | --verb)
X    verbose=yes ;;
X
X  -version | --version | --versio | --versi | --vers | -V)
X    ac_init_version=: ;;
X
X  -with-* | --with-*)
X    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
X    # Reject names that are not valid shell variable names.
X    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
X      { echo "$as_me: error: invalid package name: $ac_package" >&2
X   { (exit 1); exit 1; }; }
X    ac_package=`echo $ac_package| sed 's/-/_/g'`
X    case $ac_option in
X      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
X      *) ac_optarg=yes ;;
X    esac
X    eval "with_$ac_package='$ac_optarg'" ;;
X
X  -without-* | --without-*)
X    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
X    # Reject names that are not valid shell variable names.
X    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
X      { echo "$as_me: error: invalid package name: $ac_package" >&2
X   { (exit 1); exit 1; }; }
X    ac_package=`echo $ac_package | sed 's/-/_/g'`
X    eval "with_$ac_package=no" ;;
X
X  --x)
X    # Obsolete; use --with-x.
X    with_x=yes ;;
X
X  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
X  | --x-incl | --x-inc | --x-in | --x-i)
X    ac_prev=x_includes ;;
X  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
X  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
X    x_includes=$ac_optarg ;;
X
X  -x-libraries | --x-libraries | --x-librarie | --x-librari \
X  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
X    ac_prev=x_libraries ;;
X  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
X  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
X    x_libraries=$ac_optarg ;;
X
X  -*) { echo "$as_me: error: unrecognized option: $ac_option
XTry \`$0 --help' for more information." >&2
X   { (exit 1); exit 1; }; }
X    ;;
X
X  *=*)
X    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
X    # Reject names that are not valid shell variable names.
X    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
X      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
X   { (exit 1); exit 1; }; }
X    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
X    eval "$ac_envvar='$ac_optarg'"
X    export $ac_envvar ;;
X
X  *)
X    # FIXME: should be removed in autoconf 3.0.
X    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
X    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
X      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
X    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
X    ;;
X
X  esac
Xdone
X
Xif test -n "$ac_prev"; then
X  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
X  { echo "$as_me: error: missing argument to $ac_option" >&2
X   { (exit 1); exit 1; }; }
Xfi
X
X# Be sure to have absolute paths.
Xfor ac_var in exec_prefix prefix
Xdo
X  eval ac_val=$`echo $ac_var`
X  case $ac_val in
X    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
X    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
X   { (exit 1); exit 1; }; };;
X  esac
Xdone
X
X# Be sure to have absolute paths.
Xfor ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
X              localstatedir libdir includedir oldincludedir infodir mandir
Xdo
X  eval ac_val=$`echo $ac_var`
X  case $ac_val in
X    [\\/$]* | ?:[\\/]* ) ;;
X    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
X   { (exit 1); exit 1; }; };;
X  esac
Xdone
X
X# There might be people who depend on the old broken behavior: `$host'
X# used to hold the argument of --host etc.
X# FIXME: To remove some day.
Xbuild=$build_alias
Xhost=$host_alias
Xtarget=$target_alias
X
X# FIXME: To remove some day.
Xif test "x$host_alias" != x; then
X  if test "x$build_alias" = x; then
X    cross_compiling=maybe
X    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
X    If a cross compiler is detected then cross compile mode will be used." >&2
X  elif test "x$build_alias" != "x$host_alias"; then
X    cross_compiling=yes
X  fi
Xfi
X
Xac_tool_prefix=
Xtest -n "$host_alias" && ac_tool_prefix=$host_alias-
X
Xtest "$silent" = yes && exec 6>/dev/null
X
X
X# Find the source files, if location was not specified.
Xif test -z "$srcdir"; then
X  ac_srcdir_defaulted=yes
X  # Try the directory containing this script, then its parent.
X  ac_confdir=`(dirname "$0") 2>/dev/null ||
X$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X         X"$0" : 'X\(//\)[^/]' \| \
X         X"$0" : 'X\(//\)$' \| \
X         X"$0" : 'X\(/\)' \| \
X         .     : '\(.\)' 2>/dev/null ||
Xecho X"$0" |
X    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
X  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
X  	  /^X\(\/\/\)$/{ s//\1/; q; }
X  	  /^X\(\/\).*/{ s//\1/; q; }
X  	  s/.*/./; q'`
X  srcdir=$ac_confdir
X  if test ! -r $srcdir/$ac_unique_file; then
X    srcdir=..
X  fi
Xelse
X  ac_srcdir_defaulted=no
Xfi
Xif test ! -r $srcdir/$ac_unique_file; then
X  if test "$ac_srcdir_defaulted" = yes; then
X    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
X   { (exit 1); exit 1; }; }
X  else
X    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
X   { (exit 1); exit 1; }; }
X  fi
Xfi
X(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
X  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
X   { (exit 1); exit 1; }; }
Xsrcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
Xac_env_build_alias_set=${build_alias+set}
Xac_env_build_alias_value=$build_alias
Xac_cv_env_build_alias_set=${build_alias+set}
Xac_cv_env_build_alias_value=$build_alias
Xac_env_host_alias_set=${host_alias+set}
Xac_env_host_alias_value=$host_alias
Xac_cv_env_host_alias_set=${host_alias+set}
Xac_cv_env_host_alias_value=$host_alias
Xac_env_target_alias_set=${target_alias+set}
Xac_env_target_alias_value=$target_alias
Xac_cv_env_target_alias_set=${target_alias+set}
Xac_cv_env_target_alias_value=$target_alias
Xac_env_CC_set=${CC+set}
Xac_env_CC_value=$CC
Xac_cv_env_CC_set=${CC+set}
Xac_cv_env_CC_value=$CC
Xac_env_CFLAGS_set=${CFLAGS+set}
Xac_env_CFLAGS_value=$CFLAGS
Xac_cv_env_CFLAGS_set=${CFLAGS+set}
Xac_cv_env_CFLAGS_value=$CFLAGS
Xac_env_LDFLAGS_set=${LDFLAGS+set}
Xac_env_LDFLAGS_value=$LDFLAGS
Xac_cv_env_LDFLAGS_set=${LDFLAGS+set}
Xac_cv_env_LDFLAGS_value=$LDFLAGS
Xac_env_CPPFLAGS_set=${CPPFLAGS+set}
Xac_env_CPPFLAGS_value=$CPPFLAGS
Xac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
Xac_cv_env_CPPFLAGS_value=$CPPFLAGS
Xac_env_CPP_set=${CPP+set}
Xac_env_CPP_value=$CPP
Xac_cv_env_CPP_set=${CPP+set}
Xac_cv_env_CPP_value=$CPP
Xac_env_CXX_set=${CXX+set}
Xac_env_CXX_value=$CXX
Xac_cv_env_CXX_set=${CXX+set}
Xac_cv_env_CXX_value=$CXX
Xac_env_CXXFLAGS_set=${CXXFLAGS+set}
Xac_env_CXXFLAGS_value=$CXXFLAGS
Xac_cv_env_CXXFLAGS_set=${CXXFLAGS+set}
Xac_cv_env_CXXFLAGS_value=$CXXFLAGS
Xac_env_CXXCPP_set=${CXXCPP+set}
Xac_env_CXXCPP_value=$CXXCPP
Xac_cv_env_CXXCPP_set=${CXXCPP+set}
Xac_cv_env_CXXCPP_value=$CXXCPP
Xac_env_F77_set=${F77+set}
Xac_env_F77_value=$F77
Xac_cv_env_F77_set=${F77+set}
Xac_cv_env_F77_value=$F77
Xac_env_FFLAGS_set=${FFLAGS+set}
Xac_env_FFLAGS_value=$FFLAGS
Xac_cv_env_FFLAGS_set=${FFLAGS+set}
Xac_cv_env_FFLAGS_value=$FFLAGS
X
X#
X# Report the --help message.
X#
Xif test "$ac_init_help" = "long"; then
X  # Omit some internal or obsolete options to make the list less imposing.
X  # This message is too long to be a string in the A/UX 3.1 sh.
X  cat <<_ACEOF
X\`configure' configures this package to adapt to many kinds of systems.
X
XUsage: $0 [OPTION]... [VAR=VALUE]...
X
XTo assign environment variables (e.g., CC, CFLAGS...), specify them as
XVAR=VALUE.  See below for descriptions of some of the useful variables.
X
XDefaults for the options are specified in brackets.
X
XConfiguration:
X  -h, --help              display this help and exit
X      --help=short        display options specific to this package
X      --help=recursive    display the short help of all the included packages
X  -V, --version           display version information and exit
X  -q, --quiet, --silent   do not print \`checking...' messages
X      --cache-file=FILE   cache test results in FILE [disabled]
X  -C, --config-cache      alias for \`--cache-file=config.cache'
X  -n, --no-create         do not create output files
X      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
X
X_ACEOF
X
X  cat <<_ACEOF
XInstallation directories:
X  --prefix=PREFIX         install architecture-independent files in PREFIX
X                          [$ac_default_prefix]
X  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
X                          [PREFIX]
X
XBy default, \`make install' will install all the files in
X\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
Xan installation prefix other than \`$ac_default_prefix' using \`--prefix',
Xfor instance \`--prefix=\$HOME'.
X
XFor better control, use the options below.
X
XFine tuning of the installation directories:
X  --bindir=DIR           user executables [EPREFIX/bin]
X  --sbindir=DIR          system admin executables [EPREFIX/sbin]
X  --libexecdir=DIR       program executables [EPREFIX/libexec]
X  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
X  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
X  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
X  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
X  --libdir=DIR           object code libraries [EPREFIX/lib]
X  --includedir=DIR       C header files [PREFIX/include]
X  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
X  --infodir=DIR          info documentation [PREFIX/info]
X  --mandir=DIR           man documentation [PREFIX/man]
X_ACEOF
X
X  cat <<\_ACEOF
X
XProgram names:
X  --program-prefix=PREFIX            prepend PREFIX to installed program names
X  --program-suffix=SUFFIX            append SUFFIX to installed program names
X  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
X
XSystem types:
X  --build=BUILD     configure for building on BUILD [guessed]
X  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
X_ACEOF
Xfi
X
Xif test -n "$ac_init_help"; then
X
X  cat <<\_ACEOF
X
XOptional Features:
X  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
X  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
X  --enable-shared[=PKGS]
X                          build shared libraries [default=yes]
X  --enable-static[=PKGS]
X                          build static libraries [default=yes]
X  --enable-fast-install[=PKGS]
X                          optimize for fast installation [default=yes]
X  --disable-dependency-tracking Speeds up one-time builds
X  --enable-dependency-tracking  Do not reject slow dependency extractors
X  --disable-libtool-lock  avoid locking (might break parallel builds)
X  --enable-maintainer-mode enable make rules and dependencies not useful
X                          (and sometimes confusing) to the casual installer
X  --enable-debug=no/minimum/yes turn on debugging default=$debug_default
X  --disable-build-docs    turn off building documentation
X
XOptional Packages:
X  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
X  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
X  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
X  --with-pic              try to use only PIC/non-PIC objects [default=use
X                          both]
X  --with-tags[=TAGS]
X                          include additional configurations [automatic]
X
XSome influential environment variables:
X  CC          C compiler command
X  CFLAGS      C compiler flags
X  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
X              nonstandard directory <lib dir>
X  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
X              headers in a nonstandard directory <include dir>
X  CPP         C preprocessor
X  CXX         C++ compiler command
X  CXXFLAGS    C++ compiler flags
X  CXXCPP      C++ preprocessor
X  F77         Fortran 77 compiler command
X  FFLAGS      Fortran 77 compiler flags
X
XUse these variables to override the choices made by `configure' or to help
Xit to find libraries and programs with nonstandard names/locations.
X
X_ACEOF
Xfi
X
Xif test "$ac_init_help" = "recursive"; then
X  # If there are subdirs, report their specific --help.
X  ac_popdir=`pwd`
X  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
X    test -d $ac_dir || continue
X    ac_builddir=.
X
Xif test "$ac_dir" != .; then
X  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
X  # A "../" for each directory in $ac_dir_suffix.
X  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
Xelse
X  ac_dir_suffix= ac_top_builddir=
Xfi
X
Xcase $srcdir in
X  .)  # No --srcdir option.  We are building in place.
X    ac_srcdir=.
X    if test -z "$ac_top_builddir"; then
X       ac_top_srcdir=.
X    else
X       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
X    fi ;;
X  [\\/]* | ?:[\\/]* )  # Absolute path.
X    ac_srcdir=$srcdir$ac_dir_suffix;
X    ac_top_srcdir=$srcdir ;;
X  *) # Relative path.
X    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
X    ac_top_srcdir=$ac_top_builddir$srcdir ;;
Xesac
X# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
X# absolute.
Xac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
Xac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
Xac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
Xac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
X
X    cd $ac_dir
X    # Check for guested configure; otherwise get Cygnus style configure.
X    if test -f $ac_srcdir/configure.gnu; then
X      echo
X      $SHELL $ac_srcdir/configure.gnu  --help=recursive
X    elif test -f $ac_srcdir/configure; then
X      echo
X      $SHELL $ac_srcdir/configure  --help=recursive
X    elif test -f $ac_srcdir/configure.ac ||
X           test -f $ac_srcdir/configure.in; then
X      echo
X      $ac_configure --help
X    else
X      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
X    fi
X    cd $ac_popdir
X  done
Xfi
X
Xtest -n "$ac_init_help" && exit 0
Xif $ac_init_version; then
X  cat <<\_ACEOF
X
XCopyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
XFree Software Foundation, Inc.
XThis configure script is free software; the Free Software Foundation
Xgives unlimited permission to copy, distribute and modify it.
X_ACEOF
X  exit 0
Xfi
Xexec 5>config.log
Xcat >&5 <<_ACEOF
XThis file contains any messages produced by compilers while
Xrunning configure, to aid debugging if configure makes a mistake.
X
XIt was created by $as_me, which was
Xgenerated by GNU Autoconf 2.57.  Invocation command line was
X
X  $ $0 $@
X
X_ACEOF
X{
Xcat <<_ASUNAME
X## --------- ##
X## Platform. ##
X## --------- ##
X
Xhostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
Xuname -m = `(uname -m) 2>/dev/null || echo unknown`
Xuname -r = `(uname -r) 2>/dev/null || echo unknown`
Xuname -s = `(uname -s) 2>/dev/null || echo unknown`
Xuname -v = `(uname -v) 2>/dev/null || echo unknown`
X
X/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
X/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
X
X/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
X/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
X/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
Xhostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
X/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
X/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
X/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
X
X_ASUNAME
X
Xas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  echo "PATH: $as_dir"
Xdone
X
X} >&5
X
Xcat >&5 <<_ACEOF
X
X
X## ----------- ##
X## Core tests. ##
X## ----------- ##
X
X_ACEOF
X
X
X# Keep a trace of the command line.
X# Strip out --no-create and --no-recursion so they do not pile up.
X# Strip out --silent because we don't want to record it for future runs.
X# Also quote any args containing shell meta-characters.
X# Make two passes to allow for proper duplicate-argument suppression.
Xac_configure_args=
Xac_configure_args0=
Xac_configure_args1=
Xac_sep=
Xac_must_keep_next=false
Xfor ac_pass in 1 2
Xdo
X  for ac_arg
X  do
X    case $ac_arg in
X    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
X    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
X    | -silent | --silent | --silen | --sile | --sil)
X      continue ;;
X    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
X      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
X    esac
X    case $ac_pass in
X    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
X    2)
X      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
X      if test $ac_must_keep_next = true; then
X        ac_must_keep_next=false # Got value, back to normal.
X      else
X        case $ac_arg in
X          *=* | --config-cache | -C | -disable-* | --disable-* \
X          | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
X          | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
X          | -with-* | --with-* | -without-* | --without-* | --x)
X            case "$ac_configure_args0 " in
X              "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
X            esac
X            ;;
X          -* ) ac_must_keep_next=true ;;
X        esac
X      fi
X      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
X      # Get rid of the leading space.
X      ac_sep=" "
X      ;;
X    esac
X  done
Xdone
X$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
X$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
X
X# When interrupted or exit'd, cleanup temporary files, and complete
X# config.log.  We remove comments because anyway the quotes in there
X# would cause problems or look ugly.
X# WARNING: Be sure not to use single quotes in there, as some shells,
X# such as our DU 5.0 friend, will then `close' the trap.
Xtrap 'exit_status=$?
X  # Save into config.log some information that might help in debugging.
X  {
X    echo
X
X    cat <<\_ASBOX
X## ---------------- ##
X## Cache variables. ##
X## ---------------- ##
X_ASBOX
X    echo
X    # The following way of writing the cache mishandles newlines in values,
X{
X  (set) 2>&1 |
X    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
X    *ac_space=\ *)
X      sed -n \
X        "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
X    	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
X      ;;
X    *)
X      sed -n \
X        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
X      ;;
X    esac;
X}
X    echo
X
X    cat <<\_ASBOX
X## ----------------- ##
X## Output variables. ##
X## ----------------- ##
X_ASBOX
X    echo
X    for ac_var in $ac_subst_vars
X    do
X      eval ac_val=$`echo $ac_var`
X      echo "$ac_var='"'"'$ac_val'"'"'"
X    done | sort
X    echo
X
X    if test -n "$ac_subst_files"; then
X      cat <<\_ASBOX
X## ------------- ##
X## Output files. ##
X## ------------- ##
X_ASBOX
X      echo
X      for ac_var in $ac_subst_files
X      do
X	eval ac_val=$`echo $ac_var`
X        echo "$ac_var='"'"'$ac_val'"'"'"
X      done | sort
X      echo
X    fi
X
X    if test -s confdefs.h; then
X      cat <<\_ASBOX
X## ----------- ##
X## confdefs.h. ##
X## ----------- ##
X_ASBOX
X      echo
X      sed "/^$/d" confdefs.h | sort
X      echo
X    fi
X    test "$ac_signal" != 0 &&
X      echo "$as_me: caught signal $ac_signal"
X    echo "$as_me: exit $exit_status"
X  } >&5
X  rm -f core core.* *.core &&
X  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
X    exit $exit_status
X     ' 0
Xfor ac_signal in 1 2 13 15; do
X  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
Xdone
Xac_signal=0
X
X# confdefs.h avoids OS command line length limits that DEFS can exceed.
Xrm -rf conftest* confdefs.h
X# AIX cpp loses on an empty file, so make sure it contains at least a newline.
Xecho >confdefs.h
X
X# Predefined preprocessor variables.
X
Xcat >>confdefs.h <<_ACEOF
X#define PACKAGE_NAME "$PACKAGE_NAME"
X_ACEOF
X
X
Xcat >>confdefs.h <<_ACEOF
X#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
X_ACEOF
X
X
Xcat >>confdefs.h <<_ACEOF
X#define PACKAGE_VERSION "$PACKAGE_VERSION"
X_ACEOF
X
X
Xcat >>confdefs.h <<_ACEOF
X#define PACKAGE_STRING "$PACKAGE_STRING"
X_ACEOF
X
X
Xcat >>confdefs.h <<_ACEOF
X#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
X_ACEOF
X
X
X# Let the site file select an alternate cache file if it wants to.
X# Prefer explicitly selected file to automatically selected ones.
Xif test -z "$CONFIG_SITE"; then
X  if test "x$prefix" != xNONE; then
X    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
X  else
X    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
X  fi
Xfi
Xfor ac_site_file in $CONFIG_SITE; do
X  if test -r "$ac_site_file"; then
X    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
Xecho "$as_me: loading site script $ac_site_file" >&6;}
X    sed 's/^/| /' "$ac_site_file" >&5
X    . "$ac_site_file"
X  fi
Xdone
X
Xif test -r "$cache_file"; then
X  # Some versions of bash will fail to source /dev/null (special
X  # files actually), so we avoid doing that.
X  if test -f "$cache_file"; then
X    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
Xecho "$as_me: loading cache $cache_file" >&6;}
X    case $cache_file in
X      [\\/]* | ?:[\\/]* ) . $cache_file;;
X      *)                      . ./$cache_file;;
X    esac
X  fi
Xelse
X  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
Xecho "$as_me: creating cache $cache_file" >&6;}
X  >$cache_file
Xfi
X
X# Check that the precious variables saved in the cache have kept the same
X# value.
Xac_cache_corrupted=false
Xfor ac_var in `(set) 2>&1 |
X               sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
X  eval ac_old_set=\$ac_cv_env_${ac_var}_set
X  eval ac_new_set=\$ac_env_${ac_var}_set
X  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
X  eval ac_new_val="\$ac_env_${ac_var}_value"
X  case $ac_old_set,$ac_new_set in
X    set,)
X      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
Xecho "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
X      ac_cache_corrupted=: ;;
X    ,set)
X      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
Xecho "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
X      ac_cache_corrupted=: ;;
X    ,);;
X    *)
X      if test "x$ac_old_val" != "x$ac_new_val"; then
X        { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
Xecho "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
X        { echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
Xecho "$as_me:   former value:  $ac_old_val" >&2;}
X        { echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
Xecho "$as_me:   current value: $ac_new_val" >&2;}
X        ac_cache_corrupted=:
X      fi;;
X  esac
X  # Pass precious variables to config.status.
X  if test "$ac_new_set" = set; then
X    case $ac_new_val in
X    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
X      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
X    *) ac_arg=$ac_var=$ac_new_val ;;
X    esac
X    case " $ac_configure_args " in
X      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
X      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
X    esac
X  fi
Xdone
Xif $ac_cache_corrupted; then
X  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
Xecho "$as_me: error: changes in the environment can compromise the build" >&2;}
X  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
Xecho "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
X   { (exit 1); exit 1; }; }
Xfi
X
Xac_ext=c
Xac_cpp='$CPP $CPPFLAGS'
Xac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
Xac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
Xac_compiler_gnu=$ac_cv_c_compiler_gnu
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X# Save this value here, since automake will set cflags later
Xcflags_set=${CFLAGS+set}
X
X
X
X
X
X
X
X
X
X# libtool versioning
X# JR: Add support for MICRO_VERSION to be alpha-numeric. This will make
X# lt_current use the numeric part of MICRO_VERSION
X
XLIBUSB_MICRO_VERSION_NUM=`echo $LIBUSB_MICRO_VERSION | sed 's/[a-zA-Z]//g'`
XLT_RELEASE=$LIBUSB_MAJOR_VERSION.$LIBUSB_MINOR_VERSION
XLT_CURRENT=`expr $LIBUSB_MICRO_VERSION_NUM - $LIBUSB_INTERFACE_AGE`
XLT_REVISION=$LIBUSB_INTERFACE_AGE
XLT_AGE=`expr $LIBUSB_BINARY_AGE - $LIBUSB_INTERFACE_AGE`
X
X
X
X
X
XVERSION=$LIBUSB_VERSION
XPACKAGE=libusb
X
Xam__api_version="1.7"
Xac_aux_dir=
Xfor ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
X  if test -f $ac_dir/install-sh; then
X    ac_aux_dir=$ac_dir
X    ac_install_sh="$ac_aux_dir/install-sh -c"
X    break
X  elif test -f $ac_dir/install.sh; then
X    ac_aux_dir=$ac_dir
X    ac_install_sh="$ac_aux_dir/install.sh -c"
X    break
X  elif test -f $ac_dir/shtool; then
X    ac_aux_dir=$ac_dir
X    ac_install_sh="$ac_aux_dir/shtool install -c"
X    break
X  fi
Xdone
Xif test -z "$ac_aux_dir"; then
X  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
Xecho "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
X   { (exit 1); exit 1; }; }
Xfi
Xac_config_guess="$SHELL $ac_aux_dir/config.guess"
Xac_config_sub="$SHELL $ac_aux_dir/config.sub"
Xac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
X
X# Find a good install program.  We prefer a C program (faster),
X# so one script is as good as another.  But avoid the broken or
X# incompatible versions:
X# SysV /etc/install, /usr/sbin/install
X# SunOS /usr/etc/install
X# IRIX /sbin/install
X# AIX /bin/install
X# AmigaOS /C/install, which installs bootblocks on floppy discs
X# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
X# AFS /usr/afsws/bin/install, which mishandles nonexistent args
X# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
X# ./install, which can be erroneously created by make from ./install.sh.
Xecho "$as_me:$LINENO: checking for a BSD-compatible install" >&5
Xecho $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
Xif test -z "$INSTALL"; then
Xif test "${ac_cv_path_install+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  # Account for people who put trailing slashes in PATH elements.
Xcase $as_dir/ in
X  ./ | .// | /cC/* | \
X  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
X  /usr/ucb/* ) ;;
X  *)
X    # OSF1 and SCO ODT 3.0 have their own names for install.
X    # Don't use installbsd from OSF since it installs stuff as root
X    # by default.
X    for ac_prog in ginstall scoinst install; do
X      for ac_exec_ext in '' $ac_executable_extensions; do
X        if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
X          if test $ac_prog = install &&
X            grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
X            # AIX install.  It has an incompatible calling convention.
X            :
X          elif test $ac_prog = install &&
X            grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
X            # program-specific install script used by HP pwplus--don't use.
X            :
X          else
X            ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
X            break 3
X          fi
X        fi
X      done
X    done
X    ;;
Xesac
Xdone
X
X
Xfi
X  if test "${ac_cv_path_install+set}" = set; then
X    INSTALL=$ac_cv_path_install
X  else
X    # As a last resort, use the slow shell script.  We don't cache a
X    # path for INSTALL within a source directory, because that will
X    # break other packages using the cache if that directory is
X    # removed, or if the path is relative.
X    INSTALL=$ac_install_sh
X  fi
Xfi
Xecho "$as_me:$LINENO: result: $INSTALL" >&5
Xecho "${ECHO_T}$INSTALL" >&6
X
X# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
X# It thinks the first close brace ends the variable substitution.
Xtest -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
X
Xtest -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
X
Xtest -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
X
Xecho "$as_me:$LINENO: checking whether build environment is sane" >&5
Xecho $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
X# Just in case
Xsleep 1
Xecho timestamp > conftest.file
X# Do `set' in a subshell so we don't clobber the current shell's
X# arguments.  Must try -L first in case configure is actually a
X# symlink; some systems play weird games with the mod time of symlinks
X# (eg FreeBSD returns the mod time of the symlink's containing
X# directory).
Xif (
X   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
X   if test "$*" = "X"; then
X      # -L didn't work.
X      set X `ls -t $srcdir/configure conftest.file`
X   fi
X   rm -f conftest.file
X   if test "$*" != "X $srcdir/configure conftest.file" \
X      && test "$*" != "X conftest.file $srcdir/configure"; then
X
X      # If neither matched, then we have a broken ls.  This can happen
X      # if, for instance, CONFIG_SHELL is bash and it inherits a
X      # broken ls alias from the environment.  This has actually
X      # happened.  Such a system could not be considered "sane".
X      { { echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
Xalias in your environment" >&5
Xecho "$as_me: error: ls -t appears to fail.  Make sure there is not a broken
Xalias in your environment" >&2;}
X   { (exit 1); exit 1; }; }
X   fi
X
X   test "$2" = conftest.file
X   )
Xthen
X   # Ok.
X   :
Xelse
X   { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
XCheck your system clock" >&5
Xecho "$as_me: error: newly created file is older than distributed files!
XCheck your system clock" >&2;}
X   { (exit 1); exit 1; }; }
Xfi
Xecho "$as_me:$LINENO: result: yes" >&5
Xecho "${ECHO_T}yes" >&6
Xtest "$program_prefix" != NONE &&
X  program_transform_name="s,^,$program_prefix,;$program_transform_name"
X# Use a double $ so make ignores it.
Xtest "$program_suffix" != NONE &&
X  program_transform_name="s,\$,$program_suffix,;$program_transform_name"
X# Double any \ or $.  echo might interpret backslashes.
X# By default was `s,x,x', remove it if useless.
Xcat <<\_ACEOF >conftest.sed
Xs/[\\$]/&&/g;s/;s,x,x,$//
X_ACEOF
Xprogram_transform_name=`echo $program_transform_name | sed -f conftest.sed`
Xrm conftest.sed
X
X
X# expand $ac_aux_dir to an absolute path
Xam_aux_dir=`cd $ac_aux_dir && pwd`
X
Xtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
X# Use eval to expand $SHELL
Xif eval "$MISSING --run true"; then
X  am_missing_run="$MISSING --run "
Xelse
X  am_missing_run=
X  { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
Xecho "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
Xfi
X
Xfor ac_prog in gawk mawk nawk awk
Xdo
X  # Extract the first word of "$ac_prog", so it can be a program name with args.
Xset dummy $ac_prog; ac_word=$2
Xecho "$as_me:$LINENO: checking for $ac_word" >&5
Xecho $ECHO_N "checking for $ac_word... $ECHO_C" >&6
Xif test "${ac_cv_prog_AWK+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -n "$AWK"; then
X  ac_cv_prog_AWK="$AWK" # Let the user override the test.
Xelse
Xas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  for ac_exec_ext in '' $ac_executable_extensions; do
X  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
X    ac_cv_prog_AWK="$ac_prog"
X    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
X    break 2
X  fi
Xdone
Xdone
X
Xfi
Xfi
XAWK=$ac_cv_prog_AWK
Xif test -n "$AWK"; then
X  echo "$as_me:$LINENO: result: $AWK" >&5
Xecho "${ECHO_T}$AWK" >&6
Xelse
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X
X  test -n "$AWK" && break
Xdone
X
Xecho "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
Xecho $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
Xset dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
Xif eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  cat >conftest.make <<\_ACEOF
Xall:
X	@echo 'ac_maketemp="$(MAKE)"'
X_ACEOF
X# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
Xeval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
Xif test -n "$ac_maketemp"; then
X  eval ac_cv_prog_make_${ac_make}_set=yes
Xelse
X  eval ac_cv_prog_make_${ac_make}_set=no
Xfi
Xrm -f conftest.make
Xfi
Xif eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
X  echo "$as_me:$LINENO: result: yes" >&5
Xecho "${ECHO_T}yes" >&6
X  SET_MAKE=
Xelse
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
X  SET_MAKE="MAKE=${MAKE-make}"
Xfi
X
Xrm -rf .tst 2>/dev/null
Xmkdir .tst 2>/dev/null
Xif test -d .tst; then
X  am__leading_dot=.
Xelse
X  am__leading_dot=_
Xfi
Xrmdir .tst 2>/dev/null
X
X # test to see if srcdir already configured
Xif test "`cd $srcdir && pwd`" != "`pwd`" &&
X   test -f $srcdir/config.status; then
X  { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
Xecho "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
X   { (exit 1); exit 1; }; }
Xfi
X
X# test whether we have cygpath
Xif test -z "$CYGPATH_W"; then
X  if (cygpath --version) >/dev/null 2>/dev/null; then
X    CYGPATH_W='cygpath -w'
X  else
X    CYGPATH_W=echo
X  fi
Xfi
X
X
X# Define the identity of the package.
X PACKAGE=$PACKAGE
X VERSION=$VERSION
X
X
X# Some tools Automake needs.
X
XACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
X
X
XAUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
X
X
XAUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
X
X
XAUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
X
X
XMAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
X
X
XAMTAR=${AMTAR-"${am_missing_run}tar"}
X
Xinstall_sh=${install_sh-"$am_aux_dir/install-sh"}
X
X# Installed binaries are usually stripped using `strip' when the user
X# run `make install-strip'.  However `strip' might not be the right
X# tool to use in cross-compilation environments, therefore Automake
X# will honor the `STRIP' environment variable to overrule this program.
Xif test "$cross_compiling" != no; then
X  if test -n "$ac_tool_prefix"; then
X  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
Xset dummy ${ac_tool_prefix}strip; ac_word=$2
Xecho "$as_me:$LINENO: checking for $ac_word" >&5
Xecho $ECHO_N "checking for $ac_word... $ECHO_C" >&6
Xif test "${ac_cv_prog_STRIP+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -n "$STRIP"; then
X  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
Xelse
Xas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  for ac_exec_ext in '' $ac_executable_extensions; do
X  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
X    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
X    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
X    break 2
X  fi
Xdone
Xdone
X
Xfi
Xfi
XSTRIP=$ac_cv_prog_STRIP
Xif test -n "$STRIP"; then
X  echo "$as_me:$LINENO: result: $STRIP" >&5
Xecho "${ECHO_T}$STRIP" >&6
Xelse
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X
Xfi
Xif test -z "$ac_cv_prog_STRIP"; then
X  ac_ct_STRIP=$STRIP
X  # Extract the first word of "strip", so it can be a program name with args.
Xset dummy strip; ac_word=$2
Xecho "$as_me:$LINENO: checking for $ac_word" >&5
Xecho $ECHO_N "checking for $ac_word... $ECHO_C" >&6
Xif test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -n "$ac_ct_STRIP"; then
X  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
Xelse
Xas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  for ac_exec_ext in '' $ac_executable_extensions; do
X  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
X    ac_cv_prog_ac_ct_STRIP="strip"
X    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
X    break 2
X  fi
Xdone
Xdone
X
X  test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
Xfi
Xfi
Xac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
Xif test -n "$ac_ct_STRIP"; then
X  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
Xecho "${ECHO_T}$ac_ct_STRIP" >&6
Xelse
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X
X  STRIP=$ac_ct_STRIP
Xelse
X  STRIP="$ac_cv_prog_STRIP"
Xfi
X
Xfi
XINSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
X
X# We need awk for the "check" target.  The system "awk" is bad on
X# some platforms.
X
X
X
X
X# Specify a configuration file
X          ac_config_headers="$ac_config_headers config.h"
X
X
Xcat >>confdefs.h <<_ACEOF
X#define LIBUSB_MAJOR_VERSION $LIBUSB_MAJOR_VERSION
X_ACEOF
X
Xcat >>confdefs.h <<_ACEOF
X#define LIBUSB_MINOR_VERSION $LIBUSB_MINOR_VERSION
X_ACEOF
X
Xcat >>confdefs.h <<_ACEOF
X#define LIBUSB_MICRO_VERSION $LIBUSB_MICRO_VERSION
X_ACEOF
X
Xcat >>confdefs.h <<_ACEOF
X#define LIBUSB_INTERFACE_AGE $LIBUSB_INTERFACE_AGE
X_ACEOF
X
Xcat >>confdefs.h <<_ACEOF
X#define LIBUSB_BINARY_AGE $LIBUSB_BINARY_AGE
X_ACEOF
X
X
X# Check whether --enable-shared or --disable-shared was given.
Xif test "${enable_shared+set}" = set; then
X  enableval="$enable_shared"
X  p=${PACKAGE-default}
X    case $enableval in
X    yes) enable_shared=yes ;;
X    no) enable_shared=no ;;
X    *)
X      enable_shared=no
X      # Look at the argument we got.  We use all the common list separators.
X      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
X      for pkg in $enableval; do
X	IFS="$lt_save_ifs"
X	if test "X$pkg" = "X$p"; then
X	  enable_shared=yes
X	fi
X      done
X      IFS="$lt_save_ifs"
X      ;;
X    esac
Xelse
X  enable_shared=yes
Xfi;
X
X# Check whether --enable-static or --disable-static was given.
Xif test "${enable_static+set}" = set; then
X  enableval="$enable_static"
X  p=${PACKAGE-default}
X    case $enableval in
X    yes) enable_static=yes ;;
X    no) enable_static=no ;;
X    *)
X     enable_static=no
X      # Look at the argument we got.  We use all the common list separators.
X      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
X      for pkg in $enableval; do
X	IFS="$lt_save_ifs"
X	if test "X$pkg" = "X$p"; then
X	  enable_static=yes
X	fi
X      done
X      IFS="$lt_save_ifs"
X      ;;
X    esac
Xelse
X  enable_static=yes
Xfi;
X
X# Check whether --enable-fast-install or --disable-fast-install was given.
Xif test "${enable_fast_install+set}" = set; then
X  enableval="$enable_fast_install"
X  p=${PACKAGE-default}
X    case $enableval in
X    yes) enable_fast_install=yes ;;
X    no) enable_fast_install=no ;;
X    *)
X      enable_fast_install=no
X      # Look at the argument we got.  We use all the common list separators.
X      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
X      for pkg in $enableval; do
X	IFS="$lt_save_ifs"
X	if test "X$pkg" = "X$p"; then
X	  enable_fast_install=yes
X	fi
X      done
X      IFS="$lt_save_ifs"
X      ;;
X    esac
Xelse
X  enable_fast_install=yes
Xfi;
X
X# Make sure we can run config.sub.
X$ac_config_sub sun4 >/dev/null 2>&1 ||
X  { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
Xecho "$as_me: error: cannot run $ac_config_sub" >&2;}
X   { (exit 1); exit 1; }; }
X
Xecho "$as_me:$LINENO: checking build system type" >&5
Xecho $ECHO_N "checking build system type... $ECHO_C" >&6
Xif test "${ac_cv_build+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  ac_cv_build_alias=$build_alias
Xtest -z "$ac_cv_build_alias" &&
X  ac_cv_build_alias=`$ac_config_guess`
Xtest -z "$ac_cv_build_alias" &&
X  { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
Xecho "$as_me: error: cannot guess build type; you must specify one" >&2;}
X   { (exit 1); exit 1; }; }
Xac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
X  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
Xecho "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
X   { (exit 1); exit 1; }; }
X
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_build" >&5
Xecho "${ECHO_T}$ac_cv_build" >&6
Xbuild=$ac_cv_build
Xbuild_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
Xbuild_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
Xbuild_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
X
X
Xecho "$as_me:$LINENO: checking host system type" >&5
Xecho $ECHO_N "checking host system type... $ECHO_C" >&6
Xif test "${ac_cv_host+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  ac_cv_host_alias=$host_alias
Xtest -z "$ac_cv_host_alias" &&
X  ac_cv_host_alias=$ac_cv_build_alias
Xac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
X  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
Xecho "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
X   { (exit 1); exit 1; }; }
X
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_host" >&5
Xecho "${ECHO_T}$ac_cv_host" >&6
Xhost=$ac_cv_host
Xhost_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
Xhost_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
Xhost_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
X
X
XDEPDIR="${am__leading_dot}deps"
X
X          ac_config_commands="$ac_config_commands depfiles"
X
X
Xam_make=${MAKE-make}
Xcat > confinc << 'END'
Xam__doit:
X	@echo done
X.PHONY: am__doit
XEND
X# If we don't find an include directive, just comment out the code.
Xecho "$as_me:$LINENO: checking for style of include used by $am_make" >&5
Xecho $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
Xam__include="#"
Xam__quote=
X_am_result=none
X# First try GNU make style include.
Xecho "include confinc" > confmf
X# We grep out `Entering directory' and `Leaving directory'
X# messages which can occur if `w' ends up in MAKEFLAGS.
X# In particular we don't look at `^make:' because GNU make might
X# be invoked under some other name (usually "gmake"), in which
X# case it prints its new name instead of `make'.
Xif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
X   am__include=include
X   am__quote=
X   _am_result=GNU
Xfi
X# Now try BSD make style include.
Xif test "$am__include" = "#"; then
X   echo '.include "confinc"' > confmf
X   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
X      am__include=.include
X      am__quote="\""
X      _am_result=BSD
X   fi
Xfi
X
X
Xecho "$as_me:$LINENO: result: $_am_result" >&5
Xecho "${ECHO_T}$_am_result" >&6
Xrm -f confinc confmf
X
X# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
Xif test "${enable_dependency_tracking+set}" = set; then
X  enableval="$enable_dependency_tracking"
X
Xfi;
Xif test "x$enable_dependency_tracking" != xno; then
X  am_depcomp="$ac_aux_dir/depcomp"
X  AMDEPBACKSLASH='\'
Xfi
X
X
Xif test "x$enable_dependency_tracking" != xno; then
X  AMDEP_TRUE=
X  AMDEP_FALSE='#'
Xelse
X  AMDEP_TRUE='#'
X  AMDEP_FALSE=
Xfi
X
X
X
Xac_ext=c
Xac_cpp='$CPP $CPPFLAGS'
Xac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
Xac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
Xac_compiler_gnu=$ac_cv_c_compiler_gnu
Xif test -n "$ac_tool_prefix"; then
X  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
Xset dummy ${ac_tool_prefix}gcc; ac_word=$2
Xecho "$as_me:$LINENO: checking for $ac_word" >&5
Xecho $ECHO_N "checking for $ac_word... $ECHO_C" >&6
Xif test "${ac_cv_prog_CC+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -n "$CC"; then
X  ac_cv_prog_CC="$CC" # Let the user override the test.
Xelse
Xas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  for ac_exec_ext in '' $ac_executable_extensions; do
X  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
X    ac_cv_prog_CC="${ac_tool_prefix}gcc"
X    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
X    break 2
X  fi
Xdone
Xdone
X
Xfi
Xfi
XCC=$ac_cv_prog_CC
Xif test -n "$CC"; then
X  echo "$as_me:$LINENO: result: $CC" >&5
Xecho "${ECHO_T}$CC" >&6
Xelse
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X
Xfi
Xif test -z "$ac_cv_prog_CC"; then
X  ac_ct_CC=$CC
X  # Extract the first word of "gcc", so it can be a program name with args.
Xset dummy gcc; ac_word=$2
Xecho "$as_me:$LINENO: checking for $ac_word" >&5
Xecho $ECHO_N "checking for $ac_word... $ECHO_C" >&6
Xif test "${ac_cv_prog_ac_ct_CC+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -n "$ac_ct_CC"; then
X  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
Xelse
Xas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  for ac_exec_ext in '' $ac_executable_extensions; do
X  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
X    ac_cv_prog_ac_ct_CC="gcc"
X    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
X    break 2
X  fi
Xdone
Xdone
X
Xfi
Xfi
Xac_ct_CC=$ac_cv_prog_ac_ct_CC
Xif test -n "$ac_ct_CC"; then
X  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
Xecho "${ECHO_T}$ac_ct_CC" >&6
Xelse
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X
X  CC=$ac_ct_CC
Xelse
X  CC="$ac_cv_prog_CC"
Xfi
X
Xif test -z "$CC"; then
X  if test -n "$ac_tool_prefix"; then
X  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
Xset dummy ${ac_tool_prefix}cc; ac_word=$2
Xecho "$as_me:$LINENO: checking for $ac_word" >&5
Xecho $ECHO_N "checking for $ac_word... $ECHO_C" >&6
Xif test "${ac_cv_prog_CC+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -n "$CC"; then
X  ac_cv_prog_CC="$CC" # Let the user override the test.
Xelse
Xas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  for ac_exec_ext in '' $ac_executable_extensions; do
X  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
X    ac_cv_prog_CC="${ac_tool_prefix}cc"
X    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
X    break 2
X  fi
Xdone
Xdone
X
Xfi
Xfi
XCC=$ac_cv_prog_CC
Xif test -n "$CC"; then
X  echo "$as_me:$LINENO: result: $CC" >&5
Xecho "${ECHO_T}$CC" >&6
Xelse
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X
Xfi
Xif test -z "$ac_cv_prog_CC"; then
X  ac_ct_CC=$CC
X  # Extract the first word of "cc", so it can be a program name with args.
Xset dummy cc; ac_word=$2
Xecho "$as_me:$LINENO: checking for $ac_word" >&5
Xecho $ECHO_N "checking for $ac_word... $ECHO_C" >&6
Xif test "${ac_cv_prog_ac_ct_CC+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -n "$ac_ct_CC"; then
X  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
Xelse
Xas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  for ac_exec_ext in '' $ac_executable_extensions; do
X  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
X    ac_cv_prog_ac_ct_CC="cc"
X    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
X    break 2
X  fi
Xdone
Xdone
X
Xfi
Xfi
Xac_ct_CC=$ac_cv_prog_ac_ct_CC
Xif test -n "$ac_ct_CC"; then
X  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
Xecho "${ECHO_T}$ac_ct_CC" >&6
Xelse
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X
X  CC=$ac_ct_CC
Xelse
X  CC="$ac_cv_prog_CC"
Xfi
X
Xfi
Xif test -z "$CC"; then
X  # Extract the first word of "cc", so it can be a program name with args.
Xset dummy cc; ac_word=$2
Xecho "$as_me:$LINENO: checking for $ac_word" >&5
Xecho $ECHO_N "checking for $ac_word... $ECHO_C" >&6
Xif test "${ac_cv_prog_CC+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -n "$CC"; then
X  ac_cv_prog_CC="$CC" # Let the user override the test.
Xelse
X  ac_prog_rejected=no
Xas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  for ac_exec_ext in '' $ac_executable_extensions; do
X  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
X    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
X       ac_prog_rejected=yes
X       continue
X     fi
X    ac_cv_prog_CC="cc"
X    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
X    break 2
X  fi
Xdone
Xdone
X
Xif test $ac_prog_rejected = yes; then
X  # We found a bogon in the path, so make sure we never use it.
X  set dummy $ac_cv_prog_CC
X  shift
X  if test $# != 0; then
X    # We chose a different compiler from the bogus one.
X    # However, it has the same basename, so the bogon will be chosen
X    # first if we set CC to just the basename; use the full file name.
X    shift
X    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
X  fi
Xfi
Xfi
Xfi
XCC=$ac_cv_prog_CC
Xif test -n "$CC"; then
X  echo "$as_me:$LINENO: result: $CC" >&5
Xecho "${ECHO_T}$CC" >&6
Xelse
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X
Xfi
Xif test -z "$CC"; then
X  if test -n "$ac_tool_prefix"; then
X  for ac_prog in cl
X  do
X    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
Xset dummy $ac_tool_prefix$ac_prog; ac_word=$2
Xecho "$as_me:$LINENO: checking for $ac_word" >&5
Xecho $ECHO_N "checking for $ac_word... $ECHO_C" >&6
Xif test "${ac_cv_prog_CC+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -n "$CC"; then
X  ac_cv_prog_CC="$CC" # Let the user override the test.
Xelse
Xas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  for ac_exec_ext in '' $ac_executable_extensions; do
X  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
X    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
X    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
X    break 2
X  fi
Xdone
Xdone
X
Xfi
Xfi
XCC=$ac_cv_prog_CC
Xif test -n "$CC"; then
X  echo "$as_me:$LINENO: result: $CC" >&5
Xecho "${ECHO_T}$CC" >&6
Xelse
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X
X    test -n "$CC" && break
X  done
Xfi
Xif test -z "$CC"; then
X  ac_ct_CC=$CC
X  for ac_prog in cl
Xdo
X  # Extract the first word of "$ac_prog", so it can be a program name with args.
Xset dummy $ac_prog; ac_word=$2
Xecho "$as_me:$LINENO: checking for $ac_word" >&5
Xecho $ECHO_N "checking for $ac_word... $ECHO_C" >&6
Xif test "${ac_cv_prog_ac_ct_CC+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -n "$ac_ct_CC"; then
X  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
Xelse
Xas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  for ac_exec_ext in '' $ac_executable_extensions; do
X  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
X    ac_cv_prog_ac_ct_CC="$ac_prog"
X    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
X    break 2
X  fi
Xdone
Xdone
X
Xfi
Xfi
Xac_ct_CC=$ac_cv_prog_ac_ct_CC
Xif test -n "$ac_ct_CC"; then
X  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
Xecho "${ECHO_T}$ac_ct_CC" >&6
Xelse
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X
X  test -n "$ac_ct_CC" && break
Xdone
X
X  CC=$ac_ct_CC
Xfi
X
Xfi
X
X
Xtest -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
XSee \`config.log' for more details." >&5
Xecho "$as_me: error: no acceptable C compiler found in \$PATH
XSee \`config.log' for more details." >&2;}
X   { (exit 1); exit 1; }; }
X
X# Provide some information about the compiler.
Xecho "$as_me:$LINENO:" \
X     "checking for C compiler version" >&5
Xac_compiler=`set X $ac_compile; echo $2`
X{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
X  (eval $ac_compiler --version </dev/null >&5) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }
X{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
X  (eval $ac_compiler -v </dev/null >&5) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }
X{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
X  (eval $ac_compiler -V </dev/null >&5) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }
X
Xcat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X
Xint
Xmain ()
X{
X
X  ;
X  return 0;
X}
X_ACEOF
Xac_clean_files_save=$ac_clean_files
Xac_clean_files="$ac_clean_files a.out a.exe b.out"
X# Try to create an executable without -o first, disregard a.out.
X# It will help us diagnose broken compilers, and finding out an intuition
X# of exeext.
Xecho "$as_me:$LINENO: checking for C compiler default output" >&5
Xecho $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
Xac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
Xif { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
X  (eval $ac_link_default) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; then
X  # Find the output, starting from the most likely.  This scheme is
X# not robust to junk in `.', hence go to wildcards (a.*) only as a last
X# resort.
X
X# Be careful to initialize this variable, since it used to be cached.
X# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
Xac_cv_exeext=
X# b.out is created by i960 compilers.
Xfor ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
Xdo
X  test -f "$ac_file" || continue
X  case $ac_file in
X    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
X        ;;
X    conftest.$ac_ext )
X        # This is the source file.
X        ;;
X    [ab].out )
X        # We found the default executable, but exeext='' is most
X        # certainly right.
X        break;;
X    *.* )
X        ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
X        # FIXME: I believe we export ac_cv_exeext for Libtool,
X        # but it would be cool to find out if it's true.  Does anybody
X        # maintain Libtool? --akim.
X        export ac_cv_exeext
X        break;;
X    * )
X        break;;
X  esac
Xdone
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
X{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
XSee \`config.log' for more details." >&5
Xecho "$as_me: error: C compiler cannot create executables
XSee \`config.log' for more details." >&2;}
X   { (exit 77); exit 77; }; }
Xfi
X
Xac_exeext=$ac_cv_exeext
Xecho "$as_me:$LINENO: result: $ac_file" >&5
Xecho "${ECHO_T}$ac_file" >&6
X
X# Check the compiler produces executables we can run.  If not, either
X# the compiler is broken, or we cross compile.
Xecho "$as_me:$LINENO: checking whether the C compiler works" >&5
Xecho $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
X# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
X# If not cross compiling, check that we can run a simple program.
Xif test "$cross_compiling" != yes; then
X  if { ac_try='./$ac_file'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X    cross_compiling=no
X  else
X    if test "$cross_compiling" = maybe; then
X	cross_compiling=yes
X    else
X	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
XIf you meant to cross compile, use \`--host'.
XSee \`config.log' for more details." >&5
Xecho "$as_me: error: cannot run C compiled programs.
XIf you meant to cross compile, use \`--host'.
XSee \`config.log' for more details." >&2;}
X   { (exit 1); exit 1; }; }
X    fi
X  fi
Xfi
Xecho "$as_me:$LINENO: result: yes" >&5
Xecho "${ECHO_T}yes" >&6
X
Xrm -f a.out a.exe conftest$ac_cv_exeext b.out
Xac_clean_files=$ac_clean_files_save
X# Check the compiler produces executables we can run.  If not, either
X# the compiler is broken, or we cross compile.
Xecho "$as_me:$LINENO: checking whether we are cross compiling" >&5
Xecho $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
Xecho "$as_me:$LINENO: result: $cross_compiling" >&5
Xecho "${ECHO_T}$cross_compiling" >&6
X
Xecho "$as_me:$LINENO: checking for suffix of executables" >&5
Xecho $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; then
X  # If both `conftest.exe' and `conftest' are `present' (well, observable)
X# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
X# work properly (i.e., refer to `conftest.exe'), while it won't with
X# `rm'.
Xfor ac_file in conftest.exe conftest conftest.*; do
X  test -f "$ac_file" || continue
X  case $ac_file in
X    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
X    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
X          export ac_cv_exeext
X          break;;
X    * ) break;;
X  esac
Xdone
Xelse
X  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
XSee \`config.log' for more details." >&5
Xecho "$as_me: error: cannot compute suffix of executables: cannot compile and link
XSee \`config.log' for more details." >&2;}
X   { (exit 1); exit 1; }; }
Xfi
X
Xrm -f conftest$ac_cv_exeext
Xecho "$as_me:$LINENO: result: $ac_cv_exeext" >&5
Xecho "${ECHO_T}$ac_cv_exeext" >&6
X
Xrm -f conftest.$ac_ext
XEXEEXT=$ac_cv_exeext
Xac_exeext=$EXEEXT
Xecho "$as_me:$LINENO: checking for suffix of object files" >&5
Xecho $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
Xif test "${ac_cv_objext+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X
Xint
Xmain ()
X{
X
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.o conftest.obj
Xif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; then
X  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
X  case $ac_file in
X    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
X    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
X       break;;
X  esac
Xdone
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
X{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
XSee \`config.log' for more details." >&5
Xecho "$as_me: error: cannot compute suffix of object files: cannot compile
XSee \`config.log' for more details." >&2;}
X   { (exit 1); exit 1; }; }
Xfi
X
Xrm -f conftest.$ac_cv_objext conftest.$ac_ext
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_objext" >&5
Xecho "${ECHO_T}$ac_cv_objext" >&6
XOBJEXT=$ac_cv_objext
Xac_objext=$OBJEXT
Xecho "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
Xecho $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
Xif test "${ac_cv_c_compiler_gnu+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X
Xint
Xmain ()
X{
X#ifndef __GNUC__
X       choke me
X#endif
X
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext
Xif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest.$ac_objext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_compiler_gnu=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_compiler_gnu=no
Xfi
Xrm -f conftest.$ac_objext conftest.$ac_ext
Xac_cv_c_compiler_gnu=$ac_compiler_gnu
X
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
Xecho "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
XGCC=`test $ac_compiler_gnu = yes && echo yes`
Xac_test_CFLAGS=${CFLAGS+set}
Xac_save_CFLAGS=$CFLAGS
XCFLAGS="-g"
Xecho "$as_me:$LINENO: checking whether $CC accepts -g" >&5
Xecho $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
Xif test "${ac_cv_prog_cc_g+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X
Xint
Xmain ()
X{
X
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext
Xif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest.$ac_objext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_cv_prog_cc_g=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_cv_prog_cc_g=no
Xfi
Xrm -f conftest.$ac_objext conftest.$ac_ext
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
Xecho "${ECHO_T}$ac_cv_prog_cc_g" >&6
Xif test "$ac_test_CFLAGS" = set; then
X  CFLAGS=$ac_save_CFLAGS
Xelif test $ac_cv_prog_cc_g = yes; then
X  if test "$GCC" = yes; then
X    CFLAGS="-g -O2"
X  else
X    CFLAGS="-g"
X  fi
Xelse
X  if test "$GCC" = yes; then
X    CFLAGS="-O2"
X  else
X    CFLAGS=
X  fi
Xfi
Xecho "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
Xecho $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
Xif test "${ac_cv_prog_cc_stdc+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  ac_cv_prog_cc_stdc=no
Xac_save_CC=$CC
Xcat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X#include <stdarg.h>
X#include <stdio.h>
X#include <sys/types.h>
X#include <sys/stat.h>
X/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
Xstruct buf { int x; };
XFILE * (*rcsopen) (struct buf *, struct stat *, int);
Xstatic char *e (p, i)
X     char **p;
X     int i;
X{
X  return p[i];
X}
Xstatic char *f (char * (*g) (char **, int), char **p, ...)
X{
X  char *s;
X  va_list v;
X  va_start (v,p);
X  s = g (p, va_arg (v,int));
X  va_end (v);
X  return s;
X}
Xint test (int i, double x);
Xstruct s1 {int (*f) (int a);};
Xstruct s2 {int (*f) (double a);};
Xint pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
Xint argc;
Xchar **argv;
Xint
Xmain ()
X{
Xreturn f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
X  ;
X  return 0;
X}
X_ACEOF
X# Don't try gcc -ansi; that turns off useful extensions and
X# breaks some systems' header files.
X# AIX			-qlanglvl=ansi
X# Ultrix and OSF/1	-std1
X# HP-UX 10.20 and later	-Ae
X# HP-UX older versions	-Aa -D_HPUX_SOURCE
X# SVR4			-Xc -D__EXTENSIONS__
Xfor ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
Xdo
X  CC="$ac_save_CC $ac_arg"
X  rm -f conftest.$ac_objext
Xif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest.$ac_objext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_cv_prog_cc_stdc=$ac_arg
Xbreak
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xfi
Xrm -f conftest.$ac_objext
Xdone
Xrm -f conftest.$ac_ext conftest.$ac_objext
XCC=$ac_save_CC
X
Xfi
X
Xcase "x$ac_cv_prog_cc_stdc" in
X  x|xno)
X    echo "$as_me:$LINENO: result: none needed" >&5
Xecho "${ECHO_T}none needed" >&6 ;;
X  *)
X    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
Xecho "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
X    CC="$CC $ac_cv_prog_cc_stdc" ;;
Xesac
X
X# Some people use a C++ compiler to compile C.  Since we use `exit',
X# in C++ we need to declare it.  In case someone uses the same compiler
X# for both compiling C and C++ we need to have the C++ compiler decide
X# the declaration of exit, since it's the most demanding environment.
Xcat >conftest.$ac_ext <<_ACEOF
X#ifndef __cplusplus
X  choke me
X#endif
X_ACEOF
Xrm -f conftest.$ac_objext
Xif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest.$ac_objext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  for ac_declaration in \
X   ''\
X   '#include <stdlib.h>' \
X   'extern "C" void std::exit (int) throw (); using std::exit;' \
X   'extern "C" void std::exit (int); using std::exit;' \
X   'extern "C" void exit (int) throw ();' \
X   'extern "C" void exit (int);' \
X   'void exit (int);'
Xdo
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X#include <stdlib.h>
X$ac_declaration
Xint
Xmain ()
X{
Xexit (42);
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext
Xif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest.$ac_objext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  :
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xcontinue
Xfi
Xrm -f conftest.$ac_objext conftest.$ac_ext
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X$ac_declaration
Xint
Xmain ()
X{
Xexit (42);
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext
Xif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest.$ac_objext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  break
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xfi
Xrm -f conftest.$ac_objext conftest.$ac_ext
Xdone
Xrm -f conftest*
Xif test -n "$ac_declaration"; then
X  echo '#ifdef __cplusplus' >>confdefs.h
X  echo $ac_declaration      >>confdefs.h
X  echo '#endif'             >>confdefs.h
Xfi
X
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xfi
Xrm -f conftest.$ac_objext conftest.$ac_ext
Xac_ext=c
Xac_cpp='$CPP $CPPFLAGS'
Xac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
Xac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
Xac_compiler_gnu=$ac_cv_c_compiler_gnu
X
Xdepcc="$CC"   am_compiler_list=
X
Xecho "$as_me:$LINENO: checking dependency style of $depcc" >&5
Xecho $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
Xif test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
X  # We make a subdir and do the tests there.  Otherwise we can end up
X  # making bogus files that we don't know about and never remove.  For
X  # instance it was reported that on HP-UX the gcc test will end up
X  # making a dummy file named `D' -- because `-MD' means `put the output
X  # in D'.
X  mkdir conftest.dir
X  # Copy depcomp to subdir because otherwise we won't find it if we're
X  # using a relative directory.
X  cp "$am_depcomp" conftest.dir
X  cd conftest.dir
X  # We will build objects and dependencies in a subdirectory because
X  # it helps to detect inapplicable dependency modes.  For instance
X  # both Tru64's cc and ICC support -MD to output dependencies as a
X  # side effect of compilation, but ICC will put the dependencies in
X  # the current directory while Tru64 will put them in the object
X  # directory.
X  mkdir sub
X
X  am_cv_CC_dependencies_compiler_type=none
X  if test "$am_compiler_list" = ""; then
X     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
X  fi
X  for depmode in $am_compiler_list; do
X    # Setup a source with many dependencies, because some compilers
X    # like to wrap large dependency lists on column 80 (with \), and
X    # we should not choose a depcomp mode which is confused by this.
X    #
X    # We need to recreate these files for each test, as the compiler may
X    # overwrite some of them when testing with obscure command lines.
X    # This happens at least with the AIX C compiler.
X    : > sub/conftest.c
X    for i in 1 2 3 4 5 6; do
X      echo '#include "conftst'$i'.h"' >> sub/conftest.c
X      : > sub/conftst$i.h
X    done
X    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
X
X    case $depmode in
X    nosideeffect)
X      # after this tag, mechanisms are not by side-effect, so they'll
X      # only be used when explicitly requested
X      if test "x$enable_dependency_tracking" = xyes; then
X	continue
X      else
X	break
X      fi
X      ;;
X    none) break ;;
X    esac
X    # We check with `-c' and `-o' for the sake of the "dashmstdout"
X    # mode.  It turns out that the SunPro C++ compiler does not properly
X    # handle `-M -o', and we need to detect this.
X    if depmode=$depmode \
X       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
X       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
X       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
X         >/dev/null 2>conftest.err &&
X       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
X       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
X       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
X      # icc doesn't choke on unknown options, it will just issue warnings
X      # (even with -Werror).  So we grep stderr for any message
X      # that says an option was ignored.
X      if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
X        am_cv_CC_dependencies_compiler_type=$depmode
X        break
X      fi
X    fi
X  done
X
X  cd ..
X  rm -rf conftest.dir
Xelse
X  am_cv_CC_dependencies_compiler_type=none
Xfi
X
Xfi
Xecho "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
Xecho "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
XCCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
X
X
X
Xif
X  test "x$enable_dependency_tracking" != xno \
X  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
X  am__fastdepCC_TRUE=
X  am__fastdepCC_FALSE='#'
Xelse
X  am__fastdepCC_TRUE='#'
X  am__fastdepCC_FALSE=
Xfi
X
X
Xecho "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
Xecho $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6
Xif test "${lt_cv_path_SED+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  # Loop through the user's path and test for sed and gsed.
X# Then use that list of sed's as ones to test for truncation.
Xas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  for lt_ac_prog in sed gsed; do
X    for ac_exec_ext in '' $ac_executable_extensions; do
X      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
X        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
X      fi
X    done
X  done
Xdone
Xlt_ac_max=0
Xlt_ac_count=0
X# Add /usr/xpg4/bin/sed as it is typically found on Solaris
X# along with /bin/sed that truncates output.
Xfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
X  test ! -f $lt_ac_sed && break
X  cat /dev/null > conftest.in
X  lt_ac_count=0
X  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
X  # Check for GNU sed and select it if it is found.
X  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
X    lt_cv_path_SED=$lt_ac_sed
X    break
X  fi
X  while true; do
X    cat conftest.in conftest.in >conftest.tmp
X    mv conftest.tmp conftest.in
X    cp conftest.in conftest.nl
X    echo >>conftest.nl
X    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
X    cmp -s conftest.out conftest.nl || break
X    # 10000 chars as input seems more than enough
X    test $lt_ac_count -gt 10 && break
X    lt_ac_count=`expr $lt_ac_count + 1`
X    if test $lt_ac_count -gt $lt_ac_max; then
X      lt_ac_max=$lt_ac_count
X      lt_cv_path_SED=$lt_ac_sed
X    fi
X  done
Xdone
XSED=$lt_cv_path_SED
X
Xfi
X
Xecho "$as_me:$LINENO: result: $SED" >&5
Xecho "${ECHO_T}$SED" >&6
X
Xecho "$as_me:$LINENO: checking for egrep" >&5
Xecho $ECHO_N "checking for egrep... $ECHO_C" >&6
Xif test "${ac_cv_prog_egrep+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
X    then ac_cv_prog_egrep='grep -E'
X    else ac_cv_prog_egrep='egrep'
X    fi
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
Xecho "${ECHO_T}$ac_cv_prog_egrep" >&6
X EGREP=$ac_cv_prog_egrep
X
X
X
X# Check whether --with-gnu-ld or --without-gnu-ld was given.
Xif test "${with_gnu_ld+set}" = set; then
X  withval="$with_gnu_ld"
X  test "$withval" = no || with_gnu_ld=yes
Xelse
X  with_gnu_ld=no
Xfi;
Xac_prog=ld
Xif test "$GCC" = yes; then
X  # Check if gcc -print-prog-name=ld gives a path.
X  echo "$as_me:$LINENO: checking for ld used by $CC" >&5
Xecho $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6
X  case $host in
X  *-*-mingw*)
X    # gcc leaves a trailing carriage return which upsets mingw
X    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
X  *)
X    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
X  esac
X  case $ac_prog in
X    # Accept absolute paths.
X    [\\/]* | ?:[\\/]*)
X      re_direlt='/[^/][^/]*/\.\./'
X      # Canonicalize the path of ld
X      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
X      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
X	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
X      done
X      test -z "$LD" && LD="$ac_prog"
X      ;;
X  "")
X    # If it fails, then pretend we aren't using GCC.
X    ac_prog=ld
X    ;;
X  *)
X    # If it is relative, then search for the first ld in PATH.
X    with_gnu_ld=unknown
X    ;;
X  esac
Xelif test "$with_gnu_ld" = yes; then
X  echo "$as_me:$LINENO: checking for GNU ld" >&5
Xecho $ECHO_N "checking for GNU ld... $ECHO_C" >&6
Xelse
X  echo "$as_me:$LINENO: checking for non-GNU ld" >&5
Xecho $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
Xfi
Xif test "${lt_cv_path_LD+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -z "$LD"; then
X  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
X  for ac_dir in $PATH; do
X    IFS="$lt_save_ifs"
X    test -z "$ac_dir" && ac_dir=.
X    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
X      lt_cv_path_LD="$ac_dir/$ac_prog"
X      # Check to see if the program is GNU ld.  I'd rather use --version,
X      # but apparently some GNU ld's only accept -v.
X      # Break only if it was the GNU/non-GNU ld that we prefer.
X      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
X      *GNU* | *'with BFD'*)
X	test "$with_gnu_ld" != no && break
X	;;
X      *)
X	test "$with_gnu_ld" != yes && break
X	;;
X      esac
X    fi
X  done
X  IFS="$lt_save_ifs"
Xelse
X  lt_cv_path_LD="$LD" # Let the user override the test with a path.
Xfi
Xfi
X
XLD="$lt_cv_path_LD"
Xif test -n "$LD"; then
X  echo "$as_me:$LINENO: result: $LD" >&5
Xecho "${ECHO_T}$LD" >&6
Xelse
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
Xtest -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
Xecho "$as_me: error: no acceptable ld found in \$PATH" >&2;}
X   { (exit 1); exit 1; }; }
Xecho "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
Xecho $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
Xif test "${lt_cv_prog_gnu_ld+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
Xcase `$LD -v 2>&1 </dev/null` in
X*GNU* | *'with BFD'*)
X  lt_cv_prog_gnu_ld=yes
X  ;;
X*)
X  lt_cv_prog_gnu_ld=no
X  ;;
Xesac
Xfi
Xecho "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
Xecho "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
Xwith_gnu_ld=$lt_cv_prog_gnu_ld
X
X
Xecho "$as_me:$LINENO: checking for $LD option to reload object files" >&5
Xecho $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6
Xif test "${lt_cv_ld_reload_flag+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  lt_cv_ld_reload_flag='-r'
Xfi
Xecho "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
Xecho "${ECHO_T}$lt_cv_ld_reload_flag" >&6
Xreload_flag=$lt_cv_ld_reload_flag
Xcase $reload_flag in
X"" | " "*) ;;
X*) reload_flag=" $reload_flag" ;;
Xesac
Xreload_cmds='$LD$reload_flag -o $output$reload_objs'
X
Xecho "$as_me:$LINENO: checking for BSD-compatible nm" >&5
Xecho $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6
Xif test "${lt_cv_path_NM+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -n "$NM"; then
X  # Let the user override the test.
X  lt_cv_path_NM="$NM"
Xelse
X  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
X  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
X    IFS="$lt_save_ifs"
X    test -z "$ac_dir" && ac_dir=.
X    tmp_nm="$ac_dir/${ac_tool_prefix}nm"
X    if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
X      # Check to see if the nm accepts a BSD-compat flag.
X      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
X      #   nm: unknown option "B" ignored
X      # Tru64's nm complains that /dev/null is an invalid object file
X      case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
X      */dev/null* | *'Invalid file or object type'*)
X	lt_cv_path_NM="$tmp_nm -B"
X	break
X        ;;
X      *)
X	case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
X	*/dev/null*)
X	  lt_cv_path_NM="$tmp_nm -p"
X	  break
X	  ;;
X	*)
X	  lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
X	  continue # so that we can try to find one that supports BSD flags
X	  ;;
X	esac
X      esac
X    fi
X  done
X  IFS="$lt_save_ifs"
X  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
Xfi
Xfi
Xecho "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
Xecho "${ECHO_T}$lt_cv_path_NM" >&6
XNM="$lt_cv_path_NM"
X
Xecho "$as_me:$LINENO: checking whether ln -s works" >&5
Xecho $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
XLN_S=$as_ln_s
Xif test "$LN_S" = "ln -s"; then
X  echo "$as_me:$LINENO: result: yes" >&5
Xecho "${ECHO_T}yes" >&6
Xelse
X  echo "$as_me:$LINENO: result: no, using $LN_S" >&5
Xecho "${ECHO_T}no, using $LN_S" >&6
Xfi
X
Xecho "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
Xecho $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6
Xif test "${lt_cv_deplibs_check_method+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  lt_cv_file_magic_cmd='$MAGIC_CMD'
Xlt_cv_file_magic_test_file=
Xlt_cv_deplibs_check_method='unknown'
X# Need to set the preceding variable on all platforms that support
X# interlibrary dependencies.
X# 'none' -- dependencies not supported.
X# `unknown' -- same as none, but documents that we really don't know.
X# 'pass_all' -- all dependencies passed with no checks.
X# 'test_compile' -- check by making test program.
X# 'file_magic [[regex]]' -- check by looking for files in library path
X# which responds to the $file_magic_cmd with a given extended regex.
X# If you have `file' or equivalent on your system and you're not sure
X# whether `pass_all' will *always* work, you probably want this one.
X
Xcase $host_os in
Xaix4* | aix5*)
X  lt_cv_deplibs_check_method=pass_all
X  ;;
X
Xbeos*)
X  lt_cv_deplibs_check_method=pass_all
X  ;;
X
Xbsdi4*)
X  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
X  lt_cv_file_magic_cmd='/usr/bin/file -L'
X  lt_cv_file_magic_test_file=/shlib/libc.so
X  ;;
X
Xcygwin* | mingw* | pw32*)
X  # win32_libid is a shell function defined in ltmain.sh
X  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
X  lt_cv_file_magic_cmd='win32_libid'
X  ;;
X
Xdarwin* | rhapsody*)
X  # this will be overwritten by pass_all, but leave it in just in case
X  lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
X  lt_cv_file_magic_cmd='/usr/bin/file -L'
X  case "$host_os" in
X  rhapsody* | darwin1.[012])
X    lt_cv_file_magic_test_file=`/System/Library/Frameworks/System.framework/System`
X    ;;
X  *) # Darwin 1.3 on
X    lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
X    ;;
X  esac
X  lt_cv_deplibs_check_method=pass_all
X  ;;
X
Xfreebsd*)
X  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
X    case $host_cpu in
X    i*86 )
X      # Not sure whether the presence of OpenBSD here was a mistake.
X      # Let's accept both of them until this is cleared up.
X      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
X      lt_cv_file_magic_cmd=/usr/bin/file
X      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
X      ;;
X    esac
X  else
X    lt_cv_deplibs_check_method=pass_all
X  fi
X  ;;
X
Xgnu*)
X  lt_cv_deplibs_check_method=pass_all
X  ;;
X
Xhpux10.20* | hpux11*)
X  lt_cv_file_magic_cmd=/usr/bin/file
X  case "$host_cpu" in
X  ia64*)
X    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
X    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
X    ;;
X  hppa*64*)
X    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'
X    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
X    ;;
X  *)
X    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
X    lt_cv_file_magic_test_file=/usr/lib/libc.sl
X    ;;
X  esac
X  ;;
X
Xirix5* | irix6* | nonstopux*)
X  case $host_os in
X  irix5* | nonstopux*)
X    # this will be overridden with pass_all, but let us keep it just in case
X    lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
X    ;;
X  *)
X    case $LD in
X    *-32|*"-32 ") libmagic=32-bit;;
X    *-n32|*"-n32 ") libmagic=N32;;
X    *-64|*"-64 ") libmagic=64-bit;;
X    *) libmagic=never-match;;
X    esac
X    # this will be overridden with pass_all, but let us keep it just in case
X    lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
X    ;;
X  esac
X  lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
X  lt_cv_deplibs_check_method=pass_all
X  ;;
X
X# This must be Linux ELF.
Xlinux*)
X  case $host_cpu in
X  alpha* | hppa* | i*86 | ia64* | m68* | mips | mipsel | powerpc* | sparc* | s390* | sh* | x86_64*)
X    lt_cv_deplibs_check_method=pass_all ;;
X  *)
X    # glibc up to 2.1.1 does not perform some relocations on ARM
X    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
X  esac
X  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
X  ;;
X
Xnetbsd*)
X  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
X    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
X  else
X    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
X  fi
X  ;;
X
Xnewos6*)
X  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
X  lt_cv_file_magic_cmd=/usr/bin/file
X  lt_cv_file_magic_test_file=/usr/lib/libnls.so
X  ;;
X
Xnto-qnx)
X  lt_cv_deplibs_check_method=unknown
X  ;;
X
Xopenbsd*)
X  lt_cv_file_magic_cmd=/usr/bin/file
X  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
X  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
X    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
X  else
X    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
X  fi
X  ;;
X
Xosf3* | osf4* | osf5*)
X  # this will be overridden with pass_all, but let us keep it just in case
X  lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
X  lt_cv_file_magic_test_file=/shlib/libc.so
X  lt_cv_deplibs_check_method=pass_all
X  ;;
X
Xsco3.2v5*)
X  lt_cv_deplibs_check_method=pass_all
X  ;;
X
Xsolaris*)
X  lt_cv_deplibs_check_method=pass_all
X  lt_cv_file_magic_test_file=/lib/libc.so
X  ;;
X
Xsysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
X  case $host_vendor in
X  motorola)
X    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
X    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
X    ;;
X  ncr)
X    lt_cv_deplibs_check_method=pass_all
X    ;;
X  sequent)
X    lt_cv_file_magic_cmd='/bin/file'
X    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
X    ;;
X  sni)
X    lt_cv_file_magic_cmd='/bin/file'
X    lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
X    lt_cv_file_magic_test_file=/lib/libc.so
X    ;;
X  siemens)
X    lt_cv_deplibs_check_method=pass_all
X    ;;
X  esac
X  ;;
X
Xsysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*)
X  lt_cv_deplibs_check_method=pass_all
X  ;;
Xesac
X
Xfi
Xecho "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
Xecho "${ECHO_T}$lt_cv_deplibs_check_method" >&6
Xfile_magic_cmd=$lt_cv_file_magic_cmd
Xdeplibs_check_method=$lt_cv_deplibs_check_method
Xtest -z "$deplibs_check_method" && deplibs_check_method=unknown
X
X
X
X
X# If no C compiler was specified, use CC.
XLTCC=${LTCC-"$CC"}
X
X# Allow CC to be a program name with arguments.
Xcompiler=$CC
X
X
X# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
Xif test "${enable_libtool_lock+set}" = set; then
X  enableval="$enable_libtool_lock"
X
Xfi;
Xtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
X
X# Some flags need to be propagated to the compiler or linker for good
X# libtool support.
Xcase $host in
Xia64-*-hpux*)
X  # Find out which ABI we are using.
X  echo 'int i;' > conftest.$ac_ext
X  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; then
X    case `/usr/bin/file conftest.$ac_objext` in
X    *ELF-32*)
X      HPUX_IA64_MODE="32"
X      ;;
X    *ELF-64*)
X      HPUX_IA64_MODE="64"
X      ;;
X    esac
X  fi
X  rm -rf conftest*
X  ;;
X*-*-irix6*)
X  # Find out which ABI we are using.
X  echo '#line 3603 "configure"' > conftest.$ac_ext
X  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; then
X   if test "$lt_cv_prog_gnu_ld" = yes; then
X    case `/usr/bin/file conftest.$ac_objext` in
X    *32-bit*)
X      LD="${LD-ld} -melf32bsmip"
X      ;;
X    *N32*)
X      LD="${LD-ld} -melf32bmipn32"
X      ;;
X    *64-bit*)
X      LD="${LD-ld} -melf64bmip"
X      ;;
X    esac
X   else
X    case `/usr/bin/file conftest.$ac_objext` in
X    *32-bit*)
X      LD="${LD-ld} -32"
X      ;;
X    *N32*)
X      LD="${LD-ld} -n32"
X      ;;
X    *64-bit*)
X      LD="${LD-ld} -64"
X      ;;
X    esac
X   fi
X  fi
X  rm -rf conftest*
X  ;;
X
Xx86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
X  # Find out which ABI we are using.
X  echo 'int i;' > conftest.$ac_ext
X  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; then
X    case "`/usr/bin/file conftest.o`" in
X    *32-bit*)
X      case $host in
X        x86_64-*linux*)
X          LD="${LD-ld} -m elf_i386"
X          ;;
X        ppc64-*linux*)
X          LD="${LD-ld} -m elf32ppclinux"
X          ;;
X        s390x-*linux*)
X          LD="${LD-ld} -m elf_s390"
X          ;;
X        sparc64-*linux*)
X          LD="${LD-ld} -m elf32_sparc"
X          ;;
X      esac
X      ;;
X    *64-bit*)
X      case $host in
X        x86_64-*linux*)
X          LD="${LD-ld} -m elf_x86_64"
X          ;;
X        ppc*-*linux*|powerpc*-*linux*)
X          LD="${LD-ld} -m elf64ppc"
X          ;;
X        s390*-*linux*)
X          LD="${LD-ld} -m elf64_s390"
X          ;;
X        sparc*-*linux*)
X          LD="${LD-ld} -m elf64_sparc"
X          ;;
X      esac
X      ;;
X    esac
X  fi
X  rm -rf conftest*
X  ;;
X
X*-*-sco3.2v5*)
X  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
X  SAVE_CFLAGS="$CFLAGS"
X  CFLAGS="$CFLAGS -belf"
X  echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
Xecho $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6
Xif test "${lt_cv_cc_needs_belf+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  ac_ext=c
Xac_cpp='$CPP $CPPFLAGS'
Xac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
Xac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
Xac_compiler_gnu=$ac_cv_c_compiler_gnu
X
X     cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X
Xint
Xmain ()
X{
X
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  lt_cv_cc_needs_belf=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xlt_cv_cc_needs_belf=no
Xfi
Xrm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
X     ac_ext=c
Xac_cpp='$CPP $CPPFLAGS'
Xac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
Xac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
Xac_compiler_gnu=$ac_cv_c_compiler_gnu
X
Xfi
Xecho "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
Xecho "${ECHO_T}$lt_cv_cc_needs_belf" >&6
X  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
X    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
X    CFLAGS="$SAVE_CFLAGS"
X  fi
X  ;;
X
Xesac
X
Xneed_locks="$enable_libtool_lock"
X
X
Xac_ext=c
Xac_cpp='$CPP $CPPFLAGS'
Xac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
Xac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
Xac_compiler_gnu=$ac_cv_c_compiler_gnu
Xecho "$as_me:$LINENO: checking how to run the C preprocessor" >&5
Xecho $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
X# On Suns, sometimes $CPP names a directory.
Xif test -n "$CPP" && test -d "$CPP"; then
X  CPP=
Xfi
Xif test -z "$CPP"; then
X  if test "${ac_cv_prog_CPP+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X      # Double quotes because CPP needs to be expanded
X    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
X    do
X      ac_preproc_ok=false
Xfor ac_c_preproc_warn_flag in '' yes
Xdo
X  # Use a header file that comes with gcc, so configuring glibc
X  # with a fresh cross-compiler works.
X  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
X  # <limits.h> exists even on freestanding compilers.
X  # On the NeXT, cc -E runs the code through the compiler's parser,
X  # not just through cpp. "Syntax error" is here to catch this case.
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X#ifdef __STDC__
X# include <limits.h>
X#else
X# include <assert.h>
X#endif
X                     Syntax error
X_ACEOF
Xif { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
X  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
X  ac_status=$?
X  grep -v '^ *+' conftest.er1 >conftest.err
X  rm -f conftest.er1
X  cat conftest.err >&5
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } >/dev/null; then
X  if test -s conftest.err; then
X    ac_cpp_err=$ac_c_preproc_warn_flag
X  else
X    ac_cpp_err=
X  fi
Xelse
X  ac_cpp_err=yes
Xfi
Xif test -z "$ac_cpp_err"; then
X  :
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
X  # Broken: fails on valid input.
Xcontinue
Xfi
Xrm -f conftest.err conftest.$ac_ext
X
X  # OK, works on sane cases.  Now check whether non-existent headers
X  # can be detected and how.
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X#include <ac_nonexistent.h>
X_ACEOF
Xif { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
X  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
X  ac_status=$?
X  grep -v '^ *+' conftest.er1 >conftest.err
X  rm -f conftest.er1
X  cat conftest.err >&5
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } >/dev/null; then
X  if test -s conftest.err; then
X    ac_cpp_err=$ac_c_preproc_warn_flag
X  else
X    ac_cpp_err=
X  fi
Xelse
X  ac_cpp_err=yes
Xfi
Xif test -z "$ac_cpp_err"; then
X  # Broken: success on invalid input.
Xcontinue
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
X  # Passes both tests.
Xac_preproc_ok=:
Xbreak
Xfi
Xrm -f conftest.err conftest.$ac_ext
X
Xdone
X# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
Xrm -f conftest.err conftest.$ac_ext
Xif $ac_preproc_ok; then
X  break
Xfi
X
X    done
X    ac_cv_prog_CPP=$CPP
X
Xfi
X  CPP=$ac_cv_prog_CPP
Xelse
X  ac_cv_prog_CPP=$CPP
Xfi
Xecho "$as_me:$LINENO: result: $CPP" >&5
Xecho "${ECHO_T}$CPP" >&6
Xac_preproc_ok=false
Xfor ac_c_preproc_warn_flag in '' yes
Xdo
X  # Use a header file that comes with gcc, so configuring glibc
X  # with a fresh cross-compiler works.
X  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
X  # <limits.h> exists even on freestanding compilers.
X  # On the NeXT, cc -E runs the code through the compiler's parser,
X  # not just through cpp. "Syntax error" is here to catch this case.
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X#ifdef __STDC__
X# include <limits.h>
X#else
X# include <assert.h>
X#endif
X                     Syntax error
X_ACEOF
Xif { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
X  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
X  ac_status=$?
X  grep -v '^ *+' conftest.er1 >conftest.err
X  rm -f conftest.er1
X  cat conftest.err >&5
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } >/dev/null; then
X  if test -s conftest.err; then
X    ac_cpp_err=$ac_c_preproc_warn_flag
X  else
X    ac_cpp_err=
X  fi
Xelse
X  ac_cpp_err=yes
Xfi
Xif test -z "$ac_cpp_err"; then
X  :
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
X  # Broken: fails on valid input.
Xcontinue
Xfi
Xrm -f conftest.err conftest.$ac_ext
X
X  # OK, works on sane cases.  Now check whether non-existent headers
X  # can be detected and how.
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X#include <ac_nonexistent.h>
X_ACEOF
Xif { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
X  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
X  ac_status=$?
X  grep -v '^ *+' conftest.er1 >conftest.err
X  rm -f conftest.er1
X  cat conftest.err >&5
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } >/dev/null; then
X  if test -s conftest.err; then
X    ac_cpp_err=$ac_c_preproc_warn_flag
X  else
X    ac_cpp_err=
X  fi
Xelse
X  ac_cpp_err=yes
Xfi
Xif test -z "$ac_cpp_err"; then
X  # Broken: success on invalid input.
Xcontinue
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
X  # Passes both tests.
Xac_preproc_ok=:
Xbreak
Xfi
Xrm -f conftest.err conftest.$ac_ext
X
Xdone
X# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
Xrm -f conftest.err conftest.$ac_ext
Xif $ac_preproc_ok; then
X  :
Xelse
X  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
XSee \`config.log' for more details." >&5
Xecho "$as_me: error: C preprocessor \"$CPP\" fails sanity check
XSee \`config.log' for more details." >&2;}
X   { (exit 1); exit 1; }; }
Xfi
X
Xac_ext=c
Xac_cpp='$CPP $CPPFLAGS'
Xac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
Xac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
Xac_compiler_gnu=$ac_cv_c_compiler_gnu
X
X
Xecho "$as_me:$LINENO: checking for ANSI C header files" >&5
Xecho $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
Xif test "${ac_cv_header_stdc+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X#include <stdlib.h>
X#include <stdarg.h>
X#include <string.h>
X#include <float.h>
X
Xint
Xmain ()
X{
X
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext
Xif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest.$ac_objext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_cv_header_stdc=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_cv_header_stdc=no
Xfi
Xrm -f conftest.$ac_objext conftest.$ac_ext
X
Xif test $ac_cv_header_stdc = yes; then
X  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X#include <string.h>
X
X_ACEOF
Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
X  $EGREP "memchr" >/dev/null 2>&1; then
X  :
Xelse
X  ac_cv_header_stdc=no
Xfi
Xrm -f conftest*
X
Xfi
X
Xif test $ac_cv_header_stdc = yes; then
X  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X#include <stdlib.h>
X
X_ACEOF
Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
X  $EGREP "free" >/dev/null 2>&1; then
X  :
Xelse
X  ac_cv_header_stdc=no
Xfi
Xrm -f conftest*
X
Xfi
X
Xif test $ac_cv_header_stdc = yes; then
X  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
X  if test "$cross_compiling" = yes; then
X  :
Xelse
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X#include <ctype.h>
X#if ((' ' & 0x0FF) == 0x020)
X# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
X# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
X#else
X# define ISLOWER(c) \
X                   (('a' <= (c) && (c) <= 'i') \
X                     || ('j' <= (c) && (c) <= 'r') \
X                     || ('s' <= (c) && (c) <= 'z'))
X# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
X#endif
X
X#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
Xint
Xmain ()
X{
X  int i;
X  for (i = 0; i < 256; i++)
X    if (XOR (islower (i), ISLOWER (i))
X        || toupper (i) != TOUPPER (i))
X      exit(2);
X  exit (0);
X}
X_ACEOF
Xrm -f conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  :
Xelse
X  echo "$as_me: program exited with status $ac_status" >&5
Xecho "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
X( exit $ac_status )
Xac_cv_header_stdc=no
Xfi
Xrm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
Xfi
Xfi
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
Xecho "${ECHO_T}$ac_cv_header_stdc" >&6
Xif test $ac_cv_header_stdc = yes; then
X
Xcat >>confdefs.h <<\_ACEOF
X#define STDC_HEADERS 1
X_ACEOF
X
Xfi
X
X# On IRIX 5.3, sys/types and inttypes.h are conflicting.
X
X
X
X
X
X
X
X
X
Xfor ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
X                  inttypes.h stdint.h unistd.h
Xdo
Xas_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
Xecho "$as_me:$LINENO: checking for $ac_header" >&5
Xecho $ECHO_N "checking for $ac_header... $ECHO_C" >&6
Xif eval "test \"\${$as_ac_Header+set}\" = set"; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X$ac_includes_default
X
X#include <$ac_header>
X_ACEOF
Xrm -f conftest.$ac_objext
Xif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest.$ac_objext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  eval "$as_ac_Header=yes"
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xeval "$as_ac_Header=no"
Xfi
Xrm -f conftest.$ac_objext conftest.$ac_ext
Xfi
Xecho "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
Xecho "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
Xif test `eval echo '${'$as_ac_Header'}'` = yes; then
X  cat >>confdefs.h <<_ACEOF
X#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
X_ACEOF
X
Xfi
X
Xdone
X
X
X
Xfor ac_header in dlfcn.h
Xdo
Xas_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
Xif eval "test \"\${$as_ac_Header+set}\" = set"; then
X  echo "$as_me:$LINENO: checking for $ac_header" >&5
Xecho $ECHO_N "checking for $ac_header... $ECHO_C" >&6
Xif eval "test \"\${$as_ac_Header+set}\" = set"; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xfi
Xecho "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
Xecho "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
Xelse
X  # Is the header compilable?
Xecho "$as_me:$LINENO: checking $ac_header usability" >&5
Xecho $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
Xcat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X$ac_includes_default
X#include <$ac_header>
X_ACEOF
Xrm -f conftest.$ac_objext
Xif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest.$ac_objext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_header_compiler=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_header_compiler=no
Xfi
Xrm -f conftest.$ac_objext conftest.$ac_ext
Xecho "$as_me:$LINENO: result: $ac_header_compiler" >&5
Xecho "${ECHO_T}$ac_header_compiler" >&6
X
X# Is the header present?
Xecho "$as_me:$LINENO: checking $ac_header presence" >&5
Xecho $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
Xcat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X#include <$ac_header>
X_ACEOF
Xif { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
X  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
X  ac_status=$?
X  grep -v '^ *+' conftest.er1 >conftest.err
X  rm -f conftest.er1
X  cat conftest.err >&5
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } >/dev/null; then
X  if test -s conftest.err; then
X    ac_cpp_err=$ac_c_preproc_warn_flag
X  else
X    ac_cpp_err=
X  fi
Xelse
X  ac_cpp_err=yes
Xfi
Xif test -z "$ac_cpp_err"; then
X  ac_header_preproc=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
X  ac_header_preproc=no
Xfi
Xrm -f conftest.err conftest.$ac_ext
Xecho "$as_me:$LINENO: result: $ac_header_preproc" >&5
Xecho "${ECHO_T}$ac_header_preproc" >&6
X
X# So?  What about this header?
Xcase $ac_header_compiler:$ac_header_preproc in
X  yes:no )
X    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
Xecho "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
X    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
Xecho "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
X    (
X      cat <<\_ASBOX
X## ------------------------------------ ##
X## Report this to bug-autoconf@gnu.org. ##
X## ------------------------------------ ##
X_ASBOX
X    ) |
X      sed "s/^/$as_me: WARNING:     /" >&2
X    ;;
X  no:yes )
X    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
Xecho "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
X    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
Xecho "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
X    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
Xecho "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
X    (
X      cat <<\_ASBOX
X## ------------------------------------ ##
X## Report this to bug-autoconf@gnu.org. ##
X## ------------------------------------ ##
X_ASBOX
X    ) |
X      sed "s/^/$as_me: WARNING:     /" >&2
X    ;;
Xesac
Xecho "$as_me:$LINENO: checking for $ac_header" >&5
Xecho $ECHO_N "checking for $ac_header... $ECHO_C" >&6
Xif eval "test \"\${$as_ac_Header+set}\" = set"; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  eval "$as_ac_Header=$ac_header_preproc"
Xfi
Xecho "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
Xecho "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
X
Xfi
Xif test `eval echo '${'$as_ac_Header'}'` = yes; then
X  cat >>confdefs.h <<_ACEOF
X#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
X_ACEOF
X
Xfi
X
Xdone
X
Xac_ext=cc
Xac_cpp='$CXXCPP $CPPFLAGS'
Xac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
Xac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
Xac_compiler_gnu=$ac_cv_cxx_compiler_gnu
Xif test -n "$ac_tool_prefix"; then
X  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
X  do
X    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
Xset dummy $ac_tool_prefix$ac_prog; ac_word=$2
Xecho "$as_me:$LINENO: checking for $ac_word" >&5
Xecho $ECHO_N "checking for $ac_word... $ECHO_C" >&6
Xif test "${ac_cv_prog_CXX+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -n "$CXX"; then
X  ac_cv_prog_CXX="$CXX" # Let the user override the test.
Xelse
Xas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  for ac_exec_ext in '' $ac_executable_extensions; do
X  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
X    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
X    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
X    break 2
X  fi
Xdone
Xdone
X
Xfi
Xfi
XCXX=$ac_cv_prog_CXX
Xif test -n "$CXX"; then
X  echo "$as_me:$LINENO: result: $CXX" >&5
Xecho "${ECHO_T}$CXX" >&6
Xelse
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X
X    test -n "$CXX" && break
X  done
Xfi
Xif test -z "$CXX"; then
X  ac_ct_CXX=$CXX
X  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
Xdo
X  # Extract the first word of "$ac_prog", so it can be a program name with args.
Xset dummy $ac_prog; ac_word=$2
Xecho "$as_me:$LINENO: checking for $ac_word" >&5
Xecho $ECHO_N "checking for $ac_word... $ECHO_C" >&6
Xif test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -n "$ac_ct_CXX"; then
X  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
Xelse
Xas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  for ac_exec_ext in '' $ac_executable_extensions; do
X  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
X    ac_cv_prog_ac_ct_CXX="$ac_prog"
X    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
X    break 2
X  fi
Xdone
Xdone
X
Xfi
Xfi
Xac_ct_CXX=$ac_cv_prog_ac_ct_CXX
Xif test -n "$ac_ct_CXX"; then
X  echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
Xecho "${ECHO_T}$ac_ct_CXX" >&6
Xelse
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X
X  test -n "$ac_ct_CXX" && break
Xdone
Xtest -n "$ac_ct_CXX" || ac_ct_CXX="g++"
X
X  CXX=$ac_ct_CXX
Xfi
X
X
X# Provide some information about the compiler.
Xecho "$as_me:$LINENO:" \
X     "checking for C++ compiler version" >&5
Xac_compiler=`set X $ac_compile; echo $2`
X{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
X  (eval $ac_compiler --version </dev/null >&5) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }
X{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
X  (eval $ac_compiler -v </dev/null >&5) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }
X{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
X  (eval $ac_compiler -V </dev/null >&5) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }
X
Xecho "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
Xecho $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6
Xif test "${ac_cv_cxx_compiler_gnu+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X
Xint
Xmain ()
X{
X#ifndef __GNUC__
X       choke me
X#endif
X
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext
Xif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest.$ac_objext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_compiler_gnu=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_compiler_gnu=no
Xfi
Xrm -f conftest.$ac_objext conftest.$ac_ext
Xac_cv_cxx_compiler_gnu=$ac_compiler_gnu
X
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
Xecho "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6
XGXX=`test $ac_compiler_gnu = yes && echo yes`
Xac_test_CXXFLAGS=${CXXFLAGS+set}
Xac_save_CXXFLAGS=$CXXFLAGS
XCXXFLAGS="-g"
Xecho "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
Xecho $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6
Xif test "${ac_cv_prog_cxx_g+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X
Xint
Xmain ()
X{
X
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext
Xif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest.$ac_objext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_cv_prog_cxx_g=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_cv_prog_cxx_g=no
Xfi
Xrm -f conftest.$ac_objext conftest.$ac_ext
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
Xecho "${ECHO_T}$ac_cv_prog_cxx_g" >&6
Xif test "$ac_test_CXXFLAGS" = set; then
X  CXXFLAGS=$ac_save_CXXFLAGS
Xelif test $ac_cv_prog_cxx_g = yes; then
X  if test "$GXX" = yes; then
X    CXXFLAGS="-g -O2"
X  else
X    CXXFLAGS="-g"
X  fi
Xelse
X  if test "$GXX" = yes; then
X    CXXFLAGS="-O2"
X  else
X    CXXFLAGS=
X  fi
Xfi
Xfor ac_declaration in \
X   ''\
X   '#include <stdlib.h>' \
X   'extern "C" void std::exit (int) throw (); using std::exit;' \
X   'extern "C" void std::exit (int); using std::exit;' \
X   'extern "C" void exit (int) throw ();' \
X   'extern "C" void exit (int);' \
X   'void exit (int);'
Xdo
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X#include <stdlib.h>
X$ac_declaration
Xint
Xmain ()
X{
Xexit (42);
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext
Xif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest.$ac_objext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  :
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xcontinue
Xfi
Xrm -f conftest.$ac_objext conftest.$ac_ext
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X$ac_declaration
Xint
Xmain ()
X{
Xexit (42);
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext
Xif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest.$ac_objext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  break
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xfi
Xrm -f conftest.$ac_objext conftest.$ac_ext
Xdone
Xrm -f conftest*
Xif test -n "$ac_declaration"; then
X  echo '#ifdef __cplusplus' >>confdefs.h
X  echo $ac_declaration      >>confdefs.h
X  echo '#endif'             >>confdefs.h
Xfi
X
Xac_ext=cc
Xac_cpp='$CXXCPP $CPPFLAGS'
Xac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
Xac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
Xac_compiler_gnu=$ac_cv_cxx_compiler_gnu
X
Xdepcc="$CXX"  am_compiler_list=
X
Xecho "$as_me:$LINENO: checking dependency style of $depcc" >&5
Xecho $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
Xif test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
X  # We make a subdir and do the tests there.  Otherwise we can end up
X  # making bogus files that we don't know about and never remove.  For
X  # instance it was reported that on HP-UX the gcc test will end up
X  # making a dummy file named `D' -- because `-MD' means `put the output
X  # in D'.
X  mkdir conftest.dir
X  # Copy depcomp to subdir because otherwise we won't find it if we're
X  # using a relative directory.
X  cp "$am_depcomp" conftest.dir
X  cd conftest.dir
X  # We will build objects and dependencies in a subdirectory because
X  # it helps to detect inapplicable dependency modes.  For instance
X  # both Tru64's cc and ICC support -MD to output dependencies as a
X  # side effect of compilation, but ICC will put the dependencies in
X  # the current directory while Tru64 will put them in the object
X  # directory.
X  mkdir sub
X
X  am_cv_CXX_dependencies_compiler_type=none
X  if test "$am_compiler_list" = ""; then
X     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
X  fi
X  for depmode in $am_compiler_list; do
X    # Setup a source with many dependencies, because some compilers
X    # like to wrap large dependency lists on column 80 (with \), and
X    # we should not choose a depcomp mode which is confused by this.
X    #
X    # We need to recreate these files for each test, as the compiler may
X    # overwrite some of them when testing with obscure command lines.
X    # This happens at least with the AIX C compiler.
X    : > sub/conftest.c
X    for i in 1 2 3 4 5 6; do
X      echo '#include "conftst'$i'.h"' >> sub/conftest.c
X      : > sub/conftst$i.h
X    done
X    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
X
X    case $depmode in
X    nosideeffect)
X      # after this tag, mechanisms are not by side-effect, so they'll
X      # only be used when explicitly requested
X      if test "x$enable_dependency_tracking" = xyes; then
X	continue
X      else
X	break
X      fi
X      ;;
X    none) break ;;
X    esac
X    # We check with `-c' and `-o' for the sake of the "dashmstdout"
X    # mode.  It turns out that the SunPro C++ compiler does not properly
X    # handle `-M -o', and we need to detect this.
X    if depmode=$depmode \
X       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
X       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
X       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
X         >/dev/null 2>conftest.err &&
X       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
X       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
X       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
X      # icc doesn't choke on unknown options, it will just issue warnings
X      # (even with -Werror).  So we grep stderr for any message
X      # that says an option was ignored.
X      if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
X        am_cv_CXX_dependencies_compiler_type=$depmode
X        break
X      fi
X    fi
X  done
X
X  cd ..
X  rm -rf conftest.dir
Xelse
X  am_cv_CXX_dependencies_compiler_type=none
Xfi
X
Xfi
Xecho "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
Xecho "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6
XCXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
X
X
X
Xif
X  test "x$enable_dependency_tracking" != xno \
X  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
X  am__fastdepCXX_TRUE=
X  am__fastdepCXX_FALSE='#'
Xelse
X  am__fastdepCXX_TRUE='#'
X  am__fastdepCXX_FALSE=
Xfi
X
X
Xac_ext=cc
Xac_cpp='$CXXCPP $CPPFLAGS'
Xac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
Xac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
Xac_compiler_gnu=$ac_cv_cxx_compiler_gnu
Xecho "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
Xecho $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6
Xif test -z "$CXXCPP"; then
X  if test "${ac_cv_prog_CXXCPP+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X      # Double quotes because CXXCPP needs to be expanded
X    for CXXCPP in "$CXX -E" "/lib/cpp"
X    do
X      ac_preproc_ok=false
Xfor ac_cxx_preproc_warn_flag in '' yes
Xdo
X  # Use a header file that comes with gcc, so configuring glibc
X  # with a fresh cross-compiler works.
X  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
X  # <limits.h> exists even on freestanding compilers.
X  # On the NeXT, cc -E runs the code through the compiler's parser,
X  # not just through cpp. "Syntax error" is here to catch this case.
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X#ifdef __STDC__
X# include <limits.h>
X#else
X# include <assert.h>
X#endif
X                     Syntax error
X_ACEOF
Xif { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
X  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
X  ac_status=$?
X  grep -v '^ *+' conftest.er1 >conftest.err
X  rm -f conftest.er1
X  cat conftest.err >&5
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } >/dev/null; then
X  if test -s conftest.err; then
X    ac_cpp_err=$ac_cxx_preproc_warn_flag
X  else
X    ac_cpp_err=
X  fi
Xelse
X  ac_cpp_err=yes
Xfi
Xif test -z "$ac_cpp_err"; then
X  :
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
X  # Broken: fails on valid input.
Xcontinue
Xfi
Xrm -f conftest.err conftest.$ac_ext
X
X  # OK, works on sane cases.  Now check whether non-existent headers
X  # can be detected and how.
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X#include <ac_nonexistent.h>
X_ACEOF
Xif { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
X  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
X  ac_status=$?
X  grep -v '^ *+' conftest.er1 >conftest.err
X  rm -f conftest.er1
X  cat conftest.err >&5
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } >/dev/null; then
X  if test -s conftest.err; then
X    ac_cpp_err=$ac_cxx_preproc_warn_flag
X  else
X    ac_cpp_err=
X  fi
Xelse
X  ac_cpp_err=yes
Xfi
Xif test -z "$ac_cpp_err"; then
X  # Broken: success on invalid input.
Xcontinue
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
X  # Passes both tests.
Xac_preproc_ok=:
Xbreak
Xfi
Xrm -f conftest.err conftest.$ac_ext
X
Xdone
X# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
Xrm -f conftest.err conftest.$ac_ext
Xif $ac_preproc_ok; then
X  break
Xfi
X
X    done
X    ac_cv_prog_CXXCPP=$CXXCPP
X
Xfi
X  CXXCPP=$ac_cv_prog_CXXCPP
Xelse
X  ac_cv_prog_CXXCPP=$CXXCPP
Xfi
Xecho "$as_me:$LINENO: result: $CXXCPP" >&5
Xecho "${ECHO_T}$CXXCPP" >&6
Xac_preproc_ok=false
Xfor ac_cxx_preproc_warn_flag in '' yes
Xdo
X  # Use a header file that comes with gcc, so configuring glibc
X  # with a fresh cross-compiler works.
X  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
X  # <limits.h> exists even on freestanding compilers.
X  # On the NeXT, cc -E runs the code through the compiler's parser,
X  # not just through cpp. "Syntax error" is here to catch this case.
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X#ifdef __STDC__
X# include <limits.h>
X#else
X# include <assert.h>
X#endif
X                     Syntax error
X_ACEOF
Xif { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
X  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
X  ac_status=$?
X  grep -v '^ *+' conftest.er1 >conftest.err
X  rm -f conftest.er1
X  cat conftest.err >&5
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } >/dev/null; then
X  if test -s conftest.err; then
X    ac_cpp_err=$ac_cxx_preproc_warn_flag
X  else
X    ac_cpp_err=
X  fi
Xelse
X  ac_cpp_err=yes
Xfi
Xif test -z "$ac_cpp_err"; then
X  :
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
X  # Broken: fails on valid input.
Xcontinue
Xfi
Xrm -f conftest.err conftest.$ac_ext
X
X  # OK, works on sane cases.  Now check whether non-existent headers
X  # can be detected and how.
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X#include <ac_nonexistent.h>
X_ACEOF
Xif { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
X  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
X  ac_status=$?
X  grep -v '^ *+' conftest.er1 >conftest.err
X  rm -f conftest.er1
X  cat conftest.err >&5
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } >/dev/null; then
X  if test -s conftest.err; then
X    ac_cpp_err=$ac_cxx_preproc_warn_flag
X  else
X    ac_cpp_err=
X  fi
Xelse
X  ac_cpp_err=yes
Xfi
Xif test -z "$ac_cpp_err"; then
X  # Broken: success on invalid input.
Xcontinue
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
X  # Passes both tests.
Xac_preproc_ok=:
Xbreak
Xfi
Xrm -f conftest.err conftest.$ac_ext
X
Xdone
X# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
Xrm -f conftest.err conftest.$ac_ext
Xif $ac_preproc_ok; then
X  :
Xelse
X  { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
XSee \`config.log' for more details." >&5
Xecho "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
XSee \`config.log' for more details." >&2;}
X   { (exit 1); exit 1; }; }
Xfi
X
Xac_ext=cc
Xac_cpp='$CXXCPP $CPPFLAGS'
Xac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
Xac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
Xac_compiler_gnu=$ac_cv_cxx_compiler_gnu
X
X
Xac_ext=f
Xac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
Xac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
Xac_compiler_gnu=$ac_cv_f77_compiler_gnu
Xif test -n "$ac_tool_prefix"; then
X  for ac_prog in g77 f77 xlf frt pgf77 fl32 af77 fort77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 lf95 g95
X  do
X    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
Xset dummy $ac_tool_prefix$ac_prog; ac_word=$2
Xecho "$as_me:$LINENO: checking for $ac_word" >&5
Xecho $ECHO_N "checking for $ac_word... $ECHO_C" >&6
Xif test "${ac_cv_prog_F77+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -n "$F77"; then
X  ac_cv_prog_F77="$F77" # Let the user override the test.
Xelse
Xas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  for ac_exec_ext in '' $ac_executable_extensions; do
X  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
X    ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
X    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
X    break 2
X  fi
Xdone
Xdone
X
Xfi
Xfi
XF77=$ac_cv_prog_F77
Xif test -n "$F77"; then
X  echo "$as_me:$LINENO: result: $F77" >&5
Xecho "${ECHO_T}$F77" >&6
Xelse
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X
X    test -n "$F77" && break
X  done
Xfi
Xif test -z "$F77"; then
X  ac_ct_F77=$F77
X  for ac_prog in g77 f77 xlf frt pgf77 fl32 af77 fort77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 lf95 g95
Xdo
X  # Extract the first word of "$ac_prog", so it can be a program name with args.
Xset dummy $ac_prog; ac_word=$2
Xecho "$as_me:$LINENO: checking for $ac_word" >&5
Xecho $ECHO_N "checking for $ac_word... $ECHO_C" >&6
Xif test "${ac_cv_prog_ac_ct_F77+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -n "$ac_ct_F77"; then
X  ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
Xelse
Xas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  for ac_exec_ext in '' $ac_executable_extensions; do
X  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
X    ac_cv_prog_ac_ct_F77="$ac_prog"
X    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
X    break 2
X  fi
Xdone
Xdone
X
Xfi
Xfi
Xac_ct_F77=$ac_cv_prog_ac_ct_F77
Xif test -n "$ac_ct_F77"; then
X  echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
Xecho "${ECHO_T}$ac_ct_F77" >&6
Xelse
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X
X  test -n "$ac_ct_F77" && break
Xdone
X
X  F77=$ac_ct_F77
Xfi
X
X
X# Provide some information about the compiler.
Xecho "$as_me:5100:" \
X     "checking for Fortran 77 compiler version" >&5
Xac_compiler=`set X $ac_compile; echo $2`
X{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
X  (eval $ac_compiler --version </dev/null >&5) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }
X{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
X  (eval $ac_compiler -v </dev/null >&5) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }
X{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
X  (eval $ac_compiler -V </dev/null >&5) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }
X
X# If we don't use `.F' as extension, the preprocessor is not run on the
X# input file.
Xac_save_ext=$ac_ext
Xac_ext=F
Xecho "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
Xecho $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6
Xif test "${ac_cv_f77_compiler_gnu+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  cat >conftest.$ac_ext <<_ACEOF
X      program main
X#ifndef __GNUC__
X       choke me
X#endif
X
X      end
X_ACEOF
Xrm -f conftest.$ac_objext
Xif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest.$ac_objext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_compiler_gnu=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_compiler_gnu=no
Xfi
Xrm -f conftest.$ac_objext conftest.$ac_ext
Xac_cv_f77_compiler_gnu=$ac_compiler_gnu
X
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
Xecho "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6
Xac_ext=$ac_save_ext
XG77=`test $ac_compiler_gnu = yes && echo yes`
Xac_test_FFLAGS=${FFLAGS+set}
Xac_save_FFLAGS=$FFLAGS
XFFLAGS=
Xecho "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
Xecho $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6
Xif test "${ac_cv_prog_f77_g+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  FFLAGS=-g
Xcat >conftest.$ac_ext <<_ACEOF
X      program main
X
X      end
X_ACEOF
Xrm -f conftest.$ac_objext
Xif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest.$ac_objext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_cv_prog_f77_g=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_cv_prog_f77_g=no
Xfi
Xrm -f conftest.$ac_objext conftest.$ac_ext
X
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
Xecho "${ECHO_T}$ac_cv_prog_f77_g" >&6
Xif test "$ac_test_FFLAGS" = set; then
X  FFLAGS=$ac_save_FFLAGS
Xelif test $ac_cv_prog_f77_g = yes; then
X  if test "$G77" = yes; then
X    FFLAGS="-g -O2"
X  else
X    FFLAGS="-g"
X  fi
Xelse
X  if test "$G77" = yes; then
X    FFLAGS="-O2"
X  else
X    FFLAGS=
X  fi
Xfi
Xac_ext=c
Xac_cpp='$CPP $CPPFLAGS'
Xac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
Xac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
Xac_compiler_gnu=$ac_cv_c_compiler_gnu
X
X
X
X# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
X
X# find the maximum length of command line arguments
Xecho "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
Xecho $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6
Xif test "${lt_cv_sys_max_cmd_len+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X    i=0
X  testring="ABCD"
X
X  case $build_os in
X  msdosdjgpp*)
X    # On DJGPP, this test can blow up pretty badly due to problems in libc
X    # (any single argument exceeding 2000 bytes causes a buffer overrun
X    # during glob expansion).  Even if it were fixed, the result of this
X    # check would be larger than it should be.
X    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
X    ;;
X
X  gnu*)
X    # Under GNU Hurd, this test is not required because there is
X    # no limit to the length of command line arguments.
X    # Libtool will interpret -1 as no limit whatsoever
X    lt_cv_sys_max_cmd_len=-1;
X    ;;
X
X  cygwin* | mingw*)
X    # On Win9x/ME, this test blows up -- it succeeds, but takes
X    # about 5 minutes as the teststring grows exponentially.
X    # Worse, since 9x/ME are not pre-emptively multitasking,
X    # you end up with a "frozen" computer, even though with patience
X    # the test eventually succeeds (with a max line length of 256k).
X    # Instead, let's just punt: use the minimum linelength reported by
X    # all of the supported platforms: 8192 (on NT/2K/XP).
X    lt_cv_sys_max_cmd_len=8192;
X    ;;
X
X *)
X    # If test is not a shell built-in, we'll probably end up computing a
X    # maximum length that is only half of the actual maximum length, but
X    # we can't tell.
X    while (test "X"`$CONFIG_SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \
X	       = "XX$testring") >/dev/null 2>&1 &&
X	    new_result=`expr "X$testring" : ".*" 2>&1` &&
X	    lt_cv_sys_max_cmd_len=$new_result &&
X	    test $i != 17 # 1/2 MB should be enough
X    do
X      i=`expr $i + 1`
X      testring=$testring$testring
X    done
X    testring=
X    # Add a significant safety factor because C++ compilers can tack on massive
X    # amounts of additional arguments before passing them to the linker.
X    # It appears as though 1/2 is a usable value.
X    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
X    ;;
X  esac
X
Xfi
X
Xif test -n $lt_cv_sys_max_cmd_len ; then
X  echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
Xecho "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6
Xelse
X  echo "$as_me:$LINENO: result: none" >&5
Xecho "${ECHO_T}none" >&6
Xfi
X
X
X
X
X# Check for command to grab the raw symbol name followed by C symbol from nm.
Xecho "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
Xecho $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6
Xif test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X
X# These are sane defaults that work on at least a few old systems.
X# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
X
X# Character class describing NM global symbol codes.
Xsymcode='[BCDEGRST]'
X
X# Regexp to match symbols that can be accessed directly from C.
Xsympat='\([_A-Za-z][_A-Za-z0-9]*\)'
X
X# Transform the above into a raw symbol and a C symbol.
Xsymxfrm='\1 \2\3 \3'
X
X# Transform an extracted symbol line into a proper C declaration
Xlt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
X
X# Transform an extracted symbol line into symbol name and symbol address
Xlt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
X
X# Define system-specific variables.
Xcase $host_os in
Xaix*)
X  symcode='[BCDT]'
X  ;;
Xcygwin* | mingw* | pw32*)
X  symcode='[ABCDGISTW]'
X  ;;
Xhpux*) # Its linker distinguishes data from code symbols
X  if test "$host_cpu" = ia64; then
X    symcode='[ABCDEGRST]'
X  fi
X  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
X  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
X  ;;
Xirix* | nonstopux*)
X  symcode='[BCDEGRST]'
X  ;;
Xosf*)
X  symcode='[BCDEGQRST]'
X  ;;
Xsolaris* | sysv5*)
X  symcode='[BDRT]'
X  ;;
Xsysv4)
X  symcode='[DFNSTU]'
X  ;;
Xesac
X
X# Handle CRLF in mingw tool chain
Xopt_cr=
Xcase $build_os in
Xmingw*)
X  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
X  ;;
Xesac
X
X# If we're using GNU nm, then use its standard symbol codes.
Xcase `$NM -V 2>&1` in
X*GNU* | *'with BFD'*)
X  symcode='[ABCDGIRSTW]' ;;
Xesac
X
X# Try without a prefix undercore, then with it.
Xfor ac_symprfx in "" "_"; do
X
X  # Write the raw and C identifiers.
X  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ 	]\($symcode$symcode*\)[ 	][ 	]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
X
X  # Check to see that the pipe works correctly.
X  pipe_works=no
X
X  rm -f conftest*
X  cat > conftest.$ac_ext <<EOF
X#ifdef __cplusplus
Xextern "C" {
X#endif
Xchar nm_test_var;
Xvoid nm_test_func(){}
X#ifdef __cplusplus
X}
X#endif
Xint main(){nm_test_var='a';nm_test_func();return(0);}
XEOF
X
X  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; then
X    # Now try to grab the symbols.
X    nlist=conftest.nm
X    if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5
X  (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } && test -s "$nlist"; then
X      # Try sorting and uniquifying the output.
X      if sort "$nlist" | uniq > "$nlist"T; then
X	mv -f "$nlist"T "$nlist"
X      else
X	rm -f "$nlist"T
X      fi
X
X      # Make sure that we snagged all the symbols we need.
X      if grep ' nm_test_var$' "$nlist" >/dev/null; then
X	if grep ' nm_test_func$' "$nlist" >/dev/null; then
X	  cat <<EOF > conftest.$ac_ext
X#ifdef __cplusplus
Xextern "C" {
X#endif
X
XEOF
X	  # Now generate the symbol file.
X	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
X
X	  cat <<EOF >> conftest.$ac_ext
X#if defined (__STDC__) && __STDC__
X# define lt_ptr_t void *
X#else
X# define lt_ptr_t char *
X# define const
X#endif
X
X/* The mapping between symbol names and symbols. */
Xconst struct {
X  const char *name;
X  lt_ptr_t address;
X}
Xlt_preloaded_symbols[] =
X{
XEOF
X	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
X	  cat <<\EOF >> conftest.$ac_ext
X  {0, (lt_ptr_t) 0}
X};
X
X#ifdef __cplusplus
X}
X#endif
XEOF
X	  # Now try linking the two files.
X	  mv conftest.$ac_objext conftstm.$ac_objext
X	  lt_save_LIBS="$LIBS"
X	  lt_save_CFLAGS="$CFLAGS"
X	  LIBS="conftstm.$ac_objext"
X	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
X	  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } && test -s conftest${ac_exeext}; then
X	    pipe_works=yes
X	  fi
X	  LIBS="$lt_save_LIBS"
X	  CFLAGS="$lt_save_CFLAGS"
X	else
X	  echo "cannot find nm_test_func in $nlist" >&5
X	fi
X      else
X	echo "cannot find nm_test_var in $nlist" >&5
X      fi
X    else
X      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
X    fi
X  else
X    echo "$progname: failed program was:" >&5
X    cat conftest.$ac_ext >&5
X  fi
X  rm -f conftest* conftst*
X
X  # Do not use the global_symbol_pipe unless it works.
X  if test "$pipe_works" = yes; then
X    break
X  else
X    lt_cv_sys_global_symbol_pipe=
X  fi
Xdone
X
Xfi
X
Xif test -z "$lt_cv_sys_global_symbol_pipe"; then
X  lt_cv_sys_global_symbol_to_cdecl=
Xfi
Xif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
X  echo "$as_me:$LINENO: result: failed" >&5
Xecho "${ECHO_T}failed" >&6
Xelse
X  echo "$as_me:$LINENO: result: ok" >&5
Xecho "${ECHO_T}ok" >&6
Xfi
X
Xecho "$as_me:$LINENO: checking for objdir" >&5
Xecho $ECHO_N "checking for objdir... $ECHO_C" >&6
Xif test "${lt_cv_objdir+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  rm -f .libs 2>/dev/null
Xmkdir .libs 2>/dev/null
Xif test -d .libs; then
X  lt_cv_objdir=.libs
Xelse
X  # MS-DOS does not allow filenames that begin with a dot.
X  lt_cv_objdir=_libs
Xfi
Xrmdir .libs 2>/dev/null
Xfi
Xecho "$as_me:$LINENO: result: $lt_cv_objdir" >&5
Xecho "${ECHO_T}$lt_cv_objdir" >&6
Xobjdir=$lt_cv_objdir
X
X
X
X
X
Xcase $host_os in
Xaix3*)
X  # AIX sometimes has problems with the GCC collect2 program.  For some
X  # reason, if we set the COLLECT_NAMES environment variable, the problems
X  # vanish in a puff of smoke.
X  if test "X${COLLECT_NAMES+set}" != Xset; then
X    COLLECT_NAMES=
X    export COLLECT_NAMES
X  fi
X  ;;
Xesac
X
X# Sed substitution that helps us do robust quoting.  It backslashifies
X# metacharacters that are still active within double-quoted strings.
XXsed='sed -e s/^X//'
Xsed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
X
X# Same as above, but do not quote variable references.
Xdouble_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
X
X# Sed substitution to delay expansion of an escaped shell variable in a
X# double_quote_subst'ed string.
Xdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
X
X# Sed substitution to avoid accidental globbing in evaled expressions
Xno_glob_subst='s/\*/\\\*/g'
X
X# Constants:
Xrm="rm -f"
X
X# Global variables:
Xdefault_ofile=libtool
Xcan_build_shared=yes
X
X# All known linkers require a `.a' archive for static linking (except M$VC,
X# which needs '.lib').
Xlibext=a
Xltmain="$ac_aux_dir/ltmain.sh"
Xofile="$default_ofile"
Xwith_gnu_ld="$lt_cv_prog_gnu_ld"
X
Xif test -n "$ac_tool_prefix"; then
X  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
Xset dummy ${ac_tool_prefix}ar; ac_word=$2
Xecho "$as_me:$LINENO: checking for $ac_word" >&5
Xecho $ECHO_N "checking for $ac_word... $ECHO_C" >&6
Xif test "${ac_cv_prog_AR+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -n "$AR"; then
X  ac_cv_prog_AR="$AR" # Let the user override the test.
Xelse
Xas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  for ac_exec_ext in '' $ac_executable_extensions; do
X  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
X    ac_cv_prog_AR="${ac_tool_prefix}ar"
X    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
X    break 2
X  fi
Xdone
Xdone
X
Xfi
Xfi
XAR=$ac_cv_prog_AR
Xif test -n "$AR"; then
X  echo "$as_me:$LINENO: result: $AR" >&5
Xecho "${ECHO_T}$AR" >&6
Xelse
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X
Xfi
Xif test -z "$ac_cv_prog_AR"; then
X  ac_ct_AR=$AR
X  # Extract the first word of "ar", so it can be a program name with args.
Xset dummy ar; ac_word=$2
Xecho "$as_me:$LINENO: checking for $ac_word" >&5
Xecho $ECHO_N "checking for $ac_word... $ECHO_C" >&6
Xif test "${ac_cv_prog_ac_ct_AR+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -n "$ac_ct_AR"; then
X  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
Xelse
Xas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  for ac_exec_ext in '' $ac_executable_extensions; do
X  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
X    ac_cv_prog_ac_ct_AR="ar"
X    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
X    break 2
X  fi
Xdone
Xdone
X
X  test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false"
Xfi
Xfi
Xac_ct_AR=$ac_cv_prog_ac_ct_AR
Xif test -n "$ac_ct_AR"; then
X  echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
Xecho "${ECHO_T}$ac_ct_AR" >&6
Xelse
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X
X  AR=$ac_ct_AR
Xelse
X  AR="$ac_cv_prog_AR"
Xfi
X
Xif test -n "$ac_tool_prefix"; then
X  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
Xset dummy ${ac_tool_prefix}ranlib; ac_word=$2
Xecho "$as_me:$LINENO: checking for $ac_word" >&5
Xecho $ECHO_N "checking for $ac_word... $ECHO_C" >&6
Xif test "${ac_cv_prog_RANLIB+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -n "$RANLIB"; then
X  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
Xelse
Xas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  for ac_exec_ext in '' $ac_executable_extensions; do
X  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
X    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
X    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
X    break 2
X  fi
Xdone
Xdone
X
Xfi
Xfi
XRANLIB=$ac_cv_prog_RANLIB
Xif test -n "$RANLIB"; then
X  echo "$as_me:$LINENO: result: $RANLIB" >&5
Xecho "${ECHO_T}$RANLIB" >&6
Xelse
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X
Xfi
Xif test -z "$ac_cv_prog_RANLIB"; then
X  ac_ct_RANLIB=$RANLIB
X  # Extract the first word of "ranlib", so it can be a program name with args.
Xset dummy ranlib; ac_word=$2
Xecho "$as_me:$LINENO: checking for $ac_word" >&5
Xecho $ECHO_N "checking for $ac_word... $ECHO_C" >&6
Xif test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -n "$ac_ct_RANLIB"; then
X  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
Xelse
Xas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  for ac_exec_ext in '' $ac_executable_extensions; do
X  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
X    ac_cv_prog_ac_ct_RANLIB="ranlib"
X    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
X    break 2
X  fi
Xdone
Xdone
X
X  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
Xfi
Xfi
Xac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
Xif test -n "$ac_ct_RANLIB"; then
X  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
Xecho "${ECHO_T}$ac_ct_RANLIB" >&6
Xelse
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X
X  RANLIB=$ac_ct_RANLIB
Xelse
X  RANLIB="$ac_cv_prog_RANLIB"
Xfi
X
Xif test -n "$ac_tool_prefix"; then
X  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
Xset dummy ${ac_tool_prefix}strip; ac_word=$2
Xecho "$as_me:$LINENO: checking for $ac_word" >&5
Xecho $ECHO_N "checking for $ac_word... $ECHO_C" >&6
Xif test "${ac_cv_prog_STRIP+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -n "$STRIP"; then
X  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
Xelse
Xas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  for ac_exec_ext in '' $ac_executable_extensions; do
X  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
X    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
X    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
X    break 2
X  fi
Xdone
Xdone
X
Xfi
Xfi
XSTRIP=$ac_cv_prog_STRIP
Xif test -n "$STRIP"; then
X  echo "$as_me:$LINENO: result: $STRIP" >&5
Xecho "${ECHO_T}$STRIP" >&6
Xelse
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X
Xfi
Xif test -z "$ac_cv_prog_STRIP"; then
X  ac_ct_STRIP=$STRIP
X  # Extract the first word of "strip", so it can be a program name with args.
Xset dummy strip; ac_word=$2
Xecho "$as_me:$LINENO: checking for $ac_word" >&5
Xecho $ECHO_N "checking for $ac_word... $ECHO_C" >&6
Xif test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -n "$ac_ct_STRIP"; then
X  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
Xelse
Xas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  for ac_exec_ext in '' $ac_executable_extensions; do
X  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
X    ac_cv_prog_ac_ct_STRIP="strip"
X    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
X    break 2
X  fi
Xdone
Xdone
X
X  test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
Xfi
Xfi
Xac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
Xif test -n "$ac_ct_STRIP"; then
X  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
Xecho "${ECHO_T}$ac_ct_STRIP" >&6
Xelse
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X
X  STRIP=$ac_ct_STRIP
Xelse
X  STRIP="$ac_cv_prog_STRIP"
Xfi
X
X
Xold_CC="$CC"
Xold_CFLAGS="$CFLAGS"
X
X# Set sane defaults for various variables
Xtest -z "$AR" && AR=ar
Xtest -z "$AR_FLAGS" && AR_FLAGS=cru
Xtest -z "$AS" && AS=as
Xtest -z "$CC" && CC=cc
Xtest -z "$LTCC" && LTCC=$CC
Xtest -z "$DLLTOOL" && DLLTOOL=dlltool
Xtest -z "$LD" && LD=ld
Xtest -z "$LN_S" && LN_S="ln -s"
Xtest -z "$MAGIC_CMD" && MAGIC_CMD=file
Xtest -z "$NM" && NM=nm
Xtest -z "$SED" && SED=sed
Xtest -z "$OBJDUMP" && OBJDUMP=objdump
Xtest -z "$RANLIB" && RANLIB=:
Xtest -z "$STRIP" && STRIP=:
Xtest -z "$ac_objext" && ac_objext=o
X
X# Determine commands to create old-style static archives.
Xold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
Xold_postinstall_cmds='chmod 644 $oldlib'
Xold_postuninstall_cmds=
X
Xif test -n "$RANLIB"; then
X  case $host_os in
X  openbsd*)
X    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
X    ;;
X  *)
X    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
X    ;;
X  esac
X  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
Xfi
X
X# Only perform the check for file, if the check method requires it
Xcase $deplibs_check_method in
Xfile_magic*)
X  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
X    echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
Xecho $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6
Xif test "${lt_cv_path_MAGIC_CMD+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  case $MAGIC_CMD in
X[\\/*] |  ?:[\\/]*)
X  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
X  ;;
X*)
X  lt_save_MAGIC_CMD="$MAGIC_CMD"
X  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
X  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
X  for ac_dir in $ac_dummy; do
X    IFS="$lt_save_ifs"
X    test -z "$ac_dir" && ac_dir=.
X    if test -f $ac_dir/${ac_tool_prefix}file; then
X      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
X      if test -n "$file_magic_test_file"; then
X	case $deplibs_check_method in
X	"file_magic "*)
X	  file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
X	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
X	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
X	    $EGREP "$file_magic_regex" > /dev/null; then
X	    :
X	  else
X	    cat <<EOF 1>&2
X
X*** Warning: the command libtool uses to detect shared libraries,
X*** $file_magic_cmd, produces output that libtool cannot recognize.
X*** The result is that libtool may fail to recognize shared libraries
X*** as such.  This will affect the creation of libtool libraries that
X*** depend on shared libraries, but programs linked with such libtool
X*** libraries will work regardless of this problem.  Nevertheless, you
X*** may want to report the problem to your system manager and/or to
X*** bug-libtool@gnu.org
X
XEOF
X	  fi ;;
X	esac
X      fi
X      break
X    fi
X  done
X  IFS="$lt_save_ifs"
X  MAGIC_CMD="$lt_save_MAGIC_CMD"
X  ;;
Xesac
Xfi
X
XMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
Xif test -n "$MAGIC_CMD"; then
X  echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
Xecho "${ECHO_T}$MAGIC_CMD" >&6
Xelse
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X
Xif test -z "$lt_cv_path_MAGIC_CMD"; then
X  if test -n "$ac_tool_prefix"; then
X    echo "$as_me:$LINENO: checking for file" >&5
Xecho $ECHO_N "checking for file... $ECHO_C" >&6
Xif test "${lt_cv_path_MAGIC_CMD+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  case $MAGIC_CMD in
X[\\/*] |  ?:[\\/]*)
X  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
X  ;;
X*)
X  lt_save_MAGIC_CMD="$MAGIC_CMD"
X  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
X  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
X  for ac_dir in $ac_dummy; do
X    IFS="$lt_save_ifs"
X    test -z "$ac_dir" && ac_dir=.
X    if test -f $ac_dir/file; then
X      lt_cv_path_MAGIC_CMD="$ac_dir/file"
X      if test -n "$file_magic_test_file"; then
X	case $deplibs_check_method in
X	"file_magic "*)
X	  file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
X	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
X	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
X	    $EGREP "$file_magic_regex" > /dev/null; then
X	    :
X	  else
X	    cat <<EOF 1>&2
X
X*** Warning: the command libtool uses to detect shared libraries,
X*** $file_magic_cmd, produces output that libtool cannot recognize.
X*** The result is that libtool may fail to recognize shared libraries
X*** as such.  This will affect the creation of libtool libraries that
X*** depend on shared libraries, but programs linked with such libtool
X*** libraries will work regardless of this problem.  Nevertheless, you
X*** may want to report the problem to your system manager and/or to
X*** bug-libtool@gnu.org
X
XEOF
X	  fi ;;
X	esac
X      fi
X      break
X    fi
X  done
X  IFS="$lt_save_ifs"
X  MAGIC_CMD="$lt_save_MAGIC_CMD"
X  ;;
Xesac
Xfi
X
XMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
Xif test -n "$MAGIC_CMD"; then
X  echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
Xecho "${ECHO_T}$MAGIC_CMD" >&6
Xelse
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X
X  else
X    MAGIC_CMD=:
X  fi
Xfi
X
X  fi
X  ;;
Xesac
X
Xenable_dlopen=no
Xenable_win32_dll=no
X
X# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
Xif test "${enable_libtool_lock+set}" = set; then
X  enableval="$enable_libtool_lock"
X
Xfi;
Xtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
X
X
X# Check whether --with-pic or --without-pic was given.
Xif test "${with_pic+set}" = set; then
X  withval="$with_pic"
X  pic_mode="$withval"
Xelse
X  pic_mode=default
Xfi;
Xtest -z "$pic_mode" && pic_mode=default
X
X# Use C for the default configuration in the libtool script
Xtagname=
Xlt_save_CC="$CC"
Xac_ext=c
Xac_cpp='$CPP $CPPFLAGS'
Xac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
Xac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
Xac_compiler_gnu=$ac_cv_c_compiler_gnu
X
X
X# Source file extension for C test sources.
Xac_ext=c
X
X# Object file extension for compiled C test sources.
Xobjext=o
Xobjext=$objext
X
X# Code to be used in simple compile tests
Xlt_simple_compile_test_code="int some_variable = 0;\n"
X
X# Code to be used in simple link tests
Xlt_simple_link_test_code='int main(){return(0);}\n'
X
X
X# If no C compiler was specified, use CC.
XLTCC=${LTCC-"$CC"}
X
X# Allow CC to be a program name with arguments.
Xcompiler=$CC
X
X
X#
X# Check for any special shared library compilation flags.
X#
Xlt_prog_cc_shlib=
Xif test "$GCC" = no; then
X  case $host_os in
X  sco3.2v5*)
X    lt_prog_cc_shlib='-belf'
X    ;;
X  esac
Xfi
Xif test -n "$lt_prog_cc_shlib"; then
X  { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5
Xecho "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;}
X  if echo "$old_CC $old_CFLAGS " | grep "[ 	]$lt_prog_cc_shlib[ 	]" >/dev/null; then :
X  else
X    { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5
Xecho "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;}
X    lt_cv_prog_cc_can_build_shared=no
X  fi
Xfi
X
X
X#
X# Check to make sure the static flag actually works.
X#
Xecho "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5
Xecho $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6
Xif test "${lt_prog_compiler_static_works+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  lt_prog_compiler_static_works=no
X   save_LDFLAGS="$LDFLAGS"
X   LDFLAGS="$LDFLAGS $lt_prog_compiler_static"
X   printf "$lt_simple_link_test_code" > conftest.$ac_ext
X   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
X     # The compiler can only warn and ignore the option if not recognized
X     # So say no if there are warnings
X     if test -s conftest.err; then
X       # Append any errors to the config.log.
X       cat conftest.err 1>&5
X     else
X       lt_prog_compiler_static_works=yes
X     fi
X   fi
X   $rm conftest*
X   LDFLAGS="$save_LDFLAGS"
X
Xfi
Xecho "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5
Xecho "${ECHO_T}$lt_prog_compiler_static_works" >&6
X
Xif test x"$lt_prog_compiler_static_works" = xyes; then
X    :
Xelse
X    lt_prog_compiler_static=
Xfi
X
X
X
X
Xlt_prog_compiler_no_builtin_flag=
X
Xif test "$GCC" = yes; then
X  lt_prog_compiler_no_builtin_flag=' -fno-builtin'
X
X  echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
Xecho $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
Xif test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  lt_cv_prog_compiler_rtti_exceptions=no
X  ac_outfile=conftest.$ac_objext
X   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
X   lt_compiler_flag="-fno-rtti -fno-exceptions"
X   # Insert the option either (1) after the last *FLAGS variable, or
X   # (2) before a word containing "conftest.", or (3) at the end.
X   # Note that $ac_compile itself does not contain backslashes and begins
X   # with a dollar sign (not a hyphen), so the echo should work correctly.
X   # The option is referenced via a variable to avoid confusing sed.
X   lt_compile=`echo "$ac_compile" | $SED \
X   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
X   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
X   -e 's:$: $lt_compiler_flag:'`
X   (eval echo "\"\$as_me:6105: $lt_compile\"" >&5)
X   (eval "$lt_compile" 2>conftest.err)
X   ac_status=$?
X   cat conftest.err >&5
X   echo "$as_me:6109: \$? = $ac_status" >&5
X   if (exit $ac_status) && test -s "$ac_outfile"; then
X     # The compiler can only warn and ignore the option if not recognized
X     # So say no if there are warnings
X     if test ! -s conftest.err; then
X       lt_cv_prog_compiler_rtti_exceptions=yes
X     fi
X   fi
X   $rm conftest*
X
Xfi
Xecho "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
Xecho "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6
X
Xif test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
X    lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
Xelse
X    :
Xfi
X
Xfi
X
Xlt_prog_compiler_wl=
Xlt_prog_compiler_pic=
Xlt_prog_compiler_static=
X
Xecho "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
Xecho $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
X
X  if test "$GCC" = yes; then
X    lt_prog_compiler_wl='-Wl,'
X    lt_prog_compiler_static='-static'
X
X    case $host_os in
X      aix*)
X      # All AIX code is PIC.
X      if test "$host_cpu" = ia64; then
X	# AIX 5 now supports IA64 processor
X	lt_prog_compiler_static='-Bstatic'
X      fi
X      ;;
X
X    amigaos*)
X      # FIXME: we need at least 68020 code to build shared libraries, but
X      # adding the `-m68020' flag to GCC prevents building anything better,
X      # like `-m68040'.
X      lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
X      ;;
X
X    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
X      # PIC is the default for these OSes.
X      ;;
X
X    mingw* | pw32* | os2*)
X      # This hack is so that the source file can tell whether it is being
X      # built for inclusion in a dll (and should export symbols for example).
X      lt_prog_compiler_pic='-DDLL_EXPORT'
X      ;;
X
X    darwin* | rhapsody*)
X      # PIC is the default on this platform
X      # Common symbols not allowed in MH_DYLIB files
X      lt_prog_compiler_pic='-fno-common'
X      ;;
X
X    msdosdjgpp*)
X      # Just because we use GCC doesn't mean we suddenly get shared libraries
X      # on systems that don't support them.
X      lt_prog_compiler_can_build_shared=no
X      enable_shared=no
X      ;;
X
X    sysv4*MP*)
X      if test -d /usr/nec; then
X	lt_prog_compiler_pic=-Kconform_pic
X      fi
X      ;;
X
X    hpux*)
X      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
X      # not for PA HP-UX.
X      case "$host_cpu" in
X      hppa*64*|ia64*)
X	# +Z the default
X	;;
X      *)
X	lt_prog_compiler_pic='-fPIC'
X	;;
X      esac
X      ;;
X
X    *)
X      lt_prog_compiler_pic='-fPIC'
X      ;;
X    esac
X  else
X    # PORTME Check for flag to pass linker flags through the system compiler.
X    case $host_os in
X    aix*)
X      lt_prog_compiler_wl='-Wl,'
X      if test "$host_cpu" = ia64; then
X	# AIX 5 now supports IA64 processor
X	lt_prog_compiler_static='-Bstatic'
X      else
X	lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
X      fi
X      ;;
X
X    mingw* | pw32* | os2*)
X      # This hack is so that the source file can tell whether it is being
X      # built for inclusion in a dll (and should export symbols for example).
X      lt_prog_compiler_pic='-DDLL_EXPORT'
X      ;;
X
X    hpux9* | hpux10* | hpux11*)
X      lt_prog_compiler_wl='-Wl,'
X      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
X      # not for PA HP-UX.
X      case "$host_cpu" in
X      hppa*64*|ia64*)
X	# +Z the default
X	;;
X      *)
X	lt_prog_compiler_pic='+Z'
X	;;
X      esac
X      # Is there a better lt_prog_compiler_static that works with the bundled CC?
X      lt_prog_compiler_static='${wl}-a ${wl}archive'
X      ;;
X
X    irix5* | irix6* | nonstopux*)
X      lt_prog_compiler_wl='-Wl,'
X      # PIC (with -KPIC) is the default.
X      lt_prog_compiler_static='-non_shared'
X      ;;
X
X    newsos6)
X      lt_prog_compiler_pic='-KPIC'
X      lt_prog_compiler_static='-Bstatic'
X      ;;
X
X    linux*)
X      case $CC in
X      icc|ecc)
X	lt_prog_compiler_wl='-Wl,'
X	lt_prog_compiler_pic='-KPIC'
X	lt_prog_compiler_static='-static'
X        ;;
X      ccc)
X        lt_prog_compiler_wl='-Wl,'
X        # All Alpha code is PIC.
X        lt_prog_compiler_static='-non_shared'
X        ;;
X      esac
X      ;;
X
X    osf3* | osf4* | osf5*)
X      lt_prog_compiler_wl='-Wl,'
X      # All OSF/1 code is PIC.
X      lt_prog_compiler_static='-non_shared'
X      ;;
X
X    sco3.2v5*)
X      lt_prog_compiler_pic='-Kpic'
X      lt_prog_compiler_static='-dn'
X      ;;
X
X    solaris*)
X      lt_prog_compiler_wl='-Wl,'
X      lt_prog_compiler_pic='-KPIC'
X      lt_prog_compiler_static='-Bstatic'
X      ;;
X
X    sunos4*)
X      lt_prog_compiler_wl='-Qoption ld '
X      lt_prog_compiler_pic='-PIC'
X      lt_prog_compiler_static='-Bstatic'
X      ;;
X
X    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
X      lt_prog_compiler_wl='-Wl,'
X      lt_prog_compiler_pic='-KPIC'
X      lt_prog_compiler_static='-Bstatic'
X      ;;
X
X    sysv4*MP*)
X      if test -d /usr/nec ;then
X	lt_prog_compiler_pic='-Kconform_pic'
X	lt_prog_compiler_static='-Bstatic'
X      fi
X      ;;
X
X    uts4*)
X      lt_prog_compiler_pic='-pic'
X      lt_prog_compiler_static='-Bstatic'
X      ;;
X
X    *)
X      lt_prog_compiler_can_build_shared=no
X      ;;
X    esac
X  fi
X
Xecho "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
Xecho "${ECHO_T}$lt_prog_compiler_pic" >&6
X
X#
X# Check to make sure the PIC flag actually works.
X#
Xif test -n "$lt_prog_compiler_pic"; then
X  echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
Xecho $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6
Xif test "${lt_prog_compiler_pic_works+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  lt_prog_compiler_pic_works=no
X  ac_outfile=conftest.$ac_objext
X   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
X   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
X   # Insert the option either (1) after the last *FLAGS variable, or
X   # (2) before a word containing "conftest.", or (3) at the end.
X   # Note that $ac_compile itself does not contain backslashes and begins
X   # with a dollar sign (not a hyphen), so the echo should work correctly.
X   # The option is referenced via a variable to avoid confusing sed.
X   lt_compile=`echo "$ac_compile" | $SED \
X   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
X   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
X   -e 's:$: $lt_compiler_flag:'`
X   (eval echo "\"\$as_me:6337: $lt_compile\"" >&5)
X   (eval "$lt_compile" 2>conftest.err)
X   ac_status=$?
X   cat conftest.err >&5
X   echo "$as_me:6341: \$? = $ac_status" >&5
X   if (exit $ac_status) && test -s "$ac_outfile"; then
X     # The compiler can only warn and ignore the option if not recognized
X     # So say no if there are warnings
X     if test ! -s conftest.err; then
X       lt_prog_compiler_pic_works=yes
X     fi
X   fi
X   $rm conftest*
X
Xfi
Xecho "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5
Xecho "${ECHO_T}$lt_prog_compiler_pic_works" >&6
X
Xif test x"$lt_prog_compiler_pic_works" = xyes; then
X    case $lt_prog_compiler_pic in
X     "" | " "*) ;;
X     *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
X     esac
Xelse
X    lt_prog_compiler_pic=
X     lt_prog_compiler_can_build_shared=no
Xfi
X
Xfi
Xcase "$host_os" in
X  # For platforms which do not support PIC, -DPIC is meaningless:
X  *djgpp*)
X    lt_prog_compiler_pic=
X    ;;
X  *)
X    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
X    ;;
Xesac
X
Xecho "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
Xecho $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
Xif test "${lt_cv_prog_compiler_c_o+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  lt_cv_prog_compiler_c_o=no
X   $rm -r conftest 2>/dev/null
X   mkdir conftest
X   cd conftest
X   mkdir out
X   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
X
X   # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
X   # that will create temporary files in the current directory regardless of
X   # the output directory.  Thus, making CWD read-only will cause this test
X   # to fail, enabling locking or at least warning the user not to do parallel
X   # builds.
X   chmod -w .
X
X   lt_compiler_flag="-o out/conftest2.$ac_objext"
X   # Insert the option either (1) after the last *FLAGS variable, or
X   # (2) before a word containing "conftest.", or (3) at the end.
X   # Note that $ac_compile itself does not contain backslashes and begins
X   # with a dollar sign (not a hyphen), so the echo should work correctly.
X   lt_compile=`echo "$ac_compile" | $SED \
X   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
X   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
X   -e 's:$: $lt_compiler_flag:'`
X   (eval echo "\"\$as_me:6404: $lt_compile\"" >&5)
X   (eval "$lt_compile" 2>out/conftest.err)
X   ac_status=$?
X   cat out/conftest.err >&5
X   echo "$as_me:6408: \$? = $ac_status" >&5
X   if (exit $ac_status) && test -s out/conftest2.$ac_objext
X   then
X     # The compiler can only warn and ignore the option if not recognized
X     # So say no if there are warnings
X     if test ! -s out/conftest.err; then
X       lt_cv_prog_compiler_c_o=yes
X     fi
X   fi
X   chmod u+w .
X   $rm conftest* out/*
X   rmdir out
X   cd ..
X   rmdir conftest
X   $rm conftest*
X
Xfi
Xecho "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
Xecho "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6
X
X
Xhard_links="nottested"
Xif test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
X  # do not overwrite the value of need_locks provided by the user
X  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
Xecho $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
X  hard_links=yes
X  $rm conftest*
X  ln conftest.a conftest.b 2>/dev/null && hard_links=no
X  touch conftest.a
X  ln conftest.a conftest.b 2>&5 || hard_links=no
X  ln conftest.a conftest.b 2>/dev/null && hard_links=no
X  echo "$as_me:$LINENO: result: $hard_links" >&5
Xecho "${ECHO_T}$hard_links" >&6
X  if test "$hard_links" = no; then
X    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
Xecho "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
X    need_locks=warn
X  fi
Xelse
X  need_locks=no
Xfi
X
Xecho "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
Xecho $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
X
X  runpath_var=
X  allow_undefined_flag=
X  enable_shared_with_static_runtimes=no
X  archive_cmds=
X  archive_expsym_cmds=
X  old_archive_From_new_cmds=
X  old_archive_from_expsyms_cmds=
X  export_dynamic_flag_spec=
X  whole_archive_flag_spec=
X  thread_safe_flag_spec=
X  hardcode_libdir_flag_spec=
X  hardcode_libdir_flag_spec_ld=
X  hardcode_libdir_separator=
X  hardcode_direct=no
X  hardcode_minus_L=no
X  hardcode_shlibpath_var=unsupported
X  link_all_deplibs=unknown
X  hardcode_automatic=no
X  module_cmds=
X  module_expsym_cmds=
X  always_export_symbols=no
X  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
X  # include_expsyms should be a list of space-separated symbols to be *always*
X  # included in the symbol list
X  include_expsyms=
X  # exclude_expsyms can be an extended regexp of symbols to exclude
X  # it will be wrapped by ` (' and `)$', so one must not match beginning or
X  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
X  # as well as any symbol that contains `d'.
X  exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
X  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
X  # platforms (ab)use it in PIC code, but their linkers get confused if
X  # the symbol is explicitly referenced.  Since portable code cannot
X  # rely on this symbol name, it's probably fine to never include it in
X  # preloaded symbol tables.
X  extract_expsyms_cmds=
X
X  case $host_os in
X  cygwin* | mingw* | pw32*)
X    # FIXME: the MSVC++ port hasn't been tested in a loooong time
X    # When not using gcc, we currently assume that we are using
X    # Microsoft Visual C++.
X    if test "$GCC" != yes; then
X      with_gnu_ld=no
X    fi
X    ;;
X  openbsd*)
X    with_gnu_ld=no
X    ;;
X  esac
X
X  ld_shlibs=yes
X  if test "$with_gnu_ld" = yes; then
X    # If archive_cmds runs LD, not CC, wlarc should be empty
X    wlarc='${wl}'
X
X    # See if GNU ld supports shared libraries.
X    case $host_os in
X    aix3* | aix4* | aix5*)
X      # On AIX/PPC, the GNU linker is very broken
X      if test "$host_cpu" != ia64; then
X	ld_shlibs=no
X	cat <<EOF 1>&2
X
X*** Warning: the GNU linker, at least up to release 2.9.1, is reported
X*** to be unable to reliably create shared libraries on AIX.
X*** Therefore, libtool is disabling shared libraries support.  If you
X*** really care for shared libraries, you may want to modify your PATH
X*** so that a non-GNU linker is found, and then restart.
X
XEOF
X      fi
X      ;;
X
X    amigaos*)
X      archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
X      hardcode_libdir_flag_spec='-L$libdir'
X      hardcode_minus_L=yes
X
X      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
X      # that the semantics of dynamic libraries on AmigaOS, at least up
X      # to version 4, is to share data among multiple programs linked
X      # with the same dynamic library.  Since this doesn't match the
X      # behavior of shared libraries on other platforms, we can't use
X      # them.
X      ld_shlibs=no
X      ;;
X
X    beos*)
X      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
X	allow_undefined_flag=unsupported
X	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
X	# support --undefined.  This deserves some investigation.  FIXME
X	archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
X      else
X	ld_shlibs=no
X      fi
X      ;;
X
X    cygwin* | mingw* | pw32*)
X      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
X      # as there is no search path for DLLs.
X      hardcode_libdir_flag_spec='-L$libdir'
X      allow_undefined_flag=unsupported
X      always_export_symbols=no
X      enable_shared_with_static_runtimes=yes
X      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
X
X      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
X        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
X	# If the export-symbols file already is a .def file (1st line
X	# is EXPORTS), use it as is; otherwise, prepend...
X	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
X	  cp $export_symbols $output_objdir/$soname.def;
X	else
X	  echo EXPORTS > $output_objdir/$soname.def;
X	  cat $export_symbols >> $output_objdir/$soname.def;
X	fi~
X	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
X      else
X	ld_shlibs=no
X      fi
X      ;;
X
X    netbsd*)
X      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
X	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
X	wlarc=
X      else
X	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
X	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
X      fi
X      ;;
X
X    solaris* | sysv5*)
X      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
X	ld_shlibs=no
X	cat <<EOF 1>&2
X
X*** Warning: The releases 2.8.* of the GNU linker cannot reliably
X*** create shared libraries on Solaris systems.  Therefore, libtool
X*** is disabling shared libraries support.  We urge you to upgrade GNU
X*** binutils to release 2.9.1 or newer.  Another option is to modify
X*** your PATH or compiler configuration so that the native linker is
X*** used, and then restart.
X
XEOF
X      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
X	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
X	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
X      else
X	ld_shlibs=no
X      fi
X      ;;
X
X    sunos4*)
X      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
X      wlarc=
X      hardcode_direct=yes
X      hardcode_shlibpath_var=no
X      ;;
X
X  linux*)
X    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
X        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
X	archive_cmds="$tmp_archive_cmds"
X      supports_anon_versioning=no
X      case `$LD -v 2>/dev/null` in
X        *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
X        *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
X        *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
X        *\ 2.11.*) ;; # other 2.11 versions
X        *) supports_anon_versioning=yes ;;
X      esac
X      if test $supports_anon_versioning = yes; then
X        archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
Xcat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
X$echo "local: *; };" >> $output_objdir/$libname.ver~
X        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
X      else
X        archive_expsym_cmds="$tmp_archive_cmds"
X      fi
X    else
X      ld_shlibs=no
X    fi
X    ;;
X
X    *)
X      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
X	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
X	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
X      else
X	ld_shlibs=no
X      fi
X      ;;
X    esac
X
X    if test "$ld_shlibs" = yes; then
X      runpath_var=LD_RUN_PATH
X      hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
X      export_dynamic_flag_spec='${wl}--export-dynamic'
X      # ancient GNU ld didn't support --whole-archive et. al.
X      if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
X 	whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
X      else
X  	whole_archive_flag_spec=
X      fi
X    fi
X  else
X    # PORTME fill in a description of your system's linker (not GNU ld)
X    case $host_os in
X    aix3*)
X      allow_undefined_flag=unsupported
X      always_export_symbols=yes
X      archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
X      # Note: this linker hardcodes the directories in LIBPATH if there
X      # are no directories specified by -L.
X      hardcode_minus_L=yes
X      if test "$GCC" = yes && test -z "$link_static_flag"; then
X	# Neither direct hardcoding nor static linking is supported with a
X	# broken collect2.
X	hardcode_direct=unsupported
X      fi
X      ;;
X
X    aix4* | aix5*)
X      if test "$host_cpu" = ia64; then
X	# On IA64, the linker does run time linking by default, so we don't
X	# have to do anything special.
X	aix_use_runtimelinking=no
X	exp_sym_flag='-Bexport'
X	no_entry_flag=""
X      else
X	# If we're using GNU nm, then we don't want the "-C" option.
X	# -C means demangle to AIX nm, but means don't demangle with GNU nm
X	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
X	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
X	else
X	  export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
X	fi
X	aix_use_runtimelinking=no
X
X	# Test if we are trying to use run time linking or normal
X	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
X	# need to do runtime linking.
X	case $host_os in aix4.[23]|aix4.[23].*|aix5*)
X	  for ld_flag in $LDFLAGS; do
X  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
X  	    aix_use_runtimelinking=yes
X  	    break
X  	  fi
X	  done
X	esac
X
X	exp_sym_flag='-bexport'
X	no_entry_flag='-bnoentry'
X      fi
X
X      # When large executables or shared objects are built, AIX ld can
X      # have problems creating the table of contents.  If linking a library
X      # or program results in "error TOC overflow" add -mminimal-toc to
X      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
X      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
X
X      archive_cmds=''
X      hardcode_direct=yes
X      hardcode_libdir_separator=':'
X      link_all_deplibs=yes
X
X      if test "$GCC" = yes; then
X	case $host_os in aix4.012|aix4.012.*)
X	# We only want to do this on AIX 4.2 and lower, the check
X	# below for broken collect2 doesn't work under 4.3+
X	  collect2name=`${CC} -print-prog-name=collect2`
X	  if test -f "$collect2name" && \
X  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
X	  then
X  	  # We have reworked collect2
X  	  hardcode_direct=yes
X	  else
X  	  # We have old collect2
X  	  hardcode_direct=unsupported
X  	  # It fails to find uninstalled libraries when the uninstalled
X  	  # path is not listed in the libpath.  Setting hardcode_minus_L
X  	  # to unsupported forces relinking
X  	  hardcode_minus_L=yes
X  	  hardcode_libdir_flag_spec='-L$libdir'
X  	  hardcode_libdir_separator=
X	  fi
X	esac
X	shared_flag='-shared'
X      else
X	# not using gcc
X	if test "$host_cpu" = ia64; then
X  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
X  	# chokes on -Wl,-G. The following line is correct:
X	  shared_flag='-G'
X	else
X  	if test "$aix_use_runtimelinking" = yes; then
X	    shared_flag='${wl}-G'
X	  else
X	    shared_flag='${wl}-bM:SRE'
X  	fi
X	fi
X      fi
X
X      # It seems that -bexpall does not export symbols beginning with
X      # underscore (_), so it is better to generate a list of symbols to export.
X      always_export_symbols=yes
X      if test "$aix_use_runtimelinking" = yes; then
X	# Warning - without using the other runtime loading flags (-brtl),
X	# -berok will link without error, but may produce a broken library.
X	allow_undefined_flag='-berok'
X       # Determine the default libpath from the value encoded in an empty executable.
X       cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X
Xint
Xmain ()
X{
X
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X
Xaix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
X}'`
X# Check for a 64-bit object if we didn't find anything.
Xif test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
X}'`; fi
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xfi
Xrm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
Xif test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
X
X       hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
X	archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
X       else
X	if test "$host_cpu" = ia64; then
X	  hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
X	  allow_undefined_flag="-z nodefs"
X	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
X	else
X	 # Determine the default libpath from the value encoded in an empty executable.
X	 cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X
Xint
Xmain ()
X{
X
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X
Xaix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
X}'`
X# Check for a 64-bit object if we didn't find anything.
Xif test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
X}'`; fi
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xfi
Xrm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
Xif test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
X
X	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
X	  # Warning - without using the other run time loading flags,
X	  # -berok will link without error, but may produce a broken library.
X	  no_undefined_flag=' ${wl}-bernotok'
X	  allow_undefined_flag=' ${wl}-berok'
X	  # -bexpall does not export symbols beginning with underscore (_)
X	  always_export_symbols=yes
X	  # Exported symbols can be pulled into shared objects from archives
X	  whole_archive_flag_spec=' '
X	  archive_cmds_need_lc=yes
X	  # This is similar to how AIX traditionally builds it's shared libraries.
X	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
X	fi
X      fi
X      ;;
X
X    amigaos*)
X      archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
X      hardcode_libdir_flag_spec='-L$libdir'
X      hardcode_minus_L=yes
X      # see comment about different semantics on the GNU ld section
X      ld_shlibs=no
X      ;;
X
X    bsdi4*)
X      export_dynamic_flag_spec=-rdynamic
X      ;;
X
X    cygwin* | mingw* | pw32*)
X      # When not using gcc, we currently assume that we are using
X      # Microsoft Visual C++.
X      # hardcode_libdir_flag_spec is actually meaningless, as there is
X      # no search path for DLLs.
X      hardcode_libdir_flag_spec=' '
X      allow_undefined_flag=unsupported
X      # Tell ltmain to make .lib files, not .a files.
X      libext=lib
X      # Tell ltmain to make .dll files, not .so files.
X      shrext=".dll"
X      # FIXME: Setting linknames here is a bad hack.
X      archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
X      # The linker will automatically build a .lib file if we build a DLL.
X      old_archive_From_new_cmds='true'
X      # FIXME: Should let the user specify the lib program.
X      old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
X      fix_srcfile_path='`cygpath -w "$srcfile"`'
X      enable_shared_with_static_runtimes=yes
X      ;;
X
X    darwin* | rhapsody*)
X    if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
X      archive_cmds_need_lc=no
X      case "$host_os" in
X      rhapsody* | darwin1.[012])
X	allow_undefined_flag='-undefined suppress'
X	;;
X      *) # Darwin 1.3 on
X	test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag='-flat_namespace -undefined suppress'
X	;;
X      esac
X      # FIXME: Relying on posixy $() will cause problems for
X      #        cross-compilation, but unfortunately the echo tests do not
X      #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
X      #	       `"' quotes if we put them in here... so don't!
X    	lt_int_apple_cc_single_mod=no
X    	output_verbose_link_cmd='echo'
X    	if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
X    	  lt_int_apple_cc_single_mod=yes
X    	fi
X    	if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
X    	  archive_cmds='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
X    	else
X        archive_cmds='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
X      fi
X      module_cmds='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags'
X      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
X        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
X          archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
X        else
X          archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
X        fi
X          module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag  -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
X      hardcode_direct=no
X      hardcode_automatic=yes
X      hardcode_shlibpath_var=unsupported
X      whole_archive_flag_spec='-all_load $convenience'
X      link_all_deplibs=yes
X    fi
X      ;;
X
X    dgux*)
X      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
X      hardcode_libdir_flag_spec='-L$libdir'
X      hardcode_shlibpath_var=no
X      ;;
X
X    freebsd1*)
X      ld_shlibs=no
X      ;;
X
X    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
X    # support.  Future versions do this automatically, but an explicit c++rt0.o
X    # does not break anything, and helps significantly (at the cost of a little
X    # extra space).
X    freebsd2.2*)
X      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
X      hardcode_libdir_flag_spec='-R$libdir'
X      hardcode_direct=yes
X      hardcode_shlibpath_var=no
X      ;;
X
X    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
X    freebsd2*)
X      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
X      hardcode_direct=yes
X      hardcode_minus_L=yes
X      hardcode_shlibpath_var=no
X      ;;
X
X    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
X    freebsd*)
X      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
X      hardcode_libdir_flag_spec='-R$libdir'
X      hardcode_direct=yes
X      hardcode_shlibpath_var=no
X      ;;
X
X    hpux9*)
X      if test "$GCC" = yes; then
X	archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
X      else
X	archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
X      fi
X      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
X      hardcode_libdir_separator=:
X      hardcode_direct=yes
X
X      # hardcode_minus_L: Not really in the search PATH,
X      # but as the default location of the library.
X      hardcode_minus_L=yes
X      export_dynamic_flag_spec='${wl}-E'
X      ;;
X
X    hpux10* | hpux11*)
X      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
X	case "$host_cpu" in
X	hppa*64*|ia64*)
X	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
X	  ;;
X	*)
X	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
X	  ;;
X	esac
X      else
X	case "$host_cpu" in
X	hppa*64*|ia64*)
X	  archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
X	  ;;
X	*)
X	  archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
X	  ;;
X	esac
X      fi
X      if test "$with_gnu_ld" = no; then
X	case "$host_cpu" in
X	hppa*64*)
X	  hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
X	  hardcode_libdir_flag_spec_ld='+b $libdir'
X	  hardcode_libdir_separator=:
X	  hardcode_direct=no
X	  hardcode_shlibpath_var=no
X	  ;;
X	ia64*)
X	  hardcode_libdir_flag_spec='-L$libdir'
X	  hardcode_direct=no
X	  hardcode_shlibpath_var=no
X
X	  # hardcode_minus_L: Not really in the search PATH,
X	  # but as the default location of the library.
X	  hardcode_minus_L=yes
X	  ;;
X	*)
X	  hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
X	  hardcode_libdir_separator=:
X	  hardcode_direct=yes
X	  export_dynamic_flag_spec='${wl}-E'
X
X	  # hardcode_minus_L: Not really in the search PATH,
X	  # but as the default location of the library.
X	  hardcode_minus_L=yes
X	  ;;
X	esac
X      fi
X      ;;
X
X    irix5* | irix6* | nonstopux*)
X      if test "$GCC" = yes; then
X	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
X      else
X	archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
X	hardcode_libdir_flag_spec_ld='-rpath $libdir'
X      fi
X      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
X      hardcode_libdir_separator=:
X      link_all_deplibs=yes
X      ;;
X
X    netbsd*)
X      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
X	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
X      else
X	archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
X      fi
X      hardcode_libdir_flag_spec='-R$libdir'
X      hardcode_direct=yes
X      hardcode_shlibpath_var=no
X      ;;
X
X    newsos6)
X      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
X      hardcode_direct=yes
X      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
X      hardcode_libdir_separator=:
X      hardcode_shlibpath_var=no
X      ;;
X
X    openbsd*)
X      hardcode_direct=yes
X      hardcode_shlibpath_var=no
X      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
X	archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
X	hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
X	export_dynamic_flag_spec='${wl}-E'
X      else
X       case $host_os in
X	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
X	   archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
X	   hardcode_libdir_flag_spec='-R$libdir'
X	   ;;
X	 *)
X	   archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
X	   hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
X	   ;;
X       esac
X      fi
X      ;;
X
X    os2*)
X      hardcode_libdir_flag_spec='-L$libdir'
X      hardcode_minus_L=yes
X      allow_undefined_flag=unsupported
X      archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
X      old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
X      ;;
X
X    osf3*)
X      if test "$GCC" = yes; then
X	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
X	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
X      else
X	allow_undefined_flag=' -expect_unresolved \*'
X	archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
X      fi
X      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
X      hardcode_libdir_separator=:
X      ;;
X
X    osf4* | osf5*)	# as osf3* with the addition of -msym flag
X      if test "$GCC" = yes; then
X	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
X	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
X	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
X      else
X	allow_undefined_flag=' -expect_unresolved \*'
X	archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
X	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
X	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
X
X	# Both c and cxx compiler support -rpath directly
X	hardcode_libdir_flag_spec='-rpath $libdir'
X      fi
X      hardcode_libdir_separator=:
X      ;;
X
X    sco3.2v5*)
X      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
X      hardcode_shlibpath_var=no
X      export_dynamic_flag_spec='${wl}-Bexport'
X      runpath_var=LD_RUN_PATH
X      hardcode_runpath_var=yes
X      ;;
X
X    solaris*)
X      no_undefined_flag=' -z text'
X      if test "$GCC" = yes; then
X	archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
X	archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
X	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
X      else
X	archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
X	archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
X  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
X      fi
X      hardcode_libdir_flag_spec='-R$libdir'
X      hardcode_shlibpath_var=no
X      case $host_os in
X      solaris2.[0-5] | solaris2.[0-5].*) ;;
X      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
X	whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
X      esac
X      link_all_deplibs=yes
X      ;;
X
X    sunos4*)
X      if test "x$host_vendor" = xsequent; then
X	# Use $CC to link under sequent, because it throws in some extra .o
X	# files that make .init and .fini sections work.
X	archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
X      else
X	archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
X      fi
X      hardcode_libdir_flag_spec='-L$libdir'
X      hardcode_direct=yes
X      hardcode_minus_L=yes
X      hardcode_shlibpath_var=no
X      ;;
X
X    sysv4)
X      case $host_vendor in
X	sni)
X	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
X	  hardcode_direct=yes # is this really true???
X	;;
X	siemens)
X	  ## LD is ld it makes a PLAMLIB
X	  ## CC just makes a GrossModule.
X	  archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
X	  reload_cmds='$CC -r -o $output$reload_objs'
X	  hardcode_direct=no
X        ;;
X	motorola)
X	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
X	  hardcode_direct=no #Motorola manual says yes, but my tests say they lie
X	;;
X      esac
X      runpath_var='LD_RUN_PATH'
X      hardcode_shlibpath_var=no
X      ;;
X
X    sysv4.3*)
X      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
X      hardcode_shlibpath_var=no
X      export_dynamic_flag_spec='-Bexport'
X      ;;
X
X    sysv4*MP*)
X      if test -d /usr/nec; then
X	archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
X	hardcode_shlibpath_var=no
X	runpath_var=LD_RUN_PATH
X	hardcode_runpath_var=yes
X	ld_shlibs=yes
X      fi
X      ;;
X
X    sysv4.2uw2*)
X      archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
X      hardcode_direct=yes
X      hardcode_minus_L=no
X      hardcode_shlibpath_var=no
X      hardcode_runpath_var=yes
X      runpath_var=LD_RUN_PATH
X      ;;
X
X   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
X      no_undefined_flag='${wl}-z ${wl}text'
X      if test "$GCC" = yes; then
X	archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
X      else
X	archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
X      fi
X      runpath_var='LD_RUN_PATH'
X      hardcode_shlibpath_var=no
X      ;;
X
X    sysv5*)
X      no_undefined_flag=' -z text'
X      # $CC -shared without GNU ld will not create a library from C++
X      # object files and a static libstdc++, better avoid it by now
X      archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
X      archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
X  		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
X      hardcode_libdir_flag_spec=
X      hardcode_shlibpath_var=no
X      runpath_var='LD_RUN_PATH'
X      ;;
X
X    uts4*)
X      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
X      hardcode_libdir_flag_spec='-L$libdir'
X      hardcode_shlibpath_var=no
X      ;;
X
X    *)
X      ld_shlibs=no
X      ;;
X    esac
X  fi
X
Xecho "$as_me:$LINENO: result: $ld_shlibs" >&5
Xecho "${ECHO_T}$ld_shlibs" >&6
Xtest "$ld_shlibs" = no && can_build_shared=no
X
Xvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
Xif test "$GCC" = yes; then
X  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
Xfi
X
X#
X# Do we need to explicitly link libc?
X#
Xcase "x$archive_cmds_need_lc" in
Xx|xyes)
X  # Assume -lc should be added
X  archive_cmds_need_lc=yes
X
X  if test "$enable_shared" = yes && test "$GCC" = yes; then
X    case $archive_cmds in
X    *'~'*)
X      # FIXME: we may have to deal with multi-command sequences.
X      ;;
X    '$CC '*)
X      # Test whether the compiler implicitly links with -lc since on some
X      # systems, -lgcc has to come before -lc. If gcc already passes -lc
X      # to ld, don't add -lc before -lgcc.
X      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
Xecho $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
X      $rm conftest*
X      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
X
X      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } 2>conftest.err; then
X        soname=conftest
X        lib=conftest
X        libobjs=conftest.$ac_objext
X        deplibs=
X        wl=$lt_prog_compiler_wl
X        compiler_flags=-v
X        linker_flags=-v
X        verstring=
X        output_objdir=.
X        libname=conftest
X        lt_save_allow_undefined_flag=$allow_undefined_flag
X        allow_undefined_flag=
X        if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
X  (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }
X        then
X	  archive_cmds_need_lc=no
X        else
X	  archive_cmds_need_lc=yes
X        fi
X        allow_undefined_flag=$lt_save_allow_undefined_flag
X      else
X        cat conftest.err 1>&5
X      fi
X      $rm conftest*
X      echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
Xecho "${ECHO_T}$archive_cmds_need_lc" >&6
X      ;;
X    esac
X  fi
X  ;;
Xesac
X
Xecho "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
Xecho $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
Xhardcode_action=
Xif test -n "$hardcode_libdir_flag_spec" || \
X   test -n "$runpath_var " || \
X   test "X$hardcode_automatic"="Xyes" ; then
X
X  # We can hardcode non-existant directories.
X  if test "$hardcode_direct" != no &&
X     # If the only mechanism to avoid hardcoding is shlibpath_var, we
X     # have to relink, otherwise we might link with an installed library
X     # when we should be linking with a yet-to-be-installed one
X     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no &&
X     test "$hardcode_minus_L" != no; then
X    # Linking always hardcodes the temporary library directory.
X    hardcode_action=relink
X  else
X    # We can link without hardcoding, and we can hardcode nonexisting dirs.
X    hardcode_action=immediate
X  fi
Xelse
X  # We cannot hardcode anything, or else we can only hardcode existing
X  # directories.
X  hardcode_action=unsupported
Xfi
Xecho "$as_me:$LINENO: result: $hardcode_action" >&5
Xecho "${ECHO_T}$hardcode_action" >&6
X
Xif test "$hardcode_action" = relink; then
X  # Fast installation is not supported
X  enable_fast_install=no
Xelif test "$shlibpath_overrides_runpath" = yes ||
X     test "$enable_shared" = no; then
X  # Fast installation is not necessary
X  enable_fast_install=needless
Xfi
X
Xstriplib=
Xold_striplib=
Xecho "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
Xecho $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
Xif test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
X  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
X  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
X  echo "$as_me:$LINENO: result: yes" >&5
Xecho "${ECHO_T}yes" >&6
Xelse
X# FIXME - insert some real tests, host_os isn't really good enough
X  case $host_os in
X   darwin*)
X       if test -n "$STRIP" ; then
X         striplib="$STRIP -x"
X         echo "$as_me:$LINENO: result: yes" >&5
Xecho "${ECHO_T}yes" >&6
X       else
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X       ;;
X   *)
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
X    ;;
X  esac
Xfi
X
Xecho "$as_me:$LINENO: checking dynamic linker characteristics" >&5
Xecho $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
Xlibrary_names_spec=
Xlibname_spec='lib$name'
Xsoname_spec=
Xshrext=".so"
Xpostinstall_cmds=
Xpostuninstall_cmds=
Xfinish_cmds=
Xfinish_eval=
Xshlibpath_var=
Xshlibpath_overrides_runpath=unknown
Xversion_type=none
Xdynamic_linker="$host_os ld.so"
Xsys_lib_dlsearch_path_spec="/lib /usr/lib"
Xif test "$GCC" = yes; then
X  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
X  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
X    # if the path contains ";" then we assume it to be the separator
X    # otherwise default to the standard path separator (i.e. ":") - it is
X    # assumed that no part of a normal pathname contains ";" but that should
X    # okay in the real world where ";" in dirpaths is itself problematic.
X    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
X  else
X    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
X  fi
Xelse
X  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
Xfi
Xneed_lib_prefix=unknown
Xhardcode_into_libs=no
X
X# when you set need_version to no, make sure it does not cause -set_version
X# flags to be left without arguments
Xneed_version=unknown
X
Xcase $host_os in
Xaix3*)
X  version_type=linux
X  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
X  shlibpath_var=LIBPATH
X
X  # AIX 3 has no versioning support, so we append a major version to the name.
X  soname_spec='${libname}${release}${shared_ext}$major'
X  ;;
X
Xaix4* | aix5*)
X  version_type=linux
X  need_lib_prefix=no
X  need_version=no
X  hardcode_into_libs=yes
X  if test "$host_cpu" = ia64; then
X    # AIX 5 supports IA64
X    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
X    shlibpath_var=LD_LIBRARY_PATH
X  else
X    # With GCC up to 2.95.x, collect2 would create an import file
X    # for dependence libraries.  The import file would start with
X    # the line `#! .'.  This would cause the generated library to
X    # depend on `.', always an invalid library.  This was fixed in
X    # development snapshots of GCC prior to 3.0.
X    case $host_os in
X      aix4 | aix4.[01] | aix4.[01].*)
X      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
X	   echo ' yes '
X	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
X	:
X      else
X	can_build_shared=no
X      fi
X      ;;
X    esac
X    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
X    # soname into executable. Probably we can add versioning support to
X    # collect2, so additional links can be useful in future.
X    if test "$aix_use_runtimelinking" = yes; then
X      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
X      # instead of lib<name>.a to let people know that these are not
X      # typical AIX shared libraries.
X      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X    else
X      # We preserve .a as extension for shared libraries through AIX4.2
X      # and later when we are not doing run time linking.
X      library_names_spec='${libname}${release}.a $libname.a'
X      soname_spec='${libname}${release}${shared_ext}$major'
X    fi
X    shlibpath_var=LIBPATH
X  fi
X  ;;
X
Xamigaos*)
X  library_names_spec='$libname.ixlibrary $libname.a'
X  # Create ${libname}_ixlibrary.a entries in /sys/libs.
X  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
X  ;;
X
Xbeos*)
X  library_names_spec='${libname}${shared_ext}'
X  dynamic_linker="$host_os ld.so"
X  shlibpath_var=LIBRARY_PATH
X  ;;
X
Xbsdi4*)
X  version_type=linux
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
X  shlibpath_var=LD_LIBRARY_PATH
X  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
X  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
X  # the default ld.so.conf also contains /usr/contrib/lib and
X  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
X  # libtool to hard-code these into programs
X  ;;
X
Xcygwin* | mingw* | pw32*)
X  version_type=windows
X  shrext=".dll"
X  need_version=no
X  need_lib_prefix=no
X
X  case $GCC,$host_os in
X  yes,cygwin* | yes,mingw* | yes,pw32*)
X    library_names_spec='$libname.dll.a'
X    # DLL is installed to $(libdir)/../bin by postinstall_cmds
X    postinstall_cmds='base_file=`basename \${file}`~
X      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
X      dldir=$destdir/`dirname \$dlpath`~
X      test -d \$dldir || mkdir -p \$dldir~
X      $install_prog $dir/$dlname \$dldir/$dlname'
X    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
X      dlpath=$dir/\$dldll~
X       $rm \$dlpath'
X    shlibpath_overrides_runpath=yes
X
X    case $host_os in
X    cygwin*)
X      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
X      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
X      sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib"
X      ;;
X    mingw*)
X      # MinGW DLLs use traditional 'lib' prefix
X      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
X      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
X      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
X        # It is most probably a Windows format PATH printed by
X        # mingw gcc, but we are running on Cygwin. Gcc prints its search
X        # path with ; separators, and with drive letters. We can handle the
X        # drive letters (cygwin fileutils understands them), so leave them,
X        # especially as we might pass files found there to a mingw objdump,
X        # which wouldn't understand a cygwinified path. Ahh.
X        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
X      else
X        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
X      fi
X      ;;
X    pw32*)
X      # pw32 DLLs use 'pw' prefix rather than 'lib'
X      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'
X      ;;
X    esac
X    ;;
X
X  *)
X    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
X    ;;
X  esac
X  dynamic_linker='Win32 ld.exe'
X  # FIXME: first we should search . and the directory the executable is in
X  shlibpath_var=PATH
X  ;;
X
Xdarwin* | rhapsody*)
X  dynamic_linker="$host_os dyld"
X  version_type=darwin
X  need_lib_prefix=no
X  need_version=no
X  # FIXME: Relying on posixy $() will cause problems for
X  #        cross-compilation, but unfortunately the echo tests do not
X  #        yet detect zsh echo's removal of \ escapes.
X  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
X  soname_spec='${libname}${release}${major}$shared_ext'
X  shlibpath_overrides_runpath=yes
X  shlibpath_var=DYLD_LIBRARY_PATH
X  shrext='$(test .$module = .yes && echo .so || echo .dylib)'
X  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
X  if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
X  sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
X  fi
X  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
X  ;;
X
Xdgux*)
X  version_type=linux
X  need_lib_prefix=no
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  shlibpath_var=LD_LIBRARY_PATH
X  ;;
X
Xfreebsd1*)
X  dynamic_linker=no
X  ;;
X
Xfreebsd*)
X  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
X  version_type=freebsd-$objformat
X  case $version_type in
X    freebsd-elf*)
X      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
X      need_version=no
X      need_lib_prefix=no
X      ;;
X    freebsd-*)
X      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
X      need_version=yes
X      ;;
X  esac
X  shlibpath_var=LD_LIBRARY_PATH
X  case $host_os in
X  freebsd2*)
X    shlibpath_overrides_runpath=yes
X    ;;
X  freebsd3.01* | freebsdelf3.01*)
X    shlibpath_overrides_runpath=yes
X    hardcode_into_libs=yes
X    ;;
X  *) # from 3.2 on
X    shlibpath_overrides_runpath=no
X    hardcode_into_libs=yes
X    ;;
X  esac
X  ;;
X
Xgnu*)
X  version_type=linux
X  need_lib_prefix=no
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  shlibpath_var=LD_LIBRARY_PATH
X  hardcode_into_libs=yes
X  ;;
X
Xhpux9* | hpux10* | hpux11*)
X  # Give a soname corresponding to the major version so that dld.sl refuses to
X  # link against other versions.
X  version_type=sunos
X  need_lib_prefix=no
X  need_version=no
X  case "$host_cpu" in
X  ia64*)
X    shrext='.so'
X    hardcode_into_libs=yes
X    dynamic_linker="$host_os dld.so"
X    shlibpath_var=LD_LIBRARY_PATH
X    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
X    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X    soname_spec='${libname}${release}${shared_ext}$major'
X    if test "X$HPUX_IA64_MODE" = X32; then
X      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
X    else
X      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
X    fi
X    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
X    ;;
X   hppa*64*)
X     shrext='.sl'
X     hardcode_into_libs=yes
X     dynamic_linker="$host_os dld.sl"
X     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
X     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
X     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X     soname_spec='${libname}${release}${shared_ext}$major'
X     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
X     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
X     ;;
X   *)
X    shrext='.sl'
X    dynamic_linker="$host_os dld.sl"
X    shlibpath_var=SHLIB_PATH
X    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
X    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X    soname_spec='${libname}${release}${shared_ext}$major'
X    ;;
X  esac
X  # HP-UX runs *really* slowly unless shared libraries are mode 555.
X  postinstall_cmds='chmod 555 $lib'
X  ;;
X
Xirix5* | irix6* | nonstopux*)
X  case $host_os in
X    nonstopux*) version_type=nonstopux ;;
X    *)
X	if test "$lt_cv_prog_gnu_ld" = yes; then
X		version_type=linux
X	else
X		version_type=irix
X	fi ;;
X  esac
X  need_lib_prefix=no
X  need_version=no
X  soname_spec='${libname}${release}${shared_ext}$major'
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
X  case $host_os in
X  irix5* | nonstopux*)
X    libsuff= shlibsuff=
X    ;;
X  *)
X    case $LD in # libtool.m4 will add one of these switches to LD
X    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
X      libsuff= shlibsuff= libmagic=32-bit;;
X    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
X      libsuff=32 shlibsuff=N32 libmagic=N32;;
X    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
X      libsuff=64 shlibsuff=64 libmagic=64-bit;;
X    *) libsuff= shlibsuff= libmagic=never-match;;
X    esac
X    ;;
X  esac
X  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
X  shlibpath_overrides_runpath=no
X  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
X  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
X  hardcode_into_libs=yes
X  ;;
X
X# No shared lib support for Linux oldld, aout, or coff.
Xlinux*oldld* | linux*aout* | linux*coff*)
X  dynamic_linker=no
X  ;;
X
X# This must be Linux ELF.
Xlinux*)
X  version_type=linux
X  need_lib_prefix=no
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
X  shlibpath_var=LD_LIBRARY_PATH
X  shlibpath_overrides_runpath=no
X  # This implies no fast_install, which is unacceptable.
X  # Some rework will be needed to allow for fast_install
X  # before this can be enabled.
X  hardcode_into_libs=yes
X
X  # We used to test for /lib/ld.so.1 and disable shared libraries on
X  # powerpc, because MkLinux only supported shared libraries with the
X  # GNU dynamic linker.  Since this was broken with cross compilers,
X  # most powerpc-linux boxes support dynamic linking these days and
X  # people can always --disable-shared, the test was removed, and we
X  # assume the GNU/Linux dynamic linker is in use.
X  dynamic_linker='GNU/Linux ld.so'
X
X  # Find out which ABI we are using (multilib Linux x86_64 hack).
X  libsuff=
X  case "$host_cpu" in
X  x86_64*|s390x*|powerpc64*)
X    echo '#line 7769 "configure"' > conftest.$ac_ext
X    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; then
X      case `/usr/bin/file conftest.$ac_objext` in
X      *64-bit*)
X        libsuff=64
X        ;;
X      esac
X    fi
X    rm -rf conftest*
X    ;;
X  *)
X    ;;
X  esac
X  sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
X  sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
X  ;;
X
Xnetbsd*)
X  version_type=sunos
X  need_lib_prefix=no
X  need_version=no
X  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
X    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
X    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
X    dynamic_linker='NetBSD (a.out) ld.so'
X  else
X    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}'
X    soname_spec='${libname}${release}${shared_ext}$major'
X    dynamic_linker='NetBSD ld.elf_so'
X  fi
X  shlibpath_var=LD_LIBRARY_PATH
X  shlibpath_overrides_runpath=yes
X  hardcode_into_libs=yes
X  ;;
X
Xnewsos6)
X  version_type=linux
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  shlibpath_var=LD_LIBRARY_PATH
X  shlibpath_overrides_runpath=yes
X  ;;
X
Xnto-qnx)
X  version_type=linux
X  need_lib_prefix=no
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  shlibpath_var=LD_LIBRARY_PATH
X  shlibpath_overrides_runpath=yes
X  ;;
X
Xopenbsd*)
X  version_type=sunos
X  need_lib_prefix=no
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
X  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
X  shlibpath_var=LD_LIBRARY_PATH
X  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
X    case $host_os in
X      openbsd2.[89] | openbsd2.[89].*)
X	shlibpath_overrides_runpath=no
X	;;
X      *)
X	shlibpath_overrides_runpath=yes
X	;;
X      esac
X  else
X    shlibpath_overrides_runpath=yes
X  fi
X  ;;
X
Xos2*)
X  libname_spec='$name'
X  shrext=".dll"
X  need_lib_prefix=no
X  library_names_spec='$libname${shared_ext} $libname.a'
X  dynamic_linker='OS/2 ld.exe'
X  shlibpath_var=LIBPATH
X  ;;
X
Xosf3* | osf4* | osf5*)
X  version_type=osf
X  need_lib_prefix=no
X  need_version=no
X  soname_spec='${libname}${release}${shared_ext}$major'
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  shlibpath_var=LD_LIBRARY_PATH
X  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
X  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
X  ;;
X
Xsco3.2v5*)
X  version_type=osf
X  soname_spec='${libname}${release}${shared_ext}$major'
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  shlibpath_var=LD_LIBRARY_PATH
X  ;;
X
Xsolaris*)
X  version_type=linux
X  need_lib_prefix=no
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  shlibpath_var=LD_LIBRARY_PATH
X  shlibpath_overrides_runpath=yes
X  hardcode_into_libs=yes
X  # ldd complains unless libraries are executable
X  postinstall_cmds='chmod +x $lib'
X  ;;
X
Xsunos4*)
X  version_type=sunos
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
X  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
X  shlibpath_var=LD_LIBRARY_PATH
X  shlibpath_overrides_runpath=yes
X  if test "$with_gnu_ld" = yes; then
X    need_lib_prefix=no
X  fi
X  need_version=yes
X  ;;
X
Xsysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
X  version_type=linux
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  shlibpath_var=LD_LIBRARY_PATH
X  case $host_vendor in
X    sni)
X      shlibpath_overrides_runpath=no
X      need_lib_prefix=no
X      export_dynamic_flag_spec='${wl}-Blargedynsym'
X      runpath_var=LD_RUN_PATH
X      ;;
X    siemens)
X      need_lib_prefix=no
X      ;;
X    motorola)
X      need_lib_prefix=no
X      need_version=no
X      shlibpath_overrides_runpath=no
X      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
X      ;;
X  esac
X  ;;
X
Xsysv4*MP*)
X  if test -d /usr/nec ;then
X    version_type=linux
X    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
X    soname_spec='$libname${shared_ext}.$major'
X    shlibpath_var=LD_LIBRARY_PATH
X  fi
X  ;;
X
Xuts4*)
X  version_type=linux
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  shlibpath_var=LD_LIBRARY_PATH
X  ;;
X
X*)
X  dynamic_linker=no
X  ;;
Xesac
Xecho "$as_me:$LINENO: result: $dynamic_linker" >&5
Xecho "${ECHO_T}$dynamic_linker" >&6
Xtest "$dynamic_linker" = no && can_build_shared=no
X
Xif test "x$enable_dlopen" != xyes; then
X  enable_dlopen=unknown
X  enable_dlopen_self=unknown
X  enable_dlopen_self_static=unknown
Xelse
X  lt_cv_dlopen=no
X  lt_cv_dlopen_libs=
X
X  case $host_os in
X  beos*)
X    lt_cv_dlopen="load_add_on"
X    lt_cv_dlopen_libs=
X    lt_cv_dlopen_self=yes
X    ;;
X
X  mingw* | pw32*)
X    lt_cv_dlopen="LoadLibrary"
X    lt_cv_dlopen_libs=
X   ;;
X
X  cygwin*)
X    lt_cv_dlopen="dlopen"
X    lt_cv_dlopen_libs=
X   ;;
X
X  darwin*)
X  # if libdl is installed we need to link against it
X    echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
Xecho $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
Xif test "${ac_cv_lib_dl_dlopen+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  ac_check_lib_save_LIBS=$LIBS
XLIBS="-ldl  $LIBS"
Xcat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X
X/* Override any gcc2 internal prototype to avoid an error.  */
X#ifdef __cplusplus
Xextern "C"
X#endif
X/* We use char because int might match the return type of a gcc2
X   builtin and then its argument prototype would still apply.  */
Xchar dlopen ();
Xint
Xmain ()
X{
Xdlopen ();
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_cv_lib_dl_dlopen=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_cv_lib_dl_dlopen=no
Xfi
Xrm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
XLIBS=$ac_check_lib_save_LIBS
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
Xecho "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
Xif test $ac_cv_lib_dl_dlopen = yes; then
X  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
Xelse
X
X    lt_cv_dlopen="dyld"
X    lt_cv_dlopen_libs=
X    lt_cv_dlopen_self=yes
X
Xfi
X
X   ;;
X
X  *)
X    echo "$as_me:$LINENO: checking for shl_load" >&5
Xecho $ECHO_N "checking for shl_load... $ECHO_C" >&6
Xif test "${ac_cv_func_shl_load+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X/* System header to define __stub macros and hopefully few prototypes,
X    which can conflict with char shl_load (); below.
X    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
X    <limits.h> exists even on freestanding compilers.  */
X#ifdef __STDC__
X# include <limits.h>
X#else
X# include <assert.h>
X#endif
X/* Override any gcc2 internal prototype to avoid an error.  */
X#ifdef __cplusplus
Xextern "C"
X{
X#endif
X/* We use char because int might match the return type of a gcc2
X   builtin and then its argument prototype would still apply.  */
Xchar shl_load ();
X/* The GNU C library defines this for functions which it implements
X    to always fail with ENOSYS.  Some functions are actually named
X    something starting with __ and the normal name is an alias.  */
X#if defined (__stub_shl_load) || defined (__stub___shl_load)
Xchoke me
X#else
Xchar (*f) () = shl_load;
X#endif
X#ifdef __cplusplus
X}
X#endif
X
Xint
Xmain ()
X{
Xreturn f != shl_load;
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_cv_func_shl_load=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_cv_func_shl_load=no
Xfi
Xrm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
Xecho "${ECHO_T}$ac_cv_func_shl_load" >&6
Xif test $ac_cv_func_shl_load = yes; then
X  lt_cv_dlopen="shl_load"
Xelse
X  echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
Xecho $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
Xif test "${ac_cv_lib_dld_shl_load+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  ac_check_lib_save_LIBS=$LIBS
XLIBS="-ldld  $LIBS"
Xcat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X
X/* Override any gcc2 internal prototype to avoid an error.  */
X#ifdef __cplusplus
Xextern "C"
X#endif
X/* We use char because int might match the return type of a gcc2
X   builtin and then its argument prototype would still apply.  */
Xchar shl_load ();
Xint
Xmain ()
X{
Xshl_load ();
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_cv_lib_dld_shl_load=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_cv_lib_dld_shl_load=no
Xfi
Xrm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
XLIBS=$ac_check_lib_save_LIBS
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
Xecho "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
Xif test $ac_cv_lib_dld_shl_load = yes; then
X  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
Xelse
X  echo "$as_me:$LINENO: checking for dlopen" >&5
Xecho $ECHO_N "checking for dlopen... $ECHO_C" >&6
Xif test "${ac_cv_func_dlopen+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X/* System header to define __stub macros and hopefully few prototypes,
X    which can conflict with char dlopen (); below.
X    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
X    <limits.h> exists even on freestanding compilers.  */
X#ifdef __STDC__
X# include <limits.h>
X#else
X# include <assert.h>
X#endif
X/* Override any gcc2 internal prototype to avoid an error.  */
X#ifdef __cplusplus
Xextern "C"
X{
X#endif
X/* We use char because int might match the return type of a gcc2
X   builtin and then its argument prototype would still apply.  */
Xchar dlopen ();
X/* The GNU C library defines this for functions which it implements
X    to always fail with ENOSYS.  Some functions are actually named
X    something starting with __ and the normal name is an alias.  */
X#if defined (__stub_dlopen) || defined (__stub___dlopen)
Xchoke me
X#else
Xchar (*f) () = dlopen;
X#endif
X#ifdef __cplusplus
X}
X#endif
X
Xint
Xmain ()
X{
Xreturn f != dlopen;
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_cv_func_dlopen=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_cv_func_dlopen=no
Xfi
Xrm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
Xecho "${ECHO_T}$ac_cv_func_dlopen" >&6
Xif test $ac_cv_func_dlopen = yes; then
X  lt_cv_dlopen="dlopen"
Xelse
X  echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
Xecho $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
Xif test "${ac_cv_lib_dl_dlopen+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  ac_check_lib_save_LIBS=$LIBS
XLIBS="-ldl  $LIBS"
Xcat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X
X/* Override any gcc2 internal prototype to avoid an error.  */
X#ifdef __cplusplus
Xextern "C"
X#endif
X/* We use char because int might match the return type of a gcc2
X   builtin and then its argument prototype would still apply.  */
Xchar dlopen ();
Xint
Xmain ()
X{
Xdlopen ();
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_cv_lib_dl_dlopen=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_cv_lib_dl_dlopen=no
Xfi
Xrm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
XLIBS=$ac_check_lib_save_LIBS
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
Xecho "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
Xif test $ac_cv_lib_dl_dlopen = yes; then
X  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
Xelse
X  echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
Xecho $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
Xif test "${ac_cv_lib_svld_dlopen+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  ac_check_lib_save_LIBS=$LIBS
XLIBS="-lsvld  $LIBS"
Xcat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X
X/* Override any gcc2 internal prototype to avoid an error.  */
X#ifdef __cplusplus
Xextern "C"
X#endif
X/* We use char because int might match the return type of a gcc2
X   builtin and then its argument prototype would still apply.  */
Xchar dlopen ();
Xint
Xmain ()
X{
Xdlopen ();
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_cv_lib_svld_dlopen=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_cv_lib_svld_dlopen=no
Xfi
Xrm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
XLIBS=$ac_check_lib_save_LIBS
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
Xecho "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
Xif test $ac_cv_lib_svld_dlopen = yes; then
X  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
Xelse
X  echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
Xecho $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
Xif test "${ac_cv_lib_dld_dld_link+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  ac_check_lib_save_LIBS=$LIBS
XLIBS="-ldld  $LIBS"
Xcat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X
X/* Override any gcc2 internal prototype to avoid an error.  */
X#ifdef __cplusplus
Xextern "C"
X#endif
X/* We use char because int might match the return type of a gcc2
X   builtin and then its argument prototype would still apply.  */
Xchar dld_link ();
Xint
Xmain ()
X{
Xdld_link ();
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_cv_lib_dld_dld_link=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_cv_lib_dld_dld_link=no
Xfi
Xrm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
XLIBS=$ac_check_lib_save_LIBS
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
Xecho "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
Xif test $ac_cv_lib_dld_dld_link = yes; then
X  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
Xfi
X
X
Xfi
X
X
Xfi
X
X
Xfi
X
X
Xfi
X
X
Xfi
X
X    ;;
X  esac
X
X  if test "x$lt_cv_dlopen" != xno; then
X    enable_dlopen=yes
X  else
X    enable_dlopen=no
X  fi
X
X  case $lt_cv_dlopen in
X  dlopen)
X    save_CPPFLAGS="$CPPFLAGS"
X    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
X
X    save_LDFLAGS="$LDFLAGS"
X    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
X
X    save_LIBS="$LIBS"
X    LIBS="$lt_cv_dlopen_libs $LIBS"
X
X    echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
Xecho $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
Xif test "${lt_cv_dlopen_self+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  	  if test "$cross_compiling" = yes; then :
X  lt_cv_dlopen_self=cross
Xelse
X  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
X  lt_status=$lt_dlunknown
X  cat > conftest.$ac_ext <<EOF
X#line 8465 "configure"
X#include "confdefs.h"
X
X#if HAVE_DLFCN_H
X#include <dlfcn.h>
X#endif
X
X#include <stdio.h>
X
X#ifdef RTLD_GLOBAL
X#  define LT_DLGLOBAL		RTLD_GLOBAL
X#else
X#  ifdef DL_GLOBAL
X#    define LT_DLGLOBAL		DL_GLOBAL
X#  else
X#    define LT_DLGLOBAL		0
X#  endif
X#endif
X
X/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
X   find out it does not work in some platform. */
X#ifndef LT_DLLAZY_OR_NOW
X#  ifdef RTLD_LAZY
X#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
X#  else
X#    ifdef DL_LAZY
X#      define LT_DLLAZY_OR_NOW		DL_LAZY
X#    else
X#      ifdef RTLD_NOW
X#        define LT_DLLAZY_OR_NOW	RTLD_NOW
X#      else
X#        ifdef DL_NOW
X#          define LT_DLLAZY_OR_NOW	DL_NOW
X#        else
X#          define LT_DLLAZY_OR_NOW	0
X#        endif
X#      endif
X#    endif
X#  endif
X#endif
X
X#ifdef __cplusplus
Xextern "C" void exit (int);
X#endif
X
Xvoid fnord() { int i=42;}
Xint main ()
X{
X  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
X  int status = $lt_dlunknown;
X
X  if (self)
X    {
X      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
X      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
X      /* dlclose (self); */
X    }
X
X    exit (status);
X}
XEOF
X  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
X    (./conftest; exit; ) 2>/dev/null
X    lt_status=$?
X    case x$lt_status in
X      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
X      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
X      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
X    esac
X  else :
X    # compilation failed
X    lt_cv_dlopen_self=no
X  fi
Xfi
Xrm -fr conftest*
X
X
Xfi
Xecho "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
Xecho "${ECHO_T}$lt_cv_dlopen_self" >&6
X
X    if test "x$lt_cv_dlopen_self" = xyes; then
X      LDFLAGS="$LDFLAGS $link_static_flag"
X      echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
Xecho $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
Xif test "${lt_cv_dlopen_self_static+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  	  if test "$cross_compiling" = yes; then :
X  lt_cv_dlopen_self_static=cross
Xelse
X  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
X  lt_status=$lt_dlunknown
X  cat > conftest.$ac_ext <<EOF
X#line 8563 "configure"
X#include "confdefs.h"
X
X#if HAVE_DLFCN_H
X#include <dlfcn.h>
X#endif
X
X#include <stdio.h>
X
X#ifdef RTLD_GLOBAL
X#  define LT_DLGLOBAL		RTLD_GLOBAL
X#else
X#  ifdef DL_GLOBAL
X#    define LT_DLGLOBAL		DL_GLOBAL
X#  else
X#    define LT_DLGLOBAL		0
X#  endif
X#endif
X
X/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
X   find out it does not work in some platform. */
X#ifndef LT_DLLAZY_OR_NOW
X#  ifdef RTLD_LAZY
X#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
X#  else
X#    ifdef DL_LAZY
X#      define LT_DLLAZY_OR_NOW		DL_LAZY
X#    else
X#      ifdef RTLD_NOW
X#        define LT_DLLAZY_OR_NOW	RTLD_NOW
X#      else
X#        ifdef DL_NOW
X#          define LT_DLLAZY_OR_NOW	DL_NOW
X#        else
X#          define LT_DLLAZY_OR_NOW	0
X#        endif
X#      endif
X#    endif
X#  endif
X#endif
X
X#ifdef __cplusplus
Xextern "C" void exit (int);
X#endif
X
Xvoid fnord() { int i=42;}
Xint main ()
X{
X  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
X  int status = $lt_dlunknown;
X
X  if (self)
X    {
X      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
X      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
X      /* dlclose (self); */
X    }
X
X    exit (status);
X}
XEOF
X  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
X    (./conftest; exit; ) 2>/dev/null
X    lt_status=$?
X    case x$lt_status in
X      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
X      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
X      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
X    esac
X  else :
X    # compilation failed
X    lt_cv_dlopen_self_static=no
X  fi
Xfi
Xrm -fr conftest*
X
X
Xfi
Xecho "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
Xecho "${ECHO_T}$lt_cv_dlopen_self_static" >&6
X    fi
X
X    CPPFLAGS="$save_CPPFLAGS"
X    LDFLAGS="$save_LDFLAGS"
X    LIBS="$save_LIBS"
X    ;;
X  esac
X
X  case $lt_cv_dlopen_self in
X  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
X  *) enable_dlopen_self=unknown ;;
X  esac
X
X  case $lt_cv_dlopen_self_static in
X  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
X  *) enable_dlopen_self_static=unknown ;;
X  esac
Xfi
X
X
X# Report which librarie types wil actually be built
Xecho "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
Xecho $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
Xecho "$as_me:$LINENO: result: $can_build_shared" >&5
Xecho "${ECHO_T}$can_build_shared" >&6
X
Xecho "$as_me:$LINENO: checking whether to build shared libraries" >&5
Xecho $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6
Xtest "$can_build_shared" = "no" && enable_shared=no
X
X# On AIX, shared libraries and static libraries use the same namespace, and
X# are all built from PIC.
Xcase "$host_os" in
Xaix3*)
X  test "$enable_shared" = yes && enable_static=no
X  if test -n "$RANLIB"; then
X    archive_cmds="$archive_cmds~\$RANLIB \$lib"
X    postinstall_cmds='$RANLIB $lib'
X  fi
X  ;;
X
Xaix4*)
X  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
X    test "$enable_shared" = yes && enable_static=no
X  fi
X  ;;
X  darwin* | rhapsody*)
X  if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
X    archive_cmds_need_lc=no
X    case "$host_os" in
X    rhapsody* | darwin1.[012])
X      allow_undefined_flag='-undefined suppress'
X      ;;
X    *) # Darwin 1.3 on
X      test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag='-flat_namespace -undefined suppress'
X      ;;
X    esac
X    # FIXME: Relying on posixy $() will cause problems for
X    #        cross-compilation, but unfortunately the echo tests do not
X    #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
X    #	       `"' quotes if we put them in here... so don't!
X		output_verbose_link_cmd='echo'
X    archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring'
X    module_cmds='$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags'
X    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
X		  archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag  -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
X		  module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag  -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
X    hardcode_direct=no
X    hardcode_automatic=yes
X    hardcode_shlibpath_var=unsupported
X    whole_archive_flag_spec='-all_load $convenience'
X    link_all_deplibs=yes
X    fi
X    ;;
Xesac
Xecho "$as_me:$LINENO: result: $enable_shared" >&5
Xecho "${ECHO_T}$enable_shared" >&6
X
Xecho "$as_me:$LINENO: checking whether to build static libraries" >&5
Xecho $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
X# Make sure either enable_shared or enable_static is yes.
Xtest "$enable_shared" = yes || enable_static=yes
Xecho "$as_me:$LINENO: result: $enable_static" >&5
Xecho "${ECHO_T}$enable_static" >&6
X
X# The else clause should only fire when bootstrapping the
X# libtool distribution, otherwise you forgot to ship ltmain.sh
X# with your package, and you will get complaints that there are
X# no rules to generate ltmain.sh.
Xif test -f "$ltmain"; then
X  # See if we are running on zsh, and set the options which allow our commands through
X  # without removal of \ escapes.
X  if test -n "${ZSH_VERSION+set}" ; then
X    setopt NO_GLOB_SUBST
X  fi
X  # Now quote all the things that may contain metacharacters while being
X  # careful not to overquote the AC_SUBSTed values.  We take copies of the
X  # variables and quote the copies for generation of the libtool script.
X  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \
X    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
X    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
X    deplibs_check_method reload_flag reload_cmds need_locks \
X    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
X    lt_cv_sys_global_symbol_to_c_name_address \
X    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
X    old_postinstall_cmds old_postuninstall_cmds \
X    compiler \
X    CC \
X    LD \
X    lt_prog_compiler_wl \
X    lt_prog_compiler_pic \
X    lt_prog_compiler_static \
X    lt_prog_compiler_no_builtin_flag \
X    export_dynamic_flag_spec \
X    thread_safe_flag_spec \
X    whole_archive_flag_spec \
X    enable_shared_with_static_runtimes \
X    old_archive_cmds \
X    old_archive_from_new_cmds \
X    predep_objects \
X    postdep_objects \
X    predeps \
X    postdeps \
X    compiler_lib_search_path \
X    archive_cmds \
X    archive_expsym_cmds \
X    postinstall_cmds \
X    postuninstall_cmds \
X    old_archive_from_expsyms_cmds \
X    allow_undefined_flag \
X    no_undefined_flag \
X    export_symbols_cmds \
X    hardcode_libdir_flag_spec \
X    hardcode_libdir_flag_spec_ld \
X    hardcode_libdir_separator \
X    hardcode_automatic \
X    module_cmds \
X    module_expsym_cmds \
X    lt_cv_prog_compiler_c_o \
X    exclude_expsyms \
X    include_expsyms; do
X
X    case $var in
X    old_archive_cmds | \
X    old_archive_from_new_cmds | \
X    archive_cmds | \
X    archive_expsym_cmds | \
X    module_cmds | \
X    module_expsym_cmds | \
X    old_archive_from_expsyms_cmds | \
X    export_symbols_cmds | \
X    extract_expsyms_cmds | reload_cmds | finish_cmds | \
X    postinstall_cmds | postuninstall_cmds | \
X    old_postinstall_cmds | old_postuninstall_cmds | \
X    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
X      # Double-quote double-evaled strings.
X      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
X      ;;
X    *)
X      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
X      ;;
X    esac
X  done
X
X  case $lt_echo in
X  *'\$0 --fallback-echo"')
X    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
X    ;;
X  esac
X
Xcfgfile="${ofile}T"
X  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
X  $rm -f "$cfgfile"
X  { echo "$as_me:$LINENO: creating $ofile" >&5
Xecho "$as_me: creating $ofile" >&6;}
X
X  cat <<__EOF__ >> "$cfgfile"
X#! $SHELL
X
X# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
X# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
X# NOTE: Changes made to this file will be lost: look at ltmain.sh.
X#
X# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
X# Free Software Foundation, Inc.
X#
X# This file is part of GNU Libtool:
X# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
X#
X# This program is free software; you can redistribute it and/or modify
X# it under the terms of the GNU General Public License as published by
X# the Free Software Foundation; either version 2 of the License, or
X# (at your option) any later version.
X#
X# This program is distributed in the hope that it will be useful, but
X# WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
X# General Public License for more details.
X#
X# You should have received a copy of the GNU General Public License
X# along with this program; if not, write to the Free Software
X# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
X#
X# As a special exception to the GNU General Public License, if you
X# distribute this file as part of a program that contains a
X# configuration script generated by Autoconf, you may include it under
X# the same distribution terms that you use for the rest of that program.
X
X# A sed program that does not truncate output.
XSED=$lt_SED
X
X# Sed that helps us avoid accidentally triggering echo(1) options like -n.
XXsed="$SED -e s/^X//"
X
X# The HP-UX ksh and POSIX shell print the target directory to stdout
X# if CDPATH is set.
Xif test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
X
X# The names of the tagged configurations supported by this script.
Xavailable_tags=
X
X# ### BEGIN LIBTOOL CONFIG
X
X# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
X
X# Shell to use when invoking shell scripts.
XSHELL=$lt_SHELL
X
X# Whether or not to build shared libraries.
Xbuild_libtool_libs=$enable_shared
X
X# Whether or not to build static libraries.
Xbuild_old_libs=$enable_static
X
X# Whether or not to add -lc for building shared libraries.
Xbuild_libtool_need_lc=$archive_cmds_need_lc
X
X# Whether or not to disallow shared libs when runtime libs are static
Xallow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
X
X# Whether or not to optimize for fast installation.
Xfast_install=$enable_fast_install
X
X# The host system.
Xhost_alias=$host_alias
Xhost=$host
X
X# An echo program that does not interpret backslashes.
Xecho=$lt_echo
X
X# The archiver.
XAR=$lt_AR
XAR_FLAGS=$lt_AR_FLAGS
X
X# A C compiler.
XLTCC=$lt_LTCC
X
X# A language-specific compiler.
XCC=$lt_compiler
X
X# Is the compiler the GNU C compiler?
Xwith_gcc=$GCC
X
X# An ERE matcher.
XEGREP=$lt_EGREP
X
X# The linker used to build libraries.
XLD=$lt_LD
X
X# Whether we need hard or soft links.
XLN_S=$lt_LN_S
X
X# A BSD-compatible nm program.
XNM=$lt_NM
X
X# A symbol stripping program
XSTRIP=$STRIP
X
X# Used to examine libraries when file_magic_cmd begins "file"
XMAGIC_CMD=$MAGIC_CMD
X
X# Used on cygwin: DLL creation program.
XDLLTOOL="$DLLTOOL"
X
X# Used on cygwin: object dumper.
XOBJDUMP="$OBJDUMP"
X
X# Used on cygwin: assembler.
XAS="$AS"
X
X# The name of the directory that contains temporary libtool files.
Xobjdir=$objdir
X
X# How to create reloadable object files.
Xreload_flag=$lt_reload_flag
Xreload_cmds=$lt_reload_cmds
X
X# How to pass a linker flag through the compiler.
Xwl=$lt_lt_prog_compiler_wl
X
X# Object file suffix (normally "o").
Xobjext="$ac_objext"
X
X# Old archive suffix (normally "a").
Xlibext="$libext"
X
X# Shared library suffix (normally ".so").
Xshrext='$shrext'
X
X# Executable file suffix (normally "").
Xexeext="$exeext"
X
X# Additional compiler flags for building library objects.
Xpic_flag=$lt_lt_prog_compiler_pic
Xpic_mode=$pic_mode
X
X# What is the maximum length of a command?
Xmax_cmd_len=$lt_cv_sys_max_cmd_len
X
X# Does compiler simultaneously support -c and -o options?
Xcompiler_c_o=$lt_lt_cv_prog_compiler_c_o
X
X# Must we lock files when doing compilation ?
Xneed_locks=$lt_need_locks
X
X# Do we need the lib prefix for modules?
Xneed_lib_prefix=$need_lib_prefix
X
X# Do we need a version for libraries?
Xneed_version=$need_version
X
X# Whether dlopen is supported.
Xdlopen_support=$enable_dlopen
X
X# Whether dlopen of programs is supported.
Xdlopen_self=$enable_dlopen_self
X
X# Whether dlopen of statically linked programs is supported.
Xdlopen_self_static=$enable_dlopen_self_static
X
X# Compiler flag to prevent dynamic linking.
Xlink_static_flag=$lt_lt_prog_compiler_static
X
X# Compiler flag to turn off builtin functions.
Xno_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
X
X# Compiler flag to allow reflexive dlopens.
Xexport_dynamic_flag_spec=$lt_export_dynamic_flag_spec
X
X# Compiler flag to generate shared objects directly from archives.
Xwhole_archive_flag_spec=$lt_whole_archive_flag_spec
X
X# Compiler flag to generate thread-safe objects.
Xthread_safe_flag_spec=$lt_thread_safe_flag_spec
X
X# Library versioning type.
Xversion_type=$version_type
X
X# Format of library name prefix.
Xlibname_spec=$lt_libname_spec
X
X# List of archive names.  First name is the real one, the rest are links.
X# The last name is the one that the linker finds with -lNAME.
Xlibrary_names_spec=$lt_library_names_spec
X
X# The coded name of the library, if different from the real name.
Xsoname_spec=$lt_soname_spec
X
X# Commands used to build and install an old-style archive.
XRANLIB=$lt_RANLIB
Xold_archive_cmds=$lt_old_archive_cmds
Xold_postinstall_cmds=$lt_old_postinstall_cmds
Xold_postuninstall_cmds=$lt_old_postuninstall_cmds
X
X# Create an old-style archive from a shared archive.
Xold_archive_from_new_cmds=$lt_old_archive_from_new_cmds
X
X# Create a temporary old-style archive to link instead of a shared archive.
Xold_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
X
X# Commands used to build and install a shared archive.
Xarchive_cmds=$lt_archive_cmds
Xarchive_expsym_cmds=$lt_archive_expsym_cmds
Xpostinstall_cmds=$lt_postinstall_cmds
Xpostuninstall_cmds=$lt_postuninstall_cmds
X
X# Commands used to build a loadable module (assumed same as above if empty)
Xmodule_cmds=$lt_module_cmds
Xmodule_expsym_cmds=$lt_module_expsym_cmds
X
X# Commands to strip libraries.
Xold_striplib=$lt_old_striplib
Xstriplib=$lt_striplib
X
X# Dependencies to place before the objects being linked to create a
X# shared library.
Xpredep_objects=$lt_predep_objects
X
X# Dependencies to place after the objects being linked to create a
X# shared library.
Xpostdep_objects=$lt_postdep_objects
X
X# Dependencies to place before the objects being linked to create a
X# shared library.
Xpredeps=$lt_predeps
X
X# Dependencies to place after the objects being linked to create a
X# shared library.
Xpostdeps=$lt_postdeps
X
X# The library search path used internally by the compiler when linking
X# a shared library.
Xcompiler_lib_search_path=$lt_compiler_lib_search_path
X
X# Method to check whether dependent libraries are shared objects.
Xdeplibs_check_method=$lt_deplibs_check_method
X
X# Command to use when deplibs_check_method == file_magic.
Xfile_magic_cmd=$lt_file_magic_cmd
X
X# Flag that allows shared libraries with undefined symbols to be built.
Xallow_undefined_flag=$lt_allow_undefined_flag
X
X# Flag that forces no undefined symbols.
Xno_undefined_flag=$lt_no_undefined_flag
X
X# Commands used to finish a libtool library installation in a directory.
Xfinish_cmds=$lt_finish_cmds
X
X# Same as above, but a single script fragment to be evaled but not shown.
Xfinish_eval=$lt_finish_eval
X
X# Take the output of nm and produce a listing of raw symbols and C names.
Xglobal_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
X
X# Transform the output of nm in a proper C declaration
Xglobal_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
X
X# Transform the output of nm in a C name address pair
Xglobal_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
X
X# This is the shared library runtime path variable.
Xrunpath_var=$runpath_var
X
X# This is the shared library path variable.
Xshlibpath_var=$shlibpath_var
X
X# Is shlibpath searched before the hard-coded library search path?
Xshlibpath_overrides_runpath=$shlibpath_overrides_runpath
X
X# How to hardcode a shared library path into an executable.
Xhardcode_action=$hardcode_action
X
X# Whether we should hardcode library paths into libraries.
Xhardcode_into_libs=$hardcode_into_libs
X
X# Flag to hardcode \$libdir into a binary during linking.
X# This must work even if \$libdir does not exist.
Xhardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
X
X# If ld is used when linking, flag to hardcode \$libdir into
X# a binary during linking. This must work even if \$libdir does
X# not exist.
Xhardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
X
X# Whether we need a single -rpath flag with a separated argument.
Xhardcode_libdir_separator=$lt_hardcode_libdir_separator
X
X# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
X# resulting binary.
Xhardcode_direct=$hardcode_direct
X
X# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
X# resulting binary.
Xhardcode_minus_L=$hardcode_minus_L
X
X# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
X# the resulting binary.
Xhardcode_shlibpath_var=$hardcode_shlibpath_var
X
X# Set to yes if building a shared library automatically hardcodes DIR into the library
X# and all subsequent libraries and executables linked against it.
Xhardcode_automatic=$hardcode_automatic
X
X# Variables whose values should be saved in libtool wrapper scripts and
X# restored at relink time.
Xvariables_saved_for_relink="$variables_saved_for_relink"
X
X# Whether libtool must link a program against all its dependency libraries.
Xlink_all_deplibs=$link_all_deplibs
X
X# Compile-time system search path for libraries
Xsys_lib_search_path_spec=$lt_sys_lib_search_path_spec
X
X# Run-time system search path for libraries
Xsys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
X
X# Fix the shell variable \$srcfile for the compiler.
Xfix_srcfile_path="$fix_srcfile_path"
X
X# Set to yes if exported symbols are required.
Xalways_export_symbols=$always_export_symbols
X
X# The commands to list exported symbols.
Xexport_symbols_cmds=$lt_export_symbols_cmds
X
X# The commands to extract the exported symbol list from a shared archive.
Xextract_expsyms_cmds=$lt_extract_expsyms_cmds
X
X# Symbols that should not be listed in the preloaded symbols.
Xexclude_expsyms=$lt_exclude_expsyms
X
X# Symbols that must always be exported.
Xinclude_expsyms=$lt_include_expsyms
X
X# ### END LIBTOOL CONFIG
X
X__EOF__
X
X
X  case $host_os in
X  aix3*)
X    cat <<\EOF >> "$cfgfile"
X
X# AIX sometimes has problems with the GCC collect2 program.  For some
X# reason, if we set the COLLECT_NAMES environment variable, the problems
X# vanish in a puff of smoke.
Xif test "X${COLLECT_NAMES+set}" != Xset; then
X  COLLECT_NAMES=
X  export COLLECT_NAMES
Xfi
XEOF
X    ;;
X  esac
X
X  # We use sed instead of cat because bash on DJGPP gets confused if
X  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
X  # text mode, it properly converts lines to CR/LF.  This bash problem
X  # is reportedly fixed, but why not run on old versions too?
X  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
X
X  mv -f "$cfgfile" "$ofile" || \
X    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
X  chmod +x "$ofile"
X
Xelse
X  # If there is no Makefile yet, we rely on a make rule to execute
X  # `config.status --recheck' to rerun these tests and create the
X  # libtool script then.
X  test -f Makefile && make "$ltmain"
Xfi
X
X
Xac_ext=c
Xac_cpp='$CPP $CPPFLAGS'
Xac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
Xac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
Xac_compiler_gnu=$ac_cv_c_compiler_gnu
X
XCC="$lt_save_CC"
X
X
X# Check whether --with-tags or --without-tags was given.
Xif test "${with_tags+set}" = set; then
X  withval="$with_tags"
X  tagnames="$withval"
Xfi;
X
Xif test -f "$ltmain" && test -n "$tagnames"; then
X  if test ! -f "${ofile}"; then
X    { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5
Xecho "$as_me: WARNING: output file \`$ofile' does not exist" >&2;}
X  fi
X
X  if test -z "$LTCC"; then
X    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
X    if test -z "$LTCC"; then
X      { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5
Xecho "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;}
X    else
X      { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5
Xecho "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;}
X    fi
X  fi
X
X  # Extract list of available tagged configurations in $ofile.
X  # Note that this assumes the entire list is on one line.
X  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
X
X  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
X  for tagname in $tagnames; do
X    IFS="$lt_save_ifs"
X    # Check whether tagname contains only valid characters
X    case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in
X    "") ;;
X    *)  { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5
Xecho "$as_me: error: invalid tag name: $tagname" >&2;}
X   { (exit 1); exit 1; }; }
X	;;
X    esac
X
X    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
X    then
X      { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5
Xecho "$as_me: error: tag name \"$tagname\" already exists" >&2;}
X   { (exit 1); exit 1; }; }
X    fi
X
X    # Update the list of available tags.
X    if test -n "$tagname"; then
X      echo appending configuration tag \"$tagname\" to $ofile
X
X      case $tagname in
X      CXX)
X	if test -n "$CXX" && test "X$CXX" != "Xno"; then
X	  ac_ext=cc
Xac_cpp='$CXXCPP $CPPFLAGS'
Xac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
Xac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
Xac_compiler_gnu=$ac_cv_cxx_compiler_gnu
X
X
X
X
Xarchive_cmds_need_lc_CXX=no
Xallow_undefined_flag_CXX=
Xalways_export_symbols_CXX=no
Xarchive_expsym_cmds_CXX=
Xexport_dynamic_flag_spec_CXX=
Xhardcode_direct_CXX=no
Xhardcode_libdir_flag_spec_CXX=
Xhardcode_libdir_flag_spec_ld_CXX=
Xhardcode_libdir_separator_CXX=
Xhardcode_minus_L_CXX=no
Xhardcode_automatic_CXX=no
Xmodule_cmds_CXX=
Xmodule_expsym_cmds_CXX=
Xlink_all_deplibs_CXX=unknown
Xold_archive_cmds_CXX=$old_archive_cmds
Xno_undefined_flag_CXX=
Xwhole_archive_flag_spec_CXX=
Xenable_shared_with_static_runtimes_CXX=no
X
X# Dependencies to place before and after the object being linked:
Xpredep_objects_CXX=
Xpostdep_objects_CXX=
Xpredeps_CXX=
Xpostdeps_CXX=
Xcompiler_lib_search_path_CXX=
X
X# Source file extension for C++ test sources.
Xac_ext=cc
X
X# Object file extension for compiled C++ test sources.
Xobjext=o
Xobjext_CXX=$objext
X
X# Code to be used in simple compile tests
Xlt_simple_compile_test_code="int some_variable = 0;\n"
X
X# Code to be used in simple link tests
Xlt_simple_link_test_code='int main(int, char *) { return(0); }\n'
X
X# ltmain only uses $CC for tagged configurations so make sure $CC is set.
X
X# If no C compiler was specified, use CC.
XLTCC=${LTCC-"$CC"}
X
X# Allow CC to be a program name with arguments.
Xcompiler=$CC
X
X
X# Allow CC to be a program name with arguments.
Xlt_save_CC=$CC
Xlt_save_LD=$LD
Xlt_save_GCC=$GCC
XGCC=$GXX
Xlt_save_with_gnu_ld=$with_gnu_ld
Xlt_save_path_LD=$lt_cv_path_LD
Xif test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
X  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
Xelse
X  unset lt_cv_prog_gnu_ld
Xfi
Xif test -n "${lt_cv_path_LDCXX+set}"; then
X  lt_cv_path_LD=$lt_cv_path_LDCXX
Xelse
X  unset lt_cv_path_LD
Xfi
Xtest -z "${LDCXX+set}" || LD=$LDCXX
XCC=${CXX-"c++"}
Xcompiler=$CC
Xcompiler_CXX=$CC
Xcc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
X
X# We don't want -fno-exception wen compiling C++ code, so set the
X# no_builtin_flag separately
Xif test "$GXX" = yes; then
X  lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
Xelse
X  lt_prog_compiler_no_builtin_flag_CXX=
Xfi
X
Xif test "$GXX" = yes; then
X  # Set up default GNU C++ configuration
X
X
X# Check whether --with-gnu-ld or --without-gnu-ld was given.
Xif test "${with_gnu_ld+set}" = set; then
X  withval="$with_gnu_ld"
X  test "$withval" = no || with_gnu_ld=yes
Xelse
X  with_gnu_ld=no
Xfi;
Xac_prog=ld
Xif test "$GCC" = yes; then
X  # Check if gcc -print-prog-name=ld gives a path.
X  echo "$as_me:$LINENO: checking for ld used by $CC" >&5
Xecho $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6
X  case $host in
X  *-*-mingw*)
X    # gcc leaves a trailing carriage return which upsets mingw
X    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
X  *)
X    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
X  esac
X  case $ac_prog in
X    # Accept absolute paths.
X    [\\/]* | ?:[\\/]*)
X      re_direlt='/[^/][^/]*/\.\./'
X      # Canonicalize the path of ld
X      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
X      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
X	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
X      done
X      test -z "$LD" && LD="$ac_prog"
X      ;;
X  "")
X    # If it fails, then pretend we aren't using GCC.
X    ac_prog=ld
X    ;;
X  *)
X    # If it is relative, then search for the first ld in PATH.
X    with_gnu_ld=unknown
X    ;;
X  esac
Xelif test "$with_gnu_ld" = yes; then
X  echo "$as_me:$LINENO: checking for GNU ld" >&5
Xecho $ECHO_N "checking for GNU ld... $ECHO_C" >&6
Xelse
X  echo "$as_me:$LINENO: checking for non-GNU ld" >&5
Xecho $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
Xfi
Xif test "${lt_cv_path_LD+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -z "$LD"; then
X  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
X  for ac_dir in $PATH; do
X    IFS="$lt_save_ifs"
X    test -z "$ac_dir" && ac_dir=.
X    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
X      lt_cv_path_LD="$ac_dir/$ac_prog"
X      # Check to see if the program is GNU ld.  I'd rather use --version,
X      # but apparently some GNU ld's only accept -v.
X      # Break only if it was the GNU/non-GNU ld that we prefer.
X      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
X      *GNU* | *'with BFD'*)
X	test "$with_gnu_ld" != no && break
X	;;
X      *)
X	test "$with_gnu_ld" != yes && break
X	;;
X      esac
X    fi
X  done
X  IFS="$lt_save_ifs"
Xelse
X  lt_cv_path_LD="$LD" # Let the user override the test with a path.
Xfi
Xfi
X
XLD="$lt_cv_path_LD"
Xif test -n "$LD"; then
X  echo "$as_me:$LINENO: result: $LD" >&5
Xecho "${ECHO_T}$LD" >&6
Xelse
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
Xtest -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
Xecho "$as_me: error: no acceptable ld found in \$PATH" >&2;}
X   { (exit 1); exit 1; }; }
Xecho "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
Xecho $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
Xif test "${lt_cv_prog_gnu_ld+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
Xcase `$LD -v 2>&1 </dev/null` in
X*GNU* | *'with BFD'*)
X  lt_cv_prog_gnu_ld=yes
X  ;;
X*)
X  lt_cv_prog_gnu_ld=no
X  ;;
Xesac
Xfi
Xecho "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
Xecho "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
Xwith_gnu_ld=$lt_cv_prog_gnu_ld
X
X
X
X  # Check if GNU C++ uses GNU ld as the underlying linker, since the
X  # archiving commands below assume that GNU ld is being used.
X  if test "$with_gnu_ld" = yes; then
X    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
X    archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
X
X    hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
X    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
X
X    # If archive_cmds runs LD, not CC, wlarc should be empty
X    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
X    #     investigate it a little bit more. (MM)
X    wlarc='${wl}'
X
X    # ancient GNU ld didn't support --whole-archive et. al.
X    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
X	grep 'no-whole-archive' > /dev/null; then
X      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
X    else
X      whole_archive_flag_spec_CXX=
X    fi
X  else
X    with_gnu_ld=no
X    wlarc=
X
X    # A generic and very simple default shared library creation
X    # command for GNU C++ for the case where it uses the native
X    # linker, instead of GNU ld.  If possible, this setting should
X    # overridden to take advantage of the native linker features on
X    # the platform it is being used on.
X    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
X  fi
X
X  # Commands to make compiler produce verbose output that lists
X  # what "hidden" libraries, object files and flags are used when
X  # linking a shared library.
X  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
X
Xelse
X  GXX=no
X  with_gnu_ld=no
X  wlarc=
Xfi
X
X# PORTME: fill in a description of your system's C++ link characteristics
Xecho "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
Xecho $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
Xld_shlibs_CXX=yes
Xcase $host_os in
X  aix3*)
X    # FIXME: insert proper C++ library support
X    ld_shlibs_CXX=no
X    ;;
X  aix4* | aix5*)
X    if test "$host_cpu" = ia64; then
X      # On IA64, the linker does run time linking by default, so we don't
X      # have to do anything special.
X      aix_use_runtimelinking=no
X      exp_sym_flag='-Bexport'
X      no_entry_flag=""
X    else
X      aix_use_runtimelinking=no
X
X      # Test if we are trying to use run time linking or normal
X      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
X      # need to do runtime linking.
X      case $host_os in aix4.[23]|aix4.[23].*|aix5*)
X	for ld_flag in $LDFLAGS; do
X	  case $ld_flag in
X	  *-brtl*)
X	    aix_use_runtimelinking=yes
X	    break
X	    ;;
X	  esac
X	done
X      esac
X
X      exp_sym_flag='-bexport'
X      no_entry_flag='-bnoentry'
X    fi
X
X    # When large executables or shared objects are built, AIX ld can
X    # have problems creating the table of contents.  If linking a library
X    # or program results in "error TOC overflow" add -mminimal-toc to
X    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
X    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
X
X    archive_cmds_CXX=''
X    hardcode_direct_CXX=yes
X    hardcode_libdir_separator_CXX=':'
X    link_all_deplibs_CXX=yes
X
X    if test "$GXX" = yes; then
X      case $host_os in aix4.012|aix4.012.*)
X      # We only want to do this on AIX 4.2 and lower, the check
X      # below for broken collect2 doesn't work under 4.3+
X	collect2name=`${CC} -print-prog-name=collect2`
X	if test -f "$collect2name" && \
X	   strings "$collect2name" | grep resolve_lib_name >/dev/null
X	then
X	  # We have reworked collect2
X	  hardcode_direct_CXX=yes
X	else
X	  # We have old collect2
X	  hardcode_direct_CXX=unsupported
X	  # It fails to find uninstalled libraries when the uninstalled
X	  # path is not listed in the libpath.  Setting hardcode_minus_L
X	  # to unsupported forces relinking
X	  hardcode_minus_L_CXX=yes
X	  hardcode_libdir_flag_spec_CXX='-L$libdir'
X	  hardcode_libdir_separator_CXX=
X	fi
X      esac
X      shared_flag='-shared'
X    else
X      # not using gcc
X      if test "$host_cpu" = ia64; then
X	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
X	# chokes on -Wl,-G. The following line is correct:
X	shared_flag='-G'
X      else
X	if test "$aix_use_runtimelinking" = yes; then
X	  shared_flag='${wl}-G'
X	else
X	  shared_flag='${wl}-bM:SRE'
X	fi
X      fi
X    fi
X
X    # It seems that -bexpall does not export symbols beginning with
X    # underscore (_), so it is better to generate a list of symbols to export.
X    always_export_symbols_CXX=yes
X    if test "$aix_use_runtimelinking" = yes; then
X      # Warning - without using the other runtime loading flags (-brtl),
X      # -berok will link without error, but may produce a broken library.
X      allow_undefined_flag_CXX='-berok'
X      # Determine the default libpath from the value encoded in an empty executable.
X      cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X
Xint
Xmain ()
X{
X
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X
Xaix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
X}'`
X# Check for a 64-bit object if we didn't find anything.
Xif test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
X}'`; fi
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xfi
Xrm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
Xif test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
X
X      hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
X
X      archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
X     else
X      if test "$host_cpu" = ia64; then
X	hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
X	allow_undefined_flag_CXX="-z nodefs"
X	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
X      else
X	# Determine the default libpath from the value encoded in an empty executable.
X	cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X
Xint
Xmain ()
X{
X
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X
Xaix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
X}'`
X# Check for a 64-bit object if we didn't find anything.
Xif test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
X}'`; fi
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xfi
Xrm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
Xif test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
X
X	hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
X	# Warning - without using the other run time loading flags,
X	# -berok will link without error, but may produce a broken library.
X	no_undefined_flag_CXX=' ${wl}-bernotok'
X	allow_undefined_flag_CXX=' ${wl}-berok'
X	# -bexpall does not export symbols beginning with underscore (_)
X	always_export_symbols_CXX=yes
X	# Exported symbols can be pulled into shared objects from archives
X	whole_archive_flag_spec_CXX=' '
X	archive_cmds_need_lc_CXX=yes
X	# This is similar to how AIX traditionally builds it's shared libraries.
X	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
X      fi
X    fi
X    ;;
X  chorus*)
X    case $cc_basename in
X      *)
X	# FIXME: insert proper C++ library support
X	ld_shlibs_CXX=no
X	;;
X    esac
X    ;;
X
X  cygwin* | mingw* | pw32*)
X    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
X    # as there is no search path for DLLs.
X    hardcode_libdir_flag_spec_CXX='-L$libdir'
X    allow_undefined_flag_CXX=unsupported
X    always_export_symbols_CXX=no
X    enable_shared_with_static_runtimes_CXX=yes
X
X    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
X      archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
X      # If the export-symbols file already is a .def file (1st line
X      # is EXPORTS), use it as is; otherwise, prepend...
X      archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
X	cp $export_symbols $output_objdir/$soname.def;
X      else
X	echo EXPORTS > $output_objdir/$soname.def;
X	cat $export_symbols >> $output_objdir/$soname.def;
X      fi~
X      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
X    else
X      ld_shlibs_CXX=no
X    fi
X  ;;
X
X  darwin* | rhapsody*)
X   if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
X    archive_cmds_need_lc_CXX=no
X    case "$host_os" in
X    rhapsody* | darwin1.[012])
X      allow_undefined_flag_CXX='-undefined suppress'
X      ;;
X    *) # Darwin 1.3 on
X      test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag_CXX='-flat_namespace -undefined suppress'
X      ;;
X    esac
X    	lt_int_apple_cc_single_mod=no
X    	output_verbose_link_cmd='echo'
X    	if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
X    	  lt_int_apple_cc_single_mod=yes
X    	fi
X    	if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
X    	  archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
X    	else
X        archive_cmds_CXX='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
X      fi
X      module_cmds_CXX='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags'
X
X    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
X      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
X        archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
X      else
X        archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
X      fi
X        module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag  -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
X    hardcode_direct_CXX=no
X    hardcode_automatic_CXX=yes
X    hardcode_shlibpath_var_CXX=unsupported
X    whole_archive_flag_spec_CXX='-all_load $convenience'
X    link_all_deplibs_CXX=yes
X   fi
X    ;;
X
X  dgux*)
X    case $cc_basename in
X      ec++)
X	# FIXME: insert proper C++ library support
X	ld_shlibs_CXX=no
X	;;
X      ghcx)
X	# Green Hills C++ Compiler
X	# FIXME: insert proper C++ library support
X	ld_shlibs_CXX=no
X	;;
X      *)
X	# FIXME: insert proper C++ library support
X	ld_shlibs_CXX=no
X	;;
X    esac
X    ;;
X  freebsd12*)
X    # C++ shared libraries reported to be fairly broken before switch to ELF
X    ld_shlibs_CXX=no
X    ;;
X  freebsd-elf*)
X    archive_cmds_need_lc_CXX=no
X    ;;
X  freebsd*)
X    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
X    # conventions
X    ld_shlibs_CXX=yes
X    ;;
X  gnu*)
X    ;;
X  hpux9*)
X    hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
X    hardcode_libdir_separator_CXX=:
X    export_dynamic_flag_spec_CXX='${wl}-E'
X    hardcode_direct_CXX=yes
X    hardcode_minus_L_CXX=yes # Not in the search PATH,
X				# but as the default
X				# location of the library.
X
X    case $cc_basename in
X    CC)
X      # FIXME: insert proper C++ library support
X      ld_shlibs_CXX=no
X      ;;
X    aCC)
X      archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
X      # Commands to make compiler produce verbose output that lists
X      # what "hidden" libraries, object files and flags are used when
X      # linking a shared library.
X      #
X      # There doesn't appear to be a way to prevent this compiler from
X      # explicitly linking system object files so we need to strip them
X      # from the output so that they don't get included in the library
X      # dependencies.
X      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
X      ;;
X    *)
X      if test "$GXX" = yes; then
X        archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
X      else
X        # FIXME: insert proper C++ library support
X        ld_shlibs_CXX=no
X      fi
X      ;;
X    esac
X    ;;
X  hpux10*|hpux11*)
X    if test $with_gnu_ld = no; then
X      case "$host_cpu" in
X      hppa*64*)
X	hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
X	hardcode_libdir_flag_spec_ld_CXX='+b $libdir'
X	hardcode_libdir_separator_CXX=:
X        ;;
X      ia64*)
X	hardcode_libdir_flag_spec_CXX='-L$libdir'
X        ;;
X      *)
X	hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
X	hardcode_libdir_separator_CXX=:
X	export_dynamic_flag_spec_CXX='${wl}-E'
X        ;;
X      esac
X    fi
X    case "$host_cpu" in
X    hppa*64*)
X      hardcode_direct_CXX=no
X      hardcode_shlibpath_var_CXX=no
X      ;;
X    ia64*)
X      hardcode_direct_CXX=no
X      hardcode_shlibpath_var_CXX=no
X      hardcode_minus_L_CXX=yes # Not in the search PATH,
X					      # but as the default
X					      # location of the library.
X      ;;
X    *)
X      hardcode_direct_CXX=yes
X      hardcode_minus_L_CXX=yes # Not in the search PATH,
X					      # but as the default
X					      # location of the library.
X      ;;
X    esac
X
X    case $cc_basename in
X      CC)
X	# FIXME: insert proper C++ library support
X	ld_shlibs_CXX=no
X	;;
X      aCC)
X	case "$host_cpu" in
X	hppa*64*|ia64*)
X	  archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
X	  ;;
X	*)
X	  archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
X	  ;;
X	esac
X	# Commands to make compiler produce verbose output that lists
X	# what "hidden" libraries, object files and flags are used when
X	# linking a shared library.
X	#
X	# There doesn't appear to be a way to prevent this compiler from
X	# explicitly linking system object files so we need to strip them
X	# from the output so that they don't get included in the library
X	# dependencies.
X	output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
X	;;
X      *)
X	if test "$GXX" = yes; then
X	  if test $with_gnu_ld = no; then
X	    case "$host_cpu" in
X	    ia64*|hppa*64*)
X	      archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
X	      ;;
X	    *)
X	      archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
X	      ;;
X	    esac
X	  fi
X	else
X	  # FIXME: insert proper C++ library support
X	  ld_shlibs_CXX=no
X	fi
X	;;
X    esac
X    ;;
X  irix5* | irix6*)
X    case $cc_basename in
X      CC)
X	# SGI C++
X	archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
X
X	# Archives containing C++ object files must be created using
X	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
X	# necessary to make sure instantiated templates are included
X	# in the archive.
X	old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
X	;;
X      *)
X	if test "$GXX" = yes; then
X	  if test "$with_gnu_ld" = no; then
X	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
X	  else
X	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
X	  fi
X	fi
X	link_all_deplibs_CXX=yes
X	;;
X    esac
X    hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
X    hardcode_libdir_separator_CXX=:
X    ;;
X  linux*)
X    case $cc_basename in
X      KCC)
X	# Kuck and Associates, Inc. (KAI) C++ Compiler
X
X	# KCC will only create a shared library if the output file
X	# ends with ".so" (or ".sl" for HP-UX), so rename the library
X	# to its proper name (with version) after linking.
X	archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
X	archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
X	# Commands to make compiler produce verbose output that lists
X	# what "hidden" libraries, object files and flags are used when
X	# linking a shared library.
X	#
X	# There doesn't appear to be a way to prevent this compiler from
X	# explicitly linking system object files so we need to strip them
X	# from the output so that they don't get included in the library
X	# dependencies.
X	output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
X
X	hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir'
X	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
X
X	# Archives containing C++ object files must be created using
X	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
X	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
X	;;
X      icpc)
X	# Intel C++
X	with_gnu_ld=yes
X	archive_cmds_need_lc_CXX=no
X	archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
X	archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
X	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
X	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
X	whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
X	;;
X      cxx)
X	# Compaq C++
X	archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
X	archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
X
X	runpath_var=LD_RUN_PATH
X	hardcode_libdir_flag_spec_CXX='-rpath $libdir'
X	hardcode_libdir_separator_CXX=:
X
X	# Commands to make compiler produce verbose output that lists
X	# what "hidden" libraries, object files and flags are used when
X	# linking a shared library.
X	#
X	# There doesn't appear to be a way to prevent this compiler from
X	# explicitly linking system object files so we need to strip them
X	# from the output so that they don't get included in the library
X	# dependencies.
X	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
X	;;
X    esac
X    ;;
X  lynxos*)
X    # FIXME: insert proper C++ library support
X    ld_shlibs_CXX=no
X    ;;
X  m88k*)
X    # FIXME: insert proper C++ library support
X    ld_shlibs_CXX=no
X    ;;
X  mvs*)
X    case $cc_basename in
X      cxx)
X	# FIXME: insert proper C++ library support
X	ld_shlibs_CXX=no
X	;;
X      *)
X	# FIXME: insert proper C++ library support
X	ld_shlibs_CXX=no
X	;;
X    esac
X    ;;
X  netbsd*)
X    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
X      archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
X      wlarc=
X      hardcode_libdir_flag_spec_CXX='-R$libdir'
X      hardcode_direct_CXX=yes
X      hardcode_shlibpath_var_CXX=no
X    fi
X    # Workaround some broken pre-1.5 toolchains
X    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
X    ;;
X  osf3*)
X    case $cc_basename in
X      KCC)
X	# Kuck and Associates, Inc. (KAI) C++ Compiler
X
X	# KCC will only create a shared library if the output file
X	# ends with ".so" (or ".sl" for HP-UX), so rename the library
X	# to its proper name (with version) after linking.
X	archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
X
X	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
X	hardcode_libdir_separator_CXX=:
X
X	# Archives containing C++ object files must be created using
X	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
X	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
X
X	;;
X      RCC)
X	# Rational C++ 2.4.1
X	# FIXME: insert proper C++ library support
X	ld_shlibs_CXX=no
X	;;
X      cxx)
X	allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
X	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
X
X	hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
X	hardcode_libdir_separator_CXX=:
X
X	# Commands to make compiler produce verbose output that lists
X	# what "hidden" libraries, object files and flags are used when
X	# linking a shared library.
X	#
X	# There doesn't appear to be a way to prevent this compiler from
X	# explicitly linking system object files so we need to strip them
X	# from the output so that they don't get included in the library
X	# dependencies.
X	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
X	;;
X      *)
X	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
X	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
X	  archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
X
X	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
X	  hardcode_libdir_separator_CXX=:
X
X	  # Commands to make compiler produce verbose output that lists
X	  # what "hidden" libraries, object files and flags are used when
X	  # linking a shared library.
X	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
X
X	else
X	  # FIXME: insert proper C++ library support
X	  ld_shlibs_CXX=no
X	fi
X	;;
X    esac
X    ;;
X  osf4* | osf5*)
X    case $cc_basename in
X      KCC)
X	# Kuck and Associates, Inc. (KAI) C++ Compiler
X
X	# KCC will only create a shared library if the output file
X	# ends with ".so" (or ".sl" for HP-UX), so rename the library
X	# to its proper name (with version) after linking.
X	archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
X
X	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
X	hardcode_libdir_separator_CXX=:
X
X	# Archives containing C++ object files must be created using
X	# the KAI C++ compiler.
X	old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
X	;;
X      RCC)
X	# Rational C++ 2.4.1
X	# FIXME: insert proper C++ library support
X	ld_shlibs_CXX=no
X	;;
X      cxx)
X	allow_undefined_flag_CXX=' -expect_unresolved \*'
X	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
X	archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
X	  echo "-hidden">> $lib.exp~
X	  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version	$verstring` -update_registry $objdir/so_locations -o $lib~
X	  $rm $lib.exp'
X
X	hardcode_libdir_flag_spec_CXX='-rpath $libdir'
X	hardcode_libdir_separator_CXX=:
X
X	# Commands to make compiler produce verbose output that lists
X	# what "hidden" libraries, object files and flags are used when
X	# linking a shared library.
X	#
X	# There doesn't appear to be a way to prevent this compiler from
X	# explicitly linking system object files so we need to strip them
X	# from the output so that they don't get included in the library
X	# dependencies.
X	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
X	;;
X      *)
X	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
X	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
X	 archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
X
X	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
X	  hardcode_libdir_separator_CXX=:
X
X	  # Commands to make compiler produce verbose output that lists
X	  # what "hidden" libraries, object files and flags are used when
X	  # linking a shared library.
X	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
X
X	else
X	  # FIXME: insert proper C++ library support
X	  ld_shlibs_CXX=no
X	fi
X	;;
X    esac
X    ;;
X  psos*)
X    # FIXME: insert proper C++ library support
X    ld_shlibs_CXX=no
X    ;;
X  sco*)
X    archive_cmds_need_lc_CXX=no
X    case $cc_basename in
X      CC)
X	# FIXME: insert proper C++ library support
X	ld_shlibs_CXX=no
X	;;
X      *)
X	# FIXME: insert proper C++ library support
X	ld_shlibs_CXX=no
X	;;
X    esac
X    ;;
X  sunos4*)
X    case $cc_basename in
X      CC)
X	# Sun C++ 4.x
X	# FIXME: insert proper C++ library support
X	ld_shlibs_CXX=no
X	;;
X      lcc)
X	# Lucid
X	# FIXME: insert proper C++ library support
X	ld_shlibs_CXX=no
X	;;
X      *)
X	# FIXME: insert proper C++ library support
X	ld_shlibs_CXX=no
X	;;
X    esac
X    ;;
X  solaris*)
X    case $cc_basename in
X      CC)
X	# Sun C++ 4.2, 5.x and Centerline C++
X	no_undefined_flag_CXX=' -zdefs'
X	archive_cmds_CXX='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
X	archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
X	$CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
X
X	hardcode_libdir_flag_spec_CXX='-R$libdir'
X	hardcode_shlibpath_var_CXX=no
X	case $host_os in
X	  solaris2.0-5 | solaris2.0-5.*) ;;
X	  *)
X	    # The C++ compiler is used as linker so we must use $wl
X	    # flag to pass the commands to the underlying system
X	    # linker.
X	    # Supported since Solaris 2.6 (maybe 2.5.1?)
X	    whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
X	    ;;
X	esac
X	link_all_deplibs_CXX=yes
X
X	# Commands to make compiler produce verbose output that lists
X	# what "hidden" libraries, object files and flags are used when
X	# linking a shared library.
X	#
X	# There doesn't appear to be a way to prevent this compiler from
X	# explicitly linking system object files so we need to strip them
X	# from the output so that they don't get included in the library
X	# dependencies.
X	output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[LR]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
X
X	# Archives containing C++ object files must be created using
X	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
X	# necessary to make sure instantiated templates are included
X	# in the archive.
X	old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
X	;;
X      gcx)
X	# Green Hills C++ Compiler
X	archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
X
X	# The C++ compiler must be used to create the archive.
X	old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
X	;;
X      *)
X	# GNU C++ compiler with Solaris linker
X	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
X	  no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
X	  if $CC --version | grep -v '^2\.7' > /dev/null; then
X	    archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
X	    archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
X		$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
X
X	    # Commands to make compiler produce verbose output that lists
X	    # what "hidden" libraries, object files and flags are used when
X	    # linking a shared library.
X	    output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
X	  else
X	    # g++ 2.7 appears to require `-G' NOT `-shared' on this
X	    # platform.
X	    archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
X	    archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
X		$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
X
X	    # Commands to make compiler produce verbose output that lists
X	    # what "hidden" libraries, object files and flags are used when
X	    # linking a shared library.
X	    output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
X	  fi
X
X	  hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
X	fi
X	;;
X    esac
X    ;;
X  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
X    archive_cmds_need_lc_CXX=no
X    ;;
X  tandem*)
X    case $cc_basename in
X      NCC)
X	# NonStop-UX NCC 3.20
X	# FIXME: insert proper C++ library support
X	ld_shlibs_CXX=no
X	;;
X      *)
X	# FIXME: insert proper C++ library support
X	ld_shlibs_CXX=no
X	;;
X    esac
X    ;;
X  vxworks*)
X    # FIXME: insert proper C++ library support
X    ld_shlibs_CXX=no
X    ;;
X  *)
X    # FIXME: insert proper C++ library support
X    ld_shlibs_CXX=no
X    ;;
Xesac
Xecho "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
Xecho "${ECHO_T}$ld_shlibs_CXX" >&6
Xtest "$ld_shlibs_CXX" = no && can_build_shared=no
X
XGCC_CXX="$GXX"
XLD_CXX="$LD"
X
X
Xcat > conftest.$ac_ext <<EOF
Xclass Foo
X{
Xpublic:
X  Foo (void) { a = 0; }
Xprivate:
X  int a;
X};
XEOF
X
Xif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; then
X  # Parse the compiler output and extract the necessary
X  # objects, libraries and library flags.
X
X  # Sentinel used to keep track of whether or not we are before
X  # the conftest object file.
X  pre_test_object_deps_done=no
X
X  # The `*' in the case matches for architectures that use `case' in
X  # $output_verbose_cmd can trigger glob expansion during the loop
X  # eval without this substitution.
X  output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
X
X  for p in `eval $output_verbose_link_cmd`; do
X    case $p in
X
X    -L* | -R* | -l*)
X       # Some compilers place space between "-{L,R}" and the path.
X       # Remove the space.
X       if test $p = "-L" \
X	  || test $p = "-R"; then
X	 prev=$p
X	 continue
X       else
X	 prev=
X       fi
X
X       if test "$pre_test_object_deps_done" = no; then
X	 case $p in
X	 -L* | -R*)
X	   # Internal compiler library paths should come after those
X	   # provided the user.  The postdeps already come after the
X	   # user supplied libs so there is no need to process them.
X	   if test -z "$compiler_lib_search_path_CXX"; then
X	     compiler_lib_search_path_CXX="${prev}${p}"
X	   else
X	     compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}"
X	   fi
X	   ;;
X	 # The "-l" case would never come before the object being
X	 # linked, so don't bother handling this case.
X	 esac
X       else
X	 if test -z "$postdeps_CXX"; then
X	   postdeps_CXX="${prev}${p}"
X	 else
X	   postdeps_CXX="${postdeps_CXX} ${prev}${p}"
X	 fi
X       fi
X       ;;
X
X    *.$objext)
X       # This assumes that the test object file only shows up
X       # once in the compiler output.
X       if test "$p" = "conftest.$objext"; then
X	 pre_test_object_deps_done=yes
X	 continue
X       fi
X
X       if test "$pre_test_object_deps_done" = no; then
X	 if test -z "$predep_objects_CXX"; then
X	   predep_objects_CXX="$p"
X	 else
X	   predep_objects_CXX="$predep_objects_CXX $p"
X	 fi
X       else
X	 if test -z "$postdep_objects_CXX"; then
X	   postdep_objects_CXX="$p"
X	 else
X	   postdep_objects_CXX="$postdep_objects_CXX $p"
X	 fi
X       fi
X       ;;
X
X    *) ;; # Ignore the rest.
X
X    esac
X  done
X
X  # Clean up.
X  rm -f a.out a.exe
Xelse
X  echo "libtool.m4: error: problem compiling CXX test program"
Xfi
X
X$rm -f confest.$objext
X
Xcase " $postdeps_CXX " in
X*" -lc "*) archive_cmds_need_lc_CXX=no ;;
Xesac
X
Xlt_prog_compiler_wl_CXX=
Xlt_prog_compiler_pic_CXX=
Xlt_prog_compiler_static_CXX=
X
Xecho "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
Xecho $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
X
X  # C++ specific cases for pic, static, wl, etc.
X  if test "$GXX" = yes; then
X    lt_prog_compiler_wl_CXX='-Wl,'
X    lt_prog_compiler_static_CXX='-static'
X
X    case $host_os in
X    aix*)
X      # All AIX code is PIC.
X      if test "$host_cpu" = ia64; then
X	# AIX 5 now supports IA64 processor
X	lt_prog_compiler_static_CXX='-Bstatic'
X      fi
X      ;;
X    amigaos*)
X      # FIXME: we need at least 68020 code to build shared libraries, but
X      # adding the `-m68020' flag to GCC prevents building anything better,
X      # like `-m68040'.
X      lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
X      ;;
X    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
X      # PIC is the default for these OSes.
X      ;;
X    mingw* | os2* | pw32*)
X      # This hack is so that the source file can tell whether it is being
X      # built for inclusion in a dll (and should export symbols for example).
X      lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
X      ;;
X    darwin* | rhapsody*)
X      # PIC is the default on this platform
X      # Common symbols not allowed in MH_DYLIB files
X      lt_prog_compiler_pic_CXX='-fno-common'
X      ;;
X    *djgpp*)
X      # DJGPP does not support shared libraries at all
X      lt_prog_compiler_pic_CXX=
X      ;;
X    sysv4*MP*)
X      if test -d /usr/nec; then
X	lt_prog_compiler_pic_CXX=-Kconform_pic
X      fi
X      ;;
X    hpux*)
X      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
X      # not for PA HP-UX.
X      case "$host_cpu" in
X      hppa*64*|ia64*)
X	;;
X      *)
X	lt_prog_compiler_pic_CXX='-fPIC'
X	;;
X      esac
X      ;;
X    *)
X      lt_prog_compiler_pic_CXX='-fPIC'
X      ;;
X    esac
X  else
X    case $host_os in
X      aix4* | aix5*)
X	# All AIX code is PIC.
X	if test "$host_cpu" = ia64; then
X	  # AIX 5 now supports IA64 processor
X	  lt_prog_compiler_static_CXX='-Bstatic'
X	else
X	  lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
X	fi
X	;;
X      chorus*)
X	case $cc_basename in
X	cxch68)
X	  # Green Hills C++ Compiler
X	  # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
X	  ;;
X	esac
X	;;
X      dgux*)
X	case $cc_basename in
X	  ec++)
X	    lt_prog_compiler_pic_CXX='-KPIC'
X	    ;;
X	  ghcx)
X	    # Green Hills C++ Compiler
X	    lt_prog_compiler_pic_CXX='-pic'
X	    ;;
X	  *)
X	    ;;
X	esac
X	;;
X      freebsd*)
X	# FreeBSD uses GNU C++
X	;;
X      hpux9* | hpux10* | hpux11*)
X	case $cc_basename in
X	  CC)
X	    lt_prog_compiler_wl_CXX='-Wl,'
X	    lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
X	    if test "$host_cpu" != ia64; then
X	      lt_prog_compiler_pic_CXX='+Z'
X	    fi
X	    ;;
X	  aCC)
X	    lt_prog_compiler_wl_CXX='-Wl,'
X	    lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
X	    case "$host_cpu" in
X	    hppa*64*|ia64*)
X	      # +Z the default
X	      ;;
X	    *)
X	      lt_prog_compiler_pic_CXX='+Z'
X	      ;;
X	    esac
X	    ;;
X	  *)
X	    ;;
X	esac
X	;;
X      irix5* | irix6* | nonstopux*)
X	case $cc_basename in
X	  CC)
X	    lt_prog_compiler_wl_CXX='-Wl,'
X	    lt_prog_compiler_static_CXX='-non_shared'
X	    # CC pic flag -KPIC is the default.
X	    ;;
X	  *)
X	    ;;
X	esac
X	;;
X      linux*)
X	case $cc_basename in
X	  KCC)
X	    # KAI C++ Compiler
X	    lt_prog_compiler_wl_CXX='--backend -Wl,'
X	    lt_prog_compiler_pic_CXX='-fPIC'
X	    ;;
X	  icpc)
X	    # Intel C++
X	    lt_prog_compiler_wl_CXX='-Wl,'
X	    lt_prog_compiler_pic_CXX='-KPIC'
X	    lt_prog_compiler_static_CXX='-static'
X	    ;;
X	  cxx)
X	    # Compaq C++
X	    # Make sure the PIC flag is empty.  It appears that all Alpha
X	    # Linux and Compaq Tru64 Unix objects are PIC.
X	    lt_prog_compiler_pic_CXX=
X	    lt_prog_compiler_static_CXX='-non_shared'
X	    ;;
X	  *)
X	    ;;
X	esac
X	;;
X      lynxos*)
X	;;
X      m88k*)
X	;;
X      mvs*)
X	case $cc_basename in
X	  cxx)
X	    lt_prog_compiler_pic_CXX='-W c,exportall'
X	    ;;
X	  *)
X	    ;;
X	esac
X	;;
X      netbsd*)
X	;;
X      osf3* | osf4* | osf5*)
X	case $cc_basename in
X	  KCC)
X	    lt_prog_compiler_wl_CXX='--backend -Wl,'
X	    ;;
X	  RCC)
X	    # Rational C++ 2.4.1
X	    lt_prog_compiler_pic_CXX='-pic'
X	    ;;
X	  cxx)
X	    # Digital/Compaq C++
X	    lt_prog_compiler_wl_CXX='-Wl,'
X	    # Make sure the PIC flag is empty.  It appears that all Alpha
X	    # Linux and Compaq Tru64 Unix objects are PIC.
X	    lt_prog_compiler_pic_CXX=
X	    lt_prog_compiler_static_CXX='-non_shared'
X	    ;;
X	  *)
X	    ;;
X	esac
X	;;
X      psos*)
X	;;
X      sco*)
X	case $cc_basename in
X	  CC)
X	    lt_prog_compiler_pic_CXX='-fPIC'
X	    ;;
X	  *)
X	    ;;
X	esac
X	;;
X      solaris*)
X	case $cc_basename in
X	  CC)
X	    # Sun C++ 4.2, 5.x and Centerline C++
X	    lt_prog_compiler_pic_CXX='-KPIC'
X	    lt_prog_compiler_static_CXX='-Bstatic'
X	    lt_prog_compiler_wl_CXX='-Qoption ld '
X	    ;;
X	  gcx)
X	    # Green Hills C++ Compiler
X	    lt_prog_compiler_pic_CXX='-PIC'
X	    ;;
X	  *)
X	    ;;
X	esac
X	;;
X      sunos4*)
X	case $cc_basename in
X	  CC)
X	    # Sun C++ 4.x
X	    lt_prog_compiler_pic_CXX='-pic'
X	    lt_prog_compiler_static_CXX='-Bstatic'
X	    ;;
X	  lcc)
X	    # Lucid
X	    lt_prog_compiler_pic_CXX='-pic'
X	    ;;
X	  *)
X	    ;;
X	esac
X	;;
X      tandem*)
X	case $cc_basename in
X	  NCC)
X	    # NonStop-UX NCC 3.20
X	    lt_prog_compiler_pic_CXX='-KPIC'
X	    ;;
X	  *)
X	    ;;
X	esac
X	;;
X      unixware*)
X	;;
X      vxworks*)
X	;;
X      *)
X	lt_prog_compiler_can_build_shared_CXX=no
X	;;
X    esac
X  fi
X
Xecho "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
Xecho "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6
X
X#
X# Check to make sure the PIC flag actually works.
X#
Xif test -n "$lt_prog_compiler_pic_CXX"; then
X  echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
Xecho $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6
Xif test "${lt_prog_compiler_pic_works_CXX+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  lt_prog_compiler_pic_works_CXX=no
X  ac_outfile=conftest.$ac_objext
X   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
X   lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
X   # Insert the option either (1) after the last *FLAGS variable, or
X   # (2) before a word containing "conftest.", or (3) at the end.
X   # Note that $ac_compile itself does not contain backslashes and begins
X   # with a dollar sign (not a hyphen), so the echo should work correctly.
X   # The option is referenced via a variable to avoid confusing sed.
X   lt_compile=`echo "$ac_compile" | $SED \
X   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
X   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
X   -e 's:$: $lt_compiler_flag:'`
X   (eval echo "\"\$as_me:10695: $lt_compile\"" >&5)
X   (eval "$lt_compile" 2>conftest.err)
X   ac_status=$?
X   cat conftest.err >&5
X   echo "$as_me:10699: \$? = $ac_status" >&5
X   if (exit $ac_status) && test -s "$ac_outfile"; then
X     # The compiler can only warn and ignore the option if not recognized
X     # So say no if there are warnings
X     if test ! -s conftest.err; then
X       lt_prog_compiler_pic_works_CXX=yes
X     fi
X   fi
X   $rm conftest*
X
Xfi
Xecho "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5
Xecho "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6
X
Xif test x"$lt_prog_compiler_pic_works_CXX" = xyes; then
X    case $lt_prog_compiler_pic_CXX in
X     "" | " "*) ;;
X     *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
X     esac
Xelse
X    lt_prog_compiler_pic_CXX=
X     lt_prog_compiler_can_build_shared_CXX=no
Xfi
X
Xfi
Xcase "$host_os" in
X  # For platforms which do not support PIC, -DPIC is meaningless:
X  *djgpp*)
X    lt_prog_compiler_pic_CXX=
X    ;;
X  *)
X    lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
X    ;;
Xesac
X
Xecho "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
Xecho $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
Xif test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  lt_cv_prog_compiler_c_o_CXX=no
X   $rm -r conftest 2>/dev/null
X   mkdir conftest
X   cd conftest
X   mkdir out
X   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
X
X   # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
X   # that will create temporary files in the current directory regardless of
X   # the output directory.  Thus, making CWD read-only will cause this test
X   # to fail, enabling locking or at least warning the user not to do parallel
X   # builds.
X   chmod -w .
X
X   lt_compiler_flag="-o out/conftest2.$ac_objext"
X   # Insert the option either (1) after the last *FLAGS variable, or
X   # (2) before a word containing "conftest.", or (3) at the end.
X   # Note that $ac_compile itself does not contain backslashes and begins
X   # with a dollar sign (not a hyphen), so the echo should work correctly.
X   lt_compile=`echo "$ac_compile" | $SED \
X   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
X   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
X   -e 's:$: $lt_compiler_flag:'`
X   (eval echo "\"\$as_me:10762: $lt_compile\"" >&5)
X   (eval "$lt_compile" 2>out/conftest.err)
X   ac_status=$?
X   cat out/conftest.err >&5
X   echo "$as_me:10766: \$? = $ac_status" >&5
X   if (exit $ac_status) && test -s out/conftest2.$ac_objext
X   then
X     # The compiler can only warn and ignore the option if not recognized
X     # So say no if there are warnings
X     if test ! -s out/conftest.err; then
X       lt_cv_prog_compiler_c_o_CXX=yes
X     fi
X   fi
X   chmod u+w .
X   $rm conftest* out/*
X   rmdir out
X   cd ..
X   rmdir conftest
X   $rm conftest*
X
Xfi
Xecho "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
Xecho "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6
X
X
Xhard_links="nottested"
Xif test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
X  # do not overwrite the value of need_locks provided by the user
X  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
Xecho $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
X  hard_links=yes
X  $rm conftest*
X  ln conftest.a conftest.b 2>/dev/null && hard_links=no
X  touch conftest.a
X  ln conftest.a conftest.b 2>&5 || hard_links=no
X  ln conftest.a conftest.b 2>/dev/null && hard_links=no
X  echo "$as_me:$LINENO: result: $hard_links" >&5
Xecho "${ECHO_T}$hard_links" >&6
X  if test "$hard_links" = no; then
X    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
Xecho "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
X    need_locks=warn
X  fi
Xelse
X  need_locks=no
Xfi
X
Xecho "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
Xecho $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
X
X  export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
X  case $host_os in
X  aix4* | aix5*)
X    # If we're using GNU nm, then we don't want the "-C" option.
X    # -C means demangle to AIX nm, but means don't demangle with GNU nm
X    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
X      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
X    else
X      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
X    fi
X    ;;
X  pw32*)
X    export_symbols_cmds_CXX="$ltdll_cmds"
X  ;;
X  cygwin* | mingw*)
X    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
X  ;;
X  *)
X    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
X  ;;
X  esac
X
Xecho "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
Xecho "${ECHO_T}$ld_shlibs_CXX" >&6
Xtest "$ld_shlibs_CXX" = no && can_build_shared=no
X
Xvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
Xif test "$GCC" = yes; then
X  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
Xfi
X
X#
X# Do we need to explicitly link libc?
X#
Xcase "x$archive_cmds_need_lc_CXX" in
Xx|xyes)
X  # Assume -lc should be added
X  archive_cmds_need_lc_CXX=yes
X
X  if test "$enable_shared" = yes && test "$GCC" = yes; then
X    case $archive_cmds_CXX in
X    *'~'*)
X      # FIXME: we may have to deal with multi-command sequences.
X      ;;
X    '$CC '*)
X      # Test whether the compiler implicitly links with -lc since on some
X      # systems, -lgcc has to come before -lc. If gcc already passes -lc
X      # to ld, don't add -lc before -lgcc.
X      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
Xecho $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
X      $rm conftest*
X      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
X
X      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } 2>conftest.err; then
X        soname=conftest
X        lib=conftest
X        libobjs=conftest.$ac_objext
X        deplibs=
X        wl=$lt_prog_compiler_wl_CXX
X        compiler_flags=-v
X        linker_flags=-v
X        verstring=
X        output_objdir=.
X        libname=conftest
X        lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
X        allow_undefined_flag_CXX=
X        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
X  (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }
X        then
X	  archive_cmds_need_lc_CXX=no
X        else
X	  archive_cmds_need_lc_CXX=yes
X        fi
X        allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
X      else
X        cat conftest.err 1>&5
X      fi
X      $rm conftest*
X      echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
Xecho "${ECHO_T}$archive_cmds_need_lc_CXX" >&6
X      ;;
X    esac
X  fi
X  ;;
Xesac
X
Xecho "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
Xecho $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
Xhardcode_action_CXX=
Xif test -n "$hardcode_libdir_flag_spec_CXX" || \
X   test -n "$runpath_var CXX" || \
X   test "X$hardcode_automatic_CXX"="Xyes" ; then
X
X  # We can hardcode non-existant directories.
X  if test "$hardcode_direct_CXX" != no &&
X     # If the only mechanism to avoid hardcoding is shlibpath_var, we
X     # have to relink, otherwise we might link with an installed library
X     # when we should be linking with a yet-to-be-installed one
X     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
X     test "$hardcode_minus_L_CXX" != no; then
X    # Linking always hardcodes the temporary library directory.
X    hardcode_action_CXX=relink
X  else
X    # We can link without hardcoding, and we can hardcode nonexisting dirs.
X    hardcode_action_CXX=immediate
X  fi
Xelse
X  # We cannot hardcode anything, or else we can only hardcode existing
X  # directories.
X  hardcode_action_CXX=unsupported
Xfi
Xecho "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
Xecho "${ECHO_T}$hardcode_action_CXX" >&6
X
Xif test "$hardcode_action_CXX" = relink; then
X  # Fast installation is not supported
X  enable_fast_install=no
Xelif test "$shlibpath_overrides_runpath" = yes ||
X     test "$enable_shared" = no; then
X  # Fast installation is not necessary
X  enable_fast_install=needless
Xfi
X
Xstriplib=
Xold_striplib=
Xecho "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
Xecho $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
Xif test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
X  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
X  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
X  echo "$as_me:$LINENO: result: yes" >&5
Xecho "${ECHO_T}yes" >&6
Xelse
X# FIXME - insert some real tests, host_os isn't really good enough
X  case $host_os in
X   darwin*)
X       if test -n "$STRIP" ; then
X         striplib="$STRIP -x"
X         echo "$as_me:$LINENO: result: yes" >&5
Xecho "${ECHO_T}yes" >&6
X       else
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X       ;;
X   *)
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
X    ;;
X  esac
Xfi
X
Xecho "$as_me:$LINENO: checking dynamic linker characteristics" >&5
Xecho $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
Xlibrary_names_spec=
Xlibname_spec='lib$name'
Xsoname_spec=
Xshrext=".so"
Xpostinstall_cmds=
Xpostuninstall_cmds=
Xfinish_cmds=
Xfinish_eval=
Xshlibpath_var=
Xshlibpath_overrides_runpath=unknown
Xversion_type=none
Xdynamic_linker="$host_os ld.so"
Xsys_lib_dlsearch_path_spec="/lib /usr/lib"
Xif test "$GCC" = yes; then
X  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
X  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
X    # if the path contains ";" then we assume it to be the separator
X    # otherwise default to the standard path separator (i.e. ":") - it is
X    # assumed that no part of a normal pathname contains ";" but that should
X    # okay in the real world where ";" in dirpaths is itself problematic.
X    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
X  else
X    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
X  fi
Xelse
X  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
Xfi
Xneed_lib_prefix=unknown
Xhardcode_into_libs=no
X
X# when you set need_version to no, make sure it does not cause -set_version
X# flags to be left without arguments
Xneed_version=unknown
X
Xcase $host_os in
Xaix3*)
X  version_type=linux
X  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
X  shlibpath_var=LIBPATH
X
X  # AIX 3 has no versioning support, so we append a major version to the name.
X  soname_spec='${libname}${release}${shared_ext}$major'
X  ;;
X
Xaix4* | aix5*)
X  version_type=linux
X  need_lib_prefix=no
X  need_version=no
X  hardcode_into_libs=yes
X  if test "$host_cpu" = ia64; then
X    # AIX 5 supports IA64
X    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
X    shlibpath_var=LD_LIBRARY_PATH
X  else
X    # With GCC up to 2.95.x, collect2 would create an import file
X    # for dependence libraries.  The import file would start with
X    # the line `#! .'.  This would cause the generated library to
X    # depend on `.', always an invalid library.  This was fixed in
X    # development snapshots of GCC prior to 3.0.
X    case $host_os in
X      aix4 | aix4.[01] | aix4.[01].*)
X      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
X	   echo ' yes '
X	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
X	:
X      else
X	can_build_shared=no
X      fi
X      ;;
X    esac
X    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
X    # soname into executable. Probably we can add versioning support to
X    # collect2, so additional links can be useful in future.
X    if test "$aix_use_runtimelinking" = yes; then
X      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
X      # instead of lib<name>.a to let people know that these are not
X      # typical AIX shared libraries.
X      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X    else
X      # We preserve .a as extension for shared libraries through AIX4.2
X      # and later when we are not doing run time linking.
X      library_names_spec='${libname}${release}.a $libname.a'
X      soname_spec='${libname}${release}${shared_ext}$major'
X    fi
X    shlibpath_var=LIBPATH
X  fi
X  ;;
X
Xamigaos*)
X  library_names_spec='$libname.ixlibrary $libname.a'
X  # Create ${libname}_ixlibrary.a entries in /sys/libs.
X  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
X  ;;
X
Xbeos*)
X  library_names_spec='${libname}${shared_ext}'
X  dynamic_linker="$host_os ld.so"
X  shlibpath_var=LIBRARY_PATH
X  ;;
X
Xbsdi4*)
X  version_type=linux
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
X  shlibpath_var=LD_LIBRARY_PATH
X  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
X  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
X  # the default ld.so.conf also contains /usr/contrib/lib and
X  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
X  # libtool to hard-code these into programs
X  ;;
X
Xcygwin* | mingw* | pw32*)
X  version_type=windows
X  shrext=".dll"
X  need_version=no
X  need_lib_prefix=no
X
X  case $GCC,$host_os in
X  yes,cygwin* | yes,mingw* | yes,pw32*)
X    library_names_spec='$libname.dll.a'
X    # DLL is installed to $(libdir)/../bin by postinstall_cmds
X    postinstall_cmds='base_file=`basename \${file}`~
X      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
X      dldir=$destdir/`dirname \$dlpath`~
X      test -d \$dldir || mkdir -p \$dldir~
X      $install_prog $dir/$dlname \$dldir/$dlname'
X    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
X      dlpath=$dir/\$dldll~
X       $rm \$dlpath'
X    shlibpath_overrides_runpath=yes
X
X    case $host_os in
X    cygwin*)
X      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
X      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
X      sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib"
X      ;;
X    mingw*)
X      # MinGW DLLs use traditional 'lib' prefix
X      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
X      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
X      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
X        # It is most probably a Windows format PATH printed by
X        # mingw gcc, but we are running on Cygwin. Gcc prints its search
X        # path with ; separators, and with drive letters. We can handle the
X        # drive letters (cygwin fileutils understands them), so leave them,
X        # especially as we might pass files found there to a mingw objdump,
X        # which wouldn't understand a cygwinified path. Ahh.
X        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
X      else
X        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
X      fi
X      ;;
X    pw32*)
X      # pw32 DLLs use 'pw' prefix rather than 'lib'
X      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'
X      ;;
X    esac
X    ;;
X
X  *)
X    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
X    ;;
X  esac
X  dynamic_linker='Win32 ld.exe'
X  # FIXME: first we should search . and the directory the executable is in
X  shlibpath_var=PATH
X  ;;
X
Xdarwin* | rhapsody*)
X  dynamic_linker="$host_os dyld"
X  version_type=darwin
X  need_lib_prefix=no
X  need_version=no
X  # FIXME: Relying on posixy $() will cause problems for
X  #        cross-compilation, but unfortunately the echo tests do not
X  #        yet detect zsh echo's removal of \ escapes.
X  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
X  soname_spec='${libname}${release}${major}$shared_ext'
X  shlibpath_overrides_runpath=yes
X  shlibpath_var=DYLD_LIBRARY_PATH
X  shrext='$(test .$module = .yes && echo .so || echo .dylib)'
X  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
X  if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
X  sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
X  fi
X  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
X  ;;
X
Xdgux*)
X  version_type=linux
X  need_lib_prefix=no
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  shlibpath_var=LD_LIBRARY_PATH
X  ;;
X
Xfreebsd1*)
X  dynamic_linker=no
X  ;;
X
Xfreebsd*)
X  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
X  version_type=freebsd-$objformat
X  case $version_type in
X    freebsd-elf*)
X      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
X      need_version=no
X      need_lib_prefix=no
X      ;;
X    freebsd-*)
X      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
X      need_version=yes
X      ;;
X  esac
X  shlibpath_var=LD_LIBRARY_PATH
X  case $host_os in
X  freebsd2*)
X    shlibpath_overrides_runpath=yes
X    ;;
X  freebsd3.01* | freebsdelf3.01*)
X    shlibpath_overrides_runpath=yes
X    hardcode_into_libs=yes
X    ;;
X  *) # from 3.2 on
X    shlibpath_overrides_runpath=no
X    hardcode_into_libs=yes
X    ;;
X  esac
X  ;;
X
Xgnu*)
X  version_type=linux
X  need_lib_prefix=no
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  shlibpath_var=LD_LIBRARY_PATH
X  hardcode_into_libs=yes
X  ;;
X
Xhpux9* | hpux10* | hpux11*)
X  # Give a soname corresponding to the major version so that dld.sl refuses to
X  # link against other versions.
X  version_type=sunos
X  need_lib_prefix=no
X  need_version=no
X  case "$host_cpu" in
X  ia64*)
X    shrext='.so'
X    hardcode_into_libs=yes
X    dynamic_linker="$host_os dld.so"
X    shlibpath_var=LD_LIBRARY_PATH
X    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
X    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X    soname_spec='${libname}${release}${shared_ext}$major'
X    if test "X$HPUX_IA64_MODE" = X32; then
X      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
X    else
X      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
X    fi
X    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
X    ;;
X   hppa*64*)
X     shrext='.sl'
X     hardcode_into_libs=yes
X     dynamic_linker="$host_os dld.sl"
X     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
X     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
X     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X     soname_spec='${libname}${release}${shared_ext}$major'
X     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
X     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
X     ;;
X   *)
X    shrext='.sl'
X    dynamic_linker="$host_os dld.sl"
X    shlibpath_var=SHLIB_PATH
X    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
X    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X    soname_spec='${libname}${release}${shared_ext}$major'
X    ;;
X  esac
X  # HP-UX runs *really* slowly unless shared libraries are mode 555.
X  postinstall_cmds='chmod 555 $lib'
X  ;;
X
Xirix5* | irix6* | nonstopux*)
X  case $host_os in
X    nonstopux*) version_type=nonstopux ;;
X    *)
X	if test "$lt_cv_prog_gnu_ld" = yes; then
X		version_type=linux
X	else
X		version_type=irix
X	fi ;;
X  esac
X  need_lib_prefix=no
X  need_version=no
X  soname_spec='${libname}${release}${shared_ext}$major'
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
X  case $host_os in
X  irix5* | nonstopux*)
X    libsuff= shlibsuff=
X    ;;
X  *)
X    case $LD in # libtool.m4 will add one of these switches to LD
X    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
X      libsuff= shlibsuff= libmagic=32-bit;;
X    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
X      libsuff=32 shlibsuff=N32 libmagic=N32;;
X    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
X      libsuff=64 shlibsuff=64 libmagic=64-bit;;
X    *) libsuff= shlibsuff= libmagic=never-match;;
X    esac
X    ;;
X  esac
X  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
X  shlibpath_overrides_runpath=no
X  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
X  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
X  hardcode_into_libs=yes
X  ;;
X
X# No shared lib support for Linux oldld, aout, or coff.
Xlinux*oldld* | linux*aout* | linux*coff*)
X  dynamic_linker=no
X  ;;
X
X# This must be Linux ELF.
Xlinux*)
X  version_type=linux
X  need_lib_prefix=no
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
X  shlibpath_var=LD_LIBRARY_PATH
X  shlibpath_overrides_runpath=no
X  # This implies no fast_install, which is unacceptable.
X  # Some rework will be needed to allow for fast_install
X  # before this can be enabled.
X  hardcode_into_libs=yes
X
X  # We used to test for /lib/ld.so.1 and disable shared libraries on
X  # powerpc, because MkLinux only supported shared libraries with the
X  # GNU dynamic linker.  Since this was broken with cross compilers,
X  # most powerpc-linux boxes support dynamic linking these days and
X  # people can always --disable-shared, the test was removed, and we
X  # assume the GNU/Linux dynamic linker is in use.
X  dynamic_linker='GNU/Linux ld.so'
X
X  # Find out which ABI we are using (multilib Linux x86_64 hack).
X  libsuff=
X  case "$host_cpu" in
X  x86_64*|s390x*|powerpc64*)
X    echo '#line 11333 "configure"' > conftest.$ac_ext
X    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; then
X      case `/usr/bin/file conftest.$ac_objext` in
X      *64-bit*)
X        libsuff=64
X        ;;
X      esac
X    fi
X    rm -rf conftest*
X    ;;
X  *)
X    ;;
X  esac
X  sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
X  sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
X  ;;
X
Xnetbsd*)
X  version_type=sunos
X  need_lib_prefix=no
X  need_version=no
X  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
X    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
X    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
X    dynamic_linker='NetBSD (a.out) ld.so'
X  else
X    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}'
X    soname_spec='${libname}${release}${shared_ext}$major'
X    dynamic_linker='NetBSD ld.elf_so'
X  fi
X  shlibpath_var=LD_LIBRARY_PATH
X  shlibpath_overrides_runpath=yes
X  hardcode_into_libs=yes
X  ;;
X
Xnewsos6)
X  version_type=linux
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  shlibpath_var=LD_LIBRARY_PATH
X  shlibpath_overrides_runpath=yes
X  ;;
X
Xnto-qnx)
X  version_type=linux
X  need_lib_prefix=no
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  shlibpath_var=LD_LIBRARY_PATH
X  shlibpath_overrides_runpath=yes
X  ;;
X
Xopenbsd*)
X  version_type=sunos
X  need_lib_prefix=no
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
X  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
X  shlibpath_var=LD_LIBRARY_PATH
X  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
X    case $host_os in
X      openbsd2.[89] | openbsd2.[89].*)
X	shlibpath_overrides_runpath=no
X	;;
X      *)
X	shlibpath_overrides_runpath=yes
X	;;
X      esac
X  else
X    shlibpath_overrides_runpath=yes
X  fi
X  ;;
X
Xos2*)
X  libname_spec='$name'
X  shrext=".dll"
X  need_lib_prefix=no
X  library_names_spec='$libname${shared_ext} $libname.a'
X  dynamic_linker='OS/2 ld.exe'
X  shlibpath_var=LIBPATH
X  ;;
X
Xosf3* | osf4* | osf5*)
X  version_type=osf
X  need_lib_prefix=no
X  need_version=no
X  soname_spec='${libname}${release}${shared_ext}$major'
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  shlibpath_var=LD_LIBRARY_PATH
X  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
X  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
X  ;;
X
Xsco3.2v5*)
X  version_type=osf
X  soname_spec='${libname}${release}${shared_ext}$major'
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  shlibpath_var=LD_LIBRARY_PATH
X  ;;
X
Xsolaris*)
X  version_type=linux
X  need_lib_prefix=no
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  shlibpath_var=LD_LIBRARY_PATH
X  shlibpath_overrides_runpath=yes
X  hardcode_into_libs=yes
X  # ldd complains unless libraries are executable
X  postinstall_cmds='chmod +x $lib'
X  ;;
X
Xsunos4*)
X  version_type=sunos
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
X  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
X  shlibpath_var=LD_LIBRARY_PATH
X  shlibpath_overrides_runpath=yes
X  if test "$with_gnu_ld" = yes; then
X    need_lib_prefix=no
X  fi
X  need_version=yes
X  ;;
X
Xsysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
X  version_type=linux
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  shlibpath_var=LD_LIBRARY_PATH
X  case $host_vendor in
X    sni)
X      shlibpath_overrides_runpath=no
X      need_lib_prefix=no
X      export_dynamic_flag_spec='${wl}-Blargedynsym'
X      runpath_var=LD_RUN_PATH
X      ;;
X    siemens)
X      need_lib_prefix=no
X      ;;
X    motorola)
X      need_lib_prefix=no
X      need_version=no
X      shlibpath_overrides_runpath=no
X      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
X      ;;
X  esac
X  ;;
X
Xsysv4*MP*)
X  if test -d /usr/nec ;then
X    version_type=linux
X    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
X    soname_spec='$libname${shared_ext}.$major'
X    shlibpath_var=LD_LIBRARY_PATH
X  fi
X  ;;
X
Xuts4*)
X  version_type=linux
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  shlibpath_var=LD_LIBRARY_PATH
X  ;;
X
X*)
X  dynamic_linker=no
X  ;;
Xesac
Xecho "$as_me:$LINENO: result: $dynamic_linker" >&5
Xecho "${ECHO_T}$dynamic_linker" >&6
Xtest "$dynamic_linker" = no && can_build_shared=no
X
Xif test "x$enable_dlopen" != xyes; then
X  enable_dlopen=unknown
X  enable_dlopen_self=unknown
X  enable_dlopen_self_static=unknown
Xelse
X  lt_cv_dlopen=no
X  lt_cv_dlopen_libs=
X
X  case $host_os in
X  beos*)
X    lt_cv_dlopen="load_add_on"
X    lt_cv_dlopen_libs=
X    lt_cv_dlopen_self=yes
X    ;;
X
X  mingw* | pw32*)
X    lt_cv_dlopen="LoadLibrary"
X    lt_cv_dlopen_libs=
X   ;;
X
X  cygwin*)
X    lt_cv_dlopen="dlopen"
X    lt_cv_dlopen_libs=
X   ;;
X
X  darwin*)
X  # if libdl is installed we need to link against it
X    echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
Xecho $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
Xif test "${ac_cv_lib_dl_dlopen+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  ac_check_lib_save_LIBS=$LIBS
XLIBS="-ldl  $LIBS"
Xcat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X
X/* Override any gcc2 internal prototype to avoid an error.  */
X#ifdef __cplusplus
Xextern "C"
X#endif
X/* We use char because int might match the return type of a gcc2
X   builtin and then its argument prototype would still apply.  */
Xchar dlopen ();
Xint
Xmain ()
X{
Xdlopen ();
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_cv_lib_dl_dlopen=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_cv_lib_dl_dlopen=no
Xfi
Xrm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
XLIBS=$ac_check_lib_save_LIBS
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
Xecho "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
Xif test $ac_cv_lib_dl_dlopen = yes; then
X  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
Xelse
X
X    lt_cv_dlopen="dyld"
X    lt_cv_dlopen_libs=
X    lt_cv_dlopen_self=yes
X
Xfi
X
X   ;;
X
X  *)
X    echo "$as_me:$LINENO: checking for shl_load" >&5
Xecho $ECHO_N "checking for shl_load... $ECHO_C" >&6
Xif test "${ac_cv_func_shl_load+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X/* System header to define __stub macros and hopefully few prototypes,
X    which can conflict with char shl_load (); below.
X    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
X    <limits.h> exists even on freestanding compilers.  */
X#ifdef __STDC__
X# include <limits.h>
X#else
X# include <assert.h>
X#endif
X/* Override any gcc2 internal prototype to avoid an error.  */
X#ifdef __cplusplus
Xextern "C"
X{
X#endif
X/* We use char because int might match the return type of a gcc2
X   builtin and then its argument prototype would still apply.  */
Xchar shl_load ();
X/* The GNU C library defines this for functions which it implements
X    to always fail with ENOSYS.  Some functions are actually named
X    something starting with __ and the normal name is an alias.  */
X#if defined (__stub_shl_load) || defined (__stub___shl_load)
Xchoke me
X#else
Xchar (*f) () = shl_load;
X#endif
X#ifdef __cplusplus
X}
X#endif
X
Xint
Xmain ()
X{
Xreturn f != shl_load;
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_cv_func_shl_load=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_cv_func_shl_load=no
Xfi
Xrm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
Xecho "${ECHO_T}$ac_cv_func_shl_load" >&6
Xif test $ac_cv_func_shl_load = yes; then
X  lt_cv_dlopen="shl_load"
Xelse
X  echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
Xecho $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
Xif test "${ac_cv_lib_dld_shl_load+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  ac_check_lib_save_LIBS=$LIBS
XLIBS="-ldld  $LIBS"
Xcat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X
X/* Override any gcc2 internal prototype to avoid an error.  */
X#ifdef __cplusplus
Xextern "C"
X#endif
X/* We use char because int might match the return type of a gcc2
X   builtin and then its argument prototype would still apply.  */
Xchar shl_load ();
Xint
Xmain ()
X{
Xshl_load ();
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_cv_lib_dld_shl_load=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_cv_lib_dld_shl_load=no
Xfi
Xrm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
XLIBS=$ac_check_lib_save_LIBS
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
Xecho "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
Xif test $ac_cv_lib_dld_shl_load = yes; then
X  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
Xelse
X  echo "$as_me:$LINENO: checking for dlopen" >&5
Xecho $ECHO_N "checking for dlopen... $ECHO_C" >&6
Xif test "${ac_cv_func_dlopen+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X/* System header to define __stub macros and hopefully few prototypes,
X    which can conflict with char dlopen (); below.
X    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
X    <limits.h> exists even on freestanding compilers.  */
X#ifdef __STDC__
X# include <limits.h>
X#else
X# include <assert.h>
X#endif
X/* Override any gcc2 internal prototype to avoid an error.  */
X#ifdef __cplusplus
Xextern "C"
X{
X#endif
X/* We use char because int might match the return type of a gcc2
X   builtin and then its argument prototype would still apply.  */
Xchar dlopen ();
X/* The GNU C library defines this for functions which it implements
X    to always fail with ENOSYS.  Some functions are actually named
X    something starting with __ and the normal name is an alias.  */
X#if defined (__stub_dlopen) || defined (__stub___dlopen)
Xchoke me
X#else
Xchar (*f) () = dlopen;
X#endif
X#ifdef __cplusplus
X}
X#endif
X
Xint
Xmain ()
X{
Xreturn f != dlopen;
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_cv_func_dlopen=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_cv_func_dlopen=no
Xfi
Xrm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
Xecho "${ECHO_T}$ac_cv_func_dlopen" >&6
Xif test $ac_cv_func_dlopen = yes; then
X  lt_cv_dlopen="dlopen"
Xelse
X  echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
Xecho $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
Xif test "${ac_cv_lib_dl_dlopen+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  ac_check_lib_save_LIBS=$LIBS
XLIBS="-ldl  $LIBS"
Xcat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X
X/* Override any gcc2 internal prototype to avoid an error.  */
X#ifdef __cplusplus
Xextern "C"
X#endif
X/* We use char because int might match the return type of a gcc2
X   builtin and then its argument prototype would still apply.  */
Xchar dlopen ();
Xint
Xmain ()
X{
Xdlopen ();
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_cv_lib_dl_dlopen=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_cv_lib_dl_dlopen=no
Xfi
Xrm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
XLIBS=$ac_check_lib_save_LIBS
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
Xecho "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
Xif test $ac_cv_lib_dl_dlopen = yes; then
X  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
Xelse
X  echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
Xecho $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
Xif test "${ac_cv_lib_svld_dlopen+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  ac_check_lib_save_LIBS=$LIBS
XLIBS="-lsvld  $LIBS"
Xcat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X
X/* Override any gcc2 internal prototype to avoid an error.  */
X#ifdef __cplusplus
Xextern "C"
X#endif
X/* We use char because int might match the return type of a gcc2
X   builtin and then its argument prototype would still apply.  */
Xchar dlopen ();
Xint
Xmain ()
X{
Xdlopen ();
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_cv_lib_svld_dlopen=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_cv_lib_svld_dlopen=no
Xfi
Xrm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
XLIBS=$ac_check_lib_save_LIBS
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
Xecho "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
Xif test $ac_cv_lib_svld_dlopen = yes; then
X  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
Xelse
X  echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
Xecho $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
Xif test "${ac_cv_lib_dld_dld_link+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  ac_check_lib_save_LIBS=$LIBS
XLIBS="-ldld  $LIBS"
Xcat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X
X/* Override any gcc2 internal prototype to avoid an error.  */
X#ifdef __cplusplus
Xextern "C"
X#endif
X/* We use char because int might match the return type of a gcc2
X   builtin and then its argument prototype would still apply.  */
Xchar dld_link ();
Xint
Xmain ()
X{
Xdld_link ();
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_cv_lib_dld_dld_link=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_cv_lib_dld_dld_link=no
Xfi
Xrm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
XLIBS=$ac_check_lib_save_LIBS
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
Xecho "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
Xif test $ac_cv_lib_dld_dld_link = yes; then
X  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
Xfi
X
X
Xfi
X
X
Xfi
X
X
Xfi
X
X
Xfi
X
X
Xfi
X
X    ;;
X  esac
X
X  if test "x$lt_cv_dlopen" != xno; then
X    enable_dlopen=yes
X  else
X    enable_dlopen=no
X  fi
X
X  case $lt_cv_dlopen in
X  dlopen)
X    save_CPPFLAGS="$CPPFLAGS"
X    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
X
X    save_LDFLAGS="$LDFLAGS"
X    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
X
X    save_LIBS="$LIBS"
X    LIBS="$lt_cv_dlopen_libs $LIBS"
X
X    echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
Xecho $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
Xif test "${lt_cv_dlopen_self+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  	  if test "$cross_compiling" = yes; then :
X  lt_cv_dlopen_self=cross
Xelse
X  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
X  lt_status=$lt_dlunknown
X  cat > conftest.$ac_ext <<EOF
X#line 12029 "configure"
X#include "confdefs.h"
X
X#if HAVE_DLFCN_H
X#include <dlfcn.h>
X#endif
X
X#include <stdio.h>
X
X#ifdef RTLD_GLOBAL
X#  define LT_DLGLOBAL		RTLD_GLOBAL
X#else
X#  ifdef DL_GLOBAL
X#    define LT_DLGLOBAL		DL_GLOBAL
X#  else
X#    define LT_DLGLOBAL		0
X#  endif
X#endif
X
X/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
X   find out it does not work in some platform. */
X#ifndef LT_DLLAZY_OR_NOW
X#  ifdef RTLD_LAZY
X#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
X#  else
X#    ifdef DL_LAZY
X#      define LT_DLLAZY_OR_NOW		DL_LAZY
X#    else
X#      ifdef RTLD_NOW
X#        define LT_DLLAZY_OR_NOW	RTLD_NOW
X#      else
X#        ifdef DL_NOW
X#          define LT_DLLAZY_OR_NOW	DL_NOW
X#        else
X#          define LT_DLLAZY_OR_NOW	0
X#        endif
X#      endif
X#    endif
X#  endif
X#endif
X
X#ifdef __cplusplus
Xextern "C" void exit (int);
X#endif
X
Xvoid fnord() { int i=42;}
Xint main ()
X{
X  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
X  int status = $lt_dlunknown;
X
X  if (self)
X    {
X      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
X      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
X      /* dlclose (self); */
X    }
X
X    exit (status);
X}
XEOF
X  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
X    (./conftest; exit; ) 2>/dev/null
X    lt_status=$?
X    case x$lt_status in
X      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
X      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
X      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
X    esac
X  else :
X    # compilation failed
X    lt_cv_dlopen_self=no
X  fi
Xfi
Xrm -fr conftest*
X
X
Xfi
Xecho "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
Xecho "${ECHO_T}$lt_cv_dlopen_self" >&6
X
X    if test "x$lt_cv_dlopen_self" = xyes; then
X      LDFLAGS="$LDFLAGS $link_static_flag"
X      echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
Xecho $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
Xif test "${lt_cv_dlopen_self_static+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  	  if test "$cross_compiling" = yes; then :
X  lt_cv_dlopen_self_static=cross
Xelse
X  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
X  lt_status=$lt_dlunknown
X  cat > conftest.$ac_ext <<EOF
X#line 12127 "configure"
X#include "confdefs.h"
X
X#if HAVE_DLFCN_H
X#include <dlfcn.h>
X#endif
X
X#include <stdio.h>
X
X#ifdef RTLD_GLOBAL
X#  define LT_DLGLOBAL		RTLD_GLOBAL
X#else
X#  ifdef DL_GLOBAL
X#    define LT_DLGLOBAL		DL_GLOBAL
X#  else
X#    define LT_DLGLOBAL		0
X#  endif
X#endif
X
X/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
X   find out it does not work in some platform. */
X#ifndef LT_DLLAZY_OR_NOW
X#  ifdef RTLD_LAZY
X#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
X#  else
X#    ifdef DL_LAZY
X#      define LT_DLLAZY_OR_NOW		DL_LAZY
X#    else
X#      ifdef RTLD_NOW
X#        define LT_DLLAZY_OR_NOW	RTLD_NOW
X#      else
X#        ifdef DL_NOW
X#          define LT_DLLAZY_OR_NOW	DL_NOW
X#        else
X#          define LT_DLLAZY_OR_NOW	0
X#        endif
X#      endif
X#    endif
X#  endif
X#endif
X
X#ifdef __cplusplus
Xextern "C" void exit (int);
X#endif
X
Xvoid fnord() { int i=42;}
Xint main ()
X{
X  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
X  int status = $lt_dlunknown;
X
X  if (self)
X    {
X      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
X      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
X      /* dlclose (self); */
X    }
X
X    exit (status);
X}
XEOF
X  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
X    (./conftest; exit; ) 2>/dev/null
X    lt_status=$?
X    case x$lt_status in
X      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
X      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
X      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
X    esac
X  else :
X    # compilation failed
X    lt_cv_dlopen_self_static=no
X  fi
Xfi
Xrm -fr conftest*
X
X
Xfi
Xecho "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
Xecho "${ECHO_T}$lt_cv_dlopen_self_static" >&6
X    fi
X
X    CPPFLAGS="$save_CPPFLAGS"
X    LDFLAGS="$save_LDFLAGS"
X    LIBS="$save_LIBS"
X    ;;
X  esac
X
X  case $lt_cv_dlopen_self in
X  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
X  *) enable_dlopen_self=unknown ;;
X  esac
X
X  case $lt_cv_dlopen_self_static in
X  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
X  *) enable_dlopen_self_static=unknown ;;
X  esac
Xfi
X
X
X# The else clause should only fire when bootstrapping the
X# libtool distribution, otherwise you forgot to ship ltmain.sh
X# with your package, and you will get complaints that there are
X# no rules to generate ltmain.sh.
Xif test -f "$ltmain"; then
X  # See if we are running on zsh, and set the options which allow our commands through
X  # without removal of \ escapes.
X  if test -n "${ZSH_VERSION+set}" ; then
X    setopt NO_GLOB_SUBST
X  fi
X  # Now quote all the things that may contain metacharacters while being
X  # careful not to overquote the AC_SUBSTed values.  We take copies of the
X  # variables and quote the copies for generation of the libtool script.
X  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \
X    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
X    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
X    deplibs_check_method reload_flag reload_cmds need_locks \
X    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
X    lt_cv_sys_global_symbol_to_c_name_address \
X    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
X    old_postinstall_cmds old_postuninstall_cmds \
X    compiler_CXX \
X    CC_CXX \
X    LD_CXX \
X    lt_prog_compiler_wl_CXX \
X    lt_prog_compiler_pic_CXX \
X    lt_prog_compiler_static_CXX \
X    lt_prog_compiler_no_builtin_flag_CXX \
X    export_dynamic_flag_spec_CXX \
X    thread_safe_flag_spec_CXX \
X    whole_archive_flag_spec_CXX \
X    enable_shared_with_static_runtimes_CXX \
X    old_archive_cmds_CXX \
X    old_archive_from_new_cmds_CXX \
X    predep_objects_CXX \
X    postdep_objects_CXX \
X    predeps_CXX \
X    postdeps_CXX \
X    compiler_lib_search_path_CXX \
X    archive_cmds_CXX \
X    archive_expsym_cmds_CXX \
X    postinstall_cmds_CXX \
X    postuninstall_cmds_CXX \
X    old_archive_from_expsyms_cmds_CXX \
X    allow_undefined_flag_CXX \
X    no_undefined_flag_CXX \
X    export_symbols_cmds_CXX \
X    hardcode_libdir_flag_spec_CXX \
X    hardcode_libdir_flag_spec_ld_CXX \
X    hardcode_libdir_separator_CXX \
X    hardcode_automatic_CXX \
X    module_cmds_CXX \
X    module_expsym_cmds_CXX \
X    lt_cv_prog_compiler_c_o_CXX \
X    exclude_expsyms_CXX \
X    include_expsyms_CXX; do
X
X    case $var in
X    old_archive_cmds_CXX | \
X    old_archive_from_new_cmds_CXX | \
X    archive_cmds_CXX | \
X    archive_expsym_cmds_CXX | \
X    module_cmds_CXX | \
X    module_expsym_cmds_CXX | \
X    old_archive_from_expsyms_cmds_CXX | \
X    export_symbols_cmds_CXX | \
X    extract_expsyms_cmds | reload_cmds | finish_cmds | \
X    postinstall_cmds | postuninstall_cmds | \
X    old_postinstall_cmds | old_postuninstall_cmds | \
X    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
X      # Double-quote double-evaled strings.
X      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
X      ;;
X    *)
X      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
X      ;;
X    esac
X  done
X
X  case $lt_echo in
X  *'\$0 --fallback-echo"')
X    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
X    ;;
X  esac
X
Xcfgfile="$ofile"
X
X  cat <<__EOF__ >> "$cfgfile"
X# ### BEGIN LIBTOOL TAG CONFIG: $tagname
X
X# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
X
X# Shell to use when invoking shell scripts.
XSHELL=$lt_SHELL
X
X# Whether or not to build shared libraries.
Xbuild_libtool_libs=$enable_shared
X
X# Whether or not to build static libraries.
Xbuild_old_libs=$enable_static
X
X# Whether or not to add -lc for building shared libraries.
Xbuild_libtool_need_lc=$archive_cmds_need_lc_CXX
X
X# Whether or not to disallow shared libs when runtime libs are static
Xallow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
X
X# Whether or not to optimize for fast installation.
Xfast_install=$enable_fast_install
X
X# The host system.
Xhost_alias=$host_alias
Xhost=$host
X
X# An echo program that does not interpret backslashes.
Xecho=$lt_echo
X
X# The archiver.
XAR=$lt_AR
XAR_FLAGS=$lt_AR_FLAGS
X
X# A C compiler.
XLTCC=$lt_LTCC
X
X# A language-specific compiler.
XCC=$lt_compiler_CXX
X
X# Is the compiler the GNU C compiler?
Xwith_gcc=$GCC_CXX
X
X# An ERE matcher.
XEGREP=$lt_EGREP
X
X# The linker used to build libraries.
XLD=$lt_LD_CXX
X
X# Whether we need hard or soft links.
XLN_S=$lt_LN_S
X
X# A BSD-compatible nm program.
XNM=$lt_NM
X
X# A symbol stripping program
XSTRIP=$STRIP
X
X# Used to examine libraries when file_magic_cmd begins "file"
XMAGIC_CMD=$MAGIC_CMD
X
X# Used on cygwin: DLL creation program.
XDLLTOOL="$DLLTOOL"
X
X# Used on cygwin: object dumper.
XOBJDUMP="$OBJDUMP"
X
X# Used on cygwin: assembler.
XAS="$AS"
X
X# The name of the directory that contains temporary libtool files.
Xobjdir=$objdir
X
X# How to create reloadable object files.
Xreload_flag=$lt_reload_flag
Xreload_cmds=$lt_reload_cmds
X
X# How to pass a linker flag through the compiler.
Xwl=$lt_lt_prog_compiler_wl_CXX
X
X# Object file suffix (normally "o").
Xobjext="$ac_objext"
X
X# Old archive suffix (normally "a").
Xlibext="$libext"
X
X# Shared library suffix (normally ".so").
Xshrext='$shrext'
X
X# Executable file suffix (normally "").
Xexeext="$exeext"
X
X# Additional compiler flags for building library objects.
Xpic_flag=$lt_lt_prog_compiler_pic_CXX
Xpic_mode=$pic_mode
X
X# What is the maximum length of a command?
Xmax_cmd_len=$lt_cv_sys_max_cmd_len
X
X# Does compiler simultaneously support -c and -o options?
Xcompiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
X
X# Must we lock files when doing compilation ?
Xneed_locks=$lt_need_locks
X
X# Do we need the lib prefix for modules?
Xneed_lib_prefix=$need_lib_prefix
X
X# Do we need a version for libraries?
Xneed_version=$need_version
X
X# Whether dlopen is supported.
Xdlopen_support=$enable_dlopen
X
X# Whether dlopen of programs is supported.
Xdlopen_self=$enable_dlopen_self
X
X# Whether dlopen of statically linked programs is supported.
Xdlopen_self_static=$enable_dlopen_self_static
X
X# Compiler flag to prevent dynamic linking.
Xlink_static_flag=$lt_lt_prog_compiler_static_CXX
X
X# Compiler flag to turn off builtin functions.
Xno_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
X
X# Compiler flag to allow reflexive dlopens.
Xexport_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
X
X# Compiler flag to generate shared objects directly from archives.
Xwhole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
X
X# Compiler flag to generate thread-safe objects.
Xthread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX
X
X# Library versioning type.
Xversion_type=$version_type
X
X# Format of library name prefix.
Xlibname_spec=$lt_libname_spec
X
X# List of archive names.  First name is the real one, the rest are links.
X# The last name is the one that the linker finds with -lNAME.
Xlibrary_names_spec=$lt_library_names_spec
X
X# The coded name of the library, if different from the real name.
Xsoname_spec=$lt_soname_spec
X
X# Commands used to build and install an old-style archive.
XRANLIB=$lt_RANLIB
Xold_archive_cmds=$lt_old_archive_cmds_CXX
Xold_postinstall_cmds=$lt_old_postinstall_cmds
Xold_postuninstall_cmds=$lt_old_postuninstall_cmds
X
X# Create an old-style archive from a shared archive.
Xold_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
X
X# Create a temporary old-style archive to link instead of a shared archive.
Xold_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
X
X# Commands used to build and install a shared archive.
Xarchive_cmds=$lt_archive_cmds_CXX
Xarchive_expsym_cmds=$lt_archive_expsym_cmds_CXX
Xpostinstall_cmds=$lt_postinstall_cmds
Xpostuninstall_cmds=$lt_postuninstall_cmds
X
X# Commands used to build a loadable module (assumed same as above if empty)
Xmodule_cmds=$lt_module_cmds_CXX
Xmodule_expsym_cmds=$lt_module_expsym_cmds_CXX
X
X# Commands to strip libraries.
Xold_striplib=$lt_old_striplib
Xstriplib=$lt_striplib
X
X# Dependencies to place before the objects being linked to create a
X# shared library.
Xpredep_objects=$lt_predep_objects_CXX
X
X# Dependencies to place after the objects being linked to create a
X# shared library.
Xpostdep_objects=$lt_postdep_objects_CXX
X
X# Dependencies to place before the objects being linked to create a
X# shared library.
Xpredeps=$lt_predeps_CXX
X
X# Dependencies to place after the objects being linked to create a
X# shared library.
Xpostdeps=$lt_postdeps_CXX
X
X# The library search path used internally by the compiler when linking
X# a shared library.
Xcompiler_lib_search_path=$lt_compiler_lib_search_path_CXX
X
X# Method to check whether dependent libraries are shared objects.
Xdeplibs_check_method=$lt_deplibs_check_method
X
X# Command to use when deplibs_check_method == file_magic.
Xfile_magic_cmd=$lt_file_magic_cmd
X
X# Flag that allows shared libraries with undefined symbols to be built.
Xallow_undefined_flag=$lt_allow_undefined_flag_CXX
X
X# Flag that forces no undefined symbols.
Xno_undefined_flag=$lt_no_undefined_flag_CXX
X
X# Commands used to finish a libtool library installation in a directory.
Xfinish_cmds=$lt_finish_cmds
X
X# Same as above, but a single script fragment to be evaled but not shown.
Xfinish_eval=$lt_finish_eval
X
X# Take the output of nm and produce a listing of raw symbols and C names.
Xglobal_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
X
X# Transform the output of nm in a proper C declaration
Xglobal_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
X
X# Transform the output of nm in a C name address pair
Xglobal_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
X
X# This is the shared library runtime path variable.
Xrunpath_var=$runpath_var
X
X# This is the shared library path variable.
Xshlibpath_var=$shlibpath_var
X
X# Is shlibpath searched before the hard-coded library search path?
Xshlibpath_overrides_runpath=$shlibpath_overrides_runpath
X
X# How to hardcode a shared library path into an executable.
Xhardcode_action=$hardcode_action_CXX
X
X# Whether we should hardcode library paths into libraries.
Xhardcode_into_libs=$hardcode_into_libs
X
X# Flag to hardcode \$libdir into a binary during linking.
X# This must work even if \$libdir does not exist.
Xhardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
X
X# If ld is used when linking, flag to hardcode \$libdir into
X# a binary during linking. This must work even if \$libdir does
X# not exist.
Xhardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
X
X# Whether we need a single -rpath flag with a separated argument.
Xhardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
X
X# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
X# resulting binary.
Xhardcode_direct=$hardcode_direct_CXX
X
X# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
X# resulting binary.
Xhardcode_minus_L=$hardcode_minus_L_CXX
X
X# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
X# the resulting binary.
Xhardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
X
X# Set to yes if building a shared library automatically hardcodes DIR into the library
X# and all subsequent libraries and executables linked against it.
Xhardcode_automatic=$hardcode_automatic_CXX
X
X# Variables whose values should be saved in libtool wrapper scripts and
X# restored at relink time.
Xvariables_saved_for_relink="$variables_saved_for_relink"
X
X# Whether libtool must link a program against all its dependency libraries.
Xlink_all_deplibs=$link_all_deplibs_CXX
X
X# Compile-time system search path for libraries
Xsys_lib_search_path_spec=$lt_sys_lib_search_path_spec
X
X# Run-time system search path for libraries
Xsys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
X
X# Fix the shell variable \$srcfile for the compiler.
Xfix_srcfile_path="$fix_srcfile_path_CXX"
X
X# Set to yes if exported symbols are required.
Xalways_export_symbols=$always_export_symbols_CXX
X
X# The commands to list exported symbols.
Xexport_symbols_cmds=$lt_export_symbols_cmds_CXX
X
X# The commands to extract the exported symbol list from a shared archive.
Xextract_expsyms_cmds=$lt_extract_expsyms_cmds
X
X# Symbols that should not be listed in the preloaded symbols.
Xexclude_expsyms=$lt_exclude_expsyms_CXX
X
X# Symbols that must always be exported.
Xinclude_expsyms=$lt_include_expsyms_CXX
X
X# ### END LIBTOOL TAG CONFIG: $tagname
X
X__EOF__
X
X
Xelse
X  # If there is no Makefile yet, we rely on a make rule to execute
X  # `config.status --recheck' to rerun these tests and create the
X  # libtool script then.
X  test -f Makefile && make "$ltmain"
Xfi
X
X
Xac_ext=c
Xac_cpp='$CPP $CPPFLAGS'
Xac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
Xac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
Xac_compiler_gnu=$ac_cv_c_compiler_gnu
X
XCC=$lt_save_CC
XLDCXX=$LD
XLD=$lt_save_LD
XGCC=$lt_save_GCC
Xwith_gnu_ldcxx=$with_gnu_ld
Xwith_gnu_ld=$lt_save_with_gnu_ld
Xlt_cv_path_LDCXX=$lt_cv_path_LD
Xlt_cv_path_LD=$lt_save_path_LD
Xlt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
Xlt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
X
X	else
X	  tagname=""
X	fi
X	;;
X
X      F77)
X	if test -n "$F77" && test "X$F77" != "Xno"; then
X
Xac_ext=f
Xac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
Xac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
Xac_compiler_gnu=$ac_cv_f77_compiler_gnu
X
X
Xarchive_cmds_need_lc_F77=no
Xallow_undefined_flag_F77=
Xalways_export_symbols_F77=no
Xarchive_expsym_cmds_F77=
Xexport_dynamic_flag_spec_F77=
Xhardcode_direct_F77=no
Xhardcode_libdir_flag_spec_F77=
Xhardcode_libdir_flag_spec_ld_F77=
Xhardcode_libdir_separator_F77=
Xhardcode_minus_L_F77=no
Xhardcode_automatic_F77=no
Xmodule_cmds_F77=
Xmodule_expsym_cmds_F77=
Xlink_all_deplibs_F77=unknown
Xold_archive_cmds_F77=$old_archive_cmds
Xno_undefined_flag_F77=
Xwhole_archive_flag_spec_F77=
Xenable_shared_with_static_runtimes_F77=no
X
X# Source file extension for f77 test sources.
Xac_ext=f
X
X# Object file extension for compiled f77 test sources.
Xobjext=o
Xobjext_F77=$objext
X
X# Code to be used in simple compile tests
Xlt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
X
X# Code to be used in simple link tests
Xlt_simple_link_test_code="      program t\n      end\n"
X
X# ltmain only uses $CC for tagged configurations so make sure $CC is set.
X
X# If no C compiler was specified, use CC.
XLTCC=${LTCC-"$CC"}
X
X# Allow CC to be a program name with arguments.
Xcompiler=$CC
X
X
X# Allow CC to be a program name with arguments.
Xlt_save_CC="$CC"
XCC=${F77-"f77"}
Xcompiler=$CC
Xcompiler_F77=$CC
Xcc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
X
Xecho "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
Xecho $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
Xecho "$as_me:$LINENO: result: $can_build_shared" >&5
Xecho "${ECHO_T}$can_build_shared" >&6
X
Xecho "$as_me:$LINENO: checking whether to build shared libraries" >&5
Xecho $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6
Xtest "$can_build_shared" = "no" && enable_shared=no
X
X# On AIX, shared libraries and static libraries use the same namespace, and
X# are all built from PIC.
Xcase "$host_os" in
Xaix3*)
X  test "$enable_shared" = yes && enable_static=no
X  if test -n "$RANLIB"; then
X    archive_cmds="$archive_cmds~\$RANLIB \$lib"
X    postinstall_cmds='$RANLIB $lib'
X  fi
X  ;;
Xaix4*)
X  test "$enable_shared" = yes && enable_static=no
X  ;;
Xesac
Xecho "$as_me:$LINENO: result: $enable_shared" >&5
Xecho "${ECHO_T}$enable_shared" >&6
X
Xecho "$as_me:$LINENO: checking whether to build static libraries" >&5
Xecho $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
X# Make sure either enable_shared or enable_static is yes.
Xtest "$enable_shared" = yes || enable_static=yes
Xecho "$as_me:$LINENO: result: $enable_static" >&5
Xecho "${ECHO_T}$enable_static" >&6
X
Xtest "$ld_shlibs_F77" = no && can_build_shared=no
X
XGCC_F77="$G77"
XLD_F77="$LD"
X
Xlt_prog_compiler_wl_F77=
Xlt_prog_compiler_pic_F77=
Xlt_prog_compiler_static_F77=
X
Xecho "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
Xecho $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
X
X  if test "$GCC" = yes; then
X    lt_prog_compiler_wl_F77='-Wl,'
X    lt_prog_compiler_static_F77='-static'
X
X    case $host_os in
X      aix*)
X      # All AIX code is PIC.
X      if test "$host_cpu" = ia64; then
X	# AIX 5 now supports IA64 processor
X	lt_prog_compiler_static_F77='-Bstatic'
X      fi
X      ;;
X
X    amigaos*)
X      # FIXME: we need at least 68020 code to build shared libraries, but
X      # adding the `-m68020' flag to GCC prevents building anything better,
X      # like `-m68040'.
X      lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'
X      ;;
X
X    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
X      # PIC is the default for these OSes.
X      ;;
X
X    mingw* | pw32* | os2*)
X      # This hack is so that the source file can tell whether it is being
X      # built for inclusion in a dll (and should export symbols for example).
X      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
X      ;;
X
X    darwin* | rhapsody*)
X      # PIC is the default on this platform
X      # Common symbols not allowed in MH_DYLIB files
X      lt_prog_compiler_pic_F77='-fno-common'
X      ;;
X
X    msdosdjgpp*)
X      # Just because we use GCC doesn't mean we suddenly get shared libraries
X      # on systems that don't support them.
X      lt_prog_compiler_can_build_shared_F77=no
X      enable_shared=no
X      ;;
X
X    sysv4*MP*)
X      if test -d /usr/nec; then
X	lt_prog_compiler_pic_F77=-Kconform_pic
X      fi
X      ;;
X
X    hpux*)
X      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
X      # not for PA HP-UX.
X      case "$host_cpu" in
X      hppa*64*|ia64*)
X	# +Z the default
X	;;
X      *)
X	lt_prog_compiler_pic_F77='-fPIC'
X	;;
X      esac
X      ;;
X
X    *)
X      lt_prog_compiler_pic_F77='-fPIC'
X      ;;
X    esac
X  else
X    # PORTME Check for flag to pass linker flags through the system compiler.
X    case $host_os in
X    aix*)
X      lt_prog_compiler_wl_F77='-Wl,'
X      if test "$host_cpu" = ia64; then
X	# AIX 5 now supports IA64 processor
X	lt_prog_compiler_static_F77='-Bstatic'
X      else
X	lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
X      fi
X      ;;
X
X    mingw* | pw32* | os2*)
X      # This hack is so that the source file can tell whether it is being
X      # built for inclusion in a dll (and should export symbols for example).
X      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
X      ;;
X
X    hpux9* | hpux10* | hpux11*)
X      lt_prog_compiler_wl_F77='-Wl,'
X      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
X      # not for PA HP-UX.
X      case "$host_cpu" in
X      hppa*64*|ia64*)
X	# +Z the default
X	;;
X      *)
X	lt_prog_compiler_pic_F77='+Z'
X	;;
X      esac
X      # Is there a better lt_prog_compiler_static that works with the bundled CC?
X      lt_prog_compiler_static_F77='${wl}-a ${wl}archive'
X      ;;
X
X    irix5* | irix6* | nonstopux*)
X      lt_prog_compiler_wl_F77='-Wl,'
X      # PIC (with -KPIC) is the default.
X      lt_prog_compiler_static_F77='-non_shared'
X      ;;
X
X    newsos6)
X      lt_prog_compiler_pic_F77='-KPIC'
X      lt_prog_compiler_static_F77='-Bstatic'
X      ;;
X
X    linux*)
X      case $CC in
X      icc|ecc)
X	lt_prog_compiler_wl_F77='-Wl,'
X	lt_prog_compiler_pic_F77='-KPIC'
X	lt_prog_compiler_static_F77='-static'
X        ;;
X      ccc)
X        lt_prog_compiler_wl_F77='-Wl,'
X        # All Alpha code is PIC.
X        lt_prog_compiler_static_F77='-non_shared'
X        ;;
X      esac
X      ;;
X
X    osf3* | osf4* | osf5*)
X      lt_prog_compiler_wl_F77='-Wl,'
X      # All OSF/1 code is PIC.
X      lt_prog_compiler_static_F77='-non_shared'
X      ;;
X
X    sco3.2v5*)
X      lt_prog_compiler_pic_F77='-Kpic'
X      lt_prog_compiler_static_F77='-dn'
X      ;;
X
X    solaris*)
X      lt_prog_compiler_wl_F77='-Wl,'
X      lt_prog_compiler_pic_F77='-KPIC'
X      lt_prog_compiler_static_F77='-Bstatic'
X      ;;
X
X    sunos4*)
X      lt_prog_compiler_wl_F77='-Qoption ld '
X      lt_prog_compiler_pic_F77='-PIC'
X      lt_prog_compiler_static_F77='-Bstatic'
X      ;;
X
X    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
X      lt_prog_compiler_wl_F77='-Wl,'
X      lt_prog_compiler_pic_F77='-KPIC'
X      lt_prog_compiler_static_F77='-Bstatic'
X      ;;
X
X    sysv4*MP*)
X      if test -d /usr/nec ;then
X	lt_prog_compiler_pic_F77='-Kconform_pic'
X	lt_prog_compiler_static_F77='-Bstatic'
X      fi
X      ;;
X
X    uts4*)
X      lt_prog_compiler_pic_F77='-pic'
X      lt_prog_compiler_static_F77='-Bstatic'
X      ;;
X
X    *)
X      lt_prog_compiler_can_build_shared_F77=no
X      ;;
X    esac
X  fi
X
Xecho "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
Xecho "${ECHO_T}$lt_prog_compiler_pic_F77" >&6
X
X#
X# Check to make sure the PIC flag actually works.
X#
Xif test -n "$lt_prog_compiler_pic_F77"; then
X  echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
Xecho $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6
Xif test "${lt_prog_compiler_pic_works_F77+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  lt_prog_compiler_pic_works_F77=no
X  ac_outfile=conftest.$ac_objext
X   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
X   lt_compiler_flag="$lt_prog_compiler_pic_F77"
X   # Insert the option either (1) after the last *FLAGS variable, or
X   # (2) before a word containing "conftest.", or (3) at the end.
X   # Note that $ac_compile itself does not contain backslashes and begins
X   # with a dollar sign (not a hyphen), so the echo should work correctly.
X   # The option is referenced via a variable to avoid confusing sed.
X   lt_compile=`echo "$ac_compile" | $SED \
X   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
X   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
X   -e 's:$: $lt_compiler_flag:'`
X   (eval echo "\"\$as_me:12949: $lt_compile\"" >&5)
X   (eval "$lt_compile" 2>conftest.err)
X   ac_status=$?
X   cat conftest.err >&5
X   echo "$as_me:12953: \$? = $ac_status" >&5
X   if (exit $ac_status) && test -s "$ac_outfile"; then
X     # The compiler can only warn and ignore the option if not recognized
X     # So say no if there are warnings
X     if test ! -s conftest.err; then
X       lt_prog_compiler_pic_works_F77=yes
X     fi
X   fi
X   $rm conftest*
X
Xfi
Xecho "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5
Xecho "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6
X
Xif test x"$lt_prog_compiler_pic_works_F77" = xyes; then
X    case $lt_prog_compiler_pic_F77 in
X     "" | " "*) ;;
X     *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
X     esac
Xelse
X    lt_prog_compiler_pic_F77=
X     lt_prog_compiler_can_build_shared_F77=no
Xfi
X
Xfi
Xcase "$host_os" in
X  # For platforms which do not support PIC, -DPIC is meaningless:
X  *djgpp*)
X    lt_prog_compiler_pic_F77=
X    ;;
X  *)
X    lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77"
X    ;;
Xesac
X
Xecho "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
Xecho $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
Xif test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  lt_cv_prog_compiler_c_o_F77=no
X   $rm -r conftest 2>/dev/null
X   mkdir conftest
X   cd conftest
X   mkdir out
X   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
X
X   # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
X   # that will create temporary files in the current directory regardless of
X   # the output directory.  Thus, making CWD read-only will cause this test
X   # to fail, enabling locking or at least warning the user not to do parallel
X   # builds.
X   chmod -w .
X
X   lt_compiler_flag="-o out/conftest2.$ac_objext"
X   # Insert the option either (1) after the last *FLAGS variable, or
X   # (2) before a word containing "conftest.", or (3) at the end.
X   # Note that $ac_compile itself does not contain backslashes and begins
X   # with a dollar sign (not a hyphen), so the echo should work correctly.
X   lt_compile=`echo "$ac_compile" | $SED \
X   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
X   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
X   -e 's:$: $lt_compiler_flag:'`
X   (eval echo "\"\$as_me:13016: $lt_compile\"" >&5)
X   (eval "$lt_compile" 2>out/conftest.err)
X   ac_status=$?
X   cat out/conftest.err >&5
X   echo "$as_me:13020: \$? = $ac_status" >&5
X   if (exit $ac_status) && test -s out/conftest2.$ac_objext
X   then
X     # The compiler can only warn and ignore the option if not recognized
X     # So say no if there are warnings
X     if test ! -s out/conftest.err; then
X       lt_cv_prog_compiler_c_o_F77=yes
X     fi
X   fi
X   chmod u+w .
X   $rm conftest* out/*
X   rmdir out
X   cd ..
X   rmdir conftest
X   $rm conftest*
X
Xfi
Xecho "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
Xecho "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6
X
X
Xhard_links="nottested"
Xif test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
X  # do not overwrite the value of need_locks provided by the user
X  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
Xecho $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
X  hard_links=yes
X  $rm conftest*
X  ln conftest.a conftest.b 2>/dev/null && hard_links=no
X  touch conftest.a
X  ln conftest.a conftest.b 2>&5 || hard_links=no
X  ln conftest.a conftest.b 2>/dev/null && hard_links=no
X  echo "$as_me:$LINENO: result: $hard_links" >&5
Xecho "${ECHO_T}$hard_links" >&6
X  if test "$hard_links" = no; then
X    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
Xecho "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
X    need_locks=warn
X  fi
Xelse
X  need_locks=no
Xfi
X
Xecho "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
Xecho $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
X
X  runpath_var=
X  allow_undefined_flag_F77=
X  enable_shared_with_static_runtimes_F77=no
X  archive_cmds_F77=
X  archive_expsym_cmds_F77=
X  old_archive_From_new_cmds_F77=
X  old_archive_from_expsyms_cmds_F77=
X  export_dynamic_flag_spec_F77=
X  whole_archive_flag_spec_F77=
X  thread_safe_flag_spec_F77=
X  hardcode_libdir_flag_spec_F77=
X  hardcode_libdir_flag_spec_ld_F77=
X  hardcode_libdir_separator_F77=
X  hardcode_direct_F77=no
X  hardcode_minus_L_F77=no
X  hardcode_shlibpath_var_F77=unsupported
X  link_all_deplibs_F77=unknown
X  hardcode_automatic_F77=no
X  module_cmds_F77=
X  module_expsym_cmds_F77=
X  always_export_symbols_F77=no
X  export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
X  # include_expsyms should be a list of space-separated symbols to be *always*
X  # included in the symbol list
X  include_expsyms_F77=
X  # exclude_expsyms can be an extended regexp of symbols to exclude
X  # it will be wrapped by ` (' and `)$', so one must not match beginning or
X  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
X  # as well as any symbol that contains `d'.
X  exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_"
X  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
X  # platforms (ab)use it in PIC code, but their linkers get confused if
X  # the symbol is explicitly referenced.  Since portable code cannot
X  # rely on this symbol name, it's probably fine to never include it in
X  # preloaded symbol tables.
X  extract_expsyms_cmds=
X
X  case $host_os in
X  cygwin* | mingw* | pw32*)
X    # FIXME: the MSVC++ port hasn't been tested in a loooong time
X    # When not using gcc, we currently assume that we are using
X    # Microsoft Visual C++.
X    if test "$GCC" != yes; then
X      with_gnu_ld=no
X    fi
X    ;;
X  openbsd*)
X    with_gnu_ld=no
X    ;;
X  esac
X
X  ld_shlibs_F77=yes
X  if test "$with_gnu_ld" = yes; then
X    # If archive_cmds runs LD, not CC, wlarc should be empty
X    wlarc='${wl}'
X
X    # See if GNU ld supports shared libraries.
X    case $host_os in
X    aix3* | aix4* | aix5*)
X      # On AIX/PPC, the GNU linker is very broken
X      if test "$host_cpu" != ia64; then
X	ld_shlibs_F77=no
X	cat <<EOF 1>&2
X
X*** Warning: the GNU linker, at least up to release 2.9.1, is reported
X*** to be unable to reliably create shared libraries on AIX.
X*** Therefore, libtool is disabling shared libraries support.  If you
X*** really care for shared libraries, you may want to modify your PATH
X*** so that a non-GNU linker is found, and then restart.
X
XEOF
X      fi
X      ;;
X
X    amigaos*)
X      archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
X      hardcode_libdir_flag_spec_F77='-L$libdir'
X      hardcode_minus_L_F77=yes
X
X      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
X      # that the semantics of dynamic libraries on AmigaOS, at least up
X      # to version 4, is to share data among multiple programs linked
X      # with the same dynamic library.  Since this doesn't match the
X      # behavior of shared libraries on other platforms, we can't use
X      # them.
X      ld_shlibs_F77=no
X      ;;
X
X    beos*)
X      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
X	allow_undefined_flag_F77=unsupported
X	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
X	# support --undefined.  This deserves some investigation.  FIXME
X	archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
X      else
X	ld_shlibs_F77=no
X      fi
X      ;;
X
X    cygwin* | mingw* | pw32*)
X      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless,
X      # as there is no search path for DLLs.
X      hardcode_libdir_flag_spec_F77='-L$libdir'
X      allow_undefined_flag_F77=unsupported
X      always_export_symbols_F77=no
X      enable_shared_with_static_runtimes_F77=yes
X      export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
X
X      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
X        archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
X	# If the export-symbols file already is a .def file (1st line
X	# is EXPORTS), use it as is; otherwise, prepend...
X	archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
X	  cp $export_symbols $output_objdir/$soname.def;
X	else
X	  echo EXPORTS > $output_objdir/$soname.def;
X	  cat $export_symbols >> $output_objdir/$soname.def;
X	fi~
X	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
X      else
X	ld_shlibs=no
X      fi
X      ;;
X
X    netbsd*)
X      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
X	archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
X	wlarc=
X      else
X	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
X	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
X      fi
X      ;;
X
X    solaris* | sysv5*)
X      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
X	ld_shlibs_F77=no
X	cat <<EOF 1>&2
X
X*** Warning: The releases 2.8.* of the GNU linker cannot reliably
X*** create shared libraries on Solaris systems.  Therefore, libtool
X*** is disabling shared libraries support.  We urge you to upgrade GNU
X*** binutils to release 2.9.1 or newer.  Another option is to modify
X*** your PATH or compiler configuration so that the native linker is
X*** used, and then restart.
X
XEOF
X      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
X	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
X	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
X      else
X	ld_shlibs_F77=no
X      fi
X      ;;
X
X    sunos4*)
X      archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
X      wlarc=
X      hardcode_direct_F77=yes
X      hardcode_shlibpath_var_F77=no
X      ;;
X
X  linux*)
X    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
X        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
X	archive_cmds_F77="$tmp_archive_cmds"
X      supports_anon_versioning=no
X      case `$LD -v 2>/dev/null` in
X        *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
X        *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
X        *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
X        *\ 2.11.*) ;; # other 2.11 versions
X        *) supports_anon_versioning=yes ;;
X      esac
X      if test $supports_anon_versioning = yes; then
X        archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
Xcat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
X$echo "local: *; };" >> $output_objdir/$libname.ver~
X        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
X      else
X        archive_expsym_cmds_F77="$tmp_archive_cmds"
X      fi
X    else
X      ld_shlibs_F77=no
X    fi
X    ;;
X
X    *)
X      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
X	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
X	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
X      else
X	ld_shlibs_F77=no
X      fi
X      ;;
X    esac
X
X    if test "$ld_shlibs_F77" = yes; then
X      runpath_var=LD_RUN_PATH
X      hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir'
X      export_dynamic_flag_spec_F77='${wl}--export-dynamic'
X      # ancient GNU ld didn't support --whole-archive et. al.
X      if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
X 	whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
X      else
X  	whole_archive_flag_spec_F77=
X      fi
X    fi
X  else
X    # PORTME fill in a description of your system's linker (not GNU ld)
X    case $host_os in
X    aix3*)
X      allow_undefined_flag_F77=unsupported
X      always_export_symbols_F77=yes
X      archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
X      # Note: this linker hardcodes the directories in LIBPATH if there
X      # are no directories specified by -L.
X      hardcode_minus_L_F77=yes
X      if test "$GCC" = yes && test -z "$link_static_flag"; then
X	# Neither direct hardcoding nor static linking is supported with a
X	# broken collect2.
X	hardcode_direct_F77=unsupported
X      fi
X      ;;
X
X    aix4* | aix5*)
X      if test "$host_cpu" = ia64; then
X	# On IA64, the linker does run time linking by default, so we don't
X	# have to do anything special.
X	aix_use_runtimelinking=no
X	exp_sym_flag='-Bexport'
X	no_entry_flag=""
X      else
X	# If we're using GNU nm, then we don't want the "-C" option.
X	# -C means demangle to AIX nm, but means don't demangle with GNU nm
X	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
X	  export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
X	else
X	  export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
X	fi
X	aix_use_runtimelinking=no
X
X	# Test if we are trying to use run time linking or normal
X	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
X	# need to do runtime linking.
X	case $host_os in aix4.[23]|aix4.[23].*|aix5*)
X	  for ld_flag in $LDFLAGS; do
X  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
X  	    aix_use_runtimelinking=yes
X  	    break
X  	  fi
X	  done
X	esac
X
X	exp_sym_flag='-bexport'
X	no_entry_flag='-bnoentry'
X      fi
X
X      # When large executables or shared objects are built, AIX ld can
X      # have problems creating the table of contents.  If linking a library
X      # or program results in "error TOC overflow" add -mminimal-toc to
X      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
X      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
X
X      archive_cmds_F77=''
X      hardcode_direct_F77=yes
X      hardcode_libdir_separator_F77=':'
X      link_all_deplibs_F77=yes
X
X      if test "$GCC" = yes; then
X	case $host_os in aix4.012|aix4.012.*)
X	# We only want to do this on AIX 4.2 and lower, the check
X	# below for broken collect2 doesn't work under 4.3+
X	  collect2name=`${CC} -print-prog-name=collect2`
X	  if test -f "$collect2name" && \
X  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
X	  then
X  	  # We have reworked collect2
X  	  hardcode_direct_F77=yes
X	  else
X  	  # We have old collect2
X  	  hardcode_direct_F77=unsupported
X  	  # It fails to find uninstalled libraries when the uninstalled
X  	  # path is not listed in the libpath.  Setting hardcode_minus_L
X  	  # to unsupported forces relinking
X  	  hardcode_minus_L_F77=yes
X  	  hardcode_libdir_flag_spec_F77='-L$libdir'
X  	  hardcode_libdir_separator_F77=
X	  fi
X	esac
X	shared_flag='-shared'
X      else
X	# not using gcc
X	if test "$host_cpu" = ia64; then
X  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
X  	# chokes on -Wl,-G. The following line is correct:
X	  shared_flag='-G'
X	else
X  	if test "$aix_use_runtimelinking" = yes; then
X	    shared_flag='${wl}-G'
X	  else
X	    shared_flag='${wl}-bM:SRE'
X  	fi
X	fi
X      fi
X
X      # It seems that -bexpall does not export symbols beginning with
X      # underscore (_), so it is better to generate a list of symbols to export.
X      always_export_symbols_F77=yes
X      if test "$aix_use_runtimelinking" = yes; then
X	# Warning - without using the other runtime loading flags (-brtl),
X	# -berok will link without error, but may produce a broken library.
X	allow_undefined_flag_F77='-berok'
X       # Determine the default libpath from the value encoded in an empty executable.
X       cat >conftest.$ac_ext <<_ACEOF
X      program main
X
X      end
X_ACEOF
Xrm -f conftest.$ac_objext conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X
Xaix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
X}'`
X# Check for a 64-bit object if we didn't find anything.
Xif test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
X}'`; fi
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xfi
Xrm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
Xif test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
X
X       hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
X	archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
X       else
X	if test "$host_cpu" = ia64; then
X	  hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib'
X	  allow_undefined_flag_F77="-z nodefs"
X	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
X	else
X	 # Determine the default libpath from the value encoded in an empty executable.
X	 cat >conftest.$ac_ext <<_ACEOF
X      program main
X
X      end
X_ACEOF
Xrm -f conftest.$ac_objext conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X
Xaix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
X}'`
X# Check for a 64-bit object if we didn't find anything.
Xif test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
X}'`; fi
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xfi
Xrm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
Xif test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
X
X	 hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
X	  # Warning - without using the other run time loading flags,
X	  # -berok will link without error, but may produce a broken library.
X	  no_undefined_flag_F77=' ${wl}-bernotok'
X	  allow_undefined_flag_F77=' ${wl}-berok'
X	  # -bexpall does not export symbols beginning with underscore (_)
X	  always_export_symbols_F77=yes
X	  # Exported symbols can be pulled into shared objects from archives
X	  whole_archive_flag_spec_F77=' '
X	  archive_cmds_need_lc_F77=yes
X	  # This is similar to how AIX traditionally builds it's shared libraries.
X	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
X	fi
X      fi
X      ;;
X
X    amigaos*)
X      archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
X      hardcode_libdir_flag_spec_F77='-L$libdir'
X      hardcode_minus_L_F77=yes
X      # see comment about different semantics on the GNU ld section
X      ld_shlibs_F77=no
X      ;;
X
X    bsdi4*)
X      export_dynamic_flag_spec_F77=-rdynamic
X      ;;
X
X    cygwin* | mingw* | pw32*)
X      # When not using gcc, we currently assume that we are using
X      # Microsoft Visual C++.
X      # hardcode_libdir_flag_spec is actually meaningless, as there is
X      # no search path for DLLs.
X      hardcode_libdir_flag_spec_F77=' '
X      allow_undefined_flag_F77=unsupported
X      # Tell ltmain to make .lib files, not .a files.
X      libext=lib
X      # Tell ltmain to make .dll files, not .so files.
X      shrext=".dll"
X      # FIXME: Setting linknames here is a bad hack.
X      archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
X      # The linker will automatically build a .lib file if we build a DLL.
X      old_archive_From_new_cmds_F77='true'
X      # FIXME: Should let the user specify the lib program.
X      old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs'
X      fix_srcfile_path='`cygpath -w "$srcfile"`'
X      enable_shared_with_static_runtimes_F77=yes
X      ;;
X
X    darwin* | rhapsody*)
X    if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
X      archive_cmds_need_lc_F77=no
X      case "$host_os" in
X      rhapsody* | darwin1.[012])
X	allow_undefined_flag_F77='-undefined suppress'
X	;;
X      *) # Darwin 1.3 on
X	test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag_F77='-flat_namespace -undefined suppress'
X	;;
X      esac
X      # FIXME: Relying on posixy $() will cause problems for
X      #        cross-compilation, but unfortunately the echo tests do not
X      #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
X      #	       `"' quotes if we put them in here... so don't!
X    	lt_int_apple_cc_single_mod=no
X    	output_verbose_link_cmd='echo'
X    	if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
X    	  lt_int_apple_cc_single_mod=yes
X    	fi
X    	if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
X    	  archive_cmds_F77='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
X    	else
X        archive_cmds_F77='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
X      fi
X      module_cmds_F77='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags'
X      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
X        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
X          archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
X        else
X          archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
X        fi
X          module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag  -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
X      hardcode_direct_F77=no
X      hardcode_automatic_F77=yes
X      hardcode_shlibpath_var_F77=unsupported
X      whole_archive_flag_spec_F77='-all_load $convenience'
X      link_all_deplibs_F77=yes
X    fi
X      ;;
X
X    dgux*)
X      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
X      hardcode_libdir_flag_spec_F77='-L$libdir'
X      hardcode_shlibpath_var_F77=no
X      ;;
X
X    freebsd1*)
X      ld_shlibs_F77=no
X      ;;
X
X    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
X    # support.  Future versions do this automatically, but an explicit c++rt0.o
X    # does not break anything, and helps significantly (at the cost of a little
X    # extra space).
X    freebsd2.2*)
X      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
X      hardcode_libdir_flag_spec_F77='-R$libdir'
X      hardcode_direct_F77=yes
X      hardcode_shlibpath_var_F77=no
X      ;;
X
X    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
X    freebsd2*)
X      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
X      hardcode_direct_F77=yes
X      hardcode_minus_L_F77=yes
X      hardcode_shlibpath_var_F77=no
X      ;;
X
X    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
X    freebsd*)
X      archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
X      hardcode_libdir_flag_spec_F77='-R$libdir'
X      hardcode_direct_F77=yes
X      hardcode_shlibpath_var_F77=no
X      ;;
X
X    hpux9*)
X      if test "$GCC" = yes; then
X	archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
X      else
X	archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
X      fi
X      hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
X      hardcode_libdir_separator_F77=:
X      hardcode_direct_F77=yes
X
X      # hardcode_minus_L: Not really in the search PATH,
X      # but as the default location of the library.
X      hardcode_minus_L_F77=yes
X      export_dynamic_flag_spec_F77='${wl}-E'
X      ;;
X
X    hpux10* | hpux11*)
X      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
X	case "$host_cpu" in
X	hppa*64*|ia64*)
X	  archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
X	  ;;
X	*)
X	  archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
X	  ;;
X	esac
X      else
X	case "$host_cpu" in
X	hppa*64*|ia64*)
X	  archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
X	  ;;
X	*)
X	  archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
X	  ;;
X	esac
X      fi
X      if test "$with_gnu_ld" = no; then
X	case "$host_cpu" in
X	hppa*64*)
X	  hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
X	  hardcode_libdir_flag_spec_ld_F77='+b $libdir'
X	  hardcode_libdir_separator_F77=:
X	  hardcode_direct_F77=no
X	  hardcode_shlibpath_var_F77=no
X	  ;;
X	ia64*)
X	  hardcode_libdir_flag_spec_F77='-L$libdir'
X	  hardcode_direct_F77=no
X	  hardcode_shlibpath_var_F77=no
X
X	  # hardcode_minus_L: Not really in the search PATH,
X	  # but as the default location of the library.
X	  hardcode_minus_L_F77=yes
X	  ;;
X	*)
X	  hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
X	  hardcode_libdir_separator_F77=:
X	  hardcode_direct_F77=yes
X	  export_dynamic_flag_spec_F77='${wl}-E'
X
X	  # hardcode_minus_L: Not really in the search PATH,
X	  # but as the default location of the library.
X	  hardcode_minus_L_F77=yes
X	  ;;
X	esac
X      fi
X      ;;
X
X    irix5* | irix6* | nonstopux*)
X      if test "$GCC" = yes; then
X	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
X      else
X	archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
X	hardcode_libdir_flag_spec_ld_F77='-rpath $libdir'
X      fi
X      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
X      hardcode_libdir_separator_F77=:
X      link_all_deplibs_F77=yes
X      ;;
X
X    netbsd*)
X      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
X	archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
X      else
X	archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
X      fi
X      hardcode_libdir_flag_spec_F77='-R$libdir'
X      hardcode_direct_F77=yes
X      hardcode_shlibpath_var_F77=no
X      ;;
X
X    newsos6)
X      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
X      hardcode_direct_F77=yes
X      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
X      hardcode_libdir_separator_F77=:
X      hardcode_shlibpath_var_F77=no
X      ;;
X
X    openbsd*)
X      hardcode_direct_F77=yes
X      hardcode_shlibpath_var_F77=no
X      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
X	archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
X	hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
X	export_dynamic_flag_spec_F77='${wl}-E'
X      else
X       case $host_os in
X	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
X	   archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
X	   hardcode_libdir_flag_spec_F77='-R$libdir'
X	   ;;
X	 *)
X	   archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
X	   hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
X	   ;;
X       esac
X      fi
X      ;;
X
X    os2*)
X      hardcode_libdir_flag_spec_F77='-L$libdir'
X      hardcode_minus_L_F77=yes
X      allow_undefined_flag_F77=unsupported
X      archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
X      old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
X      ;;
X
X    osf3*)
X      if test "$GCC" = yes; then
X	allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
X	archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
X      else
X	allow_undefined_flag_F77=' -expect_unresolved \*'
X	archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
X      fi
X      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
X      hardcode_libdir_separator_F77=:
X      ;;
X
X    osf4* | osf5*)	# as osf3* with the addition of -msym flag
X      if test "$GCC" = yes; then
X	allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
X	archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
X	hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
X      else
X	allow_undefined_flag_F77=' -expect_unresolved \*'
X	archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
X	archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
X	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
X
X	# Both c and cxx compiler support -rpath directly
X	hardcode_libdir_flag_spec_F77='-rpath $libdir'
X      fi
X      hardcode_libdir_separator_F77=:
X      ;;
X
X    sco3.2v5*)
X      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
X      hardcode_shlibpath_var_F77=no
X      export_dynamic_flag_spec_F77='${wl}-Bexport'
X      runpath_var=LD_RUN_PATH
X      hardcode_runpath_var=yes
X      ;;
X
X    solaris*)
X      no_undefined_flag_F77=' -z text'
X      if test "$GCC" = yes; then
X	archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
X	archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
X	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
X      else
X	archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
X	archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
X  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
X      fi
X      hardcode_libdir_flag_spec_F77='-R$libdir'
X      hardcode_shlibpath_var_F77=no
X      case $host_os in
X      solaris2.[0-5] | solaris2.[0-5].*) ;;
X      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
X	whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;
X      esac
X      link_all_deplibs_F77=yes
X      ;;
X
X    sunos4*)
X      if test "x$host_vendor" = xsequent; then
X	# Use $CC to link under sequent, because it throws in some extra .o
X	# files that make .init and .fini sections work.
X	archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
X      else
X	archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
X      fi
X      hardcode_libdir_flag_spec_F77='-L$libdir'
X      hardcode_direct_F77=yes
X      hardcode_minus_L_F77=yes
X      hardcode_shlibpath_var_F77=no
X      ;;
X
X    sysv4)
X      case $host_vendor in
X	sni)
X	  archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
X	  hardcode_direct_F77=yes # is this really true???
X	;;
X	siemens)
X	  ## LD is ld it makes a PLAMLIB
X	  ## CC just makes a GrossModule.
X	  archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
X	  reload_cmds_F77='$CC -r -o $output$reload_objs'
X	  hardcode_direct_F77=no
X        ;;
X	motorola)
X	  archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
X	  hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie
X	;;
X      esac
X      runpath_var='LD_RUN_PATH'
X      hardcode_shlibpath_var_F77=no
X      ;;
X
X    sysv4.3*)
X      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
X      hardcode_shlibpath_var_F77=no
X      export_dynamic_flag_spec_F77='-Bexport'
X      ;;
X
X    sysv4*MP*)
X      if test -d /usr/nec; then
X	archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
X	hardcode_shlibpath_var_F77=no
X	runpath_var=LD_RUN_PATH
X	hardcode_runpath_var=yes
X	ld_shlibs_F77=yes
X      fi
X      ;;
X
X    sysv4.2uw2*)
X      archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
X      hardcode_direct_F77=yes
X      hardcode_minus_L_F77=no
X      hardcode_shlibpath_var_F77=no
X      hardcode_runpath_var=yes
X      runpath_var=LD_RUN_PATH
X      ;;
X
X   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
X      no_undefined_flag_F77='${wl}-z ${wl}text'
X      if test "$GCC" = yes; then
X	archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
X      else
X	archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
X      fi
X      runpath_var='LD_RUN_PATH'
X      hardcode_shlibpath_var_F77=no
X      ;;
X
X    sysv5*)
X      no_undefined_flag_F77=' -z text'
X      # $CC -shared without GNU ld will not create a library from C++
X      # object files and a static libstdc++, better avoid it by now
X      archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
X      archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
X  		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
X      hardcode_libdir_flag_spec_F77=
X      hardcode_shlibpath_var_F77=no
X      runpath_var='LD_RUN_PATH'
X      ;;
X
X    uts4*)
X      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
X      hardcode_libdir_flag_spec_F77='-L$libdir'
X      hardcode_shlibpath_var_F77=no
X      ;;
X
X    *)
X      ld_shlibs_F77=no
X      ;;
X    esac
X  fi
X
Xecho "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
Xecho "${ECHO_T}$ld_shlibs_F77" >&6
Xtest "$ld_shlibs_F77" = no && can_build_shared=no
X
Xvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
Xif test "$GCC" = yes; then
X  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
Xfi
X
X#
X# Do we need to explicitly link libc?
X#
Xcase "x$archive_cmds_need_lc_F77" in
Xx|xyes)
X  # Assume -lc should be added
X  archive_cmds_need_lc_F77=yes
X
X  if test "$enable_shared" = yes && test "$GCC" = yes; then
X    case $archive_cmds_F77 in
X    *'~'*)
X      # FIXME: we may have to deal with multi-command sequences.
X      ;;
X    '$CC '*)
X      # Test whether the compiler implicitly links with -lc since on some
X      # systems, -lgcc has to come before -lc. If gcc already passes -lc
X      # to ld, don't add -lc before -lgcc.
X      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
Xecho $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
X      $rm conftest*
X      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
X
X      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } 2>conftest.err; then
X        soname=conftest
X        lib=conftest
X        libobjs=conftest.$ac_objext
X        deplibs=
X        wl=$lt_prog_compiler_wl_F77
X        compiler_flags=-v
X        linker_flags=-v
X        verstring=
X        output_objdir=.
X        libname=conftest
X        lt_save_allow_undefined_flag=$allow_undefined_flag_F77
X        allow_undefined_flag_F77=
X        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
X  (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }
X        then
X	  archive_cmds_need_lc_F77=no
X        else
X	  archive_cmds_need_lc_F77=yes
X        fi
X        allow_undefined_flag_F77=$lt_save_allow_undefined_flag
X      else
X        cat conftest.err 1>&5
X      fi
X      $rm conftest*
X      echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
Xecho "${ECHO_T}$archive_cmds_need_lc_F77" >&6
X      ;;
X    esac
X  fi
X  ;;
Xesac
X
Xecho "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
Xecho $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
Xhardcode_action_F77=
Xif test -n "$hardcode_libdir_flag_spec_F77" || \
X   test -n "$runpath_var F77" || \
X   test "X$hardcode_automatic_F77"="Xyes" ; then
X
X  # We can hardcode non-existant directories.
X  if test "$hardcode_direct_F77" != no &&
X     # If the only mechanism to avoid hardcoding is shlibpath_var, we
X     # have to relink, otherwise we might link with an installed library
X     # when we should be linking with a yet-to-be-installed one
X     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no &&
X     test "$hardcode_minus_L_F77" != no; then
X    # Linking always hardcodes the temporary library directory.
X    hardcode_action_F77=relink
X  else
X    # We can link without hardcoding, and we can hardcode nonexisting dirs.
X    hardcode_action_F77=immediate
X  fi
Xelse
X  # We cannot hardcode anything, or else we can only hardcode existing
X  # directories.
X  hardcode_action_F77=unsupported
Xfi
Xecho "$as_me:$LINENO: result: $hardcode_action_F77" >&5
Xecho "${ECHO_T}$hardcode_action_F77" >&6
X
Xif test "$hardcode_action_F77" = relink; then
X  # Fast installation is not supported
X  enable_fast_install=no
Xelif test "$shlibpath_overrides_runpath" = yes ||
X     test "$enable_shared" = no; then
X  # Fast installation is not necessary
X  enable_fast_install=needless
Xfi
X
Xstriplib=
Xold_striplib=
Xecho "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
Xecho $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
Xif test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
X  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
X  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
X  echo "$as_me:$LINENO: result: yes" >&5
Xecho "${ECHO_T}yes" >&6
Xelse
X# FIXME - insert some real tests, host_os isn't really good enough
X  case $host_os in
X   darwin*)
X       if test -n "$STRIP" ; then
X         striplib="$STRIP -x"
X         echo "$as_me:$LINENO: result: yes" >&5
Xecho "${ECHO_T}yes" >&6
X       else
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X       ;;
X   *)
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
X    ;;
X  esac
Xfi
X
Xecho "$as_me:$LINENO: checking dynamic linker characteristics" >&5
Xecho $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
Xlibrary_names_spec=
Xlibname_spec='lib$name'
Xsoname_spec=
Xshrext=".so"
Xpostinstall_cmds=
Xpostuninstall_cmds=
Xfinish_cmds=
Xfinish_eval=
Xshlibpath_var=
Xshlibpath_overrides_runpath=unknown
Xversion_type=none
Xdynamic_linker="$host_os ld.so"
Xsys_lib_dlsearch_path_spec="/lib /usr/lib"
Xif test "$GCC" = yes; then
X  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
X  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
X    # if the path contains ";" then we assume it to be the separator
X    # otherwise default to the standard path separator (i.e. ":") - it is
X    # assumed that no part of a normal pathname contains ";" but that should
X    # okay in the real world where ";" in dirpaths is itself problematic.
X    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
X  else
X    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
X  fi
Xelse
X  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
Xfi
Xneed_lib_prefix=unknown
Xhardcode_into_libs=no
X
X# when you set need_version to no, make sure it does not cause -set_version
X# flags to be left without arguments
Xneed_version=unknown
X
Xcase $host_os in
Xaix3*)
X  version_type=linux
X  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
X  shlibpath_var=LIBPATH
X
X  # AIX 3 has no versioning support, so we append a major version to the name.
X  soname_spec='${libname}${release}${shared_ext}$major'
X  ;;
X
Xaix4* | aix5*)
X  version_type=linux
X  need_lib_prefix=no
X  need_version=no
X  hardcode_into_libs=yes
X  if test "$host_cpu" = ia64; then
X    # AIX 5 supports IA64
X    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
X    shlibpath_var=LD_LIBRARY_PATH
X  else
X    # With GCC up to 2.95.x, collect2 would create an import file
X    # for dependence libraries.  The import file would start with
X    # the line `#! .'.  This would cause the generated library to
X    # depend on `.', always an invalid library.  This was fixed in
X    # development snapshots of GCC prior to 3.0.
X    case $host_os in
X      aix4 | aix4.[01] | aix4.[01].*)
X      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
X	   echo ' yes '
X	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
X	:
X      else
X	can_build_shared=no
X      fi
X      ;;
X    esac
X    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
X    # soname into executable. Probably we can add versioning support to
X    # collect2, so additional links can be useful in future.
X    if test "$aix_use_runtimelinking" = yes; then
X      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
X      # instead of lib<name>.a to let people know that these are not
X      # typical AIX shared libraries.
X      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X    else
X      # We preserve .a as extension for shared libraries through AIX4.2
X      # and later when we are not doing run time linking.
X      library_names_spec='${libname}${release}.a $libname.a'
X      soname_spec='${libname}${release}${shared_ext}$major'
X    fi
X    shlibpath_var=LIBPATH
X  fi
X  ;;
X
Xamigaos*)
X  library_names_spec='$libname.ixlibrary $libname.a'
X  # Create ${libname}_ixlibrary.a entries in /sys/libs.
X  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
X  ;;
X
Xbeos*)
X  library_names_spec='${libname}${shared_ext}'
X  dynamic_linker="$host_os ld.so"
X  shlibpath_var=LIBRARY_PATH
X  ;;
X
Xbsdi4*)
X  version_type=linux
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
X  shlibpath_var=LD_LIBRARY_PATH
X  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
X  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
X  # the default ld.so.conf also contains /usr/contrib/lib and
X  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
X  # libtool to hard-code these into programs
X  ;;
X
Xcygwin* | mingw* | pw32*)
X  version_type=windows
X  shrext=".dll"
X  need_version=no
X  need_lib_prefix=no
X
X  case $GCC,$host_os in
X  yes,cygwin* | yes,mingw* | yes,pw32*)
X    library_names_spec='$libname.dll.a'
X    # DLL is installed to $(libdir)/../bin by postinstall_cmds
X    postinstall_cmds='base_file=`basename \${file}`~
X      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
X      dldir=$destdir/`dirname \$dlpath`~
X      test -d \$dldir || mkdir -p \$dldir~
X      $install_prog $dir/$dlname \$dldir/$dlname'
X    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
X      dlpath=$dir/\$dldll~
X       $rm \$dlpath'
X    shlibpath_overrides_runpath=yes
X
X    case $host_os in
X    cygwin*)
X      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
X      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
X      sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib"
X      ;;
X    mingw*)
X      # MinGW DLLs use traditional 'lib' prefix
X      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
X      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
X      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
X        # It is most probably a Windows format PATH printed by
X        # mingw gcc, but we are running on Cygwin. Gcc prints its search
X        # path with ; separators, and with drive letters. We can handle the
X        # drive letters (cygwin fileutils understands them), so leave them,
X        # especially as we might pass files found there to a mingw objdump,
X        # which wouldn't understand a cygwinified path. Ahh.
X        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
X      else
X        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
X      fi
X      ;;
X    pw32*)
X      # pw32 DLLs use 'pw' prefix rather than 'lib'
X      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'
X      ;;
X    esac
X    ;;
X
X  *)
X    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
X    ;;
X  esac
X  dynamic_linker='Win32 ld.exe'
X  # FIXME: first we should search . and the directory the executable is in
X  shlibpath_var=PATH
X  ;;
X
Xdarwin* | rhapsody*)
X  dynamic_linker="$host_os dyld"
X  version_type=darwin
X  need_lib_prefix=no
X  need_version=no
X  # FIXME: Relying on posixy $() will cause problems for
X  #        cross-compilation, but unfortunately the echo tests do not
X  #        yet detect zsh echo's removal of \ escapes.
X  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
X  soname_spec='${libname}${release}${major}$shared_ext'
X  shlibpath_overrides_runpath=yes
X  shlibpath_var=DYLD_LIBRARY_PATH
X  shrext='$(test .$module = .yes && echo .so || echo .dylib)'
X  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
X  if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
X  sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
X  fi
X  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
X  ;;
X
Xdgux*)
X  version_type=linux
X  need_lib_prefix=no
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  shlibpath_var=LD_LIBRARY_PATH
X  ;;
X
Xfreebsd1*)
X  dynamic_linker=no
X  ;;
X
Xfreebsd*)
X  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
X  version_type=freebsd-$objformat
X  case $version_type in
X    freebsd-elf*)
X      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
X      need_version=no
X      need_lib_prefix=no
X      ;;
X    freebsd-*)
X      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
X      need_version=yes
X      ;;
X  esac
X  shlibpath_var=LD_LIBRARY_PATH
X  case $host_os in
X  freebsd2*)
X    shlibpath_overrides_runpath=yes
X    ;;
X  freebsd3.01* | freebsdelf3.01*)
X    shlibpath_overrides_runpath=yes
X    hardcode_into_libs=yes
X    ;;
X  *) # from 3.2 on
X    shlibpath_overrides_runpath=no
X    hardcode_into_libs=yes
X    ;;
X  esac
X  ;;
X
Xgnu*)
X  version_type=linux
X  need_lib_prefix=no
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  shlibpath_var=LD_LIBRARY_PATH
X  hardcode_into_libs=yes
X  ;;
X
Xhpux9* | hpux10* | hpux11*)
X  # Give a soname corresponding to the major version so that dld.sl refuses to
X  # link against other versions.
X  version_type=sunos
X  need_lib_prefix=no
X  need_version=no
X  case "$host_cpu" in
X  ia64*)
X    shrext='.so'
X    hardcode_into_libs=yes
X    dynamic_linker="$host_os dld.so"
X    shlibpath_var=LD_LIBRARY_PATH
X    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
X    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X    soname_spec='${libname}${release}${shared_ext}$major'
X    if test "X$HPUX_IA64_MODE" = X32; then
X      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
X    else
X      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
X    fi
X    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
X    ;;
X   hppa*64*)
X     shrext='.sl'
X     hardcode_into_libs=yes
X     dynamic_linker="$host_os dld.sl"
X     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
X     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
X     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X     soname_spec='${libname}${release}${shared_ext}$major'
X     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
X     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
X     ;;
X   *)
X    shrext='.sl'
X    dynamic_linker="$host_os dld.sl"
X    shlibpath_var=SHLIB_PATH
X    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
X    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X    soname_spec='${libname}${release}${shared_ext}$major'
X    ;;
X  esac
X  # HP-UX runs *really* slowly unless shared libraries are mode 555.
X  postinstall_cmds='chmod 555 $lib'
X  ;;
X
Xirix5* | irix6* | nonstopux*)
X  case $host_os in
X    nonstopux*) version_type=nonstopux ;;
X    *)
X	if test "$lt_cv_prog_gnu_ld" = yes; then
X		version_type=linux
X	else
X		version_type=irix
X	fi ;;
X  esac
X  need_lib_prefix=no
X  need_version=no
X  soname_spec='${libname}${release}${shared_ext}$major'
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
X  case $host_os in
X  irix5* | nonstopux*)
X    libsuff= shlibsuff=
X    ;;
X  *)
X    case $LD in # libtool.m4 will add one of these switches to LD
X    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
X      libsuff= shlibsuff= libmagic=32-bit;;
X    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
X      libsuff=32 shlibsuff=N32 libmagic=N32;;
X    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
X      libsuff=64 shlibsuff=64 libmagic=64-bit;;
X    *) libsuff= shlibsuff= libmagic=never-match;;
X    esac
X    ;;
X  esac
X  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
X  shlibpath_overrides_runpath=no
X  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
X  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
X  hardcode_into_libs=yes
X  ;;
X
X# No shared lib support for Linux oldld, aout, or coff.
Xlinux*oldld* | linux*aout* | linux*coff*)
X  dynamic_linker=no
X  ;;
X
X# This must be Linux ELF.
Xlinux*)
X  version_type=linux
X  need_lib_prefix=no
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
X  shlibpath_var=LD_LIBRARY_PATH
X  shlibpath_overrides_runpath=no
X  # This implies no fast_install, which is unacceptable.
X  # Some rework will be needed to allow for fast_install
X  # before this can be enabled.
X  hardcode_into_libs=yes
X
X  # We used to test for /lib/ld.so.1 and disable shared libraries on
X  # powerpc, because MkLinux only supported shared libraries with the
X  # GNU dynamic linker.  Since this was broken with cross compilers,
X  # most powerpc-linux boxes support dynamic linking these days and
X  # people can always --disable-shared, the test was removed, and we
X  # assume the GNU/Linux dynamic linker is in use.
X  dynamic_linker='GNU/Linux ld.so'
X
X  # Find out which ABI we are using (multilib Linux x86_64 hack).
X  libsuff=
X  case "$host_cpu" in
X  x86_64*|s390x*|powerpc64*)
X    echo '#line 14359 "configure"' > conftest.$ac_ext
X    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; then
X      case `/usr/bin/file conftest.$ac_objext` in
X      *64-bit*)
X        libsuff=64
X        ;;
X      esac
X    fi
X    rm -rf conftest*
X    ;;
X  *)
X    ;;
X  esac
X  sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
X  sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
X  ;;
X
Xnetbsd*)
X  version_type=sunos
X  need_lib_prefix=no
X  need_version=no
X  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
X    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
X    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
X    dynamic_linker='NetBSD (a.out) ld.so'
X  else
X    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}'
X    soname_spec='${libname}${release}${shared_ext}$major'
X    dynamic_linker='NetBSD ld.elf_so'
X  fi
X  shlibpath_var=LD_LIBRARY_PATH
X  shlibpath_overrides_runpath=yes
X  hardcode_into_libs=yes
X  ;;
X
Xnewsos6)
X  version_type=linux
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  shlibpath_var=LD_LIBRARY_PATH
X  shlibpath_overrides_runpath=yes
X  ;;
X
Xnto-qnx)
X  version_type=linux
X  need_lib_prefix=no
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  shlibpath_var=LD_LIBRARY_PATH
X  shlibpath_overrides_runpath=yes
X  ;;
X
Xopenbsd*)
X  version_type=sunos
X  need_lib_prefix=no
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
X  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
X  shlibpath_var=LD_LIBRARY_PATH
X  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
X    case $host_os in
X      openbsd2.[89] | openbsd2.[89].*)
X	shlibpath_overrides_runpath=no
X	;;
X      *)
X	shlibpath_overrides_runpath=yes
X	;;
X      esac
X  else
X    shlibpath_overrides_runpath=yes
X  fi
X  ;;
X
Xos2*)
X  libname_spec='$name'
X  shrext=".dll"
X  need_lib_prefix=no
X  library_names_spec='$libname${shared_ext} $libname.a'
X  dynamic_linker='OS/2 ld.exe'
X  shlibpath_var=LIBPATH
X  ;;
X
Xosf3* | osf4* | osf5*)
X  version_type=osf
X  need_lib_prefix=no
X  need_version=no
X  soname_spec='${libname}${release}${shared_ext}$major'
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  shlibpath_var=LD_LIBRARY_PATH
X  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
X  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
X  ;;
X
Xsco3.2v5*)
X  version_type=osf
X  soname_spec='${libname}${release}${shared_ext}$major'
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  shlibpath_var=LD_LIBRARY_PATH
X  ;;
X
Xsolaris*)
X  version_type=linux
X  need_lib_prefix=no
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  shlibpath_var=LD_LIBRARY_PATH
X  shlibpath_overrides_runpath=yes
X  hardcode_into_libs=yes
X  # ldd complains unless libraries are executable
X  postinstall_cmds='chmod +x $lib'
X  ;;
X
Xsunos4*)
X  version_type=sunos
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
X  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
X  shlibpath_var=LD_LIBRARY_PATH
X  shlibpath_overrides_runpath=yes
X  if test "$with_gnu_ld" = yes; then
X    need_lib_prefix=no
X  fi
X  need_version=yes
X  ;;
X
Xsysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
X  version_type=linux
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  shlibpath_var=LD_LIBRARY_PATH
X  case $host_vendor in
X    sni)
X      shlibpath_overrides_runpath=no
X      need_lib_prefix=no
X      export_dynamic_flag_spec='${wl}-Blargedynsym'
X      runpath_var=LD_RUN_PATH
X      ;;
X    siemens)
X      need_lib_prefix=no
X      ;;
X    motorola)
X      need_lib_prefix=no
X      need_version=no
X      shlibpath_overrides_runpath=no
X      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
X      ;;
X  esac
X  ;;
X
Xsysv4*MP*)
X  if test -d /usr/nec ;then
X    version_type=linux
X    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
X    soname_spec='$libname${shared_ext}.$major'
X    shlibpath_var=LD_LIBRARY_PATH
X  fi
X  ;;
X
Xuts4*)
X  version_type=linux
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  shlibpath_var=LD_LIBRARY_PATH
X  ;;
X
X*)
X  dynamic_linker=no
X  ;;
Xesac
Xecho "$as_me:$LINENO: result: $dynamic_linker" >&5
Xecho "${ECHO_T}$dynamic_linker" >&6
Xtest "$dynamic_linker" = no && can_build_shared=no
X
X
X# The else clause should only fire when bootstrapping the
X# libtool distribution, otherwise you forgot to ship ltmain.sh
X# with your package, and you will get complaints that there are
X# no rules to generate ltmain.sh.
Xif test -f "$ltmain"; then
X  # See if we are running on zsh, and set the options which allow our commands through
X  # without removal of \ escapes.
X  if test -n "${ZSH_VERSION+set}" ; then
X    setopt NO_GLOB_SUBST
X  fi
X  # Now quote all the things that may contain metacharacters while being
X  # careful not to overquote the AC_SUBSTed values.  We take copies of the
X  # variables and quote the copies for generation of the libtool script.
X  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \
X    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
X    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
X    deplibs_check_method reload_flag reload_cmds need_locks \
X    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
X    lt_cv_sys_global_symbol_to_c_name_address \
X    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
X    old_postinstall_cmds old_postuninstall_cmds \
X    compiler_F77 \
X    CC_F77 \
X    LD_F77 \
X    lt_prog_compiler_wl_F77 \
X    lt_prog_compiler_pic_F77 \
X    lt_prog_compiler_static_F77 \
X    lt_prog_compiler_no_builtin_flag_F77 \
X    export_dynamic_flag_spec_F77 \
X    thread_safe_flag_spec_F77 \
X    whole_archive_flag_spec_F77 \
X    enable_shared_with_static_runtimes_F77 \
X    old_archive_cmds_F77 \
X    old_archive_from_new_cmds_F77 \
X    predep_objects_F77 \
X    postdep_objects_F77 \
X    predeps_F77 \
X    postdeps_F77 \
X    compiler_lib_search_path_F77 \
X    archive_cmds_F77 \
X    archive_expsym_cmds_F77 \
X    postinstall_cmds_F77 \
X    postuninstall_cmds_F77 \
X    old_archive_from_expsyms_cmds_F77 \
X    allow_undefined_flag_F77 \
X    no_undefined_flag_F77 \
X    export_symbols_cmds_F77 \
X    hardcode_libdir_flag_spec_F77 \
X    hardcode_libdir_flag_spec_ld_F77 \
X    hardcode_libdir_separator_F77 \
X    hardcode_automatic_F77 \
X    module_cmds_F77 \
X    module_expsym_cmds_F77 \
X    lt_cv_prog_compiler_c_o_F77 \
X    exclude_expsyms_F77 \
X    include_expsyms_F77; do
X
X    case $var in
X    old_archive_cmds_F77 | \
X    old_archive_from_new_cmds_F77 | \
X    archive_cmds_F77 | \
X    archive_expsym_cmds_F77 | \
X    module_cmds_F77 | \
X    module_expsym_cmds_F77 | \
X    old_archive_from_expsyms_cmds_F77 | \
X    export_symbols_cmds_F77 | \
X    extract_expsyms_cmds | reload_cmds | finish_cmds | \
X    postinstall_cmds | postuninstall_cmds | \
X    old_postinstall_cmds | old_postuninstall_cmds | \
X    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
X      # Double-quote double-evaled strings.
X      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
X      ;;
X    *)
X      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
X      ;;
X    esac
X  done
X
X  case $lt_echo in
X  *'\$0 --fallback-echo"')
X    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
X    ;;
X  esac
X
Xcfgfile="$ofile"
X
X  cat <<__EOF__ >> "$cfgfile"
X# ### BEGIN LIBTOOL TAG CONFIG: $tagname
X
X# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
X
X# Shell to use when invoking shell scripts.
XSHELL=$lt_SHELL
X
X# Whether or not to build shared libraries.
Xbuild_libtool_libs=$enable_shared
X
X# Whether or not to build static libraries.
Xbuild_old_libs=$enable_static
X
X# Whether or not to add -lc for building shared libraries.
Xbuild_libtool_need_lc=$archive_cmds_need_lc_F77
X
X# Whether or not to disallow shared libs when runtime libs are static
Xallow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77
X
X# Whether or not to optimize for fast installation.
Xfast_install=$enable_fast_install
X
X# The host system.
Xhost_alias=$host_alias
Xhost=$host
X
X# An echo program that does not interpret backslashes.
Xecho=$lt_echo
X
X# The archiver.
XAR=$lt_AR
XAR_FLAGS=$lt_AR_FLAGS
X
X# A C compiler.
XLTCC=$lt_LTCC
X
X# A language-specific compiler.
XCC=$lt_compiler_F77
X
X# Is the compiler the GNU C compiler?
Xwith_gcc=$GCC_F77
X
X# An ERE matcher.
XEGREP=$lt_EGREP
X
X# The linker used to build libraries.
XLD=$lt_LD_F77
X
X# Whether we need hard or soft links.
XLN_S=$lt_LN_S
X
X# A BSD-compatible nm program.
XNM=$lt_NM
X
X# A symbol stripping program
XSTRIP=$STRIP
X
X# Used to examine libraries when file_magic_cmd begins "file"
XMAGIC_CMD=$MAGIC_CMD
X
X# Used on cygwin: DLL creation program.
XDLLTOOL="$DLLTOOL"
X
X# Used on cygwin: object dumper.
XOBJDUMP="$OBJDUMP"
X
X# Used on cygwin: assembler.
XAS="$AS"
X
X# The name of the directory that contains temporary libtool files.
Xobjdir=$objdir
X
X# How to create reloadable object files.
Xreload_flag=$lt_reload_flag
Xreload_cmds=$lt_reload_cmds
X
X# How to pass a linker flag through the compiler.
Xwl=$lt_lt_prog_compiler_wl_F77
X
X# Object file suffix (normally "o").
Xobjext="$ac_objext"
X
X# Old archive suffix (normally "a").
Xlibext="$libext"
X
X# Shared library suffix (normally ".so").
Xshrext='$shrext'
X
X# Executable file suffix (normally "").
Xexeext="$exeext"
X
X# Additional compiler flags for building library objects.
Xpic_flag=$lt_lt_prog_compiler_pic_F77
Xpic_mode=$pic_mode
X
X# What is the maximum length of a command?
Xmax_cmd_len=$lt_cv_sys_max_cmd_len
X
X# Does compiler simultaneously support -c and -o options?
Xcompiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
X
X# Must we lock files when doing compilation ?
Xneed_locks=$lt_need_locks
X
X# Do we need the lib prefix for modules?
Xneed_lib_prefix=$need_lib_prefix
X
X# Do we need a version for libraries?
Xneed_version=$need_version
X
X# Whether dlopen is supported.
Xdlopen_support=$enable_dlopen
X
X# Whether dlopen of programs is supported.
Xdlopen_self=$enable_dlopen_self
X
X# Whether dlopen of statically linked programs is supported.
Xdlopen_self_static=$enable_dlopen_self_static
X
X# Compiler flag to prevent dynamic linking.
Xlink_static_flag=$lt_lt_prog_compiler_static_F77
X
X# Compiler flag to turn off builtin functions.
Xno_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77
X
X# Compiler flag to allow reflexive dlopens.
Xexport_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77
X
X# Compiler flag to generate shared objects directly from archives.
Xwhole_archive_flag_spec=$lt_whole_archive_flag_spec_F77
X
X# Compiler flag to generate thread-safe objects.
Xthread_safe_flag_spec=$lt_thread_safe_flag_spec_F77
X
X# Library versioning type.
Xversion_type=$version_type
X
X# Format of library name prefix.
Xlibname_spec=$lt_libname_spec
X
X# List of archive names.  First name is the real one, the rest are links.
X# The last name is the one that the linker finds with -lNAME.
Xlibrary_names_spec=$lt_library_names_spec
X
X# The coded name of the library, if different from the real name.
Xsoname_spec=$lt_soname_spec
X
X# Commands used to build and install an old-style archive.
XRANLIB=$lt_RANLIB
Xold_archive_cmds=$lt_old_archive_cmds_F77
Xold_postinstall_cmds=$lt_old_postinstall_cmds
Xold_postuninstall_cmds=$lt_old_postuninstall_cmds
X
X# Create an old-style archive from a shared archive.
Xold_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77
X
X# Create a temporary old-style archive to link instead of a shared archive.
Xold_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77
X
X# Commands used to build and install a shared archive.
Xarchive_cmds=$lt_archive_cmds_F77
Xarchive_expsym_cmds=$lt_archive_expsym_cmds_F77
Xpostinstall_cmds=$lt_postinstall_cmds
Xpostuninstall_cmds=$lt_postuninstall_cmds
X
X# Commands used to build a loadable module (assumed same as above if empty)
Xmodule_cmds=$lt_module_cmds_F77
Xmodule_expsym_cmds=$lt_module_expsym_cmds_F77
X
X# Commands to strip libraries.
Xold_striplib=$lt_old_striplib
Xstriplib=$lt_striplib
X
X# Dependencies to place before the objects being linked to create a
X# shared library.
Xpredep_objects=$lt_predep_objects_F77
X
X# Dependencies to place after the objects being linked to create a
X# shared library.
Xpostdep_objects=$lt_postdep_objects_F77
X
X# Dependencies to place before the objects being linked to create a
X# shared library.
Xpredeps=$lt_predeps_F77
X
X# Dependencies to place after the objects being linked to create a
X# shared library.
Xpostdeps=$lt_postdeps_F77
X
X# The library search path used internally by the compiler when linking
X# a shared library.
Xcompiler_lib_search_path=$lt_compiler_lib_search_path_F77
X
X# Method to check whether dependent libraries are shared objects.
Xdeplibs_check_method=$lt_deplibs_check_method
X
X# Command to use when deplibs_check_method == file_magic.
Xfile_magic_cmd=$lt_file_magic_cmd
X
X# Flag that allows shared libraries with undefined symbols to be built.
Xallow_undefined_flag=$lt_allow_undefined_flag_F77
X
X# Flag that forces no undefined symbols.
Xno_undefined_flag=$lt_no_undefined_flag_F77
X
X# Commands used to finish a libtool library installation in a directory.
Xfinish_cmds=$lt_finish_cmds
X
X# Same as above, but a single script fragment to be evaled but not shown.
Xfinish_eval=$lt_finish_eval
X
X# Take the output of nm and produce a listing of raw symbols and C names.
Xglobal_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
X
X# Transform the output of nm in a proper C declaration
Xglobal_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
X
X# Transform the output of nm in a C name address pair
Xglobal_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
X
X# This is the shared library runtime path variable.
Xrunpath_var=$runpath_var
X
X# This is the shared library path variable.
Xshlibpath_var=$shlibpath_var
X
X# Is shlibpath searched before the hard-coded library search path?
Xshlibpath_overrides_runpath=$shlibpath_overrides_runpath
X
X# How to hardcode a shared library path into an executable.
Xhardcode_action=$hardcode_action_F77
X
X# Whether we should hardcode library paths into libraries.
Xhardcode_into_libs=$hardcode_into_libs
X
X# Flag to hardcode \$libdir into a binary during linking.
X# This must work even if \$libdir does not exist.
Xhardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77
X
X# If ld is used when linking, flag to hardcode \$libdir into
X# a binary during linking. This must work even if \$libdir does
X# not exist.
Xhardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77
X
X# Whether we need a single -rpath flag with a separated argument.
Xhardcode_libdir_separator=$lt_hardcode_libdir_separator_F77
X
X# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
X# resulting binary.
Xhardcode_direct=$hardcode_direct_F77
X
X# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
X# resulting binary.
Xhardcode_minus_L=$hardcode_minus_L_F77
X
X# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
X# the resulting binary.
Xhardcode_shlibpath_var=$hardcode_shlibpath_var_F77
X
X# Set to yes if building a shared library automatically hardcodes DIR into the library
X# and all subsequent libraries and executables linked against it.
Xhardcode_automatic=$hardcode_automatic_F77
X
X# Variables whose values should be saved in libtool wrapper scripts and
X# restored at relink time.
Xvariables_saved_for_relink="$variables_saved_for_relink"
X
X# Whether libtool must link a program against all its dependency libraries.
Xlink_all_deplibs=$link_all_deplibs_F77
X
X# Compile-time system search path for libraries
Xsys_lib_search_path_spec=$lt_sys_lib_search_path_spec
X
X# Run-time system search path for libraries
Xsys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
X
X# Fix the shell variable \$srcfile for the compiler.
Xfix_srcfile_path="$fix_srcfile_path_F77"
X
X# Set to yes if exported symbols are required.
Xalways_export_symbols=$always_export_symbols_F77
X
X# The commands to list exported symbols.
Xexport_symbols_cmds=$lt_export_symbols_cmds_F77
X
X# The commands to extract the exported symbol list from a shared archive.
Xextract_expsyms_cmds=$lt_extract_expsyms_cmds
X
X# Symbols that should not be listed in the preloaded symbols.
Xexclude_expsyms=$lt_exclude_expsyms_F77
X
X# Symbols that must always be exported.
Xinclude_expsyms=$lt_include_expsyms_F77
X
X# ### END LIBTOOL TAG CONFIG: $tagname
X
X__EOF__
X
X
Xelse
X  # If there is no Makefile yet, we rely on a make rule to execute
X  # `config.status --recheck' to rerun these tests and create the
X  # libtool script then.
X  test -f Makefile && make "$ltmain"
Xfi
X
X
Xac_ext=c
Xac_cpp='$CPP $CPPFLAGS'
Xac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
Xac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
Xac_compiler_gnu=$ac_cv_c_compiler_gnu
X
XCC="$lt_save_CC"
X
X	else
X	  tagname=""
X	fi
X	;;
X
X      GCJ)
X	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
X
X
X
X# Source file extension for Java test sources.
Xac_ext=java
X
X# Object file extension for compiled Java test sources.
Xobjext=o
Xobjext_GCJ=$objext
X
X# Code to be used in simple compile tests
Xlt_simple_compile_test_code="class foo {}\n"
X
X# Code to be used in simple link tests
Xlt_simple_link_test_code='public class conftest { public static void main(String argv) {}; }\n'
X
X# ltmain only uses $CC for tagged configurations so make sure $CC is set.
X
X# If no C compiler was specified, use CC.
XLTCC=${LTCC-"$CC"}
X
X# Allow CC to be a program name with arguments.
Xcompiler=$CC
X
X
X# Allow CC to be a program name with arguments.
Xlt_save_CC="$CC"
XCC=${GCJ-"gcj"}
Xcompiler=$CC
Xcompiler_GCJ=$CC
X
X# GCJ did not exist at the time GCC didn't implicitly link libc in.
Xarchive_cmds_need_lc_GCJ=no
X
X
Xlt_prog_compiler_no_builtin_flag_GCJ=
X
Xif test "$GCC" = yes; then
X  lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin'
X
X  echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
Xecho $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
Xif test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  lt_cv_prog_compiler_rtti_exceptions=no
X  ac_outfile=conftest.$ac_objext
X   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
X   lt_compiler_flag="-fno-rtti -fno-exceptions"
X   # Insert the option either (1) after the last *FLAGS variable, or
X   # (2) before a word containing "conftest.", or (3) at the end.
X   # Note that $ac_compile itself does not contain backslashes and begins
X   # with a dollar sign (not a hyphen), so the echo should work correctly.
X   # The option is referenced via a variable to avoid confusing sed.
X   lt_compile=`echo "$ac_compile" | $SED \
X   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
X   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
X   -e 's:$: $lt_compiler_flag:'`
X   (eval echo "\"\$as_me:15005: $lt_compile\"" >&5)
X   (eval "$lt_compile" 2>conftest.err)
X   ac_status=$?
X   cat conftest.err >&5
X   echo "$as_me:15009: \$? = $ac_status" >&5
X   if (exit $ac_status) && test -s "$ac_outfile"; then
X     # The compiler can only warn and ignore the option if not recognized
X     # So say no if there are warnings
X     if test ! -s conftest.err; then
X       lt_cv_prog_compiler_rtti_exceptions=yes
X     fi
X   fi
X   $rm conftest*
X
Xfi
Xecho "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
Xecho "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6
X
Xif test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
X    lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions"
Xelse
X    :
Xfi
X
Xfi
X
Xlt_prog_compiler_wl_GCJ=
Xlt_prog_compiler_pic_GCJ=
Xlt_prog_compiler_static_GCJ=
X
Xecho "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
Xecho $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
X
X  if test "$GCC" = yes; then
X    lt_prog_compiler_wl_GCJ='-Wl,'
X    lt_prog_compiler_static_GCJ='-static'
X
X    case $host_os in
X      aix*)
X      # All AIX code is PIC.
X      if test "$host_cpu" = ia64; then
X	# AIX 5 now supports IA64 processor
X	lt_prog_compiler_static_GCJ='-Bstatic'
X      fi
X      ;;
X
X    amigaos*)
X      # FIXME: we need at least 68020 code to build shared libraries, but
X      # adding the `-m68020' flag to GCC prevents building anything better,
X      # like `-m68040'.
X      lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4'
X      ;;
X
X    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
X      # PIC is the default for these OSes.
X      ;;
X
X    mingw* | pw32* | os2*)
X      # This hack is so that the source file can tell whether it is being
X      # built for inclusion in a dll (and should export symbols for example).
X      lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
X      ;;
X
X    darwin* | rhapsody*)
X      # PIC is the default on this platform
X      # Common symbols not allowed in MH_DYLIB files
X      lt_prog_compiler_pic_GCJ='-fno-common'
X      ;;
X
X    msdosdjgpp*)
X      # Just because we use GCC doesn't mean we suddenly get shared libraries
X      # on systems that don't support them.
X      lt_prog_compiler_can_build_shared_GCJ=no
X      enable_shared=no
X      ;;
X
X    sysv4*MP*)
X      if test -d /usr/nec; then
X	lt_prog_compiler_pic_GCJ=-Kconform_pic
X      fi
X      ;;
X
X    hpux*)
X      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
X      # not for PA HP-UX.
X      case "$host_cpu" in
X      hppa*64*|ia64*)
X	# +Z the default
X	;;
X      *)
X	lt_prog_compiler_pic_GCJ='-fPIC'
X	;;
X      esac
X      ;;
X
X    *)
X      lt_prog_compiler_pic_GCJ='-fPIC'
X      ;;
X    esac
X  else
X    # PORTME Check for flag to pass linker flags through the system compiler.
X    case $host_os in
X    aix*)
X      lt_prog_compiler_wl_GCJ='-Wl,'
X      if test "$host_cpu" = ia64; then
X	# AIX 5 now supports IA64 processor
X	lt_prog_compiler_static_GCJ='-Bstatic'
X      else
X	lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp'
X      fi
X      ;;
X
X    mingw* | pw32* | os2*)
X      # This hack is so that the source file can tell whether it is being
X      # built for inclusion in a dll (and should export symbols for example).
X      lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
X      ;;
X
X    hpux9* | hpux10* | hpux11*)
X      lt_prog_compiler_wl_GCJ='-Wl,'
X      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
X      # not for PA HP-UX.
X      case "$host_cpu" in
X      hppa*64*|ia64*)
X	# +Z the default
X	;;
X      *)
X	lt_prog_compiler_pic_GCJ='+Z'
X	;;
X      esac
X      # Is there a better lt_prog_compiler_static that works with the bundled CC?
X      lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive'
X      ;;
X
X    irix5* | irix6* | nonstopux*)
X      lt_prog_compiler_wl_GCJ='-Wl,'
X      # PIC (with -KPIC) is the default.
X      lt_prog_compiler_static_GCJ='-non_shared'
X      ;;
X
X    newsos6)
X      lt_prog_compiler_pic_GCJ='-KPIC'
X      lt_prog_compiler_static_GCJ='-Bstatic'
X      ;;
X
X    linux*)
X      case $CC in
X      icc|ecc)
X	lt_prog_compiler_wl_GCJ='-Wl,'
X	lt_prog_compiler_pic_GCJ='-KPIC'
X	lt_prog_compiler_static_GCJ='-static'
X        ;;
X      ccc)
X        lt_prog_compiler_wl_GCJ='-Wl,'
X        # All Alpha code is PIC.
X        lt_prog_compiler_static_GCJ='-non_shared'
X        ;;
X      esac
X      ;;
X
X    osf3* | osf4* | osf5*)
X      lt_prog_compiler_wl_GCJ='-Wl,'
X      # All OSF/1 code is PIC.
X      lt_prog_compiler_static_GCJ='-non_shared'
X      ;;
X
X    sco3.2v5*)
X      lt_prog_compiler_pic_GCJ='-Kpic'
X      lt_prog_compiler_static_GCJ='-dn'
X      ;;
X
X    solaris*)
X      lt_prog_compiler_wl_GCJ='-Wl,'
X      lt_prog_compiler_pic_GCJ='-KPIC'
X      lt_prog_compiler_static_GCJ='-Bstatic'
X      ;;
X
X    sunos4*)
X      lt_prog_compiler_wl_GCJ='-Qoption ld '
X      lt_prog_compiler_pic_GCJ='-PIC'
X      lt_prog_compiler_static_GCJ='-Bstatic'
X      ;;
X
X    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
X      lt_prog_compiler_wl_GCJ='-Wl,'
X      lt_prog_compiler_pic_GCJ='-KPIC'
X      lt_prog_compiler_static_GCJ='-Bstatic'
X      ;;
X
X    sysv4*MP*)
X      if test -d /usr/nec ;then
X	lt_prog_compiler_pic_GCJ='-Kconform_pic'
X	lt_prog_compiler_static_GCJ='-Bstatic'
X      fi
X      ;;
X
X    uts4*)
X      lt_prog_compiler_pic_GCJ='-pic'
X      lt_prog_compiler_static_GCJ='-Bstatic'
X      ;;
X
X    *)
X      lt_prog_compiler_can_build_shared_GCJ=no
X      ;;
X    esac
X  fi
X
Xecho "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5
Xecho "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6
X
X#
X# Check to make sure the PIC flag actually works.
X#
Xif test -n "$lt_prog_compiler_pic_GCJ"; then
X  echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
Xecho $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6
Xif test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  lt_prog_compiler_pic_works_GCJ=no
X  ac_outfile=conftest.$ac_objext
X   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
X   lt_compiler_flag="$lt_prog_compiler_pic_GCJ"
X   # Insert the option either (1) after the last *FLAGS variable, or
X   # (2) before a word containing "conftest.", or (3) at the end.
X   # Note that $ac_compile itself does not contain backslashes and begins
X   # with a dollar sign (not a hyphen), so the echo should work correctly.
X   # The option is referenced via a variable to avoid confusing sed.
X   lt_compile=`echo "$ac_compile" | $SED \
X   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
X   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
X   -e 's:$: $lt_compiler_flag:'`
X   (eval echo "\"\$as_me:15237: $lt_compile\"" >&5)
X   (eval "$lt_compile" 2>conftest.err)
X   ac_status=$?
X   cat conftest.err >&5
X   echo "$as_me:15241: \$? = $ac_status" >&5
X   if (exit $ac_status) && test -s "$ac_outfile"; then
X     # The compiler can only warn and ignore the option if not recognized
X     # So say no if there are warnings
X     if test ! -s conftest.err; then
X       lt_prog_compiler_pic_works_GCJ=yes
X     fi
X   fi
X   $rm conftest*
X
Xfi
Xecho "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5
Xecho "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6
X
Xif test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then
X    case $lt_prog_compiler_pic_GCJ in
X     "" | " "*) ;;
X     *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;;
X     esac
Xelse
X    lt_prog_compiler_pic_GCJ=
X     lt_prog_compiler_can_build_shared_GCJ=no
Xfi
X
Xfi
Xcase "$host_os" in
X  # For platforms which do not support PIC, -DPIC is meaningless:
X  *djgpp*)
X    lt_prog_compiler_pic_GCJ=
X    ;;
X  *)
X    lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ"
X    ;;
Xesac
X
Xecho "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
Xecho $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
Xif test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  lt_cv_prog_compiler_c_o_GCJ=no
X   $rm -r conftest 2>/dev/null
X   mkdir conftest
X   cd conftest
X   mkdir out
X   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
X
X   # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
X   # that will create temporary files in the current directory regardless of
X   # the output directory.  Thus, making CWD read-only will cause this test
X   # to fail, enabling locking or at least warning the user not to do parallel
X   # builds.
X   chmod -w .
X
X   lt_compiler_flag="-o out/conftest2.$ac_objext"
X   # Insert the option either (1) after the last *FLAGS variable, or
X   # (2) before a word containing "conftest.", or (3) at the end.
X   # Note that $ac_compile itself does not contain backslashes and begins
X   # with a dollar sign (not a hyphen), so the echo should work correctly.
X   lt_compile=`echo "$ac_compile" | $SED \
X   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
X   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
X   -e 's:$: $lt_compiler_flag:'`
X   (eval echo "\"\$as_me:15304: $lt_compile\"" >&5)
X   (eval "$lt_compile" 2>out/conftest.err)
X   ac_status=$?
X   cat out/conftest.err >&5
X   echo "$as_me:15308: \$? = $ac_status" >&5
X   if (exit $ac_status) && test -s out/conftest2.$ac_objext
X   then
X     # The compiler can only warn and ignore the option if not recognized
X     # So say no if there are warnings
X     if test ! -s out/conftest.err; then
X       lt_cv_prog_compiler_c_o_GCJ=yes
X     fi
X   fi
X   chmod u+w .
X   $rm conftest* out/*
X   rmdir out
X   cd ..
X   rmdir conftest
X   $rm conftest*
X
Xfi
Xecho "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
Xecho "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6
X
X
Xhard_links="nottested"
Xif test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then
X  # do not overwrite the value of need_locks provided by the user
X  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
Xecho $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
X  hard_links=yes
X  $rm conftest*
X  ln conftest.a conftest.b 2>/dev/null && hard_links=no
X  touch conftest.a
X  ln conftest.a conftest.b 2>&5 || hard_links=no
X  ln conftest.a conftest.b 2>/dev/null && hard_links=no
X  echo "$as_me:$LINENO: result: $hard_links" >&5
Xecho "${ECHO_T}$hard_links" >&6
X  if test "$hard_links" = no; then
X    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
Xecho "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
X    need_locks=warn
X  fi
Xelse
X  need_locks=no
Xfi
X
Xecho "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
Xecho $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
X
X  runpath_var=
X  allow_undefined_flag_GCJ=
X  enable_shared_with_static_runtimes_GCJ=no
X  archive_cmds_GCJ=
X  archive_expsym_cmds_GCJ=
X  old_archive_From_new_cmds_GCJ=
X  old_archive_from_expsyms_cmds_GCJ=
X  export_dynamic_flag_spec_GCJ=
X  whole_archive_flag_spec_GCJ=
X  thread_safe_flag_spec_GCJ=
X  hardcode_libdir_flag_spec_GCJ=
X  hardcode_libdir_flag_spec_ld_GCJ=
X  hardcode_libdir_separator_GCJ=
X  hardcode_direct_GCJ=no
X  hardcode_minus_L_GCJ=no
X  hardcode_shlibpath_var_GCJ=unsupported
X  link_all_deplibs_GCJ=unknown
X  hardcode_automatic_GCJ=no
X  module_cmds_GCJ=
X  module_expsym_cmds_GCJ=
X  always_export_symbols_GCJ=no
X  export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
X  # include_expsyms should be a list of space-separated symbols to be *always*
X  # included in the symbol list
X  include_expsyms_GCJ=
X  # exclude_expsyms can be an extended regexp of symbols to exclude
X  # it will be wrapped by ` (' and `)$', so one must not match beginning or
X  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
X  # as well as any symbol that contains `d'.
X  exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_"
X  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
X  # platforms (ab)use it in PIC code, but their linkers get confused if
X  # the symbol is explicitly referenced.  Since portable code cannot
X  # rely on this symbol name, it's probably fine to never include it in
X  # preloaded symbol tables.
X  extract_expsyms_cmds=
X
X  case $host_os in
X  cygwin* | mingw* | pw32*)
X    # FIXME: the MSVC++ port hasn't been tested in a loooong time
X    # When not using gcc, we currently assume that we are using
X    # Microsoft Visual C++.
X    if test "$GCC" != yes; then
X      with_gnu_ld=no
X    fi
X    ;;
X  openbsd*)
X    with_gnu_ld=no
X    ;;
X  esac
X
X  ld_shlibs_GCJ=yes
X  if test "$with_gnu_ld" = yes; then
X    # If archive_cmds runs LD, not CC, wlarc should be empty
X    wlarc='${wl}'
X
X    # See if GNU ld supports shared libraries.
X    case $host_os in
X    aix3* | aix4* | aix5*)
X      # On AIX/PPC, the GNU linker is very broken
X      if test "$host_cpu" != ia64; then
X	ld_shlibs_GCJ=no
X	cat <<EOF 1>&2
X
X*** Warning: the GNU linker, at least up to release 2.9.1, is reported
X*** to be unable to reliably create shared libraries on AIX.
X*** Therefore, libtool is disabling shared libraries support.  If you
X*** really care for shared libraries, you may want to modify your PATH
X*** so that a non-GNU linker is found, and then restart.
X
XEOF
X      fi
X      ;;
X
X    amigaos*)
X      archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
X      hardcode_libdir_flag_spec_GCJ='-L$libdir'
X      hardcode_minus_L_GCJ=yes
X
X      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
X      # that the semantics of dynamic libraries on AmigaOS, at least up
X      # to version 4, is to share data among multiple programs linked
X      # with the same dynamic library.  Since this doesn't match the
X      # behavior of shared libraries on other platforms, we can't use
X      # them.
X      ld_shlibs_GCJ=no
X      ;;
X
X    beos*)
X      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
X	allow_undefined_flag_GCJ=unsupported
X	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
X	# support --undefined.  This deserves some investigation.  FIXME
X	archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
X      else
X	ld_shlibs_GCJ=no
X      fi
X      ;;
X
X    cygwin* | mingw* | pw32*)
X      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless,
X      # as there is no search path for DLLs.
X      hardcode_libdir_flag_spec_GCJ='-L$libdir'
X      allow_undefined_flag_GCJ=unsupported
X      always_export_symbols_GCJ=no
X      enable_shared_with_static_runtimes_GCJ=yes
X      export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
X
X      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
X        archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
X	# If the export-symbols file already is a .def file (1st line
X	# is EXPORTS), use it as is; otherwise, prepend...
X	archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
X	  cp $export_symbols $output_objdir/$soname.def;
X	else
X	  echo EXPORTS > $output_objdir/$soname.def;
X	  cat $export_symbols >> $output_objdir/$soname.def;
X	fi~
X	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
X      else
X	ld_shlibs=no
X      fi
X      ;;
X
X    netbsd*)
X      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
X	archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
X	wlarc=
X      else
X	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
X	archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
X      fi
X      ;;
X
X    solaris* | sysv5*)
X      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
X	ld_shlibs_GCJ=no
X	cat <<EOF 1>&2
X
X*** Warning: The releases 2.8.* of the GNU linker cannot reliably
X*** create shared libraries on Solaris systems.  Therefore, libtool
X*** is disabling shared libraries support.  We urge you to upgrade GNU
X*** binutils to release 2.9.1 or newer.  Another option is to modify
X*** your PATH or compiler configuration so that the native linker is
X*** used, and then restart.
X
XEOF
X      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
X	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
X	archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
X      else
X	ld_shlibs_GCJ=no
X      fi
X      ;;
X
X    sunos4*)
X      archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
X      wlarc=
X      hardcode_direct_GCJ=yes
X      hardcode_shlibpath_var_GCJ=no
X      ;;
X
X  linux*)
X    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
X        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
X	archive_cmds_GCJ="$tmp_archive_cmds"
X      supports_anon_versioning=no
X      case `$LD -v 2>/dev/null` in
X        *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
X        *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
X        *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
X        *\ 2.11.*) ;; # other 2.11 versions
X        *) supports_anon_versioning=yes ;;
X      esac
X      if test $supports_anon_versioning = yes; then
X        archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
Xcat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
X$echo "local: *; };" >> $output_objdir/$libname.ver~
X        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
X      else
X        archive_expsym_cmds_GCJ="$tmp_archive_cmds"
X      fi
X    else
X      ld_shlibs_GCJ=no
X    fi
X    ;;
X
X    *)
X      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
X	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
X	archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
X      else
X	ld_shlibs_GCJ=no
X      fi
X      ;;
X    esac
X
X    if test "$ld_shlibs_GCJ" = yes; then
X      runpath_var=LD_RUN_PATH
X      hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir'
X      export_dynamic_flag_spec_GCJ='${wl}--export-dynamic'
X      # ancient GNU ld didn't support --whole-archive et. al.
X      if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
X 	whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
X      else
X  	whole_archive_flag_spec_GCJ=
X      fi
X    fi
X  else
X    # PORTME fill in a description of your system's linker (not GNU ld)
X    case $host_os in
X    aix3*)
X      allow_undefined_flag_GCJ=unsupported
X      always_export_symbols_GCJ=yes
X      archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
X      # Note: this linker hardcodes the directories in LIBPATH if there
X      # are no directories specified by -L.
X      hardcode_minus_L_GCJ=yes
X      if test "$GCC" = yes && test -z "$link_static_flag"; then
X	# Neither direct hardcoding nor static linking is supported with a
X	# broken collect2.
X	hardcode_direct_GCJ=unsupported
X      fi
X      ;;
X
X    aix4* | aix5*)
X      if test "$host_cpu" = ia64; then
X	# On IA64, the linker does run time linking by default, so we don't
X	# have to do anything special.
X	aix_use_runtimelinking=no
X	exp_sym_flag='-Bexport'
X	no_entry_flag=""
X      else
X	# If we're using GNU nm, then we don't want the "-C" option.
X	# -C means demangle to AIX nm, but means don't demangle with GNU nm
X	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
X	  export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
X	else
X	  export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
X	fi
X	aix_use_runtimelinking=no
X
X	# Test if we are trying to use run time linking or normal
X	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
X	# need to do runtime linking.
X	case $host_os in aix4.[23]|aix4.[23].*|aix5*)
X	  for ld_flag in $LDFLAGS; do
X  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
X  	    aix_use_runtimelinking=yes
X  	    break
X  	  fi
X	  done
X	esac
X
X	exp_sym_flag='-bexport'
X	no_entry_flag='-bnoentry'
X      fi
X
X      # When large executables or shared objects are built, AIX ld can
X      # have problems creating the table of contents.  If linking a library
X      # or program results in "error TOC overflow" add -mminimal-toc to
X      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
X      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
X
X      archive_cmds_GCJ=''
X      hardcode_direct_GCJ=yes
X      hardcode_libdir_separator_GCJ=':'
X      link_all_deplibs_GCJ=yes
X
X      if test "$GCC" = yes; then
X	case $host_os in aix4.012|aix4.012.*)
X	# We only want to do this on AIX 4.2 and lower, the check
X	# below for broken collect2 doesn't work under 4.3+
X	  collect2name=`${CC} -print-prog-name=collect2`
X	  if test -f "$collect2name" && \
X  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
X	  then
X  	  # We have reworked collect2
X  	  hardcode_direct_GCJ=yes
X	  else
X  	  # We have old collect2
X  	  hardcode_direct_GCJ=unsupported
X  	  # It fails to find uninstalled libraries when the uninstalled
X  	  # path is not listed in the libpath.  Setting hardcode_minus_L
X  	  # to unsupported forces relinking
X  	  hardcode_minus_L_GCJ=yes
X  	  hardcode_libdir_flag_spec_GCJ='-L$libdir'
X  	  hardcode_libdir_separator_GCJ=
X	  fi
X	esac
X	shared_flag='-shared'
X      else
X	# not using gcc
X	if test "$host_cpu" = ia64; then
X  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
X  	# chokes on -Wl,-G. The following line is correct:
X	  shared_flag='-G'
X	else
X  	if test "$aix_use_runtimelinking" = yes; then
X	    shared_flag='${wl}-G'
X	  else
X	    shared_flag='${wl}-bM:SRE'
X  	fi
X	fi
X      fi
X
X      # It seems that -bexpall does not export symbols beginning with
X      # underscore (_), so it is better to generate a list of symbols to export.
X      always_export_symbols_GCJ=yes
X      if test "$aix_use_runtimelinking" = yes; then
X	# Warning - without using the other runtime loading flags (-brtl),
X	# -berok will link without error, but may produce a broken library.
X	allow_undefined_flag_GCJ='-berok'
X       # Determine the default libpath from the value encoded in an empty executable.
X       cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X
Xint
Xmain ()
X{
X
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X
Xaix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
X}'`
X# Check for a 64-bit object if we didn't find anything.
Xif test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
X}'`; fi
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xfi
Xrm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
Xif test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
X
X       hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
X	archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
X       else
X	if test "$host_cpu" = ia64; then
X	  hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib'
X	  allow_undefined_flag_GCJ="-z nodefs"
X	  archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
X	else
X	 # Determine the default libpath from the value encoded in an empty executable.
X	 cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X
Xint
Xmain ()
X{
X
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X
Xaix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
X}'`
X# Check for a 64-bit object if we didn't find anything.
Xif test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
X}'`; fi
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xfi
Xrm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
Xif test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
X
X	 hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
X	  # Warning - without using the other run time loading flags,
X	  # -berok will link without error, but may produce a broken library.
X	  no_undefined_flag_GCJ=' ${wl}-bernotok'
X	  allow_undefined_flag_GCJ=' ${wl}-berok'
X	  # -bexpall does not export symbols beginning with underscore (_)
X	  always_export_symbols_GCJ=yes
X	  # Exported symbols can be pulled into shared objects from archives
X	  whole_archive_flag_spec_GCJ=' '
X	  archive_cmds_need_lc_GCJ=yes
X	  # This is similar to how AIX traditionally builds it's shared libraries.
X	  archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
X	fi
X      fi
X      ;;
X
X    amigaos*)
X      archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
X      hardcode_libdir_flag_spec_GCJ='-L$libdir'
X      hardcode_minus_L_GCJ=yes
X      # see comment about different semantics on the GNU ld section
X      ld_shlibs_GCJ=no
X      ;;
X
X    bsdi4*)
X      export_dynamic_flag_spec_GCJ=-rdynamic
X      ;;
X
X    cygwin* | mingw* | pw32*)
X      # When not using gcc, we currently assume that we are using
X      # Microsoft Visual C++.
X      # hardcode_libdir_flag_spec is actually meaningless, as there is
X      # no search path for DLLs.
X      hardcode_libdir_flag_spec_GCJ=' '
X      allow_undefined_flag_GCJ=unsupported
X      # Tell ltmain to make .lib files, not .a files.
X      libext=lib
X      # Tell ltmain to make .dll files, not .so files.
X      shrext=".dll"
X      # FIXME: Setting linknames here is a bad hack.
X      archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
X      # The linker will automatically build a .lib file if we build a DLL.
X      old_archive_From_new_cmds_GCJ='true'
X      # FIXME: Should let the user specify the lib program.
X      old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs'
X      fix_srcfile_path='`cygpath -w "$srcfile"`'
X      enable_shared_with_static_runtimes_GCJ=yes
X      ;;
X
X    darwin* | rhapsody*)
X    if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
X      archive_cmds_need_lc_GCJ=no
X      case "$host_os" in
X      rhapsody* | darwin1.[012])
X	allow_undefined_flag_GCJ='-undefined suppress'
X	;;
X      *) # Darwin 1.3 on
X	test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag_GCJ='-flat_namespace -undefined suppress'
X	;;
X      esac
X      # FIXME: Relying on posixy $() will cause problems for
X      #        cross-compilation, but unfortunately the echo tests do not
X      #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
X      #	       `"' quotes if we put them in here... so don't!
X    	lt_int_apple_cc_single_mod=no
X    	output_verbose_link_cmd='echo'
X    	if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
X    	  lt_int_apple_cc_single_mod=yes
X    	fi
X    	if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
X    	  archive_cmds_GCJ='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
X    	else
X        archive_cmds_GCJ='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
X      fi
X      module_cmds_GCJ='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags'
X      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
X        if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
X          archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
X        else
X          archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
X        fi
X          module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag  -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
X      hardcode_direct_GCJ=no
X      hardcode_automatic_GCJ=yes
X      hardcode_shlibpath_var_GCJ=unsupported
X      whole_archive_flag_spec_GCJ='-all_load $convenience'
X      link_all_deplibs_GCJ=yes
X    fi
X      ;;
X
X    dgux*)
X      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
X      hardcode_libdir_flag_spec_GCJ='-L$libdir'
X      hardcode_shlibpath_var_GCJ=no
X      ;;
X
X    freebsd1*)
X      ld_shlibs_GCJ=no
X      ;;
X
X    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
X    # support.  Future versions do this automatically, but an explicit c++rt0.o
X    # does not break anything, and helps significantly (at the cost of a little
X    # extra space).
X    freebsd2.2*)
X      archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
X      hardcode_libdir_flag_spec_GCJ='-R$libdir'
X      hardcode_direct_GCJ=yes
X      hardcode_shlibpath_var_GCJ=no
X      ;;
X
X    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
X    freebsd2*)
X      archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
X      hardcode_direct_GCJ=yes
X      hardcode_minus_L_GCJ=yes
X      hardcode_shlibpath_var_GCJ=no
X      ;;
X
X    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
X    freebsd*)
X      archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
X      hardcode_libdir_flag_spec_GCJ='-R$libdir'
X      hardcode_direct_GCJ=yes
X      hardcode_shlibpath_var_GCJ=no
X      ;;
X
X    hpux9*)
X      if test "$GCC" = yes; then
X	archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
X      else
X	archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
X      fi
X      hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
X      hardcode_libdir_separator_GCJ=:
X      hardcode_direct_GCJ=yes
X
X      # hardcode_minus_L: Not really in the search PATH,
X      # but as the default location of the library.
X      hardcode_minus_L_GCJ=yes
X      export_dynamic_flag_spec_GCJ='${wl}-E'
X      ;;
X
X    hpux10* | hpux11*)
X      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
X	case "$host_cpu" in
X	hppa*64*|ia64*)
X	  archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
X	  ;;
X	*)
X	  archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
X	  ;;
X	esac
X      else
X	case "$host_cpu" in
X	hppa*64*|ia64*)
X	  archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
X	  ;;
X	*)
X	  archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
X	  ;;
X	esac
X      fi
X      if test "$with_gnu_ld" = no; then
X	case "$host_cpu" in
X	hppa*64*)
X	  hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
X	  hardcode_libdir_flag_spec_ld_GCJ='+b $libdir'
X	  hardcode_libdir_separator_GCJ=:
X	  hardcode_direct_GCJ=no
X	  hardcode_shlibpath_var_GCJ=no
X	  ;;
X	ia64*)
X	  hardcode_libdir_flag_spec_GCJ='-L$libdir'
X	  hardcode_direct_GCJ=no
X	  hardcode_shlibpath_var_GCJ=no
X
X	  # hardcode_minus_L: Not really in the search PATH,
X	  # but as the default location of the library.
X	  hardcode_minus_L_GCJ=yes
X	  ;;
X	*)
X	  hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
X	  hardcode_libdir_separator_GCJ=:
X	  hardcode_direct_GCJ=yes
X	  export_dynamic_flag_spec_GCJ='${wl}-E'
X
X	  # hardcode_minus_L: Not really in the search PATH,
X	  # but as the default location of the library.
X	  hardcode_minus_L_GCJ=yes
X	  ;;
X	esac
X      fi
X      ;;
X
X    irix5* | irix6* | nonstopux*)
X      if test "$GCC" = yes; then
X	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
X      else
X	archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
X	hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir'
X      fi
X      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
X      hardcode_libdir_separator_GCJ=:
X      link_all_deplibs_GCJ=yes
X      ;;
X
X    netbsd*)
X      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
X	archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
X      else
X	archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
X      fi
X      hardcode_libdir_flag_spec_GCJ='-R$libdir'
X      hardcode_direct_GCJ=yes
X      hardcode_shlibpath_var_GCJ=no
X      ;;
X
X    newsos6)
X      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
X      hardcode_direct_GCJ=yes
X      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
X      hardcode_libdir_separator_GCJ=:
X      hardcode_shlibpath_var_GCJ=no
X      ;;
X
X    openbsd*)
X      hardcode_direct_GCJ=yes
X      hardcode_shlibpath_var_GCJ=no
X      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
X	archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
X	hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
X	export_dynamic_flag_spec_GCJ='${wl}-E'
X      else
X       case $host_os in
X	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
X	   archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
X	   hardcode_libdir_flag_spec_GCJ='-R$libdir'
X	   ;;
X	 *)
X	   archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
X	   hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
X	   ;;
X       esac
X      fi
X      ;;
X
X    os2*)
X      hardcode_libdir_flag_spec_GCJ='-L$libdir'
X      hardcode_minus_L_GCJ=yes
X      allow_undefined_flag_GCJ=unsupported
X      archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
X      old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
X      ;;
X
X    osf3*)
X      if test "$GCC" = yes; then
X	allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
X	archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
X      else
X	allow_undefined_flag_GCJ=' -expect_unresolved \*'
X	archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
X      fi
X      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
X      hardcode_libdir_separator_GCJ=:
X      ;;
X
X    osf4* | osf5*)	# as osf3* with the addition of -msym flag
X      if test "$GCC" = yes; then
X	allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
X	archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
X	hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
X      else
X	allow_undefined_flag_GCJ=' -expect_unresolved \*'
X	archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
X	archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
X	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
X
X	# Both c and cxx compiler support -rpath directly
X	hardcode_libdir_flag_spec_GCJ='-rpath $libdir'
X      fi
X      hardcode_libdir_separator_GCJ=:
X      ;;
X
X    sco3.2v5*)
X      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
X      hardcode_shlibpath_var_GCJ=no
X      export_dynamic_flag_spec_GCJ='${wl}-Bexport'
X      runpath_var=LD_RUN_PATH
X      hardcode_runpath_var=yes
X      ;;
X
X    solaris*)
X      no_undefined_flag_GCJ=' -z text'
X      if test "$GCC" = yes; then
X	archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
X	archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
X	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
X      else
X	archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
X	archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
X  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
X      fi
X      hardcode_libdir_flag_spec_GCJ='-R$libdir'
X      hardcode_shlibpath_var_GCJ=no
X      case $host_os in
X      solaris2.[0-5] | solaris2.[0-5].*) ;;
X      *) # Supported since Solaris 2.6 (maybe 2.5.1?)
X	whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;
X      esac
X      link_all_deplibs_GCJ=yes
X      ;;
X
X    sunos4*)
X      if test "x$host_vendor" = xsequent; then
X	# Use $CC to link under sequent, because it throws in some extra .o
X	# files that make .init and .fini sections work.
X	archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
X      else
X	archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
X      fi
X      hardcode_libdir_flag_spec_GCJ='-L$libdir'
X      hardcode_direct_GCJ=yes
X      hardcode_minus_L_GCJ=yes
X      hardcode_shlibpath_var_GCJ=no
X      ;;
X
X    sysv4)
X      case $host_vendor in
X	sni)
X	  archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
X	  hardcode_direct_GCJ=yes # is this really true???
X	;;
X	siemens)
X	  ## LD is ld it makes a PLAMLIB
X	  ## CC just makes a GrossModule.
X	  archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
X	  reload_cmds_GCJ='$CC -r -o $output$reload_objs'
X	  hardcode_direct_GCJ=no
X        ;;
X	motorola)
X	  archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
X	  hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie
X	;;
X      esac
X      runpath_var='LD_RUN_PATH'
X      hardcode_shlibpath_var_GCJ=no
X      ;;
X
X    sysv4.3*)
X      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
X      hardcode_shlibpath_var_GCJ=no
X      export_dynamic_flag_spec_GCJ='-Bexport'
X      ;;
X
X    sysv4*MP*)
X      if test -d /usr/nec; then
X	archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
X	hardcode_shlibpath_var_GCJ=no
X	runpath_var=LD_RUN_PATH
X	hardcode_runpath_var=yes
X	ld_shlibs_GCJ=yes
X      fi
X      ;;
X
X    sysv4.2uw2*)
X      archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
X      hardcode_direct_GCJ=yes
X      hardcode_minus_L_GCJ=no
X      hardcode_shlibpath_var_GCJ=no
X      hardcode_runpath_var=yes
X      runpath_var=LD_RUN_PATH
X      ;;
X
X   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
X      no_undefined_flag_GCJ='${wl}-z ${wl}text'
X      if test "$GCC" = yes; then
X	archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
X      else
X	archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
X      fi
X      runpath_var='LD_RUN_PATH'
X      hardcode_shlibpath_var_GCJ=no
X      ;;
X
X    sysv5*)
X      no_undefined_flag_GCJ=' -z text'
X      # $CC -shared without GNU ld will not create a library from C++
X      # object files and a static libstdc++, better avoid it by now
X      archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
X      archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
X  		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
X      hardcode_libdir_flag_spec_GCJ=
X      hardcode_shlibpath_var_GCJ=no
X      runpath_var='LD_RUN_PATH'
X      ;;
X
X    uts4*)
X      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
X      hardcode_libdir_flag_spec_GCJ='-L$libdir'
X      hardcode_shlibpath_var_GCJ=no
X      ;;
X
X    *)
X      ld_shlibs_GCJ=no
X      ;;
X    esac
X  fi
X
Xecho "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5
Xecho "${ECHO_T}$ld_shlibs_GCJ" >&6
Xtest "$ld_shlibs_GCJ" = no && can_build_shared=no
X
Xvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
Xif test "$GCC" = yes; then
X  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
Xfi
X
X#
X# Do we need to explicitly link libc?
X#
Xcase "x$archive_cmds_need_lc_GCJ" in
Xx|xyes)
X  # Assume -lc should be added
X  archive_cmds_need_lc_GCJ=yes
X
X  if test "$enable_shared" = yes && test "$GCC" = yes; then
X    case $archive_cmds_GCJ in
X    *'~'*)
X      # FIXME: we may have to deal with multi-command sequences.
X      ;;
X    '$CC '*)
X      # Test whether the compiler implicitly links with -lc since on some
X      # systems, -lgcc has to come before -lc. If gcc already passes -lc
X      # to ld, don't add -lc before -lgcc.
X      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
Xecho $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
X      $rm conftest*
X      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
X
X      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } 2>conftest.err; then
X        soname=conftest
X        lib=conftest
X        libobjs=conftest.$ac_objext
X        deplibs=
X        wl=$lt_prog_compiler_wl_GCJ
X        compiler_flags=-v
X        linker_flags=-v
X        verstring=
X        output_objdir=.
X        libname=conftest
X        lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ
X        allow_undefined_flag_GCJ=
X        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
X  (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }
X        then
X	  archive_cmds_need_lc_GCJ=no
X        else
X	  archive_cmds_need_lc_GCJ=yes
X        fi
X        allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag
X      else
X        cat conftest.err 1>&5
X      fi
X      $rm conftest*
X      echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5
Xecho "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6
X      ;;
X    esac
X  fi
X  ;;
Xesac
X
Xecho "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
Xecho $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
Xhardcode_action_GCJ=
Xif test -n "$hardcode_libdir_flag_spec_GCJ" || \
X   test -n "$runpath_var GCJ" || \
X   test "X$hardcode_automatic_GCJ"="Xyes" ; then
X
X  # We can hardcode non-existant directories.
X  if test "$hardcode_direct_GCJ" != no &&
X     # If the only mechanism to avoid hardcoding is shlibpath_var, we
X     # have to relink, otherwise we might link with an installed library
X     # when we should be linking with a yet-to-be-installed one
X     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no &&
X     test "$hardcode_minus_L_GCJ" != no; then
X    # Linking always hardcodes the temporary library directory.
X    hardcode_action_GCJ=relink
X  else
X    # We can link without hardcoding, and we can hardcode nonexisting dirs.
X    hardcode_action_GCJ=immediate
X  fi
Xelse
X  # We cannot hardcode anything, or else we can only hardcode existing
X  # directories.
X  hardcode_action_GCJ=unsupported
Xfi
Xecho "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5
Xecho "${ECHO_T}$hardcode_action_GCJ" >&6
X
Xif test "$hardcode_action_GCJ" = relink; then
X  # Fast installation is not supported
X  enable_fast_install=no
Xelif test "$shlibpath_overrides_runpath" = yes ||
X     test "$enable_shared" = no; then
X  # Fast installation is not necessary
X  enable_fast_install=needless
Xfi
X
Xstriplib=
Xold_striplib=
Xecho "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
Xecho $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
Xif test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
X  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
X  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
X  echo "$as_me:$LINENO: result: yes" >&5
Xecho "${ECHO_T}yes" >&6
Xelse
X# FIXME - insert some real tests, host_os isn't really good enough
X  case $host_os in
X   darwin*)
X       if test -n "$STRIP" ; then
X         striplib="$STRIP -x"
X         echo "$as_me:$LINENO: result: yes" >&5
Xecho "${ECHO_T}yes" >&6
X       else
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X       ;;
X   *)
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
X    ;;
X  esac
Xfi
X
Xecho "$as_me:$LINENO: checking dynamic linker characteristics" >&5
Xecho $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
Xlibrary_names_spec=
Xlibname_spec='lib$name'
Xsoname_spec=
Xshrext=".so"
Xpostinstall_cmds=
Xpostuninstall_cmds=
Xfinish_cmds=
Xfinish_eval=
Xshlibpath_var=
Xshlibpath_overrides_runpath=unknown
Xversion_type=none
Xdynamic_linker="$host_os ld.so"
Xsys_lib_dlsearch_path_spec="/lib /usr/lib"
Xif test "$GCC" = yes; then
X  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
X  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
X    # if the path contains ";" then we assume it to be the separator
X    # otherwise default to the standard path separator (i.e. ":") - it is
X    # assumed that no part of a normal pathname contains ";" but that should
X    # okay in the real world where ";" in dirpaths is itself problematic.
X    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
X  else
X    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
X  fi
Xelse
X  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
Xfi
Xneed_lib_prefix=unknown
Xhardcode_into_libs=no
X
X# when you set need_version to no, make sure it does not cause -set_version
X# flags to be left without arguments
Xneed_version=unknown
X
Xcase $host_os in
Xaix3*)
X  version_type=linux
X  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
X  shlibpath_var=LIBPATH
X
X  # AIX 3 has no versioning support, so we append a major version to the name.
X  soname_spec='${libname}${release}${shared_ext}$major'
X  ;;
X
Xaix4* | aix5*)
X  version_type=linux
X  need_lib_prefix=no
X  need_version=no
X  hardcode_into_libs=yes
X  if test "$host_cpu" = ia64; then
X    # AIX 5 supports IA64
X    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
X    shlibpath_var=LD_LIBRARY_PATH
X  else
X    # With GCC up to 2.95.x, collect2 would create an import file
X    # for dependence libraries.  The import file would start with
X    # the line `#! .'.  This would cause the generated library to
X    # depend on `.', always an invalid library.  This was fixed in
X    # development snapshots of GCC prior to 3.0.
X    case $host_os in
X      aix4 | aix4.[01] | aix4.[01].*)
X      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
X	   echo ' yes '
X	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
X	:
X      else
X	can_build_shared=no
X      fi
X      ;;
X    esac
X    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
X    # soname into executable. Probably we can add versioning support to
X    # collect2, so additional links can be useful in future.
X    if test "$aix_use_runtimelinking" = yes; then
X      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
X      # instead of lib<name>.a to let people know that these are not
X      # typical AIX shared libraries.
X      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X    else
X      # We preserve .a as extension for shared libraries through AIX4.2
X      # and later when we are not doing run time linking.
X      library_names_spec='${libname}${release}.a $libname.a'
X      soname_spec='${libname}${release}${shared_ext}$major'
X    fi
X    shlibpath_var=LIBPATH
X  fi
X  ;;
X
Xamigaos*)
X  library_names_spec='$libname.ixlibrary $libname.a'
X  # Create ${libname}_ixlibrary.a entries in /sys/libs.
X  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
X  ;;
X
Xbeos*)
X  library_names_spec='${libname}${shared_ext}'
X  dynamic_linker="$host_os ld.so"
X  shlibpath_var=LIBRARY_PATH
X  ;;
X
Xbsdi4*)
X  version_type=linux
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
X  shlibpath_var=LD_LIBRARY_PATH
X  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
X  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
X  # the default ld.so.conf also contains /usr/contrib/lib and
X  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
X  # libtool to hard-code these into programs
X  ;;
X
Xcygwin* | mingw* | pw32*)
X  version_type=windows
X  shrext=".dll"
X  need_version=no
X  need_lib_prefix=no
X
X  case $GCC,$host_os in
X  yes,cygwin* | yes,mingw* | yes,pw32*)
X    library_names_spec='$libname.dll.a'
X    # DLL is installed to $(libdir)/../bin by postinstall_cmds
X    postinstall_cmds='base_file=`basename \${file}`~
X      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
X      dldir=$destdir/`dirname \$dlpath`~
X      test -d \$dldir || mkdir -p \$dldir~
X      $install_prog $dir/$dlname \$dldir/$dlname'
X    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
X      dlpath=$dir/\$dldll~
X       $rm \$dlpath'
X    shlibpath_overrides_runpath=yes
X
X    case $host_os in
X    cygwin*)
X      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
X      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
X      sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib"
X      ;;
X    mingw*)
X      # MinGW DLLs use traditional 'lib' prefix
X      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
X      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
X      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
X        # It is most probably a Windows format PATH printed by
X        # mingw gcc, but we are running on Cygwin. Gcc prints its search
X        # path with ; separators, and with drive letters. We can handle the
X        # drive letters (cygwin fileutils understands them), so leave them,
X        # especially as we might pass files found there to a mingw objdump,
X        # which wouldn't understand a cygwinified path. Ahh.
X        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
X      else
X        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
X      fi
X      ;;
X    pw32*)
X      # pw32 DLLs use 'pw' prefix rather than 'lib'
X      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'
X      ;;
X    esac
X    ;;
X
X  *)
X    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
X    ;;
X  esac
X  dynamic_linker='Win32 ld.exe'
X  # FIXME: first we should search . and the directory the executable is in
X  shlibpath_var=PATH
X  ;;
X
Xdarwin* | rhapsody*)
X  dynamic_linker="$host_os dyld"
X  version_type=darwin
X  need_lib_prefix=no
X  need_version=no
X  # FIXME: Relying on posixy $() will cause problems for
X  #        cross-compilation, but unfortunately the echo tests do not
X  #        yet detect zsh echo's removal of \ escapes.
X  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
X  soname_spec='${libname}${release}${major}$shared_ext'
X  shlibpath_overrides_runpath=yes
X  shlibpath_var=DYLD_LIBRARY_PATH
X  shrext='$(test .$module = .yes && echo .so || echo .dylib)'
X  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
X  if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
X  sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
X  fi
X  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
X  ;;
X
Xdgux*)
X  version_type=linux
X  need_lib_prefix=no
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  shlibpath_var=LD_LIBRARY_PATH
X  ;;
X
Xfreebsd1*)
X  dynamic_linker=no
X  ;;
X
Xfreebsd*)
X  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
X  version_type=freebsd-$objformat
X  case $version_type in
X    freebsd-elf*)
X      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
X      need_version=no
X      need_lib_prefix=no
X      ;;
X    freebsd-*)
X      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
X      need_version=yes
X      ;;
X  esac
X  shlibpath_var=LD_LIBRARY_PATH
X  case $host_os in
X  freebsd2*)
X    shlibpath_overrides_runpath=yes
X    ;;
X  freebsd3.01* | freebsdelf3.01*)
X    shlibpath_overrides_runpath=yes
X    hardcode_into_libs=yes
X    ;;
X  *) # from 3.2 on
X    shlibpath_overrides_runpath=no
X    hardcode_into_libs=yes
X    ;;
X  esac
X  ;;
X
Xgnu*)
X  version_type=linux
X  need_lib_prefix=no
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  shlibpath_var=LD_LIBRARY_PATH
X  hardcode_into_libs=yes
X  ;;
X
Xhpux9* | hpux10* | hpux11*)
X  # Give a soname corresponding to the major version so that dld.sl refuses to
X  # link against other versions.
X  version_type=sunos
X  need_lib_prefix=no
X  need_version=no
X  case "$host_cpu" in
X  ia64*)
X    shrext='.so'
X    hardcode_into_libs=yes
X    dynamic_linker="$host_os dld.so"
X    shlibpath_var=LD_LIBRARY_PATH
X    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
X    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X    soname_spec='${libname}${release}${shared_ext}$major'
X    if test "X$HPUX_IA64_MODE" = X32; then
X      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
X    else
X      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
X    fi
X    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
X    ;;
X   hppa*64*)
X     shrext='.sl'
X     hardcode_into_libs=yes
X     dynamic_linker="$host_os dld.sl"
X     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
X     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
X     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X     soname_spec='${libname}${release}${shared_ext}$major'
X     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
X     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
X     ;;
X   *)
X    shrext='.sl'
X    dynamic_linker="$host_os dld.sl"
X    shlibpath_var=SHLIB_PATH
X    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
X    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X    soname_spec='${libname}${release}${shared_ext}$major'
X    ;;
X  esac
X  # HP-UX runs *really* slowly unless shared libraries are mode 555.
X  postinstall_cmds='chmod 555 $lib'
X  ;;
X
Xirix5* | irix6* | nonstopux*)
X  case $host_os in
X    nonstopux*) version_type=nonstopux ;;
X    *)
X	if test "$lt_cv_prog_gnu_ld" = yes; then
X		version_type=linux
X	else
X		version_type=irix
X	fi ;;
X  esac
X  need_lib_prefix=no
X  need_version=no
X  soname_spec='${libname}${release}${shared_ext}$major'
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
X  case $host_os in
X  irix5* | nonstopux*)
X    libsuff= shlibsuff=
X    ;;
X  *)
X    case $LD in # libtool.m4 will add one of these switches to LD
X    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
X      libsuff= shlibsuff= libmagic=32-bit;;
X    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
X      libsuff=32 shlibsuff=N32 libmagic=N32;;
X    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
X      libsuff=64 shlibsuff=64 libmagic=64-bit;;
X    *) libsuff= shlibsuff= libmagic=never-match;;
X    esac
X    ;;
X  esac
X  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
X  shlibpath_overrides_runpath=no
X  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
X  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
X  hardcode_into_libs=yes
X  ;;
X
X# No shared lib support for Linux oldld, aout, or coff.
Xlinux*oldld* | linux*aout* | linux*coff*)
X  dynamic_linker=no
X  ;;
X
X# This must be Linux ELF.
Xlinux*)
X  version_type=linux
X  need_lib_prefix=no
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
X  shlibpath_var=LD_LIBRARY_PATH
X  shlibpath_overrides_runpath=no
X  # This implies no fast_install, which is unacceptable.
X  # Some rework will be needed to allow for fast_install
X  # before this can be enabled.
X  hardcode_into_libs=yes
X
X  # We used to test for /lib/ld.so.1 and disable shared libraries on
X  # powerpc, because MkLinux only supported shared libraries with the
X  # GNU dynamic linker.  Since this was broken with cross compilers,
X  # most powerpc-linux boxes support dynamic linking these days and
X  # people can always --disable-shared, the test was removed, and we
X  # assume the GNU/Linux dynamic linker is in use.
X  dynamic_linker='GNU/Linux ld.so'
X
X  # Find out which ABI we are using (multilib Linux x86_64 hack).
X  libsuff=
X  case "$host_cpu" in
X  x86_64*|s390x*|powerpc64*)
X    echo '#line 16669 "configure"' > conftest.$ac_ext
X    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; then
X      case `/usr/bin/file conftest.$ac_objext` in
X      *64-bit*)
X        libsuff=64
X        ;;
X      esac
X    fi
X    rm -rf conftest*
X    ;;
X  *)
X    ;;
X  esac
X  sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
X  sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
X  ;;
X
Xnetbsd*)
X  version_type=sunos
X  need_lib_prefix=no
X  need_version=no
X  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
X    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
X    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
X    dynamic_linker='NetBSD (a.out) ld.so'
X  else
X    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}'
X    soname_spec='${libname}${release}${shared_ext}$major'
X    dynamic_linker='NetBSD ld.elf_so'
X  fi
X  shlibpath_var=LD_LIBRARY_PATH
X  shlibpath_overrides_runpath=yes
X  hardcode_into_libs=yes
X  ;;
X
Xnewsos6)
X  version_type=linux
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  shlibpath_var=LD_LIBRARY_PATH
X  shlibpath_overrides_runpath=yes
X  ;;
X
Xnto-qnx)
X  version_type=linux
X  need_lib_prefix=no
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  shlibpath_var=LD_LIBRARY_PATH
X  shlibpath_overrides_runpath=yes
X  ;;
X
Xopenbsd*)
X  version_type=sunos
X  need_lib_prefix=no
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
X  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
X  shlibpath_var=LD_LIBRARY_PATH
X  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
X    case $host_os in
X      openbsd2.[89] | openbsd2.[89].*)
X	shlibpath_overrides_runpath=no
X	;;
X      *)
X	shlibpath_overrides_runpath=yes
X	;;
X      esac
X  else
X    shlibpath_overrides_runpath=yes
X  fi
X  ;;
X
Xos2*)
X  libname_spec='$name'
X  shrext=".dll"
X  need_lib_prefix=no
X  library_names_spec='$libname${shared_ext} $libname.a'
X  dynamic_linker='OS/2 ld.exe'
X  shlibpath_var=LIBPATH
X  ;;
X
Xosf3* | osf4* | osf5*)
X  version_type=osf
X  need_lib_prefix=no
X  need_version=no
X  soname_spec='${libname}${release}${shared_ext}$major'
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  shlibpath_var=LD_LIBRARY_PATH
X  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
X  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
X  ;;
X
Xsco3.2v5*)
X  version_type=osf
X  soname_spec='${libname}${release}${shared_ext}$major'
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  shlibpath_var=LD_LIBRARY_PATH
X  ;;
X
Xsolaris*)
X  version_type=linux
X  need_lib_prefix=no
X  need_version=no
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  shlibpath_var=LD_LIBRARY_PATH
X  shlibpath_overrides_runpath=yes
X  hardcode_into_libs=yes
X  # ldd complains unless libraries are executable
X  postinstall_cmds='chmod +x $lib'
X  ;;
X
Xsunos4*)
X  version_type=sunos
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
X  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
X  shlibpath_var=LD_LIBRARY_PATH
X  shlibpath_overrides_runpath=yes
X  if test "$with_gnu_ld" = yes; then
X    need_lib_prefix=no
X  fi
X  need_version=yes
X  ;;
X
Xsysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
X  version_type=linux
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  shlibpath_var=LD_LIBRARY_PATH
X  case $host_vendor in
X    sni)
X      shlibpath_overrides_runpath=no
X      need_lib_prefix=no
X      export_dynamic_flag_spec='${wl}-Blargedynsym'
X      runpath_var=LD_RUN_PATH
X      ;;
X    siemens)
X      need_lib_prefix=no
X      ;;
X    motorola)
X      need_lib_prefix=no
X      need_version=no
X      shlibpath_overrides_runpath=no
X      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
X      ;;
X  esac
X  ;;
X
Xsysv4*MP*)
X  if test -d /usr/nec ;then
X    version_type=linux
X    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
X    soname_spec='$libname${shared_ext}.$major'
X    shlibpath_var=LD_LIBRARY_PATH
X  fi
X  ;;
X
Xuts4*)
X  version_type=linux
X  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
X  soname_spec='${libname}${release}${shared_ext}$major'
X  shlibpath_var=LD_LIBRARY_PATH
X  ;;
X
X*)
X  dynamic_linker=no
X  ;;
Xesac
Xecho "$as_me:$LINENO: result: $dynamic_linker" >&5
Xecho "${ECHO_T}$dynamic_linker" >&6
Xtest "$dynamic_linker" = no && can_build_shared=no
X
Xif test "x$enable_dlopen" != xyes; then
X  enable_dlopen=unknown
X  enable_dlopen_self=unknown
X  enable_dlopen_self_static=unknown
Xelse
X  lt_cv_dlopen=no
X  lt_cv_dlopen_libs=
X
X  case $host_os in
X  beos*)
X    lt_cv_dlopen="load_add_on"
X    lt_cv_dlopen_libs=
X    lt_cv_dlopen_self=yes
X    ;;
X
X  mingw* | pw32*)
X    lt_cv_dlopen="LoadLibrary"
X    lt_cv_dlopen_libs=
X   ;;
X
X  cygwin*)
X    lt_cv_dlopen="dlopen"
X    lt_cv_dlopen_libs=
X   ;;
X
X  darwin*)
X  # if libdl is installed we need to link against it
X    echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
Xecho $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
Xif test "${ac_cv_lib_dl_dlopen+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  ac_check_lib_save_LIBS=$LIBS
XLIBS="-ldl  $LIBS"
Xcat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X
X/* Override any gcc2 internal prototype to avoid an error.  */
X#ifdef __cplusplus
Xextern "C"
X#endif
X/* We use char because int might match the return type of a gcc2
X   builtin and then its argument prototype would still apply.  */
Xchar dlopen ();
Xint
Xmain ()
X{
Xdlopen ();
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_cv_lib_dl_dlopen=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_cv_lib_dl_dlopen=no
Xfi
Xrm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
XLIBS=$ac_check_lib_save_LIBS
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
Xecho "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
Xif test $ac_cv_lib_dl_dlopen = yes; then
X  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
Xelse
X
X    lt_cv_dlopen="dyld"
X    lt_cv_dlopen_libs=
X    lt_cv_dlopen_self=yes
X
Xfi
X
X   ;;
X
X  *)
X    echo "$as_me:$LINENO: checking for shl_load" >&5
Xecho $ECHO_N "checking for shl_load... $ECHO_C" >&6
Xif test "${ac_cv_func_shl_load+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X/* System header to define __stub macros and hopefully few prototypes,
X    which can conflict with char shl_load (); below.
X    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
X    <limits.h> exists even on freestanding compilers.  */
X#ifdef __STDC__
X# include <limits.h>
X#else
X# include <assert.h>
X#endif
X/* Override any gcc2 internal prototype to avoid an error.  */
X#ifdef __cplusplus
Xextern "C"
X{
X#endif
X/* We use char because int might match the return type of a gcc2
X   builtin and then its argument prototype would still apply.  */
Xchar shl_load ();
X/* The GNU C library defines this for functions which it implements
X    to always fail with ENOSYS.  Some functions are actually named
X    something starting with __ and the normal name is an alias.  */
X#if defined (__stub_shl_load) || defined (__stub___shl_load)
Xchoke me
X#else
Xchar (*f) () = shl_load;
X#endif
X#ifdef __cplusplus
X}
X#endif
X
Xint
Xmain ()
X{
Xreturn f != shl_load;
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_cv_func_shl_load=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_cv_func_shl_load=no
Xfi
Xrm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
Xecho "${ECHO_T}$ac_cv_func_shl_load" >&6
Xif test $ac_cv_func_shl_load = yes; then
X  lt_cv_dlopen="shl_load"
Xelse
X  echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
Xecho $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
Xif test "${ac_cv_lib_dld_shl_load+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  ac_check_lib_save_LIBS=$LIBS
XLIBS="-ldld  $LIBS"
Xcat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X
X/* Override any gcc2 internal prototype to avoid an error.  */
X#ifdef __cplusplus
Xextern "C"
X#endif
X/* We use char because int might match the return type of a gcc2
X   builtin and then its argument prototype would still apply.  */
Xchar shl_load ();
Xint
Xmain ()
X{
Xshl_load ();
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_cv_lib_dld_shl_load=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_cv_lib_dld_shl_load=no
Xfi
Xrm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
XLIBS=$ac_check_lib_save_LIBS
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
Xecho "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
Xif test $ac_cv_lib_dld_shl_load = yes; then
X  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
Xelse
X  echo "$as_me:$LINENO: checking for dlopen" >&5
Xecho $ECHO_N "checking for dlopen... $ECHO_C" >&6
Xif test "${ac_cv_func_dlopen+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X/* System header to define __stub macros and hopefully few prototypes,
X    which can conflict with char dlopen (); below.
X    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
X    <limits.h> exists even on freestanding compilers.  */
X#ifdef __STDC__
X# include <limits.h>
X#else
X# include <assert.h>
X#endif
X/* Override any gcc2 internal prototype to avoid an error.  */
X#ifdef __cplusplus
Xextern "C"
X{
X#endif
X/* We use char because int might match the return type of a gcc2
X   builtin and then its argument prototype would still apply.  */
Xchar dlopen ();
X/* The GNU C library defines this for functions which it implements
X    to always fail with ENOSYS.  Some functions are actually named
X    something starting with __ and the normal name is an alias.  */
X#if defined (__stub_dlopen) || defined (__stub___dlopen)
Xchoke me
X#else
Xchar (*f) () = dlopen;
X#endif
X#ifdef __cplusplus
X}
X#endif
X
Xint
Xmain ()
X{
Xreturn f != dlopen;
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_cv_func_dlopen=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_cv_func_dlopen=no
Xfi
Xrm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
Xecho "${ECHO_T}$ac_cv_func_dlopen" >&6
Xif test $ac_cv_func_dlopen = yes; then
X  lt_cv_dlopen="dlopen"
Xelse
X  echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
Xecho $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
Xif test "${ac_cv_lib_dl_dlopen+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  ac_check_lib_save_LIBS=$LIBS
XLIBS="-ldl  $LIBS"
Xcat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X
X/* Override any gcc2 internal prototype to avoid an error.  */
X#ifdef __cplusplus
Xextern "C"
X#endif
X/* We use char because int might match the return type of a gcc2
X   builtin and then its argument prototype would still apply.  */
Xchar dlopen ();
Xint
Xmain ()
X{
Xdlopen ();
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_cv_lib_dl_dlopen=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_cv_lib_dl_dlopen=no
Xfi
Xrm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
XLIBS=$ac_check_lib_save_LIBS
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
Xecho "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
Xif test $ac_cv_lib_dl_dlopen = yes; then
X  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
Xelse
X  echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
Xecho $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
Xif test "${ac_cv_lib_svld_dlopen+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  ac_check_lib_save_LIBS=$LIBS
XLIBS="-lsvld  $LIBS"
Xcat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X
X/* Override any gcc2 internal prototype to avoid an error.  */
X#ifdef __cplusplus
Xextern "C"
X#endif
X/* We use char because int might match the return type of a gcc2
X   builtin and then its argument prototype would still apply.  */
Xchar dlopen ();
Xint
Xmain ()
X{
Xdlopen ();
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_cv_lib_svld_dlopen=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_cv_lib_svld_dlopen=no
Xfi
Xrm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
XLIBS=$ac_check_lib_save_LIBS
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
Xecho "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
Xif test $ac_cv_lib_svld_dlopen = yes; then
X  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
Xelse
X  echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
Xecho $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
Xif test "${ac_cv_lib_dld_dld_link+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  ac_check_lib_save_LIBS=$LIBS
XLIBS="-ldld  $LIBS"
Xcat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X
X/* Override any gcc2 internal prototype to avoid an error.  */
X#ifdef __cplusplus
Xextern "C"
X#endif
X/* We use char because int might match the return type of a gcc2
X   builtin and then its argument prototype would still apply.  */
Xchar dld_link ();
Xint
Xmain ()
X{
Xdld_link ();
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_cv_lib_dld_dld_link=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_cv_lib_dld_dld_link=no
Xfi
Xrm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
XLIBS=$ac_check_lib_save_LIBS
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
Xecho "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
Xif test $ac_cv_lib_dld_dld_link = yes; then
X  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
Xfi
X
X
Xfi
X
X
Xfi
X
X
Xfi
X
X
Xfi
X
X
Xfi
X
X    ;;
X  esac
X
X  if test "x$lt_cv_dlopen" != xno; then
X    enable_dlopen=yes
X  else
X    enable_dlopen=no
X  fi
X
X  case $lt_cv_dlopen in
X  dlopen)
X    save_CPPFLAGS="$CPPFLAGS"
X    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
X
X    save_LDFLAGS="$LDFLAGS"
X    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
X
X    save_LIBS="$LIBS"
X    LIBS="$lt_cv_dlopen_libs $LIBS"
X
X    echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
Xecho $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
Xif test "${lt_cv_dlopen_self+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  	  if test "$cross_compiling" = yes; then :
X  lt_cv_dlopen_self=cross
Xelse
X  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
X  lt_status=$lt_dlunknown
X  cat > conftest.$ac_ext <<EOF
X#line 17365 "configure"
X#include "confdefs.h"
X
X#if HAVE_DLFCN_H
X#include <dlfcn.h>
X#endif
X
X#include <stdio.h>
X
X#ifdef RTLD_GLOBAL
X#  define LT_DLGLOBAL		RTLD_GLOBAL
X#else
X#  ifdef DL_GLOBAL
X#    define LT_DLGLOBAL		DL_GLOBAL
X#  else
X#    define LT_DLGLOBAL		0
X#  endif
X#endif
X
X/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
X   find out it does not work in some platform. */
X#ifndef LT_DLLAZY_OR_NOW
X#  ifdef RTLD_LAZY
X#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
X#  else
X#    ifdef DL_LAZY
X#      define LT_DLLAZY_OR_NOW		DL_LAZY
X#    else
X#      ifdef RTLD_NOW
X#        define LT_DLLAZY_OR_NOW	RTLD_NOW
X#      else
X#        ifdef DL_NOW
X#          define LT_DLLAZY_OR_NOW	DL_NOW
X#        else
X#          define LT_DLLAZY_OR_NOW	0
X#        endif
X#      endif
X#    endif
X#  endif
X#endif
X
X#ifdef __cplusplus
Xextern "C" void exit (int);
X#endif
X
Xvoid fnord() { int i=42;}
Xint main ()
X{
X  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
X  int status = $lt_dlunknown;
X
X  if (self)
X    {
X      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
X      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
X      /* dlclose (self); */
X    }
X
X    exit (status);
X}
XEOF
X  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
X    (./conftest; exit; ) 2>/dev/null
X    lt_status=$?
X    case x$lt_status in
X      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
X      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
X      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
X    esac
X  else :
X    # compilation failed
X    lt_cv_dlopen_self=no
X  fi
Xfi
Xrm -fr conftest*
X
X
Xfi
Xecho "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
Xecho "${ECHO_T}$lt_cv_dlopen_self" >&6
X
X    if test "x$lt_cv_dlopen_self" = xyes; then
X      LDFLAGS="$LDFLAGS $link_static_flag"
X      echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
Xecho $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
Xif test "${lt_cv_dlopen_self_static+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  	  if test "$cross_compiling" = yes; then :
X  lt_cv_dlopen_self_static=cross
Xelse
X  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
X  lt_status=$lt_dlunknown
X  cat > conftest.$ac_ext <<EOF
X#line 17463 "configure"
X#include "confdefs.h"
X
X#if HAVE_DLFCN_H
X#include <dlfcn.h>
X#endif
X
X#include <stdio.h>
X
X#ifdef RTLD_GLOBAL
X#  define LT_DLGLOBAL		RTLD_GLOBAL
X#else
X#  ifdef DL_GLOBAL
X#    define LT_DLGLOBAL		DL_GLOBAL
X#  else
X#    define LT_DLGLOBAL		0
X#  endif
X#endif
X
X/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
X   find out it does not work in some platform. */
X#ifndef LT_DLLAZY_OR_NOW
X#  ifdef RTLD_LAZY
X#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
X#  else
X#    ifdef DL_LAZY
X#      define LT_DLLAZY_OR_NOW		DL_LAZY
X#    else
X#      ifdef RTLD_NOW
X#        define LT_DLLAZY_OR_NOW	RTLD_NOW
X#      else
X#        ifdef DL_NOW
X#          define LT_DLLAZY_OR_NOW	DL_NOW
X#        else
X#          define LT_DLLAZY_OR_NOW	0
X#        endif
X#      endif
X#    endif
X#  endif
X#endif
X
X#ifdef __cplusplus
Xextern "C" void exit (int);
X#endif
X
Xvoid fnord() { int i=42;}
Xint main ()
X{
X  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
X  int status = $lt_dlunknown;
X
X  if (self)
X    {
X      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
X      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
X      /* dlclose (self); */
X    }
X
X    exit (status);
X}
XEOF
X  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
X    (./conftest; exit; ) 2>/dev/null
X    lt_status=$?
X    case x$lt_status in
X      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
X      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
X      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
X    esac
X  else :
X    # compilation failed
X    lt_cv_dlopen_self_static=no
X  fi
Xfi
Xrm -fr conftest*
X
X
Xfi
Xecho "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
Xecho "${ECHO_T}$lt_cv_dlopen_self_static" >&6
X    fi
X
X    CPPFLAGS="$save_CPPFLAGS"
X    LDFLAGS="$save_LDFLAGS"
X    LIBS="$save_LIBS"
X    ;;
X  esac
X
X  case $lt_cv_dlopen_self in
X  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
X  *) enable_dlopen_self=unknown ;;
X  esac
X
X  case $lt_cv_dlopen_self_static in
X  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
X  *) enable_dlopen_self_static=unknown ;;
X  esac
Xfi
X
X
X# The else clause should only fire when bootstrapping the
X# libtool distribution, otherwise you forgot to ship ltmain.sh
X# with your package, and you will get complaints that there are
X# no rules to generate ltmain.sh.
Xif test -f "$ltmain"; then
X  # See if we are running on zsh, and set the options which allow our commands through
X  # without removal of \ escapes.
X  if test -n "${ZSH_VERSION+set}" ; then
X    setopt NO_GLOB_SUBST
X  fi
X  # Now quote all the things that may contain metacharacters while being
X  # careful not to overquote the AC_SUBSTed values.  We take copies of the
X  # variables and quote the copies for generation of the libtool script.
X  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \
X    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
X    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
X    deplibs_check_method reload_flag reload_cmds need_locks \
X    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
X    lt_cv_sys_global_symbol_to_c_name_address \
X    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
X    old_postinstall_cmds old_postuninstall_cmds \
X    compiler_GCJ \
X    CC_GCJ \
X    LD_GCJ \
X    lt_prog_compiler_wl_GCJ \
X    lt_prog_compiler_pic_GCJ \
X    lt_prog_compiler_static_GCJ \
X    lt_prog_compiler_no_builtin_flag_GCJ \
X    export_dynamic_flag_spec_GCJ \
X    thread_safe_flag_spec_GCJ \
X    whole_archive_flag_spec_GCJ \
X    enable_shared_with_static_runtimes_GCJ \
X    old_archive_cmds_GCJ \
X    old_archive_from_new_cmds_GCJ \
X    predep_objects_GCJ \
X    postdep_objects_GCJ \
X    predeps_GCJ \
X    postdeps_GCJ \
X    compiler_lib_search_path_GCJ \
X    archive_cmds_GCJ \
X    archive_expsym_cmds_GCJ \
X    postinstall_cmds_GCJ \
X    postuninstall_cmds_GCJ \
X    old_archive_from_expsyms_cmds_GCJ \
X    allow_undefined_flag_GCJ \
X    no_undefined_flag_GCJ \
X    export_symbols_cmds_GCJ \
X    hardcode_libdir_flag_spec_GCJ \
X    hardcode_libdir_flag_spec_ld_GCJ \
X    hardcode_libdir_separator_GCJ \
X    hardcode_automatic_GCJ \
X    module_cmds_GCJ \
X    module_expsym_cmds_GCJ \
X    lt_cv_prog_compiler_c_o_GCJ \
X    exclude_expsyms_GCJ \
X    include_expsyms_GCJ; do
X
X    case $var in
X    old_archive_cmds_GCJ | \
X    old_archive_from_new_cmds_GCJ | \
X    archive_cmds_GCJ | \
X    archive_expsym_cmds_GCJ | \
X    module_cmds_GCJ | \
X    module_expsym_cmds_GCJ | \
X    old_archive_from_expsyms_cmds_GCJ | \
X    export_symbols_cmds_GCJ | \
X    extract_expsyms_cmds | reload_cmds | finish_cmds | \
X    postinstall_cmds | postuninstall_cmds | \
X    old_postinstall_cmds | old_postuninstall_cmds | \
X    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
X      # Double-quote double-evaled strings.
X      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
X      ;;
X    *)
X      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
X      ;;
X    esac
X  done
X
X  case $lt_echo in
X  *'\$0 --fallback-echo"')
X    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
X    ;;
X  esac
X
Xcfgfile="$ofile"
X
X  cat <<__EOF__ >> "$cfgfile"
X# ### BEGIN LIBTOOL TAG CONFIG: $tagname
X
X# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
X
X# Shell to use when invoking shell scripts.
XSHELL=$lt_SHELL
X
X# Whether or not to build shared libraries.
Xbuild_libtool_libs=$enable_shared
X
X# Whether or not to build static libraries.
Xbuild_old_libs=$enable_static
X
X# Whether or not to add -lc for building shared libraries.
Xbuild_libtool_need_lc=$archive_cmds_need_lc_GCJ
X
X# Whether or not to disallow shared libs when runtime libs are static
Xallow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ
X
X# Whether or not to optimize for fast installation.
Xfast_install=$enable_fast_install
X
X# The host system.
Xhost_alias=$host_alias
Xhost=$host
X
X# An echo program that does not interpret backslashes.
Xecho=$lt_echo
X
X# The archiver.
XAR=$lt_AR
XAR_FLAGS=$lt_AR_FLAGS
X
X# A C compiler.
XLTCC=$lt_LTCC
X
X# A language-specific compiler.
XCC=$lt_compiler_GCJ
X
X# Is the compiler the GNU C compiler?
Xwith_gcc=$GCC_GCJ
X
X# An ERE matcher.
XEGREP=$lt_EGREP
X
X# The linker used to build libraries.
XLD=$lt_LD_GCJ
X
X# Whether we need hard or soft links.
XLN_S=$lt_LN_S
X
X# A BSD-compatible nm program.
XNM=$lt_NM
X
X# A symbol stripping program
XSTRIP=$STRIP
X
X# Used to examine libraries when file_magic_cmd begins "file"
XMAGIC_CMD=$MAGIC_CMD
X
X# Used on cygwin: DLL creation program.
XDLLTOOL="$DLLTOOL"
X
X# Used on cygwin: object dumper.
XOBJDUMP="$OBJDUMP"
X
X# Used on cygwin: assembler.
XAS="$AS"
X
X# The name of the directory that contains temporary libtool files.
Xobjdir=$objdir
X
X# How to create reloadable object files.
Xreload_flag=$lt_reload_flag
Xreload_cmds=$lt_reload_cmds
X
X# How to pass a linker flag through the compiler.
Xwl=$lt_lt_prog_compiler_wl_GCJ
X
X# Object file suffix (normally "o").
Xobjext="$ac_objext"
X
X# Old archive suffix (normally "a").
Xlibext="$libext"
X
X# Shared library suffix (normally ".so").
Xshrext='$shrext'
X
X# Executable file suffix (normally "").
Xexeext="$exeext"
X
X# Additional compiler flags for building library objects.
Xpic_flag=$lt_lt_prog_compiler_pic_GCJ
Xpic_mode=$pic_mode
X
X# What is the maximum length of a command?
Xmax_cmd_len=$lt_cv_sys_max_cmd_len
X
X# Does compiler simultaneously support -c and -o options?
Xcompiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ
X
X# Must we lock files when doing compilation ?
Xneed_locks=$lt_need_locks
X
X# Do we need the lib prefix for modules?
Xneed_lib_prefix=$need_lib_prefix
X
X# Do we need a version for libraries?
Xneed_version=$need_version
X
X# Whether dlopen is supported.
Xdlopen_support=$enable_dlopen
X
X# Whether dlopen of programs is supported.
Xdlopen_self=$enable_dlopen_self
X
X# Whether dlopen of statically linked programs is supported.
Xdlopen_self_static=$enable_dlopen_self_static
X
X# Compiler flag to prevent dynamic linking.
Xlink_static_flag=$lt_lt_prog_compiler_static_GCJ
X
X# Compiler flag to turn off builtin functions.
Xno_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ
X
X# Compiler flag to allow reflexive dlopens.
Xexport_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ
X
X# Compiler flag to generate shared objects directly from archives.
Xwhole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ
X
X# Compiler flag to generate thread-safe objects.
Xthread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ
X
X# Library versioning type.
Xversion_type=$version_type
X
X# Format of library name prefix.
Xlibname_spec=$lt_libname_spec
X
X# List of archive names.  First name is the real one, the rest are links.
X# The last name is the one that the linker finds with -lNAME.
Xlibrary_names_spec=$lt_library_names_spec
X
X# The coded name of the library, if different from the real name.
Xsoname_spec=$lt_soname_spec
X
X# Commands used to build and install an old-style archive.
XRANLIB=$lt_RANLIB
Xold_archive_cmds=$lt_old_archive_cmds_GCJ
Xold_postinstall_cmds=$lt_old_postinstall_cmds
Xold_postuninstall_cmds=$lt_old_postuninstall_cmds
X
X# Create an old-style archive from a shared archive.
Xold_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ
X
X# Create a temporary old-style archive to link instead of a shared archive.
Xold_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ
X
X# Commands used to build and install a shared archive.
Xarchive_cmds=$lt_archive_cmds_GCJ
Xarchive_expsym_cmds=$lt_archive_expsym_cmds_GCJ
Xpostinstall_cmds=$lt_postinstall_cmds
Xpostuninstall_cmds=$lt_postuninstall_cmds
X
X# Commands used to build a loadable module (assumed same as above if empty)
Xmodule_cmds=$lt_module_cmds_GCJ
Xmodule_expsym_cmds=$lt_module_expsym_cmds_GCJ
X
X# Commands to strip libraries.
Xold_striplib=$lt_old_striplib
Xstriplib=$lt_striplib
X
X# Dependencies to place before the objects being linked to create a
X# shared library.
Xpredep_objects=$lt_predep_objects_GCJ
X
X# Dependencies to place after the objects being linked to create a
X# shared library.
Xpostdep_objects=$lt_postdep_objects_GCJ
X
X# Dependencies to place before the objects being linked to create a
X# shared library.
Xpredeps=$lt_predeps_GCJ
X
X# Dependencies to place after the objects being linked to create a
X# shared library.
Xpostdeps=$lt_postdeps_GCJ
X
X# The library search path used internally by the compiler when linking
X# a shared library.
Xcompiler_lib_search_path=$lt_compiler_lib_search_path_GCJ
X
X# Method to check whether dependent libraries are shared objects.
Xdeplibs_check_method=$lt_deplibs_check_method
X
X# Command to use when deplibs_check_method == file_magic.
Xfile_magic_cmd=$lt_file_magic_cmd
X
X# Flag that allows shared libraries with undefined symbols to be built.
Xallow_undefined_flag=$lt_allow_undefined_flag_GCJ
X
X# Flag that forces no undefined symbols.
Xno_undefined_flag=$lt_no_undefined_flag_GCJ
X
X# Commands used to finish a libtool library installation in a directory.
Xfinish_cmds=$lt_finish_cmds
X
X# Same as above, but a single script fragment to be evaled but not shown.
Xfinish_eval=$lt_finish_eval
X
X# Take the output of nm and produce a listing of raw symbols and C names.
Xglobal_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
X
X# Transform the output of nm in a proper C declaration
Xglobal_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
X
X# Transform the output of nm in a C name address pair
Xglobal_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
X
X# This is the shared library runtime path variable.
Xrunpath_var=$runpath_var
X
X# This is the shared library path variable.
Xshlibpath_var=$shlibpath_var
X
X# Is shlibpath searched before the hard-coded library search path?
Xshlibpath_overrides_runpath=$shlibpath_overrides_runpath
X
X# How to hardcode a shared library path into an executable.
Xhardcode_action=$hardcode_action_GCJ
X
X# Whether we should hardcode library paths into libraries.
Xhardcode_into_libs=$hardcode_into_libs
X
X# Flag to hardcode \$libdir into a binary during linking.
X# This must work even if \$libdir does not exist.
Xhardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ
X
X# If ld is used when linking, flag to hardcode \$libdir into
X# a binary during linking. This must work even if \$libdir does
X# not exist.
Xhardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ
X
X# Whether we need a single -rpath flag with a separated argument.
Xhardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ
X
X# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
X# resulting binary.
Xhardcode_direct=$hardcode_direct_GCJ
X
X# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
X# resulting binary.
Xhardcode_minus_L=$hardcode_minus_L_GCJ
X
X# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
X# the resulting binary.
Xhardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ
X
X# Set to yes if building a shared library automatically hardcodes DIR into the library
X# and all subsequent libraries and executables linked against it.
Xhardcode_automatic=$hardcode_automatic_GCJ
X
X# Variables whose values should be saved in libtool wrapper scripts and
X# restored at relink time.
Xvariables_saved_for_relink="$variables_saved_for_relink"
X
X# Whether libtool must link a program against all its dependency libraries.
Xlink_all_deplibs=$link_all_deplibs_GCJ
X
X# Compile-time system search path for libraries
Xsys_lib_search_path_spec=$lt_sys_lib_search_path_spec
X
X# Run-time system search path for libraries
Xsys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
X
X# Fix the shell variable \$srcfile for the compiler.
Xfix_srcfile_path="$fix_srcfile_path_GCJ"
X
X# Set to yes if exported symbols are required.
Xalways_export_symbols=$always_export_symbols_GCJ
X
X# The commands to list exported symbols.
Xexport_symbols_cmds=$lt_export_symbols_cmds_GCJ
X
X# The commands to extract the exported symbol list from a shared archive.
Xextract_expsyms_cmds=$lt_extract_expsyms_cmds
X
X# Symbols that should not be listed in the preloaded symbols.
Xexclude_expsyms=$lt_exclude_expsyms_GCJ
X
X# Symbols that must always be exported.
Xinclude_expsyms=$lt_include_expsyms_GCJ
X
X# ### END LIBTOOL TAG CONFIG: $tagname
X
X__EOF__
X
X
Xelse
X  # If there is no Makefile yet, we rely on a make rule to execute
X  # `config.status --recheck' to rerun these tests and create the
X  # libtool script then.
X  test -f Makefile && make "$ltmain"
Xfi
X
X
Xac_ext=c
Xac_cpp='$CPP $CPPFLAGS'
Xac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
Xac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
Xac_compiler_gnu=$ac_cv_c_compiler_gnu
X
XCC="$lt_save_CC"
X
X	else
X	  tagname=""
X	fi
X	;;
X
X      RC)
X
X
X
X# Source file extension for RC test sources.
Xac_ext=rc
X
X# Object file extension for compiled RC test sources.
Xobjext=o
Xobjext_RC=$objext
X
X# Code to be used in simple compile tests
Xlt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
X
X# Code to be used in simple link tests
Xlt_simple_link_test_code="$lt_simple_compile_test_code"
X
X# ltmain only uses $CC for tagged configurations so make sure $CC is set.
X
X# If no C compiler was specified, use CC.
XLTCC=${LTCC-"$CC"}
X
X# Allow CC to be a program name with arguments.
Xcompiler=$CC
X
X
X# Allow CC to be a program name with arguments.
Xlt_save_CC="$CC"
XCC=${RC-"windres"}
Xcompiler=$CC
Xcompiler_RC=$CC
Xlt_cv_prog_compiler_c_o_RC=yes
X
X# The else clause should only fire when bootstrapping the
X# libtool distribution, otherwise you forgot to ship ltmain.sh
X# with your package, and you will get complaints that there are
X# no rules to generate ltmain.sh.
Xif test -f "$ltmain"; then
X  # See if we are running on zsh, and set the options which allow our commands through
X  # without removal of \ escapes.
X  if test -n "${ZSH_VERSION+set}" ; then
X    setopt NO_GLOB_SUBST
X  fi
X  # Now quote all the things that may contain metacharacters while being
X  # careful not to overquote the AC_SUBSTed values.  We take copies of the
X  # variables and quote the copies for generation of the libtool script.
X  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \
X    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
X    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
X    deplibs_check_method reload_flag reload_cmds need_locks \
X    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
X    lt_cv_sys_global_symbol_to_c_name_address \
X    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
X    old_postinstall_cmds old_postuninstall_cmds \
X    compiler_RC \
X    CC_RC \
X    LD_RC \
X    lt_prog_compiler_wl_RC \
X    lt_prog_compiler_pic_RC \
X    lt_prog_compiler_static_RC \
X    lt_prog_compiler_no_builtin_flag_RC \
X    export_dynamic_flag_spec_RC \
X    thread_safe_flag_spec_RC \
X    whole_archive_flag_spec_RC \
X    enable_shared_with_static_runtimes_RC \
X    old_archive_cmds_RC \
X    old_archive_from_new_cmds_RC \
X    predep_objects_RC \
X    postdep_objects_RC \
X    predeps_RC \
X    postdeps_RC \
X    compiler_lib_search_path_RC \
X    archive_cmds_RC \
X    archive_expsym_cmds_RC \
X    postinstall_cmds_RC \
X    postuninstall_cmds_RC \
X    old_archive_from_expsyms_cmds_RC \
X    allow_undefined_flag_RC \
X    no_undefined_flag_RC \
X    export_symbols_cmds_RC \
X    hardcode_libdir_flag_spec_RC \
X    hardcode_libdir_flag_spec_ld_RC \
X    hardcode_libdir_separator_RC \
X    hardcode_automatic_RC \
X    module_cmds_RC \
X    module_expsym_cmds_RC \
X    lt_cv_prog_compiler_c_o_RC \
X    exclude_expsyms_RC \
X    include_expsyms_RC; do
X
X    case $var in
X    old_archive_cmds_RC | \
X    old_archive_from_new_cmds_RC | \
X    archive_cmds_RC | \
X    archive_expsym_cmds_RC | \
X    module_cmds_RC | \
X    module_expsym_cmds_RC | \
X    old_archive_from_expsyms_cmds_RC | \
X    export_symbols_cmds_RC | \
X    extract_expsyms_cmds | reload_cmds | finish_cmds | \
X    postinstall_cmds | postuninstall_cmds | \
X    old_postinstall_cmds | old_postuninstall_cmds | \
X    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
X      # Double-quote double-evaled strings.
X      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
X      ;;
X    *)
X      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
X      ;;
X    esac
X  done
X
X  case $lt_echo in
X  *'\$0 --fallback-echo"')
X    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
X    ;;
X  esac
X
Xcfgfile="$ofile"
X
X  cat <<__EOF__ >> "$cfgfile"
X# ### BEGIN LIBTOOL TAG CONFIG: $tagname
X
X# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
X
X# Shell to use when invoking shell scripts.
XSHELL=$lt_SHELL
X
X# Whether or not to build shared libraries.
Xbuild_libtool_libs=$enable_shared
X
X# Whether or not to build static libraries.
Xbuild_old_libs=$enable_static
X
X# Whether or not to add -lc for building shared libraries.
Xbuild_libtool_need_lc=$archive_cmds_need_lc_RC
X
X# Whether or not to disallow shared libs when runtime libs are static
Xallow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC
X
X# Whether or not to optimize for fast installation.
Xfast_install=$enable_fast_install
X
X# The host system.
Xhost_alias=$host_alias
Xhost=$host
X
X# An echo program that does not interpret backslashes.
Xecho=$lt_echo
X
X# The archiver.
XAR=$lt_AR
XAR_FLAGS=$lt_AR_FLAGS
X
X# A C compiler.
XLTCC=$lt_LTCC
X
X# A language-specific compiler.
XCC=$lt_compiler_RC
X
X# Is the compiler the GNU C compiler?
Xwith_gcc=$GCC_RC
X
X# An ERE matcher.
XEGREP=$lt_EGREP
X
X# The linker used to build libraries.
XLD=$lt_LD_RC
X
X# Whether we need hard or soft links.
XLN_S=$lt_LN_S
X
X# A BSD-compatible nm program.
XNM=$lt_NM
X
X# A symbol stripping program
XSTRIP=$STRIP
X
X# Used to examine libraries when file_magic_cmd begins "file"
XMAGIC_CMD=$MAGIC_CMD
X
X# Used on cygwin: DLL creation program.
XDLLTOOL="$DLLTOOL"
X
X# Used on cygwin: object dumper.
XOBJDUMP="$OBJDUMP"
X
X# Used on cygwin: assembler.
XAS="$AS"
X
X# The name of the directory that contains temporary libtool files.
Xobjdir=$objdir
X
X# How to create reloadable object files.
Xreload_flag=$lt_reload_flag
Xreload_cmds=$lt_reload_cmds
X
X# How to pass a linker flag through the compiler.
Xwl=$lt_lt_prog_compiler_wl_RC
X
X# Object file suffix (normally "o").
Xobjext="$ac_objext"
X
X# Old archive suffix (normally "a").
Xlibext="$libext"
X
X# Shared library suffix (normally ".so").
Xshrext='$shrext'
X
X# Executable file suffix (normally "").
Xexeext="$exeext"
X
X# Additional compiler flags for building library objects.
Xpic_flag=$lt_lt_prog_compiler_pic_RC
Xpic_mode=$pic_mode
X
X# What is the maximum length of a command?
Xmax_cmd_len=$lt_cv_sys_max_cmd_len
X
X# Does compiler simultaneously support -c and -o options?
Xcompiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC
X
X# Must we lock files when doing compilation ?
Xneed_locks=$lt_need_locks
X
X# Do we need the lib prefix for modules?
Xneed_lib_prefix=$need_lib_prefix
X
X# Do we need a version for libraries?
Xneed_version=$need_version
X
X# Whether dlopen is supported.
Xdlopen_support=$enable_dlopen
X
X# Whether dlopen of programs is supported.
Xdlopen_self=$enable_dlopen_self
X
X# Whether dlopen of statically linked programs is supported.
Xdlopen_self_static=$enable_dlopen_self_static
X
X# Compiler flag to prevent dynamic linking.
Xlink_static_flag=$lt_lt_prog_compiler_static_RC
X
X# Compiler flag to turn off builtin functions.
Xno_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC
X
X# Compiler flag to allow reflexive dlopens.
Xexport_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC
X
X# Compiler flag to generate shared objects directly from archives.
Xwhole_archive_flag_spec=$lt_whole_archive_flag_spec_RC
X
X# Compiler flag to generate thread-safe objects.
Xthread_safe_flag_spec=$lt_thread_safe_flag_spec_RC
X
X# Library versioning type.
Xversion_type=$version_type
X
X# Format of library name prefix.
Xlibname_spec=$lt_libname_spec
X
X# List of archive names.  First name is the real one, the rest are links.
X# The last name is the one that the linker finds with -lNAME.
Xlibrary_names_spec=$lt_library_names_spec
X
X# The coded name of the library, if different from the real name.
Xsoname_spec=$lt_soname_spec
X
X# Commands used to build and install an old-style archive.
XRANLIB=$lt_RANLIB
Xold_archive_cmds=$lt_old_archive_cmds_RC
Xold_postinstall_cmds=$lt_old_postinstall_cmds
Xold_postuninstall_cmds=$lt_old_postuninstall_cmds
X
X# Create an old-style archive from a shared archive.
Xold_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC
X
X# Create a temporary old-style archive to link instead of a shared archive.
Xold_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC
X
X# Commands used to build and install a shared archive.
Xarchive_cmds=$lt_archive_cmds_RC
Xarchive_expsym_cmds=$lt_archive_expsym_cmds_RC
Xpostinstall_cmds=$lt_postinstall_cmds
Xpostuninstall_cmds=$lt_postuninstall_cmds
X
X# Commands used to build a loadable module (assumed same as above if empty)
Xmodule_cmds=$lt_module_cmds_RC
Xmodule_expsym_cmds=$lt_module_expsym_cmds_RC
X
X# Commands to strip libraries.
Xold_striplib=$lt_old_striplib
Xstriplib=$lt_striplib
X
X# Dependencies to place before the objects being linked to create a
X# shared library.
Xpredep_objects=$lt_predep_objects_RC
X
X# Dependencies to place after the objects being linked to create a
X# shared library.
Xpostdep_objects=$lt_postdep_objects_RC
X
X# Dependencies to place before the objects being linked to create a
X# shared library.
Xpredeps=$lt_predeps_RC
X
X# Dependencies to place after the objects being linked to create a
X# shared library.
Xpostdeps=$lt_postdeps_RC
X
X# The library search path used internally by the compiler when linking
X# a shared library.
Xcompiler_lib_search_path=$lt_compiler_lib_search_path_RC
X
X# Method to check whether dependent libraries are shared objects.
Xdeplibs_check_method=$lt_deplibs_check_method
X
X# Command to use when deplibs_check_method == file_magic.
Xfile_magic_cmd=$lt_file_magic_cmd
X
X# Flag that allows shared libraries with undefined symbols to be built.
Xallow_undefined_flag=$lt_allow_undefined_flag_RC
X
X# Flag that forces no undefined symbols.
Xno_undefined_flag=$lt_no_undefined_flag_RC
X
X# Commands used to finish a libtool library installation in a directory.
Xfinish_cmds=$lt_finish_cmds
X
X# Same as above, but a single script fragment to be evaled but not shown.
Xfinish_eval=$lt_finish_eval
X
X# Take the output of nm and produce a listing of raw symbols and C names.
Xglobal_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
X
X# Transform the output of nm in a proper C declaration
Xglobal_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
X
X# Transform the output of nm in a C name address pair
Xglobal_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
X
X# This is the shared library runtime path variable.
Xrunpath_var=$runpath_var
X
X# This is the shared library path variable.
Xshlibpath_var=$shlibpath_var
X
X# Is shlibpath searched before the hard-coded library search path?
Xshlibpath_overrides_runpath=$shlibpath_overrides_runpath
X
X# How to hardcode a shared library path into an executable.
Xhardcode_action=$hardcode_action_RC
X
X# Whether we should hardcode library paths into libraries.
Xhardcode_into_libs=$hardcode_into_libs
X
X# Flag to hardcode \$libdir into a binary during linking.
X# This must work even if \$libdir does not exist.
Xhardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC
X
X# If ld is used when linking, flag to hardcode \$libdir into
X# a binary during linking. This must work even if \$libdir does
X# not exist.
Xhardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC
X
X# Whether we need a single -rpath flag with a separated argument.
Xhardcode_libdir_separator=$lt_hardcode_libdir_separator_RC
X
X# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
X# resulting binary.
Xhardcode_direct=$hardcode_direct_RC
X
X# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
X# resulting binary.
Xhardcode_minus_L=$hardcode_minus_L_RC
X
X# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
X# the resulting binary.
Xhardcode_shlibpath_var=$hardcode_shlibpath_var_RC
X
X# Set to yes if building a shared library automatically hardcodes DIR into the library
X# and all subsequent libraries and executables linked against it.
Xhardcode_automatic=$hardcode_automatic_RC
X
X# Variables whose values should be saved in libtool wrapper scripts and
X# restored at relink time.
Xvariables_saved_for_relink="$variables_saved_for_relink"
X
X# Whether libtool must link a program against all its dependency libraries.
Xlink_all_deplibs=$link_all_deplibs_RC
X
X# Compile-time system search path for libraries
Xsys_lib_search_path_spec=$lt_sys_lib_search_path_spec
X
X# Run-time system search path for libraries
Xsys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
X
X# Fix the shell variable \$srcfile for the compiler.
Xfix_srcfile_path="$fix_srcfile_path_RC"
X
X# Set to yes if exported symbols are required.
Xalways_export_symbols=$always_export_symbols_RC
X
X# The commands to list exported symbols.
Xexport_symbols_cmds=$lt_export_symbols_cmds_RC
X
X# The commands to extract the exported symbol list from a shared archive.
Xextract_expsyms_cmds=$lt_extract_expsyms_cmds
X
X# Symbols that should not be listed in the preloaded symbols.
Xexclude_expsyms=$lt_exclude_expsyms_RC
X
X# Symbols that must always be exported.
Xinclude_expsyms=$lt_include_expsyms_RC
X
X# ### END LIBTOOL TAG CONFIG: $tagname
X
X__EOF__
X
X
Xelse
X  # If there is no Makefile yet, we rely on a make rule to execute
X  # `config.status --recheck' to rerun these tests and create the
X  # libtool script then.
X  test -f Makefile && make "$ltmain"
Xfi
X
X
Xac_ext=c
Xac_cpp='$CPP $CPPFLAGS'
Xac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
Xac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
Xac_compiler_gnu=$ac_cv_c_compiler_gnu
X
XCC="$lt_save_CC"
X
X	;;
X
X      *)
X	{ { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5
Xecho "$as_me: error: Unsupported tag name: $tagname" >&2;}
X   { (exit 1); exit 1; }; }
X	;;
X      esac
X
X      # Append the new tag name to the list of available tags.
X      if test -n "$tagname" ; then
X      available_tags="$available_tags $tagname"
X    fi
X    fi
X  done
X  IFS="$lt_save_ifs"
X
X  # Now substitute the updated list of available tags.
X  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
X    mv "${ofile}T" "$ofile"
X    chmod +x "$ofile"
X  else
X    rm -f "${ofile}T"
X    { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5
Xecho "$as_me: error: unable to update list of available tagged configurations." >&2;}
X   { (exit 1); exit 1; }; }
X  fi
Xfi
X
X
X
X# This can be used to rebuild libtool when needed
XLIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
X
X# Always use our own libtool.
XLIBTOOL='$(SHELL) $(top_builddir)/libtool'
X
X# Prevent multiple expansion
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
Xecho "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
Xecho $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6
X    # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
Xif test "${enable_maintainer_mode+set}" = set; then
X  enableval="$enable_maintainer_mode"
X  USE_MAINTAINER_MODE=$enableval
Xelse
X  USE_MAINTAINER_MODE=no
Xfi;
X  echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
Xecho "${ECHO_T}$USE_MAINTAINER_MODE" >&6
X
X
Xif test $USE_MAINTAINER_MODE = yes; then
X  MAINTAINER_MODE_TRUE=
X  MAINTAINER_MODE_FALSE='#'
Xelse
X  MAINTAINER_MODE_TRUE='#'
X  MAINTAINER_MODE_FALSE=
Xfi
X
X  MAINT=$MAINTAINER_MODE_TRUE
X
X
X
X
XLINUX_API=0
XDARWIN_API=0
XBSD_API=0
X
Xecho "$as_me:$LINENO: checking for what USB OS support" >&5
Xecho $ECHO_N "checking for what USB OS support... $ECHO_C" >&6
Xcase $host in
X  *-linux*)
X    cat >>confdefs.h <<\_ACEOF
X#define LINUX_API 1
X_ACEOF
X
X    cat >>confdefs.h <<\_ACEOF
X#define BSD_API 0
X_ACEOF
X
X    cat >>confdefs.h <<\_ACEOF
X#define DARWIN_API 0
X_ACEOF
X
X    LINUX_API=1
X    os_support=linux
X    echo "$as_me:$LINENO: result: Linux" >&5
Xecho "${ECHO_T}Linux" >&6
X    OSLIBS=""
X    ;;
X  *-freebsd*|*-openbsd*|*-netbsd*)
X    cat >>confdefs.h <<\_ACEOF
X#define BSD_API 1
X_ACEOF
X
X    cat >>confdefs.h <<\_ACEOF
X#define LINUX_API 0
X_ACEOF
X
X    cat >>confdefs.h <<\_ACEOF
X#define DARWIN_API 0
X_ACEOF
X
X    BSD_API=1
X    os_support=bsd
X    echo "$as_me:$LINENO: result: FreeBSD" >&5
Xecho "${ECHO_T}FreeBSD" >&6
X    OSLIBS=""
X    ;;
X  *-darwin*)
X    cat >>confdefs.h <<\_ACEOF
X#define DARWIN_API 1
X_ACEOF
X
X    cat >>confdefs.h <<\_ACEOF
X#define LINUX_API 0
X_ACEOF
X
X    cat >>confdefs.h <<\_ACEOF
X#define BSD_API 0
X_ACEOF
X
X    DARWIN_API=1
X    os_support=darwin
X    echo "$as_me:$LINENO: result: Darwin and/or MacOS 10" >&5
Xecho "${ECHO_T}Darwin and/or MacOS 10" >&6
X    OSLIBS="-framework IOKit"
X    ;;
X  *)
X    echo "$as_me:$LINENO: result: unknown operating system" >&5
Xecho "${ECHO_T}unknown operating system" >&6
X    { { echo "$as_me:$LINENO: error: libusb does not support compiling for $host" >&5
Xecho "$as_me: error: libusb does not support compiling for $host" >&2;}
X   { (exit 1); exit 1; }; }
X    ;;
Xesac
X
X
X
X
X
X
X
Xif test "$os_support" = "linux"; then
X  LINUX_API_TRUE=
X  LINUX_API_FALSE='#'
Xelse
X  LINUX_API_TRUE='#'
X  LINUX_API_FALSE=
Xfi
X
X
X
Xif test "$os_support" = "bsd"; then
X  BSD_API_TRUE=
X  BSD_API_FALSE='#'
Xelse
X  BSD_API_TRUE='#'
X  BSD_API_FALSE=
Xfi
X
X
X
Xif test "$os_support" = "darwin"; then
X  DARWIN_API_TRUE=
X  DARWIN_API_FALSE='#'
Xelse
X  DARWIN_API_TRUE='#'
X  DARWIN_API_FALSE=
Xfi
X
X
X
X
X
X# Check whether --enable-debug or --disable-debug was given.
Xif test "${enable_debug+set}" = set; then
X  enableval="$enable_debug"
X
Xelse
X  enable_debug=$debug_default
Xfi;
X
Xif test "x$enable_debug" = "xyes"; then
X  test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
Xfi
X
X# Checks for programs.
Xac_ext=c
Xac_cpp='$CPP $CPPFLAGS'
Xac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
Xac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
Xac_compiler_gnu=$ac_cv_c_compiler_gnu
Xif test -n "$ac_tool_prefix"; then
X  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
Xset dummy ${ac_tool_prefix}gcc; ac_word=$2
Xecho "$as_me:$LINENO: checking for $ac_word" >&5
Xecho $ECHO_N "checking for $ac_word... $ECHO_C" >&6
Xif test "${ac_cv_prog_CC+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -n "$CC"; then
X  ac_cv_prog_CC="$CC" # Let the user override the test.
Xelse
Xas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  for ac_exec_ext in '' $ac_executable_extensions; do
X  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
X    ac_cv_prog_CC="${ac_tool_prefix}gcc"
X    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
X    break 2
X  fi
Xdone
Xdone
X
Xfi
Xfi
XCC=$ac_cv_prog_CC
Xif test -n "$CC"; then
X  echo "$as_me:$LINENO: result: $CC" >&5
Xecho "${ECHO_T}$CC" >&6
Xelse
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X
Xfi
Xif test -z "$ac_cv_prog_CC"; then
X  ac_ct_CC=$CC
X  # Extract the first word of "gcc", so it can be a program name with args.
Xset dummy gcc; ac_word=$2
Xecho "$as_me:$LINENO: checking for $ac_word" >&5
Xecho $ECHO_N "checking for $ac_word... $ECHO_C" >&6
Xif test "${ac_cv_prog_ac_ct_CC+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -n "$ac_ct_CC"; then
X  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
Xelse
Xas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  for ac_exec_ext in '' $ac_executable_extensions; do
X  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
X    ac_cv_prog_ac_ct_CC="gcc"
X    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
X    break 2
X  fi
Xdone
Xdone
X
Xfi
Xfi
Xac_ct_CC=$ac_cv_prog_ac_ct_CC
Xif test -n "$ac_ct_CC"; then
X  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
Xecho "${ECHO_T}$ac_ct_CC" >&6
Xelse
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X
X  CC=$ac_ct_CC
Xelse
X  CC="$ac_cv_prog_CC"
Xfi
X
Xif test -z "$CC"; then
X  if test -n "$ac_tool_prefix"; then
X  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
Xset dummy ${ac_tool_prefix}cc; ac_word=$2
Xecho "$as_me:$LINENO: checking for $ac_word" >&5
Xecho $ECHO_N "checking for $ac_word... $ECHO_C" >&6
Xif test "${ac_cv_prog_CC+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -n "$CC"; then
X  ac_cv_prog_CC="$CC" # Let the user override the test.
Xelse
Xas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  for ac_exec_ext in '' $ac_executable_extensions; do
X  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
X    ac_cv_prog_CC="${ac_tool_prefix}cc"
X    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
X    break 2
X  fi
Xdone
Xdone
X
Xfi
Xfi
XCC=$ac_cv_prog_CC
Xif test -n "$CC"; then
X  echo "$as_me:$LINENO: result: $CC" >&5
Xecho "${ECHO_T}$CC" >&6
Xelse
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X
Xfi
Xif test -z "$ac_cv_prog_CC"; then
X  ac_ct_CC=$CC
X  # Extract the first word of "cc", so it can be a program name with args.
Xset dummy cc; ac_word=$2
Xecho "$as_me:$LINENO: checking for $ac_word" >&5
Xecho $ECHO_N "checking for $ac_word... $ECHO_C" >&6
Xif test "${ac_cv_prog_ac_ct_CC+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -n "$ac_ct_CC"; then
X  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
Xelse
Xas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  for ac_exec_ext in '' $ac_executable_extensions; do
X  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
X    ac_cv_prog_ac_ct_CC="cc"
X    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
X    break 2
X  fi
Xdone
Xdone
X
Xfi
Xfi
Xac_ct_CC=$ac_cv_prog_ac_ct_CC
Xif test -n "$ac_ct_CC"; then
X  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
Xecho "${ECHO_T}$ac_ct_CC" >&6
Xelse
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X
X  CC=$ac_ct_CC
Xelse
X  CC="$ac_cv_prog_CC"
Xfi
X
Xfi
Xif test -z "$CC"; then
X  # Extract the first word of "cc", so it can be a program name with args.
Xset dummy cc; ac_word=$2
Xecho "$as_me:$LINENO: checking for $ac_word" >&5
Xecho $ECHO_N "checking for $ac_word... $ECHO_C" >&6
Xif test "${ac_cv_prog_CC+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -n "$CC"; then
X  ac_cv_prog_CC="$CC" # Let the user override the test.
Xelse
X  ac_prog_rejected=no
Xas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  for ac_exec_ext in '' $ac_executable_extensions; do
X  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
X    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
X       ac_prog_rejected=yes
X       continue
X     fi
X    ac_cv_prog_CC="cc"
X    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
X    break 2
X  fi
Xdone
Xdone
X
Xif test $ac_prog_rejected = yes; then
X  # We found a bogon in the path, so make sure we never use it.
X  set dummy $ac_cv_prog_CC
X  shift
X  if test $# != 0; then
X    # We chose a different compiler from the bogus one.
X    # However, it has the same basename, so the bogon will be chosen
X    # first if we set CC to just the basename; use the full file name.
X    shift
X    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
X  fi
Xfi
Xfi
Xfi
XCC=$ac_cv_prog_CC
Xif test -n "$CC"; then
X  echo "$as_me:$LINENO: result: $CC" >&5
Xecho "${ECHO_T}$CC" >&6
Xelse
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X
Xfi
Xif test -z "$CC"; then
X  if test -n "$ac_tool_prefix"; then
X  for ac_prog in cl
X  do
X    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
Xset dummy $ac_tool_prefix$ac_prog; ac_word=$2
Xecho "$as_me:$LINENO: checking for $ac_word" >&5
Xecho $ECHO_N "checking for $ac_word... $ECHO_C" >&6
Xif test "${ac_cv_prog_CC+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -n "$CC"; then
X  ac_cv_prog_CC="$CC" # Let the user override the test.
Xelse
Xas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  for ac_exec_ext in '' $ac_executable_extensions; do
X  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
X    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
X    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
X    break 2
X  fi
Xdone
Xdone
X
Xfi
Xfi
XCC=$ac_cv_prog_CC
Xif test -n "$CC"; then
X  echo "$as_me:$LINENO: result: $CC" >&5
Xecho "${ECHO_T}$CC" >&6
Xelse
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X
X    test -n "$CC" && break
X  done
Xfi
Xif test -z "$CC"; then
X  ac_ct_CC=$CC
X  for ac_prog in cl
Xdo
X  # Extract the first word of "$ac_prog", so it can be a program name with args.
Xset dummy $ac_prog; ac_word=$2
Xecho "$as_me:$LINENO: checking for $ac_word" >&5
Xecho $ECHO_N "checking for $ac_word... $ECHO_C" >&6
Xif test "${ac_cv_prog_ac_ct_CC+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -n "$ac_ct_CC"; then
X  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
Xelse
Xas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  for ac_exec_ext in '' $ac_executable_extensions; do
X  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
X    ac_cv_prog_ac_ct_CC="$ac_prog"
X    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
X    break 2
X  fi
Xdone
Xdone
X
Xfi
Xfi
Xac_ct_CC=$ac_cv_prog_ac_ct_CC
Xif test -n "$ac_ct_CC"; then
X  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
Xecho "${ECHO_T}$ac_ct_CC" >&6
Xelse
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X
X  test -n "$ac_ct_CC" && break
Xdone
X
X  CC=$ac_ct_CC
Xfi
X
Xfi
X
X
Xtest -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
XSee \`config.log' for more details." >&5
Xecho "$as_me: error: no acceptable C compiler found in \$PATH
XSee \`config.log' for more details." >&2;}
X   { (exit 1); exit 1; }; }
X
X# Provide some information about the compiler.
Xecho "$as_me:$LINENO:" \
X     "checking for C compiler version" >&5
Xac_compiler=`set X $ac_compile; echo $2`
X{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
X  (eval $ac_compiler --version </dev/null >&5) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }
X{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
X  (eval $ac_compiler -v </dev/null >&5) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }
X{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
X  (eval $ac_compiler -V </dev/null >&5) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }
X
Xecho "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
Xecho $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
Xif test "${ac_cv_c_compiler_gnu+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X
Xint
Xmain ()
X{
X#ifndef __GNUC__
X       choke me
X#endif
X
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext
Xif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest.$ac_objext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_compiler_gnu=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_compiler_gnu=no
Xfi
Xrm -f conftest.$ac_objext conftest.$ac_ext
Xac_cv_c_compiler_gnu=$ac_compiler_gnu
X
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
Xecho "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
XGCC=`test $ac_compiler_gnu = yes && echo yes`
Xac_test_CFLAGS=${CFLAGS+set}
Xac_save_CFLAGS=$CFLAGS
XCFLAGS="-g"
Xecho "$as_me:$LINENO: checking whether $CC accepts -g" >&5
Xecho $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
Xif test "${ac_cv_prog_cc_g+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X
Xint
Xmain ()
X{
X
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext
Xif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest.$ac_objext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_cv_prog_cc_g=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_cv_prog_cc_g=no
Xfi
Xrm -f conftest.$ac_objext conftest.$ac_ext
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
Xecho "${ECHO_T}$ac_cv_prog_cc_g" >&6
Xif test "$ac_test_CFLAGS" = set; then
X  CFLAGS=$ac_save_CFLAGS
Xelif test $ac_cv_prog_cc_g = yes; then
X  if test "$GCC" = yes; then
X    CFLAGS="-g -O2"
X  else
X    CFLAGS="-g"
X  fi
Xelse
X  if test "$GCC" = yes; then
X    CFLAGS="-O2"
X  else
X    CFLAGS=
X  fi
Xfi
Xecho "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
Xecho $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
Xif test "${ac_cv_prog_cc_stdc+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  ac_cv_prog_cc_stdc=no
Xac_save_CC=$CC
Xcat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X#include <stdarg.h>
X#include <stdio.h>
X#include <sys/types.h>
X#include <sys/stat.h>
X/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
Xstruct buf { int x; };
XFILE * (*rcsopen) (struct buf *, struct stat *, int);
Xstatic char *e (p, i)
X     char **p;
X     int i;
X{
X  return p[i];
X}
Xstatic char *f (char * (*g) (char **, int), char **p, ...)
X{
X  char *s;
X  va_list v;
X  va_start (v,p);
X  s = g (p, va_arg (v,int));
X  va_end (v);
X  return s;
X}
Xint test (int i, double x);
Xstruct s1 {int (*f) (int a);};
Xstruct s2 {int (*f) (double a);};
Xint pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
Xint argc;
Xchar **argv;
Xint
Xmain ()
X{
Xreturn f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
X  ;
X  return 0;
X}
X_ACEOF
X# Don't try gcc -ansi; that turns off useful extensions and
X# breaks some systems' header files.
X# AIX			-qlanglvl=ansi
X# Ultrix and OSF/1	-std1
X# HP-UX 10.20 and later	-Ae
X# HP-UX older versions	-Aa -D_HPUX_SOURCE
X# SVR4			-Xc -D__EXTENSIONS__
Xfor ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
Xdo
X  CC="$ac_save_CC $ac_arg"
X  rm -f conftest.$ac_objext
Xif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest.$ac_objext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_cv_prog_cc_stdc=$ac_arg
Xbreak
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xfi
Xrm -f conftest.$ac_objext
Xdone
Xrm -f conftest.$ac_ext conftest.$ac_objext
XCC=$ac_save_CC
X
Xfi
X
Xcase "x$ac_cv_prog_cc_stdc" in
X  x|xno)
X    echo "$as_me:$LINENO: result: none needed" >&5
Xecho "${ECHO_T}none needed" >&6 ;;
X  *)
X    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
Xecho "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
X    CC="$CC $ac_cv_prog_cc_stdc" ;;
Xesac
X
X# Some people use a C++ compiler to compile C.  Since we use `exit',
X# in C++ we need to declare it.  In case someone uses the same compiler
X# for both compiling C and C++ we need to have the C++ compiler decide
X# the declaration of exit, since it's the most demanding environment.
Xcat >conftest.$ac_ext <<_ACEOF
X#ifndef __cplusplus
X  choke me
X#endif
X_ACEOF
Xrm -f conftest.$ac_objext
Xif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest.$ac_objext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  for ac_declaration in \
X   ''\
X   '#include <stdlib.h>' \
X   'extern "C" void std::exit (int) throw (); using std::exit;' \
X   'extern "C" void std::exit (int); using std::exit;' \
X   'extern "C" void exit (int) throw ();' \
X   'extern "C" void exit (int);' \
X   'void exit (int);'
Xdo
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X#include <stdlib.h>
X$ac_declaration
Xint
Xmain ()
X{
Xexit (42);
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext
Xif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest.$ac_objext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  :
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xcontinue
Xfi
Xrm -f conftest.$ac_objext conftest.$ac_ext
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X$ac_declaration
Xint
Xmain ()
X{
Xexit (42);
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext
Xif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest.$ac_objext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  break
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xfi
Xrm -f conftest.$ac_objext conftest.$ac_ext
Xdone
Xrm -f conftest*
Xif test -n "$ac_declaration"; then
X  echo '#ifdef __cplusplus' >>confdefs.h
X  echo $ac_declaration      >>confdefs.h
X  echo '#endif'             >>confdefs.h
Xfi
X
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xfi
Xrm -f conftest.$ac_objext conftest.$ac_ext
Xac_ext=c
Xac_cpp='$CPP $CPPFLAGS'
Xac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
Xac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
Xac_compiler_gnu=$ac_cv_c_compiler_gnu
X
Xdepcc="$CC"   am_compiler_list=
X
Xecho "$as_me:$LINENO: checking dependency style of $depcc" >&5
Xecho $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
Xif test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
X  # We make a subdir and do the tests there.  Otherwise we can end up
X  # making bogus files that we don't know about and never remove.  For
X  # instance it was reported that on HP-UX the gcc test will end up
X  # making a dummy file named `D' -- because `-MD' means `put the output
X  # in D'.
X  mkdir conftest.dir
X  # Copy depcomp to subdir because otherwise we won't find it if we're
X  # using a relative directory.
X  cp "$am_depcomp" conftest.dir
X  cd conftest.dir
X  # We will build objects and dependencies in a subdirectory because
X  # it helps to detect inapplicable dependency modes.  For instance
X  # both Tru64's cc and ICC support -MD to output dependencies as a
X  # side effect of compilation, but ICC will put the dependencies in
X  # the current directory while Tru64 will put them in the object
X  # directory.
X  mkdir sub
X
X  am_cv_CC_dependencies_compiler_type=none
X  if test "$am_compiler_list" = ""; then
X     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
X  fi
X  for depmode in $am_compiler_list; do
X    # Setup a source with many dependencies, because some compilers
X    # like to wrap large dependency lists on column 80 (with \), and
X    # we should not choose a depcomp mode which is confused by this.
X    #
X    # We need to recreate these files for each test, as the compiler may
X    # overwrite some of them when testing with obscure command lines.
X    # This happens at least with the AIX C compiler.
X    : > sub/conftest.c
X    for i in 1 2 3 4 5 6; do
X      echo '#include "conftst'$i'.h"' >> sub/conftest.c
X      : > sub/conftst$i.h
X    done
X    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
X
X    case $depmode in
X    nosideeffect)
X      # after this tag, mechanisms are not by side-effect, so they'll
X      # only be used when explicitly requested
X      if test "x$enable_dependency_tracking" = xyes; then
X	continue
X      else
X	break
X      fi
X      ;;
X    none) break ;;
X    esac
X    # We check with `-c' and `-o' for the sake of the "dashmstdout"
X    # mode.  It turns out that the SunPro C++ compiler does not properly
X    # handle `-M -o', and we need to detect this.
X    if depmode=$depmode \
X       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
X       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
X       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
X         >/dev/null 2>conftest.err &&
X       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
X       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
X       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
X      # icc doesn't choke on unknown options, it will just issue warnings
X      # (even with -Werror).  So we grep stderr for any message
X      # that says an option was ignored.
X      if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
X        am_cv_CC_dependencies_compiler_type=$depmode
X        break
X      fi
X    fi
X  done
X
X  cd ..
X  rm -rf conftest.dir
Xelse
X  am_cv_CC_dependencies_compiler_type=none
Xfi
X
Xfi
Xecho "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
Xecho "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
XCCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
X
X
X
Xif
X  test "x$enable_dependency_tracking" != xno \
X  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
X  am__fastdepCC_TRUE=
X  am__fastdepCC_FALSE='#'
Xelse
X  am__fastdepCC_TRUE='#'
X  am__fastdepCC_FALSE=
Xfi
X
X
X
X
X
Xecho "$as_me:$LINENO: checking for ${CC-cc} option to accept ANSI C" >&5
Xecho $ECHO_N "checking for ${CC-cc} option to accept ANSI C... $ECHO_C" >&6
Xif test "${am_cv_prog_cc_stdc+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  am_cv_prog_cc_stdc=no
Xac_save_CC="$CC"
X# Don't try gcc -ansi; that turns off useful extensions and
X# breaks some systems' header files.
X# AIX			-qlanglvl=ansi
X# Ultrix and OSF/1	-std1
X# HP-UX 10.20 and later	-Ae
X# HP-UX older versions	-Aa -D_HPUX_SOURCE
X# SVR4			-Xc -D__EXTENSIONS__
Xfor ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
Xdo
X  CC="$ac_save_CC $ac_arg"
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X#include <stdarg.h>
X#include <stdio.h>
X#include <sys/types.h>
X#include <sys/stat.h>
X/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
Xstruct buf { int x; };
XFILE * (*rcsopen) (struct buf *, struct stat *, int);
Xstatic char *e (p, i)
X     char **p;
X     int i;
X{
X  return p[i];
X}
Xstatic char *f (char * (*g) (char **, int), char **p, ...)
X{
X  char *s;
X  va_list v;
X  va_start (v,p);
X  s = g (p, va_arg (v,int));
X  va_end (v);
X  return s;
X}
Xint test (int i, double x);
Xstruct s1 {int (*f) (int a);};
Xstruct s2 {int (*f) (double a);};
Xint pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
Xint argc;
Xchar **argv;
X
Xint
Xmain ()
X{
X
Xreturn f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
X
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext
Xif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest.$ac_objext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  am_cv_prog_cc_stdc="$ac_arg"; break
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xfi
Xrm -f conftest.$ac_objext conftest.$ac_ext
Xdone
XCC="$ac_save_CC"
X
Xfi
X
Xif test -z "$am_cv_prog_cc_stdc"; then
X  echo "$as_me:$LINENO: result: none needed" >&5
Xecho "${ECHO_T}none needed" >&6
Xelse
X  echo "$as_me:$LINENO: result: $am_cv_prog_cc_stdc" >&5
Xecho "${ECHO_T}$am_cv_prog_cc_stdc" >&6
Xfi
Xcase "x$am_cv_prog_cc_stdc" in
X  x|xno) ;;
X  *) CC="$CC $am_cv_prog_cc_stdc" ;;
Xesac
X
X# Find a good install program.  We prefer a C program (faster),
X# so one script is as good as another.  But avoid the broken or
X# incompatible versions:
X# SysV /etc/install, /usr/sbin/install
X# SunOS /usr/etc/install
X# IRIX /sbin/install
X# AIX /bin/install
X# AmigaOS /C/install, which installs bootblocks on floppy discs
X# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
X# AFS /usr/afsws/bin/install, which mishandles nonexistent args
X# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
X# ./install, which can be erroneously created by make from ./install.sh.
Xecho "$as_me:$LINENO: checking for a BSD-compatible install" >&5
Xecho $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
Xif test -z "$INSTALL"; then
Xif test "${ac_cv_path_install+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  # Account for people who put trailing slashes in PATH elements.
Xcase $as_dir/ in
X  ./ | .// | /cC/* | \
X  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
X  /usr/ucb/* ) ;;
X  *)
X    # OSF1 and SCO ODT 3.0 have their own names for install.
X    # Don't use installbsd from OSF since it installs stuff as root
X    # by default.
X    for ac_prog in ginstall scoinst install; do
X      for ac_exec_ext in '' $ac_executable_extensions; do
X        if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
X          if test $ac_prog = install &&
X            grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
X            # AIX install.  It has an incompatible calling convention.
X            :
X          elif test $ac_prog = install &&
X            grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
X            # program-specific install script used by HP pwplus--don't use.
X            :
X          else
X            ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
X            break 3
X          fi
X        fi
X      done
X    done
X    ;;
Xesac
Xdone
X
X
Xfi
X  if test "${ac_cv_path_install+set}" = set; then
X    INSTALL=$ac_cv_path_install
X  else
X    # As a last resort, use the slow shell script.  We don't cache a
X    # path for INSTALL within a source directory, because that will
X    # break other packages using the cache if that directory is
X    # removed, or if the path is relative.
X    INSTALL=$ac_install_sh
X  fi
Xfi
Xecho "$as_me:$LINENO: result: $INSTALL" >&5
Xecho "${ECHO_T}$INSTALL" >&6
X
X# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
X# It thinks the first close brace ends the variable substitution.
Xtest -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
X
Xtest -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
X
Xtest -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
X
X
Xif test "x$GCC" = "xyes"; then
X  case " $CFLAGS " in
X  *[\ \	]-Wall[\ \	]*) ;;
X  *) CFLAGS="$CFLAGS -Wall" ;;
X  esac
Xfi
X
X# Checks for header files.
Xecho "$as_me:$LINENO: checking for ANSI C header files" >&5
Xecho $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
Xif test "${ac_cv_header_stdc+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X#include <stdlib.h>
X#include <stdarg.h>
X#include <string.h>
X#include <float.h>
X
Xint
Xmain ()
X{
X
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext
Xif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest.$ac_objext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_cv_header_stdc=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_cv_header_stdc=no
Xfi
Xrm -f conftest.$ac_objext conftest.$ac_ext
X
Xif test $ac_cv_header_stdc = yes; then
X  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X#include <string.h>
X
X_ACEOF
Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
X  $EGREP "memchr" >/dev/null 2>&1; then
X  :
Xelse
X  ac_cv_header_stdc=no
Xfi
Xrm -f conftest*
X
Xfi
X
Xif test $ac_cv_header_stdc = yes; then
X  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X#include <stdlib.h>
X
X_ACEOF
Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
X  $EGREP "free" >/dev/null 2>&1; then
X  :
Xelse
X  ac_cv_header_stdc=no
Xfi
Xrm -f conftest*
X
Xfi
X
Xif test $ac_cv_header_stdc = yes; then
X  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
X  if test "$cross_compiling" = yes; then
X  :
Xelse
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X#include <ctype.h>
X#if ((' ' & 0x0FF) == 0x020)
X# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
X# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
X#else
X# define ISLOWER(c) \
X                   (('a' <= (c) && (c) <= 'i') \
X                     || ('j' <= (c) && (c) <= 'r') \
X                     || ('s' <= (c) && (c) <= 'z'))
X# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
X#endif
X
X#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
Xint
Xmain ()
X{
X  int i;
X  for (i = 0; i < 256; i++)
X    if (XOR (islower (i), ISLOWER (i))
X        || toupper (i) != TOUPPER (i))
X      exit(2);
X  exit (0);
X}
X_ACEOF
Xrm -f conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  :
Xelse
X  echo "$as_me: program exited with status $ac_status" >&5
Xecho "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
X( exit $ac_status )
Xac_cv_header_stdc=no
Xfi
Xrm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
Xfi
Xfi
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
Xecho "${ECHO_T}$ac_cv_header_stdc" >&6
Xif test $ac_cv_header_stdc = yes; then
X
Xcat >>confdefs.h <<\_ACEOF
X#define STDC_HEADERS 1
X_ACEOF
X
Xfi
X
X
X# Checks for library functions.
X
Xfor ac_func in vprintf
Xdo
Xas_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
Xecho "$as_me:$LINENO: checking for $ac_func" >&5
Xecho $ECHO_N "checking for $ac_func... $ECHO_C" >&6
Xif eval "test \"\${$as_ac_var+set}\" = set"; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X/* System header to define __stub macros and hopefully few prototypes,
X    which can conflict with char $ac_func (); below.
X    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
X    <limits.h> exists even on freestanding compilers.  */
X#ifdef __STDC__
X# include <limits.h>
X#else
X# include <assert.h>
X#endif
X/* Override any gcc2 internal prototype to avoid an error.  */
X#ifdef __cplusplus
Xextern "C"
X{
X#endif
X/* We use char because int might match the return type of a gcc2
X   builtin and then its argument prototype would still apply.  */
Xchar $ac_func ();
X/* The GNU C library defines this for functions which it implements
X    to always fail with ENOSYS.  Some functions are actually named
X    something starting with __ and the normal name is an alias.  */
X#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
Xchoke me
X#else
Xchar (*f) () = $ac_func;
X#endif
X#ifdef __cplusplus
X}
X#endif
X
Xint
Xmain ()
X{
Xreturn f != $ac_func;
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  eval "$as_ac_var=yes"
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xeval "$as_ac_var=no"
Xfi
Xrm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
Xfi
Xecho "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
Xecho "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
Xif test `eval echo '${'$as_ac_var'}'` = yes; then
X  cat >>confdefs.h <<_ACEOF
X#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
X_ACEOF
X
Xecho "$as_me:$LINENO: checking for _doprnt" >&5
Xecho $ECHO_N "checking for _doprnt... $ECHO_C" >&6
Xif test "${ac_cv_func__doprnt+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X/* System header to define __stub macros and hopefully few prototypes,
X    which can conflict with char _doprnt (); below.
X    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
X    <limits.h> exists even on freestanding compilers.  */
X#ifdef __STDC__
X# include <limits.h>
X#else
X# include <assert.h>
X#endif
X/* Override any gcc2 internal prototype to avoid an error.  */
X#ifdef __cplusplus
Xextern "C"
X{
X#endif
X/* We use char because int might match the return type of a gcc2
X   builtin and then its argument prototype would still apply.  */
Xchar _doprnt ();
X/* The GNU C library defines this for functions which it implements
X    to always fail with ENOSYS.  Some functions are actually named
X    something starting with __ and the normal name is an alias.  */
X#if defined (__stub__doprnt) || defined (__stub____doprnt)
Xchoke me
X#else
Xchar (*f) () = _doprnt;
X#endif
X#ifdef __cplusplus
X}
X#endif
X
Xint
Xmain ()
X{
Xreturn f != _doprnt;
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_cv_func__doprnt=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_cv_func__doprnt=no
Xfi
Xrm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5
Xecho "${ECHO_T}$ac_cv_func__doprnt" >&6
Xif test $ac_cv_func__doprnt = yes; then
X
Xcat >>confdefs.h <<\_ACEOF
X#define HAVE_DOPRNT 1
X_ACEOF
X
Xfi
X
Xfi
Xdone
X
X
X
Xecho "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
Xecho $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
Xif test "${ac_cv_c_const+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X
Xint
Xmain ()
X{
X/* FIXME: Include the comments suggested by Paul. */
X#ifndef __cplusplus
X  /* Ultrix mips cc rejects this.  */
X  typedef int charset[2];
X  const charset x;
X  /* SunOS 4.1.1 cc rejects this.  */
X  char const *const *ccp;
X  char **p;
X  /* NEC SVR4.0.2 mips cc rejects this.  */
X  struct point {int x, y;};
X  static struct point const zero = {0,0};
X  /* AIX XL C 1.02.0.0 rejects this.
X     It does not let you subtract one const X* pointer from another in
X     an arm of an if-expression whose if-part is not a constant
X     expression */
X  const char *g = "string";
X  ccp = &g + (g ? g-g : 0);
X  /* HPUX 7.0 cc rejects these. */
X  ++ccp;
X  p = (char**) ccp;
X  ccp = (char const *const *) p;
X  { /* SCO 3.2v4 cc rejects this.  */
X    char *t;
X    char const *s = 0 ? (char *) 0 : (char const *) 0;
X
X    *t++ = 0;
X  }
X  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
X    int x[] = {25, 17};
X    const int *foo = &x[0];
X    ++foo;
X  }
X  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
X    typedef const int *iptr;
X    iptr p = 0;
X    ++p;
X  }
X  { /* AIX XL C 1.02.0.0 rejects this saying
X       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
X    struct s { int j; const int *ap[3]; };
X    struct s *b; b->j = 5;
X  }
X  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
X    const int foo = 10;
X  }
X#endif
X
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext
Xif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest.$ac_objext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_cv_c_const=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_cv_c_const=no
Xfi
Xrm -f conftest.$ac_objext conftest.$ac_ext
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_c_const" >&5
Xecho "${ECHO_T}$ac_cv_c_const" >&6
Xif test $ac_cv_c_const = no; then
X
Xcat >>confdefs.h <<\_ACEOF
X#define const
X_ACEOF
X
Xfi
X
X
Xecho "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
Xecho $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6
Xif test "${ac_cv_c_bigendian+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  # See if sys/param.h defines the BYTE_ORDER macro.
Xcat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X#include <sys/types.h>
X#include <sys/param.h>
X
Xint
Xmain ()
X{
X#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
X bogus endian macros
X#endif
X
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext
Xif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest.$ac_objext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  # It does; now see whether it defined to BIG_ENDIAN or not.
Xcat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X#include <sys/types.h>
X#include <sys/param.h>
X
Xint
Xmain ()
X{
X#if BYTE_ORDER != BIG_ENDIAN
X not big endian
X#endif
X
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext
Xif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest.$ac_objext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_cv_c_bigendian=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_cv_c_bigendian=no
Xfi
Xrm -f conftest.$ac_objext conftest.$ac_ext
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
X# It does not; compile a test program.
Xif test "$cross_compiling" = yes; then
X  # try to guess the endianness by grepping values into an object file
X  ac_cv_c_bigendian=unknown
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
Xshort ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
Xshort ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
Xvoid _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
Xshort ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
Xshort ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
Xvoid _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
Xint
Xmain ()
X{
X _ascii (); _ebcdic ();
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext
Xif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest.$ac_objext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
X  ac_cv_c_bigendian=yes
Xfi
Xif grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
X  if test "$ac_cv_c_bigendian" = unknown; then
X    ac_cv_c_bigendian=no
X  else
X    # finding both strings is unlikely to happen, but who knows?
X    ac_cv_c_bigendian=unknown
X  fi
Xfi
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xfi
Xrm -f conftest.$ac_objext conftest.$ac_ext
Xelse
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
Xint
Xmain ()
X{
X  /* Are we little or big endian?  From Harbison&Steele.  */
X  union
X  {
X    long l;
X    char c[sizeof (long)];
X  } u;
X  u.l = 1;
X  exit (u.c[sizeof (long) - 1] == 1);
X}
X_ACEOF
Xrm -f conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_cv_c_bigendian=no
Xelse
X  echo "$as_me: program exited with status $ac_status" >&5
Xecho "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
X( exit $ac_status )
Xac_cv_c_bigendian=yes
Xfi
Xrm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
Xfi
Xfi
Xrm -f conftest.$ac_objext conftest.$ac_ext
Xfi
Xecho "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
Xecho "${ECHO_T}$ac_cv_c_bigendian" >&6
Xcase $ac_cv_c_bigendian in
X  yes)
X
Xcat >>confdefs.h <<\_ACEOF
X#define WORDS_BIGENDIAN 1
X_ACEOF
X ;;
X  no)
X     ;;
X  *)
X    { { echo "$as_me:$LINENO: error: unknown endianness
Xpresetting ac_cv_c_bigendian=no (or yes) will help" >&5
Xecho "$as_me: error: unknown endianness
Xpresetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
X   { (exit 1); exit 1; }; } ;;
Xesac
X
X
Xif test "$ac_cv_c_bigendian" = "yes"; then
X  BIGENDIAN="1"
Xelse
X  BIGENDIAN="0"
Xfi
X
X
X
Xfor ac_header in limits.h
Xdo
Xas_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
Xif eval "test \"\${$as_ac_Header+set}\" = set"; then
X  echo "$as_me:$LINENO: checking for $ac_header" >&5
Xecho $ECHO_N "checking for $ac_header... $ECHO_C" >&6
Xif eval "test \"\${$as_ac_Header+set}\" = set"; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xfi
Xecho "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
Xecho "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
Xelse
X  # Is the header compilable?
Xecho "$as_me:$LINENO: checking $ac_header usability" >&5
Xecho $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
Xcat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X$ac_includes_default
X#include <$ac_header>
X_ACEOF
Xrm -f conftest.$ac_objext
Xif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest.$ac_objext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_header_compiler=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_header_compiler=no
Xfi
Xrm -f conftest.$ac_objext conftest.$ac_ext
Xecho "$as_me:$LINENO: result: $ac_header_compiler" >&5
Xecho "${ECHO_T}$ac_header_compiler" >&6
X
X# Is the header present?
Xecho "$as_me:$LINENO: checking $ac_header presence" >&5
Xecho $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
Xcat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X#include <$ac_header>
X_ACEOF
Xif { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
X  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
X  ac_status=$?
X  grep -v '^ *+' conftest.er1 >conftest.err
X  rm -f conftest.er1
X  cat conftest.err >&5
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } >/dev/null; then
X  if test -s conftest.err; then
X    ac_cpp_err=$ac_c_preproc_warn_flag
X  else
X    ac_cpp_err=
X  fi
Xelse
X  ac_cpp_err=yes
Xfi
Xif test -z "$ac_cpp_err"; then
X  ac_header_preproc=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
X  ac_header_preproc=no
Xfi
Xrm -f conftest.err conftest.$ac_ext
Xecho "$as_me:$LINENO: result: $ac_header_preproc" >&5
Xecho "${ECHO_T}$ac_header_preproc" >&6
X
X# So?  What about this header?
Xcase $ac_header_compiler:$ac_header_preproc in
X  yes:no )
X    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
Xecho "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
X    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
Xecho "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
X    (
X      cat <<\_ASBOX
X## ------------------------------------ ##
X## Report this to bug-autoconf@gnu.org. ##
X## ------------------------------------ ##
X_ASBOX
X    ) |
X      sed "s/^/$as_me: WARNING:     /" >&2
X    ;;
X  no:yes )
X    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
Xecho "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
X    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
Xecho "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
X    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
Xecho "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
X    (
X      cat <<\_ASBOX
X## ------------------------------------ ##
X## Report this to bug-autoconf@gnu.org. ##
X## ------------------------------------ ##
X_ASBOX
X    ) |
X      sed "s/^/$as_me: WARNING:     /" >&2
X    ;;
Xesac
Xecho "$as_me:$LINENO: checking for $ac_header" >&5
Xecho $ECHO_N "checking for $ac_header... $ECHO_C" >&6
Xif eval "test \"\${$as_ac_Header+set}\" = set"; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  eval "$as_ac_Header=$ac_header_preproc"
Xfi
Xecho "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
Xecho "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
X
Xfi
Xif test `eval echo '${'$as_ac_Header'}'` = yes; then
X  cat >>confdefs.h <<_ACEOF
X#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
X_ACEOF
X cat >>confdefs.h <<_ACEOF
X#define HAVE_LIMITS_H 1
X_ACEOF
X
Xfi
X
Xdone
X
X
Xfor ac_header in unistd.h
Xdo
Xas_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
Xif eval "test \"\${$as_ac_Header+set}\" = set"; then
X  echo "$as_me:$LINENO: checking for $ac_header" >&5
Xecho $ECHO_N "checking for $ac_header... $ECHO_C" >&6
Xif eval "test \"\${$as_ac_Header+set}\" = set"; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xfi
Xecho "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
Xecho "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
Xelse
X  # Is the header compilable?
Xecho "$as_me:$LINENO: checking $ac_header usability" >&5
Xecho $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
Xcat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X$ac_includes_default
X#include <$ac_header>
X_ACEOF
Xrm -f conftest.$ac_objext
Xif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest.$ac_objext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_header_compiler=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_header_compiler=no
Xfi
Xrm -f conftest.$ac_objext conftest.$ac_ext
Xecho "$as_me:$LINENO: result: $ac_header_compiler" >&5
Xecho "${ECHO_T}$ac_header_compiler" >&6
X
X# Is the header present?
Xecho "$as_me:$LINENO: checking $ac_header presence" >&5
Xecho $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
Xcat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X#include <$ac_header>
X_ACEOF
Xif { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
X  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
X  ac_status=$?
X  grep -v '^ *+' conftest.er1 >conftest.err
X  rm -f conftest.er1
X  cat conftest.err >&5
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } >/dev/null; then
X  if test -s conftest.err; then
X    ac_cpp_err=$ac_c_preproc_warn_flag
X  else
X    ac_cpp_err=
X  fi
Xelse
X  ac_cpp_err=yes
Xfi
Xif test -z "$ac_cpp_err"; then
X  ac_header_preproc=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
X  ac_header_preproc=no
Xfi
Xrm -f conftest.err conftest.$ac_ext
Xecho "$as_me:$LINENO: result: $ac_header_preproc" >&5
Xecho "${ECHO_T}$ac_header_preproc" >&6
X
X# So?  What about this header?
Xcase $ac_header_compiler:$ac_header_preproc in
X  yes:no )
X    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
Xecho "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
X    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
Xecho "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
X    (
X      cat <<\_ASBOX
X## ------------------------------------ ##
X## Report this to bug-autoconf@gnu.org. ##
X## ------------------------------------ ##
X_ASBOX
X    ) |
X      sed "s/^/$as_me: WARNING:     /" >&2
X    ;;
X  no:yes )
X    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
Xecho "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
X    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
Xecho "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
X    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
Xecho "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
X    (
X      cat <<\_ASBOX
X## ------------------------------------ ##
X## Report this to bug-autoconf@gnu.org. ##
X## ------------------------------------ ##
X_ASBOX
X    ) |
X      sed "s/^/$as_me: WARNING:     /" >&2
X    ;;
Xesac
Xecho "$as_me:$LINENO: checking for $ac_header" >&5
Xecho $ECHO_N "checking for $ac_header... $ECHO_C" >&6
Xif eval "test \"\${$as_ac_Header+set}\" = set"; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  eval "$as_ac_Header=$ac_header_preproc"
Xfi
Xecho "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
Xecho "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
X
Xfi
Xif test `eval echo '${'$as_ac_Header'}'` = yes; then
X  cat >>confdefs.h <<_ACEOF
X#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
X_ACEOF
X cat >>confdefs.h <<_ACEOF
X#define HAVE_UNISTD_H 1
X_ACEOF
X
Xfi
X
Xdone
X
X
Xfor ac_header in values.h
Xdo
Xas_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
Xif eval "test \"\${$as_ac_Header+set}\" = set"; then
X  echo "$as_me:$LINENO: checking for $ac_header" >&5
Xecho $ECHO_N "checking for $ac_header... $ECHO_C" >&6
Xif eval "test \"\${$as_ac_Header+set}\" = set"; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xfi
Xecho "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
Xecho "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
Xelse
X  # Is the header compilable?
Xecho "$as_me:$LINENO: checking $ac_header usability" >&5
Xecho $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
Xcat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X$ac_includes_default
X#include <$ac_header>
X_ACEOF
Xrm -f conftest.$ac_objext
Xif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest.$ac_objext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  ac_header_compiler=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xac_header_compiler=no
Xfi
Xrm -f conftest.$ac_objext conftest.$ac_ext
Xecho "$as_me:$LINENO: result: $ac_header_compiler" >&5
Xecho "${ECHO_T}$ac_header_compiler" >&6
X
X# Is the header present?
Xecho "$as_me:$LINENO: checking $ac_header presence" >&5
Xecho $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
Xcat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X#include <$ac_header>
X_ACEOF
Xif { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
X  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
X  ac_status=$?
X  grep -v '^ *+' conftest.er1 >conftest.err
X  rm -f conftest.er1
X  cat conftest.err >&5
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } >/dev/null; then
X  if test -s conftest.err; then
X    ac_cpp_err=$ac_c_preproc_warn_flag
X  else
X    ac_cpp_err=
X  fi
Xelse
X  ac_cpp_err=yes
Xfi
Xif test -z "$ac_cpp_err"; then
X  ac_header_preproc=yes
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
X  ac_header_preproc=no
Xfi
Xrm -f conftest.err conftest.$ac_ext
Xecho "$as_me:$LINENO: result: $ac_header_preproc" >&5
Xecho "${ECHO_T}$ac_header_preproc" >&6
X
X# So?  What about this header?
Xcase $ac_header_compiler:$ac_header_preproc in
X  yes:no )
X    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
Xecho "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
X    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
Xecho "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
X    (
X      cat <<\_ASBOX
X## ------------------------------------ ##
X## Report this to bug-autoconf@gnu.org. ##
X## ------------------------------------ ##
X_ASBOX
X    ) |
X      sed "s/^/$as_me: WARNING:     /" >&2
X    ;;
X  no:yes )
X    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
Xecho "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
X    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
Xecho "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
X    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
Xecho "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
X    (
X      cat <<\_ASBOX
X## ------------------------------------ ##
X## Report this to bug-autoconf@gnu.org. ##
X## ------------------------------------ ##
X_ASBOX
X    ) |
X      sed "s/^/$as_me: WARNING:     /" >&2
X    ;;
Xesac
Xecho "$as_me:$LINENO: checking for $ac_header" >&5
Xecho $ECHO_N "checking for $ac_header... $ECHO_C" >&6
Xif eval "test \"\${$as_ac_Header+set}\" = set"; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  eval "$as_ac_Header=$ac_header_preproc"
Xfi
Xecho "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
Xecho "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
X
Xfi
Xif test `eval echo '${'$as_ac_Header'}'` = yes; then
X  cat >>confdefs.h <<_ACEOF
X#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
X_ACEOF
X cat >>confdefs.h <<_ACEOF
X#define HAVE_VALUES_H 1
X_ACEOF
X
Xfi
X
Xdone
X
X
X# Check for some functions
X
Xfor ac_func in memmove
Xdo
Xas_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
Xecho "$as_me:$LINENO: checking for $ac_func" >&5
Xecho $ECHO_N "checking for $ac_func... $ECHO_C" >&6
Xif eval "test \"\${$as_ac_var+set}\" = set"; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X/* System header to define __stub macros and hopefully few prototypes,
X    which can conflict with char $ac_func (); below.
X    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
X    <limits.h> exists even on freestanding compilers.  */
X#ifdef __STDC__
X# include <limits.h>
X#else
X# include <assert.h>
X#endif
X/* Override any gcc2 internal prototype to avoid an error.  */
X#ifdef __cplusplus
Xextern "C"
X{
X#endif
X/* We use char because int might match the return type of a gcc2
X   builtin and then its argument prototype would still apply.  */
Xchar $ac_func ();
X/* The GNU C library defines this for functions which it implements
X    to always fail with ENOSYS.  Some functions are actually named
X    something starting with __ and the normal name is an alias.  */
X#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
Xchoke me
X#else
Xchar (*f) () = $ac_func;
X#endif
X#ifdef __cplusplus
X}
X#endif
X
Xint
Xmain ()
X{
Xreturn f != $ac_func;
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext conftest$ac_exeext
Xif { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
X  (eval $ac_link) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest$ac_exeext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  eval "$as_ac_var=yes"
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xeval "$as_ac_var=no"
Xfi
Xrm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
Xfi
Xecho "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
Xecho "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
Xif test `eval echo '${'$as_ac_var'}'` = yes; then
X  cat >>confdefs.h <<_ACEOF
X#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
X_ACEOF
X
Xfi
Xdone
X
X
Xif test "$os_support" = "bsd"; then
X  echo "$as_me:$LINENO: checking if dev/usb/usb.h uses new naming convention" >&5
Xecho $ECHO_N "checking if dev/usb/usb.h uses new naming convention... $ECHO_C" >&6
X  cat >conftest.$ac_ext <<_ACEOF
X#line $LINENO "configure"
X/* confdefs.h.  */
X_ACEOF
Xcat confdefs.h >>conftest.$ac_ext
Xcat >>conftest.$ac_ext <<_ACEOF
X/* end confdefs.h.  */
X#include <dev/usb/usb.h>
Xint
Xmain ()
X{
Xint main(void)
X     {
X       int a = ((struct usb_ctl_request *)0L)->ucr_addr;
X       return 0;
X     }
X  ;
X  return 0;
X}
X_ACEOF
Xrm -f conftest.$ac_objext
Xif { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
X  (eval $ac_compile) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); } &&
X         { ac_try='test -s conftest.$ac_objext'
X  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
X  (eval $ac_try) 2>&5
X  ac_status=$?
X  echo "$as_me:$LINENO: \$? = $ac_status" >&5
X  (exit $ac_status); }; }; then
X  echo "$as_me:$LINENO: result: yes" >&5
Xecho "${ECHO_T}yes" >&6
Xelse
X  echo "$as_me: failed program was:" >&5
Xsed 's/^/| /' conftest.$ac_ext >&5
X
Xecho "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
X    cat >>confdefs.h <<_ACEOF
X#define HAVE_OLD_DEV_USB_USB_H 1
X_ACEOF
X
Xfi
Xrm -f conftest.$ac_objext conftest.$ac_ext
Xfi
X
X# Check if the user wants to enable documentation
Xecho "$as_me:$LINENO: checking if we should build the documentation" >&5
Xecho $ECHO_N "checking if we should build the documentation... $ECHO_C" >&6
X# Check whether --enable-build-docs or --disable-build-docs was given.
Xif test "${enable_build_docs+set}" = set; then
X  enableval="$enable_build_docs"
X   test "$enableval" != no && build_docs=yes || build_docs=no
Xelse
X  build_docs=auto
Xfi;
Xecho "$as_me:$LINENO: result: $build_docs" >&5
Xecho "${ECHO_T}$build_docs" >&6
X
Xif test "$build_docs" != "no"; then
X  # Extract the first word of "jade", so it can be a program name with args.
Xset dummy jade; ac_word=$2
Xecho "$as_me:$LINENO: checking for $ac_word" >&5
Xecho $ECHO_N "checking for $ac_word... $ECHO_C" >&6
Xif test "${ac_cv_prog_JADE+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -n "$JADE"; then
X  ac_cv_prog_JADE="$JADE" # Let the user override the test.
Xelse
Xas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  for ac_exec_ext in '' $ac_executable_extensions; do
X  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
X    ac_cv_prog_JADE="jade"
X    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
X    break 2
X  fi
Xdone
Xdone
X
Xfi
Xfi
XJADE=$ac_cv_prog_JADE
Xif test -n "$JADE"; then
X  echo "$as_me:$LINENO: result: $JADE" >&5
Xecho "${ECHO_T}$JADE" >&6
Xelse
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X
X  if test  -z "$JADE"; then
X    # Extract the first word of "openjade", so it can be a program name with args.
Xset dummy openjade; ac_word=$2
Xecho "$as_me:$LINENO: checking for $ac_word" >&5
Xecho $ECHO_N "checking for $ac_word... $ECHO_C" >&6
Xif test "${ac_cv_prog_JADE+set}" = set; then
X  echo $ECHO_N "(cached) $ECHO_C" >&6
Xelse
X  if test -n "$JADE"; then
X  ac_cv_prog_JADE="$JADE" # Let the user override the test.
Xelse
Xas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  for ac_exec_ext in '' $ac_executable_extensions; do
X  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
X    ac_cv_prog_JADE="openjade"
X    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
X    break 2
X  fi
Xdone
Xdone
X
Xfi
Xfi
XJADE=$ac_cv_prog_JADE
Xif test -n "$JADE"; then
X  echo "$as_me:$LINENO: result: $JADE" >&5
Xecho "${ECHO_T}$JADE" >&6
Xelse
X  echo "$as_me:$LINENO: result: no" >&5
Xecho "${ECHO_T}no" >&6
Xfi
X
X  fi
Xfi
X
X
Xif test "$build_docs" != "no" -a -z "$JADE"; then
X  { echo "$as_me:$LINENO: WARNING: Documentation build components not installed. sgml docs will not be built" >&5
Xecho "$as_me: WARNING: Documentation build components not installed. sgml docs will not be built" >&2;}
X  build_docs="no"
Xfi
X
X
X
Xif test "$build_docs" != "no"; then
X  BUILD_DOCS_TRUE=
X  BUILD_DOCS_FALSE='#'
Xelse
X  BUILD_DOCS_TRUE='#'
X  BUILD_DOCS_FALSE=
Xfi
X
X
X                                                                                ac_config_files="$ac_config_files Makefile doc/Makefile libusb.spec libusb-config tests/Makefile README INSTALL.libusb usb.h"
X          ac_config_commands="$ac_config_commands default"
Xcat >confcache <<\_ACEOF
X# This file is a shell script that caches the results of configure
X# tests run on this system so they can be shared between configure
X# scripts and configure runs, see configure's option --config-cache.
X# It is not useful on other systems.  If it contains results you don't
X# want to keep, you may remove or edit it.
X#
X# config.status only pays attention to the cache file if you give it
X# the --recheck option to rerun configure.
X#
X# `ac_cv_env_foo' variables (set or unset) will be overridden when
X# loading this file, other *unset* `ac_cv_foo' will be assigned the
X# following values.
X
X_ACEOF
X
X# The following way of writing the cache mishandles newlines in values,
X# but we know of no workaround that is simple, portable, and efficient.
X# So, don't put newlines in cache variables' values.
X# Ultrix sh set writes to stderr and can't be redirected directly,
X# and sets the high bit in the cache file unless we assign to the vars.
X{
X  (set) 2>&1 |
X    case `(ac_space=' '; set | grep ac_space) 2>&1` in
X    *ac_space=\ *)
X      # `set' does not quote correctly, so add quotes (double-quote
X      # substitution turns \\\\ into \\, and sed turns \\ into \).
X      sed -n \
X        "s/'/'\\\\''/g;
X    	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
X      ;;
X    *)
X      # `set' quotes correctly as required by POSIX, so do not add quotes.
X      sed -n \
X        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
X      ;;
X    esac;
X} |
X  sed '
X     t clear
X     : clear
X     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
X     t end
X     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
X     : end' >>confcache
Xif diff $cache_file confcache >/dev/null 2>&1; then :; else
X  if test -w $cache_file; then
X    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
X    cat confcache >$cache_file
X  else
X    echo "not updating unwritable cache $cache_file"
X  fi
Xfi
Xrm -f confcache
X
Xtest "x$prefix" = xNONE && prefix=$ac_default_prefix
X# Let make expand exec_prefix.
Xtest "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
X
X# VPATH may cause trouble with some makes, so we remove $(srcdir),
X# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
X# trailing colons and then remove the whole line if VPATH becomes empty
X# (actually we leave an empty line to preserve line numbers).
Xif test "x$srcdir" = x.; then
X  ac_vpsub='/^[ 	]*VPATH[ 	]*=/{
Xs/:*\$(srcdir):*/:/;
Xs/:*\${srcdir}:*/:/;
Xs/:*@srcdir@:*/:/;
Xs/^\([^=]*=[ 	]*\):*/\1/;
Xs/:*$//;
Xs/^[^=]*=[ 	]*$//;
X}'
Xfi
X
XDEFS=-DHAVE_CONFIG_H
X
Xac_libobjs=
Xac_ltlibobjs=
Xfor ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
X  # 1. Remove the extension, and $U if already installed.
X  ac_i=`echo "$ac_i" |
X         sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
X  # 2. Add them.
X  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
X  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
Xdone
XLIBOBJS=$ac_libobjs
X
XLTLIBOBJS=$ac_ltlibobjs
X
X
Xif test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
X  { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
XUsually this means the macro was only invoked conditionally." >&5
Xecho "$as_me: error: conditional \"AMDEP\" was never defined.
XUsually this means the macro was only invoked conditionally." >&2;}
X   { (exit 1); exit 1; }; }
Xfi
Xif test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
X  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
XUsually this means the macro was only invoked conditionally." >&5
Xecho "$as_me: error: conditional \"am__fastdepCC\" was never defined.
XUsually this means the macro was only invoked conditionally." >&2;}
X   { (exit 1); exit 1; }; }
Xfi
Xif test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
X  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
XUsually this means the macro was only invoked conditionally." >&5
Xecho "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
XUsually this means the macro was only invoked conditionally." >&2;}
X   { (exit 1); exit 1; }; }
Xfi
Xif test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
X  { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
XUsually this means the macro was only invoked conditionally." >&5
Xecho "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
XUsually this means the macro was only invoked conditionally." >&2;}
X   { (exit 1); exit 1; }; }
Xfi
Xif test -z "${LINUX_API_TRUE}" && test -z "${LINUX_API_FALSE}"; then
X  { { echo "$as_me:$LINENO: error: conditional \"LINUX_API\" was never defined.
XUsually this means the macro was only invoked conditionally." >&5
Xecho "$as_me: error: conditional \"LINUX_API\" was never defined.
XUsually this means the macro was only invoked conditionally." >&2;}
X   { (exit 1); exit 1; }; }
Xfi
Xif test -z "${BSD_API_TRUE}" && test -z "${BSD_API_FALSE}"; then
X  { { echo "$as_me:$LINENO: error: conditional \"BSD_API\" was never defined.
XUsually this means the macro was only invoked conditionally." >&5
Xecho "$as_me: error: conditional \"BSD_API\" was never defined.
XUsually this means the macro was only invoked conditionally." >&2;}
X   { (exit 1); exit 1; }; }
Xfi
Xif test -z "${DARWIN_API_TRUE}" && test -z "${DARWIN_API_FALSE}"; then
X  { { echo "$as_me:$LINENO: error: conditional \"DARWIN_API\" was never defined.
XUsually this means the macro was only invoked conditionally." >&5
Xecho "$as_me: error: conditional \"DARWIN_API\" was never defined.
XUsually this means the macro was only invoked conditionally." >&2;}
X   { (exit 1); exit 1; }; }
Xfi
Xif test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
X  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
XUsually this means the macro was only invoked conditionally." >&5
Xecho "$as_me: error: conditional \"am__fastdepCC\" was never defined.
XUsually this means the macro was only invoked conditionally." >&2;}
X   { (exit 1); exit 1; }; }
Xfi
Xif test -z "${BUILD_DOCS_TRUE}" && test -z "${BUILD_DOCS_FALSE}"; then
X  { { echo "$as_me:$LINENO: error: conditional \"BUILD_DOCS\" was never defined.
XUsually this means the macro was only invoked conditionally." >&5
Xecho "$as_me: error: conditional \"BUILD_DOCS\" was never defined.
XUsually this means the macro was only invoked conditionally." >&2;}
X   { (exit 1); exit 1; }; }
Xfi
X
X: ${CONFIG_STATUS=./config.status}
Xac_clean_files_save=$ac_clean_files
Xac_clean_files="$ac_clean_files $CONFIG_STATUS"
X{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
Xecho "$as_me: creating $CONFIG_STATUS" >&6;}
Xcat >$CONFIG_STATUS <<_ACEOF
X#! $SHELL
X# Generated by $as_me.
X# Run this file to recreate the current configuration.
X# Compiler output produced by configure, useful for debugging
X# configure, is in config.log if it exists.
X
Xdebug=false
Xac_cs_recheck=false
Xac_cs_silent=false
XSHELL=\${CONFIG_SHELL-$SHELL}
X_ACEOF
X
Xcat >>$CONFIG_STATUS <<\_ACEOF
X## --------------------- ##
X## M4sh Initialization.  ##
X## --------------------- ##
X
X# Be Bourne compatible
Xif test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
X  emulate sh
X  NULLCMD=:
X  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
X  # is contrary to our usage.  Disable this feature.
X  alias -g '${1+"$@"}'='"$@"'
Xelif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
X  set -o posix
Xfi
X
X# Support unset when possible.
Xif (FOO=FOO; unset FOO) >/dev/null 2>&1; then
X  as_unset=unset
Xelse
X  as_unset=false
Xfi
X
X
X# Work around bugs in pre-3.0 UWIN ksh.
X$as_unset ENV MAIL MAILPATH
XPS1='$ '
XPS2='> '
XPS4='+ '
X
X# NLS nuisances.
Xfor as_var in \
X  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
X  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
X  LC_TELEPHONE LC_TIME
Xdo
X  if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
X    eval $as_var=C; export $as_var
X  else
X    $as_unset $as_var
X  fi
Xdone
X
X# Required to use basename.
Xif expr a : '\(a\)' >/dev/null 2>&1; then
X  as_expr=expr
Xelse
X  as_expr=false
Xfi
X
Xif (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
X  as_basename=basename
Xelse
X  as_basename=false
Xfi
X
X
X# Name of the executable.
Xas_me=`$as_basename "$0" ||
X$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X	 X"$0" : 'X\(//\)$' \| \
X	 X"$0" : 'X\(/\)$' \| \
X	 .     : '\(.\)' 2>/dev/null ||
Xecho X/"$0" |
X    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
X  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
X  	  /^X\/\(\/\).*/{ s//\1/; q; }
X  	  s/.*/./; q'`
X
X
X# PATH needs CR, and LINENO needs CR and PATH.
X# Avoid depending upon Character Ranges.
Xas_cr_letters='abcdefghijklmnopqrstuvwxyz'
Xas_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
Xas_cr_Letters=$as_cr_letters$as_cr_LETTERS
Xas_cr_digits='0123456789'
Xas_cr_alnum=$as_cr_Letters$as_cr_digits
X
X# The user is always right.
Xif test "${PATH_SEPARATOR+set}" != set; then
X  echo "#! /bin/sh" >conf$$.sh
X  echo  "exit 0"   >>conf$$.sh
X  chmod +x conf$$.sh
X  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
X    PATH_SEPARATOR=';'
X  else
X    PATH_SEPARATOR=:
X  fi
X  rm -f conf$$.sh
Xfi
X
X
X  as_lineno_1=$LINENO
X  as_lineno_2=$LINENO
X  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
X  test "x$as_lineno_1" != "x$as_lineno_2" &&
X  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
X  # Find who we are.  Look in the path if we contain no path at all
X  # relative or not.
X  case $0 in
X    *[\\/]* ) as_myself=$0 ;;
X    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in $PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
Xdone
X
X       ;;
X  esac
X  # We did not find ourselves, most probably we were run as `sh COMMAND'
X  # in which case we are not to be found in the path.
X  if test "x$as_myself" = x; then
X    as_myself=$0
X  fi
X  if test ! -f "$as_myself"; then
X    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
Xecho "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
X   { (exit 1); exit 1; }; }
X  fi
X  case $CONFIG_SHELL in
X  '')
X    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
Xfor as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
Xdo
X  IFS=$as_save_IFS
X  test -z "$as_dir" && as_dir=.
X  for as_base in sh bash ksh sh5; do
X	 case $as_dir in
X	 /*)
X	   if ("$as_dir/$as_base" -c '
X  as_lineno_1=$LINENO
X  as_lineno_2=$LINENO
X  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
X  test "x$as_lineno_1" != "x$as_lineno_2" &&
X  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
X	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
X	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
X	     CONFIG_SHELL=$as_dir/$as_base
X	     export CONFIG_SHELL
X	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
X	   fi;;
X	 esac
X       done
Xdone
X;;
X  esac
X
X  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
X  # uniformly replaced by the line number.  The first 'sed' inserts a
X  # line-number line before each line; the second 'sed' does the real
X  # work.  The second script uses 'N' to pair each line-number line
X  # with the numbered line, and appends trailing '-' during
X  # substitution so that $LINENO is not a special case at line end.
X  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
X  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
X  sed '=' <$as_myself |
X    sed '
X      N
X      s,$,-,
X      : loop
X      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
X      t loop
X      s,-$,,
X      s,^['$as_cr_digits']*\n,,
X    ' >$as_me.lineno &&
X  chmod +x $as_me.lineno ||
X    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
Xecho "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
X   { (exit 1); exit 1; }; }
X
X  # Don't try to exec as it changes $[0], causing all sort of problems
X  # (the dirname of $[0] is not the place where we might find the
X  # original and so on.  Autoconf is especially sensible to this).
X  . ./$as_me.lineno
X  # Exit status is that of the last command.
X  exit
X}
X
X
Xcase `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
X  *c*,-n*) ECHO_N= ECHO_C='
X' ECHO_T='	' ;;
X  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
X  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
Xesac
X
Xif expr a : '\(a\)' >/dev/null 2>&1; then
X  as_expr=expr
Xelse
X  as_expr=false
Xfi
X
Xrm -f conf$$ conf$$.exe conf$$.file
Xecho >conf$$.file
Xif ln -s conf$$.file conf$$ 2>/dev/null; then
X  # We could just check for DJGPP; but this test a) works b) is more generic
X  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
X  if test -f conf$$.exe; then
X    # Don't use ln at all; we don't have any links
X    as_ln_s='cp -p'
X  else
X    as_ln_s='ln -s'
X  fi
Xelif ln conf$$.file conf$$ 2>/dev/null; then
X  as_ln_s=ln
Xelse
X  as_ln_s='cp -p'
Xfi
Xrm -f conf$$ conf$$.exe conf$$.file
X
Xif mkdir -p . 2>/dev/null; then
X  as_mkdir_p=:
Xelse
X  as_mkdir_p=false
Xfi
X
Xas_executable_p="test -f"
X
X# Sed expression to map a string onto a valid CPP name.
Xas_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
X
X# Sed expression to map a string onto a valid variable name.
Xas_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
X
X
X# IFS
X# We need space, tab and new line, in precisely that order.
Xas_nl='
X'
XIFS=" 	$as_nl"
X
X# CDPATH.
X$as_unset CDPATH
X
Xexec 6>&1
X
X# Open the log real soon, to keep \$[0] and so on meaningful, and to
X# report actual input values of CONFIG_FILES etc. instead of their
X# values after options handling.  Logging --version etc. is OK.
Xexec 5>>config.log
X{
X  echo
X  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
X## Running $as_me. ##
X_ASBOX
X} >&5
Xcat >&5 <<_CSEOF
X
XThis file was extended by $as_me, which was
Xgenerated by GNU Autoconf 2.57.  Invocation command line was
X
X  CONFIG_FILES    = $CONFIG_FILES
X  CONFIG_HEADERS  = $CONFIG_HEADERS
X  CONFIG_LINKS    = $CONFIG_LINKS
X  CONFIG_COMMANDS = $CONFIG_COMMANDS
X  $ $0 $@
X
X_CSEOF
Xecho "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
Xecho >&5
X_ACEOF
X
X# Files that config.status was made for.
Xif test -n "$ac_config_files"; then
X  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
Xfi
X
Xif test -n "$ac_config_headers"; then
X  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
Xfi
X
Xif test -n "$ac_config_links"; then
X  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
Xfi
X
Xif test -n "$ac_config_commands"; then
X  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
Xfi
X
Xcat >>$CONFIG_STATUS <<\_ACEOF
X
Xac_cs_usage="\
X\`$as_me' instantiates files from templates according to the
Xcurrent configuration.
X
XUsage: $0 [OPTIONS] [FILE]...
X
X  -h, --help       print this help, then exit
X  -V, --version    print version number, then exit
X  -q, --quiet      do not print progress messages
X  -d, --debug      don't remove temporary files
X      --recheck    update $as_me by reconfiguring in the same conditions
X  --file=FILE[:TEMPLATE]
X                   instantiate the configuration file FILE
X  --header=FILE[:TEMPLATE]
X                   instantiate the configuration header FILE
X
XConfiguration files:
X$config_files
X
XConfiguration headers:
X$config_headers
X
XConfiguration commands:
X$config_commands
X
XReport bugs to <bug-autoconf@gnu.org>."
X_ACEOF
X
Xcat >>$CONFIG_STATUS <<_ACEOF
Xac_cs_version="\\
Xconfig.status
Xconfigured by $0, generated by GNU Autoconf 2.57,
X  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
X
XCopyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
XFree Software Foundation, Inc.
XThis config.status script is free software; the Free Software Foundation
Xgives unlimited permission to copy, distribute and modify it."
Xsrcdir=$srcdir
XINSTALL="$INSTALL"
X_ACEOF
X
Xcat >>$CONFIG_STATUS <<\_ACEOF
X# If no file are specified by the user, then we need to provide default
X# value.  By we need to know if files were specified by the user.
Xac_need_defaults=:
Xwhile test $# != 0
Xdo
X  case $1 in
X  --*=*)
X    ac_option=`expr "x$1" : 'x\([^=]*\)='`
X    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
X    ac_shift=:
X    ;;
X  -*)
X    ac_option=$1
X    ac_optarg=$2
X    ac_shift=shift
X    ;;
X  *) # This is not an option, so the user has probably given explicit
X     # arguments.
X     ac_option=$1
X     ac_need_defaults=false;;
X  esac
X
X  case $ac_option in
X  # Handling of the options.
X_ACEOF
Xcat >>$CONFIG_STATUS <<\_ACEOF
X  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
X    ac_cs_recheck=: ;;
X  --version | --vers* | -V )
X    echo "$ac_cs_version"; exit 0 ;;
X  --he | --h)
X    # Conflict between --help and --header
X    { { echo "$as_me:$LINENO: error: ambiguous option: $1
XTry \`$0 --help' for more information." >&5
Xecho "$as_me: error: ambiguous option: $1
XTry \`$0 --help' for more information." >&2;}
X   { (exit 1); exit 1; }; };;
X  --help | --hel | -h )
X    echo "$ac_cs_usage"; exit 0 ;;
X  --debug | --d* | -d )
X    debug=: ;;
X  --file | --fil | --fi | --f )
X    $ac_shift
X    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
X    ac_need_defaults=false;;
X  --header | --heade | --head | --hea )
X    $ac_shift
X    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
X    ac_need_defaults=false;;
X  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
X  | -silent | --silent | --silen | --sile | --sil | --si | --s)
X    ac_cs_silent=: ;;
X
X  # This is an error.
X  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
XTry \`$0 --help' for more information." >&5
Xecho "$as_me: error: unrecognized option: $1
XTry \`$0 --help' for more information." >&2;}
X   { (exit 1); exit 1; }; } ;;
X
X  *) ac_config_targets="$ac_config_targets $1" ;;
X
X  esac
X  shift
Xdone
X
Xac_configure_extra_args=
X
Xif $ac_cs_silent; then
X  exec 6>/dev/null
X  ac_configure_extra_args="$ac_configure_extra_args --silent"
Xfi
X
X_ACEOF
Xcat >>$CONFIG_STATUS <<_ACEOF
Xif \$ac_cs_recheck; then
X  echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
X  exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
Xfi
X
X_ACEOF
X
Xcat >>$CONFIG_STATUS <<_ACEOF
X#
X# INIT-COMMANDS section.
X#
X
XAMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
X
X_ACEOF
X
X
X
Xcat >>$CONFIG_STATUS <<\_ACEOF
Xfor ac_config_target in $ac_config_targets
Xdo
X  case "$ac_config_target" in
X  # Handling of arguments.
X  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
X  "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
X  "libusb.spec" ) CONFIG_FILES="$CONFIG_FILES libusb.spec" ;;
X  "libusb-config" ) CONFIG_FILES="$CONFIG_FILES libusb-config" ;;
X  "tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
X  "README" ) CONFIG_FILES="$CONFIG_FILES README" ;;
X  "INSTALL.libusb" ) CONFIG_FILES="$CONFIG_FILES INSTALL.libusb" ;;
X  "usb.h" ) CONFIG_FILES="$CONFIG_FILES usb.h" ;;
X  "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
X  "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
X  "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
X  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
Xecho "$as_me: error: invalid argument: $ac_config_target" >&2;}
X   { (exit 1); exit 1; }; };;
X  esac
Xdone
X
X# If the user did not use the arguments to specify the items to instantiate,
X# then the envvar interface is used.  Set only those that are not.
X# We use the long form for the default assignment because of an extremely
X# bizarre bug on SunOS 4.1.3.
Xif $ac_need_defaults; then
X  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
X  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
X  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
Xfi
X
X# Have a temporary directory for convenience.  Make it in the build tree
X# simply because there is no reason to put it here, and in addition,
X# creating and moving files from /tmp can sometimes cause problems.
X# Create a temporary directory, and hook for its removal unless debugging.
X$debug ||
X{
X  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
X  trap '{ (exit 1); exit 1; }' 1 2 13 15
X}
X
X# Create a (secure) tmp directory for tmp files.
X
X{
X  tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
X  test -n "$tmp" && test -d "$tmp"
X}  ||
X{
X  tmp=./confstat$$-$RANDOM
X  (umask 077 && mkdir $tmp)
X} ||
X{
X   echo "$me: cannot create a temporary directory in ." >&2
X   { (exit 1); exit 1; }
X}
X
X_ACEOF
X
Xcat >>$CONFIG_STATUS <<_ACEOF
X
X#
X# CONFIG_FILES section.
X#
X
X# No need to generate the scripts if there are no CONFIG_FILES.
X# This happens for instance when ./config.status config.h
Xif test -n "\$CONFIG_FILES"; then
X  # Protect against being on the right side of a sed subst in config.status.
X  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
X   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
Xs,@SHELL@,$SHELL,;t t
Xs,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
Xs,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
Xs,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
Xs,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
Xs,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
Xs,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
Xs,@exec_prefix@,$exec_prefix,;t t
Xs,@prefix@,$prefix,;t t
Xs,@program_transform_name@,$program_transform_name,;t t
Xs,@bindir@,$bindir,;t t
Xs,@sbindir@,$sbindir,;t t
Xs,@libexecdir@,$libexecdir,;t t
Xs,@datadir@,$datadir,;t t
Xs,@sysconfdir@,$sysconfdir,;t t
Xs,@sharedstatedir@,$sharedstatedir,;t t
Xs,@localstatedir@,$localstatedir,;t t
Xs,@libdir@,$libdir,;t t
Xs,@includedir@,$includedir,;t t
Xs,@oldincludedir@,$oldincludedir,;t t
Xs,@infodir@,$infodir,;t t
Xs,@mandir@,$mandir,;t t
Xs,@build_alias@,$build_alias,;t t
Xs,@host_alias@,$host_alias,;t t
Xs,@target_alias@,$target_alias,;t t
Xs,@DEFS@,$DEFS,;t t
Xs,@ECHO_C@,$ECHO_C,;t t
Xs,@ECHO_N@,$ECHO_N,;t t
Xs,@ECHO_T@,$ECHO_T,;t t
Xs,@LIBS@,$LIBS,;t t
Xs,@LIBUSB_MAJOR_VERSION@,$LIBUSB_MAJOR_VERSION,;t t
Xs,@LIBUSB_MINOR_VERSION@,$LIBUSB_MINOR_VERSION,;t t
Xs,@LIBUSB_MICRO_VERSION@,$LIBUSB_MICRO_VERSION,;t t
Xs,@LIBUSB_VERSION@,$LIBUSB_VERSION,;t t
Xs,@LIBUSB_INTERFACE_AGE@,$LIBUSB_INTERFACE_AGE,;t t
Xs,@LIBUSB_BINARY_AGE@,$LIBUSB_BINARY_AGE,;t t
Xs,@LT_RELEASE@,$LT_RELEASE,;t t
Xs,@LT_CURRENT@,$LT_CURRENT,;t t
Xs,@LT_REVISION@,$LT_REVISION,;t t
Xs,@LT_AGE@,$LT_AGE,;t t
Xs,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
Xs,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
Xs,@INSTALL_DATA@,$INSTALL_DATA,;t t
Xs,@CYGPATH_W@,$CYGPATH_W,;t t
Xs,@PACKAGE@,$PACKAGE,;t t
Xs,@VERSION@,$VERSION,;t t
Xs,@ACLOCAL@,$ACLOCAL,;t t
Xs,@AUTOCONF@,$AUTOCONF,;t t
Xs,@AUTOMAKE@,$AUTOMAKE,;t t
Xs,@AUTOHEADER@,$AUTOHEADER,;t t
Xs,@MAKEINFO@,$MAKEINFO,;t t
Xs,@AMTAR@,$AMTAR,;t t
Xs,@install_sh@,$install_sh,;t t
Xs,@STRIP@,$STRIP,;t t
Xs,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
Xs,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
Xs,@AWK@,$AWK,;t t
Xs,@SET_MAKE@,$SET_MAKE,;t t
Xs,@am__leading_dot@,$am__leading_dot,;t t
Xs,@build@,$build,;t t
Xs,@build_cpu@,$build_cpu,;t t
Xs,@build_vendor@,$build_vendor,;t t
Xs,@build_os@,$build_os,;t t
Xs,@host@,$host,;t t
Xs,@host_cpu@,$host_cpu,;t t
Xs,@host_vendor@,$host_vendor,;t t
Xs,@host_os@,$host_os,;t t
Xs,@CC@,$CC,;t t
Xs,@CFLAGS@,$CFLAGS,;t t
Xs,@LDFLAGS@,$LDFLAGS,;t t
Xs,@CPPFLAGS@,$CPPFLAGS,;t t
Xs,@ac_ct_CC@,$ac_ct_CC,;t t
Xs,@EXEEXT@,$EXEEXT,;t t
Xs,@OBJEXT@,$OBJEXT,;t t
Xs,@DEPDIR@,$DEPDIR,;t t
Xs,@am__include@,$am__include,;t t
Xs,@am__quote@,$am__quote,;t t
Xs,@AMDEP_TRUE@,$AMDEP_TRUE,;t t
Xs,@AMDEP_FALSE@,$AMDEP_FALSE,;t t
Xs,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
Xs,@CCDEPMODE@,$CCDEPMODE,;t t
Xs,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
Xs,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
Xs,@EGREP@,$EGREP,;t t
Xs,@LN_S@,$LN_S,;t t
Xs,@ECHO@,$ECHO,;t t
Xs,@AR@,$AR,;t t
Xs,@ac_ct_AR@,$ac_ct_AR,;t t
Xs,@RANLIB@,$RANLIB,;t t
Xs,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
Xs,@CPP@,$CPP,;t t
Xs,@CXX@,$CXX,;t t
Xs,@CXXFLAGS@,$CXXFLAGS,;t t
Xs,@ac_ct_CXX@,$ac_ct_CXX,;t t
Xs,@CXXDEPMODE@,$CXXDEPMODE,;t t
Xs,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t
Xs,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t
Xs,@CXXCPP@,$CXXCPP,;t t
Xs,@F77@,$F77,;t t
Xs,@FFLAGS@,$FFLAGS,;t t
Xs,@ac_ct_F77@,$ac_ct_F77,;t t
Xs,@LIBTOOL@,$LIBTOOL,;t t
Xs,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t
Xs,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t
Xs,@MAINT@,$MAINT,;t t
Xs,@DARWIN_API@,$DARWIN_API,;t t
Xs,@LINUX_API@,$LINUX_API,;t t
Xs,@BSD_API@,$BSD_API,;t t
Xs,@LINUX_API_TRUE@,$LINUX_API_TRUE,;t t
Xs,@LINUX_API_FALSE@,$LINUX_API_FALSE,;t t
Xs,@BSD_API_TRUE@,$BSD_API_TRUE,;t t
Xs,@BSD_API_FALSE@,$BSD_API_FALSE,;t t
Xs,@DARWIN_API_TRUE@,$DARWIN_API_TRUE,;t t
Xs,@DARWIN_API_FALSE@,$DARWIN_API_FALSE,;t t
Xs,@OSLIBS@,$OSLIBS,;t t
Xs,@BIGENDIAN@,$BIGENDIAN,;t t
Xs,@JADE@,$JADE,;t t
Xs,@BUILD_DOCS_TRUE@,$BUILD_DOCS_TRUE,;t t
Xs,@BUILD_DOCS_FALSE@,$BUILD_DOCS_FALSE,;t t
Xs,@LIBOBJS@,$LIBOBJS,;t t
Xs,@LTLIBOBJS@,$LTLIBOBJS,;t t
XCEOF
X
X_ACEOF
X
X  cat >>$CONFIG_STATUS <<\_ACEOF
X  # Split the substitutions into bite-sized pieces for seds with
X  # small command number limits, like on Digital OSF/1 and HP-UX.
X  ac_max_sed_lines=48
X  ac_sed_frag=1 # Number of current file.
X  ac_beg=1 # First line for current file.
X  ac_end=$ac_max_sed_lines # Line after last line for current file.
X  ac_more_lines=:
X  ac_sed_cmds=
X  while $ac_more_lines; do
X    if test $ac_beg -gt 1; then
X      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
X    else
X      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
X    fi
X    if test ! -s $tmp/subs.frag; then
X      ac_more_lines=false
X    else
X      # The purpose of the label and of the branching condition is to
X      # speed up the sed processing (if there are no `@' at all, there
X      # is no need to browse any of the substitutions).
X      # These are the two extra sed commands mentioned above.
X      (echo ':t
X  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
X      if test -z "$ac_sed_cmds"; then
X  	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
X      else
X  	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
X      fi
X      ac_sed_frag=`expr $ac_sed_frag + 1`
X      ac_beg=$ac_end
X      ac_end=`expr $ac_end + $ac_max_sed_lines`
X    fi
X  done
X  if test -z "$ac_sed_cmds"; then
X    ac_sed_cmds=cat
X  fi
Xfi # test -n "$CONFIG_FILES"
X
X_ACEOF
Xcat >>$CONFIG_STATUS <<\_ACEOF
Xfor ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
X  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
X  case $ac_file in
X  - | *:- | *:-:* ) # input from stdin
X        cat >$tmp/stdin
X        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
X        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
X  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
X        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
X  * )   ac_file_in=$ac_file.in ;;
X  esac
X
X  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
X  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
X$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X         X"$ac_file" : 'X\(//\)[^/]' \| \
X         X"$ac_file" : 'X\(//\)$' \| \
X         X"$ac_file" : 'X\(/\)' \| \
X         .     : '\(.\)' 2>/dev/null ||
Xecho X"$ac_file" |
X    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
X  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
X  	  /^X\(\/\/\)$/{ s//\1/; q; }
X  	  /^X\(\/\).*/{ s//\1/; q; }
X  	  s/.*/./; q'`
X  { if $as_mkdir_p; then
X    mkdir -p "$ac_dir"
X  else
X    as_dir="$ac_dir"
X    as_dirs=
X    while test ! -d "$as_dir"; do
X      as_dirs="$as_dir $as_dirs"
X      as_dir=`(dirname "$as_dir") 2>/dev/null ||
X$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X         X"$as_dir" : 'X\(//\)[^/]' \| \
X         X"$as_dir" : 'X\(//\)$' \| \
X         X"$as_dir" : 'X\(/\)' \| \
X         .     : '\(.\)' 2>/dev/null ||
Xecho X"$as_dir" |
X    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
X  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
X  	  /^X\(\/\/\)$/{ s//\1/; q; }
X  	  /^X\(\/\).*/{ s//\1/; q; }
X  	  s/.*/./; q'`
X    done
X    test ! -n "$as_dirs" || mkdir $as_dirs
X  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
Xecho "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
X   { (exit 1); exit 1; }; }; }
X
X  ac_builddir=.
X
Xif test "$ac_dir" != .; then
X  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
X  # A "../" for each directory in $ac_dir_suffix.
X  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
Xelse
X  ac_dir_suffix= ac_top_builddir=
Xfi
X
Xcase $srcdir in
X  .)  # No --srcdir option.  We are building in place.
X    ac_srcdir=.
X    if test -z "$ac_top_builddir"; then
X       ac_top_srcdir=.
X    else
X       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
X    fi ;;
X  [\\/]* | ?:[\\/]* )  # Absolute path.
X    ac_srcdir=$srcdir$ac_dir_suffix;
X    ac_top_srcdir=$srcdir ;;
X  *) # Relative path.
X    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
X    ac_top_srcdir=$ac_top_builddir$srcdir ;;
Xesac
X# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
X# absolute.
Xac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
Xac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
Xac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
Xac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
X
X
X  case $INSTALL in
X  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
X  *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
X  esac
X
X  if test x"$ac_file" != x-; then
X    { echo "$as_me:$LINENO: creating $ac_file" >&5
Xecho "$as_me: creating $ac_file" >&6;}
X    rm -f "$ac_file"
X  fi
X  # Let's still pretend it is `configure' which instantiates (i.e., don't
X  # use $as_me), people would be surprised to read:
X  #    /* config.h.  Generated by config.status.  */
X  if test x"$ac_file" = x-; then
X    configure_input=
X  else
X    configure_input="$ac_file.  "
X  fi
X  configure_input=$configure_input"Generated from `echo $ac_file_in |
X                                     sed 's,.*/,,'` by configure."
X
X  # First look for the input files in the build tree, otherwise in the
X  # src tree.
X  ac_file_inputs=`IFS=:
X    for f in $ac_file_in; do
X      case $f in
X      -) echo $tmp/stdin ;;
X      [\\/$]*)
X         # Absolute (can't be DOS-style, as IFS=:)
X         test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
Xecho "$as_me: error: cannot find input file: $f" >&2;}
X   { (exit 1); exit 1; }; }
X         echo $f;;
X      *) # Relative
X         if test -f "$f"; then
X           # Build tree
X           echo $f
X         elif test -f "$srcdir/$f"; then
X           # Source tree
X           echo $srcdir/$f
X         else
X           # /dev/null tree
X           { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
Xecho "$as_me: error: cannot find input file: $f" >&2;}
X   { (exit 1); exit 1; }; }
X         fi;;
X      esac
X    done` || { (exit 1); exit 1; }
X_ACEOF
Xcat >>$CONFIG_STATUS <<_ACEOF
X  sed "$ac_vpsub
X$extrasub
X_ACEOF
Xcat >>$CONFIG_STATUS <<\_ACEOF
X:t
X/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
Xs,@configure_input@,$configure_input,;t t
Xs,@srcdir@,$ac_srcdir,;t t
Xs,@abs_srcdir@,$ac_abs_srcdir,;t t
Xs,@top_srcdir@,$ac_top_srcdir,;t t
Xs,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
Xs,@builddir@,$ac_builddir,;t t
Xs,@abs_builddir@,$ac_abs_builddir,;t t
Xs,@top_builddir@,$ac_top_builddir,;t t
Xs,@abs_top_builddir@,$ac_abs_top_builddir,;t t
Xs,@INSTALL@,$ac_INSTALL,;t t
X" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
X  rm -f $tmp/stdin
X  if test x"$ac_file" != x-; then
X    mv $tmp/out $ac_file
X  else
X    cat $tmp/out
X    rm -f $tmp/out
X  fi
X
Xdone
X_ACEOF
Xcat >>$CONFIG_STATUS <<\_ACEOF
X
X#
X# CONFIG_HEADER section.
X#
X
X# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
X# NAME is the cpp macro being defined and VALUE is the value it is being given.
X#
X# ac_d sets the value in "#define NAME VALUE" lines.
Xac_dA='s,^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
Xac_dB='[ 	].*$,\1#\2'
Xac_dC=' '
Xac_dD=',;t'
X# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
Xac_uA='s,^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
Xac_uB='$,\1#\2define\3'
Xac_uC=' '
Xac_uD=',;t'
X
Xfor ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
X  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
X  case $ac_file in
X  - | *:- | *:-:* ) # input from stdin
X        cat >$tmp/stdin
X        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
X        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
X  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
X        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
X  * )   ac_file_in=$ac_file.in ;;
X  esac
X
X  test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
Xecho "$as_me: creating $ac_file" >&6;}
X
X  # First look for the input files in the build tree, otherwise in the
X  # src tree.
X  ac_file_inputs=`IFS=:
X    for f in $ac_file_in; do
X      case $f in
X      -) echo $tmp/stdin ;;
X      [\\/$]*)
X         # Absolute (can't be DOS-style, as IFS=:)
X         test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
Xecho "$as_me: error: cannot find input file: $f" >&2;}
X   { (exit 1); exit 1; }; }
X         echo $f;;
X      *) # Relative
X         if test -f "$f"; then
X           # Build tree
X           echo $f
X         elif test -f "$srcdir/$f"; then
X           # Source tree
X           echo $srcdir/$f
X         else
X           # /dev/null tree
X           { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
Xecho "$as_me: error: cannot find input file: $f" >&2;}
X   { (exit 1); exit 1; }; }
X         fi;;
X      esac
X    done` || { (exit 1); exit 1; }
X  # Remove the trailing spaces.
X  sed 's/[ 	]*$//' $ac_file_inputs >$tmp/in
X
X_ACEOF
X
X# Transform confdefs.h into two sed scripts, `conftest.defines' and
X# `conftest.undefs', that substitutes the proper values into
X# config.h.in to produce config.h.  The first handles `#define'
X# templates, and the second `#undef' templates.
X# And first: Protect against being on the right side of a sed subst in
X# config.status.  Protect against being in an unquoted here document
X# in config.status.
Xrm -f conftest.defines conftest.undefs
X# Using a here document instead of a string reduces the quoting nightmare.
X# Putting comments in sed scripts is not portable.
X#
X# `end' is used to avoid that the second main sed command (meant for
X# 0-ary CPP macros) applies to n-ary macro definitions.
X# See the Autoconf documentation for `clear'.
Xcat >confdef2sed.sed <<\_ACEOF
Xs/[\\&,]/\\&/g
Xs,[\\$`],\\&,g
Xt clear
X: clear
Xs,^[ 	]*#[ 	]*define[ 	][ 	]*\([^ 	(][^ 	(]*\)\(([^)]*)\)[ 	]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
Xt end
Xs,^[ 	]*#[ 	]*define[ 	][ 	]*\([^ 	][^ 	]*\)[ 	]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
X: end
X_ACEOF
X# If some macros were called several times there might be several times
X# the same #defines, which is useless.  Nevertheless, we may not want to
X# sort them, since we want the *last* AC-DEFINE to be honored.
Xuniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
Xsed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
Xrm -f confdef2sed.sed
X
X# This sed command replaces #undef with comments.  This is necessary, for
X# example, in the case of _POSIX_SOURCE, which is predefined and required
X# on some systems where configure will not decide to define it.
Xcat >>conftest.undefs <<\_ACEOF
Xs,^[ 	]*#[ 	]*undef[ 	][ 	]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
X_ACEOF
X
X# Break up conftest.defines because some shells have a limit on the size
X# of here documents, and old seds have small limits too (100 cmds).
Xecho '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
Xecho '  if grep "^[ 	]*#[ 	]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
Xecho '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
Xecho '  :' >>$CONFIG_STATUS
Xrm -f conftest.tail
Xwhile grep . conftest.defines >/dev/null
Xdo
X  # Write a limited-size here document to $tmp/defines.sed.
X  echo '  cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
X  # Speed up: don't consider the non `#define' lines.
X  echo '/^[ 	]*#[ 	]*define/!b' >>$CONFIG_STATUS
X  # Work around the forget-to-reset-the-flag bug.
X  echo 't clr' >>$CONFIG_STATUS
X  echo ': clr' >>$CONFIG_STATUS
X  sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
X  echo 'CEOF
X  sed -f $tmp/defines.sed $tmp/in >$tmp/out
X  rm -f $tmp/in
X  mv $tmp/out $tmp/in
X' >>$CONFIG_STATUS
X  sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
X  rm -f conftest.defines
X  mv conftest.tail conftest.defines
Xdone
Xrm -f conftest.defines
Xecho '  fi # grep' >>$CONFIG_STATUS
Xecho >>$CONFIG_STATUS
X
X# Break up conftest.undefs because some shells have a limit on the size
X# of here documents, and old seds have small limits too (100 cmds).
Xecho '  # Handle all the #undef templates' >>$CONFIG_STATUS
Xrm -f conftest.tail
Xwhile grep . conftest.undefs >/dev/null
Xdo
X  # Write a limited-size here document to $tmp/undefs.sed.
X  echo '  cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
X  # Speed up: don't consider the non `#undef'
X  echo '/^[ 	]*#[ 	]*undef/!b' >>$CONFIG_STATUS
X  # Work around the forget-to-reset-the-flag bug.
X  echo 't clr' >>$CONFIG_STATUS
X  echo ': clr' >>$CONFIG_STATUS
X  sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
X  echo 'CEOF
X  sed -f $tmp/undefs.sed $tmp/in >$tmp/out
X  rm -f $tmp/in
X  mv $tmp/out $tmp/in
X' >>$CONFIG_STATUS
X  sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
X  rm -f conftest.undefs
X  mv conftest.tail conftest.undefs
Xdone
Xrm -f conftest.undefs
X
Xcat >>$CONFIG_STATUS <<\_ACEOF
X  # Let's still pretend it is `configure' which instantiates (i.e., don't
X  # use $as_me), people would be surprised to read:
X  #    /* config.h.  Generated by config.status.  */
X  if test x"$ac_file" = x-; then
X    echo "/* Generated by configure.  */" >$tmp/config.h
X  else
X    echo "/* $ac_file.  Generated by configure.  */" >$tmp/config.h
X  fi
X  cat $tmp/in >>$tmp/config.h
X  rm -f $tmp/in
X  if test x"$ac_file" != x-; then
X    if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
X      { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
Xecho "$as_me: $ac_file is unchanged" >&6;}
X    else
X      ac_dir=`(dirname "$ac_file") 2>/dev/null ||
X$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X         X"$ac_file" : 'X\(//\)[^/]' \| \
X         X"$ac_file" : 'X\(//\)$' \| \
X         X"$ac_file" : 'X\(/\)' \| \
X         .     : '\(.\)' 2>/dev/null ||
Xecho X"$ac_file" |
X    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
X  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
X  	  /^X\(\/\/\)$/{ s//\1/; q; }
X  	  /^X\(\/\).*/{ s//\1/; q; }
X  	  s/.*/./; q'`
X      { if $as_mkdir_p; then
X    mkdir -p "$ac_dir"
X  else
X    as_dir="$ac_dir"
X    as_dirs=
X    while test ! -d "$as_dir"; do
X      as_dirs="$as_dir $as_dirs"
X      as_dir=`(dirname "$as_dir") 2>/dev/null ||
X$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X         X"$as_dir" : 'X\(//\)[^/]' \| \
X         X"$as_dir" : 'X\(//\)$' \| \
X         X"$as_dir" : 'X\(/\)' \| \
X         .     : '\(.\)' 2>/dev/null ||
Xecho X"$as_dir" |
X    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
X  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
X  	  /^X\(\/\/\)$/{ s//\1/; q; }
X  	  /^X\(\/\).*/{ s//\1/; q; }
X  	  s/.*/./; q'`
X    done
X    test ! -n "$as_dirs" || mkdir $as_dirs
X  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
Xecho "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
X   { (exit 1); exit 1; }; }; }
X
X      rm -f $ac_file
X      mv $tmp/config.h $ac_file
X    fi
X  else
X    cat $tmp/config.h
X    rm -f $tmp/config.h
X  fi
X# Compute $ac_file's index in $config_headers.
X_am_stamp_count=1
Xfor _am_header in $config_headers :; do
X  case $_am_header in
X    $ac_file | $ac_file:* )
X      break ;;
X    * )
X      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
X  esac
Xdone
Xecho "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
X$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X         X$ac_file : 'X\(//\)[^/]' \| \
X         X$ac_file : 'X\(//\)$' \| \
X         X$ac_file : 'X\(/\)' \| \
X         .     : '\(.\)' 2>/dev/null ||
Xecho X$ac_file |
X    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
X  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
X  	  /^X\(\/\/\)$/{ s//\1/; q; }
X  	  /^X\(\/\).*/{ s//\1/; q; }
X  	  s/.*/./; q'`/stamp-h$_am_stamp_count
Xdone
X_ACEOF
Xcat >>$CONFIG_STATUS <<\_ACEOF
X
X#
X# CONFIG_COMMANDS section.
X#
Xfor ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
X  ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
X  ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
X  ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
X$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X         X"$ac_dest" : 'X\(//\)[^/]' \| \
X         X"$ac_dest" : 'X\(//\)$' \| \
X         X"$ac_dest" : 'X\(/\)' \| \
X         .     : '\(.\)' 2>/dev/null ||
Xecho X"$ac_dest" |
X    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
X  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
X  	  /^X\(\/\/\)$/{ s//\1/; q; }
X  	  /^X\(\/\).*/{ s//\1/; q; }
X  	  s/.*/./; q'`
X  ac_builddir=.
X
Xif test "$ac_dir" != .; then
X  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
X  # A "../" for each directory in $ac_dir_suffix.
X  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
Xelse
X  ac_dir_suffix= ac_top_builddir=
Xfi
X
Xcase $srcdir in
X  .)  # No --srcdir option.  We are building in place.
X    ac_srcdir=.
X    if test -z "$ac_top_builddir"; then
X       ac_top_srcdir=.
X    else
X       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
X    fi ;;
X  [\\/]* | ?:[\\/]* )  # Absolute path.
X    ac_srcdir=$srcdir$ac_dir_suffix;
X    ac_top_srcdir=$srcdir ;;
X  *) # Relative path.
X    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
X    ac_top_srcdir=$ac_top_builddir$srcdir ;;
Xesac
X# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
X# absolute.
Xac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
Xac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
Xac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
Xac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
X
X
X  { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
Xecho "$as_me: executing $ac_dest commands" >&6;}
X  case $ac_dest in
X    depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
X  # Strip MF so we end up with the name of the file.
X  mf=`echo "$mf" | sed -e 's/:.*$//'`
X  # Check whether this is an Automake generated Makefile or not.
X  # We used to match only the files named `Makefile.in', but
X  # some people rename them; so instead we look at the file content.
X  # Grep'ing the first line is not enough: some people post-process
X  # each Makefile.in and add a new line on top of each file to say so.
X  # So let's grep whole file.
X  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
X    dirpart=`(dirname "$mf") 2>/dev/null ||
X$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X         X"$mf" : 'X\(//\)[^/]' \| \
X         X"$mf" : 'X\(//\)$' \| \
X         X"$mf" : 'X\(/\)' \| \
X         .     : '\(.\)' 2>/dev/null ||
Xecho X"$mf" |
X    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
X  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
X  	  /^X\(\/\/\)$/{ s//\1/; q; }
X  	  /^X\(\/\).*/{ s//\1/; q; }
X  	  s/.*/./; q'`
X  else
X    continue
X  fi
X  grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
X  # Extract the definition of DEP_FILES from the Makefile without
X  # running `make'.
X  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
X  test -z "$DEPDIR" && continue
X  # When using ansi2knr, U may be empty or an underscore; expand it
X  U=`sed -n -e '/^U = / s///p' < "$mf"`
X  test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
X  # We invoke sed twice because it is the simplest approach to
X  # changing $(DEPDIR) to its actual value in the expansion.
X  for file in `sed -n -e '
X    /^DEP_FILES = .*\\\\$/ {
X      s/^DEP_FILES = //
X      :loop
X	s/\\\\$//
X	p
X	n
X	/\\\\$/ b loop
X      p
X    }
X    /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
X       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
X    # Make sure the directory exists.
X    test -f "$dirpart/$file" && continue
X    fdir=`(dirname "$file") 2>/dev/null ||
X$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X         X"$file" : 'X\(//\)[^/]' \| \
X         X"$file" : 'X\(//\)$' \| \
X         X"$file" : 'X\(/\)' \| \
X         .     : '\(.\)' 2>/dev/null ||
Xecho X"$file" |
X    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
X  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
X  	  /^X\(\/\/\)$/{ s//\1/; q; }
X  	  /^X\(\/\).*/{ s//\1/; q; }
X  	  s/.*/./; q'`
X    { if $as_mkdir_p; then
X    mkdir -p $dirpart/$fdir
X  else
X    as_dir=$dirpart/$fdir
X    as_dirs=
X    while test ! -d "$as_dir"; do
X      as_dirs="$as_dir $as_dirs"
X      as_dir=`(dirname "$as_dir") 2>/dev/null ||
X$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X         X"$as_dir" : 'X\(//\)[^/]' \| \
X         X"$as_dir" : 'X\(//\)$' \| \
X         X"$as_dir" : 'X\(/\)' \| \
X         .     : '\(.\)' 2>/dev/null ||
Xecho X"$as_dir" |
X    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
X  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
X  	  /^X\(\/\/\)$/{ s//\1/; q; }
X  	  /^X\(\/\).*/{ s//\1/; q; }
X  	  s/.*/./; q'`
X    done
X    test ! -n "$as_dirs" || mkdir $as_dirs
X  fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
Xecho "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
X   { (exit 1); exit 1; }; }; }
X
X    # echo "creating $dirpart/$file"
X    echo '# dummy' > "$dirpart/$file"
X  done
Xdone
X ;;
X    default ) chmod +x libusb-config ;;
X  esac
Xdone
X_ACEOF
X
Xcat >>$CONFIG_STATUS <<\_ACEOF
X
X{ (exit 0); exit 0; }
X_ACEOF
Xchmod +x $CONFIG_STATUS
Xac_clean_files=$ac_clean_files_save
X
X
X# configure is writing to config.log, and then calls config.status.
X# config.status does its own redirection, appending to config.log.
X# Unfortunately, on DOS this fails, as config.log is still kept open
X# by configure, so config.status won't be able to write to it; its
X# output is simply discarded.  So we exec the FD to /dev/null,
X# effectively closing config.log, so it can be properly (re)opened and
X# appended to by config.status.  When coming back to configure, we
X# need to make the FD available again.
Xif test "$no_create" != yes; then
X  ac_cs_success=:
X  ac_config_status_args=
X  test "$silent" = yes &&
X    ac_config_status_args="$ac_config_status_args --quiet"
X  exec 5>/dev/null
X  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
X  exec 5>>config.log
X  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
X  # would make configure fail if this is the last instruction.
X  $ac_cs_success || { (exit 1); exit 1; }
Xfi
X
X
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/configure' 'failed'
fi
# ============= libusb-0.1.8/configure.in ==============
if test -f 'libusb-0.1.8/configure.in' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/configure.in' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/configure.in' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/configure.in' &&
X# This configure.in is based off of the one that glib uses
X
X# require atleast autoconf 2.13
XAC_PREREQ(2.13)
X
X# init autoconf (and check for presence of usb.c)
XAC_INIT(usb.c)
X
XAH_TOP(
X#undef LINUX_API
X#undef BSD_API
X#undef DARWIN_API
X
X#undef HAVE_OLD_DEV_USB_USB_H
X
X#undef HAVE_LIMITS_H
X#undef HAVE_UNISTD_H
X#undef HAVE_VALUES_H
X
X#undef LIBUSB_MAJOR_VERSION
X#undef LIBUSB_MINOR_VERSION
X#undef LIBUSB_MICRO_VERSION
X#undef LIBUSB_INTERFACE_AGE
X#undef LIBUSB_BINARY_AGE
X)
X
X# Save this value here, since automake will set cflags later
Xcflags_set=${CFLAGS+set}
X
Xdnl we need to AC_DIVERT_PUSH/AC_DIVERT_POP these variable definitions so they
Xdnl are available for $ac_help expansion (don't we all *love* autoconf?)
Xifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
X			     [AC_DIVERT_PUSH(NOTICE)])
X
X#
X# The following version number definitions apply to libusb
X# as a whole, so if changes occoured in any of them, they are all
X# treated with the same interface and binary age.
X#
X# Making releases:
X#   LIBUSB_MICRO_VERSION += 1;
X#   LIBUSB_INTERFACE_AGE += 1;
X#   LIBUSB_BINARY_AGE += 1;
X# if any functions have been added, set LIBUSB_INTERFACE_AGE to 0.
X# if backwards compatibility has been broken,
X# set LIBUSB_BINARY_AGE _and_ LIBUSB_INTERFACE_AGE to 0.
X#
XLIBUSB_MAJOR_VERSION=0
XLIBUSB_MINOR_VERSION=1
XLIBUSB_MICRO_VERSION=8
XLIBUSB_INTERFACE_AGE=0
XLIBUSB_BINARY_AGE=4
XLIBUSB_VERSION=$LIBUSB_MAJOR_VERSION.$LIBUSB_MINOR_VERSION.$LIBUSB_MICRO_VERSION
Xdnl
XAC_DIVERT_POP()dnl
X
XAC_SUBST(LIBUSB_MAJOR_VERSION)
XAC_SUBST(LIBUSB_MINOR_VERSION)
XAC_SUBST(LIBUSB_MICRO_VERSION)
XAC_SUBST(LIBUSB_VERSION)
XAC_SUBST(LIBUSB_INTERFACE_AGE)
XAC_SUBST(LIBUSB_BINARY_AGE)
X
X# libtool versioning
X# JR: Add support for MICRO_VERSION to be alpha-numeric. This will make
X# lt_current use the numeric part of MICRO_VERSION
X
XLIBUSB_MICRO_VERSION_NUM=`echo $LIBUSB_MICRO_VERSION | sed 's/[[a-zA-Z]]//g'`
XLT_RELEASE=$LIBUSB_MAJOR_VERSION.$LIBUSB_MINOR_VERSION
XLT_CURRENT=`expr $LIBUSB_MICRO_VERSION_NUM - $LIBUSB_INTERFACE_AGE`
XLT_REVISION=$LIBUSB_INTERFACE_AGE
XLT_AGE=`expr $LIBUSB_BINARY_AGE - $LIBUSB_INTERFACE_AGE`
XAC_SUBST(LT_RELEASE)
XAC_SUBST(LT_CURRENT)
XAC_SUBST(LT_REVISION)
XAC_SUBST(LT_AGE)
X
XVERSION=$LIBUSB_VERSION
XPACKAGE=libusb
X
XAM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
X
X# Specify a configuration file
XAM_CONFIG_HEADER(config.h)
X
XAC_DEFINE_UNQUOTED(LIBUSB_MAJOR_VERSION, $LIBUSB_MAJOR_VERSION)
XAC_DEFINE_UNQUOTED(LIBUSB_MINOR_VERSION, $LIBUSB_MINOR_VERSION)
XAC_DEFINE_UNQUOTED(LIBUSB_MICRO_VERSION, $LIBUSB_MICRO_VERSION)
XAC_DEFINE_UNQUOTED(LIBUSB_INTERFACE_AGE, $LIBUSB_INTERFACE_AGE)
XAC_DEFINE_UNQUOTED(LIBUSB_BINARY_AGE, $LIBUSB_BINARY_AGE)
X
Xdnl Initialize libtool
XAM_PROG_LIBTOOL
X
Xdnl Initialize maintainer mode
XAM_MAINTAINER_MODE
X
Xdnl This has already been dragged in by AM_PROG_LIBTOOL
Xdnl AC_CANONICAL_HOST
X
XLINUX_API=0
XDARWIN_API=0
XBSD_API=0
X
XAC_MSG_CHECKING(for what USB OS support)
Xcase $host in
X  *-linux*)
X    AC_DEFINE(LINUX_API, 1)
X    AC_DEFINE(BSD_API, 0)
X    AC_DEFINE(DARWIN_API, 0)
X    LINUX_API=1
X    os_support=linux
X    AC_MSG_RESULT(Linux)
X    OSLIBS=""
X    ;;
X  *-freebsd*|*-openbsd*|*-netbsd*)
X    AC_DEFINE(BSD_API, 1)
X    AC_DEFINE(LINUX_API, 0)
X    AC_DEFINE(DARWIN_API, 0)
X    BSD_API=1
X    os_support=bsd
X    AC_MSG_RESULT(FreeBSD, OpenBSD and/or NetBSD)
X    OSLIBS=""
X    ;;
X  *-darwin*)
X    AC_DEFINE(DARWIN_API, 1) 
X    AC_DEFINE(LINUX_API, 0)
X    AC_DEFINE(BSD_API, 0)
X    DARWIN_API=1
X    os_support=darwin
X    AC_MSG_RESULT(Darwin and/or MacOS 10)
X    OSLIBS="-framework IOKit"
X    ;;
X  *)
X    AC_MSG_RESULT(unknown operating system)
X    AC_MSG_ERROR(libusb does not support compiling for $host)
X    ;;
Xesac
X
XAC_SUBST(DARWIN_API)
XAC_SUBST(LINUX_API)
XAC_SUBST(BSD_API)
X
XAM_CONDITIONAL(LINUX_API, test "$os_support" = "linux")
XAM_CONDITIONAL(BSD_API, test "$os_support" = "bsd")
XAM_CONDITIONAL(DARWIN_API, test "$os_support" = "darwin")
X
XAC_SUBST(OSLIBS)
X
Xdnl figure debugging default, prior to $ac_help setup
Xdnl
Xifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
X			     [AC_DIVERT_PUSH(NOTICE)])
Xif test `expr $LIBUSB_MINOR_VERSION \% 2` = 1 ; then
X  debug_default=yes
Xelse
X  debug_default=minimum
Xfi
XAC_DIVERT_POP()dnl
X
Xdnl declare --enable-* args and collect ac_help strings
XAC_ARG_ENABLE(debug, [  --enable-debug=[no/minimum/yes] turn on debugging [default=$debug_default]],,enable_debug=$debug_default)
X
Xif test "x$enable_debug" = "xyes"; then
X  test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
Xfi
X
X# Checks for programs.
XAC_PROG_CC
XAM_PROG_CC_STDC
XAC_PROG_INSTALL
X
Xchangequote(,)dnl
Xif test "x$GCC" = "xyes"; then
X  case " $CFLAGS " in
X  *[\ \	]-Wall[\ \	]*) ;;
X  *) CFLAGS="$CFLAGS -Wall" ;;
X  esac
Xfi
Xchangequote([,])dnl
X
X# Checks for header files.
XAC_HEADER_STDC
X
X# Checks for library functions.
XAC_FUNC_VPRINTF
X
XAC_C_CONST
X
Xdnl for bytesex stuff
XAC_C_BIGENDIAN
X
Xif test "$ac_cv_c_bigendian" = "yes"; then
X  BIGENDIAN="1"
Xelse
X  BIGENDIAN="0"
Xfi
XAC_SUBST(BIGENDIAN)
X
Xdnl header file checks
XAC_CHECK_HEADERS(limits.h, AC_DEFINE_UNQUOTED(HAVE_LIMITS_H))
XAC_CHECK_HEADERS(unistd.h, AC_DEFINE_UNQUOTED(HAVE_UNISTD_H))
XAC_CHECK_HEADERS(values.h, AC_DEFINE_UNQUOTED(HAVE_VALUES_H))
X
X# Check for some functions
XAC_CHECK_FUNCS(memmove)
X
Xif test "$os_support" = "bsd"; then
X  AC_MSG_CHECKING(if dev/usb/usb.h uses new naming convention)
X  AC_TRY_COMPILE(
X    [#include <dev/usb/usb.h>],
X    [int main(void)
X     {
X       int a = ((struct usb_ctl_request *)0L)->ucr_addr;
X       return 0;
X     }],
X    [AC_MSG_RESULT(yes)],
X    [AC_MSG_RESULT(no)
X    AC_DEFINE_UNQUOTED(HAVE_OLD_DEV_USB_USB_H)])
Xfi
X
X# Check if the user wants to enable documentation
XAC_MSG_CHECKING(if we should build the documentation)
XAC_ARG_ENABLE(build-docs, [  --disable-build-docs    turn off building documentation],
X	[ test "$enableval" != no && build_docs=yes || build_docs=no ],
X	build_docs=auto)
XAC_MSG_RESULT($build_docs)
X
Xif test "$build_docs" != "no"; then
X  AC_CHECK_PROG(JADE, jade, jade)
X  if test  -z "$JADE"; then
X    AC_CHECK_PROG(JADE, openjade, openjade)
X  fi
Xfi
X
Xdnl Not quite ready for primetime --jerdfelt
Xdnl AC_CHECK_PROG(DVIPS, dvips, dvips, false)
Xdnl if test "$DVIPS" = "false"; then
Xdnl   unset BUILD_DOCS
Xdnl fi
X
Xif test "$build_docs" != "no" -a -z "$JADE"; then
X  AC_MSG_WARN(Documentation build components not installed. sgml docs will not be built)
X  build_docs="no"
Xfi
X
XAM_CONDITIONAL(BUILD_DOCS, test "$build_docs" != "no")
X
XAC_OUTPUT([
X  Makefile
X  doc/Makefile
X  libusb.spec
X  libusb-config
X  tests/Makefile
X  README
X  INSTALL.libusb
X  usb.h
X],[chmod +x libusb-config])
X
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/configure.in' 'failed'
fi
# ============= libusb-0.1.8/darwin.c ==============
if test -f 'libusb-0.1.8/darwin.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/darwin.c' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/darwin.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/darwin.c' &&
X/*
X * Darwin/MacOS X Support
X *
X * (c) 2002-2004 Nathan Hjelm <hjelmn@users.sourceforge.net>
X *
X * 0.1.8 (01/12/2004):
X *   - Fixed several memory leaks.
X *   - Readded 10.0 support
X *   - Added support for USB fuctions defined in 10.3 and above
X * (01/02/2003):
X *   - Applied a patch by Philip Edelbrock <phil@edgedesign.us> that fixes a bug in usb_control_msg.
X * (12/16/2003):
X *   - Even better error printing.
X *   - Devices that cannot be opened can have their interfaces opened.
X * 0.1.6 (05/12/2002):
X *   - Fixed problem where libusb holds resources after program completion.
X *   - Mouse should no longer freeze up now.
X * 0.1.2 (02/13/2002):
X *   - Bulk functions should work properly now.
X * 0.1.1 (02/11/2002):
X *   - Fixed major bug (device and interface need to be released after use)
X * 0.1.0 (01/06/2002):
X *   - Tested driver with gphoto (works great as long as Image Capture isn't running)
X * 0.1d  (01/04/2002):
X *   - Implimented clear_halt and resetep
X *   - Uploaded to CVS.
X * 0.1b  (01/04/2002):
X *   - Added usb_debug line to bulk read and write function.
X * 0.1a  (01/03/2002):
X *   - Driver mostly completed using the macosx driver I wrote for my rioutil software.
X *
X * this driver is EXPERIMENTAL, use at your own risk and e-mail me bug reports.
X *
X * Derived from Linux version by Richard Tobin.
X * Also partly derived from BSD version.
X *
X * This library is covered by the LGPL, read LICENSE for details.
X */
X
X#ifdef HAVE_CONFIG_H
X#include "config.h"
X#endif
X
X#include "usbi.h"
X
X#include <unistd.h>
X
X/* standard includes for darwin/os10 (IOKit) */
X#include <IOKit/IOCFBundle.h>
X#include <IOKit/usb/IOUSBLib.h>
X#include <IOKit/IOCFPlugIn.h>
X
X/* some defines */
X/* IOUSBInterfaceInferface */
X#if defined (IOUSBINTERFACE_FUNCS_197)
X
X#warning "libusb being compiled for 10.3 or higher"
X#define usb_interface_t IOUSBInterfaceInterface197
X#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID197
X#define InterfaceVersion 197
X
X#elif defined (IOUSBINTERFACE_FUNCS_190)
X
X#warning "libusb being compiled for 10.2 or higher"
X#define usb_interface_t IOUSBInterfaceInterface190
X#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID190
X#define InterfaceVersion 190
X
X#elif defined (IOUSBINTERFACE_FUNCS_182)
X
X#warning "libusb being compiled for 10.1 or higher"
X#define usb_interface_t IOUSBInterfaceInterface182
X#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID182
X#define InterfaceVersion 182
X
X#else
X
X/* No timeout functions available! Time to upgrade your os. */
X#warning "libusb being compiled without support for timout bulk functions! 10.0 and up"
X#define usb_interface_t IOUSBInterfaceInterface
X#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID
X#define LIBUSB_NO_TIMEOUT_INTERFACE
X#define InterfaceVersion 180
X
X#endif
X
X/* IOUSBDeviceInterface */
X#if defined (IOUSBDEVICE_FUNCS_197)
X
X#define usb_device_t    IOUSBDeviceInterface197
X#define DeviceInterfaceID kIOUSBDeviceInterfaceID197
X#define DeviceVersion 197
X
X#elif defined (IOUSBDEVICE_FUNCS_187)
X
X#define usb_device_t    IOUSBDeviceInterface187
X#define DeviceInterfaceID kIOUSBDeviceInterfaceID187
X#define DeviceVersion 187
X
X#elif defined (IOUSBDEVICE_FUNCS_182)
X
X#define usb_device_t    IOUSBDeviceInterface182
X#define DeviceInterfaceID kIOUSBDeviceInterfaceID182
X#define DeviceVersion 182
X
X#else
X
X#define usb_device_t    IOUSBDeviceInterface
X#define DeviceInterfaceID kIOUSBDeviceInterfaceID
X#define LIBUSB_NO_TIMEOUT_DEVICE
X#define LIBUSB_NO_SEIZE_DEVICE
X#define DeviceVersion 180
X
X#endif
X
X#define io_return_t     IOReturn
X
X/* Darwin/OS X impl does not use fd field, instead it uses this */
Xstruct darwin_dev_handle {
X  usb_device_t **device;
X  usb_interface_t **interface;
X  int open;
X};
X
Xstatic CFRunLoopSourceRef runLoopSource;
Xstatic CFMutableDictionaryRef matchingDict;
Xstatic IONotificationPortRef gNotifyPort;
Xstatic mach_port_t masterPort = MACH_PORT_NULL;
X
Xstatic void darwin_cleanup (void)
X{
X  IONotificationPortDestroy(gNotifyPort);
X  mach_port_deallocate(mach_task_self(), masterPort);
X}
X
Xstatic char *darwin_error_str (int result) {
X  switch (result) {
X  case kIOReturnSuccess:
X    return "no error";
X  case kIOReturnNotOpen:
X    return "device not opened for exclusive access";
X  case kIOReturnNoDevice:
X    return "no connection to an IOService";
X  case kIOUSBNoAsyncPortErr:
X    return "no asyc port has been opened for interface";
X  case kIOReturnExclusiveAccess:
X    return "another process has device opened for exclusive access";
X  case kIOUSBPipeStalled:
X    return "pipe is stalled";
X  case kIOReturnError:
X    return "could not establish a connection to Darin kernel";
X  case kIOReturnBadArgument:
X    return "invalid argument";
X  default:
X    return "unknown error";
X  }
X}
X
X/* not a valid errorno outside darwin.c */
X#define LUSBDARWINSTALL (ELAST+1)
X
Xstatic int darwin_to_errno (int result) {
X  switch (result) {
X  case kIOReturnSuccess:
X    return 0;
X  case kIOReturnNotOpen:
X    return EBADF;
X  case kIOReturnNoDevice:
X  case kIOUSBNoAsyncPortErr:
X    return ENXIO;
X  case kIOReturnExclusiveAccess:
X    return EBUSY;
X  case kIOUSBPipeStalled:
X    return LUSBDARWINSTALL;
X  case kIOReturnBadArgument:
X    return EINVAL;
X  case kIOReturnError:
X  default:
X    return 1;
X  }
X}
X
Xint usb_os_open(usb_dev_handle *dev)
X{
X  struct darwin_dev_handle *device;
X
X  io_return_t result;
X  io_iterator_t deviceIterator;
X  io_service_t usbDevice;
X
X  usb_device_t **darwin_device;
X
X  IOCFPlugInInterface **plugInInterface = NULL;
X
X  long score;
X  UInt16 address, vendor;
X  UInt32 location = *((UInt32 *)dev->device->dev);
X  UInt32 dlocation;
X
X  if (!dev)
X    USB_ERROR(-ENXIO);
X
X  if (!masterPort)
X    USB_ERROR(-EINVAL);
X
X  device = calloc(1, sizeof(struct darwin_dev_handle));
X  if (!device)
X    USB_ERROR(-ENOMEM);
X
X  if (usb_debug > 3)
X    fprintf(stderr, "usb_os_open: %04x:%04x\n",
X	    dev->device->descriptor.idVendor,
X	    dev->device->descriptor.idProduct);
X
X  /* set up the matching dictionary for class IOUSBDevice and its subclasses.
X     It will be consumed by the IOServiceGetMatchingServices call */
X  if ((matchingDict = IOServiceMatching(kIOUSBDeviceClassName)) == NULL) {
X    darwin_cleanup ();
X    
X    USB_ERROR(-ENOMEM);
X  }
X
X  result = IOServiceGetMatchingServices(masterPort,
X					matchingDict,
X					&deviceIterator);
X  matchingDict = NULL;
X
X  if (result != kIOReturnSuccess)
X    USB_ERROR_STR(-darwin_to_errno (result), "usb_os_open(IOServiceGetMatchingServices): %s", darwin_error_str(result));
X
X  while (IOIteratorIsValid (deviceIterator) && (usbDevice = IOIteratorNext(deviceIterator))) {
X    /* Create an intermediate plug-in */
X    result = IOCreatePlugInInterfaceForService(usbDevice, kIOUSBDeviceUserClientTypeID,
X                                               kIOCFPlugInInterfaceID, &plugInInterface,
X                                               &score);
X
X    result = IOObjectRelease(usbDevice);
X    if (result || !plugInInterface)
X      continue;
X
X    (*plugInInterface)->QueryInterface(plugInInterface, CFUUIDGetUUIDBytes(DeviceInterfaceID),
X                                       (LPVOID)&darwin_device);
X
X    (*plugInInterface)->Stop(plugInInterface);
X    IODestroyPlugInInterface (plugInInterface);
X    plugInInterface = NULL;
X
X    if (!darwin_device)
X      continue;
X
X    result = (*(darwin_device))->GetLocationID(darwin_device, (UInt32 *)&dlocation);
X    if (dlocation == location) {
X      device->device = darwin_device;
X      break;
X    }
X
X    (*darwin_device)->Release(darwin_device);
X  }
X
X  IOObjectRelease(deviceIterator);
X
X#if !defined (LIBUSB_NO_SEIZE_DEVICE)
X  result = (*(device->device))->USBDeviceOpenSeize (device->device);
X#else
X  /* No Seize in OS X 10.0 (Darwin 1.4) */
X  result = (*(device->device))->USBDeviceOpen (device->device);
X#endif
X
X  if (result != kIOReturnSuccess) {
X    switch (result) {
X    case kIOReturnExclusiveAccess:
X      if (usb_debug > 0)
X	fprintf (stderr, "usb_os_open(USBDeviceOpenSeize): %s\n", darwin_error_str(result));
X      break;
X    default:
X      (*(device->device))->Release (device->device);
X      USB_ERROR_STR(-darwin_to_errno (result), "usb_os_open(USBDeviceOpenSeize): %s", darwin_error_str(result));
X    }
X    
X    device->open = 0;
X  } else
X    device->open = 1;
X    
X  dev->impl_info = device;
X  dev->interface = -1;
X  dev->altsetting = -1;
X
X  return 0;
X}
X
Xint usb_os_close(usb_dev_handle *dev)
X{
X  struct darwin_dev_handle *device;
X  io_return_t result;
X
X  if (!dev)
X    USB_ERROR(-ENXIO);
X
X  if ((device = dev->impl_info) == NULL)
X    USB_ERROR(-ENOENT);
X
X  usb_release_interface(dev, dev->interface);
X
X  if (usb_debug > 3)
X    fprintf(stderr, "usb_os_close: %04x:%04x\n",
X	    dev->device->descriptor.idVendor,
X	    dev->device->descriptor.idProduct);
X
X  if (device->open == 1)
X    result = (*(device->device))->USBDeviceClose(device->device);
X  else
X    result = kIOReturnSuccess;
X
X  /* device may not need to be released, but if it has to... */
X  (*(device->device))->Release(device->device);
X
X  if (result != kIOReturnSuccess)
X    USB_ERROR_STR(-darwin_to_errno(result), "usb_os_close(USBDeviceClose): %s", darwin_error_str(result));
X
X  free (device);
X
X  return 0;
X}
X
X// static int claim_interface ( struct darwin_dev_handle *device, int interface )
Xstatic int claim_interface ( usb_dev_handle *dev, int interface )
X{
X  io_iterator_t interface_iterator;
X  io_service_t  usbInterface;
X
X  struct darwin_dev_handle *device;
X  io_return_t result;
X  IOUSBFindInterfaceRequest request;
X  IOCFPlugInInterface **plugInInterface = NULL;
X  long score;
X  int current_interface;
X
X  device = dev->impl_info;
X
X  request.bInterfaceClass = kIOUSBFindInterfaceDontCare;
X  request.bInterfaceSubClass = kIOUSBFindInterfaceDontCare;
X  request.bInterfaceProtocol = kIOUSBFindInterfaceDontCare;
X  request.bAlternateSetting = kIOUSBFindInterfaceDontCare;
X
X  result = (*(device->device))->CreateInterfaceIterator(device->device, &request, &interface_iterator);
X  if (result != kIOReturnSuccess)
X    USB_ERROR_STR (-darwin_to_errno(result), "claim_interface(CreateInterfaceIterator): %s",
X		   darwin_error_str(result));
X
X  for ( current_interface=0; current_interface<=interface; current_interface++ ) {
X    usbInterface = IOIteratorNext(interface_iterator);
X    if ( usb_debug > 3 )
X      fprintf ( stderr, "Interface %d of device is 0x%x\n",
X		current_interface, (void *)usbInterface );
X  }
X  current_interface--;
X
X  /* the interface iterator is no longer needed, release it */
X  IOObjectRelease(interface_iterator);
X
X  if (!usbInterface) {
X    UInt8 nConfig;			     /* Index of configuration to use */
X    IOUSBConfigurationDescriptorPtr configDesc; /* to describe which configuration to select */
X    /* Only a composite class device with no vendor-specific driver will
X       be configured. Otherwise, we need to do it ourselves, or there
X       will be no interfaces for the device. */
X
X    if ( usb_debug > 3 )
X      fprintf ( stderr,"claim_interface: No interface found; selecting configuration\n" );
X
X    result = (*(device->device))->GetNumberOfConfigurations ( device->device, &nConfig );
X    if (result != kIOReturnSuccess)
X      USB_ERROR_STR(-darwin_to_errno(result), "claim_interface(GetNumberOfConfigurations): %s",
X		    darwin_error_str(result));
X    
X    if (nConfig < 1)
X      USB_ERROR_STR(-ENXIO ,"claim_interface(GetNumberOfConfigurations): no configurations");
X    else if ( nConfig > 1 && usb_debug > 0 )
X      fprintf ( stderr, "claim_interface: device has more than one"
X		" configuration, using the first (warning)\n" );
X
X    if ( usb_debug > 3 )
X      fprintf ( stderr, "claim_interface: device has %d configuration%s\n",
X		(int)nConfig, (nConfig>1?"s":"") );
X
X    /* Always use the first configuration */
X    result = (*(device->device))->GetConfigurationDescriptorPtr ( (device->device), 0, &configDesc );
X    if (result != kIOReturnSuccess) {
X      if (device->open == 1) {
X        (*(device->device))->USBDeviceClose ( (device->device) );
X        (*(device->device))->Release ( (device->device) );
X      }
X
X      USB_ERROR_STR(-darwin_to_errno(result), "claim_interface(GetConfigurationDescriptorPtr): %s",
X		    darwin_error_str(result));
X    } else if ( usb_debug > 3 )
X      fprintf ( stderr, "claim_interface: configuration value is %d\n",
X		configDesc->bConfigurationValue );
X
X    if (device->open == 1) {
X      result = (*(device->device))->SetConfiguration ( (device->device), configDesc->bConfigurationValue );
X
X      if (result != kIOReturnSuccess) {
X	(*(device->device))->USBDeviceClose ( (device->device) );
X	(*(device->device))->Release ( (device->device) );
X
X	USB_ERROR_STR(-darwin_to_errno(result), "claim_interface(SetConfiguration): %s",
X		      darwin_error_str(result));
X      }
X    }
X    
X    request.bInterfaceClass = kIOUSBFindInterfaceDontCare;
X    request.bInterfaceSubClass = kIOUSBFindInterfaceDontCare;
X    request.bInterfaceProtocol = kIOUSBFindInterfaceDontCare;
X    request.bAlternateSetting = kIOUSBFindInterfaceDontCare;
X
X    /* Now go back and get the chosen interface */
X    result = (*(device->device))->CreateInterfaceIterator(device->device, &request, &interface_iterator);
X    if (result != kIOReturnSuccess)
X      USB_ERROR_STR (-darwin_to_errno(result), "claim_interface(CreateInterfaceIterator): %s",
X		     darwin_error_str(result));
X
X    for (current_interface = 0 ; current_interface <= interface ; current_interface++) {
X      usbInterface = IOIteratorNext(interface_iterator);
X
X      if ( usb_debug > 3 )
X	fprintf ( stderr, "claim_interface: Interface %d of device is 0x%x\n",
X		  current_interface, (void *)usbInterface );
X    }
X    current_interface--;
X
X    /* the interface iterator is no longer needed, release it */
X    IOObjectRelease(interface_iterator);
X
X    if (!usbInterface)
X      USB_ERROR_STR (-ENOENT, "claim_interface: interface iterator returned NULL");
X  }
X
X  result = IOCreatePlugInInterfaceForService(usbInterface,
X					     kIOUSBInterfaceUserClientTypeID,
X					     kIOCFPlugInInterfaceID,
X					     &plugInInterface, &score);
X  //No longer need the usbInterface object after getting the plug-in
X  result = IOObjectRelease(usbInterface);
X  if (result || !plugInInterface)
X    USB_ERROR(-ENOENT);
X
X  //Now create the device interface for the interface
X  result = (*plugInInterface)->QueryInterface(plugInInterface,
X					      CFUUIDGetUUIDBytes(InterfaceInterfaceID),
X					      (LPVOID) &device->interface);
X
X  //No longer need the intermediate plug-in  
X  (*plugInInterface)->Stop(plugInInterface);
X  IODestroyPlugInInterface (plugInInterface);
X
X  if (result != kIOReturnSuccess)
X    USB_ERROR_STR(-darwin_to_errno(result), "claim_interface(QueryInterface): %s",
X		  darwin_error_str(result));
X
X  if (!device->interface)
X    USB_ERROR(-EACCES);
X
X  if ( usb_debug > 3 )
X    fprintf ( stderr, "claim_interface: Interface %d of device from QueryInterface is 0x%x\n",
X	      current_interface, (void *)(device->interface) );
X
X  /* claim the interface */
X  result = (*(device->interface))->USBInterfaceOpen(device->interface);
X  if (result)
X    USB_ERROR_STR(-darwin_to_errno(result), "claim_interface(USBInterfaceOpen): %s",
X		  darwin_error_str(result));
X
X  return 0;
X}
X
Xint usb_set_configuration(usb_dev_handle *dev, int configuration)
X{
X  struct darwin_dev_handle *device;
X  io_return_t result;
X
X  if ( usb_debug > 3 )
X    fprintf ( stderr, "usb_set_configuration: called for config %x\n", configuration );
X
X  if (!dev)
X    USB_ERROR_STR ( -ENXIO, "usb_set_configuration: called with null device\n" );
X
X  if ((device = dev->impl_info) == NULL)
X    USB_ERROR_STR ( -ENOENT, "usb_set_configuration: device not properly initialized" );
X
X  /* Setting configuration will invalidate the interface, so we need
X     to reclaim it. First, dispose of existing interface, if any. */
X  if ( device->interface )
X    usb_release_interface(dev, dev->interface);
X
X  result = (*(device->device))->SetConfiguration(device->device, configuration);
X
X  if (result)
X    USB_ERROR_STR(-darwin_to_errno(result), "usb_set_configuration(SetConfiguration): %s",
X		  darwin_error_str(result));
X
X  /* Reclaim interface: assume zero */
X  if (dev->interface != -1)
X    result = claim_interface(dev, dev->interface);
X
X  dev->config = configuration;
X
X  return result;
X}
X
Xint usb_claim_interface(usb_dev_handle *dev, int interface)
X{
X  struct darwin_dev_handle *device = dev->impl_info;
X
X  io_return_t result;
X
X  if ( usb_debug > 3 )
X    fprintf ( stderr, "usb_claim_interface: called for interface %d\n", interface );
X
X  if (!device)
X    USB_ERROR_STR ( -ENOENT, "usb_claim_interface: device is NULL" );
X
X  if (!(device->device))
X    USB_ERROR_STR ( -EINVAL, "usb_claim_interface: device->device is NULL" );
X
X  /* If we have already claimed an interface, release it */
X  if ( device->interface )
X    usb_release_interface(dev, dev->interface);
X
X  result = claim_interface ( dev, interface );
X  if ( result )
X    USB_ERROR_STR ( result, "usb_claim_interface: couldn't claim interface" );
X
X  dev->interface = interface;
X
X  /* interface is claimed and async IO is set up: return 0 */
X  return 0;
X}
X
Xint usb_release_interface(usb_dev_handle *dev, int interface)
X{
X  struct darwin_dev_handle *device;
X  io_return_t result;
X
X  if (!dev)
X    USB_ERROR(-ENXIO);
X
X  if ((device = dev->impl_info) == NULL)
X    USB_ERROR(-ENOENT);
X
X  /* interface is not open */
X  if (!device->interface)
X    return 0;
X
X  result = (*(device->interface))->USBInterfaceClose(device->interface);
X
X  if (result != kIOReturnSuccess)
X    USB_ERROR_STR(-darwin_to_errno(result), "usb_release_interface(USBInterfaceClose): %s",
X		  darwin_error_str(result));
X
X  result = (*(device->interface))->Release(device->interface);
X
X  if (result != kIOReturnSuccess)
X    USB_ERROR_STR(-darwin_to_errno(result), "usb_release_interface(Release): %s",
X		  darwin_error_str(result));
X
X  device->interface = NULL;
X
X  dev->interface = -1;
X  dev->altsetting = -1;
X
X  return 0;
X}
X
Xint usb_set_altinterface(usb_dev_handle *dev, int alternate)
X{
X  struct darwin_dev_handle *device;
X  io_return_t result;
X
X  if (!dev)
X    USB_ERROR(-ENXIO);
X
X  if ((device = dev->impl_info) == NULL)
X    USB_ERROR(-ENOENT);
X
X  /* interface is not open */
X  if (!device->interface)
X    USB_ERROR_STR(-EACCES, "usb_set_altinterface: interface used without being claimed");
X
X  result = (*(device->interface))->SetAlternateInterface(device->interface, alternate);
X
X  if (result)
X    USB_ERROR_STR(result, "usb_set_altinterface: could not set alternate interface");
X
X  dev->altsetting = alternate;
X
X  return 0;
X}
X
X/* simple function that figures out what pipeRef is associated with an endpoint */
Xstatic int ep_to_pipeRef (struct darwin_dev_handle *device, int ep)
X{
X  u_int8_t numep, direction, number;
X  u_int8_t dont_care1, dont_care3;
X  u_int16_t dont_care2;
X  int i, ret;
X
X  if (usb_debug > 1)
X    fprintf(stderr, "Converting ep address to pipeRef.\n");
X
X  /* retrieve the total number of endpoints on this interface */
X  ret = (*(device->interface))->GetNumEndpoints(device->interface, &numep);
X  if ( ret ) {
X    if ( usb_debug > 1 )
X      fprintf ( stderr, "ep_to_pipeRef: interface is %x\n", device->interface );
X    USB_ERROR_STR ( -ret, "ep_to_pipeRef: can't get number of endpoints for interface" );
X  }
X
X  /* iterate through the pipeRefs until we find the correct one */
X  for (i = 1 ; i <= numep ; i++) {
X    ret = (*(device->interface))->GetPipeProperties(device->interface, i, &direction, &number,
X						    &dont_care1, &dont_care2, &dont_care3);
X
X    if (ret != kIOReturnSuccess) {
X      fprintf (stderr, "ep_to_pipeRef: an error occurred getting pipe information on pipe %d\n",
X	       i );
X      USB_ERROR_STR(-darwin_to_errno(ret), "ep_to_pipeRef(GetPipeProperties): %s", darwin_error_str(ret));
X    }
X
X    if (usb_debug > 1)
X      fprintf (stderr, "ep_to_pipeRef: Pipe %i: DIR: %i number: %i\n", i, direction, number);
X
X    /* calculate the endpoint of the pipe and check it versus the requested endpoint */
X    if ( ((direction << 7 & USB_ENDPOINT_DIR_MASK) | (number & USB_ENDPOINT_ADDRESS_MASK)) == ep ) {
X      if (usb_debug > 1)
X	fprintf(stderr, "ep_to_pipeRef: pipeRef for ep address 0x%02x found: 0x%02x\n", ep, i);
X
X      return i;
X    }
X  }
X
X  if (usb_debug > 1)
X    fprintf(stderr, "ep_to_pipeRef: No pipeRef found with endpoint address 0x%02x.\n", ep);
X  
X  /* none of the found pipes match the requested endpoint */
X  return -1;
X}
X
Xstatic void write_completed(void *dummy, io_return_t result, void *arg0)
X{
X  if (usb_debug > 2)
X    fprintf(stderr, "write completed\n");
X
X  CFRunLoopStop(CFRunLoopGetCurrent());
X}
X
Xint usb_bulk_write(usb_dev_handle *dev, int ep, char *bytes, int size,
X                   int timeout)
X{
X  struct darwin_dev_handle *device;
X  CFRunLoopSourceRef cfSource;
X  io_return_t result = -1;
X  int pipeRef;
X
X  UInt8   direction, number, transferType, interval;
X  UInt16			       maxPacketSize;
X
X  if (!dev)
X    USB_ERROR(-ENXIO);
X
X  if ((device = dev->impl_info) == NULL)
X    USB_ERROR(-ENOENT);
X
X  /* interface is not open */
X  if (!device->interface)
X    USB_ERROR_STR(-EACCES, "usb_bulk_write: interface used without being claimed");
X
X  if ((pipeRef = ep_to_pipeRef(device, ep)) < 0)
X    USB_ERROR(-EINVAL);
X
X  if (usb_debug > 3)
X    fprintf(stderr, "usb_bulk_write: endpoint=0x%02x size=%i TO=%i\n", ep, size, timeout);
X
X  (*(device->interface))->GetPipeProperties ( device->interface, pipeRef, &direction, &number,
X					     &transferType, &maxPacketSize, &interval );
X
X  (*(device->interface))->CreateInterfaceAsyncEventSource(device->interface, &cfSource);
X  CFRunLoopAddSource(CFRunLoopGetCurrent(), cfSource, kCFRunLoopDefaultMode);
X
X  /* there seems to be no way to determine how many bytes are actually written */
X#if !defined (LIBUSB_NO_TIMEOUT_INTERFACE)
X  if ( transferType == kUSBInterrupt )
X    result = (*(device->interface))->WritePipeAsyncTO(device->interface, pipeRef,
X						      bytes, size, 0, timeout,
X						      write_completed, NULL);
X  else
X#endif
X    result = (*(device->interface))->WritePipeAsync(device->interface, pipeRef,
X						    bytes, size, write_completed, NULL);
X  
X  if (result != kIOReturnSuccess)
X    USB_ERROR_STR(-darwin_to_errno(result), "usb_bulk_write(WritePipeAsyncTO): %s", darwin_error_str(result));
X  else
X    /* wait for write to complete */
X    CFRunLoopRun();
X
X  CFRunLoopRemoveSource(CFRunLoopGetCurrent(), cfSource, kCFRunLoopDefaultMode);
X
X
X  return size;
X}
X
Xint usb_bulk_read(usb_dev_handle *dev, int ep, char *bytes, int size,
X                  int timeout)
X{
X  struct darwin_dev_handle *device;
X  int pipeRef;
X  u_int32_t ret_size = size;
X  u_int32_t retrieved = 0;
X  io_return_t result = -1;
X
X  UInt8				direction, number, transferType, interval;
X  UInt16				maxPacketSize;
X
X  if (usb_debug)
X    fprintf (stderr, "usb_bulk_read: ep addr = 0x%02x\n", ep);
X
X  ep |= 0x80; /* USB_DIR_OUT */
X
X  if (!dev)
X    USB_ERROR_STR ( -ENXIO, "usb_bulk_read: called with null device" );
X
X  if ((device = dev->impl_info) == NULL)
X    USB_ERROR_STR ( -ENOENT, "usb_bulk_read: device not initialized" );
X
X  /* interface is not open */
X  if (!device->interface)
X    USB_ERROR_STR(-EACCES, "usb_bulk_read: interface used without being claimed");
X
X  if ((pipeRef = ep_to_pipeRef(device, ep)) == -1)
X    USB_ERROR_STR ( -EINVAL, "usb_bulk_read: invalid pipe reference" );
X
X  if (usb_debug > 3)
X    fprintf(stderr, "usb_bulk_read: endpoint=0x%02x size=%i timeout=%fsec\n" , ep, size, (double)timeout/1000 );
X
X  (*(device->interface))->GetPipeProperties ( device->interface, pipeRef, &direction, &number,
X					     &transferType, &maxPacketSize, &interval );
X
X#if !defined (LIBUSB_NO_TIMEOUT_INTERFACE)
X  if ( transferType == kUSBInterrupt ) {
X#endif
X    /* This is an interrupt pipe. We can't specify a timeout. */
X    if (usb_debug > 3)
X      fprintf(stderr, "usb_bulk_read: interrupt pipe\n" );
X    result = (*(device->interface))->ReadPipe(device->interface, pipeRef,
X						  bytes, (UInt32 *)&ret_size);
X    if (result != kIOReturnSuccess)
X      USB_ERROR_STR(-darwin_to_errno(result), "usb_bulk_read(ReadPipe): error reading from bulk endpoint %02x: %s",
X		    ep, darwin_error_str(result));
X
X    retrieved = ret_size;
X#if !defined (LIBUSB_NO_TIMEOUT_INTERFACE)
X  } else {
X    result = (*(device->interface))->ReadPipeTO(device->interface, pipeRef,
X						bytes + retrieved, (UInt32 *)&ret_size, 0,
X						timeout);
X    
X    if (result != kIOReturnSuccess)
X      USB_ERROR_STR(-darwin_to_errno(result), "usb_bulk_read(ReadPipeTO): error reading from bulk endpoint %02x: %s",
X		    ep, darwin_error_str(result));
X    retrieved = ret_size;
X  }
X#endif
X
X  /* Will this ever be true? -N */
X  if (retrieved < 0)
X    USB_ERROR_STR(retrieved, "usb_bulk_read: error reading from endpoint %02x", ep);
X
X  return retrieved;
X}
X
X/* interrupt endpoints seem to be treated just like any other endpoint under OSX/Darwin */
Xint usb_interrupt_write(usb_dev_handle *dev, int ep, char *bytes, int size,
X	int timeout)
X{
X  return usb_bulk_write (dev, ep, bytes, size, timeout);
X}
X
Xint usb_interrupt_read(usb_dev_handle *dev, int ep, char *bytes, int size,
X	int timeout)
X{
X  return usb_bulk_read (dev, ep, bytes, size, timeout);
X}
X
Xint usb_control_msg(usb_dev_handle *dev, int requesttype, int request,
X		    int value, int index, char *bytes, int size, int timeout)
X{
X  struct darwin_dev_handle *device = dev->impl_info;
X#if !defined (LIBUSB_NO_TIMEOUT_DEVICE)
X  IOUSBDevRequestTO urequest;
X#else
X  IOUSBDevRequest urequest;
X#endif
X  io_return_t result;
X
X  if (usb_debug >= 3)
X    fprintf(stderr, "usb_control_msg: %d %d %d %d %p %d %d\n",
X            requesttype, request, value, index, bytes, size, timeout);
X
X  bzero(&urequest, sizeof(IOUSBDevRequestTO));
X
X  urequest.bmRequestType = requesttype;
X  urequest.bRequest = request;
X  urequest.wValue = value;
X  urequest.wIndex = index;
X  urequest.wLength = size;
X  urequest.pData = bytes;
X#if !defined (LIBUSB_NO_TIMEOUT_DEVICE)
X  urequest.completionTimeout = timeout;
X
X  result = (*(device->device))->DeviceRequestTO(device->device, &urequest);
X#else
X  result = (*(device->device))->DeviceRequest(device->device, &urequest);
X#endif
X  if (result != kIOReturnSuccess)
X    USB_ERROR_STR(-darwin_to_errno(result), "usb_control_msg(DeviceRequestTO): %s", darwin_error_str(result));
X
X  /* Bytes transfered is stored in the wLenDone field*/
X  return urequest.wLenDone;
X}
X
Xint usb_os_find_busses(struct usb_bus **busses)
X{
X  struct usb_bus *fbus = NULL;
X
X  io_iterator_t deviceIterator;
X  io_service_t usbDevice;
X
X  usb_device_t **device;
X
X  IOCFPlugInInterface **plugInInterface = NULL;
X
X  io_return_t result;
X  SInt32 score;
X  UInt16 address;
X  UInt32 location;
X
X  char buf[20];
X  int i = 1;
X
X  /* Create a master port for communication with IOKit (this should
X     have been created if the user called usb_init() )*/
X  if (!masterPort) {
X    usb_init ();
X
X    if (result || !masterPort)
X      USB_ERROR(-ENOENT);
X  }
X
X  /* set up the matching dictionary for class IOUSBRootHubDevice
X     and its subclasses. It will be consumed by the next call */
X  if ((matchingDict = IOServiceMatching("IOUSBRootHubDevice")) == NULL) {
X    darwin_cleanup ();
X
X    USB_ERROR(-ENOMEM);
X  }
X
X  result = IOServiceGetMatchingServices(masterPort,
X					matchingDict,
X					&deviceIterator);
X  matchingDict = NULL;
X
X  if (result != kIOReturnSuccess)
X    USB_ERROR_STR(-darwin_to_errno (result), "usb_os_find_busses(IOServiceGetMatchingServices): %s", darwin_error_str(result));
X
X
X  while (IOIteratorIsValid(deviceIterator) && (usbDevice = IOIteratorNext(deviceIterator))) {
X    struct usb_bus *bus;
X
X    /* Create an intermediate plug-in */
X    result = IOCreatePlugInInterfaceForService(usbDevice,
X					       kIOUSBDeviceUserClientTypeID,
X                                               kIOCFPlugInInterfaceID,
X					       &plugInInterface,
X                                               &score);
X
X    result = IOObjectRelease(usbDevice);
X    if (result || !plugInInterface)
X      continue;
X
X    (*plugInInterface)->QueryInterface(plugInInterface,
X				       CFUUIDGetUUIDBytes(DeviceInterfaceID),
X                                       (LPVOID)&device);
X
X    /* done with this */
X    (*plugInInterface)->Stop(plugInInterface);
X    IODestroyPlugInInterface (plugInInterface);
X    plugInInterface = NULL;
X
X    if (!device)
X      continue;
X
X    result = (*(device))->GetLocationID(device, &location);
X
X    bus = malloc(sizeof(*bus));
X    if (!bus)
X      USB_ERROR(-ENOMEM);
X    
X    memset((void *)bus, 0, sizeof(*bus));
X    
X    sprintf(buf, "%03i", i++);
X    bus->location = location;
X
X    strncpy(bus->dirname, buf, sizeof(bus->dirname) - 1);
X    bus->dirname[sizeof(bus->dirname) - 1] = 0;
X    
X    LIST_ADD(fbus, bus);
X    
X    if (usb_debug >= 2)
X      fprintf(stderr, "usb_os_find_busses: Found %s\n", bus->dirname);
X
X    (*(device))->Release(device);
X  }
X
X  IOObjectRelease(deviceIterator);
X
X  *busses = fbus;
X
X  return 0;
X}
X
Xint usb_os_find_devices(struct usb_bus *bus, struct usb_device **devices)
X{
X  struct usb_device *fdev = NULL;
X
X  io_iterator_t deviceIterator;
X  io_service_t usbDevice;
X
X  usb_device_t **device;
X
X  IOCFPlugInInterface **plugInInterface = NULL;
X
X  io_return_t result;
X  SInt32 score;
X  UInt16 address;
X  UInt32 location;
X  UInt32 bus_loc = bus->location;
X
X  /* for use in retrieving device description */
X  IOUSBDevRequest req;
X
X  char buf[20];
X  int busnum = 0;
X
X  /* a master port should have been created by usb_os_init */
X  if (!masterPort)
X    USB_ERROR(-ENOENT);
X
X  /* set up the matching dictionary for class IOUSBDevice and its subclasses.
X     It will be consumed by the next call */
X  if ((matchingDict = IOServiceMatching(kIOUSBDeviceClassName)) == NULL) {
X    darwin_cleanup ();
X
X    USB_ERROR(-ENOMEM);
X  }
X
X  result = IOServiceGetMatchingServices(masterPort, matchingDict, &deviceIterator);
X  matchingDict = NULL;
X
X  if (result != kIOReturnSuccess)
X    USB_ERROR_STR(-darwin_to_errno (result), "usb_os_find_devices(IOServiceGetMatchingServices): %s", darwin_error_str(result));
X
X  req.bmRequestType = USBmakebmRequestType(kUSBIn, kUSBStandard, kUSBDevice);
X  req.bRequest = kUSBRqGetDescriptor;
X  req.wValue = kUSBDeviceDesc << 8;
X  req.wIndex = 0;
X  req.wLength = sizeof(IOUSBDeviceDescriptor);
X
X  while (IOIteratorIsValid (deviceIterator) && (usbDevice = IOIteratorNext(deviceIterator))) {
X    /* Create an intermediate plug-in */
X    result = IOCreatePlugInInterfaceForService(usbDevice, kIOUSBDeviceUserClientTypeID,
X                                               kIOCFPlugInInterfaceID, &plugInInterface,
X                                               &score);
X
X    result = IOObjectRelease(usbDevice);
X    if (result || !plugInInterface)
X      continue;
X
X    (*plugInInterface)->QueryInterface(plugInInterface, CFUUIDGetUUIDBytes(DeviceInterfaceID),
X                                       (LPVOID)&device);
X
X    /* done with this */
X    (*plugInInterface)->Stop(plugInInterface);
X    IODestroyPlugInInterface (plugInInterface);
X    plugInInterface = NULL;
X
X    if (!device)
X      continue;
X
X    result = (*(device))->GetDeviceAddress(device, (USBDeviceAddress *)&address);
X    result = (*(device))->GetLocationID(device, &location);
X
X    if (usb_debug >= 2)
X      fprintf(stderr, "usb_os_find_devices: Found USB device at location 0x%08x\n", location);
X
X    /* first byte of location appears to be associated with the device's bus */
X    if (location >> 24 == bus_loc >> 24) {
X      struct usb_device *dev;
X
X      dev = malloc(sizeof(*dev));
X      if (!dev) {
X	USB_ERROR(-ENOMEM);
X      }
X
X      memset((void *)dev, 0, sizeof(*dev));
X
X      dev->bus = bus;
X
X      req.pData = &(dev->descriptor);
X      result = (*(device))->DeviceRequest(device, &req);
X
X      USB_LE16_TO_CPU(dev->descriptor.bcdUSB);
X      USB_LE16_TO_CPU(dev->descriptor.idVendor);
X      USB_LE16_TO_CPU(dev->descriptor.idProduct);
X      USB_LE16_TO_CPU(dev->descriptor.bcdDevice);
X
X      sprintf(dev->filename, "%03i-%04x-%04x-%02x-%02x", address,
X	      dev->descriptor.idVendor, dev->descriptor.idProduct,
X	      dev->descriptor.bDeviceClass, dev->descriptor.bDeviceSubClass);
X
X      dev->dev = (USBDeviceAddress *)malloc(4);
X      memcpy(dev->dev, &location, 4);
X
X      LIST_ADD(fdev, dev);
X
X      if (usb_debug >= 2)
X	fprintf(stderr, "usb_os_find_devices: Found %s on %s at location 0x%08x\n",
X		dev->filename, bus->dirname, location);
X    }
X
X    /* release the device now */
X    (*(device))->Release(device);
X  }
X
X  IOObjectRelease(deviceIterator);
X
X  *devices = fdev;
X
X  return 0;
X}
X
Xvoid usb_os_init(void)
X{
X  if (masterPort == NULL) {
X    IOMasterPort(MACH_PORT_NULL, &masterPort);
X    
X    gNotifyPort = IONotificationPortCreate(masterPort);
X  }
X}
X
Xvoid usb_os_cleanup (void)
X{
X  if (masterPort != NULL) {
X    mach_port_deallocate(mach_task_self(), masterPort);
X    masterPort = NULL;
X  }
X}
X
Xint usb_resetep(usb_dev_handle *dev, unsigned int ep)
X{
X  struct darwin_dev_handle *device;
X  io_return_t result = -1;
X  int pipeRef;
X
X  if (!dev)
X    USB_ERROR(-ENXIO);
X
X  if ((device = dev->impl_info) == NULL)
X    USB_ERROR(-ENOENT);
X
X  /* interface is not open */
X  if (!device->interface)
X    USB_ERROR_STR(-EACCES, "usb_resetep: interface used without being claimed");
X
X  if ((pipeRef = ep_to_pipeRef(device, ep)) == -1)
X    USB_ERROR(-EINVAL);
X
X  result = (*(device->interface))->ResetPipe(device->interface, pipeRef);
X
X  if (result != kIOReturnSuccess)
X    USB_ERROR_STR(-darwin_to_errno(result), "usb_resetep(ResetPipe): %s", darwin_error_str(result));
X
X  return 0;
X}
X
Xint usb_clear_halt(usb_dev_handle *dev, unsigned int ep)
X{
X  struct darwin_dev_handle *device;
X  io_return_t result = -1;
X  int pipeRef;
X
X  if (!dev)
X    USB_ERROR(-ENXIO);
X
X  if ((device = dev->impl_info) == NULL)
X    USB_ERROR(-ENOENT);
X
X  /* interface is not open */
X  if (!device->interface)
X    USB_ERROR_STR(-EACCES, "usb_clear_halt: interface used without being claimed");
X
X  if ((pipeRef = ep_to_pipeRef(device, ep)) == -1)
X    USB_ERROR(-EINVAL);
X
X  result = (*(device->interface))->ClearPipeStall(device->interface, pipeRef);
X
X  if (result != kIOReturnSuccess)
X    USB_ERROR_STR(-darwin_to_errno(result), "usb_clear_halt(ClearPipeStall): %s", darwin_error_str(result));
X
X  return 0;
X}
X
Xint usb_reset(usb_dev_handle *dev)
X{
X  struct darwin_dev_handle *device;
X  int result;
X
X  if (!dev)
X    USB_ERROR(-ENXIO);
X
X  if ((device = dev->impl_info) == NULL)
X    USB_ERROR(-ENOENT);
X
X  if (!device->device)
X    USB_ERROR_STR(-ENOENT, "usb_reset: no such device");
X
X  result = (*(device->device))->ResetDevice(device->device);
X
X  if (result != kIOReturnSuccess)
X    USB_ERROR_STR(-darwin_to_errno(result), "usb_reset(ResetDevice): %s", darwin_error_str(result));
X  
X  return 0;
X}
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/darwin.c' 'failed'
fi
# ============= libusb-0.1.8/depcomp ==============
if test -f 'libusb-0.1.8/depcomp' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/depcomp' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/depcomp' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/depcomp' &&
X#! /bin/sh
X
X# depcomp - compile a program generating dependencies as side-effects
X# Copyright 1999, 2000 Free Software Foundation, Inc.
X
X# This program is free software; you can redistribute it and/or modify
X# it under the terms of the GNU General Public License as published by
X# the Free Software Foundation; either version 2, or (at your option)
X# any later version.
X
X# This program is distributed in the hope that it will be useful,
X# but WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X# GNU General Public License for more details.
X
X# You should have received a copy of the GNU General Public License
X# along with this program; if not, write to the Free Software
X# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
X# 02111-1307, USA.
X
X# As a special exception to the GNU General Public License, if you
X# distribute this file as part of a program that contains a
X# configuration script generated by Autoconf, you may include it under
X# the same distribution terms that you use for the rest of that program.
X
X# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
X
Xif test -z "$depmode" || test -z "$source" || test -z "$object"; then
X  echo "depcomp: Variables source, object and depmode must be set" 1>&2
X  exit 1
Xfi
X# `libtool' can also be set to `yes' or `no'.
X
Xdepfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`}
Xtmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
X
Xrm -f "$tmpdepfile"
X
X# Some modes work just like other modes, but use different flags.  We
X# parameterize here, but still list the modes in the big case below,
X# to make depend.m4 easier to write.  Note that we *cannot* use a case
X# here, because this file can only contain one case statement.
Xif test "$depmode" = hp; then
X  # HP compiler uses -M and no extra arg.
X  gccflag=-M
X  depmode=gcc
Xfi
X
Xif test "$depmode" = dashXmstdout; then
X   # This is just like dashmstdout with a different argument.
X   dashmflag=-xM
X   depmode=dashmstdout
Xfi
X
Xcase "$depmode" in
Xgcc3)
X## gcc 3 implements dependency tracking that does exactly what
X## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
X## it if -MD -MP comes after the -MF stuff.  Hmm.
X  "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
X  stat=$?
X  if test $stat -eq 0; then :
X  else
X    rm -f "$tmpdepfile"
X    exit $stat
X  fi
X  mv "$tmpdepfile" "$depfile"
X  ;;
X
Xgcc)
X## There are various ways to get dependency output from gcc.  Here's
X## why we pick this rather obscure method:
X## - Don't want to use -MD because we'd like the dependencies to end
X##   up in a subdir.  Having to rename by hand is ugly.
X##   (We might end up doing this anyway to support other compilers.)
X## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
X##   -MM, not -M (despite what the docs say).
X## - Using -M directly means running the compiler twice (even worse
X##   than renaming).
X  if test -z "$gccflag"; then
X    gccflag=-MD,
X  fi
X  "$@" -Wp,"$gccflag$tmpdepfile"
X  stat=$?
X  if test $stat -eq 0; then :
X  else
X    rm -f "$tmpdepfile"
X    exit $stat
X  fi
X  rm -f "$depfile"
X  echo "$object : \\" > "$depfile"
X  alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
X## The second -e expression handles DOS-style file names with drive letters.
X  sed -e 's/^[^:]*: / /' \
X      -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
X## This next piece of magic avoids the `deleted header file' problem.
X## The problem is that when a header file which appears in a .P file
X## is deleted, the dependency causes make to die (because there is
X## typically no way to rebuild the header).  We avoid this by adding
X## dummy dependencies for each header file.  Too bad gcc doesn't do
X## this for us directly.
X  tr ' ' '
X' < "$tmpdepfile" |
X## Some versions of gcc put a space before the `:'.  On the theory
X## that the space means something, we add a space to the output as
X## well.
X## Some versions of the HPUX 10.20 sed can't process this invocation
X## correctly.  Breaking it into two sed invocations is a workaround.
X    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
X  rm -f "$tmpdepfile"
X  ;;
X
Xhp)
X  # This case exists only to let depend.m4 do its work.  It works by
X  # looking at the text of this script.  This case will never be run,
X  # since it is checked for above.
X  exit 1
X  ;;
X
Xsgi)
X  if test "$libtool" = yes; then
X    "$@" "-Wp,-MDupdate,$tmpdepfile"
X  else
X    "$@" -MDupdate "$tmpdepfile"
X  fi
X  stat=$?
X  if test $stat -eq 0; then :
X  else
X    rm -f "$tmpdepfile"
X    exit $stat
X  fi
X  rm -f "$depfile"
X
X  if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
X    echo "$object : \\" > "$depfile"
X
X    # Clip off the initial element (the dependent).  Don't try to be
X    # clever and replace this with sed code, as IRIX sed won't handle
X    # lines with more than a fixed number of characters (4096 in
X    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
X    # the IRIX cc adds comments like `#:fec' to the end of the
X    # dependency line.
X    tr ' ' '
X' < "$tmpdepfile" \
X    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
X    tr '
X' ' ' >> $depfile
X    echo >> $depfile
X
X    # The second pass generates a dummy entry for each header file.
X    tr ' ' '
X' < "$tmpdepfile" \
X   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
X   >> $depfile
X  else
X    # The sourcefile does not contain any dependencies, so just
X    # store a dummy comment line, to avoid errors with the Makefile
X    # "include basename.Plo" scheme.
X    echo "#dummy" > "$depfile"
X  fi
X  rm -f "$tmpdepfile"
X  ;;
X
Xaix)
X  # The C for AIX Compiler uses -M and outputs the dependencies
X  # in a .u file.  This file always lives in the current directory.
X  # Also, the AIX compiler puts `$object:' at the start of each line;
X  # $object doesn't have directory information.
X  stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
X  tmpdepfile="$stripped.u"
X  outname="$stripped.o"
X  if test "$libtool" = yes; then
X    "$@" -Wc,-M
X  else
X    "$@" -M
X  fi
X
X  stat=$?
X  if test $stat -eq 0; then :
X  else
X    rm -f "$tmpdepfile"
X    exit $stat
X  fi
X
X  if test -f "$tmpdepfile"; then
X    # Each line is of the form `foo.o: dependent.h'.
X    # Do two passes, one to just change these to
X    # `$object: dependent.h' and one to simply `dependent.h:'.
X    sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
X    sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
X  else
X    # The sourcefile does not contain any dependencies, so just
X    # store a dummy comment line, to avoid errors with the Makefile
X    # "include basename.Plo" scheme.
X    echo "#dummy" > "$depfile"
X  fi
X  rm -f "$tmpdepfile"
X  ;;
X
Xtru64)
X   # The Tru64 AIX compiler uses -MD to generate dependencies as a side
X   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
X   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put 
X   # dependencies in `foo.d' instead, so we check for that too.
X   # Subdirectories are respected.
X
X   tmpdepfile1="$object.d"
X   tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'` 
X   if test "$libtool" = yes; then
X      "$@" -Wc,-MD
X   else
X      "$@" -MD
X   fi
X
X   stat=$?
X   if test $stat -eq 0; then :
X   else
X      rm -f "$tmpdepfile1" "$tmpdepfile2"
X      exit $stat
X   fi
X
X   if test -f "$tmpdepfile1"; then
X      tmpdepfile="$tmpdepfile1"
X   else
X      tmpdepfile="$tmpdepfile2"
X   fi
X   if test -f "$tmpdepfile"; then
X      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
X      # That's a space and a tab in the [].
X      sed -e 's,^.*\.[a-z]*:[ 	]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
X   else
X      echo "#dummy" > "$depfile"
X   fi
X   rm -f "$tmpdepfile"
X   ;;
X
X#nosideeffect)
X  # This comment above is used by automake to tell side-effect
X  # dependency tracking mechanisms from slower ones.
X
Xdashmstdout)
X  # Important note: in order to support this mode, a compiler *must*
X  # always write the proprocessed file to stdout, regardless of -o,
X  # because we must use -o when running libtool.
X  test -z "$dashmflag" && dashmflag=-M
X  ( IFS=" "
X    case " $* " in
X    *" --mode=compile "*) # this is libtool, let us make it quiet
X      for arg
X      do # cycle over the arguments
X        case "$arg" in
X	"--mode=compile")
X	  # insert --quiet before "--mode=compile"
X	  set fnord "$@" --quiet
X	  shift # fnord
X	  ;;
X	esac
X	set fnord "$@" "$arg"
X	shift # fnord
X	shift # "$arg"
X      done
X      ;;
X    esac
X    "$@" $dashmflag | sed 's:^[^:]*\:[ 	]*:'"$object"'\: :' > "$tmpdepfile"
X  ) &
X  proc=$!
X  "$@"
X  stat=$?
X  wait "$proc"
X  if test "$stat" != 0; then exit $stat; fi
X  rm -f "$depfile"
X  cat < "$tmpdepfile" > "$depfile"
X  tr ' ' '
X' < "$tmpdepfile" | \
X## Some versions of the HPUX 10.20 sed can't process this invocation
X## correctly.  Breaking it into two sed invocations is a workaround.
X    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
X  rm -f "$tmpdepfile"
X  ;;
X
XdashXmstdout)
X  # This case only exists to satisfy depend.m4.  It is never actually
X  # run, as this mode is specially recognized in the preamble.
X  exit 1
X  ;;
X
Xmakedepend)
X  # X makedepend
X  (
X    shift
X    cleared=no
X    for arg in "$@"; do
X      case $cleared in no)
X        set ""; shift
X	cleared=yes
X      esac
X      case "$arg" in
X        -D*|-I*)
X	  set fnord "$@" "$arg"; shift;;
X	-*)
X	  ;;
X	*)
X	  set fnord "$@" "$arg"; shift;;
X      esac
X    done
X    obj_suffix="`echo $object | sed 's/^.*\././'`"
X    touch "$tmpdepfile"
X    ${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@"
X  ) &
X  proc=$!
X  "$@"
X  stat=$?
X  wait "$proc"
X  if test "$stat" != 0; then exit $stat; fi
X  rm -f "$depfile"
X  cat < "$tmpdepfile" > "$depfile"
X  tail +3 "$tmpdepfile" | tr ' ' '
X' | \
X## Some versions of the HPUX 10.20 sed can't process this invocation
X## correctly.  Breaking it into two sed invocations is a workaround.
X    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
X  rm -f "$tmpdepfile" "$tmpdepfile".bak
X  ;;
X
Xcpp)
X  # Important note: in order to support this mode, a compiler *must*
X  # always write the proprocessed file to stdout, regardless of -o,
X  # because we must use -o when running libtool.
X  ( IFS=" "
X    case " $* " in
X    *" --mode=compile "*)
X      for arg
X      do # cycle over the arguments
X        case $arg in
X	"--mode=compile")
X	  # insert --quiet before "--mode=compile"
X	  set fnord "$@" --quiet
X	  shift # fnord
X	  ;;
X	esac
X	set fnord "$@" "$arg"
X	shift # fnord
X	shift # "$arg"
X      done
X      ;;
X    esac
X    "$@" -E |
X    sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
X    sed '$ s: \\$::' > "$tmpdepfile"
X  ) &
X  proc=$!
X  "$@"
X  stat=$?
X  wait "$proc"
X  if test "$stat" != 0; then exit $stat; fi
X  rm -f "$depfile"
X  echo "$object : \\" > "$depfile"
X  cat < "$tmpdepfile" >> "$depfile"
X  sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
X  rm -f "$tmpdepfile"
X  ;;
X
Xmsvisualcpp)
X  # Important note: in order to support this mode, a compiler *must*
X  # always write the proprocessed file to stdout, regardless of -o,
X  # because we must use -o when running libtool.
X  ( IFS=" "
X    case " $* " in
X    *" --mode=compile "*)
X      for arg
X      do # cycle over the arguments
X        case $arg in
X	"--mode=compile")
X	  # insert --quiet before "--mode=compile"
X	  set fnord "$@" --quiet
X	  shift # fnord
X	  ;;
X	esac
X	set fnord "$@" "$arg"
X	shift # fnord
X	shift # "$arg"
X      done
X      ;;
X    esac
X    "$@" -E |
X    sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
X  ) &
X  proc=$!
X  "$@"
X  stat=$?
X  wait "$proc"
X  if test "$stat" != 0; then exit $stat; fi
X  rm -f "$depfile"
X  echo "$object : \\" > "$depfile"
X  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::	\1 \\:p' >> "$depfile"
X  echo "	" >> "$depfile"
X  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
X  rm -f "$tmpdepfile"
X  ;;
X
Xnone)
X  exec "$@"
X  ;;
X
X*)
X  echo "Unknown depmode $depmode" 1>&2
X  exit 1
X  ;;
Xesac
X
Xexit 0
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/depcomp' 'failed'
fi
# ============= libusb-0.1.8/descriptors.c ==============
if test -f 'libusb-0.1.8/descriptors.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/descriptors.c' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/descriptors.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/descriptors.c' &&
X/*
X * Parses descriptors
X *
X * Copyright (c) 2001 Johannes Erdfelt <johannes@erdfelt.com>
X *
X * This library is covered by the LGPL, read LICENSE for details.
X */
X
X#include <stdio.h>
X#include "usbi.h"
X
Xint usb_get_descriptor_by_endpoint(usb_dev_handle *udev, int ep,
X	unsigned char type, unsigned char index, void *buf, int size)
X{
X  memset(buf, 0, size);
X
X  return usb_control_msg(udev, ep | USB_ENDPOINT_IN, USB_REQ_GET_DESCRIPTOR,
X                        (type << 8) + index, 0, buf, size, 1000);
X}
X
Xint usb_get_descriptor(usb_dev_handle *udev, unsigned char type,
X	unsigned char index, void *buf, int size)
X{
X  memset(buf, 0, size);
X
X  return usb_control_msg(udev, USB_ENDPOINT_IN, USB_REQ_GET_DESCRIPTOR,
X                        (type << 8) + index, 0, buf, size, 1000);
X}
X
X/*
X * This code looks surprisingly similar to the code I wrote for the Linux
X * kernel. It's not a coincidence :)
X */
X
Xstatic int usb_parse_endpoint(struct usb_endpoint_descriptor *endpoint, unsigned char *buffer, int size)
X{
X  struct usb_descriptor_header *header;
X  unsigned char *begin;
X  int parsed = 0, len, numskipped;
X
X  header = (struct usb_descriptor_header *)buffer;
X
X  /* Everything should be fine being passed into here, but we sanity */
X  /*  check JIC */
X  if (header->bLength > size) {
X    if (usb_debug >= 1)
X      fprintf(stderr, "ran out of descriptors parsing\n");
X    return -1;
X  }
X                
X  if (header->bDescriptorType != USB_DT_ENDPOINT) {
X    if (usb_debug >= 2)
X      fprintf(stderr, "unexpected descriptor 0x%X, expecting endpoint descriptor, type 0x%X\n",
X         endpoint->bDescriptorType, USB_DT_ENDPOINT);
X    return parsed;
X  }
X  if (header->bLength == USB_DT_ENDPOINT_AUDIO_SIZE)
X    memcpy(endpoint, buffer, USB_DT_ENDPOINT_AUDIO_SIZE);
X  else
X    memcpy(endpoint, buffer, USB_DT_ENDPOINT_SIZE);
X        
X  USB_LE16_TO_CPU(endpoint->wMaxPacketSize);
X
X  buffer += header->bLength;
X  size -= header->bLength;
X  parsed += header->bLength;
X
X  /* Skip over the rest of the Class Specific or Vendor Specific */
X  /*  descriptors */
X  begin = buffer;
X  numskipped = 0;
X  while (size >= sizeof(struct usb_descriptor_header)) {
X    header = (struct usb_descriptor_header *)buffer;
X
X    if (header->bLength < 2) {
X      if (usb_debug >= 1)
X        fprintf(stderr, "invalid descriptor length of %d\n", header->bLength);
X      return -1;
X    }
X
X    /* If we find another "proper" descriptor then we're done  */
X    if ((header->bDescriptorType == USB_DT_ENDPOINT) ||
X        (header->bDescriptorType == USB_DT_INTERFACE) ||
X        (header->bDescriptorType == USB_DT_CONFIG) ||
X        (header->bDescriptorType == USB_DT_DEVICE))
X      break;
X
X    if (usb_debug >= 1)
X      fprintf(stderr, "skipping descriptor 0x%X\n", header->bDescriptorType);
X    numskipped++;
X
X    buffer += header->bLength;
X    size -= header->bLength;
X    parsed += header->bLength;
X  }
X
X  if (numskipped && usb_debug >= 2)
X    fprintf(stderr, "skipped %d class/vendor specific endpoint descriptors\n", numskipped);
X
X  /* Copy any unknown descriptors into a storage area for drivers */
X  /*  to later parse */
X  len = (int)(buffer - begin);
X  if (!len) {
X    endpoint->extra = NULL;
X    endpoint->extralen = 0;
X    return parsed;
X  }
X
X  endpoint->extra = malloc(len);
X  if (!endpoint->extra) {
X    if (usb_debug >= 1)
X      fprintf(stderr, "couldn't allocate memory for endpoint extra descriptors\n");
X    endpoint->extralen = 0;
X    return parsed;
X  }
X
X  memcpy(endpoint->extra, begin, len);
X  endpoint->extralen = len;
X
X  return parsed;
X}
X
Xstatic int usb_parse_interface(struct usb_interface *interface,
X	unsigned char *buffer, int size)
X{
X  int i, len, numskipped, retval, parsed = 0;
X  struct usb_descriptor_header *header;
X  struct usb_interface_descriptor *ifp;
X  unsigned char *begin;
X
X  interface->num_altsetting = 0;
X
X  while (size > 0) {
X    interface->altsetting = realloc(interface->altsetting, sizeof(struct usb_interface_descriptor) * (interface->num_altsetting + 1));
X    if (!interface->altsetting) {
X      if (usb_debug >= 1)
X        fprintf(stderr, "couldn't malloc interface->altsetting\n");
X      return -1;
X    }
X
X    ifp = interface->altsetting + interface->num_altsetting;
X    interface->num_altsetting++;
X
X    memcpy(ifp, buffer, USB_DT_INTERFACE_SIZE);
X
X    /* Skip over the interface */
X    buffer += ifp->bLength;
X    parsed += ifp->bLength;
X    size -= ifp->bLength;
X
X    begin = buffer;
X    numskipped = 0;
X
X    /* Skip over any interface, class or vendor descriptors */
X    while (size >= sizeof(struct usb_descriptor_header)) {
X      header = (struct usb_descriptor_header *)buffer;
X
X      if (header->bLength < 2) {
X        if (usb_debug >= 1)
X          fprintf(stderr, "invalid descriptor length of %d\n", header->bLength);
X        return -1;
X      }
X
X      /* If we find another "proper" descriptor then we're done */
X      if ((header->bDescriptorType == USB_DT_INTERFACE) ||
X          (header->bDescriptorType == USB_DT_ENDPOINT) ||
X          (header->bDescriptorType == USB_DT_CONFIG) ||
X          (header->bDescriptorType == USB_DT_DEVICE))
X        break;
X
X      numskipped++;
X
X      buffer += header->bLength;
X      parsed += header->bLength;
X      size -= header->bLength;
X    }
X
X    if (numskipped && usb_debug >= 2)
X      fprintf(stderr, "skipped %d class/vendor specific interface descriptors\n", numskipped);
X
X    /* Copy any unknown descriptors into a storage area for */
X    /*  drivers to later parse */
X    len = (int)(buffer - begin);
X    if (!len) {
X      ifp->extra = NULL;
X      ifp->extralen = 0;
X    } else {
X      ifp->extra = malloc(len);
X      if (!ifp->extra) {
X        if (usb_debug >= 1)
X          fprintf(stderr, "couldn't allocate memory for interface extra descriptors\n");
X        ifp->extralen = 0;
X        return -1;
X      }
X      memcpy(ifp->extra, begin, len);
X      ifp->extralen = len;
X    }
X
X    /* Did we hit an unexpected descriptor? */
X    header = (struct usb_descriptor_header *)buffer;
X    if ((size >= sizeof(struct usb_descriptor_header)) &&
X        ((header->bDescriptorType == USB_DT_CONFIG) ||
X        (header->bDescriptorType == USB_DT_DEVICE)))
X      return parsed;
X
X    if (ifp->bNumEndpoints > USB_MAXENDPOINTS) {
X      if (usb_debug >= 1)
X        fprintf(stderr, "too many endpoints\n");
X      return -1;
X    }
X
X    ifp->endpoint = (struct usb_endpoint_descriptor *)
X                     malloc(ifp->bNumEndpoints *
X                     sizeof(struct usb_endpoint_descriptor));
X    if (!ifp->endpoint) {
X      if (usb_debug >= 1)
X        fprintf(stderr, "couldn't allocate memory for ifp->endpoint\n");
X      return -1;      
X    }
X
X    memset(ifp->endpoint, 0, ifp->bNumEndpoints *
X           sizeof(struct usb_endpoint_descriptor));
X
X    for (i = 0; i < ifp->bNumEndpoints; i++) {
X      header = (struct usb_descriptor_header *)buffer;
X
X      if (header->bLength > size) {
X        if (usb_debug >= 1)
X          fprintf(stderr, "ran out of descriptors parsing\n");
X        return -1;
X      }
X                
X      retval = usb_parse_endpoint(ifp->endpoint + i, buffer, size);
X      if (retval < 0)
X        return retval;
X
X      buffer += retval;
X      parsed += retval;
X      size -= retval;
X    }
X
X    /* We check to see if it's an alternate to this one */
X    ifp = (struct usb_interface_descriptor *)buffer;
X    if (size < USB_DT_INTERFACE_SIZE ||
X        ifp->bDescriptorType != USB_DT_INTERFACE ||
X        !ifp->bAlternateSetting)
X      return parsed;
X  }
X
X  return parsed;
X}
X
Xint usb_parse_configuration(struct usb_config_descriptor *config, char *buffer)
X{
X  int i, retval, size;
X  struct usb_descriptor_header *header;
X
X  memcpy(config, buffer, USB_DT_CONFIG_SIZE);
X  USB_LE16_TO_CPU(config->wTotalLength);
X  size = config->wTotalLength;
X
X  if (config->bNumInterfaces > USB_MAXINTERFACES) {
X    if (usb_debug >= 1)
X      fprintf(stderr, "too many interfaces\n");
X    return -1;
X  }
X
X  config->interface = (struct usb_interface *)
X                       malloc(config->bNumInterfaces *
X                       sizeof(struct usb_interface));
X  if (!config->interface) {
X    if (usb_debug >= 1)
X      fprintf(stderr, "out of memory\n");
X    return -1;      
X  }
X
X  memset(config->interface, 0, config->bNumInterfaces * sizeof(struct usb_interface));
X
X  buffer += config->bLength;
X  size -= config->bLength;
X        
X  config->extra = NULL;
X  config->extralen = 0;
X
X  for (i = 0; i < config->bNumInterfaces; i++) {
X    int numskipped, len;
X    char *begin;
X
X    /* Skip over the rest of the Class Specific or Vendor */
X    /*  Specific descriptors */
X    begin = buffer;
X    numskipped = 0;
X    while (size >= sizeof(struct usb_descriptor_header)) {
X      header = (struct usb_descriptor_header *)buffer;
X
X      if ((header->bLength > size) || (header->bLength < 2)) {
X        if (usb_debug >= 1)
X          fprintf(stderr, "invalid descriptor length of %d\n", header->bLength);
X        return -1;
X      }
X
X      /* If we find another "proper" descriptor then we're done */
X      if ((header->bDescriptorType == USB_DT_ENDPOINT) ||
X          (header->bDescriptorType == USB_DT_INTERFACE) ||
X          (header->bDescriptorType == USB_DT_CONFIG) ||
X          (header->bDescriptorType == USB_DT_DEVICE))
X        break;
X
X      if (usb_debug >= 2)
X        fprintf(stderr, "skipping descriptor 0x%X\n", header->bDescriptorType);
X      numskipped++;
X
X      buffer += header->bLength;
X      size -= header->bLength;
X    }
X
X    if (numskipped && usb_debug >= 2)
X      fprintf(stderr, "skipped %d class/vendor specific endpoint descriptors\n", numskipped);
X
X    /* Copy any unknown descriptors into a storage area for */
X    /*  drivers to later parse */
X    len = (int)(buffer - begin);
X    if (len) {
X      /* FIXME: We should realloc and append here */
X      if (!config->extralen) {
X        config->extra = malloc(len);
X        if (!config->extra) {
X          if (usb_debug >= 1)
X            fprintf(stderr, "couldn't allocate memory for config extra descriptors\n");
X          config->extralen = 0;
X          return -1;
X        }
X
X        memcpy(config->extra, begin, len);
X        config->extralen = len;
X      }
X    }
X
X    retval = usb_parse_interface(config->interface + i, buffer, size);
X    if (retval < 0)
X      return retval;
X
X    buffer += retval;
X    size -= retval;
X  }
X
X  return size;
X}
X
Xvoid usb_destroy_configuration(struct usb_device *dev)
X{
X  int c, i, j, k;
X        
X  if (!dev->config)
X    return;
X
X  for (c = 0; c < dev->descriptor.bNumConfigurations; c++) {
X    struct usb_config_descriptor *cf = &dev->config[c];
X
X    if (!cf->interface)
X      break;
X
X    for (i = 0; i < cf->bNumInterfaces; i++) {
X      struct usb_interface *ifp = &cf->interface[i];
X                                
X      if (!ifp->altsetting)
X        break;
X
X      for (j = 0; j < ifp->num_altsetting; j++) {
X        struct usb_interface_descriptor *as = &ifp->altsetting[j];
X                                        
X        if (as->extra)
X          free(as->extra);
X
X        if (!as->endpoint)
X          break;
X                                        
X        for (k = 0; k < as->bNumEndpoints; k++) {
X          if (as->endpoint[k].extra)
X            free(as->endpoint[k].extra);
X        }       
X        free(as->endpoint);
X      }
X
X      free(ifp->altsetting);
X    }
X
X    free(cf->interface);
X  }
X
X  free(dev->config);
X}
X
Xvoid usb_fetch_and_parse_descriptors(usb_dev_handle *udev)
X{
X  struct usb_device *dev = udev->device;
X  int i;
X
X  if (dev->descriptor.bNumConfigurations > USB_MAXCONFIG) {
X    if (usb_debug >= 1)
X      fprintf(stderr, "Too many configurations (%d > %d)\n", dev->descriptor.bNumConfigurations, USB_MAXCONFIG);
X    return;
X  }
X
X  if (dev->descriptor.bNumConfigurations < 1) {
X    if (usb_debug >= 1)
X      fprintf(stderr, "Not enough configurations (%d < %d)\n", dev->descriptor.bNumConfigurations, 1);
X    return;
X  }
X
X  dev->config = (struct usb_config_descriptor *)malloc(dev->descriptor.bNumConfigurations * sizeof(struct usb_config_descriptor));
X  if (!dev->config) {
X    if (usb_debug >= 1)
X      fprintf(stderr, "Unable to allocate memory for config descriptor\n");
X    return;
X  }
X
X  memset(dev->config, 0, dev->descriptor.bNumConfigurations *
X	sizeof(struct usb_config_descriptor));
X
X  for (i = 0; i < dev->descriptor.bNumConfigurations; i++) {
X    char buffer[8], *bigbuffer;
X    struct usb_config_descriptor *desc = (struct usb_config_descriptor *)buffer;
X    int res;
X
X    /* Get the first 8 bytes so we can figure out what the total length is */
X    res = usb_get_descriptor(udev, USB_DT_CONFIG, i, buffer, 8);
X    if (res < 8) {
X      if (usb_debug >= 1) {
X        if (res < 0)
X          fprintf(stderr, "Unable to get descriptor (%d)\n", res);
X        else
X          fprintf(stderr, "Config descriptor too short (expected %d, got %d)\n", 8, res);
X      }
X
X      goto err;
X    }
X
X    USB_LE16_TO_CPU(desc->wTotalLength);
X
X    bigbuffer = malloc(desc->wTotalLength);
X    if (!bigbuffer) {
X      if (usb_debug >= 1)
X        fprintf(stderr, "Unable to allocate memory for descriptors\n");
X      goto err;
X    }
X
X    res = usb_get_descriptor(udev, USB_DT_CONFIG, i, bigbuffer, desc->wTotalLength);
X    if (res < desc->wTotalLength) {
X      if (usb_debug >= 1) {
X        if (res < 0)
X          fprintf(stderr, "Unable to get descriptor (%d)\n", res);
X        else
X          fprintf(stderr, "Config descriptor too short (expected %d, got %d)\n", desc->wTotalLength, res);
X      }
X
X      free(bigbuffer);
X      goto err;
X    }
X
X    res = usb_parse_configuration(&dev->config[i], bigbuffer);
X    if (usb_debug >= 2) {
X      if (res > 0)
X        fprintf(stderr, "Descriptor data still left\n");
X      else if (res < 0)
X        fprintf(stderr, "Unable to parse descriptors\n");
X    }
X
X    free(bigbuffer);
X  }
X
X  return;
X
Xerr:
X  free(dev->config);
X
X  dev->config = NULL;
X}
X
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/descriptors.c' 'failed'
fi
# ============= libusb-0.1.8/error.c ==============
if test -f 'libusb-0.1.8/error.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/error.c' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/error.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/error.c' &&
X/*
X * USB Error messages
X *
X * Copyright (c) 2000-2001 Johannes Erdfelt <johannes@erdfelt.com>
X *
X * This library is covered by the LGPL, read LICENSE for details.
X */
X
X#include <errno.h>
X#include <string.h>
X
X#include "usb.h"
X#include "error.h"
X
Xchar usb_error_str[1024] = "";
Xint usb_error_errno = 0;
Xusb_error_type_t usb_error_type = USB_ERROR_TYPE_NONE;
X
Xchar *usb_strerror(void)
X{
X  switch (usb_error_type) {
X  case USB_ERROR_TYPE_NONE:
X    return "No error";
X  case USB_ERROR_TYPE_STRING:
X    return usb_error_str;
X  case USB_ERROR_TYPE_ERRNO:
X    if (usb_error_errno > -USB_ERROR_BEGIN)
X      return strerror(usb_error_errno);
X    else
X      /* Any error we don't know falls under here */
X      return "Unknown error";
X  }
X
X  return "Unknown error";
X}
X
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/error.c' 'failed'
fi
# ============= libusb-0.1.8/error.h ==============
if test -f 'libusb-0.1.8/error.h' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/error.h' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/error.h' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/error.h' &&
X#ifndef _ERROR_H_
X#define _ERROR_H_
X
Xtypedef enum {
X  USB_ERROR_TYPE_NONE = 0,
X  USB_ERROR_TYPE_STRING,
X  USB_ERROR_TYPE_ERRNO,
X} usb_error_type_t;
X
Xextern char usb_error_str[1024];
Xextern int usb_error_errno;
Xextern usb_error_type_t usb_error_type;
X
X#define USB_ERROR(x) \
X	do { \
X          usb_error_type = USB_ERROR_TYPE_ERRNO; \
X          usb_error_errno = x; \
X	  return x; \
X	} while (0)
X
X#define USB_ERROR_STR(x, format, args...) \
X	do { \
X	  usb_error_type = USB_ERROR_TYPE_STRING; \
X	  snprintf(usb_error_str, sizeof(usb_error_str) - 1, format, ## args); \
X          if (usb_debug >= 2) \
X            fprintf(stderr, "USB error: %s\n", usb_error_str); \
X	  return x; \
X	} while (0)
X
X#endif /* _ERROR_H_ */
X
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/error.h' 'failed'
fi
# ============= libusb-0.1.8/install-sh ==============
if test -f 'libusb-0.1.8/install-sh' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/install-sh' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/install-sh' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/install-sh' &&
X#!/bin/sh
X#
X# install - install a program, script, or datafile
X# This comes from X11R5 (mit/util/scripts/install.sh).
X#
X# Copyright 1991 by the Massachusetts Institute of Technology
X#
X# Permission to use, copy, modify, distribute, and sell this software and its
X# documentation for any purpose is hereby granted without fee, provided that
X# the above copyright notice appear in all copies and that both that
X# copyright notice and this permission notice appear in supporting
X# documentation, and that the name of M.I.T. not be used in advertising or
X# publicity pertaining to distribution of the software without specific,
X# written prior permission.  M.I.T. makes no representations about the
X# suitability of this software for any purpose.  It is provided "as is"
X# without express or implied warranty.
X#
X# Calling this script install-sh is preferred over install.sh, to prevent
X# `make' implicit rules from creating a file called install from it
X# when there is no Makefile.
X#
X# This script is compatible with the BSD install script, but was written
X# from scratch.  It can only install one file at a time, a restriction
X# shared with many OS's install programs.
X
X
X# set DOITPROG to echo to test this script
X
X# Don't use :- since 4.3BSD and earlier shells don't like it.
Xdoit="${DOITPROG-}"
X
X
X# put in absolute paths if you don't have them in your path; or use env. vars.
X
Xmvprog="${MVPROG-mv}"
Xcpprog="${CPPROG-cp}"
Xchmodprog="${CHMODPROG-chmod}"
Xchownprog="${CHOWNPROG-chown}"
Xchgrpprog="${CHGRPPROG-chgrp}"
Xstripprog="${STRIPPROG-strip}"
Xrmprog="${RMPROG-rm}"
Xmkdirprog="${MKDIRPROG-mkdir}"
X
Xtransformbasename=""
Xtransform_arg=""
Xinstcmd="$mvprog"
Xchmodcmd="$chmodprog 0755"
Xchowncmd=""
Xchgrpcmd=""
Xstripcmd=""
Xrmcmd="$rmprog -f"
Xmvcmd="$mvprog"
Xsrc=""
Xdst=""
Xdir_arg=""
X
Xwhile [ x"$1" != x ]; do
X    case $1 in
X	-c) instcmd="$cpprog"
X	    shift
X	    continue;;
X
X	-d) dir_arg=true
X	    shift
X	    continue;;
X
X	-m) chmodcmd="$chmodprog $2"
X	    shift
X	    shift
X	    continue;;
X
X	-o) chowncmd="$chownprog $2"
X	    shift
X	    shift
X	    continue;;
X
X	-g) chgrpcmd="$chgrpprog $2"
X	    shift
X	    shift
X	    continue;;
X
X	-s) stripcmd="$stripprog"
X	    shift
X	    continue;;
X
X	-t=*) transformarg=`echo $1 | sed 's/-t=//'`
X	    shift
X	    continue;;
X
X	-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
X	    shift
X	    continue;;
X
X	*)  if [ x"$src" = x ]
X	    then
X		src=$1
X	    else
X		# this colon is to work around a 386BSD /bin/sh bug
X		:
X		dst=$1
X	    fi
X	    shift
X	    continue;;
X    esac
Xdone
X
Xif [ x"$src" = x ]
Xthen
X	echo "install:	no input file specified"
X	exit 1
Xelse
X	true
Xfi
X
Xif [ x"$dir_arg" != x ]; then
X	dst=$src
X	src=""
X	
X	if [ -d $dst ]; then
X		instcmd=:
X		chmodcmd=""
X	else
X		instcmd=mkdir
X	fi
Xelse
X
X# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
X# might cause directories to be created, which would be especially bad 
X# if $src (and thus $dsttmp) contains '*'.
X
X	if [ -f $src -o -d $src ]
X	then
X		true
X	else
X		echo "install:  $src does not exist"
X		exit 1
X	fi
X	
X	if [ x"$dst" = x ]
X	then
X		echo "install:	no destination specified"
X		exit 1
X	else
X		true
X	fi
X
X# If destination is a directory, append the input filename; if your system
X# does not like double slashes in filenames, you may need to add some logic
X
X	if [ -d $dst ]
X	then
X		dst="$dst"/`basename $src`
X	else
X		true
X	fi
Xfi
X
X## this sed command emulates the dirname command
Xdstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
X
X# Make sure that the destination directory exists.
X#  this part is taken from Noah Friedman's mkinstalldirs script
X
X# Skip lots of stat calls in the usual case.
Xif [ ! -d "$dstdir" ]; then
XdefaultIFS='	
X'
XIFS="${IFS-${defaultIFS}}"
X
XoIFS="${IFS}"
X# Some sh's can't handle IFS=/ for some reason.
XIFS='%'
Xset - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
XIFS="${oIFS}"
X
Xpathcomp=''
X
Xwhile [ $# -ne 0 ] ; do
X	pathcomp="${pathcomp}${1}"
X	shift
X
X	if [ ! -d "${pathcomp}" ] ;
X        then
X		$mkdirprog "${pathcomp}"
X	else
X		true
X	fi
X
X	pathcomp="${pathcomp}/"
Xdone
Xfi
X
Xif [ x"$dir_arg" != x ]
Xthen
X	$doit $instcmd $dst &&
X
X	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
X	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
X	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
X	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
Xelse
X
X# If we're going to rename the final executable, determine the name now.
X
X	if [ x"$transformarg" = x ] 
X	then
X		dstfile=`basename $dst`
X	else
X		dstfile=`basename $dst $transformbasename | 
X			sed $transformarg`$transformbasename
X	fi
X
X# don't allow the sed command to completely eliminate the filename
X
X	if [ x"$dstfile" = x ] 
X	then
X		dstfile=`basename $dst`
X	else
X		true
X	fi
X
X# Make a temp file name in the proper directory.
X
X	dsttmp=$dstdir/#inst.$$#
X
X# Move or copy the file name to the temp name
X
X	$doit $instcmd $src $dsttmp &&
X
X	trap "rm -f ${dsttmp}" 0 &&
X
X# and set any options; do chmod last to preserve setuid bits
X
X# If any of these fail, we abort the whole thing.  If we want to
X# ignore errors from any of these, just make sure not to ignore
X# errors from the above "$doit $instcmd $src $dsttmp" command.
X
X	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
X	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
X	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
X	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
X
X# Now rename the file to the real destination.
X
X	$doit $rmcmd -f $dstdir/$dstfile &&
X	$doit $mvcmd $dsttmp $dstdir/$dstfile 
X
Xfi &&
X
X
Xexit 0
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/install-sh' 'failed'
fi
# ============= libusb-0.1.8/libusb-config.in ==============
if test -f 'libusb-0.1.8/libusb-config.in' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/libusb-config.in' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/libusb-config.in' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/libusb-config.in' &&
X#!/bin/sh
X
Xprefix=@prefix@
Xexec_prefix=@exec_prefix@
Xexec_prefix_set=no
X
Xusage()
X{
X	cat <<EOF
XUsage: libusb-config [OPTIONS] [LIBRARIES]
XOptions:
X	[--prefix[=DIR]]
X	[--exec-prefix[=DIR]]
X	[--version]
X	[--libs]
X	[--cflags]
XEOF
X	exit $1
X}
X
Xif test $# -eq 0; then
X	usage 1 1>&2
Xfi
X
Xwhile test $# -gt 0; do
X  case "$1" in
X  -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
X  *) optarg= ;;
X  esac
X
X  case $1 in
X    --prefix=*)
X      prefix=$optarg
X      if test $exec_prefix_set = no ; then
X        exec_prefix=$optarg
X      fi
X      ;;
X    --prefix)
X      echo_prefix=yes
X      ;;
X    --exec-prefix=*)
X      exec_prefix=$optarg
X      exec_prefix_set=yes
X      ;;
X    --exec-prefix)
X      echo_exec_prefix=yes
X      ;;
X    --version)
X      echo @LIBUSB_VERSION@
X      exit 0
X      ;;
X    --cflags)
X      if test "@includedir@" != /usr/include ; then
X        includes="-I@includedir@"
X      fi
X      echo_cflags=yes
X      ;;
X    --libs)
X      echo_libs=yes
X      ;;
X    *)
X      usage 1 1>&2
X      ;;
X  esac
X  shift
Xdone
X
Xif test "$echo_prefix" = "yes"; then
X	echo $prefix
Xfi
Xif test "$echo_exec_prefix" = "yes"; then
X	echo $exec_prefix
Xfi
Xif test "$echo_cflags" = "yes"; then
X	echo $includes
Xfi
Xif test "$echo_libs" = "yes"; then
X	echo -L@libdir@ -lusb @OSLIBS@
Xfi
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/libusb-config.in' 'failed'
fi
# ============= libusb-0.1.8/libusb.spec ==============
if test -f 'libusb-0.1.8/libusb.spec' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/libusb.spec' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/libusb.spec' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/libusb.spec' &&
X# Note that this is NOT a relocatable package
X%define ver      0.1.8
X%define RELEASE  1
X%define rel      %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE}
X%define prefix   /usr
X
XSummary: Application access to USB devices
XName: libusb
XVersion: %ver
XRelease: %rel
XCopyright: LGPL
XGroup: Libraries
XSource: ftp://ftp.libusb.sourceforge.net/pub/libusb/libusb-%{ver}.tar.gz
XBuildRoot: /var/tmp/libusb-%{PACKAGE_VERSION}-root
XURL: http://libusb.sourceforge.net
X
X%description
XProvides a library for application access to USB devices. Development
Xlibs and headers are in libusb-devel
X
X%package devel
XSummary: Application USB device access library
XGroup: System Environment/Libraries
X
X%description devel
XStatic libraries and header files for the USB device access library
X
X
X%changelog
X
X%prep
X%setup
X
X%build
XCFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%prefix
Xmake
X
X%install
Xrm -rf $RPM_BUILD_ROOT
X
Xmake prefix=$RPM_BUILD_ROOT%{prefix} install
X
X%clean
Xrm -rf $RPM_BUILD_ROOT
X
X%post -p /sbin/ldconfig
X
X%postun -p /sbin/ldconfig
X
X%files
X%defattr(-, root, root)
X
X%doc AUTHORS COPYING LICENSE ChangeLog NEWS README
X%{prefix}/lib/libusb-0.1.so.*
X
X%files devel
X%defattr(-, root, root)
X
X%{prefix}/lib/*.so
X%{prefix}/lib/*a
X%{prefix}/include/*
X%{prefix}/bin/*
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/libusb.spec' 'failed'
fi
# ============= libusb-0.1.8/libusb.spec.in ==============
if test -f 'libusb-0.1.8/libusb.spec.in' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/libusb.spec.in' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/libusb.spec.in' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/libusb.spec.in' &&
X# Note that this is NOT a relocatable package
X%define ver      @VERSION@
X%define RELEASE  1
X%define rel      %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE}
X%define prefix   /usr
X
XSummary: Application access to USB devices
XName: libusb
XVersion: %ver
XRelease: %rel
XCopyright: LGPL
XGroup: Libraries
XSource: ftp://ftp.libusb.sourceforge.net/pub/libusb/libusb-%{ver}.tar.gz
XBuildRoot: /var/tmp/libusb-%{PACKAGE_VERSION}-root
XURL: http://libusb.sourceforge.net
X
X%description
XProvides a library for application access to USB devices. Development
Xlibs and headers are in libusb-devel
X
X%package devel
XSummary: Application USB device access library
XGroup: System Environment/Libraries
X
X%description devel
XStatic libraries and header files for the USB device access library
X
X
X%changelog
X
X%prep
X%setup
X
X%build
XCFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%prefix
Xmake
X
X%install
Xrm -rf $RPM_BUILD_ROOT
X
Xmake prefix=$RPM_BUILD_ROOT%{prefix} install
X
X%clean
Xrm -rf $RPM_BUILD_ROOT
X
X%post -p /sbin/ldconfig
X
X%postun -p /sbin/ldconfig
X
X%files
X%defattr(-, root, root)
X
X%doc AUTHORS COPYING LICENSE ChangeLog NEWS README
X%{prefix}/lib/libusb-0.1.so.*
X
X%files devel
X%defattr(-, root, root)
X
X%{prefix}/lib/*.so
X%{prefix}/lib/*a
X%{prefix}/include/*
X%{prefix}/bin/*
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/libusb.spec.in' 'failed'
fi
# ============= libusb-0.1.8/linux.c ==============
if test -f 'libusb-0.1.8/linux.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/linux.c' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/linux.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/linux.c' &&
X/*
X * Linux USB support
X *
X * Copyright (c) 2000-2003 Johannes Erdfelt <johannes@erdfelt.com>
X *
X * This library is covered by the LGPL, read LICENSE for details.
X */
X
X#include <stdlib.h>	/* getenv, etc */
X#include <unistd.h>
X#include <string.h>
X#include <stdio.h>
X#include <fcntl.h>
X#include <errno.h>
X#include <sys/time.h>
X#include <dirent.h>
X
X#include "linux.h"
X#include "usbi.h"
X
Xstatic char usb_path[PATH_MAX + 1] = "";
X
Xint usb_os_open(usb_dev_handle *dev)
X{
X  char filename[PATH_MAX + 1];
X
X  snprintf(filename, sizeof(filename) - 1, "%s/%s/%s",
X    usb_path, dev->bus->dirname, dev->device->filename);
X
X  dev->fd = open(filename, O_RDWR);
X  if (dev->fd < 0) {
X    dev->fd = open(filename, O_RDONLY);
X    if (dev->fd < 0)
X      USB_ERROR_STR(-errno, "failed to open %s: %s",
X	filename, strerror(errno));
X  }
X
X  return 0;
X}
X
Xint usb_os_close(usb_dev_handle *dev)
X{
X  if (dev->fd < 0)
X    return 0;
X
X  if (close(dev->fd) == -1)
X    /* Failing trying to close a file really isn't an error, so return 0 */
X    USB_ERROR_STR(0, "tried to close device fd %d: %s", dev->fd,
X	strerror(errno));
X
X  return 0;
X}
X
Xint usb_set_configuration(usb_dev_handle *dev, int configuration)
X{
X  int ret;
X
X  ret = ioctl(dev->fd, IOCTL_USB_SETCONFIG, &configuration);
X  if (ret < 0)
X    USB_ERROR_STR(-errno, "could not set config %d: %s", configuration,
X	strerror(errno));
X
X  dev->config = configuration;
X
X  return 0;
X}
X
Xint usb_claim_interface(usb_dev_handle *dev, int interface)
X{
X  int ret;
X
X  ret = ioctl(dev->fd, IOCTL_USB_CLAIMINTF, &interface);
X  if (ret < 0) {
X    if (errno == EBUSY && usb_debug > 0)
X      fprintf(stderr, "Check that you have permissions to write to %s/%s and, if you don't, that you set up hotplug (http://linux-hotplug.sourceforge.net/) correctly.\n", dev->bus->dirname, dev->device->filename);
X
X    USB_ERROR_STR(-errno, "could not claim interface %d: %s", interface,
X	strerror(errno));
X  }
X
X  dev->interface = interface;
X
X  return 0;
X}
X
Xint usb_release_interface(usb_dev_handle *dev, int interface)
X{
X  int ret;
X
X  ret = ioctl(dev->fd, IOCTL_USB_RELEASEINTF, &interface);
X  if (ret < 0)
X    USB_ERROR_STR(-errno, "could not release intf %d: %s", interface,
X    	strerror(errno));
X
X  dev->interface = -1;
X
X  return 0;
X}
X
Xint usb_set_altinterface(usb_dev_handle *dev, int alternate)
X{
X  int ret;
X  struct usb_setinterface setintf;
X
X  if (dev->interface < 0)
X    USB_ERROR(-EINVAL);
X
X  setintf.interface = dev->interface;
X  setintf.altsetting = alternate;
X
X  ret = ioctl(dev->fd, IOCTL_USB_SETINTF, &setintf);
X  if (ret < 0)
X    USB_ERROR_STR(-errno, "could not set alt intf %d/%d: %s",
X	dev->interface, alternate, strerror(errno));
X
X  dev->altsetting = alternate;
X
X  return 0;
X}
X
X/* Linux usbdevfs has a limit of one page size per read/write. 4096 is */
X/* the most portable maximum we can do for now */
X#define MAX_READ_WRITE	4096
X
Xint usb_bulk_write(usb_dev_handle *dev, int ep, char *bytes, int length,
X	int timeout)
X{
X  struct usb_bulktransfer bulk;
X  int ret, sent = 0;
X
X  /* Ensure the endpoint address is correct */
X  ep &= ~USB_ENDPOINT_IN;
X
X  do {
X    bulk.ep = ep;
X    bulk.len = length - sent;
X    if (bulk.len > MAX_READ_WRITE)
X      bulk.len = MAX_READ_WRITE;
X    bulk.timeout = timeout;
X    bulk.data = (unsigned char *)bytes + sent;
X
X    ret = ioctl(dev->fd, IOCTL_USB_BULK, &bulk);
X    if (ret < 0)
X      USB_ERROR_STR(-errno, "error writing to bulk endpoint %d: %s",
X	ep, strerror(errno));
X
X    sent += ret;
X  } while (ret > 0 && sent < length);
X
X  return sent;
X}
X
Xint usb_bulk_read(usb_dev_handle *dev, int ep, char *bytes, int size,
X	int timeout)
X{
X  struct usb_bulktransfer bulk;
X  int ret, retrieved = 0, requested;
X
X  /* Ensure the endpoint address is correct */
X  ep |= USB_ENDPOINT_IN;
X
X  do {
X    bulk.ep = ep;
X    requested = size - retrieved;
X    if (requested > MAX_READ_WRITE)
X      requested = MAX_READ_WRITE;
X    bulk.len = requested;
X    bulk.timeout = timeout;
X    bulk.data = (unsigned char *)bytes + retrieved;
X
X    ret = ioctl(dev->fd, IOCTL_USB_BULK, &bulk);
X    if (ret < 0)
X      USB_ERROR_STR(-errno, "error reading from bulk endpoint 0x%x: %s",
X	ep, strerror(errno));
X
X    retrieved += ret;
X  } while (ret > 0 && retrieved < size && ret == requested);
X
X  return retrieved;
X}
X
Xint usb_control_msg(usb_dev_handle *dev, int requesttype, int request,
X	int value, int index, char *bytes, int size, int timeout)
X{
X  struct usb_ctrltransfer ctrl;
X  int ret;
X
X  ctrl.bRequestType = requesttype;
X  ctrl.bRequest = request;
X  ctrl.wValue = value;
X  ctrl.wIndex = index;
X  ctrl.wLength = size;
X
X  ctrl.data = bytes;
X  ctrl.timeout = timeout;
X
X  ret = ioctl(dev->fd, IOCTL_USB_CONTROL, &ctrl);
X  if (ret < 0)
X    USB_ERROR_STR(-errno, "error sending control message: %s", strerror(errno));
X
X  return ret;
X}
X
X/* Reading and writing are the same except for the endpoint */
Xstatic int usb_interrupt_transfer(usb_dev_handle *dev, int ep, char *bytes,
X	int size, int timeout)
X{
X  struct usb_urb int_urb;
X  void *context;
X  int ret;
X  unsigned int bytesdone = 0, requested;
X  struct timeval tv, tv_ref, tv_now;
X  int waiting;
X
X  /*
X   * FIXME: Packetize large buffers here. 2.4 HCDs (atleast, haven't checked
X   * 2.5 HCDs yet) don't handle multi-packet Interrupt transfers. So we need
X   * to lookup the endpoint packet size and packetize appropriately here.
X   */
X
X  /* get actual time, and add the timeout value. The result is the absolute
X   * time where we have to quit waiting for an interrupt message.
X   */
X  gettimeofday(&tv_ref, NULL);
X  tv_ref.tv_sec = tv_ref.tv_sec + timeout / 1000;
X  tv_ref.tv_usec = tv_ref.tv_usec + (timeout % 1000) * 1000;
X
X  if (tv_ref.tv_usec > 1e6) {
X    tv_ref.tv_usec -= 1e6;
X    tv_ref.tv_sec++;
X  }
X
X  do {
X    requested = size - bytesdone;
X    if (requested > MAX_READ_WRITE)
X      requested = MAX_READ_WRITE;
X
X    int_urb.type = USB_URB_TYPE_INTERRUPT;
X    int_urb.endpoint = ep;
X    int_urb.flags = 0;
X    int_urb.buffer = bytes + bytesdone;
X    int_urb.buffer_length = requested;
X    int_urb.usercontext = (void *)ep;
X    int_urb.signr = 0;
X    int_urb.actual_length = 0;
X
X    ret = ioctl(dev->fd, IOCTL_USB_SUBMITURB, &int_urb);
X    if (ret < 0) {
X      USB_ERROR_STR(-errno, "error submitting URB: %s", strerror(errno));
X      return ret;
X    }
X
X    waiting = 1;
X    while (((ret = ioctl(dev->fd, IOCTL_USB_REAPURBNDELAY, &context)) == -1) && waiting) {
X      tv.tv_sec = 0;
X      tv.tv_usec = 1000; // 1 msec
X      select(0, NULL, NULL, NULL, &tv); //sub second wait
X
X      /* compare with actual time, as the select timeout is not that precise */
X      gettimeofday(&tv_now, NULL);
X
X      if ((tv_now.tv_sec >= tv_ref.tv_sec) && (tv_now.tv_usec >= tv_ref.tv_usec))
X        waiting = 0;
X    }
X
X    /*
X     * If there was an error, that wasn't EAGAIN (no completion), then
X     * something happened during the reaping and we should return that
X     * error now
X     */
X    if (ret < 0 && errno != EAGAIN)
X      USB_ERROR_STR(-errno, "error reaping interrupt URB: %s", strerror(errno));
X
X    bytesdone += int_urb.actual_length;
X  } while (ret > 0 && bytesdone < size && ret == requested);
X
X  /* If the URB didn't complete in success or error, then let's unlink it */
X  if (ret < 0) {
X    int rc;
X
X    if (!waiting)
X      rc = -ETIMEDOUT;
X    else
X      rc = int_urb.status;
X
X    ret = ioctl(dev->fd, IOCTL_USB_DISCARDURB, &int_urb);
X    if (ret < 0 && errno != EINVAL && usb_debug >= 1)
X      fprintf(stderr, "error discarding interrupt URB: %s", strerror(errno));
X
X    return rc;
X  }
X
X  return bytesdone;
X}
X
Xint usb_interrupt_write(usb_dev_handle *dev, int ep, char *bytes, int size,
X	int timeout)
X{
X  /* Ensure the endpoint address is correct */
X  return usb_interrupt_transfer(dev, ep & ~USB_ENDPOINT_IN, bytes, size,
X		timeout);
X}
X
Xint usb_interrupt_read(usb_dev_handle *dev, int ep, char *bytes, int size,
X	int timeout)
X{
X  /* Ensure the endpoint address is correct */
X  return usb_interrupt_transfer(dev, ep | USB_ENDPOINT_IN, bytes, size,
X		timeout);
X}
X
Xint usb_os_find_busses(struct usb_bus **busses)
X{
X  struct usb_bus *fbus = NULL;
X  DIR *dir;
X  struct dirent *entry;
X
X  dir = opendir(usb_path);
X  if (!dir)
X    USB_ERROR_STR(-errno, "couldn't opendir(%s): %s", usb_path,
X	strerror(errno));
X
X  while ((entry = readdir(dir)) != NULL) {
X    struct usb_bus *bus;
X
X    /* Skip anything starting with a . */
X    if (entry->d_name[0] == '.')
X      continue;
X
X    if (!strchr("0123456789", entry->d_name[strlen(entry->d_name) - 1])) {
X      if (usb_debug >= 2)
X        fprintf(stderr, "usb_os_find_busses: Skipping non bus directory %s\n",
X		entry->d_name);
X      continue;
X    }
X
X    bus = malloc(sizeof(*bus));
X    if (!bus)
X      USB_ERROR(-ENOMEM);
X
X    memset((void *)bus, 0, sizeof(*bus));
X
X    strncpy(bus->dirname, entry->d_name, sizeof(bus->dirname) - 1);
X    bus->dirname[sizeof(bus->dirname) - 1] = 0;
X
X    LIST_ADD(fbus, bus);
X
X    if (usb_debug >= 2)
X       fprintf(stderr, "usb_os_find_busses: Found %s\n", bus->dirname);
X  }
X
X  closedir(dir);
X
X  *busses = fbus;
X
X  return 0;
X}
X
Xint usb_os_find_devices(struct usb_bus *bus, struct usb_device **devices)
X{
X  struct usb_device *fdev = NULL;
X  DIR *dir;
X  struct dirent *entry;
X  char dirpath[PATH_MAX + 1];
X
X  snprintf(dirpath, PATH_MAX, "%s/%s", usb_path, bus->dirname);
X
X  dir = opendir(dirpath);
X  if (!dir)
X    USB_ERROR_STR(-errno, "couldn't opendir(%s): %s", dirpath,
X	strerror(errno));
X
X  while ((entry = readdir(dir)) != NULL) {
X    char filename[PATH_MAX + 1];
X    struct usb_device *dev;
X    int i, fd, ret;
X
X    /* Skip anything starting with a . */
X    if (entry->d_name[0] == '.')
X      continue;
X
X    dev = malloc(sizeof(*dev));
X    if (!dev)
X      USB_ERROR(-ENOMEM);
X
X    memset((void *)dev, 0, sizeof(*dev));
X
X    dev->bus = bus;
X
X    strncpy(dev->filename, entry->d_name, sizeof(dev->filename) - 1);
X    dev->filename[sizeof(dev->filename) - 1] = 0;
X
X    snprintf(filename, sizeof(filename) - 1, "%s/%s", dirpath, entry->d_name);
X    fd = open(filename, O_RDONLY);
X    if (fd < 0) {
X      if (usb_debug >= 2)
X        fprintf(stderr, "usb_os_find_devices: Couldn't open %s\n",
X		filename);
X
X      free(dev);
X      continue;
X    }
X
X    ret = read(fd, (void *)&dev->descriptor, sizeof(dev->descriptor));
X    if (ret < 0) {
X      if (usb_debug)
X        fprintf(stderr, "usb_os_find_devices: Couldn't read descriptor\n");
X
X      free(dev);
X
X      goto err;
X    }
X
X    LIST_ADD(fdev, dev);
X
X    if (usb_debug >= 2)
X      fprintf(stderr, "usb_os_find_devices: Found %s on %s\n",
X		dev->filename, bus->dirname);
X
X    /* Now try to fetch the rest of the descriptors */
X    if (dev->descriptor.bNumConfigurations > USB_MAXCONFIG)
X      /* Silent since we'll try again later */
X      goto err;
X
X    if (dev->descriptor.bNumConfigurations < 1)
X      /* Silent since we'll try again later */
X      goto err;
X
X    dev->config = (struct usb_config_descriptor *)malloc(dev->descriptor.bNumConfigurations * sizeof(struct usb_config_descriptor));
X    if (!dev->config)
X      /* Silent since we'll try again later */
X      goto err;
X
X    memset(dev->config, 0, dev->descriptor.bNumConfigurations *
X          sizeof(struct usb_config_descriptor));
X
X    for (i = 0; i < dev->descriptor.bNumConfigurations; i++) {
X      char buffer[8], *bigbuffer;
X      struct usb_config_descriptor *desc = (struct usb_config_descriptor *)buffer;
X
X      /* Get the first 8 bytes so we can figure out what the total length is */
X      ret = read(fd, (void *)buffer, 8);
X      if (ret < 8) {
X        if (usb_debug >= 1) {
X          if (ret < 0)
X            fprintf(stderr, "Unable to get descriptor (%d)\n", ret);
X          else
X            fprintf(stderr, "Config descriptor too short (expected %d, got %d)\n", 8, ret);
X        }
X
X        goto err;
X      }
X
X      USB_LE16_TO_CPU(desc->wTotalLength);
X
X      bigbuffer = malloc(desc->wTotalLength);
X      if (!bigbuffer) {
X        if (usb_debug >= 1)
X          fprintf(stderr, "Unable to allocate memory for descriptors\n");
X        goto err;
X      }
X
X      /* Copy over the first 8 bytes we read */
X      memcpy(bigbuffer, buffer, 8);
X
X      ret = read(fd, (void *)(bigbuffer + 8), desc->wTotalLength - 8);
X      if (ret < desc->wTotalLength - 8) {
X        if (usb_debug >= 1) {
X          if (ret < 0)
X            fprintf(stderr, "Unable to get descriptor (%d)\n", ret);
X          else
X            fprintf(stderr, "Config descriptor too short (expected %d, got %d)\n", desc->wTotalLength, ret);
X        }
X
X        free(bigbuffer);
X        goto err;
X      }
X
X      ret = usb_parse_configuration(&dev->config[i], bigbuffer);
X      if (usb_debug >= 2) {
X        if (ret > 0)
X          fprintf(stderr, "Descriptor data still left\n");
X        else if (ret < 0)
X          fprintf(stderr, "Unable to parse descriptors\n");
X      }
X
X      free(bigbuffer);
X    }
X
Xerr:
X    close(fd);
X  }
X
X  closedir(dir);
X
X  *devices = fdev;
X
X  return 0;
X}
X
Xstatic int check_usb_vfs(const unsigned char *dirname)
X{
X  DIR *dir;
X  struct dirent *entry;
X  int found = 0;
X
X  dir = opendir(dirname);
X  if (!dir)
X    return 0;
X
X  while ((entry = readdir(dir)) != NULL) {
X    /* Skip anything starting with a . */
X    if (entry->d_name[0] == '.')
X      continue;
X
X    /* We assume if we find any files that it must be the right place */
X    found = 1;
X    break;
X  }
X
X  closedir(dir);
X
X  return found;
X}
X
Xvoid usb_os_init(void)
X{
X  /* Find the path to the virtual filesystem */
X  if (getenv("USB_DEVFS_PATH")) {
X    if (check_usb_vfs(getenv("USB_DEVFS_PATH"))) {
X      strncpy(usb_path, getenv("USB_DEVFS_PATH"), sizeof(usb_path) - 1);
X      usb_path[sizeof(usb_path) - 1] = 0;
X    } else if (usb_debug)
X      fprintf(stderr, "usb_os_init: couldn't find USB VFS in USB_DEVFS_PATH\n");
X  }
X
X  if (!usb_path[0]) {
X    if (check_usb_vfs("/proc/bus/usb")) {
X      strncpy(usb_path, "/proc/bus/usb", sizeof(usb_path) - 1);
X      usb_path[sizeof(usb_path) - 1] = 0;
X    } else if (check_usb_vfs("/sys/bus/usb")) { /* 2.6 Kernel with sysfs */
X      strncpy(usb_path, "/sys/bus/usb", sizeof(usb_path) -1);
X      usb_path[sizeof(usb_path) - 1] = 0;
X    } else if (check_usb_vfs("/dev/usb")) {
X      strncpy(usb_path, "/dev/usb", sizeof(usb_path) - 1);
X      usb_path[sizeof(usb_path) - 1] = 0;
X    } else
X      usb_path[0] = 0;	/* No path, no USB support */
X  }
X
X  if (usb_debug) {
X    if (usb_path[0])
X      fprintf(stderr, "usb_os_init: Found USB VFS at %s\n", usb_path);
X    else
X      fprintf(stderr, "usb_os_init: No USB VFS found, is it mounted?\n");
X  }
X}
X
Xint usb_resetep(usb_dev_handle *dev, unsigned int ep)
X{
X  int ret;
X
X  ret = ioctl(dev->fd, IOCTL_USB_RESETEP, &ep);
X  if (ret)
X    USB_ERROR_STR(-errno, "could not reset ep %d: %s", ep,
X    	strerror(errno));
X
X  return 0;
X}
X
Xint usb_clear_halt(usb_dev_handle *dev, unsigned int ep)
X{
X  int ret;
X
X  ret = ioctl(dev->fd, IOCTL_USB_CLEAR_HALT, &ep);
X  if (ret)
X    USB_ERROR_STR(-errno, "could not clear/halt ep %d: %s", ep,
X    	strerror(errno));
X
X  return 0;
X}
X
Xint usb_reset(usb_dev_handle *dev)
X{
X  int ret;
X
X  ret = ioctl(dev->fd, IOCTL_USB_RESET, NULL);
X  if (ret)
X     USB_ERROR_STR(-errno, "could not reset: %s", strerror(errno));
X
X  return 0;
X}
X
Xint usb_get_driver_np(usb_dev_handle *dev, int interface, char *name,
X	unsigned int namelen)
X{
X  struct usb_getdriver getdrv;
X  int ret;
X
X  getdrv.interface = interface;
X  ret = ioctl(dev->fd, IOCTL_USB_GETDRIVER, &getdrv);
X  if (ret)
X    USB_ERROR_STR(-errno, "could not get bound driver: %s", strerror(errno));
X
X  strncpy(name, getdrv.driver, namelen - 1);
X  name[namelen - 1] = 0;
X
X  return 0;
X}
X
Xint usb_detach_kernel_driver_np(usb_dev_handle *dev, int interface)
X{
X  struct usb_ioctl command;
X  int ret;
X
X  command.ifno = interface;
X  command.ioctl_code = IOCTL_USB_DISCONNECT;
X  command.data = NULL;
X
X  ret = ioctl(dev->fd, IOCTL_USB_IOCTL, &command);
X  if (ret)
X    USB_ERROR_STR(-errno, "could not detach kernel driver from interface %d: %s",
X        interface, strerror(errno));
X
X  return 0;
X}
X
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/linux.c' 'failed'
fi
# ============= libusb-0.1.8/linux.h ==============
if test -f 'libusb-0.1.8/linux.h' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/linux.h' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/linux.h' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/linux.h' &&
X#ifndef __LINUX_H__
X#define __LINUX_H__
X
X#include <unistd.h>
X#include <sys/stat.h>
X#include <sys/ioctl.h>
X
Xstruct usb_ctrltransfer {
X	/* keep in sync with usbdevice_fs.h:usbdevfs_ctrltransfer */
X	u_int8_t  bRequestType;
X	u_int8_t  bRequest;
X	u_int16_t wValue;
X	u_int16_t wIndex;
X	u_int16_t wLength;
X
X	u_int32_t timeout;	/* in milliseconds */
X
X	/* pointer to data */
X	void *data;
X};
X
Xstruct usb_bulktransfer {
X	/* keep in sync with usbdevice_fs.h:usbdevfs_bulktransfer */
X	unsigned int ep;
X	unsigned int len;
X	unsigned int timeout;	/* in milliseconds */
X
X	/* pointer to data */
X	void *data;
X};
X
Xstruct usb_setinterface {
X	/* keep in sync with usbdevice_fs.h:usbdevfs_setinterface */
X	unsigned int interface;
X	unsigned int altsetting;
X};
X
X#define USB_MAXDRIVERNAME 255
X
Xstruct usb_getdriver {
X	unsigned int interface;
X	char driver[USB_MAXDRIVERNAME + 1];
X};
X
X#define USB_URB_DISABLE_SPD	1
X#define USB_URB_ISO_ASAP	2
X#define USB_URB_QUEUE_BULK	0x10
X
X#define USB_URB_TYPE_ISO	0
X#define USB_URB_TYPE_INTERRUPT	1
X#define USB_URB_TYPE_CONTROL	2
X#define USB_URB_TYPE_BULK	3
X
Xstruct usb_iso_packet_desc {
X	unsigned int length;
X	unsigned int actual_length;
X	unsigned int status;
X};
X
Xstruct usb_urb {
X	unsigned char type;
X	unsigned char endpoint;
X	int status;
X	unsigned int flags;
X	void *buffer;
X	int buffer_length;
X	int actual_length;
X	int start_frame;
X	int number_of_packets;
X	int error_count;
X	unsigned int signr;  /* signal to be sent on error, -1 if none should be sent */
X	void *usercontext;
X	struct usb_iso_packet_desc iso_frame_desc[0];
X};
X
Xstruct usb_ioctl {
X	int ifno;	/* interface 0..N ; negative numbers reserved */
X	int ioctl_code;	/* MUST encode size + direction of data so the
X			 * macros in <asm/ioctl.h> give correct values */
X	void *data;	/* param buffer (in, or out) */
X};
X
X#define IOCTL_USB_CONTROL	_IOWR('U', 0, struct usb_ctrltransfer)
X#define IOCTL_USB_BULK		_IOWR('U', 2, struct usb_bulktransfer)
X#define IOCTL_USB_RESETEP	_IOR('U', 3, unsigned int)
X#define IOCTL_USB_SETINTF	_IOR('U', 4, struct usb_setinterface)
X#define IOCTL_USB_SETCONFIG	_IOR('U', 5, unsigned int)
X#define IOCTL_USB_GETDRIVER	_IOW('U', 8, struct usb_getdriver)
X#define IOCTL_USB_SUBMITURB	_IOR('U', 10, struct usb_urb)
X#define IOCTL_USB_DISCARDURB	_IO('U', 11)
X#define IOCTL_USB_REAPURB	_IOW('U', 12, void *)
X#define IOCTL_USB_REAPURBNDELAY	_IOW('U', 13, void *)
X#define IOCTL_USB_CLAIMINTF	_IOR('U', 15, unsigned int)
X#define IOCTL_USB_RELEASEINTF	_IOR('U', 16, unsigned int)
X#define IOCTL_USB_IOCTL         _IOWR('U', 18, struct usb_ioctl)
X#define IOCTL_USB_RESET		_IO('U', 20)
X#define IOCTL_USB_CLEAR_HALT	_IOR('U', 21, unsigned int)
X#define IOCTL_USB_DISCONNECT	_IO('U', 22)	/* via IOCTL_USB_IOCTL */
X#define IOCTL_USB_CONNECT	_IO('U', 23)	/* via IOCTL_USB_IOCTL */
X
X#endif
X
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/linux.h' 'failed'
fi
# ============= libusb-0.1.8/ltmain.sh ==============
if test -f 'libusb-0.1.8/ltmain.sh' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/ltmain.sh' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/ltmain.sh' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/ltmain.sh' &&
X# ltmain.sh - Provide generalized library-building support services.
X# NOTE: Changing this file will not affect anything until you rerun configure.
X#
X# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
X# Free Software Foundation, Inc.
X# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
X#
X# This program is free software; you can redistribute it and/or modify
X# it under the terms of the GNU General Public License as published by
X# the Free Software Foundation; either version 2 of the License, or
X# (at your option) any later version.
X#
X# This program is distributed in the hope that it will be useful, but
X# WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
X# General Public License for more details.
X#
X# You should have received a copy of the GNU General Public License
X# along with this program; if not, write to the Free Software
X# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
X#
X# As a special exception to the GNU General Public License, if you
X# distribute this file as part of a program that contains a
X# configuration script generated by Autoconf, you may include it under
X# the same distribution terms that you use for the rest of that program.
X
X# Check that we have a working $echo.
Xif test "X$1" = X--no-reexec; then
X  # Discard the --no-reexec flag, and continue.
X  shift
Xelif test "X$1" = X--fallback-echo; then
X  # Avoid inline document here, it may be left over
X  :
Xelif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
X  # Yippee, $echo works!
X  :
Xelse
X  # Restart under the correct shell, and then maybe $echo will work.
X  exec $SHELL "$0" --no-reexec ${1+"$@"}
Xfi
X
Xif test "X$1" = X--fallback-echo; then
X  # used as fallback echo
X  shift
X  cat <<EOF
X$*
XEOF
X  exit 0
Xfi
X
X# The name of this program.
Xprogname=`$echo "$0" | sed 's%^.*/%%'`
Xmodename="$progname"
X
X# Constants.
XPROGRAM=ltmain.sh
XPACKAGE=libtool
XVERSION=1.4.2
XTIMESTAMP=" (1.922.2.54 2001/09/11 03:33:37)"
X
Xdefault_mode=
Xhelp="Try \`$progname --help' for more information."
Xmagic="%%%MAGIC variable%%%"
Xmkdir="mkdir"
Xmv="mv -f"
Xrm="rm -f"
X
X# Sed substitution that helps us do robust quoting.  It backslashifies
X# metacharacters that are still active within double-quoted strings.
XXsed='sed -e 1s/^X//'
Xsed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
XSP2NL='tr \040 \012'
XNL2SP='tr \015\012 \040\040'
X
X# NLS nuisances.
X# Only set LANG and LC_ALL to C if already set.
X# These must not be set unconditionally because not all systems understand
X# e.g. LANG=C (notably SCO).
X# We save the old values to restore during execute mode.
Xif test "${LC_ALL+set}" = set; then
X  save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
Xfi
Xif test "${LANG+set}" = set; then
X  save_LANG="$LANG"; LANG=C; export LANG
Xfi
X
X# Make sure IFS has a sensible default
X: ${IFS=" 	"}
X
Xif test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
X  echo "$modename: not configured to build any kind of library" 1>&2
X  echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
X  exit 1
Xfi
X
X# Global variables.
Xmode=$default_mode
Xnonopt=
Xprev=
Xprevopt=
Xrun=
Xshow="$echo"
Xshow_help=
Xexecute_dlfiles=
Xlo2o="s/\\.lo\$/.${objext}/"
Xo2lo="s/\\.${objext}\$/.lo/"
X
X# Parse our command line options once, thoroughly.
Xwhile test $# -gt 0
Xdo
X  arg="$1"
X  shift
X
X  case $arg in
X  -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
X  *) optarg= ;;
X  esac
X
X  # If the previous option needs an argument, assign it.
X  if test -n "$prev"; then
X    case $prev in
X    execute_dlfiles)
X      execute_dlfiles="$execute_dlfiles $arg"
X      ;;
X    *)
X      eval "$prev=\$arg"
X      ;;
X    esac
X
X    prev=
X    prevopt=
X    continue
X  fi
X
X  # Have we seen a non-optional argument yet?
X  case $arg in
X  --help)
X    show_help=yes
X    ;;
X
X  --version)
X    echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
X    exit 0
X    ;;
X
X  --config)
X    sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
X    exit 0
X    ;;
X
X  --debug)
X    echo "$progname: enabling shell trace mode"
X    set -x
X    ;;
X
X  --dry-run | -n)
X    run=:
X    ;;
X
X  --features)
X    echo "host: $host"
X    if test "$build_libtool_libs" = yes; then
X      echo "enable shared libraries"
X    else
X      echo "disable shared libraries"
X    fi
X    if test "$build_old_libs" = yes; then
X      echo "enable static libraries"
X    else
X      echo "disable static libraries"
X    fi
X    exit 0
X    ;;
X
X  --finish) mode="finish" ;;
X
X  --mode) prevopt="--mode" prev=mode ;;
X  --mode=*) mode="$optarg" ;;
X
X  --quiet | --silent)
X    show=:
X    ;;
X
X  -dlopen)
X    prevopt="-dlopen"
X    prev=execute_dlfiles
X    ;;
X
X  -*)
X    $echo "$modename: unrecognized option \`$arg'" 1>&2
X    $echo "$help" 1>&2
X    exit 1
X    ;;
X
X  *)
X    nonopt="$arg"
X    break
X    ;;
X  esac
Xdone
X
Xif test -n "$prevopt"; then
X  $echo "$modename: option \`$prevopt' requires an argument" 1>&2
X  $echo "$help" 1>&2
X  exit 1
Xfi
X
X# If this variable is set in any of the actions, the command in it
X# will be execed at the end.  This prevents here-documents from being
X# left over by shells.
Xexec_cmd=
X
Xif test -z "$show_help"; then
X
X  # Infer the operation mode.
X  if test -z "$mode"; then
X    case $nonopt in
X    *cc | *++ | gcc* | *-gcc*)
X      mode=link
X      for arg
X      do
X	case $arg in
X	-c)
X	   mode=compile
X	   break
X	   ;;
X	esac
X      done
X      ;;
X    *db | *dbx | *strace | *truss)
X      mode=execute
X      ;;
X    *install*|cp|mv)
X      mode=install
X      ;;
X    *rm)
X      mode=uninstall
X      ;;
X    *)
X      # If we have no mode, but dlfiles were specified, then do execute mode.
X      test -n "$execute_dlfiles" && mode=execute
X
X      # Just use the default operation mode.
X      if test -z "$mode"; then
X	if test -n "$nonopt"; then
X	  $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
X	else
X	  $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
X	fi
X      fi
X      ;;
X    esac
X  fi
X
X  # Only execute mode is allowed to have -dlopen flags.
X  if test -n "$execute_dlfiles" && test "$mode" != execute; then
X    $echo "$modename: unrecognized option \`-dlopen'" 1>&2
X    $echo "$help" 1>&2
X    exit 1
X  fi
X
X  # Change the help message to a mode-specific one.
X  generic_help="$help"
X  help="Try \`$modename --help --mode=$mode' for more information."
X
X  # These modes are in order of execution frequency so that they run quickly.
X  case $mode in
X  # libtool compile mode
X  compile)
X    modename="$modename: compile"
X    # Get the compilation command and the source file.
X    base_compile=
X    prev=
X    lastarg=
X    srcfile="$nonopt"
X    suppress_output=
X
X    user_target=no
X    for arg
X    do
X      case $prev in
X      "") ;;
X      xcompiler)
X	# Aesthetically quote the previous argument.
X	prev=
X	lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
X
X	case $arg in
X	# Double-quote args containing other shell metacharacters.
X	# Many Bourne shells cannot handle close brackets correctly
X	# in scan sets, so we specify it separately.
X	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
X	  arg="\"$arg\""
X	  ;;
X	esac
X
X	# Add the previous argument to base_compile.
X	if test -z "$base_compile"; then
X	  base_compile="$lastarg"
X	else
X	  base_compile="$base_compile $lastarg"
X	fi
X	continue
X	;;
X      esac
X
X      # Accept any command-line options.
X      case $arg in
X      -o)
X	if test "$user_target" != "no"; then
X	  $echo "$modename: you cannot specify \`-o' more than once" 1>&2
X	  exit 1
X	fi
X	user_target=next
X	;;
X
X      -static)
X	build_old_libs=yes
X	continue
X	;;
X
X      -prefer-pic)
X	pic_mode=yes
X	continue
X	;;
X
X      -prefer-non-pic)
X	pic_mode=no
X	continue
X	;;
X
X      -Xcompiler)
X	prev=xcompiler
X	continue
X	;;
X
X      -Wc,*)
X	args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
X	lastarg=
X	save_ifs="$IFS"; IFS=','
X	for arg in $args; do
X	  IFS="$save_ifs"
X
X	  # Double-quote args containing other shell metacharacters.
X	  # Many Bourne shells cannot handle close brackets correctly
X	  # in scan sets, so we specify it separately.
X	  case $arg in
X	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
X	    arg="\"$arg\""
X	    ;;
X	  esac
X	  lastarg="$lastarg $arg"
X	done
X	IFS="$save_ifs"
X	lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
X
X	# Add the arguments to base_compile.
X	if test -z "$base_compile"; then
X	  base_compile="$lastarg"
X	else
X	  base_compile="$base_compile $lastarg"
X	fi
X	continue
X	;;
X      esac
X
X      case $user_target in
X      next)
X	# The next one is the -o target name
X	user_target=yes
X	continue
X	;;
X      yes)
X	# We got the output file
X	user_target=set
X	libobj="$arg"
X	continue
X	;;
X      esac
X
X      # Accept the current argument as the source file.
X      lastarg="$srcfile"
X      srcfile="$arg"
X
X      # Aesthetically quote the previous argument.
X
X      # Backslashify any backslashes, double quotes, and dollar signs.
X      # These are the only characters that are still specially
X      # interpreted inside of double-quoted scrings.
X      lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
X
X      # Double-quote args containing other shell metacharacters.
X      # Many Bourne shells cannot handle close brackets correctly
X      # in scan sets, so we specify it separately.
X      case $lastarg in
X      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
X	lastarg="\"$lastarg\""
X	;;
X      esac
X
X      # Add the previous argument to base_compile.
X      if test -z "$base_compile"; then
X	base_compile="$lastarg"
X      else
X	base_compile="$base_compile $lastarg"
X      fi
X    done
X
X    case $user_target in
X    set)
X      ;;
X    no)
X      # Get the name of the library object.
X      libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
X      ;;
X    *)
X      $echo "$modename: you must specify a target with \`-o'" 1>&2
X      exit 1
X      ;;
X    esac
X
X    # Recognize several different file suffixes.
X    # If the user specifies -o file.o, it is replaced with file.lo
X    xform='[cCFSfmso]'
X    case $libobj in
X    *.ada) xform=ada ;;
X    *.adb) xform=adb ;;
X    *.ads) xform=ads ;;
X    *.asm) xform=asm ;;
X    *.c++) xform=c++ ;;
X    *.cc) xform=cc ;;
X    *.cpp) xform=cpp ;;
X    *.cxx) xform=cxx ;;
X    *.f90) xform=f90 ;;
X    *.for) xform=for ;;
X    esac
X
X    libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
X
X    case $libobj in
X    *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
X    *)
X      $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
X      exit 1
X      ;;
X    esac
X
X    if test -z "$base_compile"; then
X      $echo "$modename: you must specify a compilation command" 1>&2
X      $echo "$help" 1>&2
X      exit 1
X    fi
X
X    # Delete any leftover library objects.
X    if test "$build_old_libs" = yes; then
X      removelist="$obj $libobj"
X    else
X      removelist="$libobj"
X    fi
X
X    $run $rm $removelist
X    trap "$run $rm $removelist; exit 1" 1 2 15
X
X    # On Cygwin there's no "real" PIC flag so we must build both object types
X    case $host_os in
X    cygwin* | mingw* | pw32* | os2*)
X      pic_mode=default
X      ;;
X    esac
X    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
X      # non-PIC code in shared libraries is not supported
X      pic_mode=default
X    fi
X
X    # Calculate the filename of the output object if compiler does
X    # not support -o with -c
X    if test "$compiler_c_o" = no; then
X      output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
X      lockfile="$output_obj.lock"
X      removelist="$removelist $output_obj $lockfile"
X      trap "$run $rm $removelist; exit 1" 1 2 15
X    else
X      need_locks=no
X      lockfile=
X    fi
X
X    # Lock this critical section if it is needed
X    # We use this script file to make the link, it avoids creating a new file
X    if test "$need_locks" = yes; then
X      until $run ln "$0" "$lockfile" 2>/dev/null; do
X	$show "Waiting for $lockfile to be removed"
X	sleep 2
X      done
X    elif test "$need_locks" = warn; then
X      if test -f "$lockfile"; then
X	echo "\
X*** ERROR, $lockfile exists and contains:
X`cat $lockfile 2>/dev/null`
X
XThis indicates that another process is trying to use the same
Xtemporary object file, and libtool could not work around it because
Xyour compiler does not support \`-c' and \`-o' together.  If you
Xrepeat this compilation, it may succeed, by chance, but you had better
Xavoid parallel builds (make -j) in this platform, or get a better
Xcompiler."
X
X	$run $rm $removelist
X	exit 1
X      fi
X      echo $srcfile > "$lockfile"
X    fi
X
X    if test -n "$fix_srcfile_path"; then
X      eval srcfile=\"$fix_srcfile_path\"
X    fi
X
X    # Only build a PIC object if we are building libtool libraries.
X    if test "$build_libtool_libs" = yes; then
X      # Without this assignment, base_compile gets emptied.
X      fbsd_hideous_sh_bug=$base_compile
X
X      if test "$pic_mode" != no; then
X	# All platforms use -DPIC, to notify preprocessed assembler code.
X	command="$base_compile $srcfile $pic_flag -DPIC"
X      else
X	# Don't build PIC code
X	command="$base_compile $srcfile"
X      fi
X      if test "$build_old_libs" = yes; then
X	lo_libobj="$libobj"
X	dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
X	if test "X$dir" = "X$libobj"; then
X	  dir="$objdir"
X	else
X	  dir="$dir/$objdir"
X	fi
X	libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
X
X	if test -d "$dir"; then
X	  $show "$rm $libobj"
X	  $run $rm $libobj
X	else
X	  $show "$mkdir $dir"
X	  $run $mkdir $dir
X	  status=$?
X	  if test $status -ne 0 && test ! -d $dir; then
X	    exit $status
X	  fi
X	fi
X      fi
X      if test "$compiler_o_lo" = yes; then
X	output_obj="$libobj"
X	command="$command -o $output_obj"
X      elif test "$compiler_c_o" = yes; then
X	output_obj="$obj"
X	command="$command -o $output_obj"
X      fi
X
X      $run $rm "$output_obj"
X      $show "$command"
X      if $run eval "$command"; then :
X      else
X	test -n "$output_obj" && $run $rm $removelist
X	exit 1
X      fi
X
X      if test "$need_locks" = warn &&
X	 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
X	echo "\
X*** ERROR, $lockfile contains:
X`cat $lockfile 2>/dev/null`
X
Xbut it should contain:
X$srcfile
X
XThis indicates that another process is trying to use the same
Xtemporary object file, and libtool could not work around it because
Xyour compiler does not support \`-c' and \`-o' together.  If you
Xrepeat this compilation, it may succeed, by chance, but you had better
Xavoid parallel builds (make -j) in this platform, or get a better
Xcompiler."
X
X	$run $rm $removelist
X	exit 1
X      fi
X
X      # Just move the object if needed, then go on to compile the next one
X      if test x"$output_obj" != x"$libobj"; then
X	$show "$mv $output_obj $libobj"
X	if $run $mv $output_obj $libobj; then :
X	else
X	  error=$?
X	  $run $rm $removelist
X	  exit $error
X	fi
X      fi
X
X      # If we have no pic_flag, then copy the object into place and finish.
X      if (test -z "$pic_flag" || test "$pic_mode" != default) &&
X	 test "$build_old_libs" = yes; then
X	# Rename the .lo from within objdir to obj
X	if test -f $obj; then
X	  $show $rm $obj
X	  $run $rm $obj
X	fi
X
X	$show "$mv $libobj $obj"
X	if $run $mv $libobj $obj; then :
X	else
X	  error=$?
X	  $run $rm $removelist
X	  exit $error
X	fi
X
X	xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
X	if test "X$xdir" = "X$obj"; then
X	  xdir="."
X	else
X	  xdir="$xdir"
X	fi
X	baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
X	libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
X	# Now arrange that obj and lo_libobj become the same file
X	$show "(cd $xdir && $LN_S $baseobj $libobj)"
X	if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
X	  # Unlock the critical section if it was locked
X	  if test "$need_locks" != no; then
X	    $run $rm "$lockfile"
X	  fi
X	  exit 0
X	else
X	  error=$?
X	  $run $rm $removelist
X	  exit $error
X	fi
X      fi
X
X      # Allow error messages only from the first compilation.
X      suppress_output=' >/dev/null 2>&1'
X    fi
X
X    # Only build a position-dependent object if we build old libraries.
X    if test "$build_old_libs" = yes; then
X      if test "$pic_mode" != yes; then
X	# Don't build PIC code
X	command="$base_compile $srcfile"
X      else
X	# All platforms use -DPIC, to notify preprocessed assembler code.
X	command="$base_compile $srcfile $pic_flag -DPIC"
X      fi
X      if test "$compiler_c_o" = yes; then
X	command="$command -o $obj"
X	output_obj="$obj"
X      fi
X
X      # Suppress compiler output if we already did a PIC compilation.
X      command="$command$suppress_output"
X      $run $rm "$output_obj"
X      $show "$command"
X      if $run eval "$command"; then :
X      else
X	$run $rm $removelist
X	exit 1
X      fi
X
X      if test "$need_locks" = warn &&
X	 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
X	echo "\
X*** ERROR, $lockfile contains:
X`cat $lockfile 2>/dev/null`
X
Xbut it should contain:
X$srcfile
X
XThis indicates that another process is trying to use the same
Xtemporary object file, and libtool could not work around it because
Xyour compiler does not support \`-c' and \`-o' together.  If you
Xrepeat this compilation, it may succeed, by chance, but you had better
Xavoid parallel builds (make -j) in this platform, or get a better
Xcompiler."
X
X	$run $rm $removelist
X	exit 1
X      fi
X
X      # Just move the object if needed
X      if test x"$output_obj" != x"$obj"; then
X	$show "$mv $output_obj $obj"
X	if $run $mv $output_obj $obj; then :
X	else
X	  error=$?
X	  $run $rm $removelist
X	  exit $error
X	fi
X      fi
X
X      # Create an invalid libtool object if no PIC, so that we do not
X      # accidentally link it into a program.
X      if test "$build_libtool_libs" != yes; then
X	$show "echo timestamp > $libobj"
X	$run eval "echo timestamp > \$libobj" || exit $?
X      else
X	# Move the .lo from within objdir
X	$show "$mv $libobj $lo_libobj"
X	if $run $mv $libobj $lo_libobj; then :
X	else
X	  error=$?
X	  $run $rm $removelist
X	  exit $error
X	fi
X      fi
X    fi
X
X    # Unlock the critical section if it was locked
X    if test "$need_locks" != no; then
X      $run $rm "$lockfile"
X    fi
X
X    exit 0
X    ;;
X
X  # libtool link mode
X  link | relink)
X    modename="$modename: link"
X    case $host in
X    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
X      # It is impossible to link a dll without this setting, and
X      # we shouldn't force the makefile maintainer to figure out
X      # which system we are compiling for in order to pass an extra
X      # flag for every libtool invokation.
X      # allow_undefined=no
X
X      # FIXME: Unfortunately, there are problems with the above when trying
X      # to make a dll which has undefined symbols, in which case not
X      # even a static library is built.  For now, we need to specify
X      # -no-undefined on the libtool link line when we can be certain
X      # that all symbols are satisfied, otherwise we get a static library.
X      allow_undefined=yes
X      ;;
X    *)
X      allow_undefined=yes
X      ;;
X    esac
X    libtool_args="$nonopt"
X    compile_command="$nonopt"
X    finalize_command="$nonopt"
X
X    compile_rpath=
X    finalize_rpath=
X    compile_shlibpath=
X    finalize_shlibpath=
X    convenience=
X    old_convenience=
X    deplibs=
X    old_deplibs=
X    compiler_flags=
X    linker_flags=
X    dllsearchpath=
X    lib_search_path=`pwd`
X
X    avoid_version=no
X    dlfiles=
X    dlprefiles=
X    dlself=no
X    export_dynamic=no
X    export_symbols=
X    export_symbols_regex=
X    generated=
X    libobjs=
X    ltlibs=
X    module=no
X    no_install=no
X    objs=
X    prefer_static_libs=no
X    preload=no
X    prev=
X    prevarg=
X    release=
X    rpath=
X    xrpath=
X    perm_rpath=
X    temp_rpath=
X    thread_safe=no
X    vinfo=
X
X    # We need to know -static, to get the right output filenames.
X    for arg
X    do
X      case $arg in
X      -all-static | -static)
X	if test "X$arg" = "X-all-static"; then
X	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
X	    $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
X	  fi
X	  if test -n "$link_static_flag"; then
X	    dlopen_self=$dlopen_self_static
X	  fi
X	else
X	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
X	    dlopen_self=$dlopen_self_static
X	  fi
X	fi
X	build_libtool_libs=no
X	build_old_libs=yes
X	prefer_static_libs=yes
X	break
X	;;
X      esac
X    done
X
X    # See if our shared archives depend on static archives.
X    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
X
X    # Go through the arguments, transforming them on the way.
X    while test $# -gt 0; do
X      arg="$1"
X      shift
X      case $arg in
X      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
X	qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
X	;;
X      *) qarg=$arg ;;
X      esac
X      libtool_args="$libtool_args $qarg"
X
X      # If the previous option needs an argument, assign it.
X      if test -n "$prev"; then
X	case $prev in
X	output)
X	  compile_command="$compile_command @OUTPUT@"
X	  finalize_command="$finalize_command @OUTPUT@"
X	  ;;
X	esac
X
X	case $prev in
X	dlfiles|dlprefiles)
X	  if test "$preload" = no; then
X	    # Add the symbol object into the linking commands.
X	    compile_command="$compile_command @SYMFILE@"
X	    finalize_command="$finalize_command @SYMFILE@"
X	    preload=yes
X	  fi
X	  case $arg in
X	  *.la | *.lo) ;;  # We handle these cases below.
X	  force)
X	    if test "$dlself" = no; then
X	      dlself=needless
X	      export_dynamic=yes
X	    fi
X	    prev=
X	    continue
X	    ;;
X	  self)
X	    if test "$prev" = dlprefiles; then
X	      dlself=yes
X	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
X	      dlself=yes
X	    else
X	      dlself=needless
X	      export_dynamic=yes
X	    fi
X	    prev=
X	    continue
X	    ;;
X	  *)
X	    if test "$prev" = dlfiles; then
X	      dlfiles="$dlfiles $arg"
X	    else
X	      dlprefiles="$dlprefiles $arg"
X	    fi
X	    prev=
X	    continue
X	    ;;
X	  esac
X	  ;;
X	expsyms)
X	  export_symbols="$arg"
X	  if test ! -f "$arg"; then
X	    $echo "$modename: symbol file \`$arg' does not exist"
X	    exit 1
X	  fi
X	  prev=
X	  continue
X	  ;;
X	expsyms_regex)
X	  export_symbols_regex="$arg"
X	  prev=
X	  continue
X	  ;;
X	framework)
X	  deplibs="$deplibs -framework $arg"
X	  prev=
X	  continue
X	  ;;
X	release)
X	  release="-$arg"
X	  prev=
X	  continue
X	  ;;
X	rpath | xrpath)
X	  # We need an absolute path.
X	  case $arg in
X	  [\\/]* | [A-Za-z]:[\\/]*) ;;
X	  *)
X	    $echo "$modename: only absolute run-paths are allowed" 1>&2
X	    exit 1
X	    ;;
X	  esac
X	  if test "$prev" = rpath; then
X	    case "$rpath " in
X	    *" $arg "*) ;;
X	    *) rpath="$rpath $arg" ;;
X	    esac
X	  else
X	    case "$xrpath " in
X	    *" $arg "*) ;;
X	    *) xrpath="$xrpath $arg" ;;
X	    esac
X	  fi
X	  prev=
X	  continue
X	  ;;
X	xcompiler)
X	  compiler_flags="$compiler_flags $qarg"
X	  prev=
X	  compile_command="$compile_command $qarg"
X	  finalize_command="$finalize_command $qarg"
X	  continue
X	  ;;
X	xlinker)
X	  linker_flags="$linker_flags $qarg"
X	  compiler_flags="$compiler_flags $wl$qarg"
X	  prev=
X	  compile_command="$compile_command $wl$qarg"
X	  finalize_command="$finalize_command $wl$qarg"
X	  continue
X	  ;;
X	*)
X	  eval "$prev=\"\$arg\""
X	  prev=
X	  continue
X	  ;;
X	esac
X      fi # test -n $prev
X
X      prevarg="$arg"
X
X      case $arg in
X      -all-static)
X	if test -n "$link_static_flag"; then
X	  compile_command="$compile_command $link_static_flag"
X	  finalize_command="$finalize_command $link_static_flag"
X	fi
X	continue
X	;;
X
X      -allow-undefined)
X	# FIXME: remove this flag sometime in the future.
X	$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
X	continue
X	;;
X
X      -avoid-version)
X	avoid_version=yes
X	continue
X	;;
X
X      -dlopen)
X	prev=dlfiles
X	continue
X	;;
X
X      -dlpreopen)
X	prev=dlprefiles
X	continue
X	;;
X
X      -export-dynamic)
X	export_dynamic=yes
X	continue
X	;;
X
X      -export-symbols | -export-symbols-regex)
X	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
X	  $echo "$modename: more than one -exported-symbols argument is not allowed"
X	  exit 1
X	fi
X	if test "X$arg" = "X-export-symbols"; then
X	  prev=expsyms
X	else
X	  prev=expsyms_regex
X	fi
X	continue
X	;;
X
X      -framework)
X	prev=framework
X	continue
X	;;
X
X      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
X      # so, if we see these flags be careful not to treat them like -L
X      -L[A-Z][A-Z]*:*)
X	case $with_gcc/$host in
X	no/*-*-irix*)
X	  compile_command="$compile_command $arg"
X	  finalize_command="$finalize_command $arg"
X	  ;;
X	esac
X	continue
X	;;
X
X      -L*)
X	dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
X	# We need an absolute path.
X	case $dir in
X	[\\/]* | [A-Za-z]:[\\/]*) ;;
X	*)
X	  absdir=`cd "$dir" && pwd`
X	  if test -z "$absdir"; then
X	    $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
X	    exit 1
X	  fi
X	  dir="$absdir"
X	  ;;
X	esac
X	case "$deplibs " in
X	*" -L$dir "*) ;;
X	*)
X	  deplibs="$deplibs -L$dir"
X	  lib_search_path="$lib_search_path $dir"
X	  ;;
X	esac
X	case $host in
X	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
X	  case :$dllsearchpath: in
X	  *":$dir:"*) ;;
X	  *) dllsearchpath="$dllsearchpath:$dir";;
X	  esac
X	  ;;
X	esac
X	continue
X	;;
X
X      -l*)
X	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
X	  case $host in
X	  *-*-cygwin* | *-*-pw32* | *-*-beos*)
X	    # These systems don't actually have a C or math library (as such)
X	    continue
X	    ;;
X	  *-*-mingw* | *-*-os2*)
X	    # These systems don't actually have a C library (as such)
X	    test "X$arg" = "X-lc" && continue
X	    ;;
X	  *-*-openbsd*)
X	    # Do not include libc due to us having libc/libc_r.
X	    test "X$arg" = "X-lc" && continue
X	    ;;
X	  esac
X	 elif test "X$arg" = "X-lc_r"; then
X	  case $host in
X	  *-*-openbsd*)
X	    # Do not include libc_r directly, use -pthread flag.
X	    continue
X	    ;;
X	  esac
X	fi
X	deplibs="$deplibs $arg"
X	continue
X	;;
X
X      -module)
X	module=yes
X	continue
X	;;
X
X      -no-fast-install)
X	fast_install=no
X	continue
X	;;
X
X      -no-install)
X	case $host in
X	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
X	  # The PATH hackery in wrapper scripts is required on Windows
X	  # in order for the loader to find any dlls it needs.
X	  $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
X	  $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
X	  fast_install=no
X	  ;;
X	*) no_install=yes ;;
X	esac
X	continue
X	;;
X
X      -no-undefined)
X	allow_undefined=no
X	continue
X	;;
X
X      -o) prev=output ;;
X
X      -release)
X	prev=release
X	continue
X	;;
X
X      -rpath)
X	prev=rpath
X	continue
X	;;
X
X      -R)
X	prev=xrpath
X	continue
X	;;
X
X      -R*)
X	dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
X	# We need an absolute path.
X	case $dir in
X	[\\/]* | [A-Za-z]:[\\/]*) ;;
X	*)
X	  $echo "$modename: only absolute run-paths are allowed" 1>&2
X	  exit 1
X	  ;;
X	esac
X	case "$xrpath " in
X	*" $dir "*) ;;
X	*) xrpath="$xrpath $dir" ;;
X	esac
X	continue
X	;;
X
X      -static)
X	# The effects of -static are defined in a previous loop.
X	# We used to do the same as -all-static on platforms that
X	# didn't have a PIC flag, but the assumption that the effects
X	# would be equivalent was wrong.  It would break on at least
X	# Digital Unix and AIX.
X	continue
X	;;
X
X      -thread-safe)
X	thread_safe=yes
X	continue
X	;;
X
X      -version-info)
X	prev=vinfo
X	continue
X	;;
X
X      -Wc,*)
X	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
X	arg=
X	save_ifs="$IFS"; IFS=','
X	for flag in $args; do
X	  IFS="$save_ifs"
X	  case $flag in
X	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
X	    flag="\"$flag\""
X	    ;;
X	  esac
X	  arg="$arg $wl$flag"
X	  compiler_flags="$compiler_flags $flag"
X	done
X	IFS="$save_ifs"
X	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
X	;;
X
X      -Wl,*)
X	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
X	arg=
X	save_ifs="$IFS"; IFS=','
X	for flag in $args; do
X	  IFS="$save_ifs"
X	  case $flag in
X	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
X	    flag="\"$flag\""
X	    ;;
X	  esac
X	  arg="$arg $wl$flag"
X	  compiler_flags="$compiler_flags $wl$flag"
X	  linker_flags="$linker_flags $flag"
X	done
X	IFS="$save_ifs"
X	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
X	;;
X
X      -Xcompiler)
X	prev=xcompiler
X	continue
X	;;
X
X      -Xlinker)
X	prev=xlinker
X	continue
X	;;
X
X      # Some other compiler flag.
X      -* | +*)
X	# Unknown arguments in both finalize_command and compile_command need
X	# to be aesthetically quoted because they are evaled later.
X	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
X	case $arg in
X	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
X	  arg="\"$arg\""
X	  ;;
X	esac
X	;;
X
X      *.lo | *.$objext)
X	# A library or standard object.
X	if test "$prev" = dlfiles; then
X	  # This file was specified with -dlopen.
X	  if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
X	    dlfiles="$dlfiles $arg"
X	    prev=
X	    continue
X	  else
X	    # If libtool objects are unsupported, then we need to preload.
X	    prev=dlprefiles
X	  fi
X	fi
X
X	if test "$prev" = dlprefiles; then
X	  # Preload the old-style object.
X	  dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
X	  prev=
X	else
X	  case $arg in
X	  *.lo) libobjs="$libobjs $arg" ;;
X	  *) objs="$objs $arg" ;;
X	  esac
X	fi
X	;;
X
X      *.$libext)
X	# An archive.
X	deplibs="$deplibs $arg"
X	old_deplibs="$old_deplibs $arg"
X	continue
X	;;
X
X      *.la)
X	# A libtool-controlled library.
X
X	if test "$prev" = dlfiles; then
X	  # This library was specified with -dlopen.
X	  dlfiles="$dlfiles $arg"
X	  prev=
X	elif test "$prev" = dlprefiles; then
X	  # The library was specified with -dlpreopen.
X	  dlprefiles="$dlprefiles $arg"
X	  prev=
X	else
X	  deplibs="$deplibs $arg"
X	fi
X	continue
X	;;
X
X      # Some other compiler argument.
X      *)
X	# Unknown arguments in both finalize_command and compile_command need
X	# to be aesthetically quoted because they are evaled later.
X	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
X	case $arg in
X	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
X	  arg="\"$arg\""
X	  ;;
X	esac
X	;;
X      esac # arg
X
X      # Now actually substitute the argument into the commands.
X      if test -n "$arg"; then
X	compile_command="$compile_command $arg"
X	finalize_command="$finalize_command $arg"
X      fi
X    done # argument parsing loop
X
X    if test -n "$prev"; then
X      $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
X      $echo "$help" 1>&2
X      exit 1
X    fi
X
X    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
X      eval arg=\"$export_dynamic_flag_spec\"
X      compile_command="$compile_command $arg"
X      finalize_command="$finalize_command $arg"
X    fi
X
X    # calculate the name of the file, without its directory
X    outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
X    libobjs_save="$libobjs"
X
X    if test -n "$shlibpath_var"; then
X      # get the directories listed in $shlibpath_var
X      eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
X    else
X      shlib_search_path=
X    fi
X    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
X    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
X
X    output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
X    if test "X$output_objdir" = "X$output"; then
X      output_objdir="$objdir"
X    else
X      output_objdir="$output_objdir/$objdir"
X    fi
X    # Create the object directory.
X    if test ! -d "$output_objdir"; then
X      $show "$mkdir $output_objdir"
X      $run $mkdir $output_objdir
X      status=$?
X      if test "$status" -ne 0 && test ! -d "$output_objdir"; then
X	exit $status
X      fi
X    fi
X
X    # Determine the type of output
X    case $output in
X    "")
X      $echo "$modename: you must specify an output file" 1>&2
X      $echo "$help" 1>&2
X      exit 1
X      ;;
X    *.$libext) linkmode=oldlib ;;
X    *.lo | *.$objext) linkmode=obj ;;
X    *.la) linkmode=lib ;;
X    *) linkmode=prog ;; # Anything else should be a program.
X    esac
X
X    specialdeplibs=
X    libs=
X    # Find all interdependent deplibs by searching for libraries
X    # that are linked more than once (e.g. -la -lb -la)
X    for deplib in $deplibs; do
X      case "$libs " in
X      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
X      esac
X      libs="$libs $deplib"
X    done
X    deplibs=
X    newdependency_libs=
X    newlib_search_path=
X    need_relink=no # whether we're linking any uninstalled libtool libraries
X    notinst_deplibs= # not-installed libtool libraries
X    notinst_path= # paths that contain not-installed libtool libraries
X    case $linkmode in
X    lib)
X	passes="conv link"
X	for file in $dlfiles $dlprefiles; do
X	  case $file in
X	  *.la) ;;
X	  *)
X	    $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
X	    exit 1
X	    ;;
X	  esac
X	done
X	;;
X    prog)
X	compile_deplibs=
X	finalize_deplibs=
X	alldeplibs=no
X	newdlfiles=
X	newdlprefiles=
X	passes="conv scan dlopen dlpreopen link"
X	;;
X    *)  passes="conv"
X	;;
X    esac
X    for pass in $passes; do
X      if test "$linkmode" = prog; then
X	# Determine which files to process
X	case $pass in
X	dlopen)
X	  libs="$dlfiles"
X	  save_deplibs="$deplibs" # Collect dlpreopened libraries
X	  deplibs=
X	  ;;
X	dlpreopen) libs="$dlprefiles" ;;
X	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
X	esac
X      fi
X      prev=
X      for deplib in $libs; do
X	case $prev in
X	"") ;;
X	framework)
X	  prev=
X	  if test $linkmode = oldlib && test $linkmode = obj; then
X	    $echo "$modename: warning: \`-framework' is ignored for archives/objects: $deplib" 1>&2
X	    continue
X	  fi
X	  if test $pass = conv; then
X	    deplibs="-framework $deplib $deplibs"
X	    continue
X	  fi
X	  if test "$linkmode,$pass" = "prog,link"; then
X	    compile_deplibs="-framework $deplib $compile_deplibs"
X	    finalize_deplibs="-framework $deplib $finalize_deplibs"
X	  else
X	    deplibs="-framework $deplib $deplibs"
X	    test $linkmode = lib && newdependency_libs="-framework $deplib $newdependency_libs"
X	  fi
X	  continue
X	  ;;
X	esac
X	lib=
X	found=no
X	case $deplib in
X	-framework)
X	  prev=framework
X	  continue
X	  ;;
X	-l*)
X	  if test "$linkmode" = oldlib && test "$linkmode" = obj; then
X	    $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
X	    continue
X	  fi
X	  if test "$pass" = conv; then
X	    deplibs="$deplib $deplibs"
X	    continue
X	  fi
X	  name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
X	  for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
X	    # Search the libtool library
X	    lib="$searchdir/lib${name}.la"
X	    if test -f "$lib"; then
X	      found=yes
X	      break
X	    fi
X	  done
X	  if test "$found" != yes; then
X	    # deplib doesn't seem to be a libtool library
X	    if test "$linkmode,$pass" = "prog,link"; then
X	      compile_deplibs="$deplib $compile_deplibs"
X	      finalize_deplibs="$deplib $finalize_deplibs"
X	    else
X	      deplibs="$deplib $deplibs"
X	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
X	    fi
X	    continue
X	  fi
X	  ;; # -l
X	-L*)
X	  case $linkmode in
X	  lib)
X	    deplibs="$deplib $deplibs"
X	    test "$pass" = conv && continue
X	    newdependency_libs="$deplib $newdependency_libs"
X	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
X	    ;;
X	  prog)
X	    if test "$pass" = conv; then
X	      deplibs="$deplib $deplibs"
X	      continue
X	    fi
X	    if test "$pass" = scan; then
X	      deplibs="$deplib $deplibs"
X	      newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
X	    else
X	      compile_deplibs="$deplib $compile_deplibs"
X	      finalize_deplibs="$deplib $finalize_deplibs"
X	    fi
X	    ;;
X	  *)
X	    $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
X	    ;;
X	  esac # linkmode
X	  continue
X	  ;; # -L
X	-R*)
X	  if test "$pass" = link; then
X	    dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
X	    # Make sure the xrpath contains only unique directories.
X	    case "$xrpath " in
X	    *" $dir "*) ;;
X	    *) xrpath="$xrpath $dir" ;;
X	    esac
X	  fi
X	  deplibs="$deplib $deplibs"
X	  continue
X	  ;;
X	*.la) lib="$deplib" ;;
X	*.$libext)
X	  if test "$pass" = conv; then
X	    deplibs="$deplib $deplibs"
X	    continue
X	  fi
X	  case $linkmode in
X	  lib)
X	    if test "$deplibs_check_method" != pass_all; then
X	      echo
X	      echo "*** Warning: This library needs some functionality provided by $deplib."
X	      echo "*** I have the capability to make that library automatically link in when"
X	      echo "*** you link to this library.  But I can only do this if you have a"
X	      echo "*** shared version of the library, which you do not appear to have."
X	    else
X	      echo
X	      echo "*** Warning: Linking the shared library $output against the"
X	      echo "*** static library $deplib is not portable!"
X	      deplibs="$deplib $deplibs"
X	    fi
X	    continue
X	    ;;
X	  prog)
X	    if test "$pass" != link; then
X	      deplibs="$deplib $deplibs"
X	    else
X	      compile_deplibs="$deplib $compile_deplibs"
X	      finalize_deplibs="$deplib $finalize_deplibs"
X	    fi
X	    continue
X	    ;;
X	  esac # linkmode
X	  ;; # *.$libext
X	*.lo | *.$objext)
X	  if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
X	    # If there is no dlopen support or we're linking statically,
X	    # we need to preload.
X	    newdlprefiles="$newdlprefiles $deplib"
X	    compile_deplibs="$deplib $compile_deplibs"
X	    finalize_deplibs="$deplib $finalize_deplibs"
X	  else
X	    newdlfiles="$newdlfiles $deplib"
X	  fi
X	  continue
X	  ;;
X	%DEPLIBS%)
X	  alldeplibs=yes
X	  continue
X	  ;;
X	esac # case $deplib
X	if test "$found" = yes || test -f "$lib"; then :
X	else
X	  $echo "$modename: cannot find the library \`$lib'" 1>&2
X	  exit 1
X	fi
X
X	# Check to see that this really is a libtool archive.
X	if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
X	else
X	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
X	  exit 1
X	fi
X
X	ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
X	test "X$ladir" = "X$lib" && ladir="."
X
X	dlname=
X	dlopen=
X	dlpreopen=
X	libdir=
X	library_names=
X	old_library=
X	# If the library was installed with an old release of libtool,
X	# it will not redefine variable installed.
X	installed=yes
X
X	# Read the .la file
X	case $lib in
X	*/* | *\\*) . $lib ;;
X	*) . ./$lib ;;
X	esac
X
X	if test "$linkmode,$pass" = "lib,link" ||
X	   test "$linkmode,$pass" = "prog,scan" ||
X	   { test "$linkmode" = oldlib && test "$linkmode" = obj; }; then
X	   # Add dl[pre]opened files of deplib
X	  test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
X	  test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
X	fi
X
X	if test "$pass" = conv; then
X	  # Only check for convenience libraries
X	  deplibs="$lib $deplibs"
X	  if test -z "$libdir"; then
X	    if test -z "$old_library"; then
X	      $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
X	      exit 1
X	    fi
X	    # It is a libtool convenience library, so add in its objects.
X	    convenience="$convenience $ladir/$objdir/$old_library"
X	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
X	    tmp_libs=
X	    prev=
X	    for deplib in $dependency_libs; do
X	      case $deplib in
X	      -framework)
X		prev=framework
X		continue
X		;;
X	      *)
X		case $prev in
X		framework)
X		  deplibs="-framework $deplib $deplibs"
X		  case "$tmp_libs " in
X		  *" $deplib "*)
X		    specialdeplibs="$specialdeplibs -framework $deplib" ;;
X		  esac
X		  tmp_libs="$tmp_libs -framework $deplib"
X		  ;;
X		*)
X		  deplibs="$deplib $deplibs"
X		  case "$tmp_libs " in
X		  *" $deplib "*)
X		    specialdeplibs="$specialdeplibs $deplib" ;;
X		  esac
X		  tmp_libs="$tmp_libs $deplib"
X		  ;;
X		esac
X		;;
X	      esac
X	      prev=
X	    done
X	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
X	    $echo "$modename: \`$lib' is not a convenience library" 1>&2
X	    exit 1
X	  fi
X	  continue
X	fi # $pass = conv
X
X	# Get the name of the library we link against.
X	linklib=
X	for l in $old_library $library_names; do
X	  linklib="$l"
X	done
X	if test -z "$linklib"; then
X	  $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
X	  exit 1
X	fi
X
X	# This library was specified with -dlopen.
X	if test "$pass" = dlopen; then
X	  if test -z "$libdir"; then
X	    $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
X	    exit 1
X	  fi
X	  if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
X	    # If there is no dlname, no dlopen support or we're linking
X	    # statically, we need to preload.
X	    dlprefiles="$dlprefiles $lib"
X	  else
X	    newdlfiles="$newdlfiles $lib"
X	  fi
X	  continue
X	fi # $pass = dlopen
X
X	# We need an absolute path.
X	case $ladir in
X	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
X	*)
X	  abs_ladir=`cd "$ladir" && pwd`
X	  if test -z "$abs_ladir"; then
X	    $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
X	    $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
X	    abs_ladir="$ladir"
X	  fi
X	  ;;
X	esac
X	laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
X
X	# Find the relevant object directory and library name.
X	if test "X$installed" = Xyes; then
X	  if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
X	    $echo "$modename: warning: library \`$lib' was moved." 1>&2
X	    dir="$ladir"
X	    absdir="$abs_ladir"
X	    libdir="$abs_ladir"
X	  else
X	    dir="$libdir"
X	    absdir="$libdir"
X	  fi
X	else
X	  dir="$ladir/$objdir"
X	  absdir="$abs_ladir/$objdir"
X	  # Remove this search path later
X	  notinst_path="$notinst_path $abs_ladir"
X	fi # $installed = yes
X	name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
X
X	# This library was specified with -dlpreopen.
X	if test "$pass" = dlpreopen; then
X	  if test -z "$libdir"; then
X	    $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
X	    exit 1
X	  fi
X	  # Prefer using a static library (so that no silly _DYNAMIC symbols
X	  # are required to link).
X	  if test -n "$old_library"; then
X	    newdlprefiles="$newdlprefiles $dir/$old_library"
X	  # Otherwise, use the dlname, so that lt_dlopen finds it.
X	  elif test -n "$dlname"; then
X	    newdlprefiles="$newdlprefiles $dir/$dlname"
X	  else
X	    newdlprefiles="$newdlprefiles $dir/$linklib"
X	  fi
X	fi # $pass = dlpreopen
X
X	if test -z "$libdir"; then
X	  # Link the convenience library
X	  if test "$linkmode" = lib; then
X	    deplibs="$dir/$old_library $deplibs"
X	  elif test "$linkmode,$pass" = "prog,link"; then
X	    compile_deplibs="$dir/$old_library $compile_deplibs"
X	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
X	  else
X	    deplibs="$lib $deplibs"
X	  fi
X	  continue
X	fi
X
X	if test "$linkmode" = prog && test "$pass" != link; then
X	  newlib_search_path="$newlib_search_path $ladir"
X	  deplibs="$lib $deplibs"
X
X	  linkalldeplibs=no
X	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
X	     test "$build_libtool_libs" = no; then
X	    linkalldeplibs=yes
X	  fi
X
X	  tmp_libs=
X	  prev=
X	  for deplib in $dependency_libs; do
X	    case $deplib in
X	    -framework)
X	      prev=framework
X	      continue
X	      ;;
X	    -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
X	    esac
X	    # Need to link against all dependency_libs?
X	    if test "$linkalldeplibs" = yes; then
X	      case $prev in
X	      framework) deplibs="-framework $deplib $deplibs" ;;
X	      *)         deplibs="$deplib $deplibs" ;;
X	      esac
X	    else
X	      # Need to hardcode shared library paths
X	      # or/and link against static libraries
X	      case $prev in
X	      framework) newdependency_libs="-framework $deplib $newdependency_libs" ;;
X	      *)         newdependency_libs="$deplib $newdependency_libs" ;;
X	      esac
X	    fi
X	    case "$tmp_libs " in
X	    *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
X	    esac
X	    tmp_libs="$tmp_libs $deplib"
X	    prev=
X	  done # for deplib
X	  continue
X	fi # $linkmode = prog...
X
X	link_static=no # Whether the deplib will be linked statically
X	if test -n "$library_names" &&
X	   { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
X	  # Link against this shared library
X
X	  if test "$linkmode,$pass" = "prog,link" ||
X	   { test "$linkmode" = lib && test "$hardcode_into_libs" = yes; }; then
X	    # Hardcode the library path.
X	    # Skip directories that are in the system default run-time
X	    # search path.
X	    case " $sys_lib_dlsearch_path " in
X	    *" $absdir "*) ;;
X	    *)
X	      case "$compile_rpath " in
X	      *" $absdir "*) ;;
X	      *) compile_rpath="$compile_rpath $absdir"
X	      esac
X	      ;;
X	    esac
X	    case " $sys_lib_dlsearch_path " in
X	    *" $libdir "*) ;;
X	    *)
X	      case "$finalize_rpath " in
X	      *" $libdir "*) ;;
X	      *) finalize_rpath="$finalize_rpath $libdir"
X	      esac
X	      ;;
X	    esac
X	    if test "$linkmode" = prog; then
X	      # We need to hardcode the library path
X	      if test -n "$shlibpath_var"; then
X		# Make sure the rpath contains only unique directories.
X		case "$temp_rpath " in
X		*" $dir "*) ;;
X		*" $absdir "*) ;;
X		*) temp_rpath="$temp_rpath $dir" ;;
X		esac
X	      fi
X	    fi
X	  fi # $linkmode,$pass = prog,link...
X
X	  if test "$alldeplibs" = yes &&
X	     { test "$deplibs_check_method" = pass_all ||
X	       { test "$build_libtool_libs" = yes &&
X		 test -n "$library_names"; }; }; then
X	    # We only need to search for static libraries
X	    continue
X	  fi
X
X	  if test "$installed" = no; then
X	    notinst_deplibs="$notinst_deplibs $lib"
X	    need_relink=yes
X	  fi
X
X	  if test -n "$old_archive_from_expsyms_cmds"; then
X	    # figure out the soname
X	    set dummy $library_names
X	    realname="$2"
X	    shift; shift
X	    libname=`eval \\$echo \"$libname_spec\"`
X	    # use dlname if we got it. it's perfectly good, no?
X	    if test -n "$dlname"; then
X	      soname="$dlname"
X	    elif test -n "$soname_spec"; then
X	      # bleh windows
X	      case $host in
X	      *cygwin*)
X		major=`expr $current - $age`
X		versuffix="-$major"
X		;;
X	      esac
X	      eval soname=\"$soname_spec\"
X	    else
X	      soname="$realname"
X	    fi
X
X	    # Make a new name for the extract_expsyms_cmds to use
X	    soroot="$soname"
X	    soname=`echo $soroot | sed -e 's/^.*\///'`
X	    newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
X
X	    # If the library has no export list, then create one now
X	    if test -f "$output_objdir/$soname-def"; then :
X	    else
X	      $show "extracting exported symbol list from \`$soname'"
X	      save_ifs="$IFS"; IFS='~'
X	      eval cmds=\"$extract_expsyms_cmds\"
X	      for cmd in $cmds; do
X		IFS="$save_ifs"
X		$show "$cmd"
X		$run eval "$cmd" || exit $?
X	      done
X	      IFS="$save_ifs"
X	    fi
X
X	    # Create $newlib
X	    if test -f "$output_objdir/$newlib"; then :; else
X	      $show "generating import library for \`$soname'"
X	      save_ifs="$IFS"; IFS='~'
X	      eval cmds=\"$old_archive_from_expsyms_cmds\"
X	      for cmd in $cmds; do
X		IFS="$save_ifs"
X		$show "$cmd"
X		$run eval "$cmd" || exit $?
X	      done
X	      IFS="$save_ifs"
X	    fi
X	    # make sure the library variables are pointing to the new library
X	    dir=$output_objdir
X	    linklib=$newlib
X	  fi # test -n "$old_archive_from_expsyms_cmds"
X
X	  if test "$linkmode" = prog || test "$mode" != relink; then
X	    add_shlibpath=
X	    add_dir=
X	    add=
X	    lib_linked=yes
X	    case $hardcode_action in
X	    immediate | unsupported)
X	      if test "$hardcode_direct" = no; then
X		add="$dir/$linklib"
X	      elif test "$hardcode_minus_L" = no; then
X		case $host in
X		*-*-sunos*) add_shlibpath="$dir" ;;
X		esac
X		add_dir="-L$dir"
X		add="-l$name"
X	      elif test "$hardcode_shlibpath_var" = no; then
X		add_shlibpath="$dir"
X		add="-l$name"
X	      else
X		lib_linked=no
X	      fi
X	      ;;
X	    relink)
X	      if test "$hardcode_direct" = yes; then
X		add="$dir/$linklib"
X	      elif test "$hardcode_minus_L" = yes; then
X		add_dir="-L$dir"
X		add="-l$name"
X	      elif test "$hardcode_shlibpath_var" = yes; then
X		add_shlibpath="$dir"
X		add="-l$name"
X	      else
X		lib_linked=no
X	      fi
X	      ;;
X	    *) lib_linked=no ;;
X	    esac
X
X	    if test "$lib_linked" != yes; then
X	      $echo "$modename: configuration error: unsupported hardcode properties"
X	      exit 1
X	    fi
X
X	    if test -n "$add_shlibpath"; then
X	      case :$compile_shlibpath: in
X	      *":$add_shlibpath:"*) ;;
X	      *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
X	      esac
X	    fi
X	    if test "$linkmode" = prog; then
X	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
X	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
X	    else
X	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
X	      test -n "$add" && deplibs="$add $deplibs"
X	      if test "$hardcode_direct" != yes && \
X		 test "$hardcode_minus_L" != yes && \
X		 test "$hardcode_shlibpath_var" = yes; then
X		case :$finalize_shlibpath: in
X		*":$libdir:"*) ;;
X		*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
X		esac
X	      fi
X	    fi
X	  fi
X
X	  if test "$linkmode" = prog || test "$mode" = relink; then
X	    add_shlibpath=
X	    add_dir=
X	    add=
X	    # Finalize command for both is simple: just hardcode it.
X	    if test "$hardcode_direct" = yes; then
X	      add="$libdir/$linklib"
X	    elif test "$hardcode_minus_L" = yes; then
X	      add_dir="-L$libdir"
X	      add="-l$name"
X	    elif test "$hardcode_shlibpath_var" = yes; then
X	      case :$finalize_shlibpath: in
X	      *":$libdir:"*) ;;
X	      *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
X	      esac
X	      add="-l$name"
X	    else
X	      # We cannot seem to hardcode it, guess we'll fake it.
X	      add_dir="-L$libdir"
X	      add="-l$name"
X	    fi
X
X	    if test "$linkmode" = prog; then
X	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
X	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
X	    else
X	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
X	      test -n "$add" && deplibs="$add $deplibs"
X	    fi
X	  fi
X	elif test "$linkmode" = prog; then
X	  if test "$alldeplibs" = yes &&
X	     { test "$deplibs_check_method" = pass_all ||
X	       { test "$build_libtool_libs" = yes &&
X		 test -n "$library_names"; }; }; then
X	    # We only need to search for static libraries
X	    continue
X	  fi
X
X	  # Try to link the static library
X	  # Here we assume that one of hardcode_direct or hardcode_minus_L
X	  # is not unsupported.  This is valid on all known static and
X	  # shared platforms.
X	  if test "$hardcode_direct" != unsupported; then
X	    test -n "$old_library" && linklib="$old_library"
X	    compile_deplibs="$dir/$linklib $compile_deplibs"
X	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
X	  else
X	    compile_deplibs="-l$name -L$dir $compile_deplibs"
X	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
X	  fi
X	elif test "$build_libtool_libs" = yes; then
X	  # Not a shared library
X	  if test "$deplibs_check_method" != pass_all; then
X	    # We're trying link a shared library against a static one
X	    # but the system doesn't support it.
X
X	    # Just print a warning and add the library to dependency_libs so
X	    # that the program can be linked against the static library.
X	    echo
X	    echo "*** Warning: This library needs some functionality provided by $lib."
X	    echo "*** I have the capability to make that library automatically link in when"
X	    echo "*** you link to this library.  But I can only do this if you have a"
X	    echo "*** shared version of the library, which you do not appear to have."
X	    if test "$module" = yes; then
X	      echo "*** Therefore, libtool will create a static module, that should work "
X	      echo "*** as long as the dlopening application is linked with the -dlopen flag."
X	      if test -z "$global_symbol_pipe"; then
X		echo
X		echo "*** However, this would only work if libtool was able to extract symbol"
X		echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
X		echo "*** not find such a program.  So, this module is probably useless."
X		echo "*** \`nm' from GNU binutils and a full rebuild may help."
X	      fi
X	      if test "$build_old_libs" = no; then
X		build_libtool_libs=module
X		build_old_libs=yes
X	      else
X		build_libtool_libs=no
X	      fi
X	    fi
X	  else
X	    convenience="$convenience $dir/$old_library"
X	    old_convenience="$old_convenience $dir/$old_library"
X	    deplibs="$dir/$old_library $deplibs"
X	    link_static=yes
X	  fi
X	fi # link shared/static library?
X
X	if test "$linkmode" = lib; then
X	  if test -n "$dependency_libs" &&
X	     { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
X	       test "$link_static" = yes; }; then
X	    # Extract -R from dependency_libs
X	    temp_deplibs=
X	    for libdir in $dependency_libs; do
X	      case $libdir in
X	      -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
X		   case " $xrpath " in
X		   *" $temp_xrpath "*) ;;
X		   *) xrpath="$xrpath $temp_xrpath";;
X		   esac;;
X	      *) temp_deplibs="$temp_deplibs $libdir";;
X	      esac
X	    done
X	    dependency_libs="$temp_deplibs"
X	  fi
X
X	  newlib_search_path="$newlib_search_path $absdir"
X	  # Link against this library
X	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
X	  # ... and its dependency_libs
X	  tmp_libs=
X	  prev=
X	  for deplib in $dependency_libs; do
X	    case $deplib in
X	    -framework)
X	      prev=framework
X	      continue
X	      ;;
X	    *)
X	      case $prev in
X	      framework)
X		newdependency_libs="-framework $deplib $newdependency_libs"
X		case "$tmp_libs " in
X		*" $deplib "*)
X		  specialdeplibs="$specialdeplibs -framework $deplib" ;;
X		esac
X		tmp_libs="$tmp_libs -framework $deplib"
X		;;
X	      *)
X		newdependency_libs="$deplib $newdependency_libs"
X		case "$tmp_libs " in
X		*" $deplib "*)
X		  specialdeplibs="$specialdeplibs $deplib" ;;
X		esac
X		tmp_libs="$tmp_libs $deplib"
X		;;
X	      esac
X	      ;;
X	    esac
X	    prev=
X	  done
X
X	  if test "$link_all_deplibs" != no; then
X	    # Add the search paths of all dependency libraries
X	    for deplib in $dependency_libs; do
X	      case $deplib in
X	      -L*) path="$deplib" ;;
X	      *.la)
X		dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
X		test "X$dir" = "X$deplib" && dir="."
X		# We need an absolute path.
X		case $dir in
X		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
X		*)
X		  absdir=`cd "$dir" && pwd`
X		  if test -z "$absdir"; then
X		    $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
X		    absdir="$dir"
X		  fi
X		  ;;
X		esac
X		if grep "^installed=no" $deplib > /dev/null; then
X		  path="-L$absdir/$objdir"
X		else
X		  eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
X		  if test -z "$libdir"; then
X		    $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
X		    exit 1
X		  fi
X		  if test "$absdir" != "$libdir"; then
X		    $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
X		  fi
X		  path="-L$absdir"
X		fi
X		;;
X	      *) continue ;;
X	      esac
X	      case " $deplibs " in
X	      *" $path "*) ;;
X	      *) deplibs="$deplibs $path" ;;
X	      esac
X	    done
X	  fi # link_all_deplibs != no
X	fi # linkmode = lib
X      done # for deplib in $libs
X      if test "$pass" = dlpreopen; then
X	# Link the dlpreopened libraries before other libraries
X	prev=
X	for deplib in $save_deplibs; do
X	  case $deplib in
X	  -framework)
X	    prev=framework
X	    continue
X	    ;;
X	  *)
X	    case $prev in
X	    framework) deplibs="-framework $deplib $deplibs" ;;
X	    *)         deplibs="$deplib $deplibs" ;;
X	    esac
X	    ;;
X	  esac
X	  prev=
X	done
X      fi
X      if test "$pass" != dlopen; then
X	test "$pass" != scan && dependency_libs="$newdependency_libs"
X	if test "$pass" != conv; then
X	  # Make sure lib_search_path contains only unique directories.
X	  lib_search_path=
X	  for dir in $newlib_search_path; do
X	    case "$lib_search_path " in
X	    *" $dir "*) ;;
X	    *) lib_search_path="$lib_search_path $dir" ;;
X	    esac
X	  done
X	  newlib_search_path=
X	fi
X
X	if test "$linkmode,$pass" != "prog,link"; then
X	  vars="deplibs"
X	else
X	  vars="compile_deplibs finalize_deplibs"
X	fi
X	for var in $vars dependency_libs; do
X	  # Add libraries to $var in reverse order
X	  eval tmp_libs=\"\$$var\"
X	  new_libs=
X	  prev=
X	  for deplib in $tmp_libs; do
X	    case $deplib in
X	    -framework)
X	      prev=framework
X	      continue
X	      ;;
X	    -L*) new_libs="$deplib $new_libs" ;;
X	    *)
X	      case " $specialdeplibs " in
X	      *" $deplib "*)
X		case $prev in
X		framework) new_libs="-framework $deplib $new_libs" ;;
X		*)         new_libs="$deplib $new_libs" ;;
X		esac
X		;;
X	      *)
X		case " $new_libs " in
X		*" $deplib "*) ;;
X		*)
X		  case $prev in
X		  framework) new_libs="-framework $deplib $new_libs" ;;
X		  *)         new_libs="$deplib $new_libs" ;;
X		  esac
X		  ;;
X		esac
X		;;
X	      esac
X	      ;;
X	    esac
X	    prev=
X	  done
X	  tmp_libs=
X	  for deplib in $new_libs; do
X	    case $deplib in
X	    -L*)
X	      case " $tmp_libs " in
X	      *" $deplib "*) ;;
X	      *) tmp_libs="$tmp_libs $deplib" ;;
X	      esac
X	      ;;
X	    *) tmp_libs="$tmp_libs $deplib" ;;
X	    esac
X	  done
X	  eval $var=\"$tmp_libs\"
X	done # for var
X      fi
X      if test "$pass" = "conv" &&
X       { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then
X	libs="$deplibs" # reset libs
X	deplibs=
X      fi
X    done # for pass
X    if test "$linkmode" = prog; then
X      dlfiles="$newdlfiles"
X      dlprefiles="$newdlprefiles"
X    fi
X
X    case $linkmode in
X    oldlib)
X      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
X	$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
X      fi
X
X      if test -n "$rpath"; then
X	$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
X      fi
X
X      if test -n "$xrpath"; then
X	$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
X      fi
X
X      if test -n "$vinfo"; then
X	$echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
X      fi
X
X      if test -n "$release"; then
X	$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
X      fi
X
X      if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
X	$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
X      fi
X
X      # Now set the variables for building old libraries.
X      build_libtool_libs=no
X      oldlibs="$output"
X      objs="$objs$old_deplibs"
X      ;;
X
X    lib)
X      # Make sure we only generate libraries of the form `libNAME.la'.
X      case $outputname in
X      lib*)
X	name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
X	eval libname=\"$libname_spec\"
X	;;
X      *)
X	if test "$module" = no; then
X	  $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
X	  $echo "$help" 1>&2
X	  exit 1
X	fi
X	if test "$need_lib_prefix" != no; then
X	  # Add the "lib" prefix for modules if required
X	  name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
X	  eval libname=\"$libname_spec\"
X	else
X	  libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
X	fi
X	;;
X      esac
X
X      if test -n "$objs"; then
X	if test "$deplibs_check_method" != pass_all; then
X	  $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
X	  exit 1
X	else
X	  echo
X	  echo "*** Warning: Linking the shared library $output against the non-libtool"
X	  echo "*** objects $objs is not portable!"
X	  libobjs="$libobjs $objs"
X	fi
X      fi
X
X      if test "$dlself" != no; then
X	$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
X      fi
X
X      set dummy $rpath
X      if test "$#" -gt 2; then
X	$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
X      fi
X      install_libdir="$2"
X
X      oldlibs=
X      if test -z "$rpath"; then
X	if test "$build_libtool_libs" = yes; then
X	  # Building a libtool convenience library.
X	  libext=al
X	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
X	  build_libtool_libs=convenience
X	  build_old_libs=yes
X	fi
X
X	if test -n "$vinfo"; then
X	  $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
X	fi
X
X	if test -n "$release"; then
X	  $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
X	fi
X      else
X
X	# Parse the version information argument.
X	save_ifs="$IFS"; IFS=':'
X	set dummy $vinfo 0 0 0
X	IFS="$save_ifs"
X
X	if test -n "$8"; then
X	  $echo "$modename: too many parameters to \`-version-info'" 1>&2
X	  $echo "$help" 1>&2
X	  exit 1
X	fi
X
X	current="$2"
X	revision="$3"
X	age="$4"
X
X	# Check that each of the things are valid numbers.
X	case $current in
X	[0-9]*) ;;
X	*)
X	  $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
X	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
X	  exit 1
X	  ;;
X	esac
X
X	case $revision in
X	[0-9]*) ;;
X	*)
X	  $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
X	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
X	  exit 1
X	  ;;
X	esac
X
X	case $age in
X	[0-9]*) ;;
X	*)
X	  $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
X	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
X	  exit 1
X	  ;;
X	esac
X
X	if test "$age" -gt "$current"; then
X	  $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
X	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
X	  exit 1
X	fi
X
X	# Calculate the version variables.
X	major=
X	versuffix=
X	verstring=
X	case $version_type in
X	none) ;;
X
X	darwin)
X	  # Like Linux, but with the current version available in
X	  # verstring for coding it into the library header
X	  major=.`expr $current - $age`
X	  versuffix="$major.$age.$revision"
X	  # Darwin ld doesn't like 0 for these options...
X	  minor_current=`expr $current + 1`
X	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
X	  ;;
X
X	freebsd-aout)
X	  major=".$current"
X	  versuffix=".$current.$revision";
X	  ;;
X
X	freebsd-elf)
X	  major=".$current"
X	  versuffix=".$current";
X	  ;;
X
X	irix)
X	  major=`expr $current - $age + 1`
X	  verstring="sgi$major.$revision"
X
X	  # Add in all the interfaces that we are compatible with.
X	  loop=$revision
X	  while test "$loop" -ne 0; do
X	    iface=`expr $revision - $loop`
X	    loop=`expr $loop - 1`
X	    verstring="sgi$major.$iface:$verstring"
X	  done
X
X	  # Before this point, $major must not contain `.'.
X	  major=.$major
X	  versuffix="$major.$revision"
X	  ;;
X
X	linux)
X	  major=.`expr $current - $age`
X	  versuffix="$major.$age.$revision"
X	  ;;
X
X	osf)
X	  major=`expr $current - $age`
X	  versuffix=".$current.$age.$revision"
X	  verstring="$current.$age.$revision"
X
X	  # Add in all the interfaces that we are compatible with.
X	  loop=$age
X	  while test "$loop" -ne 0; do
X	    iface=`expr $current - $loop`
X	    loop=`expr $loop - 1`
X	    verstring="$verstring:${iface}.0"
X	  done
X
X	  # Make executables depend on our current version.
X	  verstring="$verstring:${current}.0"
X	  ;;
X
X	sunos)
X	  major=".$current"
X	  versuffix=".$current.$revision"
X	  ;;
X
X	windows)
X	  # Use '-' rather than '.', since we only want one
X	  # extension on DOS 8.3 filesystems.
X	  major=`expr $current - $age`
X	  versuffix="-$major"
X	  ;;
X
X	*)
X	  $echo "$modename: unknown library version type \`$version_type'" 1>&2
X	  echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
X	  exit 1
X	  ;;
X	esac
X
X	# Clear the version info if we defaulted, and they specified a release.
X	if test -z "$vinfo" && test -n "$release"; then
X	  major=
X	  verstring="0.0"
X	  case $version_type in
X	  darwin)
X	    # we can't check for "0.0" in archive_cmds due to quoting
X	    # problems, so we reset it completely
X	    verstring=""
X	    ;;
X	  *)
X	    verstring="0.0"
X	    ;;
X	  esac
X	  if test "$need_version" = no; then
X	    versuffix=
X	  else
X	    versuffix=".0.0"
X	  fi
X	fi
X
X	# Remove version info from name if versioning should be avoided
X	if test "$avoid_version" = yes && test "$need_version" = no; then
X	  major=
X	  versuffix=
X	  verstring=""
X	fi
X
X	# Check to see if the archive will have undefined symbols.
X	if test "$allow_undefined" = yes; then
X	  if test "$allow_undefined_flag" = unsupported; then
X	    $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
X	    build_libtool_libs=no
X	    build_old_libs=yes
X	  fi
X	else
X	  # Don't allow undefined symbols.
X	  allow_undefined_flag="$no_undefined_flag"
X	fi
X      fi
X
X      if test "$mode" != relink; then
X	# Remove our outputs.
X	$show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
X	$run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
X      fi
X
X      # Now set the variables for building old libraries.
X      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
X	oldlibs="$oldlibs $output_objdir/$libname.$libext"
X
X	# Transform .lo files to .o files.
X	oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
X      fi
X
X      # Eliminate all temporary directories.
X      for path in $notinst_path; do
X	lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'`
X	deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'`
X	dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
X      done
X
X      if test -n "$xrpath"; then
X	# If the user specified any rpath flags, then add them.
X	temp_xrpath=
X	for libdir in $xrpath; do
X	  temp_xrpath="$temp_xrpath -R$libdir"
X	  case "$finalize_rpath " in
X	  *" $libdir "*) ;;
X	  *) finalize_rpath="$finalize_rpath $libdir" ;;
X	  esac
X	done
X	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
X	  dependency_libs="$temp_xrpath $dependency_libs"
X	fi
X      fi
X
X      # Make sure dlfiles contains only unique files that won't be dlpreopened
X      old_dlfiles="$dlfiles"
X      dlfiles=
X      for lib in $old_dlfiles; do
X	case " $dlprefiles $dlfiles " in
X	*" $lib "*) ;;
X	*) dlfiles="$dlfiles $lib" ;;
X	esac
X      done
X
X      # Make sure dlprefiles contains only unique files
X      old_dlprefiles="$dlprefiles"
X      dlprefiles=
X      for lib in $old_dlprefiles; do
X	case "$dlprefiles " in
X	*" $lib "*) ;;
X	*) dlprefiles="$dlprefiles $lib" ;;
X	esac
X      done
X
X      if test "$build_libtool_libs" = yes; then
X	if test -n "$rpath"; then
X	  case $host in
X	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
X	    # these systems don't actually have a c library (as such)!
X	    ;;
X	  *-*-rhapsody* | *-*-darwin1.[012])
X	    # Rhapsody C library is in the System framework
X	    deplibs="$deplibs -framework System"
X	    ;;
X	  *-*-netbsd*)
X	    # Don't link with libc until the a.out ld.so is fixed.
X	    ;;
X	  *-*-openbsd*)
X	    # Do not include libc due to us having libc/libc_r.
X	    ;;
X	  *)
X	    # Add libc to deplibs on all other systems if necessary.
X	    if test "$build_libtool_need_lc" = "yes"; then
X	      deplibs="$deplibs -lc"
X	    fi
X	    ;;
X	  esac
X	fi
X
X	# Transform deplibs into only deplibs that can be linked in shared.
X	name_save=$name
X	libname_save=$libname
X	release_save=$release
X	versuffix_save=$versuffix
X	major_save=$major
X	# I'm not sure if I'm treating the release correctly.  I think
X	# release should show up in the -l (ie -lgmp5) so we don't want to
X	# add it in twice.  Is that correct?
X	release=""
X	versuffix=""
X	major=""
X	newdeplibs=
X	droppeddeps=no
X	case $deplibs_check_method in
X	pass_all)
X	  # Don't check for shared/static.  Everything works.
X	  # This might be a little naive.  We might want to check
X	  # whether the library exists or not.  But this is on
X	  # osf3 & osf4 and I'm not really sure... Just
X	  # implementing what was already the behaviour.
X	  newdeplibs=$deplibs
X	  ;;
X	test_compile)
X	  # This code stresses the "libraries are programs" paradigm to its
X	  # limits. Maybe even breaks it.  We compile a program, linking it
X	  # against the deplibs as a proxy for the library.  Then we can check
X	  # whether they linked in statically or dynamically with ldd.
X	  $rm conftest.c
X	  cat > conftest.c <<EOF
X	  int main() { return 0; }
XEOF
X	  $rm conftest
X	  $CC -o conftest conftest.c $deplibs
X	  if test "$?" -eq 0 ; then
X	    ldd_output=`ldd conftest`
X	    for i in $deplibs; do
X	      name="`expr $i : '-l\(.*\)'`"
X	      # If $name is empty we are operating on a -L argument.
X	      if test -n "$name" && test "$name" != "0"; then
X		libname=`eval \\$echo \"$libname_spec\"`
X		deplib_matches=`eval \\$echo \"$library_names_spec\"`
X		set dummy $deplib_matches
X		deplib_match=$2
X		if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
X		  newdeplibs="$newdeplibs $i"
X		else
X		  droppeddeps=yes
X		  echo
X		  echo "*** Warning: This library needs some functionality provided by $i."
X		  echo "*** I have the capability to make that library automatically link in when"
X		  echo "*** you link to this library.  But I can only do this if you have a"
X		  echo "*** shared version of the library, which you do not appear to have."
X		fi
X	      else
X		newdeplibs="$newdeplibs $i"
X	      fi
X	    done
X	  else
X	    # Error occured in the first compile.  Let's try to salvage the situation:
X	    # Compile a seperate program for each library.
X	    for i in $deplibs; do
X	      name="`expr $i : '-l\(.*\)'`"
X	     # If $name is empty we are operating on a -L argument.
X	      if test -n "$name" && test "$name" != "0"; then
X		$rm conftest
X		$CC -o conftest conftest.c $i
X		# Did it work?
X		if test "$?" -eq 0 ; then
X		  ldd_output=`ldd conftest`
X		  libname=`eval \\$echo \"$libname_spec\"`
X		  deplib_matches=`eval \\$echo \"$library_names_spec\"`
X		  set dummy $deplib_matches
X		  deplib_match=$2
X		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
X		    newdeplibs="$newdeplibs $i"
X		  else
X		    droppeddeps=yes
X		    echo
X		    echo "*** Warning: This library needs some functionality provided by $i."
X		    echo "*** I have the capability to make that library automatically link in when"
X		    echo "*** you link to this library.  But I can only do this if you have a"
X		    echo "*** shared version of the library, which you do not appear to have."
X		  fi
X		else
X		  droppeddeps=yes
X		  echo
X		  echo "*** Warning!  Library $i is needed by this library but I was not able to"
X		  echo "***  make it link in!  You will probably need to install it or some"
X		  echo "*** library that it depends on before this library will be fully"
X		  echo "*** functional.  Installing it before continuing would be even better."
X		fi
X	      else
X		newdeplibs="$newdeplibs $i"
X	      fi
X	    done
X	  fi
X	  ;;
X	file_magic*)
X	  set dummy $deplibs_check_method
X	  file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
X	  for a_deplib in $deplibs; do
X	    name="`expr $a_deplib : '-l\(.*\)'`"
X	    # If $name is empty we are operating on a -L argument.
X	    if test -n "$name" && test "$name" != "0"; then
X	      libname=`eval \\$echo \"$libname_spec\"`
X	      for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
X		    potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
X		    for potent_lib in $potential_libs; do
X		      # Follow soft links.
X		      if ls -lLd "$potent_lib" 2>/dev/null \
X			 | grep " -> " >/dev/null; then
X			continue
X		      fi
X		      # The statement above tries to avoid entering an
X		      # endless loop below, in case of cyclic links.
X		      # We might still enter an endless loop, since a link
X		      # loop can be closed while we follow links,
X		      # but so what?
X		      potlib="$potent_lib"
X		      while test -h "$potlib" 2>/dev/null; do
X			potliblink=`ls -ld $potlib | sed 's/.* -> //'`
X			case $potliblink in
X			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
X			*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
X			esac
X		      done
X		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
X			 | sed 10q \
X			 | egrep "$file_magic_regex" > /dev/null; then
X			newdeplibs="$newdeplibs $a_deplib"
X			a_deplib=""
X			break 2
X		      fi
X		    done
X	      done
X	      if test -n "$a_deplib" ; then
X		droppeddeps=yes
X		echo
X		echo "*** Warning: This library needs some functionality provided by $a_deplib."
X		echo "*** I have the capability to make that library automatically link in when"
X		echo "*** you link to this library.  But I can only do this if you have a"
X		echo "*** shared version of the library, which you do not appear to have."
X	      fi
X	    else
X	      # Add a -L argument.
X	      newdeplibs="$newdeplibs $a_deplib"
X	    fi
X	  done # Gone through all deplibs.
X	  ;;
X	match_pattern*)
X	  set dummy $deplibs_check_method
X	  match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
X	  for a_deplib in $deplibs; do
X	    name="`expr $a_deplib : '-l\(.*\)'`"
X	    # If $name is empty we are operating on a -L argument.
X	    if test -n "$name" && test "$name" != "0"; then
X	      libname=`eval \\$echo \"$libname_spec\"`
X	      for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
X		potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
X		for potent_lib in $potential_libs; do
X		  if eval echo \"$potent_lib\" 2>/dev/null \
X		      | sed 10q \
X		      | egrep "$match_pattern_regex" > /dev/null; then
X		    newdeplibs="$newdeplibs $a_deplib"
X		    a_deplib=""
X		    break 2
X		  fi
X		done
X	      done
X	      if test -n "$a_deplib" ; then
X		droppeddeps=yes
X		echo
X		echo "*** Warning: This library needs some functionality provided by $a_deplib."
X		echo "*** I have the capability to make that library automatically link in when"
X		echo "*** you link to this library.  But I can only do this if you have a"
X		echo "*** shared version of the library, which you do not appear to have."
X	      fi
X	    else
X	      # Add a -L argument.
X	      newdeplibs="$newdeplibs $a_deplib"
X	    fi
X	  done # Gone through all deplibs.
X	  ;;
X	none | unknown | *)
X	  newdeplibs=""
X	  if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
X	       -e 's/ -[LR][^ ]*//g' -e 's/[ 	]//g' |
X	     grep . >/dev/null; then
X	    echo
X	    if test "X$deplibs_check_method" = "Xnone"; then
X	      echo "*** Warning: inter-library dependencies are not supported in this platform."
X	    else
X	      echo "*** Warning: inter-library dependencies are not known to be supported."
X	    fi
X	    echo "*** All declared inter-library dependencies are being dropped."
X	    droppeddeps=yes
X	  fi
X	  ;;
X	esac
X	versuffix=$versuffix_save
X	major=$major_save
X	release=$release_save
X	libname=$libname_save
X	name=$name_save
X
X	case $host in
X	*-*-rhapsody* | *-*-darwin1.[012])
X	  # On Rhapsody replace the C library is the System framework
X	  newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
X	  ;;
X	esac
X
X	if test "$droppeddeps" = yes; then
X	  if test "$module" = yes; then
X	    echo
X	    echo "*** Warning: libtool could not satisfy all declared inter-library"
X	    echo "*** dependencies of module $libname.  Therefore, libtool will create"
X	    echo "*** a static module, that should work as long as the dlopening"
X	    echo "*** application is linked with the -dlopen flag."
X	    if test -z "$global_symbol_pipe"; then
X	      echo
X	      echo "*** However, this would only work if libtool was able to extract symbol"
X	      echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
X	      echo "*** not find such a program.  So, this module is probably useless."
X	      echo "*** \`nm' from GNU binutils and a full rebuild may help."
X	    fi
X	    if test "$build_old_libs" = no; then
X	      oldlibs="$output_objdir/$libname.$libext"
X	      build_libtool_libs=module
X	      build_old_libs=yes
X	    else
X	      build_libtool_libs=no
X	    fi
X	  else
X	    echo "*** The inter-library dependencies that have been dropped here will be"
X	    echo "*** automatically added whenever a program is linked with this library"
X	    echo "*** or is declared to -dlopen it."
X
X	    if test "$allow_undefined" = no; then
X	      echo
X	      echo "*** Since this library must not contain undefined symbols,"
X	      echo "*** because either the platform does not support them or"
X	      echo "*** it was explicitly requested with -no-undefined,"
X	      echo "*** libtool will only create a static version of it."
X	      if test "$build_old_libs" = no; then
X		oldlibs="$output_objdir/$libname.$libext"
X		build_libtool_libs=module
X		build_old_libs=yes
X	      else
X		build_libtool_libs=no
X	      fi
X	    fi
X	  fi
X	fi
X	# Done checking deplibs!
X	deplibs=$newdeplibs
X      fi
X
X      # All the library-specific variables (install_libdir is set above).
X      library_names=
X      old_library=
X      dlname=
X
X      # Test again, we may have decided not to build it any more
X      if test "$build_libtool_libs" = yes; then
X	if test "$hardcode_into_libs" = yes; then
X	  # Hardcode the library paths
X	  hardcode_libdirs=
X	  dep_rpath=
X	  rpath="$finalize_rpath"
X	  test "$mode" != relink && rpath="$compile_rpath$rpath"
X	  for libdir in $rpath; do
X	    if test -n "$hardcode_libdir_flag_spec"; then
X	      if test -n "$hardcode_libdir_separator"; then
X		if test -z "$hardcode_libdirs"; then
X		  hardcode_libdirs="$libdir"
X		else
X		  # Just accumulate the unique libdirs.
X		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
X		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
X		    ;;
X		  *)
X		    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
X		    ;;
X		  esac
X		fi
X	      else
X		eval flag=\"$hardcode_libdir_flag_spec\"
X		dep_rpath="$dep_rpath $flag"
X	      fi
X	    elif test -n "$runpath_var"; then
X	      case "$perm_rpath " in
X	      *" $libdir "*) ;;
X	      *) perm_rpath="$perm_rpath $libdir" ;;
X	      esac
X	    fi
X	  done
X	  # Substitute the hardcoded libdirs into the rpath.
X	  if test -n "$hardcode_libdir_separator" &&
X	     test -n "$hardcode_libdirs"; then
X	    libdir="$hardcode_libdirs"
X	    eval dep_rpath=\"$hardcode_libdir_flag_spec\"
X	  fi
X	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
X	    # We should set the runpath_var.
X	    rpath=
X	    for dir in $perm_rpath; do
X	      rpath="$rpath$dir:"
X	    done
X	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
X	  fi
X	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
X	fi
X
X	shlibpath="$finalize_shlibpath"
X	test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
X	if test -n "$shlibpath"; then
X	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
X	fi
X
X	# Get the real and link names of the library.
X	eval library_names=\"$library_names_spec\"
X	set dummy $library_names
X	realname="$2"
X	shift; shift
X
X	if test -n "$soname_spec"; then
X	  eval soname=\"$soname_spec\"
X	else
X	  soname="$realname"
X	fi
X	test -z "$dlname" && dlname=$soname
X
X	lib="$output_objdir/$realname"
X	for link
X	do
X	  linknames="$linknames $link"
X	done
X
X	# Ensure that we have .o objects for linkers which dislike .lo
X	# (e.g. aix) in case we are running --disable-static
X	for obj in $libobjs; do
X	  xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
X	  if test "X$xdir" = "X$obj"; then
X	    xdir="."
X	  else
X	    xdir="$xdir"
X	  fi
X	  baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
X	  oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
X	  if test ! -f $xdir/$oldobj; then
X	    $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
X	    $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
X	  fi
X	done
X
X	# Use standard objects if they are pic
X	test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
X
X	# Prepare the list of exported symbols
X	if test -z "$export_symbols"; then
X	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
X	    $show "generating symbol list for \`$libname.la'"
X	    export_symbols="$output_objdir/$libname.exp"
X	    $run $rm $export_symbols
X	    eval cmds=\"$export_symbols_cmds\"
X	    save_ifs="$IFS"; IFS='~'
X	    for cmd in $cmds; do
X	      IFS="$save_ifs"
X	      $show "$cmd"
X	      $run eval "$cmd" || exit $?
X	    done
X	    IFS="$save_ifs"
X	    if test -n "$export_symbols_regex"; then
X	      $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
X	      $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
X	      $show "$mv \"${export_symbols}T\" \"$export_symbols\""
X	      $run eval '$mv "${export_symbols}T" "$export_symbols"'
X	    fi
X	  fi
X	fi
X
X	if test -n "$export_symbols" && test -n "$include_expsyms"; then
X	  $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
X	fi
X
X	if test -n "$convenience"; then
X	  if test -n "$whole_archive_flag_spec"; then
X	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
X	  else
X	    gentop="$output_objdir/${outputname}x"
X	    $show "${rm}r $gentop"
X	    $run ${rm}r "$gentop"
X	    $show "mkdir $gentop"
X	    $run mkdir "$gentop"
X	    status=$?
X	    if test "$status" -ne 0 && test ! -d "$gentop"; then
X	      exit $status
X	    fi
X	    generated="$generated $gentop"
X
X	    for xlib in $convenience; do
X	      # Extract the objects.
X	      case $xlib in
X	      [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
X	      *) xabs=`pwd`"/$xlib" ;;
X	      esac
X	      xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
X	      xdir="$gentop/$xlib"
X
X	      $show "${rm}r $xdir"
X	      $run ${rm}r "$xdir"
X	      $show "mkdir $xdir"
X	      $run mkdir "$xdir"
X	      status=$?
X	      if test "$status" -ne 0 && test ! -d "$xdir"; then
X		exit $status
X	      fi
X	      $show "(cd $xdir && $AR x $xabs)"
X	      $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
X
X	      libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
X	    done
X	  fi
X	fi
X
X	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
X	  eval flag=\"$thread_safe_flag_spec\"
X	  linker_flags="$linker_flags $flag"
X	fi
X
X	# Make a backup of the uninstalled library when relinking
X	if test "$mode" = relink; then
X	  $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
X	fi
X
X	# Do each of the archive commands.
X	if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
X	  eval cmds=\"$archive_expsym_cmds\"
X	else
X	  eval cmds=\"$archive_cmds\"
X	fi
X	save_ifs="$IFS"; IFS='~'
X	for cmd in $cmds; do
X	  IFS="$save_ifs"
X	  $show "$cmd"
X	  $run eval "$cmd" || exit $?
X	done
X	IFS="$save_ifs"
X
X	# Restore the uninstalled library and exit
X	if test "$mode" = relink; then
X	  $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
X	  exit 0
X	fi
X
X	# Create links to the real library.
X	for linkname in $linknames; do
X	  if test "$realname" != "$linkname"; then
X	    $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
X	    $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
X	  fi
X	done
X
X	# If -module or -export-dynamic was specified, set the dlname.
X	if test "$module" = yes || test "$export_dynamic" = yes; then
X	  # On all known operating systems, these are identical.
X	  dlname="$soname"
X	fi
X      fi
X      ;;
X
X    obj)
X      if test -n "$deplibs"; then
X	$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
X      fi
X
X      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
X	$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
X      fi
X
X      if test -n "$rpath"; then
X	$echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
X      fi
X
X      if test -n "$xrpath"; then
X	$echo "$modename: warning: \`-R' is ignored for objects" 1>&2
X      fi
X
X      if test -n "$vinfo"; then
X	$echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
X      fi
X
X      if test -n "$release"; then
X	$echo "$modename: warning: \`-release' is ignored for objects" 1>&2
X      fi
X
X      case $output in
X      *.lo)
X	if test -n "$objs$old_deplibs"; then
X	  $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
X	  exit 1
X	fi
X	libobj="$output"
X	obj=`$echo "X$output" | $Xsed -e "$lo2o"`
X	;;
X      *)
X	libobj=
X	obj="$output"
X	;;
X      esac
X
X      # Delete the old objects.
X      $run $rm $obj $libobj
X
X      # Objects from convenience libraries.  This assumes
X      # single-version convenience libraries.  Whenever we create
X      # different ones for PIC/non-PIC, this we'll have to duplicate
X      # the extraction.
X      reload_conv_objs=
X      gentop=
X      # reload_cmds runs $LD directly, so let us get rid of
X      # -Wl from whole_archive_flag_spec
X      wl=
X
X      if test -n "$convenience"; then
X	if test -n "$whole_archive_flag_spec"; then
X	  eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
X	else
X	  gentop="$output_objdir/${obj}x"
X	  $show "${rm}r $gentop"
X	  $run ${rm}r "$gentop"
X	  $show "mkdir $gentop"
X	  $run mkdir "$gentop"
X	  status=$?
X	  if test "$status" -ne 0 && test ! -d "$gentop"; then
X	    exit $status
X	  fi
X	  generated="$generated $gentop"
X
X	  for xlib in $convenience; do
X	    # Extract the objects.
X	    case $xlib in
X	    [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
X	    *) xabs=`pwd`"/$xlib" ;;
X	    esac
X	    xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
X	    xdir="$gentop/$xlib"
X
X	    $show "${rm}r $xdir"
X	    $run ${rm}r "$xdir"
X	    $show "mkdir $xdir"
X	    $run mkdir "$xdir"
X	    status=$?
X	    if test "$status" -ne 0 && test ! -d "$xdir"; then
X	      exit $status
X	    fi
X	    $show "(cd $xdir && $AR x $xabs)"
X	    $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
X
X	    reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
X	  done
X	fi
X      fi
X
X      # Create the old-style object.
X      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
X
X      output="$obj"
X      eval cmds=\"$reload_cmds\"
X      save_ifs="$IFS"; IFS='~'
X      for cmd in $cmds; do
X	IFS="$save_ifs"
X	$show "$cmd"
X	$run eval "$cmd" || exit $?
X      done
X      IFS="$save_ifs"
X
X      # Exit if we aren't doing a library object file.
X      if test -z "$libobj"; then
X	if test -n "$gentop"; then
X	  $show "${rm}r $gentop"
X	  $run ${rm}r $gentop
X	fi
X
X	exit 0
X      fi
X
X      if test "$build_libtool_libs" != yes; then
X	if test -n "$gentop"; then
X	  $show "${rm}r $gentop"
X	  $run ${rm}r $gentop
X	fi
X
X	# Create an invalid libtool object if no PIC, so that we don't
X	# accidentally link it into a program.
X	$show "echo timestamp > $libobj"
X	$run eval "echo timestamp > $libobj" || exit $?
X	exit 0
X      fi
X
X      if test -n "$pic_flag" || test "$pic_mode" != default; then
X	# Only do commands if we really have different PIC objects.
X	reload_objs="$libobjs $reload_conv_objs"
X	output="$libobj"
X	eval cmds=\"$reload_cmds\"
X	save_ifs="$IFS"; IFS='~'
X	for cmd in $cmds; do
X	  IFS="$save_ifs"
X	  $show "$cmd"
X	  $run eval "$cmd" || exit $?
X	done
X	IFS="$save_ifs"
X      else
X	# Just create a symlink.
X	$show $rm $libobj
X	$run $rm $libobj
X	xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
X	if test "X$xdir" = "X$libobj"; then
X	  xdir="."
X	else
X	  xdir="$xdir"
X	fi
X	baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
X	oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
X	$show "(cd $xdir && $LN_S $oldobj $baseobj)"
X	$run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
X      fi
X
X      if test -n "$gentop"; then
X	$show "${rm}r $gentop"
X	$run ${rm}r $gentop
X      fi
X
X      exit 0
X      ;;
X
X    prog)
X      case $host in
X	*cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;;
X      esac
X      if test -n "$vinfo"; then
X	$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
X      fi
X
X      if test -n "$release"; then
X	$echo "$modename: warning: \`-release' is ignored for programs" 1>&2
X      fi
X
X      if test "$preload" = yes; then
X	if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
X	   test "$dlopen_self_static" = unknown; then
X	  $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
X	fi
X      fi
X
X      case $host in
X      *-*-rhapsody* | *-*-darwin1.[012])
X	# On Rhapsody replace the C library is the System framework
X	compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
X	finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
X	;;
X      esac
X
X      compile_command="$compile_command $compile_deplibs"
X      finalize_command="$finalize_command $finalize_deplibs"
X
X      if test -n "$rpath$xrpath"; then
X	# If the user specified any rpath flags, then add them.
X	for libdir in $rpath $xrpath; do
X	  # This is the magic to use -rpath.
X	  case "$finalize_rpath " in
X	  *" $libdir "*) ;;
X	  *) finalize_rpath="$finalize_rpath $libdir" ;;
X	  esac
X	done
X      fi
X
X      # Now hardcode the library paths
X      rpath=
X      hardcode_libdirs=
X      for libdir in $compile_rpath $finalize_rpath; do
X	if test -n "$hardcode_libdir_flag_spec"; then
X	  if test -n "$hardcode_libdir_separator"; then
X	    if test -z "$hardcode_libdirs"; then
X	      hardcode_libdirs="$libdir"
X	    else
X	      # Just accumulate the unique libdirs.
X	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
X	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
X		;;
X	      *)
X		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
X		;;
X	      esac
X	    fi
X	  else
X	    eval flag=\"$hardcode_libdir_flag_spec\"
X	    rpath="$rpath $flag"
X	  fi
X	elif test -n "$runpath_var"; then
X	  case "$perm_rpath " in
X	  *" $libdir "*) ;;
X	  *) perm_rpath="$perm_rpath $libdir" ;;
X	  esac
X	fi
X	case $host in
X	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
X	  case :$dllsearchpath: in
X	  *":$libdir:"*) ;;
X	  *) dllsearchpath="$dllsearchpath:$libdir";;
X	  esac
X	  ;;
X	esac
X      done
X      # Substitute the hardcoded libdirs into the rpath.
X      if test -n "$hardcode_libdir_separator" &&
X	 test -n "$hardcode_libdirs"; then
X	libdir="$hardcode_libdirs"
X	eval rpath=\" $hardcode_libdir_flag_spec\"
X      fi
X      compile_rpath="$rpath"
X
X      rpath=
X      hardcode_libdirs=
X      for libdir in $finalize_rpath; do
X	if test -n "$hardcode_libdir_flag_spec"; then
X	  if test -n "$hardcode_libdir_separator"; then
X	    if test -z "$hardcode_libdirs"; then
X	      hardcode_libdirs="$libdir"
X	    else
X	      # Just accumulate the unique libdirs.
X	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
X	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
X		;;
X	      *)
X		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
X		;;
X	      esac
X	    fi
X	  else
X	    eval flag=\"$hardcode_libdir_flag_spec\"
X	    rpath="$rpath $flag"
X	  fi
X	elif test -n "$runpath_var"; then
X	  case "$finalize_perm_rpath " in
X	  *" $libdir "*) ;;
X	  *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
X	  esac
X	fi
X      done
X      # Substitute the hardcoded libdirs into the rpath.
X      if test -n "$hardcode_libdir_separator" &&
X	 test -n "$hardcode_libdirs"; then
X	libdir="$hardcode_libdirs"
X	eval rpath=\" $hardcode_libdir_flag_spec\"
X      fi
X      finalize_rpath="$rpath"
X
X      if test -n "$libobjs" && test "$build_old_libs" = yes; then
X	# Transform all the library objects into standard objects.
X	compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
X	finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
X      fi
X
X      dlsyms=
X      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
X	if test -n "$NM" && test -n "$global_symbol_pipe"; then
X	  dlsyms="${outputname}S.c"
X	else
X	  $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
X	fi
X      fi
X
X      if test -n "$dlsyms"; then
X	case $dlsyms in
X	"") ;;
X	*.c)
X	  # Discover the nlist of each of the dlfiles.
X	  nlist="$output_objdir/${outputname}.nm"
X
X	  $show "$rm $nlist ${nlist}S ${nlist}T"
X	  $run $rm "$nlist" "${nlist}S" "${nlist}T"
X
X	  # Parse the name list into a source file.
X	  $show "creating $output_objdir/$dlsyms"
X
X	  test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
X/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
X/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
X
X#ifdef __cplusplus
Xextern \"C\" {
X#endif
X
X/* Prevent the only kind of declaration conflicts we can make. */
X#define lt_preloaded_symbols some_other_symbol
X
X/* External symbol declarations for the compiler. */\
X"
X
X	  if test "$dlself" = yes; then
X	    $show "generating symbol list for \`$output'"
X
X	    test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
X
X	    # Add our own program objects to the symbol list.
X	    progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
X	    for arg in $progfiles; do
X	      $show "extracting global C symbols from \`$arg'"
X	      $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
X	    done
X
X	    if test -n "$exclude_expsyms"; then
X	      $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
X	      $run eval '$mv "$nlist"T "$nlist"'
X	    fi
X
X	    if test -n "$export_symbols_regex"; then
X	      $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
X	      $run eval '$mv "$nlist"T "$nlist"'
X	    fi
X
X	    # Prepare the list of exported symbols
X	    if test -z "$export_symbols"; then
X	      export_symbols="$output_objdir/$output.exp"
X	      $run $rm $export_symbols
X	      $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
X	    else
X	      $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
X	      $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
X	      $run eval 'mv "$nlist"T "$nlist"'
X	    fi
X	  fi
X
X	  for arg in $dlprefiles; do
X	    $show "extracting global C symbols from \`$arg'"
X	    name=`echo "$arg" | sed -e 's%^.*/%%'`
X	    $run eval 'echo ": $name " >> "$nlist"'
X	    $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
X	  done
X
X	  if test -z "$run"; then
X	    # Make sure we have at least an empty file.
X	    test -f "$nlist" || : > "$nlist"
X
X	    if test -n "$exclude_expsyms"; then
X	      egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
X	      $mv "$nlist"T "$nlist"
X	    fi
X
X	    # Try sorting and uniquifying the output.
X	    if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
X	      :
X	    else
X	      grep -v "^: " < "$nlist" > "$nlist"S
X	    fi
X
X	    if test -f "$nlist"S; then
X	      eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
X	    else
X	      echo '/* NONE */' >> "$output_objdir/$dlsyms"
X	    fi
X
X	    $echo >> "$output_objdir/$dlsyms" "\
X
X#undef lt_preloaded_symbols
X
X#if defined (__STDC__) && __STDC__
X# define lt_ptr void *
X#else
X# define lt_ptr char *
X# define const
X#endif
X
X/* The mapping between symbol names and symbols. */
Xconst struct {
X  const char *name;
X  lt_ptr address;
X}
Xlt_preloaded_symbols[] =
X{\
X"
X
X	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
X
X	    $echo >> "$output_objdir/$dlsyms" "\
X  {0, (lt_ptr) 0}
X};
X
X/* This works around a problem in FreeBSD linker */
X#ifdef FREEBSD_WORKAROUND
Xstatic const void *lt_preloaded_setup() {
X  return lt_preloaded_symbols;
X}
X#endif
X
X#ifdef __cplusplus
X}
X#endif\
X"
X	  fi
X
X	  pic_flag_for_symtable=
X	  case $host in
X	  # compiling the symbol table file with pic_flag works around
X	  # a FreeBSD bug that causes programs to crash when -lm is
X	  # linked before any other PIC object.  But we must not use
X	  # pic_flag when linking with -static.  The problem exists in
X	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
X	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
X	    case "$compile_command " in
X	    *" -static "*) ;;
X	    *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
X	    esac;;
X	  *-*-hpux*)
X	    case "$compile_command " in
X	    *" -static "*) ;;
X	    *) pic_flag_for_symtable=" $pic_flag -DPIC";;
X	    esac
X	  esac
X
X	  # Now compile the dynamic symbol file.
X	  $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
X	  $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
X
X	  # Clean up the generated files.
X	  $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
X	  $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
X
X	  # Transform the symbol file into the correct name.
X	  compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
X	  finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
X	  ;;
X	*)
X	  $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
X	  exit 1
X	  ;;
X	esac
X      else
X	# We keep going just in case the user didn't refer to
X	# lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
X	# really was required.
X
X	# Nullify the symbol file.
X	compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
X	finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
X      fi
X
X      if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
X	# Replace the output file specification.
X	compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
X	link_command="$compile_command$compile_rpath"
X
X	# We have no uninstalled library dependencies, so finalize right now.
X	$show "$link_command"
X	$run eval "$link_command"
X	status=$?
X
X	# Delete the generated files.
X	if test -n "$dlsyms"; then
X	  $show "$rm $output_objdir/${outputname}S.${objext}"
X	  $run $rm "$output_objdir/${outputname}S.${objext}"
X	fi
X
X	exit $status
X      fi
X
X      if test -n "$shlibpath_var"; then
X	# We should set the shlibpath_var
X	rpath=
X	for dir in $temp_rpath; do
X	  case $dir in
X	  [\\/]* | [A-Za-z]:[\\/]*)
X	    # Absolute path.
X	    rpath="$rpath$dir:"
X	    ;;
X	  *)
X	    # Relative path: add a thisdir entry.
X	    rpath="$rpath\$thisdir/$dir:"
X	    ;;
X	  esac
X	done
X	temp_rpath="$rpath"
X      fi
X
X      if test -n "$compile_shlibpath$finalize_shlibpath"; then
X	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
X      fi
X      if test -n "$finalize_shlibpath"; then
X	finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
X      fi
X
X      compile_var=
X      finalize_var=
X      if test -n "$runpath_var"; then
X	if test -n "$perm_rpath"; then
X	  # We should set the runpath_var.
X	  rpath=
X	  for dir in $perm_rpath; do
X	    rpath="$rpath$dir:"
X	  done
X	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
X	fi
X	if test -n "$finalize_perm_rpath"; then
X	  # We should set the runpath_var.
X	  rpath=
X	  for dir in $finalize_perm_rpath; do
X	    rpath="$rpath$dir:"
X	  done
X	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
X	fi
X      fi
X
X      if test "$no_install" = yes; then
X	# We don't need to create a wrapper script.
X	link_command="$compile_var$compile_command$compile_rpath"
X	# Replace the output file specification.
X	link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
X	# Delete the old output file.
X	$run $rm $output
X	# Link the executable and exit
X	$show "$link_command"
X	$run eval "$link_command" || exit $?
X	exit 0
X      fi
X
X      if test "$hardcode_action" = relink; then
X	# Fast installation is not supported
X	link_command="$compile_var$compile_command$compile_rpath"
X	relink_command="$finalize_var$finalize_command$finalize_rpath"
X
X	$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
X	$echo "$modename: \`$output' will be relinked during installation" 1>&2
X      else
X	if test "$fast_install" != no; then
X	  link_command="$finalize_var$compile_command$finalize_rpath"
X	  if test "$fast_install" = yes; then
X	    relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
X	  else
X	    # fast_install is set to needless
X	    relink_command=
X	  fi
X	else
X	  link_command="$compile_var$compile_command$compile_rpath"
X	  relink_command="$finalize_var$finalize_command$finalize_rpath"
X	fi
X      fi
X
X      # Replace the output file specification.
X      link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
X
X      # Delete the old output files.
X      $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
X
X      $show "$link_command"
X      $run eval "$link_command" || exit $?
X
X      # Now create the wrapper script.
X      $show "creating $output"
X
X      # Quote the relink command for shipping.
X      if test -n "$relink_command"; then
X	# Preserve any variables that may affect compiler behavior
X	for var in $variables_saved_for_relink; do
X	  if eval test -z \"\${$var+set}\"; then
X	    relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
X	  elif eval var_value=\$$var; test -z "$var_value"; then
X	    relink_command="$var=; export $var; $relink_command"
X	  else
X	    var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
X	    relink_command="$var=\"$var_value\"; export $var; $relink_command"
X	  fi
X	done
X	relink_command="(cd `pwd`; $relink_command)"
X	relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
X      fi
X
X      # Quote $echo for shipping.
X      if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
X	case $0 in
X	[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
X	*) qecho="$SHELL `pwd`/$0 --fallback-echo";;
X	esac
X	qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
X      else
X	qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
X      fi
X
X      # Only actually do things if our run command is non-null.
X      if test -z "$run"; then
X	# win32 will think the script is a binary if it has
X	# a .exe suffix, so we strip it off here.
X	case $output in
X	  *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
X	esac
X	# test for cygwin because mv fails w/o .exe extensions
X	case $host in
X	  *cygwin*) exeext=.exe ;;
X	  *) exeext= ;;
X	esac
X	$rm $output
X	trap "$rm $output; exit 1" 1 2 15
X
X	$echo > $output "\
X#! $SHELL
X
X# $output - temporary wrapper script for $objdir/$outputname
X# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
X#
X# The $output program cannot be directly executed until all the libtool
X# libraries that it depends on are installed.
X#
X# This wrapper script should never be moved out of the build directory.
X# If it is, it will not operate correctly.
X
X# Sed substitution that helps us do robust quoting.  It backslashifies
X# metacharacters that are still active within double-quoted strings.
XXsed='sed -e 1s/^X//'
Xsed_quote_subst='$sed_quote_subst'
X
X# The HP-UX ksh and POSIX shell print the target directory to stdout
X# if CDPATH is set.
Xif test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
X
Xrelink_command=\"$relink_command\"
X
X# This environment variable determines our operation mode.
Xif test \"\$libtool_install_magic\" = \"$magic\"; then
X  # install mode needs the following variable:
X  notinst_deplibs='$notinst_deplibs'
Xelse
X  # When we are sourced in execute mode, \$file and \$echo are already set.
X  if test \"\$libtool_execute_magic\" != \"$magic\"; then
X    echo=\"$qecho\"
X    file=\"\$0\"
X    # Make sure echo works.
X    if test \"X\$1\" = X--no-reexec; then
X      # Discard the --no-reexec flag, and continue.
X      shift
X    elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
X      # Yippee, \$echo works!
X      :
X    else
X      # Restart under the correct shell, and then maybe \$echo will work.
X      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
X    fi
X  fi\
X"
X	$echo >> $output "\
X
X  # Find the directory that this script lives in.
X  thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
X  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
X
X  # Follow symbolic links until we get to the real thisdir.
X  file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
X  while test -n \"\$file\"; do
X    destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
X
X    # If there was a directory component, then change thisdir.
X    if test \"x\$destdir\" != \"x\$file\"; then
X      case \"\$destdir\" in
X      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
X      *) thisdir=\"\$thisdir/\$destdir\" ;;
X      esac
X    fi
X
X    file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
X    file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
X  done
X
X  # Try to get the absolute directory name.
X  absdir=\`cd \"\$thisdir\" && pwd\`
X  test -n \"\$absdir\" && thisdir=\"\$absdir\"
X"
X
X	if test "$fast_install" = yes; then
X	  echo >> $output "\
X  program=lt-'$outputname'$exeext
X  progdir=\"\$thisdir/$objdir\"
X
X  if test ! -f \"\$progdir/\$program\" || \\
X     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
X       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
X
X    file=\"\$\$-\$program\"
X
X    if test ! -d \"\$progdir\"; then
X      $mkdir \"\$progdir\"
X    else
X      $rm \"\$progdir/\$file\"
X    fi"
X
X	  echo >> $output "\
X
X    # relink executable if necessary
X    if test -n \"\$relink_command\"; then
X      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
X      else
X	$echo \"\$relink_command_output\" >&2
X	$rm \"\$progdir/\$file\"
X	exit 1
X      fi
X    fi
X
X    $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
X    { $rm \"\$progdir/\$program\";
X      $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
X    $rm \"\$progdir/\$file\"
X  fi"
X	else
X	  echo >> $output "\
X  program='$outputname'
X  progdir=\"\$thisdir/$objdir\"
X"
X	fi
X
X	echo >> $output "\
X
X  if test -f \"\$progdir/\$program\"; then"
X
X	# Export our shlibpath_var if we have one.
X	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
X	  $echo >> $output "\
X    # Add our own library path to $shlibpath_var
X    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
X
X    # Some systems cannot cope with colon-terminated $shlibpath_var
X    # The second colon is a workaround for a bug in BeOS R4 sed
X    $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
X
X    export $shlibpath_var
X"
X	fi
X
X	# fixup the dll searchpath if we need to.
X	if test -n "$dllsearchpath"; then
X	  $echo >> $output "\
X    # Add the dll search path components to the executable PATH
X    PATH=$dllsearchpath:\$PATH
X"
X	fi
X
X	$echo >> $output "\
X    if test \"\$libtool_execute_magic\" != \"$magic\"; then
X      # Run the actual program with our arguments.
X"
X	case $host in
X	# win32 systems need to use the prog path for dll
X	# lookup to work
X	*-*-cygwin* | *-*-pw32*)
X	  $echo >> $output "\
X      exec \$progdir/\$program \${1+\"\$@\"}
X"
X	  ;;
X
X	# Backslashes separate directories on plain windows
X	*-*-mingw | *-*-os2*)
X	  $echo >> $output "\
X      exec \$progdir\\\\\$program \${1+\"\$@\"}
X"
X	  ;;
X
X	*)
X	  $echo >> $output "\
X      # Export the path to the program.
X      PATH=\"\$progdir:\$PATH\"
X      export PATH
X
X      exec \$program \${1+\"\$@\"}
X"
X	  ;;
X	esac
X	$echo >> $output "\
X      \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
X      exit 1
X    fi
X  else
X    # The program doesn't exist.
X    \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
X    \$echo \"This script is just a wrapper for \$program.\" 1>&2
X    echo \"See the $PACKAGE documentation for more information.\" 1>&2
X    exit 1
X  fi
Xfi\
X"
X	chmod +x $output
X      fi
X      exit 0
X      ;;
X    esac
X
X    # See if we need to build an old-fashioned archive.
X    for oldlib in $oldlibs; do
X
X      if test "$build_libtool_libs" = convenience; then
X	oldobjs="$libobjs_save"
X	addlibs="$convenience"
X	build_libtool_libs=no
X      else
X	if test "$build_libtool_libs" = module; then
X	  oldobjs="$libobjs_save"
X	  build_libtool_libs=no
X	else
X	  oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
X	fi
X	addlibs="$old_convenience"
X      fi
X
X      if test -n "$addlibs"; then
X	gentop="$output_objdir/${outputname}x"
X	$show "${rm}r $gentop"
X	$run ${rm}r "$gentop"
X	$show "mkdir $gentop"
X	$run mkdir "$gentop"
X	status=$?
X	if test "$status" -ne 0 && test ! -d "$gentop"; then
X	  exit $status
X	fi
X	generated="$generated $gentop"
X
X	# Add in members from convenience archives.
X	for xlib in $addlibs; do
X	  # Extract the objects.
X	  case $xlib in
X	  [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
X	  *) xabs=`pwd`"/$xlib" ;;
X	  esac
X	  xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
X	  xdir="$gentop/$xlib"
X
X	  $show "${rm}r $xdir"
X	  $run ${rm}r "$xdir"
X	  $show "mkdir $xdir"
X	  $run mkdir "$xdir"
X	  status=$?
X	  if test "$status" -ne 0 && test ! -d "$xdir"; then
X	    exit $status
X	  fi
X	  $show "(cd $xdir && $AR x $xabs)"
X	  $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
X
X	  oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
X	done
X      fi
X
X      # Do each command in the archive commands.
X      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
X	eval cmds=\"$old_archive_from_new_cmds\"
X      else
X	# Ensure that we have .o objects in place in case we decided
X	# not to build a shared library, and have fallen back to building
X	# static libs even though --disable-static was passed!
X	for oldobj in $oldobjs; do
X	  if test ! -f $oldobj; then
X	    xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
X	    if test "X$xdir" = "X$oldobj"; then
X	      xdir="."
X	    else
X	      xdir="$xdir"
X	    fi
X	    baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
X	    obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
X	    $show "(cd $xdir && ${LN_S} $obj $baseobj)"
X	    $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
X	  fi
X	done
X
X	eval cmds=\"$old_archive_cmds\"
X      fi
X      save_ifs="$IFS"; IFS='~'
X      for cmd in $cmds; do
X	IFS="$save_ifs"
X	$show "$cmd"
X	$run eval "$cmd" || exit $?
X      done
X      IFS="$save_ifs"
X    done
X
X    if test -n "$generated"; then
X      $show "${rm}r$generated"
X      $run ${rm}r$generated
X    fi
X
X    # Now create the libtool archive.
X    case $output in
X    *.la)
X      old_library=
X      test "$build_old_libs" = yes && old_library="$libname.$libext"
X      $show "creating $output"
X
X      # Preserve any variables that may affect compiler behavior
X      for var in $variables_saved_for_relink; do
X	if eval test -z \"\${$var+set}\"; then
X	  relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
X	elif eval var_value=\$$var; test -z "$var_value"; then
X	  relink_command="$var=; export $var; $relink_command"
X	else
X	  var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
X	  relink_command="$var=\"$var_value\"; export $var; $relink_command"
X	fi
X      done
X      # Quote the link command for shipping.
X      relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args)"
X      relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
X
X      # Only create the output if not a dry run.
X      if test -z "$run"; then
X	for installed in no yes; do
X	  if test "$installed" = yes; then
X	    if test -z "$install_libdir"; then
X	      break
X	    fi
X	    output="$output_objdir/$outputname"i
X	    # Replace all uninstalled libtool libraries with the installed ones
X	    newdependency_libs=
X	    for deplib in $dependency_libs; do
X	      case $deplib in
X	      *.la)
X		name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
X		eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
X		if test -z "$libdir"; then
X		  $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
X		  exit 1
X		fi
X		newdependency_libs="$newdependency_libs $libdir/$name"
X		;;
X	      *) newdependency_libs="$newdependency_libs $deplib" ;;
X	      esac
X	    done
X	    dependency_libs="$newdependency_libs"
X	    newdlfiles=
X	    for lib in $dlfiles; do
X	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
X	      eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
X	      if test -z "$libdir"; then
X		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
X		exit 1
X	      fi
X	      newdlfiles="$newdlfiles $libdir/$name"
X	    done
X	    dlfiles="$newdlfiles"
X	    newdlprefiles=
X	    for lib in $dlprefiles; do
X	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
X	      eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
X	      if test -z "$libdir"; then
X		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
X		exit 1
X	      fi
X	      newdlprefiles="$newdlprefiles $libdir/$name"
X	    done
X	    dlprefiles="$newdlprefiles"
X	  fi
X	  $rm $output
X	  # place dlname in correct position for cygwin
X	  tdlname=$dlname
X	  case $host,$output,$installed,$module,$dlname in
X	    *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
X	  esac
X	  $echo > $output "\
X# $outputname - a libtool library file
X# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
X#
X# Please DO NOT delete this file!
X# It is necessary for linking the library.
X
X# The name that we can dlopen(3).
Xdlname='$tdlname'
X
X# Names of this library.
Xlibrary_names='$library_names'
X
X# The name of the static archive.
Xold_library='$old_library'
X
X# Libraries that this one depends upon.
Xdependency_libs='$dependency_libs'
X
X# Version information for $libname.
Xcurrent=$current
Xage=$age
Xrevision=$revision
X
X# Is this an already installed library?
Xinstalled=$installed
X
X# Files to dlopen/dlpreopen
Xdlopen='$dlfiles'
Xdlpreopen='$dlprefiles'
X
X# Directory that this library needs to be installed in:
Xlibdir='$install_libdir'"
X	  if test "$installed" = no && test "$need_relink" = yes; then
X	    $echo >> $output "\
Xrelink_command=\"$relink_command\""
X	  fi
X	done
X      fi
X
X      # Do a symbolic link so that the libtool archive can be found in
X      # LD_LIBRARY_PATH before the program is installed.
X      $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
X      $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
X      ;;
X    esac
X    exit 0
X    ;;
X
X  # libtool install mode
X  install)
X    modename="$modename: install"
X
X    # There may be an optional sh(1) argument at the beginning of
X    # install_prog (especially on Windows NT).
X    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
X       # Allow the use of GNU shtool's install command.
X       $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
X      # Aesthetically quote it.
X      arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
X      case $arg in
X      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
X	arg="\"$arg\""
X	;;
X      esac
X      install_prog="$arg "
X      arg="$1"
X      shift
X    else
X      install_prog=
X      arg="$nonopt"
X    fi
X
X    # The real first argument should be the name of the installation program.
X    # Aesthetically quote it.
X    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
X    case $arg in
X    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
X      arg="\"$arg\""
X      ;;
X    esac
X    install_prog="$install_prog$arg"
X
X    # We need to accept at least all the BSD install flags.
X    dest=
X    files=
X    opts=
X    prev=
X    install_type=
X    isdir=no
X    stripme=
X    for arg
X    do
X      if test -n "$dest"; then
X	files="$files $dest"
X	dest="$arg"
X	continue
X      fi
X
X      case $arg in
X      -d) isdir=yes ;;
X      -f) prev="-f" ;;
X      -g) prev="-g" ;;
X      -m) prev="-m" ;;
X      -o) prev="-o" ;;
X      -s)
X	stripme=" -s"
X	continue
X	;;
X      -*) ;;
X
X      *)
X	# If the previous option needed an argument, then skip it.
X	if test -n "$prev"; then
X	  prev=
X	else
X	  dest="$arg"
X	  continue
X	fi
X	;;
X      esac
X
X      # Aesthetically quote the argument.
X      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
X      case $arg in
X      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
X	arg="\"$arg\""
X	;;
X      esac
X      install_prog="$install_prog $arg"
X    done
X
X    if test -z "$install_prog"; then
X      $echo "$modename: you must specify an install program" 1>&2
X      $echo "$help" 1>&2
X      exit 1
X    fi
X
X    if test -n "$prev"; then
X      $echo "$modename: the \`$prev' option requires an argument" 1>&2
X      $echo "$help" 1>&2
X      exit 1
X    fi
X
X    if test -z "$files"; then
X      if test -z "$dest"; then
X	$echo "$modename: no file or destination specified" 1>&2
X      else
X	$echo "$modename: you must specify a destination" 1>&2
X      fi
X      $echo "$help" 1>&2
X      exit 1
X    fi
X
X    # Strip any trailing slash from the destination.
X    dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
X
X    # Check to see that the destination is a directory.
X    test -d "$dest" && isdir=yes
X    if test "$isdir" = yes; then
X      destdir="$dest"
X      destname=
X    else
X      destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
X      test "X$destdir" = "X$dest" && destdir=.
X      destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
X
X      # Not a directory, so check to see that there is only one file specified.
X      set dummy $files
X      if test "$#" -gt 2; then
X	$echo "$modename: \`$dest' is not a directory" 1>&2
X	$echo "$help" 1>&2
X	exit 1
X      fi
X    fi
X    case $destdir in
X    [\\/]* | [A-Za-z]:[\\/]*) ;;
X    *)
X      for file in $files; do
X	case $file in
X	*.lo) ;;
X	*)
X	  $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
X	  $echo "$help" 1>&2
X	  exit 1
X	  ;;
X	esac
X      done
X      ;;
X    esac
X
X    # This variable tells wrapper scripts just to set variables rather
X    # than running their programs.
X    libtool_install_magic="$magic"
X
X    staticlibs=
X    future_libdirs=
X    current_libdirs=
X    for file in $files; do
X
X      # Do each installation.
X      case $file in
X      *.$libext)
X	# Do the static libraries later.
X	staticlibs="$staticlibs $file"
X	;;
X
X      *.la)
X	# Check to see that this really is a libtool archive.
X	if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
X	else
X	  $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
X	  $echo "$help" 1>&2
X	  exit 1
X	fi
X
X	library_names=
X	old_library=
X	relink_command=
X	# If there is no directory component, then add one.
X	case $file in
X	*/* | *\\*) . $file ;;
X	*) . ./$file ;;
X	esac
X
X	# Add the libdir to current_libdirs if it is the destination.
X	if test "X$destdir" = "X$libdir"; then
X	  case "$current_libdirs " in
X	  *" $libdir "*) ;;
X	  *) current_libdirs="$current_libdirs $libdir" ;;
X	  esac
X	else
X	  # Note the libdir as a future libdir.
X	  case "$future_libdirs " in
X	  *" $libdir "*) ;;
X	  *) future_libdirs="$future_libdirs $libdir" ;;
X	  esac
X	fi
X
X	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
X	test "X$dir" = "X$file/" && dir=
X	dir="$dir$objdir"
X
X	if test -n "$relink_command"; then
X	  $echo "$modename: warning: relinking \`$file'" 1>&2
X	  $show "$relink_command"
X	  if $run eval "$relink_command"; then :
X	  else
X	    $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
X	    continue
X	  fi
X	fi
X
X	# See the names of the shared library.
X	set dummy $library_names
X	if test -n "$2"; then
X	  realname="$2"
X	  shift
X	  shift
X
X	  srcname="$realname"
X	  test -n "$relink_command" && srcname="$realname"T
X
X	  # Install the shared library and build the symlinks.
X	  $show "$install_prog $dir/$srcname $destdir/$realname"
X	  $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
X	  if test -n "$stripme" && test -n "$striplib"; then
X	    $show "$striplib $destdir/$realname"
X	    $run eval "$striplib $destdir/$realname" || exit $?
X	  fi
X
X	  if test "$#" -gt 0; then
X	    # Delete the old symlinks, and create new ones.
X	    for linkname
X	    do
X	      if test "$linkname" != "$realname"; then
X		$show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
X		$run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
X	      fi
X	    done
X	  fi
X
X	  # Do each command in the postinstall commands.
X	  lib="$destdir/$realname"
X	  eval cmds=\"$postinstall_cmds\"
X	  save_ifs="$IFS"; IFS='~'
X	  for cmd in $cmds; do
X	    IFS="$save_ifs"
X	    $show "$cmd"
X	    $run eval "$cmd" || exit $?
X	  done
X	  IFS="$save_ifs"
X	fi
X
X	# Install the pseudo-library for information purposes.
X	name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
X	instname="$dir/$name"i
X	$show "$install_prog $instname $destdir/$name"
X	$run eval "$install_prog $instname $destdir/$name" || exit $?
X
X	# Maybe install the static library, too.
X	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
X	;;
X
X      *.lo)
X	# Install (i.e. copy) a libtool object.
X
X	# Figure out destination file name, if it wasn't already specified.
X	if test -n "$destname"; then
X	  destfile="$destdir/$destname"
X	else
X	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
X	  destfile="$destdir/$destfile"
X	fi
X
X	# Deduce the name of the destination old-style object file.
X	case $destfile in
X	*.lo)
X	  staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
X	  ;;
X	*.$objext)
X	  staticdest="$destfile"
X	  destfile=
X	  ;;
X	*)
X	  $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
X	  $echo "$help" 1>&2
X	  exit 1
X	  ;;
X	esac
X
X	# Install the libtool object if requested.
X	if test -n "$destfile"; then
X	  $show "$install_prog $file $destfile"
X	  $run eval "$install_prog $file $destfile" || exit $?
X	fi
X
X	# Install the old object if enabled.
X	if test "$build_old_libs" = yes; then
X	  # Deduce the name of the old-style object file.
X	  staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
X
X	  $show "$install_prog $staticobj $staticdest"
X	  $run eval "$install_prog \$staticobj \$staticdest" || exit $?
X	fi
X	exit 0
X	;;
X
X      *)
X	# Figure out destination file name, if it wasn't already specified.
X	if test -n "$destname"; then
X	  destfile="$destdir/$destname"
X	else
X	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
X	  destfile="$destdir/$destfile"
X	fi
X
X	# Do a test to see if this is really a libtool program.
X	if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
X	  notinst_deplibs=
X	  relink_command=
X
X	  # If there is no directory component, then add one.
X	  case $file in
X	  */* | *\\*) . $file ;;
X	  *) . ./$file ;;
X	  esac
X
X	  # Check the variables that should have been set.
X	  if test -z "$notinst_deplibs"; then
X	    $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
X	    exit 1
X	  fi
X
X	  finalize=yes
X	  for lib in $notinst_deplibs; do
X	    # Check to see that each library is installed.
X	    libdir=
X	    if test -f "$lib"; then
X	      # If there is no directory component, then add one.
X	      case $lib in
X	      */* | *\\*) . $lib ;;
X	      *) . ./$lib ;;
X	      esac
X	    fi
X	    libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
X	    if test -n "$libdir" && test ! -f "$libfile"; then
X	      $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
X	      finalize=no
X	    fi
X	  done
X
X	  relink_command=
X	  # If there is no directory component, then add one.
X	  case $file in
X	  */* | *\\*) . $file ;;
X	  *) . ./$file ;;
X	  esac
X
X	  outputname=
X	  if test "$fast_install" = no && test -n "$relink_command"; then
X	    if test "$finalize" = yes && test -z "$run"; then
X	      tmpdir="/tmp"
X	      test -n "$TMPDIR" && tmpdir="$TMPDIR"
X              tmpdir=`mktemp -d $tmpdir/libtool-XXXXXX 2> /dev/null`
X              if test $? = 0 ; then :
X              else
X                tmpdir="$tmpdir/libtool-$$"
X              fi
X	      if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
X	      else
X		$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
X		continue
X	      fi
X	      file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
X	      outputname="$tmpdir/$file"
X	      # Replace the output file specification.
X	      relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
X
X	      $show "$relink_command"
X	      if $run eval "$relink_command"; then :
X	      else
X		$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
X		${rm}r "$tmpdir"
X		continue
X	      fi
X	      file="$outputname"
X	    else
X	      $echo "$modename: warning: cannot relink \`$file'" 1>&2
X	    fi
X	  else
X	    # Install the binary that we compiled earlier.
X	    file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
X	  fi
X	fi
X
X	# remove .exe since cygwin /usr/bin/install will append another
X	# one anyways
X	case $install_prog,$host in
X	/usr/bin/install*,*cygwin*)
X	  case $file:$destfile in
X	  *.exe:*.exe)
X	    # this is ok
X	    ;;
X	  *.exe:*)
X	    destfile=$destfile.exe
X	    ;;
X	  *:*.exe)
X	    destfile=`echo $destfile | sed -e 's,.exe$,,'`
X	    ;;
X	  esac
X	  ;;
X	esac
X	$show "$install_prog$stripme $file $destfile"
X	$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
X	test -n "$outputname" && ${rm}r "$tmpdir"
X	;;
X      esac
X    done
X
X    for file in $staticlibs; do
X      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
X
X      # Set up the ranlib parameters.
X      oldlib="$destdir/$name"
X
X      $show "$install_prog $file $oldlib"
X      $run eval "$install_prog \$file \$oldlib" || exit $?
X
X      if test -n "$stripme" && test -n "$striplib"; then
X	$show "$old_striplib $oldlib"
X	$run eval "$old_striplib $oldlib" || exit $?
X      fi
X
X      # Do each command in the postinstall commands.
X      eval cmds=\"$old_postinstall_cmds\"
X      save_ifs="$IFS"; IFS='~'
X      for cmd in $cmds; do
X	IFS="$save_ifs"
X	$show "$cmd"
X	$run eval "$cmd" || exit $?
X      done
X      IFS="$save_ifs"
X    done
X
X    if test -n "$future_libdirs"; then
X      $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
X    fi
X
X    if test -n "$current_libdirs"; then
X      # Maybe just do a dry run.
X      test -n "$run" && current_libdirs=" -n$current_libdirs"
X      exec_cmd='$SHELL $0 --finish$current_libdirs'
X    else
X      exit 0
X    fi
X    ;;
X
X  # libtool finish mode
X  finish)
X    modename="$modename: finish"
X    libdirs="$nonopt"
X    admincmds=
X
X    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
X      for dir
X      do
X	libdirs="$libdirs $dir"
X      done
X
X      for libdir in $libdirs; do
X	if test -n "$finish_cmds"; then
X	  # Do each command in the finish commands.
X	  eval cmds=\"$finish_cmds\"
X	  save_ifs="$IFS"; IFS='~'
X	  for cmd in $cmds; do
X	    IFS="$save_ifs"
X	    $show "$cmd"
X	    $run eval "$cmd" || admincmds="$admincmds
X       $cmd"
X	  done
X	  IFS="$save_ifs"
X	fi
X	if test -n "$finish_eval"; then
X	  # Do the single finish_eval.
X	  eval cmds=\"$finish_eval\"
X	  $run eval "$cmds" || admincmds="$admincmds
X       $cmds"
X	fi
X      done
X    fi
X
X    # Exit here if they wanted silent mode.
X    test "$show" = : && exit 0
X
X    echo "----------------------------------------------------------------------"
X    echo "Libraries have been installed in:"
X    for libdir in $libdirs; do
X      echo "   $libdir"
X    done
X    echo
X    echo "If you ever happen to want to link against installed libraries"
X    echo "in a given directory, LIBDIR, you must either use libtool, and"
X    echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
X    echo "flag during linking and do at least one of the following:"
X    if test -n "$shlibpath_var"; then
X      echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
X      echo "     during execution"
X    fi
X    if test -n "$runpath_var"; then
X      echo "   - add LIBDIR to the \`$runpath_var' environment variable"
X      echo "     during linking"
X    fi
X    if test -n "$hardcode_libdir_flag_spec"; then
X      libdir=LIBDIR
X      eval flag=\"$hardcode_libdir_flag_spec\"
X
X      echo "   - use the \`$flag' linker flag"
X    fi
X    if test -n "$admincmds"; then
X      echo "   - have your system administrator run these commands:$admincmds"
X    fi
X    if test -f /etc/ld.so.conf; then
X      echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
X    fi
X    echo
X    echo "See any operating system documentation about shared libraries for"
X    echo "more information, such as the ld(1) and ld.so(8) manual pages."
X    echo "----------------------------------------------------------------------"
X    exit 0
X    ;;
X
X  # libtool execute mode
X  execute)
X    modename="$modename: execute"
X
X    # The first argument is the command name.
X    cmd="$nonopt"
X    if test -z "$cmd"; then
X      $echo "$modename: you must specify a COMMAND" 1>&2
X      $echo "$help"
X      exit 1
X    fi
X
X    # Handle -dlopen flags immediately.
X    for file in $execute_dlfiles; do
X      if test ! -f "$file"; then
X	$echo "$modename: \`$file' is not a file" 1>&2
X	$echo "$help" 1>&2
X	exit 1
X      fi
X
X      dir=
X      case $file in
X      *.la)
X	# Check to see that this really is a libtool archive.
X	if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
X	else
X	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
X	  $echo "$help" 1>&2
X	  exit 1
X	fi
X
X	# Read the libtool library.
X	dlname=
X	library_names=
X
X	# If there is no directory component, then add one.
X	case $file in
X	*/* | *\\*) . $file ;;
X	*) . ./$file ;;
X	esac
X
X	# Skip this library if it cannot be dlopened.
X	if test -z "$dlname"; then
X	  # Warn if it was a shared library.
X	  test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
X	  continue
X	fi
X
X	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
X	test "X$dir" = "X$file" && dir=.
X
X	if test -f "$dir/$objdir/$dlname"; then
X	  dir="$dir/$objdir"
X	else
X	  $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
X	  exit 1
X	fi
X	;;
X
X      *.lo)
X	# Just add the directory containing the .lo file.
X	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
X	test "X$dir" = "X$file" && dir=.
X	;;
X
X      *)
X	$echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
X	continue
X	;;
X      esac
X
X      # Get the absolute pathname.
X      absdir=`cd "$dir" && pwd`
X      test -n "$absdir" && dir="$absdir"
X
X      # Now add the directory to shlibpath_var.
X      if eval "test -z \"\$$shlibpath_var\""; then
X	eval "$shlibpath_var=\"\$dir\""
X      else
X	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
X      fi
X    done
X
X    # This variable tells wrapper scripts just to set shlibpath_var
X    # rather than running their programs.
X    libtool_execute_magic="$magic"
X
X    # Check if any of the arguments is a wrapper script.
X    args=
X    for file
X    do
X      case $file in
X      -*) ;;
X      *)
X	# Do a test to see if this is really a libtool program.
X	if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
X	  # If there is no directory component, then add one.
X	  case $file in
X	  */* | *\\*) . $file ;;
X	  *) . ./$file ;;
X	  esac
X
X	  # Transform arg to wrapped name.
X	  file="$progdir/$program"
X	fi
X	;;
X      esac
X      # Quote arguments (to preserve shell metacharacters).
X      file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
X      args="$args \"$file\""
X    done
X
X    if test -z "$run"; then
X      if test -n "$shlibpath_var"; then
X	# Export the shlibpath_var.
X	eval "export $shlibpath_var"
X      fi
X
X      # Restore saved enviroment variables
X      if test "${save_LC_ALL+set}" = set; then
X	LC_ALL="$save_LC_ALL"; export LC_ALL
X      fi
X      if test "${save_LANG+set}" = set; then
X	LANG="$save_LANG"; export LANG
X      fi
X
X      # Now prepare to actually exec the command.
X      exec_cmd="\$cmd$args"
X    else
X      # Display what would be done.
X      if test -n "$shlibpath_var"; then
X	eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
X	$echo "export $shlibpath_var"
X      fi
X      $echo "$cmd$args"
X      exit 0
X    fi
X    ;;
X
X  # libtool clean and uninstall mode
X  clean | uninstall)
X    modename="$modename: $mode"
X    rm="$nonopt"
X    files=
X    rmforce=
X    exit_status=0
X
X    # This variable tells wrapper scripts just to set variables rather
X    # than running their programs.
X    libtool_install_magic="$magic"
X
X    for arg
X    do
X      case $arg in
X      -f) rm="$rm $arg"; rmforce=yes ;;
X      -*) rm="$rm $arg" ;;
X      *) files="$files $arg" ;;
X      esac
X    done
X
X    if test -z "$rm"; then
X      $echo "$modename: you must specify an RM program" 1>&2
X      $echo "$help" 1>&2
X      exit 1
X    fi
X
X    rmdirs=
X
X    for file in $files; do
X      dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
X      if test "X$dir" = "X$file"; then
X	dir=.
X	objdir="$objdir"
X      else
X	objdir="$dir/$objdir"
X      fi
X      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
X      test "$mode" = uninstall && objdir="$dir"
X
X      # Remember objdir for removal later, being careful to avoid duplicates
X      if test "$mode" = clean; then
X	case " $rmdirs " in
X	  *" $objdir "*) ;;
X	  *) rmdirs="$rmdirs $objdir" ;;
X	esac
X      fi
X
X      # Don't error if the file doesn't exist and rm -f was used.
X      if (test -L "$file") >/dev/null 2>&1 \
X	|| (test -h "$file") >/dev/null 2>&1 \
X	|| test -f "$file"; then
X	:
X      elif test -d "$file"; then
X	exit_status=1
X	continue
X      elif test "$rmforce" = yes; then
X	continue
X      fi
X
X      rmfiles="$file"
X
X      case $name in
X      *.la)
X	# Possibly a libtool archive, so verify it.
X	if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
X	  . $dir/$name
X
X	  # Delete the libtool libraries and symlinks.
X	  for n in $library_names; do
X	    rmfiles="$rmfiles $objdir/$n"
X	  done
X	  test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
X	  test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
X
X	  if test "$mode" = uninstall; then
X	    if test -n "$library_names"; then
X	      # Do each command in the postuninstall commands.
X	      eval cmds=\"$postuninstall_cmds\"
X	      save_ifs="$IFS"; IFS='~'
X	      for cmd in $cmds; do
X		IFS="$save_ifs"
X		$show "$cmd"
X		$run eval "$cmd"
X		if test "$?" -ne 0 && test "$rmforce" != yes; then
X		  exit_status=1
X		fi
X	      done
X	      IFS="$save_ifs"
X	    fi
X
X	    if test -n "$old_library"; then
X	      # Do each command in the old_postuninstall commands.
X	      eval cmds=\"$old_postuninstall_cmds\"
X	      save_ifs="$IFS"; IFS='~'
X	      for cmd in $cmds; do
X		IFS="$save_ifs"
X		$show "$cmd"
X		$run eval "$cmd"
X		if test "$?" -ne 0 && test "$rmforce" != yes; then
X		  exit_status=1
X		fi
X	      done
X	      IFS="$save_ifs"
X	    fi
X	    # FIXME: should reinstall the best remaining shared library.
X	  fi
X	fi
X	;;
X
X      *.lo)
X	if test "$build_old_libs" = yes; then
X	  oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
X	  rmfiles="$rmfiles $dir/$oldobj"
X	fi
X	;;
X
X      *)
X	# Do a test to see if this is a libtool program.
X	if test "$mode" = clean &&
X	   (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
X	  relink_command=
X	  . $dir/$file
X
X	  rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
X	  if test "$fast_install" = yes && test -n "$relink_command"; then
X	    rmfiles="$rmfiles $objdir/lt-$name"
X	  fi
X	fi
X	;;
X      esac
X      $show "$rm $rmfiles"
X      $run $rm $rmfiles || exit_status=1
X    done
X
X    # Try to remove the ${objdir}s in the directories where we deleted files
X    for dir in $rmdirs; do
X      if test -d "$dir"; then
X	$show "rmdir $dir"
X	$run rmdir $dir >/dev/null 2>&1
X      fi
X    done
X
X    exit $exit_status
X    ;;
X
X  "")
X    $echo "$modename: you must specify a MODE" 1>&2
X    $echo "$generic_help" 1>&2
X    exit 1
X    ;;
X  esac
X
X  if test -z "$exec_cmd"; then
X    $echo "$modename: invalid operation mode \`$mode'" 1>&2
X    $echo "$generic_help" 1>&2
X    exit 1
X  fi
Xfi # test -z "$show_help"
X
Xif test -n "$exec_cmd"; then
X  eval exec $exec_cmd
X  exit 1
Xfi
X
X# We need to display help for each of the modes.
Xcase $mode in
X"") $echo \
X"Usage: $modename [OPTION]... [MODE-ARG]...
X
XProvide generalized library-building support services.
X
X    --config          show all configuration variables
X    --debug           enable verbose shell tracing
X-n, --dry-run         display commands without modifying any files
X    --features        display basic configuration information and exit
X    --finish          same as \`--mode=finish'
X    --help            display this help message and exit
X    --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
X    --quiet           same as \`--silent'
X    --silent          don't print informational messages
X    --version         print version information
X
XMODE must be one of the following:
X
X      clean           remove files from the build directory
X      compile         compile a source file into a libtool object
X      execute         automatically set library path, then run a program
X      finish          complete the installation of libtool libraries
X      install         install libraries or executables
X      link            create a library or an executable
X      uninstall       remove libraries from an installed directory
X
XMODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
Xa more detailed description of MODE."
X  exit 0
X  ;;
X
Xclean)
X  $echo \
X"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
X
XRemove files from the build directory.
X
XRM is the name of the program to use to delete files associated with each FILE
X(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
Xto RM.
X
XIf FILE is a libtool library, object or program, all the files associated
Xwith it are deleted. Otherwise, only FILE itself is deleted using RM."
X  ;;
X
Xcompile)
X  $echo \
X"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
X
XCompile a source file into a libtool library object.
X
XThis mode accepts the following additional options:
X
X  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
X  -prefer-pic       try to building PIC objects only
X  -prefer-non-pic   try to building non-PIC objects only
X  -static           always build a \`.o' file suitable for static linking
X
XCOMPILE-COMMAND is a command to be used in creating a \`standard' object file
Xfrom the given SOURCEFILE.
X
XThe output file name is determined by removing the directory component from
XSOURCEFILE, then substituting the C source code suffix \`.c' with the
Xlibrary object suffix, \`.lo'."
X  ;;
X
Xexecute)
X  $echo \
X"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
X
XAutomatically set library path, then run a program.
X
XThis mode accepts the following additional options:
X
X  -dlopen FILE      add the directory containing FILE to the library path
X
XThis mode sets the library path environment variable according to \`-dlopen'
Xflags.
X
XIf any of the ARGS are libtool executable wrappers, then they are translated
Xinto their corresponding uninstalled binary, and any of their required library
Xdirectories are added to the library path.
X
XThen, COMMAND is executed, with ARGS as arguments."
X  ;;
X
Xfinish)
X  $echo \
X"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
X
XComplete the installation of libtool libraries.
X
XEach LIBDIR is a directory that contains libtool libraries.
X
XThe commands that this mode executes may require superuser privileges.  Use
Xthe \`--dry-run' option if you just want to see what would be executed."
X  ;;
X
Xinstall)
X  $echo \
X"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
X
XInstall executables or libraries.
X
XINSTALL-COMMAND is the installation command.  The first component should be
Xeither the \`install' or \`cp' program.
X
XThe rest of the components are interpreted as arguments to that command (only
XBSD-compatible install options are recognized)."
X  ;;
X
Xlink)
X  $echo \
X"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
X
XLink object files or libraries together to form another library, or to
Xcreate an executable program.
X
XLINK-COMMAND is a command using the C compiler that you would use to create
Xa program from several object files.
X
XThe following components of LINK-COMMAND are treated specially:
X
X  -all-static       do not do any dynamic linking at all
X  -avoid-version    do not add a version suffix if possible
X  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
X  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
X  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
X  -export-symbols SYMFILE
X		    try to export only the symbols listed in SYMFILE
X  -export-symbols-regex REGEX
X		    try to export only the symbols matching REGEX
X  -LLIBDIR          search LIBDIR for required installed libraries
X  -lNAME            OUTPUT-FILE requires the installed library libNAME
X  -module           build a library that can dlopened
X  -no-fast-install  disable the fast-install mode
X  -no-install       link a not-installable executable
X  -no-undefined     declare that a library does not refer to external symbols
X  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
X  -release RELEASE  specify package release information
X  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
X  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
X  -static           do not do any dynamic linking of libtool libraries
X  -version-info CURRENT[:REVISION[:AGE]]
X		    specify library version info [each variable defaults to 0]
X
XAll other options (arguments beginning with \`-') are ignored.
X
XEvery other argument is treated as a filename.  Files ending in \`.la' are
Xtreated as uninstalled libtool libraries, other files are standard or library
Xobject files.
X
XIf the OUTPUT-FILE ends in \`.la', then a libtool library is created,
Xonly library objects (\`.lo' files) may be specified, and \`-rpath' is
Xrequired, except when creating a convenience library.
X
XIf OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
Xusing \`ar' and \`ranlib', or on Windows using \`lib'.
X
XIf OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
Xis created, otherwise an executable program is created."
X  ;;
X
Xuninstall)
X  $echo \
X"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
X
XRemove libraries from an installation directory.
X
XRM is the name of the program to use to delete files associated with each FILE
X(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
Xto RM.
X
XIf FILE is a libtool library, all the files associated with it are deleted.
XOtherwise, only FILE itself is deleted using RM."
X  ;;
X
X*)
X  $echo "$modename: invalid operation mode \`$mode'" 1>&2
X  $echo "$help" 1>&2
X  exit 1
X  ;;
Xesac
X
Xecho
X$echo "Try \`$modename --help' for more information about other modes."
X
Xexit 0
X
X# Local Variables:
X# mode:shell-script
X# sh-indentation:2
X# End:
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/ltmain.sh' 'failed'
fi
# ============= libusb-0.1.8/missing ==============
if test -f 'libusb-0.1.8/missing' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/missing' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/missing' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/missing' &&
X#! /bin/sh
X# Common stub for a few missing GNU programs while installing.
X# Copyright (C) 1996, 1997, 2001 Free Software Foundation, Inc.
X# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996.
X
X# This program is free software; you can redistribute it and/or modify
X# it under the terms of the GNU General Public License as published by
X# the Free Software Foundation; either version 2, or (at your option)
X# any later version.
X
X# This program is distributed in the hope that it will be useful,
X# but WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X# GNU General Public License for more details.
X
X# You should have received a copy of the GNU General Public License
X# along with this program; if not, write to the Free Software
X# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
X# 02111-1307, USA.
X
Xif test $# -eq 0; then
X  echo 1>&2 "Try \`$0 --help' for more information"
X  exit 1
Xfi
X
X# In the cases where this matters, `missing' is being run in the
X# srcdir already.
Xif test -f configure.in; then
X  configure_ac=configure.ac
Xelse
X  configure_ac=configure.in
Xfi
X
Xcase "$1" in
X
X  -h|--h|--he|--hel|--help)
X    echo "\
X$0 [OPTION]... PROGRAM [ARGUMENT]...
X
XHandle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
Xerror status if there is no known handling for PROGRAM.
X
XOptions:
X  -h, --help      display this help and exit
X  -v, --version   output version information and exit
X
XSupported PROGRAM values:
X  aclocal      touch file \`aclocal.m4'
X  autoconf     touch file \`configure'
X  autoheader   touch file \`config.h.in'
X  automake     touch all \`Makefile.in' files
X  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
X  flex         create \`lex.yy.c', if possible, from existing .c
X  lex          create \`lex.yy.c', if possible, from existing .c
X  makeinfo     touch the output file
X  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]"
X    ;;
X
X  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
X    echo "missing - GNU libit 0.0"
X    ;;
X
X  -*)
X    echo 1>&2 "$0: Unknown \`$1' option"
X    echo 1>&2 "Try \`$0 --help' for more information"
X    exit 1
X    ;;
X
X  aclocal)
X    echo 1>&2 "\
XWARNING: \`$1' is missing on your system.  You should only need it if
X         you modified \`acinclude.m4' or \`$configure_ac'.  You might want
X         to install the \`Automake' and \`Perl' packages.  Grab them from
X         any GNU archive site."
X    touch aclocal.m4
X    ;;
X
X  autoconf)
X    echo 1>&2 "\
XWARNING: \`$1' is missing on your system.  You should only need it if
X         you modified \`$configure_ac'.  You might want to install the
X         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
X         archive site."
X    touch configure
X    ;;
X
X  autoheader)
X    echo 1>&2 "\
XWARNING: \`$1' is missing on your system.  You should only need it if
X         you modified \`acconfig.h' or \`$configure_ac'.  You might want
X         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
X         from any GNU archive site."
X    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' $configure_ac`
X    test -z "$files" && files="config.h"
X    touch_files=
X    for f in $files; do
X      case "$f" in
X      *:*) touch_files="$touch_files "`echo "$f" |
X				       sed -e 's/^[^:]*://' -e 's/:.*//'`;;
X      *) touch_files="$touch_files $f.in";;
X      esac
X    done
X    touch $touch_files
X    ;;
X
X  automake)
X    echo 1>&2 "\
XWARNING: \`$1' is missing on your system.  You should only need it if
X         you modified \`Makefile.am', \`acinclude.m4' or \`$configure_ac'.
X         You might want to install the \`Automake' and \`Perl' packages.
X         Grab them from any GNU archive site."
X    find . -type f -name Makefile.am -print |
X	   sed 's/\.am$/.in/' |
X	   while read f; do touch "$f"; done
X    ;;
X
X  bison|yacc)
X    echo 1>&2 "\
XWARNING: \`$1' is missing on your system.  You should only need it if
X         you modified a \`.y' file.  You may need the \`Bison' package
X         in order for those modifications to take effect.  You can get
X         \`Bison' from any GNU archive site."
X    rm -f y.tab.c y.tab.h
X    if [ $# -ne 1 ]; then
X        eval LASTARG="\${$#}"
X	case "$LASTARG" in
X	*.y)
X	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
X	    if [ -f "$SRCFILE" ]; then
X	         cp "$SRCFILE" y.tab.c
X	    fi
X	    SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
X	    if [ -f "$SRCFILE" ]; then
X	         cp "$SRCFILE" y.tab.h
X	    fi
X	  ;;
X	esac
X    fi
X    if [ ! -f y.tab.h ]; then
X	echo >y.tab.h
X    fi
X    if [ ! -f y.tab.c ]; then
X	echo 'main() { return 0; }' >y.tab.c
X    fi
X    ;;
X
X  lex|flex)
X    echo 1>&2 "\
XWARNING: \`$1' is missing on your system.  You should only need it if
X         you modified a \`.l' file.  You may need the \`Flex' package
X         in order for those modifications to take effect.  You can get
X         \`Flex' from any GNU archive site."
X    rm -f lex.yy.c
X    if [ $# -ne 1 ]; then
X        eval LASTARG="\${$#}"
X	case "$LASTARG" in
X	*.l)
X	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
X	    if [ -f "$SRCFILE" ]; then
X	         cp "$SRCFILE" lex.yy.c
X	    fi
X	  ;;
X	esac
X    fi
X    if [ ! -f lex.yy.c ]; then
X	echo 'main() { return 0; }' >lex.yy.c
X    fi
X    ;;
X
X  makeinfo)
X    echo 1>&2 "\
XWARNING: \`$1' is missing on your system.  You should only need it if
X         you modified a \`.texi' or \`.texinfo' file, or any other file
X         indirectly affecting the aspect of the manual.  The spurious
X         call might also be the consequence of using a buggy \`make' (AIX,
X         DU, IRIX).  You might want to install the \`Texinfo' package or
X         the \`GNU make' package.  Grab either from any GNU archive site."
X    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
X    if test -z "$file"; then
X      file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
X      file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
X    fi
X    touch $file
X    ;;
X
X  *)
X    echo 1>&2 "\
XWARNING: \`$1' is needed, and you do not seem to have it handy on your
X         system.  You might have modified some files without having the
X         proper tools for further handling them.  Check the \`README' file,
X         it often tells you about the needed prerequirements for installing
X         this package.  You may also peek at any GNU archive site, in case
X         some other package would contain this missing \`$1' program."
X    exit 1
X    ;;
Xesac
X
Xexit 0
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/missing' 'failed'
fi
# ============= libusb-0.1.8/mkinstalldirs ==============
if test -f 'libusb-0.1.8/mkinstalldirs' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/mkinstalldirs' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/mkinstalldirs' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/mkinstalldirs' &&
X#! /bin/sh
X# mkinstalldirs --- make directory hierarchy
X# Author: Noah Friedman <friedman@prep.ai.mit.edu>
X# Created: 1993-05-16
X# Public domain
X
X# $Id: mkinstalldirs,v 1.1 2004/05/27 07:11:23 mtsirkin Exp $
X
Xerrstatus=0
X
Xfor file
Xdo
X   set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
X   shift
X
X   pathcomp=
X   for d
X   do
X     pathcomp="$pathcomp$d"
X     case "$pathcomp" in
X       -* ) pathcomp=./$pathcomp ;;
X     esac
X
X     if test ! -d "$pathcomp"; then
X        echo "mkdir $pathcomp"
X
X        mkdir "$pathcomp" || lasterr=$?
X
X        if test ! -d "$pathcomp"; then
X  	  errstatus=$lasterr
X        fi
X     fi
X
X     pathcomp="$pathcomp/"
X   done
Xdone
X
Xexit $errstatus
X
X# mkinstalldirs ends here
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/mkinstalldirs' 'failed'
fi
# ============= libusb-0.1.8/usb.c ==============
if test -f 'libusb-0.1.8/usb.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/usb.c' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/usb.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/usb.c' &&
X/*
X * Main API entry point
X *
X * Copyright (c) 2000-2003 Johannes Erdfelt <johannes@erdfelt.com>
X *
X * This library is covered by the LGPL, read LICENSE for details.
X */
X
X#include <stdlib.h>	/* getenv */
X#include <stdio.h>	/* stderr */
X#include <errno.h>
X
X#include "usbi.h"
X
Xint usb_debug = 0;
Xstruct usb_bus *usb_busses = NULL;
X
Xint usb_find_busses(void)
X{
X  struct usb_bus *busses, *bus;
X  int ret, changes = 0;
X
X  ret = usb_os_find_busses(&busses);
X  if (ret < 0)
X    return ret;
X
X  /*
X   * Now walk through all of the busses we know about and compare against
X   * this new list. Any duplicates will be removed from the new list.
X   * If we don't find it in the new list, the bus was removed. Any
X   * busses still in the new list, are new to us.
X   */
X  bus = usb_busses;
X  while (bus) {
X    int found = 0;
X    struct usb_bus *nbus, *tbus = bus->next;
X
X    nbus = busses;
X    while (nbus) {
X      struct usb_bus *tnbus = nbus->next;
X
X      if (!strcmp(bus->dirname, nbus->dirname)) {
X        /* Remove it from the new devices list */
X        LIST_DEL(busses, nbus);
X
X        usb_free_bus(nbus);
X        found = 1;
X        break;
X      }
X
X      nbus = tnbus;
X    }
X
X    if (!found) {
X      /* The device was removed from the system */
X      LIST_DEL(usb_busses, bus);
X      changes++;
X    }
X
X    bus = tbus;
X  }
X
X  /* Anything on the *busses list is new. So add them to usb_busses */
X  /*  and process them like the new bus they are */
X  bus = busses;
X  while (bus) {
X    struct usb_bus *tbus = bus->next;
X
X    /* Remove it from the temporary list first and add it to the real */
X    /*  usb_busses list */
X    LIST_DEL(busses, bus);
X
X    LIST_ADD(usb_busses, bus);
X
X    changes++;
X
X    bus = tbus;
X  }
X
X  return changes;
X}
X
Xint usb_find_devices(void)
X{
X  struct usb_bus *bus;
X  int ret, changes = 0;
X
X  for (bus = usb_busses; bus; bus = bus->next) {
X    struct usb_device *devices, *dev;
X
X    /* Find all of the devices and put them into a temporary list */
X    ret = usb_os_find_devices(bus, &devices);
X    if (ret < 0)
X      return ret;
X
X    /*
X     * Now walk through all of the devices we know about and compare
X     * against this new list. Any duplicates will be removed from the new
X     * list. If we don't find it in the new list, the device was removed.
X     * Any devices still in the new list, are new to us.
X     */
X    dev = bus->devices;
X    while (dev) {
X      int found = 0;
X      struct usb_device *ndev, *tdev = dev->next;
X
X      ndev = devices;
X      while (ndev) {
X        struct usb_device *tndev = ndev->next;
X
X        if (!strcmp(dev->filename, ndev->filename)) {
X          /* Remove it from the new devices list */
X          LIST_DEL(devices, ndev);
X
X          usb_free_dev(ndev);
X          found = 1;
X          break;
X        }
X
X        ndev = tndev;
X      }
X
X      if (!found) {
X        /* The device was removed from the system */
X        LIST_DEL(bus->devices, dev);
X        changes++;
X      }
X
X      dev = tdev;
X    }
X
X    /* Anything on the *devices list is new. So add them to bus->devices */
X    /*  and process them like the new device they are */
X    dev = devices;
X    while (dev) {
X      struct usb_device *tdev = dev->next;
X
X      /* Remove it from the temporary list first and add it to the real */
X      /*  bus->devices list */
X      LIST_DEL(devices, dev);
X
X      LIST_ADD(bus->devices, dev);
X
X      /* Some ports fetch the descriptors on scanning (like Linux) so we */
X      /*  don't need to fetch them again */
X      if (!dev->config) {
X        usb_dev_handle *udev;
X
X        udev = usb_open(dev);
X        if (udev) {
X          usb_fetch_and_parse_descriptors(udev);
X
X          usb_close(udev);
X        }
X      }
X
X      changes++;
X
X      dev = tdev;
X    }
X  }
X
X  return changes;
X}
X
Xvoid usb_set_debug(int level)
X{
X  if (usb_debug || level)
X    fprintf(stderr, "usb_set_debug: Setting debugging level to %d (%s)\n",
X	level, level ? "on" : "off");
X
X  usb_debug = level;
X}
X
Xvoid usb_init(void)
X{
X  if (getenv("USB_DEBUG"))
X    usb_set_debug(atoi(getenv("USB_DEBUG")));
X
X  usb_os_init();
X}
X
Xusb_dev_handle *usb_open(struct usb_device *dev)
X{
X  usb_dev_handle *udev;
X
X  udev = malloc(sizeof(*udev));
X  if (!udev)
X    return NULL;
X
X  udev->fd = -1;
X  udev->device = dev;
X  udev->bus = dev->bus;
X  udev->config = udev->interface = udev->altsetting = -1;
X
X  if (usb_os_open(udev) < 0) {
X    free(udev);
X    return NULL;
X  }
X
X  return udev;
X}
X
Xint usb_get_string(usb_dev_handle *dev, int index, int langid, char *buf,
X	size_t buflen)
X{
X  /*
X   * We can't use usb_get_descriptor() because it's lacking the index
X   * parameter. This will be fixed in libusb 1.0
X   */
X  return usb_control_msg(dev, USB_ENDPOINT_IN, USB_REQ_GET_DESCRIPTOR,
X			(USB_DT_STRING << 8) + index, langid, buf, buflen, 1000);
X}
X
Xint usb_get_string_simple(usb_dev_handle *dev, int index, char *buf, size_t buflen)
X{
X  char tbuf[256];
X  int ret, langid, si, di;
X
X  /*
X   * Asking for the zero'th index is special - it returns a string
X   * descriptor that contains all the language IDs supported by the
X   * device. Typically there aren't many - often only one. The
X   * language IDs are 16 bit numbers, and they start at the third byte
X   * in the descriptor. See USB 2.0 specification, section 9.6.7, for
X   * more information on this. */
X  ret = usb_get_string(dev, 0, 0, tbuf, sizeof(tbuf));
X  if (ret < 0)
X    return ret;
X
X  if (ret < 4)
X    return -EIO;
X
X  langid = tbuf[2] | (tbuf[3] << 8);
X
X  ret = usb_get_string(dev, index, langid, tbuf, sizeof(tbuf));
X  if (ret < 0)
X    return ret;
X
X  if (tbuf[1] != USB_DT_STRING)
X    return -EIO;
X
X  if (tbuf[0] > ret)
X    return -EFBIG;
X
X  for (di = 0, si = 2; si < tbuf[0]; si += 2) {
X    if (di >= (buflen - 1))
X      break;
X
X    if (tbuf[si + 1])	/* high byte */
X      buf[di++] = '?';
X    else
X      buf[di++] = tbuf[si];
X  }
X
X  buf[di] = 0;
X
X  return di;
X}
X
Xint usb_close(usb_dev_handle *dev)
X{
X  int ret;
X
X  ret = usb_os_close(dev);
X  free(dev);
X
X  return ret;
X}
X
Xstruct usb_device *usb_device(usb_dev_handle *dev)
X{
X  return dev->device;
X}
X
Xvoid usb_free_dev(struct usb_device *dev)
X{
X  usb_destroy_configuration(dev);
X  free(dev);
X}
X
Xstruct usb_bus *usb_get_busses(void)
X{
X  return usb_busses;
X}
X
Xvoid usb_free_bus(struct usb_bus *bus)
X{
X  free(bus);
X}
X
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/usb.c' 'failed'
fi
# ============= libusb-0.1.8/usb.h.in ==============
if test -f 'libusb-0.1.8/usb.h.in' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/usb.h.in' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/usb.h.in' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/usb.h.in' &&
X/*
X * Prototypes, structure definitions and macros.
X *
X * Copyright (c) 2000-2003 Johannes Erdfelt <johannes@erdfelt.com>
X *
X * This library is covered by the LGPL, read LICENSE for details.
X *
X * This file (and only this file) may alternatively be licensed under the
X * BSD license as well, read LICENSE for details.
X */
X#ifndef __USB_H__
X#define __USB_H__
X
X#include <unistd.h>
X#include <stdlib.h>
X#include <limits.h>
X
X#include <dirent.h>
X
X/*
X * USB spec information
X *
X * This is all stuff grabbed from various USB specs and is pretty much
X * not subject to change
X */
X
X/*
X * Device and/or Interface Class codes
X */
X#define USB_CLASS_PER_INTERFACE		0	/* for DeviceClass */
X#define USB_CLASS_AUDIO			1
X#define USB_CLASS_COMM			2
X#define USB_CLASS_HID			3
X#define USB_CLASS_PRINTER		7
X#define USB_CLASS_MASS_STORAGE		8
X#define USB_CLASS_HUB			9
X#define USB_CLASS_DATA			10
X#define USB_CLASS_VENDOR_SPEC		0xff
X
X/*
X * Descriptor types
X */
X#define USB_DT_DEVICE			0x01
X#define USB_DT_CONFIG			0x02
X#define USB_DT_STRING			0x03
X#define USB_DT_INTERFACE		0x04
X#define USB_DT_ENDPOINT			0x05
X
X#define USB_DT_HID			0x21
X#define USB_DT_REPORT			0x22
X#define USB_DT_PHYSICAL			0x23
X#define USB_DT_HUB			0x29
X
X/*
X * Descriptor sizes per descriptor type
X */
X#define USB_DT_DEVICE_SIZE		18
X#define USB_DT_CONFIG_SIZE		9
X#define USB_DT_INTERFACE_SIZE		9
X#define USB_DT_ENDPOINT_SIZE		7
X#define USB_DT_ENDPOINT_AUDIO_SIZE	9	/* Audio extension */
X#define USB_DT_HUB_NONVAR_SIZE		7
X
X/* All standard descriptors have these 2 fields in common */
Xstruct usb_descriptor_header {
X	u_int8_t  bLength;
X	u_int8_t  bDescriptorType;
X};
X
X/* String descriptor */
Xstruct usb_string_descriptor {
X	u_int8_t  bLength;
X	u_int8_t  bDescriptorType;
X	u_int16_t wData[1];
X};
X
X/* HID descriptor */
Xstruct usb_hid_descriptor {
X	u_int8_t  bLength;
X	u_int8_t  bDescriptorType;
X	u_int16_t bcdHID;
X	u_int8_t  bCountryCode;
X	u_int8_t  bNumDescriptors;
X	/* u_int8_t  bReportDescriptorType; */
X	/* u_int16_t wDescriptorLength; */
X	/* ... */
X};
X
X/* Endpoint descriptor */
X#define USB_MAXENDPOINTS	32
Xstruct usb_endpoint_descriptor {
X	u_int8_t  bLength;
X	u_int8_t  bDescriptorType;
X	u_int8_t  bEndpointAddress;
X	u_int8_t  bmAttributes;
X	u_int16_t wMaxPacketSize;
X	u_int8_t  bInterval;
X	u_int8_t  bRefresh;
X	u_int8_t  bSynchAddress;
X
X	unsigned char *extra;	/* Extra descriptors */
X	int extralen;
X};
X
X#define USB_ENDPOINT_ADDRESS_MASK	0x0f    /* in bEndpointAddress */
X#define USB_ENDPOINT_DIR_MASK		0x80
X
X#define USB_ENDPOINT_TYPE_MASK		0x03    /* in bmAttributes */
X#define USB_ENDPOINT_TYPE_CONTROL	0
X#define USB_ENDPOINT_TYPE_ISOCHRONOUS	1
X#define USB_ENDPOINT_TYPE_BULK		2
X#define USB_ENDPOINT_TYPE_INTERRUPT	3
X
X/* Interface descriptor */
X#define USB_MAXINTERFACES	32
Xstruct usb_interface_descriptor {
X	u_int8_t  bLength;
X	u_int8_t  bDescriptorType;
X	u_int8_t  bInterfaceNumber;
X	u_int8_t  bAlternateSetting;
X	u_int8_t  bNumEndpoints;
X	u_int8_t  bInterfaceClass;
X	u_int8_t  bInterfaceSubClass;
X	u_int8_t  bInterfaceProtocol;
X	u_int8_t  iInterface;
X
X	struct usb_endpoint_descriptor *endpoint;
X
X	unsigned char *extra;	/* Extra descriptors */
X	int extralen;
X};
X
X#define USB_MAXALTSETTING	128	/* Hard limit */
Xstruct usb_interface {
X	struct usb_interface_descriptor *altsetting;
X
X	int num_altsetting;
X};
X
X/* Configuration descriptor information.. */
X#define USB_MAXCONFIG		8
Xstruct usb_config_descriptor {
X	u_int8_t  bLength;
X	u_int8_t  bDescriptorType;
X	u_int16_t wTotalLength;
X	u_int8_t  bNumInterfaces;
X	u_int8_t  bConfigurationValue;
X	u_int8_t  iConfiguration;
X	u_int8_t  bmAttributes;
X	u_int8_t  MaxPower;
X
X	struct usb_interface *interface;
X
X	unsigned char *extra;	/* Extra descriptors */
X	int extralen;
X};
X
X/* Device descriptor */
Xstruct usb_device_descriptor {
X	u_int8_t  bLength;
X	u_int8_t  bDescriptorType;
X	u_int16_t bcdUSB;
X	u_int8_t  bDeviceClass;
X	u_int8_t  bDeviceSubClass;
X	u_int8_t  bDeviceProtocol;
X	u_int8_t  bMaxPacketSize0;
X	u_int16_t idVendor;
X	u_int16_t idProduct;
X	u_int16_t bcdDevice;
X	u_int8_t  iManufacturer;
X	u_int8_t  iProduct;
X	u_int8_t  iSerialNumber;
X	u_int8_t  bNumConfigurations;
X};
X
Xstruct usb_ctrl_setup {
X	u_int8_t  bRequestType;
X	u_int8_t  bRequest;
X	u_int16_t wValue;
X	u_int16_t wIndex;
X	u_int16_t wLength;
X};
X
X/*
X * Standard requests
X */
X#define USB_REQ_GET_STATUS		0x00
X#define USB_REQ_CLEAR_FEATURE		0x01
X/* 0x02 is reserved */
X#define USB_REQ_SET_FEATURE		0x03
X/* 0x04 is reserved */
X#define USB_REQ_SET_ADDRESS		0x05
X#define USB_REQ_GET_DESCRIPTOR		0x06
X#define USB_REQ_SET_DESCRIPTOR		0x07
X#define USB_REQ_GET_CONFIGURATION	0x08
X#define USB_REQ_SET_CONFIGURATION	0x09
X#define USB_REQ_GET_INTERFACE		0x0A
X#define USB_REQ_SET_INTERFACE		0x0B
X#define USB_REQ_SYNCH_FRAME		0x0C
X
X#define USB_TYPE_STANDARD		(0x00 << 5)
X#define USB_TYPE_CLASS			(0x01 << 5)
X#define USB_TYPE_VENDOR			(0x02 << 5)
X#define USB_TYPE_RESERVED		(0x03 << 5)
X
X#define USB_RECIP_DEVICE		0x00
X#define USB_RECIP_INTERFACE		0x01
X#define USB_RECIP_ENDPOINT		0x02
X#define USB_RECIP_OTHER			0x03
X
X/*
X * Various libusb API related stuff
X */
X
X#define USB_ENDPOINT_IN			0x80
X#define USB_ENDPOINT_OUT		0x00
X
X/* Error codes */
X#define USB_ERROR_BEGIN			500000
X
X/*
X * This is supposed to look weird. This file is generated from autoconf
X * and I didn't want to make this too complicated.
X */
X#if @BIGENDIAN@
X#define USB_LE16_TO_CPU(x) do { x = ((x & 0xff) << 8) | ((x & 0xff00) >> 8); } while(0)
X#else
X#define USB_LE16_TO_CPU(x)
X#endif
X
X/* Data types */
Xstruct usb_device;
Xstruct usb_bus;
X
Xstruct usb_device {
X  struct usb_device *next, *prev;
X
X  char filename[PATH_MAX + 1];
X
X  struct usb_bus *bus;
X
X  struct usb_device_descriptor descriptor;
X  struct usb_config_descriptor *config;
X
X  void *dev;		/* Darwin support */
X};
X
Xstruct usb_bus {
X  struct usb_bus *next, *prev;
X
X  char dirname[PATH_MAX + 1];
X
X  struct usb_device *devices;
X  u_int32_t location;
X};
X
Xstruct usb_dev_handle;
Xtypedef struct usb_dev_handle usb_dev_handle;
X
X/* Variables */
Xextern struct usb_bus *usb_busses;
X
X#ifdef __cplusplus
Xextern "C" {
X#endif
X
X/* Function prototypes */
X
X/* usb.c */
Xusb_dev_handle *usb_open(struct usb_device *dev);
Xint usb_close(usb_dev_handle *dev);
Xint usb_get_string(usb_dev_handle *dev, int index, int langid, char *buf,
X	size_t buflen);
Xint usb_get_string_simple(usb_dev_handle *dev, int index, char *buf,
X	size_t buflen);
X
X/* descriptors.c */
Xint usb_get_descriptor_by_endpoint(usb_dev_handle *udev, int ep,
X	unsigned char type, unsigned char index, void *buf, int size);
Xint usb_get_descriptor(usb_dev_handle *udev, unsigned char type,
X	unsigned char index, void *buf, int size);
X
X/* <arch>.c */
Xint usb_bulk_write(usb_dev_handle *dev, int ep, char *bytes, int size,
X	int timeout);
Xint usb_bulk_read(usb_dev_handle *dev, int ep, char *bytes, int size,
X	int timeout);
Xint usb_interrupt_write(usb_dev_handle *dev, int ep, char *bytes, int size,
X        int timeout);
Xint usb_interrupt_read(usb_dev_handle *dev, int ep, char *bytes, int size,
X        int timeout);
Xint usb_control_msg(usb_dev_handle *dev, int requesttype, int request,
X	int value, int index, char *bytes, int size, int timeout);
Xint usb_set_configuration(usb_dev_handle *dev, int configuration);
Xint usb_claim_interface(usb_dev_handle *dev, int interface);
Xint usb_release_interface(usb_dev_handle *dev, int interface);
Xint usb_set_altinterface(usb_dev_handle *dev, int alternate);
Xint usb_resetep(usb_dev_handle *dev, unsigned int ep);
Xint usb_clear_halt(usb_dev_handle *dev, unsigned int ep);
Xint usb_reset(usb_dev_handle *dev);
X
X#if @LINUX_API@
X#define LIBUSB_HAS_GET_DRIVER_NP 1
Xint usb_get_driver_np(usb_dev_handle *dev, int interface, char *name,
X	unsigned int namelen);
X#define LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP 1
Xint usb_detach_kernel_driver_np(usb_dev_handle *dev, int interface);
X#endif
X
Xchar *usb_strerror(void);
X
Xvoid usb_init(void);
Xvoid usb_set_debug(int level);
Xint usb_find_busses(void);
Xint usb_find_devices(void);
Xstruct usb_device *usb_device(usb_dev_handle *dev);
Xstruct usb_bus *usb_get_busses(void);
X
X#ifdef __cplusplus
X}
X#endif
X
X#endif /* __USB_H__ */
X
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/usb.h.in' 'failed'
fi
# ============= libusb-0.1.8/usbi.h ==============
if test -f 'libusb-0.1.8/usbi.h' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/usbi.h' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/usbi.h' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/usbi.h' &&
X#ifndef _USBI_H_
X#define _USBI_H_
X
X#include "usb.h"
X
X#include "error.h"
X
Xextern int usb_debug;
X
X/* Some quick and generic macros for the simple kind of lists we use */
X#define LIST_ADD(begin, ent) \
X	do { \
X	  if (begin) { \
X	    ent->next = begin; \
X	    ent->next->prev = ent; \
X	  } else \
X	    ent->next = NULL; \
X	  ent->prev = NULL; \
X	  begin = ent; \
X	} while(0)
X
X#define LIST_DEL(begin, ent) \
X	do { \
X	  if (ent->prev) \
X	    ent->prev->next = ent->next; \
X	  else \
X	    begin = ent->next; \
X	  if (ent->next) \
X	    ent->next->prev = ent->prev; \
X	  ent->prev = NULL; \
X	  ent->next = NULL; \
X	} while (0)
X
Xstruct usb_dev_handle {
X  int fd;
X
X  struct usb_bus *bus;
X  struct usb_device *device;
X
X  int config;
X  int interface;
X  int altsetting;
X
X  /* Added by RMT so implementations can store other per-open-device data */
X  void *impl_info;
X};
X
Xvoid usb_fetch_descriptors(usb_dev_handle *udev);
X
X/* OS specific routines */
Xint usb_os_find_busses(struct usb_bus **busses);
Xint usb_os_find_devices(struct usb_bus *bus, struct usb_device **devices);
Xvoid usb_os_init(void);
Xint usb_os_open(usb_dev_handle *dev);
Xint usb_os_close(usb_dev_handle *dev);
X
Xvoid usb_free_dev(struct usb_device *dev);
Xvoid usb_free_bus(struct usb_bus *bus);
X
X#endif /* _USBI_H_ */
X
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/usbi.h' 'failed'
fi
# ============= libusb-0.1.8/doc/Makefile.am ==============
if test ! -d 'libusb-0.1.8/doc'; then
  $echo $echo_n 'x -' 'libusb-0.1.8/doc: '$echo_c
  if mkdir 'libusb-0.1.8/doc'; then $echo 'created'; else $echo 'failed to create'; fi
fi
if test -f 'libusb-0.1.8/doc/Makefile.am' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/doc/Makefile.am' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/doc/Makefile.am' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/doc/Makefile.am' &&
Xsgml_files = manual.sgml intro.sgml api.sgml functions.sgml examples.sgml
X
X# For when we have a man page :)
Xman_MANS = 
X
XEXTRA_DIST = manual.sgml api.sgml examples.sgml functions.sgml \
X	intro.sgml website.dsl $(man_MANS)
X
X# I grabbed this same hack from the VACM docs/Makfile.am
XCLEANFILES = manual.dvi manual.aux manual.tex manual.log \
X	manual.ps.gz; rm -rf html
X
Xif BUILD_DOCS
X#MANUALS = manual.ps.gz html/index.html
XMANUALS = html/index.html
X# Generating postscript takes forever on my laptop apparentely
Xelse
XMANUALS =
Xendif
X
Xall: $(MANUALS)
X
Xmanual.ps.gz: $(sgml_files) website.dsl
X	@JADE@ -t ps -d $(srcdir)/website.dsl\#print $(srcdir)/manual.sgml
X	gzip manual.ps
X
Xhtml/index.html: $(sgml_files) website.dsl
X	rm -rf html
X	mkdir html
X	@JADE@ -t sgml -d $(srcdir)/website.dsl\#html $(srcdir)/manual.sgml
X
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/doc/Makefile.am' 'failed'
fi
# ============= libusb-0.1.8/doc/Makefile.in ==============
if test -f 'libusb-0.1.8/doc/Makefile.in' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/doc/Makefile.in' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/doc/Makefile.in' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/doc/Makefile.in' &&
X# Makefile.in generated by automake 1.7.8 from Makefile.am.
X# @configure_input@
X
X# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
X# Free Software Foundation, Inc.
X# This Makefile.in is free software; the Free Software Foundation
X# gives unlimited permission to copy and/or distribute it,
X# with or without modifications, as long as this notice is preserved.
X
X# This program is distributed in the hope that it will be useful,
X# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
X# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
X# PARTICULAR PURPOSE.
X
X@SET_MAKE@
X
Xsrcdir = @srcdir@
Xtop_srcdir = @top_srcdir@
XVPATH = @srcdir@
Xpkgdatadir = $(datadir)/@PACKAGE@
Xpkglibdir = $(libdir)/@PACKAGE@
Xpkgincludedir = $(includedir)/@PACKAGE@
Xtop_builddir = ..
X
Xam__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
XINSTALL = @INSTALL@
Xinstall_sh_DATA = $(install_sh) -c -m 644
Xinstall_sh_PROGRAM = $(install_sh) -c
Xinstall_sh_SCRIPT = $(install_sh) -c
XINSTALL_HEADER = $(INSTALL_DATA)
Xtransform = $(program_transform_name)
XNORMAL_INSTALL = :
XPRE_INSTALL = :
XPOST_INSTALL = :
XNORMAL_UNINSTALL = :
XPRE_UNINSTALL = :
XPOST_UNINSTALL = :
Xhost_triplet = @host@
XACLOCAL = @ACLOCAL@
XAMDEP_FALSE = @AMDEP_FALSE@
XAMDEP_TRUE = @AMDEP_TRUE@
XAMTAR = @AMTAR@
XAR = @AR@
XAUTOCONF = @AUTOCONF@
XAUTOHEADER = @AUTOHEADER@
XAUTOMAKE = @AUTOMAKE@
XAWK = @AWK@
XBIGENDIAN = @BIGENDIAN@
XBSD_API = @BSD_API@
XBSD_API_FALSE = @BSD_API_FALSE@
XBSD_API_TRUE = @BSD_API_TRUE@
XBUILD_DOCS_FALSE = @BUILD_DOCS_FALSE@
XBUILD_DOCS_TRUE = @BUILD_DOCS_TRUE@
XCC = @CC@
XCCDEPMODE = @CCDEPMODE@
XCFLAGS = @CFLAGS@
XCPP = @CPP@
XCPPFLAGS = @CPPFLAGS@
XCXX = @CXX@
XCXXCPP = @CXXCPP@
XCXXDEPMODE = @CXXDEPMODE@
XCXXFLAGS = @CXXFLAGS@
XCYGPATH_W = @CYGPATH_W@
XDARWIN_API = @DARWIN_API@
XDARWIN_API_FALSE = @DARWIN_API_FALSE@
XDARWIN_API_TRUE = @DARWIN_API_TRUE@
XDEFS = @DEFS@
XDEPDIR = @DEPDIR@
XECHO = @ECHO@
XECHO_C = @ECHO_C@
XECHO_N = @ECHO_N@
XECHO_T = @ECHO_T@
XEGREP = @EGREP@
XEXEEXT = @EXEEXT@
XF77 = @F77@
XFFLAGS = @FFLAGS@
XINSTALL_DATA = @INSTALL_DATA@
XINSTALL_PROGRAM = @INSTALL_PROGRAM@
XINSTALL_SCRIPT = @INSTALL_SCRIPT@
XINSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
XJADE = @JADE@
XLDFLAGS = @LDFLAGS@
XLIBOBJS = @LIBOBJS@
XLIBS = @LIBS@
XLIBTOOL = @LIBTOOL@
XLIBUSB_BINARY_AGE = @LIBUSB_BINARY_AGE@
XLIBUSB_INTERFACE_AGE = @LIBUSB_INTERFACE_AGE@
XLIBUSB_MAJOR_VERSION = @LIBUSB_MAJOR_VERSION@
XLIBUSB_MICRO_VERSION = @LIBUSB_MICRO_VERSION@
XLIBUSB_MINOR_VERSION = @LIBUSB_MINOR_VERSION@
XLIBUSB_VERSION = @LIBUSB_VERSION@
XLINUX_API = @LINUX_API@
XLINUX_API_FALSE = @LINUX_API_FALSE@
XLINUX_API_TRUE = @LINUX_API_TRUE@
XLN_S = @LN_S@
XLTLIBOBJS = @LTLIBOBJS@
XLT_AGE = @LT_AGE@
XLT_CURRENT = @LT_CURRENT@
XLT_RELEASE = @LT_RELEASE@
XLT_REVISION = @LT_REVISION@
XMAINT = @MAINT@
XMAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
XMAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
XMAKEINFO = @MAKEINFO@
XOBJEXT = @OBJEXT@
XOSLIBS = @OSLIBS@
XPACKAGE = @PACKAGE@
XPACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
XPACKAGE_NAME = @PACKAGE_NAME@
XPACKAGE_STRING = @PACKAGE_STRING@
XPACKAGE_TARNAME = @PACKAGE_TARNAME@
XPACKAGE_VERSION = @PACKAGE_VERSION@
XPATH_SEPARATOR = @PATH_SEPARATOR@
XRANLIB = @RANLIB@
XSET_MAKE = @SET_MAKE@
XSHELL = @SHELL@
XSTRIP = @STRIP@
XVERSION = @VERSION@
Xac_ct_AR = @ac_ct_AR@
Xac_ct_CC = @ac_ct_CC@
Xac_ct_CXX = @ac_ct_CXX@
Xac_ct_F77 = @ac_ct_F77@
Xac_ct_RANLIB = @ac_ct_RANLIB@
Xac_ct_STRIP = @ac_ct_STRIP@
Xam__fastdepCC_FALSE = @am__fastdepCC_FALSE@
Xam__fastdepCC_TRUE = @am__fastdepCC_TRUE@
Xam__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
Xam__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
Xam__include = @am__include@
Xam__leading_dot = @am__leading_dot@
Xam__quote = @am__quote@
Xbindir = @bindir@
Xbuild = @build@
Xbuild_alias = @build_alias@
Xbuild_cpu = @build_cpu@
Xbuild_os = @build_os@
Xbuild_vendor = @build_vendor@
Xdatadir = @datadir@
Xexec_prefix = @exec_prefix@
Xhost = @host@
Xhost_alias = @host_alias@
Xhost_cpu = @host_cpu@
Xhost_os = @host_os@
Xhost_vendor = @host_vendor@
Xincludedir = @includedir@
Xinfodir = @infodir@
Xinstall_sh = @install_sh@
Xlibdir = @libdir@
Xlibexecdir = @libexecdir@
Xlocalstatedir = @localstatedir@
Xmandir = @mandir@
Xoldincludedir = @oldincludedir@
Xprefix = @prefix@
Xprogram_transform_name = @program_transform_name@
Xsbindir = @sbindir@
Xsharedstatedir = @sharedstatedir@
Xsysconfdir = @sysconfdir@
Xtarget_alias = @target_alias@
Xsgml_files = manual.sgml intro.sgml api.sgml functions.sgml examples.sgml
X
X# For when we have a man page :)
Xman_MANS = 
X
XEXTRA_DIST = manual.sgml api.sgml examples.sgml functions.sgml \
X	intro.sgml website.dsl $(man_MANS)
X
X
X# I grabbed this same hack from the VACM docs/Makfile.am
XCLEANFILES = manual.dvi manual.aux manual.tex manual.log \
X	manual.ps.gz; rm -rf html
X
X# Generating postscript takes forever on my laptop apparentely
X@BUILD_DOCS_FALSE@MANUALS = 
X
X#MANUALS = manual.ps.gz html/index.html
X@BUILD_DOCS_TRUE@MANUALS = html/index.html
Xsubdir = doc
XACLOCAL_M4 = $(top_srcdir)/aclocal.m4
Xmkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
XCONFIG_HEADER = $(top_builddir)/config.h
XCONFIG_CLEAN_FILES =
XDIST_SOURCES =
XDIST_COMMON = $(srcdir)/Makefile.in Makefile.am
Xall: all-am
X
X.SUFFIXES:
X$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am  $(top_srcdir)/configure.in $(ACLOCAL_M4)
X	cd $(top_srcdir) && \
X	  $(AUTOMAKE) --gnu  doc/Makefile
XMakefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in  $(top_builddir)/config.status
X	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
X
Xmostlyclean-libtool:
X	-rm -f *.lo
X
Xclean-libtool:
X	-rm -rf .libs _libs
X
Xdistclean-libtool:
X	-rm -f libtool
Xuninstall-info-am:
Xtags: TAGS
XTAGS:
X
Xctags: CTAGS
XCTAGS:
X
XDISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
X
Xtop_distdir = ..
Xdistdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
X
Xdistdir: $(DISTFILES)
X	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
X	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
X	list='$(DISTFILES)'; for file in $$list; do \
X	  case $$file in \
X	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
X	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
X	  esac; \
X	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
X	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
X	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
X	    dir="/$$dir"; \
X	    $(mkinstalldirs) "$(distdir)$$dir"; \
X	  else \
X	    dir=''; \
X	  fi; \
X	  if test -d $$d/$$file; then \
X	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
X	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
X	    fi; \
X	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
X	  else \
X	    test -f $(distdir)/$$file \
X	    || cp -p $$d/$$file $(distdir)/$$file \
X	    || exit 1; \
X	  fi; \
X	done
Xcheck-am: all-am
Xcheck: check-am
Xall-am: Makefile
X
Xinstalldirs:
Xinstall: install-am
Xinstall-exec: install-exec-am
Xinstall-data: install-data-am
Xuninstall: uninstall-am
X
Xinstall-am: all-am
X	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
X
Xinstallcheck: installcheck-am
Xinstall-strip:
X	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
X	  INSTALL_STRIP_FLAG=-s \
X	  `test -z '$(STRIP)' || \
X	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
Xmostlyclean-generic:
X
Xclean-generic:
X	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
X
Xdistclean-generic:
X	-rm -f $(CONFIG_CLEAN_FILES)
X
Xmaintainer-clean-generic:
X	@echo "This command is intended for maintainers to use"
X	@echo "it deletes files that may require special tools to rebuild."
Xclean: clean-am
X
Xclean-am: clean-generic clean-libtool mostlyclean-am
X
Xdistclean: distclean-am
X	-rm -f Makefile
Xdistclean-am: clean-am distclean-generic distclean-libtool
X
Xdvi: dvi-am
X
Xdvi-am:
X
Xinfo: info-am
X
Xinfo-am:
X
Xinstall-data-am:
X
Xinstall-exec-am:
X
Xinstall-info: install-info-am
X
Xinstall-man:
X
Xinstallcheck-am:
X
Xmaintainer-clean: maintainer-clean-am
X	-rm -f Makefile
Xmaintainer-clean-am: distclean-am maintainer-clean-generic
X
Xmostlyclean: mostlyclean-am
X
Xmostlyclean-am: mostlyclean-generic mostlyclean-libtool
X
Xpdf: pdf-am
X
Xpdf-am:
X
Xps: ps-am
X
Xps-am:
X
Xuninstall-am: uninstall-info-am
X
X.PHONY: all all-am check check-am clean clean-generic clean-libtool \
X	distclean distclean-generic distclean-libtool distdir dvi \
X	dvi-am info info-am install install-am install-data \
X	install-data-am install-exec install-exec-am install-info \
X	install-info-am install-man install-strip installcheck \
X	installcheck-am installdirs maintainer-clean \
X	maintainer-clean-generic mostlyclean mostlyclean-generic \
X	mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
X	uninstall-info-am
X
X
Xall: $(MANUALS)
X
Xmanual.ps.gz: $(sgml_files) website.dsl
X	@JADE@ -t ps -d $(srcdir)/website.dsl\#print $(srcdir)/manual.sgml
X	gzip manual.ps
X
Xhtml/index.html: $(sgml_files) website.dsl
X	rm -rf html
X	mkdir html
X	@JADE@ -t sgml -d $(srcdir)/website.dsl\#html $(srcdir)/manual.sgml
X# Tell versions [3.59,3.63) of GNU make to not export all variables.
X# Otherwise a system limit (for SysV at least) may be exceeded.
X.NOEXPORT:
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/doc/Makefile.in' 'failed'
fi
# ============= libusb-0.1.8/doc/api.sgml ==============
if test -f 'libusb-0.1.8/doc/api.sgml' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/doc/api.sgml' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/doc/api.sgml' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/doc/api.sgml' &&
X<!-- FIXME: I want this to be displayed as one page, not seperate -->
X
X  <title>API</title>
X  <partintro>
X    <para>This is the external API for applications to use.</para>
X    <para>The API is relatively lean and designed to have close analogies to the USB specification. The v0.1 API was mostly hacked together and kludged together without much forethought and as a result, it's missing quite a few features. v1.0 is intended to rectify this.</para>
X  </partintro> 
X
X  <chapter id="api-device-interfaces">
X    <title>Devices and interfaces</title>
X
X    <para>The libusb API ties an open device to a specific interface. This means that if you want to claim multiple interfaces on a device, you should open the device multiple times to receive one usb_dev_handle for each interface you want to communicate with. Don't forget to call <xref linkend="function.usbclaiminterface">.</para>
X  </chapter>
X
X  <chapter id="api-timeouts">
X    <title>Timeouts</title>
X
X    <para>Timeout's in libusb are always specified in milliseconds.</para>
X  </chapter>
X
X  <chapter id="api-types">
X    <title>Data Types</title>
X
X    <para>libusb uses both abstracted and non abstracted structures to maintain portability.</para>
X  </chapter>
X
X  <chapter id="api-synchronous">
X    <title>Synchronous</title>
X 
X    <para>All functions in libusb v0.1 are synchronous, meaning the functions block and wait for the operation to finish or timeout before returning execution to the calling application. Asynchronous operation will be supported in v1.0, but not v0.1.</para>
X  </chapter>
X
X  <chapter id="api-return-values">
X    <title>Return values</title>
X 
X    <para>There are two types of return values used in libusb v0.1. The first is a handle returned by <xref linkend="function.usbopen">. The second is an int. In all cases where an int is returned, &gt;= 0 is a success and &lt; 0 is an error condition.</para>
X  </chapter>
X
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/doc/api.sgml' 'failed'
fi
# ============= libusb-0.1.8/doc/examples.sgml ==============
if test -f 'libusb-0.1.8/doc/examples.sgml' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/doc/examples.sgml' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/doc/examples.sgml' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/doc/examples.sgml' &&
X  <title>Examples</title>
X  <partintro>
X    <para>There are some nonintuitive parts of libusb v0.1 that aren't difficult, but are probably easier to understand with some examples.</para>
X  </partintro>
X
X  <chapter id="examples-code">
X    <title>Basic Examples</title>
X    <para>Before any communication can occur with a device, it needs to be found. This is accomplished by finding all of the busses and then finding all of the devices on all of the busses:</para>
X    <programlisting>
X<![CDATA[
X	struct usb_bus *busses;
X
X	usb_init();
X	usb_find_busses();
X	usb_find_devices();
X
X	busses = usb_get_busses();
X]]>
X    </programlisting>
X    <para>After this, the application should manually loop through all of the busess and all of the devices and matching the device by whatever criteria is needed:</para>
X    <programlisting>
X<![CDATA[
X	struct usb_bus *bus;
X	int c, i, a;
X
X	/* ... */
X
X	for (bus = busses; bus; bus = bus->next) {
X		struct usb_device *dev;
X
X		for (dev = bus->devices; dev; dev = dev->next) {
X			/* Check if this device is a printer */
X			if (dev->descriptor.bDeviceClass == 7) {
X				/* Open the device, claim the interface and do your processing */
X				...
X			}
X
X			/* Loop through all of the configurations */
X			for (c = 0; c < dev->descriptor.bNumConfigurations; c++) {
X				/* Loop through all of the interfaces */
X				for (i = 0; i < dev->config[c].bNumInterfaces; i++) {
X					/* Loop through all of the alternate settings */
X					for (a = 0; a < dev->config[c].interface[i].num_altsetting; a++) {
X						/* Check if this interface is a printer */
X						if (dev->config[c].interface[i].altsetting[a].bInterfaceClass == 7) {
X							/* Open the device, set the alternate setting, claim the interface and do your processing */
X							...
X						}
X					}
X				}
X			}
X		}
X	}
X]]>
X    </programlisting>
X  </chapter>
X
X  <chapter id="examples-tests">
X    <title>Examples in the source distribution</title>
X    <para>The tests directory has a program called testlibusb.c. It simply calls libusb to find all of the devices, then iterates through all of the devices and prints out the descriptor dump. It's very simple and as a result, it's of limited usefulness in itself. However, it could serve as a starting point for a new program.</para>
X  </chapter>
X
X  <chapter id="examples-other">
X    <title>Other Applications</title>
X    <para>Another source of examples can be obtained from other applications.</para>
X    <itemizedlist>
X      <listitem><para><ulink url="http://www.gphoto.org/">gPhoto</ulink> uses libusb to communicate with digital still cameras.</para></listitem>
X      <listitem><para><ulink url="http://rio500.sourceforge.net/">rio500</ulink> utils uses libusb to communicate with SONICblue Rio 500 Digital Audio Player.</para></listitem>
X    </itemizedlist>
X  </chapter>
X
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/doc/examples.sgml' 'failed'
fi
# ============= libusb-0.1.8/doc/functions.sgml ==============
if test -f 'libusb-0.1.8/doc/functions.sgml' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/doc/functions.sgml' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/doc/functions.sgml' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/doc/functions.sgml' &&
X  <title>Functions</title>
X
X  <reference id="ref.core">
X    <title>Core</title>
X    <partintro>
X      <!-- FIXME: Check spelling of "comprise" -->
X      <para>These functions comprise the core of libusb. They are used by all applications that utilize libusb.</para>
X    </partintro>
X
X    <refentry id="function.usbinit">
X      <refnamediv>
X        <refname>usb_init</refname>
X        <refpurpose>Initialize libusb</refpurpose>
X      </refnamediv>
X      <refsect1>
X        <title>Description</title>
X        <funcsynopsis>
X          <funcprototype>
X            <funcdef>void <function>usb_init</function></funcdef>
X            <void>
X          </funcprototype>
X        </funcsynopsis>
X        <para>Just like the name implies, <function>usb_init</function> sets up some internal structures. <function>usb_init</function> <emphasis>must</emphasis> be called before any other libusb functions.</para>
X      </refsect1>
X    </refentry>
X
X    <refentry id="function.usbfindbusses">
X      <refnamediv>
X        <refname>usb_find_busses</refname>
X        <refpurpose>Finds all USB busses on system</refpurpose>
X      </refnamediv>
X      <refsect1>
X        <title>Description</title>
X        <funcsynopsis>
X          <funcprototype>
X            <funcdef>int <function>usb_find_busses</function></funcdef>
X            <void>
X          </funcprototype>
X        </funcsynopsis>
X        <para><function>usb_find_busses</function> will find all of the busses on the system. Returns the number of changes since previous call to this function (total of new busses and busses removed).</para>
X      </refsect1>
X    </refentry>
X
X    <refentry id="function.usbfinddevices">
X      <refnamediv>
X        <refname>usb_find_devices</refname>
X        <refpurpose>Find all devices on all USB devices</refpurpose>
X      </refnamediv>
X      <refsect1>
X        <title>Description</title>
X        <funcsynopsis>
X          <funcprototype>
X            <funcdef>int <function>usb_find_devices</function></funcdef>
X            <void>
X          </funcprototype>
X        </funcsynopsis>
X        <para><function>usb_find_devices</function> will find all of the devices on each bus. This should be called after <xref linkend="function.usbfindbusses">. Returns the number of changes since the previous call to this function (total of new device and devices removed).</para>
X      </refsect1>
X    </refentry>
X
X    <refentry id="function.usbgetbusses">
X      <refnamediv>
X        <refname>usb_get_busses</refname>
X        <refpurpose>Return the list of USB busses found</refpurpose>
X      </refnamediv>
X      <refsect1>
X        <title>Description</title>
X        <funcsynopsis>
X          <funcprototype>
X            <funcdef>struct usb_bus *<function>usb_get_busses</function></funcdef>
X            <void>
X          </funcprototype>
X        </funcsynopsis>
X        <para><function>usb_get_busses</function> simply returns the value of the global variable <varname>usb_busses</varname>. This was implemented for those languages that support C calling convention and can use shared libraries, but don't support C global variables (like Delphi).</para>
X      </refsect1>
X    </refentry>
X  </reference>
X
X  <reference id="ref.deviceops">
X    <title>Device operations</title>
X    <partintro>
X      <para>This group of functions deal with the device. It allows you to open and close the device as well standard USB operations like setting the configuration, alternate settings, clearing halts and resetting the device. It also provides OS level operations such as claiming and releasing interfaces.</para>
X    </partintro>
X
X    <refentry id="function.usbopen">
X      <refnamediv>
X        <refname>usb_open</refname>
X        <refpurpose>Opens a USB device</refpurpose>
X      </refnamediv>
X      <refsect1>
X        <title>Description</title>
X        <funcsynopsis>
X          <funcprototype>
X            <funcdef>usb_dev_handle *<function>usb_open</function></funcdef>
X            <paramdef>struct *usb_device <parameter>dev</parameter></paramdef>
X          </funcprototype>
X        </funcsynopsis>
X        <para><function>usb_open</function> is to be used to open up a device for use. <function>usb_open</function> must be called before attempting to perform any operations to the device. Returns a handle used in future communication with the device.</para>
X      </refsect1>
X    </refentry>
X
X    <refentry id="function.usbclose">
X      <refnamediv>
X        <refname>usb_close</refname>
X        <refpurpose>Closes a USB device</refpurpose>
X      </refnamediv>
X      <refsect1>
X        <title>Description</title>
X        <funcsynopsis>
X          <funcprototype>
X            <funcdef>int <function>usb_close</function></funcdef>
X            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
X          </funcprototype>
X        </funcsynopsis>
X        <para><function>usb_close</function> closes a device opened with <xref linkend="function.usbopen">. No further operations may be performed on the handle after <function>usb_close</function> is called. Returns 0 on success or &lt; 0 on error.</para>
X      </refsect1>
X    </refentry>
X
X    <refentry id="function.usbsetconfiguration">
X      <refnamediv>
X        <refname>usb_set_configuration</refname>
X        <refpurpose>Sets the active configuration of a device</refpurpose>
X      </refnamediv>
X      <refsect1>
X        <title>Description</title>
X        <funcsynopsis>
X          <funcprototype>
X            <funcdef>int <function>usb_set_configuration</function></funcdef>
X            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
X            <paramdef>int <parameter>configuration</parameter></paramdef>
X          </funcprototype>
X        </funcsynopsis>
X        <para><function>usb_set_configuration</function> sets the active configuration of a device. The <varname>configuration</varname> parameter is the value as specified in the descriptor field bConfigurationValue. Returns 0 on success or &lt; 0 on error.</para>
X      </refsect1>
X    </refentry>
X
X    <refentry id="function.usbsetaltinterface">
X      <refnamediv>
X        <refname>usb_set_altinterface</refname>
X        <refpurpose>Sets the active alternate setting of the current interface</refpurpose>
X      </refnamediv>
X      <refsect1>
X        <title>Description</title>
X        <funcsynopsis>
X          <funcprototype>
X            <funcdef>int <function>usb_set_altinterface</function></funcdef>
X            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
X            <paramdef>int <parameter>alternate</parameter></paramdef>
X          </funcprototype>
X        </funcsynopsis>
X        <para><function>usb_set_altinterface</function> sets the active alternate setting of the current interface. The <varname>alternate</varname> parameter is the value as specified in the descriptor field bAlternateSetting. Returns 0 on success or &lt; 0 on error.</para>
X      </refsect1>
X    </refentry>
X
X    <refentry id="function.usbresetep">
X      <refnamediv>
X        <refname>usb_resetep</refname>
X        <refpurpose>Resets state for an endpoint</refpurpose>
X      </refnamediv>
X      <refsect1>
X        <title>Description</title>
X        <funcsynopsis>
X          <funcprototype>
X            <funcdef>int <function>usb_resetep</function></funcdef>
X            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
X            <paramdef>unsigned int <parameter>ep</parameter></paramdef>
X          </funcprototype>
X        </funcsynopsis>
X        <para><function>usb_resetep</function> resets all state (like toggles) for the specified endpoint. The <varname>ep</varname> parameter is the value specified in the descriptor field bEndpointAddress. Returns 0 on success or &lt; 0 on error.</para>
X        <note>
X          <title>Deprecated</title>
X          <para><function>usb_resetep</function> is deprecated. You probably want to use <xref linkend="function.usbclearhalt">.</para>
X        </note>
X      </refsect1>
X    </refentry>
X
X    <refentry id="function.usbclearhalt">
X      <refnamediv>
X        <refname>usb_clear_halt</refname>
X        <refpurpose>Clears any halt status on an endpoint</refpurpose>
X      </refnamediv>
X      <refsect1>
X        <title>Description</title>
X        <funcsynopsis>
X          <funcprototype>
X            <funcdef>int <function>usb_clear_halt</function></funcdef>
X            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
X            <paramdef>unsigned int <parameter>ep</parameter></paramdef>
X          </funcprototype>
X        </funcsynopsis>
X        <para><function>usb_clear_halt</function> clears any halt status on the specified endpoint. The <varname>ep</varname> parameter is the value specified in the descriptor field bEndpointAddress. Returns 0 on success or &lt; 0 on error.</para>
X      </refsect1>
X    </refentry>
X
X    <refentry id="function.usbreset">
X      <refnamediv>
X        <refname>usb_reset</refname>
X        <refpurpose>Resets a device</refpurpose>
X      </refnamediv>
X      <refsect1>
X        <title>Description</title>
X        <funcsynopsis>
X          <funcprototype>
X            <funcdef>int <function>usb_reset</function></funcdef>
X            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
X          </funcprototype>
X        </funcsynopsis>
X        <para><function>usb_reset</function> resets the specified device by sending a RESET down the port it is connected to. Returns 0 on success or &lt; 0 on error.</para>
X        <note>
X          <title>Causes re-enumeration</title>
X          <para>After calling <function>usb_reset</function>, the device will need to re-enumerate and thusly, requires you to find the new device and open a new handle. The handle used to call <function>usb_reset</function> will no longer work.</para>
X        </note>
X      </refsect1>
X    </refentry>
X
X    <refentry id="function.usbclaiminterface">
X      <refnamediv>
X        <refname>usb_claim_interface</refname>
X        <refpurpose>Claim an interface of a device</refpurpose>
X      </refnamediv>
X      <refsect1>
X        <title>Description</title>
X        <funcsynopsis>
X          <funcprototype>
X            <funcdef>int <function>usb_claim_interface</function></funcdef>
X            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
X            <paramdef>int <parameter>interface</parameter></paramdef>
X          </funcprototype>
X        </funcsynopsis>
X        <para><function>usb_claim_interface</function> claims the interface with the Operating System. The interface parameter is the value as specified in the descriptor field bInterfaceNumber. Returns 0 on success or &lt; 0 on error.</para>
X        <important>
X          <title>Must be called!</title>
X          <para><function>usb_claim_interface</function> <emphasis>must</emphasis> be called before you perform any operations related to this interface (like <xref linkend="function.usbsetaltinterface">, <xref linkend="function.usbbulkwrite">, etc).</para>
X        </important>
X
X        <table>
X          <title>Return Codes</title>
X          <tgroup cols="2">
X            <thead>
X              <row>
X                <entry>code</entry>
X                <entry>description</entry>
X              </row>
X            </thead>
X            <tbody>
X              <row>
X                <entry>-EBUSY</entry>
X                <entry>Interface is not available to be claimed</entry>
X              </row>
X              <row>
X                <entry>-ENOMEM</entry>
X                <entry>Insufficient memory</entry>
X              </row>
X            </tbody>
X          </tgroup>
X        </table>
X      </refsect1>
X    </refentry>
X
X    <refentry id="function.usbreleaseinterface">
X      <refnamediv>
X        <refname>usb_release_interface</refname>
X        <refpurpose>Releases a previously claimed interface</refpurpose>
X      </refnamediv>
X      <refsect1>
X        <title>Description</title>
X        <funcsynopsis>
X          <funcprototype>
X            <funcdef>int <function>usb_release_interface</function></funcdef>
X            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
X            <paramdef>int <parameter>interface</parameter></paramdef>
X          </funcprototype>
X        </funcsynopsis>
X        <para><function>usb_release_interface</function> releases an interface previously claimed with <xref linkend="function.usbclaiminterface">. The interface parameter is the value as specified in the descriptor field bInterfaceNumber. Returns 0 on success or &lt; 0 on error.</para>
X      </refsect1>
X    </refentry>
X  </reference>
X
X  <reference id="ref.control">
X    <title>Control Transfers</title>
X    <partintro>
X      <para>This group of functions allow applications to send messages to the default control pipe.</para>
X    </partintro>
X
X    <refentry id="function.usbcontrolmsg">
X      <refnamediv>
X        <refname>usb_control_msg</refname>
X        <refpurpose>Send a control message to a device</refpurpose>
X      </refnamediv>
X      <refsect1>
X        <title>Description</title>
X        <funcsynopsis>
X          <funcprototype>
X            <funcdef>int <function>usb_control_msg</function></funcdef>
X            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
X            <paramdef>int <parameter>requesttype</parameter></paramdef>
X            <paramdef>int <parameter>request</parameter></paramdef>
X            <paramdef>int <parameter>value</parameter></paramdef>
X            <paramdef>int <parameter>index</parameter></paramdef>
X            <paramdef>char *<parameter>bytes</parameter></paramdef>
X            <paramdef>int <parameter>size</parameter></paramdef>
X            <paramdef>int <parameter>timeout</parameter></paramdef>
X          </funcprototype>
X        </funcsynopsis>
X        <para><function>usb_control_msg</function> performs a control request to the default control pipe on a device. The parameters mirror the types of the same name in the USB specification. Returns number of bytes written/read or &lt; 0 on error.</para>
X      </refsect1>
X    </refentry>
X
X    <refentry id="function.usbgetstring">
X      <refnamediv>
X        <refname>usb_get_string</refname>
X        <refpurpose>Retrieves a string descriptor from a device</refpurpose>
X      </refnamediv>
X      <refsect1>
X        <title>Description</title>
X        <funcsynopsis>
X          <funcprototype>
X            <funcdef>int <function>usb_get_string</function></funcdef>
X            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
X            <paramdef>int <parameter>index</parameter></paramdef>
X            <paramdef>int <parameter>langid</parameter></paramdef>
X            <paramdef>char *<parameter>buf</parameter></paramdef>
X            <paramdef>size_t <parameter>buflen</parameter></paramdef>
X          </funcprototype>
X        </funcsynopsis>
X        <para><function>usb_get_string</function> retrieves the string descriptor specified by index and langid from a device. The string will be returned in Unicode as specified by the USB specification. Returns the number of bytes returned in <varname>buf</varname> or &lt; 0 on error.</para>
X      </refsect1>
X    </refentry>
X
X    <refentry id="function.usbgetstringsimple">
X      <refnamediv>
X        <refname>usb_get_string_simple</refname>
X        <refpurpose>Retrieves a string descriptor from a device using the first language</refpurpose>
X      </refnamediv>
X      <refsect1>
X        <title>Description</title>
X        <funcsynopsis>
X          <funcprototype>
X            <funcdef>int <function>usb_get_string_simple</function></funcdef>
X            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
X            <paramdef>int <parameter>index</parameter></paramdef>
X            <paramdef>char *<parameter>buf</parameter></paramdef>
X            <paramdef>size_t <parameter>buflen</parameter></paramdef>
X          </funcprototype>
X        </funcsynopsis>
X        <para><function>usb_get_string_simple</function> is a wrapper around <function>usb_get_string</function> that retrieves the string description specified by index in the first language for the descriptor and converts it into C style ASCII. Returns number of bytes returned in <varname>buf</varname> or &lt; 0 on error.</para>
X      </refsect1>
X    </refentry>
X
X    <refentry id="function.usbgetdescriptor">
X      <refnamediv>
X        <refname>usb_get_descriptor</refname>
X        <refpurpose>Retrieves a descriptor from a device's default control pipe</refpurpose>
X      </refnamediv>
X      <refsect1>
X        <title>Description</title>
X        <funcsynopsis>
X          <funcprototype>
X            <funcdef>int <function>usb_get_descriptor</function></funcdef>
X            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
X            <paramdef>unsigned char <parameter>type</parameter></paramdef>
X            <paramdef>unsigned char <parameter>index</parameter></paramdef>
X            <paramdef>void *<parameter>buf</parameter></paramdef>
X            <paramdef>int <parameter>size</parameter></paramdef>
X          </funcprototype>
X        </funcsynopsis>
X        <para><function>usb_get_descriptor</function> retrieves a descriptor from the device identified by the <varname>type</varname> and <varname>index</varname> of the descriptor from the default control pipe. Returns number of bytes read for the descriptor or &lt; 0 on error.</para>
X        <para>See <xref linkend="function.usbgetdescriptorbyendpoint"> for a function that allows the control endpoint to be specified.</para>
X      </refsect1>
X    </refentry>
X
X    <refentry id="function.usbgetdescriptorbyendpoint">
X      <refnamediv>
X        <refname>usb_get_descriptor_by_endpoint</refname>
X        <refpurpose>Retrieves a descriptor from a device</refpurpose>
X      </refnamediv>
X      <refsect1>
X        <title>Description</title>
X        <funcsynopsis>
X          <funcprototype>
X            <funcdef>int <function>usb_get_descriptor_by_endpoint</function></funcdef>
X            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
X            <paramdef>int <parameter>ep</parameter></paramdef>
X            <paramdef>unsigned char <parameter>type</parameter></paramdef>
X            <paramdef>unsigned char <parameter>index</parameter></paramdef>
X            <paramdef>void *<parameter>buf</parameter></paramdef>
X            <paramdef>int <parameter>size</parameter></paramdef>
X          </funcprototype>
X        </funcsynopsis>
X        <para><function>usb_get_descriptor_by_endpoint</function> retrieves a descriptor from the device identified by the <varname>type</varname> and <varname>index</varname> of the descriptor from the control pipe identified by <varname>ep</varname>. Returns number of bytes read for the descriptor or &lt; 0 on error.</para>
X      </refsect1>
X    </refentry>
X  </reference>
X
X  <reference id="ref.bulk">
X    <title>Bulk Transfers</title>
X    <partintro>
X      <para>This group of functions allow applications to send and receive data via bulk pipes.</para>
X    </partintro>
X
X    <refentry id="function.usbbulkwrite">
X      <refnamediv>
X        <refname>usb_bulk_write</refname>
X        <refpurpose>Write data to a bulk endpoint</refpurpose>
X      </refnamediv>
X      <refsect1>
X        <title>Description</title>
X        <funcsynopsis>
X          <funcprototype>
X            <funcdef>int <function>usb_bulk_write</function></funcdef>
X            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
X            <paramdef>int <parameter>ep</parameter></paramdef>
X            <paramdef>char *<parameter>bytes</parameter></paramdef>
X            <paramdef>int <parameter>size</parameter></paramdef>
X            <paramdef>int <parameter>timeout</parameter></paramdef>
X          </funcprototype>
X        </funcsynopsis>
X        <para><function>usb_bulk_write</function> performs a bulk write request to the endpoint specified by <varname>ep</varname>. Returns number of bytes written on success or &lt; 0 on error.</para>
X      </refsect1>
X    </refentry>
X
X    <refentry id="function.usbbulkread">
X      <refnamediv>
X        <refname>usb_bulk_read</refname>
X        <refpurpose>Read data from a bulk endpoint</refpurpose>
X      </refnamediv>
X      <refsect1>
X        <title>Description</title>
X        <funcsynopsis>
X          <funcprototype>
X            <funcdef>int <function>usb_bulk_read</function></funcdef>
X            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
X            <paramdef>int <parameter>ep</parameter></paramdef>
X            <paramdef>char *<parameter>bytes</parameter></paramdef>
X            <paramdef>int <parameter>size</parameter></paramdef>
X            <paramdef>int <parameter>timeout</parameter></paramdef>
X          </funcprototype>
X        </funcsynopsis>
X        <para><function>usb_bulk_read</function> performs a bulk read request to the endpoint specified by <varname>ep</varname>. Returns number of bytes read on success or &lt; 0 on error.</para>
X      </refsect1>
X    </refentry>
X  </reference>
X
X  <reference id="ref.interrupt">
X    <title>Interrupt Transfers</title>
X    <partintro>
X      <para>This group of functions allow applications to send and receive data via interrupt pipes.</para>
X    </partintro>
X
X    <refentry id="function.usbinterruptwrite">
X      <refnamediv>
X        <refname>usb_interrupt_write</refname>
X        <refpurpose>Write data to an interrupt endpoint</refpurpose>
X      </refnamediv>
X      <refsect1>
X        <title>Description</title>
X        <funcsynopsis>
X          <funcprototype>
X            <funcdef>int <function>usb_interrupt_write</function></funcdef>
X            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
X            <paramdef>int <parameter>ep</parameter></paramdef>
X            <paramdef>char *<parameter>bytes</parameter></paramdef>
X            <paramdef>int <parameter>size</parameter></paramdef>
X            <paramdef>int <parameter>timeout</parameter></paramdef>
X          </funcprototype>
X        </funcsynopsis>
X        <para><function>usb_interrupt_write</function> performs an interrupt write request to the endpoint specified by <varname>ep</varname>. Returns number of bytes written on success or &lt; 0 on error.</para>
X      </refsect1>
X    </refentry>
X
X    <refentry id="function.usbinterruptread">
X      <refnamediv>
X        <refname>usb_interrupt_read</refname>
X        <refpurpose>Read data from a interrupt endpoint</refpurpose>
X      </refnamediv>
X      <refsect1>
X        <title>Description</title>
X        <funcsynopsis>
X          <funcprototype>
X            <funcdef>int <function>usb_interrupt_read</function></funcdef>
X            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
X            <paramdef>int <parameter>ep</parameter></paramdef>
X            <paramdef>char *<parameter>bytes</parameter></paramdef>
X            <paramdef>int <parameter>size</parameter></paramdef>
X            <paramdef>int <parameter>timeout</parameter></paramdef>
X          </funcprototype>
X        </funcsynopsis>
X        <para><function>usb_interrupt_read</function> performs a interrupt read request to the endpoint specified by <varname>ep</varname>. Returns number of bytes read on success or &lt; 0 on error.</para>
X      </refsect1>
X    </refentry>
X  </reference>
X
X  <reference id="ref.nonportable">
X    <title>Non Portable</title>
X    <partintro>
X      <para>These functions are non portable. They may expose some part of the USB API on one OS or perhaps a couple, but not all. They are all marked with the string _np at the end of the function name.</para>
X      <para>A C preprocessor macro will be defined if the function is implemented. The form is LIBUSB_HAS_ prepended to the function name, without the leading "usb_", in all caps. For example, if usb_get_driver_np is implemented, LIBUSB_HAS_GET_DRIVER_NP will be defined.</para>
X    </partintro>
X
X    <refentry id="function.usbgetdrivernp">
X      <refnamediv>
X        <refname>usb_get_driver_np</refname>
X        <refpurpose>Get driver name bound to interface</refpurpose>
X      </refnamediv>
X      <refsect1>
X        <title>Description</title>
X        <funcsynopsis>
X          <funcprototype>
X            <funcdef>int <function>usb_get_driver_np</function></funcdef>
X            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
X            <paramdef>int <parameter>interface</parameter></paramdef>
X            <paramdef>char *<parameter>name</parameter></paramdef>
X            <paramdef>int <parameter>namelen</parameter></paramdef>
X          </funcprototype>
X        </funcsynopsis>
X        <para>This function will obtain the name of the driver bound to the interface specified by the parameter <parameter>interface</parameter> and place it into the buffer named <parameter>name</parameter> limited to <parameter>namelen</parameter> characters. Returns 0 on success or &lt; 0 on error.</para>
X        <para>Implemented on Linux only.</para>
X      </refsect1>
X    </refentry>
X
X    <refentry id="function.usbdetachkerneldrivernp">
X      <refnamediv>
X        <refname>usb_detach_kernel_driver_np</refname>
X        <refpurpose>Detach kernel driver from interface</refpurpose>
X      </refnamediv>
X      <refsect1>
X        <title>Description</title>
X        <funcsynopsis>
X          <funcprototype>
X            <funcdef>int <function>usb_detach_kernel_driver_np</function></funcdef>
X            <paramdef>usb_dev_handle *<parameter>dev</parameter></paramdef>
X            <paramdef>int <parameter>interface</parameter></paramdef>
X          </funcprototype>
X        </funcsynopsis>
X        <para>This function will detach a kernel driver from the interface specified by parameter <parameter>interface</parameter>. Applications using libusb can then try claiming the interface. Returns 0 on success or &lt; 0 on error.</para>
X        <para>Implemented on Linux only.</para>
X      </refsect1>
X    </refentry>
X  </reference>
X
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/doc/functions.sgml' 'failed'
fi
# ============= libusb-0.1.8/doc/intro.sgml ==============
if test -f 'libusb-0.1.8/doc/intro.sgml' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/doc/intro.sgml' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/doc/intro.sgml' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/doc/intro.sgml' &&
X  <title>Introduction</title>
X  <chapter id="intro-overview">
X    <title>Overview</title>
X    <para>This documentation will give an overview of how the v0.1 libusb API works and relates to &usb;. Work is rapidly progressing on a newer version of libusb, to be v1.0, which will be a redesigned API and is intended to obsolete v0.1. You may want to check the <ulink url="http://libusb.sourceforge.net/">libusb</ulink> website to see if it is stable and recommended.</para>
X    <para>This documentation assumes that you have a good understanding of &usb; and how it works. If you don't have a good understanding of USB, it is recommended you obtain the USB <ulink url="http://www.usb.org/developers/docs/usbspec.zip">v1.1</ulink> and/or <ulink url="http://www.usb.org/developers/docs/usb_20.zip">v2.0</ulink> specs and read them.</para>
X    <para>libusb is geared towards &usb; 1.1, however from the perspective of libusb, &usb; 2.0 won't be a significant change for libusb</para>
X  </chapter>
X
X  <chapter id="intro-support">
X    <title>Current OS support</title>
X    <itemizedlist>
X      <listitem><para><ulink url="http://www.kernel.org/">Linux</ulink> (2.2, 2.4 and on)</para></listitem>
X      <listitem><para><ulink url="http://www.freebsd.org/">FreeBSD</ulink>, <ulink url="http://www.netbsd.org/">NetBSD</ulink> and <ulink url="http://www.openbsd.org/">OpenBSD</ulink></para></listitem>
X      <listitem><para><ulink url="http://developer.apple.com/darwin/">Darwin</ulink>/<ulink url="http://developer.apple.com/macosx/">MacOS X</ulink></para></listitem>
X    </itemizedlist>
X  </chapter>
X
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/doc/intro.sgml' 'failed'
fi
# ============= libusb-0.1.8/doc/manual.sgml ==============
if test -f 'libusb-0.1.8/doc/manual.sgml' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/doc/manual.sgml' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/doc/manual.sgml' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/doc/manual.sgml' &&
X<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [
X
X<!ENTITY intro SYSTEM "intro.sgml">
X<!ENTITY api SYSTEM "api.sgml">
X<!ENTITY functions SYSTEM "functions.sgml">
X<!ENTITY examples SYSTEM "examples.sgml">
X
X<!-- I'm lazy -->
X<!ENTITY usb "<acronym>USB</acronym>">
X]>
X
X<book id="manual">
X  <title>libusb Developers Guide</title>
X  <bookinfo>
X    <author>
X      <firstname>Johannes</firstname>
X      <surname>Erdfelt</surname>
X    </author>
X    <affiliation>
X      <address><email>johannes@erdfelt.com</email></address>
X    </affiliation>
X
X    <revhistory>
X      <revision>
X        <revnumber>0.3</revnumber>
X        <date>June 28, 2002</date>
X        <authorinitials>jerdfelt</authorinitials>
X        <revremark>More cleanups. Add the rest of the API and clean up some places. Add some examples. Hopefully, this should document the entire 0.1 API now.</revremark>
X      </revision>
X
X      <revision>
X        <revnumber>0.2</revnumber>
X        <date>June 11, 2002</date>
X        <authorinitials>jerdfelt</authorinitials>
X        <revremark>Cleanup, update for all of the changes that have happened in the last couple of months.</revremark>
X      </revision>
X
X      <revision>
X        <revnumber>0.1</revnumber>
X        <date>August 26, 2001</date>
X        <authorinitials>jerdfelt</authorinitials>
X        <revremark>First stab.</revremark>
X      </revision>
X    </revhistory>
X
X    <keywordset>
X      <keyword>libusb</keyword>
X    </keywordset>
X  </bookinfo>
X
X  <preface id="preface">
X    <title>Preface</title>
X
X    <abstract>
X      <simpara>This document's purpose is to explain the API for libusb and how to use it to make a &usb; aware application</simpara>
X      <simpara>Any suggestions, corrections and comments regarding this document can be sent to the author: <ulink url="mailto:johannes@erdfelt.com">Johannes Erdfelt</ulink> or the <ulink url="mailto:libusb-devel@lists.sourceforge.net">libusb developers mailing list</ulink>.</simpara>
X    </abstract>
X  </preface>
X
X  <part id="intro">
X&intro;
X  </part>
X
X  <part id="api">
X&api;
X  </part>
X
X  <part id="functions">
X&functions;
X  </part>
X
X  <part id="examples">
X&examples;
X  </part>
X</book>
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/doc/manual.sgml' 'failed'
fi
# ============= libusb-0.1.8/doc/website.dsl ==============
if test -f 'libusb-0.1.8/doc/website.dsl' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/doc/website.dsl' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/doc/website.dsl' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/doc/website.dsl' &&
X<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
X<!entity docbook.dsl PUBLIC "-//Norman Walsh//DOCUMENT DocBook HTML Stylesheet//EN" CDATA DSSSL>
X]>
X
X<!-- 
X
XDocument: website.dsl
XVersion: 0.2
X
XAuthor: Johannes Erdfelt <johannes@erdfelt.com>
X
XThis stylesheet handles the website (html) and rtf/ps (print) stylesheets
X
X-->
X
X<style-sheet>
X
X<style-specification id="print" use="docbook">
X<style-specification-body> ;; ==============================
X;; customize the print stylesheet
X;; ==============================
X
X(declare-characteristic preserve-sdata?
X  ;; this is necessary because right now jadetex does not understand
X  ;; symbolic entities, whereas things work well with numeric entities.
X  "UNREGISTERED::James Clark//Characteristic::preserve-sdata?"
X  #f)
X
X(define %generate-article-toc%
X  ;; Should a Table of Contents be produced for Articles?
X  #t)
X
X(define (toc-depth nd)
X  2)
X
X(define %generate-article-titlepage-on-separate-page%
X  ;; Should the article title page be on a separate page?
X  #t)
X
X(define %section-autolabel%
X  ;; Are sections enumerated?
X  #t)
X
X(define %footnote-ulinks%
X  ;; Generate footnotes for ULinks?
X  #f)
X
X(define %bop-footnotes%
X  ;; Make "bottom-of-page" footnotes?
X  #f)
X
X(define %body-start-indent%
X  ;; Default indent of body text
X  0pi)
X
X(define %para-indent-firstpara%
X  ;; First line start-indent for the first paragraph
X  0pt)
X
X(define %para-indent%
X  ;; First line start-indent for paragraphs (other than the first)
X  0pt)
X
X(define %block-start-indent%
X  ;; Extra start-indent for block-elements
X  0pt)
X
X(define formal-object-float
X  ;; Do formal objects float?
X  #t)
X
X(define %hyphenation%
X  ;; Allow automatic hyphenation?
X  #t)
X
X(define %admon-graphics%
X  ;; Use graphics in admonitions?
X  #f)
X
X</style-specification-body>
X</style-specification>
X
X
X<!--
X;; ===================================================
X;; customize the html stylesheet; borrowed from Cygnus
X;; at http://sourceware.cygnus.com/ (cygnus-both.dsl)
X;; ===================================================
X-->
X
X
X<style-specification id="html" use="docbook">
X<style-specification-body>
X
X
X;; =========================
X;; Indexes
X
X;; Returns the depth of the auto-generated TOC (table of contents) that
X;; should be made at the nd-level
X(define (toc-depth nd)
X  (if (string=? (gi nd) "book")
X      2 ; the depth of the top-level TOC
X      2 ; the depth of all other TOCs
X      ))
X
X(define %page-n-columns%
X  ;; Sets the number of columns on each page
X  2)
X
X(define %generate-article-toc% 
X  #t)
X
X
X(define %header-navigation%
X  #t)
X
X(define %footer-navigation%
X  #t)
X
X(define %gentext-nav-use-tables%
X  #t)
X
X(define %gentext-nav-tblwidth% 
X  "100%")
X
X
X(define %indent-programlisting-lines%
X  "    ")
X
X(define %indent-screen-lines%
X  "    ")
X
X(define %shade-verbatim%  
X  #t)
X
X(define ($shade-verbatim-attr$)
X  (list
X   (list "BORDER" "0")
X   (list "BGCOLOR" "#E0E0E0")
X   (list "WIDTH" ($table-width$))))
X
X(define %callout-default-col% 
X  70)
X
X(define biblio-number
X  #t)
X
X(define %graphic-default-extension% 
X  "jpg")
X
X(define %graphic-extensions% 
X  '("gif" "jpg" "jpeg" "png" "tif" "tiff" "eps" "epsf"))
X
X(define %stylesheet%
X  "/base.css")
X
X(define %stylesheet-type%
X  "text/css")
X
X(define %use-id-as-filename%
X  #t)
X
X(define use-output-dir
X  #t)
X
X(define %output-dir%
X  "html")
X
X(define %html-ext% 
X  ".html")
X
X(define %root-filename%
X  "index")
X
X(define %html-use-lang-in-filename% 
X  #f)
X
X(define %html40%
X  #t)
X
X(define %fix-para-wrappers%
X  #t)
X
X(define %section-autolabel%
X  #t)
X
X(define (chunk-skip-first-element-list)
X  '())
X
X</style-specification-body>
X</style-specification>
X
X<external-specification id="docbook" document="docbook.dsl">
X
X</style-sheet>
X
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/doc/website.dsl' 'failed'
fi
# ============= libusb-0.1.8/tests/Makefile.am ==============
if test ! -d 'libusb-0.1.8/tests'; then
  $echo $echo_n 'x -' 'libusb-0.1.8/tests: '$echo_c
  if mkdir 'libusb-0.1.8/tests'; then $echo 'created'; else $echo 'failed to create'; fi
fi
if test -f 'libusb-0.1.8/tests/Makefile.am' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/tests/Makefile.am' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/tests/Makefile.am' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/tests/Makefile.am' &&
X
XINCLUDES = -I$(top_srcdir)
X
Xnoinst_PROGRAMS = testlibusb
X
Xtestlibusb_LDADD = $(top_builddir)/libusb.la @OSLIBS@
X
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/tests/Makefile.am' 'failed'
fi
# ============= libusb-0.1.8/tests/Makefile.in ==============
if test -f 'libusb-0.1.8/tests/Makefile.in' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/tests/Makefile.in' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/tests/Makefile.in' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/tests/Makefile.in' &&
X# Makefile.in generated by automake 1.7.8 from Makefile.am.
X# @configure_input@
X
X# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
X# Free Software Foundation, Inc.
X# This Makefile.in is free software; the Free Software Foundation
X# gives unlimited permission to copy and/or distribute it,
X# with or without modifications, as long as this notice is preserved.
X
X# This program is distributed in the hope that it will be useful,
X# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
X# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
X# PARTICULAR PURPOSE.
X
X@SET_MAKE@
X
Xsrcdir = @srcdir@
Xtop_srcdir = @top_srcdir@
XVPATH = @srcdir@
Xpkgdatadir = $(datadir)/@PACKAGE@
Xpkglibdir = $(libdir)/@PACKAGE@
Xpkgincludedir = $(includedir)/@PACKAGE@
Xtop_builddir = ..
X
Xam__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
XINSTALL = @INSTALL@
Xinstall_sh_DATA = $(install_sh) -c -m 644
Xinstall_sh_PROGRAM = $(install_sh) -c
Xinstall_sh_SCRIPT = $(install_sh) -c
XINSTALL_HEADER = $(INSTALL_DATA)
Xtransform = $(program_transform_name)
XNORMAL_INSTALL = :
XPRE_INSTALL = :
XPOST_INSTALL = :
XNORMAL_UNINSTALL = :
XPRE_UNINSTALL = :
XPOST_UNINSTALL = :
Xhost_triplet = @host@
XACLOCAL = @ACLOCAL@
XAMDEP_FALSE = @AMDEP_FALSE@
XAMDEP_TRUE = @AMDEP_TRUE@
XAMTAR = @AMTAR@
XAR = @AR@
XAUTOCONF = @AUTOCONF@
XAUTOHEADER = @AUTOHEADER@
XAUTOMAKE = @AUTOMAKE@
XAWK = @AWK@
XBIGENDIAN = @BIGENDIAN@
XBSD_API = @BSD_API@
XBSD_API_FALSE = @BSD_API_FALSE@
XBSD_API_TRUE = @BSD_API_TRUE@
XBUILD_DOCS_FALSE = @BUILD_DOCS_FALSE@
XBUILD_DOCS_TRUE = @BUILD_DOCS_TRUE@
XCC = @CC@
XCCDEPMODE = @CCDEPMODE@
XCFLAGS = @CFLAGS@
XCPP = @CPP@
XCPPFLAGS = @CPPFLAGS@
XCXX = @CXX@
XCXXCPP = @CXXCPP@
XCXXDEPMODE = @CXXDEPMODE@
XCXXFLAGS = @CXXFLAGS@
XCYGPATH_W = @CYGPATH_W@
XDARWIN_API = @DARWIN_API@
XDARWIN_API_FALSE = @DARWIN_API_FALSE@
XDARWIN_API_TRUE = @DARWIN_API_TRUE@
XDEFS = @DEFS@
XDEPDIR = @DEPDIR@
XECHO = @ECHO@
XECHO_C = @ECHO_C@
XECHO_N = @ECHO_N@
XECHO_T = @ECHO_T@
XEGREP = @EGREP@
XEXEEXT = @EXEEXT@
XF77 = @F77@
XFFLAGS = @FFLAGS@
XINSTALL_DATA = @INSTALL_DATA@
XINSTALL_PROGRAM = @INSTALL_PROGRAM@
XINSTALL_SCRIPT = @INSTALL_SCRIPT@
XINSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
XJADE = @JADE@
XLDFLAGS = @LDFLAGS@
XLIBOBJS = @LIBOBJS@
XLIBS = @LIBS@
XLIBTOOL = @LIBTOOL@
XLIBUSB_BINARY_AGE = @LIBUSB_BINARY_AGE@
XLIBUSB_INTERFACE_AGE = @LIBUSB_INTERFACE_AGE@
XLIBUSB_MAJOR_VERSION = @LIBUSB_MAJOR_VERSION@
XLIBUSB_MICRO_VERSION = @LIBUSB_MICRO_VERSION@
XLIBUSB_MINOR_VERSION = @LIBUSB_MINOR_VERSION@
XLIBUSB_VERSION = @LIBUSB_VERSION@
XLINUX_API = @LINUX_API@
XLINUX_API_FALSE = @LINUX_API_FALSE@
XLINUX_API_TRUE = @LINUX_API_TRUE@
XLN_S = @LN_S@
XLTLIBOBJS = @LTLIBOBJS@
XLT_AGE = @LT_AGE@
XLT_CURRENT = @LT_CURRENT@
XLT_RELEASE = @LT_RELEASE@
XLT_REVISION = @LT_REVISION@
XMAINT = @MAINT@
XMAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
XMAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
XMAKEINFO = @MAKEINFO@
XOBJEXT = @OBJEXT@
XOSLIBS = @OSLIBS@
XPACKAGE = @PACKAGE@
XPACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
XPACKAGE_NAME = @PACKAGE_NAME@
XPACKAGE_STRING = @PACKAGE_STRING@
XPACKAGE_TARNAME = @PACKAGE_TARNAME@
XPACKAGE_VERSION = @PACKAGE_VERSION@
XPATH_SEPARATOR = @PATH_SEPARATOR@
XRANLIB = @RANLIB@
XSET_MAKE = @SET_MAKE@
XSHELL = @SHELL@
XSTRIP = @STRIP@
XVERSION = @VERSION@
Xac_ct_AR = @ac_ct_AR@
Xac_ct_CC = @ac_ct_CC@
Xac_ct_CXX = @ac_ct_CXX@
Xac_ct_F77 = @ac_ct_F77@
Xac_ct_RANLIB = @ac_ct_RANLIB@
Xac_ct_STRIP = @ac_ct_STRIP@
Xam__fastdepCC_FALSE = @am__fastdepCC_FALSE@
Xam__fastdepCC_TRUE = @am__fastdepCC_TRUE@
Xam__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
Xam__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
Xam__include = @am__include@
Xam__leading_dot = @am__leading_dot@
Xam__quote = @am__quote@
Xbindir = @bindir@
Xbuild = @build@
Xbuild_alias = @build_alias@
Xbuild_cpu = @build_cpu@
Xbuild_os = @build_os@
Xbuild_vendor = @build_vendor@
Xdatadir = @datadir@
Xexec_prefix = @exec_prefix@
Xhost = @host@
Xhost_alias = @host_alias@
Xhost_cpu = @host_cpu@
Xhost_os = @host_os@
Xhost_vendor = @host_vendor@
Xincludedir = @includedir@
Xinfodir = @infodir@
Xinstall_sh = @install_sh@
Xlibdir = @libdir@
Xlibexecdir = @libexecdir@
Xlocalstatedir = @localstatedir@
Xmandir = @mandir@
Xoldincludedir = @oldincludedir@
Xprefix = @prefix@
Xprogram_transform_name = @program_transform_name@
Xsbindir = @sbindir@
Xsharedstatedir = @sharedstatedir@
Xsysconfdir = @sysconfdir@
Xtarget_alias = @target_alias@
X
XINCLUDES = -I$(top_srcdir)
X
Xnoinst_PROGRAMS = testlibusb
X
Xtestlibusb_LDADD = $(top_builddir)/libusb.la @OSLIBS@
Xsubdir = tests
XACLOCAL_M4 = $(top_srcdir)/aclocal.m4
Xmkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
XCONFIG_HEADER = $(top_builddir)/config.h
XCONFIG_CLEAN_FILES =
Xnoinst_PROGRAMS = testlibusb$(EXEEXT)
XPROGRAMS = $(noinst_PROGRAMS)
X
Xtestlibusb_SOURCES = testlibusb.c
Xtestlibusb_OBJECTS = testlibusb.$(OBJEXT)
Xtestlibusb_DEPENDENCIES = $(top_builddir)/libusb.la
Xtestlibusb_LDFLAGS =
X
XDEFAULT_INCLUDES =  -I. -I$(srcdir) -I$(top_builddir)
Xdepcomp = $(SHELL) $(top_srcdir)/depcomp
Xam__depfiles_maybe = depfiles
X@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/testlibusb.Po
XCOMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
X	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
XLTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
X	$(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
XCCLD = $(CC)
XLINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
X	$(AM_LDFLAGS) $(LDFLAGS) -o $@
XDIST_SOURCES = testlibusb.c
XDIST_COMMON = $(srcdir)/Makefile.in Makefile.am
XSOURCES = testlibusb.c
X
Xall: all-am
X
X.SUFFIXES:
X.SUFFIXES: .c .lo .o .obj
X$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am  $(top_srcdir)/configure.in $(ACLOCAL_M4)
X	cd $(top_srcdir) && \
X	  $(AUTOMAKE) --gnu  tests/Makefile
XMakefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in  $(top_builddir)/config.status
X	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
X
Xclean-noinstPROGRAMS:
X	@list='$(noinst_PROGRAMS)'; for p in $$list; do \
X	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
X	  echo " rm -f $$p $$f"; \
X	  rm -f $$p $$f ; \
X	done
Xtestlibusb$(EXEEXT): $(testlibusb_OBJECTS) $(testlibusb_DEPENDENCIES) 
X	@rm -f testlibusb$(EXEEXT)
X	$(LINK) $(testlibusb_LDFLAGS) $(testlibusb_OBJECTS) $(testlibusb_LDADD) $(LIBS)
X
Xmostlyclean-compile:
X	-rm -f *.$(OBJEXT) core *.core
X
Xdistclean-compile:
X	-rm -f *.tab.c
X
X@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testlibusb.Po@am__quote@
X
X.c.o:
X@am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
X@am__fastdepCC_TRUE@	  -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
X@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
X@am__fastdepCC_TRUE@	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
X@am__fastdepCC_TRUE@	fi
X@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
X@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
X@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
X@am__fastdepCC_FALSE@	$(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
X
X.c.obj:
X@am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
X@am__fastdepCC_TRUE@	  -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
X@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
X@am__fastdepCC_TRUE@	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
X@am__fastdepCC_TRUE@	fi
X@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
X@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
X@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
X@am__fastdepCC_FALSE@	$(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
X
X.c.lo:
X@am__fastdepCC_TRUE@	if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
X@am__fastdepCC_TRUE@	  -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
X@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \
X@am__fastdepCC_TRUE@	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
X@am__fastdepCC_TRUE@	fi
X@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
X@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
X@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
X@am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
X
Xmostlyclean-libtool:
X	-rm -f *.lo
X
Xclean-libtool:
X	-rm -rf .libs _libs
X
Xdistclean-libtool:
X	-rm -f libtool
Xuninstall-info-am:
X
XETAGS = etags
XETAGSFLAGS =
X
XCTAGS = ctags
XCTAGSFLAGS =
X
Xtags: TAGS
X
XID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
X	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
X	unique=`for i in $$list; do \
X	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
X	  done | \
X	  $(AWK) '    { files[$$0] = 1; } \
X	       END { for (i in files) print i; }'`; \
X	mkid -fID $$unique
X
XTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
X		$(TAGS_FILES) $(LISP)
X	tags=; \
X	here=`pwd`; \
X	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
X	unique=`for i in $$list; do \
X	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
X	  done | \
X	  $(AWK) '    { files[$$0] = 1; } \
X	       END { for (i in files) print i; }'`; \
X	test -z "$(ETAGS_ARGS)$$tags$$unique" \
X	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
X	     $$tags $$unique
X
Xctags: CTAGS
XCTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
X		$(TAGS_FILES) $(LISP)
X	tags=; \
X	here=`pwd`; \
X	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
X	unique=`for i in $$list; do \
X	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
X	  done | \
X	  $(AWK) '    { files[$$0] = 1; } \
X	       END { for (i in files) print i; }'`; \
X	test -z "$(CTAGS_ARGS)$$tags$$unique" \
X	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
X	     $$tags $$unique
X
XGTAGS:
X	here=`$(am__cd) $(top_builddir) && pwd` \
X	  && cd $(top_srcdir) \
X	  && gtags -i $(GTAGS_ARGS) $$here
X
Xdistclean-tags:
X	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
XDISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
X
Xtop_distdir = ..
Xdistdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
X
Xdistdir: $(DISTFILES)
X	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
X	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
X	list='$(DISTFILES)'; for file in $$list; do \
X	  case $$file in \
X	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
X	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
X	  esac; \
X	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
X	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
X	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
X	    dir="/$$dir"; \
X	    $(mkinstalldirs) "$(distdir)$$dir"; \
X	  else \
X	    dir=''; \
X	  fi; \
X	  if test -d $$d/$$file; then \
X	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
X	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
X	    fi; \
X	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
X	  else \
X	    test -f $(distdir)/$$file \
X	    || cp -p $$d/$$file $(distdir)/$$file \
X	    || exit 1; \
X	  fi; \
X	done
Xcheck-am: all-am
Xcheck: check-am
Xall-am: Makefile $(PROGRAMS)
X
Xinstalldirs:
Xinstall: install-am
Xinstall-exec: install-exec-am
Xinstall-data: install-data-am
Xuninstall: uninstall-am
X
Xinstall-am: all-am
X	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
X
Xinstallcheck: installcheck-am
Xinstall-strip:
X	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
X	  INSTALL_STRIP_FLAG=-s \
X	  `test -z '$(STRIP)' || \
X	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
Xmostlyclean-generic:
X
Xclean-generic:
X
Xdistclean-generic:
X	-rm -f $(CONFIG_CLEAN_FILES)
X
Xmaintainer-clean-generic:
X	@echo "This command is intended for maintainers to use"
X	@echo "it deletes files that may require special tools to rebuild."
Xclean: clean-am
X
Xclean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
X	mostlyclean-am
X
Xdistclean: distclean-am
X	-rm -rf ./$(DEPDIR)
X	-rm -f Makefile
Xdistclean-am: clean-am distclean-compile distclean-generic \
X	distclean-libtool distclean-tags
X
Xdvi: dvi-am
X
Xdvi-am:
X
Xinfo: info-am
X
Xinfo-am:
X
Xinstall-data-am:
X
Xinstall-exec-am:
X
Xinstall-info: install-info-am
X
Xinstall-man:
X
Xinstallcheck-am:
X
Xmaintainer-clean: maintainer-clean-am
X	-rm -rf ./$(DEPDIR)
X	-rm -f Makefile
Xmaintainer-clean-am: distclean-am maintainer-clean-generic
X
Xmostlyclean: mostlyclean-am
X
Xmostlyclean-am: mostlyclean-compile mostlyclean-generic \
X	mostlyclean-libtool
X
Xpdf: pdf-am
X
Xpdf-am:
X
Xps: ps-am
X
Xps-am:
X
Xuninstall-am: uninstall-info-am
X
X.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
X	clean-libtool clean-noinstPROGRAMS ctags distclean \
X	distclean-compile distclean-generic distclean-libtool \
X	distclean-tags distdir dvi dvi-am info info-am install \
X	install-am install-data install-data-am install-exec \
X	install-exec-am install-info install-info-am install-man \
X	install-strip installcheck installcheck-am installdirs \
X	maintainer-clean maintainer-clean-generic mostlyclean \
X	mostlyclean-compile mostlyclean-generic mostlyclean-libtool pdf \
X	pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am
X
X# Tell versions [3.59,3.63) of GNU make to not export all variables.
X# Otherwise a system limit (for SysV at least) may be exceeded.
X.NOEXPORT:
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/tests/Makefile.in' 'failed'
fi
# ============= libusb-0.1.8/tests/testlibusb.c ==============
if test -f 'libusb-0.1.8/tests/testlibusb.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'libusb-0.1.8/tests/testlibusb.c' '(file already exists)'
else
  $echo 'x -' extracting 'libusb-0.1.8/tests/testlibusb.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'libusb-0.1.8/tests/testlibusb.c' &&
X/*
X * testlibusb.c
X *
X *  Test suite program
X */
X
X#include <stdio.h>
X#include <stdlib.h>
X#include <usb.h>
X
X#if 0
Xvoid print_endpoint(struct usb_endpoint_descriptor *endpoint)
X{
X  printf("      bEndpointAddress: %02xh\n", endpoint->bEndpointAddress);
X  printf("      bmAttributes:     %02xh\n", endpoint->bmAttributes);
X  printf("      wMaxPacketSize:   %d\n", endpoint->wMaxPacketSize);
X  printf("      bInterval:        %d\n", endpoint->bInterval);
X  printf("      bRefresh:         %d\n", endpoint->bRefresh);
X  printf("      bSynchAddress:    %d\n", endpoint->bSynchAddress);
X}
X
Xvoid print_altsetting(struct usb_interface_descriptor *interface)
X{
X  int i;
X
X  printf("    bInterfaceNumber:   %d\n", interface->bInterfaceNumber);
X  printf("    bAlternateSetting:  %d\n", interface->bAlternateSetting);
X  printf("    bNumEndpoints:      %d\n", interface->bNumEndpoints);
X  printf("    bInterfaceClass:    %d\n", interface->bInterfaceClass);
X  printf("    bInterfaceSubClass: %d\n", interface->bInterfaceSubClass);
X  printf("    bInterfaceProtocol: %d\n", interface->bInterfaceProtocol);
X  printf("    iInterface:         %d\n", interface->iInterface);
X
X  for (i = 0; i < interface->bNumEndpoints; i++)
X    print_endpoint(&interface->endpoint[i]);
X}
X
Xvoid print_interface(struct usb_interface *interface)
X{
X  int i;
X
X  for (i = 0; i < interface->num_altsetting; i++)
X    print_altsetting(&interface->altsetting[i]);
X}
X
Xvoid print_configuration(struct usb_config_descriptor *config)
X{
X  int i;
X
X  printf("  wTotalLength:         %d\n", config->wTotalLength);
X  printf("  bNumInterfaces:       %d\n", config->bNumInterfaces);
X  printf("  bConfigurationValue:  %d\n", config->bConfigurationValue);
X  printf("  iConfiguration:       %d\n", config->iConfiguration);
X  printf("  bmAttributes:         %02xh\n", config->bmAttributes);
X  printf("  MaxPower:             %d\n", config->MaxPower);
X
X  for (i = 0; i < config->bNumInterfaces; i++)
X    print_interface(&config->interface[i]);
X}
X#endif
X
Xint main(int argc, const char** argv)
X{
X  struct usb_bus *bus;
X  struct usb_device *dev;
X  char * endptr;
X
X  unsigned vendorId;
X  unsigned productId;
X
X  if (argc <= 2)
X  {
X    fprintf(stderr,"Usage: listusb [vendorId] [productId]\n");
X    exit(2);
X  }
X
X // long int strtol(const char *nptr, char **endptr, int base);
X  vendorId=strtol(argv[1],&endptr, 0);
X  if (*endptr)
X  {
X    fprintf(stderr,"Usage: listusb [vendorId] [productId]\n");
X    exit(2);
X  }
X
X  productId=strtol(argv[2],&endptr, 0);
X  if (*endptr)
X  {
X    fprintf(stderr,"Usage: listusb [vendorId] [productId]\n");
X    exit(2);
X  }
X
X  usb_init();
X
X  usb_find_busses();
X  usb_find_devices();
X
X#if 0
X  printf("bus/device  idVendor/idProduct\n");
X#endif
X
X  for (bus = usb_busses; bus; bus = bus->next) {
X    for (dev = bus->devices; dev; dev = dev->next) {
X#if 0
X      int ret, i;
X      char string[256];
X      usb_dev_handle *udev;
X#endif
X
X      if (dev->descriptor.idVendor == vendorId &&
X          dev->descriptor.idProduct == productId) {
X        printf("%s/%s\n", bus->dirname, dev->filename);
X      }
X
X#if 0
X      udev = usb_open(dev);
X      if (udev) {
X        if (dev->descriptor.iManufacturer) {
X          ret = usb_get_string_simple(udev, dev->descriptor.iManufacturer, string, sizeof(string));
X          if (ret > 0)
X            printf("- Manufacturer : %s\n", string);
X          else
X            printf("- Unable to fetch manufacturer string\n");
X        }
X
X        if (dev->descriptor.iProduct) {
X          ret = usb_get_string_simple(udev, dev->descriptor.iProduct, string, sizeof(string));
X          if (ret > 0)
X            printf("- Product      : %s\n", string);
X          else
X            printf("- Unable to fetch product string\n");
X        }
X
X        if (dev->descriptor.iSerialNumber) {
X          ret = usb_get_string_simple(udev, dev->descriptor.iSerialNumber, string, sizeof(string));
X          if (ret > 0)
X            printf("- Serial Number: %s\n", string);
X          else
X            printf("- Unable to fetch serial number string\n");
X        }
X
X	usb_close (udev);
X      }
X
X      if (!dev->config) {
X        printf("  Couldn't retrieve descriptors\n");
X        continue;
X      }
X
X      for (i = 0; i < dev->descriptor.bNumConfigurations; i++)
X        print_configuration(&dev->config[i]);
X#endif
X    }
X  }
X
X  return 0;
X}
X
SHAR_EOF
  : || $echo 'restore of' 'libusb-0.1.8/tests/testlibusb.c' 'failed'
fi
# ============= fxload-2002_04_11/COPYING ==============
if test ! -d 'fxload-2002_04_11'; then
  $echo $echo_n 'x -' 'fxload-2002_04_11: '$echo_c
  if mkdir 'fxload-2002_04_11'; then $echo 'created'; else $echo 'failed to create'; fi
fi
if test -f 'fxload-2002_04_11/COPYING' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'fxload-2002_04_11/COPYING' '(file already exists)'
else
  $echo 'x -' extracting 'fxload-2002_04_11/COPYING' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'fxload-2002_04_11/COPYING' &&
X		    GNU GENERAL PUBLIC LICENSE
X		       Version 2, June 1991
X
X Copyright (C) 1989, 1991 Free Software Foundation, Inc.
X                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
X Everyone is permitted to copy and distribute verbatim copies
X of this license document, but changing it is not allowed.
X
X			    Preamble
X
X  The licenses for most software are designed to take away your
Xfreedom to share and change it.  By contrast, the GNU General Public
XLicense is intended to guarantee your freedom to share and change free
Xsoftware--to make sure the software is free for all its users.  This
XGeneral Public License applies to most of the Free Software
XFoundation's software and to any other program whose authors commit to
Xusing it.  (Some other Free Software Foundation software is covered by
Xthe GNU Library General Public License instead.)  You can apply it to
Xyour programs, too.
X
X  When we speak of free software, we are referring to freedom, not
Xprice.  Our General Public Licenses are designed to make sure that you
Xhave the freedom to distribute copies of free software (and charge for
Xthis service if you wish), that you receive source code or can get it
Xif you want it, that you can change the software or use pieces of it
Xin new free programs; and that you know you can do these things.
X
X  To protect your rights, we need to make restrictions that forbid
Xanyone to deny you these rights or to ask you to surrender the rights.
XThese restrictions translate to certain responsibilities for you if you
Xdistribute copies of the software, or if you modify it.
X
X  For example, if you distribute copies of such a program, whether
Xgratis or for a fee, you must give the recipients all the rights that
Xyou have.  You must make sure that they, too, receive or can get the
Xsource code.  And you must show them these terms so they know their
Xrights.
X
X  We protect your rights with two steps: (1) copyright the software, and
X(2) offer you this license which gives you legal permission to copy,
Xdistribute and/or modify the software.
X
X  Also, for each author's protection and ours, we want to make certain
Xthat everyone understands that there is no warranty for this free
Xsoftware.  If the software is modified by someone else and passed on, we
Xwant its recipients to know that what they have is not the original, so
Xthat any problems introduced by others will not reflect on the original
Xauthors' reputations.
X
X  Finally, any free program is threatened constantly by software
Xpatents.  We wish to avoid the danger that redistributors of a free
Xprogram will individually obtain patent licenses, in effect making the
Xprogram proprietary.  To prevent this, we have made it clear that any
Xpatent must be licensed for everyone's free use or not licensed at all.
X
X  The precise terms and conditions for copying, distribution and
Xmodification follow.
X
X		    GNU GENERAL PUBLIC LICENSE
X   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
X
X  0. This License applies to any program or other work which contains
Xa notice placed by the copyright holder saying it may be distributed
Xunder the terms of this General Public License.  The "Program", below,
Xrefers to any such program or work, and a "work based on the Program"
Xmeans either the Program or any derivative work under copyright law:
Xthat is to say, a work containing the Program or a portion of it,
Xeither verbatim or with modifications and/or translated into another
Xlanguage.  (Hereinafter, translation is included without limitation in
Xthe term "modification".)  Each licensee is addressed as "you".
X
XActivities other than copying, distribution and modification are not
Xcovered by this License; they are outside its scope.  The act of
Xrunning the Program is not restricted, and the output from the Program
Xis covered only if its contents constitute a work based on the
XProgram (independent of having been made by running the Program).
XWhether that is true depends on what the Program does.
X
X  1. You may copy and distribute verbatim copies of the Program's
Xsource code as you receive it, in any medium, provided that you
Xconspicuously and appropriately publish on each copy an appropriate
Xcopyright notice and disclaimer of warranty; keep intact all the
Xnotices that refer to this License and to the absence of any warranty;
Xand give any other recipients of the Program a copy of this License
Xalong with the Program.
X
XYou may charge a fee for the physical act of transferring a copy, and
Xyou may at your option offer warranty protection in exchange for a fee.
X
X  2. You may modify your copy or copies of the Program or any portion
Xof it, thus forming a work based on the Program, and copy and
Xdistribute such modifications or work under the terms of Section 1
Xabove, provided that you also meet all of these conditions:
X
X    a) You must cause the modified files to carry prominent notices
X    stating that you changed the files and the date of any change.
X
X    b) You must cause any work that you distribute or publish, that in
X    whole or in part contains or is derived from the Program or any
X    part thereof, to be licensed as a whole at no charge to all third
X    parties under the terms of this License.
X
X    c) If the modified program normally reads commands interactively
X    when run, you must cause it, when started running for such
X    interactive use in the most ordinary way, to print or display an
X    announcement including an appropriate copyright notice and a
X    notice that there is no warranty (or else, saying that you provide
X    a warranty) and that users may redistribute the program under
X    these conditions, and telling the user how to view a copy of this
X    License.  (Exception: if the Program itself is interactive but
X    does not normally print such an announcement, your work based on
X    the Program is not required to print an announcement.)
X
XThese requirements apply to the modified work as a whole.  If
Xidentifiable sections of that work are not derived from the Program,
Xand can be reasonably considered independent and separate works in
Xthemselves, then this License, and its terms, do not apply to those
Xsections when you distribute them as separate works.  But when you
Xdistribute the same sections as part of a whole which is a work based
Xon the Program, the distribution of the whole must be on the terms of
Xthis License, whose permissions for other licensees extend to the
Xentire whole, and thus to each and every part regardless of who wrote it.
X
XThus, it is not the intent of this section to claim rights or contest
Xyour rights to work written entirely by you; rather, the intent is to
Xexercise the right to control the distribution of derivative or
Xcollective works based on the Program.
X
XIn addition, mere aggregation of another work not based on the Program
Xwith the Program (or with a work based on the Program) on a volume of
Xa storage or distribution medium does not bring the other work under
Xthe scope of this License.
X
X  3. You may copy and distribute the Program (or a work based on it,
Xunder Section 2) in object code or executable form under the terms of
XSections 1 and 2 above provided that you also do one of the following:
X
X    a) Accompany it with the complete corresponding machine-readable
X    source code, which must be distributed under the terms of Sections
X    1 and 2 above on a medium customarily used for software interchange; or,
X
X    b) Accompany it with a written offer, valid for at least three
X    years, to give any third party, for a charge no more than your
X    cost of physically performing source distribution, a complete
X    machine-readable copy of the corresponding source code, to be
X    distributed under the terms of Sections 1 and 2 above on a medium
X    customarily used for software interchange; or,
X
X    c) Accompany it with the information you received as to the offer
X    to distribute corresponding source code.  (This alternative is
X    allowed only for noncommercial distribution and only if you
X    received the program in object code or executable form with such
X    an offer, in accord with Subsection b above.)
X
XThe source code for a work means the preferred form of the work for
Xmaking modifications to it.  For an executable work, complete source
Xcode means all the source code for all modules it contains, plus any
Xassociated interface definition files, plus the scripts used to
Xcontrol compilation and installation of the executable.  However, as a
Xspecial exception, the source code distributed need not include
Xanything that is normally distributed (in either source or binary
Xform) with the major components (compiler, kernel, and so on) of the
Xoperating system on which the executable runs, unless that component
Xitself accompanies the executable.
X
XIf distribution of executable or object code is made by offering
Xaccess to copy from a designated place, then offering equivalent
Xaccess to copy the source code from the same place counts as
Xdistribution of the source code, even though third parties are not
Xcompelled to copy the source along with the object code.
X
X  4. You may not copy, modify, sublicense, or distribute the Program
Xexcept as expressly provided under this License.  Any attempt
Xotherwise to copy, modify, sublicense or distribute the Program is
Xvoid, and will automatically terminate your rights under this License.
XHowever, parties who have received copies, or rights, from you under
Xthis License will not have their licenses terminated so long as such
Xparties remain in full compliance.
X
X  5. You are not required to accept this License, since you have not
Xsigned it.  However, nothing else grants you permission to modify or
Xdistribute the Program or its derivative works.  These actions are
Xprohibited by law if you do not accept this License.  Therefore, by
Xmodifying or distributing the Program (or any work based on the
XProgram), you indicate your acceptance of this License to do so, and
Xall its terms and conditions for copying, distributing or modifying
Xthe Program or works based on it.
X
X  6. Each time you redistribute the Program (or any work based on the
XProgram), the recipient automatically receives a license from the
Xoriginal licensor to copy, distribute or modify the Program subject to
Xthese terms and conditions.  You may not impose any further
Xrestrictions on the recipients' exercise of the rights granted herein.
XYou are not responsible for enforcing compliance by third parties to
Xthis License.
X
X  7. If, as a consequence of a court judgment or allegation of patent
Xinfringement or for any other reason (not limited to patent issues),
Xconditions are imposed on you (whether by court order, agreement or
Xotherwise) that contradict the conditions of this License, they do not
Xexcuse you from the conditions of this License.  If you cannot
Xdistribute so as to satisfy simultaneously your obligations under this
XLicense and any other pertinent obligations, then as a consequence you
Xmay not distribute the Program at all.  For example, if a patent
Xlicense would not permit royalty-free redistribution of the Program by
Xall those who receive copies directly or indirectly through you, then
Xthe only way you could satisfy both it and this License would be to
Xrefrain entirely from distribution of the Program.
X
XIf any portion of this section is held invalid or unenforceable under
Xany particular circumstance, the balance of the section is intended to
Xapply and the section as a whole is intended to apply in other
Xcircumstances.
X
XIt is not the purpose of this section to induce you to infringe any
Xpatents or other property right claims or to contest validity of any
Xsuch claims; this section has the sole purpose of protecting the
Xintegrity of the free software distribution system, which is
Ximplemented by public license practices.  Many people have made
Xgenerous contributions to the wide range of software distributed
Xthrough that system in reliance on consistent application of that
Xsystem; it is up to the author/donor to decide if he or she is willing
Xto distribute software through any other system and a licensee cannot
Ximpose that choice.
X
XThis section is intended to make thoroughly clear what is believed to
Xbe a consequence of the rest of this License.
X
X  8. If the distribution and/or use of the Program is restricted in
Xcertain countries either by patents or by copyrighted interfaces, the
Xoriginal copyright holder who places the Program under this License
Xmay add an explicit geographical distribution limitation excluding
Xthose countries, so that distribution is permitted only in or among
Xcountries not thus excluded.  In such case, this License incorporates
Xthe limitation as if written in the body of this License.
X
X  9. The Free Software Foundation may publish revised and/or new versions
Xof the General Public License from time to time.  Such new versions will
Xbe similar in spirit to the present version, but may differ in detail to
Xaddress new problems or concerns.
X
XEach version is given a distinguishing version number.  If the Program
Xspecifies a version number of this License which applies to it and "any
Xlater version", you have the option of following the terms and conditions
Xeither of that version or of any later version published by the Free
XSoftware Foundation.  If the Program does not specify a version number of
Xthis License, you may choose any version ever published by the Free Software
XFoundation.
X
X  10. If you wish to incorporate parts of the Program into other free
Xprograms whose distribution conditions are different, write to the author
Xto ask for permission.  For software which is copyrighted by the Free
XSoftware Foundation, write to the Free Software Foundation; we sometimes
Xmake exceptions for this.  Our decision will be guided by the two goals
Xof preserving the free status of all derivatives of our free software and
Xof promoting the sharing and reuse of software generally.
X
X			    NO WARRANTY
X
X  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
XFOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
XOTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
XPROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
XOR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
XMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
XTO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
XPROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
XREPAIR OR CORRECTION.
X
X  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
XWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
XREDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
XINCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
XOUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
XTO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
XYOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
XPROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
XPOSSIBILITY OF SUCH DAMAGES.
X
X		     END OF TERMS AND CONDITIONS
X
X	    How to Apply These Terms to Your New Programs
X
X  If you develop a new program, and you want it to be of the greatest
Xpossible use to the public, the best way to achieve this is to make it
Xfree software which everyone can redistribute and change under these terms.
X
X  To do so, attach the following notices to the program.  It is safest
Xto attach them to the start of each source file to most effectively
Xconvey the exclusion of warranty; and each file should have at least
Xthe "copyright" line and a pointer to where the full notice is found.
X
X    <one line to give the program's name and a brief idea of what it does.>
X    Copyright (C) 19yy  <name of author>
X
X    This program is free software; you can redistribute it and/or modify
X    it under the terms of the GNU General Public License as published by
X    the Free Software Foundation; either version 2 of the License, or
X    (at your option) any later version.
X
X    This program is distributed in the hope that it will be useful,
X    but WITHOUT ANY WARRANTY; without even the implied warranty of
X    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X    GNU General Public License for more details.
X
X    You should have received a copy of the GNU General Public License
X    along with this program; if not, write to the Free Software
X    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
X
X
XAlso add information on how to contact you by electronic and paper mail.
X
XIf the program is interactive, make it output a short notice like this
Xwhen it starts in an interactive mode:
X
X    Gnomovision version 69, Copyright (C) 19yy name of author
X    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
X    This is free software, and you are welcome to redistribute it
X    under certain conditions; type `show c' for details.
X
XThe hypothetical commands `show w' and `show c' should show the appropriate
Xparts of the General Public License.  Of course, the commands you use may
Xbe called something other than `show w' and `show c'; they could even be
Xmouse-clicks or menu items--whatever suits your program.
X
XYou should also get your employer (if you work as a programmer) or your
Xschool, if any, to sign a "copyright disclaimer" for the program, if
Xnecessary.  Here is a sample; alter the names:
X
X  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
X  `Gnomovision' (which makes passes at compilers) written by James Hacker.
X
X  <signature of Ty Coon>, 1 April 1989
X  Ty Coon, President of Vice
X
XThis General Public License does not permit incorporating your program into
Xproprietary programs.  If your program is a subroutine library, you may
Xconsider it more useful to permit linking proprietary applications with the
Xlibrary.  If this is what you want to do, use the GNU Library General
XPublic License instead of this License.
SHAR_EOF
  : || $echo 'restore of' 'fxload-2002_04_11/COPYING' 'failed'
fi
# ============= fxload-2002_04_11/ezusb.c ==============
if test -f 'fxload-2002_04_11/ezusb.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'fxload-2002_04_11/ezusb.c' '(file already exists)'
else
  $echo 'x -' extracting 'fxload-2002_04_11/ezusb.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'fxload-2002_04_11/ezusb.c' &&
X/*
X * Copyright (c) 2001 Stephen Williams (steve@icarus.com)
X * Copyright (c) 2001-2002 David Brownell (dbrownell@users.sourceforge.net)
X *
X *    This source code is free software; you can redistribute it
X *    and/or modify it in source code form under the terms of the GNU
X *    General Public License as published by the Free Software
X *    Foundation; either version 2 of the License, or (at your option)
X *    any later version.
X *
X *    This program is distributed in the hope that it will be useful,
X *    but WITHOUT ANY WARRANTY; without even the implied warranty of
X *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X *    GNU General Public License for more details.
X *
X *    You should have received a copy of the GNU General Public License
X *    along with this program; if not, write to the Free Software
X *    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
X */
X#ident "$Id: ezusb.c,v 1.2 2005/05/10 11:09:30 mtsirkin Exp $"
X
X# include  <stdio.h>
X# include  <errno.h>
X# include  <assert.h>
X# include  <limits.h>
X# include  <stdlib.h>
X# include  <string.h>
X
X# include  <sys/ioctl.h>
X
X# include  <linux/version.h>
X# include  <linux/types.h>
X# include  <linux/usb.h>
X# include  <linux/usbdevice_fs.h>
X
X# include "ezusb.h"
X
X/*
X * This file contains functions for downloading firmware into Cypress
X * EZ-USB microcontrollers. These chips use control endpoint 0 and vendor
X * specific commands to support writing into the on-chip SRAM. They also
X * support writing into the CPUCS register, which is how we reset the
X * processor after loading firmware (including the reset vector).
X *
X * A second stage loader must be used when writing to off-chip memory,
X * or when downloading firmare into the bootstrap I2C EEPROM which may
X * be available in some hardware configurations.
X *
X * These Cypress devices are 8-bit 8051 based microcontrollers with
X * special support for USB I/O.  They come in several packages, and
X * some can be set up with external memory when device costs allow.
X * Note that the design was originally by AnchorChips, so you may find
X * references to that vendor (which was later merged into Cypress).
X * The Cypress FX parts are largely compatible with the Anchorhip ones.
X */
X
Xint verbose;
X
X/*
X * return true iff [addr,addr+len) includes external RAM
X * for Anchorchips EZ-USB or Cypress EZ-USB FX
X */
Xstatic int fx_is_external (unsigned short addr, size_t len)
X{
X    /* with 8KB RAM, 0x0000-0x1b3f can be written
X     * we can't tell if it's a 4KB device here
X     */
X    if (addr <= 0x1b3f)
X	return ((addr + len) > 0x1b40);
X
X    /* there may be more RAM; unclear if we can write it.
X     * some bulk buffers may be unused, 0x1b3f-0x1f3f
X     * firmware can set ISODISAB for 2KB at 0x2000-0x27ff
X     */
X    return 1;
X}
X
X/*
X * return true iff [addr,addr+len) includes external RAM
X * for Cypress EZ-USB FX2
X */
Xstatic int fx2_is_external (unsigned short addr, size_t len)
X{
X    /* 1st 8KB for data/code, 0x0000-0x1fff */
X    if (addr <= 0x1fff)
X	return ((addr + len) > 0x2000);
X
X    /* and 512 for data, 0xe000-0xe1ff */
X    else if (addr >= 0xe000 && addr <= 0xe1ff)
X	return ((addr + len) > 0xe200);
X
X    /* otherwise, it's certainly external */
X    else
X	return 1;
X}
X
X/*****************************************************************************/
X
X#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,3)
X/*
X * in 2.5, "struct usbdevfs_ctrltransfer" fields were renamed
X * to match the USB spec
X */
X#	define bRequestType	requesttype
X#	define bRequest		request
X#	define wValue		value
X#	define wIndex		index
X#	define wLength		length
X#endif
X
X/*
X * Issue a control request to the specified device.
X * This is O/S specific ...
X */
Xstatic inline int ctrl_msg (
X    int					device,
X    unsigned char			requestType,
X    unsigned char			request,
X    unsigned short			value,
X    unsigned short			index,
X    unsigned char			*data,
X    size_t				length
X) {
X    struct usbdevfs_ctrltransfer	ctrl;
X
X    if (length > USHRT_MAX) {
X	fputs ("length too big", stderr);
X	return -EINVAL;
X    }
X
X    /* 8 bytes SETUP */
X    ctrl.bRequestType = requestType;
X    ctrl.bRequest = request;
X    ctrl.wValue   = value;
X    ctrl.wLength  = (unsigned short) length;
X    ctrl.wIndex = index;
X
X    /* "length" bytes DATA */
X    ctrl.data = data;
X
X    ctrl.timeout = 10000;
X
X    return ioctl (device, USBDEVFS_CONTROL, &ctrl);
X}
X
X
X/*
X * These are the requests (bRequest) that the bootstrap loader is expected
X * to recognize.  The codes are reserved by Cypress, and these values match
X * what EZ-USB hardware, or "Vend_Ax" firmware (2nd stage loader) uses.
X * Cypress' "a3load" is nice because it supports both FX and FX2, although
X * it doesn't have the EEPROM support (subset of "Vend_Ax").
X */
X#define RW_INTERNAL	0xA0		/* hardware implements this one */
X#define RW_EEPROM	0xA2
X#define RW_MEMORY	0xA3
X#define GET_EEPROM_SIZE	0xA5
X
X
X/*
X * Issues the specified vendor-specific read request.
X */
Xstatic int ezusb_read (
X    int					device,
X    char				*label,
X    unsigned char			opcode,
X    unsigned short			addr,
X    unsigned char			*data,
X    size_t				len
X) {
X    int					status;
X
X    if (verbose)
X	fprintf (stderr, "%s, addr 0x%04x len %4d (0x%04x)\n",
X		label, addr, len, len);
X    status = ctrl_msg (device,
X	USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, opcode,
X	addr, 0,
X	data, len);
X    if (status != len) {
X	if (status < 0)
X	    perror (label);
X	else
X	    fprintf (stderr, "%s ==> %d\n", label, status);
X    }
X    return status;
X}
X
X/*
X * Issues the specified vendor-specific write request.
X */
Xstatic int ezusb_write (
X    int					device,
X    char				*label,
X    unsigned char			opcode,
X    unsigned short			addr,
X    const unsigned char			*data,
X    size_t				len
X) {
X    int					status;
X
X    if (verbose)
X	fprintf (stderr, "%s, addr 0x%04x len %4d (0x%04x)\n",
X		label, addr, len, len);
X    status = ctrl_msg (device,
X	USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, opcode,
X	addr, 0,
X	(unsigned char *) data, len);
X    if (status != len) {
X	if (status < 0)
X	    perror (label);
X	else
X	    fprintf (stderr, "%s ==> %d\n", label, status);
X    }
X    return status;
X}
X
X/*
X * Modifies the CPUCS register to stop or reset the CPU.
X * Returns false on error.
X */
Xstatic int ezusb_cpucs (
X    int			device,
X    unsigned short	addr,
X    int			doRun
X) {
X    int			status;
X    unsigned char	data = doRun ? 0 : 1;
X
X    if (verbose)
X	fprintf (stderr, "%s\n", data ? "stop CPU" : "reset CPU");
X    status = ctrl_msg (device,
X	USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
X	RW_INTERNAL,
X	addr, 0,
X	&data, 1);
X    if (status != 1) {
X	char *mesg = "can't modify CPUCS";
X	if (status < 0)
X	    perror (mesg);
X	else
X	    fprintf (stderr, "%s\n", mesg);
X	return 0;
X    } else
X	return 1;
X}
X
X/*
X * Returns the size of the EEPROM (assuming one is present).
X * *data == 0 means it uses 8 bit addresses (or there is no EEPROM),
X * *data == 1 means it uses 16 bit addresses
X */
Xstatic inline int ezusb_get_eeprom_type (int fd, unsigned char *data)
X{
X    return ezusb_read (fd, "get EEPROM size", GET_EEPROM_SIZE, 0, data, 1);
X}
X
X/*****************************************************************************/
X
X/*
X * Parse an Intel HEX image file and invoke the poke() function on the
X * various segments to implement policies such as writing to RAM (with
X * a one or two stage loader setup, depending on the firmware) or to
X * EEPROM (two stages required).
X *
X * image	- the hex image file
X * context	- for use by poke()
X * is_external	- if non-null, used to check which segments go into
X *		  external memory (writable only by software loader)
X * poke		- called with each memory segment; errors indicated
X *		  by returning negative values.
X *
X * Caller is responsible for halting CPU as needed, such as when
X * overwriting a second stage loader.
X */
Xint parse_ihex (
X    FILE	*image,
X    void	*context,
X    int		(*is_external)(unsigned short addr, size_t len),
X    int 	(*poke) (void *context, unsigned short addr, int external,
X		      const unsigned char *data, size_t len)
X)
X{
X    unsigned char	data [1023];
X    unsigned short	data_addr = 0;
X    size_t		data_len = 0;
X    int			rc;
X    int			first_line = 1;
X    int			external = 0;
X
X    /* Read the input file as an IHEX file, and report the memory segments
X     * as we go.  Each line holds a max of 16 bytes, but downloading is
X     * faster (and EEPROM space smaller) if we merge those lines into larger
X     * chunks.  Most hex files keep memory segments together, which makes
X     * such merging all but free.  (But it may still be worth sorting the
X     * hex files to make up for undesirable behavior from tools.)
X     *
X     * Note that EEPROM segments max out at 1023 bytes; the download protocol
X     * allows segments of up to 64 KBytes (more than a loader could handle).
X     */
X    for (;;) {
X	char 		buf [512], *cp;
X	char		tmp, type;
X	size_t		len;
X	unsigned	idx, off;
X
X	cp = fgets(buf, sizeof buf, image);
X	if (cp == 0) {
X	    fprintf (stderr, "EOF without EOF record!\n");
X	    break;
X	}
X
X	/* EXTENSION: "# comment-till-end-of-line", for copyrights etc */
X	if (buf[0] == '#')
X	    continue;
X
X	if (buf[0] != ':') {
X	    fprintf (stderr, "not an ihex record: %s", buf);
X	    return -2;
X	}
X
X	if (verbose >= 3) {
X	    cp = strchr (buf, '\n');
X	    if (cp)
X		*cp = 0;
X	    fprintf (stderr, "** LINE: %s\n", buf);
X	}
X
X	/* Read the length field (up to 16 bytes) */
X	tmp = buf[3];
X	buf[3] = 0;
X	len = strtoul(buf+1, 0, 16);
X	buf[3] = tmp;
X
X	/* Read the target offset (address up to 64KB) */
X	tmp = buf[7];
X	buf[7] = 0;
X	off = strtoul(buf+3, 0, 16);
X	buf[7] = tmp;
X
X	/* Initialize data_addr */
X	if (first_line) {
X	    data_addr = off;
X	    first_line = 0;
X	}
X
X	/* Read the record type */
X	tmp = buf[9];
X	buf[9] = 0;
X	type = strtoul(buf+7, 0, 16);
X	buf[9] = tmp;
X
X	/* If this is an EOF record, then make it so. */
X	if (type == 1) {
X	    if (verbose >= 2)
X		fprintf (stderr, "EOF on hexfile\n");
X	    break;
X	}
X
X	if (type != 0) {
X	    fprintf (stderr, "unsupported record type: %u\n", type);
X	    return -3;
X	}
X
X	if ((len * 2) + 11 >= strlen(buf)) {
X	    fprintf (stderr, "record too short?\n");
X	    return -4;
X	}
X
X	// FIXME check for _physically_ contiguous not just virtually
X	// e.g. on FX2 0x1f00-0x2100 includes both on-chip and external
X	// memory so it's not really contiguous
X
X	/* flush the saved data if it's not contiguous,
X	 * or when we've buffered as much as we can.
X	 */
X	if (data_len != 0
X		    && (off != (data_addr + data_len)
X			// || !merge
X			|| (data_len + len) > sizeof data)) {
X	    if (is_external)
X		external = is_external (data_addr, data_len);
X	    rc = poke (context, data_addr, external, data, data_len);
X	    if (rc < 0)
X		return -1;
X	    data_addr = off;
X	    data_len = 0;
X	}
X
X	/* append to saved data, flush later */
X	for (idx = 0, cp = buf+9 ;  idx < len ;  idx += 1, cp += 2) {
X	    tmp = cp[2];
X	    cp[2] = 0;
X	    data [data_len + idx] = strtoul(cp, 0, 16);
X	    cp[2] = tmp;
X	}
X	data_len += len;
X    }
X
X
X    /* flush any data remaining */
X    if (data_len != 0) {
X	if (is_external)
X	    external = is_external (data_addr, data_len);
X	rc = poke (context, data_addr, external, data, data_len);
X	if (rc < 0)
X	    return -1;
X    }
X    return 0;
X}
X
X
X/*****************************************************************************/
X
X/*
X * For writing to RAM using a first (hardware) or second (software)
X * stage loader and 0xA0 or 0xA3 vendor requests
X */
Xtypedef enum {
X    _undef = 0,
X    internal_only,		/* hardware first-stage loader */
X    skip_internal,		/* first phase, second-stage loader */
X    skip_external		/* second phase, second-stage loader */
X} ram_mode;
X
Xstruct ram_poke_context {
X    int		device;
X    ram_mode	mode;
X    unsigned	total, count;
X};
X
X# define RETRY_LIMIT 5
X
Xstatic int ram_poke (
X    void		*context,
X    unsigned short	addr,
X    int			external,
X    const unsigned char	*data,
X    size_t		len
X) {
X    struct ram_poke_context	*ctx = context;
X    int			rc;
X    unsigned		retry = 0;
X
X    switch (ctx->mode) {
X    case internal_only:		/* CPU should be stopped */
X	if (external) {
X	    fprintf (stderr, "can't write %d bytes external memory at 0x%04x\n",
X		len, addr);
X	    return -EINVAL;
X	}
X	break;
X    case skip_internal:		/* CPU must be running */
X	if (!external) {
X	    if (verbose >= 2) {
X		fprintf (stderr, "SKIP on-chip RAM, %d bytes at 0x%04x\n",
X		    len, addr);
X	    }
X	    return 0;
X	}
X	break;
X    case skip_external:		/* CPU should be stopped */
X	if (external) {
X	    if (verbose >= 2) {
X		fprintf (stderr, "SKIP external RAM, %d bytes at 0x%04x\n",
X		    len, addr);
X	    }
X	    return 0;
X	}
X	break;
X    default:
X	fprintf (stderr, "bug\n");
X	return -EDOM;
X    }
X
X    ctx->total += len;
X    ctx->count++;
X
X    /* Retry this till we get a real error. Control messages are not
X     * NAKed (just dropped) so time out means is a real problem.
X     */
X    while ((rc = ezusb_write (ctx->device,
X		    external ? "write external" : "write on-chip",
X		    external ? RW_MEMORY : RW_INTERNAL,
X		    addr, data, len)) < 0
X		&& retry < RETRY_LIMIT) {
X	  if (errno != ETIMEDOUT)
X		break;
X	  retry += 1;
X    }
X    return (rc < 0) ? -errno : 0;
X}
X
X/*
X * Load an Intel HEX file into target RAM. The fd is the open "usbfs"
X * device, and the path is the name of the source file. Open the file,
X * parse the bytes, and write them in one or two phases.
X *
X * If stage == 0, this uses the first stage loader, built into EZ-USB
X * hardware but limited to writing on-chip memory or CPUCS.  Everything
X * is written during one stage, unless there's an error such as the image
X * holding data that needs to be written to external memory.
X *
X * Otherwise, things are written in two stages.  First the external
X * memory is written, expecting a second stage loader to have already
X * been loaded.  Then file is re-parsed and on-chip memory is written.
X */
Xint ezusb_load_ram (int fd, const char *path, int fx2, int stage)
X{
X    FILE			*image;
X    unsigned short		cpucs_addr;
X    int				(*is_external)(unsigned short off, size_t len);
X    struct ram_poke_context	ctx;
X    int				status;
X
X    image = fopen (path, "r");
X    if (image == 0) {
X	fprintf (stderr, "%s: unable to open for input.\n", path);
X	return -2;
X    } else if (verbose)
X	fprintf (stderr, "open RAM hexfile image %s\n", path);
X
X    /* EZ-USB original/FX and FX2 devices differ, apart from the 8051 core */
X    if (fx2) {
X	cpucs_addr = 0xe600;
X	is_external = fx2_is_external;
X    } else {
X	cpucs_addr = 0x7f92;
X	is_external = fx_is_external;
X    }
X
X    /* use only first stage loader? */
X    if (!stage) {
X	ctx.mode = internal_only;
X
X	/* don't let CPU run while we overwrite its code/data */
X	if (!ezusb_cpucs (fd, cpucs_addr, 0))
X	    return -1;
X
X    /* 2nd stage, first part? loader was already downloaded */
X    } else {
X	ctx.mode = skip_internal;
X
X	/* let CPU run; overwrite the 2nd stage loader later */
X	if (verbose)
X	    fprintf (stderr, "2nd stage:  write external memory\n");
X    }
X    
X    /* scan the image, first (maybe only) time */
X    ctx.device = fd;
X    ctx.total = ctx.count = 0;
X    status = parse_ihex (image, &ctx, is_external, ram_poke);
X    if (status < 0) {
X	fprintf (stderr, "unable to download %s\n", path);
X	return status;
X    }
X
X    /* second part of 2nd stage: rescan */
X    if (stage) {
X	ctx.mode = skip_external;
X
X	/* don't let CPU run while we overwrite the 1st stage loader */
X	if (!ezusb_cpucs (fd, cpucs_addr, 0))
X	    return -1;
X
X	/* at least write the interrupt vectors (at 0x0000) for reset! */
X	rewind (image);
X	if (verbose)
X	    fprintf (stderr, "2nd stage:  write on-chip memory\n");
X	status = parse_ihex (image, &ctx, is_external, ram_poke);
X	if (status < 0) {
X	    fprintf (stderr, "unable to completely download %s\n", path);
X	    return status;
X	}
X    }
X
X    if (verbose)
X	fprintf (stderr, "... WROTE: %d bytes, %d segments, avg %d\n",
X	    ctx.total, ctx.count, ctx.total / ctx.count);
X	
X    /* now reset the CPU so it runs what we just downloaded */
X    if (!ezusb_cpucs (fd, cpucs_addr, 1))
X	return -1;
X
X    return 0;
X}
X
X/*****************************************************************************/
X
X/*
X * For writing to EEPROM using a 2nd stage loader
X */
Xstruct eeprom_poke_context {
X    int			device;
X    unsigned short	ee_addr;	/* next free address */
X    int			last;
X};
X
Xstatic int eeprom_poke (
X    void		*context,
X    unsigned short	addr,
X    int			external,
X    const unsigned char	*data,
X    size_t		len
X) {
X    struct eeprom_poke_context	*ctx = context;
X    int			rc;
X    unsigned char	header [4];
X
X    if (external) {
X	fprintf (stderr,
X	    "EEPROM can't init %d bytes external memory at 0x%04x\n",
X	    len, addr);
X	return -EINVAL;
X    }
X
X    if (len > 1023) {
X	fprintf (stderr, "not fragmenting %d bytes\n", len);
X	return -EDOM;
X    }
X
X    /* NOTE:  No retries here.  They don't seem to be needed;
X     * could be added if that changes.
X     */
X
X    /* write header */
X    header [0] = len >> 8;
X    header [1] = len;
X    header [2] = addr >> 8;
X    header [3] = addr;
X    if (ctx->last)
X	header [0] |= 0x80;
X    if ((rc = ezusb_write (ctx->device, "write EEPROM segment header",
X		    RW_EEPROM,
X		    ctx->ee_addr, header, 4)) < 0)
X	return rc;
X
X    /* write code/data */
X    if ((rc = ezusb_write (ctx->device, "write EEPROM segment",
X		    RW_EEPROM,
X		    ctx->ee_addr + 4, data, len)) < 0)
X	return rc;
X
X    /* next shouldn't overwrite it */
X    ctx->ee_addr += 4 + len;
X
X    return 0;
X}
X
X/*
X * Load an Intel HEX file into target (large) EEPROM, set up to boot from
X * that EEPROM using the specified microcontroller-specific config byte.
X * (Defaults:  FX2 0x08, FX 0x00, AN21xx n/a)
X *
X * Caller must have pre-loaded a second stage loader that knows how
X * to handle the EEPROM write requests.
X */
Xint ezusb_load_eeprom (int dev, const char *path, const char *type, int config)
X{
X    FILE			*image;
X    unsigned short		cpucs_addr;
X    int				(*is_external)(unsigned short off, size_t len);
X    struct eeprom_poke_context	ctx;
X    int				status;
X    unsigned char		value, first_byte;
X
X    if (ezusb_get_eeprom_type (dev, &value) != 1 || value != 1) {
X	fprintf (stderr, "don't see a large enough EEPROM\n");
X	return -1;
X    }
X
X    image = fopen (path, "r");
X    if (image == 0) {
X	fprintf (stderr, "%s: unable to open for input.\n", path);
X	return -2;
X    } else if (verbose)
X	fprintf (stderr, "open EEPROM hexfile image %s\n", path);
X
X    if (verbose)
X	fprintf (stderr, "2nd stage:  write boot EEPROM\n");
X
X    /* EZ-USB family devices differ, apart from the 8051 core */
X    if (strcmp ("fx2", type) == 0) {
X	first_byte = 0xC2;
X	cpucs_addr = 0xe600;
X	is_external = fx2_is_external;
X	ctx.ee_addr = 8;
X	config &= 0x4f;
X	fprintf (stderr,
X	    "FX2:  config = 0x%02x, %sconnected, I2C = %d KHz\n",
X	    config,
X	    (config & 0x40) ? "dis" : "",
X		// NOTE:  old chiprevs let CPU clock speed be set
X		// or cycle inverted here.  You shouldn't use those.
X		// (Silicon revs B, C?  Rev E is nice!)
X	    (config & 0x01) ? 400 : 100
X	    );
X
X    } else if (strcmp ("fx", type) == 0) {
X	first_byte = 0xB6;
X	cpucs_addr = 0x7f92;
X	is_external = fx_is_external;
X	ctx.ee_addr = 9;
X	config &= 0x07;
X	fprintf (stderr,
X	    "FX:  config = 0x%02x, %d MHz%s, I2C = %d KHz\n",
X	    config,
X	    ((config & 0x04) ? 48 : 24),
X	    (config & 0x02) ? " inverted" : "",
X	    (config & 0x01) ? 400 : 100
X	    );
X
X    } else if (strcmp ("an21", type) == 0) {
X	first_byte = 0xB2;
X	cpucs_addr = 0x7f92;
X	is_external = fx_is_external;
X	ctx.ee_addr = 7;
X	config = 0;
X	fprintf (stderr, "AN21xx:  no EEPROM config byte\n");
X
X    } else {
X	fprintf (stderr, "?? Unrecognized microcontroller type %s ??\n", type);
X	return -1;
X    }
X
X    /* make sure the EEPROM won't be used for booting,
X     * in case of problems writing it
X     */
X    value = 0x00;
X    status = ezusb_write (dev, "mark EEPROM as unbootable",
X	    RW_EEPROM, 0, &value, sizeof value);
X    if (status < 0)
X	return status;
X
X    /* scan the image, write to EEPROM */
X    ctx.device = dev;
X    ctx.last = 0;
X    status = parse_ihex (image, &ctx, is_external, eeprom_poke);
X    if (status < 0) {
X	fprintf (stderr, "unable to write EEPROM %s\n", path);
X	return status;
X    }
X
X    /* append a reset command */
X    value = 0;
X    ctx.last = 1;
X    status = eeprom_poke (&ctx, cpucs_addr, 0, &value, sizeof value);
X    if (status < 0) {
X	fprintf (stderr, "unable to append reset to EEPROM %s\n", path);
X	return status;
X    }
X
X    /* write the config byte for FX, FX2 */
X    if (strcmp ("an21", type) != 0) {
X	value = config;
X	status = ezusb_write (dev, "write config byte",
X		RW_EEPROM, 7, &value, sizeof value);
X	if (status < 0)
X	    return status;
X    }
X    
X    /* EZ-USB FX has a reserved byte */
X    if (strcmp ("fx", type) == 0) {
X	value = 0;
X	status = ezusb_write (dev, "write reserved byte",
X		RW_EEPROM, 8, &value, sizeof value);
X	if (status < 0)
X	    return status;
X    }
X
X    /* make the EEPROM say to boot from this EEPROM */
X    status = ezusb_write (dev, "write EEPROM type byte",
X	    RW_EEPROM, 0, &first_byte, sizeof first_byte);
X    if (status < 0)
X	return status;
X
X    /* Note:  VID/PID/version aren't written.  They should be
X     * written if the EEPROM type is modified (to B4 or C0).
X     */
X
X    return 0;
X}
X
X/*
X * $Log: ezusb.c,v $
X * Revision 1.2  2005/05/10 11:09:30  mtsirkin
X * fix compilation on suse 9.3
X *
X * Revision 1.1  2004/05/27 12:31:36  mtsirkin
X * fxload 2002_04_11
X *
X * Revision 1.7  2002/04/12 00:25:58  dbrownell
X * - support older AnchorChips style EEPROMs too
X * - minor bugfix for config byte mask in FX
X *
X * Revision 1.6  2002/04/02 08:34:16  dbrownell
X * minor stuff:
X * - don't assume last segment in file is always internal
X * - tweak diagnostics for easier matchup to 8051 linker maps
X * - minor comment/format updates
X *
X * Revision 1.5  2002/02/26 20:06:31  dbrownell
X * - Rewrite for 2nd stage loader support, so this can write
X *   to external RAM and (given the right loader) EEPROM.
X * - Handle usbfs API changes in Linux kernel 2.5.
X * - A "more verbose" option.
X *
X * Revision 1.4  2002/01/17 14:47:44  dbrownell
X * init first line, remove warnings
X *
X * Revision 1.3  2001/12/27 17:59:33  dbrownell
X * merge adjacent hex records, and optionally show writes
X *
X * Revision 1.2  2001/12/14 11:24:04  dbrownell
X * Add sanity check: reject requests to load off-chip memory,
X * The EZ-USB devices just fail silently in these cases.
X *
X * Revision 1.1  2001/06/12 00:00:50  stevewilliams
X *  Added the fxload program.
X *  Rework root makefile and hotplug.spec to install in prefix
X *  location without need of spec file for install.
X *
X */
X
SHAR_EOF
  : || $echo 'restore of' 'fxload-2002_04_11/ezusb.c' 'failed'
fi
# ============= fxload-2002_04_11/main.c ==============
if test -f 'fxload-2002_04_11/main.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'fxload-2002_04_11/main.c' '(file already exists)'
else
  $echo 'x -' extracting 'fxload-2002_04_11/main.c' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'fxload-2002_04_11/main.c' &&
X/*
X * Copyright (c) 2001 Stephen Williams (steve@icarus.com)
X * Copyright (c) 2001-2002 David Brownell (dbrownell@users.sourceforge.net)
X *
X *    This source code is free software; you can redistribute it
X *    and/or modify it in source code form under the terms of the GNU
X *    General Public License as published by the Free Software
X *    Foundation; either version 2 of the License, or (at your option)
X *    any later version.
X *
X *    This program is distributed in the hope that it will be useful,
X *    but WITHOUT ANY WARRANTY; without even the implied warranty of
X *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X *    GNU General Public License for more details.
X *
X *    You should have received a copy of the GNU General Public License
X *    along with this program; if not, write to the Free Software
X *    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
X */
X#ident "$Id: main.c,v 1.1 2004/05/27 12:31:36 mtsirkin Exp $"
X
X/*
X * This program supports loading firmware into a target USB device
X * that is discovered and referenced by the hotplug usb agent. It can
X * also do other useful things, like set the permissions of the device
X * and create a symbolic link for the benefit of applications that are
X * looking for the device.
X *
X *     -I <path>       -- Download this firmware (intel hex)
X *     -t <type>       -- uController type: an21, fx, fx2
X *     -s <path>       -- use this second stage loader
X *     -c <byte>       -- Download to EEPROM, with this config byte
X *
X *     -L <path>       -- Create a symbolic link to the device.
X *     -m <mode>       -- Set the permissions on the device after download.
X *     -D <path>       -- Use this device, instead of $DEVICE
X *
X *     -V              -- Print version ID for program
X *
X * This program is intended to be started by hotplug scripts in
X * response to a device appearing on the bus. It therefore also
X * expects these environment variables which are passed by hotplug to
X * its sub-scripts:
X *
X *     DEVICE=<path>
X *         This is the path to the device is /proc/bus/usb. It is the
X *         complete path to the device, that I can pass to open and
X *         manipulate as a USB device.
X */
X
X# include  <stdlib.h>
X# include  <stdio.h>
X# include  <getopt.h>
X# include  <string.h>
X
X# include  <sys/types.h>
X# include  <sys/stat.h>
X# include  <fcntl.h>
X# include  <unistd.h>
X
X# include  "ezusb.h"
X
X#ifndef	FXLOAD_VERSION
X#	define FXLOAD_VERSION (__DATE__ " (development)")
X#endif
X
Xint main(int argc, char*argv[])
X{
X      const char	*link_path = 0;
X      const char	*ihex_path = 0;
X      const char	*device_path = getenv("DEVICE");
X      const char	*type = 0;
X      const char	*stage1 = 0;
X      mode_t		mode = 0;
X      int		opt;
X      int		config = -1;
X
X      while ((opt = getopt (argc, argv, "2vV?D:I:L:c:m:s:t:")) != EOF)
X      switch (opt) {
X
X	  case '2':		// original version of "-t fx2"
X	    type = "fx2";
X	    break;
X
X	  case 'D':
X	    device_path = optarg;
X	    break;
X
X	  case 'I':
X	    ihex_path = optarg;
X	    break;
X
X	  case 'L':
X	    link_path = optarg;
X	    break;
X
X	  case 'V':
X	    puts (FXLOAD_VERSION);
X	    return 0;
X
X	  case 'c':
X	    config = strtoul (optarg, 0, 0);
X	    if (config < 0 || config > 255) {
X		fputs ("illegal config byte: ", stderr);
X		fputs (optarg, stderr);
X		fputs ("\n", stderr);
X		goto usage;
X	    }
X	    break;
X
X	  case 'm':
X	    mode = strtoul(optarg,0,0);
X	    mode &= 0777;
X	    break;
X
X	  case 's':
X	    stage1 = optarg;
X	    break;
X
X	  case 't':
X	    if (strcmp (optarg, "an21")		// original AnchorChips parts
X		    && strcmp (optarg, "fx")	// updated Cypress versions
X		    && strcmp (optarg, "fx2")	// Cypress USB 2.0 versions
X		    ) {
X		fputs ("illegal microcontroller type: ", stderr);
X		fputs (optarg, stderr);
X		fputs ("\n", stderr);
X		goto usage;
X	    }
X	    type = optarg;
X	    break;
X
X	  case 'v':
X	    verbose++;
X	    break;
X
X	  case '?':
X	  default:
X	    goto usage;
X
X      }
X
X      if (config >= 0) {
X	    if (type == 0) {
X		fputs ("must specify microcontroller type to write EEPROM!\n",
X		    stderr);
X		goto usage;
X	    }
X	    if (!stage1 || !ihex_path) {
X		fputs ("need 2nd stage loader and firmware to write EEPROM!\n",
X		    stderr);
X		goto usage;
X	    }
X	    if (link_path || mode) {
X		fputs ("links and modes not set up when writing EEPROM\n",
X		    stderr);
X		goto usage;
X	    }
X      }
X
X      if (!device_path) {
X	    fputs ("no device specified!\n", stderr);
Xusage:
X	    fputs ("usage: ", stderr);
X	    fputs (argv [0], stderr);
X	    fputs (" [-vV] [-t type] [-D devpath]\n", stderr);
X	    fputs ("\t\t[-I firmware_hexfile] ", stderr);
X	    fputs ("[-s loader] [-c config_byte]\n", stderr);
X	    fputs ("\t\t[-L link] [-m mode]\n", stderr);
X	    fputs ("... [-D devpath] overrides DEVICE= in env\n", stderr);
X	    fputs ("... device types:  one of an21, fx, fx2\n", stderr);
X	    fputs ("... at least one of -I, -L, -m is required\n", stderr);
X	    return -1;
X      }
X
X      if (ihex_path) {
X	    int fd = open(device_path, O_RDWR);
X	    int status;
X	    int	fx2;
X
X	    if (fd == -1) {
X		  perror(device_path);
X		  return -1;
X	    }
X
X	    if (type == 0) {
X	    	type = "fx";	/* an21-compatible for most purposes */
X		fx2 = 0;
X	    } else
X 		fx2 = (strcmp (type, "fx2") == 0);
X	    
X	    if (verbose)
X		fprintf (stderr, "microcontroller type: %s\n", type);
X
X	    if (stage1) {
X		/* first stage:  put loader into internal memory */
X		if (verbose)
X		    fprintf (stderr, "1st stage:  load 2nd stage loader\n");
X		status = ezusb_load_ram (fd, stage1, fx2, 0);
X		if (status != 0)
X		    return status;
X		
X		/* second stage ... write either EEPROM, or RAM.  */
X		if (config >= 0)
X		    status = ezusb_load_eeprom (fd, ihex_path, type, config);
X		else
X		    status = ezusb_load_ram (fd, ihex_path, fx2, 1);
X		if (status != 0)
X		    return status;
X	    } else {
X		/* single stage, put into internal memory */
X		if (verbose)
X		    fprintf (stderr, "single stage:  load on-chip memory\n");
X		status = ezusb_load_ram (fd, ihex_path, fx2, 0);
X		if (status != 0)
X		    return status;
X	    }
X	    
X	    /* some firmware won't renumerate, but typically it will.
X	     * link and chmod only make sense without renumeration...
X	     */
X      }
X
X      if (link_path) {
X	    int rc = unlink(link_path);
X	    rc = symlink(device_path, link_path);
X	    if (rc == -1) {
X		  perror(link_path);
X		  return -1;
X	    }
X      }
X
X      if (mode != 0) {
X	    int rc = chmod(device_path, mode);
X	    if (rc == -1) {
X		  perror(link_path);
X		  return -1;
X	    }
X      }
X
X      if (!ihex_path && !link_path && !mode) {
X	    fputs ("missing request! (firmware, link, or mode)\n", stderr);
X	    return -1;
X      }
X
X      return 0;
X}
X
X
X/*
X * $Log: main.c,v $
X * Revision 1.1  2004/05/27 12:31:36  mtsirkin
X * fxload 2002_04_11
X *
X * Revision 1.7  2002/04/12 00:28:22  dbrownell
X * support "-t an21" to program EEPROMs for those microcontrollers
X *
X * Revision 1.6  2002/04/02 05:26:15  dbrownell
X * version display now noiseless (-V);
X * '-?' (usage info) convention now explicit
X *
X * Revision 1.5  2002/02/26 20:10:28  dbrownell
X * - "-s loader" option for 2nd stage loader
X * - "-c byte" option to write EEPROM with 2nd stage
X * - "-V" option to dump version code
X *
X * Revision 1.4  2002/01/17 14:19:28  dbrownell
X * fix warnings
X *
X * Revision 1.3  2001/12/27 17:54:04  dbrownell
X * forgot an important character :)
X *
X * Revision 1.2  2001/12/27 17:43:29  dbrownell
X * fail on firmware download errors; add "-v" flag
X *
X * Revision 1.1  2001/06/12 00:00:50  stevewilliams
X *  Added the fxload program.
X *  Rework root makefile and hotplug.spec to install in prefix
X *  location without need of spec file for install.
X *
X */
X
SHAR_EOF
  : || $echo 'restore of' 'fxload-2002_04_11/main.c' 'failed'
fi
# ============= fxload-2002_04_11/ezusb.h ==============
if test -f 'fxload-2002_04_11/ezusb.h' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'fxload-2002_04_11/ezusb.h' '(file already exists)'
else
  $echo 'x -' extracting 'fxload-2002_04_11/ezusb.h' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'fxload-2002_04_11/ezusb.h' &&
X#ifndef __ezusb_H
X#define __ezusb_H
X/*
X * Copyright (c) 2001 Stephen Williams (steve@icarus.com)
X * Copyright (c) 2002 David Brownell (dbrownell@users.sourceforge.net)
X *
X *    This source code is free software; you can redistribute it
X *    and/or modify it in source code form under the terms of the GNU
X *    General Public License as published by the Free Software
X *    Foundation; either version 2 of the License, or (at your option)
X *    any later version.
X *
X *    This program is distributed in the hope that it will be useful,
X *    but WITHOUT ANY WARRANTY; without even the implied warranty of
X *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X *    GNU General Public License for more details.
X *
X *    You should have received a copy of the GNU General Public License
X *    along with this program; if not, write to the Free Software
X *    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
X */
X#ident "$Id: ezusb.h,v 1.1 2004/05/27 12:31:36 mtsirkin Exp $"
X
X
X/*
X * This function loads the firmware from the given file into RAM.
X * The file is assumed to be in Intel HEX format.  If fx2 is set, uses
X * appropriate reset commands.  Stage == 0 means this is a single stage
X * load (or the first of two stages).  Otherwise it's the second of
X * two stages; the caller preloaded the second stage loader.
X *
X * The target processor is reset at the end of this download.
X */
Xextern int ezusb_load_ram (int dev, const char *path, int fx2, int stage);
X
X
X/*
X * This function stores the firmware from the given file into EEPROM.
X * The file is assumed to be in Intel HEX format.  This uses the right
X * CPUCS address to terminate the EEPROM load with a reset command,
X * where FX parts behave differently than FX2 ones.  The configuration
X * byte is as provided here (zero for an21xx parts) and the EEPROM
X * type is set so that the microcontroller will boot from it.
X * 
X * The caller must have preloaded a second stage loader that knows
X * how to respond to the EEPROM write request.
X */
Xextern int ezusb_load_eeprom (
X	int dev,		/* usbfs device handle */
X	const char *path,	/* path to hexfile */
X	const char *type,	/* fx, fx2, an21 */
X	int config		/* config byte for fx/fx2; else zero */
X	);
X
X
X/* boolean flag, says whether to write extra messages to stderr */
Xextern int verbose;
X
X
X/*
X * $Log: ezusb.h,v $
X * Revision 1.1  2004/05/27 12:31:36  mtsirkin
X * fxload 2002_04_11
X *
X * Revision 1.3  2002/04/12 00:28:21  dbrownell
X * support "-t an21" to program EEPROMs for those microcontrollers
X *
X * Revision 1.2  2002/02/26 19:55:05  dbrownell
X * 2nd stage loader support
X *
X * Revision 1.1  2001/06/12 00:00:50  stevewilliams
X *  Added the fxload program.
X *  Rework root makefile and hotplug.spec to install in prefix
X *  location without need of spec file for install.
X *
X */
X#endif
SHAR_EOF
  : || $echo 'restore of' 'fxload-2002_04_11/ezusb.h' 'failed'
fi
# ============= fxload-2002_04_11/Makefile ==============
if test -f 'fxload-2002_04_11/Makefile' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'fxload-2002_04_11/Makefile' '(file already exists)'
else
  $echo 'x -' extracting 'fxload-2002_04_11/Makefile' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'fxload-2002_04_11/Makefile' &&
X# $Id: Makefile,v 1.1 2004/05/27 12:31:35 mtsirkin Exp $
X#
X# Builds "fxload" binaries, distribution tarball, and RPMs.
X#
X
Xprefix =		/
Xexec_prefix =		${prefix}
Xsbindir =		${exec_prefix}/sbin
Xmandir =		${prefix}/usr/share/man
X
XINSTALL =		/usr/bin/install -cD
XINSTALL_PROGRAM =	${INSTALL}
X
XPROG = 			fxload
X
XCFLAGS =		-O -Wall $(RPM_OPT_FLAGS)
X
XFILES_SRC_C =		ezusb.c main.c
XFILES_SRC_H =		ezusb.h
XFILES_SRC_OTHER =	README.txt COPYING Makefile fxload.8 a3load.hex
XFILES_SRC =		$(FILES_SRC_OTHER) $(FILES_SRC_H) $(FILES_SRC_C)
X
XFILES_OBJ =		$(FILES_SRC_C:%.c=%.o)
X
XREV =			$(shell date "+%Y_%m_%d"| awk '{print $$1}')
XRELEASE_NAME =		$(PROG)-$(REV)
X
X
X
X# the interesting targets
X# NOTE:  the default build ("make all") labels itself as a
X# development build ("fxload -V" output)
Xall: $(PROG)
X
Xrelease:	rpms
X	@echo FILES FOR RELEASE $(RELEASE_NAME)
X	@find * -name '*.rpm' -o -name '*.gz' | grep $(RELEASE_NAME)
X
X
X# object files
X$(PROG): $(FILES_OBJ)
X	$(CC) -o $(PROG) $(FILES_OBJ)
X
X%.o: %.c
X	$(CC) -c $(CFLAGS)  $< -o $@
Xmain.o: main.c ezusb.h
Xezusb.o: ezusb.c ezusb.h
X
X
X# different degrees of clean ...
X#	FIXME:  shouldn't assume only x86 RPMs get built
Xmrproper:	clean
X	rm -f $(PROG)-*.tar.gz
X	rm -f  $(PROG)-*.spec $(PROG)-*.src.rpm
X	rm -rf i386 $(PROG)-* build
Xclean:
X	rm -f Log *.o *~ $(PROG)
X
X
X# install, from tarball or for binary RPM
Xinstall: $(PROG)
X	$(INSTALL_PROGRAM) $(PROG) $(sbindir)/$(PROG)
X	$(INSTALL_PROGRAM) -m 0644 $(PROG).8 $(mandir)/man8/$(PROG).8
X	$(INSTALL_PROGRAM) -m 0644 a3load.hex $(prefix)/usr/share/usb/a3load.hex
X
X
X# make a source tarball
Xtarball: $(RELEASE_NAME).tar.gz
X
X$(RELEASE_NAME).tar.gz: clean
X	@rm -rf $(RELEASE_NAME)
X	@mkdir $(RELEASE_NAME)
X	@for file in $(FILES_SRC); do			\
X		cp $$file $(RELEASE_NAME)/$$file;	\
X		chmod 0644 $(RELEASE_NAME)/$$file;	\
X		done
X	@tar cfz $(RELEASE_NAME).tar.gz $(RELEASE_NAME)
X	@rm -rf $(RELEASE_NAME)
X	@echo "TARBALL:  $(RELEASE_NAME).tar.gz"
X
X# make source and binary RPMs
X# you don't need to be root to do this, just to install
Xrpms:	tarball
X	@rm -rf $(RELEASE_NAME).spec build $(RELEASE_NAME)
X	@sed "s/VERCODE/$(REV)/" < $(PROG).spec > $(RELEASE_NAME).spec
X	@mkdir build
X	rpm --define "_srcrpmdir $(PWD)" --define "_rpmdir $(PWD)" \
X		--define "_sourcedir $(PWD)" \
X		--define "_builddir $(PWD)/build" \
X		-ba --clean --buildroot=$(PWD)/$(RELEASE_NAME) \
X		$(RELEASE_NAME).spec
X	@rm -rf $(RELEASE_NAME).spec build $(RELEASE_NAME)
X	@echo ''
X
SHAR_EOF
  : || $echo 'restore of' 'fxload-2002_04_11/Makefile' 'failed'
fi
# ============= fxload-2002_04_11/README.txt ==============
if test -f 'fxload-2002_04_11/README.txt' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'fxload-2002_04_11/README.txt' '(file already exists)'
else
  $echo 'x -' extracting 'fxload-2002_04_11/README.txt' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'fxload-2002_04_11/README.txt' &&
X
XFXLOAD UTILITY
X
XThis program is conveniently able to download firmware into FX and FX2
XEZ-USB devices, as well as the original AnchorChips EZ-USB.  It is
Xintended to be invoked by hotplug scripts when the unprogrammed device
Xappears on the bus.
X
XPrimarily as an aid for developers, this can also be used to update
Xfirmware on devices which boot from I2C serial EEPROMs.  For that
Xuse, as well as downloading firmware to all other off-chip memory,
Xa second stage loader must first be downloaded.
X
XThe distribution includes "a3load.hex", which is a simple second stage
Xloader that works with all the EZ-USB products listed above.  If you
Xwant to write to an EEPROM, you can use the appropriate version of the
X"Vend_Ax" code provided with the Cypress developer kit.
X
X
XUPDATES
X
XSee the download page at http://linux-hotplug.sourceforge.net for the
Xlatest release.  The CVS repository there holds the most current version
Xof this software.  The web site shows some ways to use "fxload" in
Xconjunction with USB hotplugging, to load device firmware.
X
XPost any bug reports to the linux-hotplug-devel or linux-usb-devel lists.
X
XIf you modify the code, the GPL requires that you make your updates
Xgenerally available (under most circumstances).  Providing them in the
Xform of patches against the current CVS ("cvs diff -u"), or the last
Xrelease ("diff -u old new") is most useful, since otherwise it's awkward
Xto integrate such changes into the standard distribution.
X
X$Id: README.txt,v 1.1 2004/05/27 12:31:35 mtsirkin Exp $
SHAR_EOF
  : || $echo 'restore of' 'fxload-2002_04_11/README.txt' 'failed'
fi
# ============= fxload-2002_04_11/fxload.8 ==============
if test -f 'fxload-2002_04_11/fxload.8' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'fxload-2002_04_11/fxload.8' '(file already exists)'
else
  $echo 'x -' extracting 'fxload-2002_04_11/fxload.8' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'fxload-2002_04_11/fxload.8' &&
X.\" fxload.8
X.\" Created: Fri Dec 28 2001 by David Brownell
X.\" Copyright (c) 2001-2002 David Brownell <dbrownell@users.sourceforge.net>
X.\" 
X.\" Permission is granted to make and distribute verbatim copies of this
X.\" manual provided the copyright notice and this permission notice are
X.\" preserved on all copies.
X.\" 
X.\" Permission is granted to copy and distribute modified versions of this
X.\" manual under the conditions for verbatim copying, provided that the
X.\" entire resulting derived work is distributed under the terms of a
X.\" permission notice identical to this one
X.\" 
X.\" Since the Linux kernel and libraries are constantly changing, this
X.\" manual page may be incorrect or out-of-date.  The author(s) assume no
X.\" responsibility for errors or omissions, or for damages resulting from
X.\" the use of the information contained herein.  The author(s) may not
X.\" have taken the same level of care in the production of this manual,
X.\" which is licensed free of charge, as they might when working
X.\" professionally.
X.\" 
X.\" Formatted or processed versions of this manual, if unaccompanied by
X.\" the source, must acknowledge the copyright and authors of this work.
X.\" 
X.TH FXLOAD 8 "April 2002" "" "Linux Programmer's Manual"
X.SH "NAME"
Xfxload \- Firmware download to EZ-USB devices
X.SH "SYNOPSIS"
X.B fxload
X.BI "[ \-v ]"
X.BI "[ \-D " devpath " ]"
X.BI "[ \-I " hexfile " ]"
X.BI "[ \-t " type " ]"
X.BI "[ \-c " config " ]"
X.BI "[ \-s " loader " ]"
X.br
X.B fxload
X.BI "[ \-D " devpath " ]"
X.BI "[ \-L " link " ]"
X.BI "[ \-m " mode " ]"
X.br
X.B fxload
X.BI "[ \-V ]"
X.SH "DESCRIPTION"
X.B fxload
Xis a program which downloads firmware to USB devices based on
XAnchorChips EZ-USB, Cypress EZ-USB FX,
Xor Cypress EZ-USB FX2 microcontrollers.
XThese have 8-bit 8051 cores with special extensions for USB I/O.
XThe FX2 supports high speed USB 2.0 transfers (480 Mbit/sec)
Xas well as full speed USB 1.1 transfers (12 Mbit/sec),
Xwhile the earlier parts supports only full speed transfers.
XThese controllers have several package options,
Xand can be set up with external memory (on-chip memory is
Xusually about 8K), EEPROMs, and ROMs when device costs allow.
X.PP
XThis uses "usbfs" (older name:  "usbdevfs") to access
Xdevices, and issues vendor specific control requests
Xto download and reset the EZ-USB devices.
XNormally, firmware will then "renumerate" by disconnecting from
XUSB and then reconnecting as a new device.
XIt then appears with new device descriptors and functionality,
Xas provided by the firmware which has been downloaded.
X.PP
XTo support some non-firmware applications, this can also set
Xup symbolic links for those usbfs names.
XIt can also change their access modes.
XBoth of these can help simplify software applications that
Xneed to talk to USB devices using user mode drivers,
Xdon't want to run with privileges or to examine all of the
Xexisting USB devices,
Xand which don't need more kernel drivers.
X.PP
XSee the
X.I Linux-Hotplug
Xweb site for information about how to use
X.B fxload
Xto download device firmware when hotplugging USB devices,
Xusing driver-specific scripts stored in the
X.I /etc/hotplug/usb
Xdirectory.
X.SH "FUNCTION LETTERS"
XAt least one of the following options must be specified.
XNote that as usual with UNIX and Linux commands,
Xthe order of command option flags does not matter.
XYou may use these in any order.
X.TP
X.BI "\-I " hexfile
XDownloads the specified firmware file.
XThis firmware is provided in standard Intel hexfile format.
X(Common naming conventions include
X.I *.hex
Xand
X.IR *.ihx .)
XDepending on the device and firmware in use, the
X.B \-s
Xoption may also be necessary to specify a second stage loader.
XFirmware is normally downloaded to RAM and executed, but there
Xis also an option for downloading into bootable I2C EEPROMs.
X.TP
X.BI "\-L " link
XCreates the specified symbolic link to the usbfs device path.
XThis would typically be used to create a name in a directory
Xthat would be searched by an application.
XThe symlink would be removed by some other component on device unplug.
X.TP
X.BI "\-m " mode
XChanges permissions on the "usbfs" device node.
XBy default, those nodes are only accessible by privileged
Xusers, which doesn't help when the user mode device driver
Xneeds to run without root privileges.
XNote that usbfs mount options like
X.I devmode=0666
Xare also available.
X.TP
X.B "\-V"
XIdentifies the version of fxload being invoked, and exits
Xwithout performing other actions.
X.PP
XNote that when downloading firmware that renumerates,
Xthere's no point in changing the device permissions
Xor creating a symbolic link.
X.SH "OPTIONS"
XBy default,
X.B fxload
Xassumes the device uses an EZ-USB or EZ-USB FX.
XIt also assumes that the device in question has been specified
Xby USB kernel hotplugging conventions, using the
X.I DEVICE
Xenvironment variable to name a "usbfs"
Xfile that can be used to talk to the device.
X.TP
X.BI "\-c " config
XIndicates the specified firmware should be downloaded to an
XI2C boot EEPROM rather than to RAM.
XThe parameter is the EZ-USB FX or FX2 configuration byte,
Xand for AnchorChips devices the value should be zero.
XThis requires a second stage loader that knows how to write
Xto I2C EEPROMs specified using the
X.B \-s
Xoption, as well as a device that's provided with an EEPROM
Xlarge enough to store the boot firmware.
XAfter downloading to a device's EEPROM,
Xyou should retest it starting from power off.
X.TP
X.BI "\-s " loader
XThis identifies the hex file holding a second stage loader
X(in the same hex file format as the firmware itself),
Xwhich is loaded into internal memory.
XThis loader understands additional vendor control requests,
Xbeyond the one built into all EZ-USB hardware,
Xwhich are needed to write external RAM or EEPROM.
XAs a last step when loading firmware,
X.B fxload
Xnormally overwrites this second stage loader
Xwith parts of the firmware residing on-chip.
X.TP
X.BI "\-t " type
XIndicates which type of microcontroller is used in the device;
Xtype may be one of
X.I an21
X(the original AnchorChips devices),
X.I fx
X(Cypress' updated version, the EZ-USB FX), or
X.I fx2
X(the Cypress EZ-USB FX2, supporting high speed transfers).
XExcept when writing to EEPROM, all that normally matters when
Xdownloading firmware is whether or not the device uses an FX2.
X.TP
X.B "\-v"
XPrints some diagnostics, such as download addresses and sizes,
Xto standard error.  Repeat the flag
X.RB ( -vv ", " -vvv )
Xto get more diagnostics.
X.TP
X.BI "\-D " devpath
XSpecifies the "usbfs" path name for the device in question,
Xsuch as
X.IR /proc/bus/usb/004/080 .
XThis takes precedence over any
X.I DEVICE
Xenvironment variable that may be set.
X.SH "NOTES"
X.PP
XThis program implements one extension to the standard "hex file" format.
XLines beginning with a "#" character are ignored, and may be used to
Xhold copyright statements and other information.
XOther tools may not handle hexfiles using this extension.
X.PP
XAt this writing, "usbfs" is a kernel configuration option.
XThat means that device drivers relying on user mode firmware
Xdownloading may need to depend on that kernel configuration option.
XA less preferable alternative involves compiling the firmware
Xinto the kernel and managing downloads and renumeration there.
XThis is less preferable in part because much device firmware is
Xprovided with GPL-incompatible licensing, and in part because
Xstoring such firmware firmware wastes kernel memory.
X.PP
XFor EZ-USB family devices, the hardware's first stage loader
X(supporting the 0xA0 vendor request) can't write into external memory.
XConfigurations that put firmware into external memory thus need a
Xsecond stage loader.
XFor typical "flat" memory architectures, a loader supporting the 0xA3
Xvendor request is used to write into that memory.
XSimilarly, a second stage loader that supports the 0xA2 vendor request
Xis needed when writing boot firmware into an I2C EEPROM.
XThese 0xA2 and 0xA3 vendor commands are conventions defined by Cypress.
XDevices that use bank switching or similar mechanisms to stretch the
X64KByte address space may need different approach to loading firmware.
X.PP
XNot all devices support EEPROM updates.
XSome EZ-USB based devices don't have an I2C EEPROM;
Xmany such EEPROMs are too small to store firmware;
Xand some firmware can't be placed in bootable I2C EEPROMs.
X.SH "ENVIRONMENT VARIABLES"
X.TP
X.B DEVICE
Xnormally names a "usbfs" file that will be used to talk to the device.
XThis is provided by the Linux kernel as part of USB hotplugging.
X.SH "FILES"
X.TP
X.I /usr/share/usb/a3load.hex
XSecond stage loader that works with AnchorChips EZ-USB,
XCypress EZ-USB FX, and Cypress EZ-USB FX2.
XNote that this only supports the 0xA3 vendor command, to
Xwrite external memory.
XA loader that also supports the 0xA2 command, to write boot EEPROMs,
Xis included with Cypress developer kits.
X.SH "SEE ALSO"
X.BR hotplug "(8) "
X.SH "AUTHORS"
XLinux Hotplugging Project
X.I http://linux-hotplug.sourceforge.net/
SHAR_EOF
  : || $echo 'restore of' 'fxload-2002_04_11/fxload.8' 'failed'
fi
# ============= fxload-2002_04_11/a3load.hex ==============
if test -f 'fxload-2002_04_11/a3load.hex' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'fxload-2002_04_11/a3load.hex' '(file already exists)'
else
  $echo 'x -' extracting 'fxload-2002_04_11/a3load.hex' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'fxload-2002_04_11/a3load.hex' &&
X#
X# $Id: a3load.hex,v 1.1 2004/05/27 12:31:35 mtsirkin Exp $
X#
X# This file contains "a3load" object code, as found in the Cypress
X# EZ-USB developer kit.  It implements a second stage firmware loader
X# supporting the original EZ-USB parts and the newer FX and FX2 ones,
X# using the 0xA3 vendor request convention.
X#
X# If you want a loader for development use, which can write to the I2C
X# boot EEPROM using the 0xA2 request, see the "Vend_Ax" code provided
X# with the developer kit for your microcontroller.
X#
X#
X# Copyright (c) 2001-2002 by Cypress Semiconductor Corporation
X#
X# Cypress Semiconductor Corporation hereby grants a copyright license to
X# use or redistribute this firmware image, in text or binary form as
X# required, only in conjunction with devices using a Cypress USB
X# microcontroller.  Every copy in any form of the firmware shall include
X# Cypress copyright legends.
X#
X# DISCLAIMERS.
X# THIS FIRMWARE IS LICENSED "AS-IS." CYPRESS MAKES NO WARRANTIES AS TO
X# PERFORMANCE, WHETHER EXPRESS, IMPLIED, OR STATUTORY, IN THIS LICENSE
X# OR COMMUNICATION BETWEEN LICENSEE AND CYPRESS. CYPRESS SPECIFICALLY
X# DISCLAIMS ALL WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
X# BUT NOT LIMITED TO THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS
X# OF THIS PROGRAM FOR A PARTICULAR PURPOSE, WITH RESPECT TO THE
X# FIRMWARE, AND THE USE, OPERATION OR SUPPORT OF THE FIRMWARE.
X# IN NO EVENT SHALL CYPRESS BE LIABLE FOR ANY CONSEQUENTIAL, INDIRECT,
X# INCIDENTAL, PUNITIVE, OR SPECIAL DAMAGES WHATSOEVER, INCLUDING WITHOUT
X# LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS
X# INTERRUPTION, LOSS OF BUSINESS INFORMATION, AND THE LIKE, ARISING OUT
X# OF OR RELATED TO THE FIRMWARE, EVEN IF CYPRESS HAS BEEN ADVISED OF THE
X# POSSIBILITY OF SUCH DAMAGES.
X#
X:1003570090E668E0FF74FFF0E0B40B04EFF0D322FF
X:0603670090E668EFF0C310
X:01036D00226D
X:1001B500907FE9E064A360030202C5A3E07508002F
X:1001C500F509A3E0FEE4EE4208907FEEE0750A0033
X:1001D500F50BA3E0FEE4EE420A907FE8E064407090
X:1001E50064E50B450A70030202D6E4907FC5F090E2
X:1001F5007FB4E020E3F9907FC5E0750C00F50DE4D0
X:10020500FCFDC3ED950DEC950C501F74C02DF582CA
X:10021500E4347EF583E0FFE5092DF582E5083CF53C
X:1002250083EFF00DBD00010C80D8E50D2509F5091A
X:10023500E50C3508F508C3E50B950DF50BE50A95B5
X:100245000CF50A809C907FE8E064C060030202D64A
X:10025500E50B450A607BC3E50B9440E50A94005025
X:1002650008850A0C850B0D8006750C00750D40E49C
X:10027500FCFDC3ED950DEC950C501FE5092DF582A0
X:10028500E5083CF583E0FF74002DF582E4347FF545
X:1002950083EFF00DBD00010C80D8907FB5E50DF022
X:1002A5002509F509E50C3508F508C3E50B950DF5A8
X:1002B5000BE50A950CF50A907FB4E030E29280F7E1
X:1002C500907FE9E0B4AC0AE4907F00F0907FB5043C
X:0802D500F0907FB4E04402F058
X:0102DD0022FE
X:1000800090E6B9E064A36003020198A3E07508005C
X:10009000F509A3E0FEE4EE420890E6BEE0750A0032
X:1000A000F50BA3E0FEE4EE420A90E6B8E06440708F
X:1000B00066E50B450A70030201ADE490E68AF0A301
X:1000C000F090E6A0E020E1F990E68BE0750C00F5F9
X:1000D0000DE4FCFDC3ED950DEC950C501F74402D07
X:1000E000F582E434E7F583E0FFE5092DF582E508C4
X:1000F0003CF583EFF00DBD00010C80D8E50D25091E
X:10010000F509E50C3508F508C3E50B950DF50BE58C
X:100110000A950CF50A809A90E6B8E064C060030284
X:1001200001ADE50B450A70030201ADC3E50B944038
X:10013000E50A94005008850A0C850B0D8006750CA5
X:1001400000750D40E4FCFDC3ED950DEC950C501FC2
X:10015000E5092DF582E5083CF583E0FF74402DF5B7
X:1001600082E434E7F583EFF00DBD00010C80D8E4A4
X:1001700090E68AF0A3E50DF02509F509E50C3508B0
X:10018000F508C3E50B950DF50BE50A950CF50A90FE
X:10019000E6A0E030E18C80F790E6B9E0B4AC0E90D8
X:1001A000E7407401F0E490E68AF0A304F090E6A042
X:0401B000E04480F0B7
X:0101B4002228
X:1002DE00C2011203579200907F95E044C0F0D2E81D
X:1002EE0030000890E6687408F08007907FAFE04415
X:1002FE0001F030000890E65C7401F08006907FAE4D
X:10030E007401F0D2AF3001FD300005120080800381
X:07031E001201B5C20180EEDF
X:03000300020325D0
X:10032500C0E0C083C082C085C084C086758600D207
X:10033500015391EF30000890E65D7401F08006905E
X:100345007FAB7401F0D086D084D085D082D083D0A5
X:02035500E03294
X:03004300020400B4
X:0404000002032500CE
X:0300000002036E8A
X:0C036E00787FE4F6D8FD7581200202DEE5
X:00000001FF
SHAR_EOF
  : || $echo 'restore of' 'fxload-2002_04_11/a3load.hex' 'failed'
fi
# ============= Device-mtcr/Changes ==============
if test ! -d 'Device-mtcr'; then
  $echo $echo_n 'x -' 'Device-mtcr: '$echo_c
  if mkdir 'Device-mtcr'; then $echo 'created'; else $echo 'failed to create'; fi
fi
if test -f 'Device-mtcr/Changes' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'Device-mtcr/Changes' '(file already exists)'
else
  $echo 'x -' extracting 'Device-mtcr/Changes' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'Device-mtcr/Changes' &&
XRevision history for Perl extension Device::mtcr
X
X0.01  Fri May  10 17:05:32 2002
X	- Initial alpha release
X
SHAR_EOF
  : || $echo 'restore of' 'Device-mtcr/Changes' 'failed'
fi
# ============= Device-mtcr/LICENSE ==============
if test -f 'Device-mtcr/LICENSE' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'Device-mtcr/LICENSE' '(file already exists)'
else
  $echo 'x -' extracting 'Device-mtcr/LICENSE' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'Device-mtcr/LICENSE' &&
X                 - Mellanox Confidential and Proprietary -
X
XCopyright (C) March 2002, Mellanox Technologies Ltd. ALL RIGHTS RESERVED.
X
XExcept as specifically permitted herein, no portion of the information,
Xincluding but not limited to object code and source code, may be reproduced,
Xmodified, distributed, republished or otherwise exploited in any form or by
Xany means for any purpose without the prior written permission of Mellanox
XTechnologies Ltd. Use of software subject to the terms and conditions
Xdetailed in the file "LICENSE.txt".
X
SHAR_EOF
  : || $echo 'restore of' 'Device-mtcr/LICENSE' 'failed'
fi
# ============= Device-mtcr/MANIFEST ==============
if test -f 'Device-mtcr/MANIFEST' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'Device-mtcr/MANIFEST' '(file already exists)'
else
  $echo 'x -' extracting 'Device-mtcr/MANIFEST' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'Device-mtcr/MANIFEST' &&
XChanges
XLICENSE
XMANIFEST
XMakefile.PL
XREADME
Xmtcr.h
Xmtcr.pm
Xmtcr.xs
Xtest.pl
SHAR_EOF
  : || $echo 'restore of' 'Device-mtcr/MANIFEST' 'failed'
fi
# ============= Device-mtcr/Makefile.PL ==============
if test -f 'Device-mtcr/Makefile.PL' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'Device-mtcr/Makefile.PL' '(file already exists)'
else
  $echo 'x -' extracting 'Device-mtcr/Makefile.PL' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'Device-mtcr/Makefile.PL' &&
Xuse ExtUtils::MakeMaker;
X# See lib/ExtUtils/MakeMaker.pm for details of how to influence
X# the contents of the Makefile that is written.
XWriteMakefile(
X    'NAME'		=> 'Device::mtcr',
X    'VERSION_FROM'	=> 'mtcr.pm', # finds $VERSION
X    'PREREQ_PM'		=> {}, # e.g., Module::Name => 1.1
X    ($] >= 5.005 ?    ## Add these new keywords supported since 5.005
X      (ABSTRACT_FROM => 'mtcr.pm', # retrieve abstract from module
X       AUTHOR     => 'Victor Kaplansky <victork@mellanox.co.il>') : ()),
X    'LIBS'		=> ['-L.. -lmtcr'], # e.g., '-lm'
X    'DEFINE'		=> '', # e.g., '-DHAVE_SOMETHING'
X	# Insert -I. if you add *.h files later:
X    'INC'		=> '-I.', # e.g., '-I/usr/include/other'
X	# Un-comment this if you add C files to link with later:
X    # 'OBJECT'		=> '$(O_FILES)', # link all the C files too
X);
SHAR_EOF
  : || $echo 'restore of' 'Device-mtcr/Makefile.PL' 'failed'
fi
# ============= Device-mtcr/README ==============
if test -f 'Device-mtcr/README' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'Device-mtcr/README' '(file already exists)'
else
  $echo 'x -' extracting 'Device-mtcr/README' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'Device-mtcr/README' &&
XDevice/mtcr
X===========
X
XThis is a Device::mtcr driver that uses direct IO access on linux. It
Xuses the linux Mellanox Tools Service driver.
XIt also means that you do not require root access.
X
XINSTALLATION
X
XTo install this module type the following:
X
X   perl Makefile.PL
X   make
X   make test
X   make install
X
XDEPENDENCIES
X
XThis module requires these other modules and libraries:
X
X  - do not require other modules
X
SHAR_EOF
  : || $echo 'restore of' 'Device-mtcr/README' 'failed'
fi
# ============= Device-mtcr/mtcr.h ==============
if test -f 'Device-mtcr/mtcr.h' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'Device-mtcr/mtcr.h' '(file already exists)'
else
  $echo 'x -' extracting 'Device-mtcr/mtcr.h' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'Device-mtcr/mtcr.h' &&
X
X/* Simple interface routines to read/write Melanox Devices cr-bus/pci-bus */
X
Xextern int mtcr_opendev(char *dev_name);
Xextern void mtcr_closedev(int dev);
X
Xextern long mtcr_rd_data(int dev, unsigned int addr);
Xextern void mtcr_wr_data(int dev, unsigned int addr, int val);
X
SHAR_EOF
  : || $echo 'restore of' 'Device-mtcr/mtcr.h' 'failed'
fi
# ============= Device-mtcr/mtcr.pm ==============
if test -f 'Device-mtcr/mtcr.pm' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'Device-mtcr/mtcr.pm' '(file already exists)'
else
  $echo 'x -' extracting 'Device-mtcr/mtcr.pm' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'Device-mtcr/mtcr.pm' &&
Xpackage Device::mtcr;
Xuse strict;
Xuse Carp;
X
X=head1 NAME
X
XDevice::mtcr - Linux Kernel 2.2+ Mellanox /usr/mellanox/dev/MT*pci*
X
X=head1 DESCRIPTION
X
XThis program uses the linux /usr/mellanox/dev/MT*pci* devices, which
Xmeans of course that you must have access to that device, which is simply
Xa matter changing permissions for your system, much the same as you
Xwould if you where giving the user access to the sound card (eg: /dev/dsp)
X
X=head1 NOTES
X
XNote that this is a temporary hack for now, full version to come soon...
X
X=head1 COPYRIGHT
X
XCopyright (c) 2002 Mellanox Technologies LTD.
X
X=head1 AUTHOR
X
XVictor Kaplansky L<victork@mellanox.co.il>, L<http://www.mellanox.com>
X
X=head1 SEE ALSO
X
XL<driver/mtcr.[ch] - Mellanox Tools Simple Driver>
X
X=cut
X
Xrequire DynaLoader;
Xour @ISA = qw(DynaLoader);
Xour $VERSION = '0.1';
X
Xbootstrap Device::mtcr $VERSION;
X
X# Standard function to return information from this driver
Xsub INFO {
X	return {
X		'os' => 'linux',
X		'ver' => '>= 2.2',
X		'type' => 'word',
X	};
X}
X
Xsub new {
X    my ($class, $dev_name, $dev_type) = @_;
X    my $this = bless {}, ref($class) || $class;
X    $dev_type ||= "MST_TAVOR";
X    $this->{DATA}->{DEV_NAME} = $dev_name;
X    if (($dev_type ne "MST_TAVOR") && ($dev_type ne "MST_GAMLA"))
X    {
X        croak "device type should be \"MST_TAVOR\" or \"MST_GAMLA\"\n";
X    }
X    $this->{DATA}->{DEV} = mtcr_opendev ($this->{DATA}->{DEV_NAME}, $dev_type);
X    if ($this->{DATA}->{DEV} == 0) {
X        croak "Failed to open " . $this->{DATA}->{DEV_NAME} . "\n"
X              . "try to run `mst [start|restart]' as super-user"
X    }
X    return $this;
X}
X
Xsub set_word {
X    my ($this, $addr, $val) = @_;
X    mtcr_wr_data ($this->{DATA}->{DEV}, $addr, $val);
X}
X
Xsub get_word {
X    my ($this, $addr) = @_;
X    return mtcr_rd_data ($this->{DATA}->{DEV}, $addr);
X}
X
Xsub DESTROY {
X    my ($this) = @_;
X
X    if (defined ($this->{DATA}->{DEV})) {
X        mtcr_closedev ($this->{DATA}->{DEV});
X    }
X}
X
X1;
X
SHAR_EOF
  : || $echo 'restore of' 'Device-mtcr/mtcr.pm' 'failed'
fi
# ============= Device-mtcr/mtcr.xs ==============
if test -f 'Device-mtcr/mtcr.xs' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'Device-mtcr/mtcr.xs' '(file already exists)'
else
  $echo 'x -' extracting 'Device-mtcr/mtcr.xs' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'Device-mtcr/mtcr.xs' &&
X#include "EXTERN.h"
X#include "perl.h"
X#include "XSUB.h"
X
X#include <stdio.h>
X#include <unistd.h>
X#include <fcntl.h>
X#include <errno.h>
X#include <sys/stat.h>
X#include <sys/sysmacros.h>
X#include <../mtcr.h>
X#include <sys/ioctl.h>
X#include <linux/ppdev.h>
X
X#include "mtcr.h"
X
XMODULE = Device::mtcr		PACKAGE = Device::mtcr
X
Xint
Xmtcr_opendev (dev_name, dev_type)
X	char *dev_name
X	char *dev_type
X	CODE:
X		RETVAL = (unsigned long) mopend (dev_name, 
X                                                   (strstr(dev_type, "GAMLA")
X                                                      ? MST_GAMLA
X                                                      : MST_TAVOR));
X	OUTPUT:
X		RETVAL
X
Xvoid
Xmtcr_closedev (dev)
X	unsigned long dev
X	CODE:
X                if (dev) {
X                        mclose ((mfile *) dev);
X                }
X
Xunsigned long
Xmtcr_rd_data(dev, addr)
X	unsigned long dev
X        unsigned int addr
X	CODE:
X		unsigned int value;
X		mread4 ((mfile *) dev, addr, &value);
X		RETVAL = value;
X	OUTPUT:
X		RETVAL
X
Xvoid
Xmtcr_wr_data(dev, addr, value)
X	unsigned long dev
X        unsigned int addr
X        unsigned int value
X	CODE:
X		mwrite4 ((mfile *) dev, addr, value);
SHAR_EOF
  : || $echo 'restore of' 'Device-mtcr/mtcr.xs' 'failed'
fi
# ============= Device-mtcr/test.pl ==============
if test -f 'Device-mtcr/test.pl' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'Device-mtcr/test.pl' '(file already exists)'
else
  $echo 'x -' extracting 'Device-mtcr/test.pl' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'Device-mtcr/test.pl' &&
X#!/usr/bin/perl -w 
X
Xuse lib "/usr/mst/lib/perl5";
Xuse Device::mtcr;
X
X
X######################################
X#       Connect to device
X######################################
X
X
X# $cr = Device::mtcr->new ("/dev/mst/mt23108_pci0_cr");
X$cr = Device::mtcr->new ("/dev/mst/mt23108_pci_cr0");
X
X######################################
X# Insert your code below
X######################################
X
X
X
X# read cr-space 32-bit word
Xprintf "cr[0x2130] = <%08x>\n", $cr->get_word(0x2130);
X
X
X# write 32-bit word to cr-space
X$cr->set_word (0x2130, 0x12345678);
X
SHAR_EOF
  : || $echo 'restore of' 'Device-mtcr/test.pl' 'failed'
fi
# ============= build2.6/Makefile ==============
if test ! -d 'build2.6'; then
  $echo $echo_n 'x -' 'build2.6: '$echo_c
  if mkdir 'build2.6'; then $echo 'created'; else $echo 'failed to create'; fi
fi
if test -f 'build2.6/Makefile' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'build2.6/Makefile' '(file already exists)'
else
  $echo 'x -' extracting 'build2.6/Makefile' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'build2.6/Makefile' &&
Xobj-m :=$(mst_module)
X$(mst_module:.o=)-objs := ../$(mst_module:.o=_mod.o)
SHAR_EOF
  : || $echo 'restore of' 'build2.6/Makefile' 'failed'
fi
$echo $shar_n 'x -' 'lock directory' "\`_sh25994': " $shar_c
if rm -fr _sh25994; then
  $echo 'removed'
else
  $echo 'failed to remove'
fi
exit 0
