[iscsi-initiator-utils: 68/109] Resolves: #715434 #696808

Chris Leech cleech at fedoraproject.org
Tue Dec 10 21:25:06 UTC 2013


commit 3c9800208a82361f01dca781fd82620e2d957459
Author: mchristi <mchristi at redhat.com>
Date:   Mon Aug 15 04:43:53 2011 +0000

    Resolves: #715434 #696808

 iscsi-initiator-utils-add-libiscsi.patch           |  303 +-
 iscsi-initiator-utils-brcm-man.patch               |    8 +-
 iscsi-initiator-utils-dcb.patch                    |  614 -
 iscsi-initiator-utils-disable-crypto.patch         |   39 -
 iscsi-initiator-utils-fix-bnx2i-mac-match.patch    |  114 -
 iscsi-initiator-utils-fix-default-bindings.patch   |  172 +
 iscsi-initiator-utils-fixes.patch                  |   97 -
 ...ils-libiscsi-nodes-remember-the-interface.patch |  168 -
 iscsi-initiator-utils-node-hostname.patch          |  122 -
 iscsi-initiator-utils-sync-brcm-0.6.2.14.patch     |143038 --------------------
 iscsi-initiator-utils-sync-iscsi.patch             | 9047 ++-
 iscsi-initiator-utils-sync-uio-0.7.0.8.patch       |74274 ++++++++++
 ...ator-utils-uio-handle-different-iface_rec.patch |   98 +-
 iscsi-initiator-utils-uip-mgmt.patch               |  125 +-
 ...itiator-utils-update-initscripts-and-docs.patch |   43 +-
 iscsi-initiator-utils-use-var-for-config.patch     |   71 +-
 iscsi-initiator-utils.spec                         |   63 +-
 iscsid.init                                        |    6 +-
 18 files changed, 83119 insertions(+), 145283 deletions(-)
---
diff --git a/iscsi-initiator-utils-add-libiscsi.patch b/iscsi-initiator-utils-add-libiscsi.patch
index 8587363..4b0e16e 100644
--- a/iscsi-initiator-utils-add-libiscsi.patch
+++ b/iscsi-initiator-utils-add-libiscsi.patch
@@ -1,7 +1,7 @@
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/libiscsi.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/libiscsi.c
---- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/libiscsi.c	1969-12-31 18:00:00.000000000 -0600
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/libiscsi.c	2011-01-31 03:00:37.000000000 -0600
-@@ -0,0 +1,580 @@
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/libiscsi.c open-iscsi-2.0-872-rc4-bnx2i.build/libiscsi/libiscsi.c
+--- open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/libiscsi.c	1969-12-31 18:00:00.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.build/libiscsi/libiscsi.c	2011-08-14 16:53:58.000000000 -0500
+@@ -0,0 +1,612 @@
 +/*
 + * iSCSI Administration library
 + *
@@ -98,6 +98,16 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/libiscsi.c open-iscsi-2.0-872-
 +	free(context);
 +}
 +
++static void free_iface_list(struct list_head *ifaces)
++{
++	struct iface_rec *iface, *tmp_iface;
++
++	list_for_each_entry_safe(iface, tmp_iface, ifaces, list) {
++		list_del(&iface->list);
++		free(iface);
++	}
++}
++
 +static void free_rec_list(struct list_head *rec_list)
 +{
 +	struct node_rec *rec, *tmp;
@@ -181,6 +191,8 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/libiscsi.c open-iscsi-2.0-872-
 +			strlcpy((*found_nodes)[found].address,
 +				 rec->conn[0].address, NI_MAXHOST);
 +			(*found_nodes)[found].port = rec->conn[0].port;
++			strlcpy((*found_nodes)[found].iface,
++				 rec->iface.name, LIBISCSI_VALUE_MAXLEN);
 +			found++;
 +		}
 +	}
@@ -193,69 +205,84 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/libiscsi.c open-iscsi-2.0-872-
 +int libiscsi_discover_firmware(struct libiscsi_context *context,
 +	int *nr_found, struct libiscsi_node **found_nodes)
 +{
-+	struct boot_context fw_entry;
-+	struct node_rec rec;
++	struct list_head targets, ifaces, rec_list;
++	discovery_rec_t drec;
 +	int rc = 0;
 +
-+	if (nr_found)
++	INIT_LIST_HEAD(&targets);
++	INIT_LIST_HEAD(&ifaces);
++	INIT_LIST_HEAD(&rec_list);
++
++	if (nr_found) {
 +		*nr_found = 0;
-+	if (found_nodes)
++	}
++
++	if (found_nodes) {
 +		*found_nodes = NULL;
++	}
 +
-+	memset(&fw_entry, 0, sizeof fw_entry);
-+	rc = fw_get_entry(&fw_entry);
++	rc = fw_get_targets(&targets);
 +	if (rc) {
-+		strcpy(context->error_str, "Could not read fw values.");
++		log_error("%s: Could not get list of targets from firmware "
++			  "(err %d).\n", __func__, rc);
 +		return rc;
 +	}
 +
-+	memset(&rec, 0, sizeof rec);
-+	idbm_node_setup_defaults(&rec);
-+
-+	strlcpy(rec.name, fw_entry.targetname, TARGET_NAME_MAXLEN);
-+	rec.tpgt = 1;
-+	strlcpy(rec.conn[0].address, fw_entry.target_ipaddr, NI_MAXHOST);
-+	rec.conn[0].port = fw_entry.target_port;
-+
-+	iface_setup_defaults(&rec.iface);
-+	strncpy(rec.iface.iname, fw_entry.initiatorname,
-+		sizeof(fw_entry.initiatorname));
-+	strncpy(rec.session.auth.username, fw_entry.chap_name,
-+		sizeof(fw_entry.chap_name));
-+	strncpy((char *)rec.session.auth.password, fw_entry.chap_password,
-+		sizeof(fw_entry.chap_password));
-+	strncpy(rec.session.auth.username_in, fw_entry.chap_name_in,
-+		sizeof(fw_entry.chap_name_in));
-+	strncpy((char *)rec.session.auth.password_in,
-+		fw_entry.chap_password_in,
-+		sizeof(fw_entry.chap_password_in));
-+	rec.session.auth.password_length =
-+				strlen((char *)fw_entry.chap_password);
-+	rec.session.auth.password_in_length =
-+				strlen((char *)fw_entry.chap_password_in);
-+
-+	CHECK(idbm_add_node(&rec, NULL, 1 /* overwrite */))
++	CHECK(iface_create_ifaces_from_boot_contexts(&ifaces, &targets));
 +
-+	if (nr_found)
-+		*nr_found = 1;
++	memset(&drec, 0, sizeof(drec));
++	drec.type = DISCOVERY_TYPE_FW;
++	rc = idbm_bind_ifaces_to_nodes(discovery_fw, &drec, &ifaces, &rec_list);
++	if (rc) {
++		log_error("%s: Could not determine target nodes from firmware "
++			  "(err %d).\n", __func__, rc);
++		goto leave;
++	}
++
++	int node_count = 0;
++	struct list_head *pos;
++	list_for_each(pos, &rec_list) {
++		++node_count;
++	}
 +
++	struct libiscsi_node* new_nodes;
++	/* allocate enough space for all the nodes */
++	new_nodes = calloc(node_count, sizeof *new_nodes);
++	if (new_nodes == NULL) {
++		rc = ENOMEM;
++		log_error("%s: %s.\n", __func__, strerror(ENOMEM));
++		goto leave;
++	}
++
++	struct node_rec *rec;
++	struct libiscsi_node *new_node = new_nodes;
++	/* in one loop, add nodes to idbm and create libiscsi_node entries */
++	list_for_each_entry(rec, &rec_list, list) {
++		CHECK(idbm_add_node(rec, NULL, 1 /* overwrite */));
++
++		strlcpy(new_node->name, rec->name, LIBISCSI_VALUE_MAXLEN);
++		new_node->tpgt = rec->tpgt;
++		strlcpy(new_node->address, rec->conn[0].address, NI_MAXHOST);
++		new_node->port = rec->conn[0].port;
++		strlcpy(new_node->iface, rec->iface.name, LIBISCSI_VALUE_MAXLEN);
++
++		++new_node;
++	}
++
++	/* update output parameters */
++	if (nr_found) {
++		*nr_found = node_count;
++	}
 +	if (found_nodes) {
-+		*found_nodes = calloc(1, sizeof **found_nodes);
-+		if (*found_nodes == NULL) {
-+			snprintf(context->error_str,
-+				 sizeof(context->error_str), strerror(ENOMEM));
-+			rc = ENOMEM;
-+			goto leave;
-+		}
-+		strlcpy((*found_nodes)[0].name, rec.name,
-+			 LIBISCSI_VALUE_MAXLEN);
-+		(*found_nodes)[0].tpgt = rec.tpgt;
-+		strlcpy((*found_nodes)[0].address,
-+			 rec.conn[0].address, NI_MAXHOST);
-+		(*found_nodes)[0].port = rec.conn[0].port;
++		*found_nodes = new_nodes;
 +	}
 +
 +leave:
++	fw_free_targets(&targets);
++
++	free_iface_list(&ifaces);
++	free_rec_list(&rec_list);
++
 +	return rc;
 +}
 +
@@ -382,6 +409,11 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/libiscsi.c open-iscsi-2.0-872-
 +
 +int login_helper(void *data, node_rec_t *rec)
 +{
++	char *iface = (char*)data;
++	if (strcmp(iface, rec->iface.name))
++		/* different iface, skip it */
++		return -1;
++
 +	int rc = iscsid_req_by_rec(MGMT_IPC_SESSION_LOGIN, rec);
 +	if (rc) {
 +		iscsi_err_print_msg(rc);
@@ -395,7 +427,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/libiscsi.c open-iscsi-2.0-872-
 +{
 +	int nr_found = 0, rc;
 +
-+	CHECK(idbm_for_each_iface(&nr_found, NULL, login_helper,
++	CHECK(idbm_for_each_iface(&nr_found, (void*)node->iface, login_helper,
 +		(char *)node->name, node->tpgt,
 +		(char *)node->address, node->port))
 +	if (nr_found == 0) {
@@ -582,9 +614,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/libiscsi.c open-iscsi-2.0-872-
 +
 +	return 0;
 +}
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/libiscsi.doxy open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/libiscsi.doxy
---- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/libiscsi.doxy	1969-12-31 18:00:00.000000000 -0600
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/libiscsi.doxy	2011-01-31 02:35:29.000000000 -0600
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/libiscsi.doxy open-iscsi-2.0-872-rc4-bnx2i.build/libiscsi/libiscsi.doxy
+--- open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/libiscsi.doxy	1969-12-31 18:00:00.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.build/libiscsi/libiscsi.doxy	2011-08-14 16:46:24.000000000 -0500
 @@ -0,0 +1,1473 @@
 +# Doxyfile 1.5.7.1
 +
@@ -2059,10 +2091,10 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/libiscsi.doxy open-iscsi-2.0-8
 +# used. If set to NO the values of all tags below this one will be ignored.
 +
 +SEARCHENGINE           = NO
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/libiscsi.h open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/libiscsi.h
---- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/libiscsi.h	1969-12-31 18:00:00.000000000 -0600
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/libiscsi.h	2011-01-31 02:35:29.000000000 -0600
-@@ -0,0 +1,343 @@
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/libiscsi.h open-iscsi-2.0-872-rc4-bnx2i.build/libiscsi/libiscsi.h
+--- open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/libiscsi.h	1969-12-31 18:00:00.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.build/libiscsi/libiscsi.h	2011-08-14 16:53:58.000000000 -0500
+@@ -0,0 +1,344 @@
 +/*
 + * iSCSI Administration library
 + *
@@ -2133,6 +2165,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/libiscsi.h open-iscsi-2.0-872-
 +       get used anywhere, so we keep things simple and assume one connection */
 +    char address[NI_MAXHOST]             /** Portal hostname or IP-address. */;
 +    int port                             /** Portal port number. */;
++    char iface[LIBISCSI_VALUE_MAXLEN]    /** Interface to connect through. */;
 +};
 +
 +/** \brief libiscsi CHAP authentication information struct
@@ -2406,9 +2439,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/libiscsi.h open-iscsi-2.0-872-
 +#endif /* __cplusplus */
 +
 +#endif
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/Makefile open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/Makefile
---- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/Makefile	1969-12-31 18:00:00.000000000 -0600
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/Makefile	2011-01-31 03:03:47.000000000 -0600
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/Makefile open-iscsi-2.0-872-rc4-bnx2i.build/libiscsi/Makefile
+--- open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/Makefile	1969-12-31 18:00:00.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.build/libiscsi/Makefile	2011-08-14 16:46:24.000000000 -0500
 @@ -0,0 +1,61 @@
 +# This Makefile will work only with GNU make.
 +
@@ -2425,7 +2458,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/Makefile open-iscsi-2.0-872-rc
 +
 +COMMON_SRCS = sysdeps.o
 +# sources shared between iscsid, iscsiadm and iscsistart
-+ISCSI_LIB_SRCS = netlink.o transport.o cxgbi.o be2iscsi.o iscsi_timer.o initiator_common.o iscsi_err.o session_info.o iscsi_util.o io.o auth.o discovery.o login.o log.o md5.o sha1.o iface.o idbm.o sysfs.o iscsi_sysfs.o iscsi_net_util.o iscsid_req.o
++ISCSI_LIB_SRCS = netlink.o transport.o cxgbi.o be2iscsi.o iscsi_timer.o initiator_common.o iscsi_err.o session_info.o iscsi_util.o dcb_app.o io.o auth.o discovery.o login.o log.o md5.o sha1.o iface.o idbm.o sysfs.o iscsi_sysfs.o iscsi_net_util.o iscsid_req.o
 +FW_PARAM_SRCS = fw_entry.o prom_lex.o prom_parse.tab.o fwparam_ppc.o fwparam_sysfs.o
 +
 +# sources shared with the userspace utils, note we build these separately
@@ -2471,10 +2504,10 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/Makefile open-iscsi-2.0-872-rc
 +	gcc $(CFLAGS) -M `ls *.c` > .depend
 +
 +-include .depend ../usr/.depend
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/pylibiscsi.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/pylibiscsi.c
---- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/pylibiscsi.c	1969-12-31 18:00:00.000000000 -0600
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/pylibiscsi.c	2011-01-31 02:35:29.000000000 -0600
-@@ -0,0 +1,624 @@
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/pylibiscsi.c open-iscsi-2.0-872-rc4-bnx2i.build/libiscsi/pylibiscsi.c
+--- open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/pylibiscsi.c	1969-12-31 18:00:00.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.build/libiscsi/pylibiscsi.c	2011-08-14 16:53:58.000000000 -0500
+@@ -0,0 +1,638 @@
 +/*
 + * iSCSI Administration library
 + *
@@ -2675,25 +2708,27 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/pylibiscsi.c open-iscsi-2.0-87
 +static int PyIscsiNode_init(PyObject *self, PyObject *args, PyObject *kwds)
 +{
 +	PyIscsiNode *node = (PyIscsiNode *)self;
-+	char *kwlist[] = {"name", "tpgt", "address", "port", NULL};
-+	const char *name = NULL, *address = NULL;
++	char *kwlist[] = {"name", "tpgt", "address", "port", "iface", NULL};
++	const char *name = NULL, *address = NULL, *iface = NULL;
 +	int tpgt = -1, port = 3260;
 +
-+	if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|isi:node.__init__",
-+					kwlist, &name, &tpgt, &address, &port))
++	if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|isis:node.__init__",
++					 kwlist, &name, &tpgt, &address,
++					 &port, &iface))
 +		return -1;
 +	if (address == NULL) {
 +		PyErr_SetString(PyExc_ValueError, "address not set");
 +		return -1;
 +	}
-+	if (check_string(name) || check_string(address))
++	if (check_string(name) || check_string(address) || check_string(iface))
 +		return -1;
 +
 +	strcpy(node->node.name, name);
 +	node->node.tpgt = tpgt;
 +	strcpy(node->node.address, address);
 +	node->node.port = port;
-+	
++	strcpy(node->node.iface, iface);
++
 +	return 0;
 +}
 +
@@ -2710,6 +2745,8 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/pylibiscsi.c open-iscsi-2.0-87
 +		return PyString_FromString(node->node.address);
 +	} else if (!strcmp(attr, "port")) {
 +		return PyInt_FromLong(node->node.port);
++	} else if (!strcmp(attr, "iface")) {
++		return PyString_FromString(node->node.iface);
 +	}
 +	return NULL;
 +}
@@ -2737,6 +2774,10 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/pylibiscsi.c open-iscsi-2.0-87
 +		if (!PyArg_Parse(value, "i", &i))
 +			return -1;
 +		node->node.port = i;
++	} else if (!strcmp(attr, "iface")) {
++		if (!PyArg_Parse(value, "s", &str) || check_string(str))
++			return -1;
++		strcpy(node->node.iface, str);
 +	}
 +
 +	return 0;
@@ -2764,6 +2805,10 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/pylibiscsi.c open-iscsi-2.0-87
 +	if (self->node.port > other->node.port)
 +		return -1;
 +
++	res = strcmp(self->node.iface, other->node.iface);
++	if (res)
++		return res;
++
 +	return 0;
 +}
 +
@@ -2917,6 +2962,8 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/pylibiscsi.c open-iscsi-2.0-87
 +		"address", "address"},
 +	{"port", (getter)PyIscsiNode_get, (setter)PyIscsiNode_set,
 +		"port", "port"},
++	{"iface", (getter)PyIscsiNode_get, (setter)PyIscsiNode_set,
++		"iface", "iface"},
 +	{NULL}
 +};
 +
@@ -3099,9 +3146,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/pylibiscsi.c open-iscsi-2.0-87
 +	Py_INCREF(&PyIscsiNode_Type);
 +	PyModule_AddObject(m, "node", (PyObject *) &PyIscsiNode_Type);
 +}
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/setup.py open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/setup.py
---- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/setup.py	1969-12-31 18:00:00.000000000 -0600
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/setup.py	2011-01-31 02:35:29.000000000 -0600
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/setup.py open-iscsi-2.0-872-rc4-bnx2i.build/libiscsi/setup.py
+--- open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/setup.py	1969-12-31 18:00:00.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.build/libiscsi/setup.py	2011-08-14 16:46:24.000000000 -0500
 @@ -0,0 +1,9 @@
 +from distutils.core import setup, Extension
 +
@@ -3112,9 +3159,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/setup.py open-iscsi-2.0-872-rc
 +
 +setup (name = 'PyIscsi',version = '1.0',
 +       description = 'libiscsi python bindings', ext_modules = [module1])
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_discovery_firmware.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_discovery_firmware.c
---- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_discovery_firmware.c	1969-12-31 18:00:00.000000000 -0600
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_discovery_firmware.c	2011-01-31 02:35:29.000000000 -0600
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_discovery_firmware.c open-iscsi-2.0-872-rc4-bnx2i.build/libiscsi/tests/test_discovery_firmware.c
+--- open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_discovery_firmware.c	1969-12-31 18:00:00.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.build/libiscsi/tests/test_discovery_firmware.c	2011-08-14 16:46:24.000000000 -0500
 @@ -0,0 +1,53 @@
 +/*
 + * iSCSI Administration library
@@ -3169,9 +3216,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_discovery_firmware.
 +
 +	return rc;
 +}
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_discovery_sendtargets.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_discovery_sendtargets.c
---- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_discovery_sendtargets.c	1969-12-31 18:00:00.000000000 -0600
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_discovery_sendtargets.c	2011-01-31 02:35:29.000000000 -0600
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_discovery_sendtargets.c open-iscsi-2.0-872-rc4-bnx2i.build/libiscsi/tests/test_discovery_sendtargets.c
+--- open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_discovery_sendtargets.c	1969-12-31 18:00:00.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.build/libiscsi/tests/test_discovery_sendtargets.c	2011-08-14 16:46:24.000000000 -0500
 @@ -0,0 +1,60 @@
 +/*
 + * iSCSI Administration library
@@ -3233,9 +3280,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_discovery_sendtarge
 +
 +	return rc;
 +}
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_get_auth.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_get_auth.c
---- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_get_auth.c	1969-12-31 18:00:00.000000000 -0600
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_get_auth.c	2011-01-31 02:35:29.000000000 -0600
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_get_auth.c open-iscsi-2.0-872-rc4-bnx2i.build/libiscsi/tests/test_get_auth.c
+--- open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_get_auth.c	1969-12-31 18:00:00.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.build/libiscsi/tests/test_get_auth.c	2011-08-14 16:46:24.000000000 -0500
 @@ -0,0 +1,70 @@
 +/*
 + * iSCSI Administration library
@@ -3307,9 +3354,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_get_auth.c open-isc
 +
 +	return rc;
 +}
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_get_initiator_name.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_get_initiator_name.c
---- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_get_initiator_name.c	1969-12-31 18:00:00.000000000 -0600
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_get_initiator_name.c	2011-01-31 02:35:29.000000000 -0600
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_get_initiator_name.c open-iscsi-2.0-872-rc4-bnx2i.build/libiscsi/tests/test_get_initiator_name.c
+--- open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_get_initiator_name.c	1969-12-31 18:00:00.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.build/libiscsi/tests/test_get_initiator_name.c	2011-08-14 16:46:24.000000000 -0500
 @@ -0,0 +1,38 @@
 +/*
 + * iSCSI Administration library
@@ -3349,9 +3396,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_get_initiator_name.
 +
 +	return 0;
 +}
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_get_network_config.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_get_network_config.c
---- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_get_network_config.c	1969-12-31 18:00:00.000000000 -0600
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_get_network_config.c	2011-01-31 02:35:29.000000000 -0600
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_get_network_config.c open-iscsi-2.0-872-rc4-bnx2i.build/libiscsi/tests/test_get_network_config.c
+--- open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_get_network_config.c	1969-12-31 18:00:00.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.build/libiscsi/tests/test_get_network_config.c	2011-08-14 16:46:24.000000000 -0500
 @@ -0,0 +1,45 @@
 +/*
 + * iSCSI Administration library
@@ -3398,9 +3445,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_get_network_config.
 +
 +	return 0;
 +}
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_login.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_login.c
---- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_login.c	1969-12-31 18:00:00.000000000 -0600
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_login.c	2011-01-31 02:35:29.000000000 -0600
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_login.c open-iscsi-2.0-872-rc4-bnx2i.build/libiscsi/tests/test_login.c
+--- open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_login.c	1969-12-31 18:00:00.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.build/libiscsi/tests/test_login.c	2011-08-14 16:46:24.000000000 -0500
 @@ -0,0 +1,52 @@
 +/*
 + * iSCSI Administration library
@@ -3454,9 +3501,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_login.c open-iscsi-
 +
 +	return rc;
 +}
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_logout.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_logout.c
---- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_logout.c	1969-12-31 18:00:00.000000000 -0600
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_logout.c	2011-01-31 02:35:29.000000000 -0600
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_logout.c open-iscsi-2.0-872-rc4-bnx2i.build/libiscsi/tests/test_logout.c
+--- open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_logout.c	1969-12-31 18:00:00.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.build/libiscsi/tests/test_logout.c	2011-08-14 16:46:24.000000000 -0500
 @@ -0,0 +1,51 @@
 +/*
 + * iSCSI Administration library
@@ -3509,9 +3556,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_logout.c open-iscsi
 +
 +	return rc;
 +}
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_params.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_params.c
---- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_params.c	1969-12-31 18:00:00.000000000 -0600
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_params.c	2011-01-31 02:35:29.000000000 -0600
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_params.c open-iscsi-2.0-872-rc4-bnx2i.build/libiscsi/tests/test_params.c
+--- open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_params.c	1969-12-31 18:00:00.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.build/libiscsi/tests/test_params.c	2011-08-14 16:46:24.000000000 -0500
 @@ -0,0 +1,103 @@
 +/*
 + * iSCSI Administration library
@@ -3616,9 +3663,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_params.c open-iscsi
 +
 +	return rc;
 +}
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_set_auth.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_set_auth.c
---- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_set_auth.c	1969-12-31 18:00:00.000000000 -0600
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_set_auth.c	2011-01-31 02:35:29.000000000 -0600
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_set_auth.c open-iscsi-2.0-872-rc4-bnx2i.build/libiscsi/tests/test_set_auth.c
+--- open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_set_auth.c	1969-12-31 18:00:00.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.build/libiscsi/tests/test_set_auth.c	2011-08-14 16:46:24.000000000 -0500
 @@ -0,0 +1,58 @@
 +/*
 + * iSCSI Administration library
@@ -3678,9 +3725,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_set_auth.c open-isc
 +
 +	return rc;
 +}
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/Makefile open-iscsi-2.0-872-rc4-bnx2i.work/Makefile
---- open-iscsi-2.0-872-rc4-bnx2i/Makefile	2011-01-31 02:35:12.000000000 -0600
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/Makefile	2011-01-31 02:35:29.000000000 -0600
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/Makefile open-iscsi-2.0-872-rc4-bnx2i.build/Makefile
+--- open-iscsi-2.0-872-rc4-bnx2i.base/Makefile	2011-08-14 16:53:01.000000000 -0500
++++ open-iscsi-2.0-872-rc4-bnx2i.build/Makefile	2011-08-14 16:46:24.000000000 -0500
 @@ -32,6 +32,7 @@ user: ;
  	$(MAKE) -C utils/fwparam_ibft
  	$(MAKE) -C usr
@@ -3697,9 +3744,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/Makefile open-iscsi-2.0-872-rc4-bnx2i.w
  	$(MAKE) -C utils/sysdeps clean
  	$(MAKE) -C utils/fwparam_ibft clean
  	$(MAKE) -C utils clean
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/discovery.c
---- open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c	2011-01-31 02:35:13.000000000 -0600
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/discovery.c	2011-01-31 02:57:55.000000000 -0600
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/usr/discovery.c open-iscsi-2.0-872-rc4-bnx2i.build/usr/discovery.c
+--- open-iscsi-2.0-872-rc4-bnx2i.base/usr/discovery.c	2011-08-14 16:53:01.000000000 -0500
++++ open-iscsi-2.0-872-rc4-bnx2i.build/usr/discovery.c	2011-08-14 16:46:24.000000000 -0500
 @@ -36,6 +36,7 @@
  #include "types.h"
  #include "iscsi_proto.h"
@@ -3728,7 +3775,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-
  void discovery_isns_free_servername(void)
  {
  	if (isns_config.ic_server_name)
-@@ -371,6 +375,7 @@ retry:
+@@ -377,6 +381,7 @@ retry:
  	discovery_isns_free_servername();
  	return rc;
  }
@@ -3736,10 +3783,10 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-
  
  int discovery_fw(void *data, struct iface_rec *iface,
  		 struct list_head *rec_list)
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/idbm.c
---- open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c	2011-01-31 02:35:13.000000000 -0600
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/idbm.c	2011-01-31 02:47:52.000000000 -0600
-@@ -1214,9 +1214,9 @@ int idbm_print_all_discovery(int info_le
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i.build/usr/idbm.c
+--- open-iscsi-2.0-872-rc4-bnx2i.base/usr/idbm.c	2011-08-14 16:53:01.000000000 -0500
++++ open-iscsi-2.0-872-rc4-bnx2i.build/usr/idbm.c	2011-08-14 16:46:24.000000000 -0500
+@@ -1274,9 +1274,9 @@ int idbm_print_all_discovery(int info_le
   * fn should return -1 if it skipped the rec, a ISCSI_ERR error code if
   * the operation failed or 0 if fn was run successfully.
   */
@@ -3752,10 +3799,10 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  {
  	DIR *iface_dirfd;
  	struct dirent *iface_dent;
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/idbm.h
---- open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.h	2011-01-31 02:35:13.000000000 -0600
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/idbm.h	2011-01-31 02:48:39.000000000 -0600
-@@ -96,6 +96,9 @@ struct rec_op_data {
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/usr/idbm.h open-iscsi-2.0-872-rc4-bnx2i.build/usr/idbm.h
+--- open-iscsi-2.0-872-rc4-bnx2i.base/usr/idbm.h	2011-08-14 16:53:01.000000000 -0500
++++ open-iscsi-2.0-872-rc4-bnx2i.build/usr/idbm.h	2011-08-14 16:46:24.000000000 -0500
+@@ -98,6 +98,9 @@ struct rec_op_data {
  	node_rec_t *match_rec;
  	idbm_iface_op_fn *fn;
  };
@@ -3765,20 +3812,20 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.h open-iscsi-2.0-872-rc4-bnx2i
  extern int idbm_for_each_portal(int *found, void *data,
  				idbm_portal_op_fn *fn, char *targetname);
  extern int idbm_for_each_node(int *found, void *data,
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_ipc.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_ipc.h
---- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_ipc.h	2011-01-31 02:35:13.000000000 -0600
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_ipc.h	2011-01-31 02:35:29.000000000 -0600
-@@ -131,4 +131,6 @@ struct iscsi_ipc {
- 	int (*recv_pdu_end) (struct iscsi_conn *conn);
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/usr/iscsi_ipc.h open-iscsi-2.0-872-rc4-bnx2i.build/usr/iscsi_ipc.h
+--- open-iscsi-2.0-872-rc4-bnx2i.base/usr/iscsi_ipc.h	2011-08-14 16:53:01.000000000 -0500
++++ open-iscsi-2.0-872-rc4-bnx2i.build/usr/iscsi_ipc.h	2011-08-14 16:46:24.000000000 -0500
+@@ -136,4 +136,6 @@ struct iscsi_ipc {
+ 	int (*recv_conn_state) (struct iscsi_conn *conn, uint32_t *state);
  };
  
 +struct iscsi_ipc *ipc;
 +
  #endif /* ISCSI_IPC_H */
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/Makefile open-iscsi-2.0-872-rc4-bnx2i.work/usr/Makefile
---- open-iscsi-2.0-872-rc4-bnx2i/usr/Makefile	2011-01-31 02:35:13.000000000 -0600
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/Makefile	2011-01-31 02:57:55.000000000 -0600
-@@ -31,7 +31,7 @@ endif
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/usr/Makefile open-iscsi-2.0-872-rc4-bnx2i.build/usr/Makefile
+--- open-iscsi-2.0-872-rc4-bnx2i.base/usr/Makefile	2011-08-14 16:53:01.000000000 -0500
++++ open-iscsi-2.0-872-rc4-bnx2i.build/usr/Makefile	2011-08-14 16:46:24.000000000 -0500
+@@ -33,7 +33,7 @@ endif
  OPTFLAGS ?= -O2 -g
  WARNFLAGS ?= -Wall -Wstrict-prototypes
  CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -I../include -I. -I../utils/open-isns \
diff --git a/iscsi-initiator-utils-brcm-man.patch b/iscsi-initiator-utils-brcm-man.patch
index 0f5e467..c421d1b 100644
--- a/iscsi-initiator-utils-brcm-man.patch
+++ b/iscsi-initiator-utils-brcm-man.patch
@@ -1,6 +1,6 @@
-diff -aurp open-iscsi-2.0-872-rc4-bnx2i/brcm_iscsi_uio/docs/brcm_iscsiuio.8 open-iscsi-2.0-872-rc4-bnx2i.work/brcm_iscsi_uio/docs/brcm_iscsiuio.8
---- open-iscsi-2.0-872-rc4-bnx2i/brcm_iscsi_uio/docs/brcm_iscsiuio.8	2011-01-31 19:38:19.000000000 -0600
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/brcm_iscsi_uio/docs/brcm_iscsiuio.8	2011-01-31 19:38:44.000000000 -0600
+diff -aurp open-iscsi-2.0-872-rc4-bnx2i/iscsi_uio/docs/iscsiuio.8 open-iscsi-2.0-872-rc4-bnx2i.work/iscsiuio/docs/iscsiuio.8
+--- open-iscsi-2.0-872-rc4-bnx2i/iscsiuio/docs/iscsiuio.8	2011-01-31 19:38:19.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.work/iscsiuio/docs/iscsiuio.8	2011-01-31 19:38:44.000000000 -0600
 @@ -67,6 +67,15 @@ into the background.
  .TP
  .BI -v
@@ -8,7 +8,7 @@ diff -aurp open-iscsi-2.0-872-rc4-bnx2i/brcm_iscsi_uio/docs/brcm_iscsiuio.8 open
 +.PP
 +.TP
 +.BI -p <pidfile>
-+Use pidfile (default  /var/run/brcm_iscsiuio.pid )
++Use pidfile (default  /var/run/iscsiuio.pid )
 +.PP
 +.TP
 +.BI -h
diff --git a/iscsi-initiator-utils-fix-default-bindings.patch b/iscsi-initiator-utils-fix-default-bindings.patch
new file mode 100644
index 0000000..79161c4
--- /dev/null
+++ b/iscsi-initiator-utils-fix-default-bindings.patch
@@ -0,0 +1,172 @@
+commit ac38eee2083821eb29d098227ad044c950d115e4
+Author: Mike Christie <michaelc at cs.wisc.edu>
+Date:   Sun Aug 14 22:14:04 2011 -0500
+
+    iscsi tools: fix default iface binding setup
+    
+    If a driver supports multiple ifaces only one is getting
+    auto created. This modifies the default iface setup code
+    so that it creates a iface per kernel iface or a iface per
+    host if kernel ifaces are not supported.
+
+diff --git a/usr/iface.c b/usr/iface.c
+index 5d5f7bf..9c70d09 100644
+--- a/usr/iface.c
++++ b/usr/iface.c
+@@ -424,12 +424,61 @@ int iface_get_by_net_binding(struct iface_rec *pattern,
+ 	return ISCSI_ERR_NO_OBJS_FOUND;
+ }
+ 
++static int iface_get_iptype(struct iface_rec *iface)
++{
++	if (strcmp(iface->bootproto, "dhcp") && !strstr(iface->ipaddress, "."))
++		return ISCSI_IFACE_TYPE_IPV6;
++	else
++		return ISCSI_IFACE_TYPE_IPV4;
++}
++
++static int iface_setup_binding_from_kern_iface(void *data,
++					       struct iface_rec *kern_iface)
++{
++	struct host_info *hinfo = data;
++	struct iface_rec iface;
++
++	if (!strlen(hinfo->iface.hwaddress)) {
++		log_error("Invalid offload iSCSI host %u. Missing "
++			  "hwaddress. Try upgrading %s driver.\n",
++			  hinfo->host_no, hinfo->iface.transport_name);
++		return 0;
++	}
++
++	memset(&iface, 0, sizeof(struct iface_rec));
++	strcpy(iface.hwaddress, hinfo->iface.hwaddress);
++	strcpy(iface.transport_name, hinfo->iface.transport_name);
++
++	if (kern_iface) {
++		iface.iface_num = kern_iface->iface_num;
++
++		snprintf(iface.name, sizeof(iface.name), "%s.%s.%s.%u",
++			 kern_iface->transport_name,
++			 kern_iface->hwaddress,
++			 iface_get_iptype(kern_iface) == ISCSI_IFACE_TYPE_IPV4 ?
++			 "ipv4" : "ipv6", kern_iface->iface_num);
++	} else {
++		snprintf(iface.name, sizeof(iface.name), "%s.%s",
++			 hinfo->iface.transport_name, hinfo->iface.hwaddress);
++	}
++
++	if (iface_conf_read(&iface)) {
++		/* not found so create it */
++		if (iface_conf_write(&iface)) {
++			log_error("Could not create default iface conf %s.",
++				  iface.name);
++			/* fall through - will not be persistent */
++		}
++	}
++
++	return 0;
++}
++
+ static int __iface_setup_host_bindings(void *data, struct host_info *hinfo)
+ {
+ 	struct iface_rec *def_iface;
+-	struct iface_rec iface;
+ 	struct iscsi_transport *t;
+-	int i = 0;
++	int i = 0, nr_found;
+ 
+ 	t = iscsi_sysfs_get_transport_by_hba(hinfo->host_no);
+ 	if (!t)
+@@ -441,26 +490,12 @@ static int __iface_setup_host_bindings(void *data, struct host_info *hinfo)
+ 			return 0;
+ 	}
+ 
+-	if (iface_get_by_net_binding(&hinfo->iface, &iface) ==
+-	    ISCSI_ERR_NO_OBJS_FOUND) {
+-		/* Must be a new port */
+-		if (!strlen(hinfo->iface.hwaddress)) {
+-			log_error("Invalid offload iSCSI host %u. Missing "
+-				  "hwaddress. Try upgrading %s driver.\n",
+-				  hinfo->host_no, t->name);
+-			return 0;
+-		}
+-
+-		memset(&iface, 0, sizeof(struct iface_rec));
+-		strcpy(iface.hwaddress, hinfo->iface.hwaddress);
+-		strcpy(iface.transport_name, hinfo->iface.transport_name);
+-		snprintf(iface.name, sizeof(iface.name), "%s.%s",
+-			 t->name, hinfo->iface.hwaddress);
+-		if (iface_conf_write(&iface))
+-			log_error("Could not create default iface conf %s.",
+-				  iface.name);
+-			/* fall through - will not be persistent */
+-	}
++	nr_found = 0;
++	iscsi_sysfs_for_each_iface_on_host(hinfo, hinfo->host_no,
++					   &nr_found,
++					   iface_setup_binding_from_kern_iface);
++	if (!nr_found)
++		iface_setup_binding_from_kern_iface(hinfo, NULL);	
+ 	return 0;
+ }
+ 
+@@ -843,7 +878,6 @@ int iface_setup_from_boot_context(struct iface_rec *iface,
+ 	memset(iface->name, 0, sizeof(iface->name));
+ 	snprintf(iface->name, sizeof(iface->name), "%s.%s",
+ 		 iface->transport_name, context->mac);
+-
+ 	strlcpy(iface->hwaddress, context->mac,
+ 		sizeof(iface->hwaddress));
+ 	strlcpy(iface->ipaddress, context->ipaddr,
+@@ -921,9 +955,7 @@ static int __iface_get_param_count(void *data, struct iface_rec *iface)
+ 	if (strcmp(iface_params->primary->hwaddress, iface->hwaddress))
+ 		return 0;
+ 
+-	if (strcmp(iface->bootproto, "dhcp") && !strstr(iface->ipaddress, "."))
+-		iptype = ISCSI_IFACE_TYPE_IPV6;
+-
++	iptype = iface_get_iptype(iface);
+ 	if (iptype == ISCSI_IFACE_TYPE_IPV4) {
+ 
+ 		if (strcmp(iface->state, "disable")) {
+@@ -1466,12 +1498,10 @@ static int __iface_build_net_config(void *data, struct iface_rec *iface)
+ 	if (strcmp(net_config->primary->hwaddress, iface->hwaddress))
+ 		return 0;
+ 
+-	if (strcmp(iface->bootproto, "dhcp") && !strstr(iface->ipaddress, "."))
+-		iptype = ISCSI_IFACE_TYPE_IPV6;
+-
+ 	/* start at 2, because 0 is for nlmsghdr and 1 for event */
+ 	iov = net_config->iovs + 2;
+ 
++	iptype = iface_get_iptype(iface);
+ 	if (iptype == ISCSI_IFACE_TYPE_IPV4) {
+ 		if (!strcmp(iface->state, "disable")) {
+ 			if (!iface_fill_net_state(&iov[net_config->count],
+diff --git a/usr/iscsi_sysfs.c b/usr/iscsi_sysfs.c
+index 995549e..961cefd 100644
+--- a/usr/iscsi_sysfs.c
++++ b/usr/iscsi_sysfs.c
+@@ -425,9 +425,10 @@ uint32_t iscsi_sysfs_get_host_no_from_hwinfo(struct iface_rec *iface, int *rc)
+ static int iscsi_sysfs_read_iface(struct iface_rec *iface, int host_no,
+ 				  char *session, char *iface_kern_id)
+ {
++	uint32_t tmp_host_no, iface_num;
+ 	char host_id[NAME_SIZE];
+ 	struct iscsi_transport *t;
+-	int ret;
++	int ret, iface_type;
+ 
+ 	t = iscsi_sysfs_get_transport_by_hba(host_no);
+ 	if (!t)
+@@ -582,6 +583,10 @@ static int iscsi_sysfs_read_iface(struct iface_rec *iface, int host_no,
+ 			 &iface->vlan_id);
+ 	sysfs_get_uint8(iface_kern_id, ISCSI_IFACE_SUBSYS, "vlan_priority",
+ 			 &iface->vlan_priority);
++
++	if (sscanf(iface_kern_id, "ipv%d-iface-%u-%u", &iface_type,
++		   &tmp_host_no, &iface_num) == 3)
++		iface->iface_num = iface_num;
+ done:
+ 	if (ret)
+ 		return ISCSI_ERR_SYSFS_LOOKUP;
diff --git a/iscsi-initiator-utils-sync-iscsi.patch b/iscsi-initiator-utils-sync-iscsi.patch
index 23f027f..bde2f24 100644
--- a/iscsi-initiator-utils-sync-iscsi.patch
+++ b/iscsi-initiator-utils-sync-iscsi.patch
@@ -1,6 +1,6 @@
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/Changelog open-iscsi-2.0-872-rc4-bnx2i.work/Changelog
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/Changelog open-iscsi-2.0-872-rc4-bnx2i.sync/Changelog
 --- open-iscsi-2.0-872-rc4-bnx2i/Changelog	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/Changelog	2011-02-24 19:54:10.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/Changelog	2011-08-14 16:48:25.000000000 -0500
 @@ -1,132 +1,114 @@
 -open-iscsi-2.0-871 - open-iscsi-2.0.870
 +open-iscsi-2.0-872 - open-iscsi-2.0.871
@@ -243,25 +243,86 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/Changelog open-iscsi-2.0-872-rc4-bnx2i.
 +Wulf C. Krueger (1):
 +      Use DESTDIR when generating an InitiatorName.
  
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/doc/iscsiadm.8 open-iscsi-2.0-872-rc4-bnx2i.work/doc/iscsiadm.8
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/doc/iscsiadm.8 open-iscsi-2.0-872-rc4-bnx2i.sync/doc/iscsiadm.8
 --- open-iscsi-2.0-872-rc4-bnx2i/doc/iscsiadm.8	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/doc/iscsiadm.8	2011-02-24 19:54:10.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/doc/iscsiadm.8	2011-08-14 16:48:25.000000000 -0500
+@@ -10,13 +10,13 @@ iscsiadm \- open-iscsi administration ut
+ \fBiscsiadm\fR \-m node [ \-hV ] [ \-d debug_level ] [ \-P printlevel ] [ \-L all,manual,automatic ] [ \-U all,manual,automatic ] [ \-S ] [ [ \-T targetname \-p ip:port \-I iface ] [ \-l | \-u | \-R | \-s] ]
+ [ [ \-o operation ]  [ \-n name ] [ \-v value ] [ \-p ip:port ] ]
+ 
+-\fBiscsiadm\fR \-m session [ \-hV ] [ \-d debug_level ] [ \-P printlevel ] [ \-r sessionid | sysfsdir [ \-R ] [ \-u | \-s ] ]
++\fBiscsiadm\fR \-m session [ \-hV ] [ \-d debug_level ] [ \-P printlevel ] [ \-r sessionid | sysfsdir [ \-R ] [ \-u | \-s | \-o new ] ]
+ 
+-\fBiscsiadm\fR \-m iface [ \-hV ] [ \-d debug_level ] [ \-P printlevel ] [ \-I ifacename ] [ [ \-o  operation  ] [ \-n name ] [ \-v value ] ]
++\fBiscsiadm\fR \-m iface [ \-hV ] [ \-d debug_level ] [ \-P printlevel ] [ \-I ifacename | \-H hostno|MAC ]   [ [ \-o  operation  ] [ \-n name ] [ \-v value ] ]
+ 
+ \fBiscsiadm\fR \-m fw [\-l]
+ 
+-\fBiscsiadm\fR \-m host [ \-P printlevel ] [ \-H hostno ]
++\fBiscsiadm\fR \-m host [ \-P printlevel ] [ \-H hostno|MAC ]
+ 
+ \fBiscsiadm\fR \-k priority
+ 
 @@ -49,7 +49,13 @@ print debugging information. Valid value
  display help text and exit
  
  .TP
 -\fB\-I\fR, \fB\-\-interface\fI[iface]\fR
-+\fB\-H\fR, \fB\-\-host=\fI[hostno]\fR
-+The host agrument specifies the SCSI host to use for the operation. The
-+hostno value is the host number assigned to the host by the kernel's
-+scsi layer.
++\fB\-H\fR, \fB\-\-host=\fI[hostno|MAC]\fR
++The host agrument specifies the SCSI host to use for the operation. It can be
++the scsi host number assigned to the host by the kernel's scsi layer, or the
++MAC address of a scsi host.
 +
 +.TP
 +\fB\-I\fR, \fB\-\-interface=\fI[iface]\fR
  The interface argument specifies the iSCSI interface to use for the operation.
  iSCSI interfaces (iface) are defined in /etc/iscsi/ifaces. For hardware
  iSCSI (qla4xxx) the iface config must have the hardware address
-@@ -294,6 +300,152 @@ or
+@@ -141,6 +147,8 @@ operator.
+ Specifies a database operator \fIop\fR. \fIop\fR must be one of
+ \fInew\fR, \fIdelete\fR, \fIupdate\fR, \fIshow\fR or \fInonpersistent\fR.
+ .IP
++For iface mode, \fIapply\fR and \fIapplyall\fR  are also applicable.
++.IP
+ This option is valid for all modes except fw. Delete should not be used on a running session. If it is iscsiadm will stop the session and then delete the
+ record.
+ .IP
+@@ -148,7 +156,8 @@ record.
+ \fIrecid\fR is the target name and portal (IP:port). In iface mode, the \fIrecid\fR
+ is the iface name. In discovery mode, the \fIrecid\fR is the portal and
+ discovery type.
+-
++.IP
++In session mode, the \fInew\fR operation logs in a new session using the same node database and iface information as the specified session.
+ .IP
+ In discovery mode, if the \fIrecid\fR and new operation is passed in, but the \fI--discover\fR argument is not, then iscsiadm will only create a discovery record (it will not perform discovery). If the \fI--discover\fR argument is passed in with the portal and discovery type, then iscsiadm will create the discovery record if needed, and it will create records for portals returned by the target that do not yet have a node DB record.
+ .IP
+@@ -163,10 +172,22 @@ sid is passed in.
+ .IP
+ \fInonpersistent\fR instructs iscsiadm to not manipulate the node DB.
+ 
++.IP
++\fIapply\fR will cause the network settings to take effect on the specified iface.
++
++.IP
++\fIapplyall\fR will cause the network settings to take effect on all the ifaces whose MAC address or host number matches that of the specific host.
++
+ .TP
+ \fB\-p\fR, \fB\-\-portal=\fIip[:port]\fR
+-Use target portal with ip-address \fIip\fR and \fIport\fR, the default
+-\fIport\fR value is 3260.
++Use target portal with ip-address \fIip\fR and \fIport\fR. If port is not passed
++in the default \fIport\fR value is 3260.
++.IP
++IPv6 addresses can bs specified as [ddd.ddd.ddd.ddd]:port or
++ddd.ddd.ddd.ddd.
++.IP
++Hostnames can also be used for the ip argument.
++
+ .IP
+ This option is only valid for discovery, or for node operations with
+ the \fInew\fR operator.
+@@ -294,6 +315,152 @@ or
  SendTargets (st)
  discovery type. An SLP implementation is under development.
  
@@ -414,10 +475,284 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/doc/iscsiadm.8 open-iscsi-2.0-872-rc4-b
  .SH EXAMPLES
  
  .nf
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/etc/initd/initd.suse open-iscsi-2.0-872-rc4-bnx2i.work/etc/initd/initd.suse
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/doc/iscsid.8 open-iscsi-2.0-872-rc4-bnx2i.sync/doc/iscsid.8
+--- open-iscsi-2.0-872-rc4-bnx2i/doc/iscsid.8	2010-07-11 04:05:58.000000000 -0500
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/doc/iscsid.8	2011-08-14 16:48:25.000000000 -0500
+@@ -35,6 +35,9 @@ run under user ID \fIuid\fR (default is 
+ .BI [-g|--gid=]\fIgid\fP
+ run under user group ID \fIgid\fR (default is the current user group ID).
+ .TP
++.BI [-n|--no-pid-file]\fP
++do not write a process ID file.
++.TP
+ .BI [-p|--pid=]\fIpid\-file\fP
+ write process ID to \fIpid\-file\fR rather than the default
+ \fI/var/run/iscsid.pid\fR
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/etc/iface.example open-iscsi-2.0-872-rc4-bnx2i.sync/etc/iface.example
+--- open-iscsi-2.0-872-rc4-bnx2i/etc/iface.example	2010-07-11 04:05:58.000000000 -0500
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/etc/iface.example	2011-08-14 16:48:25.000000000 -0500
+@@ -60,3 +60,138 @@
+ #    the same subnet.
+ # iface.net_ifacename = eth0
+ # iface.ipaddress = 102.50.50.101
++
++# OPTIONAL: iface.bootproto
++#
++# Valid values are:
++# "dhcp" and "static"
++#
++# REQUIRED when IPv4 address need to be obtained dynamically using DHCP
++# example:
++# iface.bootproto = dhcp
++#
++# OPTIONAL when the IPv4 address is set statically
++# example:
++# iface.ipaddress = 102.50.50.101
++# iface.bootproto = static
++#
++
++# OPTIONAL: iface.vlan_id
++# Used to set the VLAN ID for the iSCSI interfae.
++# example
++# iface.vlan_id = 1022
++
++# OPTIONAL: iface.vlan_priority
++# Used to set the VLAN priority for the iSCSI interfae.
++# example
++# iface.vlan_priority = 1
++
++# OPTIONAL: iface.vlan_state
++# Used to enable or disable the VLAN on the iSCSI interface
++# example
++# iface.vlan_state = enable
++
++# OPTIONAL: iface.ipv6_linklocal
++# Specify the IPV6 Link Local Address with the
++# link local prefix of FE80::0/64
++# example:
++# iface.ipv6_linklocal = fe80:0000:0000:0000:020e:1eff:1111:2221
++
++# OPTIONAL: iface.ipv6_router
++# Used to set a default IPV6 router
++# example:
++# iface.ipv6_router = fe80:0000:0000:0000:7ae7:d1ff:fe72:4048
++
++# OPTIONAL: iface.ipv6_autocfg
++# Used to set the discovery protocol to obtain IPV6 address
++# For example qla4xxx support neighbor discovery
++# example:
++# iface.ipv6_autocfg = nd
++
++# OPTIONAL: iface.linklocal_autocfg
++# For transport like qla4xxx this allows to auto configure the
++# IPV6 link local address based on the MAC address of the iSCSI
++# interface
++
++# OPTIONAL: iface.router_autocfg
++# Required to set the IPv6 router discovery protocol
++# To set the  router discovery  protocol to Neighbor Discovery specify "nd"
++# example:
++# iface.router_autocfg = nd
++
++# OPTIONAL: iface.state
++# By default the iface is enabled
++# iface.state = enable
++# To disable the iface set the state to "disable"
++# iface.state = disable
++
++# iface.iface_num
++# REQUIRED: When there are more than 1 interface to be configured.
++# For transports like qla4xxx, one can specify two IPV6 interfaces
++# in such case the iface_num must be set correctly
++# example:
++# iface settings for first IPV6 interface
++# iface.iscsi_ifacename = iface-qla4xxx-ipv6-1
++# iface.iface_num = 0
++#
++# iface settings for second IPV6 interface
++# iface.iscsi_ifacename = iface-qla4xxx-ipv6-2
++# iface.iface_num = 1
++
++# Here are some example iface files
++# IPV4 sample config file with static IP address:
++# BEGIN RECORD 2.0-872
++# iface.iscsi_ifacename = qla4xxx-3
++# iface.ipaddress = 192.168.1.75
++# iface.hwaddress = 00:0e:1e:04:93:92
++# iface.transport_name = qla4xxx
++# iface.bootproto = static
++# iface.subnet_mask = 255.255.255.0
++# iface.gateway = 192.168.1.1
++# iface.state = enable
++# iface.vlan = <empty>
++# iface.iface_num = 0
++# END RECORD
++#
++# IPV6 sample config file with neighbor discovery:
++#  BEGIN RECORD 2.0-872
++# iface.iscsi_ifacename = qla4xxx-3-1
++# iface.ipaddress =
++# iface.hwaddress = 00:0e:1e:04:93:92
++# iface.transport_name = qla4xxx
++# iface.ipv6_autocfg = nd
++# iface.linklocal_autocfg = auto
++# iface.router_autocfg = nd
++# iface.ipv6_linklocal = fe80:0000:0000:0000:020e:1eff:1111:2221
++# iface.ipv6_router = auto
++# iface.state = enable
++# iface.vlan = <empty>
++# iface.iface_num = 0
++# END RECORD
++
++# Ipv4 sample config file (DHCP configuration):
++#  BEGIN RECORD 2.0-872
++# iface.iscsi_ifacename = qla4xxx-3
++# iface.hwaddress = 00:0e:1e:04:93:92
++# iface.transport_name = qla4xxx
++# iface.bootproto = dhcp
++# iface.state = enable
++# iface.vlan = <empty>
++# iface.iface_num = 0
++# END RECORD
++
++# Sample ipv6 config file(manual configured IPs):
++# BEGIN RECORD 2.0-872
++# iface.iscsi_ifacename = iface-new-file
++# iface.ipaddress = fec0:ce00:7014:0041:1111:2222:1e04:9392
++# iface.hwaddress = 00:0e:1e:04:93:92
++# iface.transport_name = qla4xxx
++# iface.ipv6_autocfg = <empty>
++# iface.linklocal_autocfg = <empty>
++# iface.router_autocfg = <empty>
++# iface.ipv6_linklocal = fe80:0000:0000:0000:0000:0000:1e04:9392
++# iface.ipv6_router = fe80:0000:0000:0000:7ae7:d1ff:fe72:4048
++# iface.state = enable
++# iface.vlan = <empty>
++# iface.iface_num = 0
++# END RECORD
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/etc/initd/boot.suse open-iscsi-2.0-872-rc4-bnx2i.sync/etc/initd/boot.suse
+--- open-iscsi-2.0-872-rc4-bnx2i/etc/initd/boot.suse	2010-07-11 04:05:58.000000000 -0500
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/etc/initd/boot.suse	2011-08-14 16:48:25.000000000 -0500
+@@ -4,36 +4,37 @@
+ #
+ ### BEGIN INIT INFO
+ # Provides:          iscsiboot
+-# Required-Start:    boot.proc
+-# Should-Start:
+-# Required-Stop:     
++# Required-Start:
++# Should-Start:      boot.multipath
++# Required-Stop:
+ # Should-Stop:
+ # Default-Start:     B
+ # Default-Stop:      
+-# Short-Description: Starts the iSCSI initiator daemon
+-#                    
++# Short-Description: iSCSI initiator daemon root-fs support
++# Description:       Starts the iSCSI initiator daemon if the
++#                    root-filesystem is on an iSCSI device
++#               
+ ### END INIT INFO
+ 
+ ISCSIADM=/sbin/iscsiadm
+-PID_FILE=/var/run/iscsi.pid
+ CONFIG_FILE=/etc/iscsid.conf
+ DAEMON=/sbin/iscsid
+-ARGS="-c $CONFIG_FILE -p $PID_FILE"
++ARGS="-c $CONFIG_FILE"
+ 
+ # Source LSB init functions
+ . /etc/rc.status
+ 
+ #
+-# This service is run right after booting. So all activated targets
+-# must be enabled during mkinitrd run and thus should not be removed
+-# when the open-iscsi service is stopped.
++# This service is run right after booting. So all targets activated
++# during mkinitrd run should not be removed when the open-iscsi
++# service is stopped.
+ #
+ iscsi_mark_root_nodes()
+ {
+     $ISCSIADM -m session 2> /dev/null | while read t num i target ; do
+ 	ip=${i%%:*}
+-	STARTUP=`$ISCSIADM -m node -p $ip -T $target | grep "node.conn\[0\].startup" | cut -d' ' -f3`
+-	if [ "$STARTUP" != "onboot" ] ; then
++	STARTUP=`$ISCSIADM -m node -p $ip -T $target 2> /dev/null | grep "node.conn\[0\].startup" | cut -d' ' -f3`
++	if [ "$STARTUP" -a "$STARTUP" != "onboot" ] ; then
+ 	    $ISCSIADM -m node -p $ip -T $target -o update -n node.conn[0].startup -v onboot
+ 	fi
+     done
+@@ -50,13 +51,12 @@ fi
+ 
+ case "$1" in
+     start)
+-	[ ! -d /var/lib/open-iscsi ] && mkdir -p /var/lib/open-iscsi
+ 	echo -n "Starting iSCSI initiator for the root device: "
+ 	startproc $DAEMON $ARGS
+ 	rc_status -v
+ 	iscsi_mark_root_nodes
+ 	;;
+-    stop)
++    stop|restart|reload)
+ 	rc_failed 0
+ 	;;
+     status)
+@@ -68,13 +68,8 @@ case "$1" in
+ 	    rc_status -v
+ 	fi
+ 	;;
+-    restart)
+-	$0 stop
+-	sleep 1
+-	$0 start
+-	;;
+     *)
+-	echo "Usage: $0 {start|stop|status|restart}"
++	echo "Usage: $0 {start|stop|status|restart|reload}"
+ 	exit 1
+ 	;;
+ esac
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/etc/initd/initd.suse open-iscsi-2.0-872-rc4-bnx2i.sync/etc/initd/initd.suse
 --- open-iscsi-2.0-872-rc4-bnx2i/etc/initd/initd.suse	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/etc/initd/initd.suse	2011-02-24 19:54:10.000000000 -0600
-@@ -30,7 +30,7 @@ iscsi_login_all_nodes()
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/etc/initd/initd.suse	2011-08-14 16:48:25.000000000 -0500
+@@ -5,20 +5,22 @@
+ ### BEGIN INIT INFO
+ # Provides:          iscsi
+ # Required-Start:    $network
+-# Should-Start:
+-# Required-Stop:     
+-# Should-Stop:
++# Should-Start:      iscsitarget multipathd
++# Required-Stop:     $network
++# Should-Stop:       multipathd
+ # Default-Start:     3 5
+ # Default-Stop:      
+-# Short-Description: Starts and stops the iSCSI client initiator
+-#                    
++# Short-Description: iSCSI initiator daemon
++# Description:       The iSCSI initator is used to create and
++#                    manage iSCSI connections to a iSCSI Target.
++#
+ ### END INIT INFO
+ 
+-PID_FILE=/var/run/iscsi.pid
+ CONFIG_FILE=/etc/iscsi/iscsid.conf
+ DAEMON=/sbin/iscsid
+ ISCSIADM=/sbin/iscsiadm
+-ARGS="-c $CONFIG_FILE -p $PID_FILE"
++BRCM_ISCSIUIO=/sbin/brcm_iscsiuio
++ARGS="-c $CONFIG_FILE -n"
+ 
+ # Source LSB init functions
+ . /etc/rc.status
+@@ -26,66 +28,359 @@ ARGS="-c $CONFIG_FILE -p $PID_FILE"
+ # Reset status of this service
+ rc_reset
+ 
++DM_MAJOR=$(sed -n 's/\(.*\) device-mapper/\1/p' /proc/devices)
++
+ iscsi_login_all_nodes()
  {
  	echo -n "Setting up iSCSI targets: "
  	$ISCSIADM -m node --loginall=automatic 2> /dev/null
@@ -426,18 +761,536 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/etc/initd/initd.suse open-iscsi-2.0-872
  	    rc_failed 6
  	fi
  	rc_status -v
-@@ -41,7 +41,7 @@ iscsi_logout_all_nodes()
- 	echo -n "Closing all iSCSI connections: "
- 	# Logout from all sessions marked automatic
- 	if ! $ISCSIADM -m node --logoutall=automatic 2> /dev/null; then
+ }
+ 
+-iscsi_logout_all_nodes()
++#
++# Try to load all required modules prior to startup
++#
++iscsi_load_transport_modules()
+ {
+-	echo -n "Closing all iSCSI connections: "
+-	# Logout from all sessions marked automatic
+-	if ! $ISCSIADM -m node --logoutall=automatic 2> /dev/null; then
 -		if [ $? == 19 ] ; then
-+		if [ $? == 21 ] ; then
- 		    RETVAL=6
- 		else
- 		    RETVAL=1
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/include/iscsi_err.h open-iscsi-2.0-872-rc4-bnx2i.work/include/iscsi_err.h
+-		    RETVAL=6
+-		else
+-		    RETVAL=1
++    loaded=$(sed -n "/^iscsi_tcp/p" /proc/modules)
++    if [ -z "$loaded" ] ; then
++	modprobe iscsi_tcp
++	if [ $? = 0 ] ; then
++	    echo -n " tcp"
++	fi
++    fi
++
++    for iface in /etc/iscsi/ifaces/*; do
++	[ -f "$iface" ] || continue
++	[ "$iface" = "iface.example" ] && continue
++	# Check if the iface has been configured
++	result=$(sed '/#.*/D;/iface.iscsi_ifacename/D;/iface.hwaddress/D;/iface.transport_name/D' $iface)
++	if [ "$result" ] ; then
++	    mod=$(sed -n 's/iface.transport_name *= *\(.*\)/\1/p' $iface)
++	    loaded=$(sed -n "/^$mod/p" /proc/modules)
++	    if [ -z "$loaded" ] ; then
++		modprobe $mod
++		if [ $? = 0 ] ; then
++		    echo -n " $mod"
+ 		fi
+-		rc_failed $RETVAL
++	    fi
+ 	fi
+-	rc_status -v
++    done
++}
+ 
+-	# Not sure whether this is still needed
+-	sleep 1
+-	return ${RETVAL:-0}
++#
++# Set a temporary startmode for ifdown
++#
++iscsi_modify_if_startmode()
++{
++    local ifname=$1
++    local tmp_ifcfg=/dev/.sysconfig/network/if-$ifname
++
++    if [ -e "$tmp_ifcfg" ] ; then
++	. $tmp_ifcfg
++	if [ "$startmode" ] ; then
++	    return
++	fi
++    fi
++    : disabling shutdown on $ifname
++    echo "startmode=nfsroot" >> $tmp_ifcfg
+ }
+ 
+-iscsi_umount_all_luns()
++iscsi_get_ifacename_from_session()
+ {
+-    local d m dev p s
++    local session=$1
++    local ifacename
+ 
+-    cat /proc/mounts | sed -ne '/^\/dev\/.*/p' | while read d m t o x; do 
+-	if [ "$m" = "/" ] ; then 
+-	    continue;
++    ifacename=$(iscsiadm -m session -r ${session##.*/session} 2> /dev/null | \
++	sed -n 's/iface.iscsi_ifacename = \(.*\)/\1/p')
++    if [ -z "$ifacename" ] ; then
++	# Check for iBFT
++	ifacename=$(iscsiadm -m fw 2> /dev/null)
++	if [ -n "$ifacename" ] ; then
++	    ifacename="fw"
+ 	fi
++    fi
++    echo $ifacename
++}
++
++iscsi_get_hwaddress_from_iface()
++{
++    local iface=$1
++    local hwaddress
++
++    hwaddress=$(iscsiadm -m iface -I "$iface" 2> /dev/null | sed -n 's/iface.hwaddress = \(.*\)/\1/p')
++    [ "$hwaddress" = "<empty>" ] && hwaddress=
++
++    echo $hwaddress
++}
++
++iscsi_get_ifname_from_iface()
++{
++    local iface=$1
++    local ifname
++
++    ifname=$(iscsiadm -m iface -I "$iface" 2> /dev/null | sed -n 's/iface.net_ifacename = \(.*\)/\1/p')
++    [ "$ifname" = "<empty>" ] && ifname=
++
++    echo $ifname
++}
++
++iscsi_get_ipaddr_from_iface()
++{
++    local iface=$1
++    local ipaddr
++
++    ipaddr=$(iscsiadm -m iface -I "$iface" 2> /dev/null | sed -n 's/iface.ipaddress = \(.*\)/\1/p')
++    [ "$ipaddr" = "<empty>" ] && ipaddr=
++
++    echo $ipaddr
++}
++
++iscsi_get_ifname_from_firmware()
++{
++    local hwaddress
++
++    hwaddress=$(iscsiadm -m fw 2> /dev/null | sed -n 's/iface.net_ifacename = \(.*\)/\1/p')
++
++    echo $hwaddress
++}
++
++#
++# cxgb3i is using the HWAddress to select
++# the correct interface
++#
++iscsi_get_ifname_from_hwaddress()
++{
++    local hwaddress=$1
++
++    for if in /sys/class/net/*; do
++	[ -e "$if" ] || continue
++	read mac < $if/address
++	[ "$mac" = "$hwaddress" ] || continue
++	echo ${if##*/}
++	break
++    done
++}
++
++iscsi_get_ifname_from_ipaddr()
++{
++    local ipaddr=$1
++    local ifname
++
++    ifname=$(ip addr show to $ipaddr | sed -n 's/[0-9]*: \([^ :]*\): .*/\1/p')
++    return $ifname
++}
++
++#
++# Handle 'default' interface:
++# It is basically impossible to determine via which
++# interface the iSCSI traffic will flow, so we take
++# the easy option and ignore _all_ active interfaces
++# during shutdown
++#
++iscsi_modify_all_interfaces()
++{
++    ip link show up | sed -n '/.*LOOPBACK.*/d;s/[0-9]*: \(.*\): .*/\1/p' | while read ifname; do
++	iscsi_modify_if_startmode $ifname
++    done
++}
++
++#
++# Check iface setting and disable
++# affected network interfaces
++#
++iscsi_check_interface()
++{
++    local session=$1
++    local i h n
++
++    i=$(iscsi_get_ifacename_from_session $session)
++    [ -z "$i" ] && continue
++    if [ "$i" = "default" ] ; then
++	iscsi_modify_all_interfaces
++    elif [ "$i" = "fw" ] ; then
++	n=$(iscsi_get_ifname_from_firmware)
++    else
++	n=$(iscsi_get_ifname_from_iface $i)
++	if [ -z "$n" ] ; then
++	    h=$(iscsi_get_hwaddress_from_iface $i)
++	    if [ -n "$h" ] ; then
++		n=$(iscsi_get_ifname_from_hwaddress $h)
++	    fi
++	fi
++	if [ -z "$n" ] ; then
++	    h=$(iscsi_get_ipaddr_from_iface $i)
++	    if [ -n "$h" ] ; then
++		n=$(iscsi_get_ifname_from_ipaddr $h)
++	    fi
++	fi
++    fi
++    if [ "$n" ] ; then
++	iscsi_modify_if_startmode $n
++    fi
++}
++
++#
++# Check if device 'dev' is mounted
++# Returns the mount point on success
++#
++iscsi_check_if_mounted()
++{
++    local dev=$1
++    local d m t o x p
++
++    cat /proc/mounts | sed -ne '/^\/dev\/.*/p' | while read d m t o x; do 
+ 	if [ -L "$d" ] ; then
+ 	    d=$(readlink -f $d)
+ 	fi
+-	dev=${d##/dev}
++	[ -b "$d" ] || continue
++
++	b=$(ls -l $d | sed -n 's/.* \([0-9]*\), \([0-9]*\) .*/\1:\2/p')
++	p=$(cd -P /sys/dev/block/$b ; echo $PWD)
++
++	if [ -z "$p" ] ; then
++	    d=${d##/dev}
++	    p="/sys/block${d%%[0-9]*}"
++	fi
++
++	[ ! -d ${p} ] && continue
++
++	if [ -e $p/partition ] ; then
++	    p=$(cd -P $p/../; echo $PWD)
++	fi
++	if [ "$dev" = "${p##*/}" ] ; then
++	    echo $m
++	fi
++    done
++}
++
++#
++# Unwind block device stack
++# 
++# Stops unwinding if either no more 'holders'
++# are found or if a device is mounted
++# 
++# Unmounts top-level device and deconfigures
++# all devices down the stack
++#
++# Root fs is not unmounted
++#
++iscsi_unwind_stack()
++{
++    local p=$1
++    local d=${p##*/}
++    local u
++    local m
++
++    if [ ! -d ${p} ] ; then
++	return;
++    fi
++
++    m=$(iscsi_check_if_mounted $d)
++    if [ -z "$m" ] ; then
++	for s in $p/holders/* ; do
++	    [ -e $s ] || continue
++	    p=$(cd -P $s; echo $PWD)
++	    u=$(iscsi_unwind_stack $p)
++	    if [ "$u" ] ; then
++		echo -n "$u "
++	    fi
++	done
++    else
++	if [ "$m" = "/" ] ; then
++	    echo -n "$d "
++	    return 1
++	fi
++	if ! umount $m ; then
++	    echo -n "$d "
++	    return 1
++	fi
++    fi
+ 
+-	if [ "${dev##/sd}" = "$dev" ] ; then
+-	    continue;
++    if [ "${d#dm-}" != "$d" ] ; then
++	if ! dmsetup remove -j $DM_MAJOR -m ${d#dm-} 2> /dev/null ; then
++	    echo -n "$d "
++	    return 1
+ 	fi
+-	p="/sys/block${dev%%[0-9]*}"
++    fi
+ 
+-	if [ ! -d ${p} ] && [ ! -d ${p}/device ] ; then
+-	    continue;
++    if [ "${d#md}" != "$d" ] ; then
++	if ! mdadm --manage /dev/$d --stop 2> /dev/null ; then
++	    echo -n "$d "
++	    return 1
+ 	fi
++    fi
++    return 0
++}
++
++#
++# Return all targets for a given session
++#
++iscsi_get_target()
++{
++    local session=$1
++    local d
++
++    for d in $session/device/target* ; do
++	[ -e "$d" ] || continue
++	echo "$d"
++    done
++}
++
++#
++# Checks all devices presented by a target
++# and tries to umount them.
++# Skip unmounting for the root fs.
++# Stops on the first device which could not be unmounted
++# and returns the mount device of that device.
++#
++iscsi_check_target()
++{
++    local t=$1
++    local d b m
+ 
+-	s=$(cd -P ${p}/device && echo $PWD)
++    for d in $t/* ; do
++	[ -d $d/block ] || continue
++	for b in $d/block/sd* ; do
++	    [ -d "$b" ] || continue
++	    m=$(iscsi_unwind_stack $b)
++	    if [ -n "$m" ] ; then
++		echo $m
++		return 1
++	    fi
++	done
++    done
++}
+ 
+-	case "$s" in
+-	    */session[0-9]*/*)
+-		# This is an iSCSI device
+-		umount "$m"
+-	    ;;
+-	esac
++#
++# Check all sessions for mounted devices
++# and shutdown the session if the affected
++# devices could be umounted cleanly.
++# If umount fails disable shutdown on all
++# affected network interfaces
++#
++iscsi_stop_sessions()
++{
++    local t m s i
++
++    i=0
++    for session in /sys/class/iscsi_session/session* ; do
++	[ -e "$session" ] || continue;
++	[ -e $session/device ] || continue
++	t=$(iscsi_get_target $session)
++	m=$(iscsi_check_target $t)
++	s=${session##*/session}
++	if [ -z "$m" ] ; then
++	    iscsiadm -m session -r ${s} -u
++	    i=$(( $i + 1 ))
++	else
++	    iscsi_check_interface $s
++	fi
+     done
++    echo $i
+ }
+ 
+ iscsi_list_all_nodes()
+@@ -101,84 +396,45 @@ iscsi_list_all_nodes()
+     done
+ }
+ 
+-iscsi_discover_all_targets()
+-{
+-	# Strip off any existing ID information
+-	RAW_NODE_LIST=`iscsiadm -m node | sed -nre 's/^(\[[0-9a-f]*\] )?(.*)$/\2/p'`
+-	# Obtain IPv4 list
+-	IPV4_NODE_LIST=`echo "$RAW_NODE_LIST" | sed -nre 's/^([0-9]{1,3}(\.[0-9]{1,3}){3}):[^: ]* (.*)$/\1 \3/p'`
+-	# Now obtain IPv6 list
+-	IPV6_NODE_LIST=`echo "$RAW_NODE_LIST" | sed -nre 's/^([0-9a-f]{1,4}(:[0-9a-f]{0,4}){6}:[0-9a-f]{1,4}):[^: ]* (.*)$/\1 \3/p'`
+-
+-	DISC_TARGETS=""
+-	while read NODE_ADDR NODE_NAME; do
+-		[ -z "$NODE_ADDR" -a -z "$NODE_NAME" ] && continue
+-		NODE_ATTRS=`iscsiadm -m node -p "$NODE_ADDR" -T "$NODE_NAME"`
+-		NODE_STATUS=`echo "$NODE_ATTRS" | sed -nre 's/^.*node\.conn\[0\]\.startup = ([a-z]*).*$/\1/p'`
+-
+-		if [ "$NODE_STATUS" == 'automatic' ]; then
+-			DISC_TARGETS=`echo "$DISC_TARGETS" | sed -re '/'"$NODE_ADDR"'/!{s/(.*)/\1 '"$NODE_ADDR"'/}'`
+-		fi
+-	done < <(echo "$IPV4_NODE_LIST"; echo "$IPV6_NODE_LIST")
+-
+-	for TARGET_ADDR in $DISC_TARGETS; do
+-		echo -n "Attempting discovery on target at ${TARGET_ADDR}: "
+-		iscsiadm -m discovery -t st -p "$TARGET_ADDR" > /dev/null 2>&1
+-		if [ "$?" -ne 0 ]; then
+-			rc_failed 1
+-			rc_status -v
+-			return 1
+-		fi
+-		rc_status -v
+-	done
+-}
+-
+ case "$1" in
+     start)
+-	[ ! -d /var/lib/iscsi ] && mkdir -p /var/lib/iscsi
+ 	if checkproc $DAEMON ; then
+ 	    RETVAL=0
+ 	else
+ 	    echo -n "Starting iSCSI initiator service: "
+-	    modprobe iscsi_tcp
+-	    modprobe -q ib_iser
++	    iscsi_load_transport_modules
++	    if grep -q bnx2i /proc/modules && [ -x $BRCM_ISCSIUIO ] ; then
++		startproc $BRCM_ISCSIUIO
++	    fi
+ 	    startproc $DAEMON $ARGS
+ 	    RETVAL=$?
+ 	    rc_status -v
+ 	fi
+ 	if [ "$RETVAL" == "0" ]; then
+-	    iscsi_discover_all_targets
+-	    RETVAL=$?
+-	fi
+-	if [ "$RETVAL" == "0" ]; then
+ 	    iscsi_login_all_nodes
+ 	fi
+ 	;;
+     stop)
+-	iscsi_umount_all_luns
+-	if iscsi_logout_all_nodes ; then
+-	    iscsiadm -k 0
+-	    RETVAL=$?
+-	else
+-	    RETVAL=1
+-	fi
++	n=$(iscsi_stop_sessions)
+ 	echo -n "Stopping iSCSI initiator service: "
+-	if [ "$RETVAL" == "0" ]; then
+-	    rm -f $PID_FILE
+-	    status=0
+-	    modprobe -r iscsi_tcp
+-	    if [ "$?" -ne "0" -a "$?" -ne "1" ]; then
+-	    	status=1
+-	    fi
+-	    modprobe -q -r ib_iser
+-            if [ "$?" -ne "0" -a "$?" -ne "1" ]; then
+-	        status=1 
+-            fi
+-	    rc_failed $status
+-	else
++	if [ "$n" ] && [ "$n" != "0" ] ; then
++	    m=$(iscsiadm -m session 2> /dev/null)
++	    if [ -z "$m" ] ; then
++		killproc -KILL $DAEMON
++		RETVAL=$?
++		if grep -q bnx2i /proc/modules && [ -x $BRCM_ISCSIUIO ]; then
++		    killproc -KILL $BRCM_ISCSIUIO
++		fi
++ 		RETVAL=$?
++	    else
++		RETVAL=1
++	    fi
+ 	    rc_failed $RETVAL
++	    rc_status -v
++	else
++	    # umounting failed, leave initiator running
++	    rc_status -s
+ 	fi
+-	rc_status -v
+ 	;;
+     status)
+ 	echo -n "Checking for iSCSI initiator service: "
+@@ -190,7 +446,7 @@ case "$1" in
+ 	    rc_status -v
+ 	fi
+ 	;;
+-    restart)
++    restart|reload)
+ 	$0 stop
+ 	RETVAL=$?
+ 	if [ "$RETVAL" != "0" ]; then
+@@ -201,7 +457,7 @@ case "$1" in
+ 	$0 start
+ 	;;
+     *)
+-	echo "Usage: $0 {start|stop|status|restart}"
++	echo "Usage: $0 {start|stop|status|restart|reload}"
+ 	exit 1
+ 	;;
+ esac
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/etc/iscsid.conf open-iscsi-2.0-872-rc4-bnx2i.sync/etc/iscsid.conf
+--- open-iscsi-2.0-872-rc4-bnx2i/etc/iscsid.conf	2010-07-11 04:05:58.000000000 -0500
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/etc/iscsid.conf	2011-08-14 16:48:25.000000000 -0500
+@@ -39,6 +39,10 @@ iscsid.startup = /sbin/iscsid
+ # To manually startup the session set to "manual". The default is manual.
+ node.startup = manual
+ 
++# For "automatic" startup nodes, setting this to "Yes" will try logins on each
++# available iface until one succeeds, and then stop.  The default "No" will try
++# logins on all availble ifaces simultaneously.
++node.leading_login = No
+ 
+ # *************
+ # CHAP Settings
+@@ -278,6 +282,11 @@ discovery.sendtargets.iscsi.MaxRecvDataS
+ # The default is to never use DataDigests or HeaderDigests.
+ #
+ 
++# For multipath configurations, you may want more than one session to be
++# created on each iface record.  If node.session.nr_sessions is greater
++# than 1, performing a 'login' for that node will ensure that the
++# appropriate number of sessions is created.
++node.session.nr_sessions = 1
+ 
+ #************
+ # Workarounds
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/include/iscsi_err.h open-iscsi-2.0-872-rc4-bnx2i.sync/include/iscsi_err.h
 --- open-iscsi-2.0-872-rc4-bnx2i/include/iscsi_err.h	1969-12-31 18:00:00.000000000 -0600
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/include/iscsi_err.h	2011-02-24 19:54:10.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/include/iscsi_err.h	2011-08-14 16:48:25.000000000 -0500
 @@ -0,0 +1,69 @@
 +/*
 + * Return codes used by iSCSI tools.
@@ -508,156 +1361,2074 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/include/iscsi_err.h open-iscsi-2.0-872-
 +extern char *iscsi_err_to_str(int err);
 +
 +#endif
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/include/iscsi_if.h open-iscsi-2.0-872-rc4-bnx2i.work/include/iscsi_if.h
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/include/iscsi_if.h open-iscsi-2.0-872-rc4-bnx2i.sync/include/iscsi_if.h
 --- open-iscsi-2.0-872-rc4-bnx2i/include/iscsi_if.h	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/include/iscsi_if.h	2011-02-24 19:54:10.000000000 -0600
-@@ -65,6 +65,8 @@ enum iscsi_uevent_e {
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/include/iscsi_if.h	2011-08-14 16:48:25.000000000 -0500
+@@ -64,6 +64,9 @@ enum iscsi_uevent_e {
+ 	ISCSI_UEVENT_TRANSPORT_EP_CONNECT_THROUGH_HOST	= UEVENT_BASE + 19,
  
  	ISCSI_UEVENT_PATH_UPDATE	= UEVENT_BASE + 20,
- 
-+	ISCSI_UEVENT_MAX		= ISCSI_UEVENT_PATH_UPDATE,
++	ISCSI_UEVENT_SET_IFACE_PARAMS	= UEVENT_BASE + 21,
 +
++	ISCSI_UEVENT_MAX		= ISCSI_UEVENT_SET_IFACE_PARAMS,
+ 
  	/* up events */
  	ISCSI_KEVENT_RECV_PDU		= KEVENT_BASE + 1,
- 	ISCSI_KEVENT_CONN_ERROR		= KEVENT_BASE + 2,
-@@ -75,6 +77,8 @@ enum iscsi_uevent_e {
+@@ -75,6 +78,9 @@ enum iscsi_uevent_e {
  
  	ISCSI_KEVENT_PATH_REQ		= KEVENT_BASE + 7,
  	ISCSI_KEVENT_IF_DOWN		= KEVENT_BASE + 8,
++	ISCSI_KEVENT_CONN_LOGIN_STATE   = KEVENT_BASE + 9,
 +
-+	ISCSI_KEVENT_MAX		= ISCSI_KEVENT_IF_DOWN,
++	ISCSI_KEVENT_MAX		= ISCSI_KEVENT_CONN_LOGIN_STATE,
  };
  
  enum iscsi_tgt_dscvr {
-@@ -386,7 +390,7 @@ enum iscsi_host_param {
- #define CAP_HDRDGST		0x10
- #define CAP_DATADGST		0x20
- #define CAP_MULTI_CONN		0x40
--#define CAP_TEXT_NEGO		0x80
-+#define CAP_TEXT_NEGO		0x80	/* support for text requests */
- #define CAP_MARKERS		0x100
- #define CAP_FW_DB		0x200
- #define CAP_SENDTARGETS_OFFLOAD	0x400	/* offload discovery process */
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/actor.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/actor.c
---- open-iscsi-2.0-872-rc4-bnx2i/usr/actor.c	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/actor.c	2011-02-24 19:54:10.000000000 -0600
-@@ -113,14 +113,13 @@ actor_schedule_private(actor_t *thread, 
- 		 * state to scheduled, else add current time to ttschedule and
- 		 * insert in the queue at the correct point */
- 		if (delay_time == 0) {
--			if (poll_in_progress) {
-+			/* For head addition, it must go onto the head of the
-+			   actor_list regardless if poll is in progress or not
-+			 */
-+			if (poll_in_progress && !head) {
- 				thread->state = ACTOR_POLL_WAITING;
--				if (head)
--					list_add(&thread->list,
--						 &poll_list);
--				else
--					list_add_tail(&thread->list,
--						      &poll_list);
-+				list_add_tail(&thread->list,
-+					      &poll_list);
- 			} else {
- 				thread->state = ACTOR_SCHEDULED;
- 				if (head)
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/config.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/config.h
---- open-iscsi-2.0-872-rc4-bnx2i/usr/config.h	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/config.h	2011-02-24 19:54:10.000000000 -0600
-@@ -141,7 +141,8 @@ struct iscsi_sendtargets_config {
- 	int discoveryd_poll_inval;
- 	struct iscsi_auth_config auth;
- 	struct iscsi_connection_timeout_config conn_timeo;
--	struct iscsi_conn_operational_config iscsi;
-+	struct iscsi_conn_operational_config conn_conf;
-+	struct iscsi_session_operational_config session_conf;
+@@ -177,6 +183,10 @@ struct iscsi_uevent {
+ 		struct msg_set_path {
+ 			uint32_t	host_no;
+ 		} set_path;
++		struct msg_set_iface_params {
++			uint32_t	host_no;
++			uint32_t	count;
++		} set_iface_params;
+ 	} u;
+ 	union {
+ 		/* messages k -> u */
+@@ -198,6 +208,11 @@ struct iscsi_uevent {
+ 			uint32_t	cid;
+ 			uint64_t	recv_handle;
+ 		} recv_req;
++		struct msg_conn_login {
++			uint32_t	sid;
++			uint32_t	cid;
++			uint32_t	state; /* enum iscsi_conn_state */
++		} conn_login;
+ 		struct msg_conn_error {
+ 			uint32_t	sid;
+ 			uint32_t	cid;
+@@ -219,6 +234,21 @@ struct iscsi_uevent {
+ 	} r;
+ } __attribute__ ((aligned (sizeof(uint64_t))));
+ 
++enum iscsi_param_type {
++	ISCSI_PARAM,		/* iscsi_param (session, conn, target, LU) */
++	ISCSI_HOST_PARAM,	/* iscsi_host_param */
++	ISCSI_NET_PARAM,	/* iscsi_net_param */
++};
++
++struct iscsi_iface_param_info {
++	uint32_t iface_num;	/* iface number, 0 - n */
++	uint32_t len;		/* Actual length of the param */
++	uint16_t param;		/* iscsi param value */
++	uint8_t iface_type;	/* IPv4 or IPv6 */
++	uint8_t param_type;	/* iscsi_param_type */
++	uint8_t value[0];	/* length sized value follows */
++} __packed;
++
+ /*
+  * To keep the struct iscsi_uevent size the same for userspace code
+  * compatibility, the main structure for ISCSI_UEVENT_PATH_UPDATE and
+@@ -242,6 +272,70 @@ struct iscsi_path {
+ 	uint16_t	pmtu;
+ } __attribute__ ((aligned (sizeof(uint64_t))));
+ 
++/* iscsi iface enabled/disabled setting */
++#define ISCSI_IFACE_DISABLE	0x01
++#define ISCSI_IFACE_ENABLE	0x02
++
++/* ipv4 bootproto */
++#define ISCSI_BOOTPROTO_STATIC		0x01
++#define ISCSI_BOOTPROTO_DHCP		0x02
++
++/* ipv6 addr autoconfig type */
++#define ISCSI_IPV6_AUTOCFG_DISABLE		0x01
++#define ISCSI_IPV6_AUTOCFG_ND_ENABLE		0x02
++#define ISCSI_IPV6_AUTOCFG_DHCPV6_ENABLE	0x03
++
++/* ipv6 link local addr type */
++#define ISCSI_IPV6_LINKLOCAL_AUTOCFG_ENABLE	0x01
++#define ISCSI_IPV6_LINKLOCAL_AUTOCFG_DISABLE	0x02
++
++/* ipv6 router addr type */
++#define ISCSI_IPV6_ROUTER_AUTOCFG_ENABLE	0x01
++#define ISCSI_IPV6_ROUTER_AUTOCFG_DISABLE	0x02
++
++#define ISCSI_IFACE_TYPE_IPV4		0x01
++#define ISCSI_IFACE_TYPE_IPV6		0x02
++
++#define ISCSI_MAX_VLAN_ID		4095
++#define ISCSI_MAX_VLAN_PRIORITY		7
++
++/* iscsi vlan enable/disabled setting */
++#define ISCSI_VLAN_DISABLE	0x01
++#define ISCSI_VLAN_ENABLE	0x02
++
++/* iSCSI network params */
++enum iscsi_net_param {
++	ISCSI_NET_PARAM_IPV4_ADDR		= 1,
++	ISCSI_NET_PARAM_IPV4_SUBNET		= 2,
++	ISCSI_NET_PARAM_IPV4_GW			= 3,
++	ISCSI_NET_PARAM_IPV4_BOOTPROTO		= 4,
++	ISCSI_NET_PARAM_MAC			= 5,
++	ISCSI_NET_PARAM_IPV6_LINKLOCAL		= 6,
++	ISCSI_NET_PARAM_IPV6_ADDR		= 7,
++	ISCSI_NET_PARAM_IPV6_ROUTER		= 8,
++	ISCSI_NET_PARAM_IPV6_ADDR_AUTOCFG	= 9,
++	ISCSI_NET_PARAM_IPV6_LINKLOCAL_AUTOCFG	= 10,
++	ISCSI_NET_PARAM_IPV6_ROUTER_AUTOCFG	= 11,
++	ISCSI_NET_PARAM_IFACE_ENABLE		= 12,
++	ISCSI_NET_PARAM_VLAN_ID			= 13,
++	ISCSI_NET_PARAM_VLAN_PRIORITY		= 14,
++	ISCSI_NET_PARAM_VLAN_ENABLED		= 15,
++	ISCSI_NET_PARAM_IFACE_TYPE		= 16,
++	ISCSI_NET_PARAM_IFACE_NAME		= 17,
++	ISCSI_NET_PARAM_MTU			= 18,
++	ISCSI_NET_PARAM_PORT			= 19,
++};
++
++enum iscsi_conn_state {
++	ISCSI_CONN_STATE_FREE,
++	ISCSI_CONN_STATE_XPT_WAIT,
++	ISCSI_CONN_STATE_IN_LOGIN,
++	ISCSI_CONN_STATE_LOGGED_IN,
++	ISCSI_CONN_STATE_IN_LOGOUT,
++	ISCSI_CONN_STATE_LOGOUT_REQUESTED,
++	ISCSI_CONN_STATE_CLEANUP_WAIT,
++};
++
+ /*
+  * Common error codes
+  */
+@@ -268,6 +362,7 @@ enum iscsi_err {
+ 	ISCSI_ERR_INVALID_HOST		= ISCSI_ERR_BASE + 18,
+ 	ISCSI_ERR_XMIT_FAILED		= ISCSI_ERR_BASE + 19,
+ 	ISCSI_ERR_TCP_CONN_CLOSE	= ISCSI_ERR_BASE + 20,
++	ISCSI_ERR_SCSI_EH_SESSION_RST	= ISCSI_ERR_BASE + 21,
  };
  
- struct iscsi_isns_config {
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/cxgb3i.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/cxgb3i.c
---- open-iscsi-2.0-872-rc4-bnx2i/usr/cxgb3i.c	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/cxgb3i.c	1969-12-31 18:00:00.000000000 -0600
-@@ -1,24 +0,0 @@
--/*
-- * cxgb3i helpers
-- *
-- * Copyright (C) 2006 Mike Christie
-- * Copyright (C) 2006 Red Hat, Inc. All rights reserved.
-- *
-- * This program is free software; you can redistribute it and/or modify
-- * it under the terms of the GNU General Public License as published
-- * by the Free Software Foundation; either version 2 of the License, or
-- * (at your option) any later version.
-- *
-- * This program is distributed in the hope that it will be useful, but
-- * WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- * General Public License for more details.
-- */
--#include "initiator.h"
--
--void cxgb3i_create_conn(struct iscsi_conn *conn)
--{
--	/* card can handle up to 15360 bytes */
--	if (conn->max_recv_dlength > 8192)
--		conn->max_recv_dlength = 8192;
--}
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/cxgb3i.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/cxgb3i.h
---- open-iscsi-2.0-872-rc4-bnx2i/usr/cxgb3i.h	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/cxgb3i.h	1969-12-31 18:00:00.000000000 -0600
-@@ -1,8 +0,0 @@
--#ifndef CXGB3I_TRANSPORT
--#define CXGB3I_TRANSPORT
--
--struct iscsi_conn;
--
--extern void cxgb3i_create_conn(struct iscsi_conn *conn);
--
--#endif
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/cxgbi.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/cxgbi.c
---- open-iscsi-2.0-872-rc4-bnx2i/usr/cxgbi.c	1969-12-31 18:00:00.000000000 -0600
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/cxgbi.c	2011-02-24 19:54:10.000000000 -0600
-@@ -0,0 +1,24 @@
-+/*
-+ * cxgb3i/cxgb4i helpers
-+ *
-+ * Copyright (C) 2006 Mike Christie
-+ * Copyright (C) 2006 Red Hat, Inc. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published
-+ * by the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful, but
-+ * WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ * General Public License for more details.
-+ */
-+#include "initiator.h"
+ /*
+@@ -296,7 +391,7 @@ enum iscsi_param {
+ 	ISCSI_PARAM_PERSISTENT_PORT,
+ 	ISCSI_PARAM_SESS_RECOVERY_TMO,
+ 
+-	/* pased in through bind conn using transport_fd */
++	/* passed in through bind conn using transport_fd */
+ 	ISCSI_PARAM_CONN_PORT,
+ 	ISCSI_PARAM_CONN_ADDRESS,
+ 
+@@ -318,6 +413,7 @@ enum iscsi_param {
+ 	ISCSI_PARAM_INITIATOR_NAME,
+ 
+ 	ISCSI_PARAM_TGT_RESET_TMO,
++	ISCSI_PARAM_TARGET_ALIAS,
+ 	/* must always be last */
+ 	ISCSI_PARAM_MAX,
+ };
+@@ -358,6 +454,7 @@ enum iscsi_param {
+ #define ISCSI_ISID			(1ULL << ISCSI_PARAM_ISID)
+ #define ISCSI_INITIATOR_NAME		(1ULL << ISCSI_PARAM_INITIATOR_NAME)
+ #define ISCSI_TGT_RESET_TMO		(1ULL << ISCSI_PARAM_TGT_RESET_TMO)
++#define ISCSI_TARGET_ALIAS		(1ULL << ISCSI_PARAM_TARGET_ALIAS)
+ 
+ /* iSCSI HBA params */
+ enum iscsi_host_param {
+@@ -394,6 +491,7 @@ enum iscsi_host_param {
+ #define CAP_DIGEST_OFFLOAD	0x1000	/* offload hdr and data digests */
+ #define CAP_PADDING_OFFLOAD	0x2000	/* offload padding insertion, removal,
+ 					 and verification */
++#define CAP_LOGIN_OFFLOAD	0x4000  /* offload normal session login */
+ 
+ /*
+  * These flags describes reason of stop_conn() call
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/Makefile open-iscsi-2.0-872-rc4-bnx2i.sync/Makefile
+--- open-iscsi-2.0-872-rc4-bnx2i/Makefile	2010-07-11 04:05:58.000000000 -0500
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/Makefile	2011-08-14 16:48:25.000000000 -0500
+@@ -24,10 +24,10 @@ IFACEFILES = etc/iface.example
+ # using '$(MAKE)' instead of just 'make' allows make to run in parallel
+ # over multiple makefile.
+ 
+-all: user kernel
++all: user
+ 
+ user: ;
+-	cd utils/open-isns; ./configure; $(MAKE)
++	cd utils/open-isns; ./configure --with-security=no; $(MAKE)
+ 	$(MAKE) -C utils/sysdeps
+ 	$(MAKE) -C utils/fwparam_ibft
+ 	$(MAKE) -C usr
+@@ -68,7 +68,7 @@ clean:
+ 	install_initd_suse install_initd_redhat install_initd_debian \
+ 	install_etc install_iface install_doc install_kernel install_iname
+ 
+-install: install_kernel install_programs install_doc install_etc \
++install: install_programs install_doc install_etc \
+ 	install_initd install_iname install_iface
+ 
+ install_user: install_programs install_doc install_etc \
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/README open-iscsi-2.0-872-rc4-bnx2i.sync/README
+--- open-iscsi-2.0-872-rc4-bnx2i/README	2010-07-11 04:05:58.000000000 -0500
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/README	2011-08-14 16:48:25.000000000 -0500
+@@ -371,9 +371,10 @@ Usage: iscsiadm [OPTION]
+ 			  iscsi_ifacename.
+ 
+ 			  See below for examples.
+-  -m host --host=hostno --print=level
+-			  Display information for a specific host if hostno
+-			  is passed in. If no hostno is passed in then info
++  -m host --host=hostno|MAC --print=level
++			  Display information for a specific host. The host
++			  can be passed in by host number or by MAC address.
++			  If a host is not passed in then info
+ 			  for all hosts is printed.
+ 
+ 			  Print level can be 0 to 4.
+@@ -408,8 +409,9 @@ this the following is not needed for sof
+ Warning!!!!!!
+ This feature is experimental. The interface may change. When reporting
+ bugs, if you cannot do a "ping -I ethX target_portal", then check your
+-network settings first. If you cannot ping the portal, then you will
+-not be able to bind a session to a NIC.
++network settings first. Make sure the rp_filter setting is set to 0 or 2
++(see Prep section below for more info). If you cannot ping the portal,
++then you will not be able to bind a session to a NIC.
+ 
+ What is a scsi_host and iface for software, hardware and partial
+ offload iscsi?
+@@ -427,6 +429,32 @@ structure. For each HBA port or for soft
+ device (ethX) or NIC, that you wish to bind sessions to you must create
+ a iface config /etc/iscsi/ifaces.
+ 
++Prep:
++
++The iface binding feature requires the sysctl setting
++net.ipv4.conf.default.rp_filter to be set to 0 or 2. This can be set
++in /etc/sysctl.conf by having the line:
++
++net.ipv4.conf.default.rp_filter = N
++
++where N is 0 or 2. Note that when setting this you may have to reboot
++the box for the value to take effect.
++
++
++rp_filter information from Documentation/networking/ip-sysctl.txt:
++
++rp_filter - INTEGER
++        0 - No source validation.
++        1 - Strict mode as defined in RFC3704 Strict Reverse Path
++            Each incoming packet is tested against the FIB and if the interface
++            is not the best reverse path the packet check will fail.
++            By default failed packets are discarded.
++        2 - Loose mode as defined in RFC3704 Loose Reverse Path
++            Each incoming packet's source address is also tested against the FIB
++            and if the source address is not reachable via any interface
++            the packet check will fail.
++
++
+ Running:
+ 
+ # iscsiadm -m iface
+@@ -488,10 +516,10 @@ some helpful management commands.
+ 5.1.2 Setting up a iface for a iSCSI offload card
+ =================================================
+ 
+-This section describes how to setup ifaces for use with Chelsio
+-and Broadcom cards.
++This section describes how to setup ifaces for use with Chelsio, Broadcom and
++QLogic cards.
+ 
+-By default, iscsiadm will create a iface for each Broadcom and Chelsio
++By default, iscsiadm will create a iface for each Broadcom, QLogic and Chelsio
+ port. The iface name will be of the form:
+ 
+ $transport/driver_name.$MAC_ADDRESS
+@@ -502,6 +530,7 @@ Running:
+ default tcp,<empty>,<empty>,<empty>,<empty>
+ iser iser,<empty>,<empty>,<empty>,<empty>
+ cxgb3i.00:07:43:05:97:07 cxgb3i,00:07:43:05:97:07,<empty>,<empty>,<empty>
++qla4xxx.00:0e:1e:04:8b:2e qla4xxx,00:0e:1e:04:8b:2e,<empty>,<empty>,<empty>
+ 
+ 
+ Will report iface configurations that are setup in /etc/iscsi/ifaces.
+@@ -520,7 +549,7 @@ default one in /etc/iscsi/initiatorname.
+ 
+ 
+ 
+-To display these values in a more friendly run:
++To display these values in a more friendly way, run:
+ 
+ iscsiadm -m iface -I cxgb3i.00:07:43:05:97:07
+ # BEGIN RECORD 2.0-871
+@@ -544,6 +573,38 @@ For the name of the value we want to upd
+ the "iscsiadm -m iface -I cxgb3i.00:07:43:05:97:07" command which is
+ "iface.ipaddress".
+ 
++Note2.
++
++For QLogic ports after updating the iface record, for network settings to take
++effect, one must apply or applyall the settings.
++
++iscsiadm -m iface -I qla4xxx.00:0e:1e:04:8b:2e -o apply or
++iscsiadm -m iface -H 00:0e:1e:04:8b:2e -o applyall
++
++With operation "apply" network setting for the specified iface will take effect.
++With operation "applyall" network settings for all ifaces on a specific host
++will take take effect. The host can be specified using the -H/--host argument
++by either the MAC address of the host or the host number.
++
++
++Here is an example of setting multiple IPv6 address on single iSCSI interface
++port.
++First interface (no need to set iface_num, it is 0 by default)
++
++iscsiadm -m iface -I qla4xxx.00:0e:1e:04:8b:2a -o update \
++	 -n iface.ipaddress -v fec0:ce00:7014:0041:1111:2222:1e04:9392
++
++Create the second interface if it does not exist
++
++iscsiadm -m iface -I qla4xxx.00:0e:1e:04:8b:2a.1 -op=new
++iscsiadm -m iface -I qla4xxx.00:0e:1e:04:8b:2a -o update \
++	 -n iface.iface_num -v 1 (iface_num is mandatory for second iface)
++iscsiadm -m iface -I qla4xxx.00:0e:1e:04:8b:2a -o update \
++	 -n iface.ipaddress -v = fec0:ce00:7014:0041:1111:2222:1e04:9393
++iscsiadm -m iface -H 00:0e:1e:04:8b:2a --op=applyall
++
++Note: If there are common settings for multiple interfaces then the
++settings from 0th iface would be considered valid.
+ 
+ Now, we can use this iface to login into targets, which is described in the
+ next section.
+@@ -624,6 +685,9 @@ To now log into targets it is the same a
+ 	If a record does not exist, it will be created using the iscsid.conf
+ 	discovery settings.
+ 
++	The argument to -p may also be a hostname instead of an address.
++	    ./iscsiadm -m discoverydb -t st -p smoehost --discover
++
+ 	For the ifaces, iscsiadm will first search /etc/iscsi/ifaces for
+ 	interfaces using software iscsi. If any are found then nodes found
+ 	during discovery will be setup so that they can logged in through
+@@ -748,6 +812,10 @@ To now log into targets it is the same a
+ 	    ./iscsiadm -m node -T iqn.2005-03.com.max \
+ 				-p [2001:c90::211:9ff:feb8:a9e9]:3260 -l
+ 
++	To specify a hostname the following can be used:
++
++	    ./iscsiadm -m node -T iqn.2005-03.com.max -p somehost -l
++
+     - iSCSI Login to a specific portal through the NIC setup as iface0:
+ 
+ 	    ./iscsiadm -m node -T iqn.2005-03.com.max -p 192.168.0.4:3260 \
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/TODO open-iscsi-2.0-872-rc4-bnx2i.sync/TODO
+--- open-iscsi-2.0-872-rc4-bnx2i/TODO	1969-12-31 18:00:00.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/TODO	2011-08-14 16:48:25.000000000 -0500
+@@ -0,0 +1,404 @@
++iSCSI DEVELOPMENT HOWTO AND TODO
++--------------------------------
++July 7th 2011
++
++
++If you are admin or user and just want to send a fix, just send the fix any
++way you can. We can port the patch to the proper tree and fix up the patch
++for you. Engineers that would like to do more advanced development then the
++following guideline should be followed.
++
++Submitting Patches
++------------------
++Code should follow the Linux kernel codying style doc:
++http://www.kernel.org/doc/Documentation/CodingStyle
++
++Patches should be submitted to the open-iscsi list open-iscsi at googlegroups.com.
++They should be made with "git diff" or "diff -up" or "diff -uprN", and
++kernel patches must have a "Signed-off-by" line. See section 12
++http://www.kernel.org/doc/Documentation/SubmittingPatches for more
++information on the the signed off line.
++
++Getting the Code
++----------------
++Kernel patches should be made against the linux-2.6-iscsi tree. This can
++be downloaded from kernel.org with git with the following commands:
++
++git clone git://git.kernel.org/pub/scm/linux/kernel/git/mnc/linux-2.6-iscsi.git
++
++Userspace patches should be made against the open-iscsi git tree:
++
++git clone git://git.kernel.org/pub/scm/linux/kernel/git/mnc/open-iscsi.git
++
++
++
++KERNEL TODO ITEMS
++-----------------
++
++1. Make iSCSI log messages humanly readable. In many cases the iscsi tools
++and modules will log a error number value. The most well known is conn
++error 1011. Users should not have to search on google for what this means.
++
++We should:
++
++1. Write a simple table to convert the error values to a string and print
++them out.
++
++2. Document the values, how you commonly hit them and common solutions
++in the iSCSI docs.
++
++See scsi_transport_iscsi.c:iscsi_conn_error_event for where the evil
++"detected conn error 1011" is printed. See the enum iscsi_err in iscsi_if.h
++for a definition of the error code values.
++
++---------------------------------------------------------------------------
++
++2. Implement iSCSI dev loss support.
++
++Currently if a session is down for longer than replacement/recovery_timeout
++seconds, the iscsi layer will unblock the devices and fail IO. Other
++transport, like FC and SAS, will do something similar. FC has a
++fast_io_fail tmo which will unblock devices and fail IO, then it has a
++dev_loss_tmo which will delete the devices accessed through that port.
++
++iSCSI needs to implement dev_loss_tmo behavior, because apps are beginning
++to expect this behavior. An initial path was made here:
++http://groups.google.com/group/open-iscsi/msg/031510ab4cecccfd?dmode=source 
++
++Since all drivers want this behavior we want to make it common. We need to
++change the patch in that link to add a dev_loss_tmo handler callback to the
++scsi_transport_template struct, and add some common sysfs and helpers
++functions to manage the dev_loss_tmo variable.
++
++
++*Being worked on by Vikek S
++
++---------------------------------------------------------------------------
++
++3. Reduce locking contention between session lock.
++
++The session lock is basically one big lock that protects everything
++in the iscsi_session. This lock could be broken down into smaller locks
++and maybe even replaced with something that would not require a lock.
++
++For example:
++
++1. The session lock serializes access to the current R2T the initiator is
++handling (a R2T from the target or the initialR2T if being used). libiscsi/
++libiscsi_tcp will call iscsi_tcp_get_curr_r2t and grab the session lock in
++the xmit path from the xmit thread and then in the recv path
++libiscsi_tcp/iscsi_tcp will call iscsi_tcp_r2t_rsp (this function is called
++with the session lock held). We could add a new per iscsi_task lock and
++use that to gaurd the R2T.
++
++2. For iscsi_tcp and cxgb*i, libiscsi uses the session->cmdqueue linked list
++and the session lock to queue IO from the queuecommand function (run from
++scsi softirq or kblockd context) to the iscsi xmit thread. Once the task is
++sent from that thread, it is deleted from the list.
++
++It seems we should be able to remove the linked list use here. The tasks
++are all preallocated in the session->cmds array. We can access that
++array and check the task->state (see fail_scsi_tasks for an example).
++We just need to come up with a way to safely set the task state,
++wake the xmit thread and make sure that tasks are executed in the order
++that the scsi layer sent them to our queuecommand function.
++
++A starting point on the queueing:
++We might be able to create a workqueue per processor, queue the work,
++which in this case is the execution of the task, from the queuecommand,
++then rely on the work queue synchronization and serialization code.
++Not 100% sure about this.
++
++Alternative to changing the threading:
++Can we figure out a way to just remove the xmit thread? We currently
++cannot because the network may only be able to send 1000 bytes, but
++to send the current command we need to send 2000. We cannot sleep
++from the queuecommand context until another 1000 bytes frees up and for
++iscsi_tcp we cannot sleep from the recv conext (this happens because we
++could have got a R2T from target and are handling it from the recv path).
++
++
++Note: that for iser and offload drivers like bnx2i and be2iscsi their
++is no xmit thread used.
++
++Note2: cxgb*i does not actually need the xmit thread so a side project
++could be to convert that driver.
++
++
++---------------------------------------------------------------------------
++
++4. Make memory access more efficient on multi-processor machines.
++We are moving twords per process queues in the block layer, so it would
++be a good idea to move the iscsi structs to be allocated on a per process
++basis.
++
++---------------------------------------------------------------------------
++
++5. Make blk_iopoll support (see block/blk-iopoll.c and be2iscsi for an
++example) being able to round robin IO across processors or complete
++on the processor it was queued on
++(today it always completes the IO on the processor the softirq was raised on),
++and convert bnx2i, ib_iser and cxgb*i to it.
++
++Not sure if it will help iscsi_tcp and cxgb, because their completion is done
++from the network softirq which does polling already. With irq balancing it
++can also be spread over all processors too.
++
++---------------------------------------------------------------------------
++
++6. Replace iscsi_get_next_target_id with idr use.
++
++iscsi_tcp and ib_iser allocate a session per host, so the target_id is
++always just 0. The offload drivers allocate a host per pci resource, so they
++will have multiple sessions for each host. When a session is added,
++iscsi_add_session will try to find a target_id to use by looping over
++all the targets on the host. We could replace that loop with idr.
++
++
++* Being worked on by John Jose.
++
++---------------------------------------------------------------------------
++
++7. When userspace calls into the kernel using the iscsi netlink interface
++to execute oprations like creating/destroying a session, create a connection
++to a target, etc the rx_queue_mutex is held the entire time (see
++iscsi_if_rx for the iscsi netlink interface entry point). This means
++if the driver should block every thing will be held up.
++
++iscsi_tcp does not block, but some offload drivers might for a couple seconds
++to 10 or 15 secs while it figures out what is going on or cleans up. This a 
++major problem for things like multipath where one connection blocking up the
++recovery of every other connection will delay IO from re-flowing quickly.
++
++We should looking into breaking up the rx_queue_mutex into finer grained
++locks or making it multi threaded. For the latter we could queue operations
++into workqueues.
++
++---------------------------------------------------------------------------
++
++7. Add tracing support to iscsi modules. See the scsi layer's
++trace_scsi_dispatch_cmd_start for an example.
++
++Well, actually in general look into all the tracing stuff available
++(trace_printk/ftrace, etc) and use one.
++
++See http://lwn.net/Articles/291091/ for some details on what is out
++there. We can only use something that is upstream though.
++
++---------------------------------------------------------------------------
++
++8. Improve the iscsi driver logging. Each driver has a different
++way to control logging. We should unify them and make it managable
++by iscsiadm. So each driver would use a common format, there would
++be a common kernel interface to set the logging level, etc.
++
++---------------------------------------------------------------------------
++
++9. Implement more features from the iSCSI RFC if they are worth it.
++
++- Error Recovery Level (ERL) 1 support - will help tape support.
++- Multi R2T support - Might improve write performance.
++- OutOfOrder support - Might imrpove performance.
++
++---------------------------------------------------------------------------
++
++10. Add support for digest/CRC offload.
++
++---------------------------------------------------------------------------
++
++11. Finish intel IOAT support. I started this here:
++http://groups.google.com/group/open-iscsi/msg/2626b8606edbe690?dmode=source
++but could only test on boxes with 1 gig interfaces which showed no
++difference in performance. Intel had said they saw significant throughput
++gains when using 10 gig.
++
++---------------------------------------------------------------------------
++
++12. Remove the login buffer preallocated buffer. Storage drivers must be able
++to make forward process, so that they can always write out a page incase the
++kernel needs to allocate the page to another process. If the connection were
++to be disconnected and the initiator needed to relogin to the target at this
++time, we might not be abe to allocate a page for the login commands buffer.
++
++To work around the problem the initiator prealloctes a 8K (sometimes
++more depending on the page size) buffer for each session (see iscsi_conn_setup'
++s __get_free_pages call). This is obviously very wasteful since it will be
++a rate occurance. Can we think of a way to allow multiple sessions to
++be relogged in at the same time, but not have to preallocate so many
++buffers?
++
++---------------------------------------------------------------------------
++
++13. Support iSCSI over swap safely.
++
++Basically just need to hook iscsi_tcp into the patches that
++were submitted here for NBD.
++
++https://lwn.net/Articles/446831/
++
++
++---------------------------------------------------------------------------
++
++
++
++
++
++USERSPACE TODO ITEMS
++--------------------
++1. The iscsi tools, iscsid, iscsiadm and iscsid, have a debug flag, -d N, that
++allows the user to control the amount of output that is logged. The argument
++N is a integer from 1 to 8, with 8 printing out the most output.
++
++The problem is that the values from 1 to 8 do not really mean much. It would
++helpful if we could replace them with something that controls what exactly
++the iscsi tools and kernel modules log.
++
++For example, if we made the debug level argument a bitmap then
++
++iscsiadm -m node --login -d LOGIN_ERRS,PDUS,FUNCTION
++
++might print out extended iscsi login error information (LOGIN_ERRS),
++the iSCSI packets that were sent/receieved (PDUS), and the functions
++that were run (FUNCTION). Note, the use of a bitmapp and the debug
++levels are just an example. Feel free to do something else.
++
++
++We would want to be able to have iscsiadm control the iscsi kernel
++logging as well. There are interfaces like
++/sys/module/libiscsi/paramters/*debug*
++/sys/module/libiscsi_tcp/paramters/*debug*
++/sys/module/iscsi_tcp/paramters/*debug*
++/sys/module/scsi_transport_iscsi/paramters/*debug*
++
++but we would want to extend the debugging options to be finer grained
++and we would want to make it supportable by all iscsi drivers.
++(see #8 on the kernel todo).
++
++---------------------------------------------------------------------------
++
++2. "iscsiadm -m session -P 3" can print out a lot of information about the
++session, but not all configuration values are printed.
++
++iscsiadm should be modified to print out other settings like timeouts,
++Chap settings,  the iSCSI values that were requested vs negotiated for, etc.
++
++---------------------------------------------------------------------------
++
++3. iscsiadm cannot update a setting of a running session. If you want
++to change a timeout you have to run the iscsiadm logout command,
++then update the record value, then login:
++
++iscsiadm -m node -T target -p ip -u
++iscsidm -m node -T target -p ip -o update -n node.session.timeo.replacement_timeout -v 30
++iscsiadm -m node -T target -p ip -l
++
++iscsiadm should be modified to allow updating of a setting without having
++to run the iscsiadm command.
++
++Note that for some settings like iSCSI ones (ImmediateData, FirstBurstLength,
++etc)  that must be negotiated with the target we will have to logout the
++target then re-login, but we should not have to completely destroy the session
++and scsi devices like is done when running the iscsiadm logout command. We
++should be able to pass iscsid the new values and then have iscsid logout and
++relogin.
++
++Other settings like the abort timeout will not need a logout/login. We can
++just pass those to the kernel or iscsid to use.
++
++
++*Being worked on by Tomoaki Nishimura
++
++---------------------------------------------------------------------------
++
++4. iscsiadm will attempt to perform logins/logouts in parallel. Running
++iscsiadm -m node -L, will cause iscsiadm to login to all portals with
++the startup=automatic field set at the same time.
++
++To log into a target, iscsiadm opens a socket to iscsid, sends iscsid a
++request to login to a target, iscsid performs the iSCSI login operation,
++then iscsid sends iscsiadm a reply.
++
++To perform multiple logins iscsiadm will open a socket for each login
++request, then wait for a reply. This is a problem because for 1000s of targets
++we will have 1000s of sockets open. There is a rlimit to control how many
++files a process can have open and iscsiadm currently runs setrlimit to
++increase this.
++
++With users creating lots of virtual iscsi interfaces on the target and
++initiator with each having multiple paths it beomes inefficient to open
++a socket for each requests.
++
++At the very least we want to handle setrlimit RLIMIT_NOFILE limit better,
++and it would be best to just stop openening a socket per login request.
++
++---------------------------------------------------------------------------
++
++5. Make iSCSI log messages humanly readable. In many cases the iscsi tools
++will log a error number value. The most well known is conn error 1011.
++Users should not have to search on google for what this means.
++
++We should:
++
++1. Write a simple table to convert the error values to a string and print
++them out.
++
++2. Document the values, how you commonly hit them and common solutions
++in the iSCSI docs.
++
++
++See session_conn_error and __check_iscsi_status_class as a start.
++
++---------------------------------------------------------------------------
++
++6. Implement broadcast/multicasts support, so the initiator can
++find iSNS servers without the user having to set the iSNS server address.
++
++See
++5.6.5.14. Name Service Heartbeat (Heartbeat)
++in
++http://tools.ietf.org/html//rfc4171
++
++---------------------------------------------------------------------------
++
++7. Open-iscsi uses the open-isns iSNS library. The library might be a little
++too complicated and a little too heavy for what we need. Investigate
++replacing it.
++
++Also explore merging the open-isns and linux-isns projects, so we do not have
++to support multiple isns clients/servers in linux.
++
++---------------------------------------------------------------------------
++
++8. Implement the DHCP iSNS option support, so we the initiator can
++find the iSNS sever without the user having to set the iSNS server address.
++See:
++http://www.ietf.org/rfc/rfc4174.txt
++
++---------------------------------------------------------------------------
++
++9. Some iscsiadm/iscsid operations that access the iscsi DB and sysfs can be
++up to Big O(N^2). Some of the code was written when we thought 64 sessions
++would be a lot and the norm would be 4 or 8. Due to virtualization, cloud use,
++and targets like equallogic that do a target per logical unit (device) we can
++see 1000s of sessions.
++
++- We should look into making the record DB more efficient. Maybe
++time to use a real DB (something small simple and efficient since this
++needs to run in places like the initramfs).
++
++- Rewrite code to look up a running session so we do not have loop
++over every session in sysfs.
++
++
++---------------------------------------------------------------------------
++
++10. Look into using udev's libudev for our sysfs access in iscsiadm/iscsid/
++iscsistart.
++
++---------------------------------------------------------------------------
++
++11. iSCSI lib.
++
++I am working on this one. Hopefully it should be done soon.
++
++---------------------------------------------------------------------------
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/actor.c open-iscsi-2.0-872-rc4-bnx2i.sync/usr/actor.c
+--- open-iscsi-2.0-872-rc4-bnx2i/usr/actor.c	2010-07-11 04:05:58.000000000 -0500
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/actor.c	2011-08-14 16:48:25.000000000 -0500
+@@ -113,14 +113,13 @@ actor_schedule_private(actor_t *thread, 
+ 		 * state to scheduled, else add current time to ttschedule and
+ 		 * insert in the queue at the correct point */
+ 		if (delay_time == 0) {
+-			if (poll_in_progress) {
++			/* For head addition, it must go onto the head of the
++			   actor_list regardless if poll is in progress or not
++			 */
++			if (poll_in_progress && !head) {
+ 				thread->state = ACTOR_POLL_WAITING;
+-				if (head)
+-					list_add(&thread->list,
+-						 &poll_list);
+-				else
+-					list_add_tail(&thread->list,
+-						      &poll_list);
++				list_add_tail(&thread->list,
++					      &poll_list);
+ 			} else {
+ 				thread->state = ACTOR_SCHEDULED;
+ 				if (head)
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/auth.c open-iscsi-2.0-872-rc4-bnx2i.sync/usr/auth.c
+--- open-iscsi-2.0-872-rc4-bnx2i/usr/auth.c	2010-07-11 04:05:58.000000000 -0500
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/auth.c	2011-08-14 16:48:25.000000000 -0500
+@@ -194,27 +194,20 @@ get_random_bytes(unsigned char *data, un
+ 	fd = open("/dev/urandom", O_RDONLY);
+         while (length > 0) {
+ 
+-		if (fd)
+-			read(fd, &r, sizeof(long));
+-		else
++		if (!fd || read(fd, &r, sizeof(long)) != -1)
+ 			r = rand();
+                 r = r ^ (r >> 8);
+                 r = r ^ (r >> 4);
+                 n = r & 0x7;
+ 
+-		if (fd)
+-			read(fd, &r, sizeof(long));
+-		else
++		if (!fd || read(fd, &r, sizeof(long)) != -1)
+ 			r = rand();
+                 r = r ^ (r >> 8);
+                 r = r ^ (r >> 5);
+                 n = (n << 3) | (r & 0x7);
+ 
+-		if (fd)
+-			read(fd, &r, sizeof(long));
+-		else
++		if (!fd || read(fd, &r, sizeof(long)) != -1)
+ 			r = rand();
+-
+                 r = r ^ (r >> 8);
+                 r = r ^ (r >> 5);
+                 n = (n << 2) | (r & 0x3);
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/config.h open-iscsi-2.0-872-rc4-bnx2i.sync/usr/config.h
+--- open-iscsi-2.0-872-rc4-bnx2i/usr/config.h	2010-07-11 04:05:58.000000000 -0500
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/config.h	2011-08-14 16:48:25.000000000 -0500
+@@ -141,7 +141,8 @@ struct iscsi_sendtargets_config {
+ 	int discoveryd_poll_inval;
+ 	struct iscsi_auth_config auth;
+ 	struct iscsi_connection_timeout_config conn_timeo;
+-	struct iscsi_conn_operational_config iscsi;
++	struct iscsi_conn_operational_config conn_conf;
++	struct iscsi_session_operational_config session_conf;
+ };
+ 
+ struct iscsi_isns_config {
+@@ -188,21 +189,46 @@ typedef struct session_rec {
+ 	int					cmds_max;
+ 	int					queue_depth;
+ 	int					initial_login_retry_max;
++	int					nr_sessions;
+ 	struct iscsi_auth_config		auth;
+ 	struct iscsi_session_timeout_config	timeo;
+ 	struct iscsi_error_timeout_config	err_timeo;
+ 	struct iscsi_session_operational_config	iscsi;
++	struct session_info			*info;
++	unsigned                                sid;
++	/*
++	 * This is a flag passed to iscsid.  If set, multiple sessions are
++	 * allowed to be initiated on this record
++	 */
++	unsigned char                           multiple;
+ } session_rec_t;
+ 
+ #define ISCSI_TRANSPORT_NAME_MAXLEN 16
++#define ISCSI_MAX_STR_LEN 80
+ 
+ typedef struct iface_rec {
+ 	struct list_head	list;
+ 	/* iscsi iface record name */
+ 	char			name[ISCSI_MAX_IFACE_LEN];
++	uint32_t		iface_num;
+ 	/* network layer iface name (eth0) */
+ 	char			netdev[IFNAMSIZ];
+ 	char			ipaddress[NI_MAXHOST];
++	char			subnet_mask[NI_MAXHOST];
++	char			gateway[NI_MAXHOST];
++	char			bootproto[ISCSI_MAX_STR_LEN];
++	char			ipv6_linklocal[NI_MAXHOST];
++	char			ipv6_router[NI_MAXHOST];
++	char			ipv6_autocfg[NI_MAXHOST];
++	char			linklocal_autocfg[NI_MAXHOST];
++	char			router_autocfg[NI_MAXHOST];
++	uint16_t		vlan_id;
++	uint8_t			vlan_priority;
++	char			vlan_state[ISCSI_MAX_STR_LEN];
++	char			state[ISCSI_MAX_STR_LEN]; /* 0 = disable,
++							   * 1 = enable */
++	uint16_t		mtu;
++	uint16_t		port;
+ 	/*
+ 	 * TODO: we may have to make this bigger and interconnect
+ 	 * specific for infinniband 
+@@ -222,6 +248,7 @@ typedef struct node_rec {
+ 	char			name[TARGET_NAME_MAXLEN];
+ 	int			tpgt;
+ 	iscsi_startup_e		startup;
++	int			leading_login;
+ 	session_rec_t		session;
+ 	conn_rec_t		conn[ISCSI_CONN_MAX];
+ 	iface_rec_t		iface;
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/cxgb3i.c open-iscsi-2.0-872-rc4-bnx2i.sync/usr/cxgb3i.c
+--- open-iscsi-2.0-872-rc4-bnx2i/usr/cxgb3i.c	2010-07-11 04:05:58.000000000 -0500
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/cxgb3i.c	1969-12-31 18:00:00.000000000 -0600
+@@ -1,24 +0,0 @@
+-/*
+- * cxgb3i helpers
+- *
+- * Copyright (C) 2006 Mike Christie
+- * Copyright (C) 2006 Red Hat, Inc. All rights reserved.
+- *
+- * This program is free software; you can redistribute it and/or modify
+- * it under the terms of the GNU General Public License as published
+- * by the Free Software Foundation; either version 2 of the License, or
+- * (at your option) any later version.
+- *
+- * This program is distributed in the hope that it will be useful, but
+- * WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+- * General Public License for more details.
+- */
+-#include "initiator.h"
+-
+-void cxgb3i_create_conn(struct iscsi_conn *conn)
+-{
+-	/* card can handle up to 15360 bytes */
+-	if (conn->max_recv_dlength > 8192)
+-		conn->max_recv_dlength = 8192;
+-}
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/cxgb3i.h open-iscsi-2.0-872-rc4-bnx2i.sync/usr/cxgb3i.h
+--- open-iscsi-2.0-872-rc4-bnx2i/usr/cxgb3i.h	2010-07-11 04:05:58.000000000 -0500
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/cxgb3i.h	1969-12-31 18:00:00.000000000 -0600
+@@ -1,8 +0,0 @@
+-#ifndef CXGB3I_TRANSPORT
+-#define CXGB3I_TRANSPORT
+-
+-struct iscsi_conn;
+-
+-extern void cxgb3i_create_conn(struct iscsi_conn *conn);
+-
+-#endif
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/cxgbi.c open-iscsi-2.0-872-rc4-bnx2i.sync/usr/cxgbi.c
+--- open-iscsi-2.0-872-rc4-bnx2i/usr/cxgbi.c	1969-12-31 18:00:00.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/cxgbi.c	2011-08-14 16:48:25.000000000 -0500
+@@ -0,0 +1,24 @@
++/*
++ * cxgb3i/cxgb4i helpers
++ *
++ * Copyright (C) 2006 Mike Christie
++ * Copyright (C) 2006 Red Hat, Inc. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published
++ * by the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful, but
++ * WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * General Public License for more details.
++ */
++#include "initiator.h"
++
++void cxgbi_create_conn(struct iscsi_conn *conn)
++{
++	/* card can handle up to 15360 bytes */
++	if (conn->max_recv_dlength > 8192)
++		conn->max_recv_dlength = 8192;
++}
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/cxgbi.h open-iscsi-2.0-872-rc4-bnx2i.sync/usr/cxgbi.h
+--- open-iscsi-2.0-872-rc4-bnx2i/usr/cxgbi.h	1969-12-31 18:00:00.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/cxgbi.h	2011-08-14 16:48:25.000000000 -0500
+@@ -0,0 +1,8 @@
++#ifndef CXGBI_TRANSPORT
++#define CXGBI_TRANSPORT
++
++struct iscsi_conn;
++
++extern void cxgbi_create_conn(struct iscsi_conn *conn);
++
++#endif
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/dcb_app.c open-iscsi-2.0-872-rc4-bnx2i.sync/usr/dcb_app.c
+--- open-iscsi-2.0-872-rc4-bnx2i/usr/dcb_app.c	1969-12-31 18:00:00.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/dcb_app.c	2011-08-14 16:48:25.000000000 -0500
+@@ -0,0 +1,387 @@
++/*******************************************************************************
++
++  DCB application support
++  Copyright(c) 2007-2011 Intel Corporation.
++
++  This program is free software; you can redistribute it and/or modify it
++  under the terms and conditions of the GNU General Public License,
++  version 2, as published by the Free Software Foundation.
++
++  This program is distributed in the hope it will be useful, but WITHOUT
++  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
++  more details.
++
++  You should have received a copy of the GNU General Public License along with
++  this program; if not, write to the Free Software Foundation, Inc.,
++  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
++
++  The full GNU General Public License is included in this distribution in
++  the file called "COPYING".
++
++  Contact Information:
++  open-lldp Mailing List <lldp-devel at open-lldp.org>
++
++*******************************************************************************/
++
++#include <unistd.h>
++#include <stdlib.h>
++#include <string.h>
++#include <errno.h>
++#include <asm/errno.h>
++#include <fcntl.h>
++#include <sys/socket.h>
++#include <net/if.h>
++#include <linux/netlink.h>
++#include <linux/rtnetlink.h>
++#include "dcbnl.h"
++#include "dcb_app.h"
++#include "sysfs.h"
++
++/* Older kernels' rtnetlink.h may not have RTM_[GS]ETDCB */
++#ifndef RTM_GETDCB
++# define RTM_GETDCB 78
++#endif
++#ifndef RTM_SETDCB
++# define RTM_SETDCB 79
++#endif
++
++#define IEEE_SMASK_ETHTYPE	(1 << IEEE_8021QAZ_APP_SEL_ETHERTYPE)
++#define IEEE_SMASK_STREAM	(1 << IEEE_8021QAZ_APP_SEL_STREAM)
++#define IEEE_SMASK_DGRAM	(1 << IEEE_8021QAZ_APP_SEL_DGRAM)
++#define IEEE_SMASK_ANY		(1 << IEEE_8021QAZ_APP_SEL_ANY)
++
++#define NLA_DATA(nla)        ((void *)((char *)(nla) + NLA_HDRLEN))
++#define NLA_NEXT(nla) (struct rtattr *)((char *)nla + NLMSG_ALIGN(nla->rta_len))
++
++/* Maximum size of response requested or message sent */
++#define MAX_MSG_SIZE    1024
++
++static struct nlmsghdr *start_dcbmsg(__u16 msg_type, __u8 arg)
++{
++	struct nlmsghdr *nlh;
++	struct dcbmsg *d;
++
++	nlh = malloc(MAX_MSG_SIZE);
++	if (!nlh)
++		return NULL;
++	memset(nlh, 0, MAX_MSG_SIZE);
++	nlh->nlmsg_type = msg_type;
++	nlh->nlmsg_flags = NLM_F_REQUEST;
++	nlh->nlmsg_seq = 0;
++	nlh->nlmsg_pid = getpid();
++	if (msg_type != RTM_GETDCB) {
++		free(nlh);
++		return NULL;
++	}
++
++	nlh->nlmsg_len = NLMSG_LENGTH(sizeof(struct dcbmsg));
++	d = NLMSG_DATA(nlh);
++	d->cmd = arg;
++	d->dcb_family = AF_UNSPEC;
++	d->dcb_pad = 0;
++
++	return nlh;
++}
++
++static struct rtattr *add_rta(struct nlmsghdr *nlh, __u16 rta_type,
++			      void *attr, __u16 rta_len)
++{
++	struct rtattr *rta;
++
++	rta = (struct rtattr *)((char *)nlh + nlh->nlmsg_len);
++	rta->rta_type = rta_type;
++	rta->rta_len = rta_len + NLA_HDRLEN;
++	if (attr)
++		memcpy(NLA_DATA(rta), attr, rta_len);
++	nlh->nlmsg_len += NLMSG_ALIGN(rta->rta_len);
++
++	return rta;
++}
++
++static int dcbnl_send_msg(int nl_sd, struct nlmsghdr *nlh)
++{
++	struct sockaddr_nl nladdr;
++	void *buf = nlh;
++	int r, len = nlh->nlmsg_len;
++
++	memset(&nladdr, 0, sizeof(nladdr));
++	nladdr.nl_family = AF_NETLINK;
++
++	do {
++		r = sendto(nl_sd, buf, len, 0, (struct sockaddr *)&nladdr,
++			sizeof(nladdr));
++	} while (r < 0 && errno == EINTR);
++
++	if (r < 0)
++		return 1;
++
++	return 0;
++}
++
++static struct nlmsghdr *dcbnl_get_msg(int nl_sd)
++{
++	struct nlmsghdr *nlh;
++	int len;
++
++	nlh = malloc(MAX_MSG_SIZE);
++	if (!nlh)
++		return NULL;
++	memset(nlh, 0, MAX_MSG_SIZE);
++
++	len = recv(nl_sd, (void *)nlh, MAX_MSG_SIZE, 0);
++
++	if (len < 0 || nlh->nlmsg_type == NLMSG_ERROR ||
++	    !NLMSG_OK(nlh, (unsigned int)len)) {
++		free(nlh);
++		return NULL;
++	}
++
++	return nlh;
++}
++
++static int get_dcbx_cap(int nl_sd, const char *ifname)
++{
++	struct nlmsghdr *nlh;
++	struct dcbmsg *d;
++	struct rtattr *rta;
++	int rval;
++
++	nlh = start_dcbmsg(RTM_GETDCB, DCB_CMD_GDCBX);
++	if (!nlh)
++		return -EIO;
++
++	add_rta(nlh, DCB_ATTR_IFNAME, (void *)ifname, strlen(ifname) + 1);
++	rval = dcbnl_send_msg(nl_sd, nlh);
++	free(nlh);
++	if (rval)
++		return -EIO;
++
++	/* Receive DCBX capabilities */
++	nlh = dcbnl_get_msg(nl_sd);
++	if (!nlh)
++		return -EIO;
++
++	d = (struct dcbmsg *)NLMSG_DATA(nlh);
++	rta = (struct rtattr *)(((char *)d) +
++			NLMSG_ALIGN(sizeof(struct dcbmsg)));
++
++	if (d->cmd != DCB_CMD_GDCBX || rta->rta_type != DCB_ATTR_DCBX) {
++		free(nlh);
++		return -EIO;
++	}
++
++	rval = *(__u8 *)NLA_DATA(rta);
++	free(nlh);
++	return rval;
++}
++
++static int get_cee_app_pri(int nl_sd, const char *ifname,
++			   __u8 req_idtype, __u16 req_id)
++{
++	struct nlmsghdr *nlh;
++	struct dcbmsg *d;
++	struct rtattr *rta_parent, *rta_child;
++	int rval = 0;
++	__u8 idtype;
++	__u16 id;
++
++	nlh = start_dcbmsg(RTM_GETDCB, DCB_CMD_GAPP);
++	if (!nlh)
++		return -EIO;
++
++	add_rta(nlh, DCB_ATTR_IFNAME, (void *)ifname, strlen(ifname) + 1);
++	rta_parent = add_rta(nlh, DCB_ATTR_APP, NULL, 0);
++
++	rta_child = add_rta(nlh, DCB_APP_ATTR_IDTYPE,
++		(void *)&req_idtype, sizeof(__u8));
++	rta_parent->rta_len += NLA_ALIGN(rta_child->rta_len);
++
++	rta_child = add_rta(nlh, DCB_APP_ATTR_ID,
++		(void *)&req_id, sizeof(__u16));
++	rta_parent->rta_len += NLA_ALIGN(rta_child->rta_len);
++
++	rval = dcbnl_send_msg(nl_sd, nlh);
++	free(nlh);
++	if (rval)
++		return -EIO;
++
++	nlh = dcbnl_get_msg(nl_sd);
++	if (!nlh)
++		return -EIO;
++
++	d = (struct dcbmsg *)NLMSG_DATA(nlh);
++	rta_parent = (struct rtattr *)(((char *)d) +
++		NLMSG_ALIGN(sizeof(struct dcbmsg)));
++
++	if (d->cmd != DCB_CMD_GAPP) {
++		rval = -EIO;
++		goto get_error;
++	}
++	if (rta_parent->rta_type != DCB_ATTR_APP) {
++		rval = -EIO;
++		goto get_error;
++	}
++
++	rta_child = NLA_DATA(rta_parent);
++	rta_parent = NLA_NEXT(rta_parent);
++
++	idtype = *(__u8 *)NLA_DATA(rta_child);
++	rta_child = NLA_NEXT(rta_child);
++	if (idtype != req_idtype) {
++		rval = -EIO;
++		goto get_error;
++	}
++
++	id = *(__u16 *)NLA_DATA(rta_child);
++	rta_child = NLA_NEXT(rta_child);
++	if (id != req_id) {
++		rval = -EIO;
++		goto get_error;
++	}
++
++	rval = *(__u8 *)NLA_DATA(rta_child);
++
++get_error:
++	free(nlh);
++	return rval;
++}
++
++static int
++get_ieee_app_pri(int nl_sd, const char *ifname, __u8 ieee_mask, __u16 req_id)
++{
++	struct nlmsghdr *nlh;
++	struct dcbmsg *d;
++	struct rtattr *rta_parent, *rta_child;
++	int rval;
++
++	nlh = start_dcbmsg(RTM_GETDCB, DCB_CMD_IEEE_GET);
++	if (!nlh)
++		return -EIO;
++
++	add_rta(nlh, DCB_ATTR_IFNAME, (void *)ifname, strlen(ifname) + 1);
++
++	rval = dcbnl_send_msg(nl_sd, nlh);
++	free(nlh);
++	if (rval)
++		return -EIO;
++
++	nlh = dcbnl_get_msg(nl_sd);
++	if (!nlh)
++		return -EIO;
++
++	d = (struct dcbmsg *)NLMSG_DATA(nlh);
++	rta_parent = (struct rtattr *)(((char *)d) +
++		NLMSG_ALIGN(sizeof(struct dcbmsg)));
++
++	if (d->cmd != DCB_CMD_IEEE_GET) {
++		rval = -EIO;
++		goto get_error;
++	}
++	if (rta_parent->rta_type != DCB_ATTR_IFNAME) {
++		rval = -EIO;
++		goto get_error;
++	}
++
++	rta_parent = NLA_NEXT(rta_parent);
++
++	if (rta_parent->rta_type != DCB_ATTR_IEEE) {
++		rval = -EIO;
++		goto get_error;
++	}
++
++	rta_child = NLA_DATA(rta_parent);
++	rta_parent = NLA_NEXT(rta_parent);
++
++	for (; rta_parent > rta_child; rta_child = NLA_NEXT(rta_child)) {
++		if (rta_child->rta_type == DCB_ATTR_IEEE_APP_TABLE)
++			break;
++	}
++	if (rta_parent <= rta_child) {
++		rval = -EIO;
++		goto get_error;
++	}
++
++	rta_parent = rta_child;
++	rta_child = NLA_DATA(rta_parent);
++	rta_parent = NLA_NEXT(rta_parent);
++
++	rval = 0;
++	for (; rta_parent > rta_child; rta_child = NLA_NEXT(rta_child)) {
++		struct dcb_app *app;
++
++		if (rta_child->rta_type != DCB_ATTR_IEEE_APP)
++			continue;
++		app = (struct dcb_app *)NLA_DATA(rta_child);
++		if (app->protocol != req_id)
++			continue;
++		if ((1 << app->selector) & ieee_mask)
++			rval |= 1 << app->priority;
++	}
++
++get_error:
++	free(nlh);
++	return rval;
++}
++
++static int get_link_ifname(const char *ifname, char *link_ifname)
++{
++	int ifindex;
++
++	if (sysfs_get_int(ifname, "net", "iflink", &ifindex))
++		return -EIO;
++
++	if (!if_indextoname(ifindex, link_ifname))
++		return -ENODEV;
++
++	return 0;
++}
++
++static int get_app_pri(const char *iface, __u8 req_idtype, __u16 req_id,
++		       __u8 ieee_mask)
++{
++	int dcbx_cap;
++	int pri;
++	int nl_sd;
++	char ifname[IFNAMSIZ];
++
++	if (get_link_ifname(iface, ifname))
++		return 0;
++
++	nl_sd = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
++	if (nl_sd < 0)
++		return -errno;
++
++	dcbx_cap = get_dcbx_cap(nl_sd, ifname);
++	if (dcbx_cap < 0 || !(dcbx_cap & DCB_CAP_DCBX_VER_IEEE))
++		pri = get_cee_app_pri(nl_sd, ifname, req_idtype, req_id);
++	else
++		pri = get_ieee_app_pri(nl_sd, ifname, ieee_mask, req_id);
++
++	close(nl_sd);
++	return pri;
++}
++
++int get_dcb_app_pri_by_stream_port(const char *ifname, int port)
++{
++	return get_app_pri(ifname, DCB_APP_IDTYPE_PORTNUM, port,
++			IEEE_SMASK_STREAM | IEEE_SMASK_ANY);
++}
++
++int get_dcb_app_pri_by_datagram_port(const char *ifname, int port)
++{
++	return get_app_pri(ifname, DCB_APP_IDTYPE_PORTNUM, port,
++			IEEE_SMASK_DGRAM | IEEE_SMASK_ANY);
++}
++
++int get_dcb_app_pri_by_port_sel(const char *ifname, int port, int sel)
++{
++	return get_app_pri(ifname, DCB_APP_IDTYPE_PORTNUM, port,
++			1 << sel);
++}
++
++int get_dcb_app_pri_by_ethtype(const char *ifname, int ethtype)
++{
++	return get_app_pri(ifname, DCB_APP_IDTYPE_ETHTYPE, ethtype,
++			IEEE_SMASK_ETHTYPE);
++}
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/dcb_app.h open-iscsi-2.0-872-rc4-bnx2i.sync/usr/dcb_app.h
+--- open-iscsi-2.0-872-rc4-bnx2i/usr/dcb_app.h	1969-12-31 18:00:00.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/dcb_app.h	2011-08-14 16:48:25.000000000 -0500
+@@ -0,0 +1,41 @@
++/*******************************************************************************
++
++  DCB application support
++  Copyright(c) 2010-2011 Intel Corporation.
++
++  This program is free software; you can redistribute it and/or modify it
++  under the terms and conditions of the GNU General Public License,
++  version 2, as published by the Free Software Foundation.
++
++  This program is distributed in the hope it will be useful, but WITHOUT
++  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
++  more details.
++
++  You should have received a copy of the GNU General Public License along with
++  this program; if not, write to the Free Software Foundation, Inc.,
++  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
++
++  The full GNU General Public License is included in this distribution in
++  the file called "COPYING".
++
++  Contact Information:
++  open-lldp Mailing List <lldp-devel at open-lldp.org>
++
++*******************************************************************************/
++
++#ifndef _DCB_APP_H_
++#define _DCB_APP_H_
++
++int get_dcb_app_pri_by_ethtype(const char *ifname, int ethtype);
++
++int get_dcb_app_pri_by_stream_port(const char *ifname, int port);
++int get_dcb_app_pri_by_datagram_port(const char *ifname, int port);
++
++/*
++ * The selector values for the following call are defined in recent versions
++ * of the dcbnl.h file.
++ */
++int get_dcb_app_pri_by_port_sel(const char *ifname, int port, int sel);
++
++#endif  /* _DCB_APP_H_ */
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/dcbnl.h open-iscsi-2.0-872-rc4-bnx2i.sync/usr/dcbnl.h
+--- open-iscsi-2.0-872-rc4-bnx2i/usr/dcbnl.h	1969-12-31 18:00:00.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/dcbnl.h	2011-08-14 16:48:25.000000000 -0500
+@@ -0,0 +1,653 @@
++/*
++ * Local copy of the kernel's dcbnl.h
++ *
++ * Copyright (c) 2008-2011, Intel Corporation.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms and conditions of the GNU General Public License,
++ * version 2, as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
++ * more details.
++ *
++ * You should have received a copy of the GNU General Public License along with
++ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
++ * Place - Suite 330, Boston, MA 02111-1307 USA.
++ *
++ * Author: Lucy Liu <lucy.liu at intel.com>
++ */
++
++#ifndef __LINUX_DCBNL_H__
++#define __LINUX_DCBNL_H__
++
++#include <linux/types.h>
++
++/* IEEE 802.1Qaz std supported values */
++#define IEEE_8021QAZ_MAX_TCS	8
++
++#define IEEE_8021QAZ_TSA_STRICT		0
++#define IEEE_8021QAZ_TSA_CB_SHAPER	1
++#define IEEE_8021QAZ_TSA_ETS		2
++#define IEEE_8021QAZ_TSA_VENDOR		255
++
++/* This structure contains the IEEE 802.1Qaz ETS managed object
++ *
++ * @willing: willing bit in ETS configuration TLV
++ * @ets_cap: indicates supported capacity of ets feature
++ * @cbs: credit based shaper ets algorithm supported
++ * @tc_tx_bw: tc tx bandwidth indexed by traffic class
++ * @tc_rx_bw: tc rx bandwidth indexed by traffic class
++ * @tc_tsa: TSA Assignment table, indexed by traffic class
++ * @prio_tc: priority assignment table mapping 8021Qp to traffic class
++ * @tc_reco_bw: recommended tc bandwidth indexed by traffic class for TLV
++ * @tc_reco_tsa: recommended tc bandwidth indexed by traffic class for TLV
++ * @reco_prio_tc: recommended tc tx bandwidth indexed by traffic class for TLV
++ *
++ * Recommended values are used to set fields in the ETS recommendation TLV
++ * with hardware offloaded LLDP.
++ *
++ * ----
++ *  TSA Assignment 8 bit identifiers
++ *	0	strict priority
++ *	1	credit-based shaper
++ *	2	enhanced transmission selection
++ *	3-254	reserved
++ *	255	vendor specific
++ */
++struct ieee_ets {
++	__u8	willing;
++	__u8	ets_cap;
++	__u8	cbs;
++	__u8	tc_tx_bw[IEEE_8021QAZ_MAX_TCS];
++	__u8	tc_rx_bw[IEEE_8021QAZ_MAX_TCS];
++	__u8	tc_tsa[IEEE_8021QAZ_MAX_TCS];
++	__u8	prio_tc[IEEE_8021QAZ_MAX_TCS];
++	__u8	tc_reco_bw[IEEE_8021QAZ_MAX_TCS];
++	__u8	tc_reco_tsa[IEEE_8021QAZ_MAX_TCS];
++	__u8	reco_prio_tc[IEEE_8021QAZ_MAX_TCS];
++};
++
++/* This structure contains the IEEE 802.1Qaz PFC managed object
++ *
++ * @pfc_cap: Indicates the number of traffic classes on the local device
++ *	     that may simultaneously have PFC enabled.
++ * @pfc_en: bitmap indicating pfc enabled traffic classes
++ * @mbc: enable macsec bypass capability
++ * @delay: the allowance made for a round-trip propagation delay of the
++ *	   link in bits.
++ * @requests: count of the sent pfc frames
++ * @indications: count of the received pfc frames
++ */
++struct ieee_pfc {
++	__u8	pfc_cap;
++	__u8	pfc_en;
++	__u8	mbc;
++	__u16	delay;
++	__u64	requests[IEEE_8021QAZ_MAX_TCS];
++	__u64	indications[IEEE_8021QAZ_MAX_TCS];
++};
++
++/* CEE DCBX std supported values */
++#define CEE_DCBX_MAX_PGS	8
++#define CEE_DCBX_MAX_PRIO	8
++
++/**
++ * struct cee_pg - CEE Priority-Group managed object
++ *
++ * @willing: willing bit in the PG tlv
++ * @error: error bit in the PG tlv
++ * @pg_en: enable bit of the PG feature
++ * @tcs_supported: number of traffic classes supported
++ * @pg_bw: bandwidth percentage for each priority group
++ * @prio_pg: priority to PG mapping indexed by priority
++ */
++struct cee_pg {
++	__u8    willing;
++	__u8    error;
++	__u8    pg_en;
++	__u8    tcs_supported;
++	__u8    pg_bw[CEE_DCBX_MAX_PGS];
++	__u8    prio_pg[CEE_DCBX_MAX_PGS];
++};
++
++/**
++ * struct cee_pfc - CEE PFC managed object
++ *
++ * @willing: willing bit in the PFC tlv
++ * @error: error bit in the PFC tlv
++ * @pfc_en: bitmap indicating pfc enabled traffic classes
++ * @tcs_supported: number of traffic classes supported
++ */
++struct cee_pfc {
++	__u8    willing;
++	__u8    error;
++	__u8    pfc_en;
++	__u8    tcs_supported;
++};
++
++/* IEEE 802.1Qaz std supported values */
++#define IEEE_8021QAZ_APP_SEL_ETHERTYPE	1
++#define IEEE_8021QAZ_APP_SEL_STREAM	2
++#define IEEE_8021QAZ_APP_SEL_DGRAM	3
++#define IEEE_8021QAZ_APP_SEL_ANY	4
++
++/* This structure contains the IEEE 802.1Qaz APP managed object. This
++ * object is also used for the CEE std as well. There is no difference
++ * between the objects.
++ *
++ * @selector: protocol identifier type
++ * @protocol: protocol of type indicated
++ * @priority: 3-bit unsigned integer indicating priority
++ *
++ * ----
++ *  Selector field values
++ *	0	Reserved
++ *	1	Ethertype
++ *	2	Well known port number over TCP or SCTP
++ *	3	Well known port number over UDP or DCCP
++ *	4	Well known port number over TCP, SCTP, UDP, or DCCP
++ *	5-7	Reserved
++ */
++struct dcb_app {
++	__u8	selector;
++	__u8	priority;
++	__u16	protocol;
++};
++
++/**
++ * struct dcb_peer_app_info - APP feature information sent by the peer
++ *
++ * @willing: willing bit in the peer APP tlv
++ * @error: error bit in the peer APP tlv
++ *
++ * In addition to this information the full peer APP tlv also contains
++ * a table of 'app_count' APP objects defined above.
++ */
++struct dcb_peer_app_info {
++	__u8	willing;
++	__u8	error;
++};
++
++struct dcbmsg {
++	__u8               dcb_family;
++	__u8               cmd;
++	__u16              dcb_pad;
++};
++
++/**
++ * enum dcbnl_commands - supported DCB commands
++ *
++ * @DCB_CMD_UNDEFINED: unspecified command to catch errors
++ * @DCB_CMD_GSTATE: request the state of DCB in the device
++ * @DCB_CMD_SSTATE: set the state of DCB in the device
++ * @DCB_CMD_PGTX_GCFG: request the priority group configuration for Tx
++ * @DCB_CMD_PGTX_SCFG: set the priority group configuration for Tx
++ * @DCB_CMD_PGRX_GCFG: request the priority group configuration for Rx
++ * @DCB_CMD_PGRX_SCFG: set the priority group configuration for Rx
++ * @DCB_CMD_PFC_GCFG: request the priority flow control configuration
++ * @DCB_CMD_PFC_SCFG: set the priority flow control configuration
++ * @DCB_CMD_SET_ALL: apply all changes to the underlying device
++ * @DCB_CMD_GPERM_HWADDR: get the permanent MAC address of the underlying
++ *                        device.  Only useful when using bonding.
++ * @DCB_CMD_GCAP: request the DCB capabilities of the device
++ * @DCB_CMD_GNUMTCS: get the number of traffic classes currently supported
++ * @DCB_CMD_SNUMTCS: set the number of traffic classes
++ * @DCB_CMD_GBCN: set backward congestion notification configuration
++ * @DCB_CMD_SBCN: get backward congestion notification configration.
++ * @DCB_CMD_GAPP: get application protocol configuration
++ * @DCB_CMD_SAPP: set application protocol configuration
++ * @DCB_CMD_IEEE_SET: set IEEE 802.1Qaz configuration
++ * @DCB_CMD_IEEE_GET: get IEEE 802.1Qaz configuration
++ * @DCB_CMD_GDCBX: get DCBX engine configuration
++ * @DCB_CMD_SDCBX: set DCBX engine configuration
++ * @DCB_CMD_GFEATCFG: get DCBX features flags
++ * @DCB_CMD_SFEATCFG: set DCBX features negotiation flags
++ * @DCB_CMD_CEE_GET: get CEE aggregated configuration
++ */
++enum dcbnl_commands {
++	DCB_CMD_UNDEFINED,
++
++	DCB_CMD_GSTATE,
++	DCB_CMD_SSTATE,
++
++	DCB_CMD_PGTX_GCFG,
++	DCB_CMD_PGTX_SCFG,
++	DCB_CMD_PGRX_GCFG,
++	DCB_CMD_PGRX_SCFG,
++
++	DCB_CMD_PFC_GCFG,
++	DCB_CMD_PFC_SCFG,
++
++	DCB_CMD_SET_ALL,
++
++	DCB_CMD_GPERM_HWADDR,
++
++	DCB_CMD_GCAP,
++
++	DCB_CMD_GNUMTCS,
++	DCB_CMD_SNUMTCS,
++
++	DCB_CMD_PFC_GSTATE,
++	DCB_CMD_PFC_SSTATE,
++
++	DCB_CMD_BCN_GCFG,
++	DCB_CMD_BCN_SCFG,
++
++	DCB_CMD_GAPP,
++	DCB_CMD_SAPP,
++
++	DCB_CMD_IEEE_SET,
++	DCB_CMD_IEEE_GET,
++
++	DCB_CMD_GDCBX,
++	DCB_CMD_SDCBX,
++
++	DCB_CMD_GFEATCFG,
++	DCB_CMD_SFEATCFG,
++
++	DCB_CMD_CEE_GET,
++
++	__DCB_CMD_ENUM_MAX,
++	DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1,
++};
++
++/**
++ * enum dcbnl_attrs - DCB top-level netlink attributes
++ *
++ * @DCB_ATTR_UNDEFINED: unspecified attribute to catch errors
++ * @DCB_ATTR_IFNAME: interface name of the underlying device (NLA_STRING)
++ * @DCB_ATTR_STATE: enable state of DCB in the device (NLA_U8)
++ * @DCB_ATTR_PFC_STATE: enable state of PFC in the device (NLA_U8)
++ * @DCB_ATTR_PFC_CFG: priority flow control configuration (NLA_NESTED)
++ * @DCB_ATTR_NUM_TC: number of traffic classes supported in the device (NLA_U8)
++ * @DCB_ATTR_PG_CFG: priority group configuration (NLA_NESTED)
++ * @DCB_ATTR_SET_ALL: bool to commit changes to hardware or not (NLA_U8)
++ * @DCB_ATTR_PERM_HWADDR: MAC address of the physical device (NLA_NESTED)
++ * @DCB_ATTR_CAP: DCB capabilities of the device (NLA_NESTED)
++ * @DCB_ATTR_NUMTCS: number of traffic classes supported (NLA_NESTED)
++ * @DCB_ATTR_BCN: backward congestion notification configuration (NLA_NESTED)
++ * @DCB_ATTR_IEEE: IEEE 802.1Qaz supported attributes (NLA_NESTED)
++ * @DCB_ATTR_DCBX: DCBX engine configuration in the device (NLA_U8)
++ * @DCB_ATTR_FEATCFG: DCBX features flags (NLA_NESTED)
++ * @DCB_ATTR_CEE: CEE std supported attributes (NLA_NESTED)
++ */
++enum dcbnl_attrs {
++	DCB_ATTR_UNDEFINED,
++
++	DCB_ATTR_IFNAME,
++	DCB_ATTR_STATE,
++	DCB_ATTR_PFC_STATE,
++	DCB_ATTR_PFC_CFG,
++	DCB_ATTR_NUM_TC,
++	DCB_ATTR_PG_CFG,
++	DCB_ATTR_SET_ALL,
++	DCB_ATTR_PERM_HWADDR,
++	DCB_ATTR_CAP,
++	DCB_ATTR_NUMTCS,
++	DCB_ATTR_BCN,
++	DCB_ATTR_APP,
++
++	/* IEEE std attributes */
++	DCB_ATTR_IEEE,
++
++	DCB_ATTR_DCBX,
++	DCB_ATTR_FEATCFG,
++
++	/* CEE nested attributes */
++	DCB_ATTR_CEE,
++
++	__DCB_ATTR_ENUM_MAX,
++	DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1,
++};
++
++/**
++ * enum ieee_attrs - IEEE 802.1Qaz get/set attributes
++ *
++ * @DCB_ATTR_IEEE_UNSPEC: unspecified
++ * @DCB_ATTR_IEEE_ETS: negotiated ETS configuration
++ * @DCB_ATTR_IEEE_PFC: negotiated PFC configuration
++ * @DCB_ATTR_IEEE_APP_TABLE: negotiated APP configuration
++ * @DCB_ATTR_IEEE_PEER_ETS: peer ETS configuration - get only
++ * @DCB_ATTR_IEEE_PEER_PFC: peer PFC configuration - get only
++ * @DCB_ATTR_IEEE_PEER_APP: peer APP tlv - get only
++ */
++enum ieee_attrs {
++	DCB_ATTR_IEEE_UNSPEC,
++	DCB_ATTR_IEEE_ETS,
++	DCB_ATTR_IEEE_PFC,
++	DCB_ATTR_IEEE_APP_TABLE,
++	DCB_ATTR_IEEE_PEER_ETS,
++	DCB_ATTR_IEEE_PEER_PFC,
++	DCB_ATTR_IEEE_PEER_APP,
++	__DCB_ATTR_IEEE_MAX
++};
++#define DCB_ATTR_IEEE_MAX (__DCB_ATTR_IEEE_MAX - 1)
++
++enum ieee_attrs_app {
++	DCB_ATTR_IEEE_APP_UNSPEC,
++	DCB_ATTR_IEEE_APP,
++	__DCB_ATTR_IEEE_APP_MAX
++};
++#define DCB_ATTR_IEEE_APP_MAX (__DCB_ATTR_IEEE_APP_MAX - 1)
++
++/**
++ * enum cee_attrs - CEE DCBX get attributes
++ *
++ * @DCB_ATTR_CEE_UNSPEC: unspecified
++ * @DCB_ATTR_CEE_PEER_PG: peer PG configuration - get only
++ * @DCB_ATTR_CEE_PEER_PFC: peer PFC configuration - get only
++ * @DCB_ATTR_CEE_PEER_APP: peer APP tlv - get only
++ */
++enum cee_attrs {
++	DCB_ATTR_CEE_UNSPEC,
++	DCB_ATTR_CEE_PEER_PG,
++	DCB_ATTR_CEE_PEER_PFC,
++	DCB_ATTR_CEE_PEER_APP_TABLE,
++	__DCB_ATTR_CEE_MAX
++};
++#define DCB_ATTR_CEE_MAX (__DCB_ATTR_CEE_MAX - 1)
++
++enum peer_app_attr {
++	DCB_ATTR_CEE_PEER_APP_UNSPEC,
++	DCB_ATTR_CEE_PEER_APP_INFO,
++	DCB_ATTR_CEE_PEER_APP,
++	__DCB_ATTR_CEE_PEER_APP_MAX
++};
++#define DCB_ATTR_CEE_PEER_APP_MAX (__DCB_ATTR_CEE_PEER_APP_MAX - 1)
++
++/**
++ * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs
++ *
++ * @DCB_PFC_UP_ATTR_UNDEFINED: unspecified attribute to catch errors
++ * @DCB_PFC_UP_ATTR_0: Priority Flow Control value for User Priority 0 (NLA_U8)
++ * @DCB_PFC_UP_ATTR_1: Priority Flow Control value for User Priority 1 (NLA_U8)
++ * @DCB_PFC_UP_ATTR_2: Priority Flow Control value for User Priority 2 (NLA_U8)
++ * @DCB_PFC_UP_ATTR_3: Priority Flow Control value for User Priority 3 (NLA_U8)
++ * @DCB_PFC_UP_ATTR_4: Priority Flow Control value for User Priority 4 (NLA_U8)
++ * @DCB_PFC_UP_ATTR_5: Priority Flow Control value for User Priority 5 (NLA_U8)
++ * @DCB_PFC_UP_ATTR_6: Priority Flow Control value for User Priority 6 (NLA_U8)
++ * @DCB_PFC_UP_ATTR_7: Priority Flow Control value for User Priority 7 (NLA_U8)
++ * @DCB_PFC_UP_ATTR_MAX: highest attribute number currently defined
++ * @DCB_PFC_UP_ATTR_ALL: apply to all priority flow control attrs (NLA_FLAG)
++ *
++ */
++enum dcbnl_pfc_up_attrs {
++	DCB_PFC_UP_ATTR_UNDEFINED,
++
++	DCB_PFC_UP_ATTR_0,
++	DCB_PFC_UP_ATTR_1,
++	DCB_PFC_UP_ATTR_2,
++	DCB_PFC_UP_ATTR_3,
++	DCB_PFC_UP_ATTR_4,
++	DCB_PFC_UP_ATTR_5,
++	DCB_PFC_UP_ATTR_6,
++	DCB_PFC_UP_ATTR_7,
++	DCB_PFC_UP_ATTR_ALL,
++
++	__DCB_PFC_UP_ATTR_ENUM_MAX,
++	DCB_PFC_UP_ATTR_MAX = __DCB_PFC_UP_ATTR_ENUM_MAX - 1,
++};
++
++/**
++ * enum dcbnl_pg_attrs - DCB Priority Group attributes
++ *
++ * @DCB_PG_ATTR_UNDEFINED: unspecified attribute to catch errors
++ * @DCB_PG_ATTR_TC_0: Priority Group Traffic Class 0 configuration (NLA_NESTED)
++ * @DCB_PG_ATTR_TC_1: Priority Group Traffic Class 1 configuration (NLA_NESTED)
++ * @DCB_PG_ATTR_TC_2: Priority Group Traffic Class 2 configuration (NLA_NESTED)
++ * @DCB_PG_ATTR_TC_3: Priority Group Traffic Class 3 configuration (NLA_NESTED)
++ * @DCB_PG_ATTR_TC_4: Priority Group Traffic Class 4 configuration (NLA_NESTED)
++ * @DCB_PG_ATTR_TC_5: Priority Group Traffic Class 5 configuration (NLA_NESTED)
++ * @DCB_PG_ATTR_TC_6: Priority Group Traffic Class 6 configuration (NLA_NESTED)
++ * @DCB_PG_ATTR_TC_7: Priority Group Traffic Class 7 configuration (NLA_NESTED)
++ * @DCB_PG_ATTR_TC_MAX: highest attribute number currently defined
++ * @DCB_PG_ATTR_TC_ALL: apply to all traffic classes (NLA_NESTED)
++ * @DCB_PG_ATTR_BW_ID_0: Percent of link bandwidth for Priority Group 0 (NLA_U8)
++ * @DCB_PG_ATTR_BW_ID_1: Percent of link bandwidth for Priority Group 1 (NLA_U8)
++ * @DCB_PG_ATTR_BW_ID_2: Percent of link bandwidth for Priority Group 2 (NLA_U8)
++ * @DCB_PG_ATTR_BW_ID_3: Percent of link bandwidth for Priority Group 3 (NLA_U8)
++ * @DCB_PG_ATTR_BW_ID_4: Percent of link bandwidth for Priority Group 4 (NLA_U8)
++ * @DCB_PG_ATTR_BW_ID_5: Percent of link bandwidth for Priority Group 5 (NLA_U8)
++ * @DCB_PG_ATTR_BW_ID_6: Percent of link bandwidth for Priority Group 6 (NLA_U8)
++ * @DCB_PG_ATTR_BW_ID_7: Percent of link bandwidth for Priority Group 7 (NLA_U8)
++ * @DCB_PG_ATTR_BW_ID_MAX: highest attribute number currently defined
++ * @DCB_PG_ATTR_BW_ID_ALL: apply to all priority groups (NLA_FLAG)
++ *
++ */
++enum dcbnl_pg_attrs {
++	DCB_PG_ATTR_UNDEFINED,
++
++	DCB_PG_ATTR_TC_0,
++	DCB_PG_ATTR_TC_1,
++	DCB_PG_ATTR_TC_2,
++	DCB_PG_ATTR_TC_3,
++	DCB_PG_ATTR_TC_4,
++	DCB_PG_ATTR_TC_5,
++	DCB_PG_ATTR_TC_6,
++	DCB_PG_ATTR_TC_7,
++	DCB_PG_ATTR_TC_MAX,
++	DCB_PG_ATTR_TC_ALL,
++
++	DCB_PG_ATTR_BW_ID_0,
++	DCB_PG_ATTR_BW_ID_1,
++	DCB_PG_ATTR_BW_ID_2,
++	DCB_PG_ATTR_BW_ID_3,
++	DCB_PG_ATTR_BW_ID_4,
++	DCB_PG_ATTR_BW_ID_5,
++	DCB_PG_ATTR_BW_ID_6,
++	DCB_PG_ATTR_BW_ID_7,
++	DCB_PG_ATTR_BW_ID_MAX,
++	DCB_PG_ATTR_BW_ID_ALL,
++
++	__DCB_PG_ATTR_ENUM_MAX,
++	DCB_PG_ATTR_MAX = __DCB_PG_ATTR_ENUM_MAX - 1,
++};
++
++/**
++ * enum dcbnl_tc_attrs - DCB Traffic Class attributes
++ *
++ * @DCB_TC_ATTR_PARAM_UNDEFINED: unspecified attribute to catch errors
++ * @DCB_TC_ATTR_PARAM_PGID: (NLA_U8) Priority group the traffic class belongs to
++ *                          Valid values are:  0-7
++ * @DCB_TC_ATTR_PARAM_UP_MAPPING: (NLA_U8) Traffic class to user priority map
++ *                                Some devices may not support changing the
++ *                                user priority map of a TC.
++ * @DCB_TC_ATTR_PARAM_STRICT_PRIO: (NLA_U8) Strict priority setting
++ *                                 0 - none
++ *                                 1 - group strict
++ *                                 2 - link strict
++ * @DCB_TC_ATTR_PARAM_BW_PCT: optional - (NLA_U8) If supported by the device and
++ *                            not configured to use link strict priority,
++ *                            this is the percentage of bandwidth of the
++ *                            priority group this traffic class belongs to
++ * @DCB_TC_ATTR_PARAM_ALL: (NLA_FLAG) all traffic class parameters
++ *
++ */
++enum dcbnl_tc_attrs {
++	DCB_TC_ATTR_PARAM_UNDEFINED,
++
++	DCB_TC_ATTR_PARAM_PGID,
++	DCB_TC_ATTR_PARAM_UP_MAPPING,
++	DCB_TC_ATTR_PARAM_STRICT_PRIO,
++	DCB_TC_ATTR_PARAM_BW_PCT,
++	DCB_TC_ATTR_PARAM_ALL,
++
++	__DCB_TC_ATTR_PARAM_ENUM_MAX,
++	DCB_TC_ATTR_PARAM_MAX = __DCB_TC_ATTR_PARAM_ENUM_MAX - 1,
++};
++
++/**
++ * enum dcbnl_cap_attrs - DCB Capability attributes
++ *
++ * @DCB_CAP_ATTR_UNDEFINED: unspecified attribute to catch errors
++ * @DCB_CAP_ATTR_ALL: (NLA_FLAG) all capability parameters
++ * @DCB_CAP_ATTR_PG: (NLA_U8) device supports Priority Groups
++ * @DCB_CAP_ATTR_PFC: (NLA_U8) device supports Priority Flow Control
++ * @DCB_CAP_ATTR_UP2TC: (NLA_U8) device supports user priority to
++ *                               traffic class mapping
++ * @DCB_CAP_ATTR_PG_TCS: (NLA_U8) bitmap where each bit represents a
++ *                                number of traffic classes the device
++ *                                can be configured to use for Priority Groups
++ * @DCB_CAP_ATTR_PFC_TCS: (NLA_U8) bitmap where each bit represents a
++ *                                 number of traffic classes the device can be
++ *                                 configured to use for Priority Flow Control
++ * @DCB_CAP_ATTR_GSP: (NLA_U8) device supports group strict priority
++ * @DCB_CAP_ATTR_BCN: (NLA_U8) device supports Backwards Congestion
++ *                             Notification
++ * @DCB_CAP_ATTR_DCBX: (NLA_U8) device supports DCBX engine
++ *
++ */
++enum dcbnl_cap_attrs {
++	DCB_CAP_ATTR_UNDEFINED,
++	DCB_CAP_ATTR_ALL,
++	DCB_CAP_ATTR_PG,
++	DCB_CAP_ATTR_PFC,
++	DCB_CAP_ATTR_UP2TC,
++	DCB_CAP_ATTR_PG_TCS,
++	DCB_CAP_ATTR_PFC_TCS,
++	DCB_CAP_ATTR_GSP,
++	DCB_CAP_ATTR_BCN,
++	DCB_CAP_ATTR_DCBX,
++
++	__DCB_CAP_ATTR_ENUM_MAX,
++	DCB_CAP_ATTR_MAX = __DCB_CAP_ATTR_ENUM_MAX - 1,
++};
++
++/**
++ * DCBX capability flags
++ *
++ * @DCB_CAP_DCBX_HOST: DCBX negotiation is performed by the host LLDP agent.
++ *                     'set' routines are used to configure the device with
++ *                     the negotiated parameters
++ *
++ * @DCB_CAP_DCBX_LLD_MANAGED: DCBX negotiation is not performed in the host but
++ *                            by another entity
++ *                            'get' routines are used to retrieve the
++ *                            negotiated parameters
++ *                            'set' routines can be used to set the initial
++ *                            negotiation configuration
++ *
++ * @DCB_CAP_DCBX_VER_CEE: for a non-host DCBX engine, indicates the engine
++ *                        supports the CEE protocol flavor
++ *
++ * @DCB_CAP_DCBX_VER_IEEE: for a non-host DCBX engine, indicates the engine
++ *                         supports the IEEE protocol flavor
++ *
++ * @DCB_CAP_DCBX_STATIC: for a non-host DCBX engine, indicates the engine
++ *                       supports static configuration (i.e no actual
++ *                       negotiation is performed negotiated parameters equal
++ *                       the initial configuration)
++ *
++ */
++#define DCB_CAP_DCBX_HOST		0x01
++#define DCB_CAP_DCBX_LLD_MANAGED	0x02
++#define DCB_CAP_DCBX_VER_CEE		0x04
++#define DCB_CAP_DCBX_VER_IEEE		0x08
++#define DCB_CAP_DCBX_STATIC		0x10
++
++/**
++ * enum dcbnl_numtcs_attrs - number of traffic classes
++ *
++ * @DCB_NUMTCS_ATTR_UNDEFINED: unspecified attribute to catch errors
++ * @DCB_NUMTCS_ATTR_ALL: (NLA_FLAG) all traffic class attributes
++ * @DCB_NUMTCS_ATTR_PG: (NLA_U8) number of traffic classes used for
++ *                               priority groups
++ * @DCB_NUMTCS_ATTR_PFC: (NLA_U8) number of traffic classes which can
++ *                                support priority flow control
++ */
++enum dcbnl_numtcs_attrs {
++	DCB_NUMTCS_ATTR_UNDEFINED,
++	DCB_NUMTCS_ATTR_ALL,
++	DCB_NUMTCS_ATTR_PG,
++	DCB_NUMTCS_ATTR_PFC,
++
++	__DCB_NUMTCS_ATTR_ENUM_MAX,
++	DCB_NUMTCS_ATTR_MAX = __DCB_NUMTCS_ATTR_ENUM_MAX - 1,
++};
++
++enum dcbnl_bcn_attrs{
++	DCB_BCN_ATTR_UNDEFINED = 0,
++
++	DCB_BCN_ATTR_RP_0,
++	DCB_BCN_ATTR_RP_1,
++	DCB_BCN_ATTR_RP_2,
++	DCB_BCN_ATTR_RP_3,
++	DCB_BCN_ATTR_RP_4,
++	DCB_BCN_ATTR_RP_5,
++	DCB_BCN_ATTR_RP_6,
++	DCB_BCN_ATTR_RP_7,
++	DCB_BCN_ATTR_RP_ALL,
++
++	DCB_BCN_ATTR_BCNA_0,
++	DCB_BCN_ATTR_BCNA_1,
++	DCB_BCN_ATTR_ALPHA,
++	DCB_BCN_ATTR_BETA,
++	DCB_BCN_ATTR_GD,
++	DCB_BCN_ATTR_GI,
++	DCB_BCN_ATTR_TMAX,
++	DCB_BCN_ATTR_TD,
++	DCB_BCN_ATTR_RMIN,
++	DCB_BCN_ATTR_W,
++	DCB_BCN_ATTR_RD,
++	DCB_BCN_ATTR_RU,
++	DCB_BCN_ATTR_WRTT,
++	DCB_BCN_ATTR_RI,
++	DCB_BCN_ATTR_C,
++	DCB_BCN_ATTR_ALL,
++
++	__DCB_BCN_ATTR_ENUM_MAX,
++	DCB_BCN_ATTR_MAX = __DCB_BCN_ATTR_ENUM_MAX - 1,
++};
++
++/**
++ * enum dcb_general_attr_values - general DCB attribute values
++ *
++ * @DCB_ATTR_UNDEFINED: value used to indicate an attribute is not supported
++ *
++ */
++enum dcb_general_attr_values {
++	DCB_ATTR_VALUE_UNDEFINED = 0xff
++};
 +
-+void cxgbi_create_conn(struct iscsi_conn *conn)
-+{
-+	/* card can handle up to 15360 bytes */
-+	if (conn->max_recv_dlength > 8192)
-+		conn->max_recv_dlength = 8192;
-+}
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/cxgbi.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/cxgbi.h
---- open-iscsi-2.0-872-rc4-bnx2i/usr/cxgbi.h	1969-12-31 18:00:00.000000000 -0600
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/cxgbi.h	2011-02-24 19:54:10.000000000 -0600
-@@ -0,0 +1,8 @@
-+#ifndef CXGBI_TRANSPORT
-+#define CXGBI_TRANSPORT
++#define DCB_APP_IDTYPE_ETHTYPE	0x00
++#define DCB_APP_IDTYPE_PORTNUM	0x01
++enum dcbnl_app_attrs {
++	DCB_APP_ATTR_UNDEFINED,
 +
-+struct iscsi_conn;
++	DCB_APP_ATTR_IDTYPE,
++	DCB_APP_ATTR_ID,
++	DCB_APP_ATTR_PRIORITY,
 +
-+extern void cxgbi_create_conn(struct iscsi_conn *conn);
++	__DCB_APP_ATTR_ENUM_MAX,
++	DCB_APP_ATTR_MAX = __DCB_APP_ATTR_ENUM_MAX - 1,
++};
 +
-+#endif
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/discovery.c
++/**
++ * enum dcbnl_featcfg_attrs - features conifiguration flags
++ *
++ * @DCB_FEATCFG_ATTR_UNDEFINED: unspecified attribute to catch errors
++ * @DCB_FEATCFG_ATTR_ALL: (NLA_FLAG) all features configuration attributes
++ * @DCB_FEATCFG_ATTR_PG: (NLA_U8) configuration flags for priority groups
++ * @DCB_FEATCFG_ATTR_PFC: (NLA_U8) configuration flags for priority
++ *                                 flow control
++ * @DCB_FEATCFG_ATTR_APP: (NLA_U8) configuration flags for application TLV
++ *
++ */
++#define DCB_FEATCFG_ERROR	0x01	/* error in feature resolution */
++#define DCB_FEATCFG_ENABLE	0x02	/* enable feature */
++#define DCB_FEATCFG_WILLING	0x04	/* feature is willing */
++#define DCB_FEATCFG_ADVERTISE	0x08	/* advertise feature */
++enum dcbnl_featcfg_attrs {
++	DCB_FEATCFG_ATTR_UNDEFINED,
++	DCB_FEATCFG_ATTR_ALL,
++	DCB_FEATCFG_ATTR_PG,
++	DCB_FEATCFG_ATTR_PFC,
++	DCB_FEATCFG_ATTR_APP,
++
++	__DCB_FEATCFG_ATTR_ENUM_MAX,
++	DCB_FEATCFG_ATTR_MAX = __DCB_FEATCFG_ATTR_ENUM_MAX - 1,
++};
++
++#endif /* __LINUX_DCBNL_H__ */
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-bnx2i.sync/usr/discovery.c
 --- open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/discovery.c	2011-02-24 19:54:35.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/discovery.c	2011-08-14 16:48:25.000000000 -0500
 @@ -43,6 +43,12 @@
  #include "fw_context.h"
  #include "iscsid_req.h"
@@ -1062,7 +3833,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-
 +		*rc = ISCSI_ERR_NOMEM;
 +		return NULL;
 +	}
-+
+ 
 +	session->t = iscsi_sysfs_get_transport_by_name(iface->transport_name);
 +	if (!session->t) {
 +		log_error("iSCSI driver %s is not loaded. Load the module "
@@ -1070,7 +3841,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-
 +		*rc = ISCSI_ERR_TRANS_NOT_FOUND;
 +		goto fail;
 +	}
- 
++
 +	INIT_LIST_HEAD(&session->list);
  	/* initialize the session's leading connection */
 +	session->conn[0].id = 0;
@@ -1138,13 +3909,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-
 -done:
 -	return session;
 -}
+-
 +	session->id = -1;
  
-+	/* setup authentication variables for the session*/
-+	*rc = iscsi_setup_authentication(session, &config->auth);
-+	if (*rc)
-+		goto fail;
- 
 -static int
 -setup_authentication(iscsi_session_t *session,
 -		     discovery_rec_t *drec,
@@ -1179,7 +3946,11 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-
 -		/* no or 1-way authentication */
 -		session->bidirectional_auth = 0;
 -	}
--
++	/* setup authentication variables for the session*/
++	*rc = iscsi_setup_authentication(session, &config->auth);
++	if (*rc)
++		goto fail;
+ 
 -	/* copy in whatever credentials we have */
 -	strlcpy(session->username, config->auth.username,
 -		sizeof (session->username));
@@ -1253,9 +4024,11 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-
  
  			if (final) {
  				/* SendTargets exchange is now complete
-@@ -1096,11 +963,9 @@ process_recvd_pdu(struct iscsi_hdr *pdu,
+@@ -1095,12 +962,11 @@ process_recvd_pdu(struct iscsi_hdr *pdu,
+ 	return(rc);
  }
  
++#if 0 /* Unused */
  /*
 - * Make a best effort to logout the session, then disconnect the
 - * socket.
@@ -1267,7 +4040,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-
  {
  	struct iscsi_logout logout_req;
  	struct iscsi_logout_rsp logout_resp;
-@@ -1128,7 +993,7 @@ iscsi_logout_and_disconnect(iscsi_sessio
+@@ -1128,7 +994,7 @@ iscsi_logout_and_disconnect(iscsi_sessio
  	if (!rc) {
  		log_error(
  		       "iscsid: iscsi_logout - failed to send logout PDU.");
@@ -1276,7 +4049,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-
  	}
  
  	/*
-@@ -1138,117 +1003,278 @@ iscsi_logout_and_disconnect(iscsi_sessio
+@@ -1138,117 +1004,362 @@ iscsi_logout_and_disconnect(iscsi_sessio
  	rc = iscsi_io_recv_pdu(&session->conn[0],
  		(struct iscsi_hdr *)&logout_resp, ISCSI_DIGEST_NONE, NULL,
  		0, ISCSI_DIGEST_NONE, 1);
@@ -1291,6 +4064,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-
  		       logout_resp.response);
  	}
 +}
++#endif /* Unused */
 +
 +static void iscsi_destroy_session(struct iscsi_session *session)
 +{
@@ -1305,7 +4079,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-
 +		iscsi_io_disconnect(&session->conn[0]);
 +		goto done;
 +	}
-+
+ 
 +	log_debug(2, "%s ep disconnect", __FUNCTION__);
 +	t->template->ep_disconnect(conn);
 +
@@ -1317,7 +4091,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-
 +			  session->id, conn->id, rc);
 +		goto done;
 +        }
- 
++
 +	log_debug(2, "%s destroy conn", __FUNCTION__);
 +        rc = ipc->destroy_conn(session->t->handle, session->id, conn->id);
 +	if (rc) {
@@ -1332,92 +4106,49 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-
 +		log_error("Could not safely destroy session %d (err %d)",
 +			  session->id, rc);
  done:
--	/*
--	 * Close the socket.
--	 */
--	iscsi_io_disconnect(&session->conn[0]);
 +	if (conn->socket_fd >= 0) {
 +		ipc->ctldev_close();
 +		conn->socket_fd = -1;
 +	}
 +	session->id = -1;
- }
- 
--int discovery_sendtargets(void *fndata, struct iface_rec *iface,
--			  struct list_head *rec_list)
++}
++
 +static int iscsi_create_leading_conn(struct iscsi_session *session)
- {
--	discovery_rec_t *drec = fndata;
--	iscsi_session_t *session;
--	struct pollfd pfd;
--	struct iscsi_hdr pdu_buffer;
--	struct iscsi_hdr *pdu = &pdu_buffer;
--	char *data = NULL;
--	int active = 0, valid_text = 0;
--	struct timeval connection_timer;
--	int timeout;
--	int rc;
--	struct str_buffer sendtargets;
--	uint8_t status_class = 0, status_detail = 0;
--	unsigned int login_failures = 0, data_len;
--	int login_delay = 0;
--	struct sockaddr_storage ss;
--	char host[NI_MAXHOST], serv[NI_MAXSERV], default_port[NI_MAXSERV];
--	struct iscsi_sendtargets_config *config = &drec->u.sendtargets;
++{
 +	struct iface_rec *iface = &session->nrec.iface;
 +	struct iscsi_transport *t = session->t;
 +	struct iscsi_conn *conn = &session->conn[0];
 +	uint32_t host_no;
 +	int rc, sleep_count = 0;
- 
--	/* initial setup */
--	log_debug(1, "starting sendtargets discovery, address %s:%d, ",
--		 drec->address, drec->port);
--	memset(&pdu_buffer, 0, sizeof (pdu_buffer));
--	clear_timer(&connection_timer);
++
 +	if (!(t->caps & CAP_TEXT_NEGO)) {
 +		/*
 +		 * If the LLD does not support TEXT PDUs then we do
 +		 * discovery in userspace.
 +		 */
 +		session->use_ipc = 0;
- 
--	/* allocate a new session, and initialize default values */
--	session = init_new_session(config, iface);
--	if (session == NULL) {
--		log_error("Discovery process to %s:%d failed to "
--			  "create a discovery session.",
--			  drec->address, drec->port);
--		return 1;
++
 +		if (!iscsi_io_connect(conn))
 +			return ISCSI_ERR_TRANS;
 +
 +		session->id = 1;
 +		return 0;
- 	}
++	}
 +	session->use_ipc = 1;
- 
--	log_debug(4, "sendtargets discovery to %s:%d using "
--		 "isid 0x%02x%02x%02x%02x%02x%02x",
--		 drec->address, drec->port, session->isid[0],
--		 session->isid[1], session->isid[2], session->isid[3],
--		 session->isid[4], session->isid[5]);
-+	/*
++
+ 	/*
+-	 * Close the socket.
 +	 * for software this is the tcp socket fd set in iscsi_io_connect
 +	 * and for offload this is the iscsi netlink socket fd
-+	 */
+ 	 */
+-	iscsi_io_disconnect(&session->conn[0]);
 +	conn->socket_fd = ipc->ctldev_open();
 +	if (conn->socket_fd < 0) {
 +		log_error("Could not open netlink interface (err %d)\n",
 +			  errno);
 +		return ISCSI_ERR_INTERNAL;
 +	}
- 
--	/* allocate data buffers for SendTargets data */
--	data = malloc(session->conn[0].max_recv_dlength);
--	if (!data) {
--		rc = 1;
--		goto free_session;
++
 +	host_no = iscsi_sysfs_get_host_no_from_hwinfo(iface, &rc);
 +	if (!rc) {
 +		/*
@@ -1427,10 +4158,8 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-
 +		 */
 +		session->conn[0].bind_ep = 1;
 +		session->hostno = host_no;
- 	}
--	data_len = session->conn[0].max_recv_dlength;
- 
--	str_init_buffer(&sendtargets, 0);
++	}
++
 +	rc = iscsi_host_set_net_params(iface, session);
 +	if (rc) {
 +		log_error("Could not set host net params (err %d)\n",
@@ -1462,13 +4191,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-
 +		} else
 +			break;
 +	} while (1);
- 
--	sprintf(default_port, "%d", drec->port);
--	/* resolve the DiscoveryAddress to an IP address */
--	if (resolve_address(drec->address, default_port, &ss)) {
--		log_error("cannot resolve host name %s", drec->address);
--		rc = 1;
--		goto free_sendtargets;
++
 +	log_debug(2, "%s discovery create session\n", __FUNCTION__);
 +	/* create kernel structs */
 +        rc = ipc->create_session(session->t->handle,
@@ -1500,85 +4223,217 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-
 +			  session->id, rc);
 +		rc = ISCSI_ERR_INTERNAL;
 +		goto disconnect;
++	}
++
++	/* all set */
++	return 0;
++
++disconnect:
++	t->template->ep_disconnect(conn);
++
++	if (session->id != -1 &&
++	    iscsi_sysfs_session_has_leadconn(session->id)) {
++		if (ipc->destroy_conn(session->t->handle, session->id,
++				       conn->id))
++			log_error("Could not safely destroy connection %d:%d",
++				  session->id, conn->id);
++	}
++
++	if (session->id != -1) {
++		if (ipc->destroy_session(session->t->handle, session->id))
++			log_error("Could not safely destroy session %d",
++				  session->id);
++		session->id = -1;
++	}
++
++close_ipc:
++	if (conn->socket_fd >= 0) {
++		ipc->ctldev_close();
++		conn->socket_fd = -1;
++	}
++
++	log_error("Connection to discovery portal %s failed: %s",
++		  conn->host, iscsi_err_to_str(rc));
++	return rc;
+ }
+ 
+-int discovery_sendtargets(void *fndata, struct iface_rec *iface,
+-			  struct list_head *rec_list)
++static struct iscsi_ev_context *
++iscsi_ev_context_get(struct iscsi_conn *conn, int ev_size)
+ {
+-	discovery_rec_t *drec = fndata;
+-	iscsi_session_t *session;
++	log_debug(2, "%s: ev_size %d\n", __FUNCTION__, ev_size);
++
++	ipc_ev_context.data = calloc(1, ev_size);
++	if (!ipc_ev_context.data)
++		return NULL;
++
++	return &ipc_ev_context;
++}
++
++static void iscsi_ev_context_put(struct iscsi_ev_context *ev_context)
++{
++	if (ev_context->data)
++		free(ev_context->data);
++	ev_context->data = NULL;
++}
++
++static int iscsi_sched_ev_context(struct iscsi_ev_context *ev_context,
++				  struct iscsi_conn *conn, unsigned long tmo,
++				  int event)
++{
++	if (event == EV_CONN_RECV_PDU || event == EV_CONN_LOGIN) {
++		conn->recv_context = ev_context;
++		return 0;
++	}
++
++	return -EIO;
++}
++
++static struct iscsi_ipc_ev_clbk ipc_clbk = {
++        .get_ev_context         = iscsi_ev_context_get,
++        .put_ev_context         = iscsi_ev_context_put,
++        .sched_ev_context       = iscsi_sched_ev_context,
++};
++
++static int iscsi_wait_for_login(struct iscsi_conn *conn)
++{
++	struct iscsi_session *session = conn->session;
++	struct iscsi_transport *t = session->t;
+ 	struct pollfd pfd;
+-	struct iscsi_hdr pdu_buffer;
+-	struct iscsi_hdr *pdu = &pdu_buffer;
+-	char *data = NULL;
+-	int active = 0, valid_text = 0;
+ 	struct timeval connection_timer;
+-	int timeout;
+-	int rc;
+-	struct str_buffer sendtargets;
+-	uint8_t status_class = 0, status_detail = 0;
+-	unsigned int login_failures = 0, data_len;
+-	int login_delay = 0;
+-	struct sockaddr_storage ss;
+-	char host[NI_MAXHOST], serv[NI_MAXSERV], default_port[NI_MAXSERV];
+-	struct iscsi_sendtargets_config *config = &drec->u.sendtargets;
++	int timeout, rc;
++	uint32_t conn_state;
++	int status = 0;
+ 
+-	/* initial setup */
+-	log_debug(1, "starting sendtargets discovery, address %s:%d, ",
+-		 drec->address, drec->port);
+-	memset(&pdu_buffer, 0, sizeof (pdu_buffer));
+-	clear_timer(&connection_timer);
++	if (!(t->caps & CAP_LOGIN_OFFLOAD))
++		return 0;
+ 
+-	/* allocate a new session, and initialize default values */
+-	session = init_new_session(config, iface);
+-	if (session == NULL) {
+-		log_error("Discovery process to %s:%d failed to "
+-			  "create a discovery session.",
+-			  drec->address, drec->port);
+-		return 1;
+-	}
++	iscsi_timer_set(&connection_timer, conn->active_timeout);
+ 
+-	log_debug(4, "sendtargets discovery to %s:%d using "
+-		 "isid 0x%02x%02x%02x%02x%02x%02x",
+-		 drec->address, drec->port, session->isid[0],
+-		 session->isid[1], session->isid[2], session->isid[3],
+-		 session->isid[4], session->isid[5]);
++	/* prepare to poll */
++	memset(&pfd, 0, sizeof(pfd));
++	pfd.fd = conn->socket_fd;
++	pfd.events = POLLIN | POLLPRI;
+ 
+-	/* allocate data buffers for SendTargets data */
+-	data = malloc(session->conn[0].max_recv_dlength);
+-	if (!data) {
+-		rc = 1;
+-		goto free_session;
+-	}
+-	data_len = session->conn[0].max_recv_dlength;
++	timeout = iscsi_timer_msecs_until(&connection_timer);
+ 
+-	str_init_buffer(&sendtargets, 0);
++login_repoll:
++	log_debug(4, "discovery login process polling fd %d, "
++		 "timeout in %f seconds", pfd.fd, timeout / 1000.0);
+ 
+-	sprintf(default_port, "%d", drec->port);
+-	/* resolve the DiscoveryAddress to an IP address */
+-	if (resolve_address(drec->address, default_port, &ss)) {
+-		log_error("cannot resolve host name %s", drec->address);
+-		rc = 1;
+-		goto free_sendtargets;
++	pfd.revents = 0;
++	rc = poll(&pfd, 1, timeout);
++
++	log_debug(7, "discovery login process returned from poll, rc %d", rc);
++
++	if (iscsi_timer_expired(&connection_timer)) {
++		log_warning("Discovery login session timed out.");
++		rc = ISCSI_ERR_INTERNAL;
++		goto done;
  	}
  
 -	log_debug(4, "discovery timeouts: login %d, reopen_cnt %d, auth %d.",
 -		 session->conn[0].login_timeout, session->reopen_cnt,
 -		 session->conn[0].auth_timeout);
-+	/* all set */
-+	return 0;
++	if (rc > 0) {
++		if (pfd.revents & (POLLIN | POLLPRI)) {
++			timeout = iscsi_timer_msecs_until(&connection_timer);
++			status = ipc->recv_conn_state(conn, &conn_state);
++			if (status == -EAGAIN)
++				goto login_repoll;
++			else if (status < 0) {
++				rc = ISCSI_ERR_TRANS;
++				goto done;
++			}
  
 -	/* setup authentication variables for the session*/
 -	rc = setup_authentication(session, drec, config);
 -	if (rc == 0) {
 -		rc = 1;
 -		goto free_sendtargets;
-+disconnect:
-+	t->template->ep_disconnect(conn);
-+
-+	if (session->id != -1 &&
-+	    iscsi_sysfs_session_has_leadconn(session->id)) {
-+		if (ipc->destroy_conn(session->t->handle, session->id,
-+				       conn->id))
-+			log_error("Could not safely destroy connection %d:%d",
-+				  session->id, conn->id);
-+	}
-+
-+	if (session->id != -1) {
-+		if (ipc->destroy_session(session->t->handle, session->id))
-+			log_error("Could not safely destroy session %d",
-+				  session->id);
-+		session->id = -1;
-+	}
-+
-+close_ipc:
-+	if (conn->socket_fd >= 0) {
-+		ipc->ctldev_close();
-+		conn->socket_fd = -1;
-+	}
-+
-+	log_error("Connection to discovery portal %s failed: %s",
-+		  conn->host, iscsi_err_to_str(rc));
-+	return rc;
-+}
-+
-+static struct iscsi_ev_context *
-+iscsi_ev_context_get(struct iscsi_conn *conn, int ev_size)
-+{
-+	log_debug(2, "%s: ev_size %d\n", __FUNCTION__, ev_size);
-+
-+	ipc_ev_context.data = calloc(1, ev_size);
-+	if (!ipc_ev_context.data)
-+		return NULL;
++			if (conn_state != ISCSI_CONN_STATE_LOGGED_IN)
++				rc = ISCSI_ERR_TRANS;
++			else
++				rc = 0;
++			goto done;
++		}
 +
-+	return &ipc_ev_context;
-+}
++		if (pfd.revents & POLLHUP) {
++			log_warning("discovery session"
++				    "terminating after hangup");
++			 rc = ISCSI_ERR_TRANS;
++			 goto done;
++		}
 +
-+static void iscsi_ev_context_put(struct iscsi_ev_context *ev_context)
-+{
-+	if (ev_context->data)
-+		free(ev_context->data);
-+	ev_context->data = NULL;
-+}
++		if (pfd.revents & POLLNVAL) {
++			log_warning("discovery POLLNVAL");
++			rc = ISCSI_ERR_INTERNAL;
++			goto done;
++		}
 +
-+static int iscsi_sched_ev_context(struct iscsi_ev_context *ev_context,
-+				  struct iscsi_conn *conn, unsigned long tmo,
-+				  int event)
-+{
-+	if (event == EV_CONN_RECV_PDU) {
-+		conn->recv_context = ev_context;
-+		return 0;
++		if (pfd.revents & POLLERR) {
++			log_warning("discovery POLLERR");
++			rc = ISCSI_ERR_INTERNAL;
++			goto done;
++		}
++	} else if (rc < 0) {
++		log_error("Login poll error");
++		rc = ISCSI_ERR_INTERNAL;
++		goto done;
  	}
  
-+	return -EIO;
++done:
++	return rc;
 +}
 +
-+static struct iscsi_ipc_ev_clbk ipc_clbk = {
-+        .get_ev_context         = iscsi_ev_context_get,
-+        .put_ev_context         = iscsi_ev_context_put,
-+        .sched_ev_context       = iscsi_sched_ev_context,
-+};
-+
 +static int iscsi_create_session(struct iscsi_session *session,
 +				struct iscsi_sendtargets_config *config,
 +				char *data, unsigned int data_len)
@@ -1626,7 +4481,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-
  	/* slowly back off the frequency of login attempts */
  	if (login_failures == 0)
  		login_delay = 0;
-@@ -1263,47 +1289,44 @@ redirect_reconnect:
+@@ -1263,47 +1374,47 @@ redirect_reconnect:
  	else
  		login_delay = 60;	/* after 2 minutes, try once a minute */
  
@@ -1681,6 +4536,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-
 +	 */
 +	iscsi_copy_operational_params(&session->conn[0], &config->session_conf,
 +				      &config->conn_conf);
++
++	if ((session->t->caps & CAP_LOGIN_OFFLOAD))
++		goto start_conn;
  
  	status_class = 0;
  	status_detail = 0;
@@ -1697,7 +4555,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-
  	case LOGIN_OK:
  	case LOGIN_REDIRECT:
  		break;
-@@ -1311,8 +1334,7 @@ redirect_reconnect:
+@@ -1311,8 +1422,7 @@ redirect_reconnect:
  	case LOGIN_IO_ERROR:
  	case LOGIN_REDIRECTION_FAILED:
  		/* try again */
@@ -1707,7 +4565,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-
  		login_failures++;
  		goto set_address;
  
-@@ -1322,16 +1344,16 @@ redirect_reconnect:
+@@ -1322,16 +1432,16 @@ redirect_reconnect:
  	case LOGIN_AUTHENTICATION_FAILED:
  	case LOGIN_VERSION_MISMATCH:
  	case LOGIN_INVALID_PDU:
@@ -1729,7 +4587,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-
  		login_failures = 0;
  		break;
  	case ISCSI_STATUS_CLS_REDIRECT:
-@@ -1343,14 +1365,16 @@ redirect_reconnect:
+@@ -1343,14 +1453,16 @@ redirect_reconnect:
  		case ISCSI_LOGIN_STATUS_TGT_MOVED_TEMP:
  			log_warning(
  				"discovery login temporarily redirected to "
@@ -1749,7 +4607,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-
  			goto redirect_reconnect;
  		default:
  			log_error(
-@@ -1361,32 +1385,130 @@ redirect_reconnect:
+@@ -1361,32 +1473,133 @@ redirect_reconnect:
  		}
  		break;
  	case ISCSI_STATUS_CLS_INITIATOR_ERR:
@@ -1799,6 +4657,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-
 +	if (!(t->caps & CAP_TEXT_NEGO))
 +		return 0;
 +
++start_conn:
 +	log_debug(2, "%s discovery set params\n", __FUNCTION__);
 +	rc = iscsi_session_set_params(conn);
 +	if (rc) {
@@ -1816,7 +4675,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-
 +		goto login_failed;
 +	}
 +
-+	return 0;
++	rc = iscsi_wait_for_login(conn);
++	if (!rc)
++		return 0;
 +
 +login_failed:
 +	iscsi_destroy_session(session);
@@ -1891,7 +4752,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-
  	/* reinitialize */
  	str_truncate_buffer(&sendtargets, 0);
  
-@@ -1397,7 +1519,7 @@ redirect_reconnect:
+@@ -1397,7 +1610,7 @@ redirect_reconnect:
  	active = 1;
  
  	/* set timeouts */
@@ -1900,7 +4761,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-
  
  	/* prepare to poll */
  	memset(&pfd, 0, sizeof (pfd));
-@@ -1405,7 +1527,7 @@ redirect_reconnect:
+@@ -1405,7 +1618,7 @@ redirect_reconnect:
  	pfd.events = POLLIN | POLLPRI;
  
  repoll:
@@ -1909,7 +4770,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-
  	/* block until we receive a PDU, a TCP FIN, a TCP RST,
  	 * or a timeout
  	 */
-@@ -1422,31 +1544,30 @@ repoll:
+@@ -1422,31 +1635,30 @@ repoll:
  		 "discovery process to %s:%d returned from poll, rc %d",
  		 drec->address, drec->port, rc);
  
@@ -1954,7 +4815,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-
  				goto free_sendtargets;
  			}
  
-@@ -1455,14 +1576,13 @@ repoll:
+@@ -1455,14 +1667,13 @@ repoll:
  			 */
  			rc = process_recvd_pdu(pdu, drec, rec_list,
  					       session, &sendtargets,
@@ -1970,7 +4831,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-
  				       session->conn[0].active_timeout);
  				goto repoll;
  			}
-@@ -1472,8 +1592,7 @@ repoll:
+@@ -1472,8 +1683,7 @@ repoll:
  			log_warning("discovery session to %s:%d "
  				    "terminating after hangup",
  				     drec->address, drec->port);
@@ -1980,7 +4841,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-
  			goto free_sendtargets;
  		}
  
-@@ -1489,18 +1608,9 @@ repoll:
+@@ -1489,18 +1699,9 @@ repoll:
  			goto reconnect;
  		}
  	} else if (rc < 0) {
@@ -2002,7 +4863,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-
  	}
  
  	log_debug(1, "discovery process to %s:%d exiting",
-@@ -1510,8 +1620,9 @@ repoll:
+@@ -1510,8 +1711,9 @@ repoll:
  free_sendtargets:
  	str_free_buffer(&sendtargets);
  	free(data);
@@ -2013,9 +4874,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-
  	return rc;
  }
  
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discoveryd.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/discoveryd.c
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discoveryd.c open-iscsi-2.0-872-rc4-bnx2i.sync/usr/discoveryd.c
 --- open-iscsi-2.0-872-rc4-bnx2i/usr/discoveryd.c	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/discoveryd.c	2011-02-24 19:54:10.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/discoveryd.c	2011-08-14 16:48:25.000000000 -0500
 @@ -44,6 +44,7 @@
  #include "isns.h"
  #include "paths.h"
@@ -2259,9 +5120,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discoveryd.c open-iscsi-2.0-872-rc4
  
  	fork_disc(data, drec, drec->u.isns.discoveryd_poll_inval, start_isns);
  	return 0;
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/event_poll.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/event_poll.c
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/event_poll.c open-iscsi-2.0-872-rc4-bnx2i.sync/usr/event_poll.c
 --- open-iscsi-2.0-872-rc4-bnx2i/usr/event_poll.c	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/event_poll.c	2011-02-24 19:54:10.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/event_poll.c	2011-08-14 16:48:25.000000000 -0500
 @@ -35,6 +35,7 @@
  #include "iscsi_ipc.h"
  #include "actor.h"
@@ -2277,9 +5138,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/event_poll.c open-iscsi-2.0-872-rc4
 -		mgmt_ipc_write_rsp(shutdown_qtask, MGMT_IPC_OK);
 +		mgmt_ipc_write_rsp(shutdown_qtask, ISCSI_SUCCESS);
  }
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/host.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/host.c
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/host.c open-iscsi-2.0-872-rc4-bnx2i.sync/usr/host.c
 --- open-iscsi-2.0-872-rc4-bnx2i/usr/host.c	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/host.c	2011-02-24 19:54:10.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/host.c	2011-08-14 16:48:25.000000000 -0500
 @@ -33,6 +33,7 @@
  #include "transport.h"
  #include "initiator.h"
@@ -2288,7 +5149,81 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/host.c open-iscsi-2.0-872-rc4-bnx2i
  
  static int match_host_to_session(void *data, struct session_info *info)
  {
-@@ -200,13 +201,16 @@ int host_info_print(int info_level, uint
+@@ -117,6 +118,47 @@ static int host_info_print_flat(void *da
+ 	return 0;
+ }
+ 
++static int print_host_iface(void *data, struct iface_rec *iface)
++{
++	char *prefix = data;
++
++	printf("%s**********\n", prefix);
++	printf("%sInterface:\n", prefix);
++	printf("%s**********\n", prefix);
++
++	printf("%sKernel Name: %s\n", prefix, iface->name);
++
++	if (!strlen(iface->ipaddress))
++		printf("%sIPaddress: %s\n", prefix, UNKNOWN_VALUE);
++	else if (strchr(iface->ipaddress, '.')) {
++		printf("%sIPaddress: %s\n", prefix, iface->ipaddress);
++		printf("%sGateway: %s\n", prefix, iface->gateway);
++		printf("%sSubnet: %s\n", prefix, iface->subnet_mask);
++		printf("%sBootProto: %s\n", prefix, iface->bootproto);
++	} else {
++		printf("%sIPaddress: [%s]\n", prefix, iface->ipaddress);
++		printf("%sIPaddress Autocfg: %s\n", prefix, iface->ipv6_autocfg);
++		printf("%sLink Local Address: [%s]\n", prefix,
++		       iface->ipv6_linklocal);
++		printf("%sLink Local Autocfg: %s\n", prefix,
++		       iface->linklocal_autocfg);
++		printf("%sRouter Address: [%s]\n", prefix, iface->ipv6_router);
++	}
++
++	printf("%sMTU: %u\n", prefix, iface->mtu);
++	printf("%svlan ID: %u\n", prefix, iface->vlan_id);
++	printf("%svlan priority: %u\n", prefix, iface->vlan_priority);
++	return 0;
++}
++
++static void print_host_ifaces(struct host_info *hinfo, char *prefix)
++{
++	int nr_found;
++
++	iscsi_sysfs_for_each_iface_on_host(prefix, hinfo->host_no, &nr_found,
++					   print_host_iface);
++}
++
+ static int host_info_print_tree(void *data, struct host_info *hinfo)
+ {
+ 	struct list_head sessions;
+@@ -127,6 +169,7 @@ static int host_info_print_tree(void *da
+ 
+ 	INIT_LIST_HEAD(&sessions);
+ 
++
+ 	printf("Host Number: %u\n", hinfo->host_no);
+ 	if (!iscsi_sysfs_get_host_state(state, hinfo->host_no))
+ 		printf("\tState: %s\n", state);
+@@ -134,6 +177,8 @@ static int host_info_print_tree(void *da
+ 		printf("\tState: Unknown\n");
+ 	print_host_info(&hinfo->iface, "\t");
+ 
++	print_host_ifaces(hinfo, "\t");
++
+ 	if (!session_info_flags)
+ 		return 0;
+ 
+@@ -150,7 +195,7 @@ static int host_info_print_tree(void *da
+ 	printf("\tSessions:\n");
+ 	printf("\t*********\n");
+ 
+-	session_info_print_tree(&sessions, "\t", session_info_flags);
++	session_info_print_tree(&sessions, "\t", session_info_flags, 0);
+ 	session_info_free_list(&sessions);
+ 	return 0;
+ }
+@@ -200,13 +245,16 @@ int host_info_print(int info_level, uint
  		break;
  	default:
  		log_error("Invalid info level %d. Try 0 - 4.", info_level);
@@ -2308,9 +5243,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/host.c open-iscsi-2.0-872-rc4-bnx2i
 +	}
  	return 0;
  }
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/idbm.c
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i.sync/usr/idbm.c
 --- open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/idbm.c	2011-02-24 19:54:10.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/idbm.c	2011-08-14 16:48:25.000000000 -0500
 @@ -40,6 +40,7 @@
  #include "iface.h"
  #include "sysdeps.h"
@@ -2319,7 +5254,36 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  
  #define IDBM_HIDE	0    /* Hide parameter when print. */
  #define IDBM_SHOW	1    /* Show parameter when print. */
-@@ -179,7 +180,7 @@ idbm_recinfo_discovery(discovery_rec_t *
+@@ -71,6 +72,28 @@ static struct idbm *db;
+ 	_n++; \
+ } while(0)
+ 
++#define __recinfo_uint8(_key, _info, _rec, _name, _show, _n, _mod) do { \
++	_info[_n].type = TYPE_UINT8; \
++	strlcpy(_info[_n].name, _key, NAME_MAXVAL); \
++	snprintf(_info[_n].value, VALUE_MAXVAL, "%d", _rec->_name); \
++	_info[_n].data = &_rec->_name; \
++	_info[_n].data_len = sizeof(_rec->_name); \
++	_info[_n].visible = _show; \
++	_info[_n].can_modify = _mod; \
++	_n++; \
++} while (0)
++
++#define __recinfo_uint16(_key, _info, _rec, _name, _show, _n, _mod) do { \
++	_info[_n].type = TYPE_UINT16; \
++	strlcpy(_info[_n].name, _key, NAME_MAXVAL); \
++	snprintf(_info[_n].value, VALUE_MAXVAL, "%d", _rec->_name); \
++	_info[_n].data = &_rec->_name; \
++	_info[_n].data_len = sizeof(_rec->_name); \
++	_info[_n].visible = _show; \
++	_info[_n].can_modify = _mod; \
++	_n++; \
++} while (0)
++
+ #define __recinfo_int_o2(_key,_info,_rec,_name,_show,_op0,_op1,_n, _mod) do { \
+ 	_info[_n].type = TYPE_INT_O; \
+ 	strlcpy(_info[_n].name, _key, NAME_MAXVAL); \
+@@ -179,7 +202,7 @@ idbm_recinfo_discovery(discovery_rec_t *
  			      u.sendtargets.conn_timeo.active_timeout,
  			      IDBM_SHOW, num, 1);
  		__recinfo_int(DISC_ST_MAX_RECV_DLEN, ri, r,
@@ -2328,7 +5292,53 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  			      IDBM_SHOW, num, 1);
  		break;
  	case DISCOVERY_TYPE_ISNS:
-@@ -426,6 +427,31 @@ void idbm_print(int type, void *rec, int
+@@ -208,6 +231,8 @@ idbm_recinfo_node(node_rec_t *r, recinfo
+ 	__recinfo_int(NODE_TPGT, ri, r, tpgt, IDBM_SHOW, num, 0);
+ 	__recinfo_int_o3(NODE_STARTUP, ri, r, startup,
+ 			IDBM_SHOW, "manual", "automatic", "onboot", num, 1);
++	__recinfo_int_o2(NODE_LEADING_LOGIN, ri, r, leading_login, IDBM_SHOW,
++			 "No", "Yes", num, 1);
+ 	/*
+ 	 * Note: because we do not add the iface.iscsi_ifacename to
+ 	 * sysfs iscsiadm does some weird matching. We can change the iface
+@@ -247,6 +272,8 @@ idbm_recinfo_node(node_rec_t *r, recinfo
+ 		      session.cmds_max, IDBM_SHOW, num, 1);
+ 	__recinfo_int(SESSION_QDEPTH, ri, r,
+ 		       session.queue_depth, IDBM_SHOW, num, 1);
++	__recinfo_int(SESSION_NR_SESSIONS, ri, r,
++		       session.nr_sessions, IDBM_SHOW, num, 1);
+ 	__recinfo_int_o2(SESSION_AUTH_METHOD, ri, r, session.auth.authmethod,
+ 			 IDBM_SHOW, "None", "CHAP", num, 1);
+ 	__recinfo_str(SESSION_USERNAME, ri, r,
+@@ -369,6 +396,27 @@ void idbm_recinfo_iface(iface_rec_t *r, 
+ 	__recinfo_str(IFACE_TRANSPORTNAME, ri, r, transport_name,
+ 		      IDBM_SHOW, num, 1);
+ 	__recinfo_str(IFACE_INAME, ri, r, iname, IDBM_SHOW, num, 1);
++	__recinfo_str(IFACE_BOOT_PROTO, ri, r, bootproto, IDBM_SHOW, num, 1);
++	__recinfo_str(IFACE_SUBNET_MASK, ri, r, subnet_mask,
++		      IDBM_SHOW, num, 1);
++	__recinfo_str(IFACE_GATEWAY, ri, r, gateway, IDBM_SHOW, num, 1);
++	__recinfo_str(IFACE_IPV6_AUTOCFG, ri, r, ipv6_autocfg,
++		      IDBM_SHOW, num, 1);
++	__recinfo_str(IFACE_LINKLOCAL_AUTOCFG, ri, r, linklocal_autocfg,
++		      IDBM_SHOW, num, 1);
++	__recinfo_str(IFACE_ROUTER_AUTOCFG, ri, r, router_autocfg,
++		      IDBM_SHOW, num, 1);
++	__recinfo_str(IFACE_LINKLOCAL, ri, r, ipv6_linklocal,
++		      IDBM_SHOW, num, 1);
++	__recinfo_str(IFACE_ROUTER, ri, r, ipv6_router, IDBM_SHOW, num, 1);
++	__recinfo_str(IFACE_STATE, ri, r, state, IDBM_SHOW, num, 1);
++	__recinfo_uint16(IFACE_VLAN_ID, ri, r, vlan_id, IDBM_SHOW, num, 1);
++	__recinfo_uint8(IFACE_VLAN_PRIORITY, ri, r, vlan_priority,
++		      IDBM_SHOW, num, 1);
++	__recinfo_str(IFACE_VLAN_STATE, ri, r, vlan_state, IDBM_SHOW, num, 1);
++	__recinfo_int(IFACE_NUM, ri, r, iface_num, IDBM_SHOW, num, 1);
++	__recinfo_uint16(IFACE_MTU, ri, r, mtu, IDBM_SHOW, num, 1);
++	__recinfo_uint16(IFACE_PORT, ri, r, port, IDBM_SHOW, num, 1);
+ }
+ 
+ recinfo_t *idbm_recinfo_alloc(int max_keys)
+@@ -426,6 +474,31 @@ void idbm_print(int type, void *rec, int
  }
  
  static void
@@ -2360,7 +5370,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  idbm_discovery_setup_defaults(discovery_rec_t *rec, discovery_type_e type)
  {
  	memset(rec, 0, sizeof(discovery_rec_t));
-@@ -443,7 +469,10 @@ idbm_discovery_setup_defaults(discovery_
+@@ -443,7 +516,10 @@ idbm_discovery_setup_defaults(discovery_
  		rec->u.sendtargets.conn_timeo.login_timeout=15;
  		rec->u.sendtargets.conn_timeo.auth_timeout = 45;
  		rec->u.sendtargets.conn_timeo.active_timeout=30;
@@ -2372,7 +5382,28 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  						DEF_INI_DISC_MAX_RECV_SEG_LEN;
  		break;
  	case DISCOVERY_TYPE_SLP:
-@@ -515,7 +544,7 @@ setup_passwd_len:
+@@ -485,6 +561,20 @@ setup_passwd_len:
+ 				*(int*)info[i].data =
+ 					strtoul(value, NULL, 10);
+ 				goto updated;
++			} else if (info[i].type == TYPE_UINT8) {
++				if (!info[i].data)
++					continue;
++
++				*(uint8_t *)info[i].data =
++					strtoul(value, NULL, 10);
++				goto updated;
++			} else if (info[i].type == TYPE_UINT16) {
++				if (!info[i].data)
++					continue;
++
++				*(uint16_t *)info[i].data =
++					strtoul(value, NULL, 10);
++				goto updated;
+ 			} else if (info[i].type == TYPE_STR) {
+ 				if (!info[i].data)
+ 					continue;
+@@ -515,7 +605,7 @@ setup_passwd_len:
  		}
  	}
  
@@ -2381,7 +5412,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  
  updated:
  	strlcpy((char*)info[i].value, value, VALUE_MAXVAL);
-@@ -556,12 +585,12 @@ int idbm_verify_param(recinfo_t *info, c
+@@ -556,12 +646,12 @@ int idbm_verify_param(recinfo_t *info, c
  		else {
  			log_error("Cannot modify %s. It is used to look up "
  				  "the record and cannot be changed.", name);
@@ -2396,7 +5427,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  }
  
  void idbm_recinfo_config(recinfo_t *info, FILE *f)
-@@ -627,7 +656,7 @@ void idbm_recinfo_config(recinfo_t *info
+@@ -627,7 +717,7 @@ void idbm_recinfo_config(recinfo_t *info
  		}
  		*(value+i) = 0;
  
@@ -2405,7 +5436,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  	} while (line);
  }
  
-@@ -781,19 +810,19 @@ get_params_from_disc_link(char *link, ch
+@@ -781,19 +871,19 @@ get_params_from_disc_link(char *link, ch
  	(*target) = link;
  	*address = strchr(*target, ',');
  	if (!(*address))
@@ -2429,7 +5460,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  	*(*ifaceid)++ = '\0';
  	return 0;
  }
-@@ -809,8 +838,9 @@ int idbm_lock(void)
+@@ -809,8 +899,9 @@ int idbm_lock(void)
  
  	if (access(LOCK_DIR, F_OK) != 0) {
  		if (mkdir(LOCK_DIR, 0660) != 0) {
@@ -2441,7 +5472,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  		}
  	}
  
-@@ -827,7 +857,7 @@ int idbm_lock(void)
+@@ -827,7 +918,7 @@ int idbm_lock(void)
  			log_error("Maybe you are not root?");
  			log_error("Could not lock discovery DB: %s: %s",
  					LOCK_WRITE_FILE, strerror(errno));
@@ -2450,7 +5481,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  		} else if (i == 0)
  			log_debug(2, "Waiting for discovery DB lock");
  
-@@ -880,7 +910,7 @@ static int __idbm_rec_read(node_rec_t *o
+@@ -880,7 +971,7 @@ static int __idbm_rec_read(node_rec_t *o
  
  	info = idbm_recinfo_alloc(MAX_KEYS);
  	if (!info)
@@ -2459,7 +5490,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  
  	rc = idbm_lock();
  	if (rc)
-@@ -888,8 +918,9 @@ static int __idbm_rec_read(node_rec_t *o
+@@ -888,8 +979,9 @@ static int __idbm_rec_read(node_rec_t *o
  
  	f = fopen(conf, "r");
  	if (!f) {
@@ -2471,7 +5502,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  		goto unlock;
  	}
  
-@@ -916,7 +947,7 @@ idbm_rec_read(node_rec_t *out_rec, char 
+@@ -916,7 +1008,7 @@ idbm_rec_read(node_rec_t *out_rec, char 
  
  	portal = calloc(1, PATH_MAX);
  	if (!portal)
@@ -2480,7 +5511,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  
  	/* try old style portal as config */
  	snprintf(portal, PATH_MAX, "%s/%s/%s,%d", NODE_CONFIG_DIR,
-@@ -929,14 +960,14 @@ idbm_rec_read(node_rec_t *out_rec, char 
+@@ -929,14 +1021,14 @@ idbm_rec_read(node_rec_t *out_rec, char 
  		 targetname, ip, port, tpgt, iface->name);
  	log_debug(5, "rec read looking for config file %s.", portal);
  	if (!strlen(iface->name)) {
@@ -2498,7 +5529,12 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  	}
  
  read:
-@@ -1078,17 +1109,12 @@ static int __idbm_print_all_by_drec(void
+@@ -1073,22 +1165,16 @@ int idbm_for_each_isns_drec(void *data, 
+ static int __idbm_print_all_by_drec(void *data, struct discovery_rec *drec)
+ {
+ 	int info_level = *(int *)data;
+-	int rc;
+ 
  	if (info_level >= 1) {
  		printf("DiscoveryAddress: %s,%d\n",
  		       drec->address, drec->port);
@@ -2519,7 +5555,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  }
  
  static int idbm_print_all_st(int info_level)
-@@ -1168,11 +1194,23 @@ int idbm_print_all_discovery(int info_le
+@@ -1168,11 +1254,23 @@ int idbm_print_all_discovery(int info_le
  	return found;
  }
  
@@ -2547,7 +5583,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  				idbm_iface_op_fn *fn,
  				char *targetname, int tpgt, char *ip, int port)
  {
-@@ -1185,7 +1223,7 @@ int idbm_for_each_iface(int *found, void
+@@ -1185,7 +1283,7 @@ int idbm_for_each_iface(int *found, void
  
  	portal = calloc(1, PATH_MAX);
  	if (!portal)
@@ -2556,7 +5592,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  
  	if (tpgt >= 0)
  		goto read_iface;
-@@ -1195,7 +1233,7 @@ int idbm_for_each_iface(int *found, void
+@@ -1195,7 +1293,7 @@ int idbm_for_each_iface(int *found, void
  		 ip, port);
  	if (stat(portal, &statb)) {
  		log_error("iface iter could not stat %s.", portal);
@@ -2565,7 +5601,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  		goto free_portal;
  	}
  
-@@ -1217,11 +1255,13 @@ read_iface:
+@@ -1217,11 +1315,13 @@ read_iface:
  	iface_dirfd = opendir(portal);
  	if (!iface_dirfd) {
  		log_error("iface iter could not read dir %s.", portal);
@@ -2580,7 +5616,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  		if (!strcmp(iface_dent->d_name, ".") ||
  		    !strcmp(iface_dent->d_name, ".."))
  			continue;
-@@ -1233,14 +1273,12 @@ read_iface:
+@@ -1233,14 +1333,12 @@ read_iface:
  		if (__idbm_rec_read(&rec, portal))
  			continue;
  
@@ -2599,7 +5635,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  	}
  
  	closedir(iface_dirfd);
-@@ -1263,17 +1301,18 @@ int idbm_for_each_portal(int *found, voi
+@@ -1263,17 +1361,18 @@ int idbm_for_each_portal(int *found, voi
  
  	portal = calloc(1, PATH_MAX);
  	if (!portal)
@@ -2620,7 +5656,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  
  		if (!strcmp(portal_dent->d_name, ".") ||
  		    !strcmp(portal_dent->d_name, ".."))
-@@ -1288,11 +1327,12 @@ int idbm_for_each_portal(int *found, voi
+@@ -1288,11 +1387,12 @@ int idbm_for_each_portal(int *found, voi
  		if (tmp_tpgt)
  			*tmp_tpgt++ = '\0';
  
@@ -2636,7 +5672,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  	}
  	closedir(portal_dirfd);
  done:
-@@ -1314,14 +1354,17 @@ int idbm_for_each_node(int *found, void 
+@@ -1314,14 +1414,17 @@ int idbm_for_each_node(int *found, void 
  		return 0;
  
  	while ((node_dent = readdir(node_dirfd))) {
@@ -2657,7 +5693,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  	}
  
  	closedir(node_dirfd);
-@@ -1376,17 +1419,17 @@ idbm_discovery_read(discovery_rec_t *out
+@@ -1376,17 +1479,17 @@ idbm_discovery_read(discovery_rec_t *out
  	FILE *f;
  
  	if (drec_type > 1)
@@ -2678,7 +5714,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  		goto free_info;
  	}
  
-@@ -1402,8 +1445,9 @@ idbm_discovery_read(discovery_rec_t *out
+@@ -1402,8 +1505,9 @@ idbm_discovery_read(discovery_rec_t *out
  	f = idbm_open_rec_r(portal,
  			    disc_type_to_config_vals[drec_type].config_name);
  	if (!f) {
@@ -2690,7 +5726,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  		goto unlock;
  	}
  
-@@ -1474,14 +1518,15 @@ static int idbm_rec_write(node_rec_t *re
+@@ -1474,14 +1578,15 @@ static int idbm_rec_write(node_rec_t *re
  	portal = malloc(PATH_MAX);
  	if (!portal) {
  		log_error("Could not alloc portal\n");
@@ -2709,7 +5745,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  			goto free_portal;
  		}
  	}
-@@ -1489,8 +1534,9 @@ static int idbm_rec_write(node_rec_t *re
+@@ -1489,8 +1594,9 @@ static int idbm_rec_write(node_rec_t *re
  	snprintf(portal, PATH_MAX, "%s/%s", NODE_CONFIG_DIR, rec->name);
  	if (access(portal, F_OK) != 0) {
  		if (mkdir(portal, 0660) != 0) {
@@ -2721,7 +5757,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  			goto free_portal;
  		}
  	}
-@@ -1531,13 +1577,13 @@ static int idbm_rec_write(node_rec_t *re
+@@ -1531,13 +1637,13 @@ static int idbm_rec_write(node_rec_t *re
  		 * Old style portal as a file, but with tpgt. Let's update it.
  		 */
  		if (unlink(portal)) {
@@ -2739,7 +5775,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  		goto unlock;
  	}	
  
-@@ -1546,9 +1592,9 @@ mkdir_portal:
+@@ -1546,9 +1652,9 @@ mkdir_portal:
  		 rec->name, rec->conn[0].address, rec->conn[0].port, rec->tpgt);
  	if (stat(portal, &statb)) {
  		if (mkdir(portal, 0660) != 0) {
@@ -2752,7 +5788,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  			goto unlock;
  		}
  	}
-@@ -1559,8 +1605,8 @@ mkdir_portal:
+@@ -1559,8 +1665,8 @@ mkdir_portal:
  open_conf:
  	f = fopen(portal, "w");
  	if (!f) {
@@ -2763,7 +5799,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  		goto unlock;
  	}
  
-@@ -1581,12 +1627,12 @@ idbm_discovery_write(discovery_rec_t *re
+@@ -1581,12 +1687,12 @@ idbm_discovery_write(discovery_rec_t *re
  	int rc = 0;
  
  	if (rec->type > 1)
@@ -2778,7 +5814,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  	}
  
  	rc = idbm_lock();
-@@ -1597,8 +1643,9 @@ idbm_discovery_write(discovery_rec_t *re
+@@ -1597,8 +1703,9 @@ idbm_discovery_write(discovery_rec_t *re
  		 disc_type_to_config_vals[rec->type].config_root);
  	if (access(portal, F_OK) != 0) {
  		if (mkdir(portal, 0660) != 0) {
@@ -2790,7 +5826,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  			goto unlock;
  		}
  	}
-@@ -1610,8 +1657,8 @@ idbm_discovery_write(discovery_rec_t *re
+@@ -1610,8 +1717,8 @@ idbm_discovery_write(discovery_rec_t *re
  	f = idbm_open_rec_w(portal,
  			    disc_type_to_config_vals[rec->type].config_name);
  	if (!f) {
@@ -2801,7 +5837,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  		goto unlock;
  	}
  
-@@ -1655,9 +1702,9 @@ static int setup_disc_to_node_link(char 
+@@ -1655,9 +1762,9 @@ static int setup_disc_to_node_link(char 
  	case DISCOVERY_TYPE_FW:
  		if (access(FW_CONFIG_DIR, F_OK) != 0) {
  			if (mkdir(FW_CONFIG_DIR, 0660) != 0) {
@@ -2814,7 +5850,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  			}
  		}
  
-@@ -1669,9 +1716,9 @@ static int setup_disc_to_node_link(char 
+@@ -1669,9 +1776,9 @@ static int setup_disc_to_node_link(char 
  	case DISCOVERY_TYPE_STATIC:
  		if (access(STATIC_CONFIG_DIR, F_OK) != 0) {
  			if (mkdir(STATIC_CONFIG_DIR, 0660) != 0) {
@@ -2827,7 +5863,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  			}
  		}
  
-@@ -1683,9 +1730,9 @@ static int setup_disc_to_node_link(char 
+@@ -1683,9 +1790,9 @@ static int setup_disc_to_node_link(char 
  	case DISCOVERY_TYPE_ISNS:
  		if (access(ISNS_CONFIG_DIR, F_OK) != 0) {
  			if (mkdir(ISNS_CONFIG_DIR, 0660) != 0) {
@@ -2840,7 +5876,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  			}
  		}
  
-@@ -1732,7 +1779,7 @@ static int setup_disc_to_node_link(char 
+@@ -1732,7 +1839,7 @@ static int setup_disc_to_node_link(char 
  		break;
  	case DISCOVERY_TYPE_SLP:
  	default:
@@ -2849,7 +5885,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  	}
  
  	return rc;
-@@ -1773,7 +1820,7 @@ int idbm_add_node(node_rec_t *newrec, di
+@@ -1773,7 +1880,7 @@ int idbm_add_node(node_rec_t *newrec, di
  
  	node_portal = calloc(2, PATH_MAX);
  	if (!node_portal)
@@ -2858,7 +5894,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  
  	disc_portal = node_portal + PATH_MAX;
  	snprintf(node_portal, PATH_MAX, "%s/%s/%s,%d,%d", NODE_CONFIG_DIR,
-@@ -1795,9 +1842,10 @@ int idbm_add_node(node_rec_t *newrec, di
+@@ -1795,9 +1902,10 @@ int idbm_add_node(node_rec_t *newrec, di
  			log_debug(7, "link from %s to %s exists", node_portal,
  				  disc_portal);
  		else {
@@ -2871,7 +5907,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  		}
  	}
  	idbm_unlock();
-@@ -1812,10 +1860,12 @@ static int idbm_bind_iface_to_nodes(idbm
+@@ -1812,10 +1920,12 @@ static int idbm_bind_iface_to_nodes(idbm
  {
  	struct node_rec *rec, *tmp;
  	struct list_head new_recs;
@@ -2886,7 +5922,46 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  
  	list_for_each_entry_safe(rec, tmp, &new_recs, list) {
  		list_del_init(&rec->list);
-@@ -1960,7 +2010,7 @@ int idbm_delete_discovery(discovery_rec_
+@@ -1825,6 +1935,20 @@ static int idbm_bind_iface_to_nodes(idbm
+ 	return 0;
+ }
+ 
++static int
++discovery_error_fatal(int err)
++{
++	switch (err) {
++	/* No error */
++	case ISCSI_SUCCESS:
++	/* Transport errors or timeouts are not fatal */
++	case ISCSI_ERR_TRANS:
++	case ISCSI_ERR_TRANS_TIMEOUT:
++		return 0;
++	}
++	return 1;
++}
++
+ int idbm_bind_ifaces_to_nodes(idbm_disc_nodes_fn *disc_node_fn,
+ 			      void *data, struct list_head *ifaces,
+ 			      struct list_head *bound_recs)
+@@ -1856,7 +1980,7 @@ int idbm_bind_ifaces_to_nodes(idbm_disc_
+ 			rc = idbm_bind_iface_to_nodes(disc_node_fn, data, iface,
+ 						      bound_recs);
+ 			free(iface);
+-			if (rc)
++			if (discovery_error_fatal(rc))
+ 				goto fail;
+ 			found = 1;
+ 		}
+@@ -1883,7 +2007,7 @@ int idbm_bind_ifaces_to_nodes(idbm_disc_
+ 
+ 			rc = idbm_bind_iface_to_nodes(disc_node_fn, data, iface,
+ 						      bound_recs);
+-			if (rc)
++			if (discovery_error_fatal(rc))
+ 				goto fail;
+ 		}
+ 	}
+@@ -1960,7 +2084,7 @@ int idbm_delete_discovery(discovery_rec_
  
  	portal = calloc(1, PATH_MAX);
  	if (!portal)
@@ -2895,7 +5970,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  
  	snprintf(portal, PATH_MAX, "%s/%s,%d",
  		 disc_type_to_config_vals[drec->type].config_root,
-@@ -2017,7 +2067,7 @@ static int idbm_remove_disc_to_node_link
+@@ -2017,7 +2141,7 @@ static int idbm_remove_disc_to_node_link
  
  	tmprec = malloc(sizeof(*tmprec));
  	if (!tmprec)
@@ -2904,7 +5979,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  
  	memset(portal, 0, PATH_MAX);
  	snprintf(portal, PATH_MAX, "%s/%s/%s,%d,%d/%s", NODE_CONFIG_DIR,
-@@ -2045,9 +2095,9 @@ static int idbm_remove_disc_to_node_link
+@@ -2045,9 +2169,9 @@ static int idbm_remove_disc_to_node_link
  
  	if (!stat(portal, &statb)) {
  		if (unlink(portal)) {
@@ -2917,7 +5992,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  		} else
  			log_debug(7, "rmd %s", portal);
  	} else
-@@ -2073,7 +2123,7 @@ int idbm_delete_node(node_rec_t *rec)
+@@ -2073,7 +2197,7 @@ int idbm_delete_node(node_rec_t *rec)
  
  	portal = calloc(1, PATH_MAX);
  	if (!portal)
@@ -2926,7 +6001,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  
  	rc = idbm_remove_disc_to_node_link(rec, portal);
  	if (rc)
-@@ -2100,15 +2150,15 @@ int idbm_delete_node(node_rec_t *rec)
+@@ -2100,15 +2224,15 @@ int idbm_delete_node(node_rec_t *rec)
  	if (!stat(portal, &statb))
  		goto rm_conf;
  
@@ -2947,7 +6022,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  		goto unlock;
  	}
  
-@@ -2178,7 +2228,7 @@ int idbm_node_set_param(void *data, node
+@@ -2178,7 +2302,7 @@ int idbm_node_set_param(void *data, node
  
  	info = idbm_recinfo_alloc(MAX_KEYS);
  	if (!info)
@@ -2956,7 +6031,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  
  	idbm_recinfo_node(rec, info);
  
-@@ -2207,7 +2257,7 @@ int idbm_discovery_set_param(void *data,
+@@ -2207,7 +2331,7 @@ int idbm_discovery_set_param(void *data,
  
  	info = idbm_recinfo_alloc(MAX_KEYS);
  	if (!info)
@@ -2965,7 +6040,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  
  	idbm_recinfo_discovery((discovery_rec_t *)rec, info);
  
-@@ -2242,7 +2292,7 @@ int idbm_init(idbm_get_config_file_fn *f
+@@ -2242,7 +2366,7 @@ int idbm_init(idbm_get_config_file_fn *f
  	db = malloc(sizeof(idbm_t));
  	if (!db) {
  		log_error("out of memory on idbm allocation");
@@ -2974,7 +6049,20 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  	}
  	memset(db, 0, sizeof(idbm_t));
  	db->get_config_file = fn;
-@@ -2362,16 +2412,7 @@ void idbm_node_setup_defaults(node_rec_t
+@@ -2348,10 +2472,12 @@ void idbm_node_setup_defaults(node_rec_t
+ 
+ 	rec->tpgt = PORTAL_GROUP_TAG_UNKNOWN;
+ 	rec->disc_type = DISCOVERY_TYPE_STATIC;
++	rec->leading_login = 0;
+ 	rec->session.cmds_max = CMDS_MAX;
+ 	rec->session.xmit_thread_priority = XMIT_THREAD_PRIORITY;
+ 	rec->session.initial_cmdsn = 0;
+ 	rec->session.queue_depth = QUEUE_DEPTH;
++	rec->session.nr_sessions = 1;
+ 	rec->session.initial_login_retry_max = DEF_INITIAL_LOGIN_RETRIES_MAX;
+ 	rec->session.reopen_max = 32;
+ 	rec->session.auth.authmethod = 0;
+@@ -2362,16 +2488,10 @@ void idbm_node_setup_defaults(node_rec_t
  	rec->session.err_timeo.tgt_reset_timeout = DEF_TGT_RESET_TIMEO;
  	rec->session.err_timeo.host_reset_timeout = DEF_HOST_RESET_TIMEO;
  	rec->session.timeo.replacement_timeout = DEF_REPLACEMENT_TIMEO;
@@ -2988,11 +6076,14 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
 -	rec->session.iscsi.MaxOutstandingR2T = 1;
 -	rec->session.iscsi.ERL = 0;
 -	rec->session.iscsi.FastAbort = 1;
++	rec->session.info = NULL;
++	rec->session.sid = 0;
++	rec->session.multiple = 0;
 +	idbm_setup_session_defaults(&rec->session.iscsi);
  
  	for (i=0; i<ISCSI_CONN_MAX; i++) {
  		rec->conn[i].startup = ISCSI_STARTUP_MANUAL;
-@@ -2385,13 +2426,7 @@ void idbm_node_setup_defaults(node_rec_t
+@@ -2385,13 +2505,7 @@ void idbm_node_setup_defaults(node_rec_t
  		rec->conn[i].timeo.noop_out_interval = DEF_NOOP_OUT_INTERVAL;
  		rec->conn[i].timeo.noop_out_timeout = DEF_NOOP_OUT_TIMEO;
  
@@ -3007,10 +6098,68 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i
  	}
  
  	iface_setup_defaults(&rec->iface);
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/idbm.h
+@@ -2404,7 +2518,8 @@ idbm_find_rec_in_list(struct list_head *
+ 	struct node_rec *rec;
+ 
+ 	list_for_each_entry(rec, rec_list, list) {
+-		if (__iscsi_match_session(rec, targetname, addr, port, iface))
++		if (__iscsi_match_session(rec, targetname, addr, port, iface,
++					  MATCH_ANY_SID))
+ 			return rec;
+ 	}
+ 
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm_fields.h open-iscsi-2.0-872-rc4-bnx2i.sync/usr/idbm_fields.h
+--- open-iscsi-2.0-872-rc4-bnx2i/usr/idbm_fields.h	2010-07-11 04:05:58.000000000 -0500
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/idbm_fields.h	2011-08-14 16:48:25.000000000 -0500
+@@ -10,6 +10,7 @@
+ #define NODE_NAME	"node.name"
+ #define NODE_TPGT	"node.tpgt"
+ #define NODE_STARTUP	"node.startup"
++#define NODE_LEADING_LOGIN "node.leading_login"
+ #define NODE_DISC_ADDR	"node.discovery_address"
+ #define NODE_DISC_PORT	"node.discovery_port"
+ #define NODE_DISC_TYPE	"node.discovery_type"
+@@ -21,6 +22,7 @@
+ #define SESSION_CMDS_MAX	"node.session.cmds_max"
+ #define SESSION_XMIT_THREAD_PRIORITY "node.session.xmit_thread_priority"
+ #define SESSION_QDEPTH		"node.session.queue_depth"
++#define SESSION_NR_SESSIONS	"node.session.nr_sessions"
+ #define SESSION_AUTH_METHOD	"node.session.auth.authmethod"
+ #define SESSION_USERNAME	"node.session.auth.username"
+ #define SESSION_PASSWORD	"node.session.auth.password"
+@@ -75,7 +77,18 @@
+ #define IFACE_GATEWAY		"iface.gateway"
+ #define IFACE_PRIMARY_DNS	"iface.primary_dns"
+ #define IFACE_SEC_DNS		"iface.secondary_dns"
+-#define IFACE_VLAN		"iface.vlan"
++#define IFACE_VLAN_ID		"iface.vlan_id"
++#define IFACE_VLAN_PRIORITY	"iface.vlan_priority"
++#define IFACE_VLAN_STATE	"iface.vlan_state"
++#define IFACE_LINKLOCAL	"iface.ipv6_linklocal"
++#define IFACE_ROUTER		"iface.ipv6_router"
++#define IFACE_IPV6_AUTOCFG	"iface.ipv6_autocfg"
++#define IFACE_LINKLOCAL_AUTOCFG	"iface.linklocal_autocfg"
++#define IFACE_ROUTER_AUTOCFG	"iface.router_autocfg"
++#define IFACE_STATE		"iface.state"
++#define IFACE_NUM		"iface.iface_num"
++#define IFACE_MTU		"iface.mtu"
++#define IFACE_PORT		"iface.port"
+ 
+ /* discovery fields */
+ #define DISC_STARTUP		"discovery.startup"
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.h open-iscsi-2.0-872-rc4-bnx2i.sync/usr/idbm.h
 --- open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.h	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/idbm.h	2011-02-24 19:54:10.000000000 -0600
-@@ -93,9 +93,6 @@ struct rec_op_data {
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/idbm.h	2011-08-14 16:48:25.000000000 -0500
+@@ -39,6 +39,8 @@
+ #define TYPE_INT	0
+ #define TYPE_INT_O	1
+ #define TYPE_STR	2
++#define TYPE_UINT8	3
++#define TYPE_UINT16	4
+ #define MAX_KEYS	256   /* number of keys total(including CNX_MAX) */
+ #define NAME_MAXVAL	128   /* the maximum length of key name */
+ #define VALUE_MAXVAL	256   /* the maximum length of 223 bytes in the RFC. */
+@@ -93,9 +95,6 @@ struct rec_op_data {
  	node_rec_t *match_rec;
  	idbm_iface_op_fn *fn;
  };
@@ -3020,10 +6169,18 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.h open-iscsi-2.0-872-rc4-bnx2i
  extern int idbm_for_each_portal(int *found, void *data,
  				idbm_portal_op_fn *fn, char *targetname);
  extern int idbm_for_each_node(int *found, void *data,
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iface.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/iface.c
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iface.c open-iscsi-2.0-872-rc4-bnx2i.sync/usr/iface.c
 --- open-iscsi-2.0-872-rc4-bnx2i/usr/iface.c	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iface.c	2011-02-24 19:54:10.000000000 -0600
-@@ -39,6 +39,7 @@
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/iface.c	2011-08-14 16:48:25.000000000 -0500
+@@ -26,6 +26,7 @@
+ #include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#include <arpa/inet.h>
+ 
+ #include "log.h"
+ #include "list.h"
+@@ -39,6 +40,7 @@
  #include "host.h"
  #include "fw_context.h"
  #include "sysdeps.h"
@@ -3031,7 +6188,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iface.c open-iscsi-2.0-872-rc4-bnx2
  
  /*
   * Default ifaces for use with transports that do not bind to hardware
-@@ -101,13 +102,13 @@ struct iface_rec *iface_alloc(char *ifna
+@@ -101,13 +103,13 @@ struct iface_rec *iface_alloc(char *ifna
  	struct iface_rec *iface;
  
  	if (!strlen(ifname) || strlen(ifname) + 1 > ISCSI_MAX_IFACE_LEN) {
@@ -3047,7 +6204,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iface.c open-iscsi-2.0-872-rc4-bnx2
  		return NULL;
  	}
  
-@@ -125,11 +126,11 @@ static int __iface_conf_read(struct ifac
+@@ -125,11 +127,11 @@ static int __iface_conf_read(struct ifac
  
  	iface_conf = calloc(1, PATH_MAX);
  	if (!iface_conf)
@@ -3061,7 +6218,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iface.c open-iscsi-2.0-872-rc4-bnx2
  		goto free_conf;
  	}
  
-@@ -147,7 +148,7 @@ static int __iface_conf_read(struct ifac
+@@ -147,7 +149,7 @@ static int __iface_conf_read(struct ifac
  			iface_setup_defaults(iface);
  			rc = 0;
  		} else
@@ -3070,7 +6227,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iface.c open-iscsi-2.0-872-rc4-bnx2
  		goto free_info;
  	}
  
-@@ -213,12 +214,12 @@ int iface_conf_delete(struct iface_rec *
+@@ -213,12 +215,12 @@ int iface_conf_delete(struct iface_rec *
  	if (def_iface) {
  		log_error("iface %s is a special interface and "
  			  "cannot be deleted.\n", iface->name);
@@ -3085,7 +6242,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iface.c open-iscsi-2.0-872-rc4-bnx2
  
  	sprintf(iface_conf, "%s/%s", IFACE_CONFIG_DIR, iface->name);
  	rc = idbm_lock();
-@@ -226,7 +227,7 @@ int iface_conf_delete(struct iface_rec *
+@@ -226,7 +228,7 @@ int iface_conf_delete(struct iface_rec *
  		goto free_conf;
  
  	if (unlink(iface_conf))
@@ -3094,7 +6251,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iface.c open-iscsi-2.0-872-rc4-bnx2
  	idbm_unlock();
  
  free_conf:
-@@ -246,17 +247,17 @@ int iface_conf_write(struct iface_rec *i
+@@ -246,17 +248,17 @@ int iface_conf_write(struct iface_rec *i
  		log_error("iface %s is a special interface and "
  			  "is not stored in %s.\n", iface->name,
  			  IFACE_CONFIG_DIR);
@@ -3115,7 +6272,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iface.c open-iscsi-2.0-872-rc4-bnx2
  		goto free_conf;
  	}
  
-@@ -285,12 +286,12 @@ int iface_conf_update(struct db_set_para
+@@ -285,12 +287,12 @@ int iface_conf_update(struct db_set_para
  	if (def_iface) {
  		log_error("iface %s is a special interface and "
  			  "cannot be modified.\n", iface->name);
@@ -3130,7 +6287,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iface.c open-iscsi-2.0-872-rc4-bnx2
  
  	idbm_recinfo_iface(iface, info);
  	rc = idbm_verify_param(info, param->name);
-@@ -298,10 +299,8 @@ int iface_conf_update(struct db_set_para
+@@ -298,10 +300,8 @@ int iface_conf_update(struct db_set_para
  		goto free_info;
  
  	rc = idbm_rec_update_param(info, param->name, param->value, 0);
@@ -3142,7 +6299,33 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iface.c open-iscsi-2.0-872-rc4-bnx2
  
  	rc = iface_conf_write(iface);
  free_info:
-@@ -418,7 +417,7 @@ int iface_get_by_net_binding(struct ifac
+@@ -309,6 +309,7 @@ free_info:
+ 	return rc;
+ }
+ 
++#if 0 /* Unused */
+ static int iface_get_next_id(void)
+ {
+ 	struct stat statb;
+@@ -346,6 +347,7 @@ static int iface_get_next_id(void)
+ 	free(iface_conf);
+         return rc;
+ }
++#endif /* Unused */
+ 
+ struct iface_search {
+ 	struct iface_rec *pattern;
+@@ -362,7 +364,8 @@ static int __iface_get_by_net_binding(vo
+ 	}
+ 
+ 	if (iface_is_bound_by_hwaddr(search->pattern)) {
+-		if (!strcmp(iface->hwaddress, search->pattern->hwaddress)) {
++		if (!strcasecmp(iface->hwaddress,
++				search->pattern->hwaddress)) {
+ 			iface_copy(search->found, iface);
+ 			return 1;
+ 		} else
+@@ -418,7 +421,7 @@ int iface_get_by_net_binding(struct ifac
  				  __iface_get_by_net_binding);
  	if (rc == 1)
  		return 0;
@@ -3151,7 +6334,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iface.c open-iscsi-2.0-872-rc4-bnx2
  }
  
  static int __iface_setup_host_bindings(void *data, struct host_info *hinfo)
-@@ -438,7 +437,8 @@ static int __iface_setup_host_bindings(v
+@@ -438,7 +441,8 @@ static int __iface_setup_host_bindings(v
  			return 0;
  	}
  
@@ -3161,7 +6344,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iface.c open-iscsi-2.0-872-rc4-bnx2
  		/* Must be a new port */
  		if (!strlen(hinfo->iface.hwaddress)) {
  			log_error("Invalid offload iSCSI host %u. Missing "
-@@ -704,7 +704,7 @@ int iface_for_each_iface(void *data, int
+@@ -704,7 +708,7 @@ int iface_for_each_iface(void *data, int
  			 iface_dent->d_name);
  		iface = iface_alloc(iface_dent->d_name, &err);
  		if (!iface || err) {
@@ -3170,7 +6353,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iface.c open-iscsi-2.0-872-rc4-bnx2
  				log_error("Invalid iface name %s. Must be "
  					  "from 1 to %d characters.",
  					   iface_dent->d_name,
-@@ -756,7 +756,7 @@ static int iface_link(void *data, struct
+@@ -756,7 +760,7 @@ static int iface_link(void *data, struct
  
  	iface_copy = calloc(1, sizeof(*iface_copy));
  	if (!iface_copy)
@@ -3179,9 +6362,918 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iface.c open-iscsi-2.0-872-rc4-bnx2
  
  	memcpy(iface_copy, iface, sizeof(*iface_copy));
  	INIT_LIST_HEAD(&iface_copy->list);
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/initiator.c
+@@ -788,42 +792,54 @@ void iface_link_ifaces(struct list_head 
+ int iface_setup_from_boot_context(struct iface_rec *iface,
+ 				   struct boot_context *context)
+ {
++	struct iscsi_transport *t;
++	uint32_t hostno;
++
+ 	if (strlen(context->initiatorname))
+ 		strlcpy(iface->iname, context->initiatorname,
+ 			sizeof(iface->iname));
+ 
+ 	if (strlen(context->scsi_host_name)) {
+-		struct iscsi_transport *t;
+-		uint32_t hostno;
+-
+ 		if (sscanf(context->scsi_host_name, "iscsi_boot%u", &hostno) != 		    1) {
+ 			log_error("Could not parse %s's host no.",
+ 				  context->scsi_host_name);
+ 			return 0;
+ 		}
+-		t = iscsi_sysfs_get_transport_by_hba(hostno);
+-		if (!t) {
+-			log_error("Could not get transport for %s. "
+-				  "Make sure the iSCSI driver is loaded.",
+-				  context->scsi_host_name);
++	} else if (strlen(context->iface)) {
++/* this ifdef is only temp until distros and firmwares are updated */
++#ifdef OFFLOAD_BOOT_SUPPORTED
++		hostno = iscsi_sysfs_get_host_no_from_hwaddress(context->mac,
++								&rc);
++		if (rc) {
++			/*
++			 * If the MAC in the boot info does not match a iscsi
++			 * host then the MAC must be for network card, so boot
++			 * is not going to be offloaded.
++			 */
++			log_debug(3, "Could not match %s to host\n",
++				  context->mac);
+ 			return 0;
+ 		}
+ 
+-		log_debug(3, "boot context has %s transport %s",
+-			  context->scsi_host_name, t->name);
+-		strcpy(iface->transport_name, t->name);
+-	} else if (strlen(context->iface) &&
+-		 (!net_get_transport_name_from_netdev(context->iface,
+-						iface->transport_name))) {
+-		log_debug(3, "boot context has netdev %s",
+-			  context->iface);
+-		strlcpy(iface->netdev, context->iface,
+-			sizeof(iface->netdev));
++		strlcpy(iface->netdev, context->iface, sizeof(iface->netdev));
++#else
++		return 0;
++#endif
+ 	} else
+ 		return 0;
++
+ 	/*
+ 	 * set up for access through a offload card.
+ 	 */
++	t = iscsi_sysfs_get_transport_by_hba(hostno);
++	if (!t) {
++		log_error("Could not get transport for host%u. "
++			  "Make sure the iSCSI driver is loaded.",
++			  hostno);
++		return 0;
++	}
++	strcpy(iface->transport_name, t->name);
++
+ 	memset(iface->name, 0, sizeof(iface->name));
+ 	snprintf(iface->name, sizeof(iface->name), "%s.%s",
+ 		 iface->transport_name, context->mac);
+@@ -885,3 +901,821 @@ fail:
+ 	}
+ 	return rc;
+ }
++
++struct iface_param_count {
++	struct iface_rec *primary;
++	int count;
++};
++
++/**
++ * __iface_get_param_count - Gets netconfig parameter count for given iface
++ * @data: iface_param_count structure
++ * @iface: iface to setup
++ */
++static int __iface_get_param_count(void *data, struct iface_rec *iface)
++{
++	struct iface_param_count *iface_params = data;
++	int iptype = ISCSI_IFACE_TYPE_IPV4;
++	int count = 0;
++
++	if (strcmp(iface_params->primary->hwaddress, iface->hwaddress))
++		return 0;
++
++	if (strcmp(iface->bootproto, "dhcp") && !strstr(iface->ipaddress, "."))
++		iptype = ISCSI_IFACE_TYPE_IPV6;
++
++	if (iptype == ISCSI_IFACE_TYPE_IPV4) {
++
++		if (strcmp(iface->state, "disable")) {
++			if (strstr(iface->bootproto, "dhcp"))
++				/* DHCP enabled */
++				count++;
++			else {
++				/* DHCP disabled */
++				count++;
++
++				if (strstr(iface->ipaddress, ".")) {
++					/* User configured IPv4 Address */
++					count++;
++
++					if (strstr(iface->subnet_mask, "."))
++						/* User configured Subnet */
++						count++;
++
++					if (strstr(iface->gateway, "."))
++						/* User configured Gateway */
++						count++;
++				} else
++					/*
++					 * IPv4 Address not valid, decrement
++					 * count of DHCP
++					 */
++					count--;
++			}
++
++			/*
++			 * If IPv4 configuration in iface file is valid,
++			 * enable state and other parameters (if any)
++			 */
++			if (count) {
++				/* iface state */
++				count++;
++
++				if (strcmp(iface->vlan_state, "disable")) {
++					/* vlan_state enabled */
++					count++;
++
++					if (iface->vlan_id)
++						/* For vlan value */
++						count++;
++				} else
++					/* vlan_state disabled */
++					count++;
++
++				if (iface->mtu)
++					count++;
++
++				if (iface->port)
++					count++;
++			}
++		} else
++			/* IPv4 is disabled, iface state */
++			count++;
++
++	} else if (iptype == ISCSI_IFACE_TYPE_IPV6) {
++
++		if (strcmp(iface->state, "disable")) {
++
++			/* IPv6 Address */
++			if (strstr(iface->ipv6_autocfg, "nd") ||
++			    strstr(iface->ipv6_autocfg, "dhcpv6"))
++				/* Autocfg enabled */
++				count++;
++			else {
++				/* Autocfg disabled */
++				count++;
++
++				if (strstr(iface->ipaddress, ":"))
++					/* User configured IPv6 Address */
++					count++;
++				else
++					/*
++					 * IPv6 Address not valid, decrement
++					 * count of IPv6 Autocfg
++					 */
++					count--;
++			}
++
++			/* IPv6 LinkLocal Address */
++			if (strstr(iface->linklocal_autocfg, "auto"))
++				/* Autocfg enabled */
++				count++;
++			else {
++				/* Autocfg disabled */
++				count++;
++
++				if (strstr(iface->ipv6_linklocal, ":"))
++					/* User configured LinkLocal Address */
++					count++;
++				else
++					/*
++					 * LinkLocal Address not valid,
++					 * decrement count of LinkLocal Autocfg
++					 */
++					count--;
++			}
++
++			/* IPv6 Router Address */
++			if (strstr(iface->router_autocfg, "auto"))
++				/* Autocfg enabled */
++				count++;
++			else {
++				/* Autocfg disabled */
++				count++;
++
++				if (strstr(iface->ipv6_router, ":"))
++					/* User configured Router Address */
++					count++;
++				else
++					/*
++					 * Router Address not valid,
++					 * decrement count of Router Autocfg
++					 */
++					count--;
++			}
++
++			/*
++			 * If IPv6 configuration in iface file is valid,
++			 * enable state and other parameters (if any)
++			 */
++			if (count) {
++				/* iface state */
++				count++;
++
++				if (strcmp(iface->vlan_state, "disable")) {
++					/* vlan_state enabled */
++					count++;
++
++					if (iface->vlan_id)
++						/* For vlan value */
++						count++;
++				} else
++					/* vlan_state disabled */
++					count++;
++
++				if (iface->mtu)
++					count++;
++
++				if (iface->port)
++					count++;
++			}
++		} else
++			/* IPv6 is disabled, iface state */
++			count++;
++	}
++
++	iface_params->count += count;
++	return 0;
++}
++
++/**
++ * iface_get_param_count - Gets netconfig parameter count from iface
++ * @iface: iface to setup
++ * @iface_all: Flag for number of ifaces to traverse (1 for all)
++ *
++ * Returns netconfig parameter count.
++ */
++int iface_get_param_count(struct iface_rec *iface, int iface_all)
++{
++	int num_found = 0, rc;
++	struct iface_param_count iface_params;
++
++	log_debug(8, "In iface_get_param_count\n");
++
++	iface_params.primary = iface;
++	iface_params.count = 0;
++
++	if (iface_all)
++		rc = iface_for_each_iface(&iface_params, 0, &num_found,
++					  __iface_get_param_count);
++	else
++		rc = __iface_get_param_count(&iface_params, iface);
++
++	log_debug(8, "iface_get_param_count: rc = %d, count = %d\n",
++		  rc, iface_params.count);
++	return iface_params.count;
++}
++
++/* IPv4/IPv6 Port: 3260 or User defined */
++static int iface_fill_port(struct iovec *iov, struct iface_rec *iface,
++			   uint32_t iface_type)
++{
++	int len;
++	struct iscsi_iface_param_info *net_param;
++	uint16_t port = 3260;
++
++	len = sizeof(struct iscsi_iface_param_info) + 2;
++	iov->iov_base = calloc(len, sizeof(char));
++	if (!(iov->iov_base))
++		return 1;
++
++	iov->iov_len = len;
++	net_param = (struct iscsi_iface_param_info *)(iov->iov_base);
++	net_param->param = ISCSI_NET_PARAM_PORT;
++	net_param->iface_type = iface_type;
++	net_param->iface_num = iface->iface_num;
++	net_param->param_type = ISCSI_NET_PARAM;
++	net_param->len = 2;
++	if (iface->port)
++		port = iface->port;
++	memcpy(net_param->value, &port, net_param->len);
++	return 0;
++}
++
++static int iface_fill_mtu(struct iovec *iov, struct iface_rec *iface,
++			  uint32_t iface_type)
++{
++	int len;
++	struct iscsi_iface_param_info *net_param;
++	uint16_t mtu = 0;
++
++	len = sizeof(struct iscsi_iface_param_info) + 2;
++	iov->iov_base = calloc(len, sizeof(char));
++	if (!(iov->iov_base))
++		return 1;
++
++	iov->iov_len = len;
++	net_param = (struct iscsi_iface_param_info *)(iov->iov_base);
++	net_param->param = ISCSI_NET_PARAM_MTU;
++	net_param->iface_type = iface_type;
++	net_param->iface_num = iface->iface_num;
++	net_param->param_type = ISCSI_NET_PARAM;
++	net_param->len = 2;
++	mtu = iface->mtu;
++	memcpy(net_param->value, &mtu, net_param->len);
++	return 0;
++}
++
++/* IPv4/IPv6 VLAN_ID: decimal value <= 4095 */
++static int iface_fill_vlan_id(struct iovec *iov, struct iface_rec *iface,
++			      uint32_t iface_type)
++{
++	int len;
++	struct iscsi_iface_param_info *net_param;
++	uint16_t vlan = 0;
++
++	len = sizeof(struct iscsi_iface_param_info) + 2;
++	iov->iov_base = calloc(len, sizeof(char));
++	if (!(iov->iov_base))
++		return 1;
++
++	iov->iov_len = len;
++	net_param = (struct iscsi_iface_param_info *)(iov->iov_base);
++	net_param->param = ISCSI_NET_PARAM_VLAN_ID;
++	net_param->iface_type = iface_type;
++	net_param->iface_num = iface->iface_num;
++	net_param->param_type = ISCSI_NET_PARAM;
++	net_param->len = 2;
++	if (iface->vlan_id <= ISCSI_MAX_VLAN_ID &&
++	    iface->vlan_priority <= ISCSI_MAX_VLAN_PRIORITY)
++		/*
++		 * Bit 15-13: User Priority of VLAN
++		 * Bit 11-00: VLAN ID
++		 */
++		vlan = (iface->vlan_priority << 13) |
++		       (iface->vlan_id & ISCSI_MAX_VLAN_ID);
++	memcpy(net_param->value, &vlan, net_param->len);
++	return 0;
++}
++
++/* IPv4/IPv6 VLAN state: disable/enable */
++static int iface_fill_vlan_state(struct iovec *iov, struct iface_rec *iface,
++				 uint32_t iface_type)
++{
++	int len;
++	struct iscsi_iface_param_info *net_param;
++
++	len = sizeof(struct iscsi_iface_param_info) + 1;
++	iov->iov_base = calloc(len, sizeof(char));
++	if (!(iov->iov_base))
++		return 1;
++
++	iov->iov_len = len;
++	net_param = (struct iscsi_iface_param_info *)(iov->iov_base);
++	net_param->param = ISCSI_NET_PARAM_VLAN_ENABLED;
++	net_param->iface_type = iface_type;
++	net_param->iface_num = iface->iface_num;
++	net_param->param_type = ISCSI_NET_PARAM;
++	net_param->len = 1;
++	if (strcmp(iface->vlan_state, "disable") && iface->vlan_id)
++		net_param->value[0] = ISCSI_VLAN_ENABLE;
++	else /* Assume disabled */
++		net_param->value[0] = ISCSI_VLAN_DISABLE;
++	return 0;
++}
++
++/* IPv4/IPv6 Network state: disable/enable */
++static int iface_fill_net_state(struct iovec *iov, struct iface_rec *iface,
++				uint32_t iface_type)
++{
++	int len;
++	struct iscsi_iface_param_info *net_param;
++
++	len = sizeof(struct iscsi_iface_param_info) + 1;
++	iov->iov_base = calloc(len, sizeof(char));
++	if (!(iov->iov_base))
++		return 1;
++
++	iov->iov_len = len;
++	net_param = (struct iscsi_iface_param_info *)(iov->iov_base);
++	net_param->param = ISCSI_NET_PARAM_IFACE_ENABLE;
++	net_param->iface_type = iface_type;
++	net_param->iface_num = iface->iface_num;
++	net_param->param_type = ISCSI_NET_PARAM;
++	net_param->len = 1;
++	if (!strcmp(iface->state, "disable"))
++		net_param->value[0] = ISCSI_IFACE_DISABLE;
++	else /* Assume enabled */
++		net_param->value[0] = ISCSI_IFACE_ENABLE;
++	return 0;
++}
++
++/* IPv4 Bootproto: DHCP/static */
++static int iface_fill_net_bootproto(struct iovec *iov, struct iface_rec *iface)
++{
++	int len;
++	struct iscsi_iface_param_info *net_param;
++
++	len = sizeof(struct iscsi_iface_param_info) + 1;
++	iov->iov_base = calloc(len, sizeof(char));
++	if (!(iov->iov_base))
++		return 1;
++
++	iov->iov_len = len;
++	net_param = (struct iscsi_iface_param_info *)(iov->iov_base);
++	net_param->param = ISCSI_NET_PARAM_IPV4_BOOTPROTO;
++	net_param->iface_type = ISCSI_IFACE_TYPE_IPV4;
++	net_param->iface_num = iface->iface_num;
++	net_param->param_type = ISCSI_NET_PARAM;
++	net_param->len = 1;
++	if (!strcmp(iface->bootproto, "dhcp"))
++		net_param->value[0] = ISCSI_BOOTPROTO_DHCP;
++	else
++		net_param->value[0] = ISCSI_BOOTPROTO_STATIC;
++	return 0;
++}
++
++/* IPv6 IPAddress Autocfg: nd/dhcpv6/disable */
++static int iface_fill_net_autocfg(struct iovec *iov, struct iface_rec *iface)
++{
++	int len;
++	struct iscsi_iface_param_info *net_param;
++
++	len = sizeof(struct iscsi_iface_param_info) + 1;
++	iov->iov_base = calloc(len, sizeof(char));
++	if (!(iov->iov_base))
++		return 1;
++
++	iov->iov_len = len;
++	net_param = (struct iscsi_iface_param_info *)(iov->iov_base);
++	net_param->param = ISCSI_NET_PARAM_IPV6_ADDR_AUTOCFG;
++	net_param->iface_type = ISCSI_IFACE_TYPE_IPV6;
++	net_param->param_type = ISCSI_NET_PARAM;
++	net_param->len = 1;
++
++	if (!strcmp(iface->ipv6_autocfg, "nd"))
++		net_param->value[0] = ISCSI_IPV6_AUTOCFG_ND_ENABLE;
++	else if (!strcmp(iface->ipv6_autocfg, "dhcpv6"))
++		net_param->value[0] = ISCSI_IPV6_AUTOCFG_DHCPV6_ENABLE;
++	else
++		net_param->value[0] = ISCSI_IPV6_AUTOCFG_DISABLE;
++
++	return 0;
++}
++
++/* IPv6 LinkLocal Autocfg: enable/disable */
++static int iface_fill_linklocal_autocfg(struct iovec *iov,
++					struct iface_rec *iface)
++{
++	int len;
++	struct iscsi_iface_param_info *net_param;
++
++	len = sizeof(struct iscsi_iface_param_info) + 1;
++	iov->iov_base = calloc(len, sizeof(char));
++	if (!(iov->iov_base))
++		return 1;
++
++	iov->iov_len = len;
++	net_param = (struct iscsi_iface_param_info *)(iov->iov_base);
++	net_param->param = ISCSI_NET_PARAM_IPV6_LINKLOCAL_AUTOCFG;
++	net_param->iface_type = ISCSI_IFACE_TYPE_IPV6;
++	net_param->param_type = ISCSI_NET_PARAM;
++	net_param->len = 1;
++
++	if (strstr(iface->linklocal_autocfg, "auto"))
++		net_param->value[0] = ISCSI_IPV6_LINKLOCAL_AUTOCFG_ENABLE;
++	else
++		net_param->value[0] = ISCSI_IPV6_LINKLOCAL_AUTOCFG_DISABLE;
++
++	return 0;
++}
++
++/* IPv6 Router Autocfg: enable/disable */
++static int iface_fill_router_autocfg(struct iovec *iov, struct iface_rec *iface)
++{
++	int len;
++	struct iscsi_iface_param_info *net_param;
++
++	len = sizeof(struct iscsi_iface_param_info) + 1;
++	iov->iov_base = calloc(len, sizeof(char));
++	if (!(iov->iov_base))
++		return 1;
++
++	iov->iov_len = len;
++	net_param = (struct iscsi_iface_param_info *)(iov->iov_base);
++	net_param->param = ISCSI_NET_PARAM_IPV6_ROUTER_AUTOCFG;
++	net_param->iface_type = ISCSI_IFACE_TYPE_IPV6;
++	net_param->param_type = ISCSI_NET_PARAM;
++	net_param->len = 1;
++
++	if (strstr(iface->router_autocfg, "auto"))
++		net_param->value[0] = ISCSI_IPV6_ROUTER_AUTOCFG_ENABLE;
++	else
++		net_param->value[0] = ISCSI_IPV6_ROUTER_AUTOCFG_DISABLE;
++
++	return 0;
++}
++
++/* IPv4 IPAddress/Subnet Mask/Gateway: 4 bytes */
++static int iface_fill_net_ipv4_addr(struct iovec *iov, struct iface_rec *iface,
++				    uint32_t param)
++{
++	int rc = 1;
++	int len;
++	struct iscsi_iface_param_info *net_param;
++
++	len = sizeof(struct iscsi_iface_param_info) + 4;
++	iov->iov_base = calloc(len, sizeof(char));
++	if (!(iov->iov_base))
++		return 1;
++
++	iov->iov_len = len;
++	net_param = (struct iscsi_iface_param_info *)(iov->iov_base);
++	net_param->param = param;
++	net_param->iface_type = ISCSI_IFACE_TYPE_IPV4;
++	net_param->iface_num = iface->iface_num;
++	net_param->len = 4;
++	net_param->param_type = ISCSI_NET_PARAM;
++
++	switch (param) {
++	case ISCSI_NET_PARAM_IPV4_ADDR:
++		rc = inet_pton(AF_INET, iface->ipaddress, net_param->value);
++		if (rc <= 0)
++			goto free;
++		break;
++	case ISCSI_NET_PARAM_IPV4_SUBNET:
++		rc = inet_pton(AF_INET, iface->subnet_mask, net_param->value);
++		if (rc <= 0)
++			goto free;
++		break;
++	case ISCSI_NET_PARAM_IPV4_GW:
++		rc = inet_pton(AF_INET, iface->gateway, net_param->value);
++		if (rc <= 0)
++			goto free;
++		break;
++	default:
++		goto free;
++	}
++
++	/* validate */
++	if (!net_param->value[0] && !net_param->value[1] &&
++	    !net_param->value[2] && !net_param->value[3])
++		goto free;
++
++	return 0;
++free:
++	free(iov->iov_base);
++	iov->iov_base = NULL;
++	iov->iov_len = 0;
++	return 1;
++}
++
++/* IPv6 IPAddress/LinkLocal/Router: 16 bytes */
++static int iface_fill_net_ipv6_addr(struct iovec *iov, struct iface_rec *iface,
++				    uint32_t param)
++{
++	int rc;
++	int len;
++	struct iscsi_iface_param_info *net_param;
++
++	len = sizeof(struct iscsi_iface_param_info) + 16;
++	iov->iov_base = calloc(len, sizeof(char));
++	if (!(iov->iov_base))
++		return 1;
++
++	iov->iov_len = len;
++	net_param = (struct iscsi_iface_param_info *)(iov->iov_base);
++	net_param->param = param;
++	net_param->iface_type = ISCSI_IFACE_TYPE_IPV6;
++	net_param->iface_num = iface->iface_num;
++	net_param->param_type = ISCSI_NET_PARAM;
++	net_param->len = 16;
++
++	switch (param) {
++	case ISCSI_NET_PARAM_IPV6_ADDR:
++		rc = inet_pton(AF_INET6, iface->ipaddress, net_param->value);
++		if (rc <= 0)
++			goto free;
++		break;
++	case ISCSI_NET_PARAM_IPV6_LINKLOCAL:
++		rc = inet_pton(AF_INET6, iface->ipv6_linklocal,
++			       net_param->value);
++		if (rc <= 0)
++			goto free;
++		break;
++	case ISCSI_NET_PARAM_IPV6_ROUTER:
++		rc = inet_pton(AF_INET6, iface->ipv6_router, net_param->value);
++		if (rc <= 0)
++			goto free;
++		break;
++	default:
++		goto free;
++	}
++
++	return 0;
++free:
++	free(iov->iov_base);
++	iov->iov_base = NULL;
++	iov->iov_len = 0;
++	return 1;
++}
++
++struct iface_net_config {
++	struct iface_rec *primary;
++	struct iovec *iovs;
++	int count;
++};
++
++static int __iface_build_net_config(void *data, struct iface_rec *iface)
++{
++	struct iface_net_config *net_config = data;
++	struct iovec *iov;
++	int iptype = ISCSI_IFACE_TYPE_IPV4;
++	int count = 0;
++
++	if (strcmp(net_config->primary->hwaddress, iface->hwaddress))
++		return 0;
++
++	if (strcmp(iface->bootproto, "dhcp") && !strstr(iface->ipaddress, "."))
++		iptype = ISCSI_IFACE_TYPE_IPV6;
++
++	/* start at 2, because 0 is for nlmsghdr and 1 for event */
++	iov = net_config->iovs + 2;
++
++	if (iptype == ISCSI_IFACE_TYPE_IPV4) {
++		if (!strcmp(iface->state, "disable")) {
++			if (!iface_fill_net_state(&iov[net_config->count],
++						  iface,
++						  ISCSI_IFACE_TYPE_IPV4)) {
++				net_config->count++;
++				count++;
++			}
++
++			return 0;
++		}
++
++		if (strstr(iface->bootproto, "dhcp")) {
++			if (!iface_fill_net_bootproto(&iov[net_config->count],
++						      iface)) {
++				net_config->count++;
++				count++;
++			}
++		} else if (strstr(iface->ipaddress, ".")) {
++			if (!iface_fill_net_bootproto(&iov[net_config->count],
++						      iface)) {
++				net_config->count++;
++				count++;
++			}
++			if (!iface_fill_net_ipv4_addr(&iov[net_config->count],
++						iface,
++						ISCSI_NET_PARAM_IPV4_ADDR)) {
++				net_config->count++;
++				count++;
++			}
++			if (strstr(iface->subnet_mask, ".")) {
++				if (!iface_fill_net_ipv4_addr(
++						&iov[net_config->count], iface,
++						ISCSI_NET_PARAM_IPV4_SUBNET)) {
++					net_config->count++;
++					count++;
++				}
++			}
++			if (strstr(iface->gateway, ".")) {
++				if (!iface_fill_net_ipv4_addr(
++						&iov[net_config->count], iface,
++						ISCSI_NET_PARAM_IPV4_GW)) {
++					net_config->count++;
++					count++;
++				}
++			}
++		}
++
++		/*
++		 * If IPv4 configuration in iface file is valid,
++		 * fill state and other parameters (if any)
++		 */
++		if (count) {
++			if (!iface_fill_net_state(&iov[net_config->count],
++						  iface,
++						  ISCSI_IFACE_TYPE_IPV4)) {
++				net_config->count++;
++				count++;
++			}
++			if (!iface_fill_vlan_state(&iov[net_config->count],
++						iface,
++						ISCSI_IFACE_TYPE_IPV4)) {
++				net_config->count++;
++				count++;
++			}
++			if (strcmp(iface->vlan_state, "disable") &&
++			    iface->vlan_id) {
++				if (!iface_fill_vlan_id(&iov[net_config->count],
++						iface, ISCSI_IFACE_TYPE_IPV4)) {
++					net_config->count++;
++					count++;
++				}
++			}
++			if (iface->mtu) {
++				if (!iface_fill_mtu(&iov[net_config->count],
++						    iface,
++						    ISCSI_IFACE_TYPE_IPV4)) {
++					net_config->count++;
++					count++;
++				}
++			}
++			if (iface->port) {
++				if (!iface_fill_port(&iov[net_config->count],
++						iface,
++						ISCSI_IFACE_TYPE_IPV4)) {
++					net_config->count++;
++					count++;
++				}
++			}
++		}
++	} else if (iptype == ISCSI_IFACE_TYPE_IPV6) {
++		if (!strcmp(iface->state, "disable")) {
++			if (!iface_fill_net_state(&iov[net_config->count],
++						  iface,
++						  ISCSI_IFACE_TYPE_IPV6)) {
++				net_config->count++;
++				count++;
++			}
++			return 0;
++		}
++
++		/* For IPv6 Address */
++		if (strstr(iface->ipv6_autocfg, "nd") ||
++		    strstr(iface->ipv6_autocfg, "dhcpv6")) {
++			if (!iface_fill_net_autocfg(&iov[net_config->count],
++						    iface)) {
++				net_config->count++;
++				count++;
++			}
++		} else if (strstr(iface->ipaddress, ":")) {
++			if (!iface_fill_net_autocfg(&iov[net_config->count],
++						    iface)) {
++				net_config->count++;
++				count++;
++			}
++			/* User provided IPv6 Address */
++			if (!iface_fill_net_ipv6_addr(&iov[net_config->count],
++						iface,
++						ISCSI_NET_PARAM_IPV6_ADDR)) {
++				net_config->count++;
++				count++;
++			}
++		}
++
++		/* For LinkLocal Address */
++		if (strstr(iface->linklocal_autocfg, "auto")) {
++			if (!iface_fill_linklocal_autocfg(
++						&iov[net_config->count],
++						iface)) {
++				net_config->count++;
++				count++;
++			}
++		} else if (strstr(iface->ipv6_linklocal, ":")) {
++			if (!iface_fill_linklocal_autocfg(
++						&iov[net_config->count],
++						iface)) {
++				net_config->count++;
++				count++;
++			}
++			/* User provided Link Local Address */
++			if (!iface_fill_net_ipv6_addr(&iov[net_config->count],
++					iface,
++					ISCSI_NET_PARAM_IPV6_LINKLOCAL)) {
++				net_config->count++;
++				count++;
++			}
++		}
++
++		/* For Router Address */
++		if (strstr(iface->router_autocfg, "auto")) {
++			if (!iface_fill_router_autocfg(&iov[net_config->count],
++						       iface)) {
++				net_config->count++;
++				count++;
++			}
++		} else if (strstr(iface->ipv6_router, ":")) {
++			if (!iface_fill_router_autocfg(&iov[net_config->count],
++						       iface)) {
++				net_config->count++;
++				count++;
++			}
++			/* User provided Router Address */
++			if (!iface_fill_net_ipv6_addr(&iov[net_config->count],
++						iface,
++						ISCSI_NET_PARAM_IPV6_ROUTER)) {
++				net_config->count++;
++				count++;
++			}
++		}
++
++		/*
++		 * If IPv6 configuration in iface file is valid,
++		 * fill state and other parameters
++		 */
++		if (count) {
++			if (!iface_fill_net_state(&iov[net_config->count],
++						  iface,
++						  ISCSI_IFACE_TYPE_IPV6)) {
++				net_config->count++;
++				count++;
++			}
++			if (!iface_fill_vlan_state(&iov[net_config->count],
++						   iface,
++						   ISCSI_IFACE_TYPE_IPV6)) {
++				net_config->count++;
++				count++;
++			}
++			if (strcmp(iface->vlan_state, "disable") &&
++			    iface->vlan_id) {
++				if (!iface_fill_vlan_id(&iov[net_config->count],
++						iface,
++						ISCSI_IFACE_TYPE_IPV6)) {
++					net_config->count++;
++					count++;
++				}
++			}
++			if (iface->mtu) {
++				if (!iface_fill_mtu(&iov[net_config->count],
++						    iface,
++						    ISCSI_IFACE_TYPE_IPV6)) {
++					net_config->count++;
++					count++;
++				}
++			}
++			if (iface->port) {
++				if (!iface_fill_port(&iov[net_config->count],
++						     iface,
++						     ISCSI_IFACE_TYPE_IPV6)) {
++					net_config->count++;
++					count++;
++				}
++			}
++		}
++	}
++	return 0;
++}
++
++/**
++ * iface_build_net_config - Setup neconfig parameter buffers
++ * @iface: iface to setup
++ * @iface_all: Flag for number of ifaces to traverse (1 for all)
++ * @iovs: iovec buffer for netconfig parameters
++ *
++ * Returns total number of netconfig parameter buffers used.
++ */
++int iface_build_net_config(struct iface_rec *iface, int iface_all,
++			   struct iovec *iovs)
++{
++	int num_found = 0, rc;
++	struct iface_net_config net_config;
++
++	log_debug(8, "In iface_build_net_config\n");
++
++	net_config.primary = iface;
++	net_config.iovs = iovs;
++	net_config.count = 0;
++
++	if (iface_all)
++		rc = iface_for_each_iface(&net_config, 0, &num_found,
++					  __iface_build_net_config);
++	else
++		rc = __iface_build_net_config(&net_config, iface);
++
++	log_debug(8, "iface_build_net_config: rc = %d, count = %d\n",
++		  rc, net_config.count);
++	return net_config.count;
++}
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iface.h open-iscsi-2.0-872-rc4-bnx2i.sync/usr/iface.h
+--- open-iscsi-2.0-872-rc4-bnx2i/usr/iface.h	2010-07-11 04:05:58.000000000 -0500
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/iface.h	2011-08-14 16:48:25.000000000 -0500
+@@ -54,6 +54,10 @@ extern int iface_setup_from_boot_context
+                                    struct boot_context *context);
+ extern int iface_create_ifaces_from_boot_contexts(struct list_head *ifaces,
+ 						  struct list_head *targets);
++extern int iface_get_param_count(struct iface_rec *iface_primary,
++				 int iface_all);
++extern int iface_build_net_config(struct iface_rec *iface_primary,
++				  int iface_all, struct iovec *iovs);
+ 
+ #define iface_fmt "[hw=%s,ip=%s,net_if=%s,iscsi_if=%s]"
+ #define iface_str(_iface) \
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-bnx2i.sync/usr/initiator.c
 --- open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/initiator.c	2011-02-24 19:54:10.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/initiator.c	2011-08-14 16:48:25.000000000 -0500
 @@ -46,6 +46,7 @@
  #include "iscsi_settings.h"
  #include "iface.h"
@@ -3486,7 +7578,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  static int
  __session_conn_create(iscsi_session_t *session, int cid)
  {
-@@ -434,9 +244,9 @@ __session_conn_create(iscsi_session_t *s
+@@ -434,12 +244,12 @@ __session_conn_create(iscsi_session_t *s
  	conn_rec_t *conn_rec = &session->nrec.conn[cid];
  	int err;
  
@@ -3497,7 +7589,11 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
 +		return ISCSI_ERR_NOMEM;
  	}
  
- 	conn->state = STATE_FREE;
+-	conn->state = STATE_FREE;
++	conn->state = ISCSI_CONN_STATE_FREE;
+ 	conn->session = session;
+ 	/*
+ 	 * TODO: we must export the socket_fd/transport_eph from sysfs
 @@ -486,14 +296,15 @@ __session_conn_create(iscsi_session_t *s
  		conn->noop_out_interval = DEF_NOOP_OUT_INTERVAL;
  	}
@@ -3571,7 +7667,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  		}
  	}
  }
-@@ -633,9 +443,9 @@ conn_delete_timers(iscsi_conn_t *conn)
+@@ -633,15 +443,16 @@ conn_delete_timers(iscsi_conn_t *conn)
  	actor_delete(&conn->nop_out_timer);
  }
  
@@ -3583,7 +7679,26 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  {
  	iscsi_session_t *session = conn->session;
  
-@@ -657,7 +467,7 @@ session_conn_shutdown(iscsi_conn_t *conn
+ 	log_debug(2, "disconnect conn");
+ 	/* this will check for a valid interconnect connection */
+-	conn->session->t->template->ep_disconnect(conn);
++	if (session->t->template->ep_disconnect)
++		session->t->template->ep_disconnect(conn);
+ 
+ 	if (session->id == -1)
+ 		goto cleanup;
+@@ -649,15 +460,15 @@ session_conn_shutdown(iscsi_conn_t *conn
+ 	if (!iscsi_sysfs_session_has_leadconn(session->id))
+ 		goto cleanup;
+ 
+-	if (conn->state == STATE_IN_LOGIN ||
+-	    conn->state == STATE_IN_LOGOUT ||
+-	    conn->state == STATE_LOGGED_IN) {
++	if (conn->state == ISCSI_CONN_STATE_IN_LOGIN ||
++	    conn->state == ISCSI_CONN_STATE_IN_LOGOUT ||
++	    conn->state == ISCSI_CONN_STATE_LOGGED_IN) {
+ 		log_debug(2, "stop conn (conn state %d)", conn->state);
+ 		if (ipc->stop_conn(session->t->handle, session->id,
  				   conn->id, STOP_CONN_TERM)) {
  			log_error("can't stop connection %d:%d (%d)",
  				  session->id, conn->id, errno);
@@ -3592,7 +7707,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  		}
  	}
  
-@@ -665,7 +475,7 @@ session_conn_shutdown(iscsi_conn_t *conn
+@@ -665,16 +476,18 @@ session_conn_shutdown(iscsi_conn_t *conn
  	if (ipc->destroy_conn(session->t->handle, session->id,
  		conn->id)) {
  		log_error("can not safely destroy connection %d", conn->id);
@@ -3601,8 +7716,12 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  	}
  
  cleanup:
-@@ -674,7 +484,7 @@ cleanup:
- 		if (ipc->destroy_session(session->t->handle, session->id)) {
+ 	if (session->id != -1) {
+ 		log_debug(2, "kdestroy session %u", session->id);
+-		if (ipc->destroy_session(session->t->handle, session->id)) {
++		session->r_stage = R_STAGE_SESSION_DESTOYED;
++		err = ipc->destroy_session(session->t->handle, session->id);
++		if (err) {
  			log_error("can not safely destroy session %d",
  				  session->id);
 -			return MGMT_IPC_ERR_INTERNAL;
@@ -3610,7 +7729,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  		}
  	}
  
-@@ -688,7 +498,7 @@ cleanup:
+@@ -688,7 +501,7 @@ cleanup:
  	mgmt_ipc_write_rsp(qtask, err);
  	conn_delete_timers(conn);
  	__session_destroy(session);
@@ -3619,7 +7738,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  }
  
  static void
-@@ -709,17 +519,17 @@ queue_delayed_reopen(queue_task_t *qtask
+@@ -709,17 +522,17 @@ queue_delayed_reopen(queue_task_t *qtask
  
  static int iscsi_conn_connect(struct iscsi_conn *conn, queue_task_t *qtask)
  {
@@ -3641,7 +7760,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  
  	rc = conn->session->t->template->ep_connect(conn, 1);
  	if (rc < 0 && errno != EINPROGRESS) {
-@@ -732,11 +542,11 @@ static int iscsi_conn_connect(struct isc
+@@ -732,11 +545,11 @@ static int iscsi_conn_connect(struct isc
  
  		log_error("cannot make a connection to %s:%s (%d,%d)",
  			  conn->host, serv, rc, errno);
@@ -3655,7 +7774,21 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  	log_debug(3, "Setting login timer %p timeout %d", &conn->login_timer,
  		  conn->login_timeout);
  	actor_timer(&conn->login_timer, conn->login_timeout * 1000,
-@@ -844,8 +654,16 @@ static int iscsi_retry_initial_login(str
+@@ -759,11 +572,11 @@ __session_conn_reopen(iscsi_conn_t *conn
+ 	/* flush stale polls or errors queued */
+ 	iscsi_flush_context_pool(session);
+ 	conn_delete_timers(conn);
+-	conn->state = STATE_XPT_WAIT;
++	conn->state = ISCSI_CONN_STATE_XPT_WAIT;
+ 
+ 	conn->session->t->template->ep_disconnect(conn);
+ 	if (do_stop) {
+-		/* state: STATE_CLEANUP_WAIT */
++		/* state: ISCSI_CONN_STATE_CLEANUP_WAIT */
+ 		if (ipc->stop_conn(session->t->handle, session->id,
+ 				   conn->id, do_stop)) {
+ 			log_error("can't stop connection %d:%d (%d)",
+@@ -844,8 +657,16 @@ static int iscsi_retry_initial_login(str
  	return 1;
  }
  
@@ -3673,7 +7806,16 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  {
  	struct iscsi_session *session = conn->session;
  
-@@ -863,7 +681,7 @@ static void iscsi_login_eh(struct iscsi_
+@@ -856,14 +677,14 @@ static void iscsi_login_eh(struct iscsi_
+ 	iscsi_flush_context_pool(conn->session);
+ 
+ 	switch (conn->state) {
+-	case STATE_XPT_WAIT:
++	case ISCSI_CONN_STATE_XPT_WAIT:
+ 		switch (session->r_stage) {
+ 		case R_STAGE_NO_CHANGE:
+-			log_debug(6, "login failed STATE_XPT_WAIT/"
++			log_debug(6, "login failed ISCSI_CONN_STATE_XPT_WAIT/"
  				  "R_STAGE_NO_CHANGE");
  			/* timeout during initial connect.
  			 * clean connection. write ipc rsp or retry */
@@ -3682,7 +7824,12 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  			    !iscsi_retry_initial_login(conn))
  				session_conn_shutdown(conn, qtask, err);
  			else {
-@@ -879,7 +697,7 @@ static void iscsi_login_eh(struct iscsi_
+@@ -875,18 +696,18 @@ static void iscsi_login_eh(struct iscsi_
+ 			}
+ 			break;
+ 		case R_STAGE_SESSION_REDIRECT:
+-			log_debug(6, "login failed STATE_XPT_WAIT/"
++			log_debug(6, "login failed ISCSI_CONN_STATE_XPT_WAIT/"
  				  "R_STAGE_SESSION_REDIRECT");
  			/* timeout during initial redirect connect
  			 * clean connection. write ipc rsp or retry */
@@ -3691,7 +7838,29 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  			    !iscsi_retry_initial_login(conn))
  				session_conn_shutdown(conn, qtask, err);
  			else
-@@ -912,7 +730,7 @@ static void iscsi_login_eh(struct iscsi_
+ 				session_conn_reopen(conn, qtask, 0);
+ 			break;
+ 		case R_STAGE_SESSION_REOPEN:
+-			log_debug(6, "login failed STATE_XPT_WAIT/"
++			log_debug(6, "login failed ISCSI_CONN_STATE_XPT_WAIT/"
+ 				  "R_STAGE_SESSION_REOPEN %d",
+ 				  session->reopen_cnt);
+ 			/* timeout during reopen connect. try again */
+@@ -900,11 +721,11 @@ static void iscsi_login_eh(struct iscsi_
+ 		}
+ 
+ 		break;
+-	case STATE_IN_LOGIN:
++	case ISCSI_CONN_STATE_IN_LOGIN:
+ 		switch (session->r_stage) {
+ 		case R_STAGE_NO_CHANGE:
+ 		case R_STAGE_SESSION_REDIRECT:
+-			log_debug(6, "login failed STATE_IN_LOGIN/"
++			log_debug(6, "login failed ISCSI_CONN_STATE_IN_LOGIN/"
+ 				  "R_STAGE_NO_CHANGE %d",
+ 				  session->reopen_cnt);
+ 			/*
+@@ -912,7 +733,7 @@ static void iscsi_login_eh(struct iscsi_
  			 * initial redirected connect. Clean connection
  			 * and write rsp or retry.
  			 */
@@ -3700,7 +7869,15 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  			    !iscsi_retry_initial_login(conn))
  				session_conn_shutdown(conn, qtask, err);
  			else
-@@ -927,7 +745,7 @@ static void iscsi_login_eh(struct iscsi_
+@@ -920,14 +741,14 @@ static void iscsi_login_eh(struct iscsi_
+ 						    STOP_CONN_RECOVER);
+ 			break;
+ 		case R_STAGE_SESSION_REOPEN:
+-			log_debug(6, "login failed STATE_IN_LOGIN/"
++			log_debug(6, "login failed ISCSI_CONN_STATE_IN_LOGIN/"
+ 				  "R_STAGE_SESSION_REOPEN %d",
+ 				  session->reopen_cnt);
+ 			session_conn_reopen(conn, qtask, STOP_CONN_RECOVER);
  			break;
  		case R_STAGE_SESSION_CLEANUP:
  			session_conn_shutdown(conn, qtask,
@@ -3709,7 +7886,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  			break;
  		default:
  			break;
-@@ -951,7 +769,7 @@ __conn_error_handle(iscsi_session_t *ses
+@@ -951,23 +772,23 @@ __conn_error_handle(iscsi_session_t *ses
  	 * just cleanup and return to the user.
  	 */
  	if (conn->logout_qtask) {
@@ -3718,8 +7895,49 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  		return;
  	}
  
-@@ -992,7 +810,7 @@ __conn_error_handle(iscsi_session_t *ses
- 				qtask = session->sync_qtask;
+ 	switch (conn->state) {
+-	case STATE_IN_LOGOUT:
++	case ISCSI_CONN_STATE_IN_LOGOUT:
+ 		/* logout was from eh - fall down to cleanup */
+-	case STATE_LOGGED_IN:
++	case ISCSI_CONN_STATE_LOGGED_IN:
+ 		/* mark failed connection */
+-		conn->state = STATE_CLEANUP_WAIT;
++		conn->state = ISCSI_CONN_STATE_CLEANUP_WAIT;
+ 
+ 		if (session->erl > 0) {
+ 			/* check if we still have some logged in connections */
+ 			for (i=0; i<ISCSI_CONN_MAX; i++) {
+-				if (session->conn[i].state == STATE_LOGGED_IN) {
++				if (session->conn[i].state ==
++				    ISCSI_CONN_STATE_LOGGED_IN)
+ 					break;
+-				}
+ 			}
+ 			if (i != ISCSI_CONN_MAX) {
+ 				/* FIXME: re-assign leading connection
+@@ -979,30 +800,32 @@ __conn_error_handle(iscsi_session_t *ses
+ 
+ 		/* mark all connections as failed */
+ 		for (i=0; i<ISCSI_CONN_MAX; i++) {
+-			if (session->conn[i].state == STATE_LOGGED_IN)
+-				session->conn[i].state = STATE_CLEANUP_WAIT;
++			if (session->conn[i].state ==
++			    ISCSI_CONN_STATE_LOGGED_IN)
++				session->conn[i].state =
++						ISCSI_CONN_STATE_CLEANUP_WAIT;
+ 		}
+ 		session->r_stage = R_STAGE_SESSION_REOPEN;
+ 		break;
+-	case STATE_IN_LOGIN:
++	case ISCSI_CONN_STATE_IN_LOGIN:
+ 		if (session->r_stage == R_STAGE_SESSION_REOPEN) {
+ 			queue_task_t *qtask;
+ 
+-			if (session->sync_qtask)
+-				qtask = session->sync_qtask;
++			if (session->notify_qtask)
++				qtask = session->notify_qtask;
  			else
  				qtask = &session->reopen_qtask;
 -			iscsi_login_eh(conn, qtask, MGMT_IPC_ERR_TRANS_FAILURE);
@@ -3727,7 +7945,19 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  			return;
  		}
  		log_debug(1, "ignoring conn error in login. "
-@@ -1020,19 +838,19 @@ __conn_error_handle(iscsi_session_t *ses
+ 			  "let it timeout");
+ 		return;
+-	case STATE_XPT_WAIT:
++	case ISCSI_CONN_STATE_XPT_WAIT:
+ 		log_debug(1, "ignoring conn error in XPT_WAIT. "
+ 			  "let connection fail on its own");
+ 		return;
+-	case STATE_CLEANUP_WAIT:
++	case ISCSI_CONN_STATE_CLEANUP_WAIT:
+ 		log_debug(1, "ignoring conn error in CLEANUP_WAIT. "
+ 			  "let connection stop");
+ 		return;
+@@ -1020,19 +843,19 @@ __conn_error_handle(iscsi_session_t *ses
  
  static void session_conn_error(void *data)
  {
@@ -3752,15 +7982,18 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  			log_error("BUG: Could not shutdown session.");
  		break;
  	default:
-@@ -1047,13 +865,13 @@ static void iscsi_login_timedout(void *d
+@@ -1046,14 +869,14 @@ static void iscsi_login_timedout(void *d
+ 	struct iscsi_conn *conn = qtask->conn;
  
  	switch (conn->state) {
- 	case STATE_XPT_WAIT:
+-	case STATE_XPT_WAIT:
 -		iscsi_login_eh(conn, qtask, MGMT_IPC_ERR_TRANS_TIMEOUT);
++	case ISCSI_CONN_STATE_XPT_WAIT:
 +		iscsi_login_eh(conn, qtask, ISCSI_ERR_TRANS_TIMEOUT);
  		break;
- 	case STATE_IN_LOGIN:
+-	case STATE_IN_LOGIN:
 -		iscsi_login_eh(conn, qtask, MGMT_IPC_ERR_PDU_TIMEOUT);
++	case ISCSI_CONN_STATE_IN_LOGIN:
 +		iscsi_login_eh(conn, qtask, ISCSI_ERR_PDU_TIMEOUT);
  		break;
  	default:
@@ -3769,7 +8002,16 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  		break;
  	}
  }
-@@ -1136,17 +954,6 @@ static void conn_send_nop_out(void *data
+@@ -1125,7 +948,7 @@ static void conn_send_nop_out(void *data
+ 	 * we cannot start new request during logout and the logout timer
+ 	 * will figure things out.
+ 	 */
+-	if (conn->state == STATE_IN_LOGOUT)
++	if (conn->state == ISCSI_CONN_STATE_IN_LOGOUT)
+ 		return;
+ 
+ 	__send_nopout(conn);
+@@ -1136,17 +959,6 @@ static void conn_send_nop_out(void *data
  		 &conn->nop_out_timer, conn->noop_out_timeout);
  }
  
@@ -3787,7 +8029,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  void free_initiator(void)
  {
  	struct iscsi_transport *t;
-@@ -1170,7 +977,7 @@ static void session_scan_host(struct isc
+@@ -1170,7 +982,7 @@ static void session_scan_host(struct isc
  
  	pid = iscsi_sysfs_scan_host(hostno, 1);
  	if (pid == 0) {
@@ -3796,7 +8038,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  
  		if (session)
  			iscsi_sysfs_for_each_device(
-@@ -1185,302 +992,33 @@ static void session_scan_host(struct isc
+@@ -1185,306 +997,37 @@ static void session_scan_host(struct isc
  			free(qtask);
  		}
  	} else
@@ -3818,9 +8060,8 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
 -		return rc;
 -	}
 -	return 0;
-+		mgmt_ipc_write_rsp(qtask, ISCSI_ERR_INTERNAL);
- }
- 
+-}
+-
 -mgmt_ipc_err_e iscsi_host_set_param(int host_no, int param, char *value)
 -{
 -	struct iscsi_transport *t;
@@ -3831,8 +8072,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
 -	if (__iscsi_host_set_param(t, host_no, param, value, ISCSI_STRING))
 -		return MGMT_IPC_ERR;
 -        return MGMT_IPC_OK;
--}
--
++		mgmt_ipc_write_rsp(qtask, ISCSI_ERR_INTERNAL);
+ }
+ 
 -#define MAX_SESSION_PARAMS 32
 -#define MAX_HOST_PARAMS 3
 -
@@ -4042,7 +8284,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
 -		
 -		if (!(session->param_mask & (1ULL << conntbl[i].param)))
 -			continue;
- 
+-
 -		rc = ipc->set_param(session->t->handle, session->id,
 -				   conn->id, conntbl[i].param, conntbl[i].value,
 -				   conntbl[i].type);
@@ -4072,7 +8314,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
 -				break;
 -			}
 -		}
--
+ 
 -		print_param_value(conntbl[i].param, conntbl[i].value,
 -				  conntbl[i].type);
 +	if (iscsi_session_set_params(conn)) {
@@ -4108,8 +8350,17 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  		return;
  	}
  
-@@ -1504,7 +1042,7 @@ setup_full_feature_phase(iscsi_conn_t *c
- 		session->sync_qtask = NULL;
+-	conn->state = STATE_LOGGED_IN;
++	conn->state = ISCSI_CONN_STATE_LOGGED_IN;
+ 	if (session->r_stage == R_STAGE_NO_CHANGE ||
+ 	    session->r_stage == R_STAGE_SESSION_REDIRECT) {
+ 		/*
+@@ -1501,10 +1044,10 @@ setup_full_feature_phase(iscsi_conn_t *c
+ 			    session->nrec.conn[conn->id].port,
+ 			    session->nrec.iface.name);
+ 	} else {
+-		session->sync_qtask = NULL;
++		session->notify_qtask = NULL;
  
  		session_online_devs(session->hostno, session->id);
 -		mgmt_ipc_write_rsp(c->qtask, MGMT_IPC_OK);
@@ -4117,7 +8368,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  		log_warning("connection%d:%d is operational after recovery "
  			    "(%d attempts)", session->id, conn->id,
  			     session->reopen_cnt);
-@@ -1527,10 +1065,10 @@ setup_full_feature_phase(iscsi_conn_t *c
+@@ -1527,12 +1070,12 @@ setup_full_feature_phase(iscsi_conn_t *c
  
  static void iscsi_logout_timedout(void *data)
  {
@@ -4129,20 +8380,29 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
 -	iscsi_conn_context_put(conn_context); 
 +	iscsi_ev_context_put(ev_context);
  	/*
- 	 * assume we were in STATE_IN_LOGOUT or there
+-	 * assume we were in STATE_IN_LOGOUT or there
++	 * assume we were in ISCSI_CONN_STATE_IN_LOGOUT or there
  	 * was some nasty error
-@@ -1542,7 +1080,7 @@ static void iscsi_logout_timedout(void *
+ 	 */
+ 	log_debug(3, "logout timeout, dropping conn...\n");
+@@ -1542,9 +1085,9 @@ static void iscsi_logout_timedout(void *
  static int iscsi_send_logout(iscsi_conn_t *conn)
  {
  	struct iscsi_logout hdr;
 -	struct iscsi_conn_context *conn_context;
 +	struct iscsi_ev_context *ev_context;
  
- 	if (conn->state != STATE_LOGGED_IN)
+-	if (conn->state != STATE_LOGGED_IN)
++	if (conn->state != ISCSI_CONN_STATE_LOGGED_IN)
  		return EINVAL;
-@@ -1558,12 +1096,12 @@ static int iscsi_send_logout(iscsi_conn_
+ 
+ 	memset(&hdr, 0, sizeof(struct iscsi_logout));
+@@ -1556,14 +1099,14 @@ static int iscsi_send_logout(iscsi_conn_
+ 	if (!iscsi_io_send_pdu(conn, (struct iscsi_hdr*)&hdr,
+ 			       ISCSI_DIGEST_NONE, NULL, ISCSI_DIGEST_NONE, 0))
  		return EIO;
- 	conn->state = STATE_IN_LOGOUT;
+-	conn->state = STATE_IN_LOGOUT;
++	conn->state = ISCSI_CONN_STATE_IN_LOGOUT;
  
 -	conn_context = iscsi_conn_context_get(conn, 0);
 -	if (!conn_context)
@@ -4156,7 +8416,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  					 conn->logout_timeout,
  					 EV_CONN_LOGOUT_TIMER);
  		log_debug(3, "logout timeout timer %u\n",
-@@ -1575,16 +1113,16 @@ static int iscsi_send_logout(iscsi_conn_
+@@ -1575,16 +1118,18 @@ static int iscsi_send_logout(iscsi_conn_
  
  static void iscsi_stop(void *data)
  {
@@ -4169,15 +8429,19 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
 -	iscsi_conn_context_put(conn_context);
 +	iscsi_ev_context_put(ev_context);
  
- 	if (!iscsi_send_logout(conn))
- 		return;
+-	if (!iscsi_send_logout(conn))
+-		return;
++	if (!(conn->session->t->caps & CAP_LOGIN_OFFLOAD)) {
++		if (!iscsi_send_logout(conn))
++			return;
++	}
  
 -	rc = session_conn_shutdown(conn, conn->logout_qtask, MGMT_IPC_OK);
 +	rc = session_conn_shutdown(conn, conn->logout_qtask, ISCSI_SUCCESS);
  	if (rc)
  		log_error("BUG: Could not shutdown session.");
  }
-@@ -1683,6 +1221,7 @@ static void iscsi_recv_login_rsp(struct 
+@@ -1683,6 +1228,7 @@ static void iscsi_recv_login_rsp(struct 
  { 
  	struct iscsi_session *session = conn->session;
  	iscsi_login_context_t *c = &conn->login_context;
@@ -4185,7 +8449,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  
  	if (iscsi_login_rsp(session, c)) {
  		log_debug(1, "login_rsp ret (%d)", c->ret);
-@@ -1703,6 +1242,9 @@ static void iscsi_recv_login_rsp(struct 
+@@ -1703,6 +1249,9 @@ static void iscsi_recv_login_rsp(struct 
  		switch (__check_iscsi_status_class(session, conn->id,
  						   c->status_class,
  						   c->status_detail)) {
@@ -4195,9 +8459,12 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  		case CONN_LOGIN_FAILED:
  			goto failed;
  		case CONN_LOGIN_IMM_REDIRECT_RETRY:
-@@ -1720,8 +1262,7 @@ static void iscsi_recv_login_rsp(struct 
+@@ -1718,10 +1267,9 @@ static void iscsi_recv_login_rsp(struct 
+ 
+ 	if (conn->current_stage != ISCSI_FULL_FEATURE_PHASE) {
  		/* more nego. needed! */
- 		conn->state = STATE_IN_LOGIN;
+-		conn->state = STATE_IN_LOGIN;
++		conn->state = ISCSI_CONN_STATE_IN_LOGIN;
  		if (iscsi_login_req(session, c)) {
 -			iscsi_login_eh(conn, c->qtask,
 -				       MGMT_IPC_ERR_LOGIN_FAILURE);
@@ -4205,7 +8472,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  			return;
  		}
  	} else
-@@ -1730,22 +1271,22 @@ static void iscsi_recv_login_rsp(struct 
+@@ -1730,36 +1278,35 @@ static void iscsi_recv_login_rsp(struct 
  	return;
  retry:
  	/* retry if not initial login or initial login has not timed out */
@@ -4232,10 +8499,16 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
 +	conn->recv_context = ev_context;
  
  	switch (conn->state) {
- 	case STATE_IN_LOGIN:
-@@ -1755,11 +1296,10 @@ static void session_conn_recv_pdu(void *
- 	case STATE_IN_LOGOUT:
- 	case STATE_LOGOUT_REQUESTED:
+-	case STATE_IN_LOGIN:
++	case ISCSI_CONN_STATE_IN_LOGIN:
+ 		iscsi_recv_login_rsp(conn);
+ 		break;
+-	case STATE_LOGGED_IN:
+-	case STATE_IN_LOGOUT:
+-	case STATE_LOGOUT_REQUESTED:
++	case ISCSI_CONN_STATE_LOGGED_IN:
++	case ISCSI_CONN_STATE_IN_LOGOUT:
++	case ISCSI_CONN_STATE_LOGOUT_REQUESTED:
  		/* read incoming PDU */
 -		if (!iscsi_io_recv_pdu(conn, &hdr, ISCSI_DIGEST_NONE,
 -			    conn->data, ISCSI_DEF_MAX_RECV_SEG_LEN,
@@ -4248,17 +8521,20 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  
  		switch (hdr.opcode & ISCSI_OPCODE_MASK) {
  		case ISCSI_OP_NOOP_IN:
-@@ -1777,17 +1317,17 @@ static void session_conn_recv_pdu(void *
+@@ -1776,18 +1323,18 @@ static void session_conn_recv_pdu(void *
+ 			break;
  		}
  		break;
- 	case STATE_XPT_WAIT:
+-	case STATE_XPT_WAIT:
 -		iscsi_conn_context_put(conn_context);
++	case ISCSI_CONN_STATE_XPT_WAIT:
 +		iscsi_ev_context_put(ev_context);
  		log_debug(1, "ignoring incoming PDU in XPT_WAIT. "
  			  "let connection re-establish or fail");
  		break;
- 	case STATE_CLEANUP_WAIT:
+-	case STATE_CLEANUP_WAIT:
 -		iscsi_conn_context_put(conn_context);
++	case ISCSI_CONN_STATE_CLEANUP_WAIT:
 +		iscsi_ev_context_put(ev_context);
  		log_debug(1, "ignoring incoming PDU in XPT_WAIT. "
  			  "let connection cleanup");
@@ -4269,8 +8545,41 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  		log_error("Invalid state. Dropping PDU.\n");
  	}
  }
-@@ -1910,15 +1450,15 @@ retry_create:
+@@ -1908,35 +1455,66 @@ retry_create:
+ 	return err;
+ }
  
++static void setup_offload_login_phase(iscsi_conn_t *conn)
++{
++	iscsi_session_t *session = conn->session;
++	iscsi_login_context_t *c = &conn->login_context;
++	int rc;
++
++	actor_delete(&conn->login_timer);
++
++	if (iscsi_session_set_params(conn)) {
++		iscsi_login_eh(conn, c->qtask, ISCSI_ERR_LOGIN);
++		return;
++	}
++
++	if (iscsi_host_set_params(session)) {
++		iscsi_login_eh(conn, c->qtask, ISCSI_ERR_LOGIN);
++		return;
++	}
++
++	conn->state = ISCSI_CONN_STATE_IN_LOGIN;
++	if (ipc->start_conn(session->t->handle, session->id, conn->id,
++			    &rc) || rc) {
++		log_error("can't start connection %d:%d retcode %d (%d)",
++			  session->id, conn->id, rc, errno);
++		iscsi_login_eh(conn, c->qtask, ISCSI_ERR_INTERNAL);
++		return;
++	}
++
++	session->notify_qtask = c->qtask;
++}
++
++
  static void session_conn_poll(void *data)
  {
 -	struct iscsi_conn_context *conn_context = data;
@@ -4288,9 +8597,11 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
 -	iscsi_conn_context_put(conn_context);
 +	iscsi_ev_context_put(ev_context);
  
- 	if (conn->state != STATE_XPT_WAIT)
+-	if (conn->state != STATE_XPT_WAIT)
++	if (conn->state != ISCSI_CONN_STATE_XPT_WAIT)
  		return;
-@@ -1927,16 +1467,16 @@ static void session_conn_poll(void *data
+ 
+ 	rc = session->t->template->ep_poll(conn, 1);
  	if (rc == 0) {
  		log_debug(4, "poll not connected %d", rc);
  		/* timedout: Poll again. */
@@ -4312,7 +8623,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  	} else if (rc > 0) {
  		/* connected! */
  		memset(c, 0, sizeof(iscsi_login_context_t));
-@@ -1945,7 +1485,7 @@ static void session_conn_poll(void *data
+@@ -1945,26 +1523,26 @@ static void session_conn_poll(void *data
  		if (session->id == -1) {
  			if (conn->id == 0 && session_ipc_create(session)) {
  				log_error("Can't create session.");
@@ -4321,9 +8632,13 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  				goto cleanup;
  			}
  			log_debug(3, "created new iSCSI session sid %d host "
-@@ -1954,17 +1494,16 @@ static void session_conn_poll(void *data
- 			if (ipc->create_conn(session->t->handle,
- 					session->id, conn->id, &conn->id)) {
+ 				  "no %u", session->id, session->hostno);
+ 
+-			if (ipc->create_conn(session->t->handle,
+-					session->id, conn->id, &conn->id)) {
++			err = ipc->create_conn(session->t->handle,
++					session->id, conn->id, &conn->id);
++			if (err) {
  				log_error("Can't create connection.");
 -				err = MGMT_IPC_ERR_INTERNAL;
 +				err = ISCSI_ERR_INTERNAL;
@@ -4343,7 +8658,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  		/*
  		 * TODO: use the iface number or some other value
  		 * so this will be persistent
-@@ -1977,7 +1516,7 @@ static void session_conn_poll(void *data
+@@ -1977,7 +1555,7 @@ static void session_conn_poll(void *data
  			log_error("can't bind conn %d:%d to session %d, "
  				  "retcode %d (%d)", session->id, conn->id,
  				   session->id, rc, errno);
@@ -4352,29 +8667,101 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  			return;
  		}
  		log_debug(3, "bound iSCSI connection %d:%d to session %d",
-@@ -1991,13 +1530,13 @@ static void session_conn_poll(void *data
+@@ -1990,14 +1568,19 @@ static void session_conn_poll(void *data
+ 
  		conn->exp_statsn = iscsi_sysfs_get_exp_statsn(session->id);
  
++		if (session->t->caps & CAP_LOGIN_OFFLOAD) {
++			setup_offload_login_phase(conn);
++			return;
++		}
++
  		if (iscsi_login_begin(session, c)) {
 -			iscsi_login_eh(conn, qtask, MGMT_IPC_ERR_LOGIN_FAILURE);
 +			iscsi_login_eh(conn, qtask, ISCSI_ERR_LOGIN);
  			return;
  		}
  
- 		conn->state = STATE_IN_LOGIN;
+-		conn->state = STATE_IN_LOGIN;
++		conn->state = ISCSI_CONN_STATE_IN_LOGIN;
  		if (iscsi_login_req(session, c)) {
 -			iscsi_login_eh(conn, qtask, MGMT_IPC_ERR_LOGIN_FAILURE);
 +			iscsi_login_eh(conn, qtask, ISCSI_ERR_LOGIN);
  			return;
  		}
  	} else {
-@@ -2011,70 +1550,55 @@ cleanup:
+@@ -2011,70 +1594,125 @@ cleanup:
  	session_conn_shutdown(conn, qtask, err);
  }
  
 -void iscsi_sched_conn_context(struct iscsi_conn_context *conn_context,
 -			      struct iscsi_conn *conn, unsigned long tmo,
 -			      int event)
++static void session_conn_process_login(void *data)
++{
++	struct iscsi_ev_context *ev_context = data;
++	enum iscsi_conn_state state = *(enum iscsi_conn_state *)
++							ev_context->data;
++	struct iscsi_conn *conn = ev_context->conn;
++	struct iscsi_session *session = conn->session;
++	iscsi_login_context_t *c = &conn->login_context;
++	queue_task_t *qtask;
++
++	iscsi_ev_context_put(ev_context);
++	if (!(session->t->caps & CAP_LOGIN_OFFLOAD))
++		return;
++
++	if (state == ISCSI_CONN_STATE_FREE)
++		goto failed_login;
++
++	conn->state = ISCSI_CONN_STATE_LOGGED_IN;
++	/*
++	 * ok we were in_login and now we got the notification that we are
++	 * logged in
++	 */
++	log_debug(3, "session created sid %u host no %d", session->id,
++		  session->hostno);
++
++	if (session->r_stage == R_STAGE_NO_CHANGE ||
++	    session->r_stage == R_STAGE_SESSION_REDIRECT) {
++		/*
++		 * scan host is one-time deal. We
++		 * don't want to re-scan it on recovery.
++		 */
++		session_scan_host(session, session->hostno,
++				 c->qtask);
++		session->notify_qtask = NULL;
++
++		log_warning("Connection%d:%d to [target: %s, portal: %s,%d] "
++			    "through [iface: %s] is operational now",
++			    session->id, conn->id, session->nrec.name,
++			    session->nrec.conn[conn->id].address,
++			    session->nrec.conn[conn->id].port,
++			    session->nrec.iface.name);
++	} else
++		session->notify_qtask = NULL;
++
++
++	/*
++	 * reset ERL=0 reopen counter
++	 */
++	session->reopen_cnt = 0;
++	session->r_stage = R_STAGE_NO_CHANGE;
++
++	return;
++
++failed_login:
++	qtask = session->notify_qtask;
++	session->notify_qtask = NULL;
++	mgmt_ipc_write_rsp(qtask, ISCSI_ERR_LOGIN);
++	if (ipc->destroy_conn(session->t->handle, session->id, conn->id))
++		log_error("can not safely destroy connection %d", conn->id);
++	if (ipc->destroy_session(session->t->handle, session->id))
++		log_error("can not safely destroy session %d", session->id);
++	__session_destroy(session);
++
++}
++
 +static int iscsi_sched_ev_context(struct iscsi_ev_context *ev_context,
 +				  struct iscsi_conn *conn, unsigned long tmo,
 +				  int event)
@@ -4415,6 +8802,11 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  		else
 -			actor_schedule(&conn_context->actor);
 +			actor_schedule(&ev_context->actor);
++		break;
++	case EV_CONN_LOGIN:
++		actor_new(&ev_context->actor, session_conn_process_login,
++			  ev_context);
++		actor_schedule(&ev_context->actor);
  		break;
  	case EV_CONN_POLL:
 -		actor_new(&conn_context->actor, session_conn_poll,
@@ -4461,7 +8853,17 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  }
  
  static iscsi_session_t* session_find_by_rec(node_rec_t *rec)
-@@ -2111,65 +1635,20 @@ static int session_is_running(node_rec_t
+@@ -2087,7 +1725,8 @@ static iscsi_session_t* session_find_by_
+ 			if (__iscsi_match_session(rec, session->nrec.name,
+ 					 session->nrec.conn[0].address,
+ 					 session->nrec.conn[0].port,
+-					 &session->nrec.iface))
++					 &session->nrec.iface,
++					 MATCH_ANY_SID))
+ 				return session;
+ 		}
+ 	}
+@@ -2111,65 +1750,24 @@ static int session_is_running(node_rec_t
  	return 0;
  }
  
@@ -4517,9 +8919,14 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  	struct iscsi_transport *t;
 +	int rc;
  
- 	if (session_is_running(rec))
+-	if (session_is_running(rec))
 -		return MGMT_IPC_ERR_EXISTS;
-+		return ISCSI_ERR_SESS_EXISTS;
++	if (session_is_running(rec)) {
++		if (rec->session.multiple)
++			log_debug(2, "Adding a copy of an existing session");
++		else
++			return ISCSI_ERR_SESS_EXISTS;
++	}
  
  	t = iscsi_sysfs_get_transport_by_name(rec->iface.transport_name);
  	if (!t)
@@ -4530,7 +8937,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  
  	if ((!(t->caps & CAP_RECOVERY_L0) &&
  	     rec->session.iscsi.ERL != 0) ||
-@@ -2222,27 +1701,28 @@ session_login_task(node_rec_t *rec, queu
+@@ -2222,27 +1820,22 @@ session_login_task(node_rec_t *rec, queu
  
  	session = __session_create(rec, t);
  	if (!session)
@@ -4554,24 +8961,33 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
 +	if (iscsi_host_set_net_params(&rec->iface, session)) {
  		__session_destroy(session);
 -		return MGMT_IPC_ERR_LOGIN_FAILURE;
-+		return ISCSI_ERR_LOGIN;
- 	}
- 
- 	conn->state = STATE_XPT_WAIT;
- 	if (iscsi_conn_connect(conn, qtask)) {
- 		__session_destroy(session);
+-	}
+-
+-	conn->state = STATE_XPT_WAIT;
+-	if (iscsi_conn_connect(conn, qtask)) {
+-		__session_destroy(session);
 -		return MGMT_IPC_ERR_TRANS_FAILURE;
-+		return ISCSI_ERR_TRANS;
++		return ISCSI_ERR_LOGIN;
  	}
  
  	if (gettimeofday(&conn->initial_connect_time, NULL))
-@@ -2251,17 +1731,19 @@ session_login_task(node_rec_t *rec, queu
+@@ -2250,26 +1843,37 @@ session_login_task(node_rec_t *rec, queu
+ 			  "login errors iscsid may give up the initial "
  			  "login early. You should manually login.");
  
++	conn->state = ISCSI_CONN_STATE_XPT_WAIT;
  	qtask->rsp.command = MGMT_IPC_SESSION_LOGIN;
 -	qtask->rsp.err = MGMT_IPC_OK;
 -	return MGMT_IPC_OK;
 +	qtask->rsp.err = ISCSI_SUCCESS;
++
++	if (iscsi_conn_connect(conn, qtask)) {
++		log_debug(4, "Initial connect failed. Waiting %u seconds "
++			  "before trying to reconnect.\n",
++			  ISCSI_CONN_ERR_REOPEN_DELAY);
++		queue_delayed_reopen(qtask, ISCSI_CONN_ERR_REOPEN_DELAY);
++	}
++
 +	return ISCSI_SUCCESS;
  }
  
@@ -4589,7 +9005,8 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  	conn = &session->conn[cid];
  
  	/* TODO: must export via sysfs so we can pick this up */
-@@ -2269,7 +1751,7 @@ sync_conn(iscsi_session_t *session, uint
+-	conn->state = STATE_CLEANUP_WAIT;
++	conn->state = ISCSI_CONN_STATE_CLEANUP_WAIT;
  	return 0;
  }
  
@@ -4598,7 +9015,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  iscsi_sync_session(node_rec_t *rec, queue_task_t *qtask, uint32_t sid)
  {
  	iscsi_session_t *session;
-@@ -2278,32 +1760,24 @@ iscsi_sync_session(node_rec_t *rec, queu
+@@ -2278,38 +1882,32 @@ iscsi_sync_session(node_rec_t *rec, queu
  
  	t = iscsi_sysfs_get_transport_by_name(rec->iface.transport_name);
  	if (!t)
@@ -4632,9 +9049,25 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  		goto destroy_session;
 -	}
  
- 	session->sync_qtask = qtask;
+-	session->sync_qtask = qtask;
  	qtask->rsp.command = MGMT_IPC_SESSION_SYNC;
-@@ -2334,12 +1808,12 @@ session_logout_task(int sid, queue_task_
+ 
+-	session_conn_reopen(&session->conn[0], qtask, STOP_CONN_RECOVER);
+ 	log_debug(3, "Started sync iSCSI session %d", session->id);
++	session->notify_qtask = qtask;
++	session_conn_reopen(&session->conn[0], qtask,
++			    STOP_CONN_RECOVER);
++
+ 	return 0;
+ 
+ destroy_session:
+@@ -2329,37 +1927,35 @@ static int session_unbind(struct iscsi_s
+ 	return err;
+ }
+ 
+-int
+-session_logout_task(int sid, queue_task_t *qtask)
++int session_logout_task(int sid, queue_task_t *qtask)
  {
  	iscsi_session_t *session;
  	iscsi_conn_t *conn;
@@ -4649,7 +9082,17 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  	}
  	conn = &session->conn[0];
  	/*
-@@ -2354,7 +1828,7 @@ session_logout_task(int sid, queue_task_
+ 	 * If syncing up or if this is the initial login and mgmt_ipc
+ 	 * has not been notified of that result fail the logout request
+ 	 */
+-	if (session->sync_qtask ||
+-	    ((conn->state == STATE_XPT_WAIT ||
+-	      conn->state == STATE_IN_LOGIN) &&
++	if (session->notify_qtask ||
++	    ((conn->state == ISCSI_CONN_STATE_XPT_WAIT ||
++	      conn->state == ISCSI_CONN_STATE_IN_LOGIN) &&
+ 	    (session->r_stage == R_STAGE_NO_CHANGE ||
+ 	     session->r_stage == R_STAGE_SESSION_REDIRECT))) {
  invalid_state:
  		log_error("session in invalid state for logout. "
  			   "Try again later\n");
@@ -4658,17 +9101,31 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  	}
  
  	/* FIXME: logout all active connections */
-@@ -2370,39 +1844,39 @@ invalid_state:
+ 	conn = &session->conn[0];
+-	/* FIXME: implement Logout Request */
+ 	if (conn->logout_qtask)
+ 		goto invalid_state;
+ 
+@@ -2368,41 +1964,45 @@ invalid_state:
+ 	conn->logout_qtask = qtask;
+ 
  	switch (conn->state) {
- 	case STATE_LOGGED_IN:
+-	case STATE_LOGGED_IN:
++	case ISCSI_CONN_STATE_LOGGED_IN:
  		if (!session_unbind(session))
 -			return MGMT_IPC_OK;
 +			return ISCSI_SUCCESS;
++
++		/* LLDs that offload login also offload logout */
++		if (!(session->t->caps & CAP_LOGIN_OFFLOAD)) {
++			/* unbind is not supported so just do old logout */
++			if (!iscsi_send_logout(conn))
++				return ISCSI_SUCCESS;
++		}
  
- 		/* unbind is not supported so just do old logout */
- 		if (!iscsi_send_logout(conn))
+-		/* unbind is not supported so just do old logout */
+-		if (!iscsi_send_logout(conn))
 -			return MGMT_IPC_OK;
-+			return ISCSI_SUCCESS;
  		log_error("Could not send logout pdu. Dropping session\n");
  		/* fallthrough */
  	default:
@@ -4707,7 +9164,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  }
  
  /*
-@@ -2412,7 +1886,7 @@ iscsi_host_send_targets(queue_task_t *qt
+@@ -2412,7 +2012,7 @@ iscsi_host_send_targets(queue_task_t *qt
   * the card will have sessions preset in the FLASH and will log into them
   * automaotically then send us notification that a session is setup.
   */
@@ -4716,7 +9173,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
  {
  	struct iscsi_transport *transport;
  
-@@ -2428,7 +1902,20 @@ void iscsi_async_session_creation(uint32
+@@ -2428,7 +2028,20 @@ void iscsi_async_session_creation(uint32
  	session_scan_host(NULL, host_no, NULL);
  }
  
@@ -4738,10 +9195,10 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
 +{
 +	ipc_register_ev_callback(&ipc_clbk);
 +}
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator_common.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/initiator_common.c
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator_common.c open-iscsi-2.0-872-rc4-bnx2i.sync/usr/initiator_common.c
 --- open-iscsi-2.0-872-rc4-bnx2i/usr/initiator_common.c	1969-12-31 18:00:00.000000000 -0600
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/initiator_common.c	2011-02-24 19:54:10.000000000 -0600
-@@ -0,0 +1,601 @@
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/initiator_common.c	2011-08-14 16:48:25.000000000 -0500
+@@ -0,0 +1,607 @@
 +/*
 + * Common code for setting up discovery and normal sessions.
 + *
@@ -5254,6 +9711,12 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator_common.c open-iscsi-2.0-8
 +		session->param_mask &= ~ISCSI_OFMARKER_EN;
 +	}
 +
++	/* some llds will send nops internally */
++	if (!iscsi_sysfs_session_supports_nop(session->id)) {
++		session->param_mask &= ~ISCSI_PING_TMO;
++		session->param_mask &= ~ISCSI_RECV_TMO;
++	}
++
 +	/* Entered full-feature phase! */
 +	for (i = 0; i < MAX_SESSION_PARAMS; i++) {
 +		if (conn->id != 0 && !conntbl[i].conn_only)
@@ -5343,10 +9806,41 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator_common.c open-iscsi-2.0-8
 +	}
 +	return 0;
 +}
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/initiator.h
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.h open-iscsi-2.0-872-rc4-bnx2i.sync/usr/initiator.h
 --- open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.h	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/initiator.h	2011-02-24 19:54:10.000000000 -0600
-@@ -67,6 +67,7 @@ typedef enum conn_login_status_e {
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/initiator.h	2011-08-14 16:48:25.000000000 -0500
+@@ -39,25 +39,18 @@
+ #define INITIATOR_NAME_FILE	ISCSI_CONFIG_ROOT"initiatorname.iscsi"
+ 
+ #define PID_FILE		"/var/run/iscsid.pid"
++#ifndef LOCK_DIR
+ #define LOCK_DIR		"/var/lock/iscsi"
+-#define LOCK_FILE		"/var/lock/iscsi/lock"
+-#define LOCK_WRITE_FILE		"/var/lock/iscsi/lock.write"
+-
+-typedef enum iscsi_conn_state_e {
+-	STATE_FREE,
+-	STATE_XPT_WAIT,
+-	STATE_IN_LOGIN,
+-	STATE_LOGGED_IN,
+-	STATE_IN_LOGOUT,
+-	STATE_LOGOUT_REQUESTED,
+-	STATE_CLEANUP_WAIT,
+-} iscsi_conn_state_e;
++#endif
++#define LOCK_FILE		LOCK_DIR"/lock"
++#define LOCK_WRITE_FILE		LOCK_DIR"/lock.write"
+ 
+ typedef enum iscsi_session_r_stage_e {
+ 	R_STAGE_NO_CHANGE,
+ 	R_STAGE_SESSION_CLEANUP,
+ 	R_STAGE_SESSION_REOPEN,
+ 	R_STAGE_SESSION_REDIRECT,
++	R_STAGE_SESSION_DESTOYED,
+ } iscsi_session_r_stage_e;
+ 
+ typedef enum conn_login_status_e {
+@@ -67,6 +60,7 @@ typedef enum conn_login_status_e {
  	CONN_LOGIN_RETRY		= 3,
  	CONN_LOGIN_IMM_RETRY		= 4,
  	CONN_LOGIN_IMM_REDIRECT_RETRY	= 5,
@@ -5354,7 +9848,15 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.h open-iscsi-2.0-872-rc4-
  } conn_login_status_e;
  
  enum iscsi_login_status {
-@@ -112,14 +113,14 @@ typedef struct iscsi_login_context {
+@@ -88,6 +82,7 @@ typedef enum iscsi_event_e {
+ 	EV_CONN_ERROR,
+ 	EV_CONN_LOGOUT_TIMER,
+ 	EV_CONN_STOP,
++	EV_CONN_LOGIN,
+ } iscsi_event_e;
+ 
+ struct queue_task;
+@@ -112,18 +107,18 @@ typedef struct iscsi_login_context {
  
  struct iscsi_session;
  struct iscsi_conn;
@@ -5371,7 +9873,12 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.h open-iscsi-2.0-872-rc4-
  	struct queue_task *logout_qtask;
  	char data[ISCSI_DEF_MAX_RECV_SEG_LEN];
  	char host[NI_MAXHOST];	/* scratch */
-@@ -131,7 +132,7 @@ typedef struct iscsi_conn {
+-	iscsi_conn_state_e state;
++	enum iscsi_conn_state state;
+ 	int userspace_nop;
+ 
+ 	struct timeval initial_connect_time;
+@@ -131,7 +126,7 @@ typedef struct iscsi_conn {
  	actor_t nop_out_timer;
  
  #define CONTEXT_POOL_MAX 32
@@ -5380,7 +9887,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.h open-iscsi-2.0-872-rc4-
  
  	/* login state machine */
  	int current_stage;
-@@ -140,6 +141,11 @@ typedef struct iscsi_conn {
+@@ -140,6 +135,11 @@ typedef struct iscsi_conn {
  	conn_login_status_e status;
  
  	/* tcp/socket settings */
@@ -5392,7 +9899,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.h open-iscsi-2.0-872-rc4-
  	int socket_fd;
  	/* address being used for normal session connection */
  	struct sockaddr_storage saddr;
-@@ -173,7 +179,7 @@ typedef struct iscsi_conn {
+@@ -173,7 +173,7 @@ typedef struct iscsi_conn {
  	uint32_t max_xmit_dlength;	/* the value declared by the target */
  } iscsi_conn_t;
  
@@ -5401,7 +9908,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.h open-iscsi-2.0-872-rc4-
  	struct actor actor;
  	struct iscsi_conn *conn;
  	int allocated;
-@@ -201,6 +207,7 @@ typedef struct iscsi_session {
+@@ -201,6 +201,7 @@ typedef struct iscsi_session {
  	uint32_t hostno;
  	char netdev[IFNAMSIZ];
  	struct iscsi_transport *t;
@@ -5409,7 +9916,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.h open-iscsi-2.0-872-rc4-
  	node_rec_t nrec; /* copy of original Node record in database */
  	unsigned int irrelevant_keys_bitmap;
  	int send_async_text;
-@@ -242,7 +249,6 @@ typedef struct iscsi_session {
+@@ -242,7 +243,6 @@ typedef struct iscsi_session {
  	uint8_t password_in[AUTH_STR_MAX_LEN];
  	int password_in_length;
  	iscsi_conn_t conn[ISCSI_CONN_MAX];
@@ -5417,7 +9924,21 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.h open-iscsi-2.0-872-rc4-
  	uint64_t param_mask;
  
  	/* connection reopens during recovery */
-@@ -330,20 +336,25 @@ extern int iscsi_io_recv_pdu(iscsi_conn_
+@@ -256,8 +256,11 @@ typedef struct iscsi_session {
+ 	int lu_reset_timeout;
+ 	int abort_timeout;
+ 
+-	/* sync up fields */
+-	queue_task_t *sync_qtask;
++	/*
++	 * used for hw and sync up to notify caller that the operation
++	 * is complete
++	 */
++	queue_task_t *notify_qtask;
+ } iscsi_session_t;
+ 
+ /* login.c */
+@@ -330,20 +333,25 @@ extern int iscsi_io_recv_pdu(iscsi_conn_
  /* initiator.c */
  extern int session_login_task(node_rec_t *rec, queue_task_t *qtask);
  extern int session_logout_task(int sid, queue_task_t *qtask);
@@ -5455,10 +9976,237 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.h open-iscsi-2.0-872-rc4-
 +extern int iscsi_setup_portal(struct iscsi_conn *conn, char *address, int port);
  
  #endif /* INITIATOR_H */
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/io.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/io.c
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/io.c open-iscsi-2.0-872-rc4-bnx2i.sync/usr/io.c
 --- open-iscsi-2.0-872-rc4-bnx2i/usr/io.c	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/io.c	2011-02-24 19:54:10.000000000 -0600
-@@ -401,7 +401,6 @@ iscsi_io_connect(iscsi_conn_t *conn)
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/io.c	2011-08-14 16:48:25.000000000 -0500
+@@ -26,11 +26,14 @@
+ #include <fcntl.h>
+ #include <sys/poll.h>
+ #include <sys/ioctl.h>
++#include <sys/types.h>
++#include <ifaddrs.h>
+ #include <netinet/tcp.h>
+ #include <arpa/inet.h>
+ 
+ #include "types.h"
+ #include "iscsi_proto.h"
++#include "iscsi_settings.h"
+ #include "initiator.h"
+ #include "iscsi_ipc.h"
+ #include "log.h"
+@@ -38,6 +41,7 @@
+ #include "idbm.h"
+ #include "iface.h"
+ #include "sysdeps.h"
++#include "dcb_app.h"
+ 
+ #define LOG_CONN_CLOSED(conn) \
+ do { \
+@@ -53,6 +57,13 @@ do { \
+ 	log_error("Connection to Discovery Address %s failed", conn->host); \
+ } while (0)
+ 
++union sockaddr_u {
++	struct sockaddr_storage	ss;
++	struct sockaddr sa;
++	struct sockaddr_in si;
++	struct sockaddr_in6 si6;
++};
++
+ static int timedout;
+ 
+ static void
+@@ -76,6 +87,93 @@ set_non_blocking(int fd)
+ 
+ }
+ 
++static int select_priority(struct iscsi_conn *conn, int pri_mask)
++{
++	int msk;
++
++	if (!pri_mask)
++		return 0;
++
++	/*
++	 * TODO: Configure priority selection from the mask
++	 * For now, just always take the highest
++	 */
++
++	/* Find highest bit set */
++	while ((msk = pri_mask & (pri_mask - 1)))
++		pri_mask = msk;
++
++	return ffs(pri_mask) - 1;
++}
++
++static int
++inet_cmp_addr(const union sockaddr_u *s1, const union sockaddr_u *s2)
++{
++	const struct sockaddr_in *si1 = &s1->si;
++	const struct sockaddr_in *si2 = &s2->si;
++
++	return si1->sin_addr.s_addr != si2->sin_addr.s_addr;
++}
++
++static int
++inet6_cmp_addr(const union sockaddr_u *s1, const union sockaddr_u *s2)
++{
++	const struct sockaddr_in6 *si1 = &s1->si6;
++	const struct sockaddr_in6 *si2 = &s2->si6;
++
++	return memcmp(&si1->sin6_addr, &si2->sin6_addr, sizeof(si1->sin6_addr));
++}
++
++static char *
++find_ifname(const struct ifaddrs *ifa, const union sockaddr_u *ss)
++{
++	for (; ifa; ifa = ifa->ifa_next) {
++		if (!ifa->ifa_addr)
++			continue;
++
++		if (ss->ss.ss_family != ifa->ifa_addr->sa_family)
++			continue;
++		switch (ss->ss.ss_family) {
++		case AF_INET:
++			if (inet_cmp_addr(ss, (union sockaddr_u *)ifa->ifa_addr) == 0)
++				return ifa->ifa_name;
++			break;
++		case AF_INET6:
++			if (inet6_cmp_addr(ss, (union sockaddr_u *)ifa->ifa_addr) == 0)
++				return ifa->ifa_name;
++			break;
++		}
++	}
++
++	return NULL;
++}
++
++static void set_dcb_priority(struct iscsi_conn *conn, const char *devname)
++{
++	int pri_mask = 0;
++
++	pri_mask = get_dcb_app_pri_by_stream_port(devname, ISCSI_DEFAULT_PORT);
++	if (pri_mask < 0)
++		log_debug(2, "Getting priority for %s returned %d",
++				devname, pri_mask);
++	else if (pri_mask == 0)
++		log_debug(2, "No priority for %s", devname);
++	else {
++		int pri = select_priority(conn, pri_mask);
++		int rc;
++
++		log_debug(1, "Setting socket %d priority to %d",
++				conn->socket_fd, pri);
++		rc = setsockopt(conn->socket_fd, SOL_SOCKET,
++				SO_PRIORITY, &pri, sizeof(pri));
++		if (rc < 0) {
++			log_warning("Setting socket %d priority to %d failed "
++					"with errno %d", conn->socket_fd,
++					pri, errno);
++		}
++	}
++}
++
+ #if 0
+ /* not used by anyone */
+ static int get_hwaddress_from_netdev(char *netdev, char *hwaddress)
+@@ -201,15 +299,20 @@ static int bind_conn_to_iface(iscsi_conn
+ {
+ 	struct iscsi_session *session = conn->session;
+ 
++	if (strcmp(iface->transport_name, DEFAULT_TRANSPORT))
++		return 0;
++
+ 	memset(session->netdev, 0, IFNAMSIZ);
+-	if (iface_is_bound_by_hwaddr(iface) &&
+-	    net_get_netdev_from_hwaddress(iface->hwaddress, session->netdev)) {
+-		log_error("Cannot match %s to net/scsi interface.",
+-			  iface->hwaddress);
+-                return -1;
+-	} else if (iface_is_bound_by_netdev(iface))
++	if (iface_is_bound_by_hwaddr(iface)) {
++		if (net_get_netdev_from_hwaddress(iface->hwaddress,
++						  session->netdev)) {
++			log_error("Cannot match %s to net/scsi interface.",
++				  iface->hwaddress);
++			return -1;
++		}
++	} else if (iface_is_bound_by_netdev(iface)) {
+ 		strcpy(session->netdev, iface->netdev);
+-	else if (iface_is_bound_by_ipaddr(iface)) {
++	} else if (iface_is_bound_by_ipaddr(iface)) {
+ 		/*
+ 		 * we never supported this but now with offload having to
+ 		 * set the ip address in the iface, useris may forget to
+@@ -260,10 +363,8 @@ iscsi_io_tcp_connect(iscsi_conn_t *conn,
+ 		return -1;
+ 	}
+ 
+-	if (conn->session) {
+-		if (bind_conn_to_iface(conn, &conn->session->nrec.iface))
+-			return -1;
+-	}
++	if (bind_conn_to_iface(conn, &conn->session->nrec.iface))
++		return -1;
+ 
+ 	onearg = 1;
+ 	rc = setsockopt(conn->socket_fd, IPPROTO_TCP, TCP_NODELAY, &onearg,
+@@ -320,6 +421,10 @@ iscsi_io_tcp_connect(iscsi_conn_t *conn,
+ 	log_debug(1, "connecting to %s:%s", conn->host, serv);
+ 	if (non_blocking)
+ 		set_non_blocking(conn->socket_fd);
++
++	if (conn->session->netdev[0])
++		set_dcb_priority(conn, conn->session->netdev);
++
+ 	rc = connect(conn->socket_fd, (struct sockaddr *) ss, sizeof (*ss));
+ 	return rc;
+ }
+@@ -331,7 +436,7 @@ iscsi_io_tcp_poll(iscsi_conn_t *conn, in
+ 	struct pollfd pdesc;
+ 	char serv[NI_MAXSERV], lserv[NI_MAXSERV];
+ 	struct sockaddr_storage ss;
+-	socklen_t len = sizeof(ss);
++	socklen_t len;
+ 
+ 	pdesc.fd = conn->socket_fd;
+ 	pdesc.events = POLLOUT;
+@@ -368,8 +473,9 @@ iscsi_io_tcp_poll(iscsi_conn_t *conn, in
+ 	}
+ 
+ 	len = sizeof(ss);
+-	if (log_level > 0 &&
+-	    getsockname(conn->socket_fd, (struct sockaddr *) &ss, &len) >= 0) {
++	if (log_level > 0 || !conn->session->netdev[0])
++		rc = getsockname(conn->socket_fd, (struct sockaddr *)&ss, &len);
++	if (log_level > 0 && rc >= 0) {
+ 		getnameinfo((struct sockaddr *) &conn->saddr,
+ 			    sizeof(conn->saddr), conn->host,
+ 			    sizeof(conn->host), serv, sizeof(serv),
+@@ -381,6 +487,22 @@ iscsi_io_tcp_poll(iscsi_conn_t *conn, in
+ 		log_debug(1, "connected local port %s to %s:%s",
+ 			  lserv, conn->host, serv);
+ 	}
++
++	if (!conn->session->netdev[0] && rc >= 0) {
++		struct ifaddrs *ifa;
++		char *ifname;
++
++		rc = getifaddrs(&ifa);
++		if (rc < 0)
++			log_error("getifaddrs failed with %d\n", errno);
++		else {
++			ifname = find_ifname(ifa, (union sockaddr_u *)&ss);
++			if (ifname)
++				set_dcb_priority(conn, ifname);
++			freeifaddrs(ifa);
++		}
++	}
++
+ 	return 1;
+ }
+ 
+@@ -401,7 +523,6 @@ iscsi_io_connect(iscsi_conn_t *conn)
  	int rc, ret;
  	struct sigaction action;
  	struct sigaction old;
@@ -5466,7 +10214,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/io.c open-iscsi-2.0-872-rc4-bnx2i.w
  
  	/* set a timeout, since the socket calls may take a long time to
  	 * timeout on their own
-@@ -420,22 +419,21 @@ iscsi_io_connect(iscsi_conn_t *conn)
+@@ -420,22 +541,21 @@ iscsi_io_connect(iscsi_conn_t *conn)
  	 */
  	rc = iscsi_io_tcp_connect(conn, 0);
  	if (timedout) {
@@ -5494,7 +10242,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/io.c open-iscsi-2.0-872-rc4-bnx2i.w
  		socklen_t salen = sizeof(ss);
  
  		if (getsockname(conn->socket_fd, (struct sockaddr *) &ss,
-@@ -503,7 +501,7 @@ iscsi_io_send_pdu(iscsi_conn_t *conn, st
+@@ -503,7 +623,7 @@ iscsi_io_send_pdu(iscsi_conn_t *conn, st
  	/* set a timeout, since the socket calls may take a long time
  	 * to timeout on their own
  	 */
@@ -5503,7 +10251,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/io.c open-iscsi-2.0-872-rc4-bnx2i.w
  		memset(&action, 0, sizeof (struct sigaction));
  		memset(&old, 0, sizeof (struct sigaction));
  		action.sa_sigaction = NULL;
-@@ -566,7 +564,7 @@ iscsi_io_send_pdu(iscsi_conn_t *conn, st
+@@ -566,7 +686,7 @@ iscsi_io_send_pdu(iscsi_conn_t *conn, st
  	else
  		pad_bytes = 0;
  
@@ -5512,7 +10260,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/io.c open-iscsi-2.0-872-rc4-bnx2i.w
  		ipc->send_pdu_begin(session->t->handle, session->id,
  				    conn->id, end - header,
  				    ntoh24(hdr->dlength) + pad_bytes);
-@@ -575,8 +573,8 @@ iscsi_io_send_pdu(iscsi_conn_t *conn, st
+@@ -575,8 +695,8 @@ iscsi_io_send_pdu(iscsi_conn_t *conn, st
  		vec[0].iov_base = header;
  		vec[0].iov_len = end - header;
  
@@ -5523,7 +10271,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/io.c open-iscsi-2.0-872-rc4-bnx2i.w
  		else
  			rc = ipc->writev(0, vec, 1);
  		if (timedout) {
-@@ -603,13 +601,13 @@ iscsi_io_send_pdu(iscsi_conn_t *conn, st
+@@ -603,13 +723,13 @@ iscsi_io_send_pdu(iscsi_conn_t *conn, st
  		vec[1].iov_base = (void *) &pad;
  		vec[1].iov_len = pad_bytes;
  
@@ -5540,7 +10288,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/io.c open-iscsi-2.0-872-rc4-bnx2i.w
  			ret = 0;
  			goto done;
  		} else if ((rc <= 0) && (errno != EAGAIN)) {
-@@ -627,7 +625,7 @@ iscsi_io_send_pdu(iscsi_conn_t *conn, st
+@@ -627,7 +747,7 @@ iscsi_io_send_pdu(iscsi_conn_t *conn, st
  		}
  	}
  
@@ -5549,7 +10297,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/io.c open-iscsi-2.0-872-rc4-bnx2i.w
  		if (ipc->send_pdu_end(session->t->handle, session->id,
  				      conn->id, &rc)) {
  			ret = 0;
-@@ -638,7 +636,7 @@ iscsi_io_send_pdu(iscsi_conn_t *conn, st
+@@ -638,7 +758,7 @@ iscsi_io_send_pdu(iscsi_conn_t *conn, st
  	ret = 1;
  
        done:
@@ -5558,7 +10306,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/io.c open-iscsi-2.0-872-rc4-bnx2i.w
  		alarm(0);
  		sigaction(SIGALRM, &old, NULL);
  		timedout = 0;
-@@ -670,7 +668,7 @@ iscsi_io_recv_pdu(iscsi_conn_t *conn, st
+@@ -670,7 +790,7 @@ iscsi_io_recv_pdu(iscsi_conn_t *conn, st
  	/* set a timeout, since the socket calls may take a long
  	 * time to timeout on their own
  	 */
@@ -5567,7 +10315,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/io.c open-iscsi-2.0-872-rc4-bnx2i.w
  		memset(&action, 0, sizeof (struct sigaction));
  		memset(&old, 0, sizeof (struct sigaction));
  		action.sa_sigaction = NULL;
-@@ -680,7 +678,10 @@ iscsi_io_recv_pdu(iscsi_conn_t *conn, st
+@@ -680,7 +800,10 @@ iscsi_io_recv_pdu(iscsi_conn_t *conn, st
  		timedout = 0;
  		alarm(timeout);
  	} else {
@@ -5579,7 +10327,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/io.c open-iscsi-2.0-872-rc4-bnx2i.w
  			failed = 1;
  			goto done;
  		}
-@@ -688,14 +689,14 @@ iscsi_io_recv_pdu(iscsi_conn_t *conn, st
+@@ -688,14 +811,14 @@ iscsi_io_recv_pdu(iscsi_conn_t *conn, st
  
  	/* read a response header */
  	do {
@@ -5597,7 +10345,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/io.c open-iscsi-2.0-872-rc4-bnx2i.w
  			failed = 1;
  			goto done;
  		} else if (rlen == 0) {
-@@ -714,7 +715,7 @@ iscsi_io_recv_pdu(iscsi_conn_t *conn, st
+@@ -714,7 +837,7 @@ iscsi_io_recv_pdu(iscsi_conn_t *conn, st
  	} while (h_bytes < sizeof (*hdr));
  
  	log_debug(4, "read %d PDU header bytes, opcode 0x%x, dlength %u, "
@@ -5606,7 +10354,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/io.c open-iscsi-2.0-872-rc4-bnx2i.w
  		 ntoh24(hdr->dlength), data, max_data_length);
  
  	/* check for additional headers */
-@@ -745,14 +746,14 @@ iscsi_io_recv_pdu(iscsi_conn_t *conn, st
+@@ -745,14 +868,14 @@ iscsi_io_recv_pdu(iscsi_conn_t *conn, st
  	/* read the rest into our buffer */
  	d_bytes = 0;
  	while (d_bytes < dlength) {
@@ -5624,7 +10372,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/io.c open-iscsi-2.0-872-rc4-bnx2i.w
  			failed = 1;
  			goto done;
  		} else if (rlen == 0) {
-@@ -772,7 +773,7 @@ iscsi_io_recv_pdu(iscsi_conn_t *conn, st
+@@ -772,7 +895,7 @@ iscsi_io_recv_pdu(iscsi_conn_t *conn, st
  	/* handle PDU data padding.
  	 * data is padded in case of kernel_io */
  	pad = dlength % ISCSI_PAD_LEN;
@@ -5633,7 +10381,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/io.c open-iscsi-2.0-872-rc4-bnx2i.w
  		int pad_bytes = pad = ISCSI_PAD_LEN - pad;
  		char bytes[ISCSI_PAD_LEN];
  
-@@ -780,7 +781,7 @@ iscsi_io_recv_pdu(iscsi_conn_t *conn, st
+@@ -780,7 +903,7 @@ iscsi_io_recv_pdu(iscsi_conn_t *conn, st
  			rlen = read(conn->socket_fd, &bytes, pad_bytes);
  			if (timedout) {
  				log_error("socket %d pad read timed out",
@@ -5642,7 +10390,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/io.c open-iscsi-2.0-872-rc4-bnx2i.w
  				failed = 1;
  				goto done;
  			} else if (rlen == 0) {
-@@ -828,7 +829,7 @@ iscsi_io_recv_pdu(iscsi_conn_t *conn, st
+@@ -828,7 +951,7 @@ iscsi_io_recv_pdu(iscsi_conn_t *conn, st
  	}
  
  done:
@@ -5651,7 +10399,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/io.c open-iscsi-2.0-872-rc4-bnx2i.w
  		alarm(0);
  		sigaction(SIGALRM, &old, NULL);
  	} else {
-@@ -840,7 +841,7 @@ done:
+@@ -840,7 +963,7 @@ done:
  
  	if (timedout || failed) {
  		timedout = 0;
@@ -5660,14 +10408,23 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/io.c open-iscsi-2.0-872-rc4-bnx2i.w
  	}
  
  	return h_bytes + ahs_bytes + d_bytes;
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsiadm.c
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-bnx2i.sync/usr/iscsiadm.c
 --- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsiadm.c	2011-02-24 19:54:10.000000000 -0600
-@@ -48,10 +48,11 @@
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/iscsiadm.c	2011-08-14 16:48:25.000000000 -0500
+@@ -4,6 +4,7 @@
+  * Copyright (C) 2004 Dmitry Yusupov, Alex Aizman
+  * Copyright (C) 2006 Mike Christie
+  * Copyright (C) 2006 Red Hat, Inc. All rights reserved.
++ * Copyright (C) 2011 Dell Inc.
+  * maintained by open-iscsi at googlegroups.com
+  *
+  * This program is free software; you can redistribute it and/or modify
+@@ -48,10 +49,12 @@
  #include "session_mgmt.h"
  #include "iscsid_req.h"
  #include "isns-proto.h"
 +#include "iscsi_err.h"
++#include "iscsi_ipc.h"
  
 -struct iscsi_ipc *ipc = NULL; /* dummy */
  static char program_name[] = "iscsiadm";
@@ -5676,8 +10433,33 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  
  enum iscsiadm_mode {
  	MODE_DISCOVERY,
-@@ -119,7 +120,7 @@ iscsiadm -m fw [ -l ]\n\
- iscsiadm -m host [ -P printlevel ] [ -H hostno ]\n\
+@@ -69,7 +72,9 @@ enum iscsiadm_op {
+ 	OP_DELETE		= 0x2,
+ 	OP_UPDATE		= 0x4,
+ 	OP_SHOW			= 0x8,
+-	OP_NONPERSISTENT	= 0x10
++	OP_NONPERSISTENT	= 0x10,
++	OP_APPLY		= 0x20,
++	OP_APPLY_ALL		= 0x40
+ };
+ 
+ static struct option const long_options[] =
+@@ -108,18 +113,18 @@ static void usage(int status)
+ 			program_name);
+ 	else {
+ 		printf("\
+-iscsiadm -m discovery2 [ -hV ] [ -d debug_level ] [-P printlevel] [ -t type -p ip:port -I ifaceN ... [ -Dl ] ] | [ [ -p ip:port -t type] \
++iscsiadm -m discoverydb [ -hV ] [ -d debug_level ] [-P printlevel] [ -t type -p ip:port -I ifaceN ... [ -Dl ] ] | [ [ -p ip:port -t type] \
+ [ -o operation ] [ -n name ] [ -v value ] [ -lD ] ] \n\
+ iscsiadm -m discovery [ -hV ] [ -d debug_level ] [-P printlevel] [ -t type -p ip:port -I ifaceN ... [ -l ] ] | [ [ -p ip:port ] [ -l | -D ] ] \n\
+ iiscsiadm -m node [ -hV ] [ -d debug_level ] [ -P printlevel ] [ -L all,manual,automatic ] [ -U all,manual,automatic ] [ -S ] [ [ -T targetname -p ip:port -I ifaceN ] [ -l | -u | -R | -s] ] \
+ [ [ -o  operation  ] [ -n name ] [ -v value ] ]\n\
+ iscsiadm -m session [ -hV ] [ -d debug_level ] [ -P  printlevel] [ -r sessionid | sysfsdir [ -R | -u | -s ] [ -o operation ] [ -n name ] [ -v value ] ]\n\
+-iscsiadm -m iface [ -hV ] [ -d debug_level ] [ -P printlevel ] [ -I ifacename ] [ [ -o  operation  ] [ -n name ] [ -v value ] ]\n\
++iscsiadm -m iface [ -hV ] [ -d debug_level ] [ -P printlevel ] [ -I ifacename | -H hostno|MAC ] [ [ -o  operation  ] [ -n name ] [ -v value ] ]\n\
+ iscsiadm -m fw [ -l ]\n\
+-iscsiadm -m host [ -P printlevel ] [ -H hostno ]\n\
++iscsiadm -m host [ -P printlevel ] [ -H hostno|MAC ]\n\
  iscsiadm -k priority\n");
  	}
 -	exit(status == 0 ? 0 : -1);
@@ -5685,7 +10467,18 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  }
  
  static int
-@@ -212,7 +213,7 @@ static void kill_iscsid(int priority)
+@@ -137,6 +142,10 @@ str_to_op(char *str)
+ 		op = OP_SHOW;
+ 	else if (!strcmp("nonpersistent", str))
+ 		op = OP_NONPERSISTENT;
++	else if (!strcmp("apply", str))
++		op = OP_APPLY;
++	else if (!strcmp("applyall", str))
++		op = OP_APPLY_ALL;
+ 	else
+ 		op = OP_NOOP;
+ 
+@@ -212,7 +221,7 @@ static void kill_iscsid(int priority)
  	req.command = MGMT_IPC_IMMEDIATE_STOP;
  	rc = iscsid_exec_req(&req, &rsp, 0);
  	if (rc) {
@@ -5694,7 +10487,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  		log_error("Could not stop iscsid. Trying sending iscsid "
  			  "SIGTERM or SIGKILL signals manually\n");
  	}
-@@ -251,12 +252,12 @@ static int print_ifaces(struct iface_rec
+@@ -251,12 +260,12 @@ static int print_ifaces(struct iface_rec
  		break;
  	default:
  		log_error("Invalid info level %d. Try 0 - 1.", info_level);
@@ -5709,9 +10502,44 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  	}
  	return err;
  }
-@@ -296,11 +297,11 @@ for_each_session(struct node_rec *rec, i
+@@ -264,15 +273,10 @@ static int print_ifaces(struct iface_rec
+ static int
+ match_startup_mode(node_rec_t *rec, char *mode)
+ {
+-	/*
+-	 * we always skip onboot because this should be handled by
+-	 * something else
+-	 */
+-	if (rec->startup == ISCSI_STARTUP_ONBOOT)
+-		return -1;
+-
+ 	if ((!strcmp(mode, "automatic") &&
+ 	    rec->startup == ISCSI_STARTUP_AUTOMATIC) ||
++	    (!strcmp(mode, "onboot") &&
++	    rec->startup == ISCSI_STARTUP_ONBOOT) ||
+ 	    (!strcmp(mode, "manual") &&
+ 	    rec->startup == ISCSI_STARTUP_MANUAL) ||
+ 	    !strcmp(mode, "all"))
+@@ -281,6 +285,8 @@ match_startup_mode(node_rec_t *rec, char
+ 	/* support conn or session startup params */
+ 	if ((!strcmp(mode, "automatic") &&
+ 	    rec->conn[0].startup == ISCSI_STARTUP_AUTOMATIC) ||
++	    (!strcmp(mode, "onboot") &&
++	    rec->conn[0].startup == ISCSI_STARTUP_ONBOOT) ||
+ 	    (!strcmp(mode, "manual") &&
+ 	    rec->conn[0].startup == ISCSI_STARTUP_MANUAL) ||
+ 	    !strcmp(mode, "all"))
+@@ -294,13 +300,18 @@ for_each_session(struct node_rec *rec, i
+ {
+ 	int err, num_found = 0;
  
- 	err = iscsi_sysfs_for_each_session(rec, &num_found, fn);
+-	err = iscsi_sysfs_for_each_session(rec, &num_found, fn);
++	if (rec && rec->session.info) {
++		num_found = 1;
++		err = fn(rec, rec->session.info);
++	} else {
++		err = iscsi_sysfs_for_each_session(rec, &num_found, fn);
++	}
  	if (err)
 -		log_error("Could not execute operation on all sessions. Err "
 -			  "%d.", err);
@@ -5725,7 +10553,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  	}
  
  	return err;
-@@ -313,7 +314,7 @@ static int link_recs(void *data, struct 
+@@ -313,7 +324,7 @@ static int link_recs(void *data, struct 
  
  	rec_copy = calloc(1, sizeof(*rec_copy));
  	if (!rec_copy)
@@ -5734,7 +10562,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  	memcpy(rec_copy, rec, sizeof(*rec_copy));
  	INIT_LIST_HEAD(&rec_copy->list);
  	list_add_tail(&rec_copy->list, list);
-@@ -326,7 +327,6 @@ __logout_by_startup(void *data, struct l
+@@ -326,7 +337,6 @@ __logout_by_startup(void *data, struct l
  {
  	char *mode = data;
  	node_rec_t rec;
@@ -5742,7 +10570,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  
  	memset(&rec, 0, sizeof(node_rec_t));
  	if (idbm_rec_read(&rec, info->targetname, info->tpgt,
-@@ -352,28 +352,33 @@ __logout_by_startup(void *data, struct l
+@@ -352,74 +362,188 @@ __logout_by_startup(void *data, struct l
  	if (rec.startup == ISCSI_STARTUP_ONBOOT)
  		return -1;
  
@@ -5775,20 +10603,70 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
 +	if (rc == ISCSI_ERR_NO_OBJS_FOUND)
 +		log_error("No matching sessions found");
 +	return rc; 
++}
++
++struct startup_data {
++	char *mode;
++	struct list_head all_logins;
++	struct list_head leading_logins;
++};
++
++static int link_startup_recs(void *data, struct node_rec *rec)
++{
++	struct startup_data *startup = data;
++	struct node_rec *rec_copy;
++
++	if (match_startup_mode(rec, startup->mode))
++		return -1;
++
++	rec_copy = calloc(1, sizeof(*rec_copy));
++	if (!rec_copy)
++		return ISCSI_ERR_NOMEM;
++	memcpy(rec_copy, rec, sizeof(*rec_copy));
++	INIT_LIST_HEAD(&rec_copy->list);
++
++	if (rec_copy->leading_login)
++		list_add_tail(&rec_copy->list, &startup->leading_logins);
++	else
++		list_add_tail(&rec_copy->list, &startup->all_logins);
++	return 0;
  }
  
- /*
+-/*
 - * TODO: merged this and logout into the common for_each_rec by making
-+ * TODO: merged this and logout into the common for_each_matched_rec by making
-  * the matching more generic
-  */
+- * the matching more generic
+- */
  static int
-@@ -390,36 +395,45 @@ __login_by_startup(void *data, struct li
- 	if (match_startup_mode(rec, mode))
+-__login_by_startup(void *data, struct list_head *list, struct node_rec *rec)
++__do_leading_login(void *data, struct list_head *list, struct node_rec *rec)
+ {
+-	char *mode = data;
+-	/*
+-	 * we always skip onboot because this should be handled by
+-	 * something else
+-	 */
+-	if (rec->startup == ISCSI_STARTUP_ONBOOT)
++	struct iface_rec *pattern_iface = data;
++	int nr_found;
++
++	/* Skip any records that do not match the pattern iface */
++	if (!iface_match(pattern_iface, &rec->iface))
+ 		return -1;
+ 
+-	if (match_startup_mode(rec, mode))
++	/*
++	 * If there is an existing session that matcthes the target,
++	 * the leading login is complete.
++	 */
++	if (iscsi_sysfs_for_each_session(rec, &nr_found, iscsi_match_target)) {
++		log_debug(1, "Skipping %s: Already a session for that target",
++			  rec->name);
  		return -1;
++	}
  
 -	iscsi_login_portal(NULL, list, rec);
 -	return 0;
++	/* No existing session: Attempt a login. */
 +	return iscsi_login_portal(NULL, list, rec);
  }
  
@@ -5796,11 +10674,13 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  login_by_startup(char *mode)
  {
 -	int nr_found = 0, rc, err;
+-	struct list_head rec_list;
 +	int nr_found = 0, err, rc;
- 	struct list_head rec_list;
++	struct startup_data startup;
  
  	if (!mode || !(!strcmp(mode, "automatic") || !strcmp(mode, "all") ||
- 	    !strcmp(mode,"manual"))) {
+-	    !strcmp(mode,"manual"))) {
++		       !strcmp(mode,"manual") || !strcmp(mode, "onboot"))) {
  		log_error("Invalid loginall option %s.", mode);
 -		usage(0);
 -		return EINVAL;
@@ -5808,41 +10688,126 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
 +		return ISCSI_ERR_INVAL;
  	}
  
- 	INIT_LIST_HEAD(&rec_list);
+-	INIT_LIST_HEAD(&rec_list);
 -	rc = idbm_for_each_rec(&nr_found, &rec_list, link_recs);
-+	err = idbm_for_each_rec(&nr_found, &rec_list, link_recs);
-+	if (err && !list_empty(&rec_list))
+-	err = iscsi_login_portals(mode, &nr_found, 1, &rec_list,
+-				  __login_by_startup);
+-	if (err && !rc)
+-		rc = err;
++	/*
++	 * Filter all node records that match the given 'mode' into 2 lists:
++	 * Those with leading_login enabled, and those without.
++	 */
++	startup.mode = mode;
++	INIT_LIST_HEAD(&startup.all_logins);
++	INIT_LIST_HEAD(&startup.leading_logins);
++	err = idbm_for_each_rec(&nr_found, &startup, link_startup_recs);
++	if (err && (!list_empty(&startup.all_logins) ||
++		    !list_empty(&startup.leading_logins)))
 +		/* log msg and try to log into what we found */
 +		log_error("Could not read all records: %s",
 +			  iscsi_err_to_str(err));
-+	else if (err && list_empty(&rec_list)) {
-+		log_error("Could not read node DB: %s.",
-+			  iscsi_err_to_str(err));
++	else if (list_empty(&startup.all_logins) &&
++		 list_empty(&startup.leading_logins)) {
++		if (err) {
++			log_error("Could not read node DB: %s.",
++				  iscsi_err_to_str(err));
++		} else {
++			log_error("No records found");
++			err = ISCSI_ERR_NO_OBJS_FOUND;
++		}
 +		return err;
-+	} else if (list_empty(&rec_list)) {
-+		log_error("No records found");
-+		return ISCSI_ERR_NO_OBJS_FOUND;
 +	}
 +	rc = err;
-+
- 	err = iscsi_login_portals(mode, &nr_found, 1, &rec_list,
- 				  __login_by_startup);
-+	if (err)
-+		log_error("Could not log into all portals");
-+
- 	if (err && !rc)
- 		rc = err;
--
+ 
 -	if (rc)
 -		log_error("Could not log into all portals. Err %d.", rc);
 -	else if (!nr_found) {
 -		log_error("No records found!");
 -		rc = ENODEV;
--	}
++	if (!list_empty(&startup.all_logins)) {
++		log_debug(1, "Logging into normal (non-leading-login) portals");
++		/* Login all regular (non-leading-login) portals first */
++		err = iscsi_login_portals(NULL, &nr_found, 1,
++				&startup.all_logins, iscsi_login_portal);
++		if (err)
++			log_error("Could not log into all portals");
++		if (err && !rc)
++			rc = err;
+ 	}
++
++	if (!list_empty(&startup.leading_logins)) {
++		/*
++		 * For each iface in turn, try to login all portals on that
++		 * iface that do not already have a session present.
++		 */
++		struct iface_rec *pattern_iface, *tmp_iface;
++		struct node_rec *rec, *tmp_rec;
++		struct list_head iface_list;
++		int missed_leading_login = 0;
++		log_debug(1, "Logging into leading-login portals");
++		INIT_LIST_HEAD(&iface_list);
++		iface_link_ifaces(&iface_list);
++		list_for_each_entry_safe(pattern_iface, tmp_iface, &iface_list,
++					 list) {
++			log_debug(1, "Establishing leading-logins via iface %s",
++				  pattern_iface->name);
++			err = iscsi_login_portals_safe(pattern_iface, &nr_found,
++						       1,
++						       &startup.leading_logins,
++						       __do_leading_login);
++			if (err)
++				log_error("Could not log into all portals on "
++					  "%s, trying next interface",
++					  pattern_iface->name);
++
++			/*
++			 * Note: We always try all iface records in case there
++			 * are targets that are associated with only a subset
++			 * of iface records.  __do_leading_login already
++			 * prevents duplicate sessions if an iface has succeded
++			 * for a particular target.
++			 */
++		}
++		/*
++		 * Double-check that all leading-login portals have at least
++		 * one session
++		 */
++		list_for_each_entry_safe(rec, tmp_rec, &startup.leading_logins,
++					 list) {
++			if (!iscsi_sysfs_for_each_session(rec, &nr_found,
++							  iscsi_match_target))
++				missed_leading_login++;
++			/*
++			 * Cleanup the list, since 'iscsi_login_portals_safe'
++			 * does not
++			 */
++			list_del(&rec->list);
++			free(rec);
++		}
++		if (missed_leading_login) {
++			log_error("Could not login all leading-login portals");
++			if (!rc)
++				rc = ISCSI_ERR_FATAL_LOGIN;
++		}
++	}
++
  	return rc;
  }
  
-@@ -454,7 +468,7 @@ static int iscsi_logout_matched_portal(v
+@@ -442,30 +566,22 @@ static int iscsi_logout_matched_portal(v
+ 	if (!iscsi_match_session(pattern_rec, info))
+ 		return -1;
+ 
+-	/* we do not support this yet */
+-	if (t->caps & CAP_FW_DB) {
+-		log_error("Could not logout session of [sid: %d, "
+-			  "target: %s, portal: %s,%d].", info->sid,
+-			  info->targetname, info->persistent_address,
+-			  info->port);
+-		log_error("Logout not supported for driver: %s.", t->name);
+-		return -1;
+-	}
  	return iscsi_logout_portal(info, list);
  }
  
@@ -5851,7 +10816,11 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  {
  	struct rec_op_data *op_data = data;
  
-@@ -465,7 +479,8 @@ static int iface_fn(void *data, node_rec
+ 	if (!__iscsi_match_session(op_data->match_rec, rec->name,
+ 				   rec->conn[0].address, rec->conn[0].port,
+-				   &rec->iface))
++				   &rec->iface, rec->session.sid))
+ 		return -1;
  	return op_data->fn(op_data->data, rec);
  }
  
@@ -5861,7 +10830,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  {
  	struct rec_op_data op_data;
  	int nr_found = 0, rc;
-@@ -475,30 +490,51 @@ static int for_each_rec(struct node_rec 
+@@ -475,30 +591,51 @@ static int for_each_rec(struct node_rec 
  	op_data.match_rec = rec;
  	op_data.fn = fn;
  
@@ -5899,6 +10868,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  
  	INIT_LIST_HEAD(&rec_list);
 -	ret = for_each_rec(pattern_rec, &rec_list, link_recs);
+-	err = iscsi_login_portals(NULL, &nr_found, 1, &rec_list,
 +	err = for_each_matched_rec(pattern_rec, &rec_list, link_recs);
 +	if (err == ISCSI_ERR_NO_OBJS_FOUND)
 +		return err;
@@ -5908,7 +10878,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
 +	rc = err;
 +	/* if there is an err but some recs then try to login to what we have */
 +
- 	err = iscsi_login_portals(NULL, &nr_found, 1, &rec_list,
++	err = iscsi_login_portals(pattern_rec, &nr_found, 1, &rec_list,
  				  iscsi_login_portal);
 -	if (err && !ret)
 -		ret = err;
@@ -5923,7 +10893,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  }
  
  static int print_nodes(int info_level, struct node_rec *rec)
-@@ -509,17 +545,16 @@ static int print_nodes(int info_level, s
+@@ -509,17 +646,16 @@ static int print_nodes(int info_level, s
  	switch (info_level) {
  	case 0:
  	case -1:
@@ -5945,7 +10915,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  	}
  
  	return rc;
-@@ -586,7 +621,7 @@ session_stats(void *data, struct session
+@@ -586,7 +722,7 @@ session_stats(void *data, struct session
  
  	rc = iscsid_exec_req(&req, &rsp, 1);
  	if (rc)
@@ -5954,7 +10924,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  
  	printf("Stats for session [sid: %d, target: %s, portal: "
  		"%s,%d]\n",
-@@ -665,14 +700,14 @@ static int add_static_rec(int *found, ch
+@@ -665,14 +801,14 @@ static int add_static_rec(int *found, ch
  	rec = calloc(1, sizeof(*rec));
  	if (!rec) {
  		log_error("Could not allocate memory for node addition");
@@ -5971,7 +10941,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  		goto free_rec;
  	}
  	drec->type = DISCOVERY_TYPE_STATIC;
-@@ -715,10 +750,10 @@ static int add_static_portal(int *found,
+@@ -715,10 +851,10 @@ static int add_static_portal(int *found,
  
  	if (strlen(rec->conn[0].address) &&
  	    strcmp(rec->conn[0].address, ip))
@@ -5984,7 +10954,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  
  	return add_static_rec(found, targetname, tpgt, ip, port,
  			      &rec->iface);
-@@ -733,7 +768,7 @@ static int add_static_node(int *found, v
+@@ -733,7 +869,7 @@ static int add_static_node(int *found, v
  		goto search;
  
  	if (strcmp(rec->name, targetname))
@@ -5993,7 +10963,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  
  	if (!strlen(rec->conn[0].address))
  		goto search;
-@@ -751,11 +786,8 @@ static int add_static_recs(struct node_r
+@@ -751,11 +887,8 @@ static int add_static_recs(struct node_r
  	int rc, nr_found = 0;
  
  	rc = idbm_for_each_node(&nr_found, rec, add_static_node);
@@ -6007,7 +10977,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  	/* success */
  	if (nr_found > 0)
  		return 0;
-@@ -765,13 +797,12 @@ static int add_static_recs(struct node_r
+@@ -765,13 +898,12 @@ static int add_static_recs(struct node_r
  		rc = add_static_rec(&nr_found, rec->name, rec->tpgt,
  				    rec->conn[0].address, rec->conn[0].port,
  				    &rec->iface);
@@ -6025,7 +10995,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  }
  
  /*
-@@ -799,7 +830,7 @@ static int delete_node(void *data, struc
+@@ -799,7 +931,7 @@ static int delete_node(void *data, struc
  			  "using it. Logout session then rerun command to "
  			  "remove record.", rec->iface.name, rec->name,
  			  rec->conn[0].address, rec->conn[0].port);
@@ -6034,7 +11004,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  	}
  
  	return idbm_delete_node(rec);
-@@ -822,18 +853,17 @@ static int delete_stale_rec(void *data, 
+@@ -822,18 +954,18 @@ static int delete_stale_rec(void *data, 
  			 * if we are not from the same discovery source
  			 * ignore it
  			 */
@@ -6045,8 +11015,10 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  					  new_rec->name,
  					  new_rec->conn[0].address,
  					  new_rec->conn[0].port,
- 					  &new_rec->iface))
+-					  &new_rec->iface))
 -			return 0;
++					  &new_rec->iface,
++					  new_rec->session.sid))
 +			return -1;
  	}
  	/* if there is a error we can continue on */
@@ -6056,7 +11028,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  }
  
  static int
-@@ -918,8 +948,12 @@ do_software_sendtargets(discovery_rec_t 
+@@ -918,8 +1050,12 @@ do_software_sendtargets(discovery_rec_t 
  	rc = idbm_bind_ifaces_to_nodes(discovery_sendtargets, drec, ifaces,
  				       &rec_list);
  	if (rc) {
@@ -6070,7 +11042,15 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  	}
  
  	rc = exec_disc_op_on_recs(drec, &rec_list, info_level, do_login, op);
-@@ -986,7 +1020,7 @@ do_sendtargets(discovery_rec_t *drec, st
+@@ -957,7 +1093,6 @@ do_sendtargets(discovery_rec_t *drec, st
+ 			free(iface);
+ 			continue;
+ 		}
+-
+ 		host_no = iscsi_sysfs_get_host_no_from_hwinfo(iface, &rc);
+ 		if (rc || host_no == -1) {
+ 			log_debug(1, "Could not match iface" iface_fmt " to "
+@@ -986,7 +1121,7 @@ do_sendtargets(discovery_rec_t *drec, st
  	}
  
  	if (list_empty(ifaces))
@@ -6079,7 +11059,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  
  sw_st:
  	return do_software_sendtargets(drec, ifaces, info_level, do_login,
-@@ -1013,8 +1047,12 @@ static int do_isns(discovery_rec_t *drec
+@@ -1013,8 +1148,12 @@ static int do_isns(discovery_rec_t *drec
  	rc = idbm_bind_ifaces_to_nodes(discovery_isns, drec, ifaces,
  				       &rec_list);
  	if (rc) {
@@ -6093,7 +11073,106 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  	}
  
  	rc = exec_disc_op_on_recs(drec, &rec_list, info_level, do_login, op);
-@@ -1071,7 +1109,7 @@ static int exec_iface_op(int op, int do_
+@@ -1053,10 +1192,97 @@ static void catch_sigint( int signo ) {
+ 	exit(1);
+ }
+ 
++static int iface_apply_net_config(struct iface_rec *iface, int op)
++{
++	int rc = ISCSI_ERR;
++	uint32_t host_no;
++	int param_count;
++	int param_used;
++	int iface_all = 0;
++	int i;
++	struct iovec *iovs = NULL;
++	struct iovec *iov = NULL;
++	struct iscsi_transport *t = NULL;
++	int fd;
++
++	log_debug(8, "Calling iscsid, to apply net config for"
++		  "iface.name = %s\n", iface->name);
++
++	if (op == OP_APPLY_ALL)
++		iface_all = 1;
++
++	param_count = iface_get_param_count(iface, iface_all);
++	if (!param_count) {
++		log_error("Nothing to configure.");
++		return ISCSI_SUCCESS;
++	}
++
++	/*
++	 * TODO: create a nicer interface where the caller does not have
++	 * know the packet/hdr details
++	 */
++
++	/* +2 for event and nlmsghdr */
++	param_count += 2;
++	iovs = calloc((param_count * sizeof(struct iovec)),
++		       sizeof(char));
++	if (!iovs) {
++		log_error("Out of Memory.");
++		return ISCSI_ERR_NOMEM;
++	}
++
++	/* param_used gives actual number of iovecs used for netconfig */
++	param_used = iface_build_net_config(iface, iface_all, iovs);
++	if (!param_used) {
++		log_error("Build netconfig failed.");
++		goto free_buf;
++	}
++
++	t = iscsi_sysfs_get_transport_by_name(iface->transport_name);
++	if (!t) {
++		log_error("Can't find transport.");
++		goto free_buf;
++	}
++
++	host_no = iscsi_sysfs_get_host_no_from_hwinfo(iface, &rc);
++	if (host_no == -1) {
++		log_error("Can't find host_no.");
++		goto free_buf;
++	}
++	rc = ISCSI_ERR;
++
++	fd = ipc->ctldev_open();
++	if (fd < 0) {
++		log_error("Netlink open failed.");
++		goto free_buf;
++	}
++
++	rc = ipc->set_net_config(t->handle, host_no, iovs, param_count);
++	if (rc < 0)
++		log_error("Set net_config failed. errno=%d", errno);
++
++	ipc->ctldev_close();
++
++free_buf:
++	/* start at 2, because 0 is for nlmsghdr and 1 for event */
++	iov = iovs + 2;
++	for (i = 0; i < param_used; i++, iov++) {
++		if (iov->iov_base)
++			free(iov->iov_base);
++	}
++
++	free(iovs);
++	if (rc)
++		return ISCSI_ERR;
++	return ISCSI_SUCCESS;
++}
++
+ /* TODO: merge iter helpers and clean them up, so we can use them here */
+ static int exec_iface_op(int op, int do_show, int info_level,
+-			 struct iface_rec *iface, char *name, char *value)
++			 struct iface_rec *iface, uint32_t host_no,
++			 char *name, char *value)
+ {
++	struct host_info hinfo;
+ 	struct db_set_param set_param;
+ 	struct node_rec *rec = NULL;
+ 	int rc = 0;
+@@ -1071,7 +1297,7 @@ static int exec_iface_op(int op, int do_
  
  		rec = idbm_create_rec(NULL, -1, NULL, -1, iface, 0);
  		if (rec && iscsi_check_for_running_session(rec)) {
@@ -6102,7 +11181,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  			goto new_fail;
  		}
  
-@@ -1088,19 +1126,19 @@ new_fail:
+@@ -1088,19 +1314,19 @@ new_fail:
  		if (!iface) {
  			log_error("Could not delete interface. No interface "
  				  "passed in.");
@@ -6127,7 +11206,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  
  		rc = iface_conf_delete(iface);
  		if (rc)
-@@ -1109,20 +1147,19 @@ new_fail:
+@@ -1109,20 +1335,19 @@ new_fail:
  		printf("%s unbound and deleted.\n", iface->name);
  		break;
  delete_fail:
@@ -6152,7 +11231,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  			goto update_fail;
  		}
  
-@@ -1136,7 +1173,7 @@ delete_fail:
+@@ -1136,7 +1361,7 @@ delete_fail:
  			log_error("Can not update "
  				  "iface.iscsi_ifacename. Delete it, "
  				  "and then create a new one.");
@@ -6161,7 +11240,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  			break;
  		}
  
-@@ -1146,7 +1183,7 @@ delete_fail:
+@@ -1146,7 +1371,7 @@ delete_fail:
  				  "from hwaddress to net_ifacename. ");
  			log_error("You must delete the interface and "
  				  "create a new one");
@@ -6170,7 +11249,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  			break;
  		}
  
-@@ -1156,7 +1193,7 @@ delete_fail:
+@@ -1156,7 +1381,7 @@ delete_fail:
  				  "from net_ifacename to hwaddress. ");
  			log_error("You must delete the interface and "
  				  "create a new one");
@@ -6179,7 +11258,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  			break;
  		}
  		set_param.name = name;
-@@ -1167,23 +1204,25 @@ delete_fail:
+@@ -1167,23 +1392,74 @@ delete_fail:
  		if (rc)
  			goto update_fail;
  
@@ -6201,6 +11280,55 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
 -			  iface->name);
 +		log_error("Could not update iface %s: %s",
 +			  iface->name, iscsi_err_to_str(rc));
++		break;
++	case OP_APPLY:
++		if (!iface) {
++			log_error("Apply requires iface.");
++			rc = ISCSI_ERR_INVAL;
++			break;
++		}
++		rc = iface_conf_read(iface);
++		if (rc) {
++			log_error("Could not read iface %s (%d).",
++				  iface->name, rc);
++			break;
++		}
++
++		rc = iface_apply_net_config(iface, op);
++		if (rc) {
++			log_error("Could not apply net configuration: %s",
++				  iscsi_err_to_str(rc));
++			break;
++		}
++		printf("%s applied.\n", iface->name);
++		break;
++	case OP_APPLY_ALL:
++		if (host_no == -1) {
++			log_error("Applyall requires a host number or MAC "
++				  "passed in with the --host argument.");
++			rc = ISCSI_ERR_INVAL;
++			break;
++		}
++
++		/*
++		 * Need to get other iface info like transport.
++		 */
++		memset(&hinfo, 0, sizeof(struct host_info));
++		hinfo.host_no = host_no;
++		if (iscsi_sysfs_get_hostinfo_by_host_no(&hinfo)) {
++			log_error("Could not match host%u to ifaces.", host_no);
++			rc = ISCSI_ERR_INVAL;
++			break;
++		}
++		rc = iface_apply_net_config(&hinfo.iface, op);
++		if (rc) {
++			log_error("Could not apply net configuration: %s",
++				  iscsi_err_to_str(rc));
++			break;
++		}
++
++		printf("Applied settings to ifaces attached to host%u.\n",
++		       host_no);
  		break;
  	default:
  		if (!iface || (iface && info_level > 0)) {
@@ -6212,8 +11340,16 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  		} else {
  			rc = iface_conf_read(iface);
  			if (!rc)
-@@ -1214,33 +1253,29 @@ static int exec_node_op(int op, int do_l
- 			  rec->name, rec->conn[0].address, rec->conn[0].port);
+@@ -1209,38 +1485,35 @@ static int exec_node_op(int op, int do_l
+ 	struct db_set_param set_param;
+ 
+ 	if (rec)
+-		log_debug(2, "%s: %s:%s node [%s,%s,%d]", __FUNCTION__,
++		log_debug(2, "%s: %s:%s node [%s,%s,%d] sid %u", __FUNCTION__,
+ 			  rec->iface.transport_name, rec->iface.name,
+-			  rec->name, rec->conn[0].address, rec->conn[0].port);
++			  rec->name, rec->conn[0].address, rec->conn[0].port,
++			  rec->session.sid);
  
  	if (op == OP_NEW) {
 -		if (add_static_recs(rec))
@@ -6253,7 +11389,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  		goto out;
  	}
  
-@@ -1252,30 +1287,29 @@ static int exec_node_op(int op, int do_l
+@@ -1252,30 +1525,29 @@ static int exec_node_op(int op, int do_l
  	}
  
  	if (do_login) {
@@ -6291,7 +11427,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  			goto out;
  		}
  
-@@ -1284,7 +1318,7 @@ static int exec_node_op(int op, int do_l
+@@ -1284,7 +1556,7 @@ static int exec_node_op(int op, int do_l
  		     strcmp(name, "iface.transport_name")) {
  			log_error("Cannot modify %s. Use iface mode to update "
  				  "this value.", name);
@@ -6300,7 +11436,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  			goto out;
  		}
  
-@@ -1304,7 +1338,7 @@ static int exec_node_op(int op, int do_l
+@@ -1304,7 +1576,7 @@ static int exec_node_op(int op, int do_l
  					    "transport name while a session "
  					    "is using it. Log out the session "
  					    "then update record.");
@@ -6309,7 +11445,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  				goto out;
  			}
  		}
-@@ -1312,16 +1346,14 @@ static int exec_node_op(int op, int do_l
+@@ -1312,16 +1584,14 @@ static int exec_node_op(int op, int do_l
  		set_param.name = name;
  		set_param.value = value;
  
@@ -6329,7 +11465,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  		goto out;
  	}
  out:
-@@ -1443,7 +1475,7 @@ static int exec_fw_op(discovery_rec_t *d
+@@ -1443,7 +1713,7 @@ static int exec_fw_op(discovery_rec_t *d
  			if (!rec) {
  				log_error("Could not convert firmware info to "
  					  "node record.\n");
@@ -6338,7 +11474,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  				break;
  			}
  
-@@ -1493,9 +1525,9 @@ static void setup_drec_defaults(int type
+@@ -1493,9 +1763,9 @@ static void setup_drec_defaults(int type
   * and will read and add a drec, and perform discovery if needed.
   *
   * returns:
@@ -6350,7 +11486,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
   */
  static int exec_discover(int disc_type, char *ip, int port,
  			 struct list_head *ifaces, int info_level,
-@@ -1506,15 +1538,16 @@ static int exec_discover(int disc_type, 
+@@ -1506,15 +1776,16 @@ static int exec_discover(int disc_type, 
  
  	if (ip == NULL) {
  		log_error("Please specify portal as <ipaddr>[:<ipport>]");
@@ -6370,7 +11506,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  		} else {
  			printf("New discovery record for [%s,%d] added.\n", ip,
  			       port);
-@@ -1527,7 +1560,7 @@ static int exec_discover(int disc_type, 
+@@ -1527,7 +1798,7 @@ static int exec_discover(int disc_type, 
  		if (!do_discover) {
  			log_error("Discovery record [%s,%d] not found.",
  				  ip, port);
@@ -6379,7 +11515,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  		}
  
  		/* Just add default rec for user */
-@@ -1539,11 +1572,11 @@ static int exec_discover(int disc_type, 
+@@ -1539,11 +1810,11 @@ static int exec_discover(int disc_type, 
  			if (rc) {
  				log_error("Could not add new discovery "
  					  "record.");
@@ -6393,7 +11529,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  
  	rc = 0;
  	switch (disc_type) {
-@@ -1563,9 +1596,7 @@ static int exec_discover(int disc_type, 
+@@ -1563,9 +1834,7 @@ static int exec_discover(int disc_type, 
  		break;
  	}
  
@@ -6404,7 +11540,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  }
  
  static int exec_disc2_op(int disc_type, char *ip, int port,
-@@ -1587,12 +1618,12 @@ static int exec_disc2_op(int disc_type, 
+@@ -1587,12 +1856,12 @@ static int exec_disc2_op(int disc_type, 
  
  		rc = exec_discover(disc_type, ip, port, ifaces, info_level,
  				   do_login, do_discover, op, &drec);
@@ -6419,7 +11555,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  		goto done;
  	case DISCOVERY_TYPE_ISNS:
  		if (port < 0)
-@@ -1600,29 +1631,30 @@ static int exec_disc2_op(int disc_type, 
+@@ -1600,29 +1869,30 @@ static int exec_disc2_op(int disc_type, 
  
  		rc = exec_discover(disc_type, ip, port, ifaces, info_level,
  				   do_login, do_discover, op, &drec);
@@ -6455,7 +11591,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  			} else
  				log_error("Invalid operation. Operation not "
  					  "supported.");
-@@ -1640,29 +1672,27 @@ do_db_op:
+@@ -1640,29 +1910,27 @@ do_db_op:
  
  	if (op == OP_NOOP || op == OP_SHOW) {
  		if (!idbm_print_discovery_info(&drec, do_show)) {
@@ -6492,7 +11628,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  		goto done;
  	}
  done:
-@@ -1689,7 +1719,7 @@ static int exec_disc_op(int disc_type, c
+@@ -1689,7 +1957,7 @@ static int exec_disc_op(int disc_type, c
  		if (ip == NULL) {
  			log_error("Please specify portal as "
  				  "<ipaddr>[:<ipport>]");
@@ -6501,7 +11637,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  			goto done;
  		}
  
-@@ -1697,21 +1727,20 @@ static int exec_disc_op(int disc_type, c
+@@ -1697,21 +1965,20 @@ static int exec_disc_op(int disc_type, c
  		strlcpy(drec.address, ip, sizeof(drec.address));
  		drec.port = port;
  
@@ -6528,7 +11664,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  			goto done;
  		}
  
-@@ -1721,15 +1750,13 @@ static int exec_disc_op(int disc_type, c
+@@ -1721,15 +1988,13 @@ static int exec_disc_op(int disc_type, c
  		else
  			drec.port = port;
  
@@ -6547,7 +11683,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  		break;
  	default:
  		if (ip) {
-@@ -1749,42 +1776,41 @@ static int exec_disc_op(int disc_type, c
+@@ -1749,42 +2014,41 @@ static int exec_disc_op(int disc_type, c
  						ip, port)) {
  				log_error("Discovery record [%s,%d] "
  					  "not found!", ip, port);
@@ -6601,7 +11737,38 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  			goto done;
  		}
  		/* fall through */
-@@ -1837,7 +1863,7 @@ main(int argc, char **argv)
+@@ -1794,6 +2058,30 @@ done:
+ 	return rc;
+ }
+ 
++static uint32_t parse_host_info(char *optarg, int *rc)
++{
++	int err = 0;
++	uint32_t host_no = -1;
++
++	*rc = 0;
++	if (strstr(optarg, ":")) {
++		host_no = iscsi_sysfs_get_host_no_from_hwaddress(optarg,
++								 &err);
++		if (err) {
++			log_error("Could not match MAC to host.");
++			*rc = ISCSI_ERR_INVAL;
++		}
++	} else {
++		host_no = strtoul(optarg, NULL, 10);
++		if (errno) {
++			log_error("Invalid host no %s. %s.",
++				  optarg, strerror(errno));
++			*rc = ISCSI_ERR_INVAL;
++		}
++	}
++	return host_no;
++}
++
+ int
+ main(int argc, char **argv)
+ {
+@@ -1837,7 +2125,7 @@ main(int argc, char **argv)
  				log_error("Invalid killiscsid priority %d "
  					  "Priority must be greater than or "
  					  "equal to zero.", killiscsid);
@@ -6610,7 +11777,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  				goto free_ifaces;
  			}
  			break;
-@@ -1849,7 +1875,7 @@ main(int argc, char **argv)
+@@ -1849,7 +2137,7 @@ main(int argc, char **argv)
  			if (op == OP_NOOP) {
  				log_error("can not recognize operation: '%s'",
  					optarg);
@@ -6619,16 +11786,23 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  				goto free_ifaces;
  			}
  			break;
-@@ -1865,7 +1891,7 @@ main(int argc, char **argv)
- 			if (errno) {
- 				log_error("invalid host no %s. %s.",
- 					  optarg, strerror(errno));
+@@ -1860,21 +2148,16 @@ main(int argc, char **argv)
+ 			value = optarg;
+ 			break;
+ 		case 'H':
+-			errno = 0;
+-			host_no = strtoul(optarg, NULL, 10);
+-			if (errno) {
+-				log_error("invalid host no %s. %s.",
+-					  optarg, strerror(errno));
 -				rc = -1;
-+				rc = ISCSI_ERR_INVAL;
++			host_no = parse_host_info(optarg, &rc);
++			if (rc)
  				goto free_ifaces;
- 			}
+-			}
  			break;
-@@ -1874,7 +1900,7 @@ main(int argc, char **argv)
+ 		case 'r':
+ 			sid = iscsi_sysfs_get_sid_from_path(optarg);
  			if (sid < 0) {
  				log_error("invalid sid '%s'",
  					  optarg);
@@ -6637,7 +11811,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  				goto free_ifaces;
  			}
  			break;
-@@ -1921,15 +1947,14 @@ main(int argc, char **argv)
+@@ -1921,15 +2204,14 @@ main(int argc, char **argv)
  			break;
  		case 'I':
  			iface = iface_alloc(optarg, &rc);
@@ -6655,7 +11829,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  				goto free_ifaces;
  			}
  
-@@ -1947,7 +1972,7 @@ main(int argc, char **argv)
+@@ -1947,7 +2229,7 @@ main(int argc, char **argv)
  
  	if (optopt) {
  		log_error("unrecognized character '%c'", optopt);
@@ -6664,7 +11838,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  		goto free_ifaces;
  	}
  
-@@ -1957,13 +1982,13 @@ main(int argc, char **argv)
+@@ -1957,13 +2239,13 @@ main(int argc, char **argv)
  	}
  
  	if (mode < 0)
@@ -6680,7 +11854,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  			goto free_ifaces;
  		}
  
-@@ -1974,7 +1999,7 @@ main(int argc, char **argv)
+@@ -1974,7 +2256,7 @@ main(int argc, char **argv)
  	increase_max_files();
  	if (idbm_init(get_config_file)) {
  		log_warning("exiting due to idbm configuration error");
@@ -6689,7 +11863,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  		goto free_ifaces;
  	}
  
-@@ -1983,7 +2008,7 @@ main(int argc, char **argv)
+@@ -1983,7 +2265,7 @@ main(int argc, char **argv)
  		if ((rc = verify_mode_params(argc, argv, "HdmP", 0))) {
  			log_error("host mode: option '-%c' is not "
  				  "allowed/supported", rc);
@@ -6698,8 +11872,12 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  			goto out;
  		}
  
-@@ -1995,7 +2020,7 @@ main(int argc, char **argv)
- 		if ((rc = verify_mode_params(argc, argv, "IdnvmPo", 0))) {
+@@ -1992,10 +2274,10 @@ main(int argc, char **argv)
+ 	case MODE_IFACE:
+ 		iface_setup_host_bindings();
+ 
+-		if ((rc = verify_mode_params(argc, argv, "IdnvmPo", 0))) {
++		if ((rc = verify_mode_params(argc, argv, "HIdnvmPo", 0))) {
  			log_error("iface mode: option '-%c' is not "
  				  "allowed/supported", rc);
 -			rc = -1;
@@ -6707,7 +11885,15 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  			goto out;
  		}
  
-@@ -2014,7 +2039,7 @@ main(int argc, char **argv)
+@@ -2007,14 +2289,14 @@ main(int argc, char **argv)
+ 					  "interface. Using the first one "
+ 					  "%s.", iface->name);
+ 		}
+-		rc = exec_iface_op(op, do_show, info_level, iface,
++		rc = exec_iface_op(op, do_show, info_level, iface, host_no,
+ 				   name, value);
+ 		break;
+ 	case MODE_DISCOVERYDB:
  		if ((rc = verify_mode_params(argc, argv, "DSIPdmntplov", 0))) {
  			log_error("discovery mode: option '-%c' is not "
  				  "allowed/supported", rc);
@@ -6716,7 +11902,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  			goto out;
  		}
  
-@@ -2026,7 +2051,7 @@ main(int argc, char **argv)
+@@ -2026,7 +2308,7 @@ main(int argc, char **argv)
  		if ((rc = verify_mode_params(argc, argv, "DSIPdmntplov", 0))) {
  			log_error("discovery mode: option '-%c' is not "
  				  "allowed/supported", rc);
@@ -6725,7 +11911,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  			goto out;
  		}
  
-@@ -2039,7 +2064,7 @@ main(int argc, char **argv)
+@@ -2039,7 +2321,7 @@ main(int argc, char **argv)
  					     0))) {
  			log_error("node mode: option '-%c' is not "
  				  "allowed/supported", rc);
@@ -6734,7 +11920,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  			goto out;
  		}
  
-@@ -2069,7 +2094,7 @@ main(int argc, char **argv)
+@@ -2069,7 +2351,7 @@ main(int argc, char **argv)
  
  		rec = idbm_create_rec(targetname, tpgt, ip, port, iface, 1);
  		if (!rec) {
@@ -6743,7 +11929,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  			goto out;
  		}
  
-@@ -2082,7 +2107,7 @@ main(int argc, char **argv)
+@@ -2082,7 +2364,7 @@ main(int argc, char **argv)
  					      "PiRdrmusonuSv", 1))) {
  			log_error("session mode: option '-%c' is not "
  				  "allowed or supported", rc);
@@ -6752,7 +11938,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  			goto out;
  		}
  		if (sid >= 0) {
-@@ -2094,7 +2119,7 @@ main(int argc, char **argv)
+@@ -2094,7 +2376,7 @@ main(int argc, char **argv)
  
  			info = calloc(1, sizeof(*info));
  			if (!info) {
@@ -6761,16 +11947,19 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
  				goto out;
  			}
  
-@@ -2116,8 +2141,6 @@ main(int argc, char **argv)
+@@ -2115,9 +2397,8 @@ main(int argc, char **argv)
+ 
  			if (!do_logout && !do_rescan && !do_stats &&
  			    op == OP_NOOP && info_level > 0) {
- 				rc = session_info_print(info_level, info);
+-				rc = session_info_print(info_level, info);
 -				if (rc)
 -					rc = -1;
++				rc = session_info_print(info_level, info,
++							do_show);
  				goto free_info;
  			}
  
-@@ -2127,7 +2150,7 @@ main(int argc, char **argv)
+@@ -2127,9 +2408,21 @@ main(int argc, char **argv)
  					      info->persistent_port,
  					      &info->iface, 1);
  			if (!rec) {
@@ -6778,10 +11967,46 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsiadm.c open-iscsi-2.0-872-rc4-b
 +				rc = ISCSI_ERR_NOMEM;
  				goto free_info;
  			}
++			rec->session.info = info;
++			rec->session.sid = sid;
++
++			/*
++			 * A "new" session means to login a multiple of the
++			 * currently-detected session.
++			 */
++			if (op == OP_NEW) {
++				op = OP_NOOP;
++				do_login = 1;
++				rec->session.multiple = 1;
++			}
+ 
+ 			/* drop down to node ops */
+ 			rc = exec_node_op(op, do_login, do_logout, do_show,
+@@ -2139,6 +2432,12 @@ free_info:
+ 			free(info);
+ 			goto out;
+ 		} else {
++			if (op == OP_NEW) {
++				log_error("session mode: Operation 'new' only "
++					  "allowed with specific session IDs");
++				rc = ISCSI_ERR_INVAL;
++				goto out;
++			}
+ 			if (do_logout || do_rescan || do_stats) {
+ 				rc = exec_node_op(op, do_login, do_logout,
+ 						 do_show, do_rescan, do_stats,
+@@ -2146,7 +2445,7 @@ free_info:
+ 				goto out;
+ 			}
  
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsid.c
+-			rc = session_info_print(info_level, NULL);
++			rc = session_info_print(info_level, NULL, do_show);
+ 		}
+ 		break;
+ 	default:
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid.c open-iscsi-2.0-872-rc4-bnx2i.sync/usr/iscsid.c
 --- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid.c	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsid.c	2011-02-24 19:54:29.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/iscsid.c	2011-08-14 16:48:25.000000000 -0500
 @@ -31,6 +31,8 @@
  #include <sys/utsname.h>
  #include <sys/types.h>
@@ -6810,7 +12035,21 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid.c open-iscsi-2.0-872-rc4-bnx
  
  static struct option const long_options[] = {
  	{"config", required_argument, NULL, 'c'},
-@@ -92,7 +95,7 @@ Open-iSCSI initiator daemon.\n\
+@@ -66,6 +69,7 @@ static struct option const long_options[
+ 	{"debug", required_argument, NULL, 'd'},
+ 	{"uid", required_argument, NULL, 'u'},
+ 	{"gid", required_argument, NULL, 'g'},
++	{"no-pid-file", no_argument, NULL, 'n'},
+ 	{"pid", required_argument, NULL, 'p'},
+ 	{"help", no_argument, NULL, 'h'},
+ 	{"version", no_argument, NULL, 'v'},
+@@ -87,12 +91,13 @@ Open-iSCSI initiator daemon.\n\
+   -d, --debug debuglevel  print debugging information\n\
+   -u, --uid=uid           run as uid, default is current user\n\
+   -g, --gid=gid           run as gid, default is current user group\n\
++  -n, --no-pid-file       do not use a pid file\n\
+   -p, --pid=pidfile       use pid file (default " PID_FILE ").\n\
+   -h, --help              display this help and exit\n\
    -v, --version           display version and exit\n\
  ");
  	}
@@ -6819,7 +12058,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid.c open-iscsi-2.0-872-rc4-bnx
  }
  
  static void
-@@ -196,11 +199,6 @@ static int sync_session(void *data, stru
+@@ -196,11 +201,6 @@ static int sync_session(void *data, stru
  	t = iscsi_sysfs_get_transport_by_sid(info->sid);
  	if (!t)
  		return 0;
@@ -6831,7 +12070,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid.c open-iscsi-2.0-872-rc4-bnx
  
  	/*
  	 * Just rescan the device in case this is the first startup.
-@@ -213,7 +211,8 @@ static int sync_session(void *data, stru
+@@ -213,7 +213,8 @@ static int sync_session(void *data, stru
  		host_no = iscsi_sysfs_get_host_no_from_sid(info->sid, &err);
  		if (err) {
  			log_error("Could not get host no from sid %u. Can not "
@@ -6841,7 +12080,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid.c open-iscsi-2.0-872-rc4-bnx
  			return 0;
  		}
  		iscsi_sysfs_scan_host(host_no, 0);
-@@ -272,7 +271,7 @@ static int sync_session(void *data, stru
+@@ -272,7 +273,7 @@ static int sync_session(void *data, stru
  
  retry:
  	rc = iscsid_exec_req(&req, &rsp, 0);
@@ -6850,16 +12089,21 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid.c open-iscsi-2.0-872-rc4-bnx
  		retries++;
  		sleep(1);
  		goto retry;
-@@ -302,7 +301,7 @@ static void iscsid_shutdown(void)
+@@ -302,7 +303,12 @@ static void iscsid_shutdown(void)
  
  static void catch_signal(int signo)
  {
 -	log_debug(1, "%d caught signal -%d...", signo, getpid());
 +	log_debug(1, "pid %d caught signal %d", getpid(), signo);
++
++	/* In foreground mode, treat SIGINT like SIGTERM */
++	if (!daemonize && signo == SIGINT)
++		signo = SIGTERM;
++
  	switch (signo) {
  	case SIGTERM:
  		iscsid_shutdown();
-@@ -318,7 +317,7 @@ static void missing_iname_warn(char *ini
+@@ -318,7 +324,7 @@ static void missing_iname_warn(char *ini
  	log_error("Warning: InitiatorName file %s does not exist or does not "
  		  "contain a properly formated InitiatorName. If using "
  		  "software iscsi (iscsi_tcp or ib_iser) or partial offload "
@@ -6868,20 +12112,50 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid.c open-iscsi-2.0-872-rc4-bnx
  		  "into or discover targets. Please create a file %s that "
  		  "contains a sting with the format: InitiatorName="
  		  "iqn.yyyy-mm.<reversed domain name>[:identifier].\n\n"
-@@ -337,6 +336,7 @@ int main(int argc, char *argv[])
+@@ -337,17 +343,10 @@ int main(int argc, char *argv[])
  	uid_t uid = 0;
  	struct sigaction sa_old;
  	struct sigaction sa_new;
 +	int control_fd;
  	pid_t pid;
  
- 	/* do not allow ctrl-c for now... */
-@@ -388,17 +388,17 @@ int main(int argc, char *argv[])
+-	/* do not allow ctrl-c for now... */
+-	sa_new.sa_handler = catch_signal;
+-	sigemptyset(&sa_new.sa_mask);
+-	sa_new.sa_flags = 0;
+-	sigaction(SIGINT, &sa_new, &sa_old );
+-	sigaction(SIGPIPE, &sa_new, &sa_old );
+-	sigaction(SIGTERM, &sa_new, &sa_old );
+-
+-	while ((ch = getopt_long(argc, argv, "c:i:fd:u:g:p:vh", long_options,
++	while ((ch = getopt_long(argc, argv, "c:i:fd:nu:g:p:vh", long_options,
+ 				 &longindex)) >= 0) {
+ 		switch (ch) {
+ 		case 'c':
+@@ -368,6 +367,9 @@ int main(int argc, char *argv[])
+ 		case 'g':
+ 			gid = strtoul(optarg, NULL, 10);
+ 			break;
++		case 'n':
++			pid_file = NULL;
++			break;
+ 		case 'p':
+ 			pid_file = optarg;
+ 			break;
+@@ -388,17 +390,25 @@ int main(int argc, char *argv[])
  	log_pid = log_init(program_name, DEFAULT_AREA_SIZE,
  		      daemonize ? log_do_log_daemon : log_do_log_std, NULL);
  	if (log_pid < 0)
 -		exit(1);
 +		exit(ISCSI_ERR);
++
++	/* do not allow ctrl-c for now... */
++	sa_new.sa_handler = catch_signal;
++	sigemptyset(&sa_new.sa_mask);
++	sa_new.sa_flags = 0;
++	sigaction(SIGINT, &sa_new, &sa_old );
++	sigaction(SIGPIPE, &sa_new, &sa_old );
++	sigaction(SIGTERM, &sa_new, &sa_old );
  
  	sysfs_init();
  	if (idbm_init(iscsid_get_config_file)) {
@@ -6897,7 +12171,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid.c open-iscsi-2.0-872-rc4-bnx
  	}
  
  	umask(0177);
-@@ -410,7 +410,7 @@ int main(int argc, char *argv[])
+@@ -410,24 +420,26 @@ int main(int argc, char *argv[])
  
  	if ((mgmt_ipc_fd = mgmt_ipc_listen()) < 0) {
  		log_close(log_pid);
@@ -6906,12 +12180,22 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid.c open-iscsi-2.0-872-rc4-bnx
  	}
  
  	if (daemonize) {
-@@ -421,13 +421,13 @@ int main(int argc, char *argv[])
- 		if (fd < 0) {
- 			log_error("Unable to create pid file");
- 			log_close(log_pid);
+ 		char buf[64];
+-		int fd;
++		int fd = -1;
+ 
+-		fd = open(pid_file, O_WRONLY|O_CREAT, 0644);
+-		if (fd < 0) {
+-			log_error("Unable to create pid file");
+-			log_close(log_pid);
 -			exit(1);
-+			exit(ISCSI_ERR);
++		if (pid_file) {
++			fd = open(pid_file, O_WRONLY|O_CREAT, 0644);
++			if (fd < 0) {
++				log_error("Unable to create pid file");
++				log_close(log_pid);
++				exit(ISCSI_ERR);
++			}
  		}
  		pid = fork();
  		if (pid < 0) {
@@ -6922,7 +12206,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid.c open-iscsi-2.0-872-rc4-bnx
  		} else if (pid) {
  			log_error("iSCSI daemon with pid=%d started!", pid);
  			exit(0);
-@@ -435,14 +435,14 @@ int main(int argc, char *argv[])
+@@ -435,18 +447,29 @@ int main(int argc, char *argv[])
  
  		if ((control_fd = ipc->ctldev_open()) < 0) {
  			log_close(log_pid);
@@ -6930,16 +12214,38 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid.c open-iscsi-2.0-872-rc4-bnx
 +			exit(ISCSI_ERR);
  		}
  
- 		chdir("/");
- 		if (lockf(fd, F_TLOCK, 0) < 0) {
- 			log_error("Unable to lock pid file");
- 			log_close(log_pid);
+-		chdir("/");
+-		if (lockf(fd, F_TLOCK, 0) < 0) {
+-			log_error("Unable to lock pid file");
+-			log_close(log_pid);
 -			exit(1);
-+			exit(ISCSI_ERR);
++		if (chdir("/") < 0)
++			log_debug(1, "Unable to chdir to /");
++		if (fd > 0) {
++			if (lockf(fd, F_TLOCK, 0) < 0) {
++				log_error("Unable to lock pid file");
++				log_close(log_pid);
++				exit(ISCSI_ERR);
++			}
++			if (ftruncate(fd, 0) < 0) {
++				log_error("Unable to truncate pid file");
++				log_close(log_pid);
++				exit(ISCSI_ERR);
++			}
++			sprintf(buf, "%d\n", getpid());
++			if (write(fd, buf, strlen(buf)) < 0) {
++				log_error("Unable to write pid file");
++				log_close(log_pid);
++				exit(ISCSI_ERR);
++			}
  		}
- 		ftruncate(fd, 0);
- 		sprintf(buf, "%d\n", getpid());
-@@ -498,6 +498,7 @@ int main(int argc, char *argv[])
+-		ftruncate(fd, 0);
+-		sprintf(buf, "%d\n", getpid());
+-		write(fd, buf, strlen(buf));
+ 
+ 		daemon_init();
+ 	} else {
+@@ -498,6 +521,7 @@ int main(int argc, char *argv[])
  	} else
  		reap_inc();
  
@@ -6947,7 +12253,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid.c open-iscsi-2.0-872-rc4-bnx
  	increase_max_files();
  	discoveryd_start(daemon_config.initiator_name);
  
-@@ -509,7 +510,7 @@ int main(int argc, char *argv[])
+@@ -509,7 +533,7 @@ int main(int argc, char *argv[])
  	if (mlockall(MCL_CURRENT | MCL_FUTURE)) {
  		log_error("failed to mlockall, exiting...");
  		log_close(log_pid);
@@ -6956,9 +12262,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid.c open-iscsi-2.0-872-rc4-bnx
  	}
  
  	actor_init();
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsid.h
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid.h open-iscsi-2.0-872-rc4-bnx2i.sync/usr/iscsid.h
 --- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid.h	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsid.h	2011-02-24 19:54:10.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/iscsid.h	2011-08-14 16:48:25.000000000 -0500
 @@ -31,6 +31,5 @@ struct iscsi_daemon_config {
  	char *initiator_alias;
  };
@@ -6966,9 +12272,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid.h open-iscsi-2.0-872-rc4-bnx
 -extern int control_fd;
  
  #endif	/* ISCSID_H */
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid_req.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsid_req.c
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid_req.c open-iscsi-2.0-872-rc4-bnx2i.sync/usr/iscsid_req.c
 --- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid_req.c	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsid_req.c	2011-02-24 19:54:10.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/iscsid_req.c	2011-08-14 16:48:25.000000000 -0500
 @@ -31,6 +31,7 @@
  #include "mgmt_ipc.h"
  #include "iscsi_util.h"
@@ -6977,7 +12283,15 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid_req.c open-iscsi-2.0-872-rc4
  
  static void iscsid_startup(void)
  {
-@@ -51,7 +52,7 @@ static void iscsid_startup(void)
+@@ -46,12 +47,14 @@ static void iscsid_startup(void)
+ 		return;
+ 	}
+ 
+-	system(startup_cmd);
++	if (system(startup_cmd) < 0)
++		log_error("Could not execute '%s' (err %d)",
++			  startup_cmd, errno);
+ }
  
  #define MAXSLEEP 128
  
@@ -6986,7 +12300,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid_req.c open-iscsi-2.0-872-rc4
  {
  	int nsec;
  	struct sockaddr_un addr;
-@@ -59,7 +60,7 @@ static mgmt_ipc_err_e iscsid_connect(int
+@@ -59,7 +62,7 @@ static mgmt_ipc_err_e iscsid_connect(int
  	*fd = socket(AF_LOCAL, SOCK_STREAM, 0);
  	if (*fd < 0) {
  		log_error("can not create IPC socket (%d)!", errno);
@@ -6995,7 +12309,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid_req.c open-iscsi-2.0-872-rc4
  	}
  
  	memset(&addr, 0, sizeof(addr));
-@@ -72,7 +73,7 @@ static mgmt_ipc_err_e iscsid_connect(int
+@@ -72,7 +75,7 @@ static mgmt_ipc_err_e iscsid_connect(int
  	for (nsec = 1; nsec <= MAXSLEEP; nsec <<= 1) {
  		if (connect(*fd, (struct sockaddr *) &addr, sizeof(addr)) == 0)
  			/* Connection established */
@@ -7004,7 +12318,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid_req.c open-iscsi-2.0-872-rc4
  
  		/* If iscsid isn't there, there's no sense
  		 * in retrying. */
-@@ -90,10 +91,10 @@ static mgmt_ipc_err_e iscsid_connect(int
+@@ -90,10 +93,10 @@ static mgmt_ipc_err_e iscsid_connect(int
  			sleep(nsec);
  	}
  	log_error("can not connect to iSCSI daemon (%d)!", errno);
@@ -7017,7 +12331,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid_req.c open-iscsi-2.0-872-rc4
  {
  	int err;
  
-@@ -105,33 +106,33 @@ mgmt_ipc_err_e iscsid_request(int *fd, i
+@@ -105,33 +108,33 @@ mgmt_ipc_err_e iscsid_request(int *fd, i
  		log_error("got write error (%d/%d) on cmd %d, daemon died?",
  			err, errno, req->command);
  		close(*fd);
@@ -7059,7 +12373,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid_req.c open-iscsi-2.0-872-rc4
  
  	err = iscsid_request(&fd, req, start_iscsid);
  	if (err)
-@@ -189,31 +190,3 @@ int iscsid_req_by_sid(iscsiadm_cmd_e cmd
+@@ -189,31 +192,3 @@ int iscsid_req_by_sid(iscsiadm_cmd_e cmd
  		return err;
  	return iscsid_req_wait(cmd, fd);
  }
@@ -7091,9 +12405,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid_req.c open-iscsi-2.0-872-rc4
 -	};
 -	log_error("initiator reported error (%d - %s)", err, err_msgs[err]);
 -}
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid_req.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsid_req.h
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid_req.h open-iscsi-2.0-872-rc4-bnx2i.sync/usr/iscsid_req.h
 --- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid_req.h	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsid_req.h	2011-02-24 19:54:10.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/iscsid_req.h	2011-08-14 16:48:25.000000000 -0500
 @@ -27,7 +27,6 @@ struct node_rec;
  
  extern int iscsid_exec_req(struct iscsiadm_req *req, struct iscsiadm_rsp *rsp,
@@ -7102,9 +12416,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid_req.h open-iscsi-2.0-872-rc4
  extern int iscsid_req_wait(int cmd, int fd);
  extern int iscsid_req_by_rec_async(int cmd, struct node_rec *rec, int *fd);
  extern int iscsid_req_by_rec(int cmd, struct node_rec *rec);
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_err.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_err.c
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_err.c open-iscsi-2.0-872-rc4-bnx2i.sync/usr/iscsi_err.c
 --- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_err.c	1969-12-31 18:00:00.000000000 -0600
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_err.c	2011-02-24 19:54:10.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/iscsi_err.c	2011-08-14 16:48:25.000000000 -0500
 @@ -0,0 +1,72 @@
 +/*
 + * iSCSI error helpers
@@ -7152,7 +12466,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_err.c open-iscsi-2.0-872-rc4-
 +	/* 19 */ "encountered non-retryable iSCSI login failure",
 +	/* 20 */ "could not connect to iscsid",
 +	/* 21 */ "no objects found",
-+	/* 23 */ "sysfs lookup failure",
++	/* 22 */ "sysfs lookup failure",
 +	/* 23 */ "host not found",
 +	/* 24 */ "iSCSI login failed due to authorization failure",
 +	/* 25 */ "iSNS query failed",
@@ -7178,9 +12492,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_err.c open-iscsi-2.0-872-rc4-
 +	log_error("initiator reported error (%d - %s)", err,
 +		  iscsi_err_msgs[err]);
 +}
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_ipc.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_ipc.h
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_ipc.h open-iscsi-2.0-872-rc4-bnx2i.sync/usr/iscsi_ipc.h
 --- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_ipc.h	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_ipc.h	2011-02-24 19:54:10.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/iscsi_ipc.h	2011-08-14 16:48:25.000000000 -0500
 @@ -34,6 +34,26 @@ enum {
  };
  
@@ -7208,9 +12522,21 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_ipc.h open-iscsi-2.0-872-rc4-
  
  /**
   * struct iscsi_ipc - Open-iSCSI Interface for Kernel IPC
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_net_util.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_net_util.c
+@@ -109,6 +129,11 @@ struct iscsi_ipc {
+ 	int (*recv_pdu_begin) (struct iscsi_conn *conn);
+ 
+ 	int (*recv_pdu_end) (struct iscsi_conn *conn);
++
++	int (*set_net_config) (uint64_t transport_handle, uint32_t host_no,
++			       struct iovec *iovs, uint32_t param_count);
++
++	int (*recv_conn_state) (struct iscsi_conn *conn, uint32_t *state);
+ };
+ 
+ #endif /* ISCSI_IPC_H */
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_net_util.c open-iscsi-2.0-872-rc4-bnx2i.sync/usr/iscsi_net_util.c
 --- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_net_util.c	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_net_util.c	2011-02-24 19:54:10.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/iscsi_net_util.c	2011-08-14 16:48:25.000000000 -0500
 @@ -41,6 +41,7 @@ struct iscsi_net_driver {
  static struct iscsi_net_driver net_drivers[] = {
  #ifdef OFFLOAD_BOOT_SUPPORTED
@@ -7219,9 +12545,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_net_util.c open-iscsi-2.0-872
  	{"bnx2", "bnx2i" },
  	{"bnx2x", "bnx2i"},
  #endif
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsistart.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsistart.c
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsistart.c open-iscsi-2.0-872-rc4-bnx2i.sync/usr/iscsistart.c
 --- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsistart.c	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsistart.c	2011-02-24 19:54:10.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/iscsistart.c	2011-08-14 16:48:25.000000000 -0500
 @@ -47,6 +47,7 @@
  #include "iface.h"
  #include "sysdeps.h"
@@ -7384,9 +12710,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsistart.c open-iscsi-2.0-872-rc4
  	actor_init();
  	event_loop(ipc, control_fd, mgmt_ipc_fd);
  	ipc->ctldev_close();
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_sysfs.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_sysfs.c
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_sysfs.c open-iscsi-2.0-872-rc4-bnx2i.sync/usr/iscsi_sysfs.c
 --- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_sysfs.c	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_sysfs.c	2011-02-24 19:54:10.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/iscsi_sysfs.c	2011-08-14 16:48:25.000000000 -0500
 @@ -36,6 +36,7 @@
  #include "iface.h"
  #include "session_info.h"
@@ -7395,7 +12721,15 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_sysfs.c open-iscsi-2.0-872-rc
  
  /*
   * TODO: remove the _DIR defines and search for subsys dirs like
-@@ -115,6 +116,10 @@ static int read_transports(void)
+@@ -49,6 +50,7 @@
+ #define ISCSI_CONN_SUBSYS		"iscsi_connection"
+ #define ISCSI_HOST_SUBSYS		"iscsi_host"
+ #define ISCSI_TRANSPORT_SUBSYS		"iscsi_transport"
++#define ISCSI_IFACE_SUBSYS		"iscsi_iface"
+ #define SCSI_HOST_SUBSYS		"scsi_host"
+ #define SCSI_SUBSYS			"scsi"
+ 
+@@ -115,6 +117,10 @@ static int read_transports(void)
  			INIT_LIST_HEAD(&t->list);
  			strlcpy(t->name, namelist[i]->d_name,
  				ISCSI_TRANSPORT_NAME_MAXLEN);
@@ -7406,6 +12740,14 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_sysfs.c open-iscsi-2.0-872-rc
  		} else
  			log_debug(7, "Updating transport %s",
  				  namelist[i]->d_name);
+@@ -143,7 +149,6 @@ static int read_transports(void)
+ 		 */
+ 		if (!strcmp(t->name, "qla4xxx")) {
+ 			t->caps |= CAP_DATA_PATH_OFFLOAD;
+-			t->caps |= CAP_FW_DB;
+ 		}
+ 
+ 		if (list_empty(&t->list))
 @@ -238,7 +243,7 @@ uint32_t iscsi_sysfs_get_host_no_from_si
  					       ISCSI_SESSION_SUBSYS, id)) {
  		log_error("Could not lookup devpath for %s. Possible sysfs "
@@ -7451,7 +12793,24 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_sysfs.c open-iscsi-2.0-872-rc
  	free(info);
  	return host_no;
  }
-@@ -337,7 +342,7 @@ static uint32_t get_host_no_from_hwaddre
+@@ -320,14 +325,14 @@ static int __get_host_no_from_hwaddress(
+ {
+ 	struct host_info *ret_info = data;
+ 
+-	if (!strcmp(ret_info->iface.hwaddress, info->iface.hwaddress)) {
++	if (!strcasecmp(ret_info->iface.hwaddress, info->iface.hwaddress)) {
+ 		ret_info->host_no = info->host_no;
+ 		return 1;
+ 	}
+ 	return 0;
+ }
+ 
+-static uint32_t get_host_no_from_hwaddress(char *address, int *rc)
++uint32_t iscsi_sysfs_get_host_no_from_hwaddress(char *hwaddress, int *rc)
+ {
+ 	uint32_t host_no = -1;
+ 	struct host_info *info;
+@@ -337,17 +342,17 @@ static uint32_t get_host_no_from_hwaddre
  
  	info = calloc(1, sizeof(*info));
  	if (!info) {
@@ -7459,8 +12818,11 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_sysfs.c open-iscsi-2.0-872-rc
 +		*rc = ISCSI_ERR_NOMEM;
  		return -1;
  	}
- 	strcpy(info->iface.hwaddress, address);
-@@ -347,7 +352,7 @@ static uint32_t get_host_no_from_hwaddre
+-	strcpy(info->iface.hwaddress, address);
++	strcpy(info->iface.hwaddress, hwaddress);
+ 
+ 	local_rc = iscsi_sysfs_for_each_host(info, &nr_found,
+ 					__get_host_no_from_hwaddress);
  	if (local_rc == 1)
  		host_no = info->host_no;
  	else
@@ -7487,7 +12849,17 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_sysfs.c open-iscsi-2.0-872-rc
  	free(info);
  	return host_no;
  }
-@@ -404,7 +409,7 @@ uint32_t iscsi_sysfs_get_host_no_from_hw
+@@ -396,7 +401,8 @@ uint32_t iscsi_sysfs_get_host_no_from_hw
+ 
+ 	if (strlen(iface->hwaddress) &&
+ 	    strcasecmp(iface->hwaddress, DEFAULT_HWADDRESS))
+-		host_no = get_host_no_from_hwaddress(iface->hwaddress, &tmp_rc);
++		host_no = iscsi_sysfs_get_host_no_from_hwaddress(
++						iface->hwaddress, &tmp_rc);
+ 	else if (strlen(iface->netdev) &&
+ 		strcasecmp(iface->netdev, DEFAULT_NETDEV))
+ 		host_no = get_host_no_from_netdev(iface->netdev, &tmp_rc);
+@@ -404,7 +410,7 @@ uint32_t iscsi_sysfs_get_host_no_from_hw
  		 strcasecmp(iface->ipaddress, DEFAULT_IPADDRESS))
  		host_no = get_host_no_from_ipaddress(iface->ipaddress, &tmp_rc);
  	else
@@ -7496,7 +12868,57 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_sysfs.c open-iscsi-2.0-872-rc
  
  	*rc = tmp_rc;
  	return host_no;
-@@ -459,7 +464,7 @@ static int iscsi_sysfs_read_iface(struct
+@@ -417,9 +423,9 @@ uint32_t iscsi_sysfs_get_host_no_from_hw
+  * qla4xxx.
+  */
+ static int iscsi_sysfs_read_iface(struct iface_rec *iface, int host_no,
+-				  char *session)
++				  char *session, char *iface_kern_id)
+ {
+-	char id[NAME_SIZE];
++	char host_id[NAME_SIZE];
+ 	struct iscsi_transport *t;
+ 	int ret;
+ 
+@@ -430,26 +436,31 @@ static int iscsi_sysfs_read_iface(struct
+ 	else
+ 		strcpy(iface->transport_name, t->name);
+ 
+-	snprintf(id, sizeof(id), ISCSI_HOST_ID, host_no);
++	snprintf(host_id, sizeof(host_id), ISCSI_HOST_ID, host_no);
+ 	/*
+ 	 * backward compat
+ 	 * If we cannot get the address we assume we are doing the old
+ 	 * style and use default.
+ 	 */
+-	ret = sysfs_get_str(id, ISCSI_HOST_SUBSYS, "hwaddress",
++	ret = sysfs_get_str(host_id, ISCSI_HOST_SUBSYS, "hwaddress",
+ 			    iface->hwaddress, sizeof(iface->hwaddress));
+ 	if (ret)
+ 		log_debug(7, "could not read hwaddress for host%d\n", host_no);
+ 
+-	/* if not found just print out default */
+-	ret = sysfs_get_str(id, ISCSI_HOST_SUBSYS, "ipaddress",
+-			    iface->ipaddress, sizeof(iface->ipaddress));
++	if (iface_kern_id)
++		ret = sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS,
++				    "ipaddress",
++				    iface->ipaddress, sizeof(iface->ipaddress));
++	else
++		/* if not found just print out default */
++		ret = sysfs_get_str(host_id, ISCSI_HOST_SUBSYS, "ipaddress",
++				    iface->ipaddress, sizeof(iface->ipaddress));
+ 	if (ret)
+ 		log_debug(7, "could not read local address for host%d\n",
+ 			  host_no);
+ 
+ 	/* if not found just print out default */
+-	ret = sysfs_get_str(id, ISCSI_HOST_SUBSYS, "netdev",
++	ret = sysfs_get_str(host_id, ISCSI_HOST_SUBSYS, "netdev",
+ 			    iface->netdev, sizeof(iface->netdev));
+ 	if (ret)
+ 		log_debug(7, "could not read netdev for host%d\n", host_no);
+@@ -459,7 +470,7 @@ static int iscsi_sysfs_read_iface(struct
  	 * host level because we cannot create different initiator ports
  	 * (cannot set isid either). The LLD also exports the iname at the
  	 * hba level so apps can see it, but we no longer set the iname for
@@ -7505,11 +12927,76 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_sysfs.c open-iscsi-2.0-872-rc
  	 * initiator names and of course software iscsi can support anything.
  	 */
  	ret = 1;
-@@ -523,7 +528,10 @@ static int iscsi_sysfs_read_iface(struct
+@@ -481,7 +492,7 @@ static int iscsi_sysfs_read_iface(struct
+ 	}
+ 
+ 	if (ret) {
+-		ret = sysfs_get_str(id, ISCSI_HOST_SUBSYS, "initiatorname",
++		ret = sysfs_get_str(host_id, ISCSI_HOST_SUBSYS, "initiatorname",
+ 				    iface->iname, sizeof(iface->iname));
+ 		if (ret)
+ 			/*
+@@ -493,6 +504,8 @@ static int iscsi_sysfs_read_iface(struct
+ 			 */
+ 			log_debug(7, "Could not read initiatorname for "
+ 				  "host%d\n", host_no);
++		/* optional so do not return error */
++		ret = 0;
+ 	}
+ 
+ 	/*
+@@ -523,12 +536,63 @@ static int iscsi_sysfs_read_iface(struct
  					  iface_str(iface));
  		}
  	}
 -	return ret;
++
++	if (!iface_kern_id)
++		goto done;
++
++	strlcpy(iface->name, iface_kern_id, sizeof(iface->name));
++
++	if (!strncmp(iface_kern_id, "ipv4", 4)) {
++		sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "bootproto",
++			      iface->bootproto, sizeof(iface->bootproto));
++
++		sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "gateway",
++			      iface->gateway, sizeof(iface->gateway));
++
++		sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "subnet",
++			      iface->subnet_mask, sizeof(iface->subnet_mask));
++	} else {
++		sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS,
++			      "ipaddr_autocfg",
++			      iface->ipv6_autocfg, sizeof(iface->ipv6_autocfg));
++
++		sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS,
++			      "link_local_addr", iface->ipv6_linklocal,
++			      sizeof(iface->ipv6_linklocal));
++
++		if (sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS,
++				  "linklocal_autocfg",
++				   iface->linklocal_autocfg,
++				   sizeof(iface->linklocal_autocfg))) {
++			/* misspelled in some test kernels */
++			sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS,
++				      "link_local_autocfg",
++				      iface->linklocal_autocfg,
++				      sizeof(iface->linklocal_autocfg));
++		}
++
++		sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "router_addr",
++			      iface->ipv6_router,
++			      sizeof(iface->ipv6_router));
++	}
++
++	sysfs_get_uint16(iface_kern_id, ISCSI_IFACE_SUBSYS, "mtu",
++			 &iface->mtu);
++	sysfs_get_uint16(iface_kern_id, ISCSI_IFACE_SUBSYS, "vlan",
++			 &iface->vlan_id);
++	sysfs_get_uint8(iface_kern_id, ISCSI_IFACE_SUBSYS, "vlan_priority",
++			 &iface->vlan_priority);
++done:
 +	if (ret)
 +		return ISCSI_ERR_SYSFS_LOOKUP;
 +	else
@@ -7517,7 +13004,14 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_sysfs.c open-iscsi-2.0-872-rc
  }
  
  int iscsi_sysfs_get_hostinfo_by_host_no(struct host_info *hinfo)
-@@ -540,7 +548,7 @@ int iscsi_sysfs_for_each_host(void *data
+ {
+-	return iscsi_sysfs_read_iface(&hinfo->iface, hinfo->host_no, NULL);
++	return iscsi_sysfs_read_iface(&hinfo->iface, hinfo->host_no, NULL,
++				      NULL);
+ }
+ 
+ int iscsi_sysfs_for_each_host(void *data, int *nr_found,
+@@ -540,7 +604,7 @@ int iscsi_sysfs_for_each_host(void *data
  
  	info = malloc(sizeof(*info));
  	if (!info)
@@ -7526,7 +13020,58 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_sysfs.c open-iscsi-2.0-872-rc
  
  	n = scandir(ISCSI_HOST_DIR, &namelist, trans_filter,
  		    alphasort);
-@@ -631,7 +639,7 @@ int iscsi_sysfs_get_sid_from_path(char *
+@@ -572,6 +636,50 @@ free_info:
+ 	return rc;
+ }
+ 
++int iscsi_sysfs_for_each_iface_on_host(void *data, uint32_t host_no,
++				       int *nr_found,
++				       iscsi_sysfs_iface_op_fn *fn)
++{
++	struct dirent **namelist;
++	int rc = 0, i, n;
++	struct iface_rec iface;
++        char devpath[PATH_SIZE];
++        char sysfs_path[PATH_SIZE];
++        char id[NAME_SIZE];
++
++        snprintf(id, sizeof(id), "host%u", host_no);
++        if (!sysfs_lookup_devpath_by_subsys_id(devpath, sizeof(devpath),
++                                               SCSI_SUBSYS, id)) {
++                log_error("Could not look up host's ifaces via scsi bus.");
++                return ISCSI_ERR_SYSFS_LOOKUP;
++        }
++
++	sprintf(sysfs_path, "/sys");
++	strlcat(sysfs_path, devpath, sizeof(sysfs_path));
++	strlcat(sysfs_path, "/iscsi_iface", sizeof(sysfs_path));
++
++	n = scandir(sysfs_path, &namelist, trans_filter, alphasort);
++	if (n <= 0)
++		/* older kernels or some drivers will not have ifaces */
++		return 0;
++
++	for (i = 0; i < n; i++) {
++		memset(&iface, 0, sizeof(iface));
++
++		iscsi_sysfs_read_iface(&iface, host_no, NULL,
++				       namelist[i]->d_name);
++		rc = fn(data, &iface);
++		if (rc != 0)
++			break;
++		(*nr_found)++;
++	}
++
++	for (i = 0; i < n; i++)
++		free(namelist[i]);
++	free(namelist);
++	return rc;
++}
++
+ /**
+  * sysfs_session_has_leadconn - checks if session has lead conn in kernel
+  * @sid: session id
+@@ -631,7 +739,7 @@ int iscsi_sysfs_get_sid_from_path(char *
  	if (!dev) {
  		log_error("Could not get dev for %s. Possible sysfs "
  			  "incompatibility.\n", devpath);
@@ -7535,7 +13080,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_sysfs.c open-iscsi-2.0-872-rc
  	}
  
  	if (!strncmp(dev->kernel, "session", 7))
-@@ -645,8 +653,7 @@ int iscsi_sysfs_get_sid_from_path(char *
+@@ -645,8 +753,7 @@ int iscsi_sysfs_get_sid_from_path(char *
  	}
  
  	log_error("Unable to find sid in path %s", session);
@@ -7545,7 +13090,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_sysfs.c open-iscsi-2.0-872-rc
  }
  
  int iscsi_sysfs_get_sessioninfo_by_id(struct session_info *info, char *session)
-@@ -657,21 +664,21 @@ int iscsi_sysfs_get_sessioninfo_by_id(st
+@@ -657,21 +764,65 @@ int iscsi_sysfs_get_sessioninfo_by_id(st
  
  	if (sscanf(session, "session%d", &info->sid) != 1) {
  		log_error("invalid session '%s'", session);
@@ -7561,6 +13106,50 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_sysfs.c open-iscsi-2.0-872-rc
 +		return ISCSI_ERR_SYSFS_LOOKUP;
  	}
  
++	ret = sysfs_get_str(session, ISCSI_SESSION_SUBSYS, "username",
++				(info->chap).username,
++				sizeof((info->chap).username));
++	if (ret)
++		log_debug(5, "could not read username: %d", ret);
++
++	ret = sysfs_get_str(session, ISCSI_SESSION_SUBSYS, "password",
++				(info->chap).password,
++				sizeof((info->chap).password));
++	if (ret)
++		log_debug(5, "could not read password: %d", ret);
++
++	ret = sysfs_get_str(session, ISCSI_SESSION_SUBSYS, "username_in",
++				(info->chap).username_in,
++				sizeof((info->chap).username_in));
++	if (ret)
++		log_debug(5, "could not read username in: %d", ret);
++
++	ret = sysfs_get_str(session, ISCSI_SESSION_SUBSYS, "password_in",
++				(info->chap).password_in,
++				sizeof((info->chap).password_in));
++	if (ret)
++		log_debug(5, "could not read password in: %d", ret);
++
++	ret = sysfs_get_int(session, ISCSI_SESSION_SUBSYS, "recovery_tmo",
++				&((info->tmo).recovery_tmo));
++	if (ret)
++		(info->tmo).recovery_tmo = -1;
++
++	ret = sysfs_get_int(session, ISCSI_SESSION_SUBSYS, "lu_reset_tmo",
++				&((info->tmo).lu_reset_tmo));
++	if (ret)
++		(info->tmo).lu_reset_tmo = -1;
++
++	ret = sysfs_get_int(session, ISCSI_SESSION_SUBSYS, "tgt_reset_tmo",
++				&((info->tmo).tgt_reset_tmo));
++	if (ret)
++		(info->tmo).lu_reset_tmo = -1;
++
++	sysfs_get_int(session, ISCSI_SESSION_SUBSYS, "abort_tmo",
++				&((info->tmo).abort_tmo));
++	if (ret)
++		(info->tmo).abort_tmo = -1;
++
  	ret = sysfs_get_int(session, ISCSI_SESSION_SUBSYS, "tpgt",
  			    &info->tpgt);
  	if (ret) {
@@ -7571,7 +13160,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_sysfs.c open-iscsi-2.0-872-rc
  	}
  
  	snprintf(id, sizeof(id), ISCSI_CONN_ID, info->sid);
-@@ -727,8 +734,8 @@ int iscsi_sysfs_get_sessioninfo_by_id(st
+@@ -727,13 +878,13 @@ int iscsi_sysfs_get_sessioninfo_by_id(st
  	ret = 0;
  	host_no = iscsi_sysfs_get_host_no_from_sid(info->sid, &ret);
  	if (ret) {
@@ -7582,7 +13171,23 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_sysfs.c open-iscsi-2.0-872-rc
  		return ret;
  	}
  
-@@ -755,7 +762,7 @@ int iscsi_sysfs_for_each_session(void *d
+-	iscsi_sysfs_read_iface(&info->iface, host_no, session);
+- 
++	iscsi_sysfs_read_iface(&info->iface, host_no, session, NULL);
++
+ 	log_debug(7, "found targetname %s address %s pers address %s port %d "
+ 		 "pers port %d driver %s iface name %s ipaddress %s "
+ 		 "netdev %s hwaddress %s iname %s",
+@@ -745,7 +896,7 @@ int iscsi_sysfs_get_sessioninfo_by_id(st
+ 		  info->iface.iname);
+ 	return 0;
+ }
+- 
++
+ int iscsi_sysfs_for_each_session(void *data, int *nr_found,
+ 				 iscsi_sysfs_session_op_fn *fn)
+ {
+@@ -755,7 +906,7 @@ int iscsi_sysfs_for_each_session(void *d
  
  	info = calloc(1, sizeof(*info));
  	if (!info)
@@ -7591,7 +13196,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_sysfs.c open-iscsi-2.0-872-rc
  
  	n = scandir(ISCSI_SESSION_DIR, &namelist, trans_filter,
  		    alphasort);
-@@ -797,8 +804,10 @@ int iscsi_sysfs_get_session_state(char *
+@@ -797,8 +948,10 @@ int iscsi_sysfs_get_session_state(char *
  	char id[NAME_SIZE];
  
  	snprintf(id, sizeof(id), ISCSI_SESSION_ID, sid);
@@ -7604,7 +13209,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_sysfs.c open-iscsi-2.0-872-rc
  }
  
  int iscsi_sysfs_get_host_state(char *state, int host_no)
-@@ -806,8 +815,10 @@ int iscsi_sysfs_get_host_state(char *sta
+@@ -806,8 +959,10 @@ int iscsi_sysfs_get_host_state(char *sta
  	char id[NAME_SIZE];
  
  	snprintf(id, sizeof(id), ISCSI_HOST_ID, host_no);
@@ -7617,7 +13222,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_sysfs.c open-iscsi-2.0-872-rc
  }
  
  int iscsi_sysfs_get_device_state(char *state, int host_no, int target, int lun)
-@@ -818,7 +829,7 @@ int iscsi_sysfs_get_device_state(char *s
+@@ -818,7 +973,7 @@ int iscsi_sysfs_get_device_state(char *s
  	if (sysfs_get_str(id, SCSI_SUBSYS, "state", state,
  			  SCSI_MAX_STATE_VALUE)) {
  		log_debug(3, "Could not read attr state for %s\n", id);
@@ -7626,7 +13231,33 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_sysfs.c open-iscsi-2.0-872-rc
  	}
  
  	return 0;
-@@ -919,7 +930,7 @@ static uint32_t get_target_no_from_sid(u
+@@ -828,7 +983,6 @@ char *iscsi_sysfs_get_blockdev_from_lun(
+ {
+ 	char devpath[PATH_SIZE];
+ 	char path_full[PATH_SIZE];
+-	char *path;
+ 	char id[NAME_SIZE];
+ 	DIR *dirfd;
+ 	struct dirent *dent;
+@@ -845,9 +999,8 @@ char *iscsi_sysfs_get_blockdev_from_lun(
+ 	}
+ 
+ 	sysfs_len = strlcpy(path_full, sysfs_path, sizeof(path_full));
+-	if(sysfs_len >= sizeof(path_full))
++	if (sysfs_len >= sizeof(path_full))
+ 		sysfs_len = sizeof(path_full) - 1;
+-	path = &path_full[sysfs_len];
+ 	strlcat(path_full, devpath, sizeof(path_full));
+ 
+ 	dirfd = opendir(path_full);
+@@ -912,14 +1065,13 @@ static uint32_t get_target_no_from_sid(u
+ {
+ 	char devpath[PATH_SIZE];
+ 	char path_full[PATH_SIZE];
+-	char *path;
+ 	char id[NAME_SIZE];
+ 	DIR *dirfd;
+ 	struct dirent *dent;
  	uint32_t host, bus, target = 0;
  	size_t sysfs_len;
  
@@ -7635,7 +13266,18 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_sysfs.c open-iscsi-2.0-872-rc
  
  	snprintf(id, sizeof(id), "session%u", sid);
  	if (!sysfs_lookup_devpath_by_subsys_id(devpath, sizeof(devpath),
-@@ -970,7 +981,8 @@ struct iscsi_transport *iscsi_sysfs_get_
+@@ -935,9 +1087,8 @@ static uint32_t get_target_no_from_sid(u
+ 	 * /class/iscsi_session/sessionX/device.
+ 	 */
+ 	sysfs_len = strlcpy(path_full, sysfs_path, sizeof(path_full));
+-	if(sysfs_len >= sizeof(path_full))
++	if (sysfs_len >= sizeof(path_full))
+ 		sysfs_len = sizeof(path_full) - 1;
+-	path = &path_full[sysfs_len];
+ 	strlcat(path_full, devpath, sizeof(path_full));
+ 	strlcat(path_full, "/device", sizeof(devpath));
+ 
+@@ -970,7 +1121,8 @@ struct iscsi_transport *iscsi_sysfs_get_
  	struct iscsi_transport *t;
  
  	/* sync up kernel and userspace */
@@ -7645,7 +13287,27 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_sysfs.c open-iscsi-2.0-872-rc
  
  	/* check if the transport is loaded and matches */
  	list_for_each_entry(t, &transports, list) {
-@@ -1061,7 +1073,7 @@ int iscsi_sysfs_for_each_device(void *da
+@@ -1043,6 +1195,19 @@ int iscsi_sysfs_get_exp_statsn(int sid)
+ 	return exp_statsn;
+ }
+ 
++int iscsi_sysfs_session_supports_nop(int sid)
++{
++	char id[NAME_SIZE];
++	uint32_t ping_tmo = 0;
++
++	snprintf(id, sizeof(id), ISCSI_CONN_ID, sid);
++	if (sysfs_get_uint(id, ISCSI_CONN_SUBSYS, "ping_tmo",
++			   &ping_tmo)) {
++		return 0;
++	}
++	return 1;
++}
++
+ int iscsi_sysfs_for_each_device(void *data, int host_no, uint32_t sid,
+ 				void (* fn)(void *data, int host_no,
+ 					    int target, int lun))
+@@ -1061,7 +1226,7 @@ int iscsi_sysfs_for_each_device(void *da
  					       ISCSI_SESSION_SUBSYS, id)) {
  		log_debug(3, "Could not lookup devpath for %s %s\n",
  			  ISCSI_SESSION_SUBSYS, id);
@@ -7654,9 +13316,40 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_sysfs.c open-iscsi-2.0-872-rc
  	}
  
  	snprintf(path_full, sizeof(path_full), "%s%s/device/target%d:0:%d",
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_timer.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_timer.c
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_sysfs.h open-iscsi-2.0-872-rc4-bnx2i.sync/usr/iscsi_sysfs.h
+--- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_sysfs.h	2010-07-11 04:05:58.000000000 -0500
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/iscsi_sysfs.h	2011-08-14 16:48:25.000000000 -0500
+@@ -43,7 +43,11 @@ extern int iscsi_sysfs_session_has_leadc
+ 
+ typedef int (iscsi_sysfs_session_op_fn)(void *, struct session_info *);
+ typedef int (iscsi_sysfs_host_op_fn)(void *, struct host_info *);
++typedef int (iscsi_sysfs_iface_op_fn)(void *, struct iface_rec *);
+ 
++extern int iscsi_sysfs_for_each_iface_on_host(void *data, uint32_t host_no,
++					      int *nr_found,
++					      iscsi_sysfs_iface_op_fn *fn);
+ extern int iscsi_sysfs_for_each_session(void *data, int *nr_found,
+ 					iscsi_sysfs_session_op_fn *fn);
+ extern int iscsi_sysfs_for_each_host(void *data, int *nr_found,
+@@ -51,6 +55,7 @@ extern int iscsi_sysfs_for_each_host(voi
+ extern uint32_t iscsi_sysfs_get_host_no_from_sid(uint32_t sid, int *err);
+ extern uint32_t iscsi_sysfs_get_host_no_from_hwinfo(struct iface_rec *iface,
+ 						    int *rc);
++extern uint32_t iscsi_sysfs_get_host_no_from_hwaddress(char *hwaddress, int *rc);
+ extern int iscsi_sysfs_get_hostinfo_by_host_no(struct host_info *hinfo);
+ extern int iscsi_sysfs_get_sid_from_path(char *session);
+ extern char *iscsi_sysfs_get_blockdev_from_lun(int hostno, int target, int sid);
+@@ -84,6 +89,7 @@ extern struct iscsi_transport *iscsi_sys
+ extern struct iscsi_transport *iscsi_sysfs_get_transport_by_session(char *sys_session);
+ extern struct iscsi_transport *iscsi_sysfs_get_transport_by_sid(uint32_t sid);
+ extern struct iscsi_transport *iscsi_sysfs_get_transport_by_name(char *transport_name);
++extern int iscsi_sysfs_session_supports_nop(int sid);
+ 
+ extern struct list_head transports;
+ 
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_timer.c open-iscsi-2.0-872-rc4-bnx2i.sync/usr/iscsi_timer.c
 --- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_timer.c	1969-12-31 18:00:00.000000000 -0600
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_timer.c	2011-02-24 19:54:10.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/iscsi_timer.c	2011-08-14 16:48:25.000000000 -0500
 @@ -0,0 +1,86 @@
 +/*
 + * iSCSI timer
@@ -7744,41 +13437,286 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_timer.c open-iscsi-2.0-872-rc
 +
 +	return msecs;
 +}
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_timer.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_timer.h
---- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_timer.h	1969-12-31 18:00:00.000000000 -0600
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_timer.h	2011-02-24 19:54:10.000000000 -0600
-@@ -0,0 +1,28 @@
-+/*
-+ * iSCSI timer
-+ *
-+ * Copyright (C) 2002 Cisco Systems, Inc.
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published
-+ * by the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful, but
-+ * WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ * General Public License for more details.
-+ *
-+ * See the file COPYING included with this distribution for more details.
-+ */
-+#ifndef ISCSI_TIMER_H
-+#define ISCSI_TIMER_H
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_timer.h open-iscsi-2.0-872-rc4-bnx2i.sync/usr/iscsi_timer.h
+--- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_timer.h	1969-12-31 18:00:00.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/iscsi_timer.h	2011-08-14 16:48:25.000000000 -0500
+@@ -0,0 +1,28 @@
++/*
++ * iSCSI timer
++ *
++ * Copyright (C) 2002 Cisco Systems, Inc.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published
++ * by the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful, but
++ * WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * General Public License for more details.
++ *
++ * See the file COPYING included with this distribution for more details.
++ */
++#ifndef ISCSI_TIMER_H
++#define ISCSI_TIMER_H
++
++struct timeval;
++
++extern void iscsi_timer_clear(struct timeval *timer);
++extern void iscsi_timer_set(struct timeval *timer, int seconds);
++extern int iscsi_timer_expired(struct timeval *timer);
++extern int iscsi_timer_msecs_until(struct timeval *timer);
++
++#endif
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_util.c open-iscsi-2.0-872-rc4-bnx2i.sync/usr/iscsi_util.c
+--- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_util.c	2010-07-11 04:05:58.000000000 -0500
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/iscsi_util.c	2011-08-14 16:48:25.000000000 -0500
+@@ -25,12 +25,15 @@
+ #include <string.h>
+ #include <errno.h>
+ #include <ctype.h>
++#include <sys/types.h>
++#include <sys/stat.h>
+ #include <sys/resource.h>
+ 
+ #include "log.h"
+ #include "iscsi_settings.h"
+ #include "iface.h"
+ #include "session_info.h"
++#include "iscsi_util.h"
+ 
+ void daemon_init(void)
+ {
+@@ -45,24 +48,38 @@ void daemon_init(void)
+ 	dup2(fd, 1);
+ 	dup2(fd, 2);
+ 	setsid();
+-	chdir("/");
++	if (chdir("/") < 0)
++		log_debug(1, "Could not chdir to /: %s", strerror(errno));
+ }
+ 
++#define ISCSI_OOM_PATH_LEN 48
++
+ int oom_adjust(void)
+ {
+ 	int fd;
+-	char path[48];
++	char path[ISCSI_OOM_PATH_LEN];
++	struct stat statb;
+ 
+-	nice(-10);
+-	sprintf(path, "/proc/%d/oom_adj", getpid());
++	if (nice(-10) < 0)
++		log_debug(1, "Could not increase process priority: %s",
++			  strerror(errno));
++
++	snprintf(path, ISCSI_OOM_PATH_LEN, "/proc/%d/oom_score_adj", getpid());
++	if (stat(path, &statb)) {
++		/* older kernel so use old oom_adj file */
++		snprintf(path, ISCSI_OOM_PATH_LEN, "/proc/%d/oom_adj",
++			 getpid());
++	}
+ 	fd = open(path, O_WRONLY);
+-	if (fd < 0) {
++	if (fd < 0)
+ 		return -1;
+-	}
+-	write(fd, "-16\n", 3); /* for 2.6.11 */
+-	write(fd, "-17\n", 3); /* for Andrea's patch */
++	if (write(fd, "-16", 3) < 0) /* for 2.6.11 */
++		log_debug(1, "Could not set oom score to -16: %s",
++			  strerror(errno));
++	if (write(fd, "-17", 3) < 0) /* for Andrea's patch */
++		log_debug(1, "Could not set oom score to -17: %s",
++			  strerror(errno));
+ 	close(fd);
+-
+ 	return 0;
+ }
+ 
+@@ -217,31 +234,92 @@ char *cfg_get_string_param(char *pathnam
+ 	return value;
+ }
+ 
++/**
++ * iscsi_addr_match - check if the addrs are to the same ip
++ * @address1: pattern
++ * @address2: address to check
++ *
++ * If address1 is blank then it matches any string passed in.
++ */
++static int iscsi_addr_match(char *address1, char *address2)
++{
++	struct addrinfo hints1, hints2, *res1, *res2;
++	int rc;
++
++	if (!strlen(address1))
++		return 1;
++
++	if (!strcmp(address1, address2))
++		return 1;
++
++	memset(&hints1, 0, sizeof(struct addrinfo));
++	hints1.ai_family = AF_UNSPEC;
++	hints1.ai_socktype = SOCK_STREAM;
++
++	memset(&hints2, 0, sizeof(struct addrinfo));
++	hints2.ai_family = AF_UNSPEC;
++	hints2.ai_socktype = SOCK_STREAM;
++
++	/*
++	 * didn't match so we have to resolve to see if one is a dnsname
++	 * that matches a ip address.
++	 */
++	rc = getaddrinfo(address1, NULL, &hints1, &res1);
++	if (rc) {
++		log_debug(1, "Match error. Could not resolve %s: %s", address1,
++			  gai_strerror(rc));
++		return 0;
++
++	}
++
++	rc = getaddrinfo(address2, NULL, &hints2, &res2);
++	if (rc) {
++		log_debug(1, "Match error. Could not resolve %s: %s", address2,
++			  gai_strerror(rc));
++		rc = 0;
++		goto free_res1;
++	}
++
++	if ((res1->ai_addrlen != res2->ai_addrlen) ||
++	    memcmp(res1->ai_addr, res2->ai_addr, res2->ai_addrlen))
++		rc = 0;
++	else
++		rc = 1;
++
++	freeaddrinfo(res2);
++free_res1:
++	freeaddrinfo(res1);
++	return rc;
++}
++
+ int __iscsi_match_session(node_rec_t *rec, char *targetname,
+-			  char *address, int port, struct iface_rec *iface)
++			  char *address, int port, struct iface_rec *iface,
++			  unsigned sid)
+ {
+ 	if (!rec) {
+ 		log_debug(6, "no rec info to match\n");
+ 		return 1;
+ 	}
+ 
+-	log_debug(6, "match session [%s,%s,%d][%s %s,%s,%s]",
++	log_debug(6, "match session [%s,%s,%d][%s %s,%s,%s]:%u",
+ 		  rec->name, rec->conn[0].address, rec->conn[0].port,
+ 		  rec->iface.name, rec->iface.transport_name,
+-		  rec->iface.hwaddress, rec->iface.ipaddress);
++		  rec->iface.hwaddress, rec->iface.ipaddress,
++		  rec->session.sid);
+ 
+ 	if (iface)
+-		log_debug(6, "to [%s,%s,%d][%s %s,%s,%s]",
++		log_debug(6, "to [%s,%s,%d][%s %s,%s,%s]:%u",
+ 			  targetname, address, port, iface->name,
+ 			  iface->transport_name, iface->hwaddress,
+-			  iface->ipaddress);
++			  iface->ipaddress, sid);
+ 
++	if (rec->session.sid && sid && rec->session.sid != sid)
++		return 0;
+ 
+ 	if (strlen(rec->name) && strcmp(rec->name, targetname))
+ 		return 0;
+ 
+-	if (strlen(rec->conn[0].address) &&
+-	    strcmp(rec->conn[0].address, address))
++	if (!iscsi_addr_match(rec->conn[0].address, address))
+ 		return 0;
+ 
+ 	if (rec->conn[0].port != -1 && port != rec->conn[0].port)
+@@ -257,5 +335,27 @@ int iscsi_match_session(void *data, stru
+ {
+ 	return __iscsi_match_session(data, info->targetname,
+ 				     info->persistent_address,
+-				     info->persistent_port, &info->iface);
++				     info->persistent_port, &info->iface,
++				     info->sid);
++}
 +
-+struct timeval;
++int iscsi_match_session_count(void *data, struct session_info *info)
++{
++	/*
++	 * iscsi_sysfs_for_each_session expects:
++	 *   0==match -1==nomatch >0==error
++	 * but iscsi_match_session returns:
++	 *   1==match 0==nomatch
++	 */
++	if (iscsi_match_session(data, info))
++		return 0;
++	return -1;
++}
 +
-+extern void iscsi_timer_clear(struct timeval *timer);
-+extern void iscsi_timer_set(struct timeval *timer, int seconds);
-+extern int iscsi_timer_expired(struct timeval *timer);
-+extern int iscsi_timer_msecs_until(struct timeval *timer);
++int iscsi_match_target(void *data, struct session_info *info)
++{
++	return __iscsi_match_session(data, info->targetname,
++				     info->persistent_address,
++				     info->persistent_port, NULL,
++				     MATCH_ANY_SID);
+ }
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_util.h open-iscsi-2.0-872-rc4-bnx2i.sync/usr/iscsi_util.h
+--- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_util.h	2010-07-11 04:05:58.000000000 -0500
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/iscsi_util.h	2011-08-14 16:48:25.000000000 -0500
+@@ -14,9 +14,14 @@ extern int increase_max_files(void);
+ extern char *str_to_ipport(char *str, int *port, int *tgpt);
+ 
+ extern int iscsi_match_session(void *data, struct session_info *info);
++extern int iscsi_match_target(void *data, struct session_info *info);
++extern int iscsi_match_session_count(void *data, struct session_info *info);
+ extern int __iscsi_match_session(struct node_rec *rec, char *targetname,
+ 				 char *address, int port,
+-				 struct iface_rec *iface);
++				 struct iface_rec *iface,
++				 unsigned sid);
 +
-+#endif
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/login.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/login.c
++#define MATCH_ANY_SID 0
+ 
+ extern char *strstrip(char *s);
+ extern char *cfg_get_string_param(char *pathname, const char *key);
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/log.c open-iscsi-2.0-872-rc4-bnx2i.sync/usr/log.c
+--- open-iscsi-2.0-872-rc4-bnx2i/usr/log.c	2010-07-11 04:05:58.000000000 -0500
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/log.c	2011-08-14 16:48:25.000000000 -0500
+@@ -326,6 +326,7 @@ void log_info(const char *fmt, ...)
+ 	va_end(ap);
+ }
+ 
++#if 0 /* Unused */
+ static void __dump_line(int level, unsigned char *buf, int *cp)
+ {
+ 	char line[16*3+5], *lp = line;
+@@ -359,6 +360,7 @@ static void __dump_char(int level, unsig
+ 
+ #define dump_line() __dump_line(level, char_buf, &char_cnt)
+ #define dump_char(ch) __dump_char(level, char_buf, &char_cnt, ch)
++#endif /* Unused */
+ 
+ static void log_flush(void)
+ {
+@@ -474,6 +476,8 @@ void log_close(pid_t pid)
+ 		return;
+ 	}
+ 
+-	kill(pid, SIGTERM);
+-	waitpid(pid, &status, 0);
++	if (pid > 0) {
++		kill(pid, SIGTERM);
++		waitpid(pid, &status, 0);
++	}
+ }
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/login.c open-iscsi-2.0-872-rc4-bnx2i.sync/usr/login.c
 --- open-iscsi-2.0-872-rc4-bnx2i/usr/login.c	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/login.c	2011-02-24 19:54:10.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/login.c	2011-08-14 16:48:25.000000000 -0500
 @@ -27,11 +27,14 @@
  #include <stdio.h>
  #include <stdlib.h>
@@ -7911,10 +13849,23 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/login.c open-iscsi-2.0-872-rc4-bnx2
  	} while (conn->current_stage != ISCSI_FULL_FEATURE_PHASE);
  
  	c->ret = LOGIN_OK;
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/Makefile open-iscsi-2.0-872-rc4-bnx2i.work/usr/Makefile
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/Makefile open-iscsi-2.0-872-rc4-bnx2i.sync/usr/Makefile
 --- open-iscsi-2.0-872-rc4-bnx2i/usr/Makefile	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/Makefile	2011-02-24 19:54:10.000000000 -0600
-@@ -37,12 +37,13 @@ PROGRAMS = iscsid iscsiadm iscsistart
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/Makefile	2011-08-14 16:48:25.000000000 -0500
+@@ -21,10 +21,12 @@ ifeq ($(OSNAME),Linux)
+ 	endif
+ 	endif
+ IPC_OBJ=netlink.o
++DCB_OBJ=dcb_app.o
+ else
+ ifeq ($(OSNAME),FreeBSD)
+ IPC_CFLAGS=
+ IPC_OBJ=ioctl.o
++DCB_OBJ=
+ endif
+ endif
+ 
+@@ -37,12 +39,13 @@ PROGRAMS = iscsid iscsiadm iscsistart
  # libc compat files
  SYSDEPS_SRCS = $(wildcard ../utils/sysdeps/*.o)
  # sources shared between iscsid, iscsiadm and iscsistart
@@ -7924,7 +13875,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/Makefile open-iscsi-2.0-872-rc4-bnx
 +ISCSI_LIB_SRCS = iscsi_util.o io.o auth.o iscsi_timer.o login.o log.o md5.o \
 +	sha1.o iface.o idbm.o sysfs.o host.o session_info.o iscsi_sysfs.o \
 +	iscsi_net_util.o iscsid_req.o transport.o cxgbi.o be2iscsi.o \
-+	initiator_common.o iscsi_err.o $(IPC_OBJ)  $(SYSDEPS_SRCS)
++	initiator_common.o iscsi_err.o $(IPC_OBJ)  $(SYSDEPS_SRCS) $(DCB_OBJ)
  # core initiator files
 -INITIATOR_SRCS = initiator.o scsi.o actor.o event_poll.o mgmt_ipc.o \
 -		transport.o cxgb3i.o be2iscsi.o
@@ -7933,26 +13884,28 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/Makefile open-iscsi-2.0-872-rc4-bnx
  # fw boot files
  FW_BOOT_SRCS = $(wildcard ../utils/fwparam_ibft/*.o)
  
-@@ -51,14 +52,14 @@ DISCOVERY_SRCS = $(FW_BOOT_SRCS) strings
+@@ -51,14 +54,14 @@ DISCOVERY_SRCS = $(FW_BOOT_SRCS) strings
  
  all: $(PROGRAMS)
  
 -iscsid: $(ISCSI_LIB_SRCS) $(IPC_OBJ) $(INITIATOR_SRCS) $(DISCOVERY_SRCS) \
 +iscsid: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(DISCOVERY_SRCS) \
  	iscsid.o session_mgmt.o discoveryd.o
- 	$(CC) $(CFLAGS) $^ -o $@ -L../utils/open-isns -lisns -lcrypto
+-	$(CC) $(CFLAGS) $^ -o $@ -L../utils/open-isns -lisns -lcrypto
++	$(CC) $(CFLAGS) $^ -o $@ -L../utils/open-isns -lisns
  
  iscsiadm: $(ISCSI_LIB_SRCS) $(DISCOVERY_SRCS) iscsiadm.o session_mgmt.o
- 	$(CC) $(CFLAGS) $^ -o $@ -L../utils/open-isns -lisns -lcrypto
+-	$(CC) $(CFLAGS) $^ -o $@ -L../utils/open-isns -lisns -lcrypto
++	$(CC) $(CFLAGS) $^ -o $@ -L../utils/open-isns -lisns
  
 -iscsistart: $(IPC_OBJ) $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(FW_BOOT_SRCS) \
 +iscsistart: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(FW_BOOT_SRCS) \
  		iscsistart.o statics.o
  	$(CC) $(CFLAGS) -static $^ -o $@
  clean:
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/mgmt_ipc.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/mgmt_ipc.c
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/mgmt_ipc.c open-iscsi-2.0-872-rc4-bnx2i.sync/usr/mgmt_ipc.c
 --- open-iscsi-2.0-872-rc4-bnx2i/usr/mgmt_ipc.c	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/mgmt_ipc.c	2011-02-24 19:54:10.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/mgmt_ipc.c	2011-08-14 16:48:25.000000000 -0500
 @@ -35,6 +35,7 @@
  #include "transport.h"
  #include "sysdeps.h"
@@ -8219,7 +14172,17 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/mgmt_ipc.c open-iscsi-2.0-872-rc4-b
  {
  	if (!qtask)
  		return;
-@@ -510,7 +499,6 @@ static mgmt_ipc_fn_t *	mgmt_ipc_function
+@@ -446,7 +435,8 @@ mgmt_ipc_write_rsp(queue_task_t *qtask, 
+ 	}
+ 
+ 	qtask->rsp.err = err;
+-	write(qtask->mgmt_ipc_fd, &qtask->rsp, sizeof(qtask->rsp));
++	if (write(qtask->mgmt_ipc_fd, &qtask->rsp, sizeof(qtask->rsp)) < 0)
++		log_error("IPC qtask write failed: %s", strerror(errno));
+ 	close(qtask->mgmt_ipc_fd);
+ 	mgmt_ipc_destroy_queue_task(qtask);
+ }
+@@ -510,7 +500,6 @@ static mgmt_ipc_fn_t *	mgmt_ipc_function
  [MGMT_IPC_CONFIG_IALIAS]	= mgmt_ipc_cfg_initiatoralias,
  [MGMT_IPC_CONFIG_FILE]		= mgmt_ipc_cfg_filename,
  [MGMT_IPC_IMMEDIATE_STOP]	= mgmt_ipc_immediate_stop,
@@ -8227,7 +14190,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/mgmt_ipc.c open-iscsi-2.0-872-rc4-b
  [MGMT_IPC_NOTIFY_ADD_NODE]	= mgmt_ipc_notify_add_node,
  [MGMT_IPC_NOTIFY_DEL_NODE]	= mgmt_ipc_notify_del_node,
  [MGMT_IPC_NOTIFY_ADD_PORTAL]	= mgmt_ipc_notify_add_portal,
-@@ -538,7 +526,7 @@ void mgmt_ipc_handle(int accept_fd)
+@@ -538,7 +527,7 @@ void mgmt_ipc_handle(int accept_fd)
  	qtask->mgmt_ipc_fd = fd;
  
  	if (!mgmt_peeruser(fd, user) || strncmp(user, "root", PEERUSER_MAX)) {
@@ -8236,7 +14199,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/mgmt_ipc.c open-iscsi-2.0-872-rc4-b
  		goto err;
  	}
  
-@@ -556,12 +544,12 @@ void mgmt_ipc_handle(int accept_fd)
+@@ -556,12 +545,12 @@ void mgmt_ipc_handle(int accept_fd)
  		/* If the handler returns OK, this means it
  		 * already sent the reply. */
  		err = handler(qtask);
@@ -8251,9 +14214,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/mgmt_ipc.c open-iscsi-2.0-872-rc4-b
  	}
  
  err:
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/mgmt_ipc.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/mgmt_ipc.h
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/mgmt_ipc.h open-iscsi-2.0-872-rc4-bnx2i.sync/usr/mgmt_ipc.h
 --- open-iscsi-2.0-872-rc4-bnx2i/usr/mgmt_ipc.h	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/mgmt_ipc.h	2011-02-24 19:54:10.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/mgmt_ipc.h	2011-08-14 16:48:25.000000000 -0500
 @@ -26,30 +26,6 @@
  #define ISCSIADM_NAMESPACE	"ISCSIADM_ABSTRACT_NAMESPACE"
  #define PEERUSER_MAX		64
@@ -8323,9 +14286,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/mgmt_ipc.h open-iscsi-2.0-872-rc4-b
  int mgmt_ipc_listen(void);
  void mgmt_ipc_close(int fd);
  void mgmt_ipc_handle(int accept_fd);
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/netlink.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/netlink.c
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/netlink.c open-iscsi-2.0-872-rc4-bnx2i.sync/usr/netlink.c
 --- open-iscsi-2.0-872-rc4-bnx2i/usr/netlink.c	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/netlink.c	2011-02-24 19:54:10.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/netlink.c	2011-08-14 16:48:25.000000000 -0500
 @@ -33,7 +33,6 @@
  
  #include "types.h"
@@ -8334,7 +14297,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/netlink.c open-iscsi-2.0-872-rc4-bn
  #include "log.h"
  #include "iscsi_ipc.h"
  #include "initiator.h"
-@@ -50,6 +49,7 @@ static void *nlm_sendbuf;
+@@ -50,23 +49,25 @@ static void *nlm_sendbuf;
  static void *nlm_recvbuf;
  static void *pdu_sendbuf;
  static void *setparam_buf;
@@ -8342,7 +14305,24 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/netlink.c open-iscsi-2.0-872-rc4-bn
  
  static int ctldev_handle(void);
  
-@@ -66,7 +66,8 @@ static int ctldev_handle(void);
+-#define NLM_BUF_DEFAULT_MAX \
+-	(NLMSG_SPACE(ISCSI_DEF_MAX_RECV_SEG_LEN + \
+-			 sizeof(struct iscsi_hdr)))
++#define NLM_BUF_DEFAULT_MAX (NLMSG_SPACE(ISCSI_DEF_MAX_RECV_SEG_LEN +	\
++					sizeof(struct iscsi_uevent) +	\
++					sizeof(struct iscsi_hdr)))
++
++#define PDU_SENDBUF_DEFAULT_MAX	(ISCSI_DEF_MAX_RECV_SEG_LEN +		\
++					sizeof(struct iscsi_uevent) +	\
++					sizeof(struct iscsi_hdr))
+ 
+-#define PDU_SENDBUF_DEFAULT_MAX \
+-	(ISCSI_DEF_MAX_RECV_SEG_LEN + sizeof(struct iscsi_hdr))
+-
+-#define NLM_SETPARAM_DEFAULT_MAX \
+-	(NI_MAXHOST + 1 + sizeof(struct iscsi_uevent))
++#define NLM_SETPARAM_DEFAULT_MAX (NI_MAXHOST + 1 + sizeof(struct iscsi_uevent))
+ 
  static int
  kread(char *data, int count)
  {
@@ -8352,7 +14332,20 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/netlink.c open-iscsi-2.0-872-rc4-bn
  
  	memcpy(data, recvbuf + recvlen, count);
  	recvlen += count;
-@@ -142,7 +143,8 @@ nlpayload_read(int ctrl_fd, char *data, 
+@@ -107,6 +108,12 @@ nlpayload_read(int ctrl_fd, char *data, 
+ 
+ 	iov.iov_base = nlm_recvbuf;
+ 	iov.iov_len = NLMSG_SPACE(count);
++
++	if (iov.iov_len > NLM_BUF_DEFAULT_MAX) {
++		log_error("Cannot read %lu bytes. nlm_recvbuf too small.",
++			  iov.iov_len);
++		return -1;
++	}
+ 	memset(iov.iov_base, 0, iov.iov_len);
+ 
+ 	memset(&msg, 0, sizeof(msg));
+@@ -142,7 +149,8 @@ nlpayload_read(int ctrl_fd, char *data, 
  	 */
  	rc = recvmsg(ctrl_fd, &msg, flags);
  
@@ -8362,7 +14355,360 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/netlink.c open-iscsi-2.0-872-rc4-bn
  
  	return rc;
  }
-@@ -716,18 +718,34 @@ kstart_conn(uint64_t transport_handle, u
+@@ -153,7 +161,6 @@ kwritev(enum iscsi_uevent_e type, struct
+ 	int i, rc;
+ 	struct nlmsghdr *nlh;
+ 	struct msghdr msg;
+-	struct iovec iov;
+ 	int datalen = 0;
+ 
+ 	log_debug(7, "in %s", __FUNCTION__);
+@@ -172,27 +179,25 @@ kwritev(enum iscsi_uevent_e type, struct
+ 	}
+ 
+ 	nlh = nlm_sendbuf;
+-	memset(nlh, 0, NLMSG_SPACE(datalen));
++	memset(nlh, 0, NLMSG_SPACE(0));
+ 
+-	nlh->nlmsg_len = NLMSG_SPACE(datalen);
++	datalen = 0;
++	for (i = 1; i < count; i++)
++		datalen += iovp[i].iov_len;
++
++	nlh->nlmsg_len = NLMSG_ALIGN(datalen);
+ 	nlh->nlmsg_pid = getpid();
+ 	nlh->nlmsg_flags = 0;
+ 	nlh->nlmsg_type = type;
+ 
+-	datalen = 0;
+-	for (i = 0; i < count; i++) {
+-		memcpy(NLMSG_DATA(nlh) + datalen, iovp[i].iov_base,
+-		       iovp[i].iov_len);
+-		datalen += iovp[i].iov_len;
+-	}
+-	iov.iov_base = (void*)nlh;
+-	iov.iov_len = nlh->nlmsg_len;
++	iovp[0].iov_base = (void *)nlh;
++	iovp[0].iov_len = sizeof(*nlh);
+ 
+ 	memset(&msg, 0, sizeof(msg));
+ 	msg.msg_name= (void*)&dest_addr;
+ 	msg.msg_namelen = sizeof(dest_addr);
+-	msg.msg_iov = &iov;
+-	msg.msg_iovlen = 1;
++	msg.msg_iov = iovp;
++	msg.msg_iovlen = count;
+ 
+ 	do {
+ 		/*
+@@ -253,19 +258,15 @@ kwritev(enum iscsi_uevent_e type, struct
+  *        cleanup. (Dima)
+  */
+ static int
+-__kipc_call(void *iov_base, int iov_len)
++__kipc_call(struct iovec *iovp, int count)
+ {
+ 	int rc, iferr;
+-	struct iovec iov;
+-	struct iscsi_uevent *ev = iov_base;
++	struct iscsi_uevent *ev = iovp[1].iov_base;
+ 	enum iscsi_uevent_e type = ev->type;
+ 
+ 	log_debug(7, "in %s", __FUNCTION__);
+ 
+-	iov.iov_base = iov_base;
+-	iov.iov_len = iov_len;
+-
+-	rc = kwritev(type, &iov, 1);
++	rc = kwritev(type, iovp, count);
+ 
+ 	do {
+ 		if ((rc = nlpayload_read(ctrl_fd, (void*)ev,
+@@ -325,6 +326,7 @@ ksendtargets(uint64_t transport_handle, 
+ {
+ 	int rc, addrlen;
+ 	struct iscsi_uevent *ev;
++	struct iovec iov[2];
+ 
+ 	log_debug(7, "in %s", __FUNCTION__);
+ 
+@@ -346,7 +348,9 @@ ksendtargets(uint64_t transport_handle, 
+ 	}
+ 	memcpy(setparam_buf + sizeof(*ev), addr, addrlen);
+ 
+-	rc = __kipc_call(ev, sizeof(*ev) + addrlen);
++	iov[1].iov_base = ev;
++	iov[1].iov_len = sizeof(*ev) + addrlen;
++	rc = __kipc_call(iov, 2);
+ 	if (rc < 0) {
+ 		log_error("sendtargets failed rc%d\n", rc);
+ 		return rc;
+@@ -361,6 +365,7 @@ kcreate_session(uint64_t transport_handl
+ {
+ 	int rc;
+ 	struct iscsi_uevent ev;
++	struct iovec iov[2];
+ 
+ 	log_debug(7, "in %s", __FUNCTION__);
+ 
+@@ -381,9 +386,11 @@ kcreate_session(uint64_t transport_handl
+ 		ev.u.c_bound_session.ep_handle = ep_handle;
+ 	}
+ 
+-	if ((rc = __kipc_call(&ev, sizeof(ev))) < 0) {
++	iov[1].iov_base = &ev;
++	iov[1].iov_len = sizeof(ev);
++	rc = __kipc_call(iov, 2);
++	if (rc < 0)
+ 		return rc;
+-	}
+ 
+ 	*hostno = ev.r.c_session_ret.host_no;
+ 	*out_sid = ev.r.c_session_ret.sid;
+@@ -396,6 +403,7 @@ kdestroy_session(uint64_t transport_hand
+ {
+ 	int rc;
+ 	struct iscsi_uevent ev;
++	struct iovec iov[2];
+ 
+ 	log_debug(7, "in %s", __FUNCTION__);
+ 
+@@ -405,9 +413,11 @@ kdestroy_session(uint64_t transport_hand
+ 	ev.transport_handle = transport_handle;
+ 	ev.u.d_session.sid = sid;
+ 
+-	if ((rc = __kipc_call(&ev, sizeof(ev))) < 0) {
++	iov[1].iov_base = &ev;
++	iov[1].iov_len = sizeof(ev);
++	rc = __kipc_call(iov, 2);
++	if (rc < 0)
+ 		return rc;
+-	}
+ 
+ 	return 0;
+ }
+@@ -417,6 +427,7 @@ kunbind_session(uint64_t transport_handl
+ {
+ 	int rc;
+ 	struct iscsi_uevent ev;
++	struct iovec iov[2];
+ 
+ 	log_debug(7, "in %s", __FUNCTION__);
+ 
+@@ -426,9 +437,11 @@ kunbind_session(uint64_t transport_handl
+ 	ev.transport_handle = transport_handle;
+ 	ev.u.d_session.sid = sid;
+ 
+-	if ((rc = __kipc_call(&ev, sizeof(ev))) < 0) {
++	iov[1].iov_base = &ev;
++	iov[1].iov_len = sizeof(ev);
++	rc = __kipc_call(iov, 2);
++	if (rc < 0)
+ 		return rc;
+-	}
+ 
+ 	return 0;
+ }
+@@ -439,6 +452,7 @@ kcreate_conn(uint64_t transport_handle, 
+ {
+ 	int rc;
+ 	struct iscsi_uevent ev;
++	struct iovec iov[2];
+ 
+ 	log_debug(7, "in %s", __FUNCTION__);
+ 
+@@ -449,7 +463,10 @@ kcreate_conn(uint64_t transport_handle, 
+ 	ev.u.c_conn.cid = cid;
+ 	ev.u.c_conn.sid = sid;
+ 
+-	if ((rc = __kipc_call(&ev, sizeof(ev))) < 0) {
++	iov[1].iov_base = &ev;
++	iov[1].iov_len = sizeof(ev);
++	rc = __kipc_call(iov, 2);
++	if (rc < 0) {
+ 		log_debug(7, "returned %d", rc);
+ 		return rc;
+ 	}
+@@ -466,6 +483,7 @@ kdestroy_conn(uint64_t transport_handle,
+ {
+ 	int rc;
+ 	struct iscsi_uevent ev;
++	struct iovec iov[2];
+ 
+ 	log_debug(7, "in %s", __FUNCTION__);
+ 
+@@ -476,9 +494,11 @@ kdestroy_conn(uint64_t transport_handle,
+ 	ev.u.d_conn.sid = sid;
+ 	ev.u.d_conn.cid = cid;
+ 
+-	if ((rc = __kipc_call(&ev, sizeof(ev))) < 0) {
++	iov[1].iov_base = &ev;
++	iov[1].iov_len = sizeof(ev);
++	rc = __kipc_call(iov, 2);
++	if (rc < 0)
+ 		return rc;
+-	}
+ 
+ 	return 0;
+ }
+@@ -489,6 +509,7 @@ kbind_conn(uint64_t transport_handle, ui
+ {
+ 	int rc;
+ 	struct iscsi_uevent ev;
++	struct iovec iov[2];
+ 
+ 	log_debug(7, "in %s", __FUNCTION__);
+ 
+@@ -501,9 +522,11 @@ kbind_conn(uint64_t transport_handle, ui
+ 	ev.u.b_conn.transport_eph = transport_eph;
+ 	ev.u.b_conn.is_leading = is_leading;
+ 
+-	if ((rc = __kipc_call(&ev, sizeof(ev))) < 0) {
++	iov[1].iov_base = &ev;
++	iov[1].iov_len = sizeof(ev);
++	rc = __kipc_call(iov, 2);
++	if (rc < 0)
+ 		return rc;
+-	}
+ 
+ 	*retcode = ev.r.retcode;
+ 
+@@ -515,6 +538,7 @@ ksend_pdu_begin(uint64_t transport_handl
+ 			int hdr_size, int data_size)
+ {
+ 	struct iscsi_uevent *ev;
++	int total_xmitlen = sizeof(*ev) + hdr_size + data_size;
+ 
+ 	log_debug(7, "in %s", __FUNCTION__);
+ 
+@@ -523,8 +547,13 @@ ksend_pdu_begin(uint64_t transport_handl
+ 		exit(-EIO);
+ 	}
+ 
++	if (total_xmitlen > PDU_SENDBUF_DEFAULT_MAX) {
++		log_error("BUG: Cannot send %d bytes.", total_xmitlen);
++		exit(-EINVAL);
++	}
++
+ 	xmitbuf = pdu_sendbuf;
+-	memset(xmitbuf, 0, sizeof(*ev) + hdr_size + data_size);
++	memset(xmitbuf, 0, total_xmitlen);
+ 	xmitlen = sizeof(*ev);
+ 	ev = xmitbuf;
+ 	memset(ev, 0, sizeof(*ev));
+@@ -545,7 +574,7 @@ ksend_pdu_end(uint64_t transport_handle,
+ {
+ 	int rc;
+ 	struct iscsi_uevent *ev;
+-	struct iovec iov;
++	struct iovec iov[2];
+ 
+ 	log_debug(7, "in %s", __FUNCTION__);
+ 
+@@ -559,10 +588,11 @@ ksend_pdu_end(uint64_t transport_handle,
+ 		exit(-EIO);
+ 	}
+ 
+-	iov.iov_base = xmitbuf;
+-	iov.iov_len = xmitlen;
++	iov[1].iov_base = xmitbuf;
++	iov[1].iov_len = xmitlen;
+ 
+-	if ((rc = __kipc_call(xmitbuf, xmitlen)) < 0)
++	rc = __kipc_call(iov, 2);
++	if (rc < 0)
+ 		goto err;
+ 	if (ev->r.retcode) {
+ 		*retcode = ev->r.retcode;
+@@ -592,6 +622,7 @@ kset_host_param(uint64_t transport_handl
+ 	struct iscsi_uevent *ev;
+ 	char *param_str;
+ 	int rc, len;
++	struct iovec iov[2];
+ 
+ 	log_debug(7, "in %s", __FUNCTION__);
+ 
+@@ -618,9 +649,11 @@ kset_host_param(uint64_t transport_handl
+ 	}
+ 	ev->u.set_host_param.len = len = strlen(param_str) + 1;
+ 
+-	if ((rc = __kipc_call(ev, sizeof(*ev) + len)) < 0) {
++	iov[1].iov_base = ev;
++	iov[1].iov_len = sizeof(*ev) + len;
++	rc = __kipc_call(iov, 2);
++	if (rc < 0)
+ 		return rc;
+-	}
+ 
+ 	return 0;
+ }
+@@ -632,6 +665,7 @@ kset_param(uint64_t transport_handle, ui
+ 	struct iscsi_uevent *ev;
+ 	char *param_str;
+ 	int rc, len;
++	struct iovec iov[2];
+ 
+ 	log_debug(7, "in %s", __FUNCTION__);
+ 
+@@ -659,9 +693,11 @@ kset_param(uint64_t transport_handle, ui
+ 	}
+ 	ev->u.set_param.len = len = strlen(param_str) + 1;
+ 
+-	if ((rc = __kipc_call(ev, sizeof(*ev) + len)) < 0) {
++	iov[1].iov_base = ev;
++	iov[1].iov_len = sizeof(*ev) + len;
++	rc = __kipc_call(iov, 2);
++	if (rc < 0)
+ 		return rc;
+-	}
+ 
+ 	return 0;
+ }
+@@ -671,6 +707,7 @@ kstop_conn(uint64_t transport_handle, ui
+ {
+ 	int rc;
+ 	struct iscsi_uevent ev;
++	struct iovec iov[2];
+ 
+ 	log_debug(7, "in %s", __FUNCTION__);
+ 
+@@ -682,9 +719,11 @@ kstop_conn(uint64_t transport_handle, ui
+ 	ev.u.stop_conn.cid = cid;
+ 	ev.u.stop_conn.flag = flag;
+ 
+-	if ((rc = __kipc_call(&ev, sizeof(ev))) < 0) {
++	iov[1].iov_base = &ev;
++	iov[1].iov_len = sizeof(ev);
++	rc = __kipc_call(iov, 2);
++	if (rc < 0)
+ 		return rc;
+-	}
+ 
+ 	return 0;
+ }
+@@ -695,6 +734,7 @@ kstart_conn(uint64_t transport_handle, u
+ {
+ 	int rc;
+ 	struct iscsi_uevent ev;
++	struct iovec iov[2];
+ 
+ 	log_debug(7, "in %s", __FUNCTION__);
+ 
+@@ -705,9 +745,11 @@ kstart_conn(uint64_t transport_handle, u
+ 	ev.u.start_conn.sid = sid;
+ 	ev.u.start_conn.cid = cid;
+ 
+-	if ((rc = __kipc_call(&ev, sizeof(ev))) < 0) {
++	iov[1].iov_base = &ev;
++	iov[1].iov_len = sizeof(ev);
++	rc = __kipc_call(iov, 2);
++	if (rc < 0)
+ 		return rc;
+-	}
+ 
+ 	*retcode = ev.r.retcode;
+ 	return 0;
+@@ -716,18 +758,34 @@ kstart_conn(uint64_t transport_handle, u
  static int
  krecv_pdu_begin(struct iscsi_conn *conn)
  {
@@ -8400,16 +14746,151 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/netlink.c open-iscsi-2.0-872-rc4-bn
  	return 0;
  }
  
-@@ -744,7 +762,7 @@ krecv_pdu_end(struct iscsi_conn *conn)
- 	log_debug(3, "recv PDU finished for pdu handle 0x%p",
- 		  recvbuf);
- 
--	iscsi_conn_context_put(conn->recv_context);
+@@ -744,7 +802,7 @@ krecv_pdu_end(struct iscsi_conn *conn)
+ 	log_debug(3, "recv PDU finished for pdu handle 0x%p",
+ 		  recvbuf);
+ 
+-	iscsi_conn_context_put(conn->recv_context);
++	ipc_ev_clbk->put_ev_context(conn->recv_context);
+ 	conn->recv_context = NULL;
+ 	recvbuf = NULL;
+ 	return 0;
+@@ -756,6 +814,7 @@ ktransport_ep_connect(iscsi_conn_t *conn
+ 	int rc, addrlen;
+ 	struct iscsi_uevent *ev;
+ 	struct sockaddr *dst_addr = (struct sockaddr *)&conn->saddr;
++	struct iovec iov[2];
+ 
+ 	log_debug(7, "in %s", __FUNCTION__);
+ 
+@@ -783,7 +842,10 @@ ktransport_ep_connect(iscsi_conn_t *conn
+ 	}
+ 	memcpy(setparam_buf + sizeof(*ev), dst_addr, addrlen);
+ 
+-	if ((rc = __kipc_call(ev, sizeof(*ev) + addrlen)) < 0)
++	iov[1].iov_base = ev;
++	iov[1].iov_len = sizeof(*ev) + addrlen;
++	rc = __kipc_call(iov, 2);
++	if (rc < 0)
+ 		return rc;
+ 
+ 	if (!ev->r.ep_connect_ret.handle)
+@@ -801,6 +863,7 @@ ktransport_ep_poll(iscsi_conn_t *conn, i
+ {
+ 	int rc;
+ 	struct iscsi_uevent ev;
++	struct iovec iov[2];
+ 
+ 	log_debug(7, "in %s", __FUNCTION__);
+ 
+@@ -811,7 +874,10 @@ ktransport_ep_poll(iscsi_conn_t *conn, i
+ 	ev.u.ep_poll.ep_handle  = conn->transport_ep_handle;
+ 	ev.u.ep_poll.timeout_ms = timeout_ms;
+ 
+-	if ((rc = __kipc_call(&ev, sizeof(ev))) < 0)
++	iov[1].iov_base = &ev;
++	iov[1].iov_len = sizeof(ev);
++	rc = __kipc_call(iov, 2);
++	if (rc < 0)
+ 		return rc;
+ 
+ 	return ev.r.retcode;
+@@ -822,6 +888,7 @@ ktransport_ep_disconnect(iscsi_conn_t *c
+ {
+ 	int rc;
+ 	struct iscsi_uevent ev;
++	struct iovec iov[2];
+ 
+ 	log_debug(7, "in %s", __FUNCTION__);
+ 
+@@ -834,7 +901,10 @@ ktransport_ep_disconnect(iscsi_conn_t *c
+ 	ev.transport_handle = conn->session->t->handle;
+ 	ev.u.ep_disconnect.ep_handle = conn->transport_ep_handle;
+ 
+-	if ((rc = __kipc_call(&ev, sizeof(ev))) < 0) {
++	iov[1].iov_base = &ev;
++	iov[1].iov_len = sizeof(ev);
++	rc = __kipc_call(iov, 2);
++	if (rc < 0) {
+ 		log_error("connnection %d:%d transport disconnect failed for "
+ 			  "ep %" PRIu64 " with error %d.", conn->session->id,
+ 			  conn->id, conn->transport_ep_handle, rc);
+@@ -851,6 +921,7 @@ kget_stats(uint64_t transport_handle, ui
+ 	struct iscsi_uevent ev;
+ 	char nlm_ev[NLMSG_SPACE(sizeof(struct iscsi_uevent))];
+ 	struct nlmsghdr *nlh;
++	struct iovec iov[2];
+ 
+ 	log_debug(7, "in %s", __FUNCTION__);
+ 
+@@ -861,9 +932,11 @@ kget_stats(uint64_t transport_handle, ui
+ 	ev.u.get_stats.sid = sid;
+ 	ev.u.get_stats.cid = cid;
+ 
+-	if ((rc = __kipc_call(&ev, sizeof(ev))) < 0) {
++	iov[1].iov_base = &ev;
++	iov[1].iov_len = sizeof(ev);
++	rc = __kipc_call(iov, 2);
++	if (rc < 0)
+ 		return rc;
+-	}
+ 
+ 	if ((rc = nl_read(ctrl_fd, nlm_ev,
+ 		NLMSG_SPACE(sizeof(struct iscsi_uevent)), MSG_PEEK)) < 0) {
+@@ -889,12 +962,60 @@ kget_stats(uint64_t transport_handle, ui
+ 	return 0;
+ }
+ 
++static int
++kset_net_config(uint64_t transport_handle, uint32_t host_no,
++		struct iovec *iovs, uint32_t param_count)
++{
++	struct iscsi_uevent ev;
++	int rc, ev_len;
++	struct iovec *iov = iovs + 1;
++
++	log_debug(8, "in %s", __FUNCTION__);
++
++	ev_len = sizeof(ev);
++	ev.type = ISCSI_UEVENT_SET_IFACE_PARAMS;
++	ev.transport_handle = transport_handle;
++	ev.u.set_iface_params.host_no = host_no;
++	/* first two iovs for nlmsg hdr and ev */
++	ev.u.set_iface_params.count = param_count - 2;
++
++	iov->iov_base = &ev;
++	iov->iov_len = ev_len;
++	rc = __kipc_call(iovs, param_count);
++	if (rc < 0)
++		return rc;
++
++	return 0;
++}
++
++static int krecv_conn_state(struct iscsi_conn *conn, int *state)
++{
++	int rc;
++
++	rc = ipc->ctldev_handle();
++	if (rc == -ENXIO) {
++		/* event for some other conn */
++		rc = -EAGAIN;
++		goto exit;
++	} else if (rc < 0)
++		/* fatal handling error or conn error */
++		goto exit;
++
++	*state = *(enum iscsi_conn_state *)conn->recv_context->data;
++
 +	ipc_ev_clbk->put_ev_context(conn->recv_context);
- 	conn->recv_context = NULL;
- 	recvbuf = NULL;
- 	return 0;
-@@ -894,7 +912,7 @@ static void drop_data(struct nlmsghdr *n
++	conn->recv_context = NULL;
++
++exit:
++	return rc;
++}
++
+ static void drop_data(struct nlmsghdr *nlh)
+ {
  	int ev_size;
  
  	ev_size = nlh->nlmsg_len - NLMSG_ALIGN(sizeof(struct nlmsghdr));
@@ -8418,16 +14899,18 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/netlink.c open-iscsi-2.0-872-rc4-bn
  }
  
  static int ctldev_handle(void)
-@@ -905,7 +923,7 @@ static int ctldev_handle(void)
+@@ -905,8 +1026,8 @@ static int ctldev_handle(void)
  	iscsi_conn_t *conn = NULL;
  	char nlm_ev[NLMSG_SPACE(sizeof(struct iscsi_uevent))];
  	struct nlmsghdr *nlh;
 -	struct iscsi_conn_context *conn_context;
+-	uint32_t sid = 0, cid = 0;
 +	struct iscsi_ev_context *ev_context;
- 	uint32_t sid = 0, cid = 0;
++	uint32_t sid = 0, cid = 0, state = 0;
  
  	log_debug(7, "in %s", __FUNCTION__);
-@@ -925,13 +943,15 @@ static int ctldev_handle(void)
+ 
+@@ -925,13 +1046,15 @@ static int ctldev_handle(void)
  	/* old kernels sent ISCSI_UEVENT_CREATE_SESSION on creation */
  	case ISCSI_UEVENT_CREATE_SESSION:
  		drop_data(nlh);
@@ -8447,7 +14930,18 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/netlink.c open-iscsi-2.0-872-rc4-bn
  		return 0;
  	case ISCSI_KEVENT_RECV_PDU:
  		sid = ev->r.recv_req.sid;
-@@ -947,16 +967,30 @@ static int ctldev_handle(void)
+@@ -941,22 +1064,41 @@ static int ctldev_handle(void)
+ 		sid = ev->r.connerror.sid;
+ 		cid = ev->r.connerror.cid;
+ 		break;
++	case ISCSI_KEVENT_CONN_LOGIN_STATE:
++		sid = ev->r.conn_login.sid;
++		cid = ev->r.conn_login.cid;
++		state = ev->r.conn_login.state;
++		break;
+ 	case ISCSI_KEVENT_UNBIND_SESSION:
+ 		sid = ev->r.unbind_session.sid;
+ 		/* session wide event so cid is 0 */
  		cid = 0;
  		break;
  	default:
@@ -8482,7 +14976,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/netlink.c open-iscsi-2.0-872-rc4-bn
  			   "event.\n", sid, cid);
  		drop_data(nlh);
  		return -ENXIO;
-@@ -964,19 +998,20 @@ static int ctldev_handle(void)
+@@ -964,19 +1106,20 @@ static int ctldev_handle(void)
  	conn = &session->conn[0];
  
  	ev_size = nlh->nlmsg_len - NLMSG_ALIGN(sizeof(struct nlmsghdr));
@@ -8508,7 +15002,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/netlink.c open-iscsi-2.0-872-rc4-bn
  		log_error("can not read from NL socket, error %d", rc);
  		/* retry later */
  		return rc;
-@@ -988,26 +1023,28 @@ static int ctldev_handle(void)
+@@ -988,26 +1131,34 @@ static int ctldev_handle(void)
  	 */
  	switch (ev->type) {
  	case ISCSI_KEVENT_RECV_PDU:
@@ -8525,6 +15019,12 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/netlink.c open-iscsi-2.0-872-rc4-bn
 -					 EV_CONN_ERROR);
 +		rc = ipc_ev_clbk->sched_ev_context(ev_context, conn, 0,
 +						   EV_CONN_ERROR);
++		break;
++	case ISCSI_KEVENT_CONN_LOGIN_STATE:
++		memcpy(ev_context->data, &ev->r.conn_login.state,
++			sizeof(ev->r.conn_login.state));
++		rc = ipc_ev_clbk->sched_ev_context(ev_context, conn, 0,
++						   EV_CONN_LOGIN);
  		break;
  	case ISCSI_KEVENT_UNBIND_SESSION:
 -		iscsi_sched_conn_context(conn_context, conn, 0,
@@ -8546,8 +15046,12 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/netlink.c open-iscsi-2.0-872-rc4-bn
  }
  
  static int
-@@ -1116,3 +1153,8 @@ struct iscsi_ipc nl_ipc = {
+@@ -1114,5 +1265,12 @@ struct iscsi_ipc nl_ipc = {
+ 	.read			= kread,
+ 	.recv_pdu_begin         = krecv_pdu_begin,
  	.recv_pdu_end           = krecv_pdu_end,
++	.set_net_config         = kset_net_config,
++	.recv_conn_state        = krecv_conn_state,
  };
  struct iscsi_ipc *ipc = &nl_ipc;
 +
@@ -8555,9 +15059,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/netlink.c open-iscsi-2.0-872-rc4-bn
 +{
 +	ipc_ev_clbk = ev_clbk;
 +}
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/session_info.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/session_info.c
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/session_info.c open-iscsi-2.0-872-rc4-bnx2i.sync/usr/session_info.c
 --- open-iscsi-2.0-872-rc4-bnx2i/usr/session_info.c	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/session_info.c	2011-02-24 19:54:10.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/session_info.c	2011-08-14 16:48:25.000000000 -0500
 @@ -13,6 +13,7 @@
  #include "initiator.h"
  #include "iface.h"
@@ -8575,7 +15079,133 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/session_info.c open-iscsi-2.0-872-r
  	memcpy(new, info, sizeof(*new));
  	INIT_LIST_HEAD(&new->list);
  
-@@ -346,13 +347,15 @@ int session_info_print(int info_level, s
+@@ -113,7 +114,7 @@ static int print_iscsi_state(int sid, ch
+ 	 * anything here since it does not know about it.
+ 	 */
+ 	if (!err && rsp.u.session_state.conn_state >= 0 &&
+-	    rsp.u.session_state.conn_state <= STATE_CLEANUP_WAIT)
++	    rsp.u.session_state.conn_state <= ISCSI_CONN_STATE_CLEANUP_WAIT)
+ 		state = conn_state[rsp.u.session_state.conn_state];
+ 	printf("%s\t\tiSCSI Connection State: %s\n", prefix,
+ 	       state ? state : "Unknown");
+@@ -223,7 +224,7 @@ static int print_scsi_state(int sid, cha
+ }
+ 
+ void session_info_print_tree(struct list_head *list, char *prefix,
+-			     unsigned int flags)
++			     unsigned int flags, int do_show)
+ {
+ 	struct session_info *curr, *prev = NULL;
+ 
+@@ -277,6 +278,70 @@ void session_info_print_tree(struct list
+ 			printf("%s\t\tSID: %d\n", prefix, curr->sid);
+ 			print_iscsi_state(curr->sid, prefix);
+ 		}
++		if (flags & SESSION_INFO_ISCSI_TIM) {
++			printf("%s\t\t*********\n", prefix);
++			printf("%s\t\tTimeouts:\n", prefix);
++			printf("%s\t\t*********\n", prefix);
++
++			printf("%s\t\tRecovery Timeout: %d\n", prefix,
++			      ((curr->tmo).recovery_tmo));
++
++			if ((curr->tmo).tgt_reset_tmo >= 0)
++				printf("%s\t\tTarget Reset Timeout: %d\n",
++					prefix,
++					((curr->tmo).tgt_reset_tmo));
++			else
++				printf("%s\t\tTarget Reset Timeout: %s\n",
++					prefix, UNKNOWN_VALUE);
++
++			if ((curr->tmo).lu_reset_tmo >= 0)
++				printf("%s\t\tLUN Reset Timeout: %d\n", prefix,
++					((curr->tmo).lu_reset_tmo));
++			else
++				printf("%s\t\tLUN Reset Timeout: %s\n", prefix,
++					UNKNOWN_VALUE);
++
++			if ((curr->tmo).lu_reset_tmo >= 0)
++				printf("%s\t\tAbort Timeout: %d\n", prefix,
++					((curr->tmo).abort_tmo));
++			else
++				printf("%s\t\tAbort Timeout: %s\n", prefix,
++					UNKNOWN_VALUE);
++
++		}
++		if (flags & SESSION_INFO_ISCSI_AUTH) {
++			printf("%s\t\t*****\n", prefix);
++			printf("%s\t\tCHAP:\n", prefix);
++			printf("%s\t\t*****\n", prefix);
++			if (!do_show) {
++				strcpy(curr->chap.password, "********");
++				strcpy(curr->chap.password_in, "********");
++			}
++			if (strlen((curr->chap).username))
++				printf("%s\t\tusername: %s\n", prefix,
++					(curr->chap).username);
++			else
++				printf("%s\t\tusername: %s\n", prefix,
++					UNKNOWN_VALUE);
++			if (strlen((curr->chap).password))
++				printf("%s\t\tpassword: %s\n", prefix,
++					(curr->chap).password);
++			else
++				printf("%s\t\tpassword: %s\n", prefix,
++					UNKNOWN_VALUE);
++			if (strlen((curr->chap).username_in))
++				printf("%s\t\tusername_in: %s\n", prefix,
++					(curr->chap).username_in);
++			else
++				printf("%s\t\tusername_in: %s\n", prefix,
++					UNKNOWN_VALUE);
++			if (strlen((curr->chap).password_in))
++				printf("%s\t\tpassword_in: %s\n", prefix,
++					(curr->chap).password_in);
++			else
++				printf("%s\t\tpassword_in: %s\n", prefix,
++					UNKNOWN_VALUE);
++		}
+ 
+ 		if (flags & SESSION_INFO_ISCSI_PARAMS)
+ 			print_iscsi_params(curr->sid, prefix);
+@@ -288,7 +353,7 @@ void session_info_print_tree(struct list
+ 	}
+ }
+ 
+-int session_info_print(int info_level, struct session_info *info)
++int session_info_print(int info_level, struct session_info *info, int do_show)
+ {
+ 	struct list_head list;
+ 	int num_found = 0, err = 0;
+@@ -316,17 +381,18 @@ int session_info_print(int info_level, s
+ 		flags |= (SESSION_INFO_SCSI_DEVS | SESSION_INFO_HOST_DEVS);
+ 		/* fall through */
+ 	case 2:
+-		flags |= SESSION_INFO_ISCSI_PARAMS;
++		flags |= (SESSION_INFO_ISCSI_PARAMS | SESSION_INFO_ISCSI_TIM
++				| SESSION_INFO_ISCSI_AUTH);
+ 		/* fall through */
+ 	case 1:
+ 		INIT_LIST_HEAD(&list);
+ 		struct session_link_info link_info;
+ 
+-		flags |= (SESSION_INFO_ISCSI_STATE |SESSION_INFO_IFACE);
++		flags |= (SESSION_INFO_ISCSI_STATE | SESSION_INFO_IFACE);
+ 		if (info) {
+ 			INIT_LIST_HEAD(&info->list);
+ 			list_add_tail(&list, &info->list);
+-			session_info_print_tree(&list, "", flags);
++			session_info_print_tree(&list, "", flags, do_show);
+ 			num_found = 1;
+ 			break;
+ 		}
+@@ -341,18 +407,20 @@ int session_info_print(int info_level, s
+ 		if (err || !num_found)
+ 			break;
+ 
+-		session_info_print_tree(&list, "", flags);
++		session_info_print_tree(&list, "", flags, do_show);
+ 		session_info_free_list(&list);
  		break;
  	default:
  		log_error("Invalid info level %d. Try 0 - 3.", info_level);
@@ -8593,9 +15223,68 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/session_info.c open-iscsi-2.0-872-r
 +	}
  	return 0;
  }
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/session_mgmt.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/session_mgmt.c
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/session_info.h open-iscsi-2.0-872-rc4-bnx2i.sync/usr/session_info.h
+--- open-iscsi-2.0-872-rc4-bnx2i/usr/session_info.h	2010-07-11 04:05:58.000000000 -0500
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/session_info.h	2011-08-14 16:48:25.000000000 -0500
+@@ -9,12 +9,29 @@
+ 
+ struct list;
+ 
++struct session_timeout {
++	int abort_tmo;
++	int lu_reset_tmo;
++	int recovery_tmo;
++	int tgt_reset_tmo;
++};
++
++struct session_CHAP {
++	char username[AUTH_STR_MAX_LEN];
++	char password[AUTH_STR_MAX_LEN];
++	char username_in[AUTH_STR_MAX_LEN];
++	char password_in[AUTH_STR_MAX_LEN];
++};
++
+ struct session_info {
+ 	struct list_head list;
+ 	/* local info */
+ 	struct iface_rec iface;
+ 	int sid;
+ 
++	struct session_timeout tmo;
++	struct session_CHAP chap;
++
+ 	/* remote info */
+ 	char targetname[TARGET_NAME_MAXLEN + 1];
+ 	int tpgt;
+@@ -37,11 +54,14 @@ struct session_link_info {
+ #define SESSION_INFO_ISCSI_STATE	0x4
+ #define SESSION_INFO_SCSI_DEVS		0x8
+ #define SESSION_INFO_HOST_DEVS		0x10
++#define SESSION_INFO_ISCSI_TIM          0x20
++#define SESSION_INFO_ISCSI_AUTH         0x40
+ 
+ extern int session_info_create_list(void *data, struct session_info *info);
+ extern void session_info_free_list(struct list_head *list);
+-extern int session_info_print(int info_level, struct session_info *match_info);
++extern int session_info_print(int info_level, struct session_info *match_info,
++				int do_show);
+ extern void session_info_print_tree(struct list_head *list, char *prefix,
+-				    unsigned int flags);
++				    unsigned int flags, int do_show);
+ 
+ #endif
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/session_mgmt.c open-iscsi-2.0-872-rc4-bnx2i.sync/usr/session_mgmt.c
 --- open-iscsi-2.0-872-rc4-bnx2i/usr/session_mgmt.c	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/session_mgmt.c	2011-02-24 19:54:10.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/session_mgmt.c	2011-08-14 16:48:25.000000000 -0500
+@@ -3,7 +3,7 @@
+  *
+  * Copyright (C) 2010 Mike Christie
+  * Copyright (C) 2010 Red Hat, Inc. All rights reserved.
+-
++ * Copyright (C) 2011 Dell Inc.
+  * maintained by open-iscsi at googlegroups.com
+  *
+  * This program is free software; you can redistribute it and/or modify
 @@ -32,6 +32,7 @@
  #include "iscsi_sysfs.h"
  #include "log.h"
@@ -8622,7 +15311,40 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/session_mgmt.c open-iscsi-2.0-872-r
  		log_login_msg(rec, err);
  		list_del(&curr->list);
  		free(curr);
-@@ -123,11 +126,7 @@ int iscsi_login_portal(void *data, struc
+@@ -90,19 +93,27 @@ static int iscsid_login_reqs_wait(struct
+ }
+ 
+ /**
+- * iscsi_login_portal - request iscsid to login to portal
+- * @data: Unused. Only needed so this can be used in iscsi_login_portals
++ * __iscsi_login_portal - request iscsid to login to portal
++ * @data: If set, copies the session.multiple value to the portal record
++ *        so it is propagated to iscsid.
+  * @list: If async, list to add session to
+  * @rec: portal rec to log into
+  */
+-int iscsi_login_portal(void *data, struct list_head *list, struct node_rec *rec)
++static int
++__iscsi_login_portal(void *data, struct list_head *list, struct node_rec *rec)
+ {
+ 	struct iscsid_async_req *async_req = NULL;
+ 	int rc = 0, fd;
+ 
+-	log_info("Logging in to [iface: %s, target: %s, portal: %s,%d]",
++	if (data && !rec->session.multiple) {
++		struct node_rec *pattern_rec = data;
++		rec->session.multiple = pattern_rec->session.multiple;
++	}
++
++	log_info("Logging in to [iface: %s, target: %s, portal: %s,%d]%s",
+ 		 rec->iface.name, rec->name, rec->conn[0].address,
+-		 rec->conn[0].port);
++		 rec->conn[0].port,
++		 (rec->session.multiple ? " (multiple)" : ""));
+ 
+ 	if (list) {
+ 		async_req = calloc(1, sizeof(*async_req));
+@@ -123,11 +134,7 @@ int iscsi_login_portal(void *data, struc
  		log_login_msg(rec, rc);
  		if (async_req)
  			free(async_req);
@@ -8635,7 +15357,106 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/session_mgmt.c open-iscsi-2.0-872-r
  	}
  
  	if (async_req) {
-@@ -191,7 +190,6 @@ int iscsi_login_portals(void *data, int 
+@@ -141,6 +148,63 @@ int iscsi_login_portal(void *data, struc
+ }
+ 
+ /**
++ * iscsi_login_portal - request iscsid to login to portal multiple
++ * times, based on the session.nr_sessions in the portal record.
++ * @data: If set, session.multiple will cause an additional session to
++ *        be created regardless of the value of session.nr_sessions
++ * @list: If async, list to add session to
++ * @rec: portal rec to log into
++ */
++int iscsi_login_portal(void *data, struct list_head *list, struct node_rec *rec)
++{
++	struct node_rec *pattern_rec = data;
++	int rc = 0, session_count = 0, i;
++
++	/*
++	 * If pattern_rec->session.multiple is set, just add a single new
++	 * session by passing things along to __iscsi_login_portal
++	 */
++	if (pattern_rec && pattern_rec->session.multiple)
++		return __iscsi_login_portal(data, list, rec);
++
++	/*
++	 * Count the current number of sessions, and only create those
++	 * that are missing.
++	 */
++	rc = iscsi_sysfs_for_each_session(rec, &session_count,
++					  iscsi_match_session_count);
++	if (rc) {
++		log_error("Could not count current number of sessions");
++		goto done;
++	}
++	if (session_count >= rec->session.nr_sessions) {
++		log_debug(1, "%s: %d session%s requested, but %d "
++			  "already present.",
++			  rec->iface.name, rec->session.nr_sessions,
++			  rec->session.nr_sessions == 1 ? "" : "s",
++			  session_count);
++		rc = 0;
++		goto done;
++	}
++
++	/*
++	 * Ensure the record's 'multiple' flag is set so __iscsi_login_portal
++	 * will allow multiple logins.
++	 */
++	rec->session.multiple = 1;
++	for (i = session_count; i < rec->session.nr_sessions; ++i) {
++		log_debug(1, "%s: Creating session %d/%d", rec->iface.name,
++			  i + 1, rec->session.nr_sessions);
++		int err = __iscsi_login_portal(pattern_rec, list, rec);
++		if (err && !rc)
++			rc = err;
++	}
++
++done:
++	return rc;
++}
++
++/**
+  * iscsi_login_portal_nowait - request iscsid to login to portal
+  * @rec: portal rec to log into
+  *
+@@ -152,7 +216,6 @@ int iscsi_login_portal_nowait(struct nod
+ 	int err;
+ 
+ 	INIT_LIST_HEAD(&list);
+-
+ 	err = iscsi_login_portal(NULL, &list, rec);
+ 	if (err > 0)
+ 		return err;
+@@ -161,20 +224,22 @@ int iscsi_login_portal_nowait(struct nod
+ }
+ 
+ /**
+- * iscsi_login_portals - login into portals on @rec_list,
++ * __iscsi_login_portals - login into portals on @rec_list,
+  * @data: data to pass to login_fn
+  * @nr_found: returned with number of portals logged into
+  * @wait: bool indicating if the fn should wait for the result
+  * @rec_list: list of portals to log into
++ * @clear_list: If set, delete and free rec_list after iterating through.
+  * @login_fn: list iter function
+  *
+  * This will loop over the list of portals and login. It
+  * will attempt to login asynchronously, and then wait for
+  * them to complete if wait is set.
+  */
+-int iscsi_login_portals(void *data, int *nr_found, int wait,
+-			struct list_head *rec_list,
+-			int (* login_fn)(void *, struct list_head *,
++static
++int __iscsi_login_portals(void *data, int *nr_found, int wait,
++			struct list_head *rec_list, int clear_list,
++			int (*login_fn)(void *, struct list_head *,
+ 					 struct node_rec *))
+ {
+ 	struct node_rec *curr_rec, *tmp;
+@@ -191,7 +256,6 @@ int iscsi_login_portals(void *data, int 
  		if (!err)
  			(*nr_found)++;
  	}
@@ -8643,7 +15464,61 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/session_mgmt.c open-iscsi-2.0-872-r
  	if (wait) {
  		err = iscsid_login_reqs_wait(&login_list);
  		if (err && !ret)
-@@ -213,7 +211,7 @@ static void log_logout_msg(struct sessio
+@@ -199,13 +263,50 @@ int iscsi_login_portals(void *data, int 
+ 	} else
+ 		iscsid_reqs_close(&login_list);
+ 
+-	list_for_each_entry_safe(curr_rec, tmp, rec_list, list) {
+-		list_del(&curr_rec->list);
+-		free(curr_rec);
++	if (clear_list) {
++		list_for_each_entry_safe(curr_rec, tmp, rec_list, list) {
++			list_del(&curr_rec->list);
++			free(curr_rec);
++		}
+ 	}
+ 	return ret;
+ }
+ 
++/**
++ * iscsi_login_portals - login into portals on @rec_list,
++ * @data: data to pass to login_fn
++ * @nr_found: returned with number of portals logged into
++ * @wait: bool indicating if the fn should wait for the result
++ * @rec_list: list of portals to log into.  This list is deleted after
++ *            iterating through it.
++ * @login_fn: list iter function
++ *
++ * This will loop over the list of portals and login. It
++ * will attempt to login asynchronously, and then wait for
++ * them to complete if wait is set.
++ */
++int iscsi_login_portals(void *data, int *nr_found, int wait,
++			struct list_head *rec_list,
++			int (*login_fn)(void *, struct list_head *,
++					 struct node_rec *))
++{
++	return __iscsi_login_portals(data, nr_found, wait, rec_list,
++				     1, login_fn);
++}
++
++/**
++ * iscsi_login_portals_safe - login into portals on @rec_list, but do not
++ *			      clear out rec_list.
++ */
++int iscsi_login_portals_safe(void *data, int *nr_found, int wait,
++			struct list_head *rec_list,
++			int (*login_fn)(void *, struct list_head *,
++					 struct node_rec *))
++{
++	return __iscsi_login_portals(data, nr_found, wait, rec_list,
++				     0, login_fn);
++}
++
+ static void log_logout_msg(struct session_info *info, int rc)
+ {
+ 	if (rc) {
+@@ -213,7 +314,7 @@ static void log_logout_msg(struct sessio
  			  "portal: %s,%d].", info->sid,
  			  info->targetname,
  			  info->persistent_address, info->port);
@@ -8652,7 +15527,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/session_mgmt.c open-iscsi-2.0-872-r
  	} else
  		log_info("Logout of [sid: %d, target: %s, "
  			 "portal: %s,%d] successful.",
-@@ -277,11 +275,7 @@ int iscsi_logout_portal(struct session_i
+@@ -277,11 +378,7 @@ int iscsi_logout_portal(struct session_i
  		log_logout_msg(info, rc);
  		if (async_req)
  			free(async_req);
@@ -8665,7 +15540,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/session_mgmt.c open-iscsi-2.0-872-r
  	}
  
  	if (async_req) {
-@@ -325,10 +319,17 @@ int iscsi_logout_portals(void *data, int
+@@ -325,10 +422,17 @@ int iscsi_logout_portals(void *data, int
  
  	err = iscsi_sysfs_for_each_session(&link_info, nr_found,
  					   session_info_create_list);
@@ -8685,7 +15560,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/session_mgmt.c open-iscsi-2.0-872-r
  	list_for_each_entry(curr_info, &session_list, list) {
  		err = logout_fn(data, &logout_list, curr_info);
  		if (err > 0 && !ret)
-@@ -337,13 +338,22 @@ int iscsi_logout_portals(void *data, int
+@@ -337,13 +441,22 @@ int iscsi_logout_portals(void *data, int
  			(*nr_found)++;
  	}
  
@@ -8709,9 +15584,105 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/session_mgmt.c open-iscsi-2.0-872-r
  	session_info_free_list(&session_list);
  	return ret;
  }
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/transport.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/transport.c
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/session_mgmt.h open-iscsi-2.0-872-rc4-bnx2i.sync/usr/session_mgmt.h
+--- open-iscsi-2.0-872-rc4-bnx2i/usr/session_mgmt.h	2010-07-11 04:05:58.000000000 -0500
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/session_mgmt.h	2011-08-14 16:48:25.000000000 -0500
+@@ -10,7 +10,11 @@ extern int iscsi_login_portal(void *data
+ extern int iscsi_login_portal_nowait(struct node_rec *rec);
+ extern int iscsi_login_portals(void *data, int *nr_found, int wait,
+ 			       struct list_head *rec_list,
+-			       int (* login_fn)(void *, struct list_head *,
++			       int (*login_fn)(void *, struct list_head *,
++						struct node_rec *));
++extern int iscsi_login_portals_safe(void *data, int *nr_found, int wait,
++			       struct list_head *rec_list,
++			       int (*login_fn)(void *, struct list_head *,
+ 						struct node_rec *));
+ extern int iscsi_logout_portal(struct session_info *info,
+ 			       struct list_head *list);
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/sysfs.c open-iscsi-2.0-872-rc4-bnx2i.sync/usr/sysfs.c
+--- open-iscsi-2.0-872-rc4-bnx2i/usr/sysfs.c	2010-07-11 04:05:58.000000000 -0500
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/sysfs.c	2011-08-14 16:48:25.000000000 -0500
+@@ -547,7 +547,7 @@ found:
+ }
+ 
+ 
+-char *sysfs_get_value(char *id, char *subsys, char *param)
++char *sysfs_get_value(const char *id, char *subsys, char *param)
+ {
+ 	char devpath[PATH_SIZE];
+ 	char *sysfs_value;
+@@ -590,7 +590,7 @@ int sysfs_get_uint(char *id, char *subsy
+ 	return 0;
+ }
+ 
+-int sysfs_get_int(char *id, char *subsys, char *param, int *value)
++int sysfs_get_int(const char *id, char *subsys, char *param, int *value)
+ {
+ 	char *sysfs_value;
+ 
+@@ -636,6 +636,34 @@ int sysfs_get_uint64(char *id, char *sub
+ 	return 0;
+ }
+ 
++int sysfs_get_uint8(char *id, char *subsys, char *param,
++		    uint8_t *value)
++{
++	char *sysfs_value;
++
++	*value = -1;
++	sysfs_value = sysfs_get_value(id, subsys, param);
++	if (!sysfs_value)
++		return EIO;
++
++	*value = (uint8_t)atoi(sysfs_value);
++	return 0;
++}
++
++int sysfs_get_uint16(char *id, char *subsys, char *param,
++		     uint16_t *value)
++{
++	char *sysfs_value;
++
++	*value = -1;
++	sysfs_value = sysfs_get_value(id, subsys, param);
++	if (!sysfs_value)
++		return EIO;
++
++	*value = (uint16_t)atoi(sysfs_value);
++	return 0;
++}
++
+ int sysfs_set_param(char *id, char *subsys, char *attr_name,
+ 		    char *write_buf, ssize_t buf_size)
+ {
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/sysfs.h open-iscsi-2.0-872-rc4-bnx2i.sync/usr/sysfs.h
+--- open-iscsi-2.0-872-rc4-bnx2i/usr/sysfs.h	2010-07-11 04:05:58.000000000 -0500
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/sysfs.h	2011-08-14 16:48:25.000000000 -0500
+@@ -51,14 +51,18 @@ extern char *sysfs_attr_get_value(const 
+ extern int sysfs_resolve_link(char *path, size_t size);
+ extern int sysfs_lookup_devpath_by_subsys_id(char *devpath, size_t len, const char *subsystem, const char *id);
+ 
+-extern char *sysfs_get_value(char *id, char *subsys, char *param);
++extern char *sysfs_get_value(const char *id, char *subsys, char *param);
+ extern int sysfs_get_uint(char *id, char *subsys, char *param,
+ 			  unsigned int *value);
+-extern int sysfs_get_int(char *id, char *subsys, char *param, int *value);
++extern int sysfs_get_int(const char *id, char *subsys, char *param, int *value);
+ extern int sysfs_get_str(char *id, char *subsys, char *param, char *value,
+ 			 int value_size);
+ extern int sysfs_get_uint64(char *id, char *subsys, char *param,
+ 			    uint64_t *value);
++extern int sysfs_get_uint8(char *id, char *subsys, char *param,
++			   uint8_t *value);
++extern int sysfs_get_uint16(char *id, char *subsys, char *param,
++			    uint16_t *value);
+ extern int sysfs_set_param(char *id, char *subsys, char *attr_name,
+ 			   char *write_buf, ssize_t buf_size);
+ 
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/transport.c open-iscsi-2.0-872-rc4-bnx2i.sync/usr/transport.c
 --- open-iscsi-2.0-872-rc4-bnx2i/usr/transport.c	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/transport.c	2011-02-24 19:54:10.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/usr/transport.c	2011-08-14 16:48:25.000000000 -0500
 @@ -25,7 +25,7 @@
  #include "log.h"
  #include "iscsi_util.h"
@@ -8739,7 +15710,17 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/transport.c open-iscsi-2.0-872-rc4-
  };
  
  struct iscsi_transport_template bnx2i = {
-@@ -76,6 +85,7 @@ static struct iscsi_transport_template *
+@@ -70,12 +79,17 @@ struct iscsi_transport_template be2iscsi
+ 
+ struct iscsi_transport_template qla4xxx = {
+ 	.name		= "qla4xxx",
++	.set_host_ip	= 0,
++	.ep_connect	= ktransport_ep_connect,
++	.ep_poll	= ktransport_ep_poll,
++	.ep_disconnect	= ktransport_ep_disconnect,
+ };
+ 
+ static struct iscsi_transport_template *iscsi_transport_templates[] = {
  	&iscsi_tcp,
  	&iscsi_iser,
  	&cxgb3i,
@@ -8747,7 +15728,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/transport.c open-iscsi-2.0-872-rc4-
  	&bnx2i,
  	&qla4xxx,
  	&be2iscsi,
-@@ -97,6 +107,7 @@ int set_transport_template(struct iscsi_
+@@ -97,6 +111,7 @@ int set_transport_template(struct iscsi_
  		}
  	}
  
@@ -8756,9 +15737,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/transport.c open-iscsi-2.0-872-rc4-
 +		  "is probably needed.\n", t->name);
  	return ENOSYS;
  }
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/utils/fwparam_ibft/fw_entry.c open-iscsi-2.0-872-rc4-bnx2i.work/utils/fwparam_ibft/fw_entry.c
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/utils/fwparam_ibft/fw_entry.c open-iscsi-2.0-872-rc4-bnx2i.sync/utils/fwparam_ibft/fw_entry.c
 --- open-iscsi-2.0-872-rc4-bnx2i/utils/fwparam_ibft/fw_entry.c	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/utils/fwparam_ibft/fw_entry.c	2011-02-24 19:54:10.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/utils/fwparam_ibft/fw_entry.c	2011-08-14 16:48:25.000000000 -0500
 @@ -34,6 +34,7 @@
  #include "fwparam.h"
  #include "idbm_fields.h"
@@ -8788,9 +15769,18 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/utils/fwparam_ibft/fw_entry.c open-iscs
  }
  
  /**
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/utils/fwparam_ibft/fwparam_ppc.c open-iscsi-2.0-872-rc4-bnx2i.work/utils/fwparam_ibft/fwparam_ppc.c
+@@ -196,7 +200,7 @@ static void dump_network(struct boot_con
+ 	if (strlen(context->secondary_dns))
+ 		printf("%s = %s\n", IFACE_SEC_DNS, context->secondary_dns);
+ 	if (strlen(context->vlan))
+-		printf("%s = %s\n", IFACE_VLAN, context->vlan);
++		printf("%s = %s\n", IFACE_VLAN_ID, context->vlan);
+ 	if (strlen(context->iface))
+ 		printf("%s = %s\n", IFACE_NETNAME, context->iface);
+ }
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/utils/fwparam_ibft/fwparam_ppc.c open-iscsi-2.0-872-rc4-bnx2i.sync/utils/fwparam_ibft/fwparam_ppc.c
 --- open-iscsi-2.0-872-rc4-bnx2i/utils/fwparam_ibft/fwparam_ppc.c	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/utils/fwparam_ibft/fwparam_ppc.c	2011-02-24 19:54:10.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/utils/fwparam_ibft/fwparam_ppc.c	2011-08-14 16:48:25.000000000 -0500
 @@ -30,6 +30,7 @@
  #include "iscsi_obp.h"
  #include "prom_parse.h"
@@ -8799,6 +15789,15 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/utils/fwparam_ibft/fwparam_ppc.c open-i
  
  void* yy_scan_string(const char *str);
  int yyparse(struct ofw_dev *ofwdev);
+@@ -355,7 +356,7 @@ static int loop_devs(const char *devtree
+ 	 * Sort the nics into "natural" order.	The proc fs
+ 	 * device-tree has them in somewhat random, or reversed order.
+ 	 */
+-	qsort(niclist, nic_count, sizeof(char *), nic_cmp);
++	qsort(niclist, nic_count, sizeof(char *), (__compar_fn_t)nic_cmp);
+ 
+ 	snprintf(prefix, sizeof(prefix), "%s/%s", devtree, "aliases");
+ 	dev_count = 0;
 @@ -449,7 +450,7 @@ int fwparam_ppc_boot_info(struct boot_co
  
  	devtree = find_devtree(filename);
@@ -8883,9 +15882,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/utils/fwparam_ibft/fwparam_ppc.c open-i
  			else {
  				fill_context(context, ofwdevs[0]);
  				list_add_tail(&context->list, list);
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/utils/fwparam_ibft/fwparam_sysfs.c open-iscsi-2.0-872-rc4-bnx2i.work/utils/fwparam_ibft/fwparam_sysfs.c
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/utils/fwparam_ibft/fwparam_sysfs.c open-iscsi-2.0-872-rc4-bnx2i.sync/utils/fwparam_ibft/fwparam_sysfs.c
 --- open-iscsi-2.0-872-rc4-bnx2i/utils/fwparam_ibft/fwparam_sysfs.c	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/utils/fwparam_ibft/fwparam_sysfs.c	2011-02-24 19:54:21.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/utils/fwparam_ibft/fwparam_sysfs.c	2011-08-14 16:48:25.000000000 -0500
 @@ -36,6 +36,7 @@
  #include "fwparam.h"
  #include "sysdeps.h"
@@ -9001,9 +16000,511 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/utils/fwparam_ibft/fwparam_sysfs.c open
  	if (rc)
  		fw_free_targets(list);
  	return rc;
-diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/utils/open-isns/socket.c open-iscsi-2.0-872-rc4-bnx2i.work/utils/open-isns/socket.c
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/utils/fwparam_ibft/prom_lex.c open-iscsi-2.0-872-rc4-bnx2i.sync/utils/fwparam_ibft/prom_lex.c
+--- open-iscsi-2.0-872-rc4-bnx2i/utils/fwparam_ibft/prom_lex.c	2010-07-11 04:05:58.000000000 -0500
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/utils/fwparam_ibft/prom_lex.c	2011-08-14 16:48:25.000000000 -0500
+@@ -8,7 +8,7 @@
+ #define FLEX_SCANNER
+ #define YY_FLEX_MAJOR_VERSION 2
+ #define YY_FLEX_MINOR_VERSION 5
+-#define YY_FLEX_SUBMINOR_VERSION 33
++#define YY_FLEX_SUBMINOR_VERSION 35
+ #if YY_FLEX_SUBMINOR_VERSION > 0
+ #define FLEX_BETA
+ #endif
+@@ -30,7 +30,7 @@
+ 
+ /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+ 
+-#if __STDC_VERSION__ >= 199901L
++#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ 
+ /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+  * if you want the limit (max/min) macros for int types. 
+@@ -53,7 +53,6 @@ typedef int flex_int32_t;
+ typedef unsigned char flex_uint8_t; 
+ typedef unsigned short int flex_uint16_t;
+ typedef unsigned int flex_uint32_t;
+-#endif /* ! C99 */
+ 
+ /* Limits of integral types. */
+ #ifndef INT8_MIN
+@@ -84,6 +83,8 @@ typedef unsigned int flex_uint32_t;
+ #define UINT32_MAX             (4294967295U)
+ #endif
+ 
++#endif /* ! C99 */
++
+ #endif /* ! FLEXINT_H */
+ 
+ #ifdef __cplusplus
+@@ -93,11 +94,12 @@ typedef unsigned int flex_uint32_t;
+ 
+ #else	/* ! __cplusplus */
+ 
+-#if __STDC__
++/* C99 requires __STDC__ to be defined as 1. */
++#if defined (__STDC__)
+ 
+ #define YY_USE_CONST
+ 
+-#endif	/* __STDC__ */
++#endif	/* defined (__STDC__) */
+ #endif	/* ! __cplusplus */
+ 
+ #ifdef YY_USE_CONST
+@@ -139,7 +141,15 @@ typedef unsigned int flex_uint32_t;
+ 
+ /* Size of default input buffer. */
+ #ifndef YY_BUF_SIZE
++#ifdef __ia64__
++/* On IA-64, the buffer size is 16k, not 8k.
++ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
++ * Ditto for the __ia64__ case accordingly.
++ */
++#define YY_BUF_SIZE 32768
++#else
+ #define YY_BUF_SIZE 16384
++#endif /* __ia64__ */
+ #endif
+ 
+ /* The state buf must be large enough to hold one state per character in the main buffer.
+@@ -177,14 +187,9 @@ extern FILE *yyin, *yyout;
+ 
+ #define unput(c) yyunput( c, (yytext_ptr)  )
+ 
+-/* The following is because we cannot portably get our hands on size_t
+- * (without autoconf's help, which isn't available because we want
+- * flex-generated scanners to compile on their own).
+- */
+-
+ #ifndef YY_TYPEDEF_YY_SIZE_T
+ #define YY_TYPEDEF_YY_SIZE_T
+-typedef unsigned int yy_size_t;
++typedef size_t yy_size_t;
+ #endif
+ 
+ #ifndef YY_STRUCT_YY_BUFFER_STATE
+@@ -920,7 +925,7 @@ int yy_flex_debug = 0;
+ #define YY_MORE_ADJ 0
+ #define YY_RESTORE_YY_MORE_OFFSET
+ #ifndef YYLMAX
+-#define YYLMAX 2048
++#define YYLMAX 8192
+ #endif
+ 
+ char yytext[YYLMAX];
+@@ -964,8 +969,9 @@ char *yytext_ptr;
+ 
+ void dbgprint(const char *item) { fprintf(stderr, "%s: \"%s\" len=%d ", item, yytext, yyleng);}
+ 
++#define YY_NO_INPUT 1
+ /* CHOSEN uses only boot related paths. */
+-#line 969 "<stdout>"
++#line 975 "<stdout>"
+ 
+ #define INITIAL 0
+ 
+@@ -983,6 +989,35 @@ void dbgprint(const char *item) { fprint
+ 
+ static int yy_init_globals (void );
+ 
++/* Accessor methods to globals.
++   These are made visible to non-reentrant scanners for convenience. */
++
++int yylex_destroy (void );
++
++int yyget_debug (void );
++
++void yyset_debug (int debug_flag  );
++
++YY_EXTRA_TYPE yyget_extra (void );
++
++void yyset_extra (YY_EXTRA_TYPE user_defined  );
++
++FILE *yyget_in (void );
++
++void yyset_in  (FILE * in_str  );
++
++FILE *yyget_out (void );
++
++void yyset_out  (FILE * out_str  );
++
++int yyget_leng (void );
++
++char *yyget_text (void );
++
++int yyget_lineno (void );
++
++void yyset_lineno (int line_number  );
++
+ /* Macros after this point can all be overridden by user definitions in
+  * section 1.
+  */
+@@ -995,8 +1030,6 @@ extern int yywrap (void );
+ #endif
+ #endif
+ 
+-    static void yyunput (int c,char *buf_ptr  );
+-    
+ #ifndef yytext_ptr
+ static void yy_flex_strncpy (char *,yyconst char *,int );
+ #endif
+@@ -1017,7 +1050,12 @@ static int input (void );
+ 
+ /* Amount of stuff to slurp up with each read. */
+ #ifndef YY_READ_BUF_SIZE
++#ifdef __ia64__
++/* On IA-64, the buffer size is 16k, not 8k */
++#define YY_READ_BUF_SIZE 16384
++#else
+ #define YY_READ_BUF_SIZE 8192
++#endif /* __ia64__ */
+ #endif
+ 
+ /* Copy whatever the last rule matched to the standard output. */
+@@ -1025,7 +1063,7 @@ static int input (void );
+ /* This used to be an fputs(), but since the string might contain NUL's,
+  * we now use fwrite().
+  */
+-#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
++#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
+ #endif
+ 
+ /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
+@@ -1118,10 +1156,10 @@ YY_DECL
+ 	register char *yy_cp, *yy_bp;
+ 	register int yy_act;
+     
+-#line 63 "prom_lex.l"
++#line 65 "prom_lex.l"
+ 
+ 
+-#line 1125 "<stdout>"
++#line 1163 "<stdout>"
+ 
+ 	if ( !(yy_init) )
+ 		{
+@@ -1202,78 +1240,78 @@ do_action:	/* This label is used only to
+ 
+ case 1:
+ YY_RULE_SETUP
+-#line 65 "prom_lex.l"
++#line 67 "prom_lex.l"
+ { upval(CHOSEN); }
+ 	YY_BREAK
+ case 2:
+ YY_RULE_SETUP
+-#line 66 "prom_lex.l"
++#line 68 "prom_lex.l"
+ { upval(VDEVICE); }
+ 	YY_BREAK
+ case 3:
+ YY_RULE_SETUP
+-#line 67 "prom_lex.l"
++#line 69 "prom_lex.l"
+ { upval(VDEVINST); }
+ 	YY_BREAK
+ case 4:
+ YY_RULE_SETUP
+-#line 68 "prom_lex.l"
++#line 70 "prom_lex.l"
+ { upval(VDEVDEV); }
+ 	YY_BREAK
+ case 5:
+ YY_RULE_SETUP
+-#line 69 "prom_lex.l"
++#line 71 "prom_lex.l"
+ { upval(VDEVRAW); }
+ 	YY_BREAK
+ case 6:
+ YY_RULE_SETUP
+-#line 70 "prom_lex.l"
++#line 72 "prom_lex.l"
+ { upval(OBPQUAL); }
+ 	YY_BREAK
+ case 7:
+ YY_RULE_SETUP
+-#line 71 "prom_lex.l"
++#line 73 "prom_lex.l"
+ { upval(BUSNAME); }
+ 	YY_BREAK
+ case 8:
+ YY_RULE_SETUP
+-#line 72 "prom_lex.l"
++#line 74 "prom_lex.l"
+ { upval(IPV4); }
+ 	YY_BREAK
+ case 9:
+ YY_RULE_SETUP
+-#line 73 "prom_lex.l"
++#line 75 "prom_lex.l"
+ { upval(IQN); }
+ 	YY_BREAK
+ case 10:
+ YY_RULE_SETUP
+-#line 74 "prom_lex.l"
++#line 76 "prom_lex.l"
+ { upval(BOOTDEV); }
+ 	YY_BREAK
+ case 11:
+ YY_RULE_SETUP
+-#line 75 "prom_lex.l"
++#line 77 "prom_lex.l"
+ { upval(OBPPARM); }
+ 	YY_BREAK
+ case 12:
+ YY_RULE_SETUP
+-#line 76 "prom_lex.l"
++#line 78 "prom_lex.l"
+ { upval(HEX4); }
+ 	YY_BREAK
+ case 13:
+ YY_RULE_SETUP
+-#line 77 "prom_lex.l"
++#line 79 "prom_lex.l"
+ { upval(HEX16); }
+ 	YY_BREAK
+ case 14:
+ YY_RULE_SETUP
+-#line 78 "prom_lex.l"
++#line 80 "prom_lex.l"
+ { upval(FILENAME); }
+ 	YY_BREAK
+ case 15:
+ /* rule 15 can match eol */
+ YY_RULE_SETUP
+-#line 79 "prom_lex.l"
++#line 81 "prom_lex.l"
+ {                  /* eat all whitespace. */
+ 	yylloc.first_column = yylloc.last_column;
+ 	yylloc.last_column += yyleng;
+@@ -1281,7 +1319,7 @@ YY_RULE_SETUP
+ 	YY_BREAK
+ case 16:
+ YY_RULE_SETUP
+-#line 83 "prom_lex.l"
++#line 85 "prom_lex.l"
+ {			/* any other single char. */
+ 	dbg("??");
+ 	yylloc.first_column = yylloc.last_column;
+@@ -1290,15 +1328,15 @@ YY_RULE_SETUP
+ }
+ 	YY_BREAK
+ case YY_STATE_EOF(INITIAL):
+-#line 90 "prom_lex.l"
++#line 92 "prom_lex.l"
+ yyterminate();
+ 	YY_BREAK
+ case 17:
+ YY_RULE_SETUP
+-#line 91 "prom_lex.l"
++#line 93 "prom_lex.l"
+ ECHO;
+ 	YY_BREAK
+-#line 1302 "<stdout>"
++#line 1340 "<stdout>"
+ 
+ 	case YY_END_OF_BUFFER:
+ 		{
+@@ -1528,7 +1566,7 @@ static int yy_get_next_buffer (void)
+ 
+ 		/* Read in more data. */
+ 		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+-			(yy_n_chars), num_to_read );
++			(yy_n_chars), (size_t) num_to_read );
+ 
+ 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ 		}
+@@ -1552,6 +1590,14 @@ static int yy_get_next_buffer (void)
+ 	else
+ 		ret_val = EOB_ACT_CONTINUE_SCAN;
+ 
++	if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
++		/* Extend the array by 50%, plus the number we really need. */
++		yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
++		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
++		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
++			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
++	}
++
+ 	(yy_n_chars) += number_to_move;
+ 	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
+ 	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
+@@ -1618,43 +1664,6 @@ static int yy_get_next_buffer (void)
+ 	return yy_is_jam ? 0 : yy_current_state;
+ }
+ 
+-    static void yyunput (int c, register char * yy_bp )
+-{
+-	register char *yy_cp;
+-    
+-    yy_cp = (yy_c_buf_p);
+-
+-	/* undo effects of setting up yytext */
+-	*yy_cp = (yy_hold_char);
+-
+-	if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
+-		{ /* need to shift things up to make room */
+-		/* +2 for EOB chars. */
+-		register int number_to_move = (yy_n_chars) + 2;
+-		register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
+-					YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
+-		register char *source =
+-				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
+-
+-		while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+-			*--dest = *--source;
+-
+-		yy_cp += (int) (dest - source);
+-		yy_bp += (int) (dest - source);
+-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
+-			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
+-
+-		if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
+-			YY_FATAL_ERROR( "flex scanner push-back overflow" );
+-		}
+-
+-	*--yy_cp = (char) c;
+-
+-	(yytext_ptr) = yy_bp;
+-	(yy_hold_char) = *yy_cp;
+-	(yy_c_buf_p) = yy_cp;
+-}
+-
+ #ifndef YY_NO_INPUT
+ #ifdef __cplusplus
+     static int yyinput (void)
+@@ -1963,7 +1972,9 @@ static void yyensure_buffer_stack (void)
+ 		(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
+ 								(num_to_alloc * sizeof(struct yy_buffer_state*)
+ 								);
+-		
++		if ( ! (yy_buffer_stack) )
++			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
++
+ 		memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+ 				
+ 		(yy_buffer_stack_max) = num_to_alloc;
+@@ -1981,6 +1992,8 @@ static void yyensure_buffer_stack (void)
+ 								((yy_buffer_stack),
+ 								num_to_alloc * sizeof(struct yy_buffer_state*)
+ 								);
++		if ( ! (yy_buffer_stack) )
++			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
+ 
+ 		/* zero only the new slots.*/
+ 		memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
+@@ -2025,7 +2038,7 @@ YY_BUFFER_STATE yy_scan_buffer  (char * 
+ 
+ /** Setup the input buffer state to scan a string. The next call to yylex() will
+  * scan from a @e copy of @a str.
+- * @param str a NUL-terminated string to scan
++ * @param yystr a NUL-terminated string to scan
+  * 
+  * @return the newly allocated buffer state object.
+  * @note If you want to scan bytes that may contain NUL values, then use
+@@ -2039,8 +2052,8 @@ YY_BUFFER_STATE yy_scan_string (yyconst 
+ 
+ /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
+  * scan from a @e copy of @a bytes.
+- * @param bytes the byte buffer to scan
+- * @param len the number of bytes in the buffer pointed to by @a bytes.
++ * @param yybytes the byte buffer to scan
++ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
+  * 
+  * @return the newly allocated buffer state object.
+  */
+@@ -2279,7 +2292,7 @@ void yyfree (void * ptr )
+ 
+ #define YYTABLES_NAME "yytables"
+ 
+-#line 91 "prom_lex.l"
++#line 93 "prom_lex.l"
+ 
+ 
+ 
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/utils/fwparam_ibft/prom_lex.l open-iscsi-2.0-872-rc4-bnx2i.sync/utils/fwparam_ibft/prom_lex.l
+--- open-iscsi-2.0-872-rc4-bnx2i/utils/fwparam_ibft/prom_lex.l	2010-07-11 04:05:58.000000000 -0500
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/utils/fwparam_ibft/prom_lex.l	2011-08-14 16:48:25.000000000 -0500
+@@ -43,6 +43,8 @@ void dbgprint(const char *item) { fprint
+ 
+ %option noyywrap
+ %option never-interactive
++%option nounput
++%option noinput
+ 
+ VDEVICE     vdevice
+ VDEVINST    gscsi
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/utils/open-isns/client.c open-iscsi-2.0-872-rc4-bnx2i.sync/utils/open-isns/client.c
+--- open-iscsi-2.0-872-rc4-bnx2i/utils/open-isns/client.c	2010-07-11 04:05:58.000000000 -0500
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/utils/open-isns/client.c	2011-08-14 16:48:25.000000000 -0500
+@@ -123,8 +123,10 @@ static isns_security_t *
+ __create_security_context(const char *name, const char *auth_key,
+ 		const char *server_key)
+ {
++#ifdef WITH_SECURITY
+ 	isns_security_t 	*ctx;
+ 	isns_principal_t	*princ;
++#endif /* WITH_SECURITY */
+ 
+ 	if (!isns_config.ic_security)
+ 		return NULL;
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/utils/open-isns/db-file.c open-iscsi-2.0-872-rc4-bnx2i.sync/utils/open-isns/db-file.c
+--- open-iscsi-2.0-872-rc4-bnx2i/utils/open-isns/db-file.c	2010-07-11 04:05:58.000000000 -0500
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/utils/open-isns/db-file.c	2011-08-14 16:48:25.000000000 -0500
+@@ -310,7 +310,7 @@ __dbe_file_load_object(const char *filen
+ 
+ 	/* Stash away the parent's index; we resolve them later on
+ 	 * once we've loaded all objects */
+-	obj->ie_container = (isns_object_t *) ntohl(info.db_parent);
++	obj->ie_container_idx = ntohl(info.db_parent);
+ 
+ 	isns_object_list_append(result, obj);
+ 
+@@ -493,7 +493,7 @@ isns_dbe_file_reload(isns_db_t *db)
+ 	/* Resolve parent/child relationship for all nodes */
+ 	for (i = 0; i < db->id_objects->iol_count; ++i) {
+ 		isns_object_t	*obj = db->id_objects->iol_data[i];
+-		uint32_t	index = (uint32_t) obj->ie_container;
++		uint32_t	index = obj->ie_container_idx;
+ 		isns_object_t	*parent;
+ 
+ 		if (index == 0)
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/utils/open-isns/Makefile.in open-iscsi-2.0-872-rc4-bnx2i.sync/utils/open-isns/Makefile.in
+--- open-iscsi-2.0-872-rc4-bnx2i/utils/open-isns/Makefile.in	2010-07-11 04:05:58.000000000 -0500
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/utils/open-isns/Makefile.in	2011-08-14 16:48:25.000000000 -0500
+@@ -32,7 +32,6 @@ LIBOBJS	= server.o \
+ 	  security.o \
+ 	  authblock.o \
+ 	  policy.o \
+-	  pki.o \
+ 	  register.o \
+ 	  query.o \
+ 	  getnext.o \
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/utils/open-isns/objects.h open-iscsi-2.0-872-rc4-bnx2i.sync/utils/open-isns/objects.h
+--- open-iscsi-2.0-872-rc4-bnx2i/utils/open-isns/objects.h	2010-07-11 04:05:58.000000000 -0500
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/utils/open-isns/objects.h	2011-08-14 16:48:25.000000000 -0500
+@@ -83,6 +83,7 @@ struct isns_object {
+ 
+ 	isns_attr_list_t	ie_attrs;
+ 	isns_object_t *		ie_container;
++	uint32_t		ie_container_idx;
+ 	isns_object_template_t *ie_template;
+ 
+ 	isns_relation_t *	ie_relation;
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/utils/open-isns/socket.c open-iscsi-2.0-872-rc4-bnx2i.sync/utils/open-isns/socket.c
 --- open-iscsi-2.0-872-rc4-bnx2i/utils/open-isns/socket.c	2010-07-11 04:05:58.000000000 -0500
-+++ open-iscsi-2.0-872-rc4-bnx2i.work/utils/open-isns/socket.c	2011-02-24 19:54:10.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.sync/utils/open-isns/socket.c	2011-08-14 16:48:25.000000000 -0500
+@@ -562,7 +562,7 @@ void
+ isns_net_stream_accept(isns_socket_t *sock)
+ {
+ 	isns_socket_t *child;
+-	size_t	optlen;
++	socklen_t optlen;
+ 	int	fd, passcred = 0;
+ 
+ 	fd = accept(sock->is_desc, NULL, NULL);
 @@ -805,7 +805,7 @@ isns_net_stream_xmit(isns_socket_t *sock
  void
  isns_net_stream_hup(isns_socket_t *sock)
diff --git a/iscsi-initiator-utils-sync-uio-0.7.0.8.patch b/iscsi-initiator-utils-sync-uio-0.7.0.8.patch
new file mode 100644
index 0000000..9f59671
--- /dev/null
+++ b/iscsi-initiator-utils-sync-uio-0.7.0.8.patch
@@ -0,0 +1,74274 @@
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/iscsiuio/aclocal.m4 open-iscsi-2.0-872-rc4-bnx2i.build/iscsiuio/aclocal.m4
+--- open-iscsi-2.0-872-rc4-bnx2i/iscsiuio/aclocal.m4	1969-12-31 18:00:00.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.build/iscsiuio/aclocal.m4	2011-08-03 20:01:01.000000000 -0500
+@@ -0,0 +1,7277 @@
++# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
++
++# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
++# 2005  Free Software Foundation, Inc.
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
++# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
++# PARTICULAR PURPOSE.
++
++# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
++
++# serial 48 AC_PROG_LIBTOOL
++
++
++# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
++# -----------------------------------------------------------
++# If this macro is not defined by Autoconf, define it here.
++m4_ifdef([AC_PROVIDE_IFELSE],
++         [],
++         [m4_define([AC_PROVIDE_IFELSE],
++	         [m4_ifdef([AC_PROVIDE_$1],
++		           [$2], [$3])])])
++
++
++# AC_PROG_LIBTOOL
++# ---------------
++AC_DEFUN([AC_PROG_LIBTOOL],
++[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
++dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
++dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
++  AC_PROVIDE_IFELSE([AC_PROG_CXX],
++    [AC_LIBTOOL_CXX],
++    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
++  ])])
++dnl And a similar setup for Fortran 77 support
++  AC_PROVIDE_IFELSE([AC_PROG_F77],
++    [AC_LIBTOOL_F77],
++    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
++])])
++
++dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
++dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
++dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
++  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
++    [AC_LIBTOOL_GCJ],
++    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
++      [AC_LIBTOOL_GCJ],
++      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
++	[AC_LIBTOOL_GCJ],
++      [ifdef([AC_PROG_GCJ],
++	     [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
++       ifdef([A][M_PROG_GCJ],
++	     [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
++       ifdef([LT_AC_PROG_GCJ],
++	     [define([LT_AC_PROG_GCJ],
++		defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
++])])# AC_PROG_LIBTOOL
++
++
++# _AC_PROG_LIBTOOL
++# ----------------
++AC_DEFUN([_AC_PROG_LIBTOOL],
++[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
++AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
++AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
++AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
++
++# This can be used to rebuild libtool when needed
++LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
++
++# Always use our own libtool.
++LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++AC_SUBST(LIBTOOL)dnl
++
++# Prevent multiple expansion
++define([AC_PROG_LIBTOOL], [])
++])# _AC_PROG_LIBTOOL
++
++
++# AC_LIBTOOL_SETUP
++# ----------------
++AC_DEFUN([AC_LIBTOOL_SETUP],
++[AC_PREREQ(2.50)dnl
++AC_REQUIRE([AC_ENABLE_SHARED])dnl
++AC_REQUIRE([AC_ENABLE_STATIC])dnl
++AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
++AC_REQUIRE([AC_CANONICAL_HOST])dnl
++AC_REQUIRE([AC_CANONICAL_BUILD])dnl
++AC_REQUIRE([AC_PROG_CC])dnl
++AC_REQUIRE([AC_PROG_LD])dnl
++AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
++AC_REQUIRE([AC_PROG_NM])dnl
++
++AC_REQUIRE([AC_PROG_LN_S])dnl
++AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
++# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
++AC_REQUIRE([AC_OBJEXT])dnl
++AC_REQUIRE([AC_EXEEXT])dnl
++dnl
++
++AC_LIBTOOL_SYS_MAX_CMD_LEN
++AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
++AC_LIBTOOL_OBJDIR
++
++AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
++_LT_AC_PROG_ECHO_BACKSLASH
++
++case $host_os in
++aix3*)
++  # AIX sometimes has problems with the GCC collect2 program.  For some
++  # reason, if we set the COLLECT_NAMES environment variable, the problems
++  # vanish in a puff of smoke.
++  if test "X${COLLECT_NAMES+set}" != Xset; then
++    COLLECT_NAMES=
++    export COLLECT_NAMES
++  fi
++  ;;
++esac
++
++# Sed substitution that helps us do robust quoting.  It backslashifies
++# metacharacters that are still active within double-quoted strings.
++Xsed='sed -e 1s/^X//'
++[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
++
++# Same as above, but do not quote variable references.
++[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
++
++# Sed substitution to delay expansion of an escaped shell variable in a
++# double_quote_subst'ed string.
++delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
++
++# Sed substitution to avoid accidental globbing in evaled expressions
++no_glob_subst='s/\*/\\\*/g'
++
++# Constants:
++rm="rm -f"
++
++# Global variables:
++default_ofile=libtool
++can_build_shared=yes
++
++# All known linkers require a `.a' archive for static linking (except MSVC,
++# which needs '.lib').
++libext=a
++ltmain="$ac_aux_dir/ltmain.sh"
++ofile="$default_ofile"
++with_gnu_ld="$lt_cv_prog_gnu_ld"
++
++AC_CHECK_TOOL(AR, ar, false)
++AC_CHECK_TOOL(RANLIB, ranlib, :)
++AC_CHECK_TOOL(STRIP, strip, :)
++
++old_CC="$CC"
++old_CFLAGS="$CFLAGS"
++
++# Set sane defaults for various variables
++test -z "$AR" && AR=ar
++test -z "$AR_FLAGS" && AR_FLAGS=cru
++test -z "$AS" && AS=as
++test -z "$CC" && CC=cc
++test -z "$LTCC" && LTCC=$CC
++test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
++test -z "$DLLTOOL" && DLLTOOL=dlltool
++test -z "$LD" && LD=ld
++test -z "$LN_S" && LN_S="ln -s"
++test -z "$MAGIC_CMD" && MAGIC_CMD=file
++test -z "$NM" && NM=nm
++test -z "$SED" && SED=sed
++test -z "$OBJDUMP" && OBJDUMP=objdump
++test -z "$RANLIB" && RANLIB=:
++test -z "$STRIP" && STRIP=:
++test -z "$ac_objext" && ac_objext=o
++
++# Determine commands to create old-style static archives.
++old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
++old_postinstall_cmds='chmod 644 $oldlib'
++old_postuninstall_cmds=
++
++if test -n "$RANLIB"; then
++  case $host_os in
++  openbsd*)
++    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
++    ;;
++  *)
++    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
++    ;;
++  esac
++  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
++fi
++
++_LT_CC_BASENAME([$compiler])
++
++# Only perform the check for file, if the check method requires it
++case $deplibs_check_method in
++file_magic*)
++  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
++    AC_PATH_MAGIC
++  fi
++  ;;
++esac
++
++AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
++AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
++enable_win32_dll=yes, enable_win32_dll=no)
++
++AC_ARG_ENABLE([libtool-lock],
++    [AC_HELP_STRING([--disable-libtool-lock],
++	[avoid locking (might break parallel builds)])])
++test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
++
++AC_ARG_WITH([pic],
++    [AC_HELP_STRING([--with-pic],
++	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
++    [pic_mode="$withval"],
++    [pic_mode=default])
++test -z "$pic_mode" && pic_mode=default
++
++# Use C for the default configuration in the libtool script
++tagname=
++AC_LIBTOOL_LANG_C_CONFIG
++_LT_AC_TAGCONFIG
++])# AC_LIBTOOL_SETUP
++
++
++# _LT_AC_SYS_COMPILER
++# -------------------
++AC_DEFUN([_LT_AC_SYS_COMPILER],
++[AC_REQUIRE([AC_PROG_CC])dnl
++
++# If no C compiler was specified, use CC.
++LTCC=${LTCC-"$CC"}
++
++# If no C compiler flags were specified, use CFLAGS.
++LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
++
++# Allow CC to be a program name with arguments.
++compiler=$CC
++])# _LT_AC_SYS_COMPILER
++
++
++# _LT_CC_BASENAME(CC)
++# -------------------
++# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
++AC_DEFUN([_LT_CC_BASENAME],
++[for cc_temp in $1""; do
++  case $cc_temp in
++    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
++    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
++    \-*) ;;
++    *) break;;
++  esac
++done
++cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
++])
++
++
++# _LT_COMPILER_BOILERPLATE
++# ------------------------
++# Check for compiler boilerplate output or warnings with
++# the simple compiler test code.
++AC_DEFUN([_LT_COMPILER_BOILERPLATE],
++[ac_outfile=conftest.$ac_objext
++printf "$lt_simple_compile_test_code" >conftest.$ac_ext
++eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
++_lt_compiler_boilerplate=`cat conftest.err`
++$rm conftest*
++])# _LT_COMPILER_BOILERPLATE
++
++
++# _LT_LINKER_BOILERPLATE
++# ----------------------
++# Check for linker boilerplate output or warnings with
++# the simple link test code.
++AC_DEFUN([_LT_LINKER_BOILERPLATE],
++[ac_outfile=conftest.$ac_objext
++printf "$lt_simple_link_test_code" >conftest.$ac_ext
++eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
++_lt_linker_boilerplate=`cat conftest.err`
++$rm conftest*
++])# _LT_LINKER_BOILERPLATE
++
++
++# _LT_AC_SYS_LIBPATH_AIX
++# ----------------------
++# Links a minimal program and checks the executable
++# for the system default hardcoded library path. In most cases,
++# this is /usr/lib:/lib, but when the MPI compilers are used
++# the location of the communication and MPI libs are included too.
++# If we don't find anything, use the default library path according
++# to the aix ld manual.
++AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
++[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
++aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
++}'`
++# Check for a 64-bit object if we didn't find anything.
++if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
++}'`; fi],[])
++if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++])# _LT_AC_SYS_LIBPATH_AIX
++
++
++# _LT_AC_SHELL_INIT(ARG)
++# ----------------------
++AC_DEFUN([_LT_AC_SHELL_INIT],
++[ifdef([AC_DIVERSION_NOTICE],
++	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
++	 [AC_DIVERT_PUSH(NOTICE)])
++$1
++AC_DIVERT_POP
++])# _LT_AC_SHELL_INIT
++
++
++# _LT_AC_PROG_ECHO_BACKSLASH
++# --------------------------
++# Add some code to the start of the generated configure script which
++# will find an echo command which doesn't interpret backslashes.
++AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
++[_LT_AC_SHELL_INIT([
++# Check that we are running under the correct shell.
++SHELL=${CONFIG_SHELL-/bin/sh}
++
++case X$ECHO in
++X*--fallback-echo)
++  # Remove one level of quotation (which was required for Make).
++  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
++  ;;
++esac
++
++echo=${ECHO-echo}
++if test "X[$]1" = X--no-reexec; then
++  # Discard the --no-reexec flag, and continue.
++  shift
++elif test "X[$]1" = X--fallback-echo; then
++  # Avoid inline document here, it may be left over
++  :
++elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
++  # Yippee, $echo works!
++  :
++else
++  # Restart under the correct shell.
++  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
++fi
++
++if test "X[$]1" = X--fallback-echo; then
++  # used as fallback echo
++  shift
++  cat <<EOF
++[$]*
++EOF
++  exit 0
++fi
++
++# The HP-UX ksh and POSIX shell print the target directory to stdout
++# if CDPATH is set.
++(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
++
++if test -z "$ECHO"; then
++if test "X${echo_test_string+set}" != Xset; then
++# find a string as large as possible, as long as the shell can cope with it
++  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
++    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
++    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
++       echo_test_string=`eval $cmd` &&
++       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
++    then
++      break
++    fi
++  done
++fi
++
++if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
++   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
++   test "X$echo_testing_string" = "X$echo_test_string"; then
++  :
++else
++  # The Solaris, AIX, and Digital Unix default echo programs unquote
++  # backslashes.  This makes it impossible to quote backslashes using
++  #   echo "$something" | sed 's/\\/\\\\/g'
++  #
++  # So, first we look for a working echo in the user's PATH.
++
++  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
++  for dir in $PATH /usr/ucb; do
++    IFS="$lt_save_ifs"
++    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
++       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
++       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
++       test "X$echo_testing_string" = "X$echo_test_string"; then
++      echo="$dir/echo"
++      break
++    fi
++  done
++  IFS="$lt_save_ifs"
++
++  if test "X$echo" = Xecho; then
++    # We didn't find a better echo, so look for alternatives.
++    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
++       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
++       test "X$echo_testing_string" = "X$echo_test_string"; then
++      # This shell has a builtin print -r that does the trick.
++      echo='print -r'
++    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
++	 test "X$CONFIG_SHELL" != X/bin/ksh; then
++      # If we have ksh, try running configure again with it.
++      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
++      export ORIGINAL_CONFIG_SHELL
++      CONFIG_SHELL=/bin/ksh
++      export CONFIG_SHELL
++      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
++    else
++      # Try using printf.
++      echo='printf %s\n'
++      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
++	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
++	 test "X$echo_testing_string" = "X$echo_test_string"; then
++	# Cool, printf works
++	:
++      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
++	   test "X$echo_testing_string" = 'X\t' &&
++	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
++	   test "X$echo_testing_string" = "X$echo_test_string"; then
++	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
++	export CONFIG_SHELL
++	SHELL="$CONFIG_SHELL"
++	export SHELL
++	echo="$CONFIG_SHELL [$]0 --fallback-echo"
++      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
++	   test "X$echo_testing_string" = 'X\t' &&
++	   echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
++	   test "X$echo_testing_string" = "X$echo_test_string"; then
++	echo="$CONFIG_SHELL [$]0 --fallback-echo"
++      else
++	# maybe with a smaller string...
++	prev=:
++
++	for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
++	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
++	  then
++	    break
++	  fi
++	  prev="$cmd"
++	done
++
++	if test "$prev" != 'sed 50q "[$]0"'; then
++	  echo_test_string=`eval $prev`
++	  export echo_test_string
++	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
++	else
++	  # Oops.  We lost completely, so just stick with echo.
++	  echo=echo
++	fi
++      fi
++    fi
++  fi
++fi
++fi
++
++# Copy echo and quote the copy suitably for passing to libtool from
++# the Makefile, instead of quoting the original, which is used later.
++ECHO=$echo
++if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
++   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
++fi
++
++AC_SUBST(ECHO)
++])])# _LT_AC_PROG_ECHO_BACKSLASH
++
++
++# _LT_AC_LOCK
++# -----------
++AC_DEFUN([_LT_AC_LOCK],
++[AC_ARG_ENABLE([libtool-lock],
++    [AC_HELP_STRING([--disable-libtool-lock],
++	[avoid locking (might break parallel builds)])])
++test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
++
++# Some flags need to be propagated to the compiler or linker for good
++# libtool support.
++case $host in
++ia64-*-hpux*)
++  # Find out which ABI we are using.
++  echo 'int i;' > conftest.$ac_ext
++  if AC_TRY_EVAL(ac_compile); then
++    case `/usr/bin/file conftest.$ac_objext` in
++    *ELF-32*)
++      HPUX_IA64_MODE="32"
++      ;;
++    *ELF-64*)
++      HPUX_IA64_MODE="64"
++      ;;
++    esac
++  fi
++  rm -rf conftest*
++  ;;
++*-*-irix6*)
++  # Find out which ABI we are using.
++  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
++  if AC_TRY_EVAL(ac_compile); then
++   if test "$lt_cv_prog_gnu_ld" = yes; then
++    case `/usr/bin/file conftest.$ac_objext` in
++    *32-bit*)
++      LD="${LD-ld} -melf32bsmip"
++      ;;
++    *N32*)
++      LD="${LD-ld} -melf32bmipn32"
++      ;;
++    *64-bit*)
++      LD="${LD-ld} -melf64bmip"
++      ;;
++    esac
++   else
++    case `/usr/bin/file conftest.$ac_objext` in
++    *32-bit*)
++      LD="${LD-ld} -32"
++      ;;
++    *N32*)
++      LD="${LD-ld} -n32"
++      ;;
++    *64-bit*)
++      LD="${LD-ld} -64"
++      ;;
++    esac
++   fi
++  fi
++  rm -rf conftest*
++  ;;
++
++x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
++  # Find out which ABI we are using.
++  echo 'int i;' > conftest.$ac_ext
++  if AC_TRY_EVAL(ac_compile); then
++    case `/usr/bin/file conftest.o` in
++    *32-bit*)
++      case $host in
++        x86_64-*linux*)
++          LD="${LD-ld} -m elf_i386"
++          ;;
++        ppc64-*linux*|powerpc64-*linux*)
++          LD="${LD-ld} -m elf32ppclinux"
++          ;;
++        s390x-*linux*)
++          LD="${LD-ld} -m elf_s390"
++          ;;
++        sparc64-*linux*)
++          LD="${LD-ld} -m elf32_sparc"
++          ;;
++      esac
++      ;;
++    *64-bit*)
++      case $host in
++        x86_64-*linux*)
++          LD="${LD-ld} -m elf_x86_64"
++          ;;
++        ppc*-*linux*|powerpc*-*linux*)
++          LD="${LD-ld} -m elf64ppc"
++          ;;
++        s390*-*linux*)
++          LD="${LD-ld} -m elf64_s390"
++          ;;
++        sparc*-*linux*)
++          LD="${LD-ld} -m elf64_sparc"
++          ;;
++      esac
++      ;;
++    esac
++  fi
++  rm -rf conftest*
++  ;;
++
++*-*-sco3.2v5*)
++  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
++  SAVE_CFLAGS="$CFLAGS"
++  CFLAGS="$CFLAGS -belf"
++  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
++    [AC_LANG_PUSH(C)
++     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
++     AC_LANG_POP])
++  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
++    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
++    CFLAGS="$SAVE_CFLAGS"
++  fi
++  ;;
++sparc*-*solaris*)
++  # Find out which ABI we are using.
++  echo 'int i;' > conftest.$ac_ext
++  if AC_TRY_EVAL(ac_compile); then
++    case `/usr/bin/file conftest.o` in
++    *64-bit*)
++      case $lt_cv_prog_gnu_ld in
++      yes*) LD="${LD-ld} -m elf64_sparc" ;;
++      *)    LD="${LD-ld} -64" ;;
++      esac
++      ;;
++    esac
++  fi
++  rm -rf conftest*
++  ;;
++
++AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
++[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
++  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
++  AC_CHECK_TOOL(AS, as, false)
++  AC_CHECK_TOOL(OBJDUMP, objdump, false)
++  ;;
++  ])
++esac
++
++need_locks="$enable_libtool_lock"
++
++])# _LT_AC_LOCK
++
++
++# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
++#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
++# ----------------------------------------------------------------
++# Check whether the given compiler option works
++AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
++[AC_REQUIRE([LT_AC_PROG_SED])
++AC_CACHE_CHECK([$1], [$2],
++  [$2=no
++  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
++   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
++   lt_compiler_flag="$3"
++   # Insert the option either (1) after the last *FLAGS variable, or
++   # (2) before a word containing "conftest.", or (3) at the end.
++   # Note that $ac_compile itself does not contain backslashes and begins
++   # with a dollar sign (not a hyphen), so the echo should work correctly.
++   # The option is referenced via a variable to avoid confusing sed.
++   lt_compile=`echo "$ac_compile" | $SED \
++   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
++   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
++   -e 's:$: $lt_compiler_flag:'`
++   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
++   (eval "$lt_compile" 2>conftest.err)
++   ac_status=$?
++   cat conftest.err >&AS_MESSAGE_LOG_FD
++   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
++   if (exit $ac_status) && test -s "$ac_outfile"; then
++     # The compiler can only warn and ignore the option if not recognized
++     # So say no if there are warnings other than the usual output.
++     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
++     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
++     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
++       $2=yes
++     fi
++   fi
++   $rm conftest*
++])
++
++if test x"[$]$2" = xyes; then
++    ifelse([$5], , :, [$5])
++else
++    ifelse([$6], , :, [$6])
++fi
++])# AC_LIBTOOL_COMPILER_OPTION
++
++
++# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
++#                          [ACTION-SUCCESS], [ACTION-FAILURE])
++# ------------------------------------------------------------
++# Check whether the given compiler option works
++AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
++[AC_CACHE_CHECK([$1], [$2],
++  [$2=no
++   save_LDFLAGS="$LDFLAGS"
++   LDFLAGS="$LDFLAGS $3"
++   printf "$lt_simple_link_test_code" > conftest.$ac_ext
++   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
++     # The linker can only warn and ignore the option if not recognized
++     # So say no if there are warnings
++     if test -s conftest.err; then
++       # Append any errors to the config.log.
++       cat conftest.err 1>&AS_MESSAGE_LOG_FD
++       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
++       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
++       if diff conftest.exp conftest.er2 >/dev/null; then
++         $2=yes
++       fi
++     else
++       $2=yes
++     fi
++   fi
++   $rm conftest*
++   LDFLAGS="$save_LDFLAGS"
++])
++
++if test x"[$]$2" = xyes; then
++    ifelse([$4], , :, [$4])
++else
++    ifelse([$5], , :, [$5])
++fi
++])# AC_LIBTOOL_LINKER_OPTION
++
++
++# AC_LIBTOOL_SYS_MAX_CMD_LEN
++# --------------------------
++AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
++[# find the maximum length of command line arguments
++AC_MSG_CHECKING([the maximum length of command line arguments])
++AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
++  i=0
++  teststring="ABCD"
++
++  case $build_os in
++  msdosdjgpp*)
++    # On DJGPP, this test can blow up pretty badly due to problems in libc
++    # (any single argument exceeding 2000 bytes causes a buffer overrun
++    # during glob expansion).  Even if it were fixed, the result of this
++    # check would be larger than it should be.
++    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
++    ;;
++
++  gnu*)
++    # Under GNU Hurd, this test is not required because there is
++    # no limit to the length of command line arguments.
++    # Libtool will interpret -1 as no limit whatsoever
++    lt_cv_sys_max_cmd_len=-1;
++    ;;
++
++  cygwin* | mingw*)
++    # On Win9x/ME, this test blows up -- it succeeds, but takes
++    # about 5 minutes as the teststring grows exponentially.
++    # Worse, since 9x/ME are not pre-emptively multitasking,
++    # you end up with a "frozen" computer, even though with patience
++    # the test eventually succeeds (with a max line length of 256k).
++    # Instead, let's just punt: use the minimum linelength reported by
++    # all of the supported platforms: 8192 (on NT/2K/XP).
++    lt_cv_sys_max_cmd_len=8192;
++    ;;
++
++  amigaos*)
++    # On AmigaOS with pdksh, this test takes hours, literally.
++    # So we just punt and use a minimum line length of 8192.
++    lt_cv_sys_max_cmd_len=8192;
++    ;;
++
++  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
++    # This has been around since 386BSD, at least.  Likely further.
++    if test -x /sbin/sysctl; then
++      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
++    elif test -x /usr/sbin/sysctl; then
++      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
++    else
++      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
++    fi
++    # And add a safety zone
++    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
++    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
++    ;;
++
++  interix*)
++    # We know the value 262144 and hardcode it with a safety zone (like BSD)
++    lt_cv_sys_max_cmd_len=196608
++    ;;
++
++  osf*)
++    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
++    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
++    # nice to cause kernel panics so lets avoid the loop below.
++    # First set a reasonable default.
++    lt_cv_sys_max_cmd_len=16384
++    #
++    if test -x /sbin/sysconfig; then
++      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
++        *1*) lt_cv_sys_max_cmd_len=-1 ;;
++      esac
++    fi
++    ;;
++  sco3.2v5*)
++    lt_cv_sys_max_cmd_len=102400
++    ;;
++  sysv5* | sco5v6* | sysv4.2uw2*)
++    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
++    if test -n "$kargmax"; then
++      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ 	]]//'`
++    else
++      lt_cv_sys_max_cmd_len=32768
++    fi
++    ;;
++  *)
++    # If test is not a shell built-in, we'll probably end up computing a
++    # maximum length that is only half of the actual maximum length, but
++    # we can't tell.
++    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
++    while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
++	       = "XX$teststring") >/dev/null 2>&1 &&
++	    new_result=`expr "X$teststring" : ".*" 2>&1` &&
++	    lt_cv_sys_max_cmd_len=$new_result &&
++	    test $i != 17 # 1/2 MB should be enough
++    do
++      i=`expr $i + 1`
++      teststring=$teststring$teststring
++    done
++    teststring=
++    # Add a significant safety factor because C++ compilers can tack on massive
++    # amounts of additional arguments before passing them to the linker.
++    # It appears as though 1/2 is a usable value.
++    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
++    ;;
++  esac
++])
++if test -n $lt_cv_sys_max_cmd_len ; then
++  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
++else
++  AC_MSG_RESULT(none)
++fi
++])# AC_LIBTOOL_SYS_MAX_CMD_LEN
++
++
++# _LT_AC_CHECK_DLFCN
++# ------------------
++AC_DEFUN([_LT_AC_CHECK_DLFCN],
++[AC_CHECK_HEADERS(dlfcn.h)dnl
++])# _LT_AC_CHECK_DLFCN
++
++
++# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
++#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
++# ---------------------------------------------------------------------
++AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
++[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
++if test "$cross_compiling" = yes; then :
++  [$4]
++else
++  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
++  lt_status=$lt_dlunknown
++  cat > conftest.$ac_ext <<EOF
++[#line __oline__ "configure"
++#include "confdefs.h"
++
++#if HAVE_DLFCN_H
++#include <dlfcn.h>
++#endif
++
++#include <stdio.h>
++
++#ifdef RTLD_GLOBAL
++#  define LT_DLGLOBAL		RTLD_GLOBAL
++#else
++#  ifdef DL_GLOBAL
++#    define LT_DLGLOBAL		DL_GLOBAL
++#  else
++#    define LT_DLGLOBAL		0
++#  endif
++#endif
++
++/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
++   find out it does not work in some platform. */
++#ifndef LT_DLLAZY_OR_NOW
++#  ifdef RTLD_LAZY
++#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
++#  else
++#    ifdef DL_LAZY
++#      define LT_DLLAZY_OR_NOW		DL_LAZY
++#    else
++#      ifdef RTLD_NOW
++#        define LT_DLLAZY_OR_NOW	RTLD_NOW
++#      else
++#        ifdef DL_NOW
++#          define LT_DLLAZY_OR_NOW	DL_NOW
++#        else
++#          define LT_DLLAZY_OR_NOW	0
++#        endif
++#      endif
++#    endif
++#  endif
++#endif
++
++#ifdef __cplusplus
++extern "C" void exit (int);
++#endif
++
++void fnord() { int i=42;}
++int main ()
++{
++  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
++  int status = $lt_dlunknown;
++
++  if (self)
++    {
++      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
++      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
++      /* dlclose (self); */
++    }
++  else
++    puts (dlerror ());
++
++    exit (status);
++}]
++EOF
++  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
++    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
++    lt_status=$?
++    case x$lt_status in
++      x$lt_dlno_uscore) $1 ;;
++      x$lt_dlneed_uscore) $2 ;;
++      x$lt_dlunknown|x*) $3 ;;
++    esac
++  else :
++    # compilation failed
++    $3
++  fi
++fi
++rm -fr conftest*
++])# _LT_AC_TRY_DLOPEN_SELF
++
++
++# AC_LIBTOOL_DLOPEN_SELF
++# ----------------------
++AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
++[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
++if test "x$enable_dlopen" != xyes; then
++  enable_dlopen=unknown
++  enable_dlopen_self=unknown
++  enable_dlopen_self_static=unknown
++else
++  lt_cv_dlopen=no
++  lt_cv_dlopen_libs=
++
++  case $host_os in
++  beos*)
++    lt_cv_dlopen="load_add_on"
++    lt_cv_dlopen_libs=
++    lt_cv_dlopen_self=yes
++    ;;
++
++  mingw* | pw32*)
++    lt_cv_dlopen="LoadLibrary"
++    lt_cv_dlopen_libs=
++   ;;
++
++  cygwin*)
++    lt_cv_dlopen="dlopen"
++    lt_cv_dlopen_libs=
++   ;;
++
++  darwin*)
++  # if libdl is installed we need to link against it
++    AC_CHECK_LIB([dl], [dlopen],
++		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
++    lt_cv_dlopen="dyld"
++    lt_cv_dlopen_libs=
++    lt_cv_dlopen_self=yes
++    ])
++   ;;
++
++  *)
++    AC_CHECK_FUNC([shl_load],
++	  [lt_cv_dlopen="shl_load"],
++      [AC_CHECK_LIB([dld], [shl_load],
++	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
++	[AC_CHECK_FUNC([dlopen],
++	      [lt_cv_dlopen="dlopen"],
++	  [AC_CHECK_LIB([dl], [dlopen],
++		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
++	    [AC_CHECK_LIB([svld], [dlopen],
++		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
++	      [AC_CHECK_LIB([dld], [dld_link],
++		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
++	      ])
++	    ])
++	  ])
++	])
++      ])
++    ;;
++  esac
++
++  if test "x$lt_cv_dlopen" != xno; then
++    enable_dlopen=yes
++  else
++    enable_dlopen=no
++  fi
++
++  case $lt_cv_dlopen in
++  dlopen)
++    save_CPPFLAGS="$CPPFLAGS"
++    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
++
++    save_LDFLAGS="$LDFLAGS"
++    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
++
++    save_LIBS="$LIBS"
++    LIBS="$lt_cv_dlopen_libs $LIBS"
++
++    AC_CACHE_CHECK([whether a program can dlopen itself],
++	  lt_cv_dlopen_self, [dnl
++	  _LT_AC_TRY_DLOPEN_SELF(
++	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
++	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
++    ])
++
++    if test "x$lt_cv_dlopen_self" = xyes; then
++      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
++      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
++    	  lt_cv_dlopen_self_static, [dnl
++	  _LT_AC_TRY_DLOPEN_SELF(
++	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
++	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
++      ])
++    fi
++
++    CPPFLAGS="$save_CPPFLAGS"
++    LDFLAGS="$save_LDFLAGS"
++    LIBS="$save_LIBS"
++    ;;
++  esac
++
++  case $lt_cv_dlopen_self in
++  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
++  *) enable_dlopen_self=unknown ;;
++  esac
++
++  case $lt_cv_dlopen_self_static in
++  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
++  *) enable_dlopen_self_static=unknown ;;
++  esac
++fi
++])# AC_LIBTOOL_DLOPEN_SELF
++
++
++# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
++# ---------------------------------
++# Check to see if options -c and -o are simultaneously supported by compiler
++AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
++[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
++AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
++  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
++  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
++   $rm -r conftest 2>/dev/null
++   mkdir conftest
++   cd conftest
++   mkdir out
++   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
++
++   lt_compiler_flag="-o out/conftest2.$ac_objext"
++   # Insert the option either (1) after the last *FLAGS variable, or
++   # (2) before a word containing "conftest.", or (3) at the end.
++   # Note that $ac_compile itself does not contain backslashes and begins
++   # with a dollar sign (not a hyphen), so the echo should work correctly.
++   lt_compile=`echo "$ac_compile" | $SED \
++   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
++   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
++   -e 's:$: $lt_compiler_flag:'`
++   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
++   (eval "$lt_compile" 2>out/conftest.err)
++   ac_status=$?
++   cat out/conftest.err >&AS_MESSAGE_LOG_FD
++   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
++   if (exit $ac_status) && test -s out/conftest2.$ac_objext
++   then
++     # The compiler can only warn and ignore the option if not recognized
++     # So say no if there are warnings
++     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
++     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
++     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
++       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
++     fi
++   fi
++   chmod u+w . 2>&AS_MESSAGE_LOG_FD
++   $rm conftest*
++   # SGI C++ compiler will create directory out/ii_files/ for
++   # template instantiation
++   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
++   $rm out/* && rmdir out
++   cd ..
++   rmdir conftest
++   $rm conftest*
++])
++])# AC_LIBTOOL_PROG_CC_C_O
++
++
++# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
++# -----------------------------------------
++# Check to see if we can do hard links to lock some files if needed
++AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
++[AC_REQUIRE([_LT_AC_LOCK])dnl
++
++hard_links="nottested"
++if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
++  # do not overwrite the value of need_locks provided by the user
++  AC_MSG_CHECKING([if we can lock with hard links])
++  hard_links=yes
++  $rm conftest*
++  ln conftest.a conftest.b 2>/dev/null && hard_links=no
++  touch conftest.a
++  ln conftest.a conftest.b 2>&5 || hard_links=no
++  ln conftest.a conftest.b 2>/dev/null && hard_links=no
++  AC_MSG_RESULT([$hard_links])
++  if test "$hard_links" = no; then
++    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
++    need_locks=warn
++  fi
++else
++  need_locks=no
++fi
++])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
++
++
++# AC_LIBTOOL_OBJDIR
++# -----------------
++AC_DEFUN([AC_LIBTOOL_OBJDIR],
++[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
++[rm -f .libs 2>/dev/null
++mkdir .libs 2>/dev/null
++if test -d .libs; then
++  lt_cv_objdir=.libs
++else
++  # MS-DOS does not allow filenames that begin with a dot.
++  lt_cv_objdir=_libs
++fi
++rmdir .libs 2>/dev/null])
++objdir=$lt_cv_objdir
++])# AC_LIBTOOL_OBJDIR
++
++
++# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
++# ----------------------------------------------
++# Check hardcoding attributes.
++AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
++[AC_MSG_CHECKING([how to hardcode library paths into programs])
++_LT_AC_TAGVAR(hardcode_action, $1)=
++if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
++   test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
++   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
++
++  # We can hardcode non-existant directories.
++  if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
++     # If the only mechanism to avoid hardcoding is shlibpath_var, we
++     # have to relink, otherwise we might link with an installed library
++     # when we should be linking with a yet-to-be-installed one
++     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
++     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
++    # Linking always hardcodes the temporary library directory.
++    _LT_AC_TAGVAR(hardcode_action, $1)=relink
++  else
++    # We can link without hardcoding, and we can hardcode nonexisting dirs.
++    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
++  fi
++else
++  # We cannot hardcode anything, or else we can only hardcode existing
++  # directories.
++  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
++fi
++AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
++
++if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
++  # Fast installation is not supported
++  enable_fast_install=no
++elif test "$shlibpath_overrides_runpath" = yes ||
++     test "$enable_shared" = no; then
++  # Fast installation is not necessary
++  enable_fast_install=needless
++fi
++])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
++
++
++# AC_LIBTOOL_SYS_LIB_STRIP
++# ------------------------
++AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
++[striplib=
++old_striplib=
++AC_MSG_CHECKING([whether stripping libraries is possible])
++if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
++  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
++  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
++  AC_MSG_RESULT([yes])
++else
++# FIXME - insert some real tests, host_os isn't really good enough
++  case $host_os in
++   darwin*)
++       if test -n "$STRIP" ; then
++         striplib="$STRIP -x"
++         AC_MSG_RESULT([yes])
++       else
++  AC_MSG_RESULT([no])
++fi
++       ;;
++   *)
++  AC_MSG_RESULT([no])
++    ;;
++  esac
++fi
++])# AC_LIBTOOL_SYS_LIB_STRIP
++
++
++# AC_LIBTOOL_SYS_DYNAMIC_LINKER
++# -----------------------------
++# PORTME Fill in your ld.so characteristics
++AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
++[AC_MSG_CHECKING([dynamic linker characteristics])
++library_names_spec=
++libname_spec='lib$name'
++soname_spec=
++shrext_cmds=".so"
++postinstall_cmds=
++postuninstall_cmds=
++finish_cmds=
++finish_eval=
++shlibpath_var=
++shlibpath_overrides_runpath=unknown
++version_type=none
++dynamic_linker="$host_os ld.so"
++sys_lib_dlsearch_path_spec="/lib /usr/lib"
++if test "$GCC" = yes; then
++  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
++  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
++    # if the path contains ";" then we assume it to be the separator
++    # otherwise default to the standard path separator (i.e. ":") - it is
++    # assumed that no part of a normal pathname contains ";" but that should
++    # okay in the real world where ";" in dirpaths is itself problematic.
++    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
++  else
++    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
++  fi
++else
++  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
++fi
++need_lib_prefix=unknown
++hardcode_into_libs=no
++
++# when you set need_version to no, make sure it does not cause -set_version
++# flags to be left without arguments
++need_version=unknown
++
++case $host_os in
++aix3*)
++  version_type=linux
++  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
++  shlibpath_var=LIBPATH
++
++  # AIX 3 has no versioning support, so we append a major version to the name.
++  soname_spec='${libname}${release}${shared_ext}$major'
++  ;;
++
++aix4* | aix5*)
++  version_type=linux
++  need_lib_prefix=no
++  need_version=no
++  hardcode_into_libs=yes
++  if test "$host_cpu" = ia64; then
++    # AIX 5 supports IA64
++    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
++    shlibpath_var=LD_LIBRARY_PATH
++  else
++    # With GCC up to 2.95.x, collect2 would create an import file
++    # for dependence libraries.  The import file would start with
++    # the line `#! .'.  This would cause the generated library to
++    # depend on `.', always an invalid library.  This was fixed in
++    # development snapshots of GCC prior to 3.0.
++    case $host_os in
++      aix4 | aix4.[[01]] | aix4.[[01]].*)
++      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
++	   echo ' yes '
++	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
++	:
++      else
++	can_build_shared=no
++      fi
++      ;;
++    esac
++    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
++    # soname into executable. Probably we can add versioning support to
++    # collect2, so additional links can be useful in future.
++    if test "$aix_use_runtimelinking" = yes; then
++      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
++      # instead of lib<name>.a to let people know that these are not
++      # typical AIX shared libraries.
++      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
++    else
++      # We preserve .a as extension for shared libraries through AIX4.2
++      # and later when we are not doing run time linking.
++      library_names_spec='${libname}${release}.a $libname.a'
++      soname_spec='${libname}${release}${shared_ext}$major'
++    fi
++    shlibpath_var=LIBPATH
++  fi
++  ;;
++
++amigaos*)
++  library_names_spec='$libname.ixlibrary $libname.a'
++  # Create ${libname}_ixlibrary.a entries in /sys/libs.
++  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
++  ;;
++
++beos*)
++  library_names_spec='${libname}${shared_ext}'
++  dynamic_linker="$host_os ld.so"
++  shlibpath_var=LIBRARY_PATH
++  ;;
++
++bsdi[[45]]*)
++  version_type=linux
++  need_version=no
++  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
++  soname_spec='${libname}${release}${shared_ext}$major'
++  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
++  shlibpath_var=LD_LIBRARY_PATH
++  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
++  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
++  # the default ld.so.conf also contains /usr/contrib/lib and
++  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
++  # libtool to hard-code these into programs
++  ;;
++
++cygwin* | mingw* | pw32*)
++  version_type=windows
++  shrext_cmds=".dll"
++  need_version=no
++  need_lib_prefix=no
++
++  case $GCC,$host_os in
++  yes,cygwin* | yes,mingw* | yes,pw32*)
++    library_names_spec='$libname.dll.a'
++    # DLL is installed to $(libdir)/../bin by postinstall_cmds
++    postinstall_cmds='base_file=`basename \${file}`~
++      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
++      dldir=$destdir/`dirname \$dlpath`~
++      test -d \$dldir || mkdir -p \$dldir~
++      $install_prog $dir/$dlname \$dldir/$dlname~
++      chmod a+x \$dldir/$dlname'
++    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
++      dlpath=$dir/\$dldll~
++       $rm \$dlpath'
++    shlibpath_overrides_runpath=yes
++
++    case $host_os in
++    cygwin*)
++      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
++      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
++      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
++      ;;
++    mingw*)
++      # MinGW DLLs use traditional 'lib' prefix
++      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
++      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
++      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
++        # It is most probably a Windows format PATH printed by
++        # mingw gcc, but we are running on Cygwin. Gcc prints its search
++        # path with ; separators, and with drive letters. We can handle the
++        # drive letters (cygwin fileutils understands them), so leave them,
++        # especially as we might pass files found there to a mingw objdump,
++        # which wouldn't understand a cygwinified path. Ahh.
++        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
++      else
++        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
++      fi
++      ;;
++    pw32*)
++      # pw32 DLLs use 'pw' prefix rather than 'lib'
++      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
++      ;;
++    esac
++    ;;
++
++  *)
++    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
++    ;;
++  esac
++  dynamic_linker='Win32 ld.exe'
++  # FIXME: first we should search . and the directory the executable is in
++  shlibpath_var=PATH
++  ;;
++
++darwin* | rhapsody*)
++  dynamic_linker="$host_os dyld"
++  version_type=darwin
++  need_lib_prefix=no
++  need_version=no
++  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
++  soname_spec='${libname}${release}${major}$shared_ext'
++  shlibpath_overrides_runpath=yes
++  shlibpath_var=DYLD_LIBRARY_PATH
++  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
++  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
++  if test "$GCC" = yes; then
++    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
++  else
++    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
++  fi
++  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
++  ;;
++
++dgux*)
++  version_type=linux
++  need_lib_prefix=no
++  need_version=no
++  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
++  soname_spec='${libname}${release}${shared_ext}$major'
++  shlibpath_var=LD_LIBRARY_PATH
++  ;;
++
++freebsd1*)
++  dynamic_linker=no
++  ;;
++
++kfreebsd*-gnu)
++  version_type=linux
++  need_lib_prefix=no
++  need_version=no
++  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
++  soname_spec='${libname}${release}${shared_ext}$major'
++  shlibpath_var=LD_LIBRARY_PATH
++  shlibpath_overrides_runpath=no
++  hardcode_into_libs=yes
++  dynamic_linker='GNU ld.so'
++  ;;
++
++freebsd* | dragonfly*)
++  # DragonFly does not have aout.  When/if they implement a new
++  # versioning mechanism, adjust this.
++  if test -x /usr/bin/objformat; then
++    objformat=`/usr/bin/objformat`
++  else
++    case $host_os in
++    freebsd[[123]]*) objformat=aout ;;
++    *) objformat=elf ;;
++    esac
++  fi
++  version_type=freebsd-$objformat
++  case $version_type in
++    freebsd-elf*)
++      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
++      need_version=no
++      need_lib_prefix=no
++      ;;
++    freebsd-*)
++      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
++      need_version=yes
++      ;;
++  esac
++  shlibpath_var=LD_LIBRARY_PATH
++  case $host_os in
++  freebsd2*)
++    shlibpath_overrides_runpath=yes
++    ;;
++  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
++    shlibpath_overrides_runpath=yes
++    hardcode_into_libs=yes
++    ;;
++  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
++  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
++    shlibpath_overrides_runpath=no
++    hardcode_into_libs=yes
++    ;;
++  freebsd*) # from 4.6 on
++    shlibpath_overrides_runpath=yes
++    hardcode_into_libs=yes
++    ;;
++  esac
++  ;;
++
++gnu*)
++  version_type=linux
++  need_lib_prefix=no
++  need_version=no
++  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
++  soname_spec='${libname}${release}${shared_ext}$major'
++  shlibpath_var=LD_LIBRARY_PATH
++  hardcode_into_libs=yes
++  ;;
++
++hpux9* | hpux10* | hpux11*)
++  # Give a soname corresponding to the major version so that dld.sl refuses to
++  # link against other versions.
++  version_type=sunos
++  need_lib_prefix=no
++  need_version=no
++  case $host_cpu in
++  ia64*)
++    shrext_cmds='.so'
++    hardcode_into_libs=yes
++    dynamic_linker="$host_os dld.so"
++    shlibpath_var=LD_LIBRARY_PATH
++    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
++    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
++    soname_spec='${libname}${release}${shared_ext}$major'
++    if test "X$HPUX_IA64_MODE" = X32; then
++      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
++    else
++      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
++    fi
++    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
++    ;;
++   hppa*64*)
++     shrext_cmds='.sl'
++     hardcode_into_libs=yes
++     dynamic_linker="$host_os dld.sl"
++     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
++     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
++     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
++     soname_spec='${libname}${release}${shared_ext}$major'
++     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
++     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
++     ;;
++   *)
++    shrext_cmds='.sl'
++    dynamic_linker="$host_os dld.sl"
++    shlibpath_var=SHLIB_PATH
++    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
++    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
++    soname_spec='${libname}${release}${shared_ext}$major'
++    ;;
++  esac
++  # HP-UX runs *really* slowly unless shared libraries are mode 555.
++  postinstall_cmds='chmod 555 $lib'
++  ;;
++
++interix3*)
++  version_type=linux
++  need_lib_prefix=no
++  need_version=no
++  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
++  soname_spec='${libname}${release}${shared_ext}$major'
++  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
++  shlibpath_var=LD_LIBRARY_PATH
++  shlibpath_overrides_runpath=no
++  hardcode_into_libs=yes
++  ;;
++
++irix5* | irix6* | nonstopux*)
++  case $host_os in
++    nonstopux*) version_type=nonstopux ;;
++    *)
++	if test "$lt_cv_prog_gnu_ld" = yes; then
++		version_type=linux
++	else
++		version_type=irix
++	fi ;;
++  esac
++  need_lib_prefix=no
++  need_version=no
++  soname_spec='${libname}${release}${shared_ext}$major'
++  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
++  case $host_os in
++  irix5* | nonstopux*)
++    libsuff= shlibsuff=
++    ;;
++  *)
++    case $LD in # libtool.m4 will add one of these switches to LD
++    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
++      libsuff= shlibsuff= libmagic=32-bit;;
++    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
++      libsuff=32 shlibsuff=N32 libmagic=N32;;
++    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
++      libsuff=64 shlibsuff=64 libmagic=64-bit;;
++    *) libsuff= shlibsuff= libmagic=never-match;;
++    esac
++    ;;
++  esac
++  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
++  shlibpath_overrides_runpath=no
++  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
++  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
++  hardcode_into_libs=yes
++  ;;
++
++# No shared lib support for Linux oldld, aout, or coff.
++linux*oldld* | linux*aout* | linux*coff*)
++  dynamic_linker=no
++  ;;
++
++# This must be Linux ELF.
++linux*)
++  version_type=linux
++  need_lib_prefix=no
++  need_version=no
++  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
++  soname_spec='${libname}${release}${shared_ext}$major'
++  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
++  shlibpath_var=LD_LIBRARY_PATH
++  shlibpath_overrides_runpath=no
++  # This implies no fast_install, which is unacceptable.
++  # Some rework will be needed to allow for fast_install
++  # before this can be enabled.
++  hardcode_into_libs=yes
++
++  # find out which ABI we are using
++  libsuff=
++  case "$host_cpu" in
++  x86_64*|s390x*|powerpc64*)
++    echo '[#]line __oline__ "configure"' > conftest.$ac_ext
++    if AC_TRY_EVAL(ac_compile); then
++      case `/usr/bin/file conftest.$ac_objext` in
++      *64-bit*)
++        libsuff=64
++        sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
++        ;;
++      esac
++    fi
++    rm -rf conftest*
++    ;;
++  esac
++
++  # Append ld.so.conf contents to the search path
++  if test -f /etc/ld.so.conf; then
++    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
++    sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
++  fi
++
++  # We used to test for /lib/ld.so.1 and disable shared libraries on
++  # powerpc, because MkLinux only supported shared libraries with the
++  # GNU dynamic linker.  Since this was broken with cross compilers,
++  # most powerpc-linux boxes support dynamic linking these days and
++  # people can always --disable-shared, the test was removed, and we
++  # assume the GNU/Linux dynamic linker is in use.
++  dynamic_linker='GNU/Linux ld.so'
++  ;;
++
++knetbsd*-gnu)
++  version_type=linux
++  need_lib_prefix=no
++  need_version=no
++  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
++  soname_spec='${libname}${release}${shared_ext}$major'
++  shlibpath_var=LD_LIBRARY_PATH
++  shlibpath_overrides_runpath=no
++  hardcode_into_libs=yes
++  dynamic_linker='GNU ld.so'
++  ;;
++
++netbsd*)
++  version_type=sunos
++  need_lib_prefix=no
++  need_version=no
++  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
++    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
++    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
++    dynamic_linker='NetBSD (a.out) ld.so'
++  else
++    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
++    soname_spec='${libname}${release}${shared_ext}$major'
++    dynamic_linker='NetBSD ld.elf_so'
++  fi
++  shlibpath_var=LD_LIBRARY_PATH
++  shlibpath_overrides_runpath=yes
++  hardcode_into_libs=yes
++  ;;
++
++newsos6)
++  version_type=linux
++  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
++  shlibpath_var=LD_LIBRARY_PATH
++  shlibpath_overrides_runpath=yes
++  ;;
++
++nto-qnx*)
++  version_type=linux
++  need_lib_prefix=no
++  need_version=no
++  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
++  soname_spec='${libname}${release}${shared_ext}$major'
++  shlibpath_var=LD_LIBRARY_PATH
++  shlibpath_overrides_runpath=yes
++  ;;
++
++openbsd*)
++  version_type=sunos
++  sys_lib_dlsearch_path_spec="/usr/lib"
++  need_lib_prefix=no
++  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
++  case $host_os in
++    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
++    *)                         need_version=no  ;;
++  esac
++  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
++  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
++  shlibpath_var=LD_LIBRARY_PATH
++  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
++    case $host_os in
++      openbsd2.[[89]] | openbsd2.[[89]].*)
++	shlibpath_overrides_runpath=no
++	;;
++      *)
++	shlibpath_overrides_runpath=yes
++	;;
++      esac
++  else
++    shlibpath_overrides_runpath=yes
++  fi
++  ;;
++
++os2*)
++  libname_spec='$name'
++  shrext_cmds=".dll"
++  need_lib_prefix=no
++  library_names_spec='$libname${shared_ext} $libname.a'
++  dynamic_linker='OS/2 ld.exe'
++  shlibpath_var=LIBPATH
++  ;;
++
++osf3* | osf4* | osf5*)
++  version_type=osf
++  need_lib_prefix=no
++  need_version=no
++  soname_spec='${libname}${release}${shared_ext}$major'
++  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
++  shlibpath_var=LD_LIBRARY_PATH
++  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
++  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
++  ;;
++
++solaris*)
++  version_type=linux
++  need_lib_prefix=no
++  need_version=no
++  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
++  soname_spec='${libname}${release}${shared_ext}$major'
++  shlibpath_var=LD_LIBRARY_PATH
++  shlibpath_overrides_runpath=yes
++  hardcode_into_libs=yes
++  # ldd complains unless libraries are executable
++  postinstall_cmds='chmod +x $lib'
++  ;;
++
++sunos4*)
++  version_type=sunos
++  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
++  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
++  shlibpath_var=LD_LIBRARY_PATH
++  shlibpath_overrides_runpath=yes
++  if test "$with_gnu_ld" = yes; then
++    need_lib_prefix=no
++  fi
++  need_version=yes
++  ;;
++
++sysv4 | sysv4.3*)
++  version_type=linux
++  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
++  soname_spec='${libname}${release}${shared_ext}$major'
++  shlibpath_var=LD_LIBRARY_PATH
++  case $host_vendor in
++    sni)
++      shlibpath_overrides_runpath=no
++      need_lib_prefix=no
++      export_dynamic_flag_spec='${wl}-Blargedynsym'
++      runpath_var=LD_RUN_PATH
++      ;;
++    siemens)
++      need_lib_prefix=no
++      ;;
++    motorola)
++      need_lib_prefix=no
++      need_version=no
++      shlibpath_overrides_runpath=no
++      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
++      ;;
++  esac
++  ;;
++
++sysv4*MP*)
++  if test -d /usr/nec ;then
++    version_type=linux
++    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
++    soname_spec='$libname${shared_ext}.$major'
++    shlibpath_var=LD_LIBRARY_PATH
++  fi
++  ;;
++
++sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
++  version_type=freebsd-elf
++  need_lib_prefix=no
++  need_version=no
++  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
++  soname_spec='${libname}${release}${shared_ext}$major'
++  shlibpath_var=LD_LIBRARY_PATH
++  hardcode_into_libs=yes
++  if test "$with_gnu_ld" = yes; then
++    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
++    shlibpath_overrides_runpath=no
++  else
++    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
++    shlibpath_overrides_runpath=yes
++    case $host_os in
++      sco3.2v5*)
++        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
++	;;
++    esac
++  fi
++  sys_lib_dlsearch_path_spec='/usr/lib'
++  ;;
++
++uts4*)
++  version_type=linux
++  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
++  soname_spec='${libname}${release}${shared_ext}$major'
++  shlibpath_var=LD_LIBRARY_PATH
++  ;;
++
++*)
++  dynamic_linker=no
++  ;;
++esac
++AC_MSG_RESULT([$dynamic_linker])
++test "$dynamic_linker" = no && can_build_shared=no
++
++variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
++if test "$GCC" = yes; then
++  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
++fi
++])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
++
++
++# _LT_AC_TAGCONFIG
++# ----------------
++AC_DEFUN([_LT_AC_TAGCONFIG],
++[AC_ARG_WITH([tags],
++    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
++        [include additional configurations @<:@automatic@:>@])],
++    [tagnames="$withval"])
++
++if test -f "$ltmain" && test -n "$tagnames"; then
++  if test ! -f "${ofile}"; then
++    AC_MSG_WARN([output file `$ofile' does not exist])
++  fi
++
++  if test -z "$LTCC"; then
++    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
++    if test -z "$LTCC"; then
++      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
++    else
++      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
++    fi
++  fi
++  if test -z "$LTCFLAGS"; then
++    eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
++  fi
++
++  # Extract list of available tagged configurations in $ofile.
++  # Note that this assumes the entire list is on one line.
++  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
++
++  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
++  for tagname in $tagnames; do
++    IFS="$lt_save_ifs"
++    # Check whether tagname contains only valid characters
++    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
++    "") ;;
++    *)  AC_MSG_ERROR([invalid tag name: $tagname])
++	;;
++    esac
++
++    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
++    then
++      AC_MSG_ERROR([tag name \"$tagname\" already exists])
++    fi
++
++    # Update the list of available tags.
++    if test -n "$tagname"; then
++      echo appending configuration tag \"$tagname\" to $ofile
++
++      case $tagname in
++      CXX)
++	if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
++	    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
++	    (test "X$CXX" != "Xg++"))) ; then
++	  AC_LIBTOOL_LANG_CXX_CONFIG
++	else
++	  tagname=""
++	fi
++	;;
++
++      F77)
++	if test -n "$F77" && test "X$F77" != "Xno"; then
++	  AC_LIBTOOL_LANG_F77_CONFIG
++	else
++	  tagname=""
++	fi
++	;;
++
++      GCJ)
++	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
++	  AC_LIBTOOL_LANG_GCJ_CONFIG
++	else
++	  tagname=""
++	fi
++	;;
++
++      RC)
++	AC_LIBTOOL_LANG_RC_CONFIG
++	;;
++
++      *)
++	AC_MSG_ERROR([Unsupported tag name: $tagname])
++	;;
++      esac
++
++      # Append the new tag name to the list of available tags.
++      if test -n "$tagname" ; then
++      available_tags="$available_tags $tagname"
++    fi
++    fi
++  done
++  IFS="$lt_save_ifs"
++
++  # Now substitute the updated list of available tags.
++  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
++    mv "${ofile}T" "$ofile"
++    chmod +x "$ofile"
++  else
++    rm -f "${ofile}T"
++    AC_MSG_ERROR([unable to update list of available tagged configurations.])
++  fi
++fi
++])# _LT_AC_TAGCONFIG
++
++
++# AC_LIBTOOL_DLOPEN
++# -----------------
++# enable checks for dlopen support
++AC_DEFUN([AC_LIBTOOL_DLOPEN],
++ [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
++])# AC_LIBTOOL_DLOPEN
++
++
++# AC_LIBTOOL_WIN32_DLL
++# --------------------
++# declare package support for building win32 DLLs
++AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
++[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
++])# AC_LIBTOOL_WIN32_DLL
++
++
++# AC_ENABLE_SHARED([DEFAULT])
++# ---------------------------
++# implement the --enable-shared flag
++# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
++AC_DEFUN([AC_ENABLE_SHARED],
++[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
++AC_ARG_ENABLE([shared],
++    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
++	[build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
++    [p=${PACKAGE-default}
++    case $enableval in
++    yes) enable_shared=yes ;;
++    no) enable_shared=no ;;
++    *)
++      enable_shared=no
++      # Look at the argument we got.  We use all the common list separators.
++      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
++      for pkg in $enableval; do
++	IFS="$lt_save_ifs"
++	if test "X$pkg" = "X$p"; then
++	  enable_shared=yes
++	fi
++      done
++      IFS="$lt_save_ifs"
++      ;;
++    esac],
++    [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
++])# AC_ENABLE_SHARED
++
++
++# AC_DISABLE_SHARED
++# -----------------
++# set the default shared flag to --disable-shared
++AC_DEFUN([AC_DISABLE_SHARED],
++[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
++AC_ENABLE_SHARED(no)
++])# AC_DISABLE_SHARED
++
++
++# AC_ENABLE_STATIC([DEFAULT])
++# ---------------------------
++# implement the --enable-static flag
++# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
++AC_DEFUN([AC_ENABLE_STATIC],
++[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
++AC_ARG_ENABLE([static],
++    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
++	[build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
++    [p=${PACKAGE-default}
++    case $enableval in
++    yes) enable_static=yes ;;
++    no) enable_static=no ;;
++    *)
++     enable_static=no
++      # Look at the argument we got.  We use all the common list separators.
++      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
++      for pkg in $enableval; do
++	IFS="$lt_save_ifs"
++	if test "X$pkg" = "X$p"; then
++	  enable_static=yes
++	fi
++      done
++      IFS="$lt_save_ifs"
++      ;;
++    esac],
++    [enable_static=]AC_ENABLE_STATIC_DEFAULT)
++])# AC_ENABLE_STATIC
++
++
++# AC_DISABLE_STATIC
++# -----------------
++# set the default static flag to --disable-static
++AC_DEFUN([AC_DISABLE_STATIC],
++[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
++AC_ENABLE_STATIC(no)
++])# AC_DISABLE_STATIC
++
++
++# AC_ENABLE_FAST_INSTALL([DEFAULT])
++# ---------------------------------
++# implement the --enable-fast-install flag
++# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
++AC_DEFUN([AC_ENABLE_FAST_INSTALL],
++[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
++AC_ARG_ENABLE([fast-install],
++    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
++    [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
++    [p=${PACKAGE-default}
++    case $enableval in
++    yes) enable_fast_install=yes ;;
++    no) enable_fast_install=no ;;
++    *)
++      enable_fast_install=no
++      # Look at the argument we got.  We use all the common list separators.
++      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
++      for pkg in $enableval; do
++	IFS="$lt_save_ifs"
++	if test "X$pkg" = "X$p"; then
++	  enable_fast_install=yes
++	fi
++      done
++      IFS="$lt_save_ifs"
++      ;;
++    esac],
++    [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
++])# AC_ENABLE_FAST_INSTALL
++
++
++# AC_DISABLE_FAST_INSTALL
++# -----------------------
++# set the default to --disable-fast-install
++AC_DEFUN([AC_DISABLE_FAST_INSTALL],
++[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
++AC_ENABLE_FAST_INSTALL(no)
++])# AC_DISABLE_FAST_INSTALL
++
++
++# AC_LIBTOOL_PICMODE([MODE])
++# --------------------------
++# implement the --with-pic flag
++# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
++AC_DEFUN([AC_LIBTOOL_PICMODE],
++[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
++pic_mode=ifelse($#,1,$1,default)
++])# AC_LIBTOOL_PICMODE
++
++
++# AC_PROG_EGREP
++# -------------
++# This is predefined starting with Autoconf 2.54, so this conditional
++# definition can be removed once we require Autoconf 2.54 or later.
++m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
++[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
++   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
++    then ac_cv_prog_egrep='grep -E'
++    else ac_cv_prog_egrep='egrep'
++    fi])
++ EGREP=$ac_cv_prog_egrep
++ AC_SUBST([EGREP])
++])])
++
++
++# AC_PATH_TOOL_PREFIX
++# -------------------
++# find a file program which can recognise shared library
++AC_DEFUN([AC_PATH_TOOL_PREFIX],
++[AC_REQUIRE([AC_PROG_EGREP])dnl
++AC_MSG_CHECKING([for $1])
++AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
++[case $MAGIC_CMD in
++[[\\/*] |  ?:[\\/]*])
++  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
++  ;;
++*)
++  lt_save_MAGIC_CMD="$MAGIC_CMD"
++  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
++dnl $ac_dummy forces splitting on constant user-supplied paths.
++dnl POSIX.2 word splitting is done only on the output of word expansions,
++dnl not every word.  This closes a longstanding sh security hole.
++  ac_dummy="ifelse([$2], , $PATH, [$2])"
++  for ac_dir in $ac_dummy; do
++    IFS="$lt_save_ifs"
++    test -z "$ac_dir" && ac_dir=.
++    if test -f $ac_dir/$1; then
++      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
++      if test -n "$file_magic_test_file"; then
++	case $deplibs_check_method in
++	"file_magic "*)
++	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
++	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
++	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
++	    $EGREP "$file_magic_regex" > /dev/null; then
++	    :
++	  else
++	    cat <<EOF 1>&2
++
++*** Warning: the command libtool uses to detect shared libraries,
++*** $file_magic_cmd, produces output that libtool cannot recognize.
++*** The result is that libtool may fail to recognize shared libraries
++*** as such.  This will affect the creation of libtool libraries that
++*** depend on shared libraries, but programs linked with such libtool
++*** libraries will work regardless of this problem.  Nevertheless, you
++*** may want to report the problem to your system manager and/or to
++*** bug-libtool at gnu.org
++
++EOF
++	  fi ;;
++	esac
++      fi
++      break
++    fi
++  done
++  IFS="$lt_save_ifs"
++  MAGIC_CMD="$lt_save_MAGIC_CMD"
++  ;;
++esac])
++MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
++if test -n "$MAGIC_CMD"; then
++  AC_MSG_RESULT($MAGIC_CMD)
++else
++  AC_MSG_RESULT(no)
++fi
++])# AC_PATH_TOOL_PREFIX
++
++
++# AC_PATH_MAGIC
++# -------------
++# find a file program which can recognise a shared library
++AC_DEFUN([AC_PATH_MAGIC],
++[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
++if test -z "$lt_cv_path_MAGIC_CMD"; then
++  if test -n "$ac_tool_prefix"; then
++    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
++  else
++    MAGIC_CMD=:
++  fi
++fi
++])# AC_PATH_MAGIC
++
++
++# AC_PROG_LD
++# ----------
++# find the pathname to the GNU or non-GNU linker
++AC_DEFUN([AC_PROG_LD],
++[AC_ARG_WITH([gnu-ld],
++    [AC_HELP_STRING([--with-gnu-ld],
++	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
++    [test "$withval" = no || with_gnu_ld=yes],
++    [with_gnu_ld=no])
++AC_REQUIRE([LT_AC_PROG_SED])dnl
++AC_REQUIRE([AC_PROG_CC])dnl
++AC_REQUIRE([AC_CANONICAL_HOST])dnl
++AC_REQUIRE([AC_CANONICAL_BUILD])dnl
++ac_prog=ld
++if test "$GCC" = yes; then
++  # Check if gcc -print-prog-name=ld gives a path.
++  AC_MSG_CHECKING([for ld used by $CC])
++  case $host in
++  *-*-mingw*)
++    # gcc leaves a trailing carriage return which upsets mingw
++    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
++  *)
++    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
++  esac
++  case $ac_prog in
++    # Accept absolute paths.
++    [[\\/]]* | ?:[[\\/]]*)
++      re_direlt='/[[^/]][[^/]]*/\.\./'
++      # Canonicalize the pathname of ld
++      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
++      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
++	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
++      done
++      test -z "$LD" && LD="$ac_prog"
++      ;;
++  "")
++    # If it fails, then pretend we aren't using GCC.
++    ac_prog=ld
++    ;;
++  *)
++    # If it is relative, then search for the first ld in PATH.
++    with_gnu_ld=unknown
++    ;;
++  esac
++elif test "$with_gnu_ld" = yes; then
++  AC_MSG_CHECKING([for GNU ld])
++else
++  AC_MSG_CHECKING([for non-GNU ld])
++fi
++AC_CACHE_VAL(lt_cv_path_LD,
++[if test -z "$LD"; then
++  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
++  for ac_dir in $PATH; do
++    IFS="$lt_save_ifs"
++    test -z "$ac_dir" && ac_dir=.
++    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
++      lt_cv_path_LD="$ac_dir/$ac_prog"
++      # Check to see if the program is GNU ld.  I'd rather use --version,
++      # but apparently some variants of GNU ld only accept -v.
++      # Break only if it was the GNU/non-GNU ld that we prefer.
++      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
++      *GNU* | *'with BFD'*)
++	test "$with_gnu_ld" != no && break
++	;;
++      *)
++	test "$with_gnu_ld" != yes && break
++	;;
++      esac
++    fi
++  done
++  IFS="$lt_save_ifs"
++else
++  lt_cv_path_LD="$LD" # Let the user override the test with a path.
++fi])
++LD="$lt_cv_path_LD"
++if test -n "$LD"; then
++  AC_MSG_RESULT($LD)
++else
++  AC_MSG_RESULT(no)
++fi
++test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
++AC_PROG_LD_GNU
++])# AC_PROG_LD
++
++
++# AC_PROG_LD_GNU
++# --------------
++AC_DEFUN([AC_PROG_LD_GNU],
++[AC_REQUIRE([AC_PROG_EGREP])dnl
++AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
++[# I'd rather use --version here, but apparently some GNU lds only accept -v.
++case `$LD -v 2>&1 </dev/null` in
++*GNU* | *'with BFD'*)
++  lt_cv_prog_gnu_ld=yes
++  ;;
++*)
++  lt_cv_prog_gnu_ld=no
++  ;;
++esac])
++with_gnu_ld=$lt_cv_prog_gnu_ld
++])# AC_PROG_LD_GNU
++
++
++# AC_PROG_LD_RELOAD_FLAG
++# ----------------------
++# find reload flag for linker
++#   -- PORTME Some linkers may need a different reload flag.
++AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
++[AC_CACHE_CHECK([for $LD option to reload object files],
++  lt_cv_ld_reload_flag,
++  [lt_cv_ld_reload_flag='-r'])
++reload_flag=$lt_cv_ld_reload_flag
++case $reload_flag in
++"" | " "*) ;;
++*) reload_flag=" $reload_flag" ;;
++esac
++reload_cmds='$LD$reload_flag -o $output$reload_objs'
++case $host_os in
++  darwin*)
++    if test "$GCC" = yes; then
++      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
++    else
++      reload_cmds='$LD$reload_flag -o $output$reload_objs'
++    fi
++    ;;
++esac
++])# AC_PROG_LD_RELOAD_FLAG
++
++
++# AC_DEPLIBS_CHECK_METHOD
++# -----------------------
++# how to check for library dependencies
++#  -- PORTME fill in with the dynamic library characteristics
++AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
++[AC_CACHE_CHECK([how to recognise dependent libraries],
++lt_cv_deplibs_check_method,
++[lt_cv_file_magic_cmd='$MAGIC_CMD'
++lt_cv_file_magic_test_file=
++lt_cv_deplibs_check_method='unknown'
++# Need to set the preceding variable on all platforms that support
++# interlibrary dependencies.
++# 'none' -- dependencies not supported.
++# `unknown' -- same as none, but documents that we really don't know.
++# 'pass_all' -- all dependencies passed with no checks.
++# 'test_compile' -- check by making test program.
++# 'file_magic [[regex]]' -- check by looking for files in library path
++# which responds to the $file_magic_cmd with a given extended regex.
++# If you have `file' or equivalent on your system and you're not sure
++# whether `pass_all' will *always* work, you probably want this one.
++
++case $host_os in
++aix4* | aix5*)
++  lt_cv_deplibs_check_method=pass_all
++  ;;
++
++beos*)
++  lt_cv_deplibs_check_method=pass_all
++  ;;
++
++bsdi[[45]]*)
++  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
++  lt_cv_file_magic_cmd='/usr/bin/file -L'
++  lt_cv_file_magic_test_file=/shlib/libc.so
++  ;;
++
++cygwin*)
++  # func_win32_libid is a shell function defined in ltmain.sh
++  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
++  lt_cv_file_magic_cmd='func_win32_libid'
++  ;;
++
++mingw* | pw32*)
++  # Base MSYS/MinGW do not provide the 'file' command needed by
++  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
++  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
++  lt_cv_file_magic_cmd='$OBJDUMP -f'
++  ;;
++
++darwin* | rhapsody*)
++  lt_cv_deplibs_check_method=pass_all
++  ;;
++
++freebsd* | kfreebsd*-gnu | dragonfly*)
++  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
++    case $host_cpu in
++    i*86 )
++      # Not sure whether the presence of OpenBSD here was a mistake.
++      # Let's accept both of them until this is cleared up.
++      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
++      lt_cv_file_magic_cmd=/usr/bin/file
++      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
++      ;;
++    esac
++  else
++    lt_cv_deplibs_check_method=pass_all
++  fi
++  ;;
++
++gnu*)
++  lt_cv_deplibs_check_method=pass_all
++  ;;
++
++hpux10.20* | hpux11*)
++  lt_cv_file_magic_cmd=/usr/bin/file
++  case $host_cpu in
++  ia64*)
++    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
++    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
++    ;;
++  hppa*64*)
++    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
++    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
++    ;;
++  *)
++    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
++    lt_cv_file_magic_test_file=/usr/lib/libc.sl
++    ;;
++  esac
++  ;;
++
++interix3*)
++  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
++  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
++  ;;
++
++irix5* | irix6* | nonstopux*)
++  case $LD in
++  *-32|*"-32 ") libmagic=32-bit;;
++  *-n32|*"-n32 ") libmagic=N32;;
++  *-64|*"-64 ") libmagic=64-bit;;
++  *) libmagic=never-match;;
++  esac
++  lt_cv_deplibs_check_method=pass_all
++  ;;
++
++# This must be Linux ELF.
++linux*)
++  lt_cv_deplibs_check_method=pass_all
++  ;;
++
++netbsd*)
++  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
++    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
++  else
++    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
++  fi
++  ;;
++
++newos6*)
++  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
++  lt_cv_file_magic_cmd=/usr/bin/file
++  lt_cv_file_magic_test_file=/usr/lib/libnls.so
++  ;;
++
++nto-qnx*)
++  lt_cv_deplibs_check_method=unknown
++  ;;
++
++openbsd*)
++  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
++    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
++  else
++    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
++  fi
++  ;;
++
++osf3* | osf4* | osf5*)
++  lt_cv_deplibs_check_method=pass_all
++  ;;
++
++solaris*)
++  lt_cv_deplibs_check_method=pass_all
++  ;;
++
++sysv4 | sysv4.3*)
++  case $host_vendor in
++  motorola)
++    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
++    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
++    ;;
++  ncr)
++    lt_cv_deplibs_check_method=pass_all
++    ;;
++  sequent)
++    lt_cv_file_magic_cmd='/bin/file'
++    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
++    ;;
++  sni)
++    lt_cv_file_magic_cmd='/bin/file'
++    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
++    lt_cv_file_magic_test_file=/lib/libc.so
++    ;;
++  siemens)
++    lt_cv_deplibs_check_method=pass_all
++    ;;
++  pc)
++    lt_cv_deplibs_check_method=pass_all
++    ;;
++  esac
++  ;;
++
++sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
++  lt_cv_deplibs_check_method=pass_all
++  ;;
++esac
++])
++file_magic_cmd=$lt_cv_file_magic_cmd
++deplibs_check_method=$lt_cv_deplibs_check_method
++test -z "$deplibs_check_method" && deplibs_check_method=unknown
++])# AC_DEPLIBS_CHECK_METHOD
++
++
++# AC_PROG_NM
++# ----------
++# find the pathname to a BSD-compatible name lister
++AC_DEFUN([AC_PROG_NM],
++[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
++[if test -n "$NM"; then
++  # Let the user override the test.
++  lt_cv_path_NM="$NM"
++else
++  lt_nm_to_check="${ac_tool_prefix}nm"
++  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then 
++    lt_nm_to_check="$lt_nm_to_check nm"
++  fi
++  for lt_tmp_nm in $lt_nm_to_check; do
++    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
++    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
++      IFS="$lt_save_ifs"
++      test -z "$ac_dir" && ac_dir=.
++      tmp_nm="$ac_dir/$lt_tmp_nm"
++      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
++	# Check to see if the nm accepts a BSD-compat flag.
++	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
++	#   nm: unknown option "B" ignored
++	# Tru64's nm complains that /dev/null is an invalid object file
++	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
++	*/dev/null* | *'Invalid file or object type'*)
++	  lt_cv_path_NM="$tmp_nm -B"
++	  break
++	  ;;
++	*)
++	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
++	  */dev/null*)
++	    lt_cv_path_NM="$tmp_nm -p"
++	    break
++	    ;;
++	  *)
++	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
++	    continue # so that we can try to find one that supports BSD flags
++	    ;;
++	  esac
++	  ;;
++	esac
++      fi
++    done
++    IFS="$lt_save_ifs"
++  done
++  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
++fi])
++NM="$lt_cv_path_NM"
++])# AC_PROG_NM
++
++
++# AC_CHECK_LIBM
++# -------------
++# check for math library
++AC_DEFUN([AC_CHECK_LIBM],
++[AC_REQUIRE([AC_CANONICAL_HOST])dnl
++LIBM=
++case $host in
++*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
++  # These system don't have libm, or don't need it
++  ;;
++*-ncr-sysv4.3*)
++  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
++  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
++  ;;
++*)
++  AC_CHECK_LIB(m, cos, LIBM="-lm")
++  ;;
++esac
++])# AC_CHECK_LIBM
++
++
++# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
++# -----------------------------------
++# sets LIBLTDL to the link flags for the libltdl convenience library and
++# LTDLINCL to the include flags for the libltdl header and adds
++# --enable-ltdl-convenience to the configure arguments.  Note that
++# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
++# it is assumed to be `libltdl'.  LIBLTDL will be prefixed with
++# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
++# (note the single quotes!).  If your package is not flat and you're not
++# using automake, define top_builddir and top_srcdir appropriately in
++# the Makefiles.
++AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
++[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
++  case $enable_ltdl_convenience in
++  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
++  "") enable_ltdl_convenience=yes
++      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
++  esac
++  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
++  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
++  # For backwards non-gettext consistent compatibility...
++  INCLTDL="$LTDLINCL"
++])# AC_LIBLTDL_CONVENIENCE
++
++
++# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
++# -----------------------------------
++# sets LIBLTDL to the link flags for the libltdl installable library and
++# LTDLINCL to the include flags for the libltdl header and adds
++# --enable-ltdl-install to the configure arguments.  Note that
++# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
++# and an installed libltdl is not found, it is assumed to be `libltdl'.
++# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
++# '${top_srcdir}/' (note the single quotes!).  If your package is not
++# flat and you're not using automake, define top_builddir and top_srcdir
++# appropriately in the Makefiles.
++# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
++AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
++[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
++  AC_CHECK_LIB(ltdl, lt_dlinit,
++  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
++  [if test x"$enable_ltdl_install" = xno; then
++     AC_MSG_WARN([libltdl not installed, but installation disabled])
++   else
++     enable_ltdl_install=yes
++   fi
++  ])
++  if test x"$enable_ltdl_install" = x"yes"; then
++    ac_configure_args="$ac_configure_args --enable-ltdl-install"
++    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
++    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
++  else
++    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
++    LIBLTDL="-lltdl"
++    LTDLINCL=
++  fi
++  # For backwards non-gettext consistent compatibility...
++  INCLTDL="$LTDLINCL"
++])# AC_LIBLTDL_INSTALLABLE
++
++
++# AC_LIBTOOL_CXX
++# --------------
++# enable support for C++ libraries
++AC_DEFUN([AC_LIBTOOL_CXX],
++[AC_REQUIRE([_LT_AC_LANG_CXX])
++])# AC_LIBTOOL_CXX
++
++
++# _LT_AC_LANG_CXX
++# ---------------
++AC_DEFUN([_LT_AC_LANG_CXX],
++[AC_REQUIRE([AC_PROG_CXX])
++AC_REQUIRE([_LT_AC_PROG_CXXCPP])
++_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
++])# _LT_AC_LANG_CXX
++
++# _LT_AC_PROG_CXXCPP
++# ------------------
++AC_DEFUN([_LT_AC_PROG_CXXCPP],
++[
++AC_REQUIRE([AC_PROG_CXX])
++if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
++    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
++    (test "X$CXX" != "Xg++"))) ; then
++  AC_PROG_CXXCPP
++fi
++])# _LT_AC_PROG_CXXCPP
++
++# AC_LIBTOOL_F77
++# --------------
++# enable support for Fortran 77 libraries
++AC_DEFUN([AC_LIBTOOL_F77],
++[AC_REQUIRE([_LT_AC_LANG_F77])
++])# AC_LIBTOOL_F77
++
++
++# _LT_AC_LANG_F77
++# ---------------
++AC_DEFUN([_LT_AC_LANG_F77],
++[AC_REQUIRE([AC_PROG_F77])
++_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
++])# _LT_AC_LANG_F77
++
++
++# AC_LIBTOOL_GCJ
++# --------------
++# enable support for GCJ libraries
++AC_DEFUN([AC_LIBTOOL_GCJ],
++[AC_REQUIRE([_LT_AC_LANG_GCJ])
++])# AC_LIBTOOL_GCJ
++
++
++# _LT_AC_LANG_GCJ
++# ---------------
++AC_DEFUN([_LT_AC_LANG_GCJ],
++[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
++  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
++    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
++      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
++	 [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
++	   [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
++_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
++])# _LT_AC_LANG_GCJ
++
++
++# AC_LIBTOOL_RC
++# -------------
++# enable support for Windows resource files
++AC_DEFUN([AC_LIBTOOL_RC],
++[AC_REQUIRE([LT_AC_PROG_RC])
++_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
++])# AC_LIBTOOL_RC
++
++
++# AC_LIBTOOL_LANG_C_CONFIG
++# ------------------------
++# Ensure that the configuration vars for the C compiler are
++# suitably defined.  Those variables are subsequently used by
++# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
++AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
++AC_DEFUN([_LT_AC_LANG_C_CONFIG],
++[lt_save_CC="$CC"
++AC_LANG_PUSH(C)
++
++# Source file extension for C test sources.
++ac_ext=c
++
++# Object file extension for compiled C test sources.
++objext=o
++_LT_AC_TAGVAR(objext, $1)=$objext
++
++# Code to be used in simple compile tests
++lt_simple_compile_test_code="int some_variable = 0;\n"
++
++# Code to be used in simple link tests
++lt_simple_link_test_code='int main(){return(0);}\n'
++
++_LT_AC_SYS_COMPILER
++
++# save warnings/boilerplate of simple test code
++_LT_COMPILER_BOILERPLATE
++_LT_LINKER_BOILERPLATE
++
++AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
++AC_LIBTOOL_PROG_COMPILER_PIC($1)
++AC_LIBTOOL_PROG_CC_C_O($1)
++AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
++AC_LIBTOOL_PROG_LD_SHLIBS($1)
++AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
++AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
++AC_LIBTOOL_SYS_LIB_STRIP
++AC_LIBTOOL_DLOPEN_SELF
++
++# Report which library types will actually be built
++AC_MSG_CHECKING([if libtool supports shared libraries])
++AC_MSG_RESULT([$can_build_shared])
++
++AC_MSG_CHECKING([whether to build shared libraries])
++test "$can_build_shared" = "no" && enable_shared=no
++
++# On AIX, shared libraries and static libraries use the same namespace, and
++# are all built from PIC.
++case $host_os in
++aix3*)
++  test "$enable_shared" = yes && enable_static=no
++  if test -n "$RANLIB"; then
++    archive_cmds="$archive_cmds~\$RANLIB \$lib"
++    postinstall_cmds='$RANLIB $lib'
++  fi
++  ;;
++
++aix4* | aix5*)
++  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
++    test "$enable_shared" = yes && enable_static=no
++  fi
++    ;;
++esac
++AC_MSG_RESULT([$enable_shared])
++
++AC_MSG_CHECKING([whether to build static libraries])
++# Make sure either enable_shared or enable_static is yes.
++test "$enable_shared" = yes || enable_static=yes
++AC_MSG_RESULT([$enable_static])
++
++AC_LIBTOOL_CONFIG($1)
++
++AC_LANG_POP
++CC="$lt_save_CC"
++])# AC_LIBTOOL_LANG_C_CONFIG
++
++
++# AC_LIBTOOL_LANG_CXX_CONFIG
++# --------------------------
++# Ensure that the configuration vars for the C compiler are
++# suitably defined.  Those variables are subsequently used by
++# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
++AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
++AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
++[AC_LANG_PUSH(C++)
++AC_REQUIRE([AC_PROG_CXX])
++AC_REQUIRE([_LT_AC_PROG_CXXCPP])
++
++_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
++_LT_AC_TAGVAR(allow_undefined_flag, $1)=
++_LT_AC_TAGVAR(always_export_symbols, $1)=no
++_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
++_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
++_LT_AC_TAGVAR(hardcode_direct, $1)=no
++_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
++_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
++_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
++_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
++_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
++_LT_AC_TAGVAR(hardcode_automatic, $1)=no
++_LT_AC_TAGVAR(module_cmds, $1)=
++_LT_AC_TAGVAR(module_expsym_cmds, $1)=
++_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
++_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
++_LT_AC_TAGVAR(no_undefined_flag, $1)=
++_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
++_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
++
++# Dependencies to place before and after the object being linked:
++_LT_AC_TAGVAR(predep_objects, $1)=
++_LT_AC_TAGVAR(postdep_objects, $1)=
++_LT_AC_TAGVAR(predeps, $1)=
++_LT_AC_TAGVAR(postdeps, $1)=
++_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
++
++# Source file extension for C++ test sources.
++ac_ext=cpp
++
++# Object file extension for compiled C++ test sources.
++objext=o
++_LT_AC_TAGVAR(objext, $1)=$objext
++
++# Code to be used in simple compile tests
++lt_simple_compile_test_code="int some_variable = 0;\n"
++
++# Code to be used in simple link tests
++lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n'
++
++# ltmain only uses $CC for tagged configurations so make sure $CC is set.
++_LT_AC_SYS_COMPILER
++
++# save warnings/boilerplate of simple test code
++_LT_COMPILER_BOILERPLATE
++_LT_LINKER_BOILERPLATE
++
++# Allow CC to be a program name with arguments.
++lt_save_CC=$CC
++lt_save_LD=$LD
++lt_save_GCC=$GCC
++GCC=$GXX
++lt_save_with_gnu_ld=$with_gnu_ld
++lt_save_path_LD=$lt_cv_path_LD
++if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
++  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
++else
++  $as_unset lt_cv_prog_gnu_ld
++fi
++if test -n "${lt_cv_path_LDCXX+set}"; then
++  lt_cv_path_LD=$lt_cv_path_LDCXX
++else
++  $as_unset lt_cv_path_LD
++fi
++test -z "${LDCXX+set}" || LD=$LDCXX
++CC=${CXX-"c++"}
++compiler=$CC
++_LT_AC_TAGVAR(compiler, $1)=$CC
++_LT_CC_BASENAME([$compiler])
++
++# We don't want -fno-exception wen compiling C++ code, so set the
++# no_builtin_flag separately
++if test "$GXX" = yes; then
++  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
++else
++  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
++fi
++
++if test "$GXX" = yes; then
++  # Set up default GNU C++ configuration
++
++  AC_PROG_LD
++
++  # Check if GNU C++ uses GNU ld as the underlying linker, since the
++  # archiving commands below assume that GNU ld is being used.
++  if test "$with_gnu_ld" = yes; then
++    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
++    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++
++    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
++    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
++
++    # If archive_cmds runs LD, not CC, wlarc should be empty
++    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
++    #     investigate it a little bit more. (MM)
++    wlarc='${wl}'
++
++    # ancient GNU ld didn't support --whole-archive et. al.
++    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
++	grep 'no-whole-archive' > /dev/null; then
++      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
++    else
++      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
++    fi
++  else
++    with_gnu_ld=no
++    wlarc=
++
++    # A generic and very simple default shared library creation
++    # command for GNU C++ for the case where it uses the native
++    # linker, instead of GNU ld.  If possible, this setting should
++    # overridden to take advantage of the native linker features on
++    # the platform it is being used on.
++    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
++  fi
++
++  # Commands to make compiler produce verbose output that lists
++  # what "hidden" libraries, object files and flags are used when
++  # linking a shared library.
++  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
++
++else
++  GXX=no
++  with_gnu_ld=no
++  wlarc=
++fi
++
++# PORTME: fill in a description of your system's C++ link characteristics
++AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
++_LT_AC_TAGVAR(ld_shlibs, $1)=yes
++case $host_os in
++  aix3*)
++    # FIXME: insert proper C++ library support
++    _LT_AC_TAGVAR(ld_shlibs, $1)=no
++    ;;
++  aix4* | aix5*)
++    if test "$host_cpu" = ia64; then
++      # On IA64, the linker does run time linking by default, so we don't
++      # have to do anything special.
++      aix_use_runtimelinking=no
++      exp_sym_flag='-Bexport'
++      no_entry_flag=""
++    else
++      aix_use_runtimelinking=no
++
++      # Test if we are trying to use run time linking or normal
++      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
++      # need to do runtime linking.
++      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
++	for ld_flag in $LDFLAGS; do
++	  case $ld_flag in
++	  *-brtl*)
++	    aix_use_runtimelinking=yes
++	    break
++	    ;;
++	  esac
++	done
++	;;
++      esac
++
++      exp_sym_flag='-bexport'
++      no_entry_flag='-bnoentry'
++    fi
++
++    # When large executables or shared objects are built, AIX ld can
++    # have problems creating the table of contents.  If linking a library
++    # or program results in "error TOC overflow" add -mminimal-toc to
++    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
++    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
++
++    _LT_AC_TAGVAR(archive_cmds, $1)=''
++    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
++    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
++    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
++
++    if test "$GXX" = yes; then
++      case $host_os in aix4.[[012]]|aix4.[[012]].*)
++      # We only want to do this on AIX 4.2 and lower, the check
++      # below for broken collect2 doesn't work under 4.3+
++	collect2name=`${CC} -print-prog-name=collect2`
++	if test -f "$collect2name" && \
++	   strings "$collect2name" | grep resolve_lib_name >/dev/null
++	then
++	  # We have reworked collect2
++	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
++	else
++	  # We have old collect2
++	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
++	  # It fails to find uninstalled libraries when the uninstalled
++	  # path is not listed in the libpath.  Setting hardcode_minus_L
++	  # to unsupported forces relinking
++	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
++	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
++	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
++	fi
++	;;
++      esac
++      shared_flag='-shared'
++      if test "$aix_use_runtimelinking" = yes; then
++	shared_flag="$shared_flag "'${wl}-G'
++      fi
++    else
++      # not using gcc
++      if test "$host_cpu" = ia64; then
++	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
++	# chokes on -Wl,-G. The following line is correct:
++	shared_flag='-G'
++      else
++	if test "$aix_use_runtimelinking" = yes; then
++	  shared_flag='${wl}-G'
++	else
++	  shared_flag='${wl}-bM:SRE'
++	fi
++      fi
++    fi
++
++    # It seems that -bexpall does not export symbols beginning with
++    # underscore (_), so it is better to generate a list of symbols to export.
++    _LT_AC_TAGVAR(always_export_symbols, $1)=yes
++    if test "$aix_use_runtimelinking" = yes; then
++      # Warning - without using the other runtime loading flags (-brtl),
++      # -berok will link without error, but may produce a broken library.
++      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
++      # Determine the default libpath from the value encoded in an empty executable.
++      _LT_AC_SYS_LIBPATH_AIX
++      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
++
++      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
++     else
++      if test "$host_cpu" = ia64; then
++	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
++	_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
++	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
++      else
++	# Determine the default libpath from the value encoded in an empty executable.
++	_LT_AC_SYS_LIBPATH_AIX
++	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
++	# Warning - without using the other run time loading flags,
++	# -berok will link without error, but may produce a broken library.
++	_LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
++	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
++	# Exported symbols can be pulled into shared objects from archives
++	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
++	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
++	# This is similar to how AIX traditionally builds its shared libraries.
++	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
++      fi
++    fi
++    ;;
++
++  beos*)
++    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
++      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
++      # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
++      # support --undefined.  This deserves some investigation.  FIXME
++      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++    else
++      _LT_AC_TAGVAR(ld_shlibs, $1)=no
++    fi
++    ;;
++
++  chorus*)
++    case $cc_basename in
++      *)
++	# FIXME: insert proper C++ library support
++	_LT_AC_TAGVAR(ld_shlibs, $1)=no
++	;;
++    esac
++    ;;
++
++  cygwin* | mingw* | pw32*)
++    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
++    # as there is no search path for DLLs.
++    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
++    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
++    _LT_AC_TAGVAR(always_export_symbols, $1)=no
++    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
++
++    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
++      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
++      # If the export-symbols file already is a .def file (1st line
++      # is EXPORTS), use it as is; otherwise, prepend...
++      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++	cp $export_symbols $output_objdir/$soname.def;
++      else
++	echo EXPORTS > $output_objdir/$soname.def;
++	cat $export_symbols >> $output_objdir/$soname.def;
++      fi~
++      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
++    else
++      _LT_AC_TAGVAR(ld_shlibs, $1)=no
++    fi
++  ;;
++      darwin* | rhapsody*)
++        case $host_os in
++        rhapsody* | darwin1.[[012]])
++         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
++         ;;
++       *) # Darwin 1.3 on
++         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
++           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
++         else
++           case ${MACOSX_DEPLOYMENT_TARGET} in
++             10.[[012]])
++               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
++               ;;
++             10.*)
++               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
++               ;;
++           esac
++         fi
++         ;;
++        esac
++      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
++      _LT_AC_TAGVAR(hardcode_direct, $1)=no
++      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
++      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
++      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
++      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
++
++    if test "$GXX" = yes ; then
++      lt_int_apple_cc_single_mod=no
++      output_verbose_link_cmd='echo'
++      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
++       lt_int_apple_cc_single_mod=yes
++      fi
++      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
++       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
++      else
++          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
++        fi
++        _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
++        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
++          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
++            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
++          else
++            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
++          fi
++            _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
++      else
++      case $cc_basename in
++        xlc*)
++         output_verbose_link_cmd='echo'
++          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
++          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
++          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
++          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
++          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
++          ;;
++       *)
++         _LT_AC_TAGVAR(ld_shlibs, $1)=no
++          ;;
++      esac
++      fi
++        ;;
++
++  dgux*)
++    case $cc_basename in
++      ec++*)
++	# FIXME: insert proper C++ library support
++	_LT_AC_TAGVAR(ld_shlibs, $1)=no
++	;;
++      ghcx*)
++	# Green Hills C++ Compiler
++	# FIXME: insert proper C++ library support
++	_LT_AC_TAGVAR(ld_shlibs, $1)=no
++	;;
++      *)
++	# FIXME: insert proper C++ library support
++	_LT_AC_TAGVAR(ld_shlibs, $1)=no
++	;;
++    esac
++    ;;
++  freebsd[[12]]*)
++    # C++ shared libraries reported to be fairly broken before switch to ELF
++    _LT_AC_TAGVAR(ld_shlibs, $1)=no
++    ;;
++  freebsd-elf*)
++    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
++    ;;
++  freebsd* | kfreebsd*-gnu | dragonfly*)
++    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
++    # conventions
++    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
++    ;;
++  gnu*)
++    ;;
++  hpux9*)
++    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
++    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
++    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
++    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
++    _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
++				# but as the default
++				# location of the library.
++
++    case $cc_basename in
++    CC*)
++      # FIXME: insert proper C++ library support
++      _LT_AC_TAGVAR(ld_shlibs, $1)=no
++      ;;
++    aCC*)
++      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++      # Commands to make compiler produce verbose output that lists
++      # what "hidden" libraries, object files and flags are used when
++      # linking a shared library.
++      #
++      # There doesn't appear to be a way to prevent this compiler from
++      # explicitly linking system object files so we need to strip them
++      # from the output so that they don't get included in the library
++      # dependencies.
++      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
++      ;;
++    *)
++      if test "$GXX" = yes; then
++        _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++      else
++        # FIXME: insert proper C++ library support
++        _LT_AC_TAGVAR(ld_shlibs, $1)=no
++      fi
++      ;;
++    esac
++    ;;
++  hpux10*|hpux11*)
++    if test $with_gnu_ld = no; then
++      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
++      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
++
++      case $host_cpu in
++      hppa*64*|ia64*)
++	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
++        ;;
++      *)
++	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
++        ;;
++      esac
++    fi
++    case $host_cpu in
++    hppa*64*|ia64*)
++      _LT_AC_TAGVAR(hardcode_direct, $1)=no
++      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++      ;;
++    *)
++      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
++      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
++					      # but as the default
++					      # location of the library.
++      ;;
++    esac
++
++    case $cc_basename in
++      CC*)
++	# FIXME: insert proper C++ library support
++	_LT_AC_TAGVAR(ld_shlibs, $1)=no
++	;;
++      aCC*)
++	case $host_cpu in
++	hppa*64*)
++	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
++	  ;;
++	ia64*)
++	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
++	  ;;
++	*)
++	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
++	  ;;
++	esac
++	# Commands to make compiler produce verbose output that lists
++	# what "hidden" libraries, object files and flags are used when
++	# linking a shared library.
++	#
++	# There doesn't appear to be a way to prevent this compiler from
++	# explicitly linking system object files so we need to strip them
++	# from the output so that they don't get included in the library
++	# dependencies.
++	output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
++	;;
++      *)
++	if test "$GXX" = yes; then
++	  if test $with_gnu_ld = no; then
++	    case $host_cpu in
++	    hppa*64*)
++	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
++	      ;;
++	    ia64*)
++	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
++	      ;;
++	    *)
++	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
++	      ;;
++	    esac
++	  fi
++	else
++	  # FIXME: insert proper C++ library support
++	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
++	fi
++	;;
++    esac
++    ;;
++  interix3*)
++    _LT_AC_TAGVAR(hardcode_direct, $1)=no
++    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
++    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
++    # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
++    # Instead, shared libraries are loaded at an image base (0x10000000 by
++    # default) and relocated if they conflict, which is a slow very memory
++    # consuming and fragmenting process.  To avoid this, we pick a random,
++    # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
++    # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
++    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
++    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
++    ;;
++  irix5* | irix6*)
++    case $cc_basename in
++      CC*)
++	# SGI C++
++	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
++
++	# Archives containing C++ object files must be created using
++	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
++	# necessary to make sure instantiated templates are included
++	# in the archive.
++	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
++	;;
++      *)
++	if test "$GXX" = yes; then
++	  if test "$with_gnu_ld" = no; then
++	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	  else
++	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
++	  fi
++	fi
++	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
++	;;
++    esac
++    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
++    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
++    ;;
++  linux*)
++    case $cc_basename in
++      KCC*)
++	# Kuck and Associates, Inc. (KAI) C++ Compiler
++
++	# KCC will only create a shared library if the output file
++	# ends with ".so" (or ".sl" for HP-UX), so rename the library
++	# to its proper name (with version) after linking.
++	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
++	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
++	# Commands to make compiler produce verbose output that lists
++	# what "hidden" libraries, object files and flags are used when
++	# linking a shared library.
++	#
++	# There doesn't appear to be a way to prevent this compiler from
++	# explicitly linking system object files so we need to strip them
++	# from the output so that they don't get included in the library
++	# dependencies.
++	output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
++
++	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
++	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
++
++	# Archives containing C++ object files must be created using
++	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
++	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
++	;;
++      icpc*)
++	# Intel C++
++	with_gnu_ld=yes
++	# version 8.0 and above of icpc choke on multiply defined symbols
++	# if we add $predep_objects and $postdep_objects, however 7.1 and
++	# earlier do not add the objects themselves.
++	case `$CC -V 2>&1` in
++	*"Version 7."*)
++  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
++  	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	  ;;
++	*)  # Version 8.0 or newer
++	  tmp_idyn=
++	  case $host_cpu in
++	    ia64*) tmp_idyn=' -i_dynamic';;
++	  esac
++  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	  ;;
++	esac
++	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
++	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
++	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
++	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
++	;;
++      pgCC*)
++        # Portland Group C++ compiler
++	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
++  	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
++
++	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
++	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
++	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
++        ;;
++      cxx*)
++	# Compaq C++
++	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
++
++	runpath_var=LD_RUN_PATH
++	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
++	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
++
++	# Commands to make compiler produce verbose output that lists
++	# what "hidden" libraries, object files and flags are used when
++	# linking a shared library.
++	#
++	# There doesn't appear to be a way to prevent this compiler from
++	# explicitly linking system object files so we need to strip them
++	# from the output so that they don't get included in the library
++	# dependencies.
++	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
++	;;
++    esac
++    ;;
++  lynxos*)
++    # FIXME: insert proper C++ library support
++    _LT_AC_TAGVAR(ld_shlibs, $1)=no
++    ;;
++  m88k*)
++    # FIXME: insert proper C++ library support
++    _LT_AC_TAGVAR(ld_shlibs, $1)=no
++    ;;
++  mvs*)
++    case $cc_basename in
++      cxx*)
++	# FIXME: insert proper C++ library support
++	_LT_AC_TAGVAR(ld_shlibs, $1)=no
++	;;
++      *)
++	# FIXME: insert proper C++ library support
++	_LT_AC_TAGVAR(ld_shlibs, $1)=no
++	;;
++    esac
++    ;;
++  netbsd*)
++    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
++      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
++      wlarc=
++      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
++      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
++      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++    fi
++    # Workaround some broken pre-1.5 toolchains
++    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
++    ;;
++  openbsd2*)
++    # C++ shared libraries are fairly broken
++    _LT_AC_TAGVAR(ld_shlibs, $1)=no
++    ;;
++  openbsd*)
++    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
++    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
++    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
++    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
++      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
++      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
++      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
++    fi
++    output_verbose_link_cmd='echo'
++    ;;
++  osf3*)
++    case $cc_basename in
++      KCC*)
++	# Kuck and Associates, Inc. (KAI) C++ Compiler
++
++	# KCC will only create a shared library if the output file
++	# ends with ".so" (or ".sl" for HP-UX), so rename the library
++	# to its proper name (with version) after linking.
++	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
++
++	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
++	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
++
++	# Archives containing C++ object files must be created using
++	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
++	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
++
++	;;
++      RCC*)
++	# Rational C++ 2.4.1
++	# FIXME: insert proper C++ library support
++	_LT_AC_TAGVAR(ld_shlibs, $1)=no
++	;;
++      cxx*)
++	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
++	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
++
++	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
++	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
++
++	# Commands to make compiler produce verbose output that lists
++	# what "hidden" libraries, object files and flags are used when
++	# linking a shared library.
++	#
++	# There doesn't appear to be a way to prevent this compiler from
++	# explicitly linking system object files so we need to strip them
++	# from the output so that they don't get included in the library
++	# dependencies.
++	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
++	;;
++      *)
++	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
++	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
++	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++
++	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
++	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
++
++	  # Commands to make compiler produce verbose output that lists
++	  # what "hidden" libraries, object files and flags are used when
++	  # linking a shared library.
++	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
++
++	else
++	  # FIXME: insert proper C++ library support
++	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
++	fi
++	;;
++    esac
++    ;;
++  osf4* | osf5*)
++    case $cc_basename in
++      KCC*)
++	# Kuck and Associates, Inc. (KAI) C++ Compiler
++
++	# KCC will only create a shared library if the output file
++	# ends with ".so" (or ".sl" for HP-UX), so rename the library
++	# to its proper name (with version) after linking.
++	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
++
++	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
++	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
++
++	# Archives containing C++ object files must be created using
++	# the KAI C++ compiler.
++	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
++	;;
++      RCC*)
++	# Rational C++ 2.4.1
++	# FIXME: insert proper C++ library support
++	_LT_AC_TAGVAR(ld_shlibs, $1)=no
++	;;
++      cxx*)
++	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
++	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
++	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
++	  echo "-hidden">> $lib.exp~
++	  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version	$verstring` -update_registry ${output_objdir}/so_locations -o $lib~
++	  $rm $lib.exp'
++
++	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
++	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
++
++	# Commands to make compiler produce verbose output that lists
++	# what "hidden" libraries, object files and flags are used when
++	# linking a shared library.
++	#
++	# There doesn't appear to be a way to prevent this compiler from
++	# explicitly linking system object files so we need to strip them
++	# from the output so that they don't get included in the library
++	# dependencies.
++	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
++	;;
++      *)
++	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
++	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
++	 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++
++	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
++	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
++
++	  # Commands to make compiler produce verbose output that lists
++	  # what "hidden" libraries, object files and flags are used when
++	  # linking a shared library.
++	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
++
++	else
++	  # FIXME: insert proper C++ library support
++	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
++	fi
++	;;
++    esac
++    ;;
++  psos*)
++    # FIXME: insert proper C++ library support
++    _LT_AC_TAGVAR(ld_shlibs, $1)=no
++    ;;
++  sunos4*)
++    case $cc_basename in
++      CC*)
++	# Sun C++ 4.x
++	# FIXME: insert proper C++ library support
++	_LT_AC_TAGVAR(ld_shlibs, $1)=no
++	;;
++      lcc*)
++	# Lucid
++	# FIXME: insert proper C++ library support
++	_LT_AC_TAGVAR(ld_shlibs, $1)=no
++	;;
++      *)
++	# FIXME: insert proper C++ library support
++	_LT_AC_TAGVAR(ld_shlibs, $1)=no
++	;;
++    esac
++    ;;
++  solaris*)
++    case $cc_basename in
++      CC*)
++	# Sun C++ 4.2, 5.x and Centerline C++
++        _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
++	_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
++	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
++	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
++	$CC -G${allow_undefined_flag}  ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
++
++	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
++	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++	case $host_os in
++	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
++	  *)
++	    # The C++ compiler is used as linker so we must use $wl
++	    # flag to pass the commands to the underlying system
++	    # linker. We must also pass each convience library through
++	    # to the system linker between allextract/defaultextract.
++	    # The C++ compiler will combine linker options so we
++	    # cannot just pass the convience library names through
++	    # without $wl.
++	    # Supported since Solaris 2.6 (maybe 2.5.1?)
++	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
++	    ;;
++	esac
++	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
++
++	output_verbose_link_cmd='echo'
++
++	# Archives containing C++ object files must be created using
++	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
++	# necessary to make sure instantiated templates are included
++	# in the archive.
++	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
++	;;
++      gcx*)
++	# Green Hills C++ Compiler
++	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
++
++	# The C++ compiler must be used to create the archive.
++	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
++	;;
++      *)
++	# GNU C++ compiler with Solaris linker
++	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
++	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
++	  if $CC --version | grep -v '^2\.7' > /dev/null; then
++	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
++	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
++		$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
++
++	    # Commands to make compiler produce verbose output that lists
++	    # what "hidden" libraries, object files and flags are used when
++	    # linking a shared library.
++	    output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
++	  else
++	    # g++ 2.7 appears to require `-G' NOT `-shared' on this
++	    # platform.
++	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
++	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
++		$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
++
++	    # Commands to make compiler produce verbose output that lists
++	    # what "hidden" libraries, object files and flags are used when
++	    # linking a shared library.
++	    output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
++	  fi
++
++	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
++	fi
++	;;
++    esac
++    ;;
++  sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
++    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
++    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
++    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++    runpath_var='LD_RUN_PATH'
++
++    case $cc_basename in
++      CC*)
++	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
++	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
++	;;
++      *)
++	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
++	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
++	;;
++    esac
++    ;;
++  sysv5* | sco3.2v5* | sco5v6*)
++    # Note: We can NOT use -z defs as we might desire, because we do not
++    # link with -lc, and that would cause any symbols used from libc to
++    # always be unresolved, which means just about no library would
++    # ever link correctly.  If we're not using GNU ld we use -z text
++    # though, which does catch some bad symbols but isn't as heavy-handed
++    # as -z defs.
++    # For security reasons, it is highly recommended that you always
++    # use absolute paths for naming shared libraries, and exclude the
++    # DT_RUNPATH tag from executables and libraries.  But doing so
++    # requires that you compile everything twice, which is a pain.
++    # So that behaviour is only enabled if SCOABSPATH is set to a
++    # non-empty value in the environment.  Most likely only useful for
++    # creating official distributions of packages.
++    # This is a hack until libtool officially supports absolute path
++    # names for shared libraries.
++    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
++    _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
++    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
++    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
++    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
++    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
++    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
++    runpath_var='LD_RUN_PATH'
++
++    case $cc_basename in
++      CC*)
++	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
++	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
++	;;
++      *)
++	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
++	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
++	;;
++    esac
++    ;;
++  tandem*)
++    case $cc_basename in
++      NCC*)
++	# NonStop-UX NCC 3.20
++	# FIXME: insert proper C++ library support
++	_LT_AC_TAGVAR(ld_shlibs, $1)=no
++	;;
++      *)
++	# FIXME: insert proper C++ library support
++	_LT_AC_TAGVAR(ld_shlibs, $1)=no
++	;;
++    esac
++    ;;
++  vxworks*)
++    # FIXME: insert proper C++ library support
++    _LT_AC_TAGVAR(ld_shlibs, $1)=no
++    ;;
++  *)
++    # FIXME: insert proper C++ library support
++    _LT_AC_TAGVAR(ld_shlibs, $1)=no
++    ;;
++esac
++AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
++test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
++
++_LT_AC_TAGVAR(GCC, $1)="$GXX"
++_LT_AC_TAGVAR(LD, $1)="$LD"
++
++AC_LIBTOOL_POSTDEP_PREDEP($1)
++AC_LIBTOOL_PROG_COMPILER_PIC($1)
++AC_LIBTOOL_PROG_CC_C_O($1)
++AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
++AC_LIBTOOL_PROG_LD_SHLIBS($1)
++AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
++AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
++
++AC_LIBTOOL_CONFIG($1)
++
++AC_LANG_POP
++CC=$lt_save_CC
++LDCXX=$LD
++LD=$lt_save_LD
++GCC=$lt_save_GCC
++with_gnu_ldcxx=$with_gnu_ld
++with_gnu_ld=$lt_save_with_gnu_ld
++lt_cv_path_LDCXX=$lt_cv_path_LD
++lt_cv_path_LD=$lt_save_path_LD
++lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
++lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
++])# AC_LIBTOOL_LANG_CXX_CONFIG
++
++# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
++# ------------------------------------
++# Figure out "hidden" library dependencies from verbose
++# compiler output when linking a shared library.
++# Parse the compiler output and extract the necessary
++# objects, libraries and library flags.
++AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
++dnl we can't use the lt_simple_compile_test_code here,
++dnl because it contains code intended for an executable,
++dnl not a library.  It's possible we should let each
++dnl tag define a new lt_????_link_test_code variable,
++dnl but it's only used here...
++ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
++int a;
++void foo (void) { a = 0; }
++EOF
++],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
++class Foo
++{
++public:
++  Foo (void) { a = 0; }
++private:
++  int a;
++};
++EOF
++],[$1],[F77],[cat > conftest.$ac_ext <<EOF
++      subroutine foo
++      implicit none
++      integer*4 a
++      a=0
++      return
++      end
++EOF
++],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
++public class foo {
++  private int a;
++  public void bar (void) {
++    a = 0;
++  }
++};
++EOF
++])
++dnl Parse the compiler output and extract the necessary
++dnl objects, libraries and library flags.
++if AC_TRY_EVAL(ac_compile); then
++  # Parse the compiler output and extract the necessary
++  # objects, libraries and library flags.
++
++  # Sentinel used to keep track of whether or not we are before
++  # the conftest object file.
++  pre_test_object_deps_done=no
++
++  # The `*' in the case matches for architectures that use `case' in
++  # $output_verbose_cmd can trigger glob expansion during the loop
++  # eval without this substitution.
++  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
++
++  for p in `eval $output_verbose_link_cmd`; do
++    case $p in
++
++    -L* | -R* | -l*)
++       # Some compilers place space between "-{L,R}" and the path.
++       # Remove the space.
++       if test $p = "-L" \
++	  || test $p = "-R"; then
++	 prev=$p
++	 continue
++       else
++	 prev=
++       fi
++
++       if test "$pre_test_object_deps_done" = no; then
++	 case $p in
++	 -L* | -R*)
++	   # Internal compiler library paths should come after those
++	   # provided the user.  The postdeps already come after the
++	   # user supplied libs so there is no need to process them.
++	   if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
++	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
++	   else
++	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
++	   fi
++	   ;;
++	 # The "-l" case would never come before the object being
++	 # linked, so don't bother handling this case.
++	 esac
++       else
++	 if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
++	   _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
++	 else
++	   _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
++	 fi
++       fi
++       ;;
++
++    *.$objext)
++       # This assumes that the test object file only shows up
++       # once in the compiler output.
++       if test "$p" = "conftest.$objext"; then
++	 pre_test_object_deps_done=yes
++	 continue
++       fi
++
++       if test "$pre_test_object_deps_done" = no; then
++	 if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
++	   _LT_AC_TAGVAR(predep_objects, $1)="$p"
++	 else
++	   _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
++	 fi
++       else
++	 if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
++	   _LT_AC_TAGVAR(postdep_objects, $1)="$p"
++	 else
++	   _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
++	 fi
++       fi
++       ;;
++
++    *) ;; # Ignore the rest.
++
++    esac
++  done
++
++  # Clean up.
++  rm -f a.out a.exe
++else
++  echo "libtool.m4: error: problem compiling $1 test program"
++fi
++
++$rm -f confest.$objext
++
++# PORTME: override above test on systems where it is broken
++ifelse([$1],[CXX],
++[case $host_os in
++interix3*)
++  # Interix 3.5 installs completely hosed .la files for C++, so rather than
++  # hack all around it, let's just trust "g++" to DTRT.
++  _LT_AC_TAGVAR(predep_objects,$1)=
++  _LT_AC_TAGVAR(postdep_objects,$1)=
++  _LT_AC_TAGVAR(postdeps,$1)=
++  ;;
++
++solaris*)
++  case $cc_basename in
++  CC*)
++    # Adding this requires a known-good setup of shared libraries for
++    # Sun compiler versions before 5.6, else PIC objects from an old
++    # archive will be linked into the output, leading to subtle bugs.
++    _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
++    ;;
++  esac
++  ;;
++esac
++])
++
++case " $_LT_AC_TAGVAR(postdeps, $1) " in
++*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
++esac
++])# AC_LIBTOOL_POSTDEP_PREDEP
++
++# AC_LIBTOOL_LANG_F77_CONFIG
++# --------------------------
++# Ensure that the configuration vars for the C compiler are
++# suitably defined.  Those variables are subsequently used by
++# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
++AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
++AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
++[AC_REQUIRE([AC_PROG_F77])
++AC_LANG_PUSH(Fortran 77)
++
++_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
++_LT_AC_TAGVAR(allow_undefined_flag, $1)=
++_LT_AC_TAGVAR(always_export_symbols, $1)=no
++_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
++_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
++_LT_AC_TAGVAR(hardcode_direct, $1)=no
++_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
++_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
++_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
++_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
++_LT_AC_TAGVAR(hardcode_automatic, $1)=no
++_LT_AC_TAGVAR(module_cmds, $1)=
++_LT_AC_TAGVAR(module_expsym_cmds, $1)=
++_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
++_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
++_LT_AC_TAGVAR(no_undefined_flag, $1)=
++_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
++_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
++
++# Source file extension for f77 test sources.
++ac_ext=f
++
++# Object file extension for compiled f77 test sources.
++objext=o
++_LT_AC_TAGVAR(objext, $1)=$objext
++
++# Code to be used in simple compile tests
++lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
++
++# Code to be used in simple link tests
++lt_simple_link_test_code="      program t\n      end\n"
++
++# ltmain only uses $CC for tagged configurations so make sure $CC is set.
++_LT_AC_SYS_COMPILER
++
++# save warnings/boilerplate of simple test code
++_LT_COMPILER_BOILERPLATE
++_LT_LINKER_BOILERPLATE
++
++# Allow CC to be a program name with arguments.
++lt_save_CC="$CC"
++CC=${F77-"f77"}
++compiler=$CC
++_LT_AC_TAGVAR(compiler, $1)=$CC
++_LT_CC_BASENAME([$compiler])
++
++AC_MSG_CHECKING([if libtool supports shared libraries])
++AC_MSG_RESULT([$can_build_shared])
++
++AC_MSG_CHECKING([whether to build shared libraries])
++test "$can_build_shared" = "no" && enable_shared=no
++
++# On AIX, shared libraries and static libraries use the same namespace, and
++# are all built from PIC.
++case $host_os in
++aix3*)
++  test "$enable_shared" = yes && enable_static=no
++  if test -n "$RANLIB"; then
++    archive_cmds="$archive_cmds~\$RANLIB \$lib"
++    postinstall_cmds='$RANLIB $lib'
++  fi
++  ;;
++aix4* | aix5*)
++  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
++    test "$enable_shared" = yes && enable_static=no
++  fi
++  ;;
++esac
++AC_MSG_RESULT([$enable_shared])
++
++AC_MSG_CHECKING([whether to build static libraries])
++# Make sure either enable_shared or enable_static is yes.
++test "$enable_shared" = yes || enable_static=yes
++AC_MSG_RESULT([$enable_static])
++
++_LT_AC_TAGVAR(GCC, $1)="$G77"
++_LT_AC_TAGVAR(LD, $1)="$LD"
++
++AC_LIBTOOL_PROG_COMPILER_PIC($1)
++AC_LIBTOOL_PROG_CC_C_O($1)
++AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
++AC_LIBTOOL_PROG_LD_SHLIBS($1)
++AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
++AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
++
++AC_LIBTOOL_CONFIG($1)
++
++AC_LANG_POP
++CC="$lt_save_CC"
++])# AC_LIBTOOL_LANG_F77_CONFIG
++
++
++# AC_LIBTOOL_LANG_GCJ_CONFIG
++# --------------------------
++# Ensure that the configuration vars for the C compiler are
++# suitably defined.  Those variables are subsequently used by
++# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
++AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
++AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
++[AC_LANG_SAVE
++
++# Source file extension for Java test sources.
++ac_ext=java
++
++# Object file extension for compiled Java test sources.
++objext=o
++_LT_AC_TAGVAR(objext, $1)=$objext
++
++# Code to be used in simple compile tests
++lt_simple_compile_test_code="class foo {}\n"
++
++# Code to be used in simple link tests
++lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n'
++
++# ltmain only uses $CC for tagged configurations so make sure $CC is set.
++_LT_AC_SYS_COMPILER
++
++# save warnings/boilerplate of simple test code
++_LT_COMPILER_BOILERPLATE
++_LT_LINKER_BOILERPLATE
++
++# Allow CC to be a program name with arguments.
++lt_save_CC="$CC"
++CC=${GCJ-"gcj"}
++compiler=$CC
++_LT_AC_TAGVAR(compiler, $1)=$CC
++_LT_CC_BASENAME([$compiler])
++
++# GCJ did not exist at the time GCC didn't implicitly link libc in.
++_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
++
++_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
++
++AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
++AC_LIBTOOL_PROG_COMPILER_PIC($1)
++AC_LIBTOOL_PROG_CC_C_O($1)
++AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
++AC_LIBTOOL_PROG_LD_SHLIBS($1)
++AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
++AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
++
++AC_LIBTOOL_CONFIG($1)
++
++AC_LANG_RESTORE
++CC="$lt_save_CC"
++])# AC_LIBTOOL_LANG_GCJ_CONFIG
++
++
++# AC_LIBTOOL_LANG_RC_CONFIG
++# -------------------------
++# Ensure that the configuration vars for the Windows resource compiler are
++# suitably defined.  Those variables are subsequently used by
++# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
++AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
++AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
++[AC_LANG_SAVE
++
++# Source file extension for RC test sources.
++ac_ext=rc
++
++# Object file extension for compiled RC test sources.
++objext=o
++_LT_AC_TAGVAR(objext, $1)=$objext
++
++# Code to be used in simple compile tests
++lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
++
++# Code to be used in simple link tests
++lt_simple_link_test_code="$lt_simple_compile_test_code"
++
++# ltmain only uses $CC for tagged configurations so make sure $CC is set.
++_LT_AC_SYS_COMPILER
++
++# save warnings/boilerplate of simple test code
++_LT_COMPILER_BOILERPLATE
++_LT_LINKER_BOILERPLATE
++
++# Allow CC to be a program name with arguments.
++lt_save_CC="$CC"
++CC=${RC-"windres"}
++compiler=$CC
++_LT_AC_TAGVAR(compiler, $1)=$CC
++_LT_CC_BASENAME([$compiler])
++_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
++
++AC_LIBTOOL_CONFIG($1)
++
++AC_LANG_RESTORE
++CC="$lt_save_CC"
++])# AC_LIBTOOL_LANG_RC_CONFIG
++
++
++# AC_LIBTOOL_CONFIG([TAGNAME])
++# ----------------------------
++# If TAGNAME is not passed, then create an initial libtool script
++# with a default configuration from the untagged config vars.  Otherwise
++# add code to config.status for appending the configuration named by
++# TAGNAME from the matching tagged config vars.
++AC_DEFUN([AC_LIBTOOL_CONFIG],
++[# The else clause should only fire when bootstrapping the
++# libtool distribution, otherwise you forgot to ship ltmain.sh
++# with your package, and you will get complaints that there are
++# no rules to generate ltmain.sh.
++if test -f "$ltmain"; then
++  # See if we are running on zsh, and set the options which allow our commands through
++  # without removal of \ escapes.
++  if test -n "${ZSH_VERSION+set}" ; then
++    setopt NO_GLOB_SUBST
++  fi
++  # Now quote all the things that may contain metacharacters while being
++  # careful not to overquote the AC_SUBSTed values.  We take copies of the
++  # variables and quote the copies for generation of the libtool script.
++  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
++    SED SHELL STRIP \
++    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
++    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
++    deplibs_check_method reload_flag reload_cmds need_locks \
++    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
++    lt_cv_sys_global_symbol_to_c_name_address \
++    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
++    old_postinstall_cmds old_postuninstall_cmds \
++    _LT_AC_TAGVAR(compiler, $1) \
++    _LT_AC_TAGVAR(CC, $1) \
++    _LT_AC_TAGVAR(LD, $1) \
++    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
++    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
++    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
++    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
++    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
++    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
++    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
++    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
++    _LT_AC_TAGVAR(old_archive_cmds, $1) \
++    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
++    _LT_AC_TAGVAR(predep_objects, $1) \
++    _LT_AC_TAGVAR(postdep_objects, $1) \
++    _LT_AC_TAGVAR(predeps, $1) \
++    _LT_AC_TAGVAR(postdeps, $1) \
++    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
++    _LT_AC_TAGVAR(archive_cmds, $1) \
++    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
++    _LT_AC_TAGVAR(postinstall_cmds, $1) \
++    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
++    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
++    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
++    _LT_AC_TAGVAR(no_undefined_flag, $1) \
++    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
++    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
++    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
++    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
++    _LT_AC_TAGVAR(hardcode_automatic, $1) \
++    _LT_AC_TAGVAR(module_cmds, $1) \
++    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
++    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
++    _LT_AC_TAGVAR(exclude_expsyms, $1) \
++    _LT_AC_TAGVAR(include_expsyms, $1); do
++
++    case $var in
++    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
++    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
++    _LT_AC_TAGVAR(archive_cmds, $1) | \
++    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
++    _LT_AC_TAGVAR(module_cmds, $1) | \
++    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
++    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
++    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
++    extract_expsyms_cmds | reload_cmds | finish_cmds | \
++    postinstall_cmds | postuninstall_cmds | \
++    old_postinstall_cmds | old_postuninstall_cmds | \
++    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
++      # Double-quote double-evaled strings.
++      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
++      ;;
++    *)
++      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
++      ;;
++    esac
++  done
++
++  case $lt_echo in
++  *'\[$]0 --fallback-echo"')
++    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
++    ;;
++  esac
++
++ifelse([$1], [],
++  [cfgfile="${ofile}T"
++  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
++  $rm -f "$cfgfile"
++  AC_MSG_NOTICE([creating $ofile])],
++  [cfgfile="$ofile"])
++
++  cat <<__EOF__ >> "$cfgfile"
++ifelse([$1], [],
++[#! $SHELL
++
++# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
++# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
++# NOTE: Changes made to this file will be lost: look at ltmain.sh.
++#
++# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
++# Free Software Foundation, Inc.
++#
++# This file is part of GNU Libtool:
++# Originally by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful, but
++# WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++# General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++#
++# As a special exception to the GNU General Public License, if you
++# distribute this file as part of a program that contains a
++# configuration script generated by Autoconf, you may include it under
++# the same distribution terms that you use for the rest of that program.
++
++# A sed program that does not truncate output.
++SED=$lt_SED
++
++# Sed that helps us avoid accidentally triggering echo(1) options like -n.
++Xsed="$SED -e 1s/^X//"
++
++# The HP-UX ksh and POSIX shell print the target directory to stdout
++# if CDPATH is set.
++(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
++
++# The names of the tagged configurations supported by this script.
++available_tags=
++
++# ### BEGIN LIBTOOL CONFIG],
++[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
++
++# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
++
++# Shell to use when invoking shell scripts.
++SHELL=$lt_SHELL
++
++# Whether or not to build shared libraries.
++build_libtool_libs=$enable_shared
++
++# Whether or not to build static libraries.
++build_old_libs=$enable_static
++
++# Whether or not to add -lc for building shared libraries.
++build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
++
++# Whether or not to disallow shared libs when runtime libs are static
++allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
++
++# Whether or not to optimize for fast installation.
++fast_install=$enable_fast_install
++
++# The host system.
++host_alias=$host_alias
++host=$host
++host_os=$host_os
++
++# The build system.
++build_alias=$build_alias
++build=$build
++build_os=$build_os
++
++# An echo program that does not interpret backslashes.
++echo=$lt_echo
++
++# The archiver.
++AR=$lt_AR
++AR_FLAGS=$lt_AR_FLAGS
++
++# A C compiler.
++LTCC=$lt_LTCC
++
++# LTCC compiler flags.
++LTCFLAGS=$lt_LTCFLAGS
++
++# A language-specific compiler.
++CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
++
++# Is the compiler the GNU C compiler?
++with_gcc=$_LT_AC_TAGVAR(GCC, $1)
++
++gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
++gcc_ver=\`gcc -dumpversion\`
++
++# An ERE matcher.
++EGREP=$lt_EGREP
++
++# The linker used to build libraries.
++LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
++
++# Whether we need hard or soft links.
++LN_S=$lt_LN_S
++
++# A BSD-compatible nm program.
++NM=$lt_NM
++
++# A symbol stripping program
++STRIP=$lt_STRIP
++
++# Used to examine libraries when file_magic_cmd begins "file"
++MAGIC_CMD=$MAGIC_CMD
++
++# Used on cygwin: DLL creation program.
++DLLTOOL="$DLLTOOL"
++
++# Used on cygwin: object dumper.
++OBJDUMP="$OBJDUMP"
++
++# Used on cygwin: assembler.
++AS="$AS"
++
++# The name of the directory that contains temporary libtool files.
++objdir=$objdir
++
++# How to create reloadable object files.
++reload_flag=$lt_reload_flag
++reload_cmds=$lt_reload_cmds
++
++# How to pass a linker flag through the compiler.
++wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
++
++# Object file suffix (normally "o").
++objext="$ac_objext"
++
++# Old archive suffix (normally "a").
++libext="$libext"
++
++# Shared library suffix (normally ".so").
++shrext_cmds='$shrext_cmds'
++
++# Executable file suffix (normally "").
++exeext="$exeext"
++
++# Additional compiler flags for building library objects.
++pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
++pic_mode=$pic_mode
++
++# What is the maximum length of a command?
++max_cmd_len=$lt_cv_sys_max_cmd_len
++
++# Does compiler simultaneously support -c and -o options?
++compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
++
++# Must we lock files when doing compilation?
++need_locks=$lt_need_locks
++
++# Do we need the lib prefix for modules?
++need_lib_prefix=$need_lib_prefix
++
++# Do we need a version for libraries?
++need_version=$need_version
++
++# Whether dlopen is supported.
++dlopen_support=$enable_dlopen
++
++# Whether dlopen of programs is supported.
++dlopen_self=$enable_dlopen_self
++
++# Whether dlopen of statically linked programs is supported.
++dlopen_self_static=$enable_dlopen_self_static
++
++# Compiler flag to prevent dynamic linking.
++link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
++
++# Compiler flag to turn off builtin functions.
++no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
++
++# Compiler flag to allow reflexive dlopens.
++export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
++
++# Compiler flag to generate shared objects directly from archives.
++whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
++
++# Compiler flag to generate thread-safe objects.
++thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
++
++# Library versioning type.
++version_type=$version_type
++
++# Format of library name prefix.
++libname_spec=$lt_libname_spec
++
++# List of archive names.  First name is the real one, the rest are links.
++# The last name is the one that the linker finds with -lNAME.
++library_names_spec=$lt_library_names_spec
++
++# The coded name of the library, if different from the real name.
++soname_spec=$lt_soname_spec
++
++# Commands used to build and install an old-style archive.
++RANLIB=$lt_RANLIB
++old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
++old_postinstall_cmds=$lt_old_postinstall_cmds
++old_postuninstall_cmds=$lt_old_postuninstall_cmds
++
++# Create an old-style archive from a shared archive.
++old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
++
++# Create a temporary old-style archive to link instead of a shared archive.
++old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
++
++# Commands used to build and install a shared archive.
++archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
++archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
++postinstall_cmds=$lt_postinstall_cmds
++postuninstall_cmds=$lt_postuninstall_cmds
++
++# Commands used to build a loadable module (assumed same as above if empty)
++module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
++module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
++
++# Commands to strip libraries.
++old_striplib=$lt_old_striplib
++striplib=$lt_striplib
++
++# Dependencies to place before the objects being linked to create a
++# shared library.
++predep_objects=\`echo $lt_[]_LT_AC_TAGVAR(predep_objects, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
++
++# Dependencies to place after the objects being linked to create a
++# shared library.
++postdep_objects=\`echo $lt_[]_LT_AC_TAGVAR(postdep_objects, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
++
++# Dependencies to place before the objects being linked to create a
++# shared library.
++predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
++
++# Dependencies to place after the objects being linked to create a
++# shared library.
++postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
++
++# The library search path used internally by the compiler when linking
++# a shared library.
++compiler_lib_search_path=\`echo $lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
++
++# Method to check whether dependent libraries are shared objects.
++deplibs_check_method=$lt_deplibs_check_method
++
++# Command to use when deplibs_check_method == file_magic.
++file_magic_cmd=$lt_file_magic_cmd
++
++# Flag that allows shared libraries with undefined symbols to be built.
++allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
++
++# Flag that forces no undefined symbols.
++no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
++
++# Commands used to finish a libtool library installation in a directory.
++finish_cmds=$lt_finish_cmds
++
++# Same as above, but a single script fragment to be evaled but not shown.
++finish_eval=$lt_finish_eval
++
++# Take the output of nm and produce a listing of raw symbols and C names.
++global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
++
++# Transform the output of nm in a proper C declaration
++global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
++
++# Transform the output of nm in a C name address pair
++global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
++
++# This is the shared library runtime path variable.
++runpath_var=$runpath_var
++
++# This is the shared library path variable.
++shlibpath_var=$shlibpath_var
++
++# Is shlibpath searched before the hard-coded library search path?
++shlibpath_overrides_runpath=$shlibpath_overrides_runpath
++
++# How to hardcode a shared library path into an executable.
++hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
++
++# Whether we should hardcode library paths into libraries.
++hardcode_into_libs=$hardcode_into_libs
++
++# Flag to hardcode \$libdir into a binary during linking.
++# This must work even if \$libdir does not exist.
++hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
++
++# If ld is used when linking, flag to hardcode \$libdir into
++# a binary during linking. This must work even if \$libdir does
++# not exist.
++hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
++
++# Whether we need a single -rpath flag with a separated argument.
++hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
++
++# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
++# resulting binary.
++hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
++
++# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
++# resulting binary.
++hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
++
++# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
++# the resulting binary.
++hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
++
++# Set to yes if building a shared library automatically hardcodes DIR into the library
++# and all subsequent libraries and executables linked against it.
++hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
++
++# Variables whose values should be saved in libtool wrapper scripts and
++# restored at relink time.
++variables_saved_for_relink="$variables_saved_for_relink"
++
++# Whether libtool must link a program against all its dependency libraries.
++link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
++
++# Compile-time system search path for libraries
++sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
++
++# Run-time system search path for libraries
++sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
++
++# Fix the shell variable \$srcfile for the compiler.
++fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
++
++# Set to yes if exported symbols are required.
++always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
++
++# The commands to list exported symbols.
++export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
++
++# The commands to extract the exported symbol list from a shared archive.
++extract_expsyms_cmds=$lt_extract_expsyms_cmds
++
++# Symbols that should not be listed in the preloaded symbols.
++exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
++
++# Symbols that must always be exported.
++include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
++
++ifelse([$1],[],
++[# ### END LIBTOOL CONFIG],
++[# ### END LIBTOOL TAG CONFIG: $tagname])
++
++__EOF__
++
++ifelse([$1],[], [
++  case $host_os in
++  aix3*)
++    cat <<\EOF >> "$cfgfile"
++
++# AIX sometimes has problems with the GCC collect2 program.  For some
++# reason, if we set the COLLECT_NAMES environment variable, the problems
++# vanish in a puff of smoke.
++if test "X${COLLECT_NAMES+set}" != Xset; then
++  COLLECT_NAMES=
++  export COLLECT_NAMES
++fi
++EOF
++    ;;
++  esac
++
++  # We use sed instead of cat because bash on DJGPP gets confused if
++  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
++  # text mode, it properly converts lines to CR/LF.  This bash problem
++  # is reportedly fixed, but why not run on old versions too?
++  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
++
++  mv -f "$cfgfile" "$ofile" || \
++    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
++  chmod +x "$ofile"
++])
++else
++  # If there is no Makefile yet, we rely on a make rule to execute
++  # `config.status --recheck' to rerun these tests and create the
++  # libtool script then.
++  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
++  if test -f "$ltmain_in"; then
++    test -f Makefile && make "$ltmain"
++  fi
++fi
++])# AC_LIBTOOL_CONFIG
++
++
++# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
++# -------------------------------------------
++AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
++[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
++
++_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
++
++if test "$GCC" = yes; then
++  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
++
++  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
++    lt_cv_prog_compiler_rtti_exceptions,
++    [-fno-rtti -fno-exceptions], [],
++    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
++fi
++])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
++
++
++# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
++# ---------------------------------
++AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
++[AC_REQUIRE([AC_CANONICAL_HOST])
++AC_REQUIRE([AC_PROG_NM])
++AC_REQUIRE([AC_OBJEXT])
++# Check for command to grab the raw symbol name followed by C symbol from nm.
++AC_MSG_CHECKING([command to parse $NM output from $compiler object])
++AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
++[
++# These are sane defaults that work on at least a few old systems.
++# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
++
++# Character class describing NM global symbol codes.
++symcode='[[BCDEGRST]]'
++
++# Regexp to match symbols that can be accessed directly from C.
++sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
++
++# Transform an extracted symbol line into a proper C declaration
++lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
++
++# Transform an extracted symbol line into symbol name and symbol address
++lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
++
++# Define system-specific variables.
++case $host_os in
++aix*)
++  symcode='[[BCDT]]'
++  ;;
++cygwin* | mingw* | pw32*)
++  symcode='[[ABCDGISTW]]'
++  ;;
++hpux*) # Its linker distinguishes data from code symbols
++  if test "$host_cpu" = ia64; then
++    symcode='[[ABCDEGRST]]'
++  fi
++  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
++  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
++  ;;
++linux*)
++  if test "$host_cpu" = ia64; then
++    symcode='[[ABCDGIRSTW]]'
++    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
++    lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
++  fi
++  ;;
++irix* | nonstopux*)
++  symcode='[[BCDEGRST]]'
++  ;;
++osf*)
++  symcode='[[BCDEGQRST]]'
++  ;;
++solaris*)
++  symcode='[[BDRT]]'
++  ;;
++sco3.2v5*)
++  symcode='[[DT]]'
++  ;;
++sysv4.2uw2*)
++  symcode='[[DT]]'
++  ;;
++sysv5* | sco5v6* | unixware* | OpenUNIX*)
++  symcode='[[ABDT]]'
++  ;;
++sysv4)
++  symcode='[[DFNSTU]]'
++  ;;
++esac
++
++# Handle CRLF in mingw tool chain
++opt_cr=
++case $build_os in
++mingw*)
++  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
++  ;;
++esac
++
++# If we're using GNU nm, then use its standard symbol codes.
++case `$NM -V 2>&1` in
++*GNU* | *'with BFD'*)
++  symcode='[[ABCDGIRSTW]]' ;;
++esac
++
++# Try without a prefix undercore, then with it.
++for ac_symprfx in "" "_"; do
++
++  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
++  symxfrm="\\1 $ac_symprfx\\2 \\2"
++
++  # Write the raw and C identifiers.
++  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
++
++  # Check to see that the pipe works correctly.
++  pipe_works=no
++
++  rm -f conftest*
++  cat > conftest.$ac_ext <<EOF
++#ifdef __cplusplus
++extern "C" {
++#endif
++char nm_test_var;
++void nm_test_func(){}
++#ifdef __cplusplus
++}
++#endif
++int main(){nm_test_var='a';nm_test_func();return(0);}
++EOF
++
++  if AC_TRY_EVAL(ac_compile); then
++    # Now try to grab the symbols.
++    nlist=conftest.nm
++    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
++      # Try sorting and uniquifying the output.
++      if sort "$nlist" | uniq > "$nlist"T; then
++	mv -f "$nlist"T "$nlist"
++      else
++	rm -f "$nlist"T
++      fi
++
++      # Make sure that we snagged all the symbols we need.
++      if grep ' nm_test_var$' "$nlist" >/dev/null; then
++	if grep ' nm_test_func$' "$nlist" >/dev/null; then
++	  cat <<EOF > conftest.$ac_ext
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++EOF
++	  # Now generate the symbol file.
++	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
++
++	  cat <<EOF >> conftest.$ac_ext
++#if defined (__STDC__) && __STDC__
++# define lt_ptr_t void *
++#else
++# define lt_ptr_t char *
++# define const
++#endif
++
++/* The mapping between symbol names and symbols. */
++const struct {
++  const char *name;
++  lt_ptr_t address;
++}
++lt_preloaded_symbols[[]] =
++{
++EOF
++	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
++	  cat <<\EOF >> conftest.$ac_ext
++  {0, (lt_ptr_t) 0}
++};
++
++#ifdef __cplusplus
++}
++#endif
++EOF
++	  # Now try linking the two files.
++	  mv conftest.$ac_objext conftstm.$ac_objext
++	  lt_save_LIBS="$LIBS"
++	  lt_save_CFLAGS="$CFLAGS"
++	  LIBS="conftstm.$ac_objext"
++	  CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
++	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
++	    pipe_works=yes
++	  fi
++	  LIBS="$lt_save_LIBS"
++	  CFLAGS="$lt_save_CFLAGS"
++	else
++	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
++	fi
++      else
++	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
++      fi
++    else
++      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
++    fi
++  else
++    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
++    cat conftest.$ac_ext >&5
++  fi
++  rm -f conftest* conftst*
++
++  # Do not use the global_symbol_pipe unless it works.
++  if test "$pipe_works" = yes; then
++    break
++  else
++    lt_cv_sys_global_symbol_pipe=
++  fi
++done
++])
++if test -z "$lt_cv_sys_global_symbol_pipe"; then
++  lt_cv_sys_global_symbol_to_cdecl=
++fi
++if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
++  AC_MSG_RESULT(failed)
++else
++  AC_MSG_RESULT(ok)
++fi
++]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
++
++
++# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
++# ---------------------------------------
++AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
++[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
++_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
++_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
++
++AC_MSG_CHECKING([for $compiler option to produce PIC])
++ ifelse([$1],[CXX],[
++  # C++ specific cases for pic, static, wl, etc.
++  if test "$GXX" = yes; then
++    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
++
++    case $host_os in
++    aix*)
++      # All AIX code is PIC.
++      if test "$host_cpu" = ia64; then
++	# AIX 5 now supports IA64 processor
++	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
++      fi
++      ;;
++    amigaos*)
++      # FIXME: we need at least 68020 code to build shared libraries, but
++      # adding the `-m68020' flag to GCC prevents building anything better,
++      # like `-m68040'.
++      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
++      ;;
++    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
++      # PIC is the default for these OSes.
++      ;;
++    mingw* | os2* | pw32*)
++      # This hack is so that the source file can tell whether it is being
++      # built for inclusion in a dll (and should export symbols for example).
++      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
++      ;;
++    darwin* | rhapsody*)
++      # PIC is the default on this platform
++      # Common symbols not allowed in MH_DYLIB files
++      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
++      ;;
++    *djgpp*)
++      # DJGPP does not support shared libraries at all
++      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
++      ;;
++    interix3*)
++      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
++      # Instead, we relocate shared libraries at runtime.
++      ;;
++    sysv4*MP*)
++      if test -d /usr/nec; then
++	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
++      fi
++      ;;
++    hpux*)
++      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
++      # not for PA HP-UX.
++      case $host_cpu in
++      hppa*64*|ia64*)
++	;;
++      *)
++	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
++	;;
++      esac
++      ;;
++    *)
++      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
++      ;;
++    esac
++  else
++    case $host_os in
++      aix4* | aix5*)
++	# All AIX code is PIC.
++	if test "$host_cpu" = ia64; then
++	  # AIX 5 now supports IA64 processor
++	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
++	else
++	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
++	fi
++	;;
++      chorus*)
++	case $cc_basename in
++	cxch68*)
++	  # Green Hills C++ Compiler
++	  # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
++	  ;;
++	esac
++	;;
++       darwin*)
++         # PIC is the default on this platform
++         # Common symbols not allowed in MH_DYLIB files
++         case $cc_basename in
++           xlc*)
++           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
++           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++           ;;
++         esac
++       ;;
++      dgux*)
++	case $cc_basename in
++	  ec++*)
++	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
++	    ;;
++	  ghcx*)
++	    # Green Hills C++ Compiler
++	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
++	    ;;
++	  *)
++	    ;;
++	esac
++	;;
++      freebsd* | kfreebsd*-gnu | dragonfly*)
++	# FreeBSD uses GNU C++
++	;;
++      hpux9* | hpux10* | hpux11*)
++	case $cc_basename in
++	  CC*)
++	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
++	    if test "$host_cpu" != ia64; then
++	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
++	    fi
++	    ;;
++	  aCC*)
++	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
++	    case $host_cpu in
++	    hppa*64*|ia64*)
++	      # +Z the default
++	      ;;
++	    *)
++	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
++	      ;;
++	    esac
++	    ;;
++	  *)
++	    ;;
++	esac
++	;;
++      interix*)
++	# This is c89, which is MS Visual C++ (no shared libs)
++	# Anyone wants to do a port?
++	;;
++      irix5* | irix6* | nonstopux*)
++	case $cc_basename in
++	  CC*)
++	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
++	    # CC pic flag -KPIC is the default.
++	    ;;
++	  *)
++	    ;;
++	esac
++	;;
++      linux*)
++	case $cc_basename in
++	  KCC*)
++	    # KAI C++ Compiler
++	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
++	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
++	    ;;
++	  icpc* | ecpc*)
++	    # Intel C++
++	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
++	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
++	    ;;
++	  pgCC*)
++	    # Portland Group C++ compiler.
++	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
++	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
++	    ;;
++	  cxx*)
++	    # Compaq C++
++	    # Make sure the PIC flag is empty.  It appears that all Alpha
++	    # Linux and Compaq Tru64 Unix objects are PIC.
++	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
++	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
++	    ;;
++	  *)
++	    ;;
++	esac
++	;;
++      lynxos*)
++	;;
++      m88k*)
++	;;
++      mvs*)
++	case $cc_basename in
++	  cxx*)
++	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
++	    ;;
++	  *)
++	    ;;
++	esac
++	;;
++      netbsd*)
++	;;
++      osf3* | osf4* | osf5*)
++	case $cc_basename in
++	  KCC*)
++	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
++	    ;;
++	  RCC*)
++	    # Rational C++ 2.4.1
++	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
++	    ;;
++	  cxx*)
++	    # Digital/Compaq C++
++	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++	    # Make sure the PIC flag is empty.  It appears that all Alpha
++	    # Linux and Compaq Tru64 Unix objects are PIC.
++	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
++	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
++	    ;;
++	  *)
++	    ;;
++	esac
++	;;
++      psos*)
++	;;
++      solaris*)
++	case $cc_basename in
++	  CC*)
++	    # Sun C++ 4.2, 5.x and Centerline C++
++	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
++	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
++	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
++	    ;;
++	  gcx*)
++	    # Green Hills C++ Compiler
++	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
++	    ;;
++	  *)
++	    ;;
++	esac
++	;;
++      sunos4*)
++	case $cc_basename in
++	  CC*)
++	    # Sun C++ 4.x
++	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
++	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
++	    ;;
++	  lcc*)
++	    # Lucid
++	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
++	    ;;
++	  *)
++	    ;;
++	esac
++	;;
++      tandem*)
++	case $cc_basename in
++	  NCC*)
++	    # NonStop-UX NCC 3.20
++	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
++	    ;;
++	  *)
++	    ;;
++	esac
++	;;
++      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
++	case $cc_basename in
++	  CC*)
++	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
++	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
++	    ;;
++	esac
++	;;
++      vxworks*)
++	;;
++      *)
++	_LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
++	;;
++    esac
++  fi
++],
++[
++  if test "$GCC" = yes; then
++    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
++
++    case $host_os in
++      aix*)
++      # All AIX code is PIC.
++      if test "$host_cpu" = ia64; then
++	# AIX 5 now supports IA64 processor
++	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
++      fi
++      ;;
++
++    amigaos*)
++      # FIXME: we need at least 68020 code to build shared libraries, but
++      # adding the `-m68020' flag to GCC prevents building anything better,
++      # like `-m68040'.
++      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
++      ;;
++
++    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
++      # PIC is the default for these OSes.
++      ;;
++
++    mingw* | pw32* | os2*)
++      # This hack is so that the source file can tell whether it is being
++      # built for inclusion in a dll (and should export symbols for example).
++      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
++      ;;
++
++    darwin* | rhapsody*)
++      # PIC is the default on this platform
++      # Common symbols not allowed in MH_DYLIB files
++      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
++      ;;
++
++    interix3*)
++      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
++      # Instead, we relocate shared libraries at runtime.
++      ;;
++
++    msdosdjgpp*)
++      # Just because we use GCC doesn't mean we suddenly get shared libraries
++      # on systems that don't support them.
++      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
++      enable_shared=no
++      ;;
++
++    sysv4*MP*)
++      if test -d /usr/nec; then
++	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
++      fi
++      ;;
++
++    hpux*)
++      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
++      # not for PA HP-UX.
++      case $host_cpu in
++      hppa*64*|ia64*)
++	# +Z the default
++	;;
++      *)
++	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
++	;;
++      esac
++      ;;
++
++    *)
++      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
++      ;;
++    esac
++  else
++    # PORTME Check for flag to pass linker flags through the system compiler.
++    case $host_os in
++    aix*)
++      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++      if test "$host_cpu" = ia64; then
++	# AIX 5 now supports IA64 processor
++	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
++      else
++	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
++      fi
++      ;;
++      darwin*)
++        # PIC is the default on this platform
++        # Common symbols not allowed in MH_DYLIB files
++       case $cc_basename in
++         xlc*)
++         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
++         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++         ;;
++       esac
++       ;;
++
++    mingw* | pw32* | os2*)
++      # This hack is so that the source file can tell whether it is being
++      # built for inclusion in a dll (and should export symbols for example).
++      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
++      ;;
++
++    hpux9* | hpux10* | hpux11*)
++      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
++      # not for PA HP-UX.
++      case $host_cpu in
++      hppa*64*|ia64*)
++	# +Z the default
++	;;
++      *)
++	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
++	;;
++      esac
++      # Is there a better lt_prog_compiler_static that works with the bundled CC?
++      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
++      ;;
++
++    irix5* | irix6* | nonstopux*)
++      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++      # PIC (with -KPIC) is the default.
++      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
++      ;;
++
++    newsos6)
++      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
++      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
++      ;;
++
++    linux*)
++      case $cc_basename in
++      icc* | ecc*)
++	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
++	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
++        ;;
++      pgcc* | pgf77* | pgf90* | pgf95*)
++        # Portland Group compilers (*not* the Pentium gcc compiler,
++	# which looks to be a dead project)
++	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
++	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
++        ;;
++      ccc*)
++        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++        # All Alpha code is PIC.
++        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
++        ;;
++      esac
++      ;;
++
++    osf3* | osf4* | osf5*)
++      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++      # All OSF/1 code is PIC.
++      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
++      ;;
++
++    solaris*)
++      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
++      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
++      case $cc_basename in
++      f77* | f90* | f95*)
++	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
++      *)
++	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
++      esac
++      ;;
++
++    sunos4*)
++      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
++      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
++      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
++      ;;
++
++    sysv4 | sysv4.2uw2* | sysv4.3*)
++      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
++      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
++      ;;
++
++    sysv4*MP*)
++      if test -d /usr/nec ;then
++	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
++	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
++      fi
++      ;;
++
++    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
++      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
++      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
++      ;;
++
++    unicos*)
++      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
++      ;;
++
++    uts4*)
++      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
++      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
++      ;;
++
++    *)
++      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
++      ;;
++    esac
++  fi
++])
++AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
++
++#
++# Check to make sure the PIC flag actually works.
++#
++if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
++  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
++    _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
++    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
++    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
++     "" | " "*) ;;
++     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
++     esac],
++    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
++     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
++fi
++case $host_os in
++  # For platforms which do not support PIC, -DPIC is meaningless:
++  *djgpp*)
++    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
++    ;;
++  *)
++    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
++    ;;
++esac
++
++#
++# Check to make sure the static flag actually works.
++#
++wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\"
++AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
++  _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
++  $lt_tmp_static_flag,
++  [],
++  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
++])
++
++
++# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
++# ------------------------------------
++# See if the linker supports building shared libraries.
++AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
++[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
++ifelse([$1],[CXX],[
++  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
++  case $host_os in
++  aix4* | aix5*)
++    # If we're using GNU nm, then we don't want the "-C" option.
++    # -C means demangle to AIX nm, but means don't demangle with GNU nm
++    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
++      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
++    else
++      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
++    fi
++    ;;
++  pw32*)
++    _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
++  ;;
++  cygwin* | mingw*)
++    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
++  ;;
++  *)
++    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
++  ;;
++  esac
++],[
++  runpath_var=
++  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
++  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
++  _LT_AC_TAGVAR(archive_cmds, $1)=
++  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
++  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
++  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
++  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
++  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
++  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
++  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
++  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
++  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
++  _LT_AC_TAGVAR(hardcode_direct, $1)=no
++  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
++  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
++  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
++  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
++  _LT_AC_TAGVAR(module_cmds, $1)=
++  _LT_AC_TAGVAR(module_expsym_cmds, $1)=
++  _LT_AC_TAGVAR(always_export_symbols, $1)=no
++  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
++  # include_expsyms should be a list of space-separated symbols to be *always*
++  # included in the symbol list
++  _LT_AC_TAGVAR(include_expsyms, $1)=
++  # exclude_expsyms can be an extended regexp of symbols to exclude
++  # it will be wrapped by ` (' and `)$', so one must not match beginning or
++  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
++  # as well as any symbol that contains `d'.
++  _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
++  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
++  # platforms (ab)use it in PIC code, but their linkers get confused if
++  # the symbol is explicitly referenced.  Since portable code cannot
++  # rely on this symbol name, it's probably fine to never include it in
++  # preloaded symbol tables.
++  extract_expsyms_cmds=
++  # Just being paranoid about ensuring that cc_basename is set.
++  _LT_CC_BASENAME([$compiler])
++  case $host_os in
++  cygwin* | mingw* | pw32*)
++    # FIXME: the MSVC++ port hasn't been tested in a loooong time
++    # When not using gcc, we currently assume that we are using
++    # Microsoft Visual C++.
++    if test "$GCC" != yes; then
++      with_gnu_ld=no
++    fi
++    ;;
++  interix*)
++    # we just hope/assume this is gcc and not c89 (= MSVC++)
++    with_gnu_ld=yes
++    ;;
++  openbsd*)
++    with_gnu_ld=no
++    ;;
++  esac
++
++  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
++  if test "$with_gnu_ld" = yes; then
++    # If archive_cmds runs LD, not CC, wlarc should be empty
++    wlarc='${wl}'
++
++    # Set some defaults for GNU ld with shared library support. These
++    # are reset later if shared libraries are not supported. Putting them
++    # here allows them to be overridden if necessary.
++    runpath_var=LD_RUN_PATH
++    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
++    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
++    # ancient GNU ld didn't support --whole-archive et. al.
++    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
++	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
++      else
++  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
++    fi
++    supports_anon_versioning=no
++    case `$LD -v 2>/dev/null` in
++      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
++      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
++      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
++      *\ 2.11.*) ;; # other 2.11 versions
++      *) supports_anon_versioning=yes ;;
++    esac
++
++    # See if GNU ld supports shared libraries.
++    case $host_os in
++    aix3* | aix4* | aix5*)
++      # On AIX/PPC, the GNU linker is very broken
++      if test "$host_cpu" != ia64; then
++	_LT_AC_TAGVAR(ld_shlibs, $1)=no
++	cat <<EOF 1>&2
++
++*** Warning: the GNU linker, at least up to release 2.9.1, is reported
++*** to be unable to reliably create shared libraries on AIX.
++*** Therefore, libtool is disabling shared libraries support.  If you
++*** really care for shared libraries, you may want to modify your PATH
++*** so that a non-GNU linker is found, and then restart.
++
++EOF
++      fi
++      ;;
++
++    amigaos*)
++      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
++      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
++      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
++
++      # Samuel A. Falvo II <kc5tja at dolphin.openprojects.net> reports
++      # that the semantics of dynamic libraries on AmigaOS, at least up
++      # to version 4, is to share data among multiple programs linked
++      # with the same dynamic library.  Since this doesn't match the
++      # behavior of shared libraries on other platforms, we can't use
++      # them.
++      _LT_AC_TAGVAR(ld_shlibs, $1)=no
++      ;;
++
++    beos*)
++      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
++	_LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
++	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
++	# support --undefined.  This deserves some investigation.  FIXME
++	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++      else
++	_LT_AC_TAGVAR(ld_shlibs, $1)=no
++      fi
++      ;;
++
++    cygwin* | mingw* | pw32*)
++      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
++      # as there is no search path for DLLs.
++      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
++      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
++      _LT_AC_TAGVAR(always_export_symbols, $1)=no
++      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
++      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
++
++      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
++        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
++	# If the export-symbols file already is a .def file (1st line
++	# is EXPORTS), use it as is; otherwise, prepend...
++	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++	  cp $export_symbols $output_objdir/$soname.def;
++	else
++	  echo EXPORTS > $output_objdir/$soname.def;
++	  cat $export_symbols >> $output_objdir/$soname.def;
++	fi~
++	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
++      else
++	_LT_AC_TAGVAR(ld_shlibs, $1)=no
++      fi
++      ;;
++
++    interix3*)
++      _LT_AC_TAGVAR(hardcode_direct, $1)=no
++      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
++      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
++      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
++      # Instead, shared libraries are loaded at an image base (0x10000000 by
++      # default) and relocated if they conflict, which is a slow very memory
++      # consuming and fragmenting process.  To avoid this, we pick a random,
++      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
++      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
++      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
++      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
++      ;;
++
++    linux*)
++      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
++	tmp_addflag=
++	case $cc_basename,$host_cpu in
++	pgcc*)				# Portland Group C compiler
++	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
++	  tmp_addflag=' $pic_flag'
++	  ;;
++	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
++	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
++	  tmp_addflag=' $pic_flag -Mnomain' ;;
++	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
++	  tmp_addflag=' -i_dynamic' ;;
++	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
++	  tmp_addflag=' -i_dynamic -nofor_main' ;;
++	ifc* | ifort*)			# Intel Fortran compiler
++	  tmp_addflag=' -nofor_main' ;;
++	esac
++	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++
++	if test $supports_anon_versioning = yes; then
++	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
++  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
++  $echo "local: *; };" >> $output_objdir/$libname.ver~
++	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
++	fi
++      else
++	_LT_AC_TAGVAR(ld_shlibs, $1)=no
++      fi
++      ;;
++
++    netbsd*)
++      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
++	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
++	wlarc=
++      else
++	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++      fi
++      ;;
++
++    solaris*)
++      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
++	_LT_AC_TAGVAR(ld_shlibs, $1)=no
++	cat <<EOF 1>&2
++
++*** Warning: The releases 2.8.* of the GNU linker cannot reliably
++*** create shared libraries on Solaris systems.  Therefore, libtool
++*** is disabling shared libraries support.  We urge you to upgrade GNU
++*** binutils to release 2.9.1 or newer.  Another option is to modify
++*** your PATH or compiler configuration so that the native linker is
++*** used, and then restart.
++
++EOF
++      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
++	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++      else
++	_LT_AC_TAGVAR(ld_shlibs, $1)=no
++      fi
++      ;;
++
++    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
++      case `$LD -v 2>&1` in
++        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) 
++	_LT_AC_TAGVAR(ld_shlibs, $1)=no
++	cat <<_LT_EOF 1>&2
++
++*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
++*** reliably create shared libraries on SCO systems.  Therefore, libtool
++*** is disabling shared libraries support.  We urge you to upgrade GNU
++*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
++*** your PATH or compiler configuration so that the native linker is
++*** used, and then restart.
++
++_LT_EOF
++	;;
++	*)
++	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
++	    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
++	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
++	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
++	  else
++	    _LT_AC_TAGVAR(ld_shlibs, $1)=no
++	  fi
++	;;
++      esac
++      ;;
++
++    sunos4*)
++      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
++      wlarc=
++      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
++      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++      ;;
++
++    *)
++      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
++	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++      else
++	_LT_AC_TAGVAR(ld_shlibs, $1)=no
++      fi
++      ;;
++    esac
++
++    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
++      runpath_var=
++      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
++      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
++      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
++    fi
++  else
++    # PORTME fill in a description of your system's linker (not GNU ld)
++    case $host_os in
++    aix3*)
++      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
++      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
++      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
++      # Note: this linker hardcodes the directories in LIBPATH if there
++      # are no directories specified by -L.
++      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
++      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
++	# Neither direct hardcoding nor static linking is supported with a
++	# broken collect2.
++	_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
++      fi
++      ;;
++
++    aix4* | aix5*)
++      if test "$host_cpu" = ia64; then
++	# On IA64, the linker does run time linking by default, so we don't
++	# have to do anything special.
++	aix_use_runtimelinking=no
++	exp_sym_flag='-Bexport'
++	no_entry_flag=""
++      else
++	# If we're using GNU nm, then we don't want the "-C" option.
++	# -C means demangle to AIX nm, but means don't demangle with GNU nm
++	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
++	  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
++	else
++	  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
++	fi
++	aix_use_runtimelinking=no
++
++	# Test if we are trying to use run time linking or normal
++	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
++	# need to do runtime linking.
++	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
++	  for ld_flag in $LDFLAGS; do
++  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
++  	    aix_use_runtimelinking=yes
++  	    break
++  	  fi
++	  done
++	  ;;
++	esac
++
++	exp_sym_flag='-bexport'
++	no_entry_flag='-bnoentry'
++      fi
++
++      # When large executables or shared objects are built, AIX ld can
++      # have problems creating the table of contents.  If linking a library
++      # or program results in "error TOC overflow" add -mminimal-toc to
++      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
++      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
++
++      _LT_AC_TAGVAR(archive_cmds, $1)=''
++      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
++      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
++      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
++
++      if test "$GCC" = yes; then
++	case $host_os in aix4.[[012]]|aix4.[[012]].*)
++	# We only want to do this on AIX 4.2 and lower, the check
++	# below for broken collect2 doesn't work under 4.3+
++	  collect2name=`${CC} -print-prog-name=collect2`
++	  if test -f "$collect2name" && \
++  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
++	  then
++  	  # We have reworked collect2
++  	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
++	  else
++  	  # We have old collect2
++  	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
++  	  # It fails to find uninstalled libraries when the uninstalled
++  	  # path is not listed in the libpath.  Setting hardcode_minus_L
++  	  # to unsupported forces relinking
++  	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
++  	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
++  	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
++	  fi
++	  ;;
++	esac
++	shared_flag='-shared'
++	if test "$aix_use_runtimelinking" = yes; then
++	  shared_flag="$shared_flag "'${wl}-G'
++	fi
++      else
++	# not using gcc
++	if test "$host_cpu" = ia64; then
++  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
++  	# chokes on -Wl,-G. The following line is correct:
++	  shared_flag='-G'
++	else
++	  if test "$aix_use_runtimelinking" = yes; then
++	    shared_flag='${wl}-G'
++	  else
++	    shared_flag='${wl}-bM:SRE'
++	  fi
++	fi
++      fi
++
++      # It seems that -bexpall does not export symbols beginning with
++      # underscore (_), so it is better to generate a list of symbols to export.
++      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
++      if test "$aix_use_runtimelinking" = yes; then
++	# Warning - without using the other runtime loading flags (-brtl),
++	# -berok will link without error, but may produce a broken library.
++	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
++       # Determine the default libpath from the value encoded in an empty executable.
++       _LT_AC_SYS_LIBPATH_AIX
++       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
++	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
++       else
++	if test "$host_cpu" = ia64; then
++	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
++	  _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
++	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
++	else
++	 # Determine the default libpath from the value encoded in an empty executable.
++	 _LT_AC_SYS_LIBPATH_AIX
++	 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
++	  # Warning - without using the other run time loading flags,
++	  # -berok will link without error, but may produce a broken library.
++	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
++	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
++	  # Exported symbols can be pulled into shared objects from archives
++	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
++	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
++	  # This is similar to how AIX traditionally builds its shared libraries.
++	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
++	fi
++      fi
++      ;;
++
++    amigaos*)
++      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
++      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
++      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
++      # see comment about different semantics on the GNU ld section
++      _LT_AC_TAGVAR(ld_shlibs, $1)=no
++      ;;
++
++    bsdi[[45]]*)
++      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
++      ;;
++
++    cygwin* | mingw* | pw32*)
++      # When not using gcc, we currently assume that we are using
++      # Microsoft Visual C++.
++      # hardcode_libdir_flag_spec is actually meaningless, as there is
++      # no search path for DLLs.
++      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
++      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
++      # Tell ltmain to make .lib files, not .a files.
++      libext=lib
++      # Tell ltmain to make .dll files, not .so files.
++      shrext_cmds=".dll"
++      # FIXME: Setting linknames here is a bad hack.
++      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
++      # The linker will automatically build a .lib file if we build a DLL.
++      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
++      # FIXME: Should let the user specify the lib program.
++      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
++      _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
++      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
++      ;;
++
++    darwin* | rhapsody*)
++      case $host_os in
++        rhapsody* | darwin1.[[012]])
++         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
++         ;;
++       *) # Darwin 1.3 on
++         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
++           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
++         else
++           case ${MACOSX_DEPLOYMENT_TARGET} in
++             10.[[012]])
++               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
++               ;;
++             10.*)
++               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
++               ;;
++           esac
++         fi
++         ;;
++      esac
++      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
++      _LT_AC_TAGVAR(hardcode_direct, $1)=no
++      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
++      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
++      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
++      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
++    if test "$GCC" = yes ; then
++    	output_verbose_link_cmd='echo'
++        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
++      _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
++      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
++      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
++      _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
++    else
++      case $cc_basename in
++        xlc*)
++         output_verbose_link_cmd='echo'
++         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
++         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
++          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
++         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
++          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
++          ;;
++       *)
++         _LT_AC_TAGVAR(ld_shlibs, $1)=no
++          ;;
++      esac
++    fi
++      ;;
++
++    dgux*)
++      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
++      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
++      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++      ;;
++
++    freebsd1*)
++      _LT_AC_TAGVAR(ld_shlibs, $1)=no
++      ;;
++
++    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
++    # support.  Future versions do this automatically, but an explicit c++rt0.o
++    # does not break anything, and helps significantly (at the cost of a little
++    # extra space).
++    freebsd2.2*)
++      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
++      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
++      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
++      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++      ;;
++
++    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
++    freebsd2*)
++      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
++      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
++      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
++      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++      ;;
++
++    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
++    freebsd* | kfreebsd*-gnu | dragonfly*)
++      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
++      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
++      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
++      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++      ;;
++
++    hpux9*)
++      if test "$GCC" = yes; then
++	_LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++      else
++	_LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++      fi
++      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
++      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
++      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
++
++      # hardcode_minus_L: Not really in the search PATH,
++      # but as the default location of the library.
++      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
++      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
++      ;;
++
++    hpux10*)
++      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
++	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++      else
++	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
++      fi
++      if test "$with_gnu_ld" = no; then
++	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
++	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
++
++	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
++	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
++
++	# hardcode_minus_L: Not really in the search PATH,
++	# but as the default location of the library.
++	_LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
++      fi
++      ;;
++
++    hpux11*)
++      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
++	case $host_cpu in
++	hppa*64*)
++	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++	  ;;
++	ia64*)
++	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
++	  ;;
++	*)
++	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++	  ;;
++	esac
++      else
++	case $host_cpu in
++	hppa*64*)
++	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++	  ;;
++	ia64*)
++	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
++	  ;;
++	*)
++	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++	  ;;
++	esac
++      fi
++      if test "$with_gnu_ld" = no; then
++	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
++	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
++
++	case $host_cpu in
++	hppa*64*|ia64*)
++	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
++	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
++	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++	  ;;
++	*)
++	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
++	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
++
++	  # hardcode_minus_L: Not really in the search PATH,
++	  # but as the default location of the library.
++	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
++	  ;;
++	esac
++      fi
++      ;;
++
++    irix5* | irix6* | nonstopux*)
++      if test "$GCC" = yes; then
++	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++      else
++	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
++	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
++      fi
++      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
++      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
++      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
++      ;;
++
++    netbsd*)
++      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
++	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
++      else
++	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
++      fi
++      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
++      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
++      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++      ;;
++
++    newsos6)
++      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
++      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
++      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
++      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
++      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++      ;;
++
++    openbsd*)
++      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
++      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
++	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
++	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
++	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
++	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
++      else
++       case $host_os in
++	 openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
++	   _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
++	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
++	   ;;
++	 *)
++	   _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
++	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
++	   ;;
++       esac
++      fi
++      ;;
++
++    os2*)
++      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
++      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
++      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
++      _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
++      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
++      ;;
++
++    osf3*)
++      if test "$GCC" = yes; then
++	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
++	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++      else
++	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
++	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
++      fi
++      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
++      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
++      ;;
++
++    osf4* | osf5*)	# as osf3* with the addition of -msym flag
++      if test "$GCC" = yes; then
++	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
++	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
++      else
++	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
++	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
++	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
++	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
++
++	# Both c and cxx compiler support -rpath directly
++	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
++      fi
++      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
++      ;;
++
++    solaris*)
++      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
++      if test "$GCC" = yes; then
++	wlarc='${wl}'
++	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
++	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
++      else
++	wlarc=''
++	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
++	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
++  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
++      fi
++      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
++      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++      case $host_os in
++      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
++      *)
++ 	# The compiler driver will combine linker options so we
++ 	# cannot just pass the convience library names through
++ 	# without $wl, iff we do not link with $LD.
++ 	# Luckily, gcc supports the same syntax we need for Sun Studio.
++ 	# Supported since Solaris 2.6 (maybe 2.5.1?)
++ 	case $wlarc in
++ 	'')
++ 	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
++ 	*)
++ 	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
++ 	esac ;;
++      esac
++      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
++      ;;
++
++    sunos4*)
++      if test "x$host_vendor" = xsequent; then
++	# Use $CC to link under sequent, because it throws in some extra .o
++	# files that make .init and .fini sections work.
++	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
++      else
++	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
++      fi
++      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
++      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
++      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
++      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++      ;;
++
++    sysv4)
++      case $host_vendor in
++	sni)
++	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
++	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
++	;;
++	siemens)
++	  ## LD is ld it makes a PLAMLIB
++	  ## CC just makes a GrossModule.
++	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
++	  _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
++	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
++        ;;
++	motorola)
++	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
++	  _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
++	;;
++      esac
++      runpath_var='LD_RUN_PATH'
++      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++      ;;
++
++    sysv4.3*)
++      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
++      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
++      ;;
++
++    sysv4*MP*)
++      if test -d /usr/nec; then
++	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
++	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++	runpath_var=LD_RUN_PATH
++	hardcode_runpath_var=yes
++	_LT_AC_TAGVAR(ld_shlibs, $1)=yes
++      fi
++      ;;
++
++    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*)
++      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
++      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
++      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++      runpath_var='LD_RUN_PATH'
++
++      if test "$GCC" = yes; then
++	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
++	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
++      else
++	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
++	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
++      fi
++      ;;
++
++    sysv5* | sco3.2v5* | sco5v6*)
++      # Note: We can NOT use -z defs as we might desire, because we do not
++      # link with -lc, and that would cause any symbols used from libc to
++      # always be unresolved, which means just about no library would
++      # ever link correctly.  If we're not using GNU ld we use -z text
++      # though, which does catch some bad symbols but isn't as heavy-handed
++      # as -z defs.
++      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
++      _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
++      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
++      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
++      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
++      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
++      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
++      runpath_var='LD_RUN_PATH'
++
++      if test "$GCC" = yes; then
++	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
++	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
++      else
++	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
++	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
++      fi
++      ;;
++
++    uts4*)
++      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
++      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
++      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++      ;;
++
++    *)
++      _LT_AC_TAGVAR(ld_shlibs, $1)=no
++      ;;
++    esac
++  fi
++])
++AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
++test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
++
++#
++# Do we need to explicitly link libc?
++#
++case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
++x|xyes)
++  # Assume -lc should be added
++  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
++
++  if test "$enable_shared" = yes && test "$GCC" = yes; then
++    case $_LT_AC_TAGVAR(archive_cmds, $1) in
++    *'~'*)
++      # FIXME: we may have to deal with multi-command sequences.
++      ;;
++    '$CC '*)
++      # Test whether the compiler implicitly links with -lc since on some
++      # systems, -lgcc has to come before -lc. If gcc already passes -lc
++      # to ld, don't add -lc before -lgcc.
++      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
++      $rm conftest*
++      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
++
++      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
++        soname=conftest
++        lib=conftest
++        libobjs=conftest.$ac_objext
++        deplibs=
++        wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
++	pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
++        compiler_flags=-v
++        linker_flags=-v
++        verstring=
++        output_objdir=.
++        libname=conftest
++        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
++        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
++        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
++        then
++	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
++        else
++	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
++        fi
++        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
++      else
++        cat conftest.err 1>&5
++      fi
++      $rm conftest*
++      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
++      ;;
++    esac
++  fi
++  ;;
++esac
++])# AC_LIBTOOL_PROG_LD_SHLIBS
++
++
++# _LT_AC_FILE_LTDLL_C
++# -------------------
++# Be careful that the start marker always follows a newline.
++AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
++# /* ltdll.c starts here */
++# #define WIN32_LEAN_AND_MEAN
++# #include <windows.h>
++# #undef WIN32_LEAN_AND_MEAN
++# #include <stdio.h>
++#
++# #ifndef __CYGWIN__
++# #  ifdef __CYGWIN32__
++# #    define __CYGWIN__ __CYGWIN32__
++# #  endif
++# #endif
++#
++# #ifdef __cplusplus
++# extern "C" {
++# #endif
++# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
++# #ifdef __cplusplus
++# }
++# #endif
++#
++# #ifdef __CYGWIN__
++# #include <cygwin/cygwin_dll.h>
++# DECLARE_CYGWIN_DLL( DllMain );
++# #endif
++# HINSTANCE __hDllInstance_base;
++#
++# BOOL APIENTRY
++# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
++# {
++#   __hDllInstance_base = hInst;
++#   return TRUE;
++# }
++# /* ltdll.c ends here */
++])# _LT_AC_FILE_LTDLL_C
++
++
++# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
++# ---------------------------------
++AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
++
++
++# old names
++AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
++AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
++AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
++AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
++AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
++AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
++AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
++
++# This is just to silence aclocal about the macro not being used
++ifelse([AC_DISABLE_FAST_INSTALL])
++
++AC_DEFUN([LT_AC_PROG_GCJ],
++[AC_CHECK_TOOL(GCJ, gcj, no)
++  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
++  AC_SUBST(GCJFLAGS)
++])
++
++AC_DEFUN([LT_AC_PROG_RC],
++[AC_CHECK_TOOL(RC, windres, no)
++])
++
++# NOTE: This macro has been submitted for inclusion into   #
++#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
++#  a released version of Autoconf we should remove this    #
++#  macro and use it instead.                               #
++# LT_AC_PROG_SED
++# --------------
++# Check for a fully-functional sed program, that truncates
++# as few characters as possible.  Prefer GNU sed if found.
++AC_DEFUN([LT_AC_PROG_SED],
++[AC_MSG_CHECKING([for a sed that does not truncate output])
++AC_CACHE_VAL(lt_cv_path_SED,
++[# Loop through the user's path and test for sed and gsed.
++# Then use that list of sed's as ones to test for truncation.
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++  for lt_ac_prog in sed gsed; do
++    for ac_exec_ext in '' $ac_executable_extensions; do
++      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
++        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
++      fi
++    done
++  done
++done
++IFS=$as_save_IFS
++lt_ac_max=0
++lt_ac_count=0
++# Add /usr/xpg4/bin/sed as it is typically found on Solaris
++# along with /bin/sed that truncates output.
++for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
++  test ! -f $lt_ac_sed && continue
++  cat /dev/null > conftest.in
++  lt_ac_count=0
++  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
++  # Check for GNU sed and select it if it is found.
++  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
++    lt_cv_path_SED=$lt_ac_sed
++    break
++  fi
++  while true; do
++    cat conftest.in conftest.in >conftest.tmp
++    mv conftest.tmp conftest.in
++    cp conftest.in conftest.nl
++    echo >>conftest.nl
++    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
++    cmp -s conftest.out conftest.nl || break
++    # 10000 chars as input seems more than enough
++    test $lt_ac_count -gt 10 && break
++    lt_ac_count=`expr $lt_ac_count + 1`
++    if test $lt_ac_count -gt $lt_ac_max; then
++      lt_ac_max=$lt_ac_count
++      lt_cv_path_SED=$lt_ac_sed
++    fi
++  done
++done
++])
++SED=$lt_cv_path_SED
++AC_SUBST([SED])
++AC_MSG_RESULT([$SED])
++])
++
++# Copyright (C) 2002, 2003, 2005  Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# AM_AUTOMAKE_VERSION(VERSION)
++# ----------------------------
++# Automake X.Y traces this macro to ensure aclocal.m4 has been
++# generated from the m4 files accompanying Automake X.Y.
++AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
++
++# AM_SET_CURRENT_AUTOMAKE_VERSION
++# -------------------------------
++# Call AM_AUTOMAKE_VERSION so it can be traced.
++# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
++AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
++	 [AM_AUTOMAKE_VERSION([1.9.6])])
++
++# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
++
++# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
++# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
++# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
++#
++# Of course, Automake must honor this variable whenever it calls a
++# tool from the auxiliary directory.  The problem is that $srcdir (and
++# therefore $ac_aux_dir as well) can be either absolute or relative,
++# depending on how configure is run.  This is pretty annoying, since
++# it makes $ac_aux_dir quite unusable in subdirectories: in the top
++# source directory, any form will work fine, but in subdirectories a
++# relative path needs to be adjusted first.
++#
++# $ac_aux_dir/missing
++#    fails when called from a subdirectory if $ac_aux_dir is relative
++# $top_srcdir/$ac_aux_dir/missing
++#    fails if $ac_aux_dir is absolute,
++#    fails when called from a subdirectory in a VPATH build with
++#          a relative $ac_aux_dir
++#
++# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
++# are both prefixed by $srcdir.  In an in-source build this is usually
++# harmless because $srcdir is `.', but things will broke when you
++# start a VPATH build or use an absolute $srcdir.
++#
++# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
++# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
++#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
++# and then we would define $MISSING as
++#   MISSING="\${SHELL} $am_aux_dir/missing"
++# This will work as long as MISSING is not called from configure, because
++# unfortunately $(top_srcdir) has no meaning in configure.
++# However there are other variables, like CC, which are often used in
++# configure, and could therefore not use this "fixed" $ac_aux_dir.
++#
++# Another solution, used here, is to always expand $ac_aux_dir to an
++# absolute PATH.  The drawback is that using absolute paths prevent a
++# configured tree to be moved without reconfiguration.
++
++AC_DEFUN([AM_AUX_DIR_EXPAND],
++[dnl Rely on autoconf to set up CDPATH properly.
++AC_PREREQ([2.50])dnl
++# expand $ac_aux_dir to an absolute path
++am_aux_dir=`cd $ac_aux_dir && pwd`
++])
++
++# AM_CONDITIONAL                                            -*- Autoconf -*-
++
++# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
++# Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# serial 7
++
++# AM_CONDITIONAL(NAME, SHELL-CONDITION)
++# -------------------------------------
++# Define a conditional.
++AC_DEFUN([AM_CONDITIONAL],
++[AC_PREREQ(2.52)dnl
++ ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
++	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
++AC_SUBST([$1_TRUE])
++AC_SUBST([$1_FALSE])
++if $2; then
++  $1_TRUE=
++  $1_FALSE='#'
++else
++  $1_TRUE='#'
++  $1_FALSE=
++fi
++AC_CONFIG_COMMANDS_PRE(
++[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
++  AC_MSG_ERROR([[conditional "$1" was never defined.
++Usually this means the macro was only invoked conditionally.]])
++fi])])
++
++
++# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
++# Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# serial 8
++
++# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
++# written in clear, in which case automake, when reading aclocal.m4,
++# will think it sees a *use*, and therefore will trigger all it's
++# C support machinery.  Also note that it means that autoscan, seeing
++# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
++
++
++# _AM_DEPENDENCIES(NAME)
++# ----------------------
++# See how the compiler implements dependency checking.
++# NAME is "CC", "CXX", "GCJ", or "OBJC".
++# We try a few techniques and use that to set a single cache variable.
++#
++# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
++# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
++# dependency, and given that the user is not expected to run this macro,
++# just rely on AC_PROG_CC.
++AC_DEFUN([_AM_DEPENDENCIES],
++[AC_REQUIRE([AM_SET_DEPDIR])dnl
++AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
++AC_REQUIRE([AM_MAKE_INCLUDE])dnl
++AC_REQUIRE([AM_DEP_TRACK])dnl
++
++ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
++       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
++       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
++       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
++                   [depcc="$$1"   am_compiler_list=])
++
++AC_CACHE_CHECK([dependency style of $depcc],
++               [am_cv_$1_dependencies_compiler_type],
++[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
++  # We make a subdir and do the tests there.  Otherwise we can end up
++  # making bogus files that we don't know about and never remove.  For
++  # instance it was reported that on HP-UX the gcc test will end up
++  # making a dummy file named `D' -- because `-MD' means `put the output
++  # in D'.
++  mkdir conftest.dir
++  # Copy depcomp to subdir because otherwise we won't find it if we're
++  # using a relative directory.
++  cp "$am_depcomp" conftest.dir
++  cd conftest.dir
++  # We will build objects and dependencies in a subdirectory because
++  # it helps to detect inapplicable dependency modes.  For instance
++  # both Tru64's cc and ICC support -MD to output dependencies as a
++  # side effect of compilation, but ICC will put the dependencies in
++  # the current directory while Tru64 will put them in the object
++  # directory.
++  mkdir sub
++
++  am_cv_$1_dependencies_compiler_type=none
++  if test "$am_compiler_list" = ""; then
++     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
++  fi
++  for depmode in $am_compiler_list; do
++    # Setup a source with many dependencies, because some compilers
++    # like to wrap large dependency lists on column 80 (with \), and
++    # we should not choose a depcomp mode which is confused by this.
++    #
++    # We need to recreate these files for each test, as the compiler may
++    # overwrite some of them when testing with obscure command lines.
++    # This happens at least with the AIX C compiler.
++    : > sub/conftest.c
++    for i in 1 2 3 4 5 6; do
++      echo '#include "conftst'$i'.h"' >> sub/conftest.c
++      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
++      # Solaris 8's {/usr,}/bin/sh.
++      touch sub/conftst$i.h
++    done
++    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
++
++    case $depmode in
++    nosideeffect)
++      # after this tag, mechanisms are not by side-effect, so they'll
++      # only be used when explicitly requested
++      if test "x$enable_dependency_tracking" = xyes; then
++	continue
++      else
++	break
++      fi
++      ;;
++    none) break ;;
++    esac
++    # We check with `-c' and `-o' for the sake of the "dashmstdout"
++    # mode.  It turns out that the SunPro C++ compiler does not properly
++    # handle `-M -o', and we need to detect this.
++    if depmode=$depmode \
++       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
++       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
++       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
++         >/dev/null 2>conftest.err &&
++       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
++       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
++       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
++      # icc doesn't choke on unknown options, it will just issue warnings
++      # or remarks (even with -Werror).  So we grep stderr for any message
++      # that says an option was ignored or not supported.
++      # When given -MP, icc 7.0 and 7.1 complain thusly:
++      #   icc: Command line warning: ignoring option '-M'; no argument required
++      # The diagnosis changed in icc 8.0:
++      #   icc: Command line remark: option '-MP' not supported
++      if (grep 'ignoring option' conftest.err ||
++          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
++        am_cv_$1_dependencies_compiler_type=$depmode
++        break
++      fi
++    fi
++  done
++
++  cd ..
++  rm -rf conftest.dir
++else
++  am_cv_$1_dependencies_compiler_type=none
++fi
++])
++AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
++AM_CONDITIONAL([am__fastdep$1], [
++  test "x$enable_dependency_tracking" != xno \
++  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
++])
++
++
++# AM_SET_DEPDIR
++# -------------
++# Choose a directory name for dependency files.
++# This macro is AC_REQUIREd in _AM_DEPENDENCIES
++AC_DEFUN([AM_SET_DEPDIR],
++[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
++AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
++])
++
++
++# AM_DEP_TRACK
++# ------------
++AC_DEFUN([AM_DEP_TRACK],
++[AC_ARG_ENABLE(dependency-tracking,
++[  --disable-dependency-tracking  speeds up one-time build
++  --enable-dependency-tracking   do not reject slow dependency extractors])
++if test "x$enable_dependency_tracking" != xno; then
++  am_depcomp="$ac_aux_dir/depcomp"
++  AMDEPBACKSLASH='\'
++fi
++AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
++AC_SUBST([AMDEPBACKSLASH])
++])
++
++# Generate code to set up dependency tracking.              -*- Autoconf -*-
++
++# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
++# Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++#serial 3
++
++# _AM_OUTPUT_DEPENDENCY_COMMANDS
++# ------------------------------
++AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
++[for mf in $CONFIG_FILES; do
++  # Strip MF so we end up with the name of the file.
++  mf=`echo "$mf" | sed -e 's/:.*$//'`
++  # Check whether this is an Automake generated Makefile or not.
++  # We used to match only the files named `Makefile.in', but
++  # some people rename them; so instead we look at the file content.
++  # Grep'ing the first line is not enough: some people post-process
++  # each Makefile.in and add a new line on top of each file to say so.
++  # So let's grep whole file.
++  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
++    dirpart=`AS_DIRNAME("$mf")`
++  else
++    continue
++  fi
++  # Extract the definition of DEPDIR, am__include, and am__quote
++  # from the Makefile without running `make'.
++  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
++  test -z "$DEPDIR" && continue
++  am__include=`sed -n 's/^am__include = //p' < "$mf"`
++  test -z "am__include" && continue
++  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
++  # When using ansi2knr, U may be empty or an underscore; expand it
++  U=`sed -n 's/^U = //p' < "$mf"`
++  # Find all dependency output files, they are included files with
++  # $(DEPDIR) in their names.  We invoke sed twice because it is the
++  # simplest approach to changing $(DEPDIR) to its actual value in the
++  # expansion.
++  for file in `sed -n "
++    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
++       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
++    # Make sure the directory exists.
++    test -f "$dirpart/$file" && continue
++    fdir=`AS_DIRNAME(["$file"])`
++    AS_MKDIR_P([$dirpart/$fdir])
++    # echo "creating $dirpart/$file"
++    echo '# dummy' > "$dirpart/$file"
++  done
++done
++])# _AM_OUTPUT_DEPENDENCY_COMMANDS
++
++
++# AM_OUTPUT_DEPENDENCY_COMMANDS
++# -----------------------------
++# This macro should only be invoked once -- use via AC_REQUIRE.
++#
++# This code is only required when automatic dependency tracking
++# is enabled.  FIXME.  This creates each `.P' file that we will
++# need in order to bootstrap the dependency handling code.
++AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
++[AC_CONFIG_COMMANDS([depfiles],
++     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
++     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
++])
++
++# Do all the work for Automake.                             -*- Autoconf -*-
++
++# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
++# Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# serial 12
++
++# This macro actually does too much.  Some checks are only needed if
++# your package does certain things.  But this isn't really a big deal.
++
++# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
++# AM_INIT_AUTOMAKE([OPTIONS])
++# -----------------------------------------------
++# The call with PACKAGE and VERSION arguments is the old style
++# call (pre autoconf-2.50), which is being phased out.  PACKAGE
++# and VERSION should now be passed to AC_INIT and removed from
++# the call to AM_INIT_AUTOMAKE.
++# We support both call styles for the transition.  After
++# the next Automake release, Autoconf can make the AC_INIT
++# arguments mandatory, and then we can depend on a new Autoconf
++# release and drop the old call support.
++AC_DEFUN([AM_INIT_AUTOMAKE],
++[AC_PREREQ([2.58])dnl
++dnl Autoconf wants to disallow AM_ names.  We explicitly allow
++dnl the ones we care about.
++m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
++AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
++AC_REQUIRE([AC_PROG_INSTALL])dnl
++# test to see if srcdir already configured
++if test "`cd $srcdir && pwd`" != "`pwd`" &&
++   test -f $srcdir/config.status; then
++  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
++fi
++
++# test whether we have cygpath
++if test -z "$CYGPATH_W"; then
++  if (cygpath --version) >/dev/null 2>/dev/null; then
++    CYGPATH_W='cygpath -w'
++  else
++    CYGPATH_W=echo
++  fi
++fi
++AC_SUBST([CYGPATH_W])
++
++# Define the identity of the package.
++dnl Distinguish between old-style and new-style calls.
++m4_ifval([$2],
++[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
++ AC_SUBST([PACKAGE], [$1])dnl
++ AC_SUBST([VERSION], [$2])],
++[_AM_SET_OPTIONS([$1])dnl
++ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
++ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
++
++_AM_IF_OPTION([no-define],,
++[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
++ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
++
++# Some tools Automake needs.
++AC_REQUIRE([AM_SANITY_CHECK])dnl
++AC_REQUIRE([AC_ARG_PROGRAM])dnl
++AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
++AM_MISSING_PROG(AUTOCONF, autoconf)
++AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
++AM_MISSING_PROG(AUTOHEADER, autoheader)
++AM_MISSING_PROG(MAKEINFO, makeinfo)
++AM_PROG_INSTALL_SH
++AM_PROG_INSTALL_STRIP
++AC_REQUIRE([AM_PROG_MKDIR_P])dnl
++# We need awk for the "check" target.  The system "awk" is bad on
++# some platforms.
++AC_REQUIRE([AC_PROG_AWK])dnl
++AC_REQUIRE([AC_PROG_MAKE_SET])dnl
++AC_REQUIRE([AM_SET_LEADING_DOT])dnl
++_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
++              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
++	      		     [_AM_PROG_TAR([v7])])])
++_AM_IF_OPTION([no-dependencies],,
++[AC_PROVIDE_IFELSE([AC_PROG_CC],
++                  [_AM_DEPENDENCIES(CC)],
++                  [define([AC_PROG_CC],
++                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
++AC_PROVIDE_IFELSE([AC_PROG_CXX],
++                  [_AM_DEPENDENCIES(CXX)],
++                  [define([AC_PROG_CXX],
++                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
++])
++])
++
++
++# When config.status generates a header, we must update the stamp-h file.
++# This file resides in the same directory as the config header
++# that is generated.  The stamp files are numbered to have different names.
++
++# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
++# loop where config.status creates the headers, so we can generate
++# our stamp files there.
++AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
++[# Compute $1's index in $config_headers.
++_am_stamp_count=1
++for _am_header in $config_headers :; do
++  case $_am_header in
++    $1 | $1:* )
++      break ;;
++    * )
++      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
++  esac
++done
++echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
++
++# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# AM_PROG_INSTALL_SH
++# ------------------
++# Define $install_sh.
++AC_DEFUN([AM_PROG_INSTALL_SH],
++[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
++install_sh=${install_sh-"$am_aux_dir/install-sh"}
++AC_SUBST(install_sh)])
++
++# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# serial 2
++
++# Check whether the underlying file-system supports filenames
++# with a leading dot.  For instance MS-DOS doesn't.
++AC_DEFUN([AM_SET_LEADING_DOT],
++[rm -rf .tst 2>/dev/null
++mkdir .tst 2>/dev/null
++if test -d .tst; then
++  am__leading_dot=.
++else
++  am__leading_dot=_
++fi
++rmdir .tst 2>/dev/null
++AC_SUBST([am__leading_dot])])
++
++# Check to see how 'make' treats includes.	            -*- Autoconf -*-
++
++# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# serial 3
++
++# AM_MAKE_INCLUDE()
++# -----------------
++# Check to see how make treats includes.
++AC_DEFUN([AM_MAKE_INCLUDE],
++[am_make=${MAKE-make}
++cat > confinc << 'END'
++am__doit:
++	@echo done
++.PHONY: am__doit
++END
++# If we don't find an include directive, just comment out the code.
++AC_MSG_CHECKING([for style of include used by $am_make])
++am__include="#"
++am__quote=
++_am_result=none
++# First try GNU make style include.
++echo "include confinc" > confmf
++# We grep out `Entering directory' and `Leaving directory'
++# messages which can occur if `w' ends up in MAKEFLAGS.
++# In particular we don't look at `^make:' because GNU make might
++# be invoked under some other name (usually "gmake"), in which
++# case it prints its new name instead of `make'.
++if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
++   am__include=include
++   am__quote=
++   _am_result=GNU
++fi
++# Now try BSD make style include.
++if test "$am__include" = "#"; then
++   echo '.include "confinc"' > confmf
++   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
++      am__include=.include
++      am__quote="\""
++      _am_result=BSD
++   fi
++fi
++AC_SUBST([am__include])
++AC_SUBST([am__quote])
++AC_MSG_RESULT([$_am_result])
++rm -f confinc confmf
++])
++
++# Copyright (C) 1999, 2000, 2001, 2003, 2005  Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# serial 3
++
++# AM_PROG_CC_C_O
++# --------------
++# Like AC_PROG_CC_C_O, but changed for automake.
++AC_DEFUN([AM_PROG_CC_C_O],
++[AC_REQUIRE([AC_PROG_CC_C_O])dnl
++AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
++# FIXME: we rely on the cache variable name because
++# there is no other way.
++set dummy $CC
++ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
++if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
++   # Losing compiler, so override with the script.
++   # FIXME: It is wrong to rewrite CC.
++   # But if we don't then we get into trouble of one sort or another.
++   # A longer-term fix would be to have automake use am__CC in this case,
++   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
++   CC="$am_aux_dir/compile $CC"
++fi
++])
++
++# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
++
++# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
++# Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# serial 4
++
++# AM_MISSING_PROG(NAME, PROGRAM)
++# ------------------------------
++AC_DEFUN([AM_MISSING_PROG],
++[AC_REQUIRE([AM_MISSING_HAS_RUN])
++$1=${$1-"${am_missing_run}$2"}
++AC_SUBST($1)])
++
++
++# AM_MISSING_HAS_RUN
++# ------------------
++# Define MISSING if not defined so far and test if it supports --run.
++# If it does, set am_missing_run to use it, otherwise, to nothing.
++AC_DEFUN([AM_MISSING_HAS_RUN],
++[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
++test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
++# Use eval to expand $SHELL
++if eval "$MISSING --run true"; then
++  am_missing_run="$MISSING --run "
++else
++  am_missing_run=
++  AC_MSG_WARN([`missing' script is too old or missing])
++fi
++])
++
++# Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# AM_PROG_MKDIR_P
++# ---------------
++# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
++#
++# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
++# created by `make install' are always world readable, even if the
++# installer happens to have an overly restrictive umask (e.g. 077).
++# This was a mistake.  There are at least two reasons why we must not
++# use `-m 0755':
++#   - it causes special bits like SGID to be ignored,
++#   - it may be too restrictive (some setups expect 775 directories).
++#
++# Do not use -m 0755 and let people choose whatever they expect by
++# setting umask.
++#
++# We cannot accept any implementation of `mkdir' that recognizes `-p'.
++# Some implementations (such as Solaris 8's) are not thread-safe: if a
++# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
++# concurrently, both version can detect that a/ is missing, but only
++# one can create it and the other will error out.  Consequently we
++# restrict ourselves to GNU make (using the --version option ensures
++# this.)
++AC_DEFUN([AM_PROG_MKDIR_P],
++[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
++  # We used to keeping the `.' as first argument, in order to
++  # allow $(mkdir_p) to be used without argument.  As in
++  #   $(mkdir_p) $(somedir)
++  # where $(somedir) is conditionally defined.  However this is wrong
++  # for two reasons:
++  #  1. if the package is installed by a user who cannot write `.'
++  #     make install will fail,
++  #  2. the above comment should most certainly read
++  #     $(mkdir_p) $(DESTDIR)$(somedir)
++  #     so it does not work when $(somedir) is undefined and
++  #     $(DESTDIR) is not.
++  #  To support the latter case, we have to write
++  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
++  #  so the `.' trick is pointless.
++  mkdir_p='mkdir -p --'
++else
++  # On NextStep and OpenStep, the `mkdir' command does not
++  # recognize any option.  It will interpret all options as
++  # directories to create, and then abort because `.' already
++  # exists.
++  for d in ./-p ./--version;
++  do
++    test -d $d && rmdir $d
++  done
++  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
++  if test -f "$ac_aux_dir/mkinstalldirs"; then
++    mkdir_p='$(mkinstalldirs)'
++  else
++    mkdir_p='$(install_sh) -d'
++  fi
++fi
++AC_SUBST([mkdir_p])])
++
++# Helper functions for option handling.                     -*- Autoconf -*-
++
++# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# serial 3
++
++# _AM_MANGLE_OPTION(NAME)
++# -----------------------
++AC_DEFUN([_AM_MANGLE_OPTION],
++[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
++
++# _AM_SET_OPTION(NAME)
++# ------------------------------
++# Set option NAME.  Presently that only means defining a flag for this option.
++AC_DEFUN([_AM_SET_OPTION],
++[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
++
++# _AM_SET_OPTIONS(OPTIONS)
++# ----------------------------------
++# OPTIONS is a space-separated list of Automake options.
++AC_DEFUN([_AM_SET_OPTIONS],
++[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
++
++# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
++# -------------------------------------------
++# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
++AC_DEFUN([_AM_IF_OPTION],
++[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
++
++# Check to make sure that the build environment is sane.    -*- Autoconf -*-
++
++# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
++# Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# serial 4
++
++# AM_SANITY_CHECK
++# ---------------
++AC_DEFUN([AM_SANITY_CHECK],
++[AC_MSG_CHECKING([whether build environment is sane])
++# Just in case
++sleep 1
++echo timestamp > conftest.file
++# Do `set' in a subshell so we don't clobber the current shell's
++# arguments.  Must try -L first in case configure is actually a
++# symlink; some systems play weird games with the mod time of symlinks
++# (eg FreeBSD returns the mod time of the symlink's containing
++# directory).
++if (
++   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
++   if test "$[*]" = "X"; then
++      # -L didn't work.
++      set X `ls -t $srcdir/configure conftest.file`
++   fi
++   rm -f conftest.file
++   if test "$[*]" != "X $srcdir/configure conftest.file" \
++      && test "$[*]" != "X conftest.file $srcdir/configure"; then
++
++      # If neither matched, then we have a broken ls.  This can happen
++      # if, for instance, CONFIG_SHELL is bash and it inherits a
++      # broken ls alias from the environment.  This has actually
++      # happened.  Such a system could not be considered "sane".
++      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
++alias in your environment])
++   fi
++
++   test "$[2]" = conftest.file
++   )
++then
++   # Ok.
++   :
++else
++   AC_MSG_ERROR([newly created file is older than distributed files!
++Check your system clock])
++fi
++AC_MSG_RESULT(yes)])
++
++# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# AM_PROG_INSTALL_STRIP
++# ---------------------
++# One issue with vendor `install' (even GNU) is that you can't
++# specify the program used to strip binaries.  This is especially
++# annoying in cross-compiling environments, where the build's strip
++# is unlikely to handle the host's binaries.
++# Fortunately install-sh will honor a STRIPPROG variable, so we
++# always use install-sh in `make install-strip', and initialize
++# STRIPPROG with the value of the STRIP variable (set by the user).
++AC_DEFUN([AM_PROG_INSTALL_STRIP],
++[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
++# Installed binaries are usually stripped using `strip' when the user
++# run `make install-strip'.  However `strip' might not be the right
++# tool to use in cross-compilation environments, therefore Automake
++# will honor the `STRIP' environment variable to overrule this program.
++dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
++if test "$cross_compiling" != no; then
++  AC_CHECK_TOOL([STRIP], [strip], :)
++fi
++INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
++AC_SUBST([INSTALL_STRIP_PROGRAM])])
++
++# Check how to create a tarball.                            -*- Autoconf -*-
++
++# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
++#
++# This file is free software; the Free Software Foundation
++# gives unlimited permission to copy and/or distribute it,
++# with or without modifications, as long as this notice is preserved.
++
++# serial 2
++
++# _AM_PROG_TAR(FORMAT)
++# --------------------
++# Check how to create a tarball in format FORMAT.
++# FORMAT should be one of `v7', `ustar', or `pax'.
++#
++# Substitute a variable $(am__tar) that is a command
++# writing to stdout a FORMAT-tarball containing the directory
++# $tardir.
++#     tardir=directory && $(am__tar) > result.tar
++#
++# Substitute a variable $(am__untar) that extract such
++# a tarball read from stdin.
++#     $(am__untar) < result.tar
++AC_DEFUN([_AM_PROG_TAR],
++[# Always define AMTAR for backward compatibility.
++AM_MISSING_PROG([AMTAR], [tar])
++m4_if([$1], [v7],
++     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
++     [m4_case([$1], [ustar],, [pax],,
++              [m4_fatal([Unknown tar format])])
++AC_MSG_CHECKING([how to create a $1 tar archive])
++# Loop over all known methods to create a tar archive until one works.
++_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
++_am_tools=${am_cv_prog_tar_$1-$_am_tools}
++# Do not fold the above two line into one, because Tru64 sh and
++# Solaris sh will not grok spaces in the rhs of `-'.
++for _am_tool in $_am_tools
++do
++  case $_am_tool in
++  gnutar)
++    for _am_tar in tar gnutar gtar;
++    do
++      AM_RUN_LOG([$_am_tar --version]) && break
++    done
++    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
++    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
++    am__untar="$_am_tar -xf -"
++    ;;
++  plaintar)
++    # Must skip GNU tar: if it does not support --format= it doesn't create
++    # ustar tarball either.
++    (tar --version) >/dev/null 2>&1 && continue
++    am__tar='tar chf - "$$tardir"'
++    am__tar_='tar chf - "$tardir"'
++    am__untar='tar xf -'
++    ;;
++  pax)
++    am__tar='pax -L -x $1 -w "$$tardir"'
++    am__tar_='pax -L -x $1 -w "$tardir"'
++    am__untar='pax -r'
++    ;;
++  cpio)
++    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
++    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
++    am__untar='cpio -i -H $1 -d'
++    ;;
++  none)
++    am__tar=false
++    am__tar_=false
++    am__untar=false
++    ;;
++  esac
++
++  # If the value was cached, stop now.  We just wanted to have am__tar
++  # and am__untar set.
++  test -n "${am_cv_prog_tar_$1}" && break
++
++  # tar/untar a dummy directory, and stop if the command works
++  rm -rf conftest.dir
++  mkdir conftest.dir
++  echo GrepMe > conftest.dir/file
++  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
++  rm -rf conftest.dir
++  if test -s conftest.tar; then
++    AM_RUN_LOG([$am__untar <conftest.tar])
++    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
++  fi
++done
++rm -rf conftest.dir
++
++AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
++AC_MSG_RESULT([$am_cv_prog_tar_$1])])
++AC_SUBST([am__tar])
++AC_SUBST([am__untar])
++]) # _AM_PROG_TAR
++
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/iscsiuio/ChangeLog open-iscsi-2.0-872-rc4-bnx2i.build/iscsiuio/ChangeLog
+--- open-iscsi-2.0-872-rc4-bnx2i/iscsiuio/ChangeLog	1969-12-31 18:00:00.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.build/iscsiuio/ChangeLog	2011-08-03 20:01:01.000000000 -0500
+@@ -0,0 +1,7 @@
++Version 0.4.1 (July 20, 2009)
++  * Fix from Mike Christie to determine page size from getpagesize() 
++    rather then the constant PAGE_SIZE.  PAGE_SIZE is not defined om
++    ia64 and ppc.
++  * Update documentation to indicate IPv6 is not supported
++  * Fix code to catch the message from the CNIC that the network
++    interface is going down.
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/iscsiuio/compile open-iscsi-2.0-872-rc4-bnx2i.build/iscsiuio/compile
+--- open-iscsi-2.0-872-rc4-bnx2i/iscsiuio/compile	1969-12-31 18:00:00.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.build/iscsiuio/compile	2011-08-03 20:01:01.000000000 -0500
+@@ -0,0 +1,142 @@
++#! /bin/sh
++# Wrapper for compilers which do not understand `-c -o'.
++
++scriptversion=2005-05-14.22
++
++# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
++# Written by Tom Tromey <tromey at cygnus.com>.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2, or (at your option)
++# any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++
++# As a special exception to the GNU General Public License, if you
++# distribute this file as part of a program that contains a
++# configuration script generated by Autoconf, you may include it under
++# the same distribution terms that you use for the rest of that program.
++
++# This file is maintained in Automake, please report
++# bugs to <bug-automake at gnu.org> or send patches to
++# <automake-patches at gnu.org>.
++
++case $1 in
++  '')
++     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
++     exit 1;
++     ;;
++  -h | --h*)
++    cat <<\EOF
++Usage: compile [--help] [--version] PROGRAM [ARGS]
++
++Wrapper for compilers which do not understand `-c -o'.
++Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
++arguments, and rename the output as expected.
++
++If you are trying to build a whole package this is not the
++right script to run: please start by reading the file `INSTALL'.
++
++Report bugs to <bug-automake at gnu.org>.
++EOF
++    exit $?
++    ;;
++  -v | --v*)
++    echo "compile $scriptversion"
++    exit $?
++    ;;
++esac
++
++ofile=
++cfile=
++eat=
++
++for arg
++do
++  if test -n "$eat"; then
++    eat=
++  else
++    case $1 in
++      -o)
++	# configure might choose to run compile as `compile cc -o foo foo.c'.
++	# So we strip `-o arg' only if arg is an object.
++	eat=1
++	case $2 in
++	  *.o | *.obj)
++	    ofile=$2
++	    ;;
++	  *)
++	    set x "$@" -o "$2"
++	    shift
++	    ;;
++	esac
++	;;
++      *.c)
++	cfile=$1
++	set x "$@" "$1"
++	shift
++	;;
++      *)
++	set x "$@" "$1"
++	shift
++	;;
++    esac
++  fi
++  shift
++done
++
++if test -z "$ofile" || test -z "$cfile"; then
++  # If no `-o' option was seen then we might have been invoked from a
++  # pattern rule where we don't need one.  That is ok -- this is a
++  # normal compilation that the losing compiler can handle.  If no
++  # `.c' file was seen then we are probably linking.  That is also
++  # ok.
++  exec "$@"
++fi
++
++# Name of file we expect compiler to create.
++cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
++
++# Create the lock directory.
++# Note: use `[/.-]' here to ensure that we don't use the same name
++# that we are using for the .o file.  Also, base the name on the expected
++# object file name, since that is what matters with a parallel build.
++lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
++while true; do
++  if mkdir "$lockdir" >/dev/null 2>&1; then
++    break
++  fi
++  sleep 1
++done
++# FIXME: race condition here if user kills between mkdir and trap.
++trap "rmdir '$lockdir'; exit 1" 1 2 15
++
++# Run the compile.
++"$@"
++ret=$?
++
++if test -f "$cofile"; then
++  mv "$cofile" "$ofile"
++elif test -f "${cofile}bj"; then
++  mv "${cofile}bj" "$ofile"
++fi
++
++rmdir "$lockdir"
++exit $ret
++
++# Local Variables:
++# mode: shell-script
++# sh-indentation: 2
++# eval: (add-hook 'write-file-hooks 'time-stamp)
++# time-stamp-start: "scriptversion="
++# time-stamp-format: "%:y-%02m-%02d.%02H"
++# time-stamp-end: "$"
++# End:
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/iscsiuio/config.guess open-iscsi-2.0-872-rc4-bnx2i.build/iscsiuio/config.guess
+--- open-iscsi-2.0-872-rc4-bnx2i/iscsiuio/config.guess	1969-12-31 18:00:00.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.build/iscsiuio/config.guess	2011-08-03 20:01:01.000000000 -0500
+@@ -0,0 +1,1548 @@
++#! /bin/sh
++# Attempt to guess a canonical system name.
++#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
++#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
++#   Free Software Foundation, Inc.
++
++timestamp='2008-09-28'
++
++# This file is free software; you can redistribute it and/or modify it
++# under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful, but
++# WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++# General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
++# 02110-1301, USA.
++#
++# As a special exception to the GNU General Public License, if you
++# distribute this file as part of a program that contains a
++# configuration script generated by Autoconf, you may include it under
++# the same distribution terms that you use for the rest of that program.
++
++
++# Originally written by Per Bothner <per at bothner.com>.
++# Please send patches to <config-patches at gnu.org>.  Submit a context
++# diff and a properly formatted ChangeLog entry.
++#
++# This script attempts to guess a canonical system name similar to
++# config.sub.  If it succeeds, it prints the system name on stdout, and
++# exits with 0.  Otherwise, it exits with 1.
++#
++# The plan is that this can be called by configure scripts if you
++# don't specify an explicit build system type.
++
++me=`echo "$0" | sed -e 's,.*/,,'`
++
++usage="\
++Usage: $0 [OPTION]
++
++Output the configuration name of the system \`$me' is run on.
++
++Operation modes:
++  -h, --help         print this help, then exit
++  -t, --time-stamp   print date of last modification, then exit
++  -v, --version      print version number, then exit
++
++Report bugs and patches to <config-patches at gnu.org>."
++
++version="\
++GNU config.guess ($timestamp)
++
++Originally written by Per Bothner.
++Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
++2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
++
++This is free software; see the source for copying conditions.  There is NO
++warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
++
++help="
++Try \`$me --help' for more information."
++
++# Parse command line
++while test $# -gt 0 ; do
++  case $1 in
++    --time-stamp | --time* | -t )
++       echo "$timestamp" ; exit ;;
++    --version | -v )
++       echo "$version" ; exit ;;
++    --help | --h* | -h )
++       echo "$usage"; exit ;;
++    -- )     # Stop option processing
++       shift; break ;;
++    - )	# Use stdin as input.
++       break ;;
++    -* )
++       echo "$me: invalid option $1$help" >&2
++       exit 1 ;;
++    * )
++       break ;;
++  esac
++done
++
++if test $# != 0; then
++  echo "$me: too many arguments$help" >&2
++  exit 1
++fi
++
++trap 'exit 1' 1 2 15
++
++# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
++# compiler to aid in system detection is discouraged as it requires
++# temporary files to be created and, as you can see below, it is a
++# headache to deal with in a portable fashion.
++
++# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
++# use `HOST_CC' if defined, but it is deprecated.
++
++# Portable tmp directory creation inspired by the Autoconf team.
++
++set_cc_for_build='
++trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
++trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
++: ${TMPDIR=/tmp} ;
++ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
++ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
++ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
++ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
++dummy=$tmp/dummy ;
++tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
++case $CC_FOR_BUILD,$HOST_CC,$CC in
++ ,,)    echo "int x;" > $dummy.c ;
++	for c in cc gcc c89 c99 ; do
++	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
++	     CC_FOR_BUILD="$c"; break ;
++	  fi ;
++	done ;
++	if test x"$CC_FOR_BUILD" = x ; then
++	  CC_FOR_BUILD=no_compiler_found ;
++	fi
++	;;
++ ,,*)   CC_FOR_BUILD=$CC ;;
++ ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
++esac ; set_cc_for_build= ;'
++
++# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
++# (ghazi at noc.rutgers.edu 1994-08-24)
++if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
++	PATH=$PATH:/.attbin ; export PATH
++fi
++
++UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
++UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
++UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
++UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
++
++if [ "${UNAME_SYSTEM}" = "Linux" ] ; then
++	eval $set_cc_for_build
++	cat << EOF > $dummy.c
++	#include <features.h>
++	#ifdef __UCLIBC__
++	# ifdef __UCLIBC_CONFIG_VERSION__
++	LIBC=uclibc __UCLIBC_CONFIG_VERSION__
++	# else
++	LIBC=uclibc
++	# endif
++	#else
++	LIBC=gnu
++	#endif
++EOF
++	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep LIBC= | sed -e 's: ::g'`
++fi
++
++# Note: order is significant - the case branches are not exclusive.
++
++case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
++    *:NetBSD:*:*)
++	# NetBSD (nbsd) targets should (where applicable) match one or
++	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
++	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
++	# switched to ELF, *-*-netbsd* would select the old
++	# object file format.  This provides both forward
++	# compatibility and a consistent mechanism for selecting the
++	# object file format.
++	#
++	# Note: NetBSD doesn't particularly care about the vendor
++	# portion of the name.  We always set it to "unknown".
++	sysctl="sysctl -n hw.machine_arch"
++	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
++	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
++	case "${UNAME_MACHINE_ARCH}" in
++	    armeb) machine=armeb-unknown ;;
++	    arm*) machine=arm-unknown ;;
++	    sh3el) machine=shl-unknown ;;
++	    sh3eb) machine=sh-unknown ;;
++	    sh5el) machine=sh5le-unknown ;;
++	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
++	esac
++	# The Operating System including object format, if it has switched
++	# to ELF recently, or will in the future.
++	case "${UNAME_MACHINE_ARCH}" in
++	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
++		eval $set_cc_for_build
++		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
++			| grep __ELF__ >/dev/null
++		then
++		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
++		    # Return netbsd for either.  FIX?
++		    os=netbsd
++		else
++		    os=netbsdelf
++		fi
++		;;
++	    *)
++	        os=netbsd
++		;;
++	esac
++	# The OS release
++	# Debian GNU/NetBSD machines have a different userland, and
++	# thus, need a distinct triplet. However, they do not need
++	# kernel version information, so it can be replaced with a
++	# suitable tag, in the style of linux-gnu.
++	case "${UNAME_VERSION}" in
++	    Debian*)
++		release='-gnu'
++		;;
++	    *)
++		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
++		;;
++	esac
++	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
++	# contains redundant information, the shorter form:
++	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
++	echo "${machine}-${os}${release}"
++	exit ;;
++    *:OpenBSD:*:*)
++	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
++	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
++	exit ;;
++    *:ekkoBSD:*:*)
++	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
++	exit ;;
++    *:SolidBSD:*:*)
++	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
++	exit ;;
++    macppc:MirBSD:*:*)
++	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
++	exit ;;
++    *:MirBSD:*:*)
++	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
++	exit ;;
++    alpha:OSF1:*:*)
++	case $UNAME_RELEASE in
++	*4.0)
++		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
++		;;
++	*5.*)
++	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
++		;;
++	esac
++	# According to Compaq, /usr/sbin/psrinfo has been available on
++	# OSF/1 and Tru64 systems produced since 1995.  I hope that
++	# covers most systems running today.  This code pipes the CPU
++	# types through head -n 1, so we only detect the type of CPU 0.
++	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
++	case "$ALPHA_CPU_TYPE" in
++	    "EV4 (21064)")
++		UNAME_MACHINE="alpha" ;;
++	    "EV4.5 (21064)")
++		UNAME_MACHINE="alpha" ;;
++	    "LCA4 (21066/21068)")
++		UNAME_MACHINE="alpha" ;;
++	    "EV5 (21164)")
++		UNAME_MACHINE="alphaev5" ;;
++	    "EV5.6 (21164A)")
++		UNAME_MACHINE="alphaev56" ;;
++	    "EV5.6 (21164PC)")
++		UNAME_MACHINE="alphapca56" ;;
++	    "EV5.7 (21164PC)")
++		UNAME_MACHINE="alphapca57" ;;
++	    "EV6 (21264)")
++		UNAME_MACHINE="alphaev6" ;;
++	    "EV6.7 (21264A)")
++		UNAME_MACHINE="alphaev67" ;;
++	    "EV6.8CB (21264C)")
++		UNAME_MACHINE="alphaev68" ;;
++	    "EV6.8AL (21264B)")
++		UNAME_MACHINE="alphaev68" ;;
++	    "EV6.8CX (21264D)")
++		UNAME_MACHINE="alphaev68" ;;
++	    "EV6.9A (21264/EV69A)")
++		UNAME_MACHINE="alphaev69" ;;
++	    "EV7 (21364)")
++		UNAME_MACHINE="alphaev7" ;;
++	    "EV7.9 (21364A)")
++		UNAME_MACHINE="alphaev79" ;;
++	esac
++	# A Pn.n version is a patched version.
++	# A Vn.n version is a released version.
++	# A Tn.n version is a released field test version.
++	# A Xn.n version is an unreleased experimental baselevel.
++	# 1.2 uses "1.2" for uname -r.
++	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
++	exit ;;
++    Alpha\ *:Windows_NT*:*)
++	# How do we know it's Interix rather than the generic POSIX subsystem?
++	# Should we change UNAME_MACHINE based on the output of uname instead
++	# of the specific Alpha model?
++	echo alpha-pc-interix
++	exit ;;
++    21064:Windows_NT:50:3)
++	echo alpha-dec-winnt3.5
++	exit ;;
++    Amiga*:UNIX_System_V:4.0:*)
++	echo m68k-unknown-sysv4
++	exit ;;
++    *:[Aa]miga[Oo][Ss]:*:*)
++	echo ${UNAME_MACHINE}-unknown-amigaos
++	exit ;;
++    *:[Mm]orph[Oo][Ss]:*:*)
++	echo ${UNAME_MACHINE}-unknown-morphos
++	exit ;;
++    *:OS/390:*:*)
++	echo i370-ibm-openedition
++	exit ;;
++    *:z/VM:*:*)
++	echo s390-ibm-zvmoe
++	exit ;;
++    *:OS400:*:*)
++        echo powerpc-ibm-os400
++	exit ;;
++    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
++	echo arm-acorn-riscix${UNAME_RELEASE}
++	exit ;;
++    arm:riscos:*:*|arm:RISCOS:*:*)
++	echo arm-unknown-riscos
++	exit ;;
++    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
++	echo hppa1.1-hitachi-hiuxmpp
++	exit ;;
++    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
++	# akee at wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
++	if test "`(/bin/universe) 2>/dev/null`" = att ; then
++		echo pyramid-pyramid-sysv3
++	else
++		echo pyramid-pyramid-bsd
++	fi
++	exit ;;
++    NILE*:*:*:dcosx)
++	echo pyramid-pyramid-svr4
++	exit ;;
++    DRS?6000:unix:4.0:6*)
++	echo sparc-icl-nx6
++	exit ;;
++    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
++	case `/usr/bin/uname -p` in
++	    sparc) echo sparc-icl-nx7; exit ;;
++	esac ;;
++    sun4H:SunOS:5.*:*)
++	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
++	exit ;;
++    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
++	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
++	exit ;;
++    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
++	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
++	exit ;;
++    sun4*:SunOS:6*:*)
++	# According to config.sub, this is the proper way to canonicalize
++	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
++	# it's likely to be more like Solaris than SunOS4.
++	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
++	exit ;;
++    sun4*:SunOS:*:*)
++	case "`/usr/bin/arch -k`" in
++	    Series*|S4*)
++		UNAME_RELEASE=`uname -v`
++		;;
++	esac
++	# Japanese Language versions have a version number like `4.1.3-JL'.
++	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
++	exit ;;
++    sun3*:SunOS:*:*)
++	echo m68k-sun-sunos${UNAME_RELEASE}
++	exit ;;
++    sun*:*:4.2BSD:*)
++	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
++	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
++	case "`/bin/arch`" in
++	    sun3)
++		echo m68k-sun-sunos${UNAME_RELEASE}
++		;;
++	    sun4)
++		echo sparc-sun-sunos${UNAME_RELEASE}
++		;;
++	esac
++	exit ;;
++    aushp:SunOS:*:*)
++	echo sparc-auspex-sunos${UNAME_RELEASE}
++	exit ;;
++    # The situation for MiNT is a little confusing.  The machine name
++    # can be virtually everything (everything which is not
++    # "atarist" or "atariste" at least should have a processor
++    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
++    # to the lowercase version "mint" (or "freemint").  Finally
++    # the system name "TOS" denotes a system which is actually not
++    # MiNT.  But MiNT is downward compatible to TOS, so this should
++    # be no problem.
++    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
++        echo m68k-atari-mint${UNAME_RELEASE}
++	exit ;;
++    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
++	echo m68k-atari-mint${UNAME_RELEASE}
++        exit ;;
++    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
++        echo m68k-atari-mint${UNAME_RELEASE}
++	exit ;;
++    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
++        echo m68k-milan-mint${UNAME_RELEASE}
++        exit ;;
++    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
++        echo m68k-hades-mint${UNAME_RELEASE}
++        exit ;;
++    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
++        echo m68k-unknown-mint${UNAME_RELEASE}
++        exit ;;
++    m68k:machten:*:*)
++	echo m68k-apple-machten${UNAME_RELEASE}
++	exit ;;
++    powerpc:machten:*:*)
++	echo powerpc-apple-machten${UNAME_RELEASE}
++	exit ;;
++    RISC*:Mach:*:*)
++	echo mips-dec-mach_bsd4.3
++	exit ;;
++    RISC*:ULTRIX:*:*)
++	echo mips-dec-ultrix${UNAME_RELEASE}
++	exit ;;
++    VAX*:ULTRIX*:*:*)
++	echo vax-dec-ultrix${UNAME_RELEASE}
++	exit ;;
++    2020:CLIX:*:* | 2430:CLIX:*:*)
++	echo clipper-intergraph-clix${UNAME_RELEASE}
++	exit ;;
++    mips:*:*:UMIPS | mips:*:*:RISCos)
++	eval $set_cc_for_build
++	sed 's/^	//' << EOF >$dummy.c
++#ifdef __cplusplus
++#include <stdio.h>  /* for printf() prototype */
++	int main (int argc, char *argv[]) {
++#else
++	int main (argc, argv) int argc; char *argv[]; {
++#endif
++	#if defined (host_mips) && defined (MIPSEB)
++	#if defined (SYSTYPE_SYSV)
++	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
++	#endif
++	#if defined (SYSTYPE_SVR4)
++	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
++	#endif
++	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
++	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
++	#endif
++	#endif
++	  exit (-1);
++	}
++EOF
++	$CC_FOR_BUILD -o $dummy $dummy.c &&
++	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
++	  SYSTEM_NAME=`$dummy $dummyarg` &&
++	    { echo "$SYSTEM_NAME"; exit; }
++	echo mips-mips-riscos${UNAME_RELEASE}
++	exit ;;
++    Motorola:PowerMAX_OS:*:*)
++	echo powerpc-motorola-powermax
++	exit ;;
++    Motorola:*:4.3:PL8-*)
++	echo powerpc-harris-powermax
++	exit ;;
++    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
++	echo powerpc-harris-powermax
++	exit ;;
++    Night_Hawk:Power_UNIX:*:*)
++	echo powerpc-harris-powerunix
++	exit ;;
++    m88k:CX/UX:7*:*)
++	echo m88k-harris-cxux7
++	exit ;;
++    m88k:*:4*:R4*)
++	echo m88k-motorola-sysv4
++	exit ;;
++    m88k:*:3*:R3*)
++	echo m88k-motorola-sysv3
++	exit ;;
++    AViiON:dgux:*:*)
++        # DG/UX returns AViiON for all architectures
++        UNAME_PROCESSOR=`/usr/bin/uname -p`
++	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
++	then
++	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
++	       [ ${TARGET_BINARY_INTERFACE}x = x ]
++	    then
++		echo m88k-dg-dgux${UNAME_RELEASE}
++	    else
++		echo m88k-dg-dguxbcs${UNAME_RELEASE}
++	    fi
++	else
++	    echo i586-dg-dgux${UNAME_RELEASE}
++	fi
++ 	exit ;;
++    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
++	echo m88k-dolphin-sysv3
++	exit ;;
++    M88*:*:R3*:*)
++	# Delta 88k system running SVR3
++	echo m88k-motorola-sysv3
++	exit ;;
++    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
++	echo m88k-tektronix-sysv3
++	exit ;;
++    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
++	echo m68k-tektronix-bsd
++	exit ;;
++    *:IRIX*:*:*)
++	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
++	exit ;;
++    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
++	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
++	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
++    i*86:AIX:*:*)
++	echo i386-ibm-aix
++	exit ;;
++    ia64:AIX:*:*)
++	if [ -x /usr/bin/oslevel ] ; then
++		IBM_REV=`/usr/bin/oslevel`
++	else
++		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
++	fi
++	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
++	exit ;;
++    *:AIX:2:3)
++	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
++		eval $set_cc_for_build
++		sed 's/^		//' << EOF >$dummy.c
++		#include <sys/systemcfg.h>
++
++		main()
++			{
++			if (!__power_pc())
++				exit(1);
++			puts("powerpc-ibm-aix3.2.5");
++			exit(0);
++			}
++EOF
++		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
++		then
++			echo "$SYSTEM_NAME"
++		else
++			echo rs6000-ibm-aix3.2.5
++		fi
++	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
++		echo rs6000-ibm-aix3.2.4
++	else
++		echo rs6000-ibm-aix3.2
++	fi
++	exit ;;
++    *:AIX:*:[456])
++	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
++	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
++		IBM_ARCH=rs6000
++	else
++		IBM_ARCH=powerpc
++	fi
++	if [ -x /usr/bin/oslevel ] ; then
++		IBM_REV=`/usr/bin/oslevel`
++	else
++		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
++	fi
++	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
++	exit ;;
++    *:AIX:*:*)
++	echo rs6000-ibm-aix
++	exit ;;
++    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
++	echo romp-ibm-bsd4.4
++	exit ;;
++    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
++	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
++	exit ;;                             # report: romp-ibm BSD 4.3
++    *:BOSX:*:*)
++	echo rs6000-bull-bosx
++	exit ;;
++    DPX/2?00:B.O.S.:*:*)
++	echo m68k-bull-sysv3
++	exit ;;
++    9000/[34]??:4.3bsd:1.*:*)
++	echo m68k-hp-bsd
++	exit ;;
++    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
++	echo m68k-hp-bsd4.4
++	exit ;;
++    9000/[34678]??:HP-UX:*:*)
++	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
++	case "${UNAME_MACHINE}" in
++	    9000/31? )            HP_ARCH=m68000 ;;
++	    9000/[34]?? )         HP_ARCH=m68k ;;
++	    9000/[678][0-9][0-9])
++		if [ -x /usr/bin/getconf ]; then
++		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
++                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
++                    case "${sc_cpu_version}" in
++                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
++                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
++                      532)                      # CPU_PA_RISC2_0
++                        case "${sc_kernel_bits}" in
++                          32) HP_ARCH="hppa2.0n" ;;
++                          64) HP_ARCH="hppa2.0w" ;;
++			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
++                        esac ;;
++                    esac
++		fi
++		if [ "${HP_ARCH}" = "" ]; then
++		    eval $set_cc_for_build
++		    sed 's/^              //' << EOF >$dummy.c
++
++              #define _HPUX_SOURCE
++              #include <stdlib.h>
++              #include <unistd.h>
++
++              int main ()
++              {
++              #if defined(_SC_KERNEL_BITS)
++                  long bits = sysconf(_SC_KERNEL_BITS);
++              #endif
++                  long cpu  = sysconf (_SC_CPU_VERSION);
++
++                  switch (cpu)
++              	{
++              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
++              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
++              	case CPU_PA_RISC2_0:
++              #if defined(_SC_KERNEL_BITS)
++              	    switch (bits)
++              		{
++              		case 64: puts ("hppa2.0w"); break;
++              		case 32: puts ("hppa2.0n"); break;
++              		default: puts ("hppa2.0"); break;
++              		} break;
++              #else  /* !defined(_SC_KERNEL_BITS) */
++              	    puts ("hppa2.0"); break;
++              #endif
++              	default: puts ("hppa1.0"); break;
++              	}
++                  exit (0);
++              }
++EOF
++		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
++		    test -z "$HP_ARCH" && HP_ARCH=hppa
++		fi ;;
++	esac
++	if [ ${HP_ARCH} = "hppa2.0w" ]
++	then
++	    eval $set_cc_for_build
++
++	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
++	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
++	    # generating 64-bit code.  GNU and HP use different nomenclature:
++	    #
++	    # $ CC_FOR_BUILD=cc ./config.guess
++	    # => hppa2.0w-hp-hpux11.23
++	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
++	    # => hppa64-hp-hpux11.23
++
++	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
++		grep __LP64__ >/dev/null
++	    then
++		HP_ARCH="hppa2.0w"
++	    else
++		HP_ARCH="hppa64"
++	    fi
++	fi
++	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
++	exit ;;
++    ia64:HP-UX:*:*)
++	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
++	echo ia64-hp-hpux${HPUX_REV}
++	exit ;;
++    3050*:HI-UX:*:*)
++	eval $set_cc_for_build
++	sed 's/^	//' << EOF >$dummy.c
++	#include <unistd.h>
++	int
++	main ()
++	{
++	  long cpu = sysconf (_SC_CPU_VERSION);
++	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
++	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
++	     results, however.  */
++	  if (CPU_IS_PA_RISC (cpu))
++	    {
++	      switch (cpu)
++		{
++		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
++		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
++		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
++		  default: puts ("hppa-hitachi-hiuxwe2"); break;
++		}
++	    }
++	  else if (CPU_IS_HP_MC68K (cpu))
++	    puts ("m68k-hitachi-hiuxwe2");
++	  else puts ("unknown-hitachi-hiuxwe2");
++	  exit (0);
++	}
++EOF
++	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
++		{ echo "$SYSTEM_NAME"; exit; }
++	echo unknown-hitachi-hiuxwe2
++	exit ;;
++    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
++	echo hppa1.1-hp-bsd
++	exit ;;
++    9000/8??:4.3bsd:*:*)
++	echo hppa1.0-hp-bsd
++	exit ;;
++    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
++	echo hppa1.0-hp-mpeix
++	exit ;;
++    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
++	echo hppa1.1-hp-osf
++	exit ;;
++    hp8??:OSF1:*:*)
++	echo hppa1.0-hp-osf
++	exit ;;
++    i*86:OSF1:*:*)
++	if [ -x /usr/sbin/sysversion ] ; then
++	    echo ${UNAME_MACHINE}-unknown-osf1mk
++	else
++	    echo ${UNAME_MACHINE}-unknown-osf1
++	fi
++	exit ;;
++    parisc*:Lites*:*:*)
++	echo hppa1.1-hp-lites
++	exit ;;
++    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
++	echo c1-convex-bsd
++        exit ;;
++    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
++	if getsysinfo -f scalar_acc
++	then echo c32-convex-bsd
++	else echo c2-convex-bsd
++	fi
++        exit ;;
++    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
++	echo c34-convex-bsd
++        exit ;;
++    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
++	echo c38-convex-bsd
++        exit ;;
++    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
++	echo c4-convex-bsd
++        exit ;;
++    CRAY*Y-MP:*:*:*)
++	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
++	exit ;;
++    CRAY*[A-Z]90:*:*:*)
++	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
++	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
++	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
++	      -e 's/\.[^.]*$/.X/'
++	exit ;;
++    CRAY*TS:*:*:*)
++	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
++	exit ;;
++    CRAY*T3E:*:*:*)
++	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
++	exit ;;
++    CRAY*SV1:*:*:*)
++	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
++	exit ;;
++    *:UNICOS/mp:*:*)
++	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
++	exit ;;
++    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
++	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
++        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
++        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
++        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
++        exit ;;
++    5000:UNIX_System_V:4.*:*)
++        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
++        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
++        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
++	exit ;;
++    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
++	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
++	exit ;;
++    sparc*:BSD/OS:*:*)
++	echo sparc-unknown-bsdi${UNAME_RELEASE}
++	exit ;;
++    *:BSD/OS:*:*)
++	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
++	exit ;;
++    *:FreeBSD:*:*)
++	case ${UNAME_MACHINE} in
++	    pc98)
++		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
++	    amd64)
++		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
++	    *)
++		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
++	esac
++	exit ;;
++    i*:CYGWIN*:*)
++	echo ${UNAME_MACHINE}-pc-cygwin
++	exit ;;
++    *:MINGW*:*)
++	echo ${UNAME_MACHINE}-pc-mingw32
++	exit ;;
++    i*:windows32*:*)
++    	# uname -m includes "-pc" on this system.
++    	echo ${UNAME_MACHINE}-mingw32
++	exit ;;
++    i*:PW*:*)
++	echo ${UNAME_MACHINE}-pc-pw32
++	exit ;;
++    *:Interix*:[3456]*)
++    	case ${UNAME_MACHINE} in
++	    x86)
++		echo i586-pc-interix${UNAME_RELEASE}
++		exit ;;
++	    EM64T | authenticamd | genuineintel)
++		echo x86_64-unknown-interix${UNAME_RELEASE}
++		exit ;;
++	    IA64)
++		echo ia64-unknown-interix${UNAME_RELEASE}
++		exit ;;
++	esac ;;
++    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
++	echo i${UNAME_MACHINE}-pc-mks
++	exit ;;
++    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
++	# How do we know it's Interix rather than the generic POSIX subsystem?
++	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
++	# UNAME_MACHINE based on the output of uname instead of i386?
++	echo i586-pc-interix
++	exit ;;
++    i*:UWIN*:*)
++	echo ${UNAME_MACHINE}-pc-uwin
++	exit ;;
++    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
++	echo x86_64-unknown-cygwin
++	exit ;;
++    p*:CYGWIN*:*)
++	echo powerpcle-unknown-cygwin
++	exit ;;
++    prep*:SunOS:5.*:*)
++	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
++	exit ;;
++    *:GNU:*:*)
++	# the GNU system
++	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
++	exit ;;
++    *:GNU/*:*:*)
++	# other systems with GNU libc and userland
++	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
++	exit ;;
++    i*86:Minix:*:*)
++	echo ${UNAME_MACHINE}-pc-minix
++	exit ;;
++    arm*:Linux:*:*)
++	eval $set_cc_for_build
++	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
++	    | grep -q __ARM_EABI__
++	then
++	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++	else
++	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
++	fi
++	exit ;;
++    avr32*:Linux:*:*)
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++	exit ;;
++    cris:Linux:*:*)
++	echo cris-axis-linux-${LIBC}
++	exit ;;
++    crisv32:Linux:*:*)
++	echo crisv32-axis-linux-${LIBC}
++	exit ;;
++    frv:Linux:*:*)
++    	echo frv-unknown-linux-${LIBC}
++	exit ;;
++    ia64:Linux:*:*)
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++	exit ;;
++    m32r*:Linux:*:*)
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++	exit ;;
++    m68*:Linux:*:*)
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++	exit ;;
++    mips:Linux:*:*)
++	eval $set_cc_for_build
++	sed 's/^	//' << EOF >$dummy.c
++	#undef CPU
++	#undef mips
++	#undef mipsel
++	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
++	CPU=mipsel
++	#else
++	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
++	CPU=mips
++	#else
++	CPU=
++	#endif
++	#endif
++EOF
++	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
++	    /^CPU/{
++		s: ::g
++		p
++	    }'`"
++	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
++	;;
++    mips64:Linux:*:*)
++	eval $set_cc_for_build
++	sed 's/^	//' << EOF >$dummy.c
++	#undef CPU
++	#undef mips64
++	#undef mips64el
++	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
++	CPU=mips64el
++	#else
++	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
++	CPU=mips64
++	#else
++	CPU=
++	#endif
++	#endif
++EOF
++	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
++	    /^CPU/{
++		s: ::g
++		p
++	    }'`"
++	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
++	;;
++    or32:Linux:*:*)
++	echo or32-unknown-linux-${LIBC}
++	exit ;;
++    ppc:Linux:*:*)
++	echo powerpc-unknown-linux-${LIBC}
++	exit ;;
++    ppc64:Linux:*:*)
++	echo powerpc64-unknown-linux-${LIBC}
++	exit ;;
++    alpha:Linux:*:*)
++	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
++	  EV5)   UNAME_MACHINE=alphaev5 ;;
++	  EV56)  UNAME_MACHINE=alphaev56 ;;
++	  PCA56) UNAME_MACHINE=alphapca56 ;;
++	  PCA57) UNAME_MACHINE=alphapca56 ;;
++	  EV6)   UNAME_MACHINE=alphaev6 ;;
++	  EV67)  UNAME_MACHINE=alphaev67 ;;
++	  EV68*) UNAME_MACHINE=alphaev68 ;;
++        esac
++	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
++	if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++	exit ;;
++    padre:Linux:*:*)
++	echo sparc-unknown-linux-gnu
++	exit ;;
++    parisc:Linux:*:* | hppa:Linux:*:*)
++	# Look for CPU level
++	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
++	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
++	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
++	  *)    echo hppa-unknown-linux-${LIBC} ;;
++	esac
++	exit ;;
++    parisc64:Linux:*:* | hppa64:Linux:*:*)
++	echo hppa64-unknown-linux-${LIBC}
++	exit ;;
++    s390:Linux:*:* | s390x:Linux:*:*)
++	echo ${UNAME_MACHINE}-ibm-linux
++	exit ;;
++    sh64*:Linux:*:*)
++    	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++	exit ;;
++    sh*:Linux:*:*)
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++	exit ;;
++    sparc:Linux:*:* | sparc64:Linux:*:*)
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++	exit ;;
++    vax:Linux:*:*)
++	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
++	exit ;;
++    x86_64:Linux:*:*)
++	echo x86_64-unknown-linux-${LIBC}
++	exit ;;
++    xtensa*:Linux:*:*)
++    	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
++	exit ;;
++    i*86:Linux:*:*)
++	# The BFD linker knows what the default object file format is, so
++	# first see if it will tell us. cd to the root directory to prevent
++	# problems with other programs or directories called `ld' in the path.
++	# Set LC_ALL=C to ensure ld outputs messages in English.
++	ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
++			 | sed -ne '/supported targets:/!d
++				    s/[ 	][ 	]*/ /g
++				    s/.*supported targets: *//
++				    s/ .*//
++				    p'`
++        case "$ld_supported_targets" in
++	  elf32-i386)
++		TENTATIVE="${UNAME_MACHINE}-pc-linux-${LIBC}"
++		;;
++	  a.out-i386-linux)
++		echo "${UNAME_MACHINE}-pc-linux-${LIBC}aout"
++		exit ;;
++	  "")
++		# Either a pre-BFD a.out linker (linux-gnuoldld) or
++		# one that does not give us useful --help.
++		echo "${UNAME_MACHINE}-pc-linux-${LIBC}oldld"
++		exit ;;
++	esac
++	# This should get integrated into the C code below, but now we hack
++	if [ "$LIBC" != "gnu" ] ; then echo "$TENTATIVE" && exit 0 ; fi
++	# Determine whether the default compiler is a.out or elf
++	eval $set_cc_for_build
++	sed 's/^	//' << EOF >$dummy.c
++	#include <features.h>
++	#ifdef __ELF__
++	# ifdef __GLIBC__
++	#  if __GLIBC__ >= 2
++	LIBC=gnu
++	#  else
++	LIBC=gnulibc1
++	#  endif
++	# else
++	LIBC=gnulibc1
++	# endif
++	#else
++	#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
++	LIBC=gnu
++	#else
++	LIBC=gnuaout
++	#endif
++	#endif
++	#ifdef __dietlibc__
++	LIBC=dietlibc
++	#endif
++EOF
++	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
++	    /^LIBC/{
++		s: ::g
++		p
++	    }'`"
++	test x"${LIBC}" != x && {
++		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
++		exit
++	}
++	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
++	;;
++    i*86:DYNIX/ptx:4*:*)
++	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
++	# earlier versions are messed up and put the nodename in both
++	# sysname and nodename.
++	echo i386-sequent-sysv4
++	exit ;;
++    i*86:UNIX_SV:4.2MP:2.*)
++        # Unixware is an offshoot of SVR4, but it has its own version
++        # number series starting with 2...
++        # I am not positive that other SVR4 systems won't match this,
++	# I just have to hope.  -- rms.
++        # Use sysv4.2uw... so that sysv4* matches it.
++	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
++	exit ;;
++    i*86:OS/2:*:*)
++	# If we were able to find `uname', then EMX Unix compatibility
++	# is probably installed.
++	echo ${UNAME_MACHINE}-pc-os2-emx
++	exit ;;
++    i*86:XTS-300:*:STOP)
++	echo ${UNAME_MACHINE}-unknown-stop
++	exit ;;
++    i*86:atheos:*:*)
++	echo ${UNAME_MACHINE}-unknown-atheos
++	exit ;;
++    i*86:syllable:*:*)
++	echo ${UNAME_MACHINE}-pc-syllable
++	exit ;;
++    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
++	echo i386-unknown-lynxos${UNAME_RELEASE}
++	exit ;;
++    i*86:*DOS:*:*)
++	echo ${UNAME_MACHINE}-pc-msdosdjgpp
++	exit ;;
++    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
++	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
++	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
++		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
++	else
++		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
++	fi
++	exit ;;
++    i*86:*:5:[678]*)
++    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
++	case `/bin/uname -X | grep "^Machine"` in
++	    *486*)	     UNAME_MACHINE=i486 ;;
++	    *Pentium)	     UNAME_MACHINE=i586 ;;
++	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
++	esac
++	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
++	exit ;;
++    i*86:*:3.2:*)
++	if test -f /usr/options/cb.name; then
++		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
++		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
++	elif /bin/uname -X 2>/dev/null >/dev/null ; then
++		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
++		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
++		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
++			&& UNAME_MACHINE=i586
++		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
++			&& UNAME_MACHINE=i686
++		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
++			&& UNAME_MACHINE=i686
++		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
++	else
++		echo ${UNAME_MACHINE}-pc-sysv32
++	fi
++	exit ;;
++    pc:*:*:*)
++	# Left here for compatibility:
++        # uname -m prints for DJGPP always 'pc', but it prints nothing about
++        # the processor, so we play safe by assuming i386.
++	echo i386-pc-msdosdjgpp
++        exit ;;
++    Intel:Mach:3*:*)
++	echo i386-pc-mach3
++	exit ;;
++    paragon:*:*:*)
++	echo i860-intel-osf1
++	exit ;;
++    i860:*:4.*:*) # i860-SVR4
++	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
++	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
++	else # Add other i860-SVR4 vendors below as they are discovered.
++	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
++	fi
++	exit ;;
++    mini*:CTIX:SYS*5:*)
++	# "miniframe"
++	echo m68010-convergent-sysv
++	exit ;;
++    mc68k:UNIX:SYSTEM5:3.51m)
++	echo m68k-convergent-sysv
++	exit ;;
++    M680?0:D-NIX:5.3:*)
++	echo m68k-diab-dnix
++	exit ;;
++    M68*:*:R3V[5678]*:*)
++	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
++    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
++	OS_REL=''
++	test -r /etc/.relid \
++	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
++	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
++	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
++	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
++	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
++    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
++        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
++          && { echo i486-ncr-sysv4; exit; } ;;
++    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
++	echo m68k-unknown-lynxos${UNAME_RELEASE}
++	exit ;;
++    mc68030:UNIX_System_V:4.*:*)
++	echo m68k-atari-sysv4
++	exit ;;
++    TSUNAMI:LynxOS:2.*:*)
++	echo sparc-unknown-lynxos${UNAME_RELEASE}
++	exit ;;
++    rs6000:LynxOS:2.*:*)
++	echo rs6000-unknown-lynxos${UNAME_RELEASE}
++	exit ;;
++    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
++	echo powerpc-unknown-lynxos${UNAME_RELEASE}
++	exit ;;
++    SM[BE]S:UNIX_SV:*:*)
++	echo mips-dde-sysv${UNAME_RELEASE}
++	exit ;;
++    RM*:ReliantUNIX-*:*:*)
++	echo mips-sni-sysv4
++	exit ;;
++    RM*:SINIX-*:*:*)
++	echo mips-sni-sysv4
++	exit ;;
++    *:SINIX-*:*:*)
++	if uname -p 2>/dev/null >/dev/null ; then
++		UNAME_MACHINE=`(uname -p) 2>/dev/null`
++		echo ${UNAME_MACHINE}-sni-sysv4
++	else
++		echo ns32k-sni-sysv
++	fi
++	exit ;;
++    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
++                      # says <Richard.M.Bartel at ccMail.Census.GOV>
++        echo i586-unisys-sysv4
++        exit ;;
++    *:UNIX_System_V:4*:FTX*)
++	# From Gerald Hewes <hewes at openmarket.com>.
++	# How about differentiating between stratus architectures? -djm
++	echo hppa1.1-stratus-sysv4
++	exit ;;
++    *:*:*:FTX*)
++	# From seanf at swdc.stratus.com.
++	echo i860-stratus-sysv4
++	exit ;;
++    i*86:VOS:*:*)
++	# From Paul.Green at stratus.com.
++	echo ${UNAME_MACHINE}-stratus-vos
++	exit ;;
++    *:VOS:*:*)
++	# From Paul.Green at stratus.com.
++	echo hppa1.1-stratus-vos
++	exit ;;
++    mc68*:A/UX:*:*)
++	echo m68k-apple-aux${UNAME_RELEASE}
++	exit ;;
++    news*:NEWS-OS:6*:*)
++	echo mips-sony-newsos6
++	exit ;;
++    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
++	if [ -d /usr/nec ]; then
++	        echo mips-nec-sysv${UNAME_RELEASE}
++	else
++	        echo mips-unknown-sysv${UNAME_RELEASE}
++	fi
++        exit ;;
++    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
++	echo powerpc-be-beos
++	exit ;;
++    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
++	echo powerpc-apple-beos
++	exit ;;
++    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
++	echo i586-pc-beos
++	exit ;;
++    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
++	echo i586-pc-haiku
++	exit ;;
++    SX-4:SUPER-UX:*:*)
++	echo sx4-nec-superux${UNAME_RELEASE}
++	exit ;;
++    SX-5:SUPER-UX:*:*)
++	echo sx5-nec-superux${UNAME_RELEASE}
++	exit ;;
++    SX-6:SUPER-UX:*:*)
++	echo sx6-nec-superux${UNAME_RELEASE}
++	exit ;;
++    SX-7:SUPER-UX:*:*)
++	echo sx7-nec-superux${UNAME_RELEASE}
++	exit ;;
++    SX-8:SUPER-UX:*:*)
++	echo sx8-nec-superux${UNAME_RELEASE}
++	exit ;;
++    SX-8R:SUPER-UX:*:*)
++	echo sx8r-nec-superux${UNAME_RELEASE}
++	exit ;;
++    Power*:Rhapsody:*:*)
++	echo powerpc-apple-rhapsody${UNAME_RELEASE}
++	exit ;;
++    *:Rhapsody:*:*)
++	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
++	exit ;;
++    *:Darwin:*:*)
++	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
++	case $UNAME_PROCESSOR in
++	    unknown) UNAME_PROCESSOR=powerpc ;;
++	esac
++	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
++	exit ;;
++    *:procnto*:*:* | *:QNX:[0123456789]*:*)
++	UNAME_PROCESSOR=`uname -p`
++	if test "$UNAME_PROCESSOR" = "x86"; then
++		UNAME_PROCESSOR=i386
++		UNAME_MACHINE=pc
++	fi
++	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
++	exit ;;
++    *:QNX:*:4*)
++	echo i386-pc-qnx
++	exit ;;
++    NSE-?:NONSTOP_KERNEL:*:*)
++	echo nse-tandem-nsk${UNAME_RELEASE}
++	exit ;;
++    NSR-?:NONSTOP_KERNEL:*:*)
++	echo nsr-tandem-nsk${UNAME_RELEASE}
++	exit ;;
++    *:NonStop-UX:*:*)
++	echo mips-compaq-nonstopux
++	exit ;;
++    BS2000:POSIX*:*:*)
++	echo bs2000-siemens-sysv
++	exit ;;
++    DS/*:UNIX_System_V:*:*)
++	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
++	exit ;;
++    *:Plan9:*:*)
++	# "uname -m" is not consistent, so use $cputype instead. 386
++	# is converted to i386 for consistency with other x86
++	# operating systems.
++	if test "$cputype" = "386"; then
++	    UNAME_MACHINE=i386
++	else
++	    UNAME_MACHINE="$cputype"
++	fi
++	echo ${UNAME_MACHINE}-unknown-plan9
++	exit ;;
++    *:TOPS-10:*:*)
++	echo pdp10-unknown-tops10
++	exit ;;
++    *:TENEX:*:*)
++	echo pdp10-unknown-tenex
++	exit ;;
++    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
++	echo pdp10-dec-tops20
++	exit ;;
++    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
++	echo pdp10-xkl-tops20
++	exit ;;
++    *:TOPS-20:*:*)
++	echo pdp10-unknown-tops20
++	exit ;;
++    *:ITS:*:*)
++	echo pdp10-unknown-its
++	exit ;;
++    SEI:*:*:SEIUX)
++        echo mips-sei-seiux${UNAME_RELEASE}
++	exit ;;
++    *:DragonFly:*:*)
++	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
++	exit ;;
++    *:*VMS:*:*)
++    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
++	case "${UNAME_MACHINE}" in
++	    A*) echo alpha-dec-vms ; exit ;;
++	    I*) echo ia64-dec-vms ; exit ;;
++	    V*) echo vax-dec-vms ; exit ;;
++	esac ;;
++    *:XENIX:*:SysV)
++	echo i386-pc-xenix
++	exit ;;
++    i*86:skyos:*:*)
++	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
++	exit ;;
++    i*86:rdos:*:*)
++	echo ${UNAME_MACHINE}-pc-rdos
++	exit ;;
++esac
++
++#echo '(No uname command or uname output not recognized.)' 1>&2
++#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
++
++eval $set_cc_for_build
++cat >$dummy.c <<EOF
++#ifdef _SEQUENT_
++# include <sys/types.h>
++# include <sys/utsname.h>
++#endif
++main ()
++{
++#if defined (sony)
++#if defined (MIPSEB)
++  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
++     I don't know....  */
++  printf ("mips-sony-bsd\n"); exit (0);
++#else
++#include <sys/param.h>
++  printf ("m68k-sony-newsos%s\n",
++#ifdef NEWSOS4
++          "4"
++#else
++	  ""
++#endif
++         ); exit (0);
++#endif
++#endif
++
++#if defined (__arm) && defined (__acorn) && defined (__unix)
++  printf ("arm-acorn-riscix\n"); exit (0);
++#endif
++
++#if defined (hp300) && !defined (hpux)
++  printf ("m68k-hp-bsd\n"); exit (0);
++#endif
++
++#if defined (NeXT)
++#if !defined (__ARCHITECTURE__)
++#define __ARCHITECTURE__ "m68k"
++#endif
++  int version;
++  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
++  if (version < 4)
++    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
++  else
++    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
++  exit (0);
++#endif
++
++#if defined (MULTIMAX) || defined (n16)
++#if defined (UMAXV)
++  printf ("ns32k-encore-sysv\n"); exit (0);
++#else
++#if defined (CMU)
++  printf ("ns32k-encore-mach\n"); exit (0);
++#else
++  printf ("ns32k-encore-bsd\n"); exit (0);
++#endif
++#endif
++#endif
++
++#if defined (__386BSD__)
++  printf ("i386-pc-bsd\n"); exit (0);
++#endif
++
++#if defined (sequent)
++#if defined (i386)
++  printf ("i386-sequent-dynix\n"); exit (0);
++#endif
++#if defined (ns32000)
++  printf ("ns32k-sequent-dynix\n"); exit (0);
++#endif
++#endif
++
++#if defined (_SEQUENT_)
++    struct utsname un;
++
++    uname(&un);
++
++    if (strncmp(un.version, "V2", 2) == 0) {
++	printf ("i386-sequent-ptx2\n"); exit (0);
++    }
++    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
++	printf ("i386-sequent-ptx1\n"); exit (0);
++    }
++    printf ("i386-sequent-ptx\n"); exit (0);
++
++#endif
++
++#if defined (vax)
++# if !defined (ultrix)
++#  include <sys/param.h>
++#  if defined (BSD)
++#   if BSD == 43
++      printf ("vax-dec-bsd4.3\n"); exit (0);
++#   else
++#    if BSD == 199006
++      printf ("vax-dec-bsd4.3reno\n"); exit (0);
++#    else
++      printf ("vax-dec-bsd\n"); exit (0);
++#    endif
++#   endif
++#  else
++    printf ("vax-dec-bsd\n"); exit (0);
++#  endif
++# else
++    printf ("vax-dec-ultrix\n"); exit (0);
++# endif
++#endif
++
++#if defined (alliant) && defined (i860)
++  printf ("i860-alliant-bsd\n"); exit (0);
++#endif
++
++  exit (1);
++}
++EOF
++
++$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
++	{ echo "$SYSTEM_NAME"; exit; }
++
++# Apollos put the system type in the environment.
++
++test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
++
++# Convex versions that predate uname can use getsysinfo(1)
++
++if [ -x /usr/convex/getsysinfo ]
++then
++    case `getsysinfo -f cpu_type` in
++    c1*)
++	echo c1-convex-bsd
++	exit ;;
++    c2*)
++	if getsysinfo -f scalar_acc
++	then echo c32-convex-bsd
++	else echo c2-convex-bsd
++	fi
++	exit ;;
++    c34*)
++	echo c34-convex-bsd
++	exit ;;
++    c38*)
++	echo c38-convex-bsd
++	exit ;;
++    c4*)
++	echo c4-convex-bsd
++	exit ;;
++    esac
++fi
++
++cat >&2 <<EOF
++$0: unable to guess system type
++
++This script, last modified $timestamp, has failed to recognize
++the operating system you are using. It is advised that you
++download the most up to date version of the config scripts from
++
++  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
++and
++  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
++
++If the version you run ($0) is already up to date, please
++send the following data and any information you think might be
++pertinent to <config-patches at gnu.org> in order to provide the needed
++information to handle your system.
++
++config.guess timestamp = $timestamp
++
++uname -m = `(uname -m) 2>/dev/null || echo unknown`
++uname -r = `(uname -r) 2>/dev/null || echo unknown`
++uname -s = `(uname -s) 2>/dev/null || echo unknown`
++uname -v = `(uname -v) 2>/dev/null || echo unknown`
++
++/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
++/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
++
++hostinfo               = `(hostinfo) 2>/dev/null`
++/bin/universe          = `(/bin/universe) 2>/dev/null`
++/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
++/bin/arch              = `(/bin/arch) 2>/dev/null`
++/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
++/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
++
++UNAME_MACHINE = ${UNAME_MACHINE}
++UNAME_RELEASE = ${UNAME_RELEASE}
++UNAME_SYSTEM  = ${UNAME_SYSTEM}
++UNAME_VERSION = ${UNAME_VERSION}
++EOF
++
++exit 1
++
++# Local variables:
++# eval: (add-hook 'write-file-hooks 'time-stamp)
++# time-stamp-start: "timestamp='"
++# time-stamp-format: "%:y-%02m-%02d"
++# time-stamp-end: "'"
++# End:
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/iscsiuio/config.h.in open-iscsi-2.0-872-rc4-bnx2i.build/iscsiuio/config.h.in
+--- open-iscsi-2.0-872-rc4-bnx2i/iscsiuio/config.h.in	1969-12-31 18:00:00.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.build/iscsiuio/config.h.in	2011-08-03 20:01:01.000000000 -0500
+@@ -0,0 +1,111 @@
++/* config.h.in.  Generated from configure.ac by autoheader.  */
++
++/* Define to 1 if you have the <dlfcn.h> header file. */
++#undef HAVE_DLFCN_H
++
++/* Define to 1 if the system has the type `int16_t'. */
++#undef HAVE_INT16_T
++
++/* Define to 1 if the system has the type `int32_t'. */
++#undef HAVE_INT32_T
++
++/* Define to 1 if the system has the type `int64_t'. */
++#undef HAVE_INT64_T
++
++/* Define to 1 if the system has the type `int8_t'. */
++#undef HAVE_INT8_T
++
++/* Define to 1 if you have the <inttypes.h> header file. */
++#undef HAVE_INTTYPES_H
++
++/* Define to 1 if you have the <memory.h> header file. */
++#undef HAVE_MEMORY_H
++
++/* Define to 1 if you have the <stdint.h> header file. */
++#undef HAVE_STDINT_H
++
++/* Define to 1 if you have the <stdlib.h> header file. */
++#undef HAVE_STDLIB_H
++
++/* Define to 1 if you have the <strings.h> header file. */
++#undef HAVE_STRINGS_H
++
++/* Define to 1 if you have the <string.h> header file. */
++#undef HAVE_STRING_H
++
++/* Define to 1 if you have the <sys/stat.h> header file. */
++#undef HAVE_SYS_STAT_H
++
++/* Define to 1 if you have the <sys/types.h> header file. */
++#undef HAVE_SYS_TYPES_H
++
++/* Define to 1 if the system has the type `uint16_t'. */
++#undef HAVE_UINT16_T
++
++/* Define to 1 if the system has the type `uint32_t'. */
++#undef HAVE_UINT32_T
++
++/* Define to 1 if the system has the type `uint64_t'. */
++#undef HAVE_UINT64_T
++
++/* Define to 1 if the system has the type `uint8_t'. */
++#undef HAVE_UINT8_T
++
++/* Define to 1 if you have the <unistd.h> header file. */
++#undef HAVE_UNISTD_H
++
++/* Define to 1 if your C compiler doesn't accept -c and -o together. */
++#undef NO_MINUS_C_MINUS_O
++
++/* Name of package */
++#undef PACKAGE
++
++/* Define to the address where bug reports for this package should be sent. */
++#undef PACKAGE_BUGREPORT
++
++/* Define to the full name of this package. */
++#undef PACKAGE_NAME
++
++/* Define to the full name and version of this package. */
++#undef PACKAGE_STRING
++
++/* Define to the one symbol short name of this package. */
++#undef PACKAGE_TARNAME
++
++/* Define to the version of this package. */
++#undef PACKAGE_VERSION
++
++/* The size of a `int', as computed by sizeof. */
++#undef SIZEOF_INT
++
++/* The size of a `long', as computed by sizeof. */
++#undef SIZEOF_LONG
++
++/* The size of a `short', as computed by sizeof. */
++#undef SIZEOF_SHORT
++
++/* Define to 1 if you have the ANSI C header files. */
++#undef STDC_HEADERS
++
++/* Version number of package */
++#undef VERSION
++
++/* Enable GNU extensions on systems that have them.  */
++#ifndef _GNU_SOURCE
++# undef _GNU_SOURCE
++#endif
++
++/* Define to empty if `const' does not conform to ANSI C. */
++#undef const
++
++/* Define to `__inline__' or `__inline' if that's what the C compiler
++   calls it, or to nothing if 'inline' is not supported under any name.  */
++#ifndef __cplusplus
++#undef inline
++#endif
++
++/* Define to `long' if <sys/types.h> does not define. */
++#undef off_t
++
++/* Define to `unsigned' if <sys/types.h> does not define. */
++#undef size_t
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/iscsiuio/config.sub open-iscsi-2.0-872-rc4-bnx2i.build/iscsiuio/config.sub
+--- open-iscsi-2.0-872-rc4-bnx2i/iscsiuio/config.sub	1969-12-31 18:00:00.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.build/iscsiuio/config.sub	2011-08-03 20:01:01.000000000 -0500
+@@ -0,0 +1,1695 @@
++#! /bin/sh
++# Configuration validation subroutine script.
++#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
++#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
++#   Free Software Foundation, Inc.
++
++timestamp='2008-09-08'
++
++# This file is (in principle) common to ALL GNU software.
++# The presence of a machine in this file suggests that SOME GNU software
++# can handle that machine.  It does not imply ALL GNU software can.
++#
++# This file is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
++# 02110-1301, USA.
++#
++# As a special exception to the GNU General Public License, if you
++# distribute this file as part of a program that contains a
++# configuration script generated by Autoconf, you may include it under
++# the same distribution terms that you use for the rest of that program.
++
++
++# Please send patches to <config-patches at gnu.org>.  Submit a context
++# diff and a properly formatted ChangeLog entry.
++#
++# Configuration subroutine to validate and canonicalize a configuration type.
++# Supply the specified configuration type as an argument.
++# If it is invalid, we print an error message on stderr and exit with code 1.
++# Otherwise, we print the canonical config type on stdout and succeed.
++
++# This file is supposed to be the same for all GNU packages
++# and recognize all the CPU types, system types and aliases
++# that are meaningful with *any* GNU software.
++# Each package is responsible for reporting which valid configurations
++# it does not support.  The user should be able to distinguish
++# a failure to support a valid configuration from a meaningless
++# configuration.
++
++# The goal of this file is to map all the various variations of a given
++# machine specification into a single specification in the form:
++#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
++# or in some cases, the newer four-part form:
++#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
++# It is wrong to echo any other type of specification.
++
++me=`echo "$0" | sed -e 's,.*/,,'`
++
++usage="\
++Usage: $0 [OPTION] CPU-MFR-OPSYS
++       $0 [OPTION] ALIAS
++
++Canonicalize a configuration name.
++
++Operation modes:
++  -h, --help         print this help, then exit
++  -t, --time-stamp   print date of last modification, then exit
++  -v, --version      print version number, then exit
++
++Report bugs and patches to <config-patches at gnu.org>."
++
++version="\
++GNU config.sub ($timestamp)
++
++Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
++2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
++
++This is free software; see the source for copying conditions.  There is NO
++warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
++
++help="
++Try \`$me --help' for more information."
++
++# Parse command line
++while test $# -gt 0 ; do
++  case $1 in
++    --time-stamp | --time* | -t )
++       echo "$timestamp" ; exit ;;
++    --version | -v )
++       echo "$version" ; exit ;;
++    --help | --h* | -h )
++       echo "$usage"; exit ;;
++    -- )     # Stop option processing
++       shift; break ;;
++    - )	# Use stdin as input.
++       break ;;
++    -* )
++       echo "$me: invalid option $1$help"
++       exit 1 ;;
++
++    *local*)
++       # First pass through any local machine types.
++       echo $1
++       exit ;;
++
++    * )
++       break ;;
++  esac
++done
++
++case $# in
++ 0) echo "$me: missing argument$help" >&2
++    exit 1;;
++ 1) ;;
++ *) echo "$me: too many arguments$help" >&2
++    exit 1;;
++esac
++
++# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
++# Here we must recognize all the valid KERNEL-OS combinations.
++maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
++case $maybe_os in
++  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
++  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
++  storm-chaos* | os2-emx* | rtmk-nova*)
++    os=-$maybe_os
++    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
++    ;;
++  *)
++    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
++    if [ $basic_machine != $1 ]
++    then os=`echo $1 | sed 's/.*-/-/'`
++    else os=; fi
++    ;;
++esac
++
++### Let's recognize common machines as not being operating systems so
++### that things like config.sub decstation-3100 work.  We also
++### recognize some manufacturers as not being operating systems, so we
++### can provide default operating systems below.
++case $os in
++	-sun*os*)
++		# Prevent following clause from handling this invalid input.
++		;;
++	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
++	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
++	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
++	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
++	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
++	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
++	-apple | -axis | -knuth | -cray)
++		os=
++		basic_machine=$1
++		;;
++	-sim | -cisco | -oki | -wec | -winbond)
++		os=
++		basic_machine=$1
++		;;
++	-scout)
++		;;
++	-wrs)
++		os=-vxworks
++		basic_machine=$1
++		;;
++	-chorusos*)
++		os=-chorusos
++		basic_machine=$1
++		;;
++ 	-chorusrdb)
++ 		os=-chorusrdb
++		basic_machine=$1
++ 		;;
++	-hiux*)
++		os=-hiuxwe2
++		;;
++	-sco6)
++		os=-sco5v6
++		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
++		;;
++	-sco5)
++		os=-sco3.2v5
++		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
++		;;
++	-sco4)
++		os=-sco3.2v4
++		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
++		;;
++	-sco3.2.[4-9]*)
++		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
++		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
++		;;
++	-sco3.2v[4-9]*)
++		# Don't forget version if it is 3.2v4 or newer.
++		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
++		;;
++	-sco5v6*)
++		# Don't forget version if it is 3.2v4 or newer.
++		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
++		;;
++	-sco*)
++		os=-sco3.2v2
++		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
++		;;
++	-udk*)
++		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
++		;;
++	-isc)
++		os=-isc2.2
++		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
++		;;
++	-clix*)
++		basic_machine=clipper-intergraph
++		;;
++	-isc*)
++		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
++		;;
++	-lynx*)
++		os=-lynxos
++		;;
++	-ptx*)
++		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
++		;;
++	-windowsnt*)
++		os=`echo $os | sed -e 's/windowsnt/winnt/'`
++		;;
++	-psos*)
++		os=-psos
++		;;
++	-mint | -mint[0-9]*)
++		basic_machine=m68k-atari
++		os=-mint
++		;;
++esac
++
++# Decode aliases for certain CPU-COMPANY combinations.
++case $basic_machine in
++	# Recognize the basic CPU types without company name.
++	# Some are omitted here because they have special meanings below.
++	1750a | 580 \
++	| a29k \
++	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
++	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
++	| am33_2.0 \
++	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
++	| bfin \
++	| c4x | clipper \
++	| d10v | d30v | dlx | dsp16xx | dvp \
++	| fido | fr30 | frv \
++	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
++	| i370 | i860 | i960 | ia64 \
++	| ip2k | iq2000 \
++	| m32c | m32r | m32rle | m68000 | m68k | m88k \
++	| maxq | mb | microblaze | mcore | mep | metag \
++	| mips | mipsbe | mipseb | mipsel | mipsle \
++	| mips16 \
++	| mips64 | mips64el \
++	| mips64octeon | mips64octeonel \
++	| mips64orion | mips64orionel \
++	| mips64r5900 | mips64r5900el \
++	| mips64vr | mips64vrel \
++	| mips64vr4100 | mips64vr4100el \
++	| mips64vr4300 | mips64vr4300el \
++	| mips64vr5000 | mips64vr5000el \
++	| mips64vr5900 | mips64vr5900el \
++	| mipsisa32 | mipsisa32el \
++	| mipsisa32r2 | mipsisa32r2el \
++	| mipsisa64 | mipsisa64el \
++	| mipsisa64r2 | mipsisa64r2el \
++	| mipsisa64sb1 | mipsisa64sb1el \
++	| mipsisa64sr71k | mipsisa64sr71kel \
++	| mipstx39 | mipstx39el \
++	| mn10200 | mn10300 \
++	| mt \
++	| msp430 \
++	| nios | nios2 \
++	| ns16k | ns32k \
++	| or32 \
++	| pdp10 | pdp11 | pj | pjl \
++	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
++	| pyramid \
++	| score \
++	| sh | sh[1234] | sh[24]a | sh[24]a*eb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
++	| sh64 | sh64le \
++	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
++	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
++	| spu | strongarm \
++	| tahoe | thumb | tic4x | tic80 | tron \
++	| v850 | v850e \
++	| we32k \
++	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
++	| z8k | z80)
++		basic_machine=$basic_machine-unknown
++		;;
++	m6811 | m68hc11 | m6812 | m68hc12)
++		# Motorola 68HC11/12.
++		basic_machine=$basic_machine-unknown
++		os=-none
++		;;
++	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
++		;;
++	ms1)
++		basic_machine=mt-unknown
++		;;
++
++	# We use `pc' rather than `unknown'
++	# because (1) that's what they normally are, and
++	# (2) the word "unknown" tends to confuse beginning users.
++	i*86 | x86_64)
++	  basic_machine=$basic_machine-pc
++	  ;;
++	# Object if more than one company name word.
++	*-*-*)
++		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
++		exit 1
++		;;
++	# Recognize the basic CPU types with company name.
++	580-* \
++	| a29k-* \
++	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
++	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
++	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
++	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
++	| avr-* | avr32-* \
++	| bfin-* | bs2000-* \
++	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
++	| clipper-* | craynv-* | cydra-* \
++	| d10v-* | d30v-* | dlx-* \
++	| elxsi-* \
++	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
++	| h8300-* | h8500-* \
++	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
++	| i*86-* | i860-* | i960-* | ia64-* \
++	| ip2k-* | iq2000-* \
++	| m32c-* | m32r-* | m32rle-* \
++	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
++	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
++	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
++	| mips16-* \
++	| mips64-* | mips64el-* \
++	| mips64octeon-* | mips64octeonel-* \
++	| mips64orion-* | mips64orionel-* \
++	| mips64r5900-* | mips64r5900el-* \
++	| mips64vr-* | mips64vrel-* \
++	| mips64vr4100-* | mips64vr4100el-* \
++	| mips64vr4300-* | mips64vr4300el-* \
++	| mips64vr5000-* | mips64vr5000el-* \
++	| mips64vr5900-* | mips64vr5900el-* \
++	| mipsisa32-* | mipsisa32el-* \
++	| mipsisa32r2-* | mipsisa32r2el-* \
++	| mipsisa64-* | mipsisa64el-* \
++	| mipsisa64r2-* | mipsisa64r2el-* \
++	| mipsisa64sb1-* | mipsisa64sb1el-* \
++	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
++	| mipstx39-* | mipstx39el-* \
++	| mmix-* \
++	| mt-* \
++	| msp430-* \
++	| nios-* | nios2-* \
++	| none-* | np1-* | ns16k-* | ns32k-* \
++	| orion-* \
++	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
++	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
++	| pyramid-* \
++	| romp-* | rs6000-* \
++	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]a*eb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
++	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
++	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
++	| sparclite-* \
++	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
++	| tahoe-* | thumb-* \
++	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
++	| tron-* \
++	| v850-* | v850e-* | vax-* \
++	| we32k-* \
++	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
++	| xstormy16-* | xtensa*-* \
++	| ymp-* \
++	| z8k-* | z80-*)
++		;;
++	# Recognize the basic CPU types without company name, with glob match.
++	xtensa*)
++		basic_machine=$basic_machine-unknown
++		;;
++	# Recognize the various machine names and aliases which stand
++	# for a CPU type and a company and sometimes even an OS.
++	386bsd)
++		basic_machine=i386-unknown
++		os=-bsd
++		;;
++	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
++		basic_machine=m68000-att
++		;;
++	3b*)
++		basic_machine=we32k-att
++		;;
++	a29khif)
++		basic_machine=a29k-amd
++		os=-udi
++		;;
++    	abacus)
++		basic_machine=abacus-unknown
++		;;
++	adobe68k)
++		basic_machine=m68010-adobe
++		os=-scout
++		;;
++	alliant | fx80)
++		basic_machine=fx80-alliant
++		;;
++	altos | altos3068)
++		basic_machine=m68k-altos
++		;;
++	am29k)
++		basic_machine=a29k-none
++		os=-bsd
++		;;
++	amd64)
++		basic_machine=x86_64-pc
++		;;
++	amd64-*)
++		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
++		;;
++	amdahl)
++		basic_machine=580-amdahl
++		os=-sysv
++		;;
++	amiga | amiga-*)
++		basic_machine=m68k-unknown
++		;;
++	amigaos | amigados)
++		basic_machine=m68k-unknown
++		os=-amigaos
++		;;
++	amigaunix | amix)
++		basic_machine=m68k-unknown
++		os=-sysv4
++		;;
++	apollo68)
++		basic_machine=m68k-apollo
++		os=-sysv
++		;;
++	apollo68bsd)
++		basic_machine=m68k-apollo
++		os=-bsd
++		;;
++	aux)
++		basic_machine=m68k-apple
++		os=-aux
++		;;
++	balance)
++		basic_machine=ns32k-sequent
++		os=-dynix
++		;;
++	blackfin)
++		basic_machine=bfin-unknown
++		os=-linux
++		;;
++	blackfin-*)
++		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
++		os=-linux
++		;;
++	c90)
++		basic_machine=c90-cray
++		os=-unicos
++		;;
++        cegcc)
++		basic_machine=arm-unknown
++		os=-cegcc
++		;;
++	convex-c1)
++		basic_machine=c1-convex
++		os=-bsd
++		;;
++	convex-c2)
++		basic_machine=c2-convex
++		os=-bsd
++		;;
++	convex-c32)
++		basic_machine=c32-convex
++		os=-bsd
++		;;
++	convex-c34)
++		basic_machine=c34-convex
++		os=-bsd
++		;;
++	convex-c38)
++		basic_machine=c38-convex
++		os=-bsd
++		;;
++	cray | j90)
++		basic_machine=j90-cray
++		os=-unicos
++		;;
++	craynv)
++		basic_machine=craynv-cray
++		os=-unicosmp
++		;;
++	cr16)
++		basic_machine=cr16-unknown
++		os=-elf
++		;;
++	crds | unos)
++		basic_machine=m68k-crds
++		;;
++	crisv32 | crisv32-* | etraxfs*)
++		basic_machine=crisv32-axis
++		;;
++	cris | cris-* | etrax*)
++		basic_machine=cris-axis
++		;;
++	crx)
++		basic_machine=crx-unknown
++		os=-elf
++		;;
++	da30 | da30-*)
++		basic_machine=m68k-da30
++		;;
++	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
++		basic_machine=mips-dec
++		;;
++	decsystem10* | dec10*)
++		basic_machine=pdp10-dec
++		os=-tops10
++		;;
++	decsystem20* | dec20*)
++		basic_machine=pdp10-dec
++		os=-tops20
++		;;
++	delta | 3300 | motorola-3300 | motorola-delta \
++	      | 3300-motorola | delta-motorola)
++		basic_machine=m68k-motorola
++		;;
++	delta88)
++		basic_machine=m88k-motorola
++		os=-sysv3
++		;;
++	dicos)
++		basic_machine=i686-pc
++		os=-dicos
++		;;
++	djgpp)
++		basic_machine=i586-pc
++		os=-msdosdjgpp
++		;;
++	dpx20 | dpx20-*)
++		basic_machine=rs6000-bull
++		os=-bosx
++		;;
++	dpx2* | dpx2*-bull)
++		basic_machine=m68k-bull
++		os=-sysv3
++		;;
++	ebmon29k)
++		basic_machine=a29k-amd
++		os=-ebmon
++		;;
++	elxsi)
++		basic_machine=elxsi-elxsi
++		os=-bsd
++		;;
++	encore | umax | mmax)
++		basic_machine=ns32k-encore
++		;;
++	es1800 | OSE68k | ose68k | ose | OSE)
++		basic_machine=m68k-ericsson
++		os=-ose
++		;;
++	fx2800)
++		basic_machine=i860-alliant
++		;;
++	genix)
++		basic_machine=ns32k-ns
++		;;
++	gmicro)
++		basic_machine=tron-gmicro
++		os=-sysv
++		;;
++	go32)
++		basic_machine=i386-pc
++		os=-go32
++		;;
++	h3050r* | hiux*)
++		basic_machine=hppa1.1-hitachi
++		os=-hiuxwe2
++		;;
++	h8300hms)
++		basic_machine=h8300-hitachi
++		os=-hms
++		;;
++	h8300xray)
++		basic_machine=h8300-hitachi
++		os=-xray
++		;;
++	h8500hms)
++		basic_machine=h8500-hitachi
++		os=-hms
++		;;
++	harris)
++		basic_machine=m88k-harris
++		os=-sysv3
++		;;
++	hp300-*)
++		basic_machine=m68k-hp
++		;;
++	hp300bsd)
++		basic_machine=m68k-hp
++		os=-bsd
++		;;
++	hp300hpux)
++		basic_machine=m68k-hp
++		os=-hpux
++		;;
++	hp3k9[0-9][0-9] | hp9[0-9][0-9])
++		basic_machine=hppa1.0-hp
++		;;
++	hp9k2[0-9][0-9] | hp9k31[0-9])
++		basic_machine=m68000-hp
++		;;
++	hp9k3[2-9][0-9])
++		basic_machine=m68k-hp
++		;;
++	hp9k6[0-9][0-9] | hp6[0-9][0-9])
++		basic_machine=hppa1.0-hp
++		;;
++	hp9k7[0-79][0-9] | hp7[0-79][0-9])
++		basic_machine=hppa1.1-hp
++		;;
++	hp9k78[0-9] | hp78[0-9])
++		# FIXME: really hppa2.0-hp
++		basic_machine=hppa1.1-hp
++		;;
++	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
++		# FIXME: really hppa2.0-hp
++		basic_machine=hppa1.1-hp
++		;;
++	hp9k8[0-9][13679] | hp8[0-9][13679])
++		basic_machine=hppa1.1-hp
++		;;
++	hp9k8[0-9][0-9] | hp8[0-9][0-9])
++		basic_machine=hppa1.0-hp
++		;;
++	hppa-next)
++		os=-nextstep3
++		;;
++	hppaosf)
++		basic_machine=hppa1.1-hp
++		os=-osf
++		;;
++	hppro)
++		basic_machine=hppa1.1-hp
++		os=-proelf
++		;;
++	i370-ibm* | ibm*)
++		basic_machine=i370-ibm
++		;;
++# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
++	i*86v32)
++		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
++		os=-sysv32
++		;;
++	i*86v4*)
++		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
++		os=-sysv4
++		;;
++	i*86v)
++		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
++		os=-sysv
++		;;
++	i*86sol2)
++		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
++		os=-solaris2
++		;;
++	i386mach)
++		basic_machine=i386-mach
++		os=-mach
++		;;
++	i386-vsta | vsta)
++		basic_machine=i386-unknown
++		os=-vsta
++		;;
++	iris | iris4d)
++		basic_machine=mips-sgi
++		case $os in
++		    -irix*)
++			;;
++		    *)
++			os=-irix4
++			;;
++		esac
++		;;
++	isi68 | isi)
++		basic_machine=m68k-isi
++		os=-sysv
++		;;
++	m68knommu)
++		basic_machine=m68k-unknown
++		os=-linux
++		;;
++	m68knommu-*)
++		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
++		os=-linux
++		;;
++	m88k-omron*)
++		basic_machine=m88k-omron
++		;;
++	magnum | m3230)
++		basic_machine=mips-mips
++		os=-sysv
++		;;
++	merlin)
++		basic_machine=ns32k-utek
++		os=-sysv
++		;;
++	mingw32)
++		basic_machine=i386-pc
++		os=-mingw32
++		;;
++	mingw32ce)
++		basic_machine=arm-unknown
++		os=-mingw32ce
++		;;
++	miniframe)
++		basic_machine=m68000-convergent
++		;;
++	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
++		basic_machine=m68k-atari
++		os=-mint
++		;;
++	mipsEE* | ee | ps2)
++		basic_machine=mips64r5900el-scei
++		case $os in
++		    -linux*)
++			;;
++		    *)
++			os=-elf
++			;;
++		esac
++		;;
++	iop)
++		basic_machine=mipsel-scei
++		os=-irx
++		;;
++	dvp)
++		basic_machine=dvp-scei
++		os=-elf
++		;;
++	mips3*-*)
++		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
++		;;
++	mips3*)
++		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
++		;;
++	monitor)
++		basic_machine=m68k-rom68k
++		os=-coff
++		;;
++	morphos)
++		basic_machine=powerpc-unknown
++		os=-morphos
++		;;
++	msdos)
++		basic_machine=i386-pc
++		os=-msdos
++		;;
++	ms1-*)
++		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
++		;;
++	mvs)
++		basic_machine=i370-ibm
++		os=-mvs
++		;;
++	ncr3000)
++		basic_machine=i486-ncr
++		os=-sysv4
++		;;
++	netbsd386)
++		basic_machine=i386-unknown
++		os=-netbsd
++		;;
++	netwinder)
++		basic_machine=armv4l-rebel
++		os=-linux
++		;;
++	news | news700 | news800 | news900)
++		basic_machine=m68k-sony
++		os=-newsos
++		;;
++	news1000)
++		basic_machine=m68030-sony
++		os=-newsos
++		;;
++	news-3600 | risc-news)
++		basic_machine=mips-sony
++		os=-newsos
++		;;
++	necv70)
++		basic_machine=v70-nec
++		os=-sysv
++		;;
++	next | m*-next )
++		basic_machine=m68k-next
++		case $os in
++		    -nextstep* )
++			;;
++		    -ns2*)
++		      os=-nextstep2
++			;;
++		    *)
++		      os=-nextstep3
++			;;
++		esac
++		;;
++	nh3000)
++		basic_machine=m68k-harris
++		os=-cxux
++		;;
++	nh[45]000)
++		basic_machine=m88k-harris
++		os=-cxux
++		;;
++	nindy960)
++		basic_machine=i960-intel
++		os=-nindy
++		;;
++	mon960)
++		basic_machine=i960-intel
++		os=-mon960
++		;;
++	nonstopux)
++		basic_machine=mips-compaq
++		os=-nonstopux
++		;;
++	np1)
++		basic_machine=np1-gould
++		;;
++	nsr-tandem)
++		basic_machine=nsr-tandem
++		;;
++	op50n-* | op60c-*)
++		basic_machine=hppa1.1-oki
++		os=-proelf
++		;;
++	openrisc | openrisc-*)
++		basic_machine=or32-unknown
++		;;
++	os400)
++		basic_machine=powerpc-ibm
++		os=-os400
++		;;
++	OSE68000 | ose68000)
++		basic_machine=m68000-ericsson
++		os=-ose
++		;;
++	os68k)
++		basic_machine=m68k-none
++		os=-os68k
++		;;
++	pa-hitachi)
++		basic_machine=hppa1.1-hitachi
++		os=-hiuxwe2
++		;;
++	paragon)
++		basic_machine=i860-intel
++		os=-osf
++		;;
++	parisc)
++		basic_machine=hppa-unknown
++		os=-linux
++		;;
++	parisc-*)
++		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
++		os=-linux
++		;;
++	pbd)
++		basic_machine=sparc-tti
++		;;
++	pbb)
++		basic_machine=m68k-tti
++		;;
++	pc532 | pc532-*)
++		basic_machine=ns32k-pc532
++		;;
++	pc98)
++		basic_machine=i386-pc
++		;;
++	pc98-*)
++		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
++		;;
++	pentium | p5 | k5 | k6 | nexgen | viac3)
++		basic_machine=i586-pc
++		;;
++	pentiumpro | p6 | 6x86 | athlon | athlon_*)
++		basic_machine=i686-pc
++		;;
++	pentiumii | pentium2 | pentiumiii | pentium3)
++		basic_machine=i686-pc
++		;;
++	pentium4)
++		basic_machine=i786-pc
++		;;
++	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
++		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
++		;;
++	pentiumpro-* | p6-* | 6x86-* | athlon-*)
++		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
++		;;
++	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
++		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
++		;;
++	pentium4-*)
++		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
++		;;
++	pn)
++		basic_machine=pn-gould
++		;;
++	power)	basic_machine=power-ibm
++		;;
++	ppc)	basic_machine=powerpc-unknown
++		;;
++	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
++		;;
++	ppcle | powerpclittle | ppc-le | powerpc-little)
++		basic_machine=powerpcle-unknown
++		;;
++	ppcle-* | powerpclittle-*)
++		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
++		;;
++	ppc64)	basic_machine=powerpc64-unknown
++		;;
++	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
++		;;
++	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
++		basic_machine=powerpc64le-unknown
++		;;
++	ppc64le-* | powerpc64little-*)
++		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
++		;;
++	ps2)
++		basic_machine=i386-ibm
++		;;
++	pw32)
++		basic_machine=i586-unknown
++		os=-pw32
++		;;
++	rdos)
++		basic_machine=i386-pc
++		os=-rdos
++		;;
++	rom68k)
++		basic_machine=m68k-rom68k
++		os=-coff
++		;;
++	rm[46]00)
++		basic_machine=mips-siemens
++		;;
++	rtpc | rtpc-*)
++		basic_machine=romp-ibm
++		;;
++	s390 | s390-*)
++		basic_machine=s390-ibm
++		;;
++	s390x | s390x-*)
++		basic_machine=s390x-ibm
++		;;
++	sa29200)
++		basic_machine=a29k-amd
++		os=-udi
++		;;
++	sb1)
++		basic_machine=mipsisa64sb1-unknown
++		;;
++	sb1el)
++		basic_machine=mipsisa64sb1el-unknown
++		;;
++	sde)
++		basic_machine=mipsisa32-sde
++		os=-elf
++		;;
++	sei)
++		basic_machine=mips-sei
++		os=-seiux
++		;;
++	sequent)
++		basic_machine=i386-sequent
++		;;
++	sh)
++		basic_machine=sh-hitachi
++		os=-hms
++		;;
++	sh5el)
++		basic_machine=sh5le-unknown
++		;;
++	sh64)
++		basic_machine=sh64-unknown
++		;;
++	sparclite-wrs | simso-wrs)
++		basic_machine=sparclite-wrs
++		os=-vxworks
++		;;
++	sps7)
++		basic_machine=m68k-bull
++		os=-sysv2
++		;;
++	spur)
++		basic_machine=spur-unknown
++		;;
++	st2000)
++		basic_machine=m68k-tandem
++		;;
++	stratus)
++		basic_machine=i860-stratus
++		os=-sysv4
++		;;
++	sun2)
++		basic_machine=m68000-sun
++		;;
++	sun2os3)
++		basic_machine=m68000-sun
++		os=-sunos3
++		;;
++	sun2os4)
++		basic_machine=m68000-sun
++		os=-sunos4
++		;;
++	sun3os3)
++		basic_machine=m68k-sun
++		os=-sunos3
++		;;
++	sun3os4)
++		basic_machine=m68k-sun
++		os=-sunos4
++		;;
++	sun4os3)
++		basic_machine=sparc-sun
++		os=-sunos3
++		;;
++	sun4os4)
++		basic_machine=sparc-sun
++		os=-sunos4
++		;;
++	sun4sol2)
++		basic_machine=sparc-sun
++		os=-solaris2
++		;;
++	sun3 | sun3-*)
++		basic_machine=m68k-sun
++		;;
++	sun4)
++		basic_machine=sparc-sun
++		;;
++	sun386 | sun386i | roadrunner)
++		basic_machine=i386-sun
++		;;
++	sv1)
++		basic_machine=sv1-cray
++		os=-unicos
++		;;
++	symmetry)
++		basic_machine=i386-sequent
++		os=-dynix
++		;;
++	t3e)
++		basic_machine=alphaev5-cray
++		os=-unicos
++		;;
++	t90)
++		basic_machine=t90-cray
++		os=-unicos
++		;;
++	tic54x | c54x*)
++		basic_machine=tic54x-unknown
++		os=-coff
++		;;
++	tic55x | c55x*)
++		basic_machine=tic55x-unknown
++		os=-coff
++		;;
++	tic6x | c6x*)
++		basic_machine=tic6x-unknown
++		os=-coff
++		;;
++	tile*)
++		basic_machine=tile-unknown
++		os=-linux-gnu
++		;;
++	tx39)
++		basic_machine=mipstx39-unknown
++		;;
++	tx39el)
++		basic_machine=mipstx39el-unknown
++		;;
++	toad1)
++		basic_machine=pdp10-xkl
++		os=-tops20
++		;;
++	tower | tower-32)
++		basic_machine=m68k-ncr
++		;;
++	tpf)
++		basic_machine=s390x-ibm
++		os=-tpf
++		;;
++	udi29k)
++		basic_machine=a29k-amd
++		os=-udi
++		;;
++	ultra3)
++		basic_machine=a29k-nyu
++		os=-sym1
++		;;
++	v810 | necv810)
++		basic_machine=v810-nec
++		os=-none
++		;;
++	vaxv)
++		basic_machine=vax-dec
++		os=-sysv
++		;;
++	vms)
++		basic_machine=vax-dec
++		os=-vms
++		;;
++	vpp*|vx|vx-*)
++		basic_machine=f301-fujitsu
++		;;
++	vxworks960)
++		basic_machine=i960-wrs
++		os=-vxworks
++		;;
++	vxworks68)
++		basic_machine=m68k-wrs
++		os=-vxworks
++		;;
++	vxworks29k)
++		basic_machine=a29k-wrs
++		os=-vxworks
++		;;
++	w65*)
++		basic_machine=w65-wdc
++		os=-none
++		;;
++	w89k-*)
++		basic_machine=hppa1.1-winbond
++		os=-proelf
++		;;
++	xbox)
++		basic_machine=i686-pc
++		os=-mingw32
++		;;
++	xps | xps100)
++		basic_machine=xps100-honeywell
++		;;
++	ymp)
++		basic_machine=ymp-cray
++		os=-unicos
++		;;
++	z8k-*-coff)
++		basic_machine=z8k-unknown
++		os=-sim
++		;;
++	z80-*-coff)
++		basic_machine=z80-unknown
++		os=-sim
++		;;
++	none)
++		basic_machine=none-none
++		os=-none
++		;;
++
++# Here we handle the default manufacturer of certain CPU types.  It is in
++# some cases the only manufacturer, in others, it is the most popular.
++	w89k)
++		basic_machine=hppa1.1-winbond
++		;;
++	op50n)
++		basic_machine=hppa1.1-oki
++		;;
++	op60c)
++		basic_machine=hppa1.1-oki
++		;;
++	romp)
++		basic_machine=romp-ibm
++		;;
++	mmix)
++		basic_machine=mmix-knuth
++		;;
++	rs6000)
++		basic_machine=rs6000-ibm
++		;;
++	vax)
++		basic_machine=vax-dec
++		;;
++	pdp10)
++		# there are many clones, so DEC is not a safe bet
++		basic_machine=pdp10-unknown
++		;;
++	pdp11)
++		basic_machine=pdp11-dec
++		;;
++	we32k)
++		basic_machine=we32k-att
++		;;
++	sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
++		basic_machine=sh-unknown
++		;;
++	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
++		basic_machine=sparc-sun
++		;;
++	cydra)
++		basic_machine=cydra-cydrome
++		;;
++	orion)
++		basic_machine=orion-highlevel
++		;;
++	orion105)
++		basic_machine=clipper-highlevel
++		;;
++	mac | mpw | mac-mpw)
++		basic_machine=m68k-apple
++		;;
++	pmac | pmac-mpw)
++		basic_machine=powerpc-apple
++		;;
++	*-unknown)
++		# Make sure to match an already-canonicalized machine name.
++		;;
++	*)
++		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
++		exit 1
++		;;
++esac
++
++# Here we canonicalize certain aliases for manufacturers.
++case $basic_machine in
++	*-digital*)
++		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
++		;;
++	*-commodore*)
++		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
++		;;
++	*)
++		;;
++esac
++
++# Decode manufacturer-specific aliases for certain operating systems.
++
++if [ x"$os" != x"" ]
++then
++case $os in
++        # First match some system type aliases
++        # that might get confused with valid system types.
++	# -solaris* is a basic system type, with this one exception.
++	-solaris1 | -solaris1.*)
++		os=`echo $os | sed -e 's|solaris1|sunos4|'`
++		;;
++	-solaris)
++		os=-solaris2
++		;;
++	-svr4*)
++		os=-sysv4
++		;;
++	-unixware*)
++		os=-sysv4.2uw
++		;;
++	-gnu/linux*)
++		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
++		;;
++	# First accept the basic system types.
++	# The portable systems comes first.
++	# Each alternative MUST END IN A *, to match a version number.
++	# -sysv* is not here because it comes later, after sysvr4.
++	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
++	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
++	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
++	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
++	      | -aos* \
++	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
++	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
++	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
++	      | -openbsd* | -solidbsd* \
++	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
++	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
++	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
++	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
++	      | -chorusos* | -chorusrdb* | -cegcc* \
++	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
++	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
++	      | -uxpv* | -beos* | -mpeix* | -udk* \
++	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
++	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
++	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
++	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
++	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
++	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
++	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -irx*)
++	# Remember, each alternative MUST END IN *, to match a version number.
++		;;
++	-qnx*)
++		case $basic_machine in
++		    x86-* | i*86-*)
++			;;
++		    *)
++			os=-nto$os
++			;;
++		esac
++		;;
++	-nto-qnx*)
++		;;
++	-nto*)
++		os=`echo $os | sed -e 's|nto|nto-qnx|'`
++		;;
++	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
++	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
++	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
++		;;
++	-mac*)
++		os=`echo $os | sed -e 's|mac|macos|'`
++		;;
++	-linux-dietlibc)
++		os=-linux-dietlibc
++		;;
++	-linux*)
++		os=`echo $os | sed -e 's|linux|linux-gnu|'`
++		;;
++	-sunos5*)
++		os=`echo $os | sed -e 's|sunos5|solaris2|'`
++		;;
++	-sunos6*)
++		os=`echo $os | sed -e 's|sunos6|solaris3|'`
++		;;
++	-opened*)
++		os=-openedition
++		;;
++        -os400*)
++		os=-os400
++		;;
++	-wince*)
++		os=-wince
++		;;
++	-osfrose*)
++		os=-osfrose
++		;;
++	-osf*)
++		os=-osf
++		;;
++	-utek*)
++		os=-bsd
++		;;
++	-dynix*)
++		os=-bsd
++		;;
++	-acis*)
++		os=-aos
++		;;
++	-atheos*)
++		os=-atheos
++		;;
++	-syllable*)
++		os=-syllable
++		;;
++	-386bsd)
++		os=-bsd
++		;;
++	-ctix* | -uts*)
++		os=-sysv
++		;;
++	-nova*)
++		os=-rtmk-nova
++		;;
++	-ns2 )
++		os=-nextstep2
++		;;
++	-nsk*)
++		os=-nsk
++		;;
++	# Preserve the version number of sinix5.
++	-sinix5.*)
++		os=`echo $os | sed -e 's|sinix|sysv|'`
++		;;
++	-sinix*)
++		os=-sysv4
++		;;
++        -tpf*)
++		os=-tpf
++		;;
++	-triton*)
++		os=-sysv3
++		;;
++	-oss*)
++		os=-sysv3
++		;;
++	-svr4)
++		os=-sysv4
++		;;
++	-svr3)
++		os=-sysv3
++		;;
++	-sysvr4)
++		os=-sysv4
++		;;
++	# This must come after -sysvr4.
++	-sysv*)
++		;;
++	-ose*)
++		os=-ose
++		;;
++	-es1800*)
++		os=-ose
++		;;
++	-xenix)
++		os=-xenix
++		;;
++	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
++		os=-mint
++		;;
++	-aros*)
++		os=-aros
++		;;
++	-kaos*)
++		os=-kaos
++		;;
++	-zvmoe)
++		os=-zvmoe
++		;;
++	-dicos*)
++		os=-dicos
++		;;
++	-none)
++		;;
++	*)
++		# Get rid of the `-' at the beginning of $os.
++		os=`echo $os | sed 's/[^-]*-//'`
++		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
++		exit 1
++		;;
++esac
++else
++
++# Here we handle the default operating systems that come with various machines.
++# The value should be what the vendor currently ships out the door with their
++# machine or put another way, the most popular os provided with the machine.
++
++# Note that if you're going to try to match "-MANUFACTURER" here (say,
++# "-sun"), then you have to tell the case statement up towards the top
++# that MANUFACTURER isn't an operating system.  Otherwise, code above
++# will signal an error saying that MANUFACTURER isn't an operating
++# system, and we'll never get to this point.
++
++case $basic_machine in
++        score-*)
++		os=-elf
++		;;
++        spu-*)
++		os=-elf
++		;;
++	*-acorn)
++		os=-riscix1.2
++		;;
++	arm*-rebel)
++		os=-linux
++		;;
++	arm*-semi)
++		os=-aout
++		;;
++        c4x-* | tic4x-*)
++        	os=-coff
++		;;
++	# This must come before the *-dec entry.
++	pdp10-*)
++		os=-tops20
++		;;
++	pdp11-*)
++		os=-none
++		;;
++	*-dec | vax-*)
++		os=-ultrix4.2
++		;;
++	m68*-apollo)
++		os=-domain
++		;;
++	i386-sun)
++		os=-sunos4.0.2
++		;;
++	m68000-sun)
++		os=-sunos3
++		# This also exists in the configure program, but was not the
++		# default.
++		# os=-sunos4
++		;;
++	m68*-cisco)
++		os=-aout
++		;;
++        mep-*)
++		os=-elf
++		;;
++	mips*-cisco)
++		os=-elf
++		;;
++	mips*-*)
++		os=-elf
++		;;
++	or32-*)
++		os=-coff
++		;;
++	*-tti)	# must be before sparc entry or we get the wrong os.
++		os=-sysv3
++		;;
++	sparc-* | *-sun)
++		os=-sunos4.1.1
++		;;
++	*-be)
++		os=-beos
++		;;
++	*-haiku)
++		os=-haiku
++		;;
++	*-ibm)
++		os=-aix
++		;;
++    	*-knuth)
++		os=-mmixware
++		;;
++	*-wec)
++		os=-proelf
++		;;
++	*-winbond)
++		os=-proelf
++		;;
++	*-oki)
++		os=-proelf
++		;;
++	*-hp)
++		os=-hpux
++		;;
++	*-hitachi)
++		os=-hiux
++		;;
++	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
++		os=-sysv
++		;;
++	*-cbm)
++		os=-amigaos
++		;;
++	*-dg)
++		os=-dgux
++		;;
++	*-dolphin)
++		os=-sysv3
++		;;
++	m68k-ccur)
++		os=-rtu
++		;;
++	m88k-omron*)
++		os=-luna
++		;;
++	*-next )
++		os=-nextstep
++		;;
++	*-sequent)
++		os=-ptx
++		;;
++	*-crds)
++		os=-unos
++		;;
++	*-ns)
++		os=-genix
++		;;
++	i370-*)
++		os=-mvs
++		;;
++	*-next)
++		os=-nextstep3
++		;;
++	*-gould)
++		os=-sysv
++		;;
++	*-highlevel)
++		os=-bsd
++		;;
++	*-encore)
++		os=-bsd
++		;;
++	*-sgi)
++		os=-irix
++		;;
++	*-siemens)
++		os=-sysv4
++		;;
++	*-masscomp)
++		os=-rtu
++		;;
++	f30[01]-fujitsu | f700-fujitsu)
++		os=-uxpv
++		;;
++	*-rom68k)
++		os=-coff
++		;;
++	*-*bug)
++		os=-coff
++		;;
++	*-apple)
++		os=-macos
++		;;
++	*-atari*)
++		os=-mint
++		;;
++	*)
++		os=-none
++		;;
++esac
++fi
++
++# Here we handle the case where we know the os, and the CPU type, but not the
++# manufacturer.  We pick the logical manufacturer.
++vendor=unknown
++case $basic_machine in
++	*-unknown)
++		case $os in
++			-riscix*)
++				vendor=acorn
++				;;
++			-sunos*)
++				vendor=sun
++				;;
++			-aix*)
++				vendor=ibm
++				;;
++			-beos*)
++				vendor=be
++				;;
++			-hpux*)
++				vendor=hp
++				;;
++			-mpeix*)
++				vendor=hp
++				;;
++			-hiux*)
++				vendor=hitachi
++				;;
++			-unos*)
++				vendor=crds
++				;;
++			-dgux*)
++				vendor=dg
++				;;
++			-luna*)
++				vendor=omron
++				;;
++			-genix*)
++				vendor=ns
++				;;
++			-mvs* | -opened*)
++				vendor=ibm
++				;;
++			-os400*)
++				vendor=ibm
++				;;
++			-ptx*)
++				vendor=sequent
++				;;
++			-tpf*)
++				vendor=ibm
++				;;
++			-vxsim* | -vxworks* | -windiss*)
++				vendor=wrs
++				;;
++			-aux*)
++				vendor=apple
++				;;
++			-hms*)
++				vendor=hitachi
++				;;
++			-mpw* | -macos*)
++				vendor=apple
++				;;
++			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
++				vendor=atari
++				;;
++			-vos*)
++				vendor=stratus
++				;;
++		esac
++		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
++		;;
++esac
++
++echo $basic_machine$os
++exit
++
++# Local variables:
++# eval: (add-hook 'write-file-hooks 'time-stamp)
++# time-stamp-start: "timestamp='"
++# time-stamp-format: "%:y-%02m-%02d"
++# time-stamp-end: "'"
++# End:
+diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/iscsiuio/configure open-iscsi-2.0-872-rc4-bnx2i.build/iscsiuio/configure
+--- open-iscsi-2.0-872-rc4-bnx2i/iscsiuio/configure	1969-12-31 18:00:00.000000000 -0600
++++ open-iscsi-2.0-872-rc4-bnx2i.build/iscsiuio/configure	2011-08-03 20:01:16.000000000 -0500
+@@ -0,0 +1,22786 @@
++#! /bin/sh
++# Guess values for system-dependent variables and create Makefiles.
++# Generated by GNU Autoconf 2.59 for iscsiuio 0.7.0.12.
++#
++# Report bugs to <eddie.wai at broadcom.com>.
++#
++# Copyright (C) 2003 Free Software Foundation, Inc.
++# This configure script is free software; the Free Software Foundation
++# gives unlimited permission to copy, distribute and modify it.
++## --------------------- ##
++## M4sh Initialization.  ##
++## --------------------- ##
++
++# Be Bourne compatible
++if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
++  emulate sh
++  NULLCMD=:
++  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
++  # is contrary to our usage.  Disable this feature.
++  alias -g '${1+"$@"}'='"$@"'
++elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
++  set -o posix
++fi
++DUALCASE=1; export DUALCASE # for MKS sh
++
++# Support unset when possible.
++if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
++  as_unset=unset
++else
++  as_unset=false
++fi
++
++
++# Work around bugs in pre-3.0 UWIN ksh.
++$as_unset ENV MAIL MAILPATH
++PS1='$ '
++PS2='> '
++PS4='+ '
++
++# NLS nuisances.
++for as_var in \
++  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
++  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
++  LC_TELEPHONE LC_TIME
++do
++  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
++    eval $as_var=C; export $as_var
++  else
++    $as_unset $as_var
++  fi
++done
++
++# Required to use basename.
++if expr a : '\(a\)' >/dev/null 2>&1; then
++  as_expr=expr
++else
++  as_expr=false
++fi
++
++if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
++  as_basename=basename
++else
++  as_basename=false
++fi
++
++
++# Name of the executable.
++as_me=`$as_basename "$0" ||
++$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
++	 X"$0" : 'X\(//\)$' \| \
++	 X"$0" : 'X\(/\)$' \| \
++	 .     : '\(.\)' 2>/dev/null ||
++echo X/"$0" |
++    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
++  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
++  	  /^X\/\(\/\).*/{ s//\1/; q; }
++  	  s/.*/./; q'`
++
++
++# PATH needs CR, and LINENO needs CR and PATH.
++# Avoid depending upon Character Ranges.
++as_cr_letters='abcdefghijklmnopqrstuvwxyz'
++as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
++as_cr_Letters=$as_cr_letters$as_cr_LETTERS
++as_cr_digits='0123456789'
++as_cr_alnum=$as_cr_Letters$as_cr_digits
++
++# The user is always right.
++if test "${PATH_SEPARATOR+set}" != set; then
++  echo "#! /bin/sh" >conf$$.sh
++  echo  "exit 0"   >>conf$$.sh
++  chmod +x conf$$.sh
++  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
++    PATH_SEPARATOR=';'
++  else
++    PATH_SEPARATOR=:
++  fi
++  rm -f conf$$.sh
++fi
++
++
++  as_lineno_1=$LINENO
++  as_lineno_2=$LINENO
++  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
++  test "x$as_lineno_1" != "x$as_lineno_2" &&
++  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
++  # Find who we are.  Look in the path if we contain no path at all
++  # relative or not.
++  case $0 in
++    *[\\/]* ) as_myself=$0 ;;
++    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
++done
++
++       ;;
++  esac
++  # We did not find ourselves, most probably we were run as `sh COMMAND'
++  # in which case we are not to be found in the path.
++  if test "x$as_myself" = x; then
++    as_myself=$0
++  fi
++  if test ! -f "$as_myself"; then
++    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
++   { (exit 1); exit 1; }; }
++  fi
++  case $CONFIG_SHELL in
++  '')
++    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++  for as_base in sh bash ksh sh5; do
++	 case $as_dir in
++	 /*)
++	   if ("$as_dir/$as_base" -c '
++  as_lineno_1=$LINENO
++  as_lineno_2=$LINENO
++  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
++  test "x$as_lineno_1" != "x$as_lineno_2" &&
++  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
++	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
++	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
++	     CONFIG_SHELL=$as_dir/$as_base
++	     export CONFIG_SHELL
++	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
++	   fi;;
++	 esac
++       done
++done
++;;
++  esac
++
++  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
++  # uniformly replaced by the line number.  The first 'sed' inserts a
++  # line-number line before each line; the second 'sed' does the real
++  # work.  The second script uses 'N' to pair each line-number line
++  # with the numbered line, and appends trailing '-' during
++  # substitution so that $LINENO is not a special case at line end.
++  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
++  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
++  sed '=' <$as_myself |
++    sed '
++      N
++      s,$,-,
++      : loop
++      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
++      t loop
++      s,-$,,
++      s,^['$as_cr_digits']*\n,,
++    ' >$as_me.lineno &&
++  chmod +x $as_me.lineno ||
++    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
++   { (exit 1); exit 1; }; }
++
++  # Don't try to exec as it changes $[0], causing all sort of problems
++  # (the dirname of $[0] is not the place where we might find the
++  # original and so on.  Autoconf is especially sensible to this).
++  . ./$as_me.lineno
++  # Exit status is that of the last command.
++  exit
++}
++
++
++case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
++  *c*,-n*) ECHO_N= ECHO_C='
++' ECHO_T='	' ;;
++  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
++  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
++esac
++
++if expr a : '\(a\)' >/dev/null 2>&1; then
++  as_expr=expr
++else
++  as_expr=false
++fi
++
++rm -f conf$$ conf$$.exe conf$$.file
++echo >conf$$.file
++if ln -s conf$$.file conf$$ 2>/dev/null; then
++  # We could just check for DJGPP; but this test a) works b) is more generic
++  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
++  if test -f conf$$.exe; then
++    # Don't use ln at all; we don't have any links
++    as_ln_s='cp -p'
++  else
++    as_ln_s='ln -s'
++  fi
++elif ln conf$$.file conf$$ 2>/dev/null; then
++  as_ln_s=ln
++else
++  as_ln_s='cp -p'
++fi
++rm -f conf$$ conf$$.exe conf$$.file
++
++if mkdir -p . 2>/dev/null; then
++  as_mkdir_p=:
++else
++  test -d ./-p && rmdir ./-p
++  as_mkdir_p=false
++fi
++
++as_executable_p="test -f"
++
++# Sed expression to map a string onto a valid CPP name.
++as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
++
++# Sed expression to map a string onto a valid variable name.
++as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
++
++
++# IFS
++# We need space, tab and new line, in precisely that order.
++as_nl='
++'
++IFS=" 	$as_nl"
++
++# CDPATH.
++$as_unset CDPATH
++
++
++
++# Check that we are running under the correct shell.
++SHELL=${CONFIG_SHELL-/bin/sh}
++
++case X$ECHO in
++X*--fallback-echo)
++  # Remove one level of quotation (which was required for Make).
++  ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
++  ;;
++esac
++
++echo=${ECHO-echo}
++if test "X$1" = X--no-reexec; then
++  # Discard the --no-reexec flag, and continue.
++  shift
++elif test "X$1" = X--fallback-echo; then
++  # Avoid inline document here, it may be left over
++  :
++elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
++  # Yippee, $echo works!
++  :
++else
++  # Restart under the correct shell.
++  exec $SHELL "$0" --no-reexec ${1+"$@"}
++fi
++
++if test "X$1" = X--fallback-echo; then
++  # used as fallback echo
++  shift
++  cat <<EOF
++$*
++EOF
++  exit 0
++fi
++
++# The HP-UX ksh and POSIX shell print the target directory to stdout
++# if CDPATH is set.
++(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
++
++if test -z "$ECHO"; then
++if test "X${echo_test_string+set}" != Xset; then
++# find a string as large as possible, as long as the shell can cope with it
++  for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
++    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
++    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
++       echo_test_string=`eval $cmd` &&
++       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
++    then
++      break
++    fi
++  done
++fi
++
++if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
++   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
++   test "X$echo_testing_string" = "X$echo_test_string"; then
++  :
++else
++  # The Solaris, AIX, and Digital Unix default echo programs unquote
++  # backslashes.  This makes it impossible to quote backslashes using
++  #   echo "$something" | sed 's/\\/\\\\/g'
++  #
++  # So, first we look for a working echo in the user's PATH.
++
++  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
++  for dir in $PATH /usr/ucb; do
++    IFS="$lt_save_ifs"
++    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
++       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
++       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
++       test "X$echo_testing_string" = "X$echo_test_string"; then
++      echo="$dir/echo"
++      break
++    fi
++  done
++  IFS="$lt_save_ifs"
++
++  if test "X$echo" = Xecho; then
++    # We didn't find a better echo, so look for alternatives.
++    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
++       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
++       test "X$echo_testing_string" = "X$echo_test_string"; then
++      # This shell has a builtin print -r that does the trick.
++      echo='print -r'
++    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
++	 test "X$CONFIG_SHELL" != X/bin/ksh; then
++      # If we have ksh, try running configure again with it.
++      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
++      export ORIGINAL_CONFIG_SHELL
++      CONFIG_SHELL=/bin/ksh
++      export CONFIG_SHELL
++      exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
++    else
++      # Try using printf.
++      echo='printf %s\n'
++      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
++	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
++	 test "X$echo_testing_string" = "X$echo_test_string"; then
++	# Cool, printf works
++	:
++      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
++	   test "X$echo_testing_string" = 'X\t' &&
++	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
++	   test "X$echo_testing_string" = "X$echo_test_string"; then
++	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
++	export CONFIG_SHELL
++	SHELL="$CONFIG_SHELL"
++	export SHELL
++	echo="$CONFIG_SHELL $0 --fallback-echo"
++      elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
++	   test "X$echo_testing_string" = 'X\t' &&
++	   echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
++	   test "X$echo_testing_string" = "X$echo_test_string"; then
++	echo="$CONFIG_SHELL $0 --fallback-echo"
++      else
++	# maybe with a smaller string...
++	prev=:
++
++	for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
++	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
++	  then
++	    break
++	  fi
++	  prev="$cmd"
++	done
++
++	if test "$prev" != 'sed 50q "$0"'; then
++	  echo_test_string=`eval $prev`
++	  export echo_test_string
++	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
++	else
++	  # Oops.  We lost completely, so just stick with echo.
++	  echo=echo
++	fi
++      fi
++    fi
++  fi
++fi
++fi
++
++# Copy echo and quote the copy suitably for passing to libtool from
++# the Makefile, instead of quoting the original, which is used later.
++ECHO=$echo
++if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
++   ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
++fi
++
++
++
++
++tagnames=${tagnames+${tagnames},}CXX
++
++tagnames=${tagnames+${tagnames},}F77
++
++# Name of the host.
++# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
++# so uname gets run too.
++ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
++
++exec 6>&1
++
++#
++# Initializations.
++#
++ac_default_prefix=/usr/local
++ac_config_libobj_dir=.
++cross_compiling=no
++subdirs=
++MFLAGS=
++MAKEFLAGS=
++SHELL=${CONFIG_SHELL-/bin/sh}
++
++# Maximum number of lines to put in a shell here document.
++# This variable seems obsolete.  It should probably be removed, and
++# only ac_max_sed_lines should be used.
++: ${ac_max_here_lines=38}
++
++# Identity of this package.
++PACKAGE_NAME='iscsiuio'
++PACKAGE_TARNAME='iscsiuio'
++PACKAGE_VERSION='0.7.0.12'
++PACKAGE_STRING='iscsiuio 0.7.0.12'
++PACKAGE_BUGREPORT='eddie.wai at broadcom.com'
++
++# Factoring default headers for most tests.
++ac_includes_default="\
++#include <stdio.h>
++#if HAVE_SYS_TYPES_H
++# include <sys/types.h>
++#endif
++#if HAVE_SYS_STAT_H
++# include <sys/stat.h>
++#endif
++#if STDC_HEADERS
++# include <stdlib.h>
++# include <stddef.h>
++#else
++# if HAVE_STDLIB_H
++#  include <stdlib.h>
++# endif
++#endif
++#if HAVE_STRING_H
++# if !STDC_HEADERS && HAVE_MEMORY_H
++#  include <memory.h>
++# endif
++# include <string.h>
++#endif
++#if HAVE_STRINGS_H
++# include <strings.h>
++#endif
++#if HAVE_INTTYPES_H
++# include <inttypes.h>
++#else
++# if HAVE_STDINT_H
++#  include <stdint.h>
++# endif
++#endif
++#if HAVE_UNISTD_H
++# include <unistd.h>
++#endif"
++
++ac_default_prefix=
++ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar BASH 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 RANLIB ac_ct_RANLIB CPP EGREP ENDIAN build build_cpu build_vendor build_os host host_cpu host_vendor host_os SED LN_S ECHO AR ac_ct_AR CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL
  DEBUG_TRUE DEBUG_FALSE LIBOBJS LTLIBOBJS'
++ac_subst_files=''
++
++# Initialize some variables set by options.
++ac_init_help=
++ac_init_version=false
++# The variables have the same names as the options, with
++# dashes changed to underlines.
++cache_file=/dev/null
++exec_prefix=NONE
++no_create=
++no_recursion=
++prefix=NONE
++program_prefix=NONE
++program_suffix=NONE
++program_transform_name=s,x,x,
++silent=
++site=
++srcdir=
++verbose=
++x_includes=NONE
++x_libraries=NONE
++
++# Installation directory options.
++# These are left unexpanded so users can "make install exec_prefix=/foo"
++# and all the variables that are supposed to be based on exec_prefix
++# by default will actually change.
++# Use braces instead of parens because sh, perl, etc. also accept them.
++bindir='${exec_prefix}/bin'
++sbindir='${exec_prefix}/sbin'
++libexecdir='${exec_prefix}/libexec'
++datadir='${prefix}/share'
++sysconfdir='${prefix}/etc'
++sharedstatedir='${prefix}/com'
++localstatedir='${prefix}/var'
++libdir='${exec_prefix}/lib'
++includedir='${prefix}/include'
++oldincludedir='/usr/include'
++infodir='${prefix}/info'
++mandir='${prefix}/man'
++
++ac_prev=
++for ac_option
++do
++  # If the previous option needs an argument, assign it.
++  if test -n "$ac_prev"; then
++    eval "$ac_prev=\$ac_option"
++    ac_prev=
++    continue
++  fi
++
++  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
++
++  # Accept the important Cygnus configure options, so we can diagnose typos.
++
++  case $ac_option in
++
++  -bindir | --bindir | --bindi | --bind | --bin | --bi)
++    ac_prev=bindir ;;
++  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
++    bindir=$ac_optarg ;;
++
++  -build | --build | --buil | --bui | --bu)
++    ac_prev=build_alias ;;
++  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
++    build_alias=$ac_optarg ;;
++
++  -cache-file | --cache-file | --cache-fil | --cache-fi \
++  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
++    ac_prev=cache_file ;;
++  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
++  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
++    cache_file=$ac_optarg ;;
++
++  --config-cache | -C)
++    cache_file=config.cache ;;
++
++  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
++    ac_prev=datadir ;;
++  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
++  | --da=*)
++    datadir=$ac_optarg ;;
++
++  -disable-* | --disable-*)
++    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
++    # Reject names that are not valid shell variable names.
++    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
++      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
++   { (exit 1); exit 1; }; }
++    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
++    eval "enable_$ac_feature=no" ;;
++
++  -enable-* | --enable-*)
++    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
++    # Reject names that are not valid shell variable names.
++    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
++      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
++   { (exit 1); exit 1; }; }
++    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
++    case $ac_option in
++      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
++      *) ac_optarg=yes ;;
++    esac
++    eval "enable_$ac_feature='$ac_optarg'" ;;
++
++  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
++  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
++  | --exec | --exe | --ex)
++    ac_prev=exec_prefix ;;
++  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
++  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
++  | --exec=* | --exe=* | --ex=*)
++    exec_prefix=$ac_optarg ;;
++
++  -gas | --gas | --ga | --g)
++    # Obsolete; use --with-gas.
++    with_gas=yes ;;
++
++  -help | --help | --hel | --he | -h)
++    ac_init_help=long ;;
++  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
++    ac_init_help=recursive ;;
++  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
++    ac_init_help=short ;;
++
++  -host | --host | --hos | --ho)
++    ac_prev=host_alias ;;
++  -host=* | --host=* | --hos=* | --ho=*)
++    host_alias=$ac_optarg ;;
++
++  -includedir | --includedir | --includedi | --included | --include \
++  | --includ | --inclu | --incl | --inc)
++    ac_prev=includedir ;;
++  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
++  | --includ=* | --inclu=* | --incl=* | --inc=*)
++    includedir=$ac_optarg ;;
++
++  -infodir | --infodir | --infodi | --infod | --info | --inf)
++    ac_prev=infodir ;;
++  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
++    infodir=$ac_optarg ;;
++
++  -libdir | --libdir | --libdi | --libd)
++    ac_prev=libdir ;;
++  -libdir=* | --libdir=* | --libdi=* | --libd=*)
++    libdir=$ac_optarg ;;
++
++  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
++  | --libexe | --libex | --libe)
++    ac_prev=libexecdir ;;
++  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
++  | --libexe=* | --libex=* | --libe=*)
++    libexecdir=$ac_optarg ;;
++
++  -localstatedir | --localstatedir | --localstatedi | --localstated \
++  | --localstate | --localstat | --localsta | --localst \
++  | --locals | --local | --loca | --loc | --lo)
++    ac_prev=localstatedir ;;
++  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
++  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
++  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
++    localstatedir=$ac_optarg ;;
++
++  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
++    ac_prev=mandir ;;
++  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
++    mandir=$ac_optarg ;;
++
++  -nfp | --nfp | --nf)
++    # Obsolete; use --without-fp.
++    with_fp=no ;;
++
++  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
++  | --no-cr | --no-c | -n)
++    no_create=yes ;;
++
++  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
++  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
++    no_recursion=yes ;;
++
++  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
++  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
++  | --oldin | --oldi | --old | --ol | --o)
++    ac_prev=oldincludedir ;;
++  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
++  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
++  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
++    oldincludedir=$ac_optarg ;;
++
++  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
++    ac_prev=prefix ;;
++  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
++    prefix=$ac_optarg ;;
++
++  -program-prefix | --program-prefix | --program-prefi | --program-pref \
++  | --program-pre | --program-pr | --program-p)
++    ac_prev=program_prefix ;;
++  -program-prefix=* | --program-prefix=* | --program-prefi=* \
++  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
++    program_prefix=$ac_optarg ;;
++
++  -program-suffix | --program-suffix | --program-suffi | --program-suff \
++  | --program-suf | --program-su | --program-s)
++    ac_prev=program_suffix ;;
++  -program-suffix=* | --program-suffix=* | --program-suffi=* \
++  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
++    program_suffix=$ac_optarg ;;
++
++  -program-transform-name | --program-transform-name \
++  | --program-transform-nam | --program-transform-na \
++  | --program-transform-n | --program-transform- \
++  | --program-transform | --program-transfor \
++  | --program-transfo | --program-transf \
++  | --program-trans | --program-tran \
++  | --progr-tra | --program-tr | --program-t)
++    ac_prev=program_transform_name ;;
++  -program-transform-name=* | --program-transform-name=* \
++  | --program-transform-nam=* | --program-transform-na=* \
++  | --program-transform-n=* | --program-transform-=* \
++  | --program-transform=* | --program-transfor=* \
++  | --program-transfo=* | --program-transf=* \
++  | --program-trans=* | --program-tran=* \
++  | --progr-tra=* | --program-tr=* | --program-t=*)
++    program_transform_name=$ac_optarg ;;
++
++  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
++  | -silent | --silent | --silen | --sile | --sil)
++    silent=yes ;;
++
++  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
++    ac_prev=sbindir ;;
++  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
++  | --sbi=* | --sb=*)
++    sbindir=$ac_optarg ;;
++
++  -sharedstatedir | --sharedstatedir | --sharedstatedi \
++  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
++  | --sharedst | --shareds | --shared | --share | --shar \
++  | --sha | --sh)
++    ac_prev=sharedstatedir ;;
++  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
++  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
++  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
++  | --sha=* | --sh=*)
++    sharedstatedir=$ac_optarg ;;
++
++  -site | --site | --sit)
++    ac_prev=site ;;
++  -site=* | --site=* | --sit=*)
++    site=$ac_optarg ;;
++
++  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
++    ac_prev=srcdir ;;
++  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
++    srcdir=$ac_optarg ;;
++
++  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
++  | --syscon | --sysco | --sysc | --sys | --sy)
++    ac_prev=sysconfdir ;;
++  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
++  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
++    sysconfdir=$ac_optarg ;;
++
++  -target | --target | --targe | --targ | --tar | --ta | --t)
++    ac_prev=target_alias ;;
++  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
++    target_alias=$ac_optarg ;;
++
++  -v | -verbose | --verbose | --verbos | --verbo | --verb)
++    verbose=yes ;;
++
++  -version | --version | --versio | --versi | --vers | -V)
++    ac_init_version=: ;;
++
++  -with-* | --with-*)
++    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
++    # Reject names that are not valid shell variable names.
++    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
++      { echo "$as_me: error: invalid package name: $ac_package" >&2
++   { (exit 1); exit 1; }; }
++    ac_package=`echo $ac_package| sed 's/-/_/g'`
++    case $ac_option in
++      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
++      *) ac_optarg=yes ;;
++    esac
++    eval "with_$ac_package='$ac_optarg'" ;;
++
++  -without-* | --without-*)
++    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
++    # Reject names that are not valid shell variable names.
++    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
++      { echo "$as_me: error: invalid package name: $ac_package" >&2
++   { (exit 1); exit 1; }; }
++    ac_package=`echo $ac_package | sed 's/-/_/g'`
++    eval "with_$ac_package=no" ;;
++
++  --x)
++    # Obsolete; use --with-x.
++    with_x=yes ;;
++
++  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
++  | --x-incl | --x-inc | --x-in | --x-i)
++    ac_prev=x_includes ;;
++  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
++  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
++    x_includes=$ac_optarg ;;
++
++  -x-libraries | --x-libraries | --x-librarie | --x-librari \
++  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
++    ac_prev=x_libraries ;;
++  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
++  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
++    x_libraries=$ac_optarg ;;
++
++  -*) { echo "$as_me: error: unrecognized option: $ac_option
++Try \`$0 --help' for more information." >&2
++   { (exit 1); exit 1; }; }
++    ;;
++
++  *=*)
++    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
++    # Reject names that are not valid shell variable names.
++    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
++      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
++   { (exit 1); exit 1; }; }
++    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
++    eval "$ac_envvar='$ac_optarg'"
++    export $ac_envvar ;;
++
++  *)
++    # FIXME: should be removed in autoconf 3.0.
++    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
++    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
++      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
++    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
++    ;;
++
++  esac
++done
++
++if test -n "$ac_prev"; then
++  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
++  { echo "$as_me: error: missing argument to $ac_option" >&2
++   { (exit 1); exit 1; }; }
++fi
++
++# Be sure to have absolute paths.
++for ac_var in exec_prefix prefix
++do
++  eval ac_val=$`echo $ac_var`
++  case $ac_val in
++    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
++    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
++   { (exit 1); exit 1; }; };;
++  esac
++done
++
++# Be sure to have absolute paths.
++for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
++	      localstatedir libdir includedir oldincludedir infodir mandir
++do
++  eval ac_val=$`echo $ac_var`
++  case $ac_val in
++    [\\/$]* | ?:[\\/]* ) ;;
++    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
++   { (exit 1); exit 1; }; };;
++  esac
++done
++
++# There might be people who depend on the old broken behavior: `$host'
++# used to hold the argument of --host etc.
++# FIXME: To remove some day.
++build=$build_alias
++host=$host_alias
++target=$target_alias
++
++# FIXME: To remove some day.
++if test "x$host_alias" != x; then
++  if test "x$build_alias" = x; then
++    cross_compiling=maybe
++    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
++    If a cross compiler is detected then cross compile mode will be used." >&2
++  elif test "x$build_alias" != "x$host_alias"; then
++    cross_compiling=yes
++  fi
++fi
++
++ac_tool_prefix=
++test -n "$host_alias" && ac_tool_prefix=$host_alias-
++
++test "$silent" = yes && exec 6>/dev/null
++
++
++# Find the source files, if location was not specified.
++if test -z "$srcdir"; then
++  ac_srcdir_defaulted=yes
++  # Try the directory containing this script, then its parent.
++  ac_confdir=`(dirname "$0") 2>/dev/null ||
++$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++	 X"$0" : 'X\(//\)[^/]' \| \
++	 X"$0" : 'X\(//\)$' \| \
++	 X"$0" : 'X\(/\)' \| \
++	 .     : '\(.\)' 2>/dev/null ||
++echo X"$0" |
++    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
++  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
++  	  /^X\(\/\/\)$/{ s//\1/; q; }
++  	  /^X\(\/\).*/{ s//\1/; q; }
++  	  s/.*/./; q'`
++  srcdir=$ac_confdir
++  if test ! -r $srcdir/$ac_unique_file; then
++    srcdir=..
++  fi
++else
++  ac_srcdir_defaulted=no
++fi
++if test ! -r $srcdir/$ac_unique_file; then
++  if test "$ac_srcdir_defaulted" = yes; then
++    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
++   { (exit 1); exit 1; }; }
++  else
++    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
++   { (exit 1); exit 1; }; }
++  fi
++fi
++(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
++  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
++   { (exit 1); exit 1; }; }
++srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
++ac_env_build_alias_set=${build_alias+set}
++ac_env_build_alias_value=$build_alias
++ac_cv_env_build_alias_set=${build_alias+set}
++ac_cv_env_build_alias_value=$build_alias
++ac_env_host_alias_set=${host_alias+set}
++ac_env_host_alias_value=$host_alias
++ac_cv_env_host_alias_set=${host_alias+set}
++ac_cv_env_host_alias_value=$host_alias
++ac_env_target_alias_set=${target_alias+set}
++ac_env_target_alias_value=$target_alias
++ac_cv_env_target_alias_set=${target_alias+set}
++ac_cv_env_target_alias_value=$target_alias
++ac_env_CC_set=${CC+set}
++ac_env_CC_value=$CC
++ac_cv_env_CC_set=${CC+set}
++ac_cv_env_CC_value=$CC
++ac_env_CFLAGS_set=${CFLAGS+set}
++ac_env_CFLAGS_value=$CFLAGS
++ac_cv_env_CFLAGS_set=${CFLAGS+set}
++ac_cv_env_CFLAGS_value=$CFLAGS
++ac_env_LDFLAGS_set=${LDFLAGS+set}
++ac_env_LDFLAGS_value=$LDFLAGS
++ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
++ac_cv_env_LDFLAGS_value=$LDFLAGS
++ac_env_CPPFLAGS_set=${CPPFLAGS+set}
++ac_env_CPPFLAGS_value=$CPPFLAGS
++ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
++ac_cv_env_CPPFLAGS_value=$CPPFLAGS
++ac_env_CPP_set=${CPP+set}
++ac_env_CPP_value=$CPP
++ac_cv_env_CPP_set=${CPP+set}
++ac_cv_env_CPP_value=$CPP
++ac_env_CXX_set=${CXX+set}
++ac_env_CXX_value=$CXX
++ac_cv_env_CXX_set=${CXX+set}
++ac_cv_env_CXX_value=$CXX
++ac_env_CXXFLAGS_set=${CXXFLAGS+set}
++ac_env_CXXFLAGS_value=$CXXFLAGS
++ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set}
++ac_cv_env_CXXFLAGS_value=$CXXFLAGS
++ac_env_CXXCPP_set=${CXXCPP+set}
++ac_env_CXXCPP_value=$CXXCPP
++ac_cv_env_CXXCPP_set=${CXXCPP+set}
++ac_cv_env_CXXCPP_value=$CXXCPP
++ac_env_F77_set=${F77+set}
++ac_env_F77_value=$F77
++ac_cv_env_F77_set=${F77+set}
++ac_cv_env_F77_value=$F77
++ac_env_FFLAGS_set=${FFLAGS+set}
++ac_env_FFLAGS_value=$FFLAGS
++ac_cv_env_FFLAGS_set=${FFLAGS+set}
++ac_cv_env_FFLAGS_value=$FFLAGS
++
++#
++# Report the --help message.
++#
++if test "$ac_init_help" = "long"; then
++  # Omit some internal or obsolete options to make the list less imposing.
++  # This message is too long to be a string in the A/UX 3.1 sh.
++  cat <<_ACEOF
++\`configure' configures iscsiuio 0.7.0.12 to adapt to many kinds of systems.
++
++Usage: $0 [OPTION]... [VAR=VALUE]...
++
++To assign environment variables (e.g., CC, CFLAGS...), specify them as
++VAR=VALUE.  See below for descriptions of some of the useful variables.
++
++Defaults for the options are specified in brackets.
++
++Configuration:
++  -h, --help              display this help and exit
++      --help=short        display options specific to this package
++      --help=recursive    display the short help of all the included packages
++  -V, --version           display version information and exit
++  -q, --quiet, --silent   do not print \`checking...' messages
++      --cache-file=FILE   cache test results in FILE [disabled]
++  -C, --config-cache      alias for \`--cache-file=config.cache'
++  -n, --no-create         do not create output files
++      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
++
++_ACEOF
++
++  cat <<_ACEOF
++Installation directories:
++  --prefix=PREFIX         install architecture-independent files in PREFIX
++			  [$ac_default_prefix]
++  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
++			  [PREFIX]
++
++By default, \`make install' will install all the files in
++\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
++an installation prefix other than \`$ac_default_prefix' using \`--prefix',
++for instance \`--prefix=\$HOME'.
++
++For better control, use the options below.
++
++Fine tuning of the installation directories:
++  --bindir=DIR           user executables [EPREFIX/bin]
++  --sbindir=DIR          system admin executables [EPREFIX/sbin]
++  --libexecdir=DIR       program executables [EPREFIX/libexec]
++  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
++  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
++  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
++  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
++  --libdir=DIR           object code libraries [EPREFIX/lib]
++  --includedir=DIR       C header files [PREFIX/include]
++  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
++  --infodir=DIR          info documentation [PREFIX/info]
++  --mandir=DIR           man documentation [PREFIX/man]
++_ACEOF
++
++  cat <<\_ACEOF
++
++Program names:
++  --program-prefix=PREFIX            prepend PREFIX to installed program names
++  --program-suffix=SUFFIX            append SUFFIX to installed program names
++  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
++
++System types:
++  --build=BUILD     configure for building on BUILD [guessed]
++  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
++_ACEOF
++fi
++
++if test -n "$ac_init_help"; then
++  case $ac_init_help in
++     short | recursive ) echo "Configuration of iscsiuio 0.7.0.12:";;
++   esac
++  cat <<\_ACEOF
++
++Optional Features:
++  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
++  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
++  --disable-dependency-tracking  speeds up one-time build
++  --enable-dependency-tracking   do not reject slow dependency extractors
++  --enable-shared[=PKGS]
++                          build shared libraries [default=yes]
++  --enable-static[=PKGS]
++                          build static libraries [default=yes]
++  --enable-fast-install[=PKGS]
++                          optimize for fast installation [default=yes]
++  --disable-libtool-lock  avoid locking (might break parallel builds)
++  --enable-debug          Turn on compiler debugging information (default=no)
++
++Optional Packages:
++  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
++  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
++  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
++  --with-pic              try to use only PIC/non-PIC objects [default=use
++                          both]
++  --with-tags[=TAGS]
++                          include additional configurations [automatic]
++  --with-iscsid-version    Compile against a certain version of iscsid (default="$ISCSID_VERSION_DEFAULT")
++
++Some influential environment variables:
++  CC          C compiler command
++  CFLAGS      C compiler flags
++  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
++              nonstandard directory <lib dir>
++  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
++              headers in a nonstandard directory <include dir>
++  CPP         C preprocessor
++  CXX         C++ compiler command
++  CXXFLAGS    C++ compiler flags
++  CXXCPP      C++ preprocessor
++  F77         Fortran 77 compiler command
++  FFLAGS      Fortran 77 compiler flags
++
++Use these variables to override the choices made by `configure' or to help
++it to find libraries and programs with nonstandard names/locations.
++
++Report bugs to <eddie.wai at broadcom.com>.
++_ACEOF
++fi
++
++if test "$ac_init_help" = "recursive"; then
++  # If there are subdirs, report their specific --help.
++  ac_popdir=`pwd`
++  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
++    test -d $ac_dir || continue
++    ac_builddir=.
++
++if test "$ac_dir" != .; then
++  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
++  # A "../" for each directory in $ac_dir_suffix.
++  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
++else
++  ac_dir_suffix= ac_top_builddir=
++fi
++
++case $srcdir in
++  .)  # No --srcdir option.  We are building in place.
++    ac_srcdir=.
++    if test -z "$ac_top_builddir"; then
++       ac_top_srcdir=.
++    else
++       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
++    fi ;;
++  [\\/]* | ?:[\\/]* )  # Absolute path.
++    ac_srcdir=$srcdir$ac_dir_suffix;
++    ac_top_srcdir=$srcdir ;;
++  *) # Relative path.
++    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
++    ac_top_srcdir=$ac_top_builddir$srcdir ;;
++esac
++
++# Do not use `cd foo && pwd` to compute absolute paths, because
++# the directories may not exist.
++case `pwd` in
++.) ac_abs_builddir="$ac_dir";;
++*)
++  case "$ac_dir" in
++  .) ac_abs_builddir=`pwd`;;
++  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
++  *) ac_abs_builddir=`pwd`/"$ac_dir";;
++  esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_top_builddir=${ac_top_builddir}.;;
++*)
++  case ${ac_top_builddir}. in
++  .) ac_abs_top_builddir=$ac_abs_builddir;;
++  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
++  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
++  esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_srcdir=$ac_srcdir;;
++*)
++  case $ac_srcdir in
++  .) ac_abs_srcdir=$ac_abs_builddir;;
++  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
++  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
++  esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_top_srcdir=$ac_top_srcdir;;
++*)
++  case $ac_top_srcdir in
++  .) ac_abs_top_srcdir=$ac_abs_builddir;;
++  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
++  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
++  esac;;
++esac
++
++    cd $ac_dir
++    # Check for guested configure; otherwise get Cygnus style configure.
++    if test -f $ac_srcdir/configure.gnu; then
++      echo
++      $SHELL $ac_srcdir/configure.gnu  --help=recursive
++    elif test -f $ac_srcdir/configure; then
++      echo
++      $SHELL $ac_srcdir/configure  --help=recursive
++    elif test -f $ac_srcdir/configure.ac ||
++	   test -f $ac_srcdir/configure.in; then
++      echo
++      $ac_configure --help
++    else
++      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
++    fi
++    cd $ac_popdir
++  done
++fi
++
++test -n "$ac_init_help" && exit 0
++if $ac_init_version; then
++  cat <<\_ACEOF
++iscsiuio configure 0.7.0.12
++generated by GNU Autoconf 2.59
++
++Copyright (C) 2003 Free Software Foundation, Inc.
++This configure script is free software; the Free Software Foundation
++gives unlimited permission to copy, distribute and modify it.
++_ACEOF
++  exit 0
++fi
++exec 5>config.log
++cat >&5 <<_ACEOF
++This file contains any messages produced by compilers while
++running configure, to aid debugging if configure makes a mistake.
++
++It was created by iscsiuio $as_me 0.7.0.12, which was
++generated by GNU Autoconf 2.59.  Invocation command line was
++
++  $ $0 $@
++
++_ACEOF
++{
++cat <<_ASUNAME
++## --------- ##
++## Platform. ##
++## --------- ##
++
++hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
++uname -m = `(uname -m) 2>/dev/null || echo unknown`
++uname -r = `(uname -r) 2>/dev/null || echo unknown`
++uname -s = `(uname -s) 2>/dev/null || echo unknown`
++uname -v = `(uname -v) 2>/dev/null || echo unknown`
++
++/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
++/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
++
++/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
++/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
++/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
++hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
++/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
++/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
++/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
++
++_ASUNAME
++
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++  echo "PATH: $as_dir"
++done
++
++} >&5
++
++cat >&5 <<_ACEOF
++
++
++## ----------- ##
++## Core tests. ##
++## ----------- ##
++
++_ACEOF
++
++
++# Keep a trace of the command line.
++# Strip out --no-create and --no-recursion so they do not pile up.
++# Strip out --silent because we don't want to record it for future runs.
++# Also quote any args containing shell meta-characters.
++# Make two passes to allow for proper duplicate-argument suppression.
++ac_configure_args=
++ac_configure_args0=
++ac_configure_args1=
++ac_sep=
++ac_must_keep_next=false
++for ac_pass in 1 2
++do
++  for ac_arg
++  do
++    case $ac_arg in
++    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
++    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
++    | -silent | --silent | --silen | --sile | --sil)
++      continue ;;
++    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
++      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
++    esac
++    case $ac_pass in
++    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
++    2)
++      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
++      if test $ac_must_keep_next = true; then
++	ac_must_keep_next=false # Got value, back to normal.
++      else
++	case $ac_arg in
++	  *=* | --config-cache | -C | -disable-* | --disable-* \
++	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
++	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
++	  | -with-* | --with-* | -without-* | --without-* | --x)
++	    case "$ac_configure_args0 " in
++	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
++	    esac
++	    ;;
++	  -* ) ac_must_keep_next=true ;;
++	esac
++      fi
++      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
++      # Get rid of the leading space.
++      ac_sep=" "
++      ;;
++    esac
++  done
++done
++$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
++$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
++
++# When interrupted or exit'd, cleanup temporary files, and complete
++# config.log.  We remove comments because anyway the quotes in there
++# would cause problems or look ugly.
++# WARNING: Be sure not to use single quotes in there, as some shells,
++# such as our DU 5.0 friend, will then `close' the trap.
++trap 'exit_status=$?
++  # Save into config.log some information that might help in debugging.
++  {
++    echo
++
++    cat <<\_ASBOX
++## ---------------- ##
++## Cache variables. ##
++## ---------------- ##
++_ASBOX
++    echo
++    # The following way of writing the cache mishandles newlines in values,
++{
++  (set) 2>&1 |
++    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
++    *ac_space=\ *)
++      sed -n \
++	"s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
++	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
++      ;;
++    *)
++      sed -n \
++	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
++      ;;
++    esac;
++}
++    echo
++
++    cat <<\_ASBOX
++## ----------------- ##
++## Output variables. ##
++## ----------------- ##
++_ASBOX
++    echo
++    for ac_var in $ac_subst_vars
++    do
++      eval ac_val=$`echo $ac_var`
++      echo "$ac_var='"'"'$ac_val'"'"'"
++    done | sort
++    echo
++
++    if test -n "$ac_subst_files"; then
++      cat <<\_ASBOX
++## ------------- ##
++## Output files. ##
++## ------------- ##
++_ASBOX
++      echo
++      for ac_var in $ac_subst_files
++      do
++	eval ac_val=$`echo $ac_var`
++	echo "$ac_var='"'"'$ac_val'"'"'"
++      done | sort
++      echo
++    fi
++
++    if test -s confdefs.h; then
++      cat <<\_ASBOX
++## ----------- ##
++## confdefs.h. ##
++## ----------- ##
++_ASBOX
++      echo
++      sed "/^$/d" confdefs.h | sort
++      echo
++    fi
++    test "$ac_signal" != 0 &&
++      echo "$as_me: caught signal $ac_signal"
++    echo "$as_me: exit $exit_status"
++  } >&5
++  rm -f core *.core &&
++  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
++    exit $exit_status
++     ' 0
++for ac_signal in 1 2 13 15; do
++  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
++done
++ac_signal=0
++
++# confdefs.h avoids OS command line length limits that DEFS can exceed.
++rm -rf conftest* confdefs.h
++# AIX cpp loses on an empty file, so make sure it contains at least a newline.
++echo >confdefs.h
++
++# Predefined preprocessor variables.
++
++cat >>confdefs.h <<_ACEOF
++#define PACKAGE_NAME "$PACKAGE_NAME"
++_ACEOF
++
++
++cat >>confdefs.h <<_ACEOF
++#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
++_ACEOF
++
++
++cat >>confdefs.h <<_ACEOF
++#define PACKAGE_VERSION "$PACKAGE_VERSION"
++_ACEOF
++
++
++cat >>confdefs.h <<_ACEOF
++#define PACKAGE_STRING "$PACKAGE_STRING"
++_ACEOF
++
++
++cat >>confdefs.h <<_ACEOF
++#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
++_ACEOF
++
++
++# Let the site file select an alternate cache file if it wants to.
++# Prefer explicitly selected file to automatically selected ones.
++if test -z "$CONFIG_SITE"; then
++  if test "x$prefix" != xNONE; then
++    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
++  else
++    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
++  fi
++fi
++for ac_site_file in $CONFIG_SITE; do
++  if test -r "$ac_site_file"; then
++    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
++echo "$as_me: loading site script $ac_site_file" >&6;}
++    sed 's/^/| /' "$ac_site_file" >&5
++    . "$ac_site_file"
++  fi
++done
++
++if test -r "$cache_file"; then
++  # Some versions of bash will fail to source /dev/null (special
++  # files actually), so we avoid doing that.
++  if test -f "$cache_file"; then
++    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
++echo "$as_me: loading cache $cache_file" >&6;}
++    case $cache_file in
++      [\\/]* | ?:[\\/]* ) . $cache_file;;
++      *)                      . ./$cache_file;;
++    esac
++  fi
++else
++  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
++echo "$as_me: creating cache $cache_file" >&6;}
++  >$cache_file
++fi
++
++# Check that the precious variables saved in the cache have kept the same
++# value.
++ac_cache_corrupted=false
++for ac_var in `(set) 2>&1 |
++	       sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
++  eval ac_old_set=\$ac_cv_env_${ac_var}_set
++  eval ac_new_set=\$ac_env_${ac_var}_set
++  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
++  eval ac_new_val="\$ac_env_${ac_var}_value"
++  case $ac_old_set,$ac_new_set in
++    set,)
++      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
++echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
++      ac_cache_corrupted=: ;;
++    ,set)
++      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
++echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
++      ac_cache_corrupted=: ;;
++    ,);;
++    *)
++      if test "x$ac_old_val" != "x$ac_new_val"; then
++	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
++echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
++	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
++echo "$as_me:   former value:  $ac_old_val" >&2;}
++	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
++echo "$as_me:   current value: $ac_new_val" >&2;}
++	ac_cache_corrupted=:
++      fi;;
++  esac
++  # Pass precious variables to config.status.
++  if test "$ac_new_set" = set; then
++    case $ac_new_val in
++    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
++      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
++    *) ac_arg=$ac_var=$ac_new_val ;;
++    esac
++    case " $ac_configure_args " in
++      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
++      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
++    esac
++  fi
++done
++if $ac_cache_corrupted; then
++  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
++echo "$as_me: error: changes in the environment can compromise the build" >&2;}
++  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
++echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
++   { (exit 1); exit 1; }; }
++fi
++
++ac_ext=c
++ac_cpp='$CPP $CPPFLAGS'
++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
++ac_compiler_gnu=$ac_cv_c_compiler_gnu
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++am__api_version="1.9"
++ac_aux_dir=
++for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
++  if test -f $ac_dir/install-sh; then
++    ac_aux_dir=$ac_dir
++    ac_install_sh="$ac_aux_dir/install-sh -c"
++    break
++  elif test -f $ac_dir/install.sh; then
++    ac_aux_dir=$ac_dir
++    ac_install_sh="$ac_aux_dir/install.sh -c"
++    break
++  elif test -f $ac_dir/shtool; then
++    ac_aux_dir=$ac_dir
++    ac_install_sh="$ac_aux_dir/shtool install -c"
++    break
++  fi
++done
++if test -z "$ac_aux_dir"; then
++  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
++echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
++   { (exit 1); exit 1; }; }
++fi
++ac_config_guess="$SHELL $ac_aux_dir/config.guess"
++ac_config_sub="$SHELL $ac_aux_dir/config.sub"
++ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
++
++# Find a good install program.  We prefer a C program (faster),
++# so one script is as good as another.  But avoid the broken or
++# incompatible versions:
++# SysV /etc/install, /usr/sbin/install
++# SunOS /usr/etc/install
++# IRIX /sbin/install
++# AIX /bin/install
++# AmigaOS /C/install, which installs bootblocks on floppy discs
++# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
++# AFS /usr/afsws/bin/install, which mishandles nonexistent args
++# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
++# OS/2's system install, which has a completely different semantic
++# ./install, which can be erroneously created by make from ./install.sh.
++echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
++echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
++if test -z "$INSTALL"; then
++if test "${ac_cv_path_install+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++  # Account for people who put trailing slashes in PATH elements.
++case $as_dir/ in
++  ./ | .// | /cC/* | \
++  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
++  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
++  /usr/ucb/* ) ;;
++  *)
++    # OSF1 and SCO ODT 3.0 have their own names for install.
++    # Don't use installbsd from OSF since it installs stuff as root
++    # by default.
++    for ac_prog in ginstall scoinst install; do
++      for ac_exec_ext in '' $ac_executable_extensions; do
++	if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
++	  if test $ac_prog = install &&
++	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
++	    # AIX install.  It has an incompatible calling convention.
++	    :
++	  elif test $ac_prog = install &&
++	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
++	    # program-specific install script used by HP pwplus--don't use.
++	    :
++	  else
++	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
++	    break 3
++	  fi
++	fi
++      done
++    done
++    ;;
++esac
++done
++
++
++fi
++  if test "${ac_cv_path_install+set}" = set; then
++    INSTALL=$ac_cv_path_install
++  else
++    # As a last resort, use the slow shell script.  We don't cache a
++    # path for INSTALL within a source directory, because that will
++    # break other packages using the cache if that directory is
++    # removed, or if the path is relative.
++    INSTALL=$ac_install_sh
++  fi
++fi
++echo "$as_me:$LINENO: result: $INSTALL" >&5
++echo "${ECHO_T}$INSTALL" >&6
++
++# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
++# It thinks the first close brace ends the variable substitution.
++test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
++
++test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
++
++test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
++
++echo "$as_me:$LINENO: checking whether build environment is sane" >&5
++echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
++# Just in case
++sleep 1
++echo timestamp > conftest.file
++# Do `set' in a subshell so we don't clobber the current shell's
++# arguments.  Must try -L first in case configure is actually a
++# symlink; some systems play weird games with the mod time of symlinks
++# (eg FreeBSD returns the mod time of the symlink's containing
++# directory).
++if (
++   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
++   if test "$*" = "X"; then
++      # -L didn't work.
++      set X `ls -t $srcdir/configure conftest.file`
++   fi
++   rm -f conftest.file
++   if test "$*" != "X $srcdir/configure conftest.file" \
++      && test "$*" != "X conftest.file $srcdir/configure"; then
++
++      # If neither matched, then we have a broken ls.  This can happen
++      # if, for instance, CONFIG_SHELL is bash and it inherits a
++      # broken ls alias from the environment.  This has actually
++      # happened.  Such a system could not be considered "sane".
++      { { echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
++alias in your environment" >&5
++echo "$as_me: error: ls -t appears to fail.  Make sure there is not a broken
++alias in your environment" >&2;}
++   { (exit 1); exit 1; }; }
++   fi
++
++   test "$2" = conftest.file
++   )
++then
++   # Ok.
++   :
++else
++   { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
++Check your system clock" >&5
++echo "$as_me: error: newly created file is older than distributed files!
++Check your system clock" >&2;}
++   { (exit 1); exit 1; }; }
++fi
++echo "$as_me:$LINENO: result: yes" >&5
++echo "${ECHO_T}yes" >&6
++test "$program_prefix" != NONE &&
++  program_transform_name="s,^,$program_prefix,;$program_transform_name"
++# Use a double $ so make ignores it.
++test "$program_suffix" != NONE &&
++  program_transform_name="s,\$,$program_suffix,;$program_transform_name"
++# Double any \ or $.  echo might interpret backslashes.
++# By default was `s,x,x', remove it if useless.
++cat <<\_ACEOF >conftest.sed
++s/[\\$]/&&/g;s/;s,x,x,$//
++_ACEOF
++program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
++rm conftest.sed
++
++# expand $ac_aux_dir to an absolute path
++am_aux_dir=`cd $ac_aux_dir && pwd`
++
++test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
++# Use eval to expand $SHELL
++if eval "$MISSING --run true"; then
++  am_missing_run="$MISSING --run "
++else
++  am_missing_run=
++  { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
++echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
++fi
++
++if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
++  # We used to keeping the `.' as first argument, in order to
++  # allow $(mkdir_p) to be used without argument.  As in
++  #   $(mkdir_p) $(somedir)
++  # where $(somedir) is conditionally defined.  However this is wrong
++  # for two reasons:
++  #  1. if the package is installed by a user who cannot write `.'
++  #     make install will fail,
++  #  2. the above comment should most certainly read
++  #     $(mkdir_p) $(DESTDIR)$(somedir)
++  #     so it does not work when $(somedir) is undefined and
++  #     $(DESTDIR) is not.
++  #  To support the latter case, we have to write
++  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
++  #  so the `.' trick is pointless.
++  mkdir_p='mkdir -p --'
++else
++  # On NextStep and OpenStep, the `mkdir' command does not
++  # recognize any option.  It will interpret all options as
++  # directories to create, and then abort because `.' already
++  # exists.
++  for d in ./-p ./--version;
++  do
++    test -d $d && rmdir $d
++  done
++  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
++  if test -f "$ac_aux_dir/mkinstalldirs"; then
++    mkdir_p='$(mkinstalldirs)'
++  else
++    mkdir_p='$(install_sh) -d'
++  fi
++fi
++
++for ac_prog in gawk mawk nawk awk
++do
++  # Extract the first word of "$ac_prog", so it can be a program name with args.
++set dummy $ac_prog; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_AWK+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  if test -n "$AWK"; then
++  ac_cv_prog_AWK="$AWK" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++  for ac_exec_ext in '' $ac_executable_extensions; do
++  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++    ac_cv_prog_AWK="$ac_prog"
++    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++done
++
++fi
++fi
++AWK=$ac_cv_prog_AWK
++if test -n "$AWK"; then
++  echo "$as_me:$LINENO: result: $AWK" >&5
++echo "${ECHO_T}$AWK" >&6
++else
++  echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++  test -n "$AWK" && break
++done
++
++echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
++echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
++set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
++if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  cat >conftest.make <<\_ACEOF
++all:
++	@echo 'ac_maketemp="$(MAKE)"'
++_ACEOF
++# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
++eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
++if test -n "$ac_maketemp"; then
++  eval ac_cv_prog_make_${ac_make}_set=yes
++else
++  eval ac_cv_prog_make_${ac_make}_set=no
++fi
++rm -f conftest.make
++fi
++if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
++  echo "$as_me:$LINENO: result: yes" >&5
++echo "${ECHO_T}yes" >&6
++  SET_MAKE=
++else
++  echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++  SET_MAKE="MAKE=${MAKE-make}"
++fi
++
++rm -rf .tst 2>/dev/null
++mkdir .tst 2>/dev/null
++if test -d .tst; then
++  am__leading_dot=.
++else
++  am__leading_dot=_
++fi
++rmdir .tst 2>/dev/null
++
++# test to see if srcdir already configured
++if test "`cd $srcdir && pwd`" != "`pwd`" &&
++   test -f $srcdir/config.status; then
++  { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
++echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
++   { (exit 1); exit 1; }; }
++fi
++
++# test whether we have cygpath
++if test -z "$CYGPATH_W"; then
++  if (cygpath --version) >/dev/null 2>/dev/null; then
++    CYGPATH_W='cygpath -w'
++  else
++    CYGPATH_W=echo
++  fi
++fi
++
++
++# Define the identity of the package.
++ PACKAGE=$PACKAGE
++ VERSION=$VERSION
++
++
++cat >>confdefs.h <<_ACEOF
++#define PACKAGE "$PACKAGE"
++_ACEOF
++
++
++cat >>confdefs.h <<_ACEOF
++#define VERSION "$VERSION"
++_ACEOF
++
++# Some tools Automake needs.
++
++ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
++
++
++AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
++
++
++AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
++
++
++AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
++
++
++MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
++
++install_sh=${install_sh-"$am_aux_dir/install-sh"}
++
++# Installed binaries are usually stripped using `strip' when the user
++# run `make install-strip'.  However `strip' might not be the right
++# tool to use in cross-compilation environments, therefore Automake
++# will honor the `STRIP' environment variable to overrule this program.
++if test "$cross_compiling" != no; then
++  if test -n "$ac_tool_prefix"; then
++  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
++set dummy ${ac_tool_prefix}strip; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_STRIP+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  if test -n "$STRIP"; then
++  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++  for ac_exec_ext in '' $ac_executable_extensions; do
++  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
++    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++done
++
++fi
++fi
++STRIP=$ac_cv_prog_STRIP
++if test -n "$STRIP"; then
++  echo "$as_me:$LINENO: result: $STRIP" >&5
++echo "${ECHO_T}$STRIP" >&6
++else
++  echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++fi
++if test -z "$ac_cv_prog_STRIP"; then
++  ac_ct_STRIP=$STRIP
++  # Extract the first word of "strip", so it can be a program name with args.
++set dummy strip; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  if test -n "$ac_ct_STRIP"; then
++  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++  for ac_exec_ext in '' $ac_executable_extensions; do
++  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++    ac_cv_prog_ac_ct_STRIP="strip"
++    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++done
++
++  test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
++fi
++fi
++ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
++if test -n "$ac_ct_STRIP"; then
++  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
++echo "${ECHO_T}$ac_ct_STRIP" >&6
++else
++  echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++  STRIP=$ac_ct_STRIP
++else
++  STRIP="$ac_cv_prog_STRIP"
++fi
++
++fi
++INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
++
++# We need awk for the "check" target.  The system "awk" is bad on
++# some platforms.
++# Always define AMTAR for backward compatibility.
++
++AMTAR=${AMTAR-"${am_missing_run}tar"}
++
++am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
++
++
++
++
++
++          ac_config_headers="$ac_config_headers config.h"
++
++for ac_prog in bash
++do
++  # Extract the first word of "$ac_prog", so it can be a program name with args.
++set dummy $ac_prog; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_path_BASH+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  case $BASH in
++  [\\/]* | ?:[\\/]*)
++  ac_cv_path_BASH="$BASH" # Let the user override the test with a path.
++  ;;
++  *)
++  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++  for ac_exec_ext in '' $ac_executable_extensions; do
++  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++    ac_cv_path_BASH="$as_dir/$ac_word$ac_exec_ext"
++    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++done
++
++  ;;
++esac
++fi
++BASH=$ac_cv_path_BASH
++
++if test -n "$BASH"; then
++  echo "$as_me:$LINENO: result: $BASH" >&5
++echo "${ECHO_T}$BASH" >&6
++else
++  echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++  test -n "$BASH" && break
++done
++
++
++ac_ext=c
++ac_cpp='$CPP $CPPFLAGS'
++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
++ac_compiler_gnu=$ac_cv_c_compiler_gnu
++if test -n "$ac_tool_prefix"; then
++  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
++set dummy ${ac_tool_prefix}gcc; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_CC+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  if test -n "$CC"; then
++  ac_cv_prog_CC="$CC" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++  for ac_exec_ext in '' $ac_executable_extensions; do
++  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++    ac_cv_prog_CC="${ac_tool_prefix}gcc"
++    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++done
++
++fi
++fi
++CC=$ac_cv_prog_CC
++if test -n "$CC"; then
++  echo "$as_me:$LINENO: result: $CC" >&5
++echo "${ECHO_T}$CC" >&6
++else
++  echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++fi
++if test -z "$ac_cv_prog_CC"; then
++  ac_ct_CC=$CC
++  # Extract the first word of "gcc", so it can be a program name with args.
++set dummy gcc; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  if test -n "$ac_ct_CC"; then
++  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++  for ac_exec_ext in '' $ac_executable_extensions; do
++  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++    ac_cv_prog_ac_ct_CC="gcc"
++    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++done
++
++fi
++fi
++ac_ct_CC=$ac_cv_prog_ac_ct_CC
++if test -n "$ac_ct_CC"; then
++  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
++echo "${ECHO_T}$ac_ct_CC" >&6
++else
++  echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++  CC=$ac_ct_CC
++else
++  CC="$ac_cv_prog_CC"
++fi
++
++if test -z "$CC"; then
++  if test -n "$ac_tool_prefix"; then
++  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
++set dummy ${ac_tool_prefix}cc; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_CC+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  if test -n "$CC"; then
++  ac_cv_prog_CC="$CC" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++  for ac_exec_ext in '' $ac_executable_extensions; do
++  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++    ac_cv_prog_CC="${ac_tool_prefix}cc"
++    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++done
++
++fi
++fi
++CC=$ac_cv_prog_CC
++if test -n "$CC"; then
++  echo "$as_me:$LINENO: result: $CC" >&5
++echo "${ECHO_T}$CC" >&6
++else
++  echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++fi
++if test -z "$ac_cv_prog_CC"; then
++  ac_ct_CC=$CC
++  # Extract the first word of "cc", so it can be a program name with args.
++set dummy cc; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  if test -n "$ac_ct_CC"; then
++  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++  for ac_exec_ext in '' $ac_executable_extensions; do
++  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++    ac_cv_prog_ac_ct_CC="cc"
++    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++done
++
++fi
++fi
++ac_ct_CC=$ac_cv_prog_ac_ct_CC
++if test -n "$ac_ct_CC"; then
++  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
++echo "${ECHO_T}$ac_ct_CC" >&6
++else
++  echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++  CC=$ac_ct_CC
++else
++  CC="$ac_cv_prog_CC"
++fi
++
++fi
++if test -z "$CC"; then
++  # Extract the first word of "cc", so it can be a program name with args.
++set dummy cc; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_CC+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  if test -n "$CC"; then
++  ac_cv_prog_CC="$CC" # Let the user override the test.
++else
++  ac_prog_rejected=no
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++  for ac_exec_ext in '' $ac_executable_extensions; do
++  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
++       ac_prog_rejected=yes
++       continue
++     fi
++    ac_cv_prog_CC="cc"
++    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++done
++
++if test $ac_prog_rejected = yes; then
++  # We found a bogon in the path, so make sure we never use it.
++  set dummy $ac_cv_prog_CC
++  shift
++  if test $# != 0; then
++    # We chose a different compiler from the bogus one.
++    # However, it has the same basename, so the bogon will be chosen
++    # first if we set CC to just the basename; use the full file name.
++    shift
++    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
++  fi
++fi
++fi
++fi
++CC=$ac_cv_prog_CC
++if test -n "$CC"; then
++  echo "$as_me:$LINENO: result: $CC" >&5
++echo "${ECHO_T}$CC" >&6
++else
++  echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++fi
++if test -z "$CC"; then
++  if test -n "$ac_tool_prefix"; then
++  for ac_prog in cl
++  do
++    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
++set dummy $ac_tool_prefix$ac_prog; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_CC+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  if test -n "$CC"; then
++  ac_cv_prog_CC="$CC" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++  for ac_exec_ext in '' $ac_executable_extensions; do
++  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
++    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++done
++
++fi
++fi
++CC=$ac_cv_prog_CC
++if test -n "$CC"; then
++  echo "$as_me:$LINENO: result: $CC" >&5
++echo "${ECHO_T}$CC" >&6
++else
++  echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++    test -n "$CC" && break
++  done
++fi
++if test -z "$CC"; then
++  ac_ct_CC=$CC
++  for ac_prog in cl
++do
++  # Extract the first word of "$ac_prog", so it can be a program name with args.
++set dummy $ac_prog; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  if test -n "$ac_ct_CC"; then
++  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++  for ac_exec_ext in '' $ac_executable_extensions; do
++  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++    ac_cv_prog_ac_ct_CC="$ac_prog"
++    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++done
++
++fi
++fi
++ac_ct_CC=$ac_cv_prog_ac_ct_CC
++if test -n "$ac_ct_CC"; then
++  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
++echo "${ECHO_T}$ac_ct_CC" >&6
++else
++  echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++  test -n "$ac_ct_CC" && break
++done
++
++  CC=$ac_ct_CC
++fi
++
++fi
++
++
++test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
++See \`config.log' for more details." >&5
++echo "$as_me: error: no acceptable C compiler found in \$PATH
++See \`config.log' for more details." >&2;}
++   { (exit 1); exit 1; }; }
++
++# Provide some information about the compiler.
++echo "$as_me:$LINENO:" \
++     "checking for C compiler version" >&5
++ac_compiler=`set X $ac_compile; echo $2`
++{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
++  (eval $ac_compiler --version </dev/null >&5) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }
++{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
++  (eval $ac_compiler -v </dev/null >&5) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }
++{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
++  (eval $ac_compiler -V </dev/null >&5) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }
++
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++
++int
++main ()
++{
++
++  ;
++  return 0;
++}
++_ACEOF
++ac_clean_files_save=$ac_clean_files
++ac_clean_files="$ac_clean_files a.out a.exe b.out"
++# Try to create an executable without -o first, disregard a.out.
++# It will help us diagnose broken compilers, and finding out an intuition
++# of exeext.
++echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
++echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
++ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
++if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
++  (eval $ac_link_default) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; then
++  # Find the output, starting from the most likely.  This scheme is
++# not robust to junk in `.', hence go to wildcards (a.*) only as a last
++# resort.
++
++# Be careful to initialize this variable, since it used to be cached.
++# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
++ac_cv_exeext=
++# b.out is created by i960 compilers.
++for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
++do
++  test -f "$ac_file" || continue
++  case $ac_file in
++    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
++	;;
++    conftest.$ac_ext )
++	# This is the source file.
++	;;
++    [ab].out )
++	# We found the default executable, but exeext='' is most
++	# certainly right.
++	break;;
++    *.* )
++	ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
++	# FIXME: I believe we export ac_cv_exeext for Libtool,
++	# but it would be cool to find out if it's true.  Does anybody
++	# maintain Libtool? --akim.
++	export ac_cv_exeext
++	break;;
++    * )
++	break;;
++  esac
++done
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
++See \`config.log' for more details." >&5
++echo "$as_me: error: C compiler cannot create executables
++See \`config.log' for more details." >&2;}
++   { (exit 77); exit 77; }; }
++fi
++
++ac_exeext=$ac_cv_exeext
++echo "$as_me:$LINENO: result: $ac_file" >&5
++echo "${ECHO_T}$ac_file" >&6
++
++# Check the compiler produces executables we can run.  If not, either
++# the compiler is broken, or we cross compile.
++echo "$as_me:$LINENO: checking whether the C compiler works" >&5
++echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
++# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
++# If not cross compiling, check that we can run a simple program.
++if test "$cross_compiling" != yes; then
++  if { ac_try='./$ac_file'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++    cross_compiling=no
++  else
++    if test "$cross_compiling" = maybe; then
++	cross_compiling=yes
++    else
++	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
++If you meant to cross compile, use \`--host'.
++See \`config.log' for more details." >&5
++echo "$as_me: error: cannot run C compiled programs.
++If you meant to cross compile, use \`--host'.
++See \`config.log' for more details." >&2;}
++   { (exit 1); exit 1; }; }
++    fi
++  fi
++fi
++echo "$as_me:$LINENO: result: yes" >&5
++echo "${ECHO_T}yes" >&6
++
++rm -f a.out a.exe conftest$ac_cv_exeext b.out
++ac_clean_files=$ac_clean_files_save
++# Check the compiler produces executables we can run.  If not, either
++# the compiler is broken, or we cross compile.
++echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
++echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
++echo "$as_me:$LINENO: result: $cross_compiling" >&5
++echo "${ECHO_T}$cross_compiling" >&6
++
++echo "$as_me:$LINENO: checking for suffix of executables" >&5
++echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++  (eval $ac_link) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; then
++  # If both `conftest.exe' and `conftest' are `present' (well, observable)
++# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
++# work properly (i.e., refer to `conftest.exe'), while it won't with
++# `rm'.
++for ac_file in conftest.exe conftest conftest.*; do
++  test -f "$ac_file" || continue
++  case $ac_file in
++    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
++    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
++	  export ac_cv_exeext
++	  break;;
++    * ) break;;
++  esac
++done
++else
++  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
++See \`config.log' for more details." >&5
++echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
++See \`config.log' for more details." >&2;}
++   { (exit 1); exit 1; }; }
++fi
++
++rm -f conftest$ac_cv_exeext
++echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
++echo "${ECHO_T}$ac_cv_exeext" >&6
++
++rm -f conftest.$ac_ext
++EXEEXT=$ac_cv_exeext
++ac_exeext=$EXEEXT
++echo "$as_me:$LINENO: checking for suffix of object files" >&5
++echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
++if test "${ac_cv_objext+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++
++int
++main ()
++{
++
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.o conftest.obj
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; then
++  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
++  case $ac_file in
++    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
++    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
++       break;;
++  esac
++done
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
++See \`config.log' for more details." >&5
++echo "$as_me: error: cannot compute suffix of object files: cannot compile
++See \`config.log' for more details." >&2;}
++   { (exit 1); exit 1; }; }
++fi
++
++rm -f conftest.$ac_cv_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
++echo "${ECHO_T}$ac_cv_objext" >&6
++OBJEXT=$ac_cv_objext
++ac_objext=$OBJEXT
++echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
++echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
++if test "${ac_cv_c_compiler_gnu+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++
++int
++main ()
++{
++#ifndef __GNUC__
++       choke me
++#endif
++
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"
++			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  ac_compiler_gnu=yes
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_compiler_gnu=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++ac_cv_c_compiler_gnu=$ac_compiler_gnu
++
++fi
++echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
++echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
++GCC=`test $ac_compiler_gnu = yes && echo yes`
++ac_test_CFLAGS=${CFLAGS+set}
++ac_save_CFLAGS=$CFLAGS
++CFLAGS="-g"
++echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
++echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
++if test "${ac_cv_prog_cc_g+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++
++int
++main ()
++{
++
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"
++			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  ac_cv_prog_cc_g=yes
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_prog_cc_g=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
++echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
++if test "$ac_test_CFLAGS" = set; then
++  CFLAGS=$ac_save_CFLAGS
++elif test $ac_cv_prog_cc_g = yes; then
++  if test "$GCC" = yes; then
++    CFLAGS="-g -O2"
++  else
++    CFLAGS="-g"
++  fi
++else
++  if test "$GCC" = yes; then
++    CFLAGS="-O2"
++  else
++    CFLAGS=
++  fi
++fi
++echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
++echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
++if test "${ac_cv_prog_cc_stdc+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  ac_cv_prog_cc_stdc=no
++ac_save_CC=$CC
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++#include <stdarg.h>
++#include <stdio.h>
++#include <sys/types.h>
++#include <sys/stat.h>
++/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
++struct buf { int x; };
++FILE * (*rcsopen) (struct buf *, struct stat *, int);
++static char *e (p, i)
++     char **p;
++     int i;
++{
++  return p[i];
++}
++static char *f (char * (*g) (char **, int), char **p, ...)
++{
++  char *s;
++  va_list v;
++  va_start (v,p);
++  s = g (p, va_arg (v,int));
++  va_end (v);
++  return s;
++}
++
++/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
++   function prototypes and stuff, but not '\xHH' hex character constants.
++   These don't provoke an error unfortunately, instead are silently treated
++   as 'x'.  The following induces an error, until -std1 is added to get
++   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
++   array size at least.  It's necessary to write '\x00'==0 to get something
++   that's true only with -std1.  */
++int osf4_cc_array ['\x00' == 0 ? 1 : -1];
++
++int test (int i, double x);
++struct s1 {int (*f) (int a);};
++struct s2 {int (*f) (double a);};
++int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
++int argc;
++char **argv;
++int
++main ()
++{
++return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
++  ;
++  return 0;
++}
++_ACEOF
++# Don't try gcc -ansi; that turns off useful extensions and
++# breaks some systems' header files.
++# AIX			-qlanglvl=ansi
++# Ultrix and OSF/1	-std1
++# HP-UX 10.20 and later	-Ae
++# HP-UX older versions	-Aa -D_HPUX_SOURCE
++# SVR4			-Xc -D__EXTENSIONS__
++for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
++do
++  CC="$ac_save_CC $ac_arg"
++  rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"
++			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  ac_cv_prog_cc_stdc=$ac_arg
++break
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++fi
++rm -f conftest.err conftest.$ac_objext
++done
++rm -f conftest.$ac_ext conftest.$ac_objext
++CC=$ac_save_CC
++
++fi
++
++case "x$ac_cv_prog_cc_stdc" in
++  x|xno)
++    echo "$as_me:$LINENO: result: none needed" >&5
++echo "${ECHO_T}none needed" >&6 ;;
++  *)
++    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
++echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
++    CC="$CC $ac_cv_prog_cc_stdc" ;;
++esac
++
++# Some people use a C++ compiler to compile C.  Since we use `exit',
++# in C++ we need to declare it.  In case someone uses the same compiler
++# for both compiling C and C++ we need to have the C++ compiler decide
++# the declaration of exit, since it's the most demanding environment.
++cat >conftest.$ac_ext <<_ACEOF
++#ifndef __cplusplus
++  choke me
++#endif
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"
++			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  for ac_declaration in \
++   '' \
++   'extern "C" void std::exit (int) throw (); using std::exit;' \
++   'extern "C" void std::exit (int); using std::exit;' \
++   'extern "C" void exit (int) throw ();' \
++   'extern "C" void exit (int);' \
++   'void exit (int);'
++do
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++$ac_declaration
++#include <stdlib.h>
++int
++main ()
++{
++exit (42);
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"
++			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  :
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++continue
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++$ac_declaration
++int
++main ()
++{
++exit (42);
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"
++			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  break
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++done
++rm -f conftest*
++if test -n "$ac_declaration"; then
++  echo '#ifdef __cplusplus' >>confdefs.h
++  echo $ac_declaration      >>confdefs.h
++  echo '#endif'             >>confdefs.h
++fi
++
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++ac_ext=c
++ac_cpp='$CPP $CPPFLAGS'
++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
++ac_compiler_gnu=$ac_cv_c_compiler_gnu
++DEPDIR="${am__leading_dot}deps"
++
++          ac_config_commands="$ac_config_commands depfiles"
++
++
++am_make=${MAKE-make}
++cat > confinc << 'END'
++am__doit:
++	@echo done
++.PHONY: am__doit
++END
++# If we don't find an include directive, just comment out the code.
++echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
++echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
++am__include="#"
++am__quote=
++_am_result=none
++# First try GNU make style include.
++echo "include confinc" > confmf
++# We grep out `Entering directory' and `Leaving directory'
++# messages which can occur if `w' ends up in MAKEFLAGS.
++# In particular we don't look at `^make:' because GNU make might
++# be invoked under some other name (usually "gmake"), in which
++# case it prints its new name instead of `make'.
++if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
++   am__include=include
++   am__quote=
++   _am_result=GNU
++fi
++# Now try BSD make style include.
++if test "$am__include" = "#"; then
++   echo '.include "confinc"' > confmf
++   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
++      am__include=.include
++      am__quote="\""
++      _am_result=BSD
++   fi
++fi
++
++
++echo "$as_me:$LINENO: result: $_am_result" >&5
++echo "${ECHO_T}$_am_result" >&6
++rm -f confinc confmf
++
++# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
++if test "${enable_dependency_tracking+set}" = set; then
++  enableval="$enable_dependency_tracking"
++
++fi;
++if test "x$enable_dependency_tracking" != xno; then
++  am_depcomp="$ac_aux_dir/depcomp"
++  AMDEPBACKSLASH='\'
++fi
++
++
++if test "x$enable_dependency_tracking" != xno; then
++  AMDEP_TRUE=
++  AMDEP_FALSE='#'
++else
++  AMDEP_TRUE='#'
++  AMDEP_FALSE=
++fi
++
++
++
++
++depcc="$CC"   am_compiler_list=
++
++echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
++echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
++if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
++  # We make a subdir and do the tests there.  Otherwise we can end up
++  # making bogus files that we don't know about and never remove.  For
++  # instance it was reported that on HP-UX the gcc test will end up
++  # making a dummy file named `D' -- because `-MD' means `put the output
++  # in D'.
++  mkdir conftest.dir
++  # Copy depcomp to subdir because otherwise we won't find it if we're
++  # using a relative directory.
++  cp "$am_depcomp" conftest.dir
++  cd conftest.dir
++  # We will build objects and dependencies in a subdirectory because
++  # it helps to detect inapplicable dependency modes.  For instance
++  # both Tru64's cc and ICC support -MD to output dependencies as a
++  # side effect of compilation, but ICC will put the dependencies in
++  # the current directory while Tru64 will put them in the object
++  # directory.
++  mkdir sub
++
++  am_cv_CC_dependencies_compiler_type=none
++  if test "$am_compiler_list" = ""; then
++     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
++  fi
++  for depmode in $am_compiler_list; do
++    # Setup a source with many dependencies, because some compilers
++    # like to wrap large dependency lists on column 80 (with \), and
++    # we should not choose a depcomp mode which is confused by this.
++    #
++    # We need to recreate these files for each test, as the compiler may
++    # overwrite some of them when testing with obscure command lines.
++    # This happens at least with the AIX C compiler.
++    : > sub/conftest.c
++    for i in 1 2 3 4 5 6; do
++      echo '#include "conftst'$i'.h"' >> sub/conftest.c
++      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
++      # Solaris 8's {/usr,}/bin/sh.
++      touch sub/conftst$i.h
++    done
++    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
++
++    case $depmode in
++    nosideeffect)
++      # after this tag, mechanisms are not by side-effect, so they'll
++      # only be used when explicitly requested
++      if test "x$enable_dependency_tracking" = xyes; then
++	continue
++      else
++	break
++      fi
++      ;;
++    none) break ;;
++    esac
++    # We check with `-c' and `-o' for the sake of the "dashmstdout"
++    # mode.  It turns out that the SunPro C++ compiler does not properly
++    # handle `-M -o', and we need to detect this.
++    if depmode=$depmode \
++       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
++       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
++       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
++         >/dev/null 2>conftest.err &&
++       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
++       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
++       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
++      # icc doesn't choke on unknown options, it will just issue warnings
++      # or remarks (even with -Werror).  So we grep stderr for any message
++      # that says an option was ignored or not supported.
++      # When given -MP, icc 7.0 and 7.1 complain thusly:
++      #   icc: Command line warning: ignoring option '-M'; no argument required
++      # The diagnosis changed in icc 8.0:
++      #   icc: Command line remark: option '-MP' not supported
++      if (grep 'ignoring option' conftest.err ||
++          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
++        am_cv_CC_dependencies_compiler_type=$depmode
++        break
++      fi
++    fi
++  done
++
++  cd ..
++  rm -rf conftest.dir
++else
++  am_cv_CC_dependencies_compiler_type=none
++fi
++
++fi
++echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
++echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
++CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
++
++
++
++if
++  test "x$enable_dependency_tracking" != xno \
++  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
++  am__fastdepCC_TRUE=
++  am__fastdepCC_FALSE='#'
++else
++  am__fastdepCC_TRUE='#'
++  am__fastdepCC_FALSE=
++fi
++
++
++if test "x$CC" != xcc; then
++  echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5
++echo $ECHO_N "checking whether $CC and cc understand -c and -o together... $ECHO_C" >&6
++else
++  echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5
++echo $ECHO_N "checking whether cc understands -c and -o together... $ECHO_C" >&6
++fi
++set dummy $CC; ac_cc=`echo $2 |
++		      sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
++if eval "test \"\${ac_cv_prog_cc_${ac_cc}_c_o+set}\" = set"; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++
++int
++main ()
++{
++
++  ;
++  return 0;
++}
++_ACEOF
++# Make sure it works both with $CC and with simple cc.
++# We do the test twice because some compilers refuse to overwrite an
++# existing .o file with -o, though they will create one.
++ac_try='$CC -c conftest.$ac_ext -o conftest.$ac_objext >&5'
++if { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++   test -f conftest.$ac_objext && { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); };
++then
++  eval ac_cv_prog_cc_${ac_cc}_c_o=yes
++  if test "x$CC" != xcc; then
++    # Test first that cc exists at all.
++    if { ac_try='cc -c conftest.$ac_ext >&5'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++      ac_try='cc -c conftest.$ac_ext -o conftest.$ac_objext >&5'
++      if { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 test -f conftest.$ac_objext && { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); };
++      then
++	# cc works too.
++	:
++      else
++	# cc exists but doesn't like -o.
++	eval ac_cv_prog_cc_${ac_cc}_c_o=no
++      fi
++    fi
++  fi
++else
++  eval ac_cv_prog_cc_${ac_cc}_c_o=no
++fi
++rm -f conftest*
++
++fi
++if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then
++  echo "$as_me:$LINENO: result: yes" >&5
++echo "${ECHO_T}yes" >&6
++else
++  echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++
++cat >>confdefs.h <<\_ACEOF
++#define NO_MINUS_C_MINUS_O 1
++_ACEOF
++
++fi
++
++# FIXME: we rely on the cache variable name because
++# there is no other way.
++set dummy $CC
++ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
++if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
++   # Losing compiler, so override with the script.
++   # FIXME: It is wrong to rewrite CC.
++   # But if we don't then we get into trouble of one sort or another.
++   # A longer-term fix would be to have automake use am__CC in this case,
++   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
++   CC="$am_aux_dir/compile $CC"
++fi
++
++
++if test -n "$ac_tool_prefix"; then
++  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
++set dummy ${ac_tool_prefix}ranlib; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_RANLIB+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  if test -n "$RANLIB"; then
++  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++  for ac_exec_ext in '' $ac_executable_extensions; do
++  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
++    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++done
++
++fi
++fi
++RANLIB=$ac_cv_prog_RANLIB
++if test -n "$RANLIB"; then
++  echo "$as_me:$LINENO: result: $RANLIB" >&5
++echo "${ECHO_T}$RANLIB" >&6
++else
++  echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++fi
++if test -z "$ac_cv_prog_RANLIB"; then
++  ac_ct_RANLIB=$RANLIB
++  # Extract the first word of "ranlib", so it can be a program name with args.
++set dummy ranlib; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  if test -n "$ac_ct_RANLIB"; then
++  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++  for ac_exec_ext in '' $ac_executable_extensions; do
++  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++    ac_cv_prog_ac_ct_RANLIB="ranlib"
++    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++done
++
++  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
++fi
++fi
++ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
++if test -n "$ac_ct_RANLIB"; then
++  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
++echo "${ECHO_T}$ac_ct_RANLIB" >&6
++else
++  echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++  RANLIB=$ac_ct_RANLIB
++else
++  RANLIB="$ac_cv_prog_RANLIB"
++fi
++
++
++
++cat >>confdefs.h <<\_ACEOF
++#define _GNU_SOURCE 1
++_ACEOF
++
++
++# Find a good install program.  We prefer a C program (faster),
++# so one script is as good as another.  But avoid the broken or
++# incompatible versions:
++# SysV /etc/install, /usr/sbin/install
++# SunOS /usr/etc/install
++# IRIX /sbin/install
++# AIX /bin/install
++# AmigaOS /C/install, which installs bootblocks on floppy discs
++# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
++# AFS /usr/afsws/bin/install, which mishandles nonexistent args
++# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
++# OS/2's system install, which has a completely different semantic
++# ./install, which can be erroneously created by make from ./install.sh.
++echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
++echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
++if test -z "$INSTALL"; then
++if test "${ac_cv_path_install+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++  # Account for people who put trailing slashes in PATH elements.
++case $as_dir/ in
++  ./ | .// | /cC/* | \
++  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
++  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
++  /usr/ucb/* ) ;;
++  *)
++    # OSF1 and SCO ODT 3.0 have their own names for install.
++    # Don't use installbsd from OSF since it installs stuff as root
++    # by default.
++    for ac_prog in ginstall scoinst install; do
++      for ac_exec_ext in '' $ac_executable_extensions; do
++	if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
++	  if test $ac_prog = install &&
++	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
++	    # AIX install.  It has an incompatible calling convention.
++	    :
++	  elif test $ac_prog = install &&
++	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
++	    # program-specific install script used by HP pwplus--don't use.
++	    :
++	  else
++	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
++	    break 3
++	  fi
++	fi
++      done
++    done
++    ;;
++esac
++done
++
++
++fi
++  if test "${ac_cv_path_install+set}" = set; then
++    INSTALL=$ac_cv_path_install
++  else
++    # As a last resort, use the slow shell script.  We don't cache a
++    # path for INSTALL within a source directory, because that will
++    # break other packages using the cache if that directory is
++    # removed, or if the path is relative.
++    INSTALL=$ac_install_sh
++  fi
++fi
++echo "$as_me:$LINENO: result: $INSTALL" >&5
++echo "${ECHO_T}$INSTALL" >&6
++
++# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
++# It thinks the first close brace ends the variable substitution.
++test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
++
++test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
++
++test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
++
++
++ac_ext=c
++ac_cpp='$CPP $CPPFLAGS'
++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
++ac_compiler_gnu=$ac_cv_c_compiler_gnu
++echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
++echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
++# On Suns, sometimes $CPP names a directory.
++if test -n "$CPP" && test -d "$CPP"; then
++  CPP=
++fi
++if test -z "$CPP"; then
++  if test "${ac_cv_prog_CPP+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++      # Double quotes because CPP needs to be expanded
++    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
++    do
++      ac_preproc_ok=false
++for ac_c_preproc_warn_flag in '' yes
++do
++  # Use a header file that comes with gcc, so configuring glibc
++  # with a fresh cross-compiler works.
++  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
++  # <limits.h> exists even on freestanding compilers.
++  # On the NeXT, cc -E runs the code through the compiler's parser,
++  # not just through cpp. "Syntax error" is here to catch this case.
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++#ifdef __STDC__
++# include <limits.h>
++#else
++# include <assert.h>
++#endif
++		     Syntax error
++_ACEOF
++if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
++  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } >/dev/null; then
++  if test -s conftest.err; then
++    ac_cpp_err=$ac_c_preproc_warn_flag
++    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
++  else
++    ac_cpp_err=
++  fi
++else
++  ac_cpp_err=yes
++fi
++if test -z "$ac_cpp_err"; then
++  :
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++  # Broken: fails on valid input.
++continue
++fi
++rm -f conftest.err conftest.$ac_ext
++
++  # OK, works on sane cases.  Now check whether non-existent headers
++  # can be detected and how.
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++#include <ac_nonexistent.h>
++_ACEOF
++if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
++  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } >/dev/null; then
++  if test -s conftest.err; then
++    ac_cpp_err=$ac_c_preproc_warn_flag
++    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
++  else
++    ac_cpp_err=
++  fi
++else
++  ac_cpp_err=yes
++fi
++if test -z "$ac_cpp_err"; then
++  # Broken: success on invalid input.
++continue
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++  # Passes both tests.
++ac_preproc_ok=:
++break
++fi
++rm -f conftest.err conftest.$ac_ext
++
++done
++# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
++rm -f conftest.err conftest.$ac_ext
++if $ac_preproc_ok; then
++  break
++fi
++
++    done
++    ac_cv_prog_CPP=$CPP
++
++fi
++  CPP=$ac_cv_prog_CPP
++else
++  ac_cv_prog_CPP=$CPP
++fi
++echo "$as_me:$LINENO: result: $CPP" >&5
++echo "${ECHO_T}$CPP" >&6
++ac_preproc_ok=false
++for ac_c_preproc_warn_flag in '' yes
++do
++  # Use a header file that comes with gcc, so configuring glibc
++  # with a fresh cross-compiler works.
++  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
++  # <limits.h> exists even on freestanding compilers.
++  # On the NeXT, cc -E runs the code through the compiler's parser,
++  # not just through cpp. "Syntax error" is here to catch this case.
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++#ifdef __STDC__
++# include <limits.h>
++#else
++# include <assert.h>
++#endif
++		     Syntax error
++_ACEOF
++if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
++  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } >/dev/null; then
++  if test -s conftest.err; then
++    ac_cpp_err=$ac_c_preproc_warn_flag
++    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
++  else
++    ac_cpp_err=
++  fi
++else
++  ac_cpp_err=yes
++fi
++if test -z "$ac_cpp_err"; then
++  :
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++  # Broken: fails on valid input.
++continue
++fi
++rm -f conftest.err conftest.$ac_ext
++
++  # OK, works on sane cases.  Now check whether non-existent headers
++  # can be detected and how.
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++#include <ac_nonexistent.h>
++_ACEOF
++if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
++  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } >/dev/null; then
++  if test -s conftest.err; then
++    ac_cpp_err=$ac_c_preproc_warn_flag
++    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
++  else
++    ac_cpp_err=
++  fi
++else
++  ac_cpp_err=yes
++fi
++if test -z "$ac_cpp_err"; then
++  # Broken: success on invalid input.
++continue
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++  # Passes both tests.
++ac_preproc_ok=:
++break
++fi
++rm -f conftest.err conftest.$ac_ext
++
++done
++# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
++rm -f conftest.err conftest.$ac_ext
++if $ac_preproc_ok; then
++  :
++else
++  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
++See \`config.log' for more details." >&5
++echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
++See \`config.log' for more details." >&2;}
++   { (exit 1); exit 1; }; }
++fi
++
++ac_ext=c
++ac_cpp='$CPP $CPPFLAGS'
++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
++ac_compiler_gnu=$ac_cv_c_compiler_gnu
++
++
++echo "$as_me:$LINENO: checking for egrep" >&5
++echo $ECHO_N "checking for egrep... $ECHO_C" >&6
++if test "${ac_cv_prog_egrep+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
++    then ac_cv_prog_egrep='grep -E'
++    else ac_cv_prog_egrep='egrep'
++    fi
++fi
++echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
++echo "${ECHO_T}$ac_cv_prog_egrep" >&6
++ EGREP=$ac_cv_prog_egrep
++
++
++if test $ac_cv_c_compiler_gnu = yes; then
++    echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5
++echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
++if test "${ac_cv_prog_gcc_traditional+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++    ac_pattern="Autoconf.*'x'"
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++#include <sgtty.h>
++Autoconf TIOCGETP
++_ACEOF
++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
++  $EGREP "$ac_pattern" >/dev/null 2>&1; then
++  ac_cv_prog_gcc_traditional=yes
++else
++  ac_cv_prog_gcc_traditional=no
++fi
++rm -f conftest*
++
++
++  if test $ac_cv_prog_gcc_traditional = no; then
++    cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++#include <termio.h>
++Autoconf TCGETA
++_ACEOF
++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
++  $EGREP "$ac_pattern" >/dev/null 2>&1; then
++  ac_cv_prog_gcc_traditional=yes
++fi
++rm -f conftest*
++
++  fi
++fi
++echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5
++echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
++  if test $ac_cv_prog_gcc_traditional = yes; then
++    CC="$CC -traditional"
++  fi
++fi
++
++
++# Checks for typedefs, structures, and compiler characteristics.
++echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
++echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
++if test "${ac_cv_c_const+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++
++int
++main ()
++{
++/* FIXME: Include the comments suggested by Paul. */
++#ifndef __cplusplus
++  /* Ultrix mips cc rejects this.  */
++  typedef int charset[2];
++  const charset x;
++  /* SunOS 4.1.1 cc rejects this.  */
++  char const *const *ccp;
++  char **p;
++  /* NEC SVR4.0.2 mips cc rejects this.  */
++  struct point {int x, y;};
++  static struct point const zero = {0,0};
++  /* AIX XL C 1.02.0.0 rejects this.
++     It does not let you subtract one const X* pointer from another in
++     an arm of an if-expression whose if-part is not a constant
++     expression */
++  const char *g = "string";
++  ccp = &g + (g ? g-g : 0);
++  /* HPUX 7.0 cc rejects these. */
++  ++ccp;
++  p = (char**) ccp;
++  ccp = (char const *const *) p;
++  { /* SCO 3.2v4 cc rejects this.  */
++    char *t;
++    char const *s = 0 ? (char *) 0 : (char const *) 0;
++
++    *t++ = 0;
++  }
++  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
++    int x[] = {25, 17};
++    const int *foo = &x[0];
++    ++foo;
++  }
++  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
++    typedef const int *iptr;
++    iptr p = 0;
++    ++p;
++  }
++  { /* AIX XL C 1.02.0.0 rejects this saying
++       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
++    struct s { int j; const int *ap[3]; };
++    struct s *b; b->j = 5;
++  }
++  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
++    const int foo = 10;
++  }
++#endif
++
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"
++			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  ac_cv_c_const=yes
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_c_const=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
++echo "${ECHO_T}$ac_cv_c_const" >&6
++if test $ac_cv_c_const = no; then
++
++cat >>confdefs.h <<\_ACEOF
++#define const
++_ACEOF
++
++fi
++
++echo "$as_me:$LINENO: checking for inline" >&5
++echo $ECHO_N "checking for inline... $ECHO_C" >&6
++if test "${ac_cv_c_inline+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  ac_cv_c_inline=no
++for ac_kw in inline __inline__ __inline; do
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++#ifndef __cplusplus
++typedef int foo_t;
++static $ac_kw foo_t static_foo () {return 0; }
++$ac_kw foo_t foo () {return 0; }
++#endif
++
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"
++			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  ac_cv_c_inline=$ac_kw; break
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++done
++
++fi
++echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5
++echo "${ECHO_T}$ac_cv_c_inline" >&6
++
++
++case $ac_cv_c_inline in
++  inline | yes) ;;
++  *)
++    case $ac_cv_c_inline in
++      no) ac_val=;;
++      *) ac_val=$ac_cv_c_inline;;
++    esac
++    cat >>confdefs.h <<_ACEOF
++#ifndef __cplusplus
++#define inline $ac_val
++#endif
++_ACEOF
++    ;;
++esac
++
++echo "$as_me:$LINENO: checking for ANSI C header files" >&5
++echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
++if test "${ac_cv_header_stdc+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++#include <stdlib.h>
++#include <stdarg.h>
++#include <string.h>
++#include <float.h>
++
++int
++main ()
++{
++
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"
++			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  ac_cv_header_stdc=yes
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_header_stdc=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++if test $ac_cv_header_stdc = yes; then
++  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++#include <string.h>
++
++_ACEOF
++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
++  $EGREP "memchr" >/dev/null 2>&1; then
++  :
++else
++  ac_cv_header_stdc=no
++fi
++rm -f conftest*
++
++fi
++
++if test $ac_cv_header_stdc = yes; then
++  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++#include <stdlib.h>
++
++_ACEOF
++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
++  $EGREP "free" >/dev/null 2>&1; then
++  :
++else
++  ac_cv_header_stdc=no
++fi
++rm -f conftest*
++
++fi
++
++if test $ac_cv_header_stdc = yes; then
++  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
++  if test "$cross_compiling" = yes; then
++  :
++else
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++#include <ctype.h>
++#if ((' ' & 0x0FF) == 0x020)
++# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
++# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
++#else
++# define ISLOWER(c) \
++		   (('a' <= (c) && (c) <= 'i') \
++		     || ('j' <= (c) && (c) <= 'r') \
++		     || ('s' <= (c) && (c) <= 'z'))
++# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
++#endif
++
++#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
++int
++main ()
++{
++  int i;
++  for (i = 0; i < 256; i++)
++    if (XOR (islower (i), ISLOWER (i))
++	|| toupper (i) != TOUPPER (i))
++      exit(2);
++  exit (0);
++}
++_ACEOF
++rm -f conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++  (eval $ac_link) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  :
++else
++  echo "$as_me: program exited with status $ac_status" >&5
++echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++( exit $ac_status )
++ac_cv_header_stdc=no
++fi
++rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
++fi
++fi
++fi
++echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
++echo "${ECHO_T}$ac_cv_header_stdc" >&6
++if test $ac_cv_header_stdc = yes; then
++
++cat >>confdefs.h <<\_ACEOF
++#define STDC_HEADERS 1
++_ACEOF
++
++fi
++
++# On IRIX 5.3, sys/types and inttypes.h are conflicting.
++
++
++
++
++
++
++
++
++
++for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
++		  inttypes.h stdint.h unistd.h
++do
++as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
++echo "$as_me:$LINENO: checking for $ac_header" >&5
++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
++if eval "test \"\${$as_ac_Header+set}\" = set"; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++$ac_includes_default
++
++#include <$ac_header>
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"
++			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  eval "$as_ac_Header=yes"
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++eval "$as_ac_Header=no"
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
++echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
++if test `eval echo '${'$as_ac_Header'}'` = yes; then
++  cat >>confdefs.h <<_ACEOF
++#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
++_ACEOF
++
++fi
++
++done
++
++
++echo "$as_me:$LINENO: checking for off_t" >&5
++echo $ECHO_N "checking for off_t... $ECHO_C" >&6
++if test "${ac_cv_type_off_t+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++$ac_includes_default
++int
++main ()
++{
++if ((off_t *) 0)
++  return 0;
++if (sizeof (off_t))
++  return 0;
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"
++			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  ac_cv_type_off_t=yes
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_type_off_t=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5
++echo "${ECHO_T}$ac_cv_type_off_t" >&6
++if test $ac_cv_type_off_t = yes; then
++  :
++else
++
++cat >>confdefs.h <<_ACEOF
++#define off_t long
++_ACEOF
++
++fi
++
++echo "$as_me:$LINENO: checking for size_t" >&5
++echo $ECHO_N "checking for size_t... $ECHO_C" >&6
++if test "${ac_cv_type_size_t+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++$ac_includes_default
++int
++main ()
++{
++if ((size_t *) 0)
++  return 0;
++if (sizeof (size_t))
++  return 0;
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"
++			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  ac_cv_type_size_t=yes
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_type_size_t=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
++echo "${ECHO_T}$ac_cv_type_size_t" >&6
++if test $ac_cv_type_size_t = yes; then
++  :
++else
++
++cat >>confdefs.h <<_ACEOF
++#define size_t unsigned
++_ACEOF
++
++fi
++
++echo "$as_me:$LINENO: checking for int8_t" >&5
++echo $ECHO_N "checking for int8_t... $ECHO_C" >&6
++if test "${ac_cv_type_int8_t+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++$ac_includes_default
++int
++main ()
++{
++if ((int8_t *) 0)
++  return 0;
++if (sizeof (int8_t))
++  return 0;
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"
++			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  ac_cv_type_int8_t=yes
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_type_int8_t=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_type_int8_t" >&5
++echo "${ECHO_T}$ac_cv_type_int8_t" >&6
++if test $ac_cv_type_int8_t = yes; then
++
++cat >>confdefs.h <<_ACEOF
++#define HAVE_INT8_T 1
++_ACEOF
++
++
++fi
++
++echo "$as_me:$LINENO: checking for uint8_t" >&5
++echo $ECHO_N "checking for uint8_t... $ECHO_C" >&6
++if test "${ac_cv_type_uint8_t+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++$ac_includes_default
++int
++main ()
++{
++if ((uint8_t *) 0)
++  return 0;
++if (sizeof (uint8_t))
++  return 0;
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"
++			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  ac_cv_type_uint8_t=yes
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_type_uint8_t=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_type_uint8_t" >&5
++echo "${ECHO_T}$ac_cv_type_uint8_t" >&6
++if test $ac_cv_type_uint8_t = yes; then
++
++cat >>confdefs.h <<_ACEOF
++#define HAVE_UINT8_T 1
++_ACEOF
++
++
++fi
++
++echo "$as_me:$LINENO: checking for int16_t" >&5
++echo $ECHO_N "checking for int16_t... $ECHO_C" >&6
++if test "${ac_cv_type_int16_t+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++$ac_includes_default
++int
++main ()
++{
++if ((int16_t *) 0)
++  return 0;
++if (sizeof (int16_t))
++  return 0;
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"
++			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  ac_cv_type_int16_t=yes
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_type_int16_t=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_type_int16_t" >&5
++echo "${ECHO_T}$ac_cv_type_int16_t" >&6
++if test $ac_cv_type_int16_t = yes; then
++
++cat >>confdefs.h <<_ACEOF
++#define HAVE_INT16_T 1
++_ACEOF
++
++
++fi
++
++echo "$as_me:$LINENO: checking for uint16_t" >&5
++echo $ECHO_N "checking for uint16_t... $ECHO_C" >&6
++if test "${ac_cv_type_uint16_t+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++$ac_includes_default
++int
++main ()
++{
++if ((uint16_t *) 0)
++  return 0;
++if (sizeof (uint16_t))
++  return 0;
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"
++			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  ac_cv_type_uint16_t=yes
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_type_uint16_t=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_type_uint16_t" >&5
++echo "${ECHO_T}$ac_cv_type_uint16_t" >&6
++if test $ac_cv_type_uint16_t = yes; then
++
++cat >>confdefs.h <<_ACEOF
++#define HAVE_UINT16_T 1
++_ACEOF
++
++
++fi
++
++echo "$as_me:$LINENO: checking for int32_t" >&5
++echo $ECHO_N "checking for int32_t... $ECHO_C" >&6
++if test "${ac_cv_type_int32_t+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++$ac_includes_default
++int
++main ()
++{
++if ((int32_t *) 0)
++  return 0;
++if (sizeof (int32_t))
++  return 0;
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"
++			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  ac_cv_type_int32_t=yes
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_type_int32_t=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_type_int32_t" >&5
++echo "${ECHO_T}$ac_cv_type_int32_t" >&6
++if test $ac_cv_type_int32_t = yes; then
++
++cat >>confdefs.h <<_ACEOF
++#define HAVE_INT32_T 1
++_ACEOF
++
++
++fi
++
++echo "$as_me:$LINENO: checking for uint32_t" >&5
++echo $ECHO_N "checking for uint32_t... $ECHO_C" >&6
++if test "${ac_cv_type_uint32_t+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++$ac_includes_default
++int
++main ()
++{
++if ((uint32_t *) 0)
++  return 0;
++if (sizeof (uint32_t))
++  return 0;
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"
++			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  ac_cv_type_uint32_t=yes
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_type_uint32_t=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_type_uint32_t" >&5
++echo "${ECHO_T}$ac_cv_type_uint32_t" >&6
++if test $ac_cv_type_uint32_t = yes; then
++
++cat >>confdefs.h <<_ACEOF
++#define HAVE_UINT32_T 1
++_ACEOF
++
++
++fi
++
++echo "$as_me:$LINENO: checking for int64_t" >&5
++echo $ECHO_N "checking for int64_t... $ECHO_C" >&6
++if test "${ac_cv_type_int64_t+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++$ac_includes_default
++int
++main ()
++{
++if ((int64_t *) 0)
++  return 0;
++if (sizeof (int64_t))
++  return 0;
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"
++			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  ac_cv_type_int64_t=yes
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_type_int64_t=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5
++echo "${ECHO_T}$ac_cv_type_int64_t" >&6
++if test $ac_cv_type_int64_t = yes; then
++
++cat >>confdefs.h <<_ACEOF
++#define HAVE_INT64_T 1
++_ACEOF
++
++
++fi
++
++echo "$as_me:$LINENO: checking for uint64_t" >&5
++echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6
++if test "${ac_cv_type_uint64_t+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++$ac_includes_default
++int
++main ()
++{
++if ((uint64_t *) 0)
++  return 0;
++if (sizeof (uint64_t))
++  return 0;
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"
++			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  ac_cv_type_uint64_t=yes
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_type_uint64_t=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5
++echo "${ECHO_T}$ac_cv_type_uint64_t" >&6
++if test $ac_cv_type_uint64_t = yes; then
++
++cat >>confdefs.h <<_ACEOF
++#define HAVE_UINT64_T 1
++_ACEOF
++
++
++fi
++
++echo "$as_me:$LINENO: checking for short" >&5
++echo $ECHO_N "checking for short... $ECHO_C" >&6
++if test "${ac_cv_type_short+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++$ac_includes_default
++int
++main ()
++{
++if ((short *) 0)
++  return 0;
++if (sizeof (short))
++  return 0;
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"
++			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  ac_cv_type_short=yes
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_type_short=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5
++echo "${ECHO_T}$ac_cv_type_short" >&6
++
++echo "$as_me:$LINENO: checking size of short" >&5
++echo $ECHO_N "checking size of short... $ECHO_C" >&6
++if test "${ac_cv_sizeof_short+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  if test "$ac_cv_type_short" = yes; then
++  # The cast to unsigned long works around a bug in the HP C Compiler
++  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
++  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
++  # This bug is HP SR number 8606223364.
++  if test "$cross_compiling" = yes; then
++  # Depending upon the size, compute the lo and hi bounds.
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++$ac_includes_default
++int
++main ()
++{
++static int test_array [1 - 2 * !(((long) (sizeof (short))) >= 0)];
++test_array [0] = 0
++
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"
++			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  ac_lo=0 ac_mid=0
++  while :; do
++    cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++$ac_includes_default
++int
++main ()
++{
++static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)];
++test_array [0] = 0
++
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"
++			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  ac_hi=$ac_mid; break
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_lo=`expr $ac_mid + 1`
++		    if test $ac_lo -le $ac_mid; then
++		      ac_lo= ac_hi=
++		      break
++		    fi
++		    ac_mid=`expr 2 '*' $ac_mid + 1`
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++  done
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++$ac_includes_default
++int
++main ()
++{
++static int test_array [1 - 2 * !(((long) (sizeof (short))) < 0)];
++test_array [0] = 0
++
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"
++			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  ac_hi=-1 ac_mid=-1
++  while :; do
++    cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++$ac_includes_default
++int
++main ()
++{
++static int test_array [1 - 2 * !(((long) (sizeof (short))) >= $ac_mid)];
++test_array [0] = 0
++
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"
++			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  ac_lo=$ac_mid; break
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_hi=`expr '(' $ac_mid ')' - 1`
++		       if test $ac_mid -le $ac_hi; then
++			 ac_lo= ac_hi=
++			 break
++		       fi
++		       ac_mid=`expr 2 '*' $ac_mid`
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++  done
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_lo= ac_hi=
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++# Binary search between lo and hi bounds.
++while test "x$ac_lo" != "x$ac_hi"; do
++  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++$ac_includes_default
++int
++main ()
++{
++static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)];
++test_array [0] = 0
++
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"
++			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  ac_hi=$ac_mid
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_lo=`expr '(' $ac_mid ')' + 1`
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++done
++case $ac_lo in
++?*) ac_cv_sizeof_short=$ac_lo;;
++'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77
++See \`config.log' for more details." >&5
++echo "$as_me: error: cannot compute sizeof (short), 77
++See \`config.log' for more details." >&2;}
++   { (exit 1); exit 1; }; } ;;
++esac
++else
++  if test "$cross_compiling" = yes; then
++  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
++See \`config.log' for more details." >&5
++echo "$as_me: error: cannot run test program while cross compiling
++See \`config.log' for more details." >&2;}
++   { (exit 1); exit 1; }; }
++else
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++$ac_includes_default
++long longval () { return (long) (sizeof (short)); }
++unsigned long ulongval () { return (long) (sizeof (short)); }
++#include <stdio.h>
++#include <stdlib.h>
++int
++main ()
++{
++
++  FILE *f = fopen ("conftest.val", "w");
++  if (! f)
++    exit (1);
++  if (((long) (sizeof (short))) < 0)
++    {
++      long i = longval ();
++      if (i != ((long) (sizeof (short))))
++	exit (1);
++      fprintf (f, "%ld\n", i);
++    }
++  else
++    {
++      unsigned long i = ulongval ();
++      if (i != ((long) (sizeof (short))))
++	exit (1);
++      fprintf (f, "%lu\n", i);
++    }
++  exit (ferror (f) || fclose (f) != 0);
++
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++  (eval $ac_link) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  ac_cv_sizeof_short=`cat conftest.val`
++else
++  echo "$as_me: program exited with status $ac_status" >&5
++echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++( exit $ac_status )
++{ { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77
++See \`config.log' for more details." >&5
++echo "$as_me: error: cannot compute sizeof (short), 77
++See \`config.log' for more details." >&2;}
++   { (exit 1); exit 1; }; }
++fi
++rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
++fi
++fi
++rm -f conftest.val
++else
++  ac_cv_sizeof_short=0
++fi
++fi
++echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5
++echo "${ECHO_T}$ac_cv_sizeof_short" >&6
++cat >>confdefs.h <<_ACEOF
++#define SIZEOF_SHORT $ac_cv_sizeof_short
++_ACEOF
++
++
++echo "$as_me:$LINENO: checking for int" >&5
++echo $ECHO_N "checking for int... $ECHO_C" >&6
++if test "${ac_cv_type_int+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++$ac_includes_default
++int
++main ()
++{
++if ((int *) 0)
++  return 0;
++if (sizeof (int))
++  return 0;
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"
++			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  ac_cv_type_int=yes
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_type_int=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5
++echo "${ECHO_T}$ac_cv_type_int" >&6
++
++echo "$as_me:$LINENO: checking size of int" >&5
++echo $ECHO_N "checking size of int... $ECHO_C" >&6
++if test "${ac_cv_sizeof_int+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  if test "$ac_cv_type_int" = yes; then
++  # The cast to unsigned long works around a bug in the HP C Compiler
++  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
++  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
++  # This bug is HP SR number 8606223364.
++  if test "$cross_compiling" = yes; then
++  # Depending upon the size, compute the lo and hi bounds.
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++$ac_includes_default
++int
++main ()
++{
++static int test_array [1 - 2 * !(((long) (sizeof (int))) >= 0)];
++test_array [0] = 0
++
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"
++			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  ac_lo=0 ac_mid=0
++  while :; do
++    cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++$ac_includes_default
++int
++main ()
++{
++static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)];
++test_array [0] = 0
++
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"
++			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  ac_hi=$ac_mid; break
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_lo=`expr $ac_mid + 1`
++		    if test $ac_lo -le $ac_mid; then
++		      ac_lo= ac_hi=
++		      break
++		    fi
++		    ac_mid=`expr 2 '*' $ac_mid + 1`
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++  done
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++$ac_includes_default
++int
++main ()
++{
++static int test_array [1 - 2 * !(((long) (sizeof (int))) < 0)];
++test_array [0] = 0
++
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"
++			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  ac_hi=-1 ac_mid=-1
++  while :; do
++    cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++$ac_includes_default
++int
++main ()
++{
++static int test_array [1 - 2 * !(((long) (sizeof (int))) >= $ac_mid)];
++test_array [0] = 0
++
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"
++			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  ac_lo=$ac_mid; break
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_hi=`expr '(' $ac_mid ')' - 1`
++		       if test $ac_mid -le $ac_hi; then
++			 ac_lo= ac_hi=
++			 break
++		       fi
++		       ac_mid=`expr 2 '*' $ac_mid`
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++  done
++else
+