diff -Nru open-iscsi-2.0.873+git0.3b4b4500/Changelog open-iscsi-2.0.874/Changelog --- open-iscsi-2.0.873+git0.3b4b4500/Changelog 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/Changelog 2016-09-29 18:33:24.000000000 +0000 @@ -1,3 +1,244 @@ +open-iscsi-2.0-873 - open-iscsi-2.0.874 + +Adam Jackson (6): + actor: Mark actor_check static + actor: simplify actor_check + actor: s/ACTOR_TICKS/actor_jiffies/ + actor: Remove ACTOR_TICKS_10MS() + actor: Unobfuscate ACTOR_MAX_LOOPS + actor: Simplify actor_poll a little + +Adheer Chandravanshi (26): + Manpage changes for flashnode submode support for host mode. + README changes for flashnode submode support for host mode. + iscsiadm: Check for mode is not required when creating params list + iscsiadm: Correctly check for invalid hostno and flashnode index + flashnode: Add support to set ISCSI_FLASHNODE_CHAP_OUT_IDX param + iscsiadm: Use '-x' option instead of '-v' to specify chap_tbl_idx + iscsiadm: Man page changes to use -x option for chap_tbl_idx + README changes to use long option --index instead of --flashnode_idx + iscsiadm: Add support to set CHAP entry using host chap mode + iscsi tools: Correctly get username_in and password_in flashnode params + README changes for adding support to set CHAP entry + iscsi tools: Setup iface conf file with all iface attrs exported in sysfs + iscsi_if.h: Additional parameters for network param settings + iscsi tools: iface params should be updated for node_rec as well. + iscsi tools: Let default type of iface be ipv4 + iscsi tools: Show iface params based on iface type + iscsi tools: Fix the iscsiadm help options for host mode + Man page correction for host mode options of iscsiadm + iscsiadm: Fix the compile time warning + iscsiuio: Correct the handling of Multi Function mode + iscsiuio: Add QLogic Vendor ID to support newer NX2 HBAs + iscsid: Changes to support ping through iscsiuio + iscsiuio: Add ping support through iscsiuio + iscsiadm: let ping be tried after iface config is initialized + iscsiuio: Wait for iface to be ready before issuing the ping + iscsiuio: Get the library to use based on uio sysfs name + +Andy Grover (20): + Update README for removal of DBM requirement + Fix build warnings for unused variables + Fix warning about possibly-uninitialized variable + Fix bad sizeof in memset + Fix missing header + iscsiuio: Fix warning about non-matching types + iscsiuio: Fix strict-aliasing warning with struct mac_address + iscsiuio: Resolve strict aliasing issue in iscsiuio/src/unix/nic.c + iscsiuio: Fix aliasing issue with IPV6_IS_ADDR_UNSPECIFIED + iscsiuio: Use attribute(unused) for variables that are unused but needed + iscsiuio: Use attribute(unused) for *icmpv6_hdr + iscsiuio: Change nic_disable to return void + iscsiuio: Remove set but unused variables + iscsiuio: Check return value from nic_queue_tx_packet + Remove actor_init and rename actor_new to actor_init + Make running actors event-driven + Wake up to reap children + Fix incorrect list operation leading to out-of-order items on pend_list + Prevent spinning over poll() when reconnecting to an inaccessible target + Add some more debug logging to actor.c + +Anish Bhatt (1): + iscsiadm : make iface.ipaddress optional in iface configs for transports that don't have a hard requirement on it. + +Chris Leech (19): + iscsiadm: Fix the hostno check for stats submode of host mode + fix regression in iscsi_tcp iface binding + guard against NULL ptr during discovery from unexpected event + add discovery as a valid mode in iscsiadm.8 + iscsid: fix order of setting uid/gid and drop supplementary groups + iscsiuio CFLAGS fixes + iscsiuio systemd socket activation support + iscsid safe session logout + iscsid: don't re-read config file for every session logout + make use of all 24 bits of ISID qualifier space + iscsi_tcp set SO_LINGER to abort connection for error handling + iscsiadm: fix parallel rescan handling of exit codes + iscsistart: support booting over a VLAN + iscsid: safe_logout fix device path canonicalization by using libmount cache + iscsid: make safe_logut session checks apply for flashnode session + remove sysfs attr_list + Merge pull request #25 from cleech/master + Merge pull request #29 from chris-se/debian-patches + Replace open-iscsi.org with open-iscsi.com in docs + +Christian Hesse (1): + typo in man iscsiadm(8) + +Christian Seiler (8): + buildsys: make 'make clean' idempotent + buildsys: respect CFLAGS and LDFLAGS from the outside + Remove outdated Debian packaging code. + Reformat man page synopsis sections + Build system: sort object file lists + iscsiuio: Make builds reproducible if SOURCE_DATE_EPOCH is set + Additional spelling fixes + iscsiuio/Makefile.am: fix typo introduced by reproducibility patch + +Christophe Vu-Brugier (1): + Fix typos in iscsiadm man page + +Christopher Unkel (1): + Fix typo in man page. + +Duane Northcutt (1): + iscsid: Fix double close of mgmt ipc fd + +Eddie Wai (13): + ISCSISTART: Bring up the corresponding network interface for iboot + ISCSID: Passing more net params from ibft to iface + ISCSID: Modified the Makefile for iscsiuio compilation + ISCSID: Added iscsiuio source to the open-iscsi pkg + ISCSIUIO: Updated iscsiuio to version 0.7.8.1b for perf optimization + ISCSID: Added the extraction of the session boot info + ISCSID: Added iface content override fix + ISCSIUIO: Added tx doorbell override mechanism + ISCSIUIO: Added fix for the iface.subnet_mask decoding for IPv6 + ISCSIUIO: Added fix for the ARP cache flush mechanism + ISCSIUIO: Updated RELEASE note and version + ISCSIUIO: Removed the auto-generated COPYING file + ISCSIUIO: Fixed a pthread resc leak from excessive session recovery + +Frank Fegert (2): + Prevent iscsiuio from segfaulting due to un-lock of a not locked mutex. + iscsiuio: ensure unlock of mutex in case of an error. + +Hannes Reinecke (14): + iscsiuio: Remove autogenerated files from tracking + iscsiuio: Update automake files + iscsiuio: Add .gitignore files + Remove unused variable 'path' + Parse 'origin' value from iBFT + Added new utility script to generate initiator name + Added new util script to aid in CNA setup + Code cleanup: no functional changes + Represent DHCP "origin" as an enum, not a string. + fwparam_ibft: Check iBFT target and NIC flags + Allow modifications for iface.gateway and iface.subnet_mask + iscsiuio: Do not memcpy identical locations + iscsiuio: Clear memory after allocation + iscsiuio: fixup race condition + +Harish Zunjarrao (6): + iscsi_if.h: Remove numbers used for network parameter settings + iscsi tools: Use macro to set IPv4/IPv6 IP addresses + iscsi tools: Use single function to enable/disable network parameters + iscsi tools: Use single function to set integer network parameters + iscsi tools: Ignore network parameter if not enabled/disabled + iscsi tools: Additional parameters for network settings + +Heinrich Schuchardt (1): + Kernel include path + +Jan Vesely (2): + iscsid: Fix strlen parameter + iscsiuio: Change socket bind to use the same struct size as iscsid + +Jim Ramsay (1): + iscsi tools: Convert '-r' argument to an integer before checking if it is a path + +John Soni Jose (2): + be2iscsi: Fix MaxXmitDataLenght of the driver. + Fix StatSN in Open-iSCSI Stack. + +Kamalneet Singh (1): + fix typo + +Lalit Chandivade (3): + iscsi_tool: Add offload host statistics support. + README: Updated for host statistics. + iscsiadm.8: Updated man page for host statistics. + +Lee Duncan (13): + PATCH 1 of 1] correctly check return value of nice() + iscsiadm: return error when login fails + Fix discovery error return without return value + Add missing DESTDIR + isns: Add docs for deregistering discovery domains. + Supply strings for newly-added error numbers + Allow setting host params to return EAGAIN errors. + Remove duplicate newlines in log messages. + Fix iBFT target flags check. + Use system-wide open-isns, not internal version. + ARP table too small when switches involved. + Merge pull request #22 from frank-fegert/master + Merge pull request #26 from cvubrugier/master + +Manish Rangankar (1): + iscsiadm: Initialize param_count in set_host_chap_info + +Mark Karpeles (1): + fixed typo in iscsi_discovery usage() + +Mike Christie (22): + iscsid: fix iscsid segfault during qla4xxx login + iscsi tools: fix compile error when OFFLOAD_BOOT_SUPPORT defined + iscsi tools: fix get_random_bytes error handling + ISCSID: Added socket communication hooks for uip + From: Adheer Chandravanshi + Allow firmware mode to use debug flag + iscsiadm: bind ifaces to portals found using isns + iscsid/iscsiadm: add support for emulex one connect storage + Make rescan run in parallel + iscsi tools: sync iscsi_if.h with kernel space + ISCSISTART: Saved ibft boot info to the session + iscsi tools: Bug fix on IPC address copy (version 2) + ISCSIUIO: Updated the configure file to reflect the new version + iscsiuio: fix compilation + iscsi tools: set non negotiated params early. + iscsid: Fix handling of iscsi async events. + iscsid: retry login for ISCSI_ERR_HOST_NOT_FOUND + iscsid: don't round up when modifying padding len + iscsi: remove local copy of open-isns + iscsid: make sure actor is delated before rescheduling + iscsid/iscsiuio: remove uio poll + iscsid: fix iscsi_host_set_net_params return code + +Ritesh Raj Sarraf (1): + Spelling and escaping error fixes. + +Salvatore Bonaccorso (1): + Fix small typo in iscsid.conf + +Tomasz Torcz (3): + iscsid,iscsiadm: fix abstract socket length in bind() call + iscsid: implement systemd-compatible socket activation + iscsid: add example unit files for systemd + +Vikas Chaudhary (3): + iscsi tools: Print additional session info for flashnode session + iscsiadm: Added document for description of iface attributes + iscsiuio: Rebranding iscsiuio + +Ville Skyttä (2): + man page syntax fixes + Spelling fixes + +mikechristie (3): + Merge pull request #11 from deepankar/master + Merge pull request #8 from dscunkel/master + Merge pull request #9 from xypron/kernel_source_path + open-iscsi-2.0-872 - open-iscsi-2.0.873 Ales Kozumplik (1): @@ -54,7 +295,7 @@ isns: Fix endless loop when pollhup is returned iscsi tools: fix multi pdu sendtargets discovery sequences iscsi boot: fix iscsi_boot sysfs parsing - Use pass through interface for sendtargets (take4) Currenly offload cards like bnx2i, be2iscsi, cxgb3i must use a normal eth for discovery. This patch allows us to do discovery using the iscsi class passthrough interface. + Use pass through interface for sendtargets (take4) Currently offload cards like bnx2i, be2iscsi, cxgb3i must use a normal eth for discovery. This patch allows us to do discovery using the iscsi class passthrough interface. Add userspace/tools iscsi error code defs iscsi tools: fix iscsiadm exit codes iscsid: modify data drop diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/changelog open-iscsi-2.0.874/debian/changelog --- open-iscsi-2.0.873+git0.3b4b4500/debian/changelog 2017-02-16 20:47:58.000000000 +0000 +++ open-iscsi-2.0.874/debian/changelog 2017-08-08 23:16:27.000000000 +0000 @@ -1,3 +1,251 @@ +open-iscsi (2.0.874-4ubuntu1) artful; urgency=medium + + * Merge with Debian unstable. Remaining changes: + - debian/tests: Add Ubuntu autopkgtests. + - debian/iscsi-network-interface.rules, debian/net-interface-handler, + debian/open-iscsi.install: + Prevent network interface that contains iscsi root from bouncing + during boot or going down during shutdown. + Integrates with resolvconf and initramfs code that writes + /run/initramfs/open-iscsi.interface + - debian/open-iscsi.maintscript: clean up the obsolete + iscsi-network-interface upstart job, file on upgrade. + - Let iscsid systemd job run in privileged containers but not in + unprivileged ones + - Start open-iscsi systemd job when either /etc/iscsi/nodes or + /sys/class/iscsi_session have content + Based on patch by Nish Aravamudan, thanks! (LP #1576341) + - add IPv6 support + + add support for IPV6{DOMAINSEARCH,DNS0,DNS1} to net-interface-handler + LP #1621507 + + Source /run/net6-*.conf when needed. + + debian/extra/initramfs.local-top: handle IPv6 configs being + shipped in DEVICE6 or /run/net6-*.conf in the initramfs, so we + can fill in /run/initramfs/open-iscsi.interface (LP #1621507) + * Drop: + - d/extra/initramfs.local-top: When booting from iBFT, + set the PROTO= entry in /run/net-*.conf accordingly, + so that other tools, such as cloud-init, can use that + information. (cloud-init fails if the current PROTO=none + is used.) (LP: #1684039) (Closes: #866213) + [ Fixed in Debian 2.0.874-4 ] + * d/t/test-open-iscsi.py: drop test_daemon test + - With the updates to the systemd units, the services do not run + unless iSCSI is configured. + + -- Nishanth Aravamudan Tue, 08 Aug 2017 16:16:27 -0700 + +open-iscsi (2.0.874-4) unstable; urgency=medium + + * [0347300] initramfs: populate PROTO= entry in /run/net-*.conf from iBFT + (Closes: #866213) + + -- Christian Seiler Sun, 02 Jul 2017 18:01:09 +0200 + +open-iscsi (2.0.874-3) unstable; urgency=medium + + * [e506ea0] udeb: don't update initramfs when iSCSI is not used. + (Closes: #863435) + + -- Christian Seiler Sun, 18 Jun 2017 22:01:22 +0200 + +open-iscsi (2.0.874-2ubuntu3) artful; urgency=medium + + * d/t/test-open-iscsi.py: drop test_daemon test + - With the updates to the systemd units, the services do not run + unless iSCSI is configured. + + -- Nishanth Aravamudan Tue, 08 Aug 2017 16:05:29 -0700 + +open-iscsi (2.0.874-2ubuntu2) artful; urgency=medium + + * d/extra/initramfs.local-top: When booting from iBFT, + set the PROTO= entry in /run/net-*.conf accordingly, + so that other tools, such as cloud-init, can use that + information. (cloud-init fails if the current PROTO=none + is used.) (LP: #1684039) (Closes: #866213) + + -- Eric Desrochers Wed, 05 Jul 2017 09:02:12 -0400 + +open-iscsi (2.0.874-2ubuntu1) artful; urgency=medium + + [ Nishanth Aravamudan ] + * Merge with Debian unstable. Remaining changes: + - debian/tests: Add Ubuntu autopkgtests. + - debian/iscsi-network-interface.rules, debian/net-interface-handler, + debian/open-iscsi.install: + Prevent network interface that contains iscsi root from bouncing + during boot or going down during shutdown. + Integrates with resolvconf and initramfs code that writes + /run/initramfs/open-iscsi.interface + - debian/open-iscsi.maintscript: clean up the obsolete + iscsi-network-interface upstart job, file on upgrade. + - add IPv6 support + + add support for IPV6{DOMAINSEARCH,DNS0,DNS1} to net-interface-handler + LP #1621507 + + Source /run/net6-*.conf when needed. + + debian/extra/initramfs.local-top: handle IPv6 configs being + shipped in DEVICE6 or /run/net6-*.conf in the initramfs, so we + can fill in /run/initramfs/open-iscsi.interface (LP #1621507) + * Drop: + - Make systemd job not run in containers (LP #1576341) + [ This prevents running iscsi in privileged containers. + Fixed differently in this upload. ] + - Cherry-pick from Debian git repository (Christian Seiler): + + open-iscsi-udeb: drop Depends: libnss-files-udeb + (Closes #819685) + [ Fixed in Debian ] + - d/extra/initramfs.local-top whitespace change + [ previously undocumented ] + + [ Balint Reczey ] + * Let iscsid systemd job run in privileged containers but not in + unprivileged ones + * Start open-iscsi systemd job when either /etc/iscsi/nodes or + /sys/class/iscsi_session have content + Based on patch by Nish Aravamudan, thanks! (LP #1576341) + + -- Nishanth Aravamudan Tue, 09 May 2017 09:24:23 -0700 + +open-iscsi (2.0.874-2) unstable; urgency=medium + + [ Christian Seiler ] + * Upload to sid. + * [dfc0d4a] Add some information about hardware offloading to README.Debian. + * [e5e3428] Properly dismantle dm-crypt devices on shutdown. + (Closes: #850211) + + [ Andrew Patterson ] + * [dafd2de] Use /run/initramfs/iscsiuio.pid for pid file in initramfs + * [68f161f] Add iscsuio dependent libgcc_s library to debian initramfs + (Closes: #850060) + * [62f0717] Add Chelsio offload modules to initramfs + * [c1d67ee] Revert "Don't ignore offloading NICs in iscsistart." + * [b61d8ba] iscsiuio must be present to use hardware offload for bnx2x + * [fda3118] Move iscsistart offload discovery/setup to fw_get_targets() + * [397d886] Fix iscsiuio long options + * These changes make it possible to have the root filesystem on an iSCSI + volume and boot the system using hardware offloading. + + -- Christian Seiler Wed, 25 Jan 2017 13:12:44 +0100 + +open-iscsi (2.0.874-2~exp1) experimental; urgency=medium + + * [c451bcf] debian/tests: drop specific sysvinit tests, assume testbed + setup for that instead. + * [f65cf91] debian/tests/find_free_ip.py: fix error when processing + empty lines in /etc/resolv.conf. + * [02c3051] Don't ignore offloading NICs in iscsistart. (Closes: #850057) + * [e47af5b] Add support for iscsiuio offloading to the initramfs. + (Closes: #850060) + * [9ab14bb] Build with -DOFFLOAD_BOOT_SUPPORTED for rootfs on offloaded + iSCSI. + + -- Christian Seiler Wed, 04 Jan 2017 19:00:08 +0100 + +open-iscsi (2.0.874-1) unstable; urgency=medium + + [ Christian Seiler ] + * [cfea3bc] New upstream version 2.0.874 + * [b0bf3f3] debian/patches: drop patches applied upstream + * [6699561] debian/control: add lsb-base dependency for init script + * [8ede6f7] debian/tests: use targetcli-fb for nested tests + * [b7ba04a] debian/tests: bump Depends of autopkgtest, due to use of new + features + * [6f37806] debian/rules: explicitly regenerate lexers/parsers during + build + + [ Frank Fegert ] + * [6004a7e] umountiscsi.sh: properly detect iSCSI disks from offloaded + sessions + + -- Christian Seiler Sat, 29 Oct 2016 17:44:00 +0200 + +open-iscsi (2.0.873+git2.f951a06b-1) unstable; urgency=medium + + * [ace9f2a] New upstream version 2.0.873+git2.f951a06b + * Fix locking issue in iscsiuio + * iscsiadm: fix parallel rescan handling of exit codes + * Better TCP connection error handling + * [6a4ba6a] debian/patches: rebase onto new upstream version + * [d05fe0e] Only deactivate LVM VGs we're supposed to. (Closes: #836135) + * [3b387b7] debian/patches/bugfixes/additional-spelling.patch: + fix some more typos + + -- Christian Seiler Sun, 18 Sep 2016 12:06:11 +0200 + +open-iscsi (2.0.873+git1.4c1f2d90-2) unstable; urgency=medium + + * [5a7879c] remove debian/source/local-options + * [f5d5cbb] Temporarily build udeb without libmount (Closes: #834241) + * [520129b] open-iscsi-udeb: update initramfs after copying + configuration to target system + + -- Christian Seiler Mon, 22 Aug 2016 08:31:02 +0200 + +open-iscsi (2.0.873+git1.4c1f2d90-1) unstable; urgency=medium + + * Upload to sid. + * [0f85c07] debian/copyright: add copyright information for debian/* and + debian/patches/* (accidentally dropped when converting to DEP-5) + * [fc39696] debian/control: tighten libisns-dev dependency to >= 0.96-4~ + (open-isns renamed the library udeb, this ensures that the new name + will be picked up.) + * [60d3f4a] iscsiuio: fix reproducibility issues (build date) + * [328a368] debian/gbp.conf: don't specify experimental branch anymore + * [d44c9d4] debian/extra/activate-storage.sh: work around race condition + against the kernel scanning for partitions (Closes: #833917) + + -- Christian Seiler Fri, 12 Aug 2016 22:57:55 +0200 + +open-iscsi (2.0.873+git1.4c1f2d90-1~exp1) experimental; urgency=medium + + * [16ff653] New Upstream version 2.0.873+git1.4c1f2d90 + (Closes: #627908) + * [313215d] debian/watch, debian/control: new upstream URIs + * [0930362] debian/patches: rebase on current git master, + drop upstream-applied patches + * [466d970] Link against non-OpenSSL-variant of libisns + (GPL vs. OpenSSL license) + * [6cf412f] debian/control: add Build-Depends of new upstream version + * [147b55b] debian/control: use cgit instead of gitweb for Vcs-Browser + * [49dd8a2] debian/rules: simplify due to upstream build system + improvements + * [533a744] debian/rules: add dh_... --remaining-packages where + appropriate + * [9ae0be5] remove obsolete files (debian/*.modules{,.in}) + * [7236298] debian/*: improve readability via wrap-and-sort + * [c68d51f] don't run make clean in kernel/ subdir + * [607f4d1] debian/gbp.conf: switch to experimental branch + * [a3b1a24] README.Debian: fix spelling error + * [d1cdd8e] cherry-pick upstream PR #17 (spelling fixes) + * [fd0f467] cherry-pick upstream PR #16 (man warnings) + * [c55b9c2] cherry-pick upstream PR #13 (typo) + * [4786175] cherry-pick upstream PR #2 (typo) + * [3e79826] additional spelling fixes (found by lintian) + * [ee0a6a5] Add iscsiuio binary package (Closes: #699240) + * [ad61aa0] debian/docs: install additional upstream docs + * [419e1b6] debian/copyright: move to DEP-5 style format + * [768632b] TODO.Debian: remove resolved issues + * [17767e9] Add autopkgtest functionality tests. + + -- Christian Seiler Fri, 29 Jul 2016 19:32:25 +0200 + +open-iscsi (2.0.873+git0.3b4b4500-15) unstable; urgency=medium + + [ Christian Seiler ] + * [ec1cc4b] debian/control: Use Arch: linux-any instead of Arch: any + * [2f35aeb] open-iscsi-udeb: drop Depends: libnss-files-udeb + (Closes: #819685) + * [2af4f32] debian/control: Bump Standards-Version to 3.9.8. + (No changes.) + + [ Adriano Rafael Gomes ] + * [8b8eb17] Add Brazilian Portuguese debconf translation. + (Closes: #824339) + + -- Christian Seiler Fri, 20 May 2016 09:52:46 +0200 + open-iscsi (2.0.873+git0.3b4b4500-14ubuntu17) zesty; urgency=medium * debian/tests: @@ -1114,3 +1362,4 @@ -- Philipp Hug Mon, 6 Mar 2006 19:20:17 +0000 + diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/control open-iscsi-2.0.874/debian/control --- open-iscsi-2.0.873+git0.3b4b4500/debian/control 2017-02-16 20:47:58.000000000 +0000 +++ open-iscsi-2.0.874/debian/control 2017-08-08 23:16:27.000000000 +0000 @@ -3,17 +3,29 @@ Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Debian iSCSI Maintainers -Uploaders: Ritesh Raj Sarraf , Christian Seiler -Build-Depends: debhelper (>= 9), bzip2, bison, flex, autotools-dev, dh-autoreconf, dh-exec, dpkg-dev (>= 1.16.1~), po-debconf, dh-systemd -Standards-Version: 3.9.7 +Uploaders: Ritesh Raj Sarraf , + Christian Seiler +Build-Depends: autotools-dev, + bison, + bzip2, + debhelper (>= 9), + dh-autoreconf, + dh-exec, + dh-systemd, + dpkg-dev (>= 1.16.1~), + flex, + libisns-dev (>= 0.96-4~), + libmount-dev, + po-debconf +Standards-Version: 3.9.8 Vcs-Git: https://anonscm.debian.org/git/pkg-iscsi/open-iscsi.git -Vcs-Browser: https://anonscm.debian.org/gitweb/?p=pkg-iscsi/open-iscsi.git -Homepage: http://www.open-iscsi.org/ +Vcs-Browser: https://anonscm.debian.org/cgit/pkg-iscsi/open-iscsi.git +Homepage: http://www.open-iscsi.com/ Testsuite: autopkgtest Package: open-iscsi -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, udev +Architecture: linux-any +Depends: udev, ${misc:Depends}, ${shlibs:Depends}, lsb-base (>= 3.0-6) Recommends: ${busybox:Recommends} Pre-Depends: debconf | debconf-2.0 Description: iSCSI initiator tools @@ -34,18 +46,39 @@ This package includes a daemon, iscsid, and a management utility, iscsiadm. +Package: iscsiuio +Architecture: linux-any +Depends: udev, ${misc:Depends}, ${shlibs:Depends} +Enhances: open-iscsi +Description: iSCSI offloading daemon for QLogic devices + Open-iSCSI is a high-performance, transport independent, multi-platform + implementation of the RFC3720 Internet Small Computer Systems Interface + (iSCSI). + . + This package contains the userspace offloading daemon, for use with + QLogic (formerly Broadcom) NetXtreme II hardware, as supported by the + 'bnx2' and 'bnx2x' drivers, in conjunction with the 'bnx2i' driver. + . + The following network controllers are supported: + bnx2: BCM5706, BCM5708, BCM5709 devices + bnx2x: BCM57710, BCM57711, BCM57711E, BCM57712, BCM57712E, BCM57800, + BCM57810, BCM57840 + . + This package is required to offload iSCSI onto these devices. + Package: open-iscsi-udeb # Note: the (virtual) udeb package scsi-modules (provided by different # linux kernel udebs) must exist for these architectures - so # check that before adding them to this list; the other # scsi-(core|common|...)-modules are NOT sufficient! -Architecture: amd64 arm64 i386 ia64 mips mipsel powerpc s390x ppc64el ppc64 armhf +Architecture: amd64 arm64 armhf i386 ia64 mips mipsel powerpc ppc64 ppc64el s390x Section: debian-installer Package-Type: udeb -Depends: ${shlibs:Depends}, ${misc:Depends}, scsi-modules +Depends: scsi-modules, ${misc:Depends}, ${shlibs:Depends} Description: Configure iSCSI Open-iSCSI is a high-performance, transport independent, multi-platform implementation of the RFC3720 Internet Small Computer Systems Interface (iSCSI). . This is the minimal package (udeb) used by debian-installer. + diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/control.modules.in open-iscsi-2.0.874/debian/control.modules.in --- open-iscsi-2.0.873+git0.3b4b4500/debian/control.modules.in 2017-02-16 20:47:58.000000000 +0000 +++ open-iscsi-2.0.874/debian/control.modules.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -Source: linux-iscsi-modules -Section: net -Priority: optional -Maintainer: Philipp Hug -Build-Depends: debhelper (>> 4.1.0), bzip2 -Standards-Version: 3.6.1 - -Package: linux-iscsi-modules-_KVERS_ -Architecture: any -Depends: modutils, open-iscsi -Provides: linux-iscsi-modules -Description: Linux Kernel Driver Modules for Linux iSCSI (kernel _KVERS_) - This is a Linux driver for iSCSI initiator functionality. - . - This package contains the compiled kernel modules for _KVERS_ - . - If you have compiled your own kernel, you will most likely need to build - your own linux-iscsi-modules. The linux-iscsi-source package has been - provided for use with the Debian kernel-package utility to produce a version - of linux-iscsi-module for your kernel. diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/copyright open-iscsi-2.0.874/debian/copyright --- open-iscsi-2.0.873+git0.3b4b4500/debian/copyright 2017-02-16 20:47:58.000000000 +0000 +++ open-iscsi-2.0.874/debian/copyright 2017-08-03 20:04:27.000000000 +0000 @@ -1,19 +1,382 @@ -This package was debianized by Philipp Hug on -Tue, 07 Mar 2005 01:22:53 +0100. +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: Open-iSCSI +Source: http://www.open-iscsi.com/ -Based on linux-iscsi debianization from Chad Tindel +Files: * +Copyright: 2004-2005 Dmitry Yusupov + 2004-2005 Alex Aizman + 2006-2016 Red Hat, Inc. + 2004-2016 Mike Christie + 2016 Chris Leech + 2016 Lee Duncan +License: GPL-2+ -It was downloaded from http://www.open-iscsi.org/ +Files: include/fw_context.h + utils/fwparam_ibft/* +Copyright: 2006-2007 IBM Corporation + Author: Doug Maxey +License: GPL-2+ -Upstream Authors: Open-iSCSI Developers -Copyright: (C) Dmitry Yusupov and others. +Files: include/sysdeps.h + usr/sysfs.c + usr/sysfs.h + utils/sysdeps/* +Copyright: 2003-2006 Kay Sievers + 2003 Greg Kroah-Hartman +Comment: These files are based on the udev source code. +License: GPL-2 -License: +Files: iscsiuio/* +Copyright: 2009-2011 Broadcom Corporation + 2014-2015 QLogic Corporation +Comment: iscsiuio is a separate binary that does not link against other + code in the package, so its license does not need to be + compatible with the GPL. +License: BSD-4-clause - You are free to distribute this software under the terms of the GNU General - Public License v2 (or at your option) any later version. On Debian systems, - the complete text of the GNU General Public License can be found in the file - `/usr/share/common-licenses/GPL-2'. +Files: iscsiuio/src/apps/dhcpc/dhcpc.c + iscsiuio/src/apps/dhcpc/dhcpc.h + iscsiuio/src/uip/lc-addrlabels.h + iscsiuio/src/uip/uip-neighbor.c + iscsiuio/src/uip/lc-switch.h + iscsiuio/src/uip/timer.c + iscsiuio/src/uip/pt.h + iscsiuio/src/uip/timer.h + iscsiuio/src/uip/lc.h + iscsiuio/src/uip/clock.h + iscsiuio/src/uip/uip-neighbor.h + iscsiuio/src/uip/psock.c + iscsiuio/src/uip/ipv6_ndpc.c + iscsiuio/src/uip/psock.h + iscsiuio/src/unix/clock-arch.c + iscsiuio/src/unix/clock-arch.h + iscsiuio/src/unix/uip-conf.h +Copyright: 2004-2006 Swedish Institute of Computer Science +License: BSD-3-clause-1 -The Debian packaging is copyright 2009, Ritesh Raj Sarraf and -is licensed under the GPL 2 license, see `/usr/share/common-licenses/GPL-2'. +Files: iscsiuio/src/uip/uip.c + iscsiuio/src/uip/uip.h + iscsiuio/src/uip/uip_arch.h + iscsiuio/src/uip/uip_arp.c + iscsiuio/src/uip/uip_arp.h + iscsiuio/src/uip/uipopt.h +Copyright: 2001-2003 Adam Dunkels +License: BSD-3-clause-2 + +Files: iscsiuio/src/unix/main.c +Copyright: 2001 Adam Dunkels +License: BSD-4-clause + +Files: kernel/scsi_transport_iscsi.c + kernel/scsi_transport_iscsi.h +Copyright: 2004 IBM Corporation + 2004-2005 Dmitry Yusupov + 2004-2005 Alex Aizman + 2004-2006 Mike Christie +License: GPL-2+ + +Files: usr/auth.c + usr/auth.h + usr/config.h + usr/discovery.c + usr/io.c + usr/iscsi_timer.c + usr/iscsi_timer.h + usr/strings.c + usr/strings.h +Copyright: 2001-2002 Cisco Systems, Inc +License: GPL-2+ + +Files: usr/ethtool-copy.h +Copyright: 1998 David S. Miller + 2001 Jeff Garzik + 2001 Sun Microsystems + 2002 Intel + 2001 Sun Microsystems + 2002 Intel +Comment: This file is based on the ethtool source code. +License: GPL-2 + +Files: usr/event_poll.c + usr/mgmt_ipc.c +Copyright: 2004 FUJITA Tomonori + 2004 Dmitry Yusupov + 2004 Alex Aizman + 2006 Mike Christie + 2006 Red Hat Inc. +License: GPL-2+ + +Files: usr/flashnode.c + usr/flashnode.h +Copyright: 2013 QLogic Corporation +License: GPL-2+ + +Files: usr/iscsiadm.c +Copyright: 2004 Dmitry Yusupov + 2004 Alex Aizman + 2006 Red Hat, Inc. + 2006 Mike Christie + 2011 Dell, Inc. +License: GPL-2+ + +Files: usr/kern_err_table.c + usr/kern_err_table.h +Copyright: 2011 Aastha Mehta + 2011 Mike Christie +License: GPL-2+ + +Files: usr/log.c + usr/log.h + usr/types.h +Copyright: 2002-2003 Ardis Technolgies + 2004 Dmitry Yusupov + 2004-2005 Alex Aizman +License: GPL-2 + +Files: usr/login.c +Copyright: 2001 Cisco Systems, Inc. + 2004 Dmitry Yusupov + 2004 Alex Aizman +License: GPL-2+ + +Files: usr/md5.c + usr/md5.h +Copyright: Author: 1993 Colin Plumb +License: public-domain + This is the header file for the MD5 message-digest algorithm. + The algorithm is due to Ron Rivest. This code was + written by Colin Plumb in 1993, no copyright is claimed. + This code is in the public domain; do with it what you wish. + . + Equivalent code is available from RSA Data Security, Inc. + This code has been tested against that, and is equivalent, + except that you don't need to include two pages of legalese + with every copy. + . + To compute the message digest of a chunk of bytes, declare an + MD5Context structure, pass it to MD5Init, call MD5Update as + needed on buffers full of bytes, and then call MD5Final, which + will fill a supplied 16-byte array with the digest. + . + Changed so as no longer to depend on Colin Plumb's `usual.h' + header definitions; now uses stuff from dpkg's config.h + - Ian Jackson . + Still in the public domain. + +Files: include/list.h + usr/scsi.c + usr/scsi.h +Copyright: 1991-2012 Linus Torvalds and many others + 1997 Eric Youngdale +Comment: These files are based on the Linux Kernel source code. +License: GPL-2 + +Files: usr/session_mgmt.c +Copyright: 2010 Mike Christie + 2010 Red Hat, Inc. + 2011 Dell, Inc. +License: GPL-2+ + +Files: usr/sha1.c +Copyright: Alan Smithee + Andrew McDonald + Jean-Francois Dive +License: GPL-2+ + +Files: usr/sha1.h +Copyright: 2004 Xiranet Communications GmbH +License: GPL-2 + +Files: utils/fwparam_ibft/fwparam_ibft.c +Copyright: 2006 IBM Corporation + Author: Patrick Mansfield +License: GPL-2+ + +Files: utils/fwparam_ibft/fwparam_ibft_sysfs.c + utils/fwparam_ibft/fwparam_sysfs.c +Copyright: 2007 IBM Corporation + 2008-2010 Red Hat, Inc. + 2008-2010 Mike Christie +License: GPL-2+ + +Files: utils/fwparam_ibft/prom_parse.tab.c + utils/fwparam_ibft/prom_parse.tab.h +Copyright: 1984-2006, Free Software Foundation, Inc. +License: GPL-2+ with Bison exception + +Files: utils/iscsi-gen-initiatorname + utils/iscsi_offload +Copyright: 2011 Hannes Reinecke, SUSE Labs +License: GPL-2 + +Files: utils/iscsi-iname.c +Copyright: 2001-2002 Cisco Systems, Inc +License: GPL-2+ + +Files: utils/iscsi_discovery +Copyright: 2006 Voltaire Ltd. +License: GPL-2+ + +Files: debian/* +Copyright: 2006-2008 Philipp Hug + 2010 Guido Günther + 2010-2016 Ritesh Raj Sarraf + 2016 Christian Seiler +License: GPL-2+ + +Files: debian/patches/* +Copyright: 2016 Christian Seiler + 2016 Ritesh Raj Sarraf +License: Patches-GPL-2+-or-BSD-4-clause + +Files: debian/patches/debian/var-run-lock.patch +Copyright: 2016 Stéphane Graber +License: Patches-GPL-2+-or-BSD-4-clause + +License: BSD-3-clause-1 + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the Institute nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + +License: BSD-3-clause-2 + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. The name of the author may not be used to endorse or promote + products derived from this software without specific prior + written permission. + . + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +License: BSD-4-clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by Adam Dunkels. + 4. The name of the author may not be used to endorse or promote + products derived from this software without specific prior + written permission. + . + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +License: GPL-2+ + This package 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 package 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, see + . + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". + +License: GPL-2 + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. + . + This package 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, see + . + On Debian systems, the complete text of the GNU General Public License + version 2 can be found in `/usr/share/common-licenses/GPL-2'. + +License: GPL-2+ with Bison exception + This package 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 package 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, see + . + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". + . + As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + . + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. + +License: Patches-GPL-2+-or-BSD-4-clause + Changes to files under the iscsiuio/ directory are licensed under the + 4-clause BSD license. Changes to files under any other directory are + licensed under the GNU General Public license version 2, or (at your + option) any later version. See the GPL-2+ and BSD-4-clause license + paragraphs for further details. diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/dirs open-iscsi-2.0.874/debian/dirs --- open-iscsi-2.0.873+git0.3b4b4500/debian/dirs 2017-02-16 20:47:58.000000000 +0000 +++ open-iscsi-2.0.874/debian/dirs 2017-08-03 20:04:27.000000000 +0000 @@ -1,8 +1,8 @@ -etc/init.d etc/default +etc/init.d etc/iscsi etc/network/if-up.d +lib/modules-load.d +lib/open-iscsi usr/share/initramfs-tools/hooks/ usr/share/initramfs-tools/scripts/local-top/ -lib/open-iscsi -lib/modules-load.d diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/docs open-iscsi-2.0.874/debian/docs --- open-iscsi-2.0.873+git0.3b4b4500/debian/docs 2017-02-16 20:47:58.000000000 +0000 +++ open-iscsi-2.0.874/debian/docs 2017-08-03 20:04:27.000000000 +0000 @@ -1 +1,3 @@ README +sysfs-documentation +THANKS diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/extra/activate-storage.sh open-iscsi-2.0.874/debian/extra/activate-storage.sh --- open-iscsi-2.0.873+git0.3b4b4500/debian/extra/activate-storage.sh 2017-02-16 20:47:58.000000000 +0000 +++ open-iscsi-2.0.874/debian/extra/activate-storage.sh 2017-08-03 20:04:27.000000000 +0000 @@ -32,21 +32,32 @@ # Make sure we pick up all devices udevadm settle || true -# Handle multipath +# Work around race condition here: after udevadm settle it is +# guaranteed that all iSCSI disks have now properly appeared, but +# other dependent devices may not have. This can include multipath +# mappings of iSCSI devices (multipathd will race against udev for +# locking the underlying source block devices when it comes to +# creating the mappings, and it will retry the lock only once per +# second, and typically succeed only on second try), but also +# partitions on the given disks (which the kernel scans +# asyncronously). +# +# The proper way of handling this is to have LVM activation and/or +# mounting of file systems be handled in a completely event-driven +# manner, but that requires configuration by the sysadmin in the +# case of LVM, and for mounting it only works with systemd at the +# moment. For compatibility with how the package handled this +# previously, we will work around this race for a while longer. + if [ -x $MULTIPATH ] ; then - # If multipath is used, we might need to do udevadm settle - # twice to make sure multipathd has seen the devices and - # then been able to create the mappings. - # (We assume that multipathd is already running.) - # - # Note that multipathd will race against udev for locking the - # block device when it comes to creating the mappings, and it - # will retry only once per second (and will typically succeed - # on the second try), so we will wait three seconds here to be - # sure that it worked as expected. + # 1 second is too short for multipath devices to appear, + # because multipathd takes more than 1s to activate them + # after udevadm settle is done. sleep 3 - udevadm settle || true +else + sleep 1 fi +udevadm settle || true # Handle LVM if [ -n "$LVMGROUPS" ] ; then diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/extra/initramfs.hook open-iscsi-2.0.874/debian/extra/initramfs.hook --- open-iscsi-2.0.873+git0.3b4b4500/debian/extra/initramfs.hook 2017-02-16 20:47:58.000000000 +0000 +++ open-iscsi-2.0.874/debian/extra/initramfs.hook 2017-08-03 20:04:27.000000000 +0000 @@ -35,3 +35,7 @@ for x in crc32c libcrc32c iscsi_tcp libiscsi scsi_transport_iscsi iscsi_ibft; do manual_add_modules ${x} done +for x in cxgb3i cxgb4i; do + manual_add_modules ${x} +done + diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/extra/initramfs.local-bottom open-iscsi-2.0.874/debian/extra/initramfs.local-bottom --- open-iscsi-2.0.873+git0.3b4b4500/debian/extra/initramfs.local-bottom 1970-01-01 00:00:00.000000000 +0000 +++ open-iscsi-2.0.874/debian/extra/initramfs.local-bottom 2017-08-03 20:04:27.000000000 +0000 @@ -0,0 +1,10 @@ +#!/bin/sh +# If iscsiuio is present in the initramfs, and it was started by us, +# stop it again so the system iscsiuio can take over later. +if [ -x /sbin/iscsiuio ] && [ -e /run/initramfs/iscsiuio.pid ] ; then + start-stop-daemon --stop --quiet --retry=TERM/10/KILL/5 \ + --pidfile /run/initramfs/iscsiuio.pid \ + --name iscsiuio --exec /sbin/iscsiuio || : +fi + +exit 0 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/extra/initramfs.local-top open-iscsi-2.0.874/debian/extra/initramfs.local-top --- open-iscsi-2.0.873+git0.3b4b4500/debian/extra/initramfs.local-top 2017-02-16 20:47:58.000000000 +0000 +++ open-iscsi-2.0.874/debian/extra/initramfs.local-top 2017-08-08 23:15:26.000000000 +0000 @@ -159,6 +159,13 @@ iface.primary_dns) IPV4DNS0="${v}" ;; iface.secondary_dns) IPV4DNS1="${v}" ;; iface.net_ifacename) DEVICE="${v}" ;; + iface.bootproto) + case "${v}" in + DHCP) PROTO="dhcp" ;; + STATIC) PROTO="static" ;; + *) PROTO="${v}" ;; + esac + ;; esac done fi @@ -173,7 +180,7 @@ # prefer that). if ! [ -e /run/initramfs/open-iscsi.interface ] ; then if [ -z "${DEVICE}" ] || ! [ -e "/run/net-${DEVICE}.conf" ] ; then - for i in /run/net-*.conf; do + for i in /run/net-*.conf ; do [ -e "${i}" ] && { . "${i}" ; break ; } done fi @@ -192,6 +199,14 @@ modprobe iscsi_tcp modprobe crc32c + # If iscsiuio is present in the initramfs, start it, in case UIO + # offloading is required. + if [ -x /sbin/iscsiuio ] ; then + start-stop-daemon --start --quiet --pidfile /run/initramfs/iscsiuio.pid \ + --startas /sbin/iscsiuio --name iscsiuio \ + --exec /sbin/iscsiuio -- --pid=/run/initramfs/iscsiuio.pid || : + fi + if [ -z $ISCSI_AUTO ]; then if [ -z $ISCSI_INITIATOR ]; then . /etc/initiatorname.iscsi diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/extra/iscsiuio.initramfs.hook open-iscsi-2.0.874/debian/extra/iscsiuio.initramfs.hook --- open-iscsi-2.0.873+git0.3b4b4500/debian/extra/iscsiuio.initramfs.hook 1970-01-01 00:00:00.000000000 +0000 +++ open-iscsi-2.0.874/debian/extra/iscsiuio.initramfs.hook 2017-08-03 20:04:27.000000000 +0000 @@ -0,0 +1,35 @@ +#!/bin/sh + +PREREQ="udev iscsi" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +if [ -r /etc/initramfs-tools/conf.d/open-iscsi ] ; then + . /etc/initramfs-tools/conf.d/open-iscsi +fi + +if [ x"$NO_ISCSI_IN_INITRAMFS" = x"yes" ] ; then + exit 0 +fi + +# Hooks for loading iscsi bits into the initramfs +. /usr/share/initramfs-tools/hook-functions + +copy_exec /sbin/iscsiuio +# iscsiuio needs libgcc_s library, so add it and its dependencies. +LIBC_DIR=$(ldd /sbin/iscsiuio | sed -nr 's#.* => (/lib.*)/libc\.so\.[0-9.-]+ \(0x[[:xdigit:]]+\)$#\1#p') +find -L "$LIBC_DIR" -maxdepth 1 -name 'libgcc_s.*' -type f | while read so; do + copy_exec "$so" +done +manual_add_modules bnx2i diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/extra/umountiscsi.sh open-iscsi-2.0.874/debian/extra/umountiscsi.sh --- open-iscsi-2.0.873+git0.3b4b4500/debian/extra/umountiscsi.sh 2017-02-16 20:47:58.000000000 +0000 +++ open-iscsi-2.0.874/debian/extra/umountiscsi.sh 2017-08-03 20:04:27.000000000 +0000 @@ -7,6 +7,12 @@ # LVM -> multipath -> iSCSI # multipath -> iSCSI # LVM -> iSCSI +# LVM -> LUKS -> multipath -> iSCSI +# LVM -> LUKS -> iSCSI +# LUKS -> LVM -> multipath -> iSCSI +# LUKS -> multipath -> iSCSI +# LUKS -> LVM -> iSCSI +# LUKS -> iSCSI # It does not try to umount anything belonging to any device that is # also used as a backing store for the root filesystem. Any iSCSI # device part of the backing store of the root filesystem will be noted @@ -58,12 +64,19 @@ LVS=/sbin/lvs VGS=/sbin/vgs VGCHANGE=/sbin/vgchange +CRYPTSETUP=/sbin/cryptsetup +DMSETUP=/sbin/dmsetup if [ -x $PVS ] && [ -x $LVS ] && [ -x $VGCHANGE ] ; then HAVE_LVM=1 else HAVE_LVM=0 fi +if [ -x $CRYPTSETUP ] && [ -x $DMSETUP ] ; then + HAVE_LUKS=1 +else + HAVE_LUKS=0 +fi DRY_RUN=0 @@ -185,6 +198,39 @@ eval $1=\${_majmin_dec} } +get_lvm_vgs() { + # handle the case where we didn't get passed any PVs + # at all + [ $# -gt 0 ] || return 0 + # subshell for pwd change + ( + cd /dev + $PVS --noheadings -o vg_name "$@" 2>/dev/null + ) +} + +enumerate_luks() { + hash_clear LUKS_DEVICES_REVERSE_MAP + + _all_crypt_devices=$($DMSETUP info --noheadings -o name -c -S subsystem=CRYPT 2>/dev/null || :) + for _crypt_device in ${_all_crypt_devices} ; do + [ -b "/dev/mapper/${_crypt_device}" ] || continue + _crypt_device="$(readlink -fe "/dev/mapper/${_crypt_device}" 2>/dev/null || :)" + _crypt_device="${_crypt_device#/dev/}" + [ -b "/dev/${_crypt_device}" ] || continue + # dmsetup deps is weird, it outputs the following: + # 1 dependencies : (XYZ) + _dep=$($DMSETUP deps -o blkdevname "/dev/${_crypt_device}" | sed -n '1s%.*: (\(.*\)).*%\1%p') + if [ -n "$_dep" ] && [ -b "/dev/${_dep}" ] ; then + _dep="$(readlink -fe "/dev/$_dep" 2>/dev/null || :)" + _dep="${_dep#/dev/}" + fi + if [ -n "$_dep" ] && [ -b "/dev/${_dep}" ] ; then + hash_set LUKS_DEVICES_REVERSE_MAP "${_dep}" "${_crypt_device}" + fi + done +} + enumerate_iscsi_devices() { # Empty arrays iscsi_disks="" @@ -195,6 +241,8 @@ iscsi_lvm_vgs="" iscsi_lvm_lvs="" iscsi_potential_mount_sources="" + iscsi_luks_pass1="" + iscsi_luks_pass2="" hash_clear ISCSI_DEVICE_SESSIONS hash_clear ISCSI_MPALIAS_SESSIONS @@ -202,9 +250,17 @@ hash_clear ISCSI_NUMDEVICE_SESSIONS ISCSI_EXCLUDED_SESSIONS="" + # We first need to generate a global reverse mapping of all + # cryptsetup (e.g. LUKS) devices, because there's no easy way + # to query "is this the encrypted backing of an active crypto + # mapping? + enumerate_luks + # Look for all iscsi disks - for _host_dir in /sys/devices/platform/host* ; do - [ -d "$_host_dir"/iscsi_host* ] || continue + for _host_dir in /sys/devices/platform/host* /sys/devices/pci*/*/*/host* ; do + if ! [ -d "$_host_dir"/iscsi_host* ] || ! [ -d "$_host_dir"/iscsi_host/host* ] ; then + continue + fi for _session_dir in "$_host_dir"/session* ; do [ -d "$_session_dir"/target* ] || continue for _block_dev_dir in "$_session_dir"/target*/*\:*/block/* ; do @@ -253,12 +309,25 @@ done fi + if [ $HAVE_LUKS -eq 1 ] ; then + # Look for all LUKS devices. + for _dev in $iscsi_disks $iscsi_partitions $iscsi_multipath_disks $iscsi_multipath_partitions ; do + hash_get _luksDev LUKS_DEVICES_REVERSE_MAP "${_dev}" + [ -n "${_luksDev}" ] || continue + add_to_set iscsi_luks_pass1 "${_luksDev}" + hash_get _currentSession ISCSI_DEVICE_SESSIONS "${_dev}" + if [ -n "${_currentSession}" ] ; then + hash_set ISCSI_DEVICE_SESSIONS "${_luksDev}" "${_currentSession}" + fi + done + fi + if [ $HAVE_LVM -eq 1 ] ; then # Look for all LVM volume groups that have a backing store # on any iSCSI device we found. Also, add $LVMGROUPS set in # /etc/default/open-iscsi (for more complicated stacking # configurations we don't automatically detect). - for _vg in $(cd /dev ; $PVS --noheadings -o vg_name $iscsi_disks $iscsi_partitions $iscsi_multipath_disks $iscsi_multipath_partitions 2>/dev/null) $LVMGROUPS ; do + for _vg in $(get_lvm_vgs $iscsi_disks $iscsi_partitions $iscsi_multipath_disks $iscsi_multipath_partitions $iscsi_luks_pass1) $LVMGROUPS ; do add_to_set iscsi_lvm_vgs "$_vg" done @@ -285,10 +354,24 @@ done fi + if [ $HAVE_LUKS -eq 1 ] ; then + # Look for all LUKS devices. + for _dev in $iscsi_lvm_lvs ; do + hash_get _luksDev LUKS_DEVICES_REVERSE_MAP "${_dev}" + [ -n "${_luksDev}" ] || continue + add_to_set iscsi_luks_pass2 "${_luksDev}" + hash_get _currentSession ISCSI_DEVICE_SESSIONS "${_dev}" + if [ -n "${_currentSession}" ] ; then + hash_set ISCSI_DEVICE_SESSIONS "${_luksDev}" "${_currentSession}" + fi + done + fi + # Gather together all mount sources iscsi_potential_mount_sources="$iscsi_potential_mount_sources $iscsi_disks $iscsi_partitions" iscsi_potential_mount_sources="$iscsi_potential_mount_sources $iscsi_multipath_disks $iscsi_multipath_partitions" iscsi_potential_mount_sources="$iscsi_potential_mount_sources $iscsi_lvm_lvs" + iscsi_potential_mount_sources="$iscsi_potential_mount_sources $iscsi_luks_pass1 $iscsi_luks_pass2" # Convert them to numerical representation iscsi_potential_mount_sources_majmin="" @@ -373,7 +456,7 @@ # Make sure the volume group (still) exists. If # it doesn't we count that as deactivated, so # don't fail then. - _vg_test=$(vgs -o vg_name --noheadings vg2 2>/dev/null || :) + _vg_test=$(vgs -o vg_name --noheadings $vg 2>/dev/null || :) if [ -n "${_vg_test}" ] ; then echo "Cannot deactivate Volume Group $vg" >&2 any_umount_failed=1 @@ -408,6 +491,33 @@ done } +try_dismantle_luks() { + [ $HAVE_LUKS -eq 1 ] || return + case "$1" in + 1) iscsi_luks_current_pass="$iscsi_luks_pass1" ;; + 2|*) iscsi_luks_current_pass="$iscsi_luks_pass2" ;; + esac + + for luksDev in $iscsi_luks_current_pass ; do + luks_excluded=0 + hash_get device_sessions ISCSI_DEVICE_SESSIONS "$luksDev" + for device_session in $device_sessions ; do + if in_set ISCSI_EXCLUDED_SESSIONS "$device_session" ; then + luks_excluded=1 + fi + done + if [ $luks_excluded -eq 1 ] ; then + continue + fi + _luksName="$($DMSETUP info -c --noheadings -o name /dev/"$luksDev" 2>/dev/null || :)" + [ -n "${_luksName}" ] || continue + if ! $CRYPTSETUP close "${_luksName}" ; then + echo "Cannot dismantle cryptsetup device ${_luksName}" >&2 + any_umount_failed=1 + fi + done +} + # Don't do this if we are using systemd as init system, since systemd # takes care of network filesystems (including those marked _netdev) by # itself. @@ -430,6 +540,28 @@ fi [ $had_mount -eq 1 ] || echo " (none)" + echo "$0: would disable the following LUKS devices (second pass):" + had_luks=0 + if [ -n "$iscsi_luks_pass2" ] ; then + for v in ${iscsi_luks_pass2} ; do + luks_excluded=0 + hash_get device_sessions ISCSI_DEVICE_SESSIONS "$v" + for device_session in $device_sessions ; do + if in_set ISCSI_EXCLUDED_SESSIONS "$device_session" ; then + luks_excluded=1 + fi + done + if [ $luks_excluded -eq 1 ] ; then + continue + fi + _luksName="$($DMSETUP info -c --noheadings -o name /dev/"$v" 2>/dev/null || :)" + [ -n "${_luksName}" ] || continue + echo " ${_luksName}" + had_luks=1 + done + fi + [ $had_luks -eq 1 ] || echo " (none)" + echo "$0: would deactivate the following LVM Volume Groups:" had_vg=0 if [ -n "$iscsi_lvm_vgs" ] ; then @@ -451,6 +583,28 @@ fi [ $had_vg -eq 1 ] || echo " (none)" + echo "$0: would disable the following LUKS devices (first pass):" + had_luks=0 + if [ -n "$iscsi_luks_pass1" ] ; then + for v in ${iscsi_luks_pass1} ; do + luks_excluded=0 + hash_get device_sessions ISCSI_DEVICE_SESSIONS "$v" + for device_session in $device_sessions ; do + if in_set ISCSI_EXCLUDED_SESSIONS "$device_session" ; then + luks_excluded=1 + fi + done + if [ $luks_excluded -eq 1 ] ; then + continue + fi + _luksName="$($DMSETUP info -c --noheadings -o name /dev/"$v" 2>/dev/null || :)" + [ -n "${_luksName}" ] || continue + echo " ${_luksName}" + had_luks=1 + done + fi + [ $had_luks -eq 1 ] || echo " (none)" + echo "$0: would deactivate the following multipath volumes:" had_mp=0 if [ -n "$iscsi_multipath_disk_aliases" ] ; then @@ -497,7 +651,9 @@ any_umount_failed=0 try_umount +try_dismantle_luks 2 try_deactivate_lvm +try_dismantle_luks 1 try_dismantle_multipath while [ $any_umount_failed -ne 0 ] && ( [ $timeout -gt 0 ] || [ $timeout -eq -1 ] ) ; do @@ -509,7 +665,9 @@ enumerate_iscsi_devices any_umount_failed=0 try_umount + try_dismantle_luks 2 try_deactivate_lvm + try_dismantle_luks 1 try_dismantle_multipath if [ $timeout -gt 0 ] ; then timeout=$((timeout - 1)) diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/gbp.conf open-iscsi-2.0.874/debian/gbp.conf --- open-iscsi-2.0.873+git0.3b4b4500/debian/gbp.conf 1970-01-01 00:00:00.000000000 +0000 +++ open-iscsi-2.0.874/debian/gbp.conf 2017-08-03 20:04:27.000000000 +0000 @@ -0,0 +1,11 @@ +[DEFAULT] +pristine-tar = True +color = auto + +[import-orig] +dch = True + +[dch] +id-length = 7 +meta = True +multimaint-merge = True diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/iscsid.service open-iscsi-2.0.874/debian/iscsid.service --- open-iscsi-2.0.873+git0.3b4b4500/debian/iscsid.service 2017-02-16 20:47:58.000000000 +0000 +++ open-iscsi-2.0.874/debian/iscsid.service 2017-08-08 23:15:15.000000000 +0000 @@ -7,6 +7,7 @@ DefaultDependencies=no Conflicts=shutdown.target Before=shutdown.target +ConditionVirtualization=!private-users [Service] Type=forking diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/iscsiuio.docs open-iscsi-2.0.874/debian/iscsiuio.docs --- open-iscsi-2.0.873+git0.3b4b4500/debian/iscsiuio.docs 1970-01-01 00:00:00.000000000 +0000 +++ open-iscsi-2.0.874/debian/iscsiuio.docs 2017-08-03 20:04:27.000000000 +0000 @@ -0,0 +1,2 @@ +iscsiuio/RELEASE.TXT +iscsiuio/README diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/iscsiuio.init open-iscsi-2.0.874/debian/iscsiuio.init --- open-iscsi-2.0.873+git0.3b4b4500/debian/iscsiuio.init 1970-01-01 00:00:00.000000000 +0000 +++ open-iscsi-2.0.874/debian/iscsiuio.init 2017-08-03 20:04:27.000000000 +0000 @@ -0,0 +1,24 @@ +#!/bin/sh +# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing. +if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then + set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script +fi +### BEGIN INIT INFO +# Provides: iscsiuio +# Required-Start: $network $local_fs +# Required-Stop: $network $local_fs sendsigs +# X-Start-Before: iscsid +# X-Stop-After: iscsid +# Default-Start: S +# Default-Stop: 0 1 6 +# Short-Description: iSCSI userspace offloading daemon (iscsiuio) +# Description: Userspace daemon required for the hardware iSCSI +# offloading functionality of QLogic (formerly +# Broadcom) NetXtreme II cards. +### END INIT INFO + +# Author: Christian Seiler + +DESC="iSCSI userspace offloading daemon (iscsiuio)" +DAEMON=/sbin/iscsiuio +PIDFILE=/run/iscsiuio.pid diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/iscsiuio.install open-iscsi-2.0.874/debian/iscsiuio.install --- open-iscsi-2.0.873+git0.3b4b4500/debian/iscsiuio.install 1970-01-01 00:00:00.000000000 +0000 +++ open-iscsi-2.0.874/debian/iscsiuio.install 2017-08-03 20:04:27.000000000 +0000 @@ -0,0 +1,3 @@ +#!/usr/bin/dh-exec +iscsiuio/src/unix/iscsiuio /sbin +debian/extra/iscsiuio.initramfs.hook => /usr/share/initramfs-tools/hooks/iscsiuio diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/iscsiuio.manpages open-iscsi-2.0.874/debian/iscsiuio.manpages --- open-iscsi-2.0.873+git0.3b4b4500/debian/iscsiuio.manpages 1970-01-01 00:00:00.000000000 +0000 +++ open-iscsi-2.0.874/debian/iscsiuio.manpages 2017-08-03 20:04:27.000000000 +0000 @@ -0,0 +1 @@ +iscsiuio/docs/iscsiuio.8 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/iscsiuio.service open-iscsi-2.0.874/debian/iscsiuio.service --- open-iscsi-2.0.873+git0.3b4b4500/debian/iscsiuio.service 1970-01-01 00:00:00.000000000 +0000 +++ open-iscsi-2.0.874/debian/iscsiuio.service 2017-08-03 20:04:27.000000000 +0000 @@ -0,0 +1,18 @@ +[Unit] +Description=iSCSI userspace offloading daemon (iscsiuio) +Documentation=man:iscsiuio(8) +Documentation=file:///usr/share/doc/iscsiuio/README.gz +Wants=network.target +Before=iscsid.service +After=network.target +DefaultDependencies=no +Conflicts=shutdown.target +Before=shutdown.target + +[Service] +Type=forking +PIDFile=/run/iscsiuio.pid +ExecStart=/sbin/iscsiuio + +[Install] +WantedBy=sysinit.target diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/iscsiuio.triggers open-iscsi-2.0.874/debian/iscsiuio.triggers --- open-iscsi-2.0.873+git0.3b4b4500/debian/iscsiuio.triggers 1970-01-01 00:00:00.000000000 +0000 +++ open-iscsi-2.0.874/debian/iscsiuio.triggers 2017-08-03 20:04:27.000000000 +0000 @@ -0,0 +1 @@ +activate update-initramfs diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/manpages open-iscsi-2.0.874/debian/manpages --- open-iscsi-2.0.873+git0.3b4b4500/debian/manpages 2017-02-16 20:47:58.000000000 +0000 +++ open-iscsi-2.0.874/debian/manpages 2017-08-03 20:04:27.000000000 +0000 @@ -1,5 +1,5 @@ +doc/iscsi-iname.8 doc/iscsi_discovery.8 -doc/iscsid.8 doc/iscsiadm.8 +doc/iscsid.8 doc/iscsistart.8 -doc/iscsi-iname.8 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/open-iscsi.install open-iscsi-2.0.874/debian/open-iscsi.install --- open-iscsi-2.0.873+git0.3b4b4500/debian/open-iscsi.install 2017-02-16 20:47:58.000000000 +0000 +++ open-iscsi-2.0.874/debian/open-iscsi.install 2017-08-08 23:15:15.000000000 +0000 @@ -1,12 +1,13 @@ #!/usr/bin/dh-exec usr/iscsiadm /sbin -usr/iscsid /sbin -usr/iscsistart /sbin +build.deb/iscsid /sbin +build.deb/iscsistart /sbin utils/iscsi_discovery /sbin utils/iscsi-iname /sbin etc/iscsid.conf /etc/iscsi debian/extra/initramfs.hook => /usr/share/initramfs-tools/hooks/iscsi debian/extra/initramfs.local-top => /usr/share/initramfs-tools/scripts/local-top/iscsi +debian/extra/initramfs.local-bottom => /usr/share/initramfs-tools/scripts/local-bottom/iscsi debian/extra/umountiscsi.sh /lib/open-iscsi debian/extra/logout-all.sh /lib/open-iscsi debian/extra/startup-checks.sh /lib/open-iscsi diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/open-iscsi.service open-iscsi-2.0.874/debian/open-iscsi.service --- open-iscsi-2.0.873+git0.3b4b4500/debian/open-iscsi.service 2017-02-16 20:47:58.000000000 +0000 +++ open-iscsi-2.0.874/debian/open-iscsi.service 2017-08-08 23:15:20.000000000 +0000 @@ -7,7 +7,10 @@ DefaultDependencies=no Conflicts=shutdown.target Before=shutdown.target -ConditionVirtualization=!container +# Must have some pre-defined targets to login to +ConditionDirectoryNotEmpty=|/etc/iscsi/nodes +# or have a session to use via iscsid +ConditionDirectoryNotEmpty=|/sys/class/iscsi_session [Service] Type=oneshot diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/open-iscsi-udeb.dirs open-iscsi-2.0.874/debian/open-iscsi-udeb.dirs --- open-iscsi-2.0.873+git0.3b4b4500/debian/open-iscsi-udeb.dirs 2017-02-16 20:47:58.000000000 +0000 +++ open-iscsi-2.0.874/debian/open-iscsi-udeb.dirs 2017-08-03 20:04:27.000000000 +0000 @@ -1,4 +1,4 @@ bin -usr/lib/finish-install.d -sbin etc/iscsi +sbin +usr/lib/finish-install.d diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/open-iscsi-udeb.finish-install open-iscsi-2.0.874/debian/open-iscsi-udeb.finish-install --- open-iscsi-2.0.873+git0.3b4b4500/debian/open-iscsi-udeb.finish-install 2017-02-16 20:47:58.000000000 +0000 +++ open-iscsi-2.0.874/debian/open-iscsi-udeb.finish-install 2017-08-08 23:15:15.000000000 +0000 @@ -4,6 +4,11 @@ got_iscsi= for f in /etc/iscsi/*; do + # Ignore iscsid.conf, as that will always be present, even if + # iSCSI is not used. (See Debian bug #863435.) + if [ x"$f" = x"/etc/iscsi/iscsid.conf" ] ; then + continue + fi [ -e "$f" ] || continue got_iscsi=1 break @@ -12,4 +17,8 @@ if [ "$got_iscsi" ]; then # Copy the configuration to the target... cp -a /etc/iscsi /target/etc/ + if [ -x /target/usr/sbin/update-initramfs ] ; then + echo "iSCSI detected, refreshing initramfs" + /bin/in-target update-initramfs -k all -u + fi fi diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/patches/01_spelling-errors-and-manpage-hyphen-fixes.patch open-iscsi-2.0.874/debian/patches/01_spelling-errors-and-manpage-hyphen-fixes.patch --- open-iscsi-2.0.873+git0.3b4b4500/debian/patches/01_spelling-errors-and-manpage-hyphen-fixes.patch 2017-02-16 20:47:58.000000000 +0000 +++ open-iscsi-2.0.874/debian/patches/01_spelling-errors-and-manpage-hyphen-fixes.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,75 +0,0 @@ -spelling error fixes -Index: open-iscsi/doc/iscsiadm.8 -=================================================================== ---- open-iscsi.orig/doc/iscsiadm.8 2013-11-05 20:55:06.529420366 +0530 -+++ open-iscsi/doc/iscsiadm.8 2013-11-05 20:55:06.525420366 +0530 -@@ -2,10 +2,10 @@ - .SH NAME - iscsiadm \- open-iscsi administration utility - .SH SYNOPSIS --\fBiscsiadm\fR \-m discoverydb [ \-hV ] [ \-d debug_level ] [ \-P printlevel ] [ \-I iface \-t type \-p ip:port [ \-lD ] ] | [ [ -p ip:port -t type ] \ -+\fBiscsiadm\fR \-m discoverydb [ \-hV ] [ \-d debug_level ] [ \-P printlevel ] [ \-I iface \-t type \-p ip:port [ \-lD ] ] | [ [ \-p ip:port \-t type ] \ - [ \-o operation ] [ \-n name ] [ \-v value ] [ \-lD ] ] - --\fBiscsiadm\fR \-m discovery [ \-hV ] [ \-d debug_level ] [ \-P printlevel ] [ \-I iface \-t type \-p ip:port [ \-l ] ] | [ [ -p ip:port ] [ \-l | \-D ] ] -+\fBiscsiadm\fR \-m discovery [ \-hV ] [ \-d debug_level ] [ \-P printlevel ] [ \-I iface \-t type \-p ip:port [ \-l ] ] | [ [ \-p ip:port ] [ \-l | \-D ] ] - - \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 ] ] -@@ -70,7 +70,7 @@ - - Currently iscsiadm support ping as submode for iface. For example, - --iscsiadm -m iface -I ifacename -C ping -a ipaddr -b packetsize -c count -i interval -+iscsiadm \-m iface \-I ifacename \-C ping \-a ipaddr \-b packetsize \-c count \-i interval - - For host, it supports chap and flashnode as submodes. For example, - -@@ -125,7 +125,7 @@ - In discovery mode multiple interfaces can be specified by passing in multiple - \-I/\-\-interface instances. For example, - --"iscsiadm \-m discoverydb \-t st \-p ip:port \-I iface0 \-I iface2 --discover" -+"iscsiadm \-m discoverydb \-t st \-p ip:port \-I iface0 \-I iface2 \-\-discover" - - Will direct iscsiadm to setup the node db to create records which will create - sessions though the two intefaces passed in. -Index: open-iscsi/usr/auth.c -=================================================================== ---- open-iscsi.orig/usr/auth.c 2013-11-05 20:55:06.529420366 +0530 -+++ open-iscsi/usr/auth.c 2013-11-05 20:55:06.525420366 +0530 -@@ -2002,7 +2002,7 @@ - "AuthMethod negotiation failed", - "AuthMethod negotiated to none", - "CHAP algorithm negotiation failed", -- "CHAP challange reflected", -+ "CHAP challenge reflected", - "Local password same as remote", - "Local password not set", - "CHAP identifier bad", -Index: open-iscsi/usr/initiator_common.c -=================================================================== ---- open-iscsi.orig/usr/initiator_common.c 2013-11-05 20:55:06.529420366 +0530 -+++ open-iscsi/usr/initiator_common.c 2013-11-05 20:55:06.525420366 +0530 -@@ -77,7 +77,7 @@ - if (auth_cfg->username_in[0] || auth_cfg->password_in_length) { - /* sanity check the config */ - if (auth_cfg->password_length == 0) { -- log_warning("CHAP configuratoin has incoming " -+ log_warning("CHAP configuration has incoming " - "authentication credentials but has no " - "outgoing credentials configured."); - return EINVAL; -Index: open-iscsi/usr/netlink.c -=================================================================== ---- open-iscsi.orig/usr/netlink.c 2013-11-05 20:55:06.529420366 +0530 -+++ open-iscsi/usr/netlink.c 2013-11-05 20:55:06.525420366 +0530 -@@ -935,7 +935,7 @@ - iov[1].iov_len = sizeof(ev); - rc = __kipc_call(iov, 2); - if (rc < 0) { -- log_error("connnection %d:%d transport disconnect failed for " -+ log_error("connection %d:%d transport disconnect failed for " - "ep %" PRIu64 " with error %d.", conn->session->id, - conn->id, conn->transport_ep_handle, rc); - } else diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/patches/02_make-iscsistart-a-dynamic-binary.patch open-iscsi-2.0.874/debian/patches/02_make-iscsistart-a-dynamic-binary.patch --- open-iscsi-2.0.873+git0.3b4b4500/debian/patches/02_make-iscsistart-a-dynamic-binary.patch 2017-02-16 20:47:58.000000000 +0000 +++ open-iscsi-2.0.874/debian/patches/02_make-iscsistart-a-dynamic-binary.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -From 40ef398290064e0c52be9e0d2127901b0f91f20d Mon Sep 17 00:00:00 2001 -From: Ritesh Raj Sarraf -Date: Tue, 2 Feb 2010 11:43:29 +0530 -Subject: [PATCH 32/43] make iscsistart a dynamic binary - ---- - usr/Makefile | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -Index: open-iscsi/usr/Makefile -=================================================================== ---- open-iscsi.orig/usr/Makefile 2013-11-05 20:56:35.089418806 +0530 -+++ open-iscsi/usr/Makefile 2013-11-05 20:56:35.089418806 +0530 -@@ -62,7 +62,7 @@ - - iscsistart: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(FW_BOOT_SRCS) \ - iscsistart.o statics.o -- $(CC) $(CFLAGS) -static $^ -o $@ -+ $(CC) $(CFLAGS) $^ -o $@ - clean: - rm -f *.o $(PROGRAMS) .depend $(LIBSYS) - diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/patches/03_respect-build-flags.patch open-iscsi-2.0.874/debian/patches/03_respect-build-flags.patch --- open-iscsi-2.0.873+git0.3b4b4500/debian/patches/03_respect-build-flags.patch 2017-02-16 20:47:58.000000000 +0000 +++ open-iscsi-2.0.874/debian/patches/03_respect-build-flags.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -hardened build flags - wheezy release goal ---- a/usr/Makefile -+++ b/usr/Makefile -@@ -55,14 +55,14 @@ all: $(PROGRAMS) - - iscsid: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(DISCOVERY_SRCS) \ - iscsid.o session_mgmt.o discoveryd.o -- $(CC) $(CFLAGS) $^ -o $@ -L../utils/open-isns -lisns -+ $(CC) $(CFLAGS) $(LDFLAGS) $^ -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 -+ $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -L../utils/open-isns -lisns - - iscsistart: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(FW_BOOT_SRCS) \ - iscsistart.o statics.o -- $(CC) $(CFLAGS) $^ -o $@ -+ $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ - clean: - rm -f *.o $(PROGRAMS) .depend $(LIBSYS) - ---- a/utils/Makefile -+++ b/utils/Makefile -@@ -1,12 +1,12 @@ - # This Makefile will work only with GNU make. - --CFLAGS += $(OPTFLAGS) -O2 -fno-inline -Wall -Wstrict-prototypes -g -+CFLAGS += $(OPTFLAGS) -Wall -Wstrict-prototypes - PROGRAMS = iscsi-iname - - all: $(PROGRAMS) - - iscsi-iname: md5.o iscsi-iname.o -- $(CC) $(CFLAGS) $^ $(DBM_LIB) -o $@ -+ $(CC) $(CFLAGS) $(LDFLAGS) $^ $(DBM_LIB) -o $@ - - clean: - rm -f *.o $(PROGRAMS) .depend diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/patches/04_fix_iscsi_path.patch open-iscsi-2.0.874/debian/patches/04_fix_iscsi_path.patch --- open-iscsi-2.0.873+git0.3b4b4500/debian/patches/04_fix_iscsi_path.patch 2017-02-16 20:47:58.000000000 +0000 +++ open-iscsi-2.0.874/debian/patches/04_fix_iscsi_path.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -Fix path for iscsid as we ship it in /usr/sbin -Index: open-iscsi/etc/iscsid.conf -=================================================================== ---- open-iscsi.orig/etc/iscsid.conf 2013-11-05 20:56:42.941418667 +0530 -+++ open-iscsi/etc/iscsid.conf 2013-11-05 20:56:42.941418667 +0530 -@@ -20,7 +20,7 @@ - # iscsid.startup = /etc/rc.d/init.d/iscsid force-start - # - # Default for upstream open-iscsi scripts (uncomment to activate). --iscsid.startup = /sbin/iscsid -+iscsid.startup = /usr/sbin/iscsid - - - ############################# diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/patches/05-disable-iscsiuio.patch open-iscsi-2.0.874/debian/patches/05-disable-iscsiuio.patch --- open-iscsi-2.0.873+git0.3b4b4500/debian/patches/05-disable-iscsiuio.patch 2017-02-16 20:47:58.000000000 +0000 +++ open-iscsi-2.0.874/debian/patches/05-disable-iscsiuio.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -We are out of time for Jessie. Re-target for Jessie + 1 -Index: open-iscsi/Makefile -=================================================================== ---- open-iscsi.orig/Makefile 2013-11-05 20:53:59.489421548 +0530 -+++ open-iscsi/Makefile 2013-11-05 21:38:25.117374573 +0530 -@@ -32,7 +32,7 @@ - $(MAKE) -C utils/fwparam_ibft - $(MAKE) -C usr - $(MAKE) -C utils -- $(MAKE) -C iscsiuio -+ #$(MAKE) -C iscsiuio - @echo - @echo "Compilation complete Output file" - @echo "----------------------------------- ----------------" diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/patches/06_var-lock_var-run_transition open-iscsi-2.0.874/debian/patches/06_var-lock_var-run_transition --- open-iscsi-2.0.873+git0.3b4b4500/debian/patches/06_var-lock_var-run_transition 2017-02-16 20:47:58.000000000 +0000 +++ open-iscsi-2.0.874/debian/patches/06_var-lock_var-run_transition 1970-01-01 00:00:00.000000000 +0000 @@ -1,110 +0,0 @@ -Description: Move from /var/lock and /var/run to /run/lock and /run -Author: Stéphane Graber - -Index: open-iscsi-2.0.873+git0.3b4b4500/doc/iscsid.8 -=================================================================== ---- open-iscsi-2.0.873+git0.3b4b4500.orig/doc/iscsid.8 -+++ open-iscsi-2.0.873+git0.3b4b4500/doc/iscsid.8 -@@ -40,7 +40,7 @@ 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 -+\fI/run/iscsid.pid\fR - .TP - .BI [-h|--help] - display this help and exit -Index: open-iscsi-2.0.873+git0.3b4b4500/usr/initiator.h -=================================================================== ---- open-iscsi-2.0.873+git0.3b4b4500.orig/usr/initiator.h -+++ open-iscsi-2.0.873+git0.3b4b4500/usr/initiator.h -@@ -38,9 +38,9 @@ - #define CONFIG_FILE ISCSI_CONFIG_ROOT"iscsid.conf" - #define INITIATOR_NAME_FILE ISCSI_CONFIG_ROOT"initiatorname.iscsi" - --#define PID_FILE "/var/run/iscsid.pid" -+#define PID_FILE "/run/iscsid.pid" - #ifndef LOCK_DIR --#define LOCK_DIR "/var/lock/iscsi" -+#define LOCK_DIR "/run/lock/iscsi" - #endif - #define LOCK_FILE LOCK_DIR"/lock" - #define LOCK_WRITE_FILE LOCK_DIR"/lock.write" -Index: open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/paths.h -=================================================================== ---- open-iscsi-2.0.873+git0.3b4b4500.orig/utils/open-isns/paths.h -+++ open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/paths.h -@@ -13,7 +13,7 @@ - #define OPENISNS_VERSION_STRING "0.90" - - #define ISNS_ETCDIR "/etc/isns" --#define ISNS_RUNDIR "/var/run" -+#define ISNS_RUNDIR "/run" - #define ISNS_DEFAULT_ISNSD_CONFIG ISNS_ETCDIR "/isnsd.conf" - #define ISNS_DEFAULT_ISNSDD_CONFIG ISNS_ETCDIR "/isnsdd.conf" - #define ISNS_DEFAULT_ISNSADM_CONFIG ISNS_ETCDIR "/isnsadm.conf" -Index: open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/doc/isns_config.5 -=================================================================== ---- open-iscsi-2.0.873+git0.3b4b4500.orig/utils/open-isns/doc/isns_config.5 -+++ open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/doc/isns_config.5 -@@ -94,7 +94,7 @@ statically. - .TP - .BR PIDFile " (server): - This specifies the name of the server's PID file, which is --.B /var/run/isnsd.pid -+.B /run/isnsd.pid - by default. - .\" ------------------------------------------------------------------ - .SS Database Related Options -Index: open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/etc/openisns.init -=================================================================== ---- open-iscsi-2.0.873+git0.3b4b4500.orig/utils/open-isns/etc/openisns.init -+++ open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/etc/openisns.init -@@ -8,7 +8,7 @@ - # description: Starts and stops the iSCSI isns server - # - # processname: isnsd --# pidfile: /var/run/isnsd.pid -+# pidfile: /run/isnsd.pid - # config: /etc/isns/isnsd.conf - - # Source function library. -@@ -27,14 +27,14 @@ start() - success - echo - [ $RETVAL -eq 0 ] || return -- touch /var/lock/subsys/open-isns -+ touch /run/lock/subsys/open-isns - } - - stop() - { - echo -n "Stopping iSCSI isns service: " - killproc isnsd -- [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/open-isns -+ [ $RETVAL -eq 0 ] && rm -f /run/lock/subsys/open-isns - success - echo - -@@ -61,7 +61,7 @@ status) - RETVAL=$? - ;; - condrestart) -- [ -f /var/lock/subsys/open-isns ] && restart -+ [ -f /run/lock/subsys/open-isns ] && restart - ;; - *) - echo $"Usage: $0 {start|stop|restart|status|condrestart}" -Index: open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/main.c -=================================================================== ---- open-iscsi-2.0.873+git0.3b4b4500.orig/iscsiuio/src/unix/main.c -+++ open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/main.c -@@ -76,7 +76,7 @@ - ******************************************************************************/ - #define PFX "main " - --static const char default_pid_filepath[] = "/var/run/iscsiuio.pid"; -+static const char default_pid_filepath[] = "/run/iscsiuio.pid"; - - /******************************************************************************* - * Global Variables diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/patches/07_makefile_reproducibility_issues.patch open-iscsi-2.0.874/debian/patches/07_makefile_reproducibility_issues.patch --- open-iscsi-2.0.873+git0.3b4b4500/debian/patches/07_makefile_reproducibility_issues.patch 2017-02-16 20:47:58.000000000 +0000 +++ open-iscsi-2.0.874/debian/patches/07_makefile_reproducibility_issues.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -Description: Fix reproducibility issues in Makefiles - Intend to forward upstream as soon as Jenkins confirms that it fixes - reproducibility. -Author: Christian Seiler - ---- a/usr/Makefile -+++ b/usr/Makefile -@@ -35,7 +35,7 @@ CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -I../ - PROGRAMS = iscsid iscsiadm iscsistart - - # libc compat files --SYSDEPS_SRCS = $(wildcard ../utils/sysdeps/*.o) -+SYSDEPS_SRCS = $(sort $(wildcard ../utils/sysdeps/*.o)) - # sources shared between iscsid, iscsiadm and iscsistart - 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 \ -@@ -46,7 +46,7 @@ ISCSI_LIB_SRCS = iscsi_util.o io.o auth. - INITIATOR_SRCS = initiator.o scsi.o actor.o event_poll.o mgmt_ipc.o kern_err_table.o - - # fw boot files --FW_BOOT_SRCS = $(wildcard ../utils/fwparam_ibft/*.o) -+FW_BOOT_SRCS = $(sort $(wildcard ../utils/fwparam_ibft/*.o)) - - # core discovery files - DISCOVERY_SRCS = $(FW_BOOT_SRCS) strings.o discovery.o ---- a/utils/fwparam_ibft/Makefile -+++ b/utils/fwparam_ibft/Makefile -@@ -21,7 +21,7 @@ - # "Prasanna Mumbai" - # - --SYSDEPS_OBJS = $(wildcard ../sysdeps/*.o) -+SYSDEPS_OBJS = $(sort $(wildcard ../sysdeps/*.o)) - OBJS := fw_entry.o fwparam_sysfs.o $(SYSDEPS_OBJS) ../../usr/iscsi_net_util.o - OBJS += prom_lex.o prom_parse.tab.o fwparam_ppc.o - CLEANFILES = $(OBJS) *.output *~ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/patches/bugfixes/fix_iscsiuio_long_options.patch open-iscsi-2.0.874/debian/patches/bugfixes/fix_iscsiuio_long_options.patch --- open-iscsi-2.0.873+git0.3b4b4500/debian/patches/bugfixes/fix_iscsiuio_long_options.patch 1970-01-01 00:00:00.000000000 +0000 +++ open-iscsi-2.0.874/debian/patches/bugfixes/fix_iscsiuio_long_options.patch 2017-08-03 20:04:27.000000000 +0000 @@ -0,0 +1,71 @@ +Description: Fix iscsiuio long options +Author: Andrew Patterson +Bug: https://groups.google.com/forum/?_escaped_fragment_=msg/open-iscsi/PsT65Z4$ +Bug-Debian: https://bugs.debian.org/850057 +Last-Update: 2017-01-24 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/iscsiuio/src/unix/main.c ++++ b/iscsiuio/src/unix/main.c +@@ -82,10 +82,12 @@ + * Global Variables + ******************************************************************************/ + static const struct option long_options[] = { +- {"debug", 0, 0, 0}, +- {"version", 0, 0, 0}, +- {"help", 0, 0, 0}, +- {0, 0, 0, 0} ++ {"foreground", no_argument, NULL, 'f'}, ++ {"debug", required_argument, NULL, 'd'}, ++ {"pid", required_argument, NULL, 'p'}, ++ {"version", no_argument, NULL, 'v'}, ++ {"help", no_argument, NULL, 'h'}, ++ {NULL, no_argument, NULL, 0} + }; + + struct options opt = { +@@ -172,7 +174,7 @@ + printf("iscsiuio daemon.\n" + "-f, --foreground make the program run in the foreground\n" + "-d, --debug debuglevel print debugging information\n" +- "-p, --pid=pidfile use pid file (default %s).\n" ++ "-p, --pid pidfile use pid file (default %s).\n" + "-h, --help display this help and exit\n" + "-v, --version display version and exit\n", + default_pid_filepath); +--- a/iscsiuio/docs/iscsiuio.8 ++++ b/iscsiuio/docs/iscsiuio.8 +@@ -45,7 +45,7 @@ + .SH PARAMETERS + There are very few parameters when running this application. + .TP +-.BI -d ++.BI -d|--debug + This is to enable debug mode where debug messages will be sent to stdout + The following debug modes are supported + .P +@@ -61,20 +61,20 @@ + .PP + .TP + .TP +-.BI -f ++.BI -f|--foreground + This is to enable foreground mode so that this application doesn't get sent + into the background. + .PP + .TP +-.BI -v ++.BI -v|--version + This is to print the version. + .PP + .TP +-.BI -p ++.BI -p|--pid + Use pidfile (default /var/run/iscsiuio.pid ) + .PP + .TP +-.BI -h ++.BI -h|--help + Display this help and exit. + + diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/patches/bugfixes/move_offload_discovery_to_fw_get_targets.patch open-iscsi-2.0.874/debian/patches/bugfixes/move_offload_discovery_to_fw_get_targets.patch --- open-iscsi-2.0.873+git0.3b4b4500/debian/patches/bugfixes/move_offload_discovery_to_fw_get_targets.patch 1970-01-01 00:00:00.000000000 +0000 +++ open-iscsi-2.0.874/debian/patches/bugfixes/move_offload_discovery_to_fw_get_targets.patch 2017-08-03 20:04:27.000000000 +0000 @@ -0,0 +1,91 @@ +Description: Move iscsistart offload discovery/setup to fw_get_targets() +Author: Andrew Patterson +Bug: https://groups.google.com/forum/?_escaped_fragment_=msg/open-iscsi/PsT65Z4$ +Bug-Debian: https://bugs.debian.org/850057 +Last-Update: 2017-01-24 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/utils/fwparam_ibft/fw_entry.c ++++ b/utils/fwparam_ibft/fw_entry.c +@@ -64,26 +64,40 @@ + * For each target in iBFT bring up required NIC and use routing + * to force iSCSI traffic through correct NIC + */ +- list_for_each_entry(context, &targets, list) { +- /* if it is a offload nic ignore it */ +- if (!net_get_transport_name_from_netdev(context->iface, +- transport)) +- continue; +- ++ list_for_each_entry(context, &targets, list) { + if (iface_prev == NULL || strcmp(context->iface, iface_prev)) { +- /* Note: test above works because there is a +- * maximum of two targets in the iBFT +- */ +- iface_prev = context->iface; +- needs_bringup = 1; ++ /* Note: test above works because there is a ++ * maximum of two targets in the iBFT ++ */ ++ iface_prev = context->iface; ++ needs_bringup = 1; + } ++ if (net_get_transport_name_from_netdev(context->iface, transport)) { ++ /* Setup software NIC, */ ++ printf("Setting up software interface %s\n", context->iface); ++ err = net_setup_netdev(context->iface, context->ipaddr, ++ context->mask, context->gateway, ++ context->vlan, ++ context->target_ipaddr, needs_bringup); ++ if (err) { ++ printf("Setting up software interface %s failed\n", ++ context->iface); ++ ret = err; ++ } ++ } else { ++ /* Setup offload NIC. */ ++ struct iface_rec iface; ++ ++ memset(&iface, 0, sizeof(iface)); ++ iface_setup_defaults(&iface); ++ printf("Setting up offload interface %s\n", context->iface); ++ if (!iface_setup_from_boot_context(&iface, context)) { ++ printf("Setting up offload interface %s failed\n", ++ context->iface); + +- err = net_setup_netdev(context->iface, context->ipaddr, +- context->mask, context->gateway, +- context->vlan, +- context->target_ipaddr, needs_bringup); +- if (err) +- ret = err; ++ ret = ISCSI_ERR; ++ } ++ } + } + + fw_free_targets(&targets); +@@ -147,11 +161,7 @@ + + static void dump_initiator(struct boot_context *context) + { +- struct iface_rec iface; +- +- memset(&iface, 0, sizeof(iface)); +- iface_setup_defaults(&iface); +- iface_setup_from_boot_context(&iface, context); ++ char transport_name[ISCSI_TRANSPORT_NAME_MAXLEN]; + + if (strlen(context->initiatorname)) + printf("%s = %s\n", IFACE_INAME, context->initiatorname); +@@ -159,7 +169,9 @@ + if (strlen(context->isid)) + printf("%s = %s\n", IFACE_ISID, context->isid); + +- printf("%s = %s\n", IFACE_TRANSPORTNAME, iface.transport_name); ++ memset(transport_name, 0, ISCSI_TRANSPORT_NAME_MAXLEN); ++ if (!net_get_transport_name_from_netdev(context->iface, transport_name)) ++ printf("%s = %s\n", IFACE_TRANSPORTNAME, transport_name); + } + + static void dump_target(struct boot_context *context) diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/patches/bugfixes/need_iscsiuio_for_hardware_offload.patch open-iscsi-2.0.874/debian/patches/bugfixes/need_iscsiuio_for_hardware_offload.patch --- open-iscsi-2.0.873+git0.3b4b4500/debian/patches/bugfixes/need_iscsiuio_for_hardware_offload.patch 1970-01-01 00:00:00.000000000 +0000 +++ open-iscsi-2.0.874/debian/patches/bugfixes/need_iscsiuio_for_hardware_offload.patch 2017-08-03 20:04:27.000000000 +0000 @@ -0,0 +1,50 @@ +Description: iscsiuio must be present to use hardware offload for bnx2x +Author: Andrew Patterson +Bug: https://groups.google.com/forum/?_escaped_fragment_=msg/open-iscsi/PsT65Z4Gx3I/GUObdlVvCQAJ#!msg/open-iscsi/PsT65Z4Gx3I/GUObdlVvCQAJ +Bug-Debian: https://bugs.debian.org/850057 +Last-Update: 2017-01-24 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/include/iscsi_net_util.h ++++ b/include/iscsi_net_util.h +@@ -2,6 +2,7 @@ + #define __ISCSI_NET_UTIL_h__ + + #define ISCSI_HWADDRESS_BUF_SIZE 18 ++#define ISCSIUIO_PATH "/sbin/iscsiuio" + + extern int net_get_transport_name_from_netdev(char *netdev, char *transport); + extern int net_get_netdev_from_hwaddress(char *hwaddress, char *netdev); +--- a/usr/iscsi_net_util.c ++++ b/usr/iscsi_net_util.c +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -81,6 +82,22 @@ int net_get_transport_name_from_netdev(c + goto close_sock; + } + ++ /* ++ * iSCSI hardware offload for bnx2{,x} is only supported if the ++ * iscsiuio executable is available. ++ */ ++ if (!strcmp(drvinfo.driver, "bnx2x") || ++ !strcmp(drvinfo.driver, "bnx2")) { ++ struct stat buf; ++ ++ if (stat(ISCSIUIO_PATH, &buf) < 0) { ++ log_debug(1, "ISCSI offload not supported " ++ "(%s not found).", ISCSIUIO_PATH); ++ err = ENODEV; ++ goto close_sock; ++ } ++ } ++ + for (i = 0; net_drivers[i].net_drv_name != NULL; i++) { + struct iscsi_net_driver *net_driver = &net_drivers[i]; + diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/patches/bugfixes/no-make-clean-kernel.patch open-iscsi-2.0.874/debian/patches/bugfixes/no-make-clean-kernel.patch --- open-iscsi-2.0.873+git0.3b4b4500/debian/patches/bugfixes/no-make-clean-kernel.patch 1970-01-01 00:00:00.000000000 +0000 +++ open-iscsi-2.0.874/debian/patches/bugfixes/no-make-clean-kernel.patch 2017-08-03 20:04:27.000000000 +0000 @@ -0,0 +1,18 @@ +Description: Don't run make -C kernel clean + The kernel modules are no longer built (part of mainline), so don't + run make -C kernel clean on make clean. +Author: Christian Seiler +Forwarded: not-yet +Last-Update: 2016-07-27 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/Makefile ++++ b/Makefile +@@ -75,7 +75,6 @@ clean: + $(MAKE) -C utils/fwparam_ibft clean + $(MAKE) -C utils clean + $(MAKE) -C usr clean +- $(MAKE) -C kernel clean + [ ! -f iscsiuio/Makefile ] || $(MAKE) -C iscsiuio clean + [ ! -f iscsiuio/Makefile ] || $(MAKE) -C iscsiuio distclean + diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/patches/debian/dont-link-against-openssl.patch open-iscsi-2.0.874/debian/patches/debian/dont-link-against-openssl.patch --- open-iscsi-2.0.873+git0.3b4b4500/debian/patches/debian/dont-link-against-openssl.patch 1970-01-01 00:00:00.000000000 +0000 +++ open-iscsi-2.0.874/debian/patches/debian/dont-link-against-openssl.patch 2017-08-03 20:04:27.000000000 +0000 @@ -0,0 +1,27 @@ +Description: Don't link against OpenSSL + GPL programs are legally not allowed to be linked against OpenSSL in + Debian. Link against libisns-nocrypto instead of libisns, and don't + link against libcrypto. + . + As the iSNS functionality in open-iscsi does not use the cryptographic + capabilities of open-isns anyway, this has no impact on functionality. +Author: Christian Seiler +Forwarded: not-needed (Debian-specific) +Last-Update: 2016-07-27 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/usr/Makefile ++++ b/usr/Makefile +@@ -54,10 +54,10 @@ all: $(PROGRAMS) + + iscsid: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(DISCOVERY_SRCS) \ + iscsid.o session_mgmt.o discoveryd.o mntcheck.o +- $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -lisns -lcrypto -lrt -lmount ++ $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -lisns-nocrypto -lrt -lmount + + iscsiadm: $(ISCSI_LIB_SRCS) $(DISCOVERY_SRCS) iscsiadm.o session_mgmt.o mntcheck.o +- $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -lisns -lcrypto -lmount ++ $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -lisns-nocrypto -lmount + + iscsistart: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(FW_BOOT_SRCS) \ + iscsistart.o statics.o diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/patches/debian/udeb-without-libmount.patch open-iscsi-2.0.874/debian/patches/debian/udeb-without-libmount.patch --- open-iscsi-2.0.873+git0.3b4b4500/debian/patches/debian/udeb-without-libmount.patch 1970-01-01 00:00:00.000000000 +0000 +++ open-iscsi-2.0.874/debian/patches/debian/udeb-without-libmount.patch 2017-08-03 20:04:27.000000000 +0000 @@ -0,0 +1,115 @@ +Description: Temporarily support builds without libmount + libmount is not available as an udeb at the moment, so in order for + the udeb not to break, temporarily support builds without libmount + for d-i environments (removing the safety check at session shutdown). + This is not intended for upstream, only as a stop-gap measure until + a libmount udeb is available again. +Forwarded: no +Author: Christian Seiler +Bug-Debian: https://bugs.debian.org/834241 +Last-Update: 2016-08-14 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/usr/Makefile ++++ b/usr/Makefile +@@ -33,6 +33,8 @@ WARNFLAGS ?= -Wall -Wstrict-prototypes + CFLAGS += $(WARNFLAGS) -I../include -I. -D$(OSNAME) $(IPC_CFLAGS) + PROGRAMS = iscsid iscsiadm iscsistart + ++LIBMOUNT_LIB = -lmount ++ + # libc compat files + SYSDEPS_SRCS = $(sort $(wildcard ../utils/sysdeps/*.o)) + # sources shared between iscsid, iscsiadm and iscsistart +@@ -54,10 +56,10 @@ all: $(PROGRAMS) + + iscsid: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(DISCOVERY_SRCS) \ + iscsid.o session_mgmt.o discoveryd.o mntcheck.o +- $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -lisns-nocrypto -lrt -lmount ++ $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -lisns-nocrypto -lrt $(LIBMOUNT_LIB) + + iscsiadm: $(ISCSI_LIB_SRCS) $(DISCOVERY_SRCS) iscsiadm.o session_mgmt.o mntcheck.o +- $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -lisns-nocrypto -lmount ++ $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -lisns-nocrypto $(LIBMOUNT_LIB) + + iscsistart: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(FW_BOOT_SRCS) \ + iscsistart.o statics.o +--- a/usr/initiator_common.c ++++ b/usr/initiator_common.c +@@ -24,7 +24,9 @@ + #include + #include + #include ++#ifndef NO_LIBMOUNT + #include ++#endif + + #include "initiator.h" + #include "transport.h" +--- a/usr/mntcheck.c ++++ b/usr/mntcheck.c +@@ -22,7 +22,9 @@ + #include + #include + #include ++#ifndef NO_LIBMOUNT + #include ++#endif + + #include "initiator.h" + #include "transport.h" +@@ -37,6 +39,7 @@ + #include "iscsi_err.h" + #include "iscsi_net_util.h" + ++#ifndef NO_LIBMOUNT + static struct libmnt_table *mtab, *swaps; + static struct libmnt_cache *mntcache; + +@@ -66,6 +69,7 @@ static int libmount_init(void) + mnt_table_parse_swaps(swaps, NULL); + return 0; + } ++#endif + + static int trans_filter(const struct dirent *d) + { +@@ -97,6 +101,7 @@ static int is_partition(const char *path + + static int blockdev_check_mnts(char *syspath) + { ++#ifndef NO_LIBMOUNT + struct libmnt_fs *fs; + char *devname = NULL; + char *_devname = NULL; +@@ -123,6 +128,9 @@ out: + free(devname); + free(_devname); + return rc; ++#else ++ return 0; ++#endif + } + + static int count_device_users(char *syspath); +@@ -218,16 +226,20 @@ int session_in_use(int sid) + int host_no = -1, err = 0; + int count = 0; + ++#ifndef NO_LIBMOUNT + if (libmount_init()) { + log_error("Failed to initialize libmount, " + "not checking for active mounts on session [%d].", sid); + return 0; + } ++#endif + + host_no = iscsi_sysfs_get_host_no_from_sid(sid, &err); + if (!err) + iscsi_sysfs_for_each_device(&count, host_no, sid, device_in_use); + ++#ifndef NO_LIBMOUNT + libmount_cleanup(); ++#endif + return count; + } diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/patches/debian/var-run-lock.patch open-iscsi-2.0.874/debian/patches/debian/var-run-lock.patch --- open-iscsi-2.0.873+git0.3b4b4500/debian/patches/debian/var-run-lock.patch 1970-01-01 00:00:00.000000000 +0000 +++ open-iscsi-2.0.874/debian/patches/debian/var-run-lock.patch 2017-08-03 20:04:27.000000000 +0000 @@ -0,0 +1,39 @@ +Description: Move from /var/lock and /var/run to /run/lock and /run +Author: Stéphane Graber + +--- a/doc/iscsid.8 ++++ b/doc/iscsid.8 +@@ -40,7 +40,7 @@ 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 ++\fI/run/iscsid.pid\fR + .TP + .BI [-h|--help] + display this help and exit +--- a/usr/initiator.h ++++ b/usr/initiator.h +@@ -38,9 +38,9 @@ + #define CONFIG_FILE ISCSI_CONFIG_ROOT"iscsid.conf" + #define INITIATOR_NAME_FILE ISCSI_CONFIG_ROOT"initiatorname.iscsi" + +-#define PID_FILE "/var/run/iscsid.pid" ++#define PID_FILE "/run/iscsid.pid" + #ifndef LOCK_DIR +-#define LOCK_DIR "/var/lock/iscsi" ++#define LOCK_DIR "/run/lock/iscsi" + #endif + #define LOCK_FILE LOCK_DIR"/lock" + #define LOCK_WRITE_FILE LOCK_DIR"/lock.write" +--- a/iscsiuio/src/unix/main.c ++++ b/iscsiuio/src/unix/main.c +@@ -76,7 +76,7 @@ + ******************************************************************************/ + #define PFX "main " + +-static const char default_pid_filepath[] = "/var/run/iscsiuio.pid"; ++static const char default_pid_filepath[] = "/run/iscsiuio.pid"; + + /******************************************************************************* + * Global Variables diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/patches/series open-iscsi-2.0.874/debian/patches/series --- open-iscsi-2.0.873+git0.3b4b4500/debian/patches/series 2017-02-16 20:47:58.000000000 +0000 +++ open-iscsi-2.0.874/debian/patches/series 2017-08-03 20:04:27.000000000 +0000 @@ -1,7 +1,7 @@ -01_spelling-errors-and-manpage-hyphen-fixes.patch -02_make-iscsistart-a-dynamic-binary.patch -03_respect-build-flags.patch -04_fix_iscsi_path.patch -05-disable-iscsiuio.patch -06_var-lock_var-run_transition -07_makefile_reproducibility_issues.patch +bugfixes/no-make-clean-kernel.patch +debian/var-run-lock.patch +debian/dont-link-against-openssl.patch +debian/udeb-without-libmount.patch +bugfixes/need_iscsiuio_for_hardware_offload.patch +bugfixes/move_offload_discovery_to_fw_get_targets.patch +bugfixes/fix_iscsiuio_long_options.patch diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/po/pt_BR.po open-iscsi-2.0.874/debian/po/pt_BR.po --- open-iscsi-2.0.873+git0.3b4b4500/debian/po/pt_BR.po 1970-01-01 00:00:00.000000000 +0000 +++ open-iscsi-2.0.874/debian/po/pt_BR.po 2017-08-03 20:04:27.000000000 +0000 @@ -0,0 +1,181 @@ +# Debconf translations for open-iscsi. +# Copyright (C) 2015 THE open-iscsi'S COPYRIGHT HOLDER +# This file is distributed under the same license as the open-iscsi package. +# Adriano Rafael Gomes , 2015. +# +msgid "" +msgstr "" +"Project-Id-Version: open-iscsi\n" +"Report-Msgid-Bugs-To: open-iscsi@packages.debian.org\n" +"POT-Creation-Date: 2015-09-30 06:58+0200\n" +"PO-Revision-Date: 2015-10-01 21:28-0300\n" +"Last-Translator: Adriano Rafael Gomes \n" +"Language-Team: Brazilian Portuguese \n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../open-iscsi.templates:2001 +msgid "Proceed with removing open-iscsi?" +msgstr "Prosseguir com a remoção do open-iscsi?" + +#. Type: boolean +#. Description +#: ../open-iscsi.templates:2001 +msgid "" +"There are currently active iSCSI sessions. If you remove open-iscsi now this " +"may lead to data loss and/or hang the system at shutdown." +msgstr "" +"Existem sessões iSCSI ativas atualmente. Se você remover o open-iscsi agora, " +"isso pode levar a perda de dados e/ou travamento do sistema ao desligá-lo." + +#. Type: boolean +#. Description +#: ../open-iscsi.templates:2001 +msgid "Do not do this if this system's root filesystem is on iSCSI." +msgstr "" +"Não faça isso se o sistema de arquivos root desse sistema estiver sobre " +"iSCSI." + +#. Type: boolean +#. Description +#: ../open-iscsi.templates:2001 +msgid "" +"If you do proceed, open-iscsi will try to unmount all filesystems on iSCSI " +"and log out from current sessions. If that fails (because a filesystem is " +"still in use), the kernel will keep the current iSCSI sessions open, but " +"will not perform any recovery if there is an interruption of the network " +"connection (or if the target is rebooted)." +msgstr "" +"Se você prosseguir, o open-iscsi tentará desmontar todos os sistemas de " +"arquivos sobre iSCSI e fazer \"log out\" das sessões atuais. Se isso falhar " +"(porque um sistema de arquivos ainda estiver em uso), o kernel manterá as " +"sessões iSCSI atuais abertas, mas não executará qualquer recuperação se " +"houver uma interrupção na conexão de rede (ou se o alvo for reinicializado)." + +#. Type: boolean +#. Description +#: ../open-iscsi.templates:2001 +msgid "" +"If you really intend to remove open-iscsi, you should abort here and then " +"stop open-iscsi:" +msgstr "" +"Se você realmente pretende remover o open-iscsi, você deve cancelar aqui e " +"então parar o open-iscsi:" + +#. Type: boolean +#. Description +#: ../open-iscsi.templates:2001 +msgid "" +"If that did not clean up everything, manually umount all filesystems that " +"are on iSCSI, manually dismantle the storage stack, and only then log out " +"from all iSCSI sessions:" +msgstr "" +"Se isso não tiver limpado tudo, desmonte manualmente todos os sistemas de " +"arquivos que estejam sobre iSCSI, desfaça a pilha de armazenamento, e " +"somente então faça \"log out\" de todas as sessões iSCSI:" + +#. Type: boolean +#. Description +#: ../open-iscsi.templates:2001 +msgid "At that point, it should be safe to remove this package." +msgstr "Nesse ponto, deve ser seguro remover esse pacote." + +#. Type: boolean +#. Description +#: ../open-iscsi.templates:3001 +msgid "Proceed with upgrading open-iscsi?" +msgstr "Prosseguir com a atualização do open-iscsi?" + +#. Type: boolean +#. Description +#: ../open-iscsi.templates:3001 +msgid "" +"There are currently failed iSCSI sessions. Upgrading open-iscsi may cause " +"data loss." +msgstr "" +"Existem sessões iSCSI falhadas atualmente. Atualizar o open-iscsi pode " +"causar perda de dados." + +#. Type: boolean +#. Description +#: ../open-iscsi.templates:3001 +msgid "" +"If you do not proceed, the preinstallation script will be aborted and you " +"will have the option to manually recover the iSCSI sessions. (Note that " +"aborting an upgrade is problematic if you are dist-upgrading your entire " +"system.) You may also recover the iSCSI sessions manually while keeping this " +"prompt open and then choose to proceed. Or you may choose to proceed " +"directly, after which iscsid will be restarted and session recovery will be " +"attempted once more." +msgstr "" +"Se você não prosseguir, o script de pré instalação será cancelado e você " +"terá a opção de recuperar manualmente as sessões iSCSI. (Note que cancelar " +"uma atualização é problemático se você estiver fazendo um \"dist-upgrade\" " +"de seu sistema todo.) Você também pode recuperar as sessões iSCSI " +"manualmente enquanto mantém essa tela aberta e depois escolher prosseguir. " +"Ou você pode escolher prosseguir diretamente, após o que o iscsid reiniciará " +"e a recuperação de sessões será tentada mais uma vez." + +#. Type: error +#. Description +#: ../open-iscsi.templates:4001 +msgid "iSCSI recovery error on upgrade" +msgstr "Erro de recuperação iSCSI na atualização" + +#. Type: error +#. Description +#: ../open-iscsi.templates:4001 +msgid "" +"The iscsid daemon was restarted, but couldn't recover all iSCSI sessions. " +"This is bad and could lead to data loss. Please check the system and kernel " +"logs to determine the cause of the issue." +msgstr "" +"O daemon iscsid foi reiniciado, mas não conseguiu recuperar todas as sessões " +"iSCSI. Isso é ruim e pode levar a perda de dados. Por favor, verifique os " +"\"logs\" do kernel e do sistema para descobrir a causa do problema." + +#. Type: error +#. Description +#: ../open-iscsi.templates:4001 +msgid "" +"Please do not acknowledge this note until you have fixed the problem from a " +"separate login shell." +msgstr "" +"Por favor, não confirme esse aviso até que você tenha corrigido o problema a " +"partir de um \"login shell\" separado." + +#. Type: boolean +#. Description +#: ../open-iscsi.templates:5001 +msgid "Proceed with downgrading open-iscsi?" +msgstr "Prosseguir com o rebaixamento de versão do open-iscsi?" + +#. Type: boolean +#. Description +#: ../open-iscsi.templates:5001 +msgid "" +"You are trying to downgrade open-iscsi. Because of changes between the " +"version you are downgrading to and the version currently installed, this " +"downgrade will break the system." +msgstr "" +"Você está tentando rebaixar a versão do open-iscsi. Por causa de mudanças " +"entre a versão para a qual você está rebaixando e a versão instalada " +"atualmente, esse rebaixamento de versão quebrará o sistema." + +#. Type: boolean +#. Description +#: ../open-iscsi.templates:5001 +msgid "" +"If you really intend to downgrade, please follow the following procedure " +"instead: umount all iSCSI file systems, log out of all iSCSI sessions, back " +"up /etc/iscsi, purge open-iscsi, and reinstall the older version." +msgstr "" +"Se você realmente pretende rebaixar a versão, por favor, ao invés disso siga " +"este procedimento: desmonte todos os sistemas de arquivos iSCSI, faça \"log " +"out\" de todas as sessões iSCSI, faça um cópia de /etc/iscsi, expurgue o " +"open-iscsi, e reinstale a versão antiga." diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/postinst.modules.in open-iscsi-2.0.874/debian/postinst.modules.in --- open-iscsi-2.0.873+git0.3b4b4500/debian/postinst.modules.in 2017-02-16 20:47:58.000000000 +0000 +++ open-iscsi-2.0.874/debian/postinst.modules.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -#!/bin/sh - -set -e - -if [ "`uname -r`" = "_KVERS_" ]; then - /sbin/depmod -a & -fi - -#DEBHELPER# - -exit 0 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/README.Debian open-iscsi-2.0.874/debian/README.Debian --- open-iscsi-2.0.873+git0.3b4b4500/debian/README.Debian 2017-02-16 20:47:58.000000000 +0000 +++ open-iscsi-2.0.874/debian/README.Debian 2017-08-03 20:04:27.000000000 +0000 @@ -124,11 +124,31 @@ Eg: ISCSI_TARGET_IP="192.168.1.1 192.168.2.1 192.168.3.1" This will allow login into all the Target IPs in the initrafs. + +QLogic/Broadcom (bnx2/bnx2x) Offloading +----------------------------------- + +Cards managed by the bnx2 / bnx2x driver support hardware offloading of +iSCSI sessions. To enable support for this, please install the iscsiuio +package. Further details can be found in the package's README file, +located in /usr/share/doc/iscsiuio/README.gz. + + +Booting with Hardware Offloading +----------------------------------- + +Booting from volumes accessed via hardware offloaded devices is +supported. For bnx2/bnx2x cards the iscsiuio package must be installed. +At the moment this is only supported when using automatic NIC +configuration at boot time when using iscsi_auto on the kernel command +line or ISCSI_AUTO=true in /etc/iscsi/iscsi.initramfs (see above). + + initramfs integration ----------------------------------- open-iscsi binaries are added to the initramfs, regardless of whether -/etc/iscsi/iscsi.initramfs exists, because kernel parameters could be be used +/etc/iscsi/iscsi.initramfs exists, because kernel parameters could be used to specify iSCSI parameters regardless of its existence. If you don't have the root or /usr filesystem on iSCSI and want to keep the diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/rules open-iscsi-2.0.874/debian/rules --- open-iscsi-2.0.873+git0.3b4b4500/debian/rules 2017-02-16 20:47:58.000000000 +0000 +++ open-iscsi-2.0.874/debian/rules 2017-08-03 20:04:27.000000000 +0000 @@ -2,14 +2,11 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -DPKG_EXPORT_BUILDFLAGS = 1 -include /usr/share/dpkg/default.mk - export DEB_BUILD_MAINT_OPTIONS = hardening=+all -export DEB_CFLAGS_MAINT_APPEND = -Wall +export DEB_CFLAGS_MAINT_APPEND = -Wall -DOFFLOAD_BOOT_SUPPORTED -# open-iscsi's build system uses OPTFLAGS to set CFLAGS -export OPTFLAGS = $(CPPFLAGS) $(CFLAGS) +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/default.mk %: dh $@ --with autotools_dev,autoreconf,systemd @@ -20,19 +17,37 @@ uscan --force-download --rename --repack --download-version=$(DEB_UPSTREAM_VERSION) --destdir=. override_dh_auto_build: - $(MAKE) -C utils/fwparam_ibft - $(MAKE) user - $(MAKE) -C utils - -override_dh_auto_clean: - $(MAKE) -C utils/fwparam_ibft clean - $(MAKE) -C usr clean - $(MAKE) -C utils clean - rm -rf modules + @# We want to regenerate the parser/lexer files with bison/flex + @# to make sure that the package is fully built from source. + @# Store the generated files upstream added to the source + @# tarball away and explicitly call flex/bison here. + mv utils/fwparam_ibft/prom_lex.c utils/fwparam_ibft/prom_lex.c.upstream + mv utils/fwparam_ibft/prom_parse.tab.c utils/fwparam_ibft/prom_parse.tab.c.upstream + mv utils/fwparam_ibft/prom_parse.tab.h utils/fwparam_ibft/prom_parse.tab.h.upstream + cd utils/fwparam_ibft && flex -t prom_lex.l | \ + ../../debian/workaround_flex_bug.sh > prom_lex.c + cd utils/fwparam_ibft && bison -d prom_parse.y + + @# The build system doesn't support CPPFLAGS + env CFLAGS="$(CPPFLAGS) $(CFLAGS)" dh_auto_build + @# Build udeb variant without libmount + mkdir -p build.deb + cp -a usr/iscsid usr/iscsistart build.deb/ + rm usr/initiator_common.o usr/mntcheck.o usr/iscsid usr/iscsistart + env CFLAGS="$(CPPFLAGS) $(CFLAGS) -DNO_LIBMOUNT" dh_auto_build -- LIBMOUNT_LIB= override_dh_auto_install: @# do nothing, we install stuff with dh_install etc. +override_dh_auto_clean: + dh_auto_clean + rm -rf build.deb + @# Make dpkg-source happy and restore upstream's generated lexer/parser files + @# in the clean step. + ! [ -f utils/fwparam_ibft/prom_lex.c.upstream ] || mv utils/fwparam_ibft/prom_lex.c.upstream utils/fwparam_ibft/prom_lex.c + ! [ -f utils/fwparam_ibft/prom_parse.tab.c.upstream ] || mv utils/fwparam_ibft/prom_parse.tab.c.upstream utils/fwparam_ibft/prom_parse.tab.c + ! [ -f utils/fwparam_ibft/prom_parse.tab.h.upstream ] || mv utils/fwparam_ibft/prom_parse.tab.h.upstream utils/fwparam_ibft/prom_parse.tab.h + override_dh_fixperms: dh_fixperms @# That configuration file might contain authentication data, so @@ -48,16 +63,23 @@ chmod 0600 $(CURDIR)/debian/open-iscsi-udeb/etc/iscsi/iscsid.conf ; \ fi +override_dh_installchangelogs: + dh_installchangelogs -piscsiuio iscsiuio/ChangeLog + dh_installchangelogs --remaining-packages + override_dh_installinit: - dh_installinit --no-start --name=iscsid - dh_installinit --no-start + dh_installinit -popen-iscsi --no-start --name=iscsid + dh_installinit -popen-iscsi --no-start + dh_installinit --remaining-packages override_dh_systemd_enable: - dh_systemd_enable --name=iscsid - dh_systemd_enable + dh_systemd_enable -popen-iscsi --name=iscsid + dh_systemd_enable -popen-iscsi + dh_systemd_enable --remaining-packages override_dh_systemd_start: dh_systemd_start -popen-iscsi --no-restart-on-upgrade --no-start iscsid.service open-iscsi.service + dh_systemd_start --remaining-packages # The following is taken from the initramfs-tools package. (We recommend # busybox in the initramfs because otherwise we don't have access to the diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/rules.modules open-iscsi-2.0.874/debian/rules.modules --- open-iscsi-2.0.873+git0.3b4b4500/debian/rules.modules 2017-02-16 20:47:58.000000000 +0000 +++ open-iscsi-2.0.874/debian/rules.modules 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -#!/usr/bin/make -f - -# module-assistant stuff -PACKAGE = linux-iscsi-modules -MA_DIR ?= /usr/share/modass --include $(MA_DIR)/include/generic.make --include $(MA_DIR)/include/common-rules.make - -kdist_clean: prep-deb-files - dh_clean - #$(MAKE) clean KERNEL_PATH=$(KSRC) - make clean - -kdist_config: prep-deb-files - -TARGET = $(CURDIR)/debian/linux-iscsi-modules-$(KVERS) -MODULES_TARGET = $(TARGET)/lib/modules/$(KVERS)/kernel/net/iscsi - -binary-modules: kdist_config - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs lib/modules/$(KVERS) - - # build and install the module - patch -d kernel < kernel/backward-compile-2.6.11.patch - make -C kernel KSRC=$(KSRC) - mkdir -p $(MODULES_TARGET) - install -m 755 kernel/iscsi_tcp.ko $(MODULES_TARGET) - install -m 755 kernel/scsi_transport_iscsi.ko $(MODULES_TARGET) - - dh_installdocs - dh_installchangelogs - dh_compress - dh_fixperms - dh_installdeb - dh_gencontrol -- -v$(VERSION) - dh_md5sums - dh_builddeb --destdir=$(DEB_DESTDIR) diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/tests/control open-iscsi-2.0.874/debian/tests/control --- open-iscsi-2.0.873+git0.3b4b4500/debian/tests/control 2017-02-16 20:47:58.000000000 +0000 +++ open-iscsi-2.0.874/debian/tests/control 2017-08-08 23:15:15.000000000 +0000 @@ -1,3 +1,11 @@ -Tests: install sysvinit-install daemon testsuite +Tests: install +Restrictions: needs-root isolation-machine breaks-testbed +Depends: + +Tests: testsuite Restrictions: needs-root isolation-machine breaks-testbed Depends: open-iscsi, python, tgt, qemu-system, ubuntu-cloudimage-keyring, simplestreams, python-netifaces, distro-info, cloud-image-utils, dctrl-tools, rsync + +Tests: nested +Restrictions: needs-root, isolation-machine, breaks-testbed, allow-stderr +Depends: targetcli-fb, autopkgtest (>= 4~), qemu-system, qemu-utils, python3, python3-netifaces diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/tests/control.nested open-iscsi-2.0.874/debian/tests/control.nested --- open-iscsi-2.0.873+git0.3b4b4500/debian/tests/control.nested 1970-01-01 00:00:00.000000000 +0000 +++ open-iscsi-2.0.874/debian/tests/control.nested 2017-08-03 20:04:27.000000000 +0000 @@ -0,0 +1,3 @@ +Tests: login +Restrictions: needs-root, isolation-machine, breaks-testbed +Depends: open-iscsi diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/tests/find_free_ip.py open-iscsi-2.0.874/debian/tests/find_free_ip.py --- open-iscsi-2.0.873+git0.3b4b4500/debian/tests/find_free_ip.py 1970-01-01 00:00:00.000000000 +0000 +++ open-iscsi-2.0.874/debian/tests/find_free_ip.py 2017-08-03 20:04:27.000000000 +0000 @@ -0,0 +1,93 @@ +#!/usr/bin/python3 + +import ipaddress, netifaces, socket, subprocess +from functools import reduce + +# These are the private IP ranges that are available. +allowed_ranges = list(map(lambda x: ipaddress.IPv4Network(x), [ + '10.0.0.0/8', + '172.16.0.0/12', + '192.168.0.0/16' +])) + +# Exclude IP addresses we have already assigned to ourselves +def network_links(): + for interface in netifaces.interfaces(): + for link in netifaces.ifaddresses(interface).get(netifaces.AF_INET, ()): + yield link +own_ranges = [ipaddress.IPv4Network('%s/%s' % (link['addr'], link['netmask']), strict=False) for link in network_links()] + +# Exclude any /24 range containing the nameserver +try: + with open('/etc/resolv.conf', 'r') as f: + for line in f: + line = line.split() + if len(line) != 2: + continue + if line[0] == 'nameserver': + try: + range = ipaddress.IPv4Network('%s/24' % line[1], strict=False) + own_ranges.append(range) + except ipaddress.AddressValueError: + pass +except IOError: + pass + +# Exclude any /24 range containing the APT proxy +try: + for line in subprocess.check_output(['apt-config', 'dump', '--format=%v%n', 'Acquire::http::Proxy']).split(b'\n'): + try: + line = line.decode() + # ignore IPv6 + if len(line) == 0 or line[0] == '[': + continue + line = line.split(':') + if len(line) > 2: + continue + port = None + if len(line) > 1: + port = line[1] + for family, type, proto, canonname, addrport in socket.getaddrinfo(line[0], port, family=socket.AddressFamily.AF_INET, type=socket.SocketType.SOCK_STREAM): + try: + range = ipaddress.IPv4Network('%s/24' % addrport[0], strict=False) + own_ranges.append(range) + except ipaddress.AddressValueError: + pass + except (UnicodeDecodeError, socket.gaierror): + continue +except subprocess.CalledProcessError: + pass + +# First let's try our first choice of a range +chosen_range = ipaddress.IPv4Network('10.0.4.0/24') +collides = False +for own_range in own_ranges: + if chosen_range.overlaps(own_range): + collides = True + break + +# If our first go-to IP range collides: subtract that from all +# private IP ranges and get the first available /24 subnet from +# there. +if collides: + chosen_range = None + + for own_range in own_ranges: + new_allowed_ranges = [] + for allowed_range in allowed_ranges: + if not allowed_range.overlaps(own_range): + new_allowed_ranges.append(allowed_range) + else: + new_allowed_ranges += allowed_range.address_exclude(own_range) + allowed_ranges = new_allowed_ranges + + for allowed_range in allowed_ranges: + try: + chosen_range = next(allowed_range.subnets(new_prefix=24)) + break + except ValueError: + pass + +base = chosen_range.network_address +print(str(base + 1)) + diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/tests/install open-iscsi-2.0.874/debian/tests/install --- open-iscsi-2.0.873+git0.3b4b4500/debian/tests/install 2017-02-16 20:47:58.000000000 +0000 +++ open-iscsi-2.0.874/debian/tests/install 2017-08-03 20:04:27.000000000 +0000 @@ -2,8 +2,6 @@ set -e -. debian/tests/sysvinit.inc - die() { echo "$@" >&2 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/tests/login open-iscsi-2.0.874/debian/tests/login --- open-iscsi-2.0.873+git0.3b4b4500/debian/tests/login 1970-01-01 00:00:00.000000000 +0000 +++ open-iscsi-2.0.874/debian/tests/login 2017-08-03 20:04:27.000000000 +0000 @@ -0,0 +1,38 @@ +#!/bin/sh + +set -e + +die() +{ + echo "$@" >&2 + exit 1 +} + +if [ -z "$ISCSI_TARGET_IP" ] || [ -z "$ISCSI_TARGET_NAME" ] ; then + echo "SKIP: skipping current test because ISCSI_TARGET_IP/ISCSI_TARGET_NAME are not set" + exit 0 +fi + +service iscsid status >/dev/null 2>&1 || die "iscsid not running" + +# Discover targets +iscsiadm -m discovery -t sendtargets -p "$ISCSI_TARGET_IP" || die "iSCSI discovery failed" + +# Log in to nodes +iscsiadm -m node -p "$ISCSI_TARGET_IP" -T "$ISCSI_TARGET_NAME" --login || die "iSCSI login failed" + +# Make sure udev had time to process the device events (wait max 60s) +udevadm settle -t 60 || die "udevadm settle failed" + +# Check that we imported a single iSCSI drive +num_devices=0 +last_device= +for dev in /sys/class/iscsi_session/session*/device/target*/*\:*/block/* ; do + [ -d "$dev/" ] || continue + num_devices=$((num_devices + 1)) + last_device="$dev" +done +[ $num_devices -eq 1 ] || die "Found $num_devices iSCSI drives, expected 1 (last device was ${last_device})" + +last_device=$(basename $last_device) +echo "Found 1 iSCSI drive: /dev/$last_device" diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/tests/nested open-iscsi-2.0.874/debian/tests/nested --- open-iscsi-2.0.873+git0.3b4b4500/debian/tests/nested 1970-01-01 00:00:00.000000000 +0000 +++ open-iscsi-2.0.874/debian/tests/nested 2017-08-03 20:04:27.000000000 +0000 @@ -0,0 +1,87 @@ +#!/bin/sh + +set -e + +die() +{ + echo "$@" >&2 + exit 1 +} + +if ! [ -e "/dev/baseimage" ] ; then + echo "SKIP: skipping nested tests because /dev/baseimage does not exist" + exit 0 +fi + +ISCSI_IP=$(python3 debian/tests/find_free_ip.py) +ISCSI_NAME=iqn.2003-01.org.linux-iscsi.debian.autopkgtest + +[ -n "$ISCSI_IP" ] || die "$0: couldn't find free ip to use for iSCSI target" +[ -n "$ADT_ARTIFACTS" ] || die "$0: ADT_ARTIFACTS not set" + +echo "Creating dummy interface with iSCSI target IP $ISCSI_IP" + +# Create iSCSI interface +modprobe dummy +ip link add name iscsi0 type dummy +ip link set dev iscsi0 up +ip -4 addr add "${ISCSI_IP}/24" dev iscsi0 + +echo "Setting up iSCSI target" + +# Create disk image and export it (qemu-img create will be sparse by default) +qemu-img create -f raw /tmp/iscsi_disk.img 100M +# Since we add a portal manually, we need to make sure not to automatically +# add a new portal when creating the initial TPG, otherwise the portal +# creation command will fail. +targetcli set global auto_add_default_portal=false +targetcli backstores/fileio/ create name=disk0 file_or_dev=/tmp/iscsi_disk.img size=100M +targetcli iscsi/ create "${ISCSI_NAME}" +targetcli iscsi/"${ISCSI_NAME}"/tpg1/luns/ create /backstores/fileio/disk0 +targetcli iscsi/"${ISCSI_NAME}"/tpg1/portals/ create "$ISCSI_IP" 3260 +targetcli iscsi/"${ISCSI_NAME}"/tpg1/ set attribute authentication=0 demo_mode_write_protect=0 generate_node_acls=1 cache_dynamic_acls=1 + +BINARY_PATH="$(grep -v ^# /etc/apt/sources.list.d/autopkgtest.list 2>/dev/null | grep -v ^$ | sed 's%.*file://\([^ ]*\) .*%\1%' | head -n 1)" + +# Reuse binary packages +BINARY_ARGS="" + +for pkg in "${BINARY_PATH}/"*.deb ; do + if [ -f "$pkg" ] ; then + BINARY_ARGS="${BINARY_ARGS:+$BINARY_ARGS }$pkg" + fi +done + +# We pretend that this is a built tree here, because we don't want to +# trigger a rebuild. That's fine, because even if there was a build +# required here, they will have been added to the binary package +# repository. + +echo "Calling nested autopkgtest with debian/tests/control.nested" + +# Call autopkgtest for the nested tests; also allocate less RAM than we +# have, otherwise QEMU won't start. 10/16ths is a good ration, because +# we haven't started much in this VM - and with a default ram size of +# 1 GiB (see autopkgtest-qemu) this would give us a reasonable 640 MiB +# of RAM in the nested VM. +# FIXME: Possibly add some swap space... +RAM_SIZE=$(grep MemTotal: /proc/meminfo | awk '{print int($2/1024/16*10)}') + +set +e +autopkgtest -B -o "$ADT_ARTIFACTS/nested" -U --override-control debian/tests/control.nested \ + --env "ISCSI_TARGET_IP=$ISCSI_IP" --env "ISCSI_TARGET_NAME=$ISCSI_NAME" \ + $BINARY_ARGS $PWD/ \ + -- qemu --ram-size $RAM_SIZE /dev/baseimage +RC=$? +case $RC in + 0|2) + # adt-run exit code 2 signifies skipped tests - but that shouldn't + # cause the outer-layered test to fail + exit 0 + ;; + *) + exit $RC + ;; +esac + +exit 0 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/tests/sysvinit.inc open-iscsi-2.0.874/debian/tests/sysvinit.inc --- open-iscsi-2.0.873+git0.3b4b4500/debian/tests/sysvinit.inc 2017-02-16 20:47:58.000000000 +0000 +++ open-iscsi-2.0.874/debian/tests/sysvinit.inc 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -# Include file to support sysvinit - -BASENAME=$(basename "$0") -if [ x"${BASENAME##sysvinit-}"x != x"$BASENAME"x ] ; then - # Ignore this on Ubuntu, because sysvinit is not suppoterd there. - if [ -f /etc/os-release ] ; then - ( . /etc/os-release && [ x"$ID"x = x"ubuntu"x ] ) && { echo "Ignoring sysvinit-based test on Ubuntu"; exit 0; } - elif [ -f /etc/lsb-release ] ; then - ( . /etc/lsb-release && [ x"$DISTRIB_ID"x = x"Ubuntu"x ] ) && { echo "Ignoring sysvinit-based test on Ubuntu"; exit 0; } - fi - - if [ x"$ADT_REBOOT_MARK"x = x"sysvinit"x ] ; then - echo "Continuing test after sysvinit was installed." - unset ADT_REBOOT_MARK - elif [ -z "$ADT_REBOOT_MARK" ] ; then - echo "Installing sysvinit and then rebooting for this test..." - if [ -e /etc/inittab ] ; then - # work around Debian bug #800910 - if ! grep -v ^'#' /etc/inittab | grep -vE '^[[:space:]]*$' | grep -qv ^S0 ; then - # inittab with only serial console was created, remove it - # before installing sysvinit (if there's a full inittab - # present, the if condition will never be true) - rm -f /etc/inittab - fi - fi - - # install sysvinit - DEBIAN_FRONTEND=noninteractive apt-get install -y --purge sysvinit-core > /etc/inittab - echo "S0:23:respawn:/sbin/getty -L ttyS0 115200 vt100" >> /etc/inittab - fi - - # reboot the system - sync - /tmp/autopkgtest-reboot sysvinit - fi -fi diff -Nru open-iscsi-2.0.873+git0.3b4b4500/debian/tests/sysvinit-install open-iscsi-2.0.874/debian/tests/sysvinit-install --- open-iscsi-2.0.873+git0.3b4b4500/debian/tests/sysvinit-install 2017-02-16 20:47:58.000000000 +0000 +++ open-iscsi-2.0.874/debian/tests/sysvinit-install 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -#!/bin/sh - -set -e - -. debian/tests/sysvinit.inc - -die() -{ - echo "$@" >&2 - exit 1 -} - -die_with_file() -{ - file="$1" - shift - echo "$@" >&2 - echo "contents of $file:" >&2 - cat "$file" >&2 - exit 1 -} - -DEBIAN_FRONTEND=noninteractive apt-get -y install open-iscsi +Open-iSCSI project .br Alex Aizman .br diff -Nru open-iscsi-2.0.873+git0.3b4b4500/doc/iscsid.8 open-iscsi-2.0.874/doc/iscsid.8 --- open-iscsi-2.0.873+git0.3b4b4500/doc/iscsid.8 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/doc/iscsid.8 2016-09-29 18:33:24.000000000 +0000 @@ -72,7 +72,7 @@ .BR iscsiadm (8) .SH AUTHORS -Open-iSCSI project +Open-iSCSI project .br Alex Aizman .br diff -Nru open-iscsi-2.0.873+git0.3b4b4500/doc/iscsi_discovery.8 open-iscsi-2.0.874/doc/iscsi_discovery.8 --- open-iscsi-2.0.873+git0.3b4b4500/doc/iscsi_discovery.8 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/doc/iscsi_discovery.8 2016-09-29 18:33:24.000000000 +0000 @@ -8,7 +8,17 @@ .SH NAME iscsi_discovery \- discover iSCSI targets .SH SYNOPSIS -.B iscsi_discovery [-p ] [-d] [-t [-f]] [-m] [-l] +.B iscsi_discovery +.I +.RB [ -p +.IR ] +.RB [ -d ] +.RB [\ -t +.IR +.RB [ -f ] +] +.RB [ -m ] +.RB [ -l ] .SH DESCRIPTION Perform send-targets discovery to the specified IP. If a discovery record @@ -24,7 +34,7 @@ .\" .SH OPTIONS .TP .BI [-p=]\fIport\-number\fP -set the port number (defualt is 3260). +set the port number (default is 3260). .TP .BI [-d] print debugging information. @@ -42,7 +52,7 @@ manual startup - will set manual startup (default is automatic startup). .TP .BI [-l] -login - login to the new discovered nodes (defualt is false). +login - login to the new discovered nodes (default is false). .SH AUTHOR Written by Dan Bar Dov diff -Nru open-iscsi-2.0.873+git0.3b4b4500/doc/iscsi-iname.8 open-iscsi-2.0.874/doc/iscsi-iname.8 --- open-iscsi-2.0.873+git0.3b4b4500/doc/iscsi-iname.8 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/doc/iscsi-iname.8 2016-09-29 18:33:24.000000000 +0000 @@ -17,6 +17,6 @@ Use the prefix passed in instead of the default "iqn.2005-03.org.open-iscsi" .SH AUTHORS -Open-iSCSI project +Open-iSCSI project .br Mike Christie diff -Nru open-iscsi-2.0.873+git0.3b4b4500/doc/iscsistart.8 open-iscsi-2.0.874/doc/iscsistart.8 --- open-iscsi-2.0.873+git0.3b4b4500/doc/iscsistart.8 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/doc/iscsistart.8 2016-09-29 18:33:24.000000000 +0000 @@ -22,7 +22,7 @@ Set target portal group tag to N (Required if not using iBFT or OF) .TP .BI [-a|--address=]\fIA.B.C.D\fP -Set IP addres to A.B.C.D (Required if not using iBFT or OF) +Set IP address to A.B.C.D (Required if not using iBFT or OF) .TP .BI [-p|--port=]\fIN\fP Set port to N (Optional. Default 3260) @@ -66,6 +66,6 @@ .BR iscsiadm (8) .SH AUTHORS -Open-iSCSI project +Open-iSCSI project .br Mike Christie diff -Nru open-iscsi-2.0.873+git0.3b4b4500/etc/iface.example open-iscsi-2.0.874/etc/iface.example --- open-iscsi-2.0.873+git0.3b4b4500/etc/iface.example 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/etc/iface.example 2016-09-29 18:33:24.000000000 +0000 @@ -1,7 +1,7 @@ # # Example iSCSI interface config # -# There must be a seperate iscsi interface config file for each NIC, network +# There must be a separate iscsi interface config file for each NIC, network # interface or port or iscsi HBA you want to bind sessions to. # # For hardware iscsi, this is created for you when you run iscsiadm. @@ -23,7 +23,7 @@ # - cxgb3i (Chelsio cxgb S3 iSCSI HBAs); # #OPTIONAL: iface.initiatorname -# To use a initiator name other than the one set in +# To use an initiator name other than the one set in # /etc/iscsi/initiatorname.iscsi for normal sessions set the # iface.initiatorname. This is only used for normal sessions. # For discovery sessions the /etc/iscsi/initiatorname.iscsi value diff -Nru open-iscsi-2.0.873+git0.3b4b4500/etc/initd/initd.suse open-iscsi-2.0.874/etc/initd/initd.suse --- open-iscsi-2.0.873+git0.3b4b4500/etc/initd/initd.suse 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/etc/initd/initd.suse 2016-09-29 18:33:24.000000000 +0000 @@ -12,7 +12,7 @@ # Default-Stop: # Short-Description: iSCSI initiator daemon # Description: The iSCSI initator is used to create and -# manage iSCSI connections to a iSCSI Target. +# manage iSCSI connections to an iSCSI Target. # ### END INIT INFO diff -Nru open-iscsi-2.0.873+git0.3b4b4500/etc/iscsid.conf open-iscsi-2.0.874/etc/iscsid.conf --- open-iscsi-2.0.873+git0.3b4b4500/etc/iscsid.conf 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/etc/iscsid.conf 2016-09-29 18:33:24.000000000 +0000 @@ -10,7 +10,7 @@ ###################### # iscsid daemon config ###################### -# If you want iscsid to start the first time a iscsi tool +# If you want iscsid to start the first time an iscsi tool # needs to access it, instead of starting it when the init # scripts run, set the iscsid startup command here. This # should normally only need to be done by distro package @@ -22,6 +22,9 @@ # Default for upstream open-iscsi scripts (uncomment to activate). iscsid.startup = /sbin/iscsid +# Check for active mounts on devices reachable through a session +# and refuse to logout if there are any. Defaults to "No". +# iscsid.safe_logout = Yes ############################# # NIC/HBA and driver settings @@ -41,7 +44,7 @@ # 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. +# logins on all available ifaces simultaneously. node.leading_login = No # ************* @@ -80,7 +83,7 @@ # Timeouts # ******** # -# See the iSCSI REAME's Advanced Configuration section for tips +# See the iSCSI README's Advanced Configuration section for tips # on setting timeouts when using multipath or doing root over iSCSI. # # To specify the length of time to wait for session re-establishment diff -Nru open-iscsi-2.0.873+git0.3b4b4500/include/fw_context.h open-iscsi-2.0.874/include/fw_context.h --- open-iscsi-2.0.873+git0.3b4b4500/include/fw_context.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/include/fw_context.h 2016-09-29 18:33:24.000000000 +0000 @@ -28,6 +28,15 @@ #include "list.h" #include "auth.h" +enum ibft_ip_prefix_origin { + IBFT_IP_PREFIX_ORIGIN_OTHER = 0, + IBFT_IP_PREFIX_ORIGIN_MANUAL, + IBFT_IP_PREFIX_ORIGIN_WELL_KNOWN, + IBFT_IP_PREFIX_ORIGIN_DHCP, + IBFT_IP_PREFIX_ORIGIN_ROUTER_ADVERTISEMENT, + IBFT_IP_PREFIX_ORIGIN_UNCHANGED = 16 +}; + struct boot_context { struct list_head list; char boot_root[BOOT_NAME_MAXLEN]; @@ -35,6 +44,7 @@ char boot_target[BOOT_NAME_MAXLEN]; /* target settings */ + int target_flags; int target_port; char targetname[TARGET_NAME_MAXLEN + 1]; char target_ipaddr[NI_MAXHOST]; @@ -48,6 +58,8 @@ char initiatorname[TARGET_NAME_MAXLEN + 1]; /* network settings */ + int nic_flags; + enum ibft_ip_prefix_origin origin; char dhcp[NI_MAXHOST]; char iface[IF_NAMESIZE]; char mac[18]; diff -Nru open-iscsi-2.0.873+git0.3b4b4500/include/iscsi_err.h open-iscsi-2.0.874/include/iscsi_err.h --- open-iscsi-2.0.873+git0.3b4b4500/include/iscsi_err.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/include/iscsi_err.h 2016-09-29 18:33:24.000000000 +0000 @@ -66,6 +66,8 @@ ISCSI_ERR_AGAIN = 29, /* unknown discovery type */ ISCSI_ERR_UNKNOWN_DISCOVERY_TYPE = 30, + /* child process terminated */ + ISCSI_ERR_CHILD_TERMINATED = 31, /* Always last. Indicates end of error code space */ ISCSI_MAX_ERR_VAL, diff -Nru open-iscsi-2.0.873+git0.3b4b4500/include/iscsi_if.h open-iscsi-2.0.874/include/iscsi_if.h --- open-iscsi-2.0.873+git0.3b4b4500/include/iscsi_if.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/include/iscsi_if.h 2016-09-29 18:33:24.000000000 +0000 @@ -74,8 +74,9 @@ ISCSI_UEVENT_LOGIN_FLASHNODE = UEVENT_BASE + 28, ISCSI_UEVENT_LOGOUT_FLASHNODE = UEVENT_BASE + 29, ISCSI_UEVENT_LOGOUT_FLASHNODE_SID = UEVENT_BASE + 30, - - ISCSI_UEVENT_MAX = ISCSI_UEVENT_LOGOUT_FLASHNODE_SID, + ISCSI_UEVENT_SET_CHAP = UEVENT_BASE + 31, + ISCSI_UEVENT_GET_HOST_STATS = UEVENT_BASE + 32, + ISCSI_UEVENT_MAX = ISCSI_UEVENT_GET_HOST_STATS, /* up events */ ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1, @@ -250,6 +251,10 @@ uint32_t host_no; uint32_t sid; } logout_flashnode_sid; + struct msg_get_host_stats { + uint32_t host_no; + } get_host_stats; + } u; union { /* messages k -> u */ @@ -318,8 +323,17 @@ ISCSI_HOST_PARAM, /* iscsi_host_param */ ISCSI_NET_PARAM, /* iscsi_net_param */ ISCSI_FLASHNODE_PARAM, /* iscsi_flashnode_param */ + ISCSI_CHAP_PARAM, /* iscsi_chap_param */ + ISCSI_IFACE_PARAM, /* iscsi_iface_param */ }; +/* structure for minimalist usecase */ +struct iscsi_param_info { + uint32_t len; /* Actual length of the param value */ + uint16_t param; /* iscsi param */ + uint8_t value[0]; /* length sized value follows */ +} __attribute__((__packed__)); + struct iscsi_iface_param_info { uint32_t iface_num; /* iface number, 0 - n */ uint32_t len; /* Actual length of the param */ @@ -383,28 +397,106 @@ #define ISCSI_VLAN_DISABLE 0x01 #define ISCSI_VLAN_ENABLE 0x02 +/* iscsi generic enable/disabled setting for various features */ +#define ISCSI_NET_PARAM_DISABLE 0x01 +#define ISCSI_NET_PARAM_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_VLAN_TAG = 16, - ISCSI_NET_PARAM_IFACE_TYPE = 17, - ISCSI_NET_PARAM_IFACE_NAME = 18, - ISCSI_NET_PARAM_MTU = 19, - ISCSI_NET_PARAM_PORT = 20, + ISCSI_NET_PARAM_IPV4_SUBNET, + ISCSI_NET_PARAM_IPV4_GW, + ISCSI_NET_PARAM_IPV4_BOOTPROTO, + ISCSI_NET_PARAM_MAC, + ISCSI_NET_PARAM_IPV6_LINKLOCAL, + ISCSI_NET_PARAM_IPV6_ADDR, + ISCSI_NET_PARAM_IPV6_ROUTER, + ISCSI_NET_PARAM_IPV6_ADDR_AUTOCFG, + ISCSI_NET_PARAM_IPV6_LINKLOCAL_AUTOCFG, + ISCSI_NET_PARAM_IPV6_ROUTER_AUTOCFG, + ISCSI_NET_PARAM_IFACE_ENABLE, + ISCSI_NET_PARAM_VLAN_ID, + ISCSI_NET_PARAM_VLAN_PRIORITY, + ISCSI_NET_PARAM_VLAN_ENABLED, + ISCSI_NET_PARAM_VLAN_TAG, + ISCSI_NET_PARAM_IFACE_TYPE, + ISCSI_NET_PARAM_IFACE_NAME, + ISCSI_NET_PARAM_MTU, + ISCSI_NET_PARAM_PORT, + ISCSI_NET_PARAM_IPADDR_STATE, + ISCSI_NET_PARAM_IPV6_LINKLOCAL_STATE, + ISCSI_NET_PARAM_IPV6_ROUTER_STATE, + ISCSI_NET_PARAM_DELAYED_ACK_EN, + ISCSI_NET_PARAM_TCP_NAGLE_DISABLE, + ISCSI_NET_PARAM_TCP_WSF_DISABLE, + ISCSI_NET_PARAM_TCP_WSF, + ISCSI_NET_PARAM_TCP_TIMER_SCALE, + ISCSI_NET_PARAM_TCP_TIMESTAMP_EN, + ISCSI_NET_PARAM_CACHE_ID, + ISCSI_NET_PARAM_IPV4_DHCP_DNS_ADDR_EN, + ISCSI_NET_PARAM_IPV4_DHCP_SLP_DA_EN, + ISCSI_NET_PARAM_IPV4_TOS_EN, + ISCSI_NET_PARAM_IPV4_TOS, + ISCSI_NET_PARAM_IPV4_GRAT_ARP_EN, + ISCSI_NET_PARAM_IPV4_DHCP_ALT_CLIENT_ID_EN, + ISCSI_NET_PARAM_IPV4_DHCP_ALT_CLIENT_ID, + ISCSI_NET_PARAM_IPV4_DHCP_REQ_VENDOR_ID_EN, + ISCSI_NET_PARAM_IPV4_DHCP_USE_VENDOR_ID_EN, + ISCSI_NET_PARAM_IPV4_DHCP_VENDOR_ID, + ISCSI_NET_PARAM_IPV4_DHCP_LEARN_IQN_EN, + ISCSI_NET_PARAM_IPV4_FRAGMENT_DISABLE, + ISCSI_NET_PARAM_IPV4_IN_FORWARD_EN, + ISCSI_NET_PARAM_IPV4_TTL, + ISCSI_NET_PARAM_IPV6_GRAT_NEIGHBOR_ADV_EN, + ISCSI_NET_PARAM_IPV6_MLD_EN, + ISCSI_NET_PARAM_IPV6_FLOW_LABEL, + ISCSI_NET_PARAM_IPV6_TRAFFIC_CLASS, + ISCSI_NET_PARAM_IPV6_HOP_LIMIT, + ISCSI_NET_PARAM_IPV6_ND_REACHABLE_TMO, + ISCSI_NET_PARAM_IPV6_ND_REXMIT_TIME, + ISCSI_NET_PARAM_IPV6_ND_STALE_TMO, + ISCSI_NET_PARAM_IPV6_DUP_ADDR_DETECT_CNT, + ISCSI_NET_PARAM_IPV6_RTR_ADV_LINK_MTU, + ISCSI_NET_PARAM_REDIRECT_EN, +}; + +enum iscsi_ipaddress_state { + ISCSI_IPDDRESS_STATE_UNCONFIGURED, + ISCSI_IPDDRESS_STATE_ACQUIRING, + ISCSI_IPDDRESS_STATE_TENTATIVE, + ISCSI_IPDDRESS_STATE_VALID, + ISCSI_IPDDRESS_STATE_DISABLING, + ISCSI_IPDDRESS_STATE_INVALID, + ISCSI_IPDDRESS_STATE_DEPRECATED, +}; + +enum iscsi_router_state { + ISCSI_ROUTER_STATE_UNKNOWN, + ISCSI_ROUTER_STATE_ADVERTISED, + ISCSI_ROUTER_STATE_MANUAL, + ISCSI_ROUTER_STATE_STALE, +}; + +/* iSCSI specific settings params for iface */ +enum iscsi_iface_param { + ISCSI_IFACE_PARAM_DEF_TASKMGMT_TMO, + ISCSI_IFACE_PARAM_HDRDGST_EN, + ISCSI_IFACE_PARAM_DATADGST_EN, + ISCSI_IFACE_PARAM_IMM_DATA_EN, + ISCSI_IFACE_PARAM_INITIAL_R2T_EN, + ISCSI_IFACE_PARAM_DATASEQ_INORDER_EN, + ISCSI_IFACE_PARAM_PDU_INORDER_EN, + ISCSI_IFACE_PARAM_ERL, + ISCSI_IFACE_PARAM_MAX_RECV_DLENGTH, + ISCSI_IFACE_PARAM_FIRST_BURST, + ISCSI_IFACE_PARAM_MAX_R2T, + ISCSI_IFACE_PARAM_MAX_BURST, + ISCSI_IFACE_PARAM_CHAP_AUTH_EN, + ISCSI_IFACE_PARAM_BIDI_CHAP_EN, + ISCSI_IFACE_PARAM_DISCOVERY_AUTH_OPTIONAL, + ISCSI_IFACE_PARAM_DISCOVERY_LOGOUT_EN, + ISCSI_IFACE_PARAM_STRICT_LOGIN_COMP_EN, + ISCSI_IFACE_PARAM_INITIATOR_NAME, }; enum iscsi_conn_state { @@ -748,6 +840,14 @@ CHAP_TYPE_IN, }; +enum iscsi_chap_param { + ISCSI_CHAP_PARAM_INDEX, + ISCSI_CHAP_PARAM_CHAP_TYPE, + ISCSI_CHAP_PARAM_USERNAME, + ISCSI_CHAP_PARAM_PASSWORD, + ISCSI_CHAP_PARAM_PASSWORD_LEN +}; + #define ISCSI_CHAP_AUTH_NAME_MAX_LEN 256 #define ISCSI_CHAP_AUTH_SECRET_MAX_LEN 256 struct iscsi_chap_rec { @@ -758,4 +858,112 @@ uint8_t password_length; }; +#define ISCSI_HOST_STATS_CUSTOM_MAX 32 +#define ISCSI_HOST_STATS_CUSTOM_DESC_MAX 64 +struct iscsi_host_stats_custom { + char desc[ISCSI_HOST_STATS_CUSTOM_DESC_MAX]; + uint64_t value; +}; + +/* struct iscsi_offload_host_stats: Host statistics, + * Include statistics for MAC, IP, TCP & iSCSI. + */ +struct iscsi_offload_host_stats { + /* MAC */ + uint64_t mactx_frames; + uint64_t mactx_bytes; + uint64_t mactx_multicast_frames; + uint64_t mactx_broadcast_frames; + uint64_t mactx_pause_frames; + uint64_t mactx_control_frames; + uint64_t mactx_deferral; + uint64_t mactx_excess_deferral; + uint64_t mactx_late_collision; + uint64_t mactx_abort; + uint64_t mactx_single_collision; + uint64_t mactx_multiple_collision; + uint64_t mactx_collision; + uint64_t mactx_frames_dropped; + uint64_t mactx_jumbo_frames; + uint64_t macrx_frames; + uint64_t macrx_bytes; + uint64_t macrx_unknown_control_frames; + uint64_t macrx_pause_frames; + uint64_t macrx_control_frames; + uint64_t macrx_dribble; + uint64_t macrx_frame_length_error; + uint64_t macrx_jabber; + uint64_t macrx_carrier_sense_error; + uint64_t macrx_frame_discarded; + uint64_t macrx_frames_dropped; + uint64_t mac_crc_error; + uint64_t mac_encoding_error; + uint64_t macrx_length_error_large; + uint64_t macrx_length_error_small; + uint64_t macrx_multicast_frames; + uint64_t macrx_broadcast_frames; + /* IP */ + uint64_t iptx_packets; + uint64_t iptx_bytes; + uint64_t iptx_fragments; + uint64_t iprx_packets; + uint64_t iprx_bytes; + uint64_t iprx_fragments; + uint64_t ip_datagram_reassembly; + uint64_t ip_invalid_address_error; + uint64_t ip_error_packets; + uint64_t ip_fragrx_overlap; + uint64_t ip_fragrx_outoforder; + uint64_t ip_datagram_reassembly_timeout; + uint64_t ipv6tx_packets; + uint64_t ipv6tx_bytes; + uint64_t ipv6tx_fragments; + uint64_t ipv6rx_packets; + uint64_t ipv6rx_bytes; + uint64_t ipv6rx_fragments; + uint64_t ipv6_datagram_reassembly; + uint64_t ipv6_invalid_address_error; + uint64_t ipv6_error_packets; + uint64_t ipv6_fragrx_overlap; + uint64_t ipv6_fragrx_outoforder; + uint64_t ipv6_datagram_reassembly_timeout; + /* TCP */ + uint64_t tcptx_segments; + uint64_t tcptx_bytes; + uint64_t tcprx_segments; + uint64_t tcprx_byte; + uint64_t tcp_duplicate_ack_retx; + uint64_t tcp_retx_timer_expired; + uint64_t tcprx_duplicate_ack; + uint64_t tcprx_pure_ackr; + uint64_t tcptx_delayed_ack; + uint64_t tcptx_pure_ack; + uint64_t tcprx_segment_error; + uint64_t tcprx_segment_outoforder; + uint64_t tcprx_window_probe; + uint64_t tcprx_window_update; + uint64_t tcptx_window_probe_persist; + /* ECC */ + uint64_t ecc_error_correction; + /* iSCSI */ + uint64_t iscsi_pdu_tx; + uint64_t iscsi_data_bytes_tx; + uint64_t iscsi_pdu_rx; + uint64_t iscsi_data_bytes_rx; + uint64_t iscsi_io_completed; + uint64_t iscsi_unexpected_io_rx; + uint64_t iscsi_format_error; + uint64_t iscsi_hdr_digest_error; + uint64_t iscsi_data_digest_error; + uint64_t iscsi_sequence_error; + /* + * iSCSI Custom Host Statistics support, i.e. Transport could + * extend existing host statistics with its own specific statistics + * up to ISCSI_HOST_STATS_CUSTOM_MAX + */ + uint32_t custom_length; + struct iscsi_host_stats_custom custom[0] + __attribute__ ((aligned (sizeof(uint64_t)))); +}; + #endif diff -Nru open-iscsi-2.0.873+git0.3b4b4500/include/iscsi_net_util.h open-iscsi-2.0.874/include/iscsi_net_util.h --- open-iscsi-2.0.873+git0.3b4b4500/include/iscsi_net_util.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/include/iscsi_net_util.h 2016-09-29 18:33:24.000000000 +0000 @@ -6,7 +6,8 @@ extern int net_get_transport_name_from_netdev(char *netdev, char *transport); extern int net_get_netdev_from_hwaddress(char *hwaddress, char *netdev); extern int net_setup_netdev(char *netdev, char *local_ip, char *mask, - char *gateway, char *remote_ip, int needs_bringup); + char *gateway, char *vlan, char *remote_ip, + int needs_bringup); extern int net_ifup_netdev(char *netdev); #endif diff -Nru open-iscsi-2.0.873+git0.3b4b4500/include/list.h open-iscsi-2.0.874/include/list.h --- open-iscsi-2.0.873+git0.3b4b4500/include/list.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/include/list.h 2016-09-29 18:33:24.000000000 +0000 @@ -38,6 +38,12 @@ #define list_entry(ptr, type, member) \ list_container_of(ptr, type, member) +#define list_first_entry(ptr, type, member) \ + list_entry((ptr)->next, type, member) + +#define list_first_entry_or_null(ptr, type, member) \ + (!list_empty(ptr) ? list_first_entry(ptr, type, member) : NULL) + #define list_for_each(pos, head) \ for (pos = (head)->next; pos != (head); pos = pos->next) diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/aclocal.m4 open-iscsi-2.0.874/iscsiuio/aclocal.m4 --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/aclocal.m4 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/aclocal.m4 1970-01-01 00:00:00.000000000 +0000 @@ -1,7276 +0,0 @@ -# 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 </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 < -#endif - -#include - -#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.so - # instead of lib.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 <&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@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 &1 /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 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 < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$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 , 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 < $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 < 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 <> 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 <&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 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 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 <&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 -# #undef WIN32_LEAN_AND_MEAN -# #include -# -# #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 -# 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 /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 -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/compile open-iscsi-2.0.874/iscsiuio/compile --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/compile 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/compile 1970-01-01 00:00:00.000000000 +0000 @@ -1,142 +0,0 @@ -#! /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 . -# -# 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 or send patches to -# . - -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 . -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 -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/config.guess open-iscsi-2.0.874/iscsiuio/config.guess --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/config.guess 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/config.guess 1970-01-01 00:00:00.000000000 +0000 @@ -1,1548 +0,0 @@ -#! /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 . -# Please send patches to . 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 ." - -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@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 - #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@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 /* 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 - - 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 - #include - - 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 - 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 - #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' /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 - echo i586-unisys-sysv4 - exit ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; - i*86:VOS:*:*) - # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos - exit ;; - *:VOS:*:*) - # From Paul.Green@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 < -# include -#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 - 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 -# 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 < 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 -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/config.h.in open-iscsi-2.0.874/iscsiuio/config.h.in --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/config.h.in 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/config.h.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,111 +0,0 @@ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* Define to 1 if you have the 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 header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the 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 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 does not define. */ -#undef off_t - -/* Define to `unsigned' if does not define. */ -#undef size_t diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/config.status open-iscsi-2.0.874/iscsiuio/config.status --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/config.status 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/config.status 1970-01-01 00:00:00.000000000 +0000 @@ -1,1236 +0,0 @@ -#! /bin/sh -# Generated by configure. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false -SHELL=${CONFIG_SHELL-/bin/sh} -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi -DUALCASE=1; export DUALCASE # for MKS sh - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit -} - - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.file - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_executable_p="test -f" - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - -exec 6>&1 - -# Open the log real soon, to keep \$[0] and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - -This file was extended by iscsiuio $as_me 0.7.4.2k, which was -generated by GNU Autoconf 2.59. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 -config_files=" Makefile src/Makefile src/apps/Makefile src/apps/dhcpc/Makefile src/apps/brcm-iscsi/Makefile src/uip/Makefile src/unix/Makefile src/unix/libs/Makefile" -config_headers=" config.h" -config_commands=" depfiles default" - -ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTIONS] [FILE]... - - -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Configuration commands: -$config_commands - -Report bugs to ." -ac_cs_version="\ -iscsiuio config.status 0.7.4.2k -configured by ./configure, generated by GNU Autoconf 2.59, - with options \"\" - -Copyright (C) 2003 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." -srcdir=. -INSTALL="/usr/bin/install -c" -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` - ac_shift=: - ;; - -*) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$ac_config_targets $1" ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -if $ac_cs_recheck; then - echo "running /bin/sh ./configure " $ac_configure_extra_args " --no-create --no-recursion" >&6 - exec /bin/sh ./configure $ac_configure_extra_args --no-create --no-recursion -fi - -# -# INIT-COMMANDS section. -# - -AMDEP_TRUE="" ac_aux_dir="." - - -for ac_config_target in $ac_config_targets -do - case "$ac_config_target" in - # Handling of arguments. - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; - "src/apps/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/apps/Makefile" ;; - "src/apps/dhcpc/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/apps/dhcpc/Makefile" ;; - "src/apps/brcm-iscsi/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/apps/brcm-iscsi/Makefile" ;; - "src/uip/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/uip/Makefile" ;; - "src/unix/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/unix/Makefile" ;; - "src/unix/libs/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/unix/libs/Makefile" ;; - "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; - "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - esac -done - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. -$debug || -{ - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} - -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) -} || -{ - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} - - -# -# CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h -if test -n "$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t$/@;t t/; /@;t t$/s/[\\&,]/\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t$/,;t t/' >$tmp/subs.sed <<\CEOF -s,@SHELL@,/bin/sh,;t t -s,@PATH_SEPARATOR@,:,;t t -s,@PACKAGE_NAME@,iscsiuio,;t t -s,@PACKAGE_TARNAME@,iscsiuio,;t t -s,@PACKAGE_VERSION@,0.7.4.2k,;t t -s,@PACKAGE_STRING@,iscsiuio 0.7.4.2k,;t t -s,@PACKAGE_BUGREPORT@,eddie.wai@broadcom.com,;t t -s,@exec_prefix@,${prefix},;t t -s,@prefix@,,;t t -s,@program_transform_name@,s,x,x,,;t t -s,@bindir@,${exec_prefix}/bin,;t t -s,@sbindir@,${exec_prefix}/sbin,;t t -s,@libexecdir@,${exec_prefix}/libexec,;t t -s,@datadir@,${prefix}/share,;t t -s,@sysconfdir@,${prefix}/etc,;t t -s,@sharedstatedir@,${prefix}/com,;t t -s,@localstatedir@,${prefix}/var,;t t -s,@libdir@,${exec_prefix}/lib,;t t -s,@includedir@,${prefix}/include,;t t -s,@oldincludedir@,/usr/include,;t t -s,@infodir@,${prefix}/info,;t t -s,@mandir@,${prefix}/man,;t t -s,@build_alias@,,;t t -s,@host_alias@,,;t t -s,@target_alias@,,;t t -s,@DEFS@,-DHAVE_CONFIG_H,;t t -s,@ECHO_C@,,;t t -s,@ECHO_N@,-n,;t t -s,@ECHO_T@,,;t t -s,@LIBS@,,;t t -s,@INSTALL_PROGRAM@,${INSTALL},;t t -s,@INSTALL_SCRIPT@,${INSTALL},;t t -s,@INSTALL_DATA@,${INSTALL} -m 644,;t t -s,@CYGPATH_W@,echo,;t t -s,@PACKAGE@,,;t t -s,@VERSION@,,;t t -s,@ACLOCAL@,${SHELL} /home/share/source/open-iscsi/main/open-iscsi-iscsiuio/iscsiuio/missing --run aclocal-1.9,;t t -s,@AUTOCONF@,${SHELL} /home/share/source/open-iscsi/main/open-iscsi-iscsiuio/iscsiuio/missing --run autoconf,;t t -s,@AUTOMAKE@,${SHELL} /home/share/source/open-iscsi/main/open-iscsi-iscsiuio/iscsiuio/missing --run automake-1.9,;t t -s,@AUTOHEADER@,${SHELL} /home/share/source/open-iscsi/main/open-iscsi-iscsiuio/iscsiuio/missing --run autoheader,;t t -s,@MAKEINFO@,${SHELL} /home/share/source/open-iscsi/main/open-iscsi-iscsiuio/iscsiuio/missing --run makeinfo,;t t -s,@install_sh@,/home/share/source/open-iscsi/main/open-iscsi-iscsiuio/iscsiuio/install-sh,;t t -s,@STRIP@,strip,;t t -s,@ac_ct_STRIP@,strip,;t t -s,@INSTALL_STRIP_PROGRAM@,${SHELL} $(install_sh) -c -s,;t t -s,@mkdir_p@,mkdir -p --,;t t -s,@AWK@,gawk,;t t -s,@SET_MAKE@,,;t t -s,@am__leading_dot@,.,;t t -s,@AMTAR@,${SHELL} /home/share/source/open-iscsi/main/open-iscsi-iscsiuio/iscsiuio/missing --run tar,;t t -s,@am__tar@,${AMTAR} chof - "$$tardir",;t t -s,@am__untar@,${AMTAR} xf -,;t t -s,@BASH@,/bin/sh,;t t -s,@CC@,gcc,;t t -s,@CFLAGS@,-O2 -Wall,;t t -s,@LDFLAGS@,,;t t -s,@CPPFLAGS@,,;t t -s,@ac_ct_CC@,gcc,;t t -s,@EXEEXT@,,;t t -s,@OBJEXT@,o,;t t -s,@DEPDIR@,.deps,;t t -s,@am__include@,include,;t t -s,@am__quote@,,;t t -s,@AMDEP_TRUE@,,;t t -s,@AMDEP_FALSE@,#,;t t -s,@AMDEPBACKSLASH@,\,;t t -s,@CCDEPMODE@,depmode=gcc3,;t t -s,@am__fastdepCC_TRUE@,,;t t -s,@am__fastdepCC_FALSE@,#,;t t -s,@RANLIB@,ranlib,;t t -s,@ac_ct_RANLIB@,ranlib,;t t -s,@CPP@,gcc -E,;t t -s,@EGREP@,grep -E,;t t -s,@ENDIAN@,LITTLE,;t t -s,@build@,x86_64-unknown-linux-gnu,;t t -s,@build_cpu@,x86_64,;t t -s,@build_vendor@,unknown,;t t -s,@build_os@,linux-gnu,;t t -s,@host@,x86_64-unknown-linux-gnu,;t t -s,@host_cpu@,x86_64,;t t -s,@host_vendor@,unknown,;t t -s,@host_os@,linux-gnu,;t t -s,@SED@,/bin/sed,;t t -s,@LN_S@,ln -s,;t t -s,@ECHO@,echo,;t t -s,@AR@,ar,;t t -s,@ac_ct_AR@,ar,;t t -s,@CXX@,g++,;t t -s,@CXXFLAGS@,-g -O2,;t t -s,@ac_ct_CXX@,g++,;t t -s,@CXXDEPMODE@,depmode=gcc3,;t t -s,@am__fastdepCXX_TRUE@,,;t t -s,@am__fastdepCXX_FALSE@,#,;t t -s,@CXXCPP@,g++ -E,;t t -s,@F77@,f95,;t t -s,@FFLAGS@,-g -O2,;t t -s,@ac_ct_F77@,f95,;t t -s,@LIBTOOL@,$(SHELL) $(top_builddir)/libtool,;t t -s,@DEBUG_TRUE@,#,;t t -s,@DEBUG_FALSE@,,;t t -s,@LIBOBJS@,,;t t -s,@LTLIBOBJS@,,;t t -CEOF - - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat - fi -fi # test -n "$CONFIG_FILES" - -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; - esac - - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac - - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_builddir$INSTALL ;; - esac - - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } - sed "/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -} - -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@abs_srcdir@,$ac_abs_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s,@builddir@,$ac_builddir,;t t -s,@abs_builddir@,$ac_abs_builddir,;t t -s,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -s,@INSTALL@,$ac_INSTALL,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi - -done - -# -# CONFIG_HEADER section. -# - -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='[ ].*$,\1#\2' -ac_dC=' ' -ac_dD=',;t' -# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='$,\1#\2define\3' -ac_uC=' ' -ac_uD=',;t' - -for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; - esac - - test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - # Do quote $f, to prevent DOS paths from being IFS'd. - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } - # Remove the trailing spaces. - sed 's/[ ]*$//' $ac_file_inputs >$tmp/in - - # Handle all the #define templates only if necessary. - if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then - # If there are no defines, we may have an empty if/fi - : - cat >$tmp/defines.sed <$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in - - fi # grep - - # Handle all the #undef templates - cat >$tmp/undefs.sed <$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - echo "/* Generated by configure. */" >$tmp/config.h - else - echo "/* $ac_file. Generated by configure. */" >$tmp/config.h - fi - cat $tmp/in >>$tmp/config.h - rm -f $tmp/in - if test x"$ac_file" != x-; then - if diff $ac_file $tmp/config.h >/dev/null 2>&1; then - { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -echo "$as_me: $ac_file is unchanged" >&6;} - else - ac_dir=`(dirname "$ac_file") 2>/dev/null || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - rm -f $ac_file - mv $tmp/config.h $ac_file - fi - else - cat $tmp/config.h - rm -f $tmp/config.h - fi -# Compute $ac_file's index in $config_headers. -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $ac_file | $ac_file:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || -$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X$ac_file : 'X\(//\)[^/]' \| \ - X$ac_file : 'X\(//\)$' \| \ - X$ac_file : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X$ac_file | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'`/stamp-h$_am_stamp_count -done - -# -# CONFIG_COMMANDS section. -# -for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue - ac_dest=`echo "$ac_file" | sed 's,:.*,,'` - ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_dir=`(dirname "$ac_dest") 2>/dev/null || -$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_dest" : 'X\(//\)[^/]' \| \ - X"$ac_dest" : 'X\(//\)$' \| \ - X"$ac_dest" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_dest" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac - - - { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 -echo "$as_me: executing $ac_dest commands" >&6;} - case $ac_dest in - depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # So let's grep whole file. - if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then - dirpart=`(dirname "$mf") 2>/dev/null || -$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$mf" : 'X\(//\)[^/]' \| \ - X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$mf" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - else - continue - fi - # 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=`(dirname "$file") 2>/dev/null || -$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$file" : 'X\(//\)[^/]' \| \ - X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p $dirpart/$fdir - else - as_dir=$dirpart/$fdir - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 -echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} - { (exit 1); exit 1; }; }; } - - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done -done - ;; - default ) echo 'char *build_date ="'`date`'";' > src/unix/build_date.c && echo 'char *build_date; '> src/unix/build_date.h ;; - esac -done - -{ (exit 0); exit 0; } diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/config.sub open-iscsi-2.0.874/iscsiuio/config.sub --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/config.sub 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/config.sub 1970-01-01 00:00:00.000000000 +0000 @@ -1,1695 +0,0 @@ -#! /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 . 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 ." - -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 -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/configure open-iscsi-2.0.874/iscsiuio/configure --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/configure 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/configure 1970-01-01 00:00:00.000000000 +0000 @@ -1,22765 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for iscsiuio 0.7.8.1b. -# -# Report bugs to . -# -# Copyright (C) 2003 Free Software Foundation, Inc. -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi -DUALCASE=1; export DUALCASE # for MKS sh - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit -} - - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.file - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_executable_p="test -f" - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - - - -# 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 </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.8.1b' -PACKAGE_STRING='iscsiuio 0.7.8.1b' -PACKAGE_BUGREPORT='eddie.wai@broadcom.com' - -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#if HAVE_SYS_TYPES_H -# include -#endif -#if HAVE_SYS_STAT_H -# include -#endif -#if STDC_HEADERS -# include -# include -#else -# if HAVE_STDLIB_H -# include -# endif -#endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H -# include -# endif -# include -#endif -#if HAVE_STRINGS_H -# include -#endif -#if HAVE_INTTYPES_H -# include -#else -# if HAVE_STDINT_H -# include -# endif -#endif -#if HAVE_UNISTD_H -# include -#endif" - -ac_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.8.1b 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.8.1b:";; - 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] - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory - 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 . -_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.8.1b -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.8.1b, 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 &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext - break;; - * ) - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } -fi - -ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 - -# Check the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - fi - fi -fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - -rm -f a.out a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 - -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext - break;; - * ) break;; - esac -done -else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 -if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_compiler_gnu=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 -GCC=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_prog_cc_g=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_stdc=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std1 is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std1. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext -done -rm -f conftest.$ac_ext conftest.$ac_objext -CC=$ac_save_CC - -fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; - *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; -esac - -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -#include -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -continue -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -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 to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep - - -if test $ac_cv_c_compiler_gnu = yes; then - echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 -echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6 -if test "${ac_cv_prog_gcc_traditional+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_pattern="Autoconf.*'x'" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -Autoconf TIOCGETP -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1; then - ac_cv_prog_gcc_traditional=yes -else - ac_cv_prog_gcc_traditional=no -fi -rm -f conftest* - - - if test $ac_cv_prog_gcc_traditional = no; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -Autoconf TCGETA -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1; then - ac_cv_prog_gcc_traditional=yes -fi -rm -f conftest* - - fi -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 -echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6 - if test $ac_cv_prog_gcc_traditional = yes; then - CC="$CC -traditional" - fi -fi - - -# 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 -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_stdc=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_Header=no" -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -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 -#include -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 - 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 (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 -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_int=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int), 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 (int)); } -unsigned long ulongval () { return (long) (sizeof (int)); } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - exit (1); - if (((long) (sizeof (int))) < 0) - { - long i = longval (); - if (i != ((long) (sizeof (int)))) - exit (1); - fprintf (f, "%ld\n", i); - } - else - { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (int)))) - 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_int=`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 (int), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int), 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_int=0 -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 -echo "${ECHO_T}$ac_cv_sizeof_int" >&6 -cat >>confdefs.h <<_ACEOF -#define SIZEOF_INT $ac_cv_sizeof_int -_ACEOF - - -echo "$as_me:$LINENO: checking for long" >&5 -echo $ECHO_N "checking for long... $ECHO_C" >&6 -if test "${ac_cv_type_long+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 ((long *) 0) - return 0; -if (sizeof (long)) - 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_long=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_long=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 -echo "${ECHO_T}$ac_cv_type_long" >&6 - -echo "$as_me:$LINENO: checking size of long" >&5 -echo $ECHO_N "checking size of long... $ECHO_C" >&6 -if test "${ac_cv_sizeof_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$ac_cv_type_long" = 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 (long))) >= 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 (long))) <= $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 (long))) < 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 (long))) >= $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 (long))) <= $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_long=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long), 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 (long)); } -unsigned long ulongval () { return (long) (sizeof (long)); } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - exit (1); - if (((long) (sizeof (long))) < 0) - { - long i = longval (); - if (i != ((long) (sizeof (long)))) - exit (1); - fprintf (f, "%ld\n", i); - } - else - { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (long)))) - 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_long=`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 (long), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long), 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_long=0 -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long" >&6 -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG $ac_cv_sizeof_long -_ACEOF - - - -echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 -if test "${ac_cv_c_bigendian+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # See if sys/param.h defines the BYTE_ORDER macro. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -int -main () -{ -#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN - bogus endian macros -#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 - # It does; now see whether it defined to BIG_ENDIAN or not. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -int -main () -{ -#if BYTE_ORDER != BIG_ENDIAN - not big endian -#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_bigendian=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_c_bigendian=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -# It does not; compile a test program. -if test "$cross_compiling" = yes; then - # try to guess the endianness by grepping values into an object file - ac_cv_c_bigendian=unknown - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; -short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; -void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } -short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; -short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; -void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } -int -main () -{ - _ascii (); _ebcdic (); - ; - 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 - if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then - ac_cv_c_bigendian=yes -fi -if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi -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 -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 () -{ - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long l; - char c[sizeof (long)]; - } u; - u.l = 1; - exit (u.c[sizeof (long) - 1] == 1); -} -_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_c_bigendian=no -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_c_bigendian=yes -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -echo "${ECHO_T}$ac_cv_c_bigendian" >&6 -case $ac_cv_c_bigendian in - yes) - ENDIAN=BIG - ;; - no) - ENDIAN=LITTLE - ;; - *) - { { echo "$as_me:$LINENO: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -echo "$as_me: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} - { (exit 1); exit 1; }; } ;; -esac - - - - - -# libtool stuff -# Check whether --enable-shared or --disable-shared was given. -if test "${enable_shared+set}" = set; then - enableval="$enable_shared" - p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - 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 -else - enable_shared=yes -fi; - -# Check whether --enable-static or --disable-static was given. -if test "${enable_static+set}" = set; then - enableval="$enable_static" - p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - 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 -else - enable_static=yes -fi; - -# Check whether --enable-fast-install or --disable-fast-install was given. -if test "${enable_fast_install+set}" = set; then - enableval="$enable_fast_install" - p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - 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 -else - enable_fast_install=yes -fi; - -# Make sure we can run config.sub. -$ac_config_sub sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 -echo "$as_me: error: cannot run $ac_config_sub" >&2;} - { (exit 1); exit 1; }; } - -echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6 -if test "${ac_cv_build+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_build_alias=$build_alias -test -z "$ac_cv_build_alias" && - ac_cv_build_alias=`$ac_config_guess` -test -z "$ac_cv_build_alias" && - { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -echo "$as_me: error: cannot guess build type; you must specify one" >&2;} - { (exit 1); exit 1; }; } -ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} - { (exit 1); exit 1; }; } - -fi -echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6 -build=$ac_cv_build -build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - - -echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6 -if test "${ac_cv_host+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_host_alias=$host_alias -test -z "$ac_cv_host_alias" && - ac_cv_host_alias=$ac_cv_build_alias -ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} - { (exit 1); exit 1; }; } - -fi -echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6 -host=$ac_cv_host -host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - - -echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 -echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 -if test "${lt_cv_path_SED+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_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 - -fi - -SED=$lt_cv_path_SED - -echo "$as_me:$LINENO: result: $SED" >&5 -echo "${ECHO_T}$SED" >&6 - - -# Check whether --with-gnu-ld or --without-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then - withval="$with_gnu_ld" - test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no -fi; -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - echo "$as_me:$LINENO: checking for ld used by $CC" >&5 -echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | ?:[\\/]*) - 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 - echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 -else - echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 -fi -if test "${lt_cv_path_LD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -z "$LD"; then - 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 &5 -echo "${ECHO_T}$LD" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi -test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 -echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} - { (exit 1); exit 1; }; } -echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 -if test "${lt_cv_prog_gnu_ld+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &5 -echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 -with_gnu_ld=$lt_cv_prog_gnu_ld - - -echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 -echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 -if test "${lt_cv_ld_reload_flag+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_ld_reload_flag='-r' -fi -echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 -echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 -reload_flag=$lt_cv_ld_reload_flag -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 - -echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 -echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 -if test "${lt_cv_path_NM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - 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 -fi -echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 -echo "${ECHO_T}$lt_cv_path_NM" >&6 -NM="$lt_cv_path_NM" - -echo "$as_me:$LINENO: checking whether ln -s works" >&5 -echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -else - echo "$as_me:$LINENO: result: no, using $LN_S" >&5 -echo "${ECHO_T}no, using $LN_S" >&6 -fi - -echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 -echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6 -if test "${lt_cv_deplibs_check_method+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [[regex]]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given 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 - -fi -echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 -echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown - - - - -# 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 - -# Check whether --enable-libtool-lock or --disable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then - enableval="$enable_libtool_lock" - -fi; -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.$ac_objext` in - *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 6825 "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.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" - echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 -echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 -if test "${lt_cv_cc_needs_belf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - lt_cv_cc_needs_belf=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -lt_cv_cc_needs_belf=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -fi -echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 -echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; -sparc*-*solaris*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.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* - ;; - - -esac - -need_locks="$enable_libtool_lock" - - - -for ac_header in dlfcn.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------- ## -## Report this to eddie.wai@broadcom.com ## -## ------------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CXX=$ac_cv_prog_CXX -if test -n "$CXX"; then - echo "$as_me:$LINENO: result: $CXX" >&5 -echo "${ECHO_T}$CXX" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$CXX" && break - done -fi -if test -z "$CXX"; then - ac_ct_CXX=$CXX - for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CXX="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -if test -n "$ac_ct_CXX"; then - echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 -echo "${ECHO_T}$ac_ct_CXX" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$ac_ct_CXX" && break -done -test -n "$ac_ct_CXX" || ac_ct_CXX="g++" - - CXX=$ac_ct_CXX -fi - - -# Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C++ compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 -if test "${ac_cv_cxx_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_compiler_gnu=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - -fi -echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 -GXX=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CXXFLAGS=${CXXFLAGS+set} -ac_save_CXXFLAGS=$CXXFLAGS -CXXFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 -echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 -if test "${ac_cv_prog_cxx_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cxx_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_prog_cxx_g=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 -if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" - fi -else - if test "$GXX" = yes; then - CXXFLAGS="-O2" - else - CXXFLAGS= - fi -fi -for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -#include -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -continue -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - -ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -depcc="$CXX" am_compiler_list= - -echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 -echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 -if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CXX_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # 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_CXX_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CXX_dependencies_compiler_type=none -fi - -fi -echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 -echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6 -CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type - - - -if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then - am__fastdepCXX_TRUE= - am__fastdepCXX_FALSE='#' -else - am__fastdepCXX_TRUE='#' - am__fastdepCXX_FALSE= -fi - - - - -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -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 -if test -z "$CXXCPP"; then - if test "${ac_cv_prog_CXXCPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CXXCPP needs to be expanded - for CXXCPP in "$CXX -E" "/lib/cpp" - do - ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_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_CXXCPP=$CXXCPP - -fi - CXXCPP=$ac_cv_prog_CXXCPP -else - ac_cv_prog_CXXCPP=$CXXCPP -fi -echo "$as_me:$LINENO: result: $CXXCPP" >&5 -echo "${ECHO_T}$CXXCPP" >&6 -ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_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 \"$CXXCPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -fi - - -ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran - 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_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$F77"; then - ac_cv_prog_F77="$F77" # 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_F77="$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 -F77=$ac_cv_prog_F77 -if test -n "$F77"; then - echo "$as_me:$LINENO: result: $F77" >&5 -echo "${ECHO_T}$F77" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$F77" && break - done -fi -if test -z "$F77"; then - ac_ct_F77=$F77 - for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran -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_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_F77"; then - ac_cv_prog_ac_ct_F77="$ac_ct_F77" # 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_F77="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_F77=$ac_cv_prog_ac_ct_F77 -if test -n "$ac_ct_F77"; then - echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 -echo "${ECHO_T}$ac_ct_F77" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$ac_ct_F77" && break -done - - F77=$ac_ct_F77 -fi - - -# Provide some information about the compiler. -echo "$as_me:7951:" \ - "checking for Fortran 77 compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -rm -f a.out - -# If we don't use `.F' as extension, the preprocessor is not run on the -# input file. (Note that this only needs to work for GNU compilers.) -ac_save_ext=$ac_ext -ac_ext=F -echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6 -if test "${ac_cv_f77_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF - program main -#ifndef __GNUC__ - choke me -#endif - - end -_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_f77_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_f77_compiler_gnu=$ac_compiler_gnu - -fi -echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 -ac_ext=$ac_save_ext -ac_test_FFLAGS=${FFLAGS+set} -ac_save_FFLAGS=$FFLAGS -FFLAGS= -echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 -echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6 -if test "${ac_cv_prog_f77_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - FFLAGS=-g -cat >conftest.$ac_ext <<_ACEOF - program main - - end -_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_f77_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_f77_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_prog_f77_g=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 -echo "${ECHO_T}$ac_cv_prog_f77_g" >&6 -if test "$ac_test_FFLAGS" = set; then - FFLAGS=$ac_save_FFLAGS -elif test $ac_cv_prog_f77_g = yes; then - if test "x$ac_cv_f77_compiler_gnu" = xyes; then - FFLAGS="-g -O2" - else - FFLAGS="-g" - fi -else - if test "x$ac_cv_f77_compiler_gnu" = xyes; then - FFLAGS="-O2" - else - FFLAGS= - fi -fi - -G77=`test $ac_compiler_gnu = yes && echo yes` -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 - - - -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! - -# find the maximum length of command line arguments -echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 -echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 -if test "${lt_cv_sys_max_cmd_len+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - 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 - -fi - -if test -n $lt_cv_sys_max_cmd_len ; then - echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 -echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 -else - echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6 -fi - - - - -# Check for command to grab the raw symbol name followed by C symbol from nm. -echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 -echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 -if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[BCDEGRST]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([_A-Za-z][_A-Za-z0-9]*\)' - -# Transform 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 <&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Now try to grab the symbols. - nlist=conftest.nm - if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 - (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if grep ' nm_test_var$' "$nlist" >/dev/null; then - if grep ' nm_test_func$' "$nlist" >/dev/null; then - cat < 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 <> 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_prog_compiler_no_builtin_flag" - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" - else - echo "cannot find nm_test_func in $nlist" >&5 - fi - else - echo "cannot find nm_test_var in $nlist" >&5 - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 - fi - else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - fi - rm -f conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done - -fi - -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 - echo "$as_me:$LINENO: result: failed" >&5 -echo "${ECHO_T}failed" >&6 -else - echo "$as_me:$LINENO: result: ok" >&5 -echo "${ECHO_T}ok" >&6 -fi - -echo "$as_me:$LINENO: checking for objdir" >&5 -echo $ECHO_N "checking for objdir... $ECHO_C" >&6 -if test "${lt_cv_objdir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - 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 -fi -echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 -echo "${ECHO_T}$lt_cv_objdir" >&6 -objdir=$lt_cv_objdir - - - - - -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" - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. -set dummy ${ac_tool_prefix}ar; 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_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # 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_AR="${ac_tool_prefix}ar" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - echo "$as_me:$LINENO: result: $AR" >&5 -echo "${ECHO_T}$AR" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_AR"; then - ac_ct_AR=$AR - # Extract the first word of "ar", so it can be a program name with args. -set dummy ar; 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_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # 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_AR="ar" - 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_AR" && ac_cv_prog_ac_ct_AR="false" -fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 -echo "${ECHO_T}$ac_ct_AR" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - AR=$ac_ct_AR -else - AR="$ac_cv_prog_AR" -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 - -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 - - -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 - -for cc_temp in $compiler""; 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-%%"` - - -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 -echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/${ac_tool_prefix}file; then - lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <&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@gnu.org - -EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac -fi - -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - echo "$as_me:$LINENO: checking for file" >&5 -echo $ECHO_N "checking for file... $ECHO_C" >&6 -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/file; then - lt_cv_path_MAGIC_CMD="$ac_dir/file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <&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@gnu.org - -EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac -fi - -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - else - MAGIC_CMD=: - fi -fi - - fi - ;; -esac - -enable_dlopen=yes -enable_win32_dll=no - -# Check whether --enable-libtool-lock or --disable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then - enableval="$enable_libtool_lock" - -fi; -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - - -# Check whether --with-pic or --without-pic was given. -if test "${with_pic+set}" = set; then - withval="$with_pic" - pic_mode="$withval" -else - pic_mode=default -fi; -test -z "$pic_mode" && pic_mode=default - -# Use C for the default configuration in the libtool script -tagname= -lt_save_CC="$CC" -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 - - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -objext=$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' - - -# 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 - - -# save warnings/boilerplate of simple test code -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* - -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_prog_compiler_no_builtin_flag= - -if test "$GCC" = yes; then - lt_prog_compiler_no_builtin_flag=' -fno-builtin' - - -echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 -if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" - # 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:9014: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:9018: \$? = $ac_status" >&5 - 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 - lt_cv_prog_compiler_rtti_exceptions=yes - fi - fi - $rm conftest* - -fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 - -if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then - lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" -else - : -fi - -fi - -lt_prog_compiler_wl= -lt_prog_compiler_pic= -lt_prog_compiler_static= - -echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 - - if test "$GCC" = yes; then - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_static='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-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_prog_compiler_pic='-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_prog_compiler_pic='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic='-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_prog_compiler_can_build_shared=no - enable_shared=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic=-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_prog_compiler_pic='-fPIC' - ;; - esac - ;; - - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - else - lt_prog_compiler_static='-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_prog_compiler_pic='-qnocommon' - lt_prog_compiler_wl='-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_prog_compiler_pic='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl='-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_prog_compiler_pic='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static='-non_shared' - ;; - - newsos6) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - linux*) - case $cc_basename in - icc* | ecc*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fpic' - lt_prog_compiler_static='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - - solaris*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - lt_prog_compiler_wl='-Qoption ld ';; - *) - lt_prog_compiler_wl='-Wl,';; - esac - ;; - - sunos4*) - lt_prog_compiler_wl='-Qoption ld ' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic='-Kconform_pic' - lt_prog_compiler_static='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - unicos*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_can_build_shared=no - ;; - - uts4*) - lt_prog_compiler_pic='-pic' - lt_prog_compiler_static='-Bstatic' - ;; - - *) - lt_prog_compiler_can_build_shared=no - ;; - esac - fi - -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic" >&6 - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic"; then - -echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 -if test "${lt_prog_compiler_pic_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic -DPIC" - # 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:9282: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:9286: \$? = $ac_status" >&5 - 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 - lt_prog_compiler_pic_works=yes - fi - fi - $rm conftest* - -fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6 - -if test x"$lt_prog_compiler_pic_works" = xyes; then - case $lt_prog_compiler_pic in - "" | " "*) ;; - *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; - esac -else - lt_prog_compiler_pic= - lt_prog_compiler_can_build_shared=no -fi - -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic= - ;; - *) - lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" - ;; -esac - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 -if test "${lt_prog_compiler_static_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - 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>&5 - $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 - lt_prog_compiler_static_works=yes - fi - else - lt_prog_compiler_static_works=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" - -fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 - -if test x"$lt_prog_compiler_static_works" = xyes; then - : -else - lt_prog_compiler_static= -fi - - -echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 -if test "${lt_cv_prog_compiler_c_o+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o=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:9386: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:9390: \$? = $ac_status" >&5 - 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_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . 2>&5 - $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* - -fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6 - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi - -echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 - - runpath_var= - allow_undefined_flag= - enable_shared_with_static_runtimes=no - archive_cmds= - archive_expsym_cmds= - old_archive_From_new_cmds= - old_archive_from_expsyms_cmds= - export_dynamic_flag_spec= - whole_archive_flag_spec= - thread_safe_flag_spec= - hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld= - hardcode_libdir_separator= - hardcode_direct=no - hardcode_minus_L=no - hardcode_shlibpath_var=unsupported - link_all_deplibs=unknown - hardcode_automatic=no - module_cmds= - module_expsym_cmds= - always_export_symbols=no - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms= - # exclude_expsyms can be an 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'. - exclude_expsyms="_GLOBAL_OFFSET_TABLE_" - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - for cc_temp in $compiler""; 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-%%"` - - 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 - - ld_shlibs=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 - hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec='${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 - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec= - 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 - ld_shlibs=no - cat <&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*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - - # Samuel A. Falvo II 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. - ld_shlibs=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - allow_undefined_flag=unsupported - always_export_symbols=no - enable_shared_with_static_runtimes=yes - export_symbols_cmds='$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 - archive_cmds='$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... - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - 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 - ld_shlibs=no - fi - ;; - - interix3*) - hardcode_direct=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${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. - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='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 - whole_archive_flag_spec='${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 - whole_archive_flag_spec='${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 - archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test $supports_anon_versioning = yes; then - archive_expsym_cmds='$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 - ld_shlibs=no - fi - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris*) - if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <&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 - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs=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 - hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - ;; - - sunos4*) - archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - - if test "$ld_shlibs" = no; then - runpath_var= - hardcode_libdir_flag_spec= - export_dynamic_flag_spec= - whole_archive_flag_spec= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag=unsupported - always_export_symbols=yes - archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # 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 - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - 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. - - archive_cmds='' - hardcode_direct=yes - hardcode_libdir_separator=':' - link_all_deplibs=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 - hardcode_direct=yes - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - ;; - esac - shared_flag='-shared' - 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. - always_export_symbols=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag='-berok' - # Determine the default libpath from the value encoded in an empty executable. - 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 conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - -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 -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds="\$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 - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $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. - 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 conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - -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 -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec='${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. - no_undefined_flag=' ${wl}-bernotok' - allow_undefined_flag=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec='$convenience' - archive_cmds_need_lc=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds="\$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*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - # see comment about different semantics on the GNU ld section - ld_shlibs=no - ;; - - bsdi[45]*) - export_dynamic_flag_spec=-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. - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=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. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_From_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes=yes - ;; - - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc=no - hardcode_direct=no - hardcode_automatic=yes - hardcode_shlibpath_var=unsupported - whole_archive_flag_spec='' - link_all_deplibs=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - module_cmds='$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 - archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds='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' - archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds='$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 - archive_expsym_cmds='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}' - module_expsym_cmds='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}' - ;; - *) - ld_shlibs=no - ;; - esac - fi - ;; - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - freebsd1*) - ld_shlibs=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu | dragonfly*) - archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - hpux9*) - if test "$GCC" = yes; then - archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - export_dynamic_flag_spec='${wl}-E' - ;; - - hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - - hardcode_direct=yes - export_dynamic_flag_spec='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds='$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*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds='$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 - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - - case $host_cpu in - hppa*64*|ia64*) - hardcode_libdir_flag_spec_ld='+b $libdir' - hardcode_direct=no - hardcode_shlibpath_var=no - ;; - *) - hardcode_direct=yes - export_dynamic_flag_spec='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_ld='-rpath $libdir' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - link_all_deplibs=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - newsos6) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_shlibpath_var=no - ;; - - openbsd*) - hardcode_direct=yes - hardcode_shlibpath_var=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%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 - hardcode_libdir_flag_spec='-rpath $libdir' - fi - hardcode_libdir_separator=: - ;; - - solaris*) - no_undefined_flag=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$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='' - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_shlibpath_var=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 - '') - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; - *) - whole_archive_flag_spec='${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 - link_all_deplibs=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - sysv4) - case $host_vendor in - sni) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds='$CC -r -o $output$reload_objs' - hardcode_direct=no - ;; - motorola) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - - sysv4.3*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) - no_undefined_flag='${wl}-z,text' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$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. - no_undefined_flag='${wl}-z,text' - allow_undefined_flag='${wl}-z,nodefs' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - hardcode_libdir_separator=':' - link_all_deplibs=yes - export_dynamic_flag_spec='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - *) - ld_shlibs=no - ;; - esac - fi - -echo "$as_me:$LINENO: result: $ld_shlibs" >&5 -echo "${ECHO_T}$ld_shlibs" >&6 -test "$ld_shlibs" = no && can_build_shared=no - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl - pic_flag=$lt_prog_compiler_pic - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc=no - else - archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 -echo "${ECHO_T}$archive_cmds_need_lc" >&6 - ;; - esac - fi - ;; -esac - -echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 -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.so - # instead of lib.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 10855 "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.$ac_objext` in - *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 -echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6 -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 - -echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || \ - test -n "$runpath_var" || \ - test "X$hardcode_automatic" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && - test "$hardcode_minus_L" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported -fi -echo "$as_me:$LINENO: result: $hardcode_action" >&5 -echo "${ECHO_T}$hardcode_action" >&6 - -if test "$hardcode_action" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - -striplib= -old_striplib= -echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 -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" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -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" - 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 -fi - ;; - *) - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - ;; - esac -fi - -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 - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dl_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dl_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 -if test $ac_cv_lib_dl_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - -fi - - ;; - - *) - echo "$as_me:$LINENO: checking for shl_load" >&5 -echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 -if test "${ac_cv_func_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define shl_load to an innocuous variant, in case declares shl_load. - For example, HP-UX 11i declares gettimeofday. */ -#define shl_load innocuous_shl_load - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char shl_load (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef shl_load - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shl_load (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_shl_load) || defined (__stub___shl_load) -choke me -#else -char (*f) () = shl_load; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != shl_load; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_shl_load=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 -echo "${ECHO_T}$ac_cv_func_shl_load" >&6 -if test $ac_cv_func_shl_load = yes; then - lt_cv_dlopen="shl_load" -else - echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 -if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shl_load (); -int -main () -{ -shl_load (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dld_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dld_shl_load=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 -if test $ac_cv_lib_dld_shl_load = yes; then - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" -else - echo "$as_me:$LINENO: checking for dlopen" >&5 -echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 -if test "${ac_cv_func_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define dlopen to an innocuous variant, in case declares dlopen. - For example, HP-UX 11i declares gettimeofday. */ -#define dlopen innocuous_dlopen - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char dlopen (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef dlopen - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_dlopen) || defined (__stub___dlopen) -choke me -#else -char (*f) () = dlopen; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != dlopen; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 -echo "${ECHO_T}$ac_cv_func_dlopen" >&6 -if test $ac_cv_func_dlopen = yes; then - lt_cv_dlopen="dlopen" -else - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dl_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dl_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 -if test $ac_cv_lib_dl_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 -echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 -if test "${ac_cv_lib_svld_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsvld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_svld_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_svld_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 -if test $ac_cv_lib_svld_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" -else - echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 -echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 -if test "${ac_cv_lib_dld_dld_link+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dld_link (); -int -main () -{ -dld_link (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dld_dld_link=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dld_dld_link=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 -if test $ac_cv_lib_dld_dld_link = yes; then - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" -fi - - -fi - - -fi - - -fi - - -fi - - -fi - - ;; - 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" - - echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 -echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 -if test "${lt_cv_dlopen_self+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext < -#endif - -#include - -#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 { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self=no - fi -fi -rm -fr conftest* - - -fi -echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self" >&6 - - if test "x$lt_cv_dlopen_self" = xyes; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 -echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 -if test "${lt_cv_dlopen_self_static+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self_static=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext < -#endif - -#include - -#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 { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self_static=no - fi -fi -rm -fr conftest* - - -fi -echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 - 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 - - -# Report which library types will actually be built -echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 -echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $can_build_shared" >&5 -echo "${ECHO_T}$can_build_shared" >&6 - -echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 -echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 -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 -echo "$as_me:$LINENO: result: $enable_shared" >&5 -echo "${ECHO_T}$enable_shared" >&6 - -echo "$as_me:$LINENO: checking whether to build static libraries" >&5 -echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -echo "$as_me:$LINENO: result: $enable_static" >&5 -echo "${ECHO_T}$enable_static" >&6 - -# 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 \ - compiler \ - CC \ - LD \ - lt_prog_compiler_wl \ - lt_prog_compiler_pic \ - lt_prog_compiler_static \ - lt_prog_compiler_no_builtin_flag \ - export_dynamic_flag_spec \ - thread_safe_flag_spec \ - whole_archive_flag_spec \ - enable_shared_with_static_runtimes \ - old_archive_cmds \ - old_archive_from_new_cmds \ - predep_objects \ - postdep_objects \ - predeps \ - postdeps \ - compiler_lib_search_path \ - archive_cmds \ - archive_expsym_cmds \ - postinstall_cmds \ - postuninstall_cmds \ - old_archive_from_expsyms_cmds \ - allow_undefined_flag \ - no_undefined_flag \ - export_symbols_cmds \ - hardcode_libdir_flag_spec \ - hardcode_libdir_flag_spec_ld \ - hardcode_libdir_separator \ - hardcode_automatic \ - module_cmds \ - module_expsym_cmds \ - lt_cv_prog_compiler_c_o \ - exclude_expsyms \ - include_expsyms; do - - case $var in - old_archive_cmds | \ - old_archive_from_new_cmds | \ - archive_cmds | \ - archive_expsym_cmds | \ - module_cmds | \ - module_expsym_cmds | \ - old_archive_from_expsyms_cmds | \ - export_symbols_cmds | \ - 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 - -cfgfile="${ofile}T" - trap "$rm \"$cfgfile\"; exit 1" 1 2 15 - $rm -f "$cfgfile" - { echo "$as_me:$LINENO: creating $ofile" >&5 -echo "$as_me: creating $ofile" >&6;} - - cat <<__EOF__ >> "$cfgfile" -#! $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 , 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 - -# 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=$archive_cmds_need_lc - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes - -# 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_compiler - -# Is the compiler the GNU C compiler? -with_gcc=$GCC - -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_LD - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$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_prog_compiler_wl - -# 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_prog_compiler_pic -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_cv_prog_compiler_c_o - -# 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_prog_compiler_static - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds -archive_expsym_cmds=$lt_archive_expsym_cmds -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds -module_expsym_cmds=$lt_module_expsym_cmds - -# 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_predep_objects | \$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_postdep_objects | \$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_predeps - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=\`echo $lt_compiler_lib_search_path | \$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_allow_undefined_flag - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_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=$hardcode_action - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec - -# 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_hardcode_libdir_flag_spec_ld - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var - -# 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=$hardcode_automatic - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs - -# Compile-time system search path for libraries -sys_lib_search_path_spec=\`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="$fix_srcfile_path" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms - -# ### END LIBTOOL CONFIG - -__EOF__ - - - case $host_os in - aix3*) - cat <<\EOF >> "$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_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 - -CC="$lt_save_CC" - - -# Check whether --with-tags or --without-tags was given. -if test "${with_tags+set}" = set; then - withval="$with_tags" - tagnames="$withval" -fi; - -if test -f "$ltmain" && test -n "$tagnames"; then - if test ! -f "${ofile}"; then - { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 -echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} - fi - - if test -z "$LTCC"; then - eval "`$SHELL ${ofile} --config | grep '^LTCC='`" - if test -z "$LTCC"; then - { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 -echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} - else - { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 -echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} - 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 - "") ;; - *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 -echo "$as_me: error: invalid tag name: $tagname" >&2;} - { (exit 1); exit 1; }; } - ;; - esac - - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null - then - { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 -echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} - { (exit 1); exit 1; }; } - 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_ext=cc -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - -archive_cmds_need_lc_CXX=no -allow_undefined_flag_CXX= -always_export_symbols_CXX=no -archive_expsym_cmds_CXX= -export_dynamic_flag_spec_CXX= -hardcode_direct_CXX=no -hardcode_libdir_flag_spec_CXX= -hardcode_libdir_flag_spec_ld_CXX= -hardcode_libdir_separator_CXX= -hardcode_minus_L_CXX=no -hardcode_shlibpath_var_CXX=unsupported -hardcode_automatic_CXX=no -module_cmds_CXX= -module_expsym_cmds_CXX= -link_all_deplibs_CXX=unknown -old_archive_cmds_CXX=$old_archive_cmds -no_undefined_flag_CXX= -whole_archive_flag_spec_CXX= -enable_shared_with_static_runtimes_CXX=no - -# Dependencies to place before and after the object being linked: -predep_objects_CXX= -postdep_objects_CXX= -predeps_CXX= -postdeps_CXX= -compiler_lib_search_path_CXX= - -# Source file extension for C++ test sources. -ac_ext=cpp - -# Object file extension for compiled C++ test sources. -objext=o -objext_CXX=$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. - -# 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 - - -# save warnings/boilerplate of simple test code -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* - -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* - - -# 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 -compiler_CXX=$CC -for cc_temp in $compiler""; 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-%%"` - - -# We don't want -fno-exception wen compiling C++ code, so set the -# no_builtin_flag separately -if test "$GXX" = yes; then - lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' -else - lt_prog_compiler_no_builtin_flag_CXX= -fi - -if test "$GXX" = yes; then - # Set up default GNU C++ configuration - - -# Check whether --with-gnu-ld or --without-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then - withval="$with_gnu_ld" - test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no -fi; -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - echo "$as_me:$LINENO: checking for ld used by $CC" >&5 -echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | ?:[\\/]*) - 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 - echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 -else - echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 -fi -if test "${lt_cv_path_LD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -z "$LD"; then - 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 &5 -echo "${ECHO_T}$LD" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi -test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 -echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} - { (exit 1); exit 1; }; } -echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 -if test "${lt_cv_prog_gnu_ld+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &5 -echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 -with_gnu_ld=$lt_cv_prog_gnu_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 - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - - hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_CXX='${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 - whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_CXX= - 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. - archive_cmds_CXX='$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 -echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 -ld_shlibs_CXX=yes -case $host_os in - aix3*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=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. - - archive_cmds_CXX='' - hardcode_direct_CXX=yes - hardcode_libdir_separator_CXX=':' - link_all_deplibs_CXX=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 - hardcode_direct_CXX=yes - else - # We have old collect2 - hardcode_direct_CXX=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L_CXX=yes - hardcode_libdir_flag_spec_CXX='-L$libdir' - hardcode_libdir_separator_CXX= - 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. - always_export_symbols_CXX=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag_CXX='-berok' - # Determine the default libpath from the value encoded in an empty executable. - 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 conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_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 - -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 -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" - - archive_expsym_cmds_CXX="\$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 - hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_CXX="-z nodefs" - archive_expsym_cmds_CXX="\$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. - 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 conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_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 - -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 -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_CXX='${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. - no_undefined_flag_CXX=' ${wl}-bernotok' - allow_undefined_flag_CXX=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_CXX='$convenience' - archive_cmds_need_lc_CXX=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds_CXX="\$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 - allow_undefined_flag_CXX=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs_CXX=no - fi - ;; - - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_CXX='-L$libdir' - allow_undefined_flag_CXX=unsupported - always_export_symbols_CXX=no - enable_shared_with_static_runtimes_CXX=yes - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds_CXX='$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... - archive_expsym_cmds_CXX='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 - ld_shlibs_CXX=no - fi - ;; - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc_CXX=no - hardcode_direct_CXX=no - hardcode_automatic_CXX=yes - hardcode_shlibpath_var_CXX=unsupported - whole_archive_flag_spec_CXX='' - link_all_deplibs_CXX=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 - archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - archive_cmds_CXX='$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 - module_cmds_CXX='$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 - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - archive_expsym_cmds_CXX='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 - module_expsym_cmds_CXX='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' - archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds_CXX='$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 - archive_expsym_cmds_CXX='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}' - module_expsym_cmds_CXX='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}' - ;; - *) - ld_shlibs_CXX=no - ;; - esac - fi - ;; - - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - freebsd[12]*) - # C++ shared libraries reported to be fairly broken before switch to ELF - ld_shlibs_CXX=no - ;; - freebsd-elf*) - archive_cmds_need_lc_CXX=no - ;; - freebsd* | kfreebsd*-gnu | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - ld_shlibs_CXX=yes - ;; - gnu*) - ;; - hpux9*) - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_CXX=: - export_dynamic_flag_spec_CXX='${wl}-E' - hardcode_direct_CXX=yes - hardcode_minus_L_CXX=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 - ld_shlibs_CXX=no - ;; - aCC*) - archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # 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 - archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_CXX=: - - case $host_cpu in - hppa*64*|ia64*) - hardcode_libdir_flag_spec_ld_CXX='+b $libdir' - ;; - *) - export_dynamic_flag_spec_CXX='${wl}-E' - ;; - esac - fi - case $host_cpu in - hppa*64*|ia64*) - hardcode_direct_CXX=no - hardcode_shlibpath_var_CXX=no - ;; - *) - hardcode_direct_CXX=yes - hardcode_minus_L_CXX=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 - ld_shlibs_CXX=no - ;; - aCC*) - case $host_cpu in - hppa*64*) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - archive_cmds_CXX='$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*) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - interix3*) - hardcode_direct_CXX=no - hardcode_shlibpath_var_CXX=no - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - export_dynamic_flag_spec_CXX='${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. - archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds_CXX='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++ - archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${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. - old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' - fi - fi - link_all_deplibs_CXX=yes - ;; - esac - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - ;; - 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. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # 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' - - hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - old_archive_cmds_CXX='$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."*) - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - tmp_idyn= - case $host_cpu in - ia64*) tmp_idyn=' -i_dynamic';; - esac - archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - archive_cmds_need_lc_CXX=no - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - pgCC*) - # Portland Group C++ compiler - archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - archive_expsym_cmds_CXX='$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' - - hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${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++ - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec_CXX='-rpath $libdir' - hardcode_libdir_separator_CXX=: - - # 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 - ld_shlibs_CXX=no - ;; - m88k*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - hardcode_libdir_flag_spec_CXX='-R$libdir' - hardcode_direct_CXX=yes - hardcode_shlibpath_var_CXX=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 - ld_shlibs_CXX=no - ;; - openbsd*) - hardcode_direct_CXX=yes - hardcode_shlibpath_var_CXX=no - archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - export_dynamic_flag_spec_CXX='${wl}-E' - whole_archive_flag_spec_CXX="$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. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - hardcode_libdir_separator_CXX=: - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' - - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - cxx*) - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - - # 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 - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - - # 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 - ld_shlibs_CXX=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. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - hardcode_libdir_separator_CXX=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - cxx*) - allow_undefined_flag_CXX=' -expect_unresolved \*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_CXX='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' - - hardcode_libdir_flag_spec_CXX='-rpath $libdir' - hardcode_libdir_separator_CXX=: - - # 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 - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - - # 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 - ld_shlibs_CXX=no - fi - ;; - esac - ;; - psos*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - archive_cmds_need_lc_CXX=yes - no_undefined_flag_CXX=' -zdefs' - archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - archive_expsym_cmds_CXX='$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' - - hardcode_libdir_flag_spec_CXX='-R$libdir' - hardcode_shlibpath_var_CXX=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?) - whole_archive_flag_spec_CXX='${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 - link_all_deplibs_CXX=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. - old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - archive_cmds_CXX='$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. - old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - no_undefined_flag_CXX=' ${wl}-z ${wl}defs' - if $CC --version | grep -v '^2\.7' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='$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. - archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='$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 - - hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' - fi - ;; - esac - ;; - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag_CXX='${wl}-z,text' - archive_cmds_need_lc_CXX=no - hardcode_shlibpath_var_CXX=no - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$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. - no_undefined_flag_CXX='${wl}-z,text' - allow_undefined_flag_CXX='${wl}-z,nodefs' - archive_cmds_need_lc_CXX=no - hardcode_shlibpath_var_CXX=no - hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - hardcode_libdir_separator_CXX=':' - link_all_deplibs_CXX=yes - export_dynamic_flag_spec_CXX='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$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 - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - vxworks*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; -esac -echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 -echo "${ECHO_T}$ld_shlibs_CXX" >&6 -test "$ld_shlibs_CXX" = no && can_build_shared=no - -GCC_CXX="$GXX" -LD_CXX="$LD" - - -cat > conftest.$ac_ext <&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; 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 "$compiler_lib_search_path_CXX"; then - compiler_lib_search_path_CXX="${prev}${p}" - else - compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${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 "$postdeps_CXX"; then - postdeps_CXX="${prev}${p}" - else - postdeps_CXX="${postdeps_CXX} ${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 "$predep_objects_CXX"; then - predep_objects_CXX="$p" - else - predep_objects_CXX="$predep_objects_CXX $p" - fi - else - if test -z "$postdep_objects_CXX"; then - postdep_objects_CXX="$p" - else - postdep_objects_CXX="$postdep_objects_CXX $p" - fi - fi - ;; - - *) ;; # Ignore the rest. - - esac - done - - # Clean up. - rm -f a.out a.exe -else - echo "libtool.m4: error: problem compiling CXX test program" -fi - -$rm -f confest.$objext - -# PORTME: override above test on systems where it is broken -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. - predep_objects_CXX= - postdep_objects_CXX= - postdeps_CXX= - ;; - -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. - postdeps_CXX='-lCstd -lCrun' - ;; - esac - ;; -esac - - -case " $postdeps_CXX " in -*" -lc "*) archive_cmds_need_lc_CXX=no ;; -esac - -lt_prog_compiler_wl_CXX= -lt_prog_compiler_pic_CXX= -lt_prog_compiler_static_CXX= - -echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 - - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_CXX='-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_prog_compiler_pic_CXX='-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_prog_compiler_pic_CXX='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_CXX='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - lt_prog_compiler_pic_CXX= - ;; - 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_prog_compiler_pic_CXX=-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_prog_compiler_pic_CXX='-fPIC' - ;; - esac - ;; - *) - lt_prog_compiler_pic_CXX='-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_prog_compiler_static_CXX='-Bstatic' - else - lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - lt_prog_compiler_pic_CXX='-qnocommon' - lt_prog_compiler_wl_CXX='-Wl,' - ;; - esac - ;; - dgux*) - case $cc_basename in - ec++*) - lt_prog_compiler_pic_CXX='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - lt_prog_compiler_pic_CXX='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | kfreebsd*-gnu | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' - if test "$host_cpu" != ia64; then - lt_prog_compiler_pic_CXX='+Z' - fi - ;; - aCC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_CXX='+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_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux*) - case $cc_basename in - KCC*) - # KAI C++ Compiler - lt_prog_compiler_wl_CXX='--backend -Wl,' - lt_prog_compiler_pic_CXX='-fPIC' - ;; - icpc* | ecpc*) - # Intel C++ - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-static' - ;; - pgCC*) - # Portland Group C++ compiler. - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-fpic' - lt_prog_compiler_static_CXX='-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_prog_compiler_pic_CXX= - lt_prog_compiler_static_CXX='-non_shared' - ;; - *) - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - lt_prog_compiler_pic_CXX='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd*) - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - lt_prog_compiler_wl_CXX='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - lt_prog_compiler_pic_CXX='-pic' - ;; - cxx*) - # Digital/Compaq C++ - lt_prog_compiler_wl_CXX='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - lt_prog_compiler_pic_CXX= - lt_prog_compiler_static_CXX='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-Bstatic' - lt_prog_compiler_wl_CXX='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - lt_prog_compiler_pic_CXX='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - lt_prog_compiler_pic_CXX='-pic' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - lcc*) - # Lucid - lt_prog_compiler_pic_CXX='-pic' - ;; - *) - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - lt_prog_compiler_pic_CXX='-KPIC' - ;; - *) - ;; - esac - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - esac - ;; - vxworks*) - ;; - *) - lt_prog_compiler_can_build_shared_CXX=no - ;; - esac - fi - -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6 - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_CXX"; then - -echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6 -if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works_CXX=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" - # 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:14195: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:14199: \$? = $ac_status" >&5 - 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 - lt_prog_compiler_pic_works_CXX=yes - fi - fi - $rm conftest* - -fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6 - -if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then - case $lt_prog_compiler_pic_CXX in - "" | " "*) ;; - *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; - esac -else - lt_prog_compiler_pic_CXX= - lt_prog_compiler_can_build_shared_CXX=no -fi - -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_CXX= - ;; - *) - lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" - ;; -esac - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" -echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 -if test "${lt_prog_compiler_static_works_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works_CXX=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - 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>&5 - $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 - lt_prog_compiler_static_works_CXX=yes - fi - else - lt_prog_compiler_static_works_CXX=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" - -fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6 - -if test x"$lt_prog_compiler_static_works_CXX" = xyes; then - : -else - lt_prog_compiler_static_CXX= -fi - - -echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 -if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o_CXX=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:14299: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:14303: \$? = $ac_status" >&5 - 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_cv_prog_compiler_c_o_CXX=yes - fi - fi - chmod u+w . 2>&5 - $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* - -fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6 - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6 - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi - -echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 - - export_symbols_cmds_CXX='$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 - export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - export_symbols_cmds_CXX="$ltdll_cmds" - ;; - cygwin* | mingw*) - export_symbols_cmds_CXX='$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' - ;; - *) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac - -echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 -echo "${ECHO_T}$ld_shlibs_CXX" >&6 -test "$ld_shlibs_CXX" = no && can_build_shared=no - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_CXX" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_CXX=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_CXX 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. - echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_CXX - pic_flag=$lt_prog_compiler_pic_CXX - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_CXX - allow_undefined_flag_CXX= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc_CXX=no - else - archive_cmds_need_lc_CXX=yes - fi - allow_undefined_flag_CXX=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6 - ;; - esac - fi - ;; -esac - -echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 -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.so - # instead of lib.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 14835 "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.$ac_objext` in - *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 -echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6 -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 - -echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 -hardcode_action_CXX= -if test -n "$hardcode_libdir_flag_spec_CXX" || \ - test -n "$runpath_var_CXX" || \ - test "X$hardcode_automatic_CXX" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct_CXX" != 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, CXX)" != no && - test "$hardcode_minus_L_CXX" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_CXX=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_CXX=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_CXX=unsupported -fi -echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 -echo "${ECHO_T}$hardcode_action_CXX" >&6 - -if test "$hardcode_action_CXX" = 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 - - -# 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 \ - compiler_CXX \ - CC_CXX \ - LD_CXX \ - lt_prog_compiler_wl_CXX \ - lt_prog_compiler_pic_CXX \ - lt_prog_compiler_static_CXX \ - lt_prog_compiler_no_builtin_flag_CXX \ - export_dynamic_flag_spec_CXX \ - thread_safe_flag_spec_CXX \ - whole_archive_flag_spec_CXX \ - enable_shared_with_static_runtimes_CXX \ - old_archive_cmds_CXX \ - old_archive_from_new_cmds_CXX \ - predep_objects_CXX \ - postdep_objects_CXX \ - predeps_CXX \ - postdeps_CXX \ - compiler_lib_search_path_CXX \ - archive_cmds_CXX \ - archive_expsym_cmds_CXX \ - postinstall_cmds_CXX \ - postuninstall_cmds_CXX \ - old_archive_from_expsyms_cmds_CXX \ - allow_undefined_flag_CXX \ - no_undefined_flag_CXX \ - export_symbols_cmds_CXX \ - hardcode_libdir_flag_spec_CXX \ - hardcode_libdir_flag_spec_ld_CXX \ - hardcode_libdir_separator_CXX \ - hardcode_automatic_CXX \ - module_cmds_CXX \ - module_expsym_cmds_CXX \ - lt_cv_prog_compiler_c_o_CXX \ - exclude_expsyms_CXX \ - include_expsyms_CXX; do - - case $var in - old_archive_cmds_CXX | \ - old_archive_from_new_cmds_CXX | \ - archive_cmds_CXX | \ - archive_expsym_cmds_CXX | \ - module_cmds_CXX | \ - module_expsym_cmds_CXX | \ - old_archive_from_expsyms_cmds_CXX | \ - export_symbols_cmds_CXX | \ - 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 - -cfgfile="$ofile" - - cat <<__EOF__ >> "$cfgfile" -# ### 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=$archive_cmds_need_lc_CXX - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX - -# 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_compiler_CXX - -# Is the compiler the GNU C compiler? -with_gcc=$GCC_CXX - -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_LD_CXX - -# 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_prog_compiler_wl_CXX - -# 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_prog_compiler_pic_CXX -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_cv_prog_compiler_c_o_CXX - -# 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_prog_compiler_static_CXX - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_CXX -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_CXX -archive_expsym_cmds=$lt_archive_expsym_cmds_CXX -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_module_cmds_CXX -module_expsym_cmds=$lt_module_expsym_cmds_CXX - -# 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_predep_objects_CXX | \$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_postdep_objects_CXX | \$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_predeps_CXX - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_CXX - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_CXX | \$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_allow_undefined_flag_CXX - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_CXX - -# 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=$hardcode_action_CXX - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX - -# 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_hardcode_libdir_flag_spec_ld_CXX - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_CXX - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_CXX - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX - -# 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=$hardcode_automatic_CXX - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_CXX - -# 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="$fix_srcfile_path_CXX" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_CXX - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_CXX - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_CXX - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_CXX - -# ### END LIBTOOL TAG CONFIG: $tagname - -__EOF__ - - -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_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 - -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 - - else - tagname="" - fi - ;; - - F77) - if test -n "$F77" && test "X$F77" != "Xno"; then - -ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu - - -archive_cmds_need_lc_F77=no -allow_undefined_flag_F77= -always_export_symbols_F77=no -archive_expsym_cmds_F77= -export_dynamic_flag_spec_F77= -hardcode_direct_F77=no -hardcode_libdir_flag_spec_F77= -hardcode_libdir_flag_spec_ld_F77= -hardcode_libdir_separator_F77= -hardcode_minus_L_F77=no -hardcode_automatic_F77=no -module_cmds_F77= -module_expsym_cmds_F77= -link_all_deplibs_F77=unknown -old_archive_cmds_F77=$old_archive_cmds -no_undefined_flag_F77= -whole_archive_flag_spec_F77= -enable_shared_with_static_runtimes_F77=no - -# Source file extension for f77 test sources. -ac_ext=f - -# Object file extension for compiled f77 test sources. -objext=o -objext_F77=$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. - -# 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 - - -# save warnings/boilerplate of simple test code -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* - -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* - - -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${F77-"f77"} -compiler=$CC -compiler_F77=$CC -for cc_temp in $compiler""; 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-%%"` - - -echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 -echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $can_build_shared" >&5 -echo "${ECHO_T}$can_build_shared" >&6 - -echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 -echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 -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 -echo "$as_me:$LINENO: result: $enable_shared" >&5 -echo "${ECHO_T}$enable_shared" >&6 - -echo "$as_me:$LINENO: checking whether to build static libraries" >&5 -echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -echo "$as_me:$LINENO: result: $enable_static" >&5 -echo "${ECHO_T}$enable_static" >&6 - -GCC_F77="$G77" -LD_F77="$LD" - -lt_prog_compiler_wl_F77= -lt_prog_compiler_pic_F77= -lt_prog_compiler_static_F77= - -echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 - - if test "$GCC" = yes; then - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_static_F77='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_F77='-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_prog_compiler_pic_F77='-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_prog_compiler_pic_F77='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_F77='-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_prog_compiler_can_build_shared_F77=no - enable_shared=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_F77=-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_prog_compiler_pic_F77='-fPIC' - ;; - esac - ;; - - *) - lt_prog_compiler_pic_F77='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl_F77='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_F77='-Bstatic' - else - lt_prog_compiler_static_F77='-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_prog_compiler_pic_F77='-qnocommon' - lt_prog_compiler_wl_F77='-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_prog_compiler_pic_F77='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl_F77='-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_prog_compiler_pic_F77='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static_F77='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl_F77='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static_F77='-non_shared' - ;; - - newsos6) - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - linux*) - case $cc_basename in - icc* | ecc*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-fpic' - lt_prog_compiler_static_F77='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl_F77='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static_F77='-non_shared' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl_F77='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static_F77='-non_shared' - ;; - - solaris*) - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - lt_prog_compiler_wl_F77='-Qoption ld ';; - *) - lt_prog_compiler_wl_F77='-Wl,';; - esac - ;; - - sunos4*) - lt_prog_compiler_wl_F77='-Qoption ld ' - lt_prog_compiler_pic_F77='-PIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic_F77='-Kconform_pic' - lt_prog_compiler_static_F77='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - unicos*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_can_build_shared_F77=no - ;; - - uts4*) - lt_prog_compiler_pic_F77='-pic' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - *) - lt_prog_compiler_can_build_shared_F77=no - ;; - esac - fi - -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6 - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_F77"; then - -echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6 -if test "${lt_prog_compiler_pic_works_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works_F77=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_F77" - # 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:15893: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:15897: \$? = $ac_status" >&5 - 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 - lt_prog_compiler_pic_works_F77=yes - fi - fi - $rm conftest* - -fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6 - -if test x"$lt_prog_compiler_pic_works_F77" = xyes; then - case $lt_prog_compiler_pic_F77 in - "" | " "*) ;; - *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; - esac -else - lt_prog_compiler_pic_F77= - lt_prog_compiler_can_build_shared_F77=no -fi - -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_F77= - ;; - *) - lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" - ;; -esac - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" -echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 -if test "${lt_prog_compiler_static_works_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works_F77=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - 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>&5 - $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 - lt_prog_compiler_static_works_F77=yes - fi - else - lt_prog_compiler_static_works_F77=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" - -fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6 - -if test x"$lt_prog_compiler_static_works_F77" = xyes; then - : -else - lt_prog_compiler_static_F77= -fi - - -echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 -if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o_F77=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:15997: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:16001: \$? = $ac_status" >&5 - 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_cv_prog_compiler_c_o_F77=yes - fi - fi - chmod u+w . 2>&5 - $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* - -fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6 - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6 - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi - -echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 - - runpath_var= - allow_undefined_flag_F77= - enable_shared_with_static_runtimes_F77=no - archive_cmds_F77= - archive_expsym_cmds_F77= - old_archive_From_new_cmds_F77= - old_archive_from_expsyms_cmds_F77= - export_dynamic_flag_spec_F77= - whole_archive_flag_spec_F77= - thread_safe_flag_spec_F77= - hardcode_libdir_flag_spec_F77= - hardcode_libdir_flag_spec_ld_F77= - hardcode_libdir_separator_F77= - hardcode_direct_F77=no - hardcode_minus_L_F77=no - hardcode_shlibpath_var_F77=unsupported - link_all_deplibs_F77=unknown - hardcode_automatic_F77=no - module_cmds_F77= - module_expsym_cmds_F77= - always_export_symbols_F77=no - export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms_F77= - # 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'. - exclude_expsyms_F77="_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. - for cc_temp in $compiler""; 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-%%"` - - 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 - - ld_shlibs_F77=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 - hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_F77='${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 - whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_F77= - 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 - ld_shlibs_F77=no - cat <&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*) - archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_minus_L_F77=yes - - # Samuel A. Falvo II 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. - ld_shlibs_F77=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_F77=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs_F77=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_F77='-L$libdir' - allow_undefined_flag_F77=unsupported - always_export_symbols_F77=no - enable_shared_with_static_runtimes_F77=yes - export_symbols_cmds_F77='$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 - archive_cmds_F77='$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... - archive_expsym_cmds_F77='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 - ld_shlibs_F77=no - fi - ;; - - interix3*) - hardcode_direct_F77=no - hardcode_shlibpath_var_F77=no - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - export_dynamic_flag_spec_F77='${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. - archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds_F77='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 - whole_archive_flag_spec_F77='${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 - whole_archive_flag_spec_F77='${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 - archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test $supports_anon_versioning = yes; then - archive_expsym_cmds_F77='$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 - ld_shlibs_F77=no - fi - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$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 - ld_shlibs_F77=no - cat <&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 - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_F77=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs_F77=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 - hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' - else - ld_shlibs_F77=no - fi - ;; - esac - ;; - - sunos4*) - archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_F77=no - fi - ;; - esac - - if test "$ld_shlibs_F77" = no; then - runpath_var= - hardcode_libdir_flag_spec_F77= - export_dynamic_flag_spec_F77= - whole_archive_flag_spec_F77= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag_F77=unsupported - always_export_symbols_F77=yes - archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L_F77=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct_F77=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 - export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - 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. - - archive_cmds_F77='' - hardcode_direct_F77=yes - hardcode_libdir_separator_F77=':' - link_all_deplibs_F77=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 - hardcode_direct_F77=yes - else - # We have old collect2 - hardcode_direct_F77=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L_F77=yes - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_libdir_separator_F77= - 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. - always_export_symbols_F77=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag_F77='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_f77_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - -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 -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_F77="\$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 - hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_F77="-z nodefs" - archive_expsym_cmds_F77="\$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. - cat >conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_f77_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - -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 -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_F77='${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. - no_undefined_flag_F77=' ${wl}-bernotok' - allow_undefined_flag_F77=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_F77='$convenience' - archive_cmds_need_lc_F77=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds_F77="\$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*) - archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_minus_L_F77=yes - # see comment about different semantics on the GNU ld section - ld_shlibs_F77=no - ;; - - bsdi[45]*) - export_dynamic_flag_spec_F77=-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. - hardcode_libdir_flag_spec_F77=' ' - allow_undefined_flag_F77=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. - archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_From_new_cmds_F77='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path_F77='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes_F77=yes - ;; - - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc_F77=no - hardcode_direct_F77=no - hardcode_automatic_F77=yes - hardcode_shlibpath_var_F77=unsupported - whole_archive_flag_spec_F77='' - link_all_deplibs_F77=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - module_cmds_F77='$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 - archive_expsym_cmds_F77='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}' - module_expsym_cmds_F77='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' - archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds_F77='$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 - archive_expsym_cmds_F77='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}' - module_expsym_cmds_F77='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}' - ;; - *) - ld_shlibs_F77=no - ;; - esac - fi - ;; - - dgux*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_shlibpath_var_F77=no - ;; - - freebsd1*) - ld_shlibs_F77=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes - hardcode_minus_L_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu | dragonfly*) - archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - hpux9*) - if test "$GCC" = yes; then - archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_F77=: - hardcode_direct_F77=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - export_dynamic_flag_spec_F77='${wl}-E' - ;; - - hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_F77=: - - hardcode_direct_F77=yes - export_dynamic_flag_spec_F77='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_F77='$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*) - archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_F77='$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 - hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_F77=: - - case $host_cpu in - hppa*64*|ia64*) - hardcode_libdir_flag_spec_ld_F77='+b $libdir' - hardcode_direct_F77=no - hardcode_shlibpath_var_F77=no - ;; - *) - hardcode_direct_F77=yes - export_dynamic_flag_spec_F77='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' - fi - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - link_all_deplibs_F77=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - newsos6) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - hardcode_shlibpath_var_F77=no - ;; - - openbsd*) - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - export_dynamic_flag_spec_F77='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-R$libdir' - ;; - *) - archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_minus_L_F77=yes - allow_undefined_flag_F77=unsupported - archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag_F77=' -expect_unresolved \*' - archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag_F77=' -expect_unresolved \*' - archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $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 - hardcode_libdir_flag_spec_F77='-rpath $libdir' - fi - hardcode_libdir_separator_F77=: - ;; - - solaris*) - no_undefined_flag_F77=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$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='' - archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_F77='$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 - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_shlibpath_var_F77=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 - '') - whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; - *) - whole_archive_flag_spec_F77='${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 - link_all_deplibs_F77=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_direct_F77=yes - hardcode_minus_L_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - sysv4) - case $host_vendor in - sni) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds_F77='$CC -r -o $output$reload_objs' - hardcode_direct_F77=no - ;; - motorola) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var_F77=no - ;; - - sysv4.3*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_F77=no - export_dynamic_flag_spec_F77='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_F77=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs_F77=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) - no_undefined_flag_F77='${wl}-z,text' - archive_cmds_need_lc_F77=no - hardcode_shlibpath_var_F77=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$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. - no_undefined_flag_F77='${wl}-z,text' - allow_undefined_flag_F77='${wl}-z,nodefs' - archive_cmds_need_lc_F77=no - hardcode_shlibpath_var_F77=no - hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - hardcode_libdir_separator_F77=':' - link_all_deplibs_F77=yes - export_dynamic_flag_spec_F77='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_shlibpath_var_F77=no - ;; - - *) - ld_shlibs_F77=no - ;; - esac - fi - -echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 -echo "${ECHO_T}$ld_shlibs_F77" >&6 -test "$ld_shlibs_F77" = no && can_build_shared=no - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_F77" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_F77=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_F77 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. - echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_F77 - pic_flag=$lt_prog_compiler_pic_F77 - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_F77 - allow_undefined_flag_F77= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc_F77=no - else - archive_cmds_need_lc_F77=yes - fi - allow_undefined_flag_F77=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6 - ;; - esac - fi - ;; -esac - -echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 -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.so - # instead of lib.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 17446 "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.$ac_objext` in - *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 -echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6 -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 - -echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 -hardcode_action_F77= -if test -n "$hardcode_libdir_flag_spec_F77" || \ - test -n "$runpath_var_F77" || \ - test "X$hardcode_automatic_F77" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct_F77" != 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, F77)" != no && - test "$hardcode_minus_L_F77" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_F77=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_F77=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_F77=unsupported -fi -echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 -echo "${ECHO_T}$hardcode_action_F77" >&6 - -if test "$hardcode_action_F77" = 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 - - -# 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 \ - compiler_F77 \ - CC_F77 \ - LD_F77 \ - lt_prog_compiler_wl_F77 \ - lt_prog_compiler_pic_F77 \ - lt_prog_compiler_static_F77 \ - lt_prog_compiler_no_builtin_flag_F77 \ - export_dynamic_flag_spec_F77 \ - thread_safe_flag_spec_F77 \ - whole_archive_flag_spec_F77 \ - enable_shared_with_static_runtimes_F77 \ - old_archive_cmds_F77 \ - old_archive_from_new_cmds_F77 \ - predep_objects_F77 \ - postdep_objects_F77 \ - predeps_F77 \ - postdeps_F77 \ - compiler_lib_search_path_F77 \ - archive_cmds_F77 \ - archive_expsym_cmds_F77 \ - postinstall_cmds_F77 \ - postuninstall_cmds_F77 \ - old_archive_from_expsyms_cmds_F77 \ - allow_undefined_flag_F77 \ - no_undefined_flag_F77 \ - export_symbols_cmds_F77 \ - hardcode_libdir_flag_spec_F77 \ - hardcode_libdir_flag_spec_ld_F77 \ - hardcode_libdir_separator_F77 \ - hardcode_automatic_F77 \ - module_cmds_F77 \ - module_expsym_cmds_F77 \ - lt_cv_prog_compiler_c_o_F77 \ - exclude_expsyms_F77 \ - include_expsyms_F77; do - - case $var in - old_archive_cmds_F77 | \ - old_archive_from_new_cmds_F77 | \ - archive_cmds_F77 | \ - archive_expsym_cmds_F77 | \ - module_cmds_F77 | \ - module_expsym_cmds_F77 | \ - old_archive_from_expsyms_cmds_F77 | \ - export_symbols_cmds_F77 | \ - 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 - -cfgfile="$ofile" - - cat <<__EOF__ >> "$cfgfile" -# ### 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=$archive_cmds_need_lc_F77 - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 - -# 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_compiler_F77 - -# Is the compiler the GNU C compiler? -with_gcc=$GCC_F77 - -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_LD_F77 - -# 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_prog_compiler_wl_F77 - -# 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_prog_compiler_pic_F77 -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_cv_prog_compiler_c_o_F77 - -# 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_prog_compiler_static_F77 - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_F77 -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_F77 -archive_expsym_cmds=$lt_archive_expsym_cmds_F77 -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_module_cmds_F77 -module_expsym_cmds=$lt_module_expsym_cmds_F77 - -# 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_predep_objects_F77 | \$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_postdep_objects_F77 | \$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_predeps_F77 - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_F77 - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_F77 | \$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_allow_undefined_flag_F77 - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_F77 - -# 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=$hardcode_action_F77 - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 - -# 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_hardcode_libdir_flag_spec_ld_F77 - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_F77 - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_F77 - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 - -# 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=$hardcode_automatic_F77 - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_F77 - -# 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="$fix_srcfile_path_F77" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_F77 - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_F77 - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_F77 - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_F77 - -# ### END LIBTOOL TAG CONFIG: $tagname - -__EOF__ - - -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_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 - -CC="$lt_save_CC" - - else - tagname="" - fi - ;; - - GCJ) - if test -n "$GCJ" && test "X$GCJ" != "Xno"; then - - - -# Source file extension for Java test sources. -ac_ext=java - -# Object file extension for compiled Java test sources. -objext=o -objext_GCJ=$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. - -# 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 - - -# save warnings/boilerplate of simple test code -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* - -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* - - -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${GCJ-"gcj"} -compiler=$CC -compiler_GCJ=$CC -for cc_temp in $compiler""; 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-%%"` - - -# GCJ did not exist at the time GCC didn't implicitly link libc in. -archive_cmds_need_lc_GCJ=no - -old_archive_cmds_GCJ=$old_archive_cmds - - -lt_prog_compiler_no_builtin_flag_GCJ= - -if test "$GCC" = yes; then - lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' - - -echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 -if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" - # 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:18224: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:18228: \$? = $ac_status" >&5 - 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 - lt_cv_prog_compiler_rtti_exceptions=yes - fi - fi - $rm conftest* - -fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 - -if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then - lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" -else - : -fi - -fi - -lt_prog_compiler_wl_GCJ= -lt_prog_compiler_pic_GCJ= -lt_prog_compiler_static_GCJ= - -echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 - - if test "$GCC" = yes; then - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_static_GCJ='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_GCJ='-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_prog_compiler_pic_GCJ='-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_prog_compiler_pic_GCJ='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_GCJ='-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_prog_compiler_can_build_shared_GCJ=no - enable_shared=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_GCJ=-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_prog_compiler_pic_GCJ='-fPIC' - ;; - esac - ;; - - *) - lt_prog_compiler_pic_GCJ='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl_GCJ='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_GCJ='-Bstatic' - else - lt_prog_compiler_static_GCJ='-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_prog_compiler_pic_GCJ='-qnocommon' - lt_prog_compiler_wl_GCJ='-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_prog_compiler_pic_GCJ='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl_GCJ='-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_prog_compiler_pic_GCJ='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl_GCJ='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static_GCJ='-non_shared' - ;; - - newsos6) - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - linux*) - case $cc_basename in - icc* | ecc*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-fpic' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl_GCJ='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static_GCJ='-non_shared' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl_GCJ='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static_GCJ='-non_shared' - ;; - - solaris*) - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - lt_prog_compiler_wl_GCJ='-Qoption ld ';; - *) - lt_prog_compiler_wl_GCJ='-Wl,';; - esac - ;; - - sunos4*) - lt_prog_compiler_wl_GCJ='-Qoption ld ' - lt_prog_compiler_pic_GCJ='-PIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic_GCJ='-Kconform_pic' - lt_prog_compiler_static_GCJ='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - unicos*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_can_build_shared_GCJ=no - ;; - - uts4*) - lt_prog_compiler_pic_GCJ='-pic' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - *) - lt_prog_compiler_can_build_shared_GCJ=no - ;; - esac - fi - -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6 - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_GCJ"; then - -echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6 -if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works_GCJ=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_GCJ" - # 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:18492: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:18496: \$? = $ac_status" >&5 - 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 - lt_prog_compiler_pic_works_GCJ=yes - fi - fi - $rm conftest* - -fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6 - -if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then - case $lt_prog_compiler_pic_GCJ in - "" | " "*) ;; - *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; - esac -else - lt_prog_compiler_pic_GCJ= - lt_prog_compiler_can_build_shared_GCJ=no -fi - -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_GCJ= - ;; - *) - lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" - ;; -esac - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" -echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 -if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works_GCJ=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - 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>&5 - $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 - lt_prog_compiler_static_works_GCJ=yes - fi - else - lt_prog_compiler_static_works_GCJ=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" - -fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6 - -if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then - : -else - lt_prog_compiler_static_GCJ= -fi - - -echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 -if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o_GCJ=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:18596: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:18600: \$? = $ac_status" >&5 - 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_cv_prog_compiler_c_o_GCJ=yes - fi - fi - chmod u+w . 2>&5 - $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* - -fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6 - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6 - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi - -echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 - - runpath_var= - allow_undefined_flag_GCJ= - enable_shared_with_static_runtimes_GCJ=no - archive_cmds_GCJ= - archive_expsym_cmds_GCJ= - old_archive_From_new_cmds_GCJ= - old_archive_from_expsyms_cmds_GCJ= - export_dynamic_flag_spec_GCJ= - whole_archive_flag_spec_GCJ= - thread_safe_flag_spec_GCJ= - hardcode_libdir_flag_spec_GCJ= - hardcode_libdir_flag_spec_ld_GCJ= - hardcode_libdir_separator_GCJ= - hardcode_direct_GCJ=no - hardcode_minus_L_GCJ=no - hardcode_shlibpath_var_GCJ=unsupported - link_all_deplibs_GCJ=unknown - hardcode_automatic_GCJ=no - module_cmds_GCJ= - module_expsym_cmds_GCJ= - always_export_symbols_GCJ=no - export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms_GCJ= - # 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'. - exclude_expsyms_GCJ="_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. - for cc_temp in $compiler""; 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-%%"` - - 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 - - ld_shlibs_GCJ=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 - hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_GCJ='${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 - whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_GCJ= - 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 - ld_shlibs_GCJ=no - cat <&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*) - archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_minus_L_GCJ=yes - - # Samuel A. Falvo II 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. - ld_shlibs_GCJ=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_GCJ=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs_GCJ=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_GCJ='-L$libdir' - allow_undefined_flag_GCJ=unsupported - always_export_symbols_GCJ=no - enable_shared_with_static_runtimes_GCJ=yes - export_symbols_cmds_GCJ='$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 - archive_cmds_GCJ='$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... - archive_expsym_cmds_GCJ='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 - ld_shlibs_GCJ=no - fi - ;; - - interix3*) - hardcode_direct_GCJ=no - hardcode_shlibpath_var_GCJ=no - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - export_dynamic_flag_spec_GCJ='${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. - archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds_GCJ='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 - whole_archive_flag_spec_GCJ='${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 - whole_archive_flag_spec_GCJ='${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 - archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test $supports_anon_versioning = yes; then - archive_expsym_cmds_GCJ='$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 - ld_shlibs_GCJ=no - fi - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_GCJ='$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 - ld_shlibs_GCJ=no - cat <&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 - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_GCJ=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs_GCJ=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 - hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' - else - ld_shlibs_GCJ=no - fi - ;; - esac - ;; - - sunos4*) - archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_GCJ=no - fi - ;; - esac - - if test "$ld_shlibs_GCJ" = no; then - runpath_var= - hardcode_libdir_flag_spec_GCJ= - export_dynamic_flag_spec_GCJ= - whole_archive_flag_spec_GCJ= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag_GCJ=unsupported - always_export_symbols_GCJ=yes - archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L_GCJ=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct_GCJ=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 - export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - 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. - - archive_cmds_GCJ='' - hardcode_direct_GCJ=yes - hardcode_libdir_separator_GCJ=':' - link_all_deplibs_GCJ=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 - hardcode_direct_GCJ=yes - else - # We have old collect2 - hardcode_direct_GCJ=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L_GCJ=yes - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_libdir_separator_GCJ= - 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. - always_export_symbols_GCJ=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag_GCJ='-berok' - # Determine the default libpath from the value encoded in an empty executable. - 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 conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - -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 -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_GCJ="\$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 - hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_GCJ="-z nodefs" - archive_expsym_cmds_GCJ="\$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. - 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 conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - -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 -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_GCJ='${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. - no_undefined_flag_GCJ=' ${wl}-bernotok' - allow_undefined_flag_GCJ=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_GCJ='$convenience' - archive_cmds_need_lc_GCJ=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds_GCJ="\$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*) - archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_minus_L_GCJ=yes - # see comment about different semantics on the GNU ld section - ld_shlibs_GCJ=no - ;; - - bsdi[45]*) - export_dynamic_flag_spec_GCJ=-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. - hardcode_libdir_flag_spec_GCJ=' ' - allow_undefined_flag_GCJ=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. - archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_From_new_cmds_GCJ='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes_GCJ=yes - ;; - - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc_GCJ=no - hardcode_direct_GCJ=no - hardcode_automatic_GCJ=yes - hardcode_shlibpath_var_GCJ=unsupported - whole_archive_flag_spec_GCJ='' - link_all_deplibs_GCJ=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - module_cmds_GCJ='$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 - archive_expsym_cmds_GCJ='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}' - module_expsym_cmds_GCJ='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' - archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds_GCJ='$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 - archive_expsym_cmds_GCJ='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}' - module_expsym_cmds_GCJ='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}' - ;; - *) - ld_shlibs_GCJ=no - ;; - esac - fi - ;; - - dgux*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_shlibpath_var_GCJ=no - ;; - - freebsd1*) - ld_shlibs_GCJ=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes - hardcode_minus_L_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu | dragonfly*) - archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - hpux9*) - if test "$GCC" = yes; then - archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - hardcode_direct_GCJ=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-E' - ;; - - hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - - hardcode_direct_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_GCJ=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_GCJ='$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*) - archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_GCJ='$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 - hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - - case $host_cpu in - hppa*64*|ia64*) - hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' - hardcode_direct_GCJ=no - hardcode_shlibpath_var_GCJ=no - ;; - *) - hardcode_direct_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_GCJ=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' - fi - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - link_all_deplibs_GCJ=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - newsos6) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - hardcode_shlibpath_var_GCJ=no - ;; - - openbsd*) - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - export_dynamic_flag_spec_GCJ='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - ;; - *) - archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_minus_L_GCJ=yes - allow_undefined_flag_GCJ=unsupported - archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag_GCJ=' -expect_unresolved \*' - archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag_GCJ=' -expect_unresolved \*' - archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $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 - hardcode_libdir_flag_spec_GCJ='-rpath $libdir' - fi - hardcode_libdir_separator_GCJ=: - ;; - - solaris*) - no_undefined_flag_GCJ=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$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='' - archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_GCJ='$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 - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_shlibpath_var_GCJ=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 - '') - whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; - *) - whole_archive_flag_spec_GCJ='${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 - link_all_deplibs_GCJ=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_direct_GCJ=yes - hardcode_minus_L_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - sysv4) - case $host_vendor in - sni) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds_GCJ='$CC -r -o $output$reload_objs' - hardcode_direct_GCJ=no - ;; - motorola) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var_GCJ=no - ;; - - sysv4.3*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_GCJ=no - export_dynamic_flag_spec_GCJ='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_GCJ=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs_GCJ=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) - no_undefined_flag_GCJ='${wl}-z,text' - archive_cmds_need_lc_GCJ=no - hardcode_shlibpath_var_GCJ=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$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. - no_undefined_flag_GCJ='${wl}-z,text' - allow_undefined_flag_GCJ='${wl}-z,nodefs' - archive_cmds_need_lc_GCJ=no - hardcode_shlibpath_var_GCJ=no - hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - hardcode_libdir_separator_GCJ=':' - link_all_deplibs_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_shlibpath_var_GCJ=no - ;; - - *) - ld_shlibs_GCJ=no - ;; - esac - fi - -echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 -echo "${ECHO_T}$ld_shlibs_GCJ" >&6 -test "$ld_shlibs_GCJ" = no && can_build_shared=no - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_GCJ" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_GCJ=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_GCJ 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. - echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_GCJ - pic_flag=$lt_prog_compiler_pic_GCJ - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ - allow_undefined_flag_GCJ= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc_GCJ=no - else - archive_cmds_need_lc_GCJ=yes - fi - allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6 - ;; - esac - fi - ;; -esac - -echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 -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.so - # instead of lib.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 20065 "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.$ac_objext` in - *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 -echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6 -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 - -echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 -hardcode_action_GCJ= -if test -n "$hardcode_libdir_flag_spec_GCJ" || \ - test -n "$runpath_var_GCJ" || \ - test "X$hardcode_automatic_GCJ" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct_GCJ" != 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, GCJ)" != no && - test "$hardcode_minus_L_GCJ" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_GCJ=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_GCJ=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_GCJ=unsupported -fi -echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 -echo "${ECHO_T}$hardcode_action_GCJ" >&6 - -if test "$hardcode_action_GCJ" = 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 - - -# 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 \ - compiler_GCJ \ - CC_GCJ \ - LD_GCJ \ - lt_prog_compiler_wl_GCJ \ - lt_prog_compiler_pic_GCJ \ - lt_prog_compiler_static_GCJ \ - lt_prog_compiler_no_builtin_flag_GCJ \ - export_dynamic_flag_spec_GCJ \ - thread_safe_flag_spec_GCJ \ - whole_archive_flag_spec_GCJ \ - enable_shared_with_static_runtimes_GCJ \ - old_archive_cmds_GCJ \ - old_archive_from_new_cmds_GCJ \ - predep_objects_GCJ \ - postdep_objects_GCJ \ - predeps_GCJ \ - postdeps_GCJ \ - compiler_lib_search_path_GCJ \ - archive_cmds_GCJ \ - archive_expsym_cmds_GCJ \ - postinstall_cmds_GCJ \ - postuninstall_cmds_GCJ \ - old_archive_from_expsyms_cmds_GCJ \ - allow_undefined_flag_GCJ \ - no_undefined_flag_GCJ \ - export_symbols_cmds_GCJ \ - hardcode_libdir_flag_spec_GCJ \ - hardcode_libdir_flag_spec_ld_GCJ \ - hardcode_libdir_separator_GCJ \ - hardcode_automatic_GCJ \ - module_cmds_GCJ \ - module_expsym_cmds_GCJ \ - lt_cv_prog_compiler_c_o_GCJ \ - exclude_expsyms_GCJ \ - include_expsyms_GCJ; do - - case $var in - old_archive_cmds_GCJ | \ - old_archive_from_new_cmds_GCJ | \ - archive_cmds_GCJ | \ - archive_expsym_cmds_GCJ | \ - module_cmds_GCJ | \ - module_expsym_cmds_GCJ | \ - old_archive_from_expsyms_cmds_GCJ | \ - export_symbols_cmds_GCJ | \ - 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 - -cfgfile="$ofile" - - cat <<__EOF__ >> "$cfgfile" -# ### 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=$archive_cmds_need_lc_GCJ - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ - -# 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_compiler_GCJ - -# Is the compiler the GNU C compiler? -with_gcc=$GCC_GCJ - -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_LD_GCJ - -# 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_prog_compiler_wl_GCJ - -# 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_prog_compiler_pic_GCJ -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_cv_prog_compiler_c_o_GCJ - -# 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_prog_compiler_static_GCJ - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_GCJ -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_GCJ -archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ -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_module_cmds_GCJ -module_expsym_cmds=$lt_module_expsym_cmds_GCJ - -# 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_predep_objects_GCJ | \$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_postdep_objects_GCJ | \$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_predeps_GCJ - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_GCJ - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_GCJ | \$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_allow_undefined_flag_GCJ - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_GCJ - -# 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=$hardcode_action_GCJ - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ - -# 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_hardcode_libdir_flag_spec_ld_GCJ - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_GCJ - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_GCJ - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ - -# 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=$hardcode_automatic_GCJ - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_GCJ - -# 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="$fix_srcfile_path_GCJ" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_GCJ - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_GCJ - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_GCJ - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_GCJ - -# ### END LIBTOOL TAG CONFIG: $tagname - -__EOF__ - - -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_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 - -CC="$lt_save_CC" - - else - tagname="" - fi - ;; - - RC) - - - -# Source file extension for RC test sources. -ac_ext=rc - -# Object file extension for compiled RC test sources. -objext=o -objext_RC=$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. - -# 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 - - -# save warnings/boilerplate of simple test code -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* - -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* - - -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${RC-"windres"} -compiler=$CC -compiler_RC=$CC -for cc_temp in $compiler""; 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_cv_prog_compiler_c_o_RC=yes - -# 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 \ - compiler_RC \ - CC_RC \ - LD_RC \ - lt_prog_compiler_wl_RC \ - lt_prog_compiler_pic_RC \ - lt_prog_compiler_static_RC \ - lt_prog_compiler_no_builtin_flag_RC \ - export_dynamic_flag_spec_RC \ - thread_safe_flag_spec_RC \ - whole_archive_flag_spec_RC \ - enable_shared_with_static_runtimes_RC \ - old_archive_cmds_RC \ - old_archive_from_new_cmds_RC \ - predep_objects_RC \ - postdep_objects_RC \ - predeps_RC \ - postdeps_RC \ - compiler_lib_search_path_RC \ - archive_cmds_RC \ - archive_expsym_cmds_RC \ - postinstall_cmds_RC \ - postuninstall_cmds_RC \ - old_archive_from_expsyms_cmds_RC \ - allow_undefined_flag_RC \ - no_undefined_flag_RC \ - export_symbols_cmds_RC \ - hardcode_libdir_flag_spec_RC \ - hardcode_libdir_flag_spec_ld_RC \ - hardcode_libdir_separator_RC \ - hardcode_automatic_RC \ - module_cmds_RC \ - module_expsym_cmds_RC \ - lt_cv_prog_compiler_c_o_RC \ - exclude_expsyms_RC \ - include_expsyms_RC; do - - case $var in - old_archive_cmds_RC | \ - old_archive_from_new_cmds_RC | \ - archive_cmds_RC | \ - archive_expsym_cmds_RC | \ - module_cmds_RC | \ - module_expsym_cmds_RC | \ - old_archive_from_expsyms_cmds_RC | \ - export_symbols_cmds_RC | \ - 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 - -cfgfile="$ofile" - - cat <<__EOF__ >> "$cfgfile" -# ### 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=$archive_cmds_need_lc_RC - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC - -# 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_compiler_RC - -# Is the compiler the GNU C compiler? -with_gcc=$GCC_RC - -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_LD_RC - -# 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_prog_compiler_wl_RC - -# 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_prog_compiler_pic_RC -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_cv_prog_compiler_c_o_RC - -# 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_prog_compiler_static_RC - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_RC -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_RC -archive_expsym_cmds=$lt_archive_expsym_cmds_RC -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_module_cmds_RC -module_expsym_cmds=$lt_module_expsym_cmds_RC - -# 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_predep_objects_RC | \$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_postdep_objects_RC | \$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_predeps_RC - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_RC - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_RC | \$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_allow_undefined_flag_RC - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_RC - -# 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=$hardcode_action_RC - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC - -# 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_hardcode_libdir_flag_spec_ld_RC - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_RC - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_RC - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_RC - -# 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=$hardcode_automatic_RC - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_RC - -# 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="$fix_srcfile_path_RC" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_RC - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_RC - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_RC - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_RC - -# ### END LIBTOOL TAG CONFIG: $tagname - -__EOF__ - - -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_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 - -CC="$lt_save_CC" - - ;; - - *) - { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 -echo "$as_me: error: Unsupported tag name: $tagname" >&2;} - { (exit 1); exit 1; }; } - ;; - 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" - { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 -echo "$as_me: error: unable to update list of available tagged configurations." >&2;} - { (exit 1); exit 1; }; } - fi -fi - - - -# 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' - -# Prevent multiple expansion - - - - - - - - - - - - - - - - - - - - - -CFLAGS="-O2 -Wall" -## check for --enable-debug first before checking CFLAGS before -## so that we don't mix -O and -g -# Check whether --enable-debug or --disable-debug was given. -if test "${enable_debug+set}" = set; then - enableval="$enable_debug" - if eval "test x$enable_debug = xyes"; then - CFLAGS="${CFLAGS} -g -O0" - fi -fi; - - -if test x$debug = xtrue; then - DEBUG_TRUE= - DEBUG_FALSE='#' -else - DEBUG_TRUE='#' - DEBUG_FALSE= -fi - - - ac_config_commands="$ac_config_commands default" - - - - - ac_config_files="$ac_config_files Makefile src/Makefile src/apps/Makefile src/apps/dhcpc/Makefile src/apps/brcm-iscsi/Makefile src/uip/Makefile src/unix/Makefile src/unix/libs/Makefile" -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -{ - (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; -} | - sed ' - t clear - : clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" - cat confcache >$cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - -if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi -if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi -if test -z "${DEBUG_TRUE}" && test -z "${DEBUG_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"DEBUG\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"DEBUG\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi - -: ${CONFIG_STATUS=./config.status} -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi -DUALCASE=1; export DUALCASE # for MKS sh - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit -} - - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.file - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_executable_p="test -f" - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - -exec 6>&1 - -# Open the log real soon, to keep \$[0] and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - -This file was extended by iscsiuio $as_me 0.7.8.1b, which was -generated by GNU Autoconf 2.59. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 -_ACEOF - -# Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi - -cat >>$CONFIG_STATUS <<\_ACEOF - -ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTIONS] [FILE]... - - -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Configuration commands: -$config_commands - -Report bugs to ." -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF -ac_cs_version="\\ -iscsiuio config.status 0.7.8.1b -configured by $0, generated by GNU Autoconf 2.59, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" - -Copyright (C) 2003 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir -INSTALL="$INSTALL" -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` - ac_shift=: - ;; - -*) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; - esac - - case $ac_option in - # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$ac_config_targets $1" ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -fi - -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF -# -# INIT-COMMANDS section. -# - -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" - - -_ACEOF - - - -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_config_target in $ac_config_targets -do - case "$ac_config_target" in - # Handling of arguments. - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; - "src/apps/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/apps/Makefile" ;; - "src/apps/dhcpc/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/apps/dhcpc/Makefile" ;; - "src/apps/brcm-iscsi/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/apps/brcm-iscsi/Makefile" ;; - "src/uip/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/uip/Makefile" ;; - "src/unix/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/unix/Makefile" ;; - "src/unix/libs/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/unix/libs/Makefile" ;; - "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; - "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - esac -done - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. -$debug || -{ - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} - -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) -} || -{ - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} - -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF - -# -# CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -s,@INSTALL_DATA@,$INSTALL_DATA,;t t -s,@CYGPATH_W@,$CYGPATH_W,;t t -s,@PACKAGE@,$PACKAGE,;t t -s,@VERSION@,$VERSION,;t t -s,@ACLOCAL@,$ACLOCAL,;t t -s,@AUTOCONF@,$AUTOCONF,;t t -s,@AUTOMAKE@,$AUTOMAKE,;t t -s,@AUTOHEADER@,$AUTOHEADER,;t t -s,@MAKEINFO@,$MAKEINFO,;t t -s,@install_sh@,$install_sh,;t t -s,@STRIP@,$STRIP,;t t -s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t -s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t -s,@mkdir_p@,$mkdir_p,;t t -s,@AWK@,$AWK,;t t -s,@SET_MAKE@,$SET_MAKE,;t t -s,@am__leading_dot@,$am__leading_dot,;t t -s,@AMTAR@,$AMTAR,;t t -s,@am__tar@,$am__tar,;t t -s,@am__untar@,$am__untar,;t t -s,@BASH@,$BASH,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@DEPDIR@,$DEPDIR,;t t -s,@am__include@,$am__include,;t t -s,@am__quote@,$am__quote,;t t -s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t -s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t -s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t -s,@CCDEPMODE@,$CCDEPMODE,;t t -s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t -s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t -s,@RANLIB@,$RANLIB,;t t -s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t -s,@CPP@,$CPP,;t t -s,@EGREP@,$EGREP,;t t -s,@ENDIAN@,$ENDIAN,;t t -s,@build@,$build,;t t -s,@build_cpu@,$build_cpu,;t t -s,@build_vendor@,$build_vendor,;t t -s,@build_os@,$build_os,;t t -s,@host@,$host,;t t -s,@host_cpu@,$host_cpu,;t t -s,@host_vendor@,$host_vendor,;t t -s,@host_os@,$host_os,;t t -s,@SED@,$SED,;t t -s,@LN_S@,$LN_S,;t t -s,@ECHO@,$ECHO,;t t -s,@AR@,$AR,;t t -s,@ac_ct_AR@,$ac_ct_AR,;t t -s,@CXX@,$CXX,;t t -s,@CXXFLAGS@,$CXXFLAGS,;t t -s,@ac_ct_CXX@,$ac_ct_CXX,;t t -s,@CXXDEPMODE@,$CXXDEPMODE,;t t -s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t -s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t -s,@CXXCPP@,$CXXCPP,;t t -s,@F77@,$F77,;t t -s,@FFLAGS@,$FFLAGS,;t t -s,@ac_ct_F77@,$ac_ct_F77,;t t -s,@LIBTOOL@,$LIBTOOL,;t t -s,@DEBUG_TRUE@,$DEBUG_TRUE,;t t -s,@DEBUG_FALSE@,$DEBUG_FALSE,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t -CEOF - -_ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat - fi -fi # test -n "$CONFIG_FILES" - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; - esac - - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac - - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_builddir$INSTALL ;; - esac - - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@abs_srcdir@,$ac_abs_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s,@builddir@,$ac_builddir,;t t -s,@abs_builddir@,$ac_abs_builddir,;t t -s,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -s,@INSTALL@,$ac_INSTALL,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi - -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -# -# CONFIG_HEADER section. -# - -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='[ ].*$,\1#\2' -ac_dC=' ' -ac_dD=',;t' -# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='$,\1#\2define\3' -ac_uC=' ' -ac_uD=',;t' - -for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; - esac - - test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - # Do quote $f, to prevent DOS paths from being IFS'd. - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } - # Remove the trailing spaces. - sed 's/[ ]*$//' $ac_file_inputs >$tmp/in - -_ACEOF - -# Transform confdefs.h into two sed scripts, `conftest.defines' and -# `conftest.undefs', that substitutes the proper values into -# config.h.in to produce config.h. The first handles `#define' -# templates, and the second `#undef' templates. -# And first: Protect against being on the right side of a sed subst in -# config.status. Protect against being in an unquoted here document -# in config.status. -rm -f conftest.defines conftest.undefs -# Using a here document instead of a string reduces the quoting nightmare. -# Putting comments in sed scripts is not portable. -# -# `end' is used to avoid that the second main sed command (meant for -# 0-ary CPP macros) applies to n-ary macro definitions. -# See the Autoconf documentation for `clear'. -cat >confdef2sed.sed <<\_ACEOF -s/[\\&,]/\\&/g -s,[\\$`],\\&,g -t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp -t end -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp -: end -_ACEOF -# If some macros were called several times there might be several times -# the same #defines, which is useless. Nevertheless, we may not want to -# sort them, since we want the *last* AC-DEFINE to be honored. -uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines -sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs -rm -f confdef2sed.sed - -# This sed command replaces #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -cat >>conftest.undefs <<\_ACEOF -s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, -_ACEOF - -# Break up conftest.defines because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS -echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS -echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS -echo ' :' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.defines >/dev/null -do - # Write a limited-size here document to $tmp/defines.sed. - echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#define' lines. - echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS - echo 'CEOF - sed -f $tmp/defines.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail - rm -f conftest.defines - mv conftest.tail conftest.defines -done -rm -f conftest.defines -echo ' fi # grep' >>$CONFIG_STATUS -echo >>$CONFIG_STATUS - -# Break up conftest.undefs because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #undef templates' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.undefs >/dev/null -do - # Write a limited-size here document to $tmp/undefs.sed. - echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#undef' - echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS - echo 'CEOF - sed -f $tmp/undefs.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail - rm -f conftest.undefs - mv conftest.tail conftest.undefs -done -rm -f conftest.undefs - -cat >>$CONFIG_STATUS <<\_ACEOF - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - echo "/* Generated by configure. */" >$tmp/config.h - else - echo "/* $ac_file. Generated by configure. */" >$tmp/config.h - fi - cat $tmp/in >>$tmp/config.h - rm -f $tmp/in - if test x"$ac_file" != x-; then - if diff $ac_file $tmp/config.h >/dev/null 2>&1; then - { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -echo "$as_me: $ac_file is unchanged" >&6;} - else - ac_dir=`(dirname "$ac_file") 2>/dev/null || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - rm -f $ac_file - mv $tmp/config.h $ac_file - fi - else - cat $tmp/config.h - rm -f $tmp/config.h - fi -# Compute $ac_file's index in $config_headers. -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $ac_file | $ac_file:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || -$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X$ac_file : 'X\(//\)[^/]' \| \ - X$ac_file : 'X\(//\)$' \| \ - X$ac_file : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X$ac_file | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'`/stamp-h$_am_stamp_count -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -# -# CONFIG_COMMANDS section. -# -for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue - ac_dest=`echo "$ac_file" | sed 's,:.*,,'` - ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_dir=`(dirname "$ac_dest") 2>/dev/null || -$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_dest" : 'X\(//\)[^/]' \| \ - X"$ac_dest" : 'X\(//\)$' \| \ - X"$ac_dest" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_dest" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac - - - { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 -echo "$as_me: executing $ac_dest commands" >&6;} - case $ac_dest in - depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # So let's grep whole file. - if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then - dirpart=`(dirname "$mf") 2>/dev/null || -$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$mf" : 'X\(//\)[^/]' \| \ - X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$mf" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - else - continue - fi - # 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=`(dirname "$file") 2>/dev/null || -$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$file" : 'X\(//\)[^/]' \| \ - X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p $dirpart/$fdir - else - as_dir=$dirpart/$fdir - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 -echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} - { (exit 1); exit 1; }; }; } - - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done -done - ;; - default ) echo 'char *build_date = "'`date`'";' > src/unix/build_date.c && echo 'char *build_date;'> src/unix/build_date.h ;; - esac -done -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF - -{ (exit 0); exit 0; } -_ACEOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } -fi - diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/configure.ac open-iscsi-2.0.874/iscsiuio/configure.ac --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/configure.ac 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/configure.ac 2016-09-29 18:33:24.000000000 +0000 @@ -1,6 +1,7 @@ dnl iscsiuio uIP user space stack configure.ac file dnl dnl Copyright (c) 2004-2013 Broadcom Corporation +dnl Copyright (c) 2014, QLogic Corporation dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by @@ -11,11 +12,11 @@ dnl PACKAGE=iscsiuio -VERSION=0.7.8.1b +VERSION=0.7.8.2 -AC_INIT(iscsiuio, 0.7.8.1b, eddie.wai@broadcom.com) +AC_INIT([iscsiuio], [0.7.8.2], [QLogic-Storage-Upstream@qlogic.com]) -AM_INIT_AUTOMAKE($PACKAGE, $VERSION) +AM_INIT_AUTOMAKE AC_CONFIG_HEADER(config.h) AC_PATH_PROGS(BASH, bash) @@ -52,7 +53,8 @@ # libtool stuff AC_PROG_LIBTOOL -CFLAGS="-O2 -Wall" +: ${CFLAGS:="-O2"} +CFLAGS="${CFLAGS} -Wall" ## check for --enable-debug first before checking CFLAGS before ## so that we don't mix -O and -g AC_ARG_ENABLE(debug, @@ -62,7 +64,14 @@ fi]) AM_CONDITIONAL([DEBUG], [test x$debug = xtrue]) -AC_CONFIG_COMMANDS([default],[[ echo 'char *build_date = "'`date`'";' > src/unix/build_date.c && echo 'char *build_date;'> src/unix/build_date.h]],[[]]) +AC_CONFIG_COMMANDS([default],[[ + if [ -n "$SOURCE_DATE_EPOCH" ] ; then + echo 'char *build_date = "'`LC_ALL=C.UTF-8 date --date=@$SOURCE_DATE_EPOCH -u`'";' > src/unix/build_date.c + else + echo 'char *build_date = "'`date`'";' > src/unix/build_date.c + fi + echo 'char *build_date;'> src/unix/build_date.h +]],[[]]) AC_PREFIX_DEFAULT() diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/COPYING open-iscsi-2.0.874/iscsiuio/COPYING --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/COPYING 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/COPYING 1970-01-01 00:00:00.000000000 +0000 @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - 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 3 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, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/depcomp open-iscsi-2.0.874/iscsiuio/depcomp --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/depcomp 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/depcomp 1970-01-01 00:00:00.000000000 +0000 @@ -1,589 +0,0 @@ -#! /bin/sh -# depcomp - compile a program generating dependencies as side-effects - -scriptversion=2007-03-29.01 - -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software -# Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 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 Alexandre Oliva . - -case $1 in - '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: depcomp [--help] [--version] PROGRAM [ARGS] - -Run PROGRAMS ARGS to compile a file, generating dependencies -as side-effects. - -Environment variables: - depmode Dependency tracking mode. - source Source file read by `PROGRAMS ARGS'. - object Object file output by `PROGRAMS ARGS'. - DEPDIR directory where to store dependencies. - depfile Dependency file to output. - tmpdepfile Temporary file to use when outputing dependencies. - libtool Whether libtool is used (yes/no). - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "depcomp $scriptversion" - exit $? - ;; -esac - -if test -z "$depmode" || test -z "$source" || test -z "$object"; then - echo "depcomp: Variables source, object and depmode must be set" 1>&2 - exit 1 -fi - -# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. -depfile=${depfile-`echo "$object" | - sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} -tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} - -rm -f "$tmpdepfile" - -# Some modes work just like other modes, but use different flags. We -# parameterize here, but still list the modes in the big case below, -# to make depend.m4 easier to write. Note that we *cannot* use a case -# here, because this file can only contain one case statement. -if test "$depmode" = hp; then - # HP compiler uses -M and no extra arg. - gccflag=-M - depmode=gcc -fi - -if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout -fi - -case "$depmode" in -gcc3) -## gcc 3 implements dependency tracking that does exactly what -## we want. Yay! Note: for some reason libtool 1.4 doesn't like -## it if -MD -MP comes after the -MF stuff. Hmm. -## Unfortunately, FreeBSD c89 acceptance of flags depends upon -## the command line argument order; so add the flags where they -## appear in depend2.am. Note that the slowdown incurred here -## affects only configure: in makefiles, %FASTDEP% shortcuts this. - for arg - do - case $arg in - -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; - *) set fnord "$@" "$arg" ;; - esac - shift # fnord - shift # $arg - done - "$@" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - mv "$tmpdepfile" "$depfile" - ;; - -gcc) -## There are various ways to get dependency output from gcc. Here's -## why we pick this rather obscure method: -## - Don't want to use -MD because we'd like the dependencies to end -## up in a subdir. Having to rename by hand is ugly. -## (We might end up doing this anyway to support other compilers.) -## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). -## - Using -M directly means running the compiler twice (even worse -## than renaming). - if test -z "$gccflag"; then - gccflag=-MD, - fi - "$@" -Wp,"$gccflag$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -## The second -e expression handles DOS-style file names with drive letters. - sed -e 's/^[^:]*: / /' \ - -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the `deleted header file' problem. -## The problem is that when a header file which appears in a .P file -## is deleted, the dependency causes make to die (because there is -## typically no way to rebuild the header). We avoid this by adding -## dummy dependencies for each header file. Too bad gcc doesn't do -## this for us directly. - tr ' ' ' -' < "$tmpdepfile" | -## Some versions of gcc put a space before the `:'. On the theory -## that the space means something, we add a space to the output as -## well. -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -sgi) - if test "$libtool" = yes; then - "$@" "-Wp,-MDupdate,$tmpdepfile" - else - "$@" -MDupdate "$tmpdepfile" - fi - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - - if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files - echo "$object : \\" > "$depfile" - - # Clip off the initial element (the dependent). Don't try to be - # clever and replace this with sed code, as IRIX sed won't handle - # lines with more than a fixed number of characters (4096 in - # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like `#:fec' to the end of the - # dependency line. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ - tr ' -' ' ' >> $depfile - echo >> $depfile - - # The second pass generates a dummy entry for each header file. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> $depfile - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -aix) - # The C for AIX Compiler uses -M and outputs the dependencies - # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts `$object:' at the - # start of each line; $object doesn't have directory information. - # Version 6 uses the directory in both cases. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.u - tmpdepfile2=$base.u - tmpdepfile3=$dir.libs/$base.u - "$@" -Wc,-M - else - tmpdepfile1=$dir$base.u - tmpdepfile2=$dir$base.u - tmpdepfile3=$dir$base.u - "$@" -M - fi - stat=$? - - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - # Each line is of the form `foo.o: dependent.h'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -icc) - # Intel's C compiler understands `-MD -MF file'. However on - # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c - # ICC 7.0 will fill foo.d with something like - # foo.o: sub/foo.c - # foo.o: sub/foo.h - # which is wrong. We want: - # sub/foo.o: sub/foo.c - # sub/foo.o: sub/foo.h - # sub/foo.c: - # sub/foo.h: - # ICC 7.1 will output - # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using \ : - # foo.o: sub/foo.c ... \ - # sub/foo.h ... \ - # ... - - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each line is of the form `foo.o: dependent.h', - # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | - sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp2) - # The "hp" stanza above does not work with aCC (C++) and HP's ia64 - # compilers, which have integrated preprocessors. The correct option - # to use with these is +Maked; it writes dependencies to a file named - # 'foo.d', which lands next to the object file, wherever that - # happens to be. - # Much of this is similar to the tru64 case; see comments there. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir.libs/$base.d - "$@" -Wc,+Maked - else - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir$base.d - "$@" +Maked - fi - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" - # Add `dependent.h:' lines. - sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" - else - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" "$tmpdepfile2" - ;; - -tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in `foo.d' instead, so we check for that too. - # Subdirectories are respected. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - - if test "$libtool" = yes; then - # With Tru64 cc, shared objects can also be used to make a - # static library. This mechanism is used in libtool 1.4 series to - # handle both shared and static libraries in a single compilation. - # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. - # - # With libtool 1.5 this exception was removed, and libtool now - # generates 2 separate objects for the 2 libraries. These two - # compilations output dependencies in $dir.libs/$base.o.d and - # in $dir$base.o.d. We have to check for both files, because - # one of the two compilations can be disabled. We should prefer - # $dir$base.o.d over $dir.libs/$base.o.d because the latter is - # automatically cleaned when .libs/ is deleted, while ignoring - # the former would cause a distcleancheck panic. - tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 - tmpdepfile2=$dir$base.o.d # libtool 1.5 - tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 - tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 - "$@" -Wc,-MD - else - tmpdepfile1=$dir$base.o.d - tmpdepfile2=$dir$base.d - tmpdepfile3=$dir$base.d - tmpdepfile4=$dir$base.d - "$@" -MD - fi - - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -#nosideeffect) - # This comment above is used by automake to tell side-effect - # dependency tracking mechanisms from slower ones. - -dashmstdout) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do - shift - done - shift - fi - - # Remove `-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for `:' - # in the target name. This is to cope with DOS-style filenames: - # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. - "$@" $dashmflag | - sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - tr ' ' ' -' < "$tmpdepfile" | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -dashXmstdout) - # This case only exists to satisfy depend.m4. It is never actually - # run, as this mode is specially recognized in the preamble. - exit 1 - ;; - -makedepend) - "$@" || exit $? - # Remove any Libtool call - if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do - shift - done - shift - fi - # X makedepend - shift - cleared=no - for arg in "$@"; do - case $cleared in - no) - set ""; shift - cleared=yes ;; - esac - case "$arg" in - -D*|-I*) - set fnord "$@" "$arg"; shift ;; - # Strip any option that makedepend may not understand. Remove - # the object too, otherwise makedepend will parse it as a source file. - -*|$object) - ;; - *) - set fnord "$@" "$arg"; shift ;; - esac - done - obj_suffix="`echo $object | sed 's/^.*\././'`" - touch "$tmpdepfile" - ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - sed '1,2d' "$tmpdepfile" | tr ' ' ' -' | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" "$tmpdepfile".bak - ;; - -cpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do - shift - done - shift - fi - - # Remove `-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - "$@" -E | - sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | - sed '$ s: \\$::' > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - cat < "$tmpdepfile" >> "$depfile" - sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvisualcpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o, - # because we must use -o when running libtool. - "$@" || exit $? - IFS=" " - for arg - do - case "$arg" in - "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; - *) - set fnord "$@" "$arg" - shift - shift - ;; - esac - done - "$@" -E | - sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" - echo " " >> "$depfile" - . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -none) - exec "$@" - ;; - -*) - echo "Unknown depmode $depmode" 1>&2 - exit 1 - ;; -esac - -exit 0 - -# 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 -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/docs/iscsiuio.8 open-iscsi-2.0.874/iscsiuio/docs/iscsiuio.8 --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/docs/iscsiuio.8 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/docs/iscsiuio.8 2016-09-29 18:33:24.000000000 +0000 @@ -1,11 +1,12 @@ .\" Copyright (c) 2010-2013 Broadcom Corporation +.\" Copyright (c) 2014, QLogic Corporation .\" This is free documentation; you can redistribute it and/or .\" modify it under the terms of the GNU General Public License as .\" published by the Free Software Foundation. .\" .\" bnx2.4,v 0.7.8.1b .\" -.TH iscsiuio 8 "05/01/2013" "Broadcom Corporation" +.TH iscsiuio 8 "12/10/2013" "QLogic Corporation" .\" .\" NAME part .\" @@ -22,9 +23,9 @@ .\" DESCRIPTION part .\" .SH DESCRIPTION -iscsiuio is the UserSpace I/O driver for the Broadcom NetXtreme II +iscsiuio is the UserSpace I/O driver for the QLogic NetXtreme II BCM5706/5708/5709 series PCI/PCI-X Gigabit Ethernet Network Interface Card -(NIC) and for the Broadcom NetXtreme II BCM57710/57711/57712/57800/57810/57840 +(NIC) and for the QLogic NetXtreme II BCM57710/57711/57712/57800/57810/57840 series PCI-E 10 Gigabit Ethernet Network Interface Card. The driver has been tested on 2.6.28 kernels and above. .PP @@ -61,7 +62,7 @@ .TP .TP .BI -f -This is to enable forground mode so that this application doesn't get sent +This is to enable foreground mode so that this application doesn't get sent into the background. .PP .TP @@ -84,3 +85,5 @@ Benjamin Li \- benli@broadcom.com .P Eddie Wai \- eddie.wai@broadcom.com +.SH Maintained by +QLogic-Storage-Upstream@qlogic.com diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/.gitignore open-iscsi-2.0.874/iscsiuio/.gitignore --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/.gitignore 2016-09-29 18:33:24.000000000 +0000 @@ -0,0 +1,25 @@ +# Autogenerated files +stamp-h1 +Makefile.in +Makefile +configure +config.h.in +config.h +config.guess +config.log +config.status +config.sub +COPYING + +.deps +autom4te.cache + +# autotools +aclocal.m4 +compile +depcomp +install-sh +libtool +ltmain.sh +missing + diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/install-sh open-iscsi-2.0.874/iscsiuio/install-sh --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/install-sh 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/install-sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,519 +0,0 @@ -#!/bin/sh -# install - install a program, script, or datafile - -scriptversion=2006-12-25.00 - -# This originates from X11R5 (mit/util/scripts/install.sh), which was -# later released in X11R6 (xc/config/util/install.sh) with the -# following copyright and license. -# -# Copyright (C) 1994 X Consortium -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- -# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name of the X Consortium shall not -# be used in advertising or otherwise to promote the sale, use or other deal- -# ings in this Software without prior written authorization from the X Consor- -# tium. -# -# -# FSF changes to this file are in the public domain. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. - -nl=' -' -IFS=" "" $nl" - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit=${DOITPROG-} -if test -z "$doit"; then - doit_exec=exec -else - doit_exec=$doit -fi - -# Put in absolute file names if you don't have them in your path; -# or use environment vars. - -chgrpprog=${CHGRPPROG-chgrp} -chmodprog=${CHMODPROG-chmod} -chownprog=${CHOWNPROG-chown} -cmpprog=${CMPPROG-cmp} -cpprog=${CPPROG-cp} -mkdirprog=${MKDIRPROG-mkdir} -mvprog=${MVPROG-mv} -rmprog=${RMPROG-rm} -stripprog=${STRIPPROG-strip} - -posix_glob='?' -initialize_posix_glob=' - test "$posix_glob" != "?" || { - if (set -f) 2>/dev/null; then - posix_glob= - else - posix_glob=: - fi - } -' - -posix_mkdir= - -# Desired mode of installed file. -mode=0755 - -chgrpcmd= -chmodcmd=$chmodprog -chowncmd= -mvcmd=$mvprog -rmcmd="$rmprog -f" -stripcmd= - -src= -dst= -dir_arg= -dst_arg= - -copy_on_change=false -no_target_directory= - -usage="\ -Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE - or: $0 [OPTION]... SRCFILES... DIRECTORY - or: $0 [OPTION]... -t DIRECTORY SRCFILES... - or: $0 [OPTION]... -d DIRECTORIES... - -In the 1st form, copy SRCFILE to DSTFILE. -In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. -In the 4th, create DIRECTORIES. - -Options: - --help display this help and exit. - --version display version info and exit. - - -c (ignored) - -C install only if different (preserve the last data modification time) - -d create directories instead of installing files. - -g GROUP $chgrpprog installed files to GROUP. - -m MODE $chmodprog installed files to MODE. - -o USER $chownprog installed files to USER. - -s $stripprog installed files. - -t DIRECTORY install into DIRECTORY. - -T report an error if DSTFILE is a directory. - -Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG - RMPROG STRIPPROG -" - -while test $# -ne 0; do - case $1 in - -c) ;; - - -C) copy_on_change=true;; - - -d) dir_arg=true;; - - -g) chgrpcmd="$chgrpprog $2" - shift;; - - --help) echo "$usage"; exit $?;; - - -m) mode=$2 - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; - - -o) chowncmd="$chownprog $2" - shift;; - - -s) stripcmd=$stripprog;; - - -t) dst_arg=$2 - shift;; - - -T) no_target_directory=true;; - - --version) echo "$0 $scriptversion"; exit $?;; - - --) shift - break;; - - -*) echo "$0: invalid option: $1" >&2 - exit 1;; - - *) break;; - esac - shift -done - -if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then - # When -d is used, all remaining arguments are directories to create. - # When -t is used, the destination is already specified. - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dst_arg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dst_arg" - shift # fnord - fi - shift # arg - dst_arg=$arg - done -fi - -if test $# -eq 0; then - if test -z "$dir_arg"; then - echo "$0: no input file specified." >&2 - exit 1 - fi - # It's OK to call `install-sh -d' without argument. - # This can happen when creating conditional directories. - exit 0 -fi - -if test -z "$dir_arg"; then - trap '(exit $?); exit' 1 2 13 15 - - # Set umask so as not to create temps with too-generous modes. - # However, 'strip' requires both read and write access to temps. - case $mode in - # Optimize common cases. - *644) cp_umask=133;; - *755) cp_umask=22;; - - *[0-7]) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw='% 200' - fi - cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; - *) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw=,u+rw - fi - cp_umask=$mode$u_plus_rw;; - esac -fi - -for src -do - # Protect names starting with `-'. - case $src in - -*) src=./$src;; - esac - - if test -n "$dir_arg"; then - dst=$src - dstdir=$dst - test -d "$dstdir" - dstdir_status=$? - else - - # Waiting for this to be detected by the "$cpprog $src $dsttmp" command - # might cause directories to be created, which would be especially bad - # if $src (and thus $dsttmp) contains '*'. - if test ! -f "$src" && test ! -d "$src"; then - echo "$0: $src does not exist." >&2 - exit 1 - fi - - if test -z "$dst_arg"; then - echo "$0: no destination specified." >&2 - exit 1 - fi - - dst=$dst_arg - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst;; - esac - - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. - if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 - fi - dstdir=$dst - dst=$dstdir/`basename "$src"` - dstdir_status=0 - else - # Prefer dirname, but fall back on a substitute if dirname fails. - dstdir=` - (dirname "$dst") 2>/dev/null || - expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$dst" : 'X\(//\)[^/]' \| \ - X"$dst" : 'X\(//\)$' \| \ - X"$dst" : 'X\(/\)' \| . 2>/dev/null || - echo X"$dst" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q' - ` - - test -d "$dstdir" - dstdir_status=$? - fi - fi - - obsolete_mkdir_used=false - - if test $dstdir_status != 0; then - case $posix_mkdir in - '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi - - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - - if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writeable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/d" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null - fi - trap '' 0;; - esac;; - esac - - if - $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" - ) - then : - else - - # The umask is ridiculous, or mkdir does not conform to POSIX, - # or it failed possibly due to a race condition. Create the - # directory the slow way, step by step, checking for races as we go. - - case $dstdir in - /*) prefix='/';; - -*) prefix='./';; - *) prefix='';; - esac - - eval "$initialize_posix_glob" - - oIFS=$IFS - IFS=/ - $posix_glob set -f - set fnord $dstdir - shift - $posix_glob set +f - IFS=$oIFS - - prefixes= - - for d - do - test -z "$d" && continue - - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ - done - - if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true - fi - fi - fi - - if test -n "$dir_arg"; then - { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && - { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || - test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 - else - - # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ - - # Trap to clean up those temp files at exit. - trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 - - # Copy the file name to the temp name. - (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && - - # and set any options; do chmod last to preserve setuid bits. - # - # If any of these fail, we abort the whole thing. If we want to - # ignore errors from any of these, just make sure not to ignore - # errors from the above "$doit $cpprog $src $dsttmp" command. - # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && - { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && - { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && - - # If -C, don't bother to copy if it wouldn't change the file. - if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - - eval "$initialize_posix_glob" && - $posix_glob set -f && - set X $old && old=:$2:$4:$5:$6 && - set X $new && new=:$2:$4:$5:$6 && - $posix_glob set +f && - - test "$old" = "$new" && - $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 - then - rm -f "$dsttmp" - else - # Rename the file to the real destination. - $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || - - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. - { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" - } - fi || exit 1 - - trap '' 0 - fi -done - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/ltmain.sh open-iscsi-2.0.874/iscsiuio/ltmain.sh --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/ltmain.sh 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/ltmain.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,6912 +0,0 @@ -# ltmain.sh - Provide generalized library-building support services. -# NOTE: Changing this file will not affect anything until you rerun configure. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 -# Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit , 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. - -basename="s,^.*/,,g" - -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -# is ksh but when the shell is invoked as "sh" and the current value of -# the _XPG environment variable is not equal to 1 (one), the special -# positional parameter $0, within a function call, is the name of the -# function. -progpath="$0" - -# The name of this program: -progname=`echo "$progpath" | $SED $basename` -modename="$progname" - -# Global variables: -EXIT_SUCCESS=0 -EXIT_FAILURE=1 - -PROGRAM=ltmain.sh -PACKAGE=libtool -VERSION=1.5.22 -TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" - -# Be Bourne compatible (taken from Autoconf:_AS_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+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac -fi - -# Check that we have a working $echo. -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then - # Yippee, $echo works! - : -else - # Restart under the correct shell, and then maybe $echo will work. - exec $SHELL "$progpath" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat <&2 - $echo "Fatal configuration error. " - $echo "See the $PACKAGE docs for more information." 1>&2 - exit $EXIT_FAILURE -fi - -# Global variables. -mode=$default_mode -nonopt= -prev= -prevopt= -run= -show="$echo" -show_help= -execute_dlfiles= -duplicate_deps=no -preserve_args= -lo2o="s/\\.lo\$/.${objext}/" -o2lo="s/\\.${objext}\$/.lo/" -extracted_archives= -extracted_serial=0 - -##################################### -# Shell function definitions: -# This seems to be the best place for them - -# func_mktempdir [string] -# Make a temporary directory that won't clash with other running -# libtool processes, and avoids race conditions if possible. If -# given, STRING is the basename for that directory. -func_mktempdir () -{ - my_template="${TMPDIR-/tmp}/${1-$progname}" - - if test "$run" = ":"; then - # Return a directory name, but don't create it in dry-run mode - my_tmpdir="${my_template}-$$" - else - - # If mktemp works, use that first and foremost - my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` - - if test ! -d "$my_tmpdir"; then - # Failing that, at least try and use $RANDOM to avoid a race - my_tmpdir="${my_template}-${RANDOM-0}$$" - - save_mktempdir_umask=`umask` - umask 0077 - $mkdir "$my_tmpdir" - umask $save_mktempdir_umask - fi - - # If we're not in dry-run mode, bomb out on failure - test -d "$my_tmpdir" || { - $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 - exit $EXIT_FAILURE - } - fi - - $echo "X$my_tmpdir" | $Xsed -} - - -# func_win32_libid arg -# return the library type of file 'arg' -# -# Need a lot of goo to handle *both* DLLs and import libs -# Has to be a shell function in order to 'eat' the argument -# that is supplied when $file_magic_command is called. -func_win32_libid () -{ - win32_libid_type="unknown" - win32_fileres=`file -L $1 2>/dev/null` - case $win32_fileres in - *ar\ archive\ import\ library*) # definitely import - win32_libid_type="x86 archive import" - ;; - *ar\ archive*) # could be an import, or static - if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ - $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then - win32_nmres=`eval $NM -f posix -A $1 | \ - $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` - case $win32_nmres in - import*) win32_libid_type="x86 archive import";; - *) win32_libid_type="x86 archive static";; - esac - fi - ;; - *DLL*) - win32_libid_type="x86 DLL" - ;; - *executable*) # but shell scripts are "executable" too... - case $win32_fileres in - *MS\ Windows\ PE\ Intel*) - win32_libid_type="x86 DLL" - ;; - esac - ;; - esac - $echo $win32_libid_type -} - - -# func_infer_tag arg -# Infer tagged configuration to use if any are available and -# if one wasn't chosen via the "--tag" command line option. -# Only attempt this if the compiler in the base compile -# command doesn't match the default compiler. -# arg is usually of the form 'gcc ...' -func_infer_tag () -{ - if test -n "$available_tags" && test -z "$tagname"; then - CC_quoted= - for arg in $CC; do - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - CC_quoted="$CC_quoted $arg" - done - case $@ in - # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when configure was run. - " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; - # Blanks at the start of $base_compile will cause this to fail - # if we don't check for them as well. - *) - for z in $available_tags; do - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" - CC_quoted= - for arg in $CC; do - # Double-quote args containing other shell metacharacters. - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - CC_quoted="$CC_quoted $arg" - done - case "$@ " in - " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) - # The compiler in the base compile command matches - # the one in the tagged configuration. - # Assume this is the tagged configuration we want. - tagname=$z - break - ;; - esac - fi - done - # If $tagname still isn't set, then no tagged configuration - # was found and let the user know that the "--tag" command - # line option must be used. - if test -z "$tagname"; then - $echo "$modename: unable to infer tagged configuration" - $echo "$modename: specify a tag with \`--tag'" 1>&2 - exit $EXIT_FAILURE -# else -# $echo "$modename: using $tagname tagged configuration" - fi - ;; - esac - fi -} - - -# func_extract_an_archive dir oldlib -func_extract_an_archive () -{ - f_ex_an_ar_dir="$1"; shift - f_ex_an_ar_oldlib="$1" - - $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" - $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? - if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 - exit $EXIT_FAILURE - fi -} - -# func_extract_archives gentop oldlib ... -func_extract_archives () -{ - my_gentop="$1"; shift - my_oldlibs=${1+"$@"} - my_oldobjs="" - my_xlib="" - my_xabs="" - my_xdir="" - my_status="" - - $show "${rm}r $my_gentop" - $run ${rm}r "$my_gentop" - $show "$mkdir $my_gentop" - $run $mkdir "$my_gentop" - my_status=$? - if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then - exit $my_status - fi - - for my_xlib in $my_oldlibs; do - # Extract the objects. - case $my_xlib in - [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; - *) my_xabs=`pwd`"/$my_xlib" ;; - esac - my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` - my_xlib_u=$my_xlib - while :; do - case " $extracted_archives " in - *" $my_xlib_u "*) - extracted_serial=`expr $extracted_serial + 1` - my_xlib_u=lt$extracted_serial-$my_xlib ;; - *) break ;; - esac - done - extracted_archives="$extracted_archives $my_xlib_u" - my_xdir="$my_gentop/$my_xlib_u" - - $show "${rm}r $my_xdir" - $run ${rm}r "$my_xdir" - $show "$mkdir $my_xdir" - $run $mkdir "$my_xdir" - exit_status=$? - if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then - exit $exit_status - fi - case $host in - *-darwin*) - $show "Extracting $my_xabs" - # Do not bother doing anything if just a dry run - if test -z "$run"; then - darwin_orig_dir=`pwd` - cd $my_xdir || exit $? - darwin_archive=$my_xabs - darwin_curdir=`pwd` - darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` - darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` - if test -n "$darwin_arches"; then - darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` - darwin_arch= - $show "$darwin_base_archive has multiple architectures $darwin_arches" - for darwin_arch in $darwin_arches ; do - mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" - lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" - cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" - func_extract_an_archive "`pwd`" "${darwin_base_archive}" - cd "$darwin_curdir" - $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" - done # $darwin_arches - ## Okay now we have a bunch of thin objects, gotta fatten them up :) - darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` - darwin_file= - darwin_files= - for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` - lipo -create -output "$darwin_file" $darwin_files - done # $darwin_filelist - ${rm}r unfat-$$ - cd "$darwin_orig_dir" - else - cd "$darwin_orig_dir" - func_extract_an_archive "$my_xdir" "$my_xabs" - fi # $darwin_arches - fi # $run - ;; - *) - func_extract_an_archive "$my_xdir" "$my_xabs" - ;; - esac - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` - done - func_extract_archives_result="$my_oldobjs" -} -# End of Shell function definitions -##################################### - -# Darwin sucks -eval std_shrext=\"$shrext_cmds\" - -disable_libs=no - -# Parse our command line options once, thoroughly. -while test "$#" -gt 0 -do - arg="$1" - shift - - case $arg in - -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - execute_dlfiles) - execute_dlfiles="$execute_dlfiles $arg" - ;; - tag) - tagname="$arg" - preserve_args="${preserve_args}=$arg" - - # Check whether tagname contains only valid characters - case $tagname in - *[!-_A-Za-z0-9,/]*) - $echo "$progname: invalid tag name: $tagname" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - case $tagname in - CC) - # Don't test for the "default" C tag, as we know, it's there, but - # not specially marked. - ;; - *) - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then - taglist="$taglist $tagname" - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" - else - $echo "$progname: ignoring unknown tag $tagname" 1>&2 - fi - ;; - esac - ;; - *) - eval "$prev=\$arg" - ;; - esac - - prev= - prevopt= - continue - fi - - # Have we seen a non-optional argument yet? - case $arg in - --help) - show_help=yes - ;; - - --version) - $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" - $echo - $echo "Copyright (C) 2005 Free Software Foundation, Inc." - $echo "This is free software; see the source for copying conditions. There is NO" - $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - exit $? - ;; - - --config) - ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath - # Now print the configurations for the tags. - for tagname in $taglist; do - ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" - done - exit $? - ;; - - --debug) - $echo "$progname: enabling shell trace mode" - set -x - preserve_args="$preserve_args $arg" - ;; - - --dry-run | -n) - run=: - ;; - - --features) - $echo "host: $host" - if test "$build_libtool_libs" = yes; then - $echo "enable shared libraries" - else - $echo "disable shared libraries" - fi - if test "$build_old_libs" = yes; then - $echo "enable static libraries" - else - $echo "disable static libraries" - fi - exit $? - ;; - - --finish) mode="finish" ;; - - --mode) prevopt="--mode" prev=mode ;; - --mode=*) mode="$optarg" ;; - - --preserve-dup-deps) duplicate_deps="yes" ;; - - --quiet | --silent) - show=: - preserve_args="$preserve_args $arg" - ;; - - --tag) - prevopt="--tag" - prev=tag - preserve_args="$preserve_args --tag" - ;; - --tag=*) - set tag "$optarg" ${1+"$@"} - shift - prev=tag - preserve_args="$preserve_args --tag" - ;; - - -dlopen) - prevopt="-dlopen" - prev=execute_dlfiles - ;; - - -*) - $echo "$modename: unrecognized option \`$arg'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - - *) - nonopt="$arg" - break - ;; - esac -done - -if test -n "$prevopt"; then - $echo "$modename: option \`$prevopt' requires an argument" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE -fi - -case $disable_libs in -no) - ;; -shared) - build_libtool_libs=no - build_old_libs=yes - ;; -static) - build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` - ;; -esac - -# If this variable is set in any of the actions, the command in it -# will be execed at the end. This prevents here-documents from being -# left over by shells. -exec_cmd= - -if test -z "$show_help"; then - - # Infer the operation mode. - if test -z "$mode"; then - $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 - $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 - case $nonopt in - *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) - mode=link - for arg - do - case $arg in - -c) - mode=compile - break - ;; - esac - done - ;; - *db | *dbx | *strace | *truss) - mode=execute - ;; - *install*|cp|mv) - mode=install - ;; - *rm) - mode=uninstall - ;; - *) - # If we have no mode, but dlfiles were specified, then do execute mode. - test -n "$execute_dlfiles" && mode=execute - - # Just use the default operation mode. - if test -z "$mode"; then - if test -n "$nonopt"; then - $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 - else - $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 - fi - fi - ;; - esac - fi - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$execute_dlfiles" && test "$mode" != execute; then - $echo "$modename: unrecognized option \`-dlopen'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$modename --help --mode=$mode' for more information." - - # These modes are in order of execution frequency so that they run quickly. - case $mode in - # libtool compile mode - compile) - modename="$modename: compile" - # Get the compilation command and the source file. - base_compile= - srcfile="$nonopt" # always keep a non-empty value in "srcfile" - suppress_opt=yes - suppress_output= - arg_mode=normal - libobj= - later= - - for arg - do - case $arg_mode in - arg ) - # do not "continue". Instead, add this to base_compile - lastarg="$arg" - arg_mode=normal - ;; - - target ) - libobj="$arg" - arg_mode=normal - continue - ;; - - normal ) - # Accept any command-line options. - case $arg in - -o) - if test -n "$libobj" ; then - $echo "$modename: you cannot specify \`-o' more than once" 1>&2 - exit $EXIT_FAILURE - fi - arg_mode=target - continue - ;; - - -static | -prefer-pic | -prefer-non-pic) - later="$later $arg" - continue - ;; - - -no-suppress) - suppress_opt=no - continue - ;; - - -Xcompiler) - arg_mode=arg # the next one goes into the "base_compile" arg list - continue # The current "srcfile" will either be retained or - ;; # replaced later. I would guess that would be a bug. - - -Wc,*) - args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` - lastarg= - save_ifs="$IFS"; IFS=',' - for arg in $args; do - IFS="$save_ifs" - - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - lastarg="$lastarg $arg" - done - IFS="$save_ifs" - lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` - - # Add the arguments to base_compile. - base_compile="$base_compile $lastarg" - continue - ;; - - * ) - # Accept the current argument as the source file. - # The previous "srcfile" becomes the current argument. - # - lastarg="$srcfile" - srcfile="$arg" - ;; - esac # case $arg - ;; - esac # case $arg_mode - - # Aesthetically quote the previous argument. - lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` - - case $lastarg in - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, and some SunOS ksh mistreat backslash-escaping - # in scan sets (worked around with variable expansion), - # and furthermore cannot handle '|' '&' '(' ')' in scan sets - # at all, so we specify them separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - lastarg="\"$lastarg\"" - ;; - esac - - base_compile="$base_compile $lastarg" - done # for arg - - case $arg_mode in - arg) - $echo "$modename: you must specify an argument for -Xcompile" - exit $EXIT_FAILURE - ;; - target) - $echo "$modename: you must specify a target with \`-o'" 1>&2 - exit $EXIT_FAILURE - ;; - *) - # Get the name of the library object. - [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` - ;; - esac - - # Recognize several different file suffixes. - # If the user specifies -o file.o, it is replaced with file.lo - xform='[cCFSifmso]' - case $libobj in - *.ada) xform=ada ;; - *.adb) xform=adb ;; - *.ads) xform=ads ;; - *.asm) xform=asm ;; - *.c++) xform=c++ ;; - *.cc) xform=cc ;; - *.ii) xform=ii ;; - *.class) xform=class ;; - *.cpp) xform=cpp ;; - *.cxx) xform=cxx ;; - *.f90) xform=f90 ;; - *.for) xform=for ;; - *.java) xform=java ;; - *.obj) xform=obj ;; - esac - - libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` - - case $libobj in - *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; - *) - $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - func_infer_tag $base_compile - - for arg in $later; do - case $arg in - -static) - build_old_libs=yes - continue - ;; - - -prefer-pic) - pic_mode=yes - continue - ;; - - -prefer-non-pic) - pic_mode=no - continue - ;; - esac - done - - qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` - case $qlibobj in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - qlibobj="\"$qlibobj\"" ;; - esac - test "X$libobj" != "X$qlibobj" \ - && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ - && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." - objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` - xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$obj"; then - xdir= - else - xdir=$xdir/ - fi - lobj=${xdir}$objdir/$objname - - if test -z "$base_compile"; then - $echo "$modename: you must specify a compilation command" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Delete any leftover library objects. - if test "$build_old_libs" = yes; then - removelist="$obj $lobj $libobj ${libobj}T" - else - removelist="$lobj $libobj ${libobj}T" - fi - - $run $rm $removelist - trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 - - # On Cygwin there's no "real" PIC flag so we must build both object types - case $host_os in - cygwin* | mingw* | pw32* | os2*) - pic_mode=default - ;; - esac - if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then - # non-PIC code in shared libraries is not supported - pic_mode=default - fi - - # Calculate the filename of the output object if compiler does - # not support -o with -c - if test "$compiler_c_o" = no; then - output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} - lockfile="$output_obj.lock" - removelist="$removelist $output_obj $lockfile" - trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 - else - output_obj= - need_locks=no - lockfile= - fi - - # Lock this critical section if it is needed - # We use this script file to make the link, it avoids creating a new file - if test "$need_locks" = yes; then - until $run ln "$progpath" "$lockfile" 2>/dev/null; do - $show "Waiting for $lockfile to be removed" - sleep 2 - done - elif test "$need_locks" = warn; then - if test -f "$lockfile"; then - $echo "\ -*** ERROR, $lockfile exists and contains: -`cat $lockfile 2>/dev/null` - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit $EXIT_FAILURE - fi - $echo "$srcfile" > "$lockfile" - fi - - if test -n "$fix_srcfile_path"; then - eval srcfile=\"$fix_srcfile_path\" - fi - qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` - case $qsrcfile in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - qsrcfile="\"$qsrcfile\"" ;; - esac - - $run $rm "$libobj" "${libobj}T" - - # Create a libtool object file (analogous to a ".la" file), - # but don't create it if we're doing a dry run. - test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then - $echo "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed, then go on to compile the next one - if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then - $show "$mv $output_obj $lobj" - if $run $mv $output_obj $lobj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Append the name of the PIC object to the libtool object file. - test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then - $echo "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed - if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then - $show "$mv $output_obj $obj" - if $run $mv $output_obj $obj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Append the name of the non-PIC object the libtool object file. - # Only append if the libtool object file exists. - test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 - fi - if test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - -static) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=built - ;; - -static-libtool-libs) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - esac - build_libtool_libs=no - build_old_libs=yes - break - ;; - esac - done - - # See if our shared archives depend on static archives. - test -n "$old_archive_from_new_cmds" && build_old_libs=yes - - # Go through the arguments, transforming them on the way. - while test "$#" -gt 0; do - arg="$1" - shift - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test - ;; - *) qarg=$arg ;; - esac - libtool_args="$libtool_args $qarg" - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - output) - compile_command="$compile_command @OUTPUT@" - finalize_command="$finalize_command @OUTPUT@" - ;; - esac - - case $prev in - dlfiles|dlprefiles) - if test "$preload" = no; then - # Add the symbol object into the linking commands. - compile_command="$compile_command @SYMFILE@" - finalize_command="$finalize_command @SYMFILE@" - preload=yes - fi - case $arg in - *.la | *.lo) ;; # We handle these cases below. - force) - if test "$dlself" = no; then - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - self) - if test "$prev" = dlprefiles; then - dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then - dlself=yes - else - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - *) - if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" - else - dlprefiles="$dlprefiles $arg" - fi - prev= - continue - ;; - esac - ;; - expsyms) - export_symbols="$arg" - if test ! -f "$arg"; then - $echo "$modename: symbol file \`$arg' does not exist" - exit $EXIT_FAILURE - fi - prev= - continue - ;; - expsyms_regex) - export_symbols_regex="$arg" - prev= - continue - ;; - inst_prefix) - inst_prefix_dir="$arg" - prev= - continue - ;; - precious_regex) - precious_files_regex="$arg" - prev= - continue - ;; - release) - release="-$arg" - prev= - continue - ;; - objectlist) - if test -f "$arg"; then - save_arg=$arg - moreargs= - for fil in `cat $save_arg` - do -# moreargs="$moreargs $fil" - arg=$fil - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - pic_object= - non_pic_object= - - # Read the .lo file - # If there is no directory component, then add one. - case $arg in - */* | *\\*) . $arg ;; - *) . ./$arg ;; - esac - - if test -z "$pic_object" || \ - test -z "$non_pic_object" || - test "$pic_object" = none && \ - test "$non_pic_object" = none; then - $echo "$modename: cannot find name of object for \`$arg'" 1>&2 - exit $EXIT_FAILURE - fi - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" - prev= - fi - - # A PIC object. - libobjs="$libobjs $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - non_pic_objects="$non_pic_objects $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if test -z "$run"; then - $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 - exit $EXIT_FAILURE - else - # Dry-run case. - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` - non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` - libobjs="$libobjs $pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - fi - done - else - $echo "$modename: link input file \`$save_arg' does not exist" - exit $EXIT_FAILURE - fi - arg=$save_arg - prev= - continue - ;; - rpath | xrpath) - # We need an absolute path. - case $arg in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit $EXIT_FAILURE - ;; - esac - if test "$prev" = rpath; then - case "$rpath " in - *" $arg "*) ;; - *) rpath="$rpath $arg" ;; - esac - else - case "$xrpath " in - *" $arg "*) ;; - *) xrpath="$xrpath $arg" ;; - esac - fi - prev= - continue - ;; - xcompiler) - compiler_flags="$compiler_flags $qarg" - prev= - compile_command="$compile_command $qarg" - finalize_command="$finalize_command $qarg" - continue - ;; - xlinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $wl$qarg" - prev= - compile_command="$compile_command $wl$qarg" - finalize_command="$finalize_command $wl$qarg" - continue - ;; - xcclinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $qarg" - prev= - compile_command="$compile_command $qarg" - finalize_command="$finalize_command $qarg" - continue - ;; - shrext) - shrext_cmds="$arg" - prev= - continue - ;; - darwin_framework|darwin_framework_skip) - test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - prev= - continue - ;; - *) - eval "$prev=\"\$arg\"" - prev= - continue - ;; - esac - fi # test -n "$prev" - - prevarg="$arg" - - case $arg in - -all-static) - if test -n "$link_static_flag"; then - compile_command="$compile_command $link_static_flag" - finalize_command="$finalize_command $link_static_flag" - fi - continue - ;; - - -allow-undefined) - # FIXME: remove this flag sometime in the future. - $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 - continue - ;; - - -avoid-version) - avoid_version=yes - continue - ;; - - -dlopen) - prev=dlfiles - continue - ;; - - -dlpreopen) - prev=dlprefiles - continue - ;; - - -export-dynamic) - export_dynamic=yes - continue - ;; - - -export-symbols | -export-symbols-regex) - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: more than one -exported-symbols argument is not allowed" - exit $EXIT_FAILURE - fi - if test "X$arg" = "X-export-symbols"; then - prev=expsyms - else - prev=expsyms_regex - fi - continue - ;; - - -framework|-arch|-isysroot) - case " $CC " in - *" ${arg} ${1} "* | *" ${arg} ${1} "*) - prev=darwin_framework_skip ;; - *) compiler_flags="$compiler_flags $arg" - prev=darwin_framework ;; - esac - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - continue - ;; - - -inst-prefix-dir) - prev=inst_prefix - continue - ;; - - # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* - # so, if we see these flags be careful not to treat them like -L - -L[A-Z][A-Z]*:*) - case $with_gcc/$host in - no/*-*-irix* | /*-*-irix*) - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - ;; - esac - continue - ;; - - -L*) - dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 - absdir="$dir" - notinst_path="$notinst_path $dir" - fi - dir="$absdir" - ;; - esac - case "$deplibs " in - *" -L$dir "*) ;; - *) - deplibs="$deplibs -L$dir" - lib_search_path="$lib_search_path $dir" - ;; - esac - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$dir:"*) ;; - *) dllsearchpath="$dllsearchpath:$dir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - *) dllsearchpath="$dllsearchpath:$testbindir";; - esac - ;; - esac - continue - ;; - - -l*) - if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) - # These systems don't actually have a C or math library (as such) - continue - ;; - *-*-os2*) - # These systems don't actually have a C library (as such) - test "X$arg" = "X-lc" && continue - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C and math libraries are in the System framework - deplibs="$deplibs -framework System" - continue - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - test "X$arg" = "X-lc" && continue - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - test "X$arg" = "X-lc" && continue - ;; - esac - elif test "X$arg" = "X-lc_r"; then - case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc_r directly, use -pthread flag. - continue - ;; - esac - fi - deplibs="$deplibs $arg" - continue - ;; - - # Tru64 UNIX uses -model [arg] to determine the layout of C++ - # classes, name mangling, and exception handling. - -model) - compile_command="$compile_command $arg" - compiler_flags="$compiler_flags $arg" - finalize_command="$finalize_command $arg" - prev=xcompiler - continue - ;; - - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) - compiler_flags="$compiler_flags $arg" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - continue - ;; - - -module) - module=yes - continue - ;; - - # -64, -mips[0-9] enable 64-bit mode on the SGI compiler - # -r[0-9][0-9]* specifies the processor on the SGI compiler - # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler - # +DA*, +DD* enable 64-bit mode on the HP compiler - # -q* pass through compiler args for the IBM compiler - # -m* pass through architecture-specific compiler args for GCC - # -m*, -t[45]*, -txscale* pass through architecture-specific - # compiler args for GCC - # -pg pass through profiling flag for GCC - # @file GCC response files - -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ - -t[45]*|-txscale*|@*) - - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - compiler_flags="$compiler_flags $arg" - continue - ;; - - -shrext) - prev=shrext - continue - ;; - - -no-fast-install) - fast_install=no - continue - ;; - - -no-install) - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - # The PATH hackery in wrapper scripts is required on Windows - # in order for the loader to find any dlls it needs. - $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 - $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 - fast_install=no - ;; - *) no_install=yes ;; - esac - continue - ;; - - -no-undefined) - allow_undefined=no - continue - ;; - - -objectlist) - prev=objectlist - continue - ;; - - -o) prev=output ;; - - -precious-files-regex) - prev=precious_regex - continue - ;; - - -release) - prev=release - continue - ;; - - -rpath) - prev=rpath - continue - ;; - - -R) - prev=xrpath - continue - ;; - - -R*) - dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit $EXIT_FAILURE - ;; - esac - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - continue - ;; - - -static | -static-libtool-libs) - # The effects of -static are defined in a previous loop. - # We used to do the same as -all-static on platforms that - # didn't have a PIC flag, but the assumption that the effects - # would be equivalent was wrong. It would break on at least - # Digital Unix and AIX. - continue - ;; - - -thread-safe) - thread_safe=yes - continue - ;; - - -version-info) - prev=vinfo - continue - ;; - -version-number) - prev=vinfo - vinfo_number=yes - continue - ;; - - -Wc,*) - args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - case $flag in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - flag="\"$flag\"" - ;; - esac - arg="$arg $wl$flag" - compiler_flags="$compiler_flags $flag" - done - IFS="$save_ifs" - arg=`$echo "X$arg" | $Xsed -e "s/^ //"` - ;; - - -Wl,*) - args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - case $flag in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - flag="\"$flag\"" - ;; - esac - arg="$arg $wl$flag" - compiler_flags="$compiler_flags $wl$flag" - linker_flags="$linker_flags $flag" - done - IFS="$save_ifs" - arg=`$echo "X$arg" | $Xsed -e "s/^ //"` - ;; - - -Xcompiler) - prev=xcompiler - continue - ;; - - -Xlinker) - prev=xlinker - continue - ;; - - -XCClinker) - prev=xcclinker - continue - ;; - - # Some other compiler flag. - -* | +*) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - ;; - - *.$objext) - # A standard object. - objs="$objs $arg" - ;; - - *.lo) - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - pic_object= - non_pic_object= - - # Read the .lo file - # If there is no directory component, then add one. - case $arg in - */* | *\\*) . $arg ;; - *) . ./$arg ;; - esac - - if test -z "$pic_object" || \ - test -z "$non_pic_object" || - test "$pic_object" = none && \ - test "$non_pic_object" = none; then - $echo "$modename: cannot find name of object for \`$arg'" 1>&2 - exit $EXIT_FAILURE - fi - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" - prev= - fi - - # A PIC object. - libobjs="$libobjs $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - non_pic_objects="$non_pic_objects $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if test -z "$run"; then - $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 - exit $EXIT_FAILURE - else - # Dry-run case. - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` - non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` - libobjs="$libobjs $pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - fi - ;; - - *.$libext) - # An archive. - deplibs="$deplibs $arg" - old_deplibs="$old_deplibs $arg" - continue - ;; - - *.la) - # A libtool-controlled library. - - if test "$prev" = dlfiles; then - # This library was specified with -dlopen. - dlfiles="$dlfiles $arg" - prev= - elif test "$prev" = dlprefiles; then - # The library was specified with -dlpreopen. - dlprefiles="$dlprefiles $arg" - prev= - else - deplibs="$deplibs $arg" - fi - continue - ;; - - # Some other compiler argument. - *) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - ;; - esac # arg - - # Now actually substitute the argument into the commands. - if test -n "$arg"; then - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - done # argument parsing loop - - if test -n "$prev"; then - $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - - oldlibs= - # calculate the name of the file, without its directory - outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` - libobjs_save="$libobjs" - - if test -n "$shlibpath_var"; then - # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` - else - shlib_search_path= - fi - eval sys_lib_search_path=\"$sys_lib_search_path_spec\" - eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" - - output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` - if test "X$output_objdir" = "X$output"; then - output_objdir="$objdir" - else - output_objdir="$output_objdir/$objdir" - fi - # Create the object directory. - if test ! -d "$output_objdir"; then - $show "$mkdir $output_objdir" - $run $mkdir $output_objdir - exit_status=$? - if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then - exit $exit_status - fi - fi - - # Determine the type of output - case $output in - "") - $echo "$modename: you must specify an output file" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - *.$libext) linkmode=oldlib ;; - *.lo | *.$objext) linkmode=obj ;; - *.la) linkmode=lib ;; - *) linkmode=prog ;; # Anything else should be a program. - esac - - case $host in - *cygwin* | *mingw* | *pw32*) - # don't eliminate duplications in $postdeps and $predeps - duplicate_compiler_generated_deps=yes - ;; - *) - duplicate_compiler_generated_deps=$duplicate_deps - ;; - esac - specialdeplibs= - - libs= - # Find all interdependent deplibs by searching for libraries - # that are linked more than once (e.g. -la -lb -la) - for deplib in $deplibs; do - if test "X$duplicate_deps" = "Xyes" ; then - case "$libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - libs="$libs $deplib" - done - - if test "$linkmode" = lib; then - libs="$predeps $libs $compiler_lib_search_path $postdeps" - - # Compute libraries that are listed more than once in $predeps - # $postdeps and mark them as special (i.e., whose duplicates are - # not to be eliminated). - pre_post_deps= - if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then - for pre_post_dep in $predeps $postdeps; do - case "$pre_post_deps " in - *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; - esac - pre_post_deps="$pre_post_deps $pre_post_dep" - done - fi - pre_post_deps= - fi - - deplibs= - newdependency_libs= - newlib_search_path= - need_relink=no # whether we're linking any uninstalled libtool libraries - notinst_deplibs= # not-installed libtool libraries - case $linkmode in - lib) - passes="conv link" - for file in $dlfiles $dlprefiles; do - case $file in - *.la) ;; - *) - $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 - exit $EXIT_FAILURE - ;; - esac - done - ;; - prog) - compile_deplibs= - finalize_deplibs= - alldeplibs=no - newdlfiles= - newdlprefiles= - passes="conv scan dlopen dlpreopen link" - ;; - *) passes="conv" - ;; - esac - for pass in $passes; do - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan"; then - libs="$deplibs" - deplibs= - fi - if test "$linkmode" = prog; then - case $pass in - dlopen) libs="$dlfiles" ;; - dlpreopen) libs="$dlprefiles" ;; - link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; - esac - fi - if test "$pass" = dlopen; then - # Collect dlpreopened libraries - save_deplibs="$deplibs" - deplibs= - fi - for deplib in $libs; do - lib= - found=no - case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - compiler_flags="$compiler_flags $deplib" - fi - continue - ;; - -l*) - if test "$linkmode" != lib && test "$linkmode" != prog; then - $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 - continue - fi - name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` - for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do - for search_ext in .la $std_shrext .so .a; do - # Search the libtool library - lib="$searchdir/lib${name}${search_ext}" - if test -f "$lib"; then - if test "$search_ext" = ".la"; then - found=yes - else - found=no - fi - break 2 - fi - done - done - if test "$found" != yes; then - # deplib doesn't seem to be a libtool library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - else # deplib is a libtool library - # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, - # We need to do some special things here, and not later. - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $deplib "*) - if (${SED} -e '2q' $lib | - grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - library_names= - old_library= - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - for l in $old_library $library_names; do - ll="$l" - done - if test "X$ll" = "X$old_library" ; then # only static version available - found=no - ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` - test "X$ladir" = "X$lib" && ladir="." - lib=$ladir/$old_library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - fi - fi - ;; - *) ;; - esac - fi - fi - ;; # -l - -L*) - case $linkmode in - lib) - deplibs="$deplib $deplibs" - test "$pass" = conv && continue - newdependency_libs="$deplib $newdependency_libs" - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - ;; - prog) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - if test "$pass" = scan; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - ;; - *) - $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 - ;; - esac # linkmode - continue - ;; # -L - -R*) - if test "$pass" = link; then - dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` - # Make sure the xrpath contains only unique directories. - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - fi - deplibs="$deplib $deplibs" - continue - ;; - *.la) lib="$deplib" ;; - *.$libext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - case $linkmode in - lib) - valid_a_lib=no - case $deplibs_check_method in - match_pattern*) - set dummy $deplibs_check_method - match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` - if eval $echo \"$deplib\" 2>/dev/null \ - | $SED 10q \ - | $EGREP "$match_pattern_regex" > /dev/null; then - valid_a_lib=yes - fi - ;; - pass_all) - valid_a_lib=yes - ;; - esac - if test "$valid_a_lib" != yes; then - $echo - $echo "*** Warning: Trying to link with static lib archive $deplib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have" - $echo "*** because the file extensions .$libext of this argument makes me believe" - $echo "*** that it is just a static archive that I should not used here." - else - $echo - $echo "*** Warning: Linking the shared library $output against the" - $echo "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" - fi - continue - ;; - prog) - if test "$pass" != link; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - continue - ;; - esac # linkmode - ;; # *.$libext - *.lo | *.$objext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - elif test "$linkmode" = prog; then - if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then - # If there is no dlopen support or we're linking statically, - # we need to preload. - newdlprefiles="$newdlprefiles $deplib" - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - newdlfiles="$newdlfiles $deplib" - fi - fi - continue - ;; - %DEPLIBS%) - alldeplibs=yes - continue - ;; - esac # case $deplib - if test "$found" = yes || test -f "$lib"; then : - else - $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 - exit $EXIT_FAILURE - fi - - # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - - ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` - test "X$ladir" = "X$lib" && ladir="." - - dlname= - dlopen= - dlpreopen= - libdir= - library_names= - old_library= - # If the library was installed with an old release of libtool, - # it will not redefine variables installed, or shouldnotlink - installed=yes - shouldnotlink=no - avoidtemprpath= - - - # Read the .la file - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan" || - { test "$linkmode" != prog && test "$linkmode" != lib; }; then - test -n "$dlopen" && dlfiles="$dlfiles $dlopen" - test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" - fi - - if test "$pass" = conv; then - # Only check for convenience libraries - deplibs="$lib $deplibs" - if test -z "$libdir"; then - if test -z "$old_library"; then - $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - # It is a libtool convenience library, so add in its objects. - convenience="$convenience $ladir/$objdir/$old_library" - old_convenience="$old_convenience $ladir/$objdir/$old_library" - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done - elif test "$linkmode" != prog && test "$linkmode" != lib; then - $echo "$modename: \`$lib' is not a convenience library" 1>&2 - exit $EXIT_FAILURE - fi - continue - fi # $pass = conv - - - # Get the name of the library we link against. - linklib= - for l in $old_library $library_names; do - linklib="$l" - done - if test -z "$linklib"; then - $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - - # This library was specified with -dlopen. - if test "$pass" = dlopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - if test -z "$dlname" || - test "$dlopen_support" != yes || - test "$build_libtool_libs" = no; then - # If there is no dlname, no dlopen support or we're linking - # statically, we need to preload. We also need to preload any - # dependent libraries so libltdl's deplib preloader doesn't - # bomb out in the load deplibs phase. - dlprefiles="$dlprefiles $lib $dependency_libs" - else - newdlfiles="$newdlfiles $lib" - fi - continue - fi # $pass = dlopen - - # We need an absolute path. - case $ladir in - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; - *) - abs_ladir=`cd "$ladir" && pwd` - if test -z "$abs_ladir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 - $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 - abs_ladir="$ladir" - fi - ;; - esac - laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - - # Find the relevant object directory and library name. - if test "X$installed" = Xyes; then - if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - $echo "$modename: warning: library \`$lib' was moved." 1>&2 - dir="$ladir" - absdir="$abs_ladir" - libdir="$abs_ladir" - else - dir="$libdir" - absdir="$libdir" - fi - test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes - else - if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then - dir="$ladir" - absdir="$abs_ladir" - # Remove this search path later - notinst_path="$notinst_path $abs_ladir" - else - dir="$ladir/$objdir" - absdir="$abs_ladir/$objdir" - # Remove this search path later - notinst_path="$notinst_path $abs_ladir" - fi - fi # $installed = yes - name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - - # This library was specified with -dlpreopen. - if test "$pass" = dlpreopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - newdlprefiles="$newdlprefiles $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - newdlprefiles="$newdlprefiles $dir/$dlname" - else - newdlprefiles="$newdlprefiles $dir/$linklib" - fi - fi # $pass = dlpreopen - - if test -z "$libdir"; then - # Link the convenience library - if test "$linkmode" = lib; then - deplibs="$dir/$old_library $deplibs" - elif test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$dir/$old_library $compile_deplibs" - finalize_deplibs="$dir/$old_library $finalize_deplibs" - else - deplibs="$lib $deplibs" # used for prog,scan pass - fi - continue - fi - - - if test "$linkmode" = prog && test "$pass" != link; then - newlib_search_path="$newlib_search_path $ladir" - deplibs="$lib $deplibs" - - linkalldeplibs=no - if test "$link_all_deplibs" != no || test -z "$library_names" || - test "$build_libtool_libs" = no; then - linkalldeplibs=yes - fi - - tmp_libs= - for deplib in $dependency_libs; do - case $deplib in - -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test - esac - # Need to link against all dependency_libs? - if test "$linkalldeplibs" = yes; then - deplibs="$deplib $deplibs" - else - # Need to hardcode shared library paths - # or/and link against static libraries - newdependency_libs="$deplib $newdependency_libs" - fi - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done # for deplib - continue - fi # $linkmode = prog... - - if test "$linkmode,$pass" = "prog,link"; then - if test -n "$library_names" && - { { test "$prefer_static_libs" = no || - test "$prefer_static_libs,$installed" = "built,yes"; } || - test -z "$old_library"; }; then - # We need to hardcode the library path - if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then - # Make sure the rpath contains only unique directories. - case "$temp_rpath " in - *" $dir "*) ;; - *" $absdir "*) ;; - *) temp_rpath="$temp_rpath $absdir" ;; - esac - fi - - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - fi # $linkmode,$pass = prog,link... - - if test "$alldeplibs" = yes && - { test "$deplibs_check_method" = pass_all || - { test "$build_libtool_libs" = yes && - test -n "$library_names"; }; }; then - # We only need to search for static libraries - continue - fi - fi - - link_static=no # Whether the deplib will be linked statically - use_static_libs=$prefer_static_libs - if test "$use_static_libs" = built && test "$installed" = yes ; then - use_static_libs=no - fi - if test -n "$library_names" && - { test "$use_static_libs" = no || test -z "$old_library"; }; then - if test "$installed" = no; then - notinst_deplibs="$notinst_deplibs $lib" - need_relink=yes - fi - # This is a shared library - - # Warn about portability, can't link against -module's on - # some systems (darwin) - if test "$shouldnotlink" = yes && test "$pass" = link ; then - $echo - if test "$linkmode" = prog; then - $echo "*** Warning: Linking the executable $output against the loadable module" - else - $echo "*** Warning: Linking the shared library $output against the loadable module" - fi - $echo "*** $linklib is not portable!" - fi - if test "$linkmode" = lib && - test "$hardcode_into_libs" = yes; then - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - fi - - if test -n "$old_archive_from_expsyms_cmds"; then - # figure out the soname - set dummy $library_names - realname="$2" - shift; shift - libname=`eval \\$echo \"$libname_spec\"` - # use dlname if we got it. it's perfectly good, no? - if test -n "$dlname"; then - soname="$dlname" - elif test -n "$soname_spec"; then - # bleh windows - case $host in - *cygwin* | mingw*) - major=`expr $current - $age` - versuffix="-$major" - ;; - esac - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - - # Make a new name for the extract_expsyms_cmds to use - soroot="$soname" - soname=`$echo $soroot | ${SED} -e 's/^.*\///'` - newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" - - # If the library has no export list, then create one now - if test -f "$output_objdir/$soname-def"; then : - else - $show "extracting exported symbol list from \`$soname'" - save_ifs="$IFS"; IFS='~' - cmds=$extract_expsyms_cmds - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - # Create $newlib - if test -f "$output_objdir/$newlib"; then :; else - $show "generating import library for \`$soname'" - save_ifs="$IFS"; IFS='~' - cmds=$old_archive_from_expsyms_cmds - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - # make sure the library variables are pointing to the new library - dir=$output_objdir - linklib=$newlib - fi # test -n "$old_archive_from_expsyms_cmds" - - if test "$linkmode" = prog || test "$mode" != relink; then - add_shlibpath= - add_dir= - add= - lib_linked=yes - case $hardcode_action in - immediate | unsupported) - if test "$hardcode_direct" = no; then - add="$dir/$linklib" - case $host in - *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; - *-*-sysv4*uw2*) add_dir="-L$dir" ;; - *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ - *-*-unixware7*) add_dir="-L$dir" ;; - *-*-darwin* ) - # if the lib is a module then we can not link against - # it, someone is ignoring the new warnings I added - if /usr/bin/file -L $add 2> /dev/null | - $EGREP ": [^:]* bundle" >/dev/null ; then - $echo "** Warning, lib $linklib is a module, not a shared library" - if test -z "$old_library" ; then - $echo - $echo "** And there doesn't seem to be a static archive available" - $echo "** The link will probably fail, sorry" - else - add="$dir/$old_library" - fi - fi - esac - elif test "$hardcode_minus_L" = no; then - case $host in - *-*-sunos*) add_shlibpath="$dir" ;; - esac - add_dir="-L$dir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = no; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - relink) - if test "$hardcode_direct" = yes; then - add="$dir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$dir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - *) lib_linked=no ;; - esac - - if test "$lib_linked" != yes; then - $echo "$modename: configuration error: unsupported hardcode properties" - exit $EXIT_FAILURE - fi - - if test -n "$add_shlibpath"; then - case :$compile_shlibpath: in - *":$add_shlibpath:"*) ;; - *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; - esac - fi - if test "$linkmode" = prog; then - test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" - test -n "$add" && compile_deplibs="$add $compile_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - if test "$hardcode_direct" != yes && \ - test "$hardcode_minus_L" != yes && \ - test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - fi - fi - fi - - if test "$linkmode" = prog || test "$mode" = relink; then - add_shlibpath= - add_dir= - add= - # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes; then - add="$libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$libdir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - add="-l$name" - elif test "$hardcode_automatic" = yes; then - if test -n "$inst_prefix_dir" && - test -f "$inst_prefix_dir$libdir/$linklib" ; then - add="$inst_prefix_dir$libdir/$linklib" - else - add="$libdir/$linklib" - fi - else - # We cannot seem to hardcode it, guess we'll fake it. - add_dir="-L$libdir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - fi - - if test "$linkmode" = prog; then - test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" - test -n "$add" && finalize_deplibs="$add $finalize_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - fi - fi - elif test "$linkmode" = prog; then - # Here we assume that one of hardcode_direct or hardcode_minus_L - # is not unsupported. This is valid on all known static and - # shared platforms. - if test "$hardcode_direct" != unsupported; then - test -n "$old_library" && linklib="$old_library" - compile_deplibs="$dir/$linklib $compile_deplibs" - finalize_deplibs="$dir/$linklib $finalize_deplibs" - else - compile_deplibs="-l$name -L$dir $compile_deplibs" - finalize_deplibs="-l$name -L$dir $finalize_deplibs" - fi - elif test "$build_libtool_libs" = yes; then - # Not a shared library - if test "$deplibs_check_method" != pass_all; then - # We're trying link a shared library against a static one - # but the system doesn't support it. - - # Just print a warning and add the library to dependency_libs so - # that the program can be linked against the static library. - $echo - $echo "*** Warning: This system can not link to static lib archive $lib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have." - if test "$module" = yes; then - $echo "*** But as you try to build a module library, libtool will still create " - $echo "*** a static module, that should work as long as the dlopening application" - $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." - if test -z "$global_symbol_pipe"; then - $echo - $echo "*** However, this would only work if libtool was able to extract symbol" - $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - $echo "*** not find such a program. So, this module is probably useless." - $echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - else - deplibs="$dir/$old_library $deplibs" - link_static=yes - fi - fi # link shared/static library? - - if test "$linkmode" = lib; then - if test -n "$dependency_libs" && - { test "$hardcode_into_libs" != yes || - test "$build_old_libs" = yes || - test "$link_static" = yes; }; then - # Extract -R from dependency_libs - temp_deplibs= - for libdir in $dependency_libs; do - case $libdir in - -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` - case " $xrpath " in - *" $temp_xrpath "*) ;; - *) xrpath="$xrpath $temp_xrpath";; - esac;; - *) temp_deplibs="$temp_deplibs $libdir";; - esac - done - dependency_libs="$temp_deplibs" - fi - - newlib_search_path="$newlib_search_path $absdir" - # Link against this library - test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" - # ... and its dependency_libs - tmp_libs= - for deplib in $dependency_libs; do - newdependency_libs="$deplib $newdependency_libs" - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done - - if test "$link_all_deplibs" != no; then - # Add the search paths of all dependency libraries - for deplib in $dependency_libs; do - case $deplib in - -L*) path="$deplib" ;; - *.la) - dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$deplib" && dir="." - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 - absdir="$dir" - fi - ;; - esac - if grep "^installed=no" $deplib > /dev/null; then - path="$absdir/$objdir" - else - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - if test "$absdir" != "$libdir"; then - $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 - fi - path="$absdir" - fi - depdepl= - case $host in - *-*-darwin*) - # we do not want to link against static libs, - # but need to link against shared - eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` - if test -n "$deplibrary_names" ; then - for tmp in $deplibrary_names ; do - depdepl=$tmp - done - if test -f "$path/$depdepl" ; then - depdepl="$path/$depdepl" - fi - # do not add paths which are already there - case " $newlib_search_path " in - *" $path "*) ;; - *) newlib_search_path="$newlib_search_path $path";; - esac - fi - path="" - ;; - *) - path="-L$path" - ;; - esac - ;; - -l*) - case $host in - *-*-darwin*) - # Again, we only want to link against shared libraries - eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` - for tmp in $newlib_search_path ; do - if test -f "$tmp/lib$tmp_libs.dylib" ; then - eval depdepl="$tmp/lib$tmp_libs.dylib" - break - fi - done - path="" - ;; - *) continue ;; - esac - ;; - *) continue ;; - esac - case " $deplibs " in - *" $path "*) ;; - *) deplibs="$path $deplibs" ;; - esac - case " $deplibs " in - *" $depdepl "*) ;; - *) deplibs="$depdepl $deplibs" ;; - esac - done - fi # link_all_deplibs != no - fi # linkmode = lib - done # for deplib in $libs - dependency_libs="$newdependency_libs" - if test "$pass" = dlpreopen; then - # Link the dlpreopened libraries before other libraries - for deplib in $save_deplibs; do - deplibs="$deplib $deplibs" - done - fi - if test "$pass" != dlopen; then - if test "$pass" != conv; then - # Make sure lib_search_path contains only unique directories. - lib_search_path= - for dir in $newlib_search_path; do - case "$lib_search_path " in - *" $dir "*) ;; - *) lib_search_path="$lib_search_path $dir" ;; - esac - done - newlib_search_path= - fi - - if test "$linkmode,$pass" != "prog,link"; then - vars="deplibs" - else - vars="compile_deplibs finalize_deplibs" - fi - for var in $vars dependency_libs; do - # Add libraries to $var in reverse order - eval tmp_libs=\"\$$var\" - new_libs= - for deplib in $tmp_libs; do - # FIXME: Pedantically, this is the right thing to do, so - # that some nasty dependency loop isn't accidentally - # broken: - #new_libs="$deplib $new_libs" - # Pragmatically, this seems to cause very few problems in - # practice: - case $deplib in - -L*) new_libs="$deplib $new_libs" ;; - -R*) ;; - *) - # And here is the reason: when a library appears more - # than once as an explicit dependence of a library, or - # is implicitly linked in more than once by the - # compiler, it is considered special, and multiple - # occurrences thereof are not removed. Compare this - # with having the same library being listed as a - # dependency of multiple other libraries: in this case, - # we know (pedantically, we assume) the library does not - # need to be listed more than once, so we keep only the - # last copy. This is not always right, but it is rare - # enough that we require users that really mean to play - # such unportable linking tricks to link the library - # using -Wl,-lname, so that libtool does not consider it - # for duplicate removal. - case " $specialdeplibs " in - *" $deplib "*) new_libs="$deplib $new_libs" ;; - *) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$deplib $new_libs" ;; - esac - ;; - esac - ;; - esac - done - tmp_libs= - for deplib in $new_libs; do - case $deplib in - -L*) - case " $tmp_libs " in - *" $deplib "*) ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - done - eval $var=\"$tmp_libs\" - done # for var - fi - # Last step: remove runtime libs from dependency_libs - # (they stay in deplibs) - tmp_libs= - for i in $dependency_libs ; do - case " $predeps $postdeps $compiler_lib_search_path " in - *" $i "*) - i="" - ;; - esac - if test -n "$i" ; then - tmp_libs="$tmp_libs $i" - fi - done - dependency_libs=$tmp_libs - done # for pass - if test "$linkmode" = prog; then - dlfiles="$newdlfiles" - dlprefiles="$newdlprefiles" - fi - - case $linkmode in - oldlib) - if test -n "$deplibs"; then - $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 - fi - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 - fi - - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 - fi - - # Now set the variables for building old libraries. - build_libtool_libs=no - oldlibs="$output" - objs="$objs$old_deplibs" - ;; - - lib) - # Make sure we only generate libraries of the form `libNAME.la'. - case $outputname in - lib*) - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - ;; - *) - if test "$module" = no; then - $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - if test "$need_lib_prefix" != no; then - # Add the "lib" prefix for modules if required - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - else - libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - fi - ;; - esac - - if test -n "$objs"; then - if test "$deplibs_check_method" != pass_all; then - $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 - exit $EXIT_FAILURE - else - $echo - $echo "*** Warning: Linking the shared library $output against the non-libtool" - $echo "*** objects $objs is not portable!" - libobjs="$libobjs $objs" - fi - fi - - if test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 - fi - - set dummy $rpath - if test "$#" -gt 2; then - $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 - fi - install_libdir="$2" - - oldlibs= - if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then - # Building a libtool convenience library. - # Some compilers have problems with a `.al' extension so - # convenience libraries should have the same extension an - # archive normally would. - oldlibs="$output_objdir/$libname.$libext $oldlibs" - build_libtool_libs=convenience - build_old_libs=yes - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 - fi - else - - # Parse the version information argument. - save_ifs="$IFS"; IFS=':' - set dummy $vinfo 0 0 0 - IFS="$save_ifs" - - if test -n "$8"; then - $echo "$modename: too many parameters to \`-version-info'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # convert absolute version numbers to libtool ages - # this retains compatibility with .la files and attempts - # to make the code below a bit more comprehensible - - case $vinfo_number in - yes) - number_major="$2" - number_minor="$3" - number_revision="$4" - # - # There are really only two kinds -- those that - # use the current revision as the major version - # and those that subtract age and use age as - # a minor version. But, then there is irix - # which has an extra 1 added just for fun - # - case $version_type in - darwin|linux|osf|windows|none) - current=`expr $number_major + $number_minor` - age="$number_minor" - revision="$number_revision" - ;; - freebsd-aout|freebsd-elf|sunos) - current="$number_major" - revision="$number_minor" - age="0" - ;; - irix|nonstopux) - current=`expr $number_major + $number_minor - 1` - age="$number_minor" - revision="$number_minor" - ;; - esac - ;; - no) - current="$2" - revision="$3" - age="$4" - ;; - esac - - # Check that each of the things are valid numbers. - case $current in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - case $revision in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - case $age in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - if test "$age" -gt "$current"; then - $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - fi - - # Calculate the version variables. - major= - versuffix= - verstring= - case $version_type in - none) ;; - - darwin) - # Like Linux, but with the current version available in - # verstring for coding it into the library header - major=.`expr $current - $age` - versuffix="$major.$age.$revision" - # Darwin ld doesn't like 0 for these options... - minor_current=`expr $current + 1` - verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" - ;; - - freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; - ;; - - freebsd-elf) - major=".$current" - versuffix=".$current"; - ;; - - irix | nonstopux) - major=`expr $current - $age + 1` - - case $version_type in - nonstopux) verstring_prefix=nonstopux ;; - *) verstring_prefix=sgi ;; - esac - verstring="$verstring_prefix$major.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$revision - while test "$loop" -ne 0; do - iface=`expr $revision - $loop` - loop=`expr $loop - 1` - verstring="$verstring_prefix$major.$iface:$verstring" - done - - # Before this point, $major must not contain `.'. - major=.$major - versuffix="$major.$revision" - ;; - - linux) - major=.`expr $current - $age` - versuffix="$major.$age.$revision" - ;; - - osf) - major=.`expr $current - $age` - versuffix=".$current.$age.$revision" - verstring="$current.$age.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$age - while test "$loop" -ne 0; do - iface=`expr $current - $loop` - loop=`expr $loop - 1` - verstring="$verstring:${iface}.0" - done - - # Make executables depend on our current version. - verstring="$verstring:${current}.0" - ;; - - sunos) - major=".$current" - versuffix=".$current.$revision" - ;; - - windows) - # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 filesystems. - major=`expr $current - $age` - versuffix="-$major" - ;; - - *) - $echo "$modename: unknown library version type \`$version_type'" 1>&2 - $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit $EXIT_FAILURE - ;; - esac - - # Clear the version info if we defaulted, and they specified a release. - if test -z "$vinfo" && test -n "$release"; then - major= - case $version_type in - darwin) - # we can't check for "0.0" in archive_cmds due to quoting - # problems, so we reset it completely - verstring= - ;; - *) - verstring="0.0" - ;; - esac - if test "$need_version" = no; then - versuffix= - else - versuffix=".0.0" - fi - fi - - # Remove version info from name if versioning should be avoided - if test "$avoid_version" = yes && test "$need_version" = no; then - major= - versuffix= - verstring="" - fi - - # Check to see if the archive will have undefined symbols. - if test "$allow_undefined" = yes; then - if test "$allow_undefined_flag" = unsupported; then - $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 - build_libtool_libs=no - build_old_libs=yes - fi - else - # Don't allow undefined symbols. - allow_undefined_flag="$no_undefined_flag" - fi - fi - - if test "$mode" != relink; then - # Remove our outputs, but don't remove object files since they - # may have been created when compiling PIC objects. - removelist= - tempremovelist=`$echo "$output_objdir/*"` - for p in $tempremovelist; do - case $p in - *.$objext) - ;; - $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) - if test "X$precious_files_regex" != "X"; then - if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 - then - continue - fi - fi - removelist="$removelist $p" - ;; - *) ;; - esac - done - if test -n "$removelist"; then - $show "${rm}r $removelist" - $run ${rm}r $removelist - fi - fi - - # Now set the variables for building old libraries. - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - oldlibs="$oldlibs $output_objdir/$libname.$libext" - - # Transform .lo files to .o files. - oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` - fi - - # Eliminate all temporary directories. -# for path in $notinst_path; do -# lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` -# deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` -# dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` -# done - - if test -n "$xrpath"; then - # If the user specified any rpath flags, then add them. - temp_xrpath= - for libdir in $xrpath; do - temp_xrpath="$temp_xrpath -R$libdir" - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then - dependency_libs="$temp_xrpath $dependency_libs" - fi - fi - - # Make sure dlfiles contains only unique files that won't be dlpreopened - old_dlfiles="$dlfiles" - dlfiles= - for lib in $old_dlfiles; do - case " $dlprefiles $dlfiles " in - *" $lib "*) ;; - *) dlfiles="$dlfiles $lib" ;; - esac - done - - # Make sure dlprefiles contains only unique files - old_dlprefiles="$dlprefiles" - dlprefiles= - for lib in $old_dlprefiles; do - case "$dlprefiles " in - *" $lib "*) ;; - *) dlprefiles="$dlprefiles $lib" ;; - esac - done - - if test "$build_libtool_libs" = yes; then - if test -n "$rpath"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) - # these systems don't actually have a c library (as such)! - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C library is in the System framework - deplibs="$deplibs -framework System" - ;; - *-*-netbsd*) - # Don't link with libc until the a.out ld.so is fixed. - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - ;; - *) - # Add libc to deplibs on all other systems if necessary. - if test "$build_libtool_need_lc" = "yes"; then - deplibs="$deplibs -lc" - fi - ;; - esac - fi - - # Transform deplibs into only deplibs that can be linked in shared. - name_save=$name - libname_save=$libname - release_save=$release - versuffix_save=$versuffix - major_save=$major - # I'm not sure if I'm treating the release correctly. I think - # release should show up in the -l (ie -lgmp5) so we don't want to - # add it in twice. Is that correct? - release="" - versuffix="" - major="" - newdeplibs= - droppeddeps=no - case $deplibs_check_method in - pass_all) - # Don't check for shared/static. Everything works. - # This might be a little naive. We might want to check - # whether the library exists or not. But this is on - # osf3 & osf4 and I'm not really sure... Just - # implementing what was already the behavior. - newdeplibs=$deplibs - ;; - test_compile) - # This code stresses the "libraries are programs" paradigm to its - # limits. Maybe even breaks it. We compile a program, linking it - # against the deplibs as a proxy for the library. Then we can check - # whether they linked in statically or dynamically with ldd. - $rm conftest.c - cat > conftest.c </dev/null` - for potent_lib in $potential_libs; do - # Follow soft links. - if ls -lLd "$potent_lib" 2>/dev/null \ - | grep " -> " >/dev/null; then - continue - fi - # The statement above tries to avoid entering an - # endless loop below, in case of cyclic links. - # We might still enter an endless loop, since a link - # loop can be closed while we follow links, - # but so what? - potlib="$potent_lib" - while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` - case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ - | ${SED} 10q \ - | $EGREP "$file_magic_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - $echo - $echo "*** Warning: linker path does not have real file for library $a_deplib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have" - $echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $echo "*** with $libname but no candidates were found. (...for file magic test)" - else - $echo "*** with $libname and none of the candidates passed a file format test" - $echo "*** using a file magic. Last file checked: $potlib" - fi - fi - else - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - fi - done # Gone through all deplibs. - ;; - match_pattern*) - set dummy $deplibs_check_method - match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` - for a_deplib in $deplibs; do - name=`expr $a_deplib : '-l\(.*\)'` - # If $name is empty we are operating on a -L argument. - if test -n "$name" && test "$name" != "0"; then - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $a_deplib "*) - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - ;; - esac - fi - if test -n "$a_deplib" ; then - libname=`eval \\$echo \"$libname_spec\"` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` - for potent_lib in $potential_libs; do - potlib="$potent_lib" # see symlink-check above in file_magic test - if eval $echo \"$potent_lib\" 2>/dev/null \ - | ${SED} 10q \ - | $EGREP "$match_pattern_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - $echo - $echo "*** Warning: linker path does not have real file for library $a_deplib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have" - $echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $echo "*** with $libname but no candidates were found. (...for regex pattern test)" - else - $echo "*** with $libname and none of the candidates passed a file format test" - $echo "*** using a regex pattern. Last file checked: $potlib" - fi - fi - else - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - fi - done # Gone through all deplibs. - ;; - none | unknown | *) - newdeplibs="" - tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ - -e 's/ -[LR][^ ]*//g'` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - for i in $predeps $postdeps ; do - # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` - done - fi - if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ - | grep . >/dev/null; then - $echo - if test "X$deplibs_check_method" = "Xnone"; then - $echo "*** Warning: inter-library dependencies are not supported in this platform." - else - $echo "*** Warning: inter-library dependencies are not known to be supported." - fi - $echo "*** All declared inter-library dependencies are being dropped." - droppeddeps=yes - fi - ;; - esac - versuffix=$versuffix_save - major=$major_save - release=$release_save - libname=$libname_save - name=$name_save - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` - ;; - esac - - if test "$droppeddeps" = yes; then - if test "$module" = yes; then - $echo - $echo "*** Warning: libtool could not satisfy all declared inter-library" - $echo "*** dependencies of module $libname. Therefore, libtool will create" - $echo "*** a static module, that should work as long as the dlopening" - $echo "*** application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then - $echo - $echo "*** However, this would only work if libtool was able to extract symbol" - $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - $echo "*** not find such a program. So, this module is probably useless." - $echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - else - $echo "*** The inter-library dependencies that have been dropped here will be" - $echo "*** automatically added whenever a program is linked with this library" - $echo "*** or is declared to -dlopen it." - - if test "$allow_undefined" = no; then - $echo - $echo "*** Since this library must not contain undefined symbols," - $echo "*** because either the platform does not support them or" - $echo "*** it was explicitly requested with -no-undefined," - $echo "*** libtool will only create a static version of it." - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - fi - fi - # Done checking deplibs! - deplibs=$newdeplibs - fi - - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $deplibs " in - *" -L$path/$objdir "*) - new_libs="$new_libs -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; - esac - ;; - *) new_libs="$new_libs $deplib" ;; - esac - done - deplibs="$new_libs" - - - # All the library-specific variables (install_libdir is set above). - library_names= - old_library= - dlname= - - # Test again, we may have decided not to build it any more - if test "$build_libtool_libs" = yes; then - if test "$hardcode_into_libs" = yes; then - # Hardcode the library paths - hardcode_libdirs= - dep_rpath= - rpath="$finalize_rpath" - test "$mode" != relink && rpath="$compile_rpath$rpath" - for libdir in $rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - dep_rpath="$dep_rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - if test -n "$hardcode_libdir_flag_spec_ld"; then - eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" - else - eval dep_rpath=\"$hardcode_libdir_flag_spec\" - fi - fi - if test -n "$runpath_var" && test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" - fi - test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" - fi - - shlibpath="$finalize_shlibpath" - test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" - if test -n "$shlibpath"; then - eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" - fi - - # Get the real and link names of the library. - eval shared_ext=\"$shrext_cmds\" - eval library_names=\"$library_names_spec\" - set dummy $library_names - realname="$2" - shift; shift - - if test -n "$soname_spec"; then - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - if test -z "$dlname"; then - dlname=$soname - fi - - lib="$output_objdir/$realname" - linknames= - for link - do - linknames="$linknames $link" - done - - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then - $show "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $run $rm $export_symbols - cmds=$export_symbols_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - if len=`expr "X$cmd" : ".*"` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - $show "$cmd" - $run eval "$cmd" || exit $? - skipped_export=false - else - # The command line is too long to execute in one step. - $show "using reloadable object file for export list..." - skipped_export=: - # Break out early, otherwise skipped_export may be - # set to false by a later but shorter cmd. - break - fi - done - IFS="$save_ifs" - if test -n "$export_symbols_regex"; then - $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" - $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - $show "$mv \"${export_symbols}T\" \"$export_symbols\"" - $run eval '$mv "${export_symbols}T" "$export_symbols"' - fi - fi - fi - - if test -n "$export_symbols" && test -n "$include_expsyms"; then - $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' - fi - - tmp_deplibs= - for test_deplib in $deplibs; do - case " $convenience " in - *" $test_deplib "*) ;; - *) - tmp_deplibs="$tmp_deplibs $test_deplib" - ;; - esac - done - deplibs="$tmp_deplibs" - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - func_extract_archives $gentop $convenience - libobjs="$libobjs $func_extract_archives_result" - fi - fi - - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - linker_flags="$linker_flags $flag" - fi - - # Make a backup of the uninstalled library when relinking - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? - fi - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - eval test_cmds=\"$module_expsym_cmds\" - cmds=$module_expsym_cmds - else - eval test_cmds=\"$module_cmds\" - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval test_cmds=\"$archive_expsym_cmds\" - cmds=$archive_expsym_cmds - else - eval test_cmds=\"$archive_cmds\" - cmds=$archive_cmds - fi - fi - - if test "X$skipped_export" != "X:" && - len=`expr "X$test_cmds" : ".*" 2>/dev/null` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - : - else - # The command line is too long to link in one step, link piecewise. - $echo "creating reloadable object files..." - - # Save the value of $output and $libobjs because we want to - # use them later. If we have whole_archive_flag_spec, we - # want to use save_libobjs as it was before - # whole_archive_flag_spec was expanded, because we can't - # assume the linker understands whole_archive_flag_spec. - # This may have to be revisited, in case too many - # convenience libraries get linked in and end up exceeding - # the spec. - if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - fi - save_output=$output - output_la=`$echo "X$output" | $Xsed -e "$basename"` - - # Clear the reloadable object creation command queue and - # initialize k to one. - test_cmds= - concat_cmds= - objlist= - delfiles= - last_robj= - k=1 - output=$output_objdir/$output_la-${k}.$objext - # Loop over the list of objects to be linked. - for obj in $save_libobjs - do - eval test_cmds=\"$reload_cmds $objlist $last_robj\" - if test "X$objlist" = X || - { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && - test "$len" -le "$max_cmd_len"; }; then - objlist="$objlist $obj" - else - # The command $test_cmds is almost too long, add a - # command to the queue. - if test "$k" -eq 1 ; then - # The first file doesn't have a previous command to add. - eval concat_cmds=\"$reload_cmds $objlist $last_robj\" - else - # All subsequent reloadable object files will link in - # the last one created. - eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" - fi - last_robj=$output_objdir/$output_la-${k}.$objext - k=`expr $k + 1` - output=$output_objdir/$output_la-${k}.$objext - objlist=$obj - len=1 - fi - done - # Handle the remaining objects by creating one last - # reloadable object file. All subsequent reloadable object - # files will link in the last one created. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" - - if ${skipped_export-false}; then - $show "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $run $rm $export_symbols - libobjs=$output - # Append the command to create the export file. - eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" - fi - - # Set up a command to remove the reloadable object files - # after they are used. - i=0 - while test "$i" -lt "$k" - do - i=`expr $i + 1` - delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" - done - - $echo "creating a temporary reloadable object file: $output" - - # Loop through the commands generated above and execute them. - save_ifs="$IFS"; IFS='~' - for cmd in $concat_cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - libobjs=$output - # Restore the value of output. - output=$save_output - - if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - fi - # Expand the library linking commands again to reset the - # value of $libobjs for piecewise linking. - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - cmds=$module_expsym_cmds - else - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - cmds=$archive_expsym_cmds - else - cmds=$archive_cmds - fi - fi - - # Append the command to remove the reloadable object files - # to the just-reset $cmds. - eval cmds=\"\$cmds~\$rm $delfiles\" - fi - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' - fi - - exit $lt_exit - } - done - IFS="$save_ifs" - - # Restore the uninstalled library and exit - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? - - if test -n "$convenience"; then - if test -z "$whole_archive_flag_spec"; then - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - fi - fi - - exit $EXIT_SUCCESS - fi - - # Create links to the real library. - for linkname in $linknames; do - if test "$realname" != "$linkname"; then - $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" - $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? - fi - done - - # If -module or -export-dynamic was specified, set the dlname. - if test "$module" = yes || test "$export_dynamic" = yes; then - # On all known operating systems, these are identical. - dlname="$soname" - fi - fi - ;; - - obj) - if test -n "$deplibs"; then - $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 - fi - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 - fi - - case $output in - *.lo) - if test -n "$objs$old_deplibs"; then - $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 - exit $EXIT_FAILURE - fi - libobj="$output" - obj=`$echo "X$output" | $Xsed -e "$lo2o"` - ;; - *) - libobj= - obj="$output" - ;; - esac - - # Delete the old objects. - $run $rm $obj $libobj - - # Objects from convenience libraries. This assumes - # single-version convenience libraries. Whenever we create - # different ones for PIC/non-PIC, this we'll have to duplicate - # the extraction. - reload_conv_objs= - gentop= - # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec and hope we can get by with - # turning comma into space.. - wl= - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" - reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` - else - gentop="$output_objdir/${obj}x" - generated="$generated $gentop" - - func_extract_archives $gentop $convenience - reload_conv_objs="$reload_objs $func_extract_archives_result" - fi - fi - - # Create the old-style object. - reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test - - output="$obj" - cmds=$reload_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - # Exit if we aren't doing a library object file. - if test -z "$libobj"; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit $EXIT_SUCCESS - fi - - if test "$build_libtool_libs" != yes; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - # Create an invalid libtool object if no PIC, so that we don't - # accidentally link it into a program. - # $show "echo timestamp > $libobj" - # $run eval "echo timestamp > $libobj" || exit $? - exit $EXIT_SUCCESS - fi - - if test -n "$pic_flag" || test "$pic_mode" != default; then - # Only do commands if we really have different PIC objects. - reload_objs="$libobjs $reload_conv_objs" - output="$libobj" - cmds=$reload_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit $EXIT_SUCCESS - ;; - - prog) - case $host in - *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; - esac - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 - fi - - if test "$preload" = yes; then - if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && - test "$dlopen_self_static" = unknown; then - $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." - fi - fi - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` - finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` - ;; - esac - - case $host in - *darwin*) - # Don't allow lazy linking, it breaks C++ global constructors - if test "$tagname" = CXX ; then - compile_command="$compile_command ${wl}-bind_at_load" - finalize_command="$finalize_command ${wl}-bind_at_load" - fi - ;; - esac - - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $compile_deplibs " in - *" -L$path/$objdir "*) - new_libs="$new_libs -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $compile_deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; - esac - ;; - *) new_libs="$new_libs $deplib" ;; - esac - done - compile_deplibs="$new_libs" - - - compile_command="$compile_command $compile_deplibs" - finalize_command="$finalize_command $finalize_deplibs" - - if test -n "$rpath$xrpath"; then - # If the user specified any rpath flags, then add them. - for libdir in $rpath $xrpath; do - # This is the magic to use -rpath. - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - fi - - # Now hardcode the library paths - rpath= - hardcode_libdirs= - for libdir in $compile_rpath $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$libdir:"*) ;; - *) dllsearchpath="$dllsearchpath:$libdir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - *) dllsearchpath="$dllsearchpath:$testbindir";; - esac - ;; - esac - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - compile_rpath="$rpath" - - rpath= - hardcode_libdirs= - for libdir in $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$finalize_perm_rpath " in - *" $libdir "*) ;; - *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - finalize_rpath="$rpath" - - if test -n "$libobjs" && test "$build_old_libs" = yes; then - # Transform all the library objects into standard objects. - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - fi - - dlsyms= - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - if test -n "$NM" && test -n "$global_symbol_pipe"; then - dlsyms="${outputname}S.c" - else - $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 - fi - fi - - if test -n "$dlsyms"; then - case $dlsyms in - "") ;; - *.c) - # Discover the nlist of each of the dlfiles. - nlist="$output_objdir/${outputname}.nm" - - $show "$rm $nlist ${nlist}S ${nlist}T" - $run $rm "$nlist" "${nlist}S" "${nlist}T" - - # Parse the name list into a source file. - $show "creating $output_objdir/$dlsyms" - - test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ -/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ -/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ - -#ifdef __cplusplus -extern \"C\" { -#endif - -/* Prevent the only kind of declaration conflicts we can make. */ -#define lt_preloaded_symbols some_other_symbol - -/* External symbol declarations for the compiler. */\ -" - - if test "$dlself" = yes; then - $show "generating symbol list for \`$output'" - - test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" - - # Add our own program objects to the symbol list. - progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - for arg in $progfiles; do - $show "extracting global C symbols from \`$arg'" - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -n "$exclude_expsyms"; then - $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - if test -n "$export_symbols_regex"; then - $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - export_symbols="$output_objdir/$outputname.exp" - $run $rm $export_symbols - $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' - case $host in - *cygwin* | *mingw* ) - $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' - ;; - esac - else - $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' - $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' - $run eval 'mv "$nlist"T "$nlist"' - case $host in - *cygwin* | *mingw* ) - $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' - ;; - esac - fi - fi - - for arg in $dlprefiles; do - $show "extracting global C symbols from \`$arg'" - name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` - $run eval '$echo ": $name " >> "$nlist"' - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -z "$run"; then - # Make sure we have at least an empty file. - test -f "$nlist" || : > "$nlist" - - if test -n "$exclude_expsyms"; then - $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T - $mv "$nlist"T "$nlist" - fi - - # Try sorting and uniquifying the output. - if grep -v "^: " < "$nlist" | - if sort -k 3 /dev/null 2>&1; then - sort -k 3 - else - sort +2 - fi | - uniq > "$nlist"S; then - : - else - grep -v "^: " < "$nlist" > "$nlist"S - fi - - if test -f "$nlist"S; then - eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' - else - $echo '/* NONE */' >> "$output_objdir/$dlsyms" - fi - - $echo >> "$output_objdir/$dlsyms" "\ - -#undef lt_preloaded_symbols - -#if defined (__STDC__) && __STDC__ -# define lt_ptr void * -#else -# define lt_ptr char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -" - - case $host in - *cygwin* | *mingw* ) - $echo >> "$output_objdir/$dlsyms" "\ -/* DATA imports from DLLs on WIN32 can't be const, because - runtime relocations are performed -- see ld's documentation - on pseudo-relocs */ -struct { -" - ;; - * ) - $echo >> "$output_objdir/$dlsyms" "\ -const struct { -" - ;; - esac - - - $echo >> "$output_objdir/$dlsyms" "\ - const char *name; - lt_ptr address; -} -lt_preloaded_symbols[] = -{\ -" - - eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" - - $echo >> "$output_objdir/$dlsyms" "\ - {0, (lt_ptr) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif\ -" - fi - - pic_flag_for_symtable= - case $host in - # compiling the symbol table file with pic_flag works around - # a FreeBSD bug that causes programs to crash when -lm is - # linked before any other PIC object. But we must not use - # pic_flag when linking with -static. The problem exists in - # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; - esac;; - *-*-hpux*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag";; - esac - esac - - # Now compile the dynamic symbol file. - $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" - $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? - - # Clean up the generated files. - $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" - $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" - - # Transform the symbol file into the correct name. - case $host in - *cygwin* | *mingw* ) - if test -f "$output_objdir/${outputname}.def" ; then - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` - else - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` - fi - ;; - * ) - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` - ;; - esac - ;; - *) - $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 - exit $EXIT_FAILURE - ;; - esac - else - # We keep going just in case the user didn't refer to - # lt_preloaded_symbols. The linker will fail if global_symbol_pipe - # really was required. - - # Nullify the symbol file. - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` - fi - - if test "$need_relink" = no || test "$build_libtool_libs" != yes; then - # Replace the output file specification. - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP` - link_command="$compile_command$compile_rpath" - - # We have no uninstalled library dependencies, so finalize right now. - $show "$link_command" - $run eval "$link_command" - exit_status=$? - - # Delete the generated files. - if test -n "$dlsyms"; then - $show "$rm $output_objdir/${outputname}S.${objext}" - $run $rm "$output_objdir/${outputname}S.${objext}" - fi - - exit $exit_status - fi - - if test -n "$shlibpath_var"; then - # We should set the shlibpath_var - rpath= - for dir in $temp_rpath; do - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) - # Absolute path. - rpath="$rpath$dir:" - ;; - *) - # Relative path: add a thisdir entry. - rpath="$rpath\$thisdir/$dir:" - ;; - esac - done - temp_rpath="$rpath" - fi - - if test -n "$compile_shlibpath$finalize_shlibpath"; then - compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" - fi - if test -n "$finalize_shlibpath"; then - finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" - fi - - compile_var= - finalize_var= - if test -n "$runpath_var"; then - if test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - compile_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - if test -n "$finalize_perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $finalize_perm_rpath; do - rpath="$rpath$dir:" - done - finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - fi - - if test "$no_install" = yes; then - # We don't need to create a wrapper script. - link_command="$compile_var$compile_command$compile_rpath" - # Replace the output file specification. - link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` - # Delete the old output file. - $run $rm $output - # Link the executable and exit - $show "$link_command" - $run eval "$link_command" || exit $? - exit $EXIT_SUCCESS - fi - - if test "$hardcode_action" = relink; then - # Fast installation is not supported - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - - $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 - $echo "$modename: \`$output' will be relinked during installation" 1>&2 - else - if test "$fast_install" != no; then - link_command="$finalize_var$compile_command$finalize_rpath" - if test "$fast_install" = yes; then - relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP` - else - # fast_install is set to needless - relink_command= - fi - else - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - fi - fi - - # Replace the output file specification. - link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - - # Delete the old output files. - $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname - - $show "$link_command" - $run eval "$link_command" || exit $? - - # Now create the wrapper script. - $show "creating $output" - - # Quote the relink command for shipping. - if test -n "$relink_command"; then - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` - relink_command="$var=\"$var_value\"; export $var; $relink_command" - fi - done - relink_command="(cd `pwd`; $relink_command)" - relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` - fi - - # Quote $echo for shipping. - if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then - case $progpath in - [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; - *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; - esac - qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` - else - qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` - fi - - # Only actually do things if our run command is non-null. - if test -z "$run"; then - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in - *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; - esac - # test for cygwin because mv fails w/o .exe extensions - case $host in - *cygwin*) - exeext=.exe - outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; - *) exeext= ;; - esac - case $host in - *cygwin* | *mingw* ) - output_name=`basename $output` - output_path=`dirname $output` - cwrappersource="$output_path/$objdir/lt-$output_name.c" - cwrapper="$output_path/$output_name.exe" - $rm $cwrappersource $cwrapper - trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 - - cat > $cwrappersource <> $cwrappersource<<"EOF" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if defined(PATH_MAX) -# define LT_PATHMAX PATH_MAX -#elif defined(MAXPATHLEN) -# define LT_PATHMAX MAXPATHLEN -#else -# define LT_PATHMAX 1024 -#endif - -#ifndef DIR_SEPARATOR -# define DIR_SEPARATOR '/' -# define PATH_SEPARATOR ':' -#endif - -#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ - defined (__OS2__) -# define HAVE_DOS_BASED_FILE_SYSTEM -# ifndef DIR_SEPARATOR_2 -# define DIR_SEPARATOR_2 '\\' -# endif -# ifndef PATH_SEPARATOR_2 -# define PATH_SEPARATOR_2 ';' -# endif -#endif - -#ifndef DIR_SEPARATOR_2 -# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) -#else /* DIR_SEPARATOR_2 */ -# define IS_DIR_SEPARATOR(ch) \ - (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) -#endif /* DIR_SEPARATOR_2 */ - -#ifndef PATH_SEPARATOR_2 -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) -#else /* PATH_SEPARATOR_2 */ -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) -#endif /* PATH_SEPARATOR_2 */ - -#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) -#define XFREE(stale) do { \ - if (stale) { free ((void *) stale); stale = 0; } \ -} while (0) - -/* -DDEBUG is fairly common in CFLAGS. */ -#undef DEBUG -#if defined DEBUGWRAPPER -# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) -#else -# define DEBUG(format, ...) -#endif - -const char *program_name = NULL; - -void * xmalloc (size_t num); -char * xstrdup (const char *string); -const char * base_name (const char *name); -char * find_executable(const char *wrapper); -int check_executable(const char *path); -char * strendzap(char *str, const char *pat); -void lt_fatal (const char *message, ...); - -int -main (int argc, char *argv[]) -{ - char **newargz; - int i; - - program_name = (char *) xstrdup (base_name (argv[0])); - DEBUG("(main) argv[0] : %s\n",argv[0]); - DEBUG("(main) program_name : %s\n",program_name); - newargz = XMALLOC(char *, argc+2); -EOF - - cat >> $cwrappersource <> $cwrappersource <<"EOF" - newargz[1] = find_executable(argv[0]); - if (newargz[1] == NULL) - lt_fatal("Couldn't find %s", argv[0]); - DEBUG("(main) found exe at : %s\n",newargz[1]); - /* we know the script has the same name, without the .exe */ - /* so make sure newargz[1] doesn't end in .exe */ - strendzap(newargz[1],".exe"); - for (i = 1; i < argc; i++) - newargz[i+1] = xstrdup(argv[i]); - newargz[argc+1] = NULL; - - for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" - return 127; -} - -void * -xmalloc (size_t num) -{ - void * p = (void *) malloc (num); - if (!p) - lt_fatal ("Memory exhausted"); - - return p; -} - -char * -xstrdup (const char *string) -{ - return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL -; -} - -const char * -base_name (const char *name) -{ - const char *base; - -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - /* Skip over the disk name in MSDOS pathnames. */ - if (isalpha ((unsigned char)name[0]) && name[1] == ':') - name += 2; -#endif - - for (base = name; *name; name++) - if (IS_DIR_SEPARATOR (*name)) - base = name + 1; - return base; -} - -int -check_executable(const char * path) -{ - struct stat st; - - DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); - if ((!path) || (!*path)) - return 0; - - if ((stat (path, &st) >= 0) && - ( - /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ -#if defined (S_IXOTH) - ((st.st_mode & S_IXOTH) == S_IXOTH) || -#endif -#if defined (S_IXGRP) - ((st.st_mode & S_IXGRP) == S_IXGRP) || -#endif - ((st.st_mode & S_IXUSR) == S_IXUSR)) - ) - return 1; - else - return 0; -} - -/* Searches for the full path of the wrapper. Returns - newly allocated full path name if found, NULL otherwise */ -char * -find_executable (const char* wrapper) -{ - int has_slash = 0; - const char* p; - const char* p_next; - /* static buffer for getcwd */ - char tmp[LT_PATHMAX + 1]; - int tmp_len; - char* concat_name; - - DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); - - if ((wrapper == NULL) || (*wrapper == '\0')) - return NULL; - - /* Absolute path? */ -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') - { - concat_name = xstrdup (wrapper); - if (check_executable(concat_name)) - return concat_name; - XFREE(concat_name); - } - else - { -#endif - if (IS_DIR_SEPARATOR (wrapper[0])) - { - concat_name = xstrdup (wrapper); - if (check_executable(concat_name)) - return concat_name; - XFREE(concat_name); - } -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - } -#endif - - for (p = wrapper; *p; p++) - if (*p == '/') - { - has_slash = 1; - break; - } - if (!has_slash) - { - /* no slashes; search PATH */ - const char* path = getenv ("PATH"); - if (path != NULL) - { - for (p = path; *p; p = p_next) - { - const char* q; - size_t p_len; - for (q = p; *q; q++) - if (IS_PATH_SEPARATOR(*q)) - break; - p_len = q - p; - p_next = (*q == '\0' ? q : q + 1); - if (p_len == 0) - { - /* empty path: current directory */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal ("getcwd failed"); - tmp_len = strlen(tmp); - concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - } - else - { - concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); - memcpy (concat_name, p, p_len); - concat_name[p_len] = '/'; - strcpy (concat_name + p_len + 1, wrapper); - } - if (check_executable(concat_name)) - return concat_name; - XFREE(concat_name); - } - } - /* not found in PATH; assume curdir */ - } - /* Relative path | not found in path: prepend cwd */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal ("getcwd failed"); - tmp_len = strlen(tmp); - concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - - if (check_executable(concat_name)) - return concat_name; - XFREE(concat_name); - return NULL; -} - -char * -strendzap(char *str, const char *pat) -{ - size_t len, patlen; - - assert(str != NULL); - assert(pat != NULL); - - len = strlen(str); - patlen = strlen(pat); - - if (patlen <= len) - { - str += len - patlen; - if (strcmp(str, pat) == 0) - *str = '\0'; - } - return str; -} - -static void -lt_error_core (int exit_status, const char * mode, - const char * message, va_list ap) -{ - fprintf (stderr, "%s: %s: ", program_name, mode); - vfprintf (stderr, message, ap); - fprintf (stderr, ".\n"); - - if (exit_status >= 0) - exit (exit_status); -} - -void -lt_fatal (const char *message, ...) -{ - va_list ap; - va_start (ap, message); - lt_error_core (EXIT_FAILURE, "FATAL", message, ap); - va_end (ap); -} -EOF - # we should really use a build-platform specific compiler - # here, but OTOH, the wrappers (shell script and this C one) - # are only useful if you want to execute the "real" binary. - # Since the "real" binary is built for $host, then this - # wrapper might as well be built for $host, too. - $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource - ;; - esac - $rm $output - trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 - - $echo > $output "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# The $output program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='${SED} -e 1s/^X//' -sed_quote_subst='$sed_quote_subst' - -# Be Bourne compatible (taken from Autoconf:_AS_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+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac -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 - -relink_command=\"$relink_command\" - -# This environment variable determines our operation mode. -if test \"\$libtool_install_magic\" = \"$magic\"; then - # install mode needs the following variable: - notinst_deplibs='$notinst_deplibs' -else - # When we are sourced in execute mode, \$file and \$echo are already set. - if test \"\$libtool_execute_magic\" != \"$magic\"; then - echo=\"$qecho\" - file=\"\$0\" - # Make sure echo works. - if test \"X\$1\" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift - elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then - # Yippee, \$echo works! - : - else - # Restart under the correct shell, and then maybe \$echo will work. - exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} - fi - fi\ -" - $echo >> $output "\ - - # Find the directory that this script lives in. - thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` - test \"x\$thisdir\" = \"x\$file\" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` - - # If there was a directory component, then change thisdir. - if test \"x\$destdir\" != \"x\$file\"; then - case \"\$destdir\" in - [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; - *) thisdir=\"\$thisdir/\$destdir\" ;; - esac - fi - - file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` - done - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test "$fast_install" = yes; then - $echo >> $output "\ - program=lt-'$outputname'$exeext - progdir=\"\$thisdir/$objdir\" - - if test ! -f \"\$progdir/\$program\" || \\ - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then - - file=\"\$\$-\$program\" - - if test ! -d \"\$progdir\"; then - $mkdir \"\$progdir\" - else - $rm \"\$progdir/\$file\" - fi" - - $echo >> $output "\ - - # relink executable if necessary - if test -n \"\$relink_command\"; then - if relink_command_output=\`eval \$relink_command 2>&1\`; then : - else - $echo \"\$relink_command_output\" >&2 - $rm \"\$progdir/\$file\" - exit $EXIT_FAILURE - fi - fi - - $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || - { $rm \"\$progdir/\$program\"; - $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } - $rm \"\$progdir/\$file\" - fi" - else - $echo >> $output "\ - program='$outputname' - progdir=\"\$thisdir/$objdir\" -" - fi - - $echo >> $output "\ - - if test -f \"\$progdir/\$program\"; then" - - # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $echo >> $output "\ - # Add our own library path to $shlibpath_var - $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" - - # Some systems cannot cope with colon-terminated $shlibpath_var - # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` - - export $shlibpath_var -" - fi - - # fixup the dll searchpath if we need to. - if test -n "$dllsearchpath"; then - $echo >> $output "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - - $echo >> $output "\ - if test \"\$libtool_execute_magic\" != \"$magic\"; then - # Run the actual program with our arguments. -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2*) - $echo >> $output "\ - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} -" - ;; - - *) - $echo >> $output "\ - exec \"\$progdir/\$program\" \${1+\"\$@\"} -" - ;; - esac - $echo >> $output "\ - \$echo \"\$0: cannot exec \$program \$*\" - exit $EXIT_FAILURE - fi - else - # The program doesn't exist. - \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 - \$echo \"This script is just a wrapper for \$program.\" 1>&2 - $echo \"See the $PACKAGE documentation for more information.\" 1>&2 - exit $EXIT_FAILURE - fi -fi\ -" - chmod +x $output - fi - exit $EXIT_SUCCESS - ;; - esac - - # See if we need to build an old-fashioned archive. - for oldlib in $oldlibs; do - - if test "$build_libtool_libs" = convenience; then - oldobjs="$libobjs_save" - addlibs="$convenience" - build_libtool_libs=no - else - if test "$build_libtool_libs" = module; then - oldobjs="$libobjs_save" - build_libtool_libs=no - else - oldobjs="$old_deplibs $non_pic_objects" - fi - addlibs="$old_convenience" - fi - - if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - func_extract_archives $gentop $addlibs - oldobjs="$oldobjs $func_extract_archives_result" - fi - - # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then - cmds=$old_archive_from_new_cmds - else - # POSIX demands no paths to be encoded in archives. We have - # to avoid creating archives with duplicate basenames if we - # might have to extract them afterwards, e.g., when creating a - # static archive out of a convenience library, or when linking - # the entirety of a libtool archive into another (currently - # not supported by libtool). - if (for obj in $oldobjs - do - $echo "X$obj" | $Xsed -e 's%^.*/%%' - done | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "copying selected object files to avoid basename conflicts..." - - if test -z "$gentop"; then - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - $show "$mkdir $gentop" - $run $mkdir "$gentop" - exit_status=$? - if test "$exit_status" -ne 0 && test ! -d "$gentop"; then - exit $exit_status - fi - fi - - save_oldobjs=$oldobjs - oldobjs= - counter=1 - for obj in $save_oldobjs - do - objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` - case " $oldobjs " in - " ") oldobjs=$obj ;; - *[\ /]"$objbase "*) - while :; do - # Make sure we don't pick an alternate name that also - # overlaps. - newobj=lt$counter-$objbase - counter=`expr $counter + 1` - case " $oldobjs " in - *[\ /]"$newobj "*) ;; - *) if test ! -f "$gentop/$newobj"; then break; fi ;; - esac - done - $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" - $run ln "$obj" "$gentop/$newobj" || - $run cp "$obj" "$gentop/$newobj" - oldobjs="$oldobjs $gentop/$newobj" - ;; - *) oldobjs="$oldobjs $obj" ;; - esac - done - fi - - eval cmds=\"$old_archive_cmds\" - - if len=`expr "X$cmds" : ".*"` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - cmds=$old_archive_cmds - else - # the command line is too long to link in one step, link in parts - $echo "using piecewise archive linking..." - save_RANLIB=$RANLIB - RANLIB=: - objlist= - concat_cmds= - save_oldobjs=$oldobjs - - # Is there a better way of finding the last object in the list? - for obj in $save_oldobjs - do - last_oldobj=$obj - done - for obj in $save_oldobjs - do - oldobjs="$objlist $obj" - objlist="$objlist $obj" - eval test_cmds=\"$old_archive_cmds\" - if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && - test "$len" -le "$max_cmd_len"; then - : - else - # the above command should be used before it gets too long - oldobjs=$objlist - if test "$obj" = "$last_oldobj" ; then - RANLIB=$save_RANLIB - fi - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" - objlist= - fi - done - RANLIB=$save_RANLIB - oldobjs=$objlist - if test "X$oldobjs" = "X" ; then - eval cmds=\"\$concat_cmds\" - else - eval cmds=\"\$concat_cmds~\$old_archive_cmds\" - fi - fi - fi - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - eval cmd=\"$cmd\" - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$generated"; then - $show "${rm}r$generated" - $run ${rm}r$generated - fi - - # Now create the libtool archive. - case $output in - *.la) - old_library= - test "$build_old_libs" = yes && old_library="$libname.$libext" - $show "creating $output" - - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` - relink_command="$var=\"$var_value\"; export $var; $relink_command" - fi - done - # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` - if test "$hardcode_automatic" = yes ; then - relink_command= - fi - - - # Only create the output if not a dry run. - if test -z "$run"; then - for installed in no yes; do - if test "$installed" = yes; then - if test -z "$install_libdir"; then - break - fi - output="$output_objdir/$outputname"i - # Replace all uninstalled libtool libraries with the installed ones - newdependency_libs= - for deplib in $dependency_libs; do - case $deplib in - *.la) - name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - newdependency_libs="$newdependency_libs $libdir/$name" - ;; - *) newdependency_libs="$newdependency_libs $deplib" ;; - esac - done - dependency_libs="$newdependency_libs" - newdlfiles= - for lib in $dlfiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - if test -z "$libdir"; then - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - newdlfiles="$newdlfiles $libdir/$name" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - if test -z "$libdir"; then - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - newdlprefiles="$newdlprefiles $libdir/$name" - done - dlprefiles="$newdlprefiles" - else - newdlfiles= - for lib in $dlfiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - newdlfiles="$newdlfiles $abs" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - newdlprefiles="$newdlprefiles $abs" - done - dlprefiles="$newdlprefiles" - fi - $rm $output - # place dlname in correct position for cygwin - tdlname=$dlname - case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; - esac - $echo > $output "\ -# $outputname - a libtool library file -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# The name that we can dlopen(3). -dlname='$tdlname' - -# Names of this library. -library_names='$library_names' - -# The name of the static archive. -old_library='$old_library' - -# Libraries that this one depends upon. -dependency_libs='$dependency_libs' - -# Version information for $libname. -current=$current -age=$age -revision=$revision - -# Is this an already installed library? -installed=$installed - -# Should we warn about portability when linking against -modules? -shouldnotlink=$module - -# Files to dlopen/dlpreopen -dlopen='$dlfiles' -dlpreopen='$dlprefiles' - -# Directory that this library needs to be installed in: -libdir='$install_libdir'" - if test "$installed" = no && test "$need_relink" = yes; then - $echo >> $output "\ -relink_command=\"$relink_command\"" - fi - done - fi - - # Do a symbolic link so that the libtool archive can be found in - # LD_LIBRARY_PATH before the program is installed. - $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" - $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? - ;; - esac - exit $EXIT_SUCCESS - ;; - - # libtool install mode - install) - modename="$modename: install" - - # There may be an optional sh(1) argument at the beginning of - # install_prog (especially on Windows NT). - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || - # Allow the use of GNU shtool's install command. - $echo "X$nonopt" | grep shtool > /dev/null; then - # Aesthetically quote it. - arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - install_prog="$arg " - arg="$1" - shift - else - install_prog= - arg=$nonopt - fi - - # The real first argument should be the name of the installation program. - # Aesthetically quote it. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog$arg" - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=no - stripme= - for arg - do - if test -n "$dest"; then - files="$files $dest" - dest=$arg - continue - fi - - case $arg in - -d) isdir=yes ;; - -f) - case " $install_prog " in - *[\\\ /]cp\ *) ;; - *) prev=$arg ;; - esac - ;; - -g | -m | -o) prev=$arg ;; - -s) - stripme=" -s" - continue - ;; - -*) - ;; - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - prev= - else - dest=$arg - continue - fi - ;; - esac - - # Aesthetically quote the argument. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog $arg" - done - - if test -z "$install_prog"; then - $echo "$modename: you must specify an install program" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - if test -n "$prev"; then - $echo "$modename: the \`$prev' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - if test -z "$files"; then - if test -z "$dest"; then - $echo "$modename: no file or destination specified" 1>&2 - else - $echo "$modename: you must specify a destination" 1>&2 - fi - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Strip any trailing slash from the destination. - dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` - - # Check to see that the destination is a directory. - test -d "$dest" && isdir=yes - if test "$isdir" = yes; then - destdir="$dest" - destname= - else - destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` - test "X$destdir" = "X$dest" && destdir=. - destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` - - # Not a directory, so check to see that there is only one file specified. - set dummy $files - if test "$#" -gt 2; then - $echo "$modename: \`$dest' is not a directory" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - fi - case $destdir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - for file in $files; do - case $file in - *.lo) ;; - *) - $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - esac - done - ;; - esac - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - staticlibs= - future_libdirs= - current_libdirs= - for file in $files; do - - # Do each installation. - case $file in - *.$libext) - # Do the static libraries later. - staticlibs="$staticlibs $file" - ;; - - *.la) - # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - library_names= - old_library= - relink_command= - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Add the libdir to current_libdirs if it is the destination. - if test "X$destdir" = "X$libdir"; then - case "$current_libdirs " in - *" $libdir "*) ;; - *) current_libdirs="$current_libdirs $libdir" ;; - esac - else - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; - *) future_libdirs="$future_libdirs $libdir" ;; - esac - fi - - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ - test "X$dir" = "X$file/" && dir= - dir="$dir$objdir" - - if test -n "$relink_command"; then - # Determine the prefix the user has applied to our future dir. - inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` - - # Don't allow the user to place us outside of our expected - # location b/c this prevents finding dependent libraries that - # are installed to the same prefix. - # At present, this check doesn't affect windows .dll's that - # are installed into $libdir/../bin (currently, that works fine) - # but it's something to keep an eye on. - if test "$inst_prefix_dir" = "$destdir"; then - $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 - exit $EXIT_FAILURE - fi - - if test -n "$inst_prefix_dir"; then - # Stick the inst_prefix_dir data into the link command. - relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP` - else - relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP` - fi - - $echo "$modename: warning: relinking \`$file'" 1>&2 - $show "$relink_command" - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - exit $EXIT_FAILURE - fi - fi - - # See the names of the shared library. - set dummy $library_names - if test -n "$2"; then - realname="$2" - shift - shift - - srcname="$realname" - test -n "$relink_command" && srcname="$realname"T - - # Install the shared library and build the symlinks. - $show "$install_prog $dir/$srcname $destdir/$realname" - $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? - if test -n "$stripme" && test -n "$striplib"; then - $show "$striplib $destdir/$realname" - $run eval "$striplib $destdir/$realname" || exit $? - fi - - if test "$#" -gt 0; then - # Delete the old symlinks, and create new ones. - # Try `ln -sf' first, because the `ln' binary might depend on - # the symlink we replace! Solaris /bin/ln does not understand -f, - # so we also need to try rm && ln -s. - for linkname - do - if test "$linkname" != "$realname"; then - $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" - $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" - fi - done - fi - - # Do each command in the postinstall commands. - lib="$destdir/$realname" - cmds=$postinstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' - fi - - exit $lt_exit - } - done - IFS="$save_ifs" - fi - - # Install the pseudo-library for information purposes. - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - instname="$dir/$name"i - $show "$install_prog $instname $destdir/$name" - $run eval "$install_prog $instname $destdir/$name" || exit $? - - # Maybe install the static library, too. - test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" - ;; - - *.lo) - # Install (i.e. copy) a libtool object. - - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # Deduce the name of the destination old-style object file. - case $destfile in - *.lo) - staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` - ;; - *.$objext) - staticdest="$destfile" - destfile= - ;; - *) - $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - # Install the libtool object if requested. - if test -n "$destfile"; then - $show "$install_prog $file $destfile" - $run eval "$install_prog $file $destfile" || exit $? - fi - - # Install the old object if enabled. - if test "$build_old_libs" = yes; then - # Deduce the name of the old-style object file. - staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` - - $show "$install_prog $staticobj $staticdest" - $run eval "$install_prog \$staticobj \$staticdest" || exit $? - fi - exit $EXIT_SUCCESS - ;; - - *) - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # If the file is missing, and there is a .exe on the end, strip it - # because it is most likely a libtool script we actually want to - # install - stripped_ext="" - case $file in - *.exe) - if test ! -f "$file"; then - file=`$echo $file|${SED} 's,.exe$,,'` - stripped_ext=".exe" - fi - ;; - esac - - # Do a test to see if this is really a libtool program. - case $host in - *cygwin*|*mingw*) - wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` - ;; - *) - wrapper=$file - ;; - esac - if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then - notinst_deplibs= - relink_command= - - # Note that it is not necessary on cygwin/mingw to append a dot to - # foo even if both foo and FILE.exe exist: automatic-append-.exe - # behavior happens only for exec(3), not for open(2)! Also, sourcing - # `FILE.' does not work on cygwin managed mounts. - # - # If there is no directory component, then add one. - case $wrapper in - */* | *\\*) . ${wrapper} ;; - *) . ./${wrapper} ;; - esac - - # Check the variables that should have been set. - if test -z "$notinst_deplibs"; then - $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 - exit $EXIT_FAILURE - fi - - finalize=yes - for lib in $notinst_deplibs; do - # Check to see that each library is installed. - libdir= - if test -f "$lib"; then - # If there is no directory component, then add one. - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - fi - libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test - if test -n "$libdir" && test ! -f "$libfile"; then - $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 - finalize=no - fi - done - - relink_command= - # Note that it is not necessary on cygwin/mingw to append a dot to - # foo even if both foo and FILE.exe exist: automatic-append-.exe - # behavior happens only for exec(3), not for open(2)! Also, sourcing - # `FILE.' does not work on cygwin managed mounts. - # - # If there is no directory component, then add one. - case $wrapper in - */* | *\\*) . ${wrapper} ;; - *) . ./${wrapper} ;; - esac - - outputname= - if test "$fast_install" = no && test -n "$relink_command"; then - if test "$finalize" = yes && test -z "$run"; then - tmpdir=`func_mktempdir` - file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` - outputname="$tmpdir/$file" - # Replace the output file specification. - relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP` - - $show "$relink_command" - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - ${rm}r "$tmpdir" - continue - fi - file="$outputname" - else - $echo "$modename: warning: cannot relink \`$file'" 1>&2 - fi - else - # Install the binary that we compiled earlier. - file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - # remove .exe since cygwin /usr/bin/install will append another - # one anyway - case $install_prog,$host in - */usr/bin/install*,*cygwin*) - case $file:$destfile in - *.exe:*.exe) - # this is ok - ;; - *.exe:*) - destfile=$destfile.exe - ;; - *:*.exe) - destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` - ;; - esac - ;; - esac - $show "$install_prog$stripme $file $destfile" - $run eval "$install_prog\$stripme \$file \$destfile" || exit $? - test -n "$outputname" && ${rm}r "$tmpdir" - ;; - esac - done - - for file in $staticlibs; do - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - - # Set up the ranlib parameters. - oldlib="$destdir/$name" - - $show "$install_prog $file $oldlib" - $run eval "$install_prog \$file \$oldlib" || exit $? - - if test -n "$stripme" && test -n "$old_striplib"; then - $show "$old_striplib $oldlib" - $run eval "$old_striplib $oldlib" || exit $? - fi - - # Do each command in the postinstall commands. - cmds=$old_postinstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$future_libdirs"; then - $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 - fi - - if test -n "$current_libdirs"; then - # Maybe just do a dry run. - test -n "$run" && current_libdirs=" -n$current_libdirs" - exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' - else - exit $EXIT_SUCCESS - fi - ;; - - # libtool finish mode - finish) - modename="$modename: finish" - libdirs="$nonopt" - admincmds= - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for dir - do - libdirs="$libdirs $dir" - done - - for libdir in $libdirs; do - if test -n "$finish_cmds"; then - # Do each command in the finish commands. - cmds=$finish_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || admincmds="$admincmds - $cmd" - done - IFS="$save_ifs" - fi - if test -n "$finish_eval"; then - # Do the single finish_eval. - eval cmds=\"$finish_eval\" - $run eval "$cmds" || admincmds="$admincmds - $cmds" - fi - done - fi - - # Exit here if they wanted silent mode. - test "$show" = : && exit $EXIT_SUCCESS - - $echo "X----------------------------------------------------------------------" | $Xsed - $echo "Libraries have been installed in:" - for libdir in $libdirs; do - $echo " $libdir" - done - $echo - $echo "If you ever happen to want to link against installed libraries" - $echo "in a given directory, LIBDIR, you must either use libtool, and" - $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" - $echo "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" - $echo " during execution" - fi - if test -n "$runpath_var"; then - $echo " - add LIBDIR to the \`$runpath_var' environment variable" - $echo " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" - - $echo " - use the \`$flag' linker flag" - fi - if test -n "$admincmds"; then - $echo " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" - fi - $echo - $echo "See any operating system documentation about shared libraries for" - $echo "more information, such as the ld(1) and ld.so(8) manual pages." - $echo "X----------------------------------------------------------------------" | $Xsed - exit $EXIT_SUCCESS - ;; - - # libtool execute mode - execute) - modename="$modename: execute" - - # The first argument is the command name. - cmd="$nonopt" - if test -z "$cmd"; then - $echo "$modename: you must specify a COMMAND" 1>&2 - $echo "$help" - exit $EXIT_FAILURE - fi - - # Handle -dlopen flags immediately. - for file in $execute_dlfiles; do - if test ! -f "$file"; then - $echo "$modename: \`$file' is not a file" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - dir= - case $file in - *.la) - # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Read the libtool library. - dlname= - library_names= - - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Skip this library if it cannot be dlopened. - if test -z "$dlname"; then - # Warn if it was a shared library. - test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" - continue - fi - - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - - if test -f "$dir/$objdir/$dlname"; then - dir="$dir/$objdir" - else - $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 - exit $EXIT_FAILURE - fi - ;; - - *.lo) - # Just add the directory containing the .lo file. - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - ;; - - *) - $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 - continue - ;; - esac - - # Get the absolute pathname. - absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir="$absdir" - - # Now add the directory to shlibpath_var. - if eval "test -z \"\$$shlibpath_var\""; then - eval "$shlibpath_var=\"\$dir\"" - else - eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" - fi - done - - # This variable tells wrapper scripts just to set shlibpath_var - # rather than running their programs. - libtool_execute_magic="$magic" - - # Check if any of the arguments is a wrapper script. - args= - for file - do - case $file in - -*) ;; - *) - # Do a test to see if this is really a libtool program. - if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Transform arg to wrapped name. - file="$progdir/$program" - fi - ;; - esac - # Quote arguments (to preserve shell metacharacters). - file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` - args="$args \"$file\"" - done - - if test -z "$run"; then - if test -n "$shlibpath_var"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" - fi - - # Restore saved environment variables - for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES - do - eval "if test \"\${save_$lt_var+set}\" = set; then - $lt_var=\$save_$lt_var; export $lt_var - else - $lt_unset $lt_var - fi" - done - - - # Now prepare to actually exec the command. - exec_cmd="\$cmd$args" - else - # Display what would be done. - if test -n "$shlibpath_var"; then - eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" - $echo "export $shlibpath_var" - fi - $echo "$cmd$args" - exit $EXIT_SUCCESS - fi - ;; - - # libtool clean and uninstall mode - clean | uninstall) - modename="$modename: $mode" - rm="$nonopt" - files= - rmforce= - exit_status=0 - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - for arg - do - case $arg in - -f) rm="$rm $arg"; rmforce=yes ;; - -*) rm="$rm $arg" ;; - *) files="$files $arg" ;; - esac - done - - if test -z "$rm"; then - $echo "$modename: you must specify an RM program" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - rmdirs= - - origobjdir="$objdir" - for file in $files; do - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - if test "X$dir" = "X$file"; then - dir=. - objdir="$origobjdir" - else - objdir="$dir/$origobjdir" - fi - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - test "$mode" = uninstall && objdir="$dir" - - # Remember objdir for removal later, being careful to avoid duplicates - if test "$mode" = clean; then - case " $rmdirs " in - *" $objdir "*) ;; - *) rmdirs="$rmdirs $objdir" ;; - esac - fi - - # Don't error if the file doesn't exist and rm -f was used. - if (test -L "$file") >/dev/null 2>&1 \ - || (test -h "$file") >/dev/null 2>&1 \ - || test -f "$file"; then - : - elif test -d "$file"; then - exit_status=1 - continue - elif test "$rmforce" = yes; then - continue - fi - - rmfiles="$file" - - case $name in - *.la) - # Possibly a libtool archive, so verify it. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - . $dir/$name - - # Delete the libtool libraries and symlinks. - for n in $library_names; do - rmfiles="$rmfiles $objdir/$n" - done - test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" - - case "$mode" in - clean) - case " $library_names " in - # " " in the beginning catches empty $dlname - *" $dlname "*) ;; - *) rmfiles="$rmfiles $objdir/$dlname" ;; - esac - test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" - ;; - uninstall) - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - cmds=$postuninstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" - if test "$?" -ne 0 && test "$rmforce" != yes; then - exit_status=1 - fi - done - IFS="$save_ifs" - fi - - if test -n "$old_library"; then - # Do each command in the old_postuninstall commands. - cmds=$old_postuninstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" - if test "$?" -ne 0 && test "$rmforce" != yes; then - exit_status=1 - fi - done - IFS="$save_ifs" - fi - # FIXME: should reinstall the best remaining shared library. - ;; - esac - fi - ;; - - *.lo) - # Possibly a libtool object, so verify it. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - - # Read the .lo file - . $dir/$name - - # Add PIC object to the list of files to remove. - if test -n "$pic_object" \ - && test "$pic_object" != none; then - rmfiles="$rmfiles $dir/$pic_object" - fi - - # Add non-PIC object to the list of files to remove. - if test -n "$non_pic_object" \ - && test "$non_pic_object" != none; then - rmfiles="$rmfiles $dir/$non_pic_object" - fi - fi - ;; - - *) - if test "$mode" = clean ; then - noexename=$name - case $file in - *.exe) - file=`$echo $file|${SED} 's,.exe$,,'` - noexename=`$echo $name|${SED} 's,.exe$,,'` - # $file with .exe has already been added to rmfiles, - # add $file without .exe - rmfiles="$rmfiles $file" - ;; - esac - # Do a test to see if this is a libtool program. - if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - relink_command= - . $dir/$noexename - - # note $name still contains .exe if it was in $file originally - # as does the version of $file that was added into $rmfiles - rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" - if test "$fast_install" = yes && test -n "$relink_command"; then - rmfiles="$rmfiles $objdir/lt-$name" - fi - if test "X$noexename" != "X$name" ; then - rmfiles="$rmfiles $objdir/lt-${noexename}.c" - fi - fi - fi - ;; - esac - $show "$rm $rmfiles" - $run $rm $rmfiles || exit_status=1 - done - objdir="$origobjdir" - - # Try to remove the ${objdir}s in the directories where we deleted files - for dir in $rmdirs; do - if test -d "$dir"; then - $show "rmdir $dir" - $run rmdir $dir >/dev/null 2>&1 - fi - done - - exit $exit_status - ;; - - "") - $echo "$modename: you must specify a MODE" 1>&2 - $echo "$generic_help" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - if test -z "$exec_cmd"; then - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$generic_help" 1>&2 - exit $EXIT_FAILURE - fi -fi # test -z "$show_help" - -if test -n "$exec_cmd"; then - eval exec $exec_cmd - exit $EXIT_FAILURE -fi - -# We need to display help for each of the modes. -case $mode in -"") $echo \ -"Usage: $modename [OPTION]... [MODE-ARG]... - -Provide generalized library-building support services. - - --config show all configuration variables - --debug enable verbose shell tracing --n, --dry-run display commands without modifying any files - --features display basic configuration information and exit - --finish same as \`--mode=finish' - --help display this help message and exit - --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] - --quiet same as \`--silent' - --silent don't print informational messages - --tag=TAG use configuration variables from tag TAG - --version print version information - -MODE must be one of the following: - - clean remove files from the build directory - compile compile a source file into a libtool object - execute automatically set library path, then run a program - finish complete the installation of libtool libraries - install install libraries or executables - link create a library or an executable - uninstall remove libraries from an installed directory - -MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for -a more detailed description of MODE. - -Report bugs to ." - exit $EXIT_SUCCESS - ;; - -clean) - $echo \ -"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... - -Remove files from the build directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, object or program, all the files associated -with it are deleted. Otherwise, only FILE itself is deleted using RM." - ;; - -compile) - $echo \ -"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE - -Compile a source file into a libtool library object. - -This mode accepts the following additional options: - - -o OUTPUT-FILE set the output file name to OUTPUT-FILE - -prefer-pic try to building PIC objects only - -prefer-non-pic try to building non-PIC objects only - -static always build a \`.o' file suitable for static linking - -COMPILE-COMMAND is a command to be used in creating a \`standard' object file -from the given SOURCEFILE. - -The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix \`.c' with the -library object suffix, \`.lo'." - ;; - -execute) - $echo \ -"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... - -Automatically set library path, then run a program. - -This mode accepts the following additional options: - - -dlopen FILE add the directory containing FILE to the library path - -This mode sets the library path environment variable according to \`-dlopen' -flags. - -If any of the ARGS are libtool executable wrappers, then they are translated -into their corresponding uninstalled binary, and any of their required library -directories are added to the library path. - -Then, COMMAND is executed, with ARGS as arguments." - ;; - -finish) - $echo \ -"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... - -Complete the installation of libtool libraries. - -Each LIBDIR is a directory that contains libtool libraries. - -The commands that this mode executes may require superuser privileges. Use -the \`--dry-run' option if you just want to see what would be executed." - ;; - -install) - $echo \ -"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... - -Install executables or libraries. - -INSTALL-COMMAND is the installation command. The first component should be -either the \`install' or \`cp' program. - -The rest of the components are interpreted as arguments to that command (only -BSD-compatible install options are recognized)." - ;; - -link) - $echo \ -"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... - -Link object files or libraries together to form another library, or to -create an executable program. - -LINK-COMMAND is a command using the C compiler that you would use to create -a program from several object files. - -The following components of LINK-COMMAND are treated specially: - - -all-static do not do any dynamic linking at all - -avoid-version do not add a version suffix if possible - -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) - -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE - -export-symbols-regex REGEX - try to export only the symbols matching REGEX - -LLIBDIR search LIBDIR for required installed libraries - -lNAME OUTPUT-FILE requires the installed library libNAME - -module build a library that can dlopened - -no-fast-install disable the fast-install mode - -no-install link a not-installable executable - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -objectlist FILE Use a list of object files found in FILE to specify objects - -precious-files-regex REGEX - don't remove output files matching REGEX - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -static do not do any dynamic linking of uninstalled libtool libraries - -static-libtool-libs - do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] - -All other options (arguments beginning with \`-') are ignored. - -Every other argument is treated as a filename. Files ending in \`.la' are -treated as uninstalled libtool libraries, other files are standard or library -object files. - -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, -only library objects (\`.lo' files) may be specified, and \`-rpath' is -required, except when creating a convenience library. - -If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created -using \`ar' and \`ranlib', or on Windows using \`lib'. - -If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file -is created, otherwise an executable program is created." - ;; - -uninstall) - $echo \ -"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... - -Remove libraries from an installation directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, all the files associated with it are deleted. -Otherwise, only FILE itself is deleted using RM." - ;; - -*) - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; -esac - -$echo -$echo "Try \`$modename --help' for more information about other modes." - -exit $? - -# The TAGs below are defined such that we never get into a situation -# in which we disable both kinds of libraries. Given conflicting -# choices, we go for a static library, that is the most portable, -# since we can't tell whether shared libraries were disabled because -# the user asked for that or because the platform doesn't support -# them. This is particularly important on AIX, because we don't -# support having both static and shared libraries enabled at the same -# time on that platform, so we default to a shared-only configuration. -# If a disable-shared tag is given, we'll fallback to a static-only -# configuration. But we'll never go from static-only to shared-only. - -# ### BEGIN LIBTOOL TAG CONFIG: disable-shared -disable_libs=shared -# ### END LIBTOOL TAG CONFIG: disable-shared - -# ### BEGIN LIBTOOL TAG CONFIG: disable-static -disable_libs=static -# ### END LIBTOOL TAG CONFIG: disable-static - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/Makefile.am open-iscsi-2.0.874/iscsiuio/Makefile.am --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/Makefile.am 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/Makefile.am 2016-09-29 18:33:24.000000000 +0000 @@ -3,7 +3,11 @@ EXTRA_DIST = build_date build_date: - echo 'char *build_date = "'`date`'";' > build_date.c + if [ -n "$$SOURCE_DATE_EPOCH" ] ; then \ + echo 'char *build_date = "'`LC_ALL=C.UTF-8 date --date=@$$SOURCE_DATE_EPOCH -u`'";' > build_date.c ; \ + else \ + echo 'char *build_date = "'`date`'";' > build_date.c ; \ + fi echo 'char *build_date;'> build_date.h manprefix = /usr/share diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/Makefile.in open-iscsi-2.0.874/iscsiuio/Makefile.in --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/Makefile.in 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,629 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = . -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(srcdir)/config.h.in \ - $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ - TODO compile config.guess config.sub depcomp install-sh \ - ltmain.sh missing -subdir = . -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ - configure.lineno configure.status.lineno -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-exec-recursive install-info-recursive \ - install-recursive installcheck-recursive installdirs-recursive \ - pdf-recursive ps-recursive uninstall-info-recursive \ - uninstall-recursive -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -distdir = $(PACKAGE)-$(VERSION) -top_distdir = $(distdir) -am__remove_distdir = \ - { test ! -d $(distdir) \ - || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr $(distdir); }; } -DIST_ARCHIVES = $(distdir).tar.gz -GZIP_ENV = --best -distuninstallcheck_listfiles = find . -type f -print -distcleancheck_listfiles = find . -type f -print -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BASH = @BASH@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ENDIAN = @ENDIAN@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = ${manprefix}/man -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -SUBDIRS = src -EXTRA_DIST = build_date -manprefix = /usr/share -logdir = /etc/logrotate.d -all: config.h - $(MAKE) $(AM_MAKEFLAGS) all-recursive - -.SUFFIXES: -am--refresh: - @: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ - cd $(srcdir) && $(AUTOMAKE) --gnu \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - echo ' $(SHELL) ./config.status'; \ - $(SHELL) ./config.status;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - $(SHELL) ./config.status --recheck - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) - -config.h: stamp-h1 - @if test ! -f $@; then \ - rm -f stamp-h1; \ - $(MAKE) stamp-h1; \ - else :; fi - -stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status - @rm -f stamp-h1 - cd $(top_builddir) && $(SHELL) ./config.status config.h -$(srcdir)/config.h.in: $(am__configure_deps) - cd $(top_srcdir) && $(AUTOHEADER) - rm -f stamp-h1 - touch $@ - -distclean-hdr: - -rm -f config.h stamp-h1 - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - $(am__remove_distdir) - mkdir $(distdir) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done - list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(mkdir_p) "$(distdir)/$$subdir" \ - || exit 1; \ - distdir=`$(am__cd) $(distdir) && pwd`; \ - top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ - (cd $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$top_distdir" \ - distdir="$$distdir/$$subdir" \ - distdir) \ - || exit 1; \ - fi; \ - done - -find $(distdir) -type d ! -perm -755 -exec chmod a+rwx,go+rx {} \; -o \ - ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ - || chmod -R a+r $(distdir) -dist-gzip: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) - -dist-bzip2: distdir - tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 - $(am__remove_distdir) - -dist-tarZ: distdir - tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__remove_distdir) - -dist-shar: distdir - shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz - $(am__remove_distdir) - -dist-zip: distdir - -rm -f $(distdir).zip - zip -rq $(distdir).zip $(distdir) - $(am__remove_distdir) - -dist dist-all: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) - -# This target untars the dist file and tries a VPATH configuration. Then -# it guarantees that the distribution is self-contained by making another -# tarfile. -distcheck: dist - case '$(DIST_ARCHIVES)' in \ - *.tar.gz*) \ - GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ - *.tar.bz2*) \ - bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.Z*) \ - uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ - *.shar.gz*) \ - GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ - *.zip*) \ - unzip $(distdir).zip ;;\ - esac - chmod -R a-w $(distdir); chmod a+w $(distdir) - mkdir $(distdir)/_build - mkdir $(distdir)/_inst - chmod a-w $(distdir) - dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ - && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ - && cd $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ - $(DISTCHECK_CONFIGURE_FLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ - && $(MAKE) $(AM_MAKEFLAGS) check \ - && $(MAKE) $(AM_MAKEFLAGS) install \ - && $(MAKE) $(AM_MAKEFLAGS) installcheck \ - && $(MAKE) $(AM_MAKEFLAGS) uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ - distuninstallcheck \ - && chmod -R a-w "$$dc_install_base" \ - && ({ \ - (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ - distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ - } || { rm -rf "$$dc_destdir"; exit 1; }) \ - && rm -rf "$$dc_destdir" \ - && $(MAKE) $(AM_MAKEFLAGS) dist \ - && rm -rf $(DIST_ARCHIVES) \ - && $(MAKE) $(AM_MAKEFLAGS) distcleancheck - $(am__remove_distdir) - @(echo "$(distdir) archives ready for distribution: "; \ - list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ - sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' -distuninstallcheck: - @cd $(distuninstallcheck_dir) \ - && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ - || { echo "ERROR: files left after uninstall:" ; \ - if test -n "$(DESTDIR)"; then \ - echo " (check DESTDIR support)"; \ - fi ; \ - $(distuninstallcheck_listfiles) ; \ - exit 1; } >&2 -distcleancheck: distclean - @if test '$(srcdir)' = . ; then \ - echo "ERROR: distcleancheck can only run from a VPATH build" ; \ - exit 1 ; \ - fi - @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ - || { echo "ERROR: files left in build directory after distclean:" ; \ - $(distcleancheck_listfiles) ; \ - exit 1; } >&2 -check-am: all-am -check: check-recursive -all-am: Makefile config.h -installdirs: installdirs-recursive -installdirs-am: -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -installcheck: installcheck-recursive -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-recursive - -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-hdr \ - distclean-libtool distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -info: info-recursive - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-recursive - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf $(top_srcdir)/autom4te.cache - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: uninstall-info-am - -uninstall-info: uninstall-info-recursive - -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ - check-am clean clean-generic clean-libtool clean-recursive \ - ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ - dist-shar dist-tarZ dist-zip distcheck distclean \ - distclean-generic distclean-hdr distclean-libtool \ - distclean-recursive distclean-tags distcleancheck distdir \ - distuninstallcheck dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - maintainer-clean-recursive mostlyclean mostlyclean-generic \ - mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \ - tags tags-recursive uninstall uninstall-am uninstall-info-am - - -build_date: - echo 'char *build_date = "'`date`'";' > build_date.c - echo 'char *build_date;'> build_date.h - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install-man install-log install-brcm - -install-man: - cat docs/iscsiuio.8 | GZIP=$(GZIP_ENV) gzip -c > iscsiuio.8.gz - $(INSTALL_PROGRAM) iscsiuio.8.gz $(mandir)/man8 - -install-log: - $(INSTALL_PROGRAM) iscsiuiolog $(logdir) - -install-brcm: - -rm -f $(sbindir)/brcm_iscsiuio - -ln -s $(sbindir)/iscsiuio $(sbindir)/brcm_iscsiuio -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/missing open-iscsi-2.0.874/iscsiuio/missing --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/missing 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/missing 1970-01-01 00:00:00.000000000 +0000 @@ -1,367 +0,0 @@ -#! /bin/sh -# Common stub for a few missing GNU programs while installing. - -scriptversion=2006-05-10.23 - -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 -# Free Software Foundation, Inc. -# Originally by Fran,cois Pinard , 1996. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 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. - -if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 -fi - -run=: -sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' -sed_minuso='s/.* -o \([^ ]*\).*/\1/p' - -# In the cases where this matters, `missing' is being run in the -# srcdir already. -if test -f configure.ac; then - configure_ac=configure.ac -else - configure_ac=configure.in -fi - -msg="missing on your system" - -case $1 in ---run) - # Try to run requested program, and just exit if it succeeds. - run= - shift - "$@" && exit 0 - # Exit code 63 means version mismatch. This often happens - # when the user try to use an ancient version of a tool on - # a file that requires a minimum version. In this case we - # we should proceed has if the program had been absent, or - # if --run hadn't been passed. - if test $? = 63; then - run=: - msg="probably too old" - fi - ;; - - -h|--h|--he|--hel|--help) - echo "\ -$0 [OPTION]... PROGRAM [ARGUMENT]... - -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an -error status if there is no known handling for PROGRAM. - -Options: - -h, --help display this help and exit - -v, --version output version information and exit - --run try to run the given command, and emulate it if it fails - -Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - autom4te touch the output file, or create a stub one - automake touch all \`Makefile.in' files - bison create \`y.tab.[ch]', if possible, from existing .[ch] - flex create \`lex.yy.c', if possible, from existing .c - help2man touch the output file - lex create \`lex.yy.c', if possible, from existing .c - makeinfo touch the output file - tar try tar, gnutar, gtar, then tar without non-portable flags - yacc create \`y.tab.[ch]', if possible, from existing .[ch] - -Send bug reports to ." - exit $? - ;; - - -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing $scriptversion (GNU Automake)" - exit $? - ;; - - -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 - ;; - -esac - -# Now exit if we have it, but it failed. Also exit now if we -# don't have it and --version was passed (most likely to detect -# the program). -case $1 in - lex|yacc) - # Not GNU programs, they don't have --version. - ;; - - tar) - if test -n "$run"; then - echo 1>&2 "ERROR: \`tar' requires --run" - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - exit 1 - fi - ;; - - *) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - # Could not run --version or --help. This is probably someone - # running `$TOOL --version' or `$TOOL --help' to check whether - # $TOOL exists and not knowing $TOOL uses missing. - exit 1 - fi - ;; -esac - -# If it does not exist, or fails to run (possibly an outdated version), -# try to emulate it. -case $1 in - aclocal*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acinclude.m4' or \`${configure_ac}'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from - any GNU archive site." - touch aclocal.m4 - ;; - - autoconf) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`${configure_ac}'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU - archive site." - touch configure - ;; - - autoheader) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acconfig.h' or \`${configure_ac}'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them - from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` - test -z "$files" && files="config.h" - touch_files= - for f in $files; do - case $f in - *:*) touch_files="$touch_files "`echo "$f" | - sed -e 's/^[^:]*://' -e 's/:.*//'`;; - *) touch_files="$touch_files $f.in";; - esac - done - touch $touch_files - ;; - - automake*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. - You might want to install the \`Automake' and \`Perl' packages. - Grab them from any GNU archive site." - find . -type f -name Makefile.am -print | - sed 's/\.am$/.in/' | - while read f; do touch "$f"; done - ;; - - autom4te) - echo 1>&2 "\ -WARNING: \`$1' is needed, but is $msg. - You might have modified some files without having the - proper tools for further handling them. - You can get \`$1' as part of \`Autoconf' from any GNU - archive site." - - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo "#! /bin/sh" - echo "# Created by GNU Automake missing as a replacement of" - echo "# $ $@" - echo "exit 0" - chmod +x $file - exit 1 - fi - ;; - - bison|yacc) - echo 1>&2 "\ -WARNING: \`$1' $msg. You should only need it if - you modified a \`.y' file. You may need the \`Bison' package - in order for those modifications to take effect. You can get - \`Bison' from any GNU archive site." - rm -f y.tab.c y.tab.h - if test $# -ne 1; then - eval LASTARG="\${$#}" - case $LASTARG in - *.y) - SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" y.tab.c - fi - SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" y.tab.h - fi - ;; - esac - fi - if test ! -f y.tab.h; then - echo >y.tab.h - fi - if test ! -f y.tab.c; then - echo 'main() { return 0; }' >y.tab.c - fi - ;; - - lex|flex) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.l' file. You may need the \`Flex' package - in order for those modifications to take effect. You can get - \`Flex' from any GNU archive site." - rm -f lex.yy.c - if test $# -ne 1; then - eval LASTARG="\${$#}" - case $LASTARG in - *.l) - SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" lex.yy.c - fi - ;; - esac - fi - if test ! -f lex.yy.c; then - echo 'main() { return 0; }' >lex.yy.c - fi - ;; - - help2man) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a dependency of a manual page. You may need the - \`Help2man' package in order for those modifications to take - effect. You can get \`Help2man' from any GNU archive site." - - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo ".ab help2man is required to generate this page" - exit 1 - fi - ;; - - makeinfo) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.texi' or \`.texinfo' file, or any other file - indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." - # The file to touch is that specified with -o ... - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -z "$file"; then - # ... or it is the one specified with @setfilename ... - infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n ' - /^@setfilename/{ - s/.* \([^ ]*\) *$/\1/ - p - q - }' $infile` - # ... or it is derived from the source name (dir/f.texi becomes f.info) - test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info - fi - # If the file does not exist, the user really needs makeinfo; - # let's fail without touching anything. - test -f $file || exit 1 - touch $file - ;; - - tar) - shift - - # We have already tried tar in the generic part. - # Look for gnutar/gtar before invocation to avoid ugly error - # messages. - if (gnutar --version > /dev/null 2>&1); then - gnutar "$@" && exit 0 - fi - if (gtar --version > /dev/null 2>&1); then - gtar "$@" && exit 0 - fi - firstarg="$1" - if shift; then - case $firstarg in - *o*) - firstarg=`echo "$firstarg" | sed s/o//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - case $firstarg in - *h*) - firstarg=`echo "$firstarg" | sed s/h//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - fi - - echo 1>&2 "\ -WARNING: I can't seem to be able to run \`tar' with the given arguments. - You may want to install GNU tar or Free paxutils, or check the - command line arguments." - exit 1 - ;; - - *) - echo 1>&2 "\ -WARNING: \`$1' is needed, and is $msg. - You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, - it often tells you about the needed prerequisites for installing - this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." - exit 1 - ;; -esac - -exit 0 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/README open-iscsi-2.0.874/iscsiuio/README --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/README 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/README 2016-09-29 18:33:24.000000000 +0000 @@ -1,13 +1,13 @@ Iscsiuio Userspace Tool -Version 0.7.8.1b -May 01, 2013 +Version 0.7.8.2 +Dec 10, 2013 ------------------------------------------------------ -This tool is to be used in conjunction with the Broadcom NetXtreme II Linux -driver (Kernel module name: 'bnx2' and 'bnx2x'), Broadcom CNIC driver, -and the Broadcom iSCSI driver (Kernel module name: 'bnx2i'). +This tool is to be used in conjunction with the QLogic NetXtreme II Linux +driver (Kernel module name: 'bnx2' and 'bnx2x'), QLogic CNIC driver, +and the QLogic iSCSI driver (Kernel module name: 'bnx2i'). This user space tool is used in conjunction with the following -Broadcom Network Controllers: +QLogic Network Controllers: bnx2: BCM5706, BCM5708, BCM5709 devices bnx2x: BCM57710, BCM57711, BCM57711E, BCM57712, BCM57712E, BCM57800, BCM57810, BCM57840 devices @@ -25,8 +25,8 @@ ======================================= Linux Kernel Dependencies: -1. Broadcom CNIC driver (cnic) -1. Broadcom iSCSI offload driver (bnx2i) +1. QLogic CNIC driver (cnic) +1. QLogic iSCSI offload driver (bnx2i) 2. Userspace I/O driver (uio) Directory Structure of this Package: diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/RELEASE.TXT open-iscsi-2.0.874/iscsiuio/RELEASE.TXT --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/RELEASE.TXT 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/RELEASE.TXT 2016-09-29 18:33:24.000000000 +0000 @@ -1,15 +1,48 @@ Release Notes - Broadcom uIP Linux Driver - Version 0.7.8.1b - 05/01/2013 - - Broadcom Corporation - 5300 California Avenue, - Irvine, CA 92617 + QLogic uIP Linux Driver + Version 0.7.8.2 + 12/10/2013 + + QLogic Corporation + 26650 Aliso Viejo Pkwy, + Aliso Viejo, CA 92656 Copyright (c) 2004 - 2013 Broadcom Corporation + Copyright (c) 2014, QLogic Corporation All rights reserved +uIP v0.7.10.2 (Feb 12, 2014) +======================================================= + Fixes + ----- + 1. Problem: Cont00072504 - ifconfig shows allocation failure after + up/down few hours with iSCSI + L2 traffic + Cause: A memory leak was discovered in the ongoing pthread creation + destruction code during the connection recovery process + Change: Fixed the pthread creation code + Impact: All + + +uIP v0.7.8.2 (Dec 10, 2013) +======================================================= + Fixes + ----- + 1. Problem: Cont00072053 - Some hardware iSCSI paths fail during test + Cause: The test exercised a corner case where the ARP cache flush + mechanism didn't work properly + Change: Fixed the ARP cache flush mechanism + Impact: All + + Enhancements + ------------ + 1. Change: Added a new tx doorbell field in the uio path to work with + the new bnx2x/cnic drivers that supports VF_RSS + Impact: 10G only + + 2. Change: Fixed the iface.subnet_mask decoding for IPv6 + Impact: IPv6 + + uIP v0.7.8.1b (May 01, 2013) ======================================================= Enhancements diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/apps/brcm-iscsi/brcm_iscsi.c open-iscsi-2.0.874/iscsiuio/src/apps/brcm-iscsi/brcm_iscsi.c --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/apps/brcm-iscsi/brcm_iscsi.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/apps/brcm-iscsi/brcm_iscsi.c 2016-09-29 18:33:24.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2009-2011, Broadcom Corporation + * Copyright (c) 2014, QLogic Corporation * * Written by: Benjamin Li * Based on code example from Adam Dunkels diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/apps/brcm-iscsi/brcm_iscsi.h open-iscsi-2.0.874/iscsiuio/src/apps/brcm-iscsi/brcm_iscsi.h --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/apps/brcm-iscsi/brcm_iscsi.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/apps/brcm-iscsi/brcm_iscsi.h 2016-09-29 18:33:24.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2009-2011, Broadcom Corporation + * Copyright (c) 2014, QLogic Corporation * * Written by: Benjamin Li * Based on code example from Adam Dunkels diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/apps/brcm-iscsi/Makefile.am open-iscsi-2.0.874/iscsiuio/src/apps/brcm-iscsi/Makefile.am --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/apps/brcm-iscsi/Makefile.am 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/apps/brcm-iscsi/Makefile.am 2016-09-29 18:33:24.000000000 +0000 @@ -1,4 +1,4 @@ -INCLUDES = -I${top_srcdir}/src/unix \ +AM_CFLAGS = -I${top_srcdir}/src/unix \ -I${top_srcdir}/src/uip \ -I${top_srcdir}/src/apps/dhcpc \ -I${top_srcdir}/src/apps/brcm-iscsi \ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/apps/brcm-iscsi/Makefile.in open-iscsi-2.0.874/iscsiuio/src/apps/brcm-iscsi/Makefile.in --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/apps/brcm-iscsi/Makefile.in 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/apps/brcm-iscsi/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,446 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../.. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = src/apps/brcm-iscsi -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) -ARFLAGS = cru -lib_apps_brcm_iscsi_a_AR = $(AR) $(ARFLAGS) -lib_apps_brcm_iscsi_a_LIBADD = -am_lib_apps_brcm_iscsi_a_OBJECTS = \ - lib_apps_brcm_iscsi_a-brcm_iscsi.$(OBJEXT) -lib_apps_brcm_iscsi_a_OBJECTS = $(am_lib_apps_brcm_iscsi_a_OBJECTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(lib_apps_brcm_iscsi_a_SOURCES) -DIST_SOURCES = $(lib_apps_brcm_iscsi_a_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BASH = @BASH@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ENDIAN = @ENDIAN@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -INCLUDES = -I${top_srcdir}/src/unix \ - -I${top_srcdir}/src/uip \ - -I${top_srcdir}/src/apps/dhcpc \ - -I${top_srcdir}/src/apps/brcm-iscsi \ - -I${top_srcdir}/../include \ - -I${top_srcdir}/../usr - -noinst_LIBRARIES = lib_apps_brcm_iscsi.a -lib_apps_brcm_iscsi_a_SOURCES = brcm_iscsi.c -lib_apps_brcm_iscsi_a_CFLAGS = $(AM_CFLAGS) \ - -DBYTE_ORDER=@ENDIAN@ - -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/apps/brcm-iscsi/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/apps/brcm-iscsi/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) -lib_apps_brcm_iscsi.a: $(lib_apps_brcm_iscsi_a_OBJECTS) $(lib_apps_brcm_iscsi_a_DEPENDENCIES) - -rm -f lib_apps_brcm_iscsi.a - $(lib_apps_brcm_iscsi_a_AR) lib_apps_brcm_iscsi.a $(lib_apps_brcm_iscsi_a_OBJECTS) $(lib_apps_brcm_iscsi_a_LIBADD) - $(RANLIB) lib_apps_brcm_iscsi.a - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib_apps_brcm_iscsi_a-brcm_iscsi.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< - -lib_apps_brcm_iscsi_a-brcm_iscsi.o: brcm_iscsi.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_apps_brcm_iscsi_a_CFLAGS) $(CFLAGS) -MT lib_apps_brcm_iscsi_a-brcm_iscsi.o -MD -MP -MF "$(DEPDIR)/lib_apps_brcm_iscsi_a-brcm_iscsi.Tpo" -c -o lib_apps_brcm_iscsi_a-brcm_iscsi.o `test -f 'brcm_iscsi.c' || echo '$(srcdir)/'`brcm_iscsi.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib_apps_brcm_iscsi_a-brcm_iscsi.Tpo" "$(DEPDIR)/lib_apps_brcm_iscsi_a-brcm_iscsi.Po"; else rm -f "$(DEPDIR)/lib_apps_brcm_iscsi_a-brcm_iscsi.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='brcm_iscsi.c' object='lib_apps_brcm_iscsi_a-brcm_iscsi.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_apps_brcm_iscsi_a_CFLAGS) $(CFLAGS) -c -o lib_apps_brcm_iscsi_a-brcm_iscsi.o `test -f 'brcm_iscsi.c' || echo '$(srcdir)/'`brcm_iscsi.c - -lib_apps_brcm_iscsi_a-brcm_iscsi.obj: brcm_iscsi.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_apps_brcm_iscsi_a_CFLAGS) $(CFLAGS) -MT lib_apps_brcm_iscsi_a-brcm_iscsi.obj -MD -MP -MF "$(DEPDIR)/lib_apps_brcm_iscsi_a-brcm_iscsi.Tpo" -c -o lib_apps_brcm_iscsi_a-brcm_iscsi.obj `if test -f 'brcm_iscsi.c'; then $(CYGPATH_W) 'brcm_iscsi.c'; else $(CYGPATH_W) '$(srcdir)/brcm_iscsi.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib_apps_brcm_iscsi_a-brcm_iscsi.Tpo" "$(DEPDIR)/lib_apps_brcm_iscsi_a-brcm_iscsi.Po"; else rm -f "$(DEPDIR)/lib_apps_brcm_iscsi_a-brcm_iscsi.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='brcm_iscsi.c' object='lib_apps_brcm_iscsi_a-brcm_iscsi.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_apps_brcm_iscsi_a_CFLAGS) $(CFLAGS) -c -o lib_apps_brcm_iscsi_a-brcm_iscsi.obj `if test -f 'brcm_iscsi.c'; then $(CYGPATH_W) 'brcm_iscsi.c'; else $(CYGPATH_W) '$(srcdir)/brcm_iscsi.c'; fi` - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LIBRARIES) -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am \ - uninstall-info-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/apps/dhcpc/dhcpv6.c open-iscsi-2.0.874/iscsiuio/src/apps/dhcpc/dhcpv6.c --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/apps/dhcpc/dhcpv6.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/apps/dhcpc/dhcpv6.c 2016-09-29 18:33:24.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2011, Broadcom Corporation + * Copyright (c) 2014, QLogic Corporation * * Written by: Eddie Wai * Based on code from Kevin Tran's iSCSI boot code @@ -68,8 +69,7 @@ /* Use the last four bytes of MAC address as base of the transaction ID */ - context->dhcpv6_transaction_id = - *((u32_t *) &context->our_mac_addr->addr[2]) & 0xffffffL; + context->dhcpv6_transaction_id = context->our_mac_addr->last_4_bytes; context->dhcpv6_done = FALSE; strcpy(context->dhcp_vendor_id, "BRCM ISAN"); @@ -208,8 +208,7 @@ /* Add IA_NA option */ opt->hdr.type = HOST_TO_NET16(DHCPV6_OPT_IA_NA); opt->hdr.length = HOST_TO_NET16(sizeof(struct dhcpv6_opt_id_assoc_na)); - opt->type.ida_na.iaid = - htonl(*((u32_t *) &context->our_mac_addr->addr[2])); + opt->type.ida_na.iaid = htonl(context->our_mac_addr->last_4_bytes); opt->type.ida_na.t1 = 0; opt->type.ida_na.t2 = 0; pkt_len += sizeof(struct dhcpv6_opt_id_assoc_na) + diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/apps/dhcpc/dhcpv6.h open-iscsi-2.0.874/iscsiuio/src/apps/dhcpc/dhcpv6.h --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/apps/dhcpc/dhcpv6.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/apps/dhcpc/dhcpv6.h 2016-09-29 18:33:24.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2011, Broadcom Corporation + * Copyright (c) 2014, QLogic Corporation * * Written by: Eddie Wai * Based on code from Kevin Tran's iSCSI boot code @@ -227,7 +228,7 @@ #define IANA_ENTERPRISE_NUM_BROADCOM 0x113d -/* Broadcom Extended DHCP options used in iSCSI boot */ +/* QLogic Extended DHCP options used in iSCSI boot */ #define DHCPV6_TAG_FIRST_ISCSI_TARGET_NAME 201 #define DHCPV6_TAG_SECOND_ISCSI_TARGET_NAME 202 #define DHCPV6_TAG_ISCSI_INITIATOR_NAME 203 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/apps/dhcpc/Makefile.am open-iscsi-2.0.874/iscsiuio/src/apps/dhcpc/Makefile.am --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/apps/dhcpc/Makefile.am 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/apps/dhcpc/Makefile.am 2016-09-29 18:33:24.000000000 +0000 @@ -1,4 +1,4 @@ -INCLUDES = -I${top_srcdir}/src/unix \ +AM_CFLAGS = -I${top_srcdir}/src/unix \ -I${top_srcdir}/src/uip \ -I${top_srcdir}/src/apps/dhcpc \ -I${top_srcdir}/src/apps/brcm-iscsi \ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/apps/dhcpc/Makefile.in open-iscsi-2.0.874/iscsiuio/src/apps/dhcpc/Makefile.in --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/apps/dhcpc/Makefile.in 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/apps/dhcpc/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,461 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../.. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = src/apps/dhcpc -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) -ARFLAGS = cru -lib_apps_dhcpc_a_AR = $(AR) $(ARFLAGS) -lib_apps_dhcpc_a_LIBADD = -am_lib_apps_dhcpc_a_OBJECTS = lib_apps_dhcpc_a-dhcpc.$(OBJEXT) \ - lib_apps_dhcpc_a-dhcpv6.$(OBJEXT) -lib_apps_dhcpc_a_OBJECTS = $(am_lib_apps_dhcpc_a_OBJECTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(lib_apps_dhcpc_a_SOURCES) -DIST_SOURCES = $(lib_apps_dhcpc_a_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BASH = @BASH@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ENDIAN = @ENDIAN@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -INCLUDES = -I${top_srcdir}/src/unix \ - -I${top_srcdir}/src/uip \ - -I${top_srcdir}/src/apps/dhcpc \ - -I${top_srcdir}/src/apps/brcm-iscsi \ - -I${top_srcdir}/../include \ - -I${top_srcdir}/../usr - -noinst_LIBRARIES = lib_apps_dhcpc.a -lib_apps_dhcpc_a_SOURCES = dhcpc.c dhcpv6.c -lib_apps_dhcpc_a_CFLAGS = $(AM_CFLAGS) \ - -DBYTE_ORDER=@ENDIAN@ - -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/apps/dhcpc/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/apps/dhcpc/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) -lib_apps_dhcpc.a: $(lib_apps_dhcpc_a_OBJECTS) $(lib_apps_dhcpc_a_DEPENDENCIES) - -rm -f lib_apps_dhcpc.a - $(lib_apps_dhcpc_a_AR) lib_apps_dhcpc.a $(lib_apps_dhcpc_a_OBJECTS) $(lib_apps_dhcpc_a_LIBADD) - $(RANLIB) lib_apps_dhcpc.a - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib_apps_dhcpc_a-dhcpc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib_apps_dhcpc_a-dhcpv6.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< - -lib_apps_dhcpc_a-dhcpc.o: dhcpc.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_apps_dhcpc_a_CFLAGS) $(CFLAGS) -MT lib_apps_dhcpc_a-dhcpc.o -MD -MP -MF "$(DEPDIR)/lib_apps_dhcpc_a-dhcpc.Tpo" -c -o lib_apps_dhcpc_a-dhcpc.o `test -f 'dhcpc.c' || echo '$(srcdir)/'`dhcpc.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib_apps_dhcpc_a-dhcpc.Tpo" "$(DEPDIR)/lib_apps_dhcpc_a-dhcpc.Po"; else rm -f "$(DEPDIR)/lib_apps_dhcpc_a-dhcpc.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dhcpc.c' object='lib_apps_dhcpc_a-dhcpc.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_apps_dhcpc_a_CFLAGS) $(CFLAGS) -c -o lib_apps_dhcpc_a-dhcpc.o `test -f 'dhcpc.c' || echo '$(srcdir)/'`dhcpc.c - -lib_apps_dhcpc_a-dhcpc.obj: dhcpc.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_apps_dhcpc_a_CFLAGS) $(CFLAGS) -MT lib_apps_dhcpc_a-dhcpc.obj -MD -MP -MF "$(DEPDIR)/lib_apps_dhcpc_a-dhcpc.Tpo" -c -o lib_apps_dhcpc_a-dhcpc.obj `if test -f 'dhcpc.c'; then $(CYGPATH_W) 'dhcpc.c'; else $(CYGPATH_W) '$(srcdir)/dhcpc.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib_apps_dhcpc_a-dhcpc.Tpo" "$(DEPDIR)/lib_apps_dhcpc_a-dhcpc.Po"; else rm -f "$(DEPDIR)/lib_apps_dhcpc_a-dhcpc.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dhcpc.c' object='lib_apps_dhcpc_a-dhcpc.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_apps_dhcpc_a_CFLAGS) $(CFLAGS) -c -o lib_apps_dhcpc_a-dhcpc.obj `if test -f 'dhcpc.c'; then $(CYGPATH_W) 'dhcpc.c'; else $(CYGPATH_W) '$(srcdir)/dhcpc.c'; fi` - -lib_apps_dhcpc_a-dhcpv6.o: dhcpv6.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_apps_dhcpc_a_CFLAGS) $(CFLAGS) -MT lib_apps_dhcpc_a-dhcpv6.o -MD -MP -MF "$(DEPDIR)/lib_apps_dhcpc_a-dhcpv6.Tpo" -c -o lib_apps_dhcpc_a-dhcpv6.o `test -f 'dhcpv6.c' || echo '$(srcdir)/'`dhcpv6.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib_apps_dhcpc_a-dhcpv6.Tpo" "$(DEPDIR)/lib_apps_dhcpc_a-dhcpv6.Po"; else rm -f "$(DEPDIR)/lib_apps_dhcpc_a-dhcpv6.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dhcpv6.c' object='lib_apps_dhcpc_a-dhcpv6.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_apps_dhcpc_a_CFLAGS) $(CFLAGS) -c -o lib_apps_dhcpc_a-dhcpv6.o `test -f 'dhcpv6.c' || echo '$(srcdir)/'`dhcpv6.c - -lib_apps_dhcpc_a-dhcpv6.obj: dhcpv6.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_apps_dhcpc_a_CFLAGS) $(CFLAGS) -MT lib_apps_dhcpc_a-dhcpv6.obj -MD -MP -MF "$(DEPDIR)/lib_apps_dhcpc_a-dhcpv6.Tpo" -c -o lib_apps_dhcpc_a-dhcpv6.obj `if test -f 'dhcpv6.c'; then $(CYGPATH_W) 'dhcpv6.c'; else $(CYGPATH_W) '$(srcdir)/dhcpv6.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib_apps_dhcpc_a-dhcpv6.Tpo" "$(DEPDIR)/lib_apps_dhcpc_a-dhcpv6.Po"; else rm -f "$(DEPDIR)/lib_apps_dhcpc_a-dhcpv6.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dhcpv6.c' object='lib_apps_dhcpc_a-dhcpv6.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_apps_dhcpc_a_CFLAGS) $(CFLAGS) -c -o lib_apps_dhcpc_a-dhcpv6.obj `if test -f 'dhcpv6.c'; then $(CYGPATH_W) 'dhcpv6.c'; else $(CYGPATH_W) '$(srcdir)/dhcpv6.c'; fi` - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LIBRARIES) -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am \ - uninstall-info-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/apps/Makefile.in open-iscsi-2.0.874/iscsiuio/src/apps/Makefile.in --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/apps/Makefile.in 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/apps/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,471 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../.. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = src/apps -DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-exec-recursive install-info-recursive \ - install-recursive installcheck-recursive installdirs-recursive \ - pdf-recursive ps-recursive uninstall-info-recursive \ - uninstall-recursive -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BASH = @BASH@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ENDIAN = @ENDIAN@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -SUBDIRS = dhcpc brcm-iscsi -all: all-recursive - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/apps/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/apps/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done - list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(mkdir_p) "$(distdir)/$$subdir" \ - || exit 1; \ - distdir=`$(am__cd) $(distdir) && pwd`; \ - top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ - (cd $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$top_distdir" \ - distdir="$$distdir/$$subdir" \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile -installdirs: installdirs-recursive -installdirs-am: -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-recursive - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool \ - distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -info: info-recursive - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-recursive - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: uninstall-info-am - -uninstall-info: uninstall-info-recursive - -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ - clean clean-generic clean-libtool clean-recursive ctags \ - ctags-recursive distclean distclean-generic distclean-libtool \ - distclean-recursive distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-exec install-exec-am install-info \ - install-info-am install-man install-strip installcheck \ - installcheck-am installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic maintainer-clean-recursive \ - mostlyclean mostlyclean-generic mostlyclean-libtool \ - mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am uninstall-info-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/Makefile.in open-iscsi-2.0.874/iscsiuio/src/Makefile.in --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/Makefile.in 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,471 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = src -DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-exec-recursive install-info-recursive \ - install-recursive installcheck-recursive installdirs-recursive \ - pdf-recursive ps-recursive uninstall-info-recursive \ - uninstall-recursive -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BASH = @BASH@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ENDIAN = @ENDIAN@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -SUBDIRS = apps uip unix -all: all-recursive - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done - list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(mkdir_p) "$(distdir)/$$subdir" \ - || exit 1; \ - distdir=`$(am__cd) $(distdir) && pwd`; \ - top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ - (cd $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$top_distdir" \ - distdir="$$distdir/$$subdir" \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile -installdirs: installdirs-recursive -installdirs-am: -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-recursive - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool \ - distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -info: info-recursive - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-recursive - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: uninstall-info-am - -uninstall-info: uninstall-info-recursive - -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ - clean clean-generic clean-libtool clean-recursive ctags \ - ctags-recursive distclean distclean-generic distclean-libtool \ - distclean-recursive distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-exec install-exec-am install-info \ - install-info-am install-man install-strip installcheck \ - installcheck-am installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic maintainer-clean-recursive \ - mostlyclean mostlyclean-generic mostlyclean-libtool \ - mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am uninstall-info-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/uip/icmpv6.h open-iscsi-2.0.874/iscsiuio/src/uip/icmpv6.h --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/uip/icmpv6.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/uip/icmpv6.h 2016-09-29 18:33:24.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2011, Broadcom Corporation + * Copyright (c) 2014, QLogic Corporation * * Written by: Eddie Wai (eddie.wai@broadcom.com) * Based on Kevin Tran's iSCSI boot code diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/uip/ipv6.c open-iscsi-2.0.874/iscsiuio/src/uip/ipv6.c --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/uip/ipv6.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/uip/ipv6.c 2016-09-29 18:33:24.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2011, Broadcom Corporation + * Copyright (c) 2014, QLogic Corporation * * Written by: Eddie Wai (eddie.wai@broadcom.com) * Based on Kevin Tran's iSCSI boot code @@ -46,6 +47,7 @@ #include "icmpv6.h" #include "uipopt.h" #include "dhcpv6.h" +#include "ping.h" inline int best_match_bufcmp(u8_t *a, u8_t *b, int len) { @@ -91,7 +93,7 @@ { int i; struct mac_address *mc_addr; - const struct mac_address all_zeroes_mc = { { 0, 0, 0, 0, 0, 0 } }; + const struct mac_address all_zeroes_mc = { { { 0, 0, 0, 0, 0, 0 } } }; mc_addr = context->mc_addr; for (i = 0; i < MAX_MCADDR_TABLE; i++, mc_addr++) @@ -810,6 +812,9 @@ (struct ipv6_hdr *)context->ustack->network_layer; struct icmpv6_hdr *icmp = (struct icmpv6_hdr *)((u8_t *)ipv6 + sizeof(struct ipv6_hdr)); + uip_icmp_echo_hdr_t *icmp_echo_hdr = + (uip_icmp_echo_hdr_t *)((u8_t *)ipv6 + + sizeof(struct ipv6_hdr)); switch (icmp->icmpv6_type) { case ICMPV6_RTR_ADV: @@ -829,6 +834,11 @@ ipv6_icmp_handle_echo_request(context); break; + case ICMPV6_ECHO_REPLY: + /* Handle ICMP reply */ + process_icmp_packet(icmp_echo_hdr, context->ustack); + break; + default: break; } diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/uip/ipv6.h open-iscsi-2.0.874/iscsiuio/src/uip/ipv6.h --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/uip/ipv6.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/uip/ipv6.h 2016-09-29 18:33:24.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2011, Broadcom Corporation + * Copyright (c) 2014, QLogic Corporation * * Written by: Eddie Wai (eddie.wai@broadcom.com) * Based on Kevin Tran's iSCSI boot code @@ -70,7 +71,13 @@ }; struct mac_address { - u8_t addr[6]; + union { + u8_t addr[6]; + struct { + u16_t first_2_bytes; + u32_t last_4_bytes; + } __attribute__ ((packed)); + }; }; #define HOST_TO_NET16(a) htons(a) @@ -135,32 +142,11 @@ (memcmp((char *)a, (char *)b, sizeof(struct ipv6_addr)) == 0) /* Unspecified IPv6 address */ -#define IPV6_IS_ADDR_UNSPECIFIED(a) \ - ((*(u32_t *)(&(a)->addr8[0]) == 0) && \ - (*(u32_t *)(&(a)->addr8[4]) == 0) && \ - (*(u32_t *)(&(a)->addr8[8]) == 0) && \ - (*(u32_t *)(&(a)->addr8[12]) == 0)) - -/* Loopback IPv6 address */ -#define IPV6_IS_ADDR_LOOPBACK(a) \ - ((*(u32_t *)(&(a)->addr8[0]) == 0) && \ - (*(u32_t *)(&(a)->addr8[4]) == 0) && \ - (*(u32_t *)(&(a)->addr8[8]) == 0) && \ - (*(u32_t *)(&(a)->addr8[12]) == 0x1)) - -/* IPv4 compatible */ -#define IPV6_IS_ADDR_IPV4_COMPAT(a) \ - ((*(u32_t *)(&(a)->addr8[0]) == 0) && \ - (*(u32_t *)(&(a)->addr8[4]) == 0) && \ - (*(u32_t *)(&(a)->addr8[8]) == 0) && \ - (*(u32_t *)(&(a)->addr8[12]) != 0) && \ - (*(u32_t *)(&(a)->addr8[12]) != 0x1)) - -/* Mapped IPv4-IPv6 address */ -#define IPV6_IS_ADDR_IPV4_MAPPED(a) \ - ((*(u32_t *)(&(a)->addr8[0]) == 0) && \ - (*(u32_t *)(&(a)->addr8[4]) == 0) && \ - (*(u32_t *)(&(a)->addr8[8]) == ntohl(0x0000ffff))) +#define IPV6_IS_ADDR_UNSPECIFIED(a) \ + ((((a)->addr[0]) == 0) && \ + (((a)->addr[1]) == 0) && \ + (((a)->addr[2]) == 0) && \ + (((a)->addr[3]) == 0)) /* IPv6 Scope Values */ #define IPV6_ADDR_SCOPE_INTFACELOCAL 0x01 /* Node-local scope */ @@ -284,7 +270,7 @@ struct ipv6_addr default_router; struct ipv6_prefix_entry *addr_list; u8_t hop_limit; -#define UIP_ARPTAB_SIZE 8 +#define UIP_ARPTAB_SIZE 16 struct uip_stack *ustack; #define MAX_MCADDR_TABLE 5 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/uip/ipv6_ndpc.c open-iscsi-2.0.874/iscsiuio/src/uip/ipv6_ndpc.c --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/uip/ipv6_ndpc.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/uip/ipv6_ndpc.c 2016-09-29 18:33:24.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2011, Broadcom Corporation + * Copyright (c) 2014, QLogic Corporation * * Written by: Eddie Wai (eddie.wai@broadcom.com) * Based on the Swedish Institute of Computer Science's diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/uip/ipv6_ndpc.h open-iscsi-2.0.874/iscsiuio/src/uip/ipv6_ndpc.h --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/uip/ipv6_ndpc.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/uip/ipv6_ndpc.h 2016-09-29 18:33:24.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2011, Broadcom Corporation + * Copyright (c) 2014, QLogic Corporation * * Written by: Eddie Wai (eddie.wai@broadcom.com) * diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/uip/ipv6_pkt.h open-iscsi-2.0.874/iscsiuio/src/uip/ipv6_pkt.h --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/uip/ipv6_pkt.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/uip/ipv6_pkt.h 2016-09-29 18:33:24.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2011, Broadcom Corporation + * Copyright (c) 2014, QLogic Corporation * * Written by: Eddie Wai (eddie.wai@broadcom.com) * Based on Kevin Tran's iSCSI boot code diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/uip/Makefile.am open-iscsi-2.0.874/iscsiuio/src/uip/Makefile.am --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/uip/Makefile.am 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/uip/Makefile.am 2016-09-29 18:33:24.000000000 +0000 @@ -1,4 +1,4 @@ -INCLUDES = -I${top_srcdir}/src/unix \ +AM_CFLAGS = -I${top_srcdir}/src/unix \ -I${top_srcdir}/src/apps/dhcpc \ -I${top_srcdir}/src/apps/brcm-iscsi \ -I${top_srcdir}/../include \ @@ -15,4 +15,4 @@ ipv6_ndpc.c \ ipv6.c -lib_iscsi_uip_a_CFLAGS = -DBYTE_ORDER=@ENDIAN@ +lib_iscsi_uip_a_CFLAGS = -DBYTE_ORDER=@ENDIAN@ $(AM_CFLAGS) diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/uip/Makefile.in open-iscsi-2.0.874/iscsiuio/src/uip/Makefile.in --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/uip/Makefile.in 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/uip/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,562 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../.. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = src/uip -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) -ARFLAGS = cru -lib_iscsi_uip_a_AR = $(AR) $(ARFLAGS) -lib_iscsi_uip_a_LIBADD = -am_lib_iscsi_uip_a_OBJECTS = lib_iscsi_uip_a-uip.$(OBJEXT) \ - lib_iscsi_uip_a-uip_arp.$(OBJEXT) \ - lib_iscsi_uip_a-psock.$(OBJEXT) \ - lib_iscsi_uip_a-timer.$(OBJEXT) \ - lib_iscsi_uip_a-uip-neighbor.$(OBJEXT) \ - lib_iscsi_uip_a-uip_eth.$(OBJEXT) \ - lib_iscsi_uip_a-ipv6_ndpc.$(OBJEXT) \ - lib_iscsi_uip_a-ipv6.$(OBJEXT) -lib_iscsi_uip_a_OBJECTS = $(am_lib_iscsi_uip_a_OBJECTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(lib_iscsi_uip_a_SOURCES) -DIST_SOURCES = $(lib_iscsi_uip_a_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BASH = @BASH@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ENDIAN = @ENDIAN@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -INCLUDES = -I${top_srcdir}/src/unix \ - -I${top_srcdir}/src/apps/dhcpc \ - -I${top_srcdir}/src/apps/brcm-iscsi \ - -I${top_srcdir}/../include \ - -I${top_srcdir}/../usr - -noinst_LIBRARIES = lib_iscsi_uip.a -lib_iscsi_uip_a_SOURCES = uip.c \ - uip_arp.c \ - psock.c \ - timer.c \ - uip-neighbor.c \ - uip_eth.c \ - ipv6_ndpc.c \ - ipv6.c - -lib_iscsi_uip_a_CFLAGS = -DBYTE_ORDER=@ENDIAN@ -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/uip/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/uip/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) -lib_iscsi_uip.a: $(lib_iscsi_uip_a_OBJECTS) $(lib_iscsi_uip_a_DEPENDENCIES) - -rm -f lib_iscsi_uip.a - $(lib_iscsi_uip_a_AR) lib_iscsi_uip.a $(lib_iscsi_uip_a_OBJECTS) $(lib_iscsi_uip_a_LIBADD) - $(RANLIB) lib_iscsi_uip.a - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib_iscsi_uip_a-ipv6.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib_iscsi_uip_a-ipv6_ndpc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib_iscsi_uip_a-psock.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib_iscsi_uip_a-timer.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib_iscsi_uip_a-uip-neighbor.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib_iscsi_uip_a-uip.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib_iscsi_uip_a-uip_arp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib_iscsi_uip_a-uip_eth.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< - -lib_iscsi_uip_a-uip.o: uip.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_iscsi_uip_a_CFLAGS) $(CFLAGS) -MT lib_iscsi_uip_a-uip.o -MD -MP -MF "$(DEPDIR)/lib_iscsi_uip_a-uip.Tpo" -c -o lib_iscsi_uip_a-uip.o `test -f 'uip.c' || echo '$(srcdir)/'`uip.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib_iscsi_uip_a-uip.Tpo" "$(DEPDIR)/lib_iscsi_uip_a-uip.Po"; else rm -f "$(DEPDIR)/lib_iscsi_uip_a-uip.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='uip.c' object='lib_iscsi_uip_a-uip.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_iscsi_uip_a_CFLAGS) $(CFLAGS) -c -o lib_iscsi_uip_a-uip.o `test -f 'uip.c' || echo '$(srcdir)/'`uip.c - -lib_iscsi_uip_a-uip.obj: uip.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_iscsi_uip_a_CFLAGS) $(CFLAGS) -MT lib_iscsi_uip_a-uip.obj -MD -MP -MF "$(DEPDIR)/lib_iscsi_uip_a-uip.Tpo" -c -o lib_iscsi_uip_a-uip.obj `if test -f 'uip.c'; then $(CYGPATH_W) 'uip.c'; else $(CYGPATH_W) '$(srcdir)/uip.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib_iscsi_uip_a-uip.Tpo" "$(DEPDIR)/lib_iscsi_uip_a-uip.Po"; else rm -f "$(DEPDIR)/lib_iscsi_uip_a-uip.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='uip.c' object='lib_iscsi_uip_a-uip.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_iscsi_uip_a_CFLAGS) $(CFLAGS) -c -o lib_iscsi_uip_a-uip.obj `if test -f 'uip.c'; then $(CYGPATH_W) 'uip.c'; else $(CYGPATH_W) '$(srcdir)/uip.c'; fi` - -lib_iscsi_uip_a-uip_arp.o: uip_arp.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_iscsi_uip_a_CFLAGS) $(CFLAGS) -MT lib_iscsi_uip_a-uip_arp.o -MD -MP -MF "$(DEPDIR)/lib_iscsi_uip_a-uip_arp.Tpo" -c -o lib_iscsi_uip_a-uip_arp.o `test -f 'uip_arp.c' || echo '$(srcdir)/'`uip_arp.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib_iscsi_uip_a-uip_arp.Tpo" "$(DEPDIR)/lib_iscsi_uip_a-uip_arp.Po"; else rm -f "$(DEPDIR)/lib_iscsi_uip_a-uip_arp.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='uip_arp.c' object='lib_iscsi_uip_a-uip_arp.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_iscsi_uip_a_CFLAGS) $(CFLAGS) -c -o lib_iscsi_uip_a-uip_arp.o `test -f 'uip_arp.c' || echo '$(srcdir)/'`uip_arp.c - -lib_iscsi_uip_a-uip_arp.obj: uip_arp.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_iscsi_uip_a_CFLAGS) $(CFLAGS) -MT lib_iscsi_uip_a-uip_arp.obj -MD -MP -MF "$(DEPDIR)/lib_iscsi_uip_a-uip_arp.Tpo" -c -o lib_iscsi_uip_a-uip_arp.obj `if test -f 'uip_arp.c'; then $(CYGPATH_W) 'uip_arp.c'; else $(CYGPATH_W) '$(srcdir)/uip_arp.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib_iscsi_uip_a-uip_arp.Tpo" "$(DEPDIR)/lib_iscsi_uip_a-uip_arp.Po"; else rm -f "$(DEPDIR)/lib_iscsi_uip_a-uip_arp.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='uip_arp.c' object='lib_iscsi_uip_a-uip_arp.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_iscsi_uip_a_CFLAGS) $(CFLAGS) -c -o lib_iscsi_uip_a-uip_arp.obj `if test -f 'uip_arp.c'; then $(CYGPATH_W) 'uip_arp.c'; else $(CYGPATH_W) '$(srcdir)/uip_arp.c'; fi` - -lib_iscsi_uip_a-psock.o: psock.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_iscsi_uip_a_CFLAGS) $(CFLAGS) -MT lib_iscsi_uip_a-psock.o -MD -MP -MF "$(DEPDIR)/lib_iscsi_uip_a-psock.Tpo" -c -o lib_iscsi_uip_a-psock.o `test -f 'psock.c' || echo '$(srcdir)/'`psock.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib_iscsi_uip_a-psock.Tpo" "$(DEPDIR)/lib_iscsi_uip_a-psock.Po"; else rm -f "$(DEPDIR)/lib_iscsi_uip_a-psock.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='psock.c' object='lib_iscsi_uip_a-psock.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_iscsi_uip_a_CFLAGS) $(CFLAGS) -c -o lib_iscsi_uip_a-psock.o `test -f 'psock.c' || echo '$(srcdir)/'`psock.c - -lib_iscsi_uip_a-psock.obj: psock.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_iscsi_uip_a_CFLAGS) $(CFLAGS) -MT lib_iscsi_uip_a-psock.obj -MD -MP -MF "$(DEPDIR)/lib_iscsi_uip_a-psock.Tpo" -c -o lib_iscsi_uip_a-psock.obj `if test -f 'psock.c'; then $(CYGPATH_W) 'psock.c'; else $(CYGPATH_W) '$(srcdir)/psock.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib_iscsi_uip_a-psock.Tpo" "$(DEPDIR)/lib_iscsi_uip_a-psock.Po"; else rm -f "$(DEPDIR)/lib_iscsi_uip_a-psock.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='psock.c' object='lib_iscsi_uip_a-psock.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_iscsi_uip_a_CFLAGS) $(CFLAGS) -c -o lib_iscsi_uip_a-psock.obj `if test -f 'psock.c'; then $(CYGPATH_W) 'psock.c'; else $(CYGPATH_W) '$(srcdir)/psock.c'; fi` - -lib_iscsi_uip_a-timer.o: timer.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_iscsi_uip_a_CFLAGS) $(CFLAGS) -MT lib_iscsi_uip_a-timer.o -MD -MP -MF "$(DEPDIR)/lib_iscsi_uip_a-timer.Tpo" -c -o lib_iscsi_uip_a-timer.o `test -f 'timer.c' || echo '$(srcdir)/'`timer.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib_iscsi_uip_a-timer.Tpo" "$(DEPDIR)/lib_iscsi_uip_a-timer.Po"; else rm -f "$(DEPDIR)/lib_iscsi_uip_a-timer.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='timer.c' object='lib_iscsi_uip_a-timer.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_iscsi_uip_a_CFLAGS) $(CFLAGS) -c -o lib_iscsi_uip_a-timer.o `test -f 'timer.c' || echo '$(srcdir)/'`timer.c - -lib_iscsi_uip_a-timer.obj: timer.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_iscsi_uip_a_CFLAGS) $(CFLAGS) -MT lib_iscsi_uip_a-timer.obj -MD -MP -MF "$(DEPDIR)/lib_iscsi_uip_a-timer.Tpo" -c -o lib_iscsi_uip_a-timer.obj `if test -f 'timer.c'; then $(CYGPATH_W) 'timer.c'; else $(CYGPATH_W) '$(srcdir)/timer.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib_iscsi_uip_a-timer.Tpo" "$(DEPDIR)/lib_iscsi_uip_a-timer.Po"; else rm -f "$(DEPDIR)/lib_iscsi_uip_a-timer.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='timer.c' object='lib_iscsi_uip_a-timer.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_iscsi_uip_a_CFLAGS) $(CFLAGS) -c -o lib_iscsi_uip_a-timer.obj `if test -f 'timer.c'; then $(CYGPATH_W) 'timer.c'; else $(CYGPATH_W) '$(srcdir)/timer.c'; fi` - -lib_iscsi_uip_a-uip-neighbor.o: uip-neighbor.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_iscsi_uip_a_CFLAGS) $(CFLAGS) -MT lib_iscsi_uip_a-uip-neighbor.o -MD -MP -MF "$(DEPDIR)/lib_iscsi_uip_a-uip-neighbor.Tpo" -c -o lib_iscsi_uip_a-uip-neighbor.o `test -f 'uip-neighbor.c' || echo '$(srcdir)/'`uip-neighbor.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib_iscsi_uip_a-uip-neighbor.Tpo" "$(DEPDIR)/lib_iscsi_uip_a-uip-neighbor.Po"; else rm -f "$(DEPDIR)/lib_iscsi_uip_a-uip-neighbor.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='uip-neighbor.c' object='lib_iscsi_uip_a-uip-neighbor.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_iscsi_uip_a_CFLAGS) $(CFLAGS) -c -o lib_iscsi_uip_a-uip-neighbor.o `test -f 'uip-neighbor.c' || echo '$(srcdir)/'`uip-neighbor.c - -lib_iscsi_uip_a-uip-neighbor.obj: uip-neighbor.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_iscsi_uip_a_CFLAGS) $(CFLAGS) -MT lib_iscsi_uip_a-uip-neighbor.obj -MD -MP -MF "$(DEPDIR)/lib_iscsi_uip_a-uip-neighbor.Tpo" -c -o lib_iscsi_uip_a-uip-neighbor.obj `if test -f 'uip-neighbor.c'; then $(CYGPATH_W) 'uip-neighbor.c'; else $(CYGPATH_W) '$(srcdir)/uip-neighbor.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib_iscsi_uip_a-uip-neighbor.Tpo" "$(DEPDIR)/lib_iscsi_uip_a-uip-neighbor.Po"; else rm -f "$(DEPDIR)/lib_iscsi_uip_a-uip-neighbor.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='uip-neighbor.c' object='lib_iscsi_uip_a-uip-neighbor.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_iscsi_uip_a_CFLAGS) $(CFLAGS) -c -o lib_iscsi_uip_a-uip-neighbor.obj `if test -f 'uip-neighbor.c'; then $(CYGPATH_W) 'uip-neighbor.c'; else $(CYGPATH_W) '$(srcdir)/uip-neighbor.c'; fi` - -lib_iscsi_uip_a-uip_eth.o: uip_eth.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_iscsi_uip_a_CFLAGS) $(CFLAGS) -MT lib_iscsi_uip_a-uip_eth.o -MD -MP -MF "$(DEPDIR)/lib_iscsi_uip_a-uip_eth.Tpo" -c -o lib_iscsi_uip_a-uip_eth.o `test -f 'uip_eth.c' || echo '$(srcdir)/'`uip_eth.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib_iscsi_uip_a-uip_eth.Tpo" "$(DEPDIR)/lib_iscsi_uip_a-uip_eth.Po"; else rm -f "$(DEPDIR)/lib_iscsi_uip_a-uip_eth.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='uip_eth.c' object='lib_iscsi_uip_a-uip_eth.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_iscsi_uip_a_CFLAGS) $(CFLAGS) -c -o lib_iscsi_uip_a-uip_eth.o `test -f 'uip_eth.c' || echo '$(srcdir)/'`uip_eth.c - -lib_iscsi_uip_a-uip_eth.obj: uip_eth.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_iscsi_uip_a_CFLAGS) $(CFLAGS) -MT lib_iscsi_uip_a-uip_eth.obj -MD -MP -MF "$(DEPDIR)/lib_iscsi_uip_a-uip_eth.Tpo" -c -o lib_iscsi_uip_a-uip_eth.obj `if test -f 'uip_eth.c'; then $(CYGPATH_W) 'uip_eth.c'; else $(CYGPATH_W) '$(srcdir)/uip_eth.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib_iscsi_uip_a-uip_eth.Tpo" "$(DEPDIR)/lib_iscsi_uip_a-uip_eth.Po"; else rm -f "$(DEPDIR)/lib_iscsi_uip_a-uip_eth.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='uip_eth.c' object='lib_iscsi_uip_a-uip_eth.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_iscsi_uip_a_CFLAGS) $(CFLAGS) -c -o lib_iscsi_uip_a-uip_eth.obj `if test -f 'uip_eth.c'; then $(CYGPATH_W) 'uip_eth.c'; else $(CYGPATH_W) '$(srcdir)/uip_eth.c'; fi` - -lib_iscsi_uip_a-ipv6_ndpc.o: ipv6_ndpc.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_iscsi_uip_a_CFLAGS) $(CFLAGS) -MT lib_iscsi_uip_a-ipv6_ndpc.o -MD -MP -MF "$(DEPDIR)/lib_iscsi_uip_a-ipv6_ndpc.Tpo" -c -o lib_iscsi_uip_a-ipv6_ndpc.o `test -f 'ipv6_ndpc.c' || echo '$(srcdir)/'`ipv6_ndpc.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib_iscsi_uip_a-ipv6_ndpc.Tpo" "$(DEPDIR)/lib_iscsi_uip_a-ipv6_ndpc.Po"; else rm -f "$(DEPDIR)/lib_iscsi_uip_a-ipv6_ndpc.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ipv6_ndpc.c' object='lib_iscsi_uip_a-ipv6_ndpc.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_iscsi_uip_a_CFLAGS) $(CFLAGS) -c -o lib_iscsi_uip_a-ipv6_ndpc.o `test -f 'ipv6_ndpc.c' || echo '$(srcdir)/'`ipv6_ndpc.c - -lib_iscsi_uip_a-ipv6_ndpc.obj: ipv6_ndpc.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_iscsi_uip_a_CFLAGS) $(CFLAGS) -MT lib_iscsi_uip_a-ipv6_ndpc.obj -MD -MP -MF "$(DEPDIR)/lib_iscsi_uip_a-ipv6_ndpc.Tpo" -c -o lib_iscsi_uip_a-ipv6_ndpc.obj `if test -f 'ipv6_ndpc.c'; then $(CYGPATH_W) 'ipv6_ndpc.c'; else $(CYGPATH_W) '$(srcdir)/ipv6_ndpc.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib_iscsi_uip_a-ipv6_ndpc.Tpo" "$(DEPDIR)/lib_iscsi_uip_a-ipv6_ndpc.Po"; else rm -f "$(DEPDIR)/lib_iscsi_uip_a-ipv6_ndpc.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ipv6_ndpc.c' object='lib_iscsi_uip_a-ipv6_ndpc.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_iscsi_uip_a_CFLAGS) $(CFLAGS) -c -o lib_iscsi_uip_a-ipv6_ndpc.obj `if test -f 'ipv6_ndpc.c'; then $(CYGPATH_W) 'ipv6_ndpc.c'; else $(CYGPATH_W) '$(srcdir)/ipv6_ndpc.c'; fi` - -lib_iscsi_uip_a-ipv6.o: ipv6.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_iscsi_uip_a_CFLAGS) $(CFLAGS) -MT lib_iscsi_uip_a-ipv6.o -MD -MP -MF "$(DEPDIR)/lib_iscsi_uip_a-ipv6.Tpo" -c -o lib_iscsi_uip_a-ipv6.o `test -f 'ipv6.c' || echo '$(srcdir)/'`ipv6.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib_iscsi_uip_a-ipv6.Tpo" "$(DEPDIR)/lib_iscsi_uip_a-ipv6.Po"; else rm -f "$(DEPDIR)/lib_iscsi_uip_a-ipv6.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ipv6.c' object='lib_iscsi_uip_a-ipv6.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_iscsi_uip_a_CFLAGS) $(CFLAGS) -c -o lib_iscsi_uip_a-ipv6.o `test -f 'ipv6.c' || echo '$(srcdir)/'`ipv6.c - -lib_iscsi_uip_a-ipv6.obj: ipv6.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_iscsi_uip_a_CFLAGS) $(CFLAGS) -MT lib_iscsi_uip_a-ipv6.obj -MD -MP -MF "$(DEPDIR)/lib_iscsi_uip_a-ipv6.Tpo" -c -o lib_iscsi_uip_a-ipv6.obj `if test -f 'ipv6.c'; then $(CYGPATH_W) 'ipv6.c'; else $(CYGPATH_W) '$(srcdir)/ipv6.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lib_iscsi_uip_a-ipv6.Tpo" "$(DEPDIR)/lib_iscsi_uip_a-ipv6.Po"; else rm -f "$(DEPDIR)/lib_iscsi_uip_a-ipv6.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ipv6.c' object='lib_iscsi_uip_a-ipv6.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_iscsi_uip_a_CFLAGS) $(CFLAGS) -c -o lib_iscsi_uip_a-ipv6.obj `if test -f 'ipv6.c'; then $(CYGPATH_W) 'ipv6.c'; else $(CYGPATH_W) '$(srcdir)/ipv6.c'; fi` - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LIBRARIES) -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am \ - uninstall-info-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/uip/pt.h open-iscsi-2.0.874/iscsiuio/src/uip/pt.h --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/uip/pt.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/uip/pt.h 2016-09-29 18:33:24.000000000 +0000 @@ -111,7 +111,7 @@ * * \hideinitializer */ -#define PT_BEGIN(pt) { char PT_YIELD_FLAG = 1; LC_RESUME((pt)->lc) +#define PT_BEGIN(pt) { char PT_YIELD_FLAG __attribute__((__unused__)) = 1; LC_RESUME((pt)->lc) /** * Declare the end of a protothread. diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/uip/uip_arp.c open-iscsi-2.0.874/iscsiuio/src/uip/uip_arp.c --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/uip/uip_arp.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/uip/uip_arp.c 2016-09-29 18:33:24.000000000 +0000 @@ -112,7 +112,7 @@ for (i = 0; i < UIP_ARPTAB_SIZE; ++i) { tabptr = &arp_table[i]; if ((tabptr->ipaddr[0] | tabptr->ipaddr[1]) != 0 && - arptime - tabptr->time >= UIP_ARP_MAXAGE) + (u8_t)(arptime - tabptr->time) >= UIP_ARP_MAXAGE) memset(tabptr->ipaddr, 0, 4); } @@ -165,8 +165,8 @@ c = 0; for (i = 0; i < UIP_ARPTAB_SIZE; ++i) { tabptr = &arp_table[i]; - if (arptime - tabptr->time > tmpage) { - tmpage = arptime - tabptr->time; + if ((u8_t)(arptime - tabptr->time) > tmpage) { + tmpage = (u8_t)(arptime - tabptr->time); c = i; } } @@ -310,11 +310,9 @@ dest_ipv4_addr_t uip_determine_dest_ipv4_addr(struct uip_stack *ustack, u16_t *ipaddr) { - struct arp_hdr *arp; struct uip_eth_hdr *eth; struct ip_hdr *ip_buf; - arp = (struct arp_hdr *)ustack->network_layer; eth = (struct uip_eth_hdr *)ustack->data_link_layer; ip_buf = (struct ip_hdr *)ustack->network_layer; diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/uip/uip.c open-iscsi-2.0.874/iscsiuio/src/uip/uip.c --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/uip/uip.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/uip/uip.c 2016-09-29 18:33:24.000000000 +0000 @@ -7,6 +7,7 @@ #include "dhcpc.h" #include "ipv6_ndpc.h" #include "brcm_iscsi.h" +#include "ping.h" /** * \defgroup uip The uIP TCP/IP stack @@ -219,10 +220,14 @@ uip_ip4addr_t *netmask, uip_ip4addr_t *default_route, uint8_t *mac_addr) { - uip_sethostaddr4(ustack, ip); - uip_setnetmask4(ustack, netmask); - uip_setdraddr4(ustack, default_route); - uip_setethernetmac(ustack, mac_addr); + if (ip) + uip_sethostaddr4(ustack, ip); + if (netmask) + uip_setnetmask4(ustack, netmask); + if (default_route) + uip_setdraddr4(ustack, default_route); + if (mac_addr) + uip_setethernetmac(ustack, mac_addr); } #if !UIP_ARCH_ADD32 @@ -441,6 +446,7 @@ ustack->dhcpc = NULL; ustack->ndpc = NULL; + ustack->ping_conf = NULL; } void uip_reset(struct uip_stack *ustack) { @@ -1023,7 +1029,7 @@ struct uip_tcp_ipv4_hdr *tcp_ipv4_hdr = NULL; struct uip_tcp_hdr *tcp_hdr = NULL; struct uip_icmpv4_hdr *icmpv4_hdr = NULL; - struct uip_icmpv6_hdr *icmpv6_hdr = NULL; + struct uip_icmpv6_hdr *icmpv6_hdr __attribute__((__unused__)) = NULL; struct uip_udp_hdr *udp_hdr = NULL; /* Drop invalid packets */ @@ -1425,6 +1431,11 @@ #endif /* UIP_PINGADDRCONF */ ++ustack->stats.icmp.recv; + if (icmpv4_hdr->type == ICMP_ECHO_REPLY) { + if (process_icmp_packet(icmpv4_hdr, ustack) == 0) + goto drop; + } + /* ICMP echo (i.e., ping) processing. This is simple, we only change the ICMP type from ECHO to ECHO_REPLY and adjust the ICMP checksum before we return the packet. */ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/uip/uip_eth.c open-iscsi-2.0.874/iscsiuio/src/uip/uip_eth.c --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/uip/uip_eth.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/uip/uip_eth.c 2016-09-29 18:33:24.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2009-2011, Broadcom Corporation + * Copyright (c) 2014, QLogic Corporation * * Written by: Benjamin Li (benli@broadcom.com) * diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/uip/uip.h open-iscsi-2.0.874/iscsiuio/src/uip/uip.h --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/uip/uip.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/uip/uip.h 2016-09-29 18:33:24.000000000 +0000 @@ -1283,6 +1283,8 @@ u16_t id, seqno; }; +typedef struct uip_icmpv4_hdr uip_icmp_echo_hdr_t; + /* The ICMPv6 */ struct __attribute__ ((__packed__)) uip_icmpv6_hdr { /* ICMP (echo) header. */ @@ -1554,6 +1556,8 @@ /* NDP client */ void *ndpc; + + void *ping_conf; }; /******************************************************************************* @@ -1563,6 +1567,7 @@ int is_ipv6_link_local_address(uip_ip6addr_t *addr); void dump_uip_packet(struct uip_stack *ustack); +u16_t uip_icmp6chksum(struct uip_stack *ustack); #endif /* __UIP_H__ */ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/uip/uipopt.h open-iscsi-2.0.874/iscsiuio/src/uip/uipopt.h --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/uip/uipopt.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/uip/uipopt.h 2016-09-29 18:33:24.000000000 +0000 @@ -341,7 +341,7 @@ #ifdef UIP_CONF_ARPTAB_SIZE #define UIP_ARPTAB_SIZE UIP_CONF_ARPTAB_SIZE #else -#define UIP_ARPTAB_SIZE 8 +#define UIP_ARPTAB_SIZE 16 #endif /** diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/build_date.c open-iscsi-2.0.874/iscsiuio/src/unix/build_date.c --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/build_date.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/unix/build_date.c 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -char *build_date = "Thu Sep 6 16:56:48 PDT 2012"; diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/build_date.h open-iscsi-2.0.874/iscsiuio/src/unix/build_date.h --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/build_date.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/unix/build_date.h 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -char *build_date; diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/.gitignore open-iscsi-2.0.874/iscsiuio/src/unix/.gitignore --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/unix/.gitignore 2016-09-29 18:33:24.000000000 +0000 @@ -0,0 +1,2 @@ +build_date.c +build_date.h diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/iscsid_ipc.c open-iscsi-2.0.874/iscsiuio/src/unix/iscsid_ipc.c --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/iscsid_ipc.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/unix/iscsid_ipc.c 2016-09-29 18:33:24.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2009-2011, Broadcom Corporation + * Copyright (c) 2014, QLogic Corporation * * Written by: Benjamin Li (benli@broadcom.com) * @@ -63,6 +64,7 @@ #include "logger.h" #include "uip.h" +#include "ping.h" /* private iscsid options stucture */ struct iscsid_options { @@ -274,7 +276,7 @@ sizeof(struct in6_addr)); /* Subnet mask priority: CIDR, then rec */ if (!ird->ipv6_subnet_mask.s6_addr) - inet_pton(AF_INET, rec->subnet_mask, + inet_pton(AF_INET6, rec->subnet_mask, &ird->ipv6_subnet_mask); /* For LL on, ignore the IPv6 addr in the iface */ @@ -322,7 +324,67 @@ return rc; } -static int parse_iface(void *arg) +static void *perform_ping(void *arg) +{ + struct ping_conf *png_c = (struct ping_conf *)arg; + nic_interface_t *nic_iface = png_c->nic_iface; + nic_t *nic = nic_iface->parent; + iscsid_uip_broadcast_t *data; + struct sockaddr_in *addr; + struct sockaddr_in6 *addr6; + uip_ip6addr_t dst_addr; + int rc = 0; + int datalen; + struct timespec ts = {.tv_sec = 5, + .tv_nsec = 0}; + + data = (iscsid_uip_broadcast_t *)png_c->data; + datalen = data->u.ping_rec.datalen; + + memset(dst_addr, 0, sizeof(uip_ip6addr_t)); + if (nic_iface->protocol == AF_INET) { + /* IPv4 */ + addr = (struct sockaddr_in *)&data->u.ping_rec.ipaddr; + memcpy(dst_addr, &addr->sin_addr.s_addr, sizeof(uip_ip4addr_t)); + } else { + /* IPv6 */ + addr6 = (struct sockaddr_in6 *)&data->u.ping_rec.ipaddr; + memcpy(dst_addr, &addr6->sin6_addr.s6_addr, + sizeof(uip_ip6addr_t)); + } + + /* Ensure that the NIC is RUNNING */ + if ((nic->state != NIC_RUNNING) || !(nic->flags & NIC_ENABLED)) { + pthread_mutex_lock(&nic->nic_mutex); + rc = pthread_cond_timedwait(&nic->enable_done_cond, + &nic->nic_mutex, &ts); + if ((rc == 0) && (nic->state == NIC_RUNNING)) { + LOG_DEBUG(PFX "%s: nic running", nic->log_name); + } else if (rc) { + LOG_DEBUG(PFX "%s: err %d", nic->log_name, rc); + rc = -EAGAIN; + } + pthread_mutex_unlock(&nic->nic_mutex); + } + + if (rc || nic->state != NIC_RUNNING) { + png_c->state = rc; + goto ping_done; + } + + ping_init(png_c, dst_addr, nic_iface->protocol, datalen); + + rc = do_ping_from_nic_iface(png_c); + if (png_c->state == -1) + png_c->state = rc; + +ping_done: + LOG_INFO(PFX "ping thread end"); + nic->ping_thread = INVALID_THREAD; + pthread_exit(NULL); +} + +static int parse_iface(void *arg, int do_ping) { int rc, i; nic_t *nic = NULL; @@ -334,12 +396,17 @@ char ipv6_buf_str[INET6_ADDRSTRLEN]; int request_type = 0; struct iface_rec *rec; - void *res; struct iface_rec_decode ird; struct in_addr src_match, dst_match; + pthread_attr_t attr; + struct ping_conf *png_c; data = (iscsid_uip_broadcast_t *) arg; - rec = &data->u.iface_rec.rec; + if (do_ping) + rec = &data->u.ping_rec.ifrec; + else + rec = &data->u.iface_rec.rec; + LOG_INFO(PFX "Received request for '%s' to set IP address: '%s' " "VLAN: '%d'", rec->netdev, @@ -437,14 +504,18 @@ nic->pending_count++; pthread_mutex_unlock(&nic->nic_mutex); - sleep_req.tv_sec = 0; - sleep_req.tv_nsec = 100000; + sleep_req.tv_sec = 2; + sleep_req.tv_nsec = 0; nanosleep(&sleep_req, &sleep_rem); - LOG_INFO(PFX "%s: enabled pending", nic->log_name); - - rc = -EAGAIN; - goto done; + pthread_mutex_lock(&nic->nic_mutex); + if (!(nic->flags & NIC_ENABLED) || + nic->state != NIC_RUNNING) { + pthread_mutex_unlock(&nic->nic_mutex); + LOG_INFO(PFX "%s: enabled pending", nic->log_name); + rc = -EAGAIN; + goto done; + } } pthread_mutex_unlock(&nic->nic_mutex); @@ -594,7 +665,9 @@ nic_iface->flags |= NIC_IFACE_PATHREQ_WAIT1; if (nic->nl_process_thread == INVALID_THREAD) { - rc = pthread_create(&nic->nl_process_thread, NULL, + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); + rc = pthread_create(&nic->nl_process_thread, &attr, nl_process_handle_thread, nic); if (rc != 0) { LOG_ERR(PFX "%s: Could not create NIC NL " @@ -745,14 +818,16 @@ case NIC_STOPPED: /* This thread will be thrown away when completed */ if (nic->enable_thread != INVALID_THREAD) { - rc = pthread_join(nic->enable_thread, &res); + rc = pthread_cancel(nic->enable_thread); if (rc != 0) { - LOG_INFO(PFX "%s: failed joining enable NIC " + LOG_INFO(PFX "%s: failed to cancel enable NIC " "thread\n", nic->log_name); goto eagain; } } - rc = pthread_create(&nic->enable_thread, NULL, + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); + rc = pthread_create(&nic->enable_thread, &attr, enable_nic_thread, (void *)nic); if (rc != 0) LOG_WARN(PFX "%s: failed starting enable NIC thread\n", @@ -781,6 +856,47 @@ ipv6_buf_str, ird.vlan_id, rec->transport_name); + if (do_ping) { + if (nic->ping_thread != INVALID_THREAD) { + rc = pthread_cancel(nic->ping_thread); + if (rc != 0) { + LOG_INFO(PFX "%s: failed to cancel ping thread", + nic->log_name); + rc = -EAGAIN; + goto done; + } + } + + png_c = malloc(sizeof(struct ping_conf)); + if (!png_c) { + LOG_ERR(PFX "Memory alloc failed for ping conf"); + rc = -ENOMEM; + goto done; + } + + memset(png_c, 0, sizeof(struct ping_conf)); + png_c->nic_iface = nic_iface; + png_c->data = arg; + nic_iface->ustack.ping_conf = png_c; + + /* Spawn a thread to perform ping operation. + * This thread will exit when done. + */ + rc = pthread_create(&nic->ping_thread, NULL, + perform_ping, (void *)png_c); + if (rc != 0) { + LOG_WARN(PFX "%s: failed starting ping thread\n", + nic->log_name); + } else { + pthread_join(nic->ping_thread, NULL); + rc = png_c->state; + if (rc == -EAGAIN) + png_c->state = 0; + } + free(png_c); + nic_iface->ustack.ping_conf = NULL; + } + done: pthread_mutex_unlock(&nic_list_mutex); @@ -832,16 +948,16 @@ LOG_DEBUG(PFX "recv iscsid request: cmd: %d, payload_len: %d", cmd, payload_len); - size = fread(&data->u.iface_rec, payload_len, 1, fd); - if (!size) { - LOG_ERR(PFX "Could not read data: %d(%s)", - errno, strerror(errno)); - goto error; - } - switch (cmd) { case ISCSID_UIP_IPC_GET_IFACE: - rc = parse_iface(data); + size = fread(&data->u.iface_rec, payload_len, 1, fd); + if (!size) { + LOG_ERR(PFX "Could not read data: %d(%s)", + errno, strerror(errno)); + goto error; + } + + rc = parse_iface(data, 0); switch (rc) { case 0: rsp.command = cmd; @@ -857,6 +973,30 @@ } break; + case ISCSID_UIP_IPC_PING: + size = fread(&data->u.ping_rec, payload_len, 1, fd); + if (!size) { + LOG_ERR(PFX "Could not read data: %d(%s)", + errno, strerror(errno)); + goto error; + } + + rc = parse_iface(data, 1); + rsp.command = cmd; + rsp.ping_sc = rc; + + switch (rc) { + case 0: + rsp.err = ISCSID_UIP_MGMT_IPC_DEVICE_UP; + break; + case -EAGAIN: + rsp.err = ISCSID_UIP_MGMT_IPC_DEVICE_INITIALIZING; + break; + default: + rsp.err = ISCSID_UIP_MGMT_IPC_ERR; + } + + break; default: LOG_WARN(PFX "Unknown iscsid broadcast command: %x", data->header.command); @@ -948,6 +1088,30 @@ pthread_exit(NULL); } +#define SD_SOCKET_FDS_START 3 + +static int ipc_systemd(void) +{ + char *env; + + env = getenv("LISTEN_PID"); + + if (!env || (strtoul(env, NULL, 10) != getpid())) + return -EINVAL; + + env = getenv("LISTEN_FDS"); + + if (!env) + return -EINVAL; + + if (strtoul(env, NULL, 10) != 1) { + LOG_ERR("Did not receive exactly one IPC socket from systemd"); + return -EINVAL; + } + + return SD_SOCKET_FDS_START; +} + /****************************************************************************** * Initialize/Cleanup routines ******************************************************************************/ @@ -961,6 +1125,10 @@ int rc, addr_len; struct sockaddr_un addr; + iscsid_opts.fd = ipc_systemd(); + if (iscsid_opts.fd >= 0) + return 0; + iscsid_opts.fd = socket(AF_LOCAL, SOCK_STREAM, 0); if (iscsid_opts.fd < 0) { LOG_ERR(PFX "Can not create IPC socket"); @@ -1001,9 +1169,12 @@ */ int iscsid_start() { + pthread_attr_t attr; int rc; - rc = pthread_create(&iscsid_opts.thread, NULL, iscsid_loop, NULL); + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); + rc = pthread_create(&iscsid_opts.thread, &attr, iscsid_loop, NULL); if (rc != 0) { LOG_ERR(PFX "Could not start iscsid listening thread rc=%d", rc); @@ -1026,7 +1197,6 @@ void iscsid_cleanup() { int rc; - void *res; if (iscsid_opts.fd != INVALID_FD) { rc = pthread_cancel(iscsid_opts.thread); @@ -1034,12 +1204,6 @@ LOG_ERR("Could not cancel iscsid listening thread: %s", strerror(rc)); } - - rc = pthread_join(iscsid_opts.thread, &res); - if (rc != 0) { - LOG_ERR("Could not wait for the iscsid listening " - "thread: %s", strerror(rc)); - } } LOG_INFO(PFX "iscsid listening thread has shutdown"); diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/iscsid_ipc.h open-iscsi-2.0.874/iscsiuio/src/unix/iscsid_ipc.h --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/iscsid_ipc.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/unix/iscsid_ipc.h 2016-09-29 18:33:24.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2009-2011, Broadcom Corporation + * Copyright (c) 2014, QLogic Corporation * * Written by: Benjamin Li (benli@broadcom.com) * diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/libs/bnx2.c open-iscsi-2.0.874/iscsiuio/src/unix/libs/bnx2.c --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/libs/bnx2.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/unix/libs/bnx2.c 2016-09-29 18:33:24.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2009-2011, Broadcom Corporation + * Copyright (c) 2014, QLogic Corporation * * Written by: Benjamin Li (benli@broadcom.com) * @@ -75,20 +76,20 @@ /******************************************************************************* * String constants used to display human readable adapter name ******************************************************************************/ -static const char brcm_5706C[] = "Broadcom NetXtreme II BCM5706 1000Base-T"; +static const char brcm_5706C[] = "QLogic NetXtreme II BCM5706 1000Base-T"; static const char hp_NC370T[] = "HP NC370T Multifunction Gigabit Server Adapter"; static const char hp_NC370I[] = "HP NC370i Multifunction Gigabit Server Adapter"; -static const char brcm_5706S[] = "Broadcom NetXtreme II BCM5706 1000Base-SX"; +static const char brcm_5706S[] = "QLogic NetXtreme II BCM5706 1000Base-SX"; static const char hp_NC370F[] = "HP NC370F Multifunction Gigabit Server Adapter"; -static const char brcm_5708C[] = "Broadcom NetXtreme II BCM5708 1000Base-T"; -static const char brcm_5708S[] = "Broadcom NetXtreme II BCM5708 1000Base-SX"; -static const char brcm_5709C[] = "Broadcom NetXtreme II BCM5709 1000Base-T"; -static const char brcm_5709S[] = "Broadcom NetXtreme II BCM5709 1000Base-SX"; -static const char brcm_5716C[] = "Broadcom NetXtreme II BCM5716 1000Base-T"; -static const char brcm_5716S[] = "Broadcom NetXtreme II BCM5716 1000Base-SX"; +static const char brcm_5708C[] = "QLogic NetXtreme II BCM5708 1000Base-T"; +static const char brcm_5708S[] = "QLogic NetXtreme II BCM5708 1000Base-SX"; +static const char brcm_5709C[] = "QLogic NetXtreme II BCM5709 1000Base-T"; +static const char brcm_5709S[] = "QLogic NetXtreme II BCM5709 1000Base-SX"; +static const char brcm_5716C[] = "QLogic NetXtreme II BCM5716 1000Base-T"; +static const char brcm_5716S[] = "QLogic NetXtreme II BCM5716 1000Base-SX"; /******************************************************************************* * PCI ID constants @@ -1053,7 +1054,7 @@ /* If the NIC passes up a packet bigger * then the RX buffer, flag it */ LOG_ERR(PFX "%s: invalid packet length %d " - "recieve ", nic->log_name, len); + "receive ", nic->log_name, len); } } diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/libs/bnx2.h open-iscsi-2.0.874/iscsiuio/src/unix/libs/bnx2.h --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/libs/bnx2.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/unix/libs/bnx2.h 2016-09-29 18:33:24.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2009-2011, Broadcom Corporation + * Copyright (c) 2014, QLogic Corporation * * Written by: Benjamin Li (benli@broadcom.com) * diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/libs/bnx2x.c open-iscsi-2.0.874/iscsiuio/src/unix/libs/bnx2x.c --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/libs/bnx2x.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/unix/libs/bnx2x.c 2016-09-29 18:33:24.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2009-2011, Broadcom Corporation + * Copyright (c) 2014, QLogic Corporation * * Written by: Benjamin Li (benli@broadcom.com) * @@ -80,45 +81,46 @@ /******************************************************************************* * String constants used to display human readable adapter name ******************************************************************************/ -static const char brcm_57710[] = "Broadcom NetXtreme II BCM57710 10-Gigabit"; -static const char brcm_57711[] = "Broadcom NetXtreme II BCM57711 10-Gigabit"; -static const char brcm_57711e[] = "Broadcom NetXtreme II BCM57711E 10-Gigabit"; -static const char brcm_57712[] = "Broadcom NetXtreme II BCM57712 10-Gigabit"; -static const char brcm_57712_MF[] = "Broadcom NetXtreme II BCM57712 MF " +static const char brcm_57710[] = "QLogic NetXtreme II BCM57710 10-Gigabit"; +static const char brcm_57711[] = "QLogic NetXtreme II BCM57711 10-Gigabit"; +static const char brcm_57711e[] = "QLogic NetXtreme II BCM57711E 10-Gigabit"; +static const char brcm_57712[] = "QLogic NetXtreme II BCM57712 10-Gigabit"; +static const char brcm_57712_MF[] = "QLogic NetXtreme II BCM57712 MF " "10-Gigabit"; -static const char brcm_57712_VF[] = "Broadcom NetXtreme II BCM57712 VF " +static const char brcm_57712_VF[] = "QLogic NetXtreme II BCM57712 VF " "10-Gigabit"; -static const char brcm_57713[] = "Broadcom NetXtreme II BCM57713 10-Gigabit"; -static const char brcm_57713e[] = "Broadcom NetXtreme II BCM57713E 10-Gigabit"; -static const char brcm_57800[] = "Broadcom NetXtreme II BCM57800 10-Gigabit"; -static const char brcm_57800_MF[] = "Broadcom NetXtreme II BCM57800 MF " +static const char brcm_57713[] = "QLogic NetXtreme II BCM57713 10-Gigabit"; +static const char brcm_57713e[] = "QLogic NetXtreme II BCM57713E 10-Gigabit"; +static const char brcm_57800[] = "QLogic NetXtreme II BCM57800 10-Gigabit"; +static const char brcm_57800_MF[] = "QLogic NetXtreme II BCM57800 MF " "10-Gigabit"; -static const char brcm_57800_VF[] = "Broadcom NetXtreme II BCM57800 VF " +static const char brcm_57800_VF[] = "QLogic NetXtreme II BCM57800 VF " "10-Gigabit"; -static const char brcm_57810[] = "Broadcom NetXtreme II BCM57810 10-Gigabit"; -static const char brcm_57810_MF[] = "Broadcom NetXtreme II BCM57810 MF " +static const char brcm_57810[] = "QLogic NetXtreme II BCM57810 10-Gigabit"; +static const char brcm_57810_MF[] = "QLogic NetXtreme II BCM57810 MF " "10-Gigabit"; -static const char brcm_57810_VF[] = "Broadcom NetXtreme II BCM57810 VF " +static const char brcm_57810_VF[] = "QLogic NetXtreme II BCM57810 VF " "10-Gigabit"; -static const char brcm_57811[] = "Broadcom NetXtreme II BCM57811 10-Gigabit"; -static const char brcm_57811_MF[] = "Broadcom NetXtreme II BCM57811 MF " +static const char brcm_57811[] = "QLogic NetXtreme II BCM57811 10-Gigabit"; +static const char brcm_57811_MF[] = "QLogic NetXtreme II BCM57811 MF " "10-Gigabit"; -static const char brcm_57811_VF[] = "Broadcom NetXtreme II BCM57811 VF " +static const char brcm_57811_VF[] = "QLogic NetXtreme II BCM57811 VF " "10-Gigabit"; -static const char brcm_57840[] = "Broadcom NetXtreme II BCM57840 10-Gigabit"; -static const char brcm_57840_MF[] = "Broadcom NetXtreme II BCM57840 MF " +static const char brcm_57840[] = "QLogic NetXtreme II BCM57840 10-Gigabit"; +static const char brcm_57840_MF[] = "QLogic NetXtreme II BCM57840 MF " "10-Gigabit"; -static const char brcm_57840_VF[] = "Broadcom NetXtreme II BCM57840 VF " +static const char brcm_57840_VF[] = "QLogic NetXtreme II BCM57840 VF " "10-Gigabit"; -static const char brcm_57840_4_10[] = "Broadcom NetXtreme II BCM57840 4x" +static const char brcm_57840_4_10[] = "QLogic NetXtreme II BCM57840 4x" "10-Gigabit"; -static const char brcm_57840_2_20[] = "Broadcom NetXtreme II BCM57840 2x" +static const char brcm_57840_2_20[] = "QLogic NetXtreme II BCM57840 2x" "20-Gigabit"; /******************************************************************************* * PCI ID constants ******************************************************************************/ #define PCI_VENDOR_ID_BROADCOM 0x14e4 +#define PCI_VENDOR_ID_QLOGIC 0x1077 #define PCI_DEVICE_ID_NX2_57710 0x164e #define PCI_DEVICE_ID_NX2_57711 0x164f #define PCI_DEVICE_ID_NX2_57711E 0x1650 @@ -193,6 +195,14 @@ PCI_ANY_ID, PCI_ANY_ID, brcm_57840_MF}, {PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_NX2_57840_VF, PCI_ANY_ID, PCI_ANY_ID, brcm_57840_VF}, + {PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_NX2_57840_4_10, + PCI_ANY_ID, PCI_ANY_ID, brcm_57840_4_10}, + {PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_NX2_57840_2_20, + PCI_ANY_ID, PCI_ANY_ID, brcm_57840_2_20}, + {PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_NX2_57840_MF, + PCI_ANY_ID, PCI_ANY_ID, brcm_57840_MF}, + {PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_NX2_57840_VF, + PCI_ANY_ID, PCI_ANY_ID, brcm_57840_VF}, }; static struct iro e1_iro[2] = { @@ -359,6 +369,7 @@ return -EIO; } + memset(&drvinfo, 0, sizeof(drvinfo)); drvinfo.cmd = ETHTOOL_GDRVINFO; ifr.ifr_data = (caddr_t) &drvinfo; rc = ioctl(fd, SIOCETHTOOL, &ifr); @@ -442,7 +453,7 @@ static void bnx2x_flush_doorbell(bnx2x_t *bp, __u32 off) { - volatile __u32 tmp; + volatile __u32 tmp __attribute__((__unused__)); barrier(); tmp = *((volatile __u32 *)(bp->reg2 + off)); @@ -671,6 +682,9 @@ uint32_t bus; uint32_t slot; uint32_t func; + uint32_t mode; + __u32 proto_offset; + __u32 ovtag_offset; /* Sanity Check: validate the parameters */ if (nic == NULL) { @@ -900,8 +914,14 @@ struct client_init_general_data *data = bp->bufs; bp->client_id = data->client_id; - if (data->reserved0) - bp->cid = data->reserved0; + if (data->uid.cid) + bp->cid = data->uid.cid; + if (bp->version.minor >= 78 && bp->version.sub_minor >= 55 && + data->uid.cid_override_key == UIO_USE_TX_DOORBELL) { + bp->tx_doorbell = data->uid.tx_db_off; + LOG_INFO(PFX "%s: tx doorbell override offset = 0x%x", + nic->log_name, bp->tx_doorbell); + } } LOG_INFO(PFX "%s: func 0x%x, pfid 0x%x, client_id 0x%x, cid 0x%x", @@ -928,7 +948,8 @@ USTORM_RX_PRODS_E2_OFFSET(cl_qzone_id) : USTORM_RX_PRODS_E1X_OFFSET(bp->port, bp->client_id)); - bp->tx_doorbell = bp->cid * 0x80 + 0x40; + if (!bp->tx_doorbell) + bp->tx_doorbell = bp->cid * 0x80 + 0x40; bp->get_rx_cons = bnx2x_get_rx_60; bp->get_tx_cons = bnx2x_get_tx_60; @@ -994,9 +1015,11 @@ mf_cfg_addr = bp->shmem_base + 0x7e4; /* shared_feat_cfg.config */ - val = bnx2x_rd32(bp, bp->shmem_base + 0x354); - /* SI mode */ - if ((val & 0x700) == 0x300) { + mode = bnx2x_rd32(bp, bp->shmem_base + 0x354); + mode &= 0x700; + LOG_DEBUG(PFX "%s: mode = 0x%x", nic->log_name, mode); + switch (mode) { + case 0x300: /* SI mode */ mac_offset = 0xe4 + (bp->func * 0x28) + 4; val = bnx2x_rd32(bp, mf_cfg_addr + mac_offset); mac[0] = (__u8) (val >> 8); @@ -1019,9 +1042,13 @@ rc = -ENOTSUP; goto open_error; } - } else if ((val & 0x700) == 0) { - __u32 proto_offset = 0x24 + (bp->func * 0x18); - __u32 ovtag_offset = proto_offset + 0xc; + break; + + case 0x0: /* MF SD mode */ + case 0x500: + case 0x600: + proto_offset = 0x24 + (bp->func * 0x18); + ovtag_offset = proto_offset + 0xc; rc = -ENOTSUP; val = bnx2x_rd32(bp, mf_cfg_addr + ovtag_offset); @@ -1049,7 +1076,7 @@ mac[4] = (__u8) (val >> 8); mac[5] = (__u8) val; memcpy(nic->mac_addr, mac, 6); - + break; } } SF: diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/libs/bnx2x.h open-iscsi-2.0.874/iscsiuio/src/unix/libs/bnx2x.h --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/libs/bnx2x.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/unix/libs/bnx2x.h 2016-09-29 18:33:24.000000000 +0000 @@ -382,6 +382,13 @@ struct eth_rx_cqe_next_page_70 next_page_cqe_70; }; +struct uio_init_data { + __u32 cid; + __u32 tx_db_off; + __u32 cid_override_key; +#define UIO_USE_TX_DOORBELL 0x017855DB +}; + struct client_init_general_data { __u8 client_id; __u8 statistics_counter_id; @@ -394,7 +401,7 @@ __u8 func_id; __u8 cos; __u8 traffic_type; - __u32 reserved0; + struct uio_init_data uid; }; /****************************************************************************** diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/libs/cnic.c open-iscsi-2.0.874/iscsiuio/src/unix/libs/cnic.c --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/libs/cnic.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/unix/libs/cnic.c 2016-09-29 18:33:24.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2009-2011, Broadcom Corporation + * Copyright (c) 2014, QLogic Corporation * * Written by: Benjamin Li (benli@broadcom.com) * @@ -426,8 +427,10 @@ if (status != 0 || rc != 0) pthread_mutex_unlock(&nic->xmit_mutex); - cnic_nl_neigh_rsp(nic, fd, ev, path, mac_addr, - nic_iface, status, AF_INET); + if (ev) { + cnic_nl_neigh_rsp(nic, fd, ev, path, mac_addr, + nic_iface, status, AF_INET); + } return rc; } @@ -623,8 +626,10 @@ if (status != 0 || rc != 0) pthread_mutex_unlock(&nic->xmit_mutex); - cnic_nl_neigh_rsp(nic, fd, ev, path, mac_addr, - nic_iface, status, AF_INET6); + if (ev) { + cnic_nl_neigh_rsp(nic, fd, ev, path, mac_addr, + nic_iface, status, AF_INET6); + } return rc; } diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/libs/cnic.h open-iscsi-2.0.874/iscsiuio/src/unix/libs/cnic.h --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/libs/cnic.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/unix/libs/cnic.h 2016-09-29 18:33:24.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2009-2011, Broadcom Corporation + * Copyright (c) 2014, QLogic Corporation * * Written by: Benjamin Li (benli@broadcom.com) * diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/libs/Makefile.am open-iscsi-2.0.874/iscsiuio/src/unix/libs/Makefile.am --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/libs/Makefile.am 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/unix/libs/Makefile.am 2016-09-29 18:33:24.000000000 +0000 @@ -1,4 +1,4 @@ -INCLUDES = -I${top_srcdir}/src/uip \ +AM_CFLAGS = -I${top_srcdir}/src/uip \ -I${top_srcdir}/src/unix \ -I${top_srcdir}/src/unix/libs \ -I${top_srcdir}/src/apps/dhcpc \ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/libs/Makefile.in open-iscsi-2.0.874/iscsiuio/src/unix/libs/Makefile.in --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/libs/Makefile.in 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/unix/libs/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,450 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../.. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = src/unix/libs -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) -ARFLAGS = cru -lib_iscsiuio_hw_cnic_a_AR = $(AR) $(ARFLAGS) -lib_iscsiuio_hw_cnic_a_LIBADD = -am_lib_iscsiuio_hw_cnic_a_OBJECTS = build_date.$(OBJEXT) \ - cnic.$(OBJEXT) bnx2.$(OBJEXT) bnx2x.$(OBJEXT) -lib_iscsiuio_hw_cnic_a_OBJECTS = $(am_lib_iscsiuio_hw_cnic_a_OBJECTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(lib_iscsiuio_hw_cnic_a_SOURCES) -DIST_SOURCES = $(lib_iscsiuio_hw_cnic_a_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BASH = @BASH@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ENDIAN = @ENDIAN@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -INCLUDES = -I${top_srcdir}/src/uip \ - -I${top_srcdir}/src/unix \ - -I${top_srcdir}/src/unix/libs \ - -I${top_srcdir}/src/apps/dhcpc \ - -I${top_srcdir}/../include \ - -I${top_srcdir}/../usr - -noinst_LIBRARIES = lib_iscsiuio_hw_cnic.a -lib_iscsiuio_hw_cnic_a_SOURCES = ../build_date.c \ - cnic.c \ - bnx2.c \ - bnx2x.c - -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/unix/libs/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/unix/libs/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) -lib_iscsiuio_hw_cnic.a: $(lib_iscsiuio_hw_cnic_a_OBJECTS) $(lib_iscsiuio_hw_cnic_a_DEPENDENCIES) - -rm -f lib_iscsiuio_hw_cnic.a - $(lib_iscsiuio_hw_cnic_a_AR) lib_iscsiuio_hw_cnic.a $(lib_iscsiuio_hw_cnic_a_OBJECTS) $(lib_iscsiuio_hw_cnic_a_LIBADD) - $(RANLIB) lib_iscsiuio_hw_cnic.a - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bnx2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bnx2x.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/build_date.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cnic.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< - -build_date.o: ../build_date.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT build_date.o -MD -MP -MF "$(DEPDIR)/build_date.Tpo" -c -o build_date.o `test -f '../build_date.c' || echo '$(srcdir)/'`../build_date.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/build_date.Tpo" "$(DEPDIR)/build_date.Po"; else rm -f "$(DEPDIR)/build_date.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../build_date.c' object='build_date.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o build_date.o `test -f '../build_date.c' || echo '$(srcdir)/'`../build_date.c - -build_date.obj: ../build_date.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT build_date.obj -MD -MP -MF "$(DEPDIR)/build_date.Tpo" -c -o build_date.obj `if test -f '../build_date.c'; then $(CYGPATH_W) '../build_date.c'; else $(CYGPATH_W) '$(srcdir)/../build_date.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/build_date.Tpo" "$(DEPDIR)/build_date.Po"; else rm -f "$(DEPDIR)/build_date.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../build_date.c' object='build_date.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o build_date.obj `if test -f '../build_date.c'; then $(CYGPATH_W) '../build_date.c'; else $(CYGPATH_W) '$(srcdir)/../build_date.c'; fi` - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LIBRARIES) -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am \ - uninstall-info-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/logger.c open-iscsi-2.0.874/iscsiuio/src/unix/logger.c --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/logger.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/unix/logger.c 2016-09-29 18:33:24.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2009-2011, Broadcom Corporation + * Copyright (c) 2014, QLogic Corporation * * Written by: Benjamin Li (benli@broadcom.com) * diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/logger.h open-iscsi-2.0.874/iscsiuio/src/unix/logger.h --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/logger.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/unix/logger.h 2016-09-29 18:33:24.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2009-2011, Broadcom Corporation + * Copyright (c) 2014, QLogic Corporation * * Written by: Benjamin Li (benli@broadcom.com) * diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/main.c open-iscsi-2.0.874/iscsiuio/src/unix/main.c --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/main.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/unix/main.c 2016-09-29 18:33:24.000000000 +0000 @@ -181,7 +181,6 @@ static void daemon_init() { int fd; - int rc; fd = open("/dev/null", O_RDWR); if (fd == -1) @@ -191,7 +190,7 @@ dup2(fd, 1); dup2(fd, 2); setsid(); - rc = chdir("/"); + chdir("/"); } #define ISCSI_OOM_PATH_LEN 48 @@ -233,10 +232,11 @@ { int rc; sigset_t set; - char *pid_file = default_pid_filepath; + const char *pid_file = default_pid_filepath; int fd; int foreground = 0; pid_t pid; + pthread_attr_t attr; /* Record the start time for the user space daemon */ opt.start_time = time(NULL); @@ -366,7 +366,9 @@ rc = pthread_sigmask(SIG_SETMASK, &set, NULL); /* Spin off the signal handling thread */ - rc = pthread_create(&signal_thread, NULL, signal_handle_thread, NULL); + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); + rc = pthread_create(&signal_thread, &attr, signal_handle_thread, NULL); if (rc != 0) LOG_ERR("Could not create signal handling thread"); diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/Makefile.am open-iscsi-2.0.874/iscsiuio/src/unix/Makefile.am --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/Makefile.am 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/unix/Makefile.am 2016-09-29 18:33:24.000000000 +0000 @@ -1,6 +1,6 @@ SUBDIRS= libs -INCLUDES = -I${top_srcdir}/src/uip \ +AM_CFLAGS = -I${top_srcdir}/src/uip \ -I${top_srcdir}/src/apps/brcm-iscsi \ -I${top_srcdir}/src/apps/dhcpc \ -I${top_srcdir}/src/unix/libs \ @@ -19,7 +19,8 @@ nic_nl.c \ nic_utils.c \ packet.c \ - iscsid_ipc.c + iscsid_ipc.c \ + ping.c iscsiuio_CFLAGS = $(AM_CFLAGS) \ $(LIBNL_CFLAGS) \ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/Makefile.in open-iscsi-2.0.874/iscsiuio/src/unix/Makefile.in --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/Makefile.in 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/unix/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,767 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../.. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -sbin_PROGRAMS = iscsiuio$(EXEEXT) -subdir = src/unix -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -am__installdirs = "$(DESTDIR)$(sbindir)" -sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) -PROGRAMS = $(sbin_PROGRAMS) -am_iscsiuio_OBJECTS = iscsiuio-build_date.$(OBJEXT) \ - iscsiuio-main.$(OBJEXT) iscsiuio-clock-arch.$(OBJEXT) \ - iscsiuio-logger.$(OBJEXT) iscsiuio-nic.$(OBJEXT) \ - iscsiuio-nic_id.$(OBJEXT) iscsiuio-nic_vlan.$(OBJEXT) \ - iscsiuio-nic_nl.$(OBJEXT) iscsiuio-nic_utils.$(OBJEXT) \ - iscsiuio-packet.$(OBJEXT) iscsiuio-iscsid_ipc.$(OBJEXT) -iscsiuio_OBJECTS = $(am_iscsiuio_OBJECTS) -iscsiuio_DEPENDENCIES = ${top_srcdir}/src/uip/lib_iscsi_uip.a \ - ${top_srcdir}/src/apps/dhcpc/lib_apps_dhcpc.a \ - ${top_srcdir}/src/apps/brcm-iscsi/lib_apps_brcm_iscsi.a \ - ${top_srcdir}/src/unix/libs/lib_iscsiuio_hw_cnic.a -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(iscsiuio_SOURCES) -DIST_SOURCES = $(iscsiuio_SOURCES) -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-exec-recursive install-info-recursive \ - install-recursive installcheck-recursive installdirs-recursive \ - pdf-recursive ps-recursive uninstall-info-recursive \ - uninstall-recursive -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BASH = @BASH@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -ENDIAN = @ENDIAN@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -SUBDIRS = libs -INCLUDES = -I${top_srcdir}/src/uip \ - -I${top_srcdir}/src/apps/brcm-iscsi \ - -I${top_srcdir}/src/apps/dhcpc \ - -I${top_srcdir}/src/unix/libs \ - -I${top_srcdir}/../include \ - -I${top_srcdir}/../usr - -iscsiuio_SOURCES = build_date.c \ - main.c \ - clock-arch.c \ - logger.c \ - nic.c \ - nic_id.c \ - nic_vlan.c \ - nic_nl.c \ - nic_utils.c \ - packet.c \ - iscsid_ipc.c - -iscsiuio_CFLAGS = $(AM_CFLAGS) \ - $(LIBNL_CFLAGS) \ - -DBYTE_ORDER=@ENDIAN@ - -iscsiuio_LDFLAGS = $(AM_LDADD) \ - -ldl \ - -rdynamic \ - $(LIBNL_LIBS) \ - -lpthread - -iscsiuio_LDADD = ${top_srcdir}/src/uip/lib_iscsi_uip.a \ - ${top_srcdir}/src/apps/dhcpc/lib_apps_dhcpc.a\ - ${top_srcdir}/src/apps/brcm-iscsi/lib_apps_brcm_iscsi.a \ - ${top_srcdir}/src/unix/libs/lib_iscsiuio_hw_cnic.a - -iscsiuio_YFLAGS = -d -all: all-recursive - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/unix/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/unix/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -install-sbinPROGRAMS: $(sbin_PROGRAMS) - @$(NORMAL_INSTALL) - test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)" - @list='$(sbin_PROGRAMS)'; for p in $$list; do \ - p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - if test -f $$p \ - || test -f $$p1 \ - ; then \ - f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \ - else :; fi; \ - done - -uninstall-sbinPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(sbin_PROGRAMS)'; for p in $$list; do \ - f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \ - rm -f "$(DESTDIR)$(sbindir)/$$f"; \ - done - -clean-sbinPROGRAMS: - @list='$(sbin_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f $$p $$f"; \ - rm -f $$p $$f ; \ - done -iscsiuio$(EXEEXT): $(iscsiuio_OBJECTS) $(iscsiuio_DEPENDENCIES) - @rm -f iscsiuio$(EXEEXT) - $(LINK) $(iscsiuio_LDFLAGS) $(iscsiuio_OBJECTS) $(iscsiuio_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iscsiuio-build_date.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iscsiuio-clock-arch.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iscsiuio-iscsid_ipc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iscsiuio-logger.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iscsiuio-main.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iscsiuio-nic.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iscsiuio-nic_id.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iscsiuio-nic_nl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iscsiuio-nic_utils.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iscsiuio-nic_vlan.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iscsiuio-packet.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< - -iscsiuio-build_date.o: build_date.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -MT iscsiuio-build_date.o -MD -MP -MF "$(DEPDIR)/iscsiuio-build_date.Tpo" -c -o iscsiuio-build_date.o `test -f 'build_date.c' || echo '$(srcdir)/'`build_date.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/iscsiuio-build_date.Tpo" "$(DEPDIR)/iscsiuio-build_date.Po"; else rm -f "$(DEPDIR)/iscsiuio-build_date.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='build_date.c' object='iscsiuio-build_date.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -c -o iscsiuio-build_date.o `test -f 'build_date.c' || echo '$(srcdir)/'`build_date.c - -iscsiuio-build_date.obj: build_date.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -MT iscsiuio-build_date.obj -MD -MP -MF "$(DEPDIR)/iscsiuio-build_date.Tpo" -c -o iscsiuio-build_date.obj `if test -f 'build_date.c'; then $(CYGPATH_W) 'build_date.c'; else $(CYGPATH_W) '$(srcdir)/build_date.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/iscsiuio-build_date.Tpo" "$(DEPDIR)/iscsiuio-build_date.Po"; else rm -f "$(DEPDIR)/iscsiuio-build_date.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='build_date.c' object='iscsiuio-build_date.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -c -o iscsiuio-build_date.obj `if test -f 'build_date.c'; then $(CYGPATH_W) 'build_date.c'; else $(CYGPATH_W) '$(srcdir)/build_date.c'; fi` - -iscsiuio-main.o: main.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -MT iscsiuio-main.o -MD -MP -MF "$(DEPDIR)/iscsiuio-main.Tpo" -c -o iscsiuio-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/iscsiuio-main.Tpo" "$(DEPDIR)/iscsiuio-main.Po"; else rm -f "$(DEPDIR)/iscsiuio-main.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='main.c' object='iscsiuio-main.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -c -o iscsiuio-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c - -iscsiuio-main.obj: main.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -MT iscsiuio-main.obj -MD -MP -MF "$(DEPDIR)/iscsiuio-main.Tpo" -c -o iscsiuio-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/iscsiuio-main.Tpo" "$(DEPDIR)/iscsiuio-main.Po"; else rm -f "$(DEPDIR)/iscsiuio-main.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='main.c' object='iscsiuio-main.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -c -o iscsiuio-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` - -iscsiuio-clock-arch.o: clock-arch.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -MT iscsiuio-clock-arch.o -MD -MP -MF "$(DEPDIR)/iscsiuio-clock-arch.Tpo" -c -o iscsiuio-clock-arch.o `test -f 'clock-arch.c' || echo '$(srcdir)/'`clock-arch.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/iscsiuio-clock-arch.Tpo" "$(DEPDIR)/iscsiuio-clock-arch.Po"; else rm -f "$(DEPDIR)/iscsiuio-clock-arch.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='clock-arch.c' object='iscsiuio-clock-arch.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -c -o iscsiuio-clock-arch.o `test -f 'clock-arch.c' || echo '$(srcdir)/'`clock-arch.c - -iscsiuio-clock-arch.obj: clock-arch.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -MT iscsiuio-clock-arch.obj -MD -MP -MF "$(DEPDIR)/iscsiuio-clock-arch.Tpo" -c -o iscsiuio-clock-arch.obj `if test -f 'clock-arch.c'; then $(CYGPATH_W) 'clock-arch.c'; else $(CYGPATH_W) '$(srcdir)/clock-arch.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/iscsiuio-clock-arch.Tpo" "$(DEPDIR)/iscsiuio-clock-arch.Po"; else rm -f "$(DEPDIR)/iscsiuio-clock-arch.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='clock-arch.c' object='iscsiuio-clock-arch.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -c -o iscsiuio-clock-arch.obj `if test -f 'clock-arch.c'; then $(CYGPATH_W) 'clock-arch.c'; else $(CYGPATH_W) '$(srcdir)/clock-arch.c'; fi` - -iscsiuio-logger.o: logger.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -MT iscsiuio-logger.o -MD -MP -MF "$(DEPDIR)/iscsiuio-logger.Tpo" -c -o iscsiuio-logger.o `test -f 'logger.c' || echo '$(srcdir)/'`logger.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/iscsiuio-logger.Tpo" "$(DEPDIR)/iscsiuio-logger.Po"; else rm -f "$(DEPDIR)/iscsiuio-logger.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='logger.c' object='iscsiuio-logger.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -c -o iscsiuio-logger.o `test -f 'logger.c' || echo '$(srcdir)/'`logger.c - -iscsiuio-logger.obj: logger.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -MT iscsiuio-logger.obj -MD -MP -MF "$(DEPDIR)/iscsiuio-logger.Tpo" -c -o iscsiuio-logger.obj `if test -f 'logger.c'; then $(CYGPATH_W) 'logger.c'; else $(CYGPATH_W) '$(srcdir)/logger.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/iscsiuio-logger.Tpo" "$(DEPDIR)/iscsiuio-logger.Po"; else rm -f "$(DEPDIR)/iscsiuio-logger.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='logger.c' object='iscsiuio-logger.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -c -o iscsiuio-logger.obj `if test -f 'logger.c'; then $(CYGPATH_W) 'logger.c'; else $(CYGPATH_W) '$(srcdir)/logger.c'; fi` - -iscsiuio-nic.o: nic.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -MT iscsiuio-nic.o -MD -MP -MF "$(DEPDIR)/iscsiuio-nic.Tpo" -c -o iscsiuio-nic.o `test -f 'nic.c' || echo '$(srcdir)/'`nic.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/iscsiuio-nic.Tpo" "$(DEPDIR)/iscsiuio-nic.Po"; else rm -f "$(DEPDIR)/iscsiuio-nic.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nic.c' object='iscsiuio-nic.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -c -o iscsiuio-nic.o `test -f 'nic.c' || echo '$(srcdir)/'`nic.c - -iscsiuio-nic.obj: nic.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -MT iscsiuio-nic.obj -MD -MP -MF "$(DEPDIR)/iscsiuio-nic.Tpo" -c -o iscsiuio-nic.obj `if test -f 'nic.c'; then $(CYGPATH_W) 'nic.c'; else $(CYGPATH_W) '$(srcdir)/nic.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/iscsiuio-nic.Tpo" "$(DEPDIR)/iscsiuio-nic.Po"; else rm -f "$(DEPDIR)/iscsiuio-nic.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nic.c' object='iscsiuio-nic.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -c -o iscsiuio-nic.obj `if test -f 'nic.c'; then $(CYGPATH_W) 'nic.c'; else $(CYGPATH_W) '$(srcdir)/nic.c'; fi` - -iscsiuio-nic_id.o: nic_id.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -MT iscsiuio-nic_id.o -MD -MP -MF "$(DEPDIR)/iscsiuio-nic_id.Tpo" -c -o iscsiuio-nic_id.o `test -f 'nic_id.c' || echo '$(srcdir)/'`nic_id.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/iscsiuio-nic_id.Tpo" "$(DEPDIR)/iscsiuio-nic_id.Po"; else rm -f "$(DEPDIR)/iscsiuio-nic_id.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nic_id.c' object='iscsiuio-nic_id.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -c -o iscsiuio-nic_id.o `test -f 'nic_id.c' || echo '$(srcdir)/'`nic_id.c - -iscsiuio-nic_id.obj: nic_id.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -MT iscsiuio-nic_id.obj -MD -MP -MF "$(DEPDIR)/iscsiuio-nic_id.Tpo" -c -o iscsiuio-nic_id.obj `if test -f 'nic_id.c'; then $(CYGPATH_W) 'nic_id.c'; else $(CYGPATH_W) '$(srcdir)/nic_id.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/iscsiuio-nic_id.Tpo" "$(DEPDIR)/iscsiuio-nic_id.Po"; else rm -f "$(DEPDIR)/iscsiuio-nic_id.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nic_id.c' object='iscsiuio-nic_id.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -c -o iscsiuio-nic_id.obj `if test -f 'nic_id.c'; then $(CYGPATH_W) 'nic_id.c'; else $(CYGPATH_W) '$(srcdir)/nic_id.c'; fi` - -iscsiuio-nic_vlan.o: nic_vlan.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -MT iscsiuio-nic_vlan.o -MD -MP -MF "$(DEPDIR)/iscsiuio-nic_vlan.Tpo" -c -o iscsiuio-nic_vlan.o `test -f 'nic_vlan.c' || echo '$(srcdir)/'`nic_vlan.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/iscsiuio-nic_vlan.Tpo" "$(DEPDIR)/iscsiuio-nic_vlan.Po"; else rm -f "$(DEPDIR)/iscsiuio-nic_vlan.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nic_vlan.c' object='iscsiuio-nic_vlan.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -c -o iscsiuio-nic_vlan.o `test -f 'nic_vlan.c' || echo '$(srcdir)/'`nic_vlan.c - -iscsiuio-nic_vlan.obj: nic_vlan.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -MT iscsiuio-nic_vlan.obj -MD -MP -MF "$(DEPDIR)/iscsiuio-nic_vlan.Tpo" -c -o iscsiuio-nic_vlan.obj `if test -f 'nic_vlan.c'; then $(CYGPATH_W) 'nic_vlan.c'; else $(CYGPATH_W) '$(srcdir)/nic_vlan.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/iscsiuio-nic_vlan.Tpo" "$(DEPDIR)/iscsiuio-nic_vlan.Po"; else rm -f "$(DEPDIR)/iscsiuio-nic_vlan.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nic_vlan.c' object='iscsiuio-nic_vlan.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -c -o iscsiuio-nic_vlan.obj `if test -f 'nic_vlan.c'; then $(CYGPATH_W) 'nic_vlan.c'; else $(CYGPATH_W) '$(srcdir)/nic_vlan.c'; fi` - -iscsiuio-nic_nl.o: nic_nl.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -MT iscsiuio-nic_nl.o -MD -MP -MF "$(DEPDIR)/iscsiuio-nic_nl.Tpo" -c -o iscsiuio-nic_nl.o `test -f 'nic_nl.c' || echo '$(srcdir)/'`nic_nl.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/iscsiuio-nic_nl.Tpo" "$(DEPDIR)/iscsiuio-nic_nl.Po"; else rm -f "$(DEPDIR)/iscsiuio-nic_nl.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nic_nl.c' object='iscsiuio-nic_nl.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -c -o iscsiuio-nic_nl.o `test -f 'nic_nl.c' || echo '$(srcdir)/'`nic_nl.c - -iscsiuio-nic_nl.obj: nic_nl.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -MT iscsiuio-nic_nl.obj -MD -MP -MF "$(DEPDIR)/iscsiuio-nic_nl.Tpo" -c -o iscsiuio-nic_nl.obj `if test -f 'nic_nl.c'; then $(CYGPATH_W) 'nic_nl.c'; else $(CYGPATH_W) '$(srcdir)/nic_nl.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/iscsiuio-nic_nl.Tpo" "$(DEPDIR)/iscsiuio-nic_nl.Po"; else rm -f "$(DEPDIR)/iscsiuio-nic_nl.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nic_nl.c' object='iscsiuio-nic_nl.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -c -o iscsiuio-nic_nl.obj `if test -f 'nic_nl.c'; then $(CYGPATH_W) 'nic_nl.c'; else $(CYGPATH_W) '$(srcdir)/nic_nl.c'; fi` - -iscsiuio-nic_utils.o: nic_utils.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -MT iscsiuio-nic_utils.o -MD -MP -MF "$(DEPDIR)/iscsiuio-nic_utils.Tpo" -c -o iscsiuio-nic_utils.o `test -f 'nic_utils.c' || echo '$(srcdir)/'`nic_utils.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/iscsiuio-nic_utils.Tpo" "$(DEPDIR)/iscsiuio-nic_utils.Po"; else rm -f "$(DEPDIR)/iscsiuio-nic_utils.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nic_utils.c' object='iscsiuio-nic_utils.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -c -o iscsiuio-nic_utils.o `test -f 'nic_utils.c' || echo '$(srcdir)/'`nic_utils.c - -iscsiuio-nic_utils.obj: nic_utils.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -MT iscsiuio-nic_utils.obj -MD -MP -MF "$(DEPDIR)/iscsiuio-nic_utils.Tpo" -c -o iscsiuio-nic_utils.obj `if test -f 'nic_utils.c'; then $(CYGPATH_W) 'nic_utils.c'; else $(CYGPATH_W) '$(srcdir)/nic_utils.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/iscsiuio-nic_utils.Tpo" "$(DEPDIR)/iscsiuio-nic_utils.Po"; else rm -f "$(DEPDIR)/iscsiuio-nic_utils.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='nic_utils.c' object='iscsiuio-nic_utils.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -c -o iscsiuio-nic_utils.obj `if test -f 'nic_utils.c'; then $(CYGPATH_W) 'nic_utils.c'; else $(CYGPATH_W) '$(srcdir)/nic_utils.c'; fi` - -iscsiuio-packet.o: packet.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -MT iscsiuio-packet.o -MD -MP -MF "$(DEPDIR)/iscsiuio-packet.Tpo" -c -o iscsiuio-packet.o `test -f 'packet.c' || echo '$(srcdir)/'`packet.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/iscsiuio-packet.Tpo" "$(DEPDIR)/iscsiuio-packet.Po"; else rm -f "$(DEPDIR)/iscsiuio-packet.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='packet.c' object='iscsiuio-packet.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -c -o iscsiuio-packet.o `test -f 'packet.c' || echo '$(srcdir)/'`packet.c - -iscsiuio-packet.obj: packet.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -MT iscsiuio-packet.obj -MD -MP -MF "$(DEPDIR)/iscsiuio-packet.Tpo" -c -o iscsiuio-packet.obj `if test -f 'packet.c'; then $(CYGPATH_W) 'packet.c'; else $(CYGPATH_W) '$(srcdir)/packet.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/iscsiuio-packet.Tpo" "$(DEPDIR)/iscsiuio-packet.Po"; else rm -f "$(DEPDIR)/iscsiuio-packet.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='packet.c' object='iscsiuio-packet.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -c -o iscsiuio-packet.obj `if test -f 'packet.c'; then $(CYGPATH_W) 'packet.c'; else $(CYGPATH_W) '$(srcdir)/packet.c'; fi` - -iscsiuio-iscsid_ipc.o: iscsid_ipc.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -MT iscsiuio-iscsid_ipc.o -MD -MP -MF "$(DEPDIR)/iscsiuio-iscsid_ipc.Tpo" -c -o iscsiuio-iscsid_ipc.o `test -f 'iscsid_ipc.c' || echo '$(srcdir)/'`iscsid_ipc.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/iscsiuio-iscsid_ipc.Tpo" "$(DEPDIR)/iscsiuio-iscsid_ipc.Po"; else rm -f "$(DEPDIR)/iscsiuio-iscsid_ipc.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='iscsid_ipc.c' object='iscsiuio-iscsid_ipc.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -c -o iscsiuio-iscsid_ipc.o `test -f 'iscsid_ipc.c' || echo '$(srcdir)/'`iscsid_ipc.c - -iscsiuio-iscsid_ipc.obj: iscsid_ipc.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -MT iscsiuio-iscsid_ipc.obj -MD -MP -MF "$(DEPDIR)/iscsiuio-iscsid_ipc.Tpo" -c -o iscsiuio-iscsid_ipc.obj `if test -f 'iscsid_ipc.c'; then $(CYGPATH_W) 'iscsid_ipc.c'; else $(CYGPATH_W) '$(srcdir)/iscsid_ipc.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/iscsiuio-iscsid_ipc.Tpo" "$(DEPDIR)/iscsiuio-iscsid_ipc.Po"; else rm -f "$(DEPDIR)/iscsiuio-iscsid_ipc.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='iscsid_ipc.c' object='iscsiuio-iscsid_ipc.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(iscsiuio_CFLAGS) $(CFLAGS) -c -o iscsiuio-iscsid_ipc.obj `if test -f 'iscsid_ipc.c'; then $(CYGPATH_W) 'iscsid_ipc.c'; else $(CYGPATH_W) '$(srcdir)/iscsid_ipc.c'; fi` - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done - list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(mkdir_p) "$(distdir)/$$subdir" \ - || exit 1; \ - distdir=`$(am__cd) $(distdir) && pwd`; \ - top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ - (cd $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$top_distdir" \ - distdir="$$distdir/$$subdir" \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile $(PROGRAMS) -installdirs: installdirs-recursive -installdirs-am: - for dir in "$(DESTDIR)$(sbindir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ - done -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ - mostlyclean-am - -distclean: distclean-recursive - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -info: info-recursive - -info-am: - -install-data-am: - -install-exec-am: install-sbinPROGRAMS - -install-info: install-info-recursive - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: uninstall-info-am uninstall-sbinPROGRAMS - -uninstall-info: uninstall-info-recursive - -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ - clean clean-generic clean-libtool clean-recursive \ - clean-sbinPROGRAMS ctags ctags-recursive distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-recursive distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-exec install-exec-am install-info \ - install-info-am install-man install-sbinPROGRAMS install-strip \ - installcheck installcheck-am installdirs installdirs-am \ - maintainer-clean maintainer-clean-generic \ - maintainer-clean-recursive mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \ - pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ - uninstall-info-am uninstall-sbinPROGRAMS - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/nic.c open-iscsi-2.0.874/iscsiuio/src/unix/nic.c --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/nic.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/unix/nic.c 2016-09-29 18:33:24.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2009-2011, Broadcom Corporation + * Copyright (c) 2014, QLogic Corporation * * Written by: Benjamin Li (benli@broadcom.com) * @@ -151,7 +152,6 @@ /* Validate the NIC library ops table to ensure that all the proper * fields are filled */ if ((handle->ops->lib_ops.get_library_name == NULL) || - (handle->ops->lib_ops.get_pci_table == NULL) || (handle->ops->lib_ops.get_library_version == NULL) || (handle->ops->lib_ops.get_build_date == NULL) || (handle->ops->lib_ops.get_transport_name == NULL)) { @@ -246,7 +246,8 @@ return 0; } -NIC_LIBRARY_EXIST_T does_nic_uio_name_exist(char *name) +NIC_LIBRARY_EXIST_T does_nic_uio_name_exist(char *name, + nic_lib_handle_t **handle) { NIC_LIBRARY_EXIST_T rc; nic_lib_handle_t *current; @@ -262,6 +263,9 @@ &uio_name_size); if (strncmp(name, uio_name, uio_name_size) == 0) { + if (handle) + *handle = current; + rc = NIC_LIBRARY_EXSITS; goto done; } @@ -276,7 +280,8 @@ return rc; } -NIC_LIBRARY_EXIST_T does_nic_library_exist(char *name) +NIC_LIBRARY_EXIST_T does_nic_library_exist(char *name, + nic_lib_handle_t **handle) { NIC_LIBRARY_EXIST_T rc; nic_lib_handle_t *current; @@ -292,6 +297,9 @@ &library_name_size); if (strncmp(name, library_name, library_name_size) == 0) { + if (handle) + *handle = current; + rc = NIC_LIBRARY_EXSITS; goto done; } @@ -332,8 +340,13 @@ uint32_t entries; int i; - current->ops->lib_ops.get_pci_table(&pci_table, &entries); - + if (current->ops->lib_ops.get_pci_table != NULL) { + current->ops->lib_ops.get_pci_table(&pci_table, + &entries); + } else { + current = current->next; + continue; + } /* Sanity check the the pci table coming from the * hardware library */ if (entries > MAX_PCI_DEVICE_ENTRIES) { @@ -423,6 +436,8 @@ nic->nl_process_tail = 0; memset(&nic->nl_process_ring, 0, sizeof(nic->nl_process_ring)); + nic->ping_thread = INVALID_THREAD; + return nic; } @@ -450,15 +465,16 @@ int rc; nic_t *prev, *current; struct stat file_stat; - void *res; nic_interface_t *nic_iface, *next_nic_iface, *vlan_iface; pthread_mutex_lock(&nic->nic_mutex); /* Check if the file node exists before closing */ - rc = stat(nic->uio_device_name, &file_stat); - if ((rc == 0) && (nic->ops)) - nic->ops->close(nic, 0); + if (nic->uio_device_name) { + rc = stat(nic->uio_device_name, &file_stat); + if ((rc == 0) && (nic->ops)) + nic->ops->close(nic, 0); + } pthread_mutex_unlock(&nic->nic_mutex); nic->state = NIC_EXIT; @@ -471,12 +487,6 @@ LOG_DEBUG(PFX "%s: Couldn't send cancel to nic enable " "thread", nic->log_name); - LOG_DEBUG(PFX "%s: Waiting to join nic enable thread", - nic->log_name); - rc = pthread_join(nic->enable_thread, &res); - if (rc != 0) - LOG_DEBUG(PFX "%s: Couldn't join to canceled enable " - "nic thread", nic->log_name); nic->enable_thread = INVALID_THREAD; LOG_DEBUG(PFX "%s: nic enable thread cleaned", nic->log_name); } else { @@ -492,11 +502,6 @@ LOG_DEBUG(PFX "%s: Couldn't send cancel to nic", nic->log_name); - LOG_DEBUG(PFX "%s: Waiting to join nic thread", nic->log_name); - rc = pthread_join(nic->thread, &res); - if (rc != 0) - LOG_DEBUG(PFX "%s: Couldn't join to canceled nic " - "thread", nic->log_name); nic->thread = INVALID_THREAD; LOG_DEBUG(PFX "%s: nic thread cleaned", nic->log_name); } else { @@ -511,12 +516,6 @@ LOG_DEBUG(PFX "%s: Couldn't send cancel to nic nl " "thread", nic->log_name); - LOG_DEBUG(PFX "%s: Waiting to join nic nl thread", - nic->log_name); - rc = pthread_join(nic->nl_process_thread, &res); - if (rc != 0) - LOG_DEBUG(PFX "%s: Couldn't join to canceled nic nl " - "thread", nic->log_name); nic->nl_process_thread = INVALID_THREAD; LOG_DEBUG(PFX "%s: nic nl thread cleaned", nic->log_name); } else { @@ -736,7 +735,7 @@ /* Simple sanity checks */ if (discard_check != 1 && nic->state != NIC_RUNNING) { - LOG_ERR(PFX "%s: Couldn't process interupt NIC not running", + LOG_ERR(PFX "%s: Couldn't process interrupt NIC not running", nic->log_name); return -EBUSY; } @@ -806,9 +805,9 @@ return ret; } -static void prepare_ipv4_packet(nic_t *nic, - nic_interface_t *nic_iface, - struct uip_stack *ustack, packet_t *pkt) +void prepare_ipv4_packet(nic_t *nic, + nic_interface_t *nic_iface, + struct uip_stack *ustack, packet_t *pkt) { u16_t ipaddr[2]; arp_table_query_t arp_query; @@ -840,7 +839,11 @@ break; case NOT_IN_ARP_TABLE: queue_rc = nic_queue_tx_packet(nic, nic_iface, pkt); - uip_build_arp_request(ustack, ipaddr); + if (queue_rc) { + LOG_ERR("could not queue TX packet: %d", queue_rc); + } else { + uip_build_arp_request(ustack, ipaddr); + } break; default: LOG_ERR("Unknown arp state"); @@ -848,9 +851,9 @@ } } -static void prepare_ipv6_packet(nic_t *nic, - nic_interface_t *nic_iface, - struct uip_stack *ustack, packet_t *pkt) +void prepare_ipv6_packet(nic_t *nic, + nic_interface_t *nic_iface, + struct uip_stack *ustack, packet_t *pkt) { struct uip_eth_hdr *eth; struct uip_vlan_eth_hdr *eth_vlan; @@ -873,9 +876,9 @@ } } -static void prepare_ustack(nic_t *nic, - nic_interface_t *nic_iface, - struct uip_stack *ustack, struct packet *pkt) +void prepare_ustack(nic_t *nic, + nic_interface_t *nic_iface, + struct uip_stack *ustack, struct packet *pkt) { struct ether_header *eth = NULL; ustack->uip_buf = pkt->buf; @@ -1006,9 +1009,6 @@ uint16_t type = 0; int af_type = 0; struct uip_stack *ustack; - struct ip_hdr *ip; - struct ipv6_hdr *ip6; - void *dst_ip; uint16_t vlan_id; pkt->data_link_layer = pkt->buf; @@ -1016,11 +1016,13 @@ vlan_id = pkt->vlan_tag & 0xFFF; if ((vlan_id == 0) || (NIC_VLAN_STRIP_ENABLED & nic->flags)) { - type = ntohs(ETH_BUF(pkt->buf)->type); + struct uip_eth_hdr *hdr = ETH_BUF(pkt->buf); + type = ntohs(hdr->type); pkt->network_layer = pkt->data_link_layer + sizeof(struct uip_eth_hdr); } else { - type = ntohs(VLAN_ETH_BUF(pkt->buf)->type); + struct uip_vlan_eth_hdr *hdr = VLAN_ETH_BUF(pkt->buf); + type = ntohs(hdr->type); pkt->network_layer = pkt->data_link_layer + sizeof(struct uip_vlan_eth_hdr); } @@ -1028,14 +1030,10 @@ switch (type) { case UIP_ETHTYPE_IPv6: af_type = AF_INET6; - ip6 = (struct ipv6_hdr *) pkt->network_layer; - dst_ip = (void *)&ip6->ipv6_dst; break; case UIP_ETHTYPE_IPv4: case UIP_ETHTYPE_ARP: af_type = AF_INET; - ip = (struct ip_hdr *) pkt->network_layer; - dst_ip = (void *)&ip->destipaddr; break; default: LOG_PACKET(PFX "%s: Ignoring vlan:0x%x ethertype:0x%x", @@ -1238,7 +1236,6 @@ { struct in_addr addr; struct in6_addr addr6; - void *res; char buf[INET6_ADDRSTRLEN]; int rc = -1; @@ -1273,17 +1270,13 @@ nic->log_name, inet_ntoa(addr)); set_uip_stack(&nic_iface->ustack, - &nic_iface->ustack.hostaddr, - &nic_iface->ustack.netmask, - &nic_iface->ustack.default_route_addr, + NULL, NULL, NULL, nic_iface->mac_addr); break; case IPV4_CONFIG_DHCP: set_uip_stack(&nic_iface->ustack, - &nic_iface->ustack.hostaddr, - &nic_iface->ustack.netmask, - &nic_iface->ustack.default_route_addr, + NULL, NULL, NULL, nic_iface->mac_addr); if (dhcpc_init(nic, &nic_iface->ustack, nic_iface->mac_addr, ETH_ALEN)) { @@ -1316,9 +1309,9 @@ if (nic->enable_thread == INVALID_THREAD) goto dhcp_err; - rc = pthread_join(nic->enable_thread, &res); + rc = pthread_cancel(nic->enable_thread); if (rc != 0) - LOG_ERR(PFX "%s: Couldn't join to canceled " + LOG_ERR(PFX "%s: Couldn't cancel " "enable nic thread", nic->log_name); dhcp_err: pthread_mutex_lock(&nic->nic_mutex); @@ -1498,13 +1491,13 @@ /* Signal that the device enable is done */ pthread_cond_broadcast(&nic->enable_done_cond); - pthread_mutex_unlock(&nic->nic_mutex); LOG_INFO(PFX "%s: entering main nic loop", nic->log_name); while ((nic->state == NIC_RUNNING) && (event_loop_stop == 0) && !(nic->flags & NIC_GOING_DOWN)) { + pthread_mutex_unlock(&nic->nic_mutex); /* Check the periodic and ARP timer */ check_timers(nic, &periodic_timer, &arp_timer); rc = nic_process_intr(nic, 0); @@ -1515,6 +1508,7 @@ &periodic_timer, &arp_timer, NULL); } + pthread_mutex_lock(&nic->nic_mutex); } LOG_INFO(PFX "%s: exited main processing loop", nic->log_name); @@ -1522,7 +1516,6 @@ dev_close_free: free_free_queue(nic); dev_close: - pthread_mutex_lock(&nic->nic_mutex); if (nic->flags & NIC_GOING_DOWN) { nic_close(nic, 1, FREE_NO_STRINGS); diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/nic.h open-iscsi-2.0.874/iscsiuio/src/unix/nic.h --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/nic.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/unix/nic.h 2016-09-29 18:33:24.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2009-2011, Broadcom Corporation + * Copyright (c) 2014, QLogic Corporation * * Written by: Benjamin Li (benli@broadcom.com) * @@ -51,6 +52,7 @@ #include "nic_nl.h" #include "packet.h" #include "uip.h" +#include "timer.h" #include "iscsi_if.h" @@ -329,6 +331,9 @@ #define NIC_NL_PROCESS_LAST_ENTRY (NIC_NL_PROCESS_MAX_RING_SIZE - 1) #define NIC_NL_PROCESS_NEXT_ENTRY(x) ((x + 1) & NIC_NL_PROCESS_MAX_RING_SIZE) void *nl_process_ring[NIC_NL_PROCESS_MAX_RING_SIZE]; + + /* The thread used to perform ping */ + pthread_t ping_thread; } nic_t; /****************************************************************************** @@ -350,8 +355,10 @@ NIC_LIBRARY_DOESNT_EXIST = 2, } NIC_LIBRARY_EXIST_T; -NIC_LIBRARY_EXIST_T does_nic_uio_name_exist(char *name); -NIC_LIBRARY_EXIST_T does_nic_library_exist(char *name); +NIC_LIBRARY_EXIST_T does_nic_uio_name_exist(char *name, + nic_lib_handle_t **handle); +NIC_LIBRARY_EXIST_T does_nic_library_exist(char *name, + nic_lib_handle_t **handle); /******************************************************************************* * Packet management utility functions @@ -380,4 +387,20 @@ int nic_packet_capture(struct nic *, struct packet *pkt); +int process_packets(nic_t *nic, + struct timer *periodic_timer, + struct timer *arp_timer, nic_interface_t *nic_iface); + +void prepare_ustack(nic_t *nic, + nic_interface_t *nic_iface, + struct uip_stack *ustack, struct packet *pkt); + +void prepare_ipv4_packet(nic_t *nic, + nic_interface_t *nic_iface, + struct uip_stack *ustack, struct packet *pkt); + +void prepare_ipv6_packet(nic_t *nic, + nic_interface_t *nic_iface, + struct uip_stack *ustack, struct packet *pkt); + #endif /* __NIC_H__ */ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/nic_id.c open-iscsi-2.0.874/iscsiuio/src/unix/nic_id.c --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/nic_id.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/unix/nic_id.c 2016-09-29 18:33:24.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2009-2011, Broadcom Corporation + * Copyright (c) 2014, QLogic Corporation * * Written by: Benjamin Li (benli@broadcom.com) * @@ -307,6 +308,7 @@ nic_lib_handle_t *handle; struct pci_device_id *pci_entry; + size_t name_size; rc = get_vendor(nic, &vendor); if (rc != 0) { @@ -356,6 +358,7 @@ /* Prepare the NIC library op table */ nic->ops = handle->ops; + (*nic->ops->lib_ops.get_library_name) (&nic->library_name, &name_size); return 0; } diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/nic_id.h open-iscsi-2.0.874/iscsiuio/src/unix/nic_id.h --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/nic_id.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/unix/nic_id.h 2016-09-29 18:33:24.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2009-2011, Broadcom Corporation + * Copyright (c) 2014, QLogic Corporation * * Written by: Benjamin Li (benli@broadcom.com) * diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/nic_nl.c open-iscsi-2.0.874/iscsiuio/src/unix/nic_nl.c --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/nic_nl.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/unix/nic_nl.c 2016-09-29 18:33:24.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2009-2011, Broadcom Corporation + * Copyright (c) 2014, QLogic Corporation * * Written by: Benjamin Li (benli@broadcom.com) * @@ -482,9 +483,11 @@ while (!event_loop_stop) { char *data = NULL; + pthread_mutex_lock(&nic->nl_process_mutex); rc = pthread_cond_wait(&nic->nl_process_cond, &nic->nl_process_mutex); if (rc != 0) { + pthread_mutex_unlock(&nic->nl_process_mutex); LOG_ERR("Fatal error in NL processing thread " "during wait[%s]", strerror(rc)); break; diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/nic_nl.h open-iscsi-2.0.874/iscsiuio/src/unix/nic_nl.h --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/nic_nl.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/unix/nic_nl.h 2016-09-29 18:33:24.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2009-2011, Broadcom Corporation + * Copyright (c) 2014, QLogic Corporation * * Written by: Benjamin Li (benli@broadcom.com) * diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/nic_utils.c open-iscsi-2.0.874/iscsiuio/src/unix/nic_utils.c --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/nic_utils.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/unix/nic_utils.c 2016-09-29 18:33:24.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2009-2011, Broadcom Corporation + * Copyright (c) 2014, QLogic Corporation * * Written by: Benjamin Li (benli@broadcom.com) * @@ -699,6 +700,9 @@ uint32_t raw_size = 0; char temp_path[sizeof(nic_uio_sysfs_name_tempate) + 8]; int rc = 0; + nic_lib_handle_t *handle = NULL; + size_t name_size; + /* Build the path to determine uio name */ snprintf(temp_path, sizeof(temp_path), @@ -715,37 +719,43 @@ *raw_tmp = '\0'; /* If the nic library is not set then check if there is a library - * which matches the library name */ + * which matches the uio sysfs name */ if (nic->nic_library == NULL) { NIC_LIBRARY_EXIST_T exist; - exist = does_nic_uio_name_exist(raw); + exist = does_nic_uio_name_exist(raw, &handle); if (exist == NIC_LIBRARY_DOESNT_EXIST) { - LOG_ERR(PFX "%s: could not find library: %s ", + LOG_ERR(PFX "%s: could not find library for uio name: %s", nic->log_name, raw); - rc = -EIO; + rc = -EINVAL; + goto error; } - } else { - char *library_name; - size_t library_name_size; - /* Get the string name from the NIC library */ - (*nic->ops->lib_ops.get_library_name) (&library_name, - &library_name_size); + /* fill the lib info */ + nic->nic_library = handle; + nic->ops = handle->ops; + (*nic->ops->lib_ops.get_library_name) (&nic->library_name, + &name_size); + } else { + /* Get the uio sysfs name from the NIC library */ + (*nic->ops->lib_ops.get_uio_name) (&raw_tmp, &name_size); - if (strcmp(raw, library_name) != 0) { + if (strncmp(raw, raw_tmp, name_size) != 0) { LOG_ERR(PFX "%s: uio names not equal: " "expecting %s got %s from %s", - nic->log_name, library_name, raw, temp_path); - rc = -EIO; + nic->log_name, raw, raw_tmp, temp_path); + rc = -EINVAL; + goto error; } } - free(raw); - - LOG_INFO(PFX "%s: Verified is a cnic_uio device", nic->log_name); + LOG_INFO(PFX "%s: Verified uio name %s with library %s", + nic->log_name, raw, nic->library_name); error: + if (raw) + free(raw); + return rc; } @@ -843,34 +853,47 @@ { int rc; NIC_LIBRARY_EXIST_T exist; + nic_lib_handle_t *handle = NULL; nic_fill_name(nic); /* No assoicated library, we can skip it */ if (nic->library_name != NULL) { /* Check that we have the proper NIC library loaded */ - exist = does_nic_library_exist(nic->library_name); + exist = does_nic_library_exist(nic->library_name, &handle); if (exist == NIC_LIBRARY_DOESNT_EXIST) { LOG_ERR(PFX "NIC library doesn't exists: %s", nic->library_name); goto error; + } else if (handle && (nic->nic_library == handle) && + (nic->ops == handle->ops)) { + LOG_INFO("%s: Have NIC library '%s'", + nic->log_name, nic->library_name); } } - /* Determine the NIC library to use based on the PCI Id */ - rc = find_set_nic_lib(nic); + /* Verify the NIC library to use */ + rc = nic_verify_uio_sysfs_name(nic); if (rc != 0) { - LOG_ERR(PFX "%s: Couldn't find NIC library", nic->log_name); - goto error; + /* Determine the NIC library to use based on the PCI Id */ + rc = find_set_nic_lib(nic); + if (rc != 0) { + LOG_ERR(PFX "%s: Couldn't find NIC library", + nic->log_name); + goto error; + } + } - LOG_INFO("%s: found NIC '%s'", nic->log_name, nic->pci_id->device_name); + LOG_INFO("%s: found NIC with library '%s'", + nic->log_name, nic->library_name); error: return; } void prepare_nic_thread(nic_t *nic) { + pthread_attr_t attr; int rc; pthread_mutex_lock(&nic->nic_mutex); @@ -881,7 +904,9 @@ LOG_INFO(PFX "%s: spinning up thread for nic", nic->log_name); /* Try to spin up the nic thread */ - rc = pthread_create(&nic->thread, NULL, nic_loop, nic); + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); + rc = pthread_create(&nic->thread, &attr, nic_loop, nic); if (rc != 0) { LOG_ERR(PFX "%s: Couldn't create thread for nic", nic->log_name); @@ -969,9 +994,9 @@ /** * nic_disable() - Function used to disable the NIC * @param nic - NIC to disble - * @return 0 on success, <0 on failure + * @return void */ -int nic_disable(nic_t *nic, int going_down) +void nic_disable(nic_t *nic, int going_down) { if (nic->state == NIC_STARTED_RUNNING || nic->state == NIC_RUNNING) { @@ -992,6 +1017,12 @@ /* Convert from timeval to timespec */ rc = gettimeofday(&tp, NULL); + if (rc) { + LOG_ERR("gettimeofday failed, should never happen: %d\n", errno); + pthread_mutex_unlock(&nic->nic_mutex); + return; + } + ts.tv_sec = tp.tv_sec; ts.tv_nsec = tp.tv_usec * 1000; ts.tv_sec += 5; /* TODO: hardcoded wait for 5 seconds */ @@ -999,16 +1030,18 @@ /* Wait for the device to be disabled */ rc = pthread_cond_timedwait(&nic->disable_wait_cond, &nic->nic_mutex, &ts); + if (rc) { + LOG_ERR("cond_timedwait failed, should never happen: %d\n", errno); + } + pthread_mutex_unlock(&nic->nic_mutex); LOG_DEBUG(PFX "%s: device disabled", nic->log_name); - return 0; } else { LOG_WARN(PFX "%s: device already disabled: " "flag: 0x%x state: 0x%x", nic->log_name, nic->flags, nic->state); - return -EALREADY; } } diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/nic_utils.h open-iscsi-2.0.874/iscsiuio/src/unix/nic_utils.h --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/nic_utils.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/unix/nic_utils.h 2016-09-29 18:33:24.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2009-2011, Broadcom Corporation + * Copyright (c) 2014, QLogic Corporation * * Written by: Benjamin Li (benli@broadcom.com) * @@ -90,7 +91,7 @@ void prepare_library(nic_t *nic); int nic_enable(nic_t *nic); -int nic_disable(nic_t *nic, int going_down); +void nic_disable(nic_t *nic, int going_down); void dump_packet_to_log(struct nic_interface *iface, uint8_t *buf, uint16_t buf_len); diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/nic_vlan.c open-iscsi-2.0.874/iscsiuio/src/unix/nic_vlan.c --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/nic_vlan.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/unix/nic_vlan.c 2016-09-29 18:33:24.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2009-2011, Broadcom Corporation + * Copyright (c) 2014, QLogic Corporation * * Written by: Benjamin Li (benli@broadcom.com) * diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/nic_vlan.h open-iscsi-2.0.874/iscsiuio/src/unix/nic_vlan.h --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/nic_vlan.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/unix/nic_vlan.h 2016-09-29 18:33:24.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2009-2011, Broadcom Corporation + * Copyright (c) 2014, QLogic Corporation * * Written by: Benjamin Li (benli@broadcom.com) * diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/options.h open-iscsi-2.0.874/iscsiuio/src/unix/options.h --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/options.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/unix/options.h 2016-09-29 18:33:24.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2009-2011, Broadcom Corporation + * Copyright (c) 2014, QLogic Corporation * * Written by: Benjamin Li (benli@broadcom.com) * diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/packet.c open-iscsi-2.0.874/iscsiuio/src/unix/packet.c --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/packet.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/unix/packet.c 2016-09-29 18:33:24.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2009-2011, Broadcom Corporation + * Copyright (c) 2014, QLogic Corporation * * Written by: Benjamin Li (benli@broadcom.com) * @@ -37,6 +38,7 @@ */ #include #include +#include #include "logger.h" #include "packet.h" @@ -58,13 +60,14 @@ LOG_ERR("Could not allocate any memory for packet"); return NULL; } + memset(pkt, 0, max_buf_size + sizeof(struct packet)); priv = malloc(priv_size); if (priv == NULL) { LOG_ERR("Could not allocate any memory for private structure"); goto free_pkt; } - + memset(priv, 0, priv_size); pkt->max_buf_size = max_buf_size; pkt->priv = priv; @@ -103,7 +106,7 @@ int alloc_free_queue(nic_t *nic, size_t num_of_packets) { - int rc, i; + int i; pthread_mutex_lock(&nic->free_packet_queue_mutex); for (i = 0; i < num_of_packets; i++) { @@ -111,7 +114,6 @@ pkt = alloc_packet(1500, 1500); if (pkt == NULL) { - rc = i; goto done; } @@ -121,8 +123,6 @@ nic->free_packet_queue = pkt; } - rc = num_of_packets; - done: pthread_mutex_unlock(&nic->free_packet_queue_mutex); diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/packet.h open-iscsi-2.0.874/iscsiuio/src/unix/packet.h --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/packet.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/unix/packet.h 2016-09-29 18:33:24.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2009-2011, Broadcom Corporation + * Copyright (c) 2014, QLogic Corporation * * Written by: Benjamin Li (benli@broadcom.com) * diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/ping.c open-iscsi-2.0.874/iscsiuio/src/unix/ping.c --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/ping.c 1970-01-01 00:00:00.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/unix/ping.c 2016-09-29 18:33:24.000000000 +0000 @@ -0,0 +1,518 @@ +/* + * Copyright (c) 2015, QLogic Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Adam Dunkels. + * 4. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ping.c - Ping implementation for iscsiuio using ICMP/ICMPv6 + * + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "iscsi_if.h" + +#include "uip.h" +#include "uip_arp.h" +#include "uip_eth.h" +#include "dhcpc.h" +#include "ipv6_ndpc.h" +#include "ipv6.h" + +#include "logger.h" +#include "nic.h" +#include "nic_utils.h" +#include "options.h" +#include "packet.h" +#include "bnx2.h" +#include "bnx2x.h" +#include "cnic.h" +#include "ping.h" + +#define PFX "ping " + +static void fill_payload_data(struct uip_stack *ustack) +{ + if (ustack->uip_slen) + memset(ustack->uip_appdata, 'A', ustack->uip_slen); +} + +static int prepare_icmpv4_req_pkt(struct ping_conf *png_c, struct packet *pkt, + uip_ip4addr_t *dst_addr) +{ + nic_interface_t *nic_iface = png_c->nic_iface; + struct uip_stack *ustack = &nic_iface->ustack; + struct uip_ipv4_hdr *ipv4_hdr = NULL; + struct uip_icmpv4_hdr *icmpv4_hdr = NULL; + u16_t uip_iph_len = 0; + u16_t icmpv4_hdr_len = 0; + u16_t uip_ip_icmph_len = 0; + int mtu = 1500; + int rc = 0; + + uip_iph_len = UIP_IPv4_H_LEN; + icmpv4_hdr_len = sizeof(*icmpv4_hdr); + uip_ip_icmph_len = uip_iph_len + icmpv4_hdr_len; + + ipv4_hdr = (struct uip_ipv4_hdr *)ustack->network_layer; + + icmpv4_hdr = (struct uip_icmpv4_hdr *) (ustack->network_layer + + sizeof(struct uip_ipv4_hdr)); + + /* fill IP header */ + ipv4_hdr->vhl = 0x45; + ipv4_hdr->tos = 0; + ++ustack->ipid; + ipv4_hdr->ipid[0] = ustack->ipid >> 8; + ipv4_hdr->ipid[1] = ustack->ipid & 0xff; + ipv4_hdr->ipoffset[0] = 0; + ipv4_hdr->ipoffset[1] = 0; + ipv4_hdr->ttl = UIP_TTL; + ipv4_hdr->proto = UIP_PROTO_ICMP; + uip_ip4addr_copy(ipv4_hdr->srcipaddr, ustack->hostaddr); + uip_ip4addr_copy(ipv4_hdr->destipaddr, dst_addr); + + LOG_INFO(PFX "src ipaddr: %d.%d.%d.%d", + uip_ipaddr1(ipv4_hdr->srcipaddr), + uip_ipaddr2(ipv4_hdr->srcipaddr), + uip_ipaddr3(ipv4_hdr->srcipaddr), + uip_ipaddr4(ipv4_hdr->srcipaddr)); + + LOG_INFO(PFX "dest ipaddr: %d.%d.%d.%d", + uip_ipaddr1(ipv4_hdr->destipaddr), + uip_ipaddr2(ipv4_hdr->destipaddr), + uip_ipaddr3(ipv4_hdr->destipaddr), + uip_ipaddr4(ipv4_hdr->destipaddr)); + + /* fill ICMP header */ + icmpv4_hdr->type = ICMP_ECHO; + icmpv4_hdr->icode = 0; + icmpv4_hdr->id = getpid() & 0xffff; + png_c->id = icmpv4_hdr->id; + icmpv4_hdr->seqno = ustack->ipid; + png_c->seqno =icmpv4_hdr->seqno; + + /* appdata and sappdata point to the icmp payload */ + ustack->uip_appdata = ustack->network_layer + uip_ip_icmph_len; + ustack->uip_sappdata = ustack->uip_appdata; + + if (nic_iface->mtu) + mtu = nic_iface->mtu; + + if ((mtu - uip_ip_icmph_len) > png_c->datalen) { + ustack->uip_slen = png_c->datalen; + } else { + png_c->state = ISCSI_PING_OVERSIZE_PACKET; + LOG_ERR(PFX "MTU=%d, payload=%d\n", + mtu, png_c->datalen); + rc = -EINVAL; + goto done; + } + + fill_payload_data(ustack); + + /* Calculate ICMP checksum. */ + icmpv4_hdr->icmpchksum = 0; + icmpv4_hdr->icmpchksum = ~(uip_chksum((u16_t *)icmpv4_hdr, + icmpv4_hdr_len + + ustack->uip_slen)); + if (icmpv4_hdr->icmpchksum == 0) + icmpv4_hdr->icmpchksum = 0xffff; + + /* IPv4 total length = IPv4 HLEN + ICMP HLEN + Payload len */ + ustack->uip_len = uip_ip_icmph_len + ustack->uip_slen; + ipv4_hdr->len[0] = (ustack->uip_len >> 8); + ipv4_hdr->len[1] = (ustack->uip_len & 0xff); + + /* Calculate IP checksum. */ + ipv4_hdr->ipchksum = 0; + ipv4_hdr->ipchksum = ~(uip_ipchksum(ustack)); + if (ipv4_hdr->ipchksum == 0) + ipv4_hdr->ipchksum = 0xffff; + + ++ustack->stats.ip.sent; + /* Return and let the caller do the actual transmission. */ + ustack->uip_flags = 0; + +done: + return rc; +} + +static void prepare_icmpv6_req_pkt(struct ping_conf *png_c, struct packet *pkt, + uip_ip6addr_t *dst_addr, + uip_ip6addr_t *src_addr) +{ + nic_interface_t *nic_iface = png_c->nic_iface; + struct uip_stack *ustack = &nic_iface->ustack; + struct uip_ipv6_hdr *ipv6_hdr = NULL; + uip_icmp_echo_hdr_t *icmp_echo_hdr = NULL; + u16_t uip_iph_len = 0; + u16_t icmp_echo_hdr_len = 0; + u16_t uip_ip_icmph_len = 0; + char ipbuf[INET6_ADDRSTRLEN] = {0}; + + uip_iph_len = UIP_IPv6_H_LEN; + icmp_echo_hdr_len = sizeof(*icmp_echo_hdr); + uip_ip_icmph_len = uip_iph_len + icmp_echo_hdr_len; + + ipv6_hdr = (struct uip_ipv6_hdr *)ustack->network_layer; + + icmp_echo_hdr = (uip_icmp_echo_hdr_t *) (ustack->network_layer + + sizeof(struct uip_ipv6_hdr)); + + /* fill IPv6 header */ + ipv6_hdr->vtc = 0x60; + ipv6_hdr->tcflow = 0; + ipv6_hdr->flow = 0; + ipv6_hdr->proto = UIP_PROTO_ICMP6; + ipv6_hdr->ttl = UIP_TTL; + uip_ip6addr_copy(ipv6_hdr->srcipaddr, src_addr); + uip_ip6addr_copy(ipv6_hdr->destipaddr, dst_addr); + + memset(ipbuf, 0, sizeof(ipbuf)); + if (inet_ntop(AF_INET6, &ipv6_hdr->srcipaddr, ipbuf, INET6_ADDRSTRLEN)) + LOG_INFO(PFX "src ipaddr=%s", ipbuf); + + memset(ipbuf, 0, sizeof(ipbuf)); + if (inet_ntop(AF_INET6, &ipv6_hdr->destipaddr, ipbuf, INET6_ADDRSTRLEN)) + LOG_INFO(PFX "dest ipaddr=%s", ipbuf); + + /* fill ICMP header */ + icmp_echo_hdr->type = ICMPV6_ECHO_REQ; + icmp_echo_hdr->icode = 0; + icmp_echo_hdr->id = HOST_TO_NET16(getpid() & 0xffff); + png_c->id = icmp_echo_hdr->id; + ++ustack->ipid; + icmp_echo_hdr->seqno = HOST_TO_NET16(ustack->ipid); + png_c->seqno = icmp_echo_hdr->seqno; + + /* appdata and sappdata point to the icmp payload */ + ustack->uip_appdata = ustack->network_layer + uip_ip_icmph_len; + ustack->uip_sappdata = ustack->uip_appdata; + ustack->uip_slen = png_c->datalen; + + fill_payload_data(ustack); + + /* Total length = ETH HLEN + IPv6 HLEN + ICMP HLEN + Data len */ + ustack->uip_len = UIP_LLH_LEN + uip_ip_icmph_len + ustack->uip_slen; + /* IPv6 payload len */ + ipv6_hdr->len = HOST_TO_NET16(icmp_echo_hdr_len + ustack->uip_slen); + + /* Calculate ICMP checksum. */ + icmp_echo_hdr->icmpchksum = 0; + icmp_echo_hdr->icmpchksum = ~(uip_icmp6chksum(ustack)); + + ++ustack->stats.ip.sent; + /* Return and let the caller do the actual transmission. */ + ustack->uip_flags = 0; + return; +} + +static int chk_arp_entry_for_dst_addr(nic_t *nic, nic_interface_t *nic_iface, + void *addr) +{ + struct iscsi_path path; + uip_ip4addr_t dst_addr4; + uip_ip6addr_t dst_addr6; + + if (nic_iface->protocol == AF_INET) { + memcpy(dst_addr4, addr, sizeof(uip_ip4addr_t)); + memcpy(&path.dst.v4_addr, dst_addr4, sizeof(struct in_addr)); + path.ip_addr_len = 4; + } else { + memcpy(dst_addr6, addr, sizeof(uip_ip6addr_t)); + memcpy(&path.dst.v6_addr, dst_addr6, sizeof(struct in6_addr)); + path.ip_addr_len = 16; + } + + return cnic_handle_iscsi_path_req(nic, 0, NULL, &path, nic_iface); +} + +static int fill_icmpv6_eth_hdr(struct uip_stack *ustack, + uip_ip6addr_t *dst_addr6) +{ + struct uip_eth_hdr *eth; + __u8 mac_addr[6]; + struct ndpc_reqptr req_ptr; + int rc = 0; + int ret = 0; + + eth = (struct uip_eth_hdr *)ustack->data_link_layer; + memcpy(eth->src.addr, ustack->uip_ethaddr.addr, sizeof(eth->src.addr)); + + memset(mac_addr, 0, sizeof(mac_addr)); + req_ptr.eth = (void *)mac_addr; + req_ptr.ipv6 = (void *)dst_addr6; + + ret = ndpc_request(ustack, &req_ptr, &rc, CHECK_ARP_TABLE); + if (ret) { + LOG_DEBUG(PFX "ndpc request failed"); + rc = ret; + } else if (rc) { + memcpy(eth->dest.addr, mac_addr, sizeof(eth->dest.addr)); + LOG_DEBUG(PFX "ipv6 arp entry present"); + rc = 0; + } else { + LOG_DEBUG(PFX "ipv6 arp entry not present"); + rc = -EAGAIN; + } + + return rc; +} + +static int determine_src_ipv6_addr(nic_interface_t *nic_iface, + uip_ip6addr_t *dst_addr6, + uip_ip6addr_t *src_addr6) +{ + struct in6_addr *addr; + int rc = 0; + int ret = 0; + + if (nic_iface->ustack.ip_config == IPV6_CONFIG_STATIC) { + memcpy(src_addr6, &nic_iface->ustack.hostaddr6, + sizeof(uip_ip6addr_t)); + goto done; + } + + ret = ndpc_request(&nic_iface->ustack, dst_addr6, + &rc, CHECK_LINK_LOCAL_ADDR); + if (ret) { + LOG_DEBUG(PFX "Check LL failed"); + rc = ret; + goto done; + } + + if (rc) { + LOG_DEBUG(PFX "Use LL"); + /* Get link local IPv6 address */ + addr = (struct in6_addr *)&nic_iface->ustack.linklocal6; + rc = 0; + } else { + LOG_DEBUG(PFX "Use Best matched"); + ret = ndpc_request(&nic_iface->ustack, + dst_addr6, + &addr, GET_HOST_ADDR); + if (ret) { + LOG_DEBUG(PFX "Use Best matched failed"); + rc = ret; + goto done; + } + if (addr == NULL) { + LOG_DEBUG(PFX "No Best matched found"); + rc = -EINVAL; + goto done; + } + } + + /* Got the best matched src IP address */ + memcpy(src_addr6, addr, sizeof(struct in6_addr)); + +done: + return rc; +} + +void ping_init(struct ping_conf *png_c, void *addr, u16_t type, int datalen) +{ + png_c->dst_addr = addr; + png_c->proto = type; + png_c->state = PING_INIT_STATE; + png_c->datalen = datalen; + return; +} + +int do_ping_from_nic_iface(struct ping_conf *png_c) +{ + packet_t *pkt; + nic_interface_t *nic_iface = png_c->nic_iface; + nic_t *nic = nic_iface->parent; + struct uip_stack *ustack = &nic_iface->ustack; + uip_ip4addr_t dst_addr4; + uip_ip6addr_t dst_addr6; + uip_ip6addr_t src_addr6; + struct timer ping_timer; + int rc = 0; + + memset(dst_addr4, 0, sizeof(uip_ip4addr_t)); + memset(dst_addr6, 0, sizeof(uip_ip6addr_t)); + memset(src_addr6, 0, sizeof(uip_ip6addr_t)); + + if (nic_iface->protocol == AF_INET) + memcpy(dst_addr4, png_c->dst_addr, sizeof(uip_ip4addr_t)); + else + memcpy(dst_addr6, png_c->dst_addr, sizeof(uip_ip6addr_t)); + + rc = chk_arp_entry_for_dst_addr(nic, nic_iface, png_c->dst_addr); + + if (rc && (nic_iface->protocol == AF_INET)) { + png_c->state = ISCSI_PING_NO_ARP_RECEIVED; + LOG_ERR(PFX "ARP failure for IPv4 dest addr"); + goto done; + } else if ((rc < 1) && (nic_iface->protocol == AF_INET6)) { + png_c->state = ISCSI_PING_NO_ARP_RECEIVED; + LOG_ERR(PFX "ARP failure for IPv6 dest addr"); + goto done; + } else if (rc < 0) { + LOG_ERR(PFX "ARP failure"); + goto done; + } + + pthread_mutex_lock(&nic->nic_mutex); + pkt = get_next_free_packet(nic); + if (pkt == NULL) { + pthread_mutex_unlock(&nic->nic_mutex); + LOG_ERR(PFX "Unable to get a free packet buffer"); + rc = -EIO; + goto done; + } + + prepare_ustack(nic, nic_iface, ustack, pkt); + + if (nic_iface->protocol == AF_INET) { + rc = prepare_icmpv4_req_pkt(png_c, pkt, &dst_addr4); + if (rc) + goto put_pkt; + + /* If the above function invocation resulted + * in data that should be sent out on the + * network, the global variable uip_len is + * set to a value > 0. */ + if (ustack->uip_len > 0) { + pkt->buf_size = ustack->uip_len; + + prepare_ipv4_packet(nic, nic_iface, ustack, pkt); + + LOG_DEBUG(PFX "Send ICMP echo request"); + (*nic->ops->write) (nic, nic_iface, pkt); + ustack->uip_len = 0; + } + } else { + rc = determine_src_ipv6_addr(nic_iface, &dst_addr6, &src_addr6); + if (rc) + goto put_pkt; + + prepare_icmpv6_req_pkt(png_c, pkt, &dst_addr6, &src_addr6); + + /* If the above function invocation resulted + * in data that should be sent out on the + * network, the global variable uip_len is + * set to a value > 0. */ + if (ustack->uip_len > 0) { + pkt->buf_size = ustack->uip_len; + + prepare_ipv6_packet(nic, nic_iface, ustack, pkt); + rc = fill_icmpv6_eth_hdr(ustack, &dst_addr6); + if (rc) { + ustack->uip_len = 0; + goto put_pkt; + } + + LOG_DEBUG(PFX "Send ICMPv6 echo request"); + (*nic->ops->write) (nic, nic_iface, pkt); + ustack->uip_len = 0; + } + } + +put_pkt: + put_packet_in_free_queue(pkt, nic); + pthread_mutex_unlock(&nic->nic_mutex); + + if (rc) { + LOG_DEBUG(PFX "Ping request not transmitted"); + goto done; + } + + timer_set(&ping_timer, CLOCK_SECOND * 10); + + while ((event_loop_stop == 0) && + (nic->flags & NIC_ENABLED) && !(nic->flags & NIC_GOING_DOWN)) { + + rc = nic_process_intr(nic, 1); + + while ((rc > 0) && (!(nic->flags & NIC_GOING_DOWN))) { + rc = process_packets(nic, NULL, NULL, nic_iface); + } + + if (!rc && (png_c->state == ISCSI_PING_SUCCESS)) { + LOG_INFO(PFX "PING successful!"); + break; + } + + if (timer_expired(&ping_timer)) { + png_c->state = ISCSI_PING_TIMEOUT; + LOG_ERR(PFX "PING timeout"); + rc = -EIO; + break; + } + } + +done: + return rc; +} + +int process_icmp_packet(uip_icmp_echo_hdr_t *icmp_hdr, + struct uip_stack *ustack) +{ + struct ping_conf *png_c = (struct ping_conf *)ustack->ping_conf; + int rc = 0; + + LOG_INFO(PFX "Verify ICMP echo reply"); + + if ((icmp_hdr->type == ICMPV6_ECHO_REPLY && + png_c->proto == AF_INET6) || + (icmp_hdr->type == ICMP_ECHO_REPLY && + png_c->proto == AF_INET)) { + + if ((icmp_hdr->icode == 0) && + (icmp_hdr->id == png_c->id) && + (icmp_hdr->seqno == png_c->seqno)) { + png_c->state = ISCSI_PING_SUCCESS; + } else { + rc = 1; + } + } else { + rc = 1; + } + + if (rc) { + LOG_INFO(PFX "ICMP echo reply verification failed!"); + } else { + LOG_INFO(PFX "ICMP echo reply OK"); + } + + return rc; +} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/ping.h open-iscsi-2.0.874/iscsiuio/src/unix/ping.h --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/src/unix/ping.h 1970-01-01 00:00:00.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/src/unix/ping.h 2016-09-29 18:33:24.000000000 +0000 @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2015, QLogic Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Adam Dunkels. + * 4. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ping.h - PING header file + * + */ + +#ifndef __PING_H__ +#define __PING_H__ + +#include "nic_nl.h" +#include "uip.h" + +#define ICMP_ECHO_REPLY 0 +#define ICMP_ECHO 8 + +#define ICMPV6_ECHO_REQ 128 +#define ICMPV6_ECHO_REPLY 129 + +#define DEF_ICMP_PAYLOAD 32 +#define DEF_ICMPV6_PAYLOAD 16 + +#define PING_INIT_STATE (-1) + +struct ping_conf +{ + nic_t *nic; + nic_interface_t *nic_iface; + void *data; + int state; + void *dst_addr; + u16_t proto; + u16_t id; + u16_t seqno; + u16_t datalen; +}; + +void ping_init(struct ping_conf *png_c, void *addr, u16_t type, int datalen); + +int do_ping_from_nic_iface(struct ping_conf *png_c); + +int process_icmp_packet(uip_icmp_echo_hdr_t *icmp_hdr, + struct uip_stack *ustack); + +#endif /* __PING_H__ */ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/stamp-h1 open-iscsi-2.0.874/iscsiuio/stamp-h1 --- open-iscsi-2.0.873+git0.3b4b4500/iscsiuio/stamp-h1 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/iscsiuio/stamp-h1 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -timestamp for config.h diff -Nru open-iscsi-2.0.873+git0.3b4b4500/kernel/iscsi_tcp.c open-iscsi-2.0.874/kernel/iscsi_tcp.c --- open-iscsi-2.0.873+git0.3b4b4500/kernel/iscsi_tcp.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/kernel/iscsi_tcp.c 2016-09-29 18:33:24.000000000 +0000 @@ -296,7 +296,7 @@ rc = iscsi_sw_tcp_xmit_segment(tcp_conn, segment); /* * We may not have been able to send data because the conn - * is getting stopped. libiscsi will know so propogate err + * is getting stopped. libiscsi will know so propagate err * for it to do the right thing. */ if (rc == -EAGAIN) diff -Nru open-iscsi-2.0.873+git0.3b4b4500/kernel/libiscsi.c open-iscsi-2.0.874/kernel/libiscsi.c --- open-iscsi-2.0.873+git0.3b4b4500/kernel/libiscsi.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/kernel/libiscsi.c 2016-09-29 18:33:24.000000000 +0000 @@ -2264,7 +2264,7 @@ spin_lock_bh(&session->lock); /* * Just check if we are not logged in. We cannot check for - * the phase because the reset could come from a ioctl. + * the phase because the reset could come from an ioctl. */ if (!session->leadconn || session->state != ISCSI_STATE_LOGGED_IN) goto unlock; @@ -2427,7 +2427,7 @@ spin_lock_bh(&session->lock); /* * Just check if we are not logged in. We cannot check for - * the phase because the reset could come from a ioctl. + * the phase because the reset could come from an ioctl. */ if (!session->leadconn || session->state != ISCSI_STATE_LOGGED_IN) goto unlock; diff -Nru open-iscsi-2.0.873+git0.3b4b4500/kernel/libiscsi_tcp.h open-iscsi-2.0.874/kernel/libiscsi_tcp.h --- open-iscsi-2.0.873+git0.3b4b4500/kernel/libiscsi_tcp.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/kernel/libiscsi_tcp.h 2016-09-29 18:33:24.000000000 +0000 @@ -51,7 +51,7 @@ iscsi_segment_done_fn_t *done; }; -/* Socket connection recieve helper */ +/* Socket connection receive helper */ struct iscsi_tcp_recv { struct iscsi_hdr *hdr; struct iscsi_segment segment; diff -Nru open-iscsi-2.0.873+git0.3b4b4500/kernel/Makefile open-iscsi-2.0.874/kernel/Makefile --- open-iscsi-2.0.873+git0.3b4b4500/kernel/Makefile 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/kernel/Makefile 2016-09-29 18:33:24.000000000 +0000 @@ -183,9 +183,9 @@ $(KBUILD_BASE) clean rm -f Module.symvers -## The folowing compat_patch target is what we need to do to prepare a clean +## The following compat_patch target is what we need to do to prepare a clean # compat_patch set after new code is check-in to svn. To keep patches fuzzless. -# the new patches are writen into .new files so svn diff of next file will +# the new patches are written into .new files so svn diff of next file will # not trip on them. compat_patch: $(unpatch_code) test -z "$(svn diff|head)" || { \ @@ -213,7 +213,7 @@ endif # this evil rule ensures that the modules get build if you specify $(ko) -# as a dependancy. +# as a dependency. ko = $(patsubst %.o,%.ko,$(obj-m)) $(ko): all diff -Nru open-iscsi-2.0.873+git0.3b4b4500/kernel/scsi_transport_iscsi.h open-iscsi-2.0.874/kernel/scsi_transport_iscsi.h --- open-iscsi-2.0.873+git0.3b4b4500/kernel/scsi_transport_iscsi.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/kernel/scsi_transport_iscsi.h 2016-09-29 18:33:24.000000000 +0000 @@ -58,7 +58,7 @@ * @stop_conn: suspend/recover/terminate connection * @send_pdu: send iSCSI PDU, Login, Logout, NOP-Out, Reject, Text. * @session_recovery_timedout: notify LLD a block during recovery timed out - * @init_task: Initialize a iscsi_task and any internal structs. + * @init_task: Initialize an iscsi_task and any internal structs. * When offloading the data path, this is called from * queuecommand with the session lock, or from the * iscsi_conn_send_pdu context with the session lock. diff -Nru open-iscsi-2.0.873+git0.3b4b4500/Makefile open-iscsi-2.0.874/Makefile --- open-iscsi-2.0.873+git0.3b4b4500/Makefile 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/Makefile 2016-09-29 18:33:24.000000000 +0000 @@ -20,14 +20,24 @@ ETCFILES = etc/iscsid.conf IFACEFILES = etc/iface.example +# Compatibility: parse old OPTFLAGS argument +ifdef OPTFLAGS +CFLAGS = $(OPTFLAGS) +endif + +# Export it so configure of iscsiuio will +# pick it up. +ifneq (,$(CFLAGS)) +export CFLAGS +endif + # Random comments: # using '$(MAKE)' instead of just 'make' allows make to run in parallel # over multiple makefile. all: user -user: utils/open-isns/Makefile iscsiuio/Makefile - $(MAKE) -C utils/open-isns +user: iscsiuio/Makefile $(MAKE) -C utils/sysdeps $(MAKE) -C utils/fwparam_ibft $(MAKE) -C usr @@ -43,12 +53,12 @@ @echo @echo "Read README file for detailed information." -utils/open-isns/Makefile: utils/open-isns/configure utils/open-isns/Makefile.in - cd utils/open-isns; ./configure CFLAGS="$(OPTFLAGS)" --with-security=no - iscsiuio/Makefile: iscsiuio/configure iscsiuio/Makefile.in cd iscsiuio; ./configure +iscsiuio/configure iscsiuio/Makefile.in: iscsiuio/configure.ac iscsiuio/Makefile.am + cd iscsiuio; autoreconf --install + kernel: force $(MAKE) -C kernel @echo "Kernel Compilation complete Output file" @@ -66,9 +76,8 @@ $(MAKE) -C utils clean $(MAKE) -C usr clean $(MAKE) -C kernel clean - $(MAKE) -C iscsiuio clean - $(MAKE) -C utils/open-isns clean - $(MAKE) -C utils/open-isns distclean + [ ! -f iscsiuio/Makefile ] || $(MAKE) -C iscsiuio clean + [ ! -f iscsiuio/Makefile ] || $(MAKE) -C iscsiuio distclean # this is for safety # now -jXXX will still be safe @@ -121,7 +130,7 @@ $(INSTALL) -m 644 $^ $(DESTDIR)$(etcdir)/iscsi/ifaces install_etc: $(ETCFILES) - if [ ! -f /etc/iscsi/iscsid.conf ]; then \ + if [ ! -f $(DESTDIR)/etc/iscsi/iscsid.conf ]; then \ $(INSTALL) -d $(DESTDIR)$(etcdir)/iscsi ; \ $(INSTALL) -m 644 $^ $(DESTDIR)$(etcdir)/iscsi ; \ fi @@ -134,11 +143,11 @@ $(MAKE) -C kernel install_kernel install_iname: - if [ ! -f /etc/iscsi/initiatorname.iscsi ]; then \ + if [ ! -f $(DESTDIR)/etc/iscsi/initiatorname.iscsi ]; then \ echo "InitiatorName=`$(DESTDIR)/sbin/iscsi-iname`" > $(DESTDIR)/etc/iscsi/initiatorname.iscsi ; \ echo "***************************************************" ; \ echo "Setting InitiatorName to `cat $(DESTDIR)/etc/iscsi/initiatorname.iscsi`" ; \ - echo "To override edit /etc/iscsi/initiatorname.iscsi" ; \ + echo "To override edit $(DESTDIR)/etc/iscsi/initiatorname.iscsi" ; \ echo "***************************************************" ; \ fi diff -Nru open-iscsi-2.0.873+git0.3b4b4500/README open-iscsi-2.0.874/README --- open-iscsi-2.0.873+git0.3b4b4500/README 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/README 2016-09-29 18:33:24.000000000 +0000 @@ -4,7 +4,7 @@ ================================================================= - May 20, 2012 + Sep 29, 2016 Contents ======== @@ -26,7 +26,7 @@ tested on AMD Opteron (TM) and Intel Xeon (TM). The latest development release is available at: -http://www.open-iscsi.org +http://www.open-iscsi.com For questions, comments, contributions send e-mail to: open-iscsi@googlegroups.com @@ -79,6 +79,20 @@ you do not use header or data digests. They are the kernel options, CONFIG_CRYPTO and CONFIG_CRYPTO_CRC32C, respectively. +The userspace components: iscsid, iscsiadm and iscsistart require the +open-isns library which can be found here: + +https://github.com/gonzoleeman/open-isns/releases + +To install the open-isns headers and library required for open-iscsi download +the current release and run: + + ./configure + make + make install + make install_hdrs + make install_lib + By default the kernel's iSCSI modules will be used. Running: make @@ -92,7 +106,7 @@ make kernel When building those modules the kernel source found at -/lib/modules/`uname -a`/build +/lib/modules/`uname -r`/build will be used to compile the open-iscsi modules. To specify a different kernel to build against use: @@ -393,7 +407,7 @@ See below for examples. -m iface --interface=iscsi_ifacename -C ping --ip=[ipaddr] --packetsize=[size] --count=[count] --interval=[interval] - -m host --host=hostno|MAC --print=level -C chap --op=[op] --value=[chap_tbl_idx] + -m host --host=hostno|MAC --print=level -C chap --op=[SHOW] 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 @@ -406,6 +420,14 @@ is connected to. 3 = Print iscsi params used. 4 = Print SCSI info like LUNs, device state. + -m host --host=hostno|MAC -C chap --op=[DELETE] --index=[chap_tbl_idx] + Delete chap entry at the given index from chap table. + -m host --host=hostno|MAC -C chap --op=[NEW | UPDATE] --index=[chap_tbl_idx] \ + --name=[name] --value=[value] + Add new or update existing chap entry at the given + index with given username and password pair. If index + is not passed then entry is added at the first free + index in chap table. -m host --host=hostno|MAC -C flashnode Display list of all the targets in adapter's flash (flash node), for the specified host, @@ -414,13 +436,13 @@ Create new flash node entry for the given host of the specified portal_type. This returns the index of the newly created entry on success. - -m host --host=hostno|MAC -C flashnode --flashnode_idx=[flashnode index] \ + -m host --host=hostno|MAC -C flashnode --index=[flashnode index] \ --op=[UPDATE] --name=[name] --value=[value] Update the params of the speficied flash node. The [name] and [value] pairs must be provided for the params that need to be updated. Multiple params can be updated using a single command. - -m host --host=hostno|MAC -C flashnode--flashnode_idx=[flashnode index] \ + -m host --host=hostno|MAC -C flashnode --index=[flashnode index] \ --op=[SHOW | DELETE | LOGIN | LOGOUT] op=DELETE|LOGIN|LOGOUT will perform deletion/login/ logout operation on the specified flash node. @@ -512,11 +534,11 @@ iface_name transport_name,hwaddress,ipaddress,net_ifacename,initiatorname For software iscsi, you can create the iface configs by hand, but it is -reccomended that you use iscsiadm's iface mode. There is a iface.example in +recommended that you use iscsiadm's iface mode. There is an iface.example in /etc/iscsi/ifaces which can be used as a template for the daring. For each network object you wish to bind a session to you must create -a seperate iface config in /etc/iscsi/ifaces and each iface config file +a separate iface config in /etc/iscsi/ifaces and each iface config file must have a unique name which is less than or equal to 64 characters. Example: @@ -533,14 +555,14 @@ iface.transport_name = tcp iface.hwaddress = 00:C0:DD:08:63:E7 -Warning: Do not name a iface config file "default" or "iser". +Warning: Do not name an iface config file "default" or "iser". They are special value/file that is used by the iscsi tools for -backward compatibility. If you name a iface default or iser, then +backward compatibility. If you name an iface default or iser, then the behavior is not defined. To use iscsiadm to create iface0 above for you run: -(This will create a new empty iface config. If there was already a iface +(This will create a new empty iface config. If there was already an iface with the name "iface0" this command will overwrite it.) # iscsiadm -m iface -I iface0 --op=new @@ -548,7 +570,7 @@ # iscsiadm -m iface -I iface0 --op=update -n iface.hwaddress -v 00:0F:1F:92:6B:BF If you had sessions logged in iscsiadm will not update, overwrite -a iface. You must log out first. If you have a iface bound to a node/portal +a iface. You must log out first. If you have an iface bound to a node/portal but you have not logged in then, iscsiadm will update the config and all existing bindings. @@ -558,13 +580,13 @@ -5.1.2 Setting up a iface for a iSCSI offload card -================================================= +5.1.2 Setting up an iface for an iSCSI offload card +=================================================== 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, QLogic and Chelsio +By default, iscsiadm will create an iface for each Broadcom, QLogic and Chelsio port. The iface name will be of the form: $transport/driver_name.$MAC_ADDRESS @@ -660,7 +682,7 @@ Be aware that iscsiadm will use the default route to do discovery. It will not use the iface specified. So if you are using a offload card, you will -need a seperate network connection to the target for discovery purposes. +need a separate network connection to the target for discovery purposes. *This will be fixed in the next version of open-iscsi* For compatibility reasons, when you run iscsiadm to do discovery, it @@ -677,7 +699,7 @@ iscsiadm -m discoverydb -t st -p ip:port -I iface1 --discover -P 1 If you had defined interfaces but wanted the old behavior, where -we do not bind a session to a iface, then you can use the special iface +we do not bind a session to an iface, then you can use the special iface "default": iscsiadm -m discoverydb -t st -p ip:port -I default --discover -P 1 @@ -705,7 +727,7 @@ iscsiadm -m node -p ip:port -I iface0 --op=delete -To now log into targets it is the same as with sofware iscsi. See section +To now log into targets it is the same as with software iscsi. See section 7 for how to get started. @@ -846,7 +868,7 @@ ./iscsiadm -m node -T iqn.2005-03.com.max -p 192.168.0.4:3260 -l - To specify a IPv6 address the following can be used: + To specify an iPv6 address the following can be used: ./iscsiadm -m node -T iqn.2005-03.com.max \ -p 2001:c90::211:9ff:feb8:a9e9 -l @@ -917,7 +939,7 @@ ./iscsiadm -m node -o new -I iface4 - This command will add a interface config using the iSCSI and SCSI + This command will add an interface config using the iSCSI and SCSI settings from iscsid.conf to every target that is in the node db. - Removing iSCSI portal: @@ -1033,6 +1055,46 @@ - Delete a flash node entry ./iscsiadm -m host -H 6 -C flashnode -x 1 -o delete + Host mode with chap submode: + + - Display list of chap entries for a host + + ./iscsiadm -m host -H 6 -C chap -o show + + This will list all the chap entries for the given host. + + - Delete a chap entry for a host + + ./iscsiadm -m host -H 6 -C chap -o delete -x 5 + + This will delete any chap entry present at given index 5. + + - Add/Update a local chap entry for a host + + ./iscsiadm -m host -H 6 -C chap -o update -x 4 -n username \ + -v value -n password -v value + + This will update the local chap entry present at index 4. If index 4 + is free then entry of type local chap will be created at that index + with given username and password values. + + - Add/Update a bidi chap entry for a host + + ./iscsiadm -m host -H 6 -C chap -o update -x 5 -n username_in \ + -v value -n password_in -v value + + This will update the bidi chap entry present at index 5. If index 5 + is free then entry of type bidi chap will be created at that index + with given username_in and password_in values. + + Host mode with stats submode: + + - Display host statistics: + ./iscsiadm -m host -H 6 -C stats + + This will print the aggregate statistics on the host adapter port. + This includes MAC, TCP/IP, ECC & iSCSI statistics. + 6. Configuration ================ @@ -1059,7 +1121,7 @@ or discovered through the discover daemon iscsid.conf params (discussed in 7.1.2). -If your distro does not have a init script, then you will have to start the +If your distro does not have an init script, then you will have to start the daemon and log into the targets manually. @@ -1079,13 +1141,13 @@ And, to automatically mount a file system during startup you must have the partition entry in /etc/fstab marked with the "_netdev" -option. For example this would mount a iscsi disk sdb: +option. For example this would mount an iscsi disk sdb: /dev/sdb /mnt/iscsi ext3 _netdev 0 0 SUSE or Debian: --------------- -Otherwise, if there is a initd script for your distro in etc/initd that +Otherwise, if there is an initd script for your distro in etc/initd that gets installed with "make install" /etc/init.d/open-iscsi start @@ -1309,7 +1371,7 @@ iSNS: ---- -- Create a iSNS record by passing iscsiadm the "-o new" argument in +- Create an iSNS record by passing iscsiadm the "-o new" argument in discoverydb mode. # iscsiadm -m discoverydb -t isns -p 20.15.0.7:3205 -o new New discovery record for [20.15.0.7,3205] added. @@ -1458,7 +1520,7 @@ 8.2 iSCSI settings for iSCSI root --------------------------------- -When accessing the root partition directly through a iSCSI disk, the +When accessing the root partition directly through an iSCSI disk, the iSCSI timers should be set so that iSCSI layer has several chances to try to re-establish a session and so that commands are not quickly requeued to the SCSI layer. Basically you want the opposite of when using dm-multipath. diff -Nru open-iscsi-2.0.873+git0.3b4b4500/sysfs-documentation open-iscsi-2.0.874/sysfs-documentation --- open-iscsi-2.0.873+git0.3b4b4500/sysfs-documentation 1970-01-01 00:00:00.000000000 +0000 +++ open-iscsi-2.0.874/sysfs-documentation 2016-09-29 18:33:24.000000000 +0000 @@ -0,0 +1,514 @@ +Description of iface attributes and their valid values +====================================================== + +== IPv4 attributes == + +ipaddress +--------- +IP address in format XXX.XXX.XXX.XXX + +gateway +------- +IP address of the network router or gateway device in format XXX.XXX.XXX.XXX + +subnet +------ +Broadcast address in format XXX.XXX.XXX.XXX + +bootproto +--------- +The protocol type used to initialize interface + +Valid values: "dhcp" or "static" + +dhcp_dns_address_en +------------------- +Request DNS Server IP Addresses and Domain Name + +If bootproto is set to dhcp and dhcp_dns_address_en is enable, +requests DNS addresses (option 6) and domain name (option 15) in its +DHCP parameter request list. + +Valid values: "enable" or "disable" + +dhcp_slp_da_info_en +------------------- +Request SLP DA Information and SLP Scope +If bootproto is set to dhcp and dhcp_slp_da_info_en is enable, +requests SLP DA information (option 78) and SLP scope (option 79) +in its DHCP parameter request list. + +Valid values: "enable" or "disable" + +tos_en +------ +Enable IPv4 type of service (ToS) + +When tos_en is set to enable, use value set in tos when transmitting IPv4 TCP +packets on iSCSI connections. + +Valid values: "enable" or "disable" + +tos +--- +IPv4 Type of service (ToS) + +When tos_en is set to enable, use value set in tos when transmitting IPv4 TCP +packets on iSCSI connections. + +Valid range: 8-bit value. [0-255] + +grat_arp_en +----------- +Enable Gratuitous ARP Requests + +Valid values: "enable" or "disable" + +dhcp_alt_client_id_en +--------------------- +DHCP Use Alternate Client ID + +When dhcp_alt_client_id_en is set to enable, use the Client ID configured in +dhcp_alt_client_id as its Client ID (DHCP option 61) in outgoing DHCP messages. + +Valid values: "enable" or "disable" + +dhcp_alt_client_id +------------------ +DHCP Alternate Client ID + +When dhcp_alt_client_id_en is set to enable, use value set in dhcp_alt_client_id +for Client ID in DHCP messages. + +Valid values: 11-byte Client ID + +dhcp_req_vendor_id_en +--------------------- +DHCP Require Vendor ID + +When dhcp_req_vendor_id_en is set to enable, use value set in dhcp_vendor_id as +its vendor ID (DHCP option 60) in outgoing DHCP messages. + +Valid values: "enable" or "disable" + +dhcp_use_vendor_id_en +--------------------- +DHCP Use Vendor ID + +When dhcp_use_vendor_id_en is set to enable, use value set in dhcp_vendor_id as +its vendor ID (DHCP option 60) in outgoing DHCP messages. + +Valid values: "enable" or "disable" + +dhcp_vendor_id +-------------- +DHCP Vendor ID + +When dhcp_req_vendor_id_en or dhcp_use_vendor_id_en is set to enable, +use value set in dhcp_vendor_id for Vendor ID in DHCP messages. + +Valid values: 11-byte Client ID + +dhcp_learn_iqn_en +----------------- +DHCP Learn IQN + +When dhcp_learn_iqn_en is set to enable, iSCSI initiator attempts to use DHCP +to learn its (IQN) iSCSI name. + +Valid values: "enable" or "disable" + +fragment_disable +---------------- +Fragmentation Disable. + +When fragment_disable is set to disable, iSCSI initiator cannot fragment IP +datagrams. + +Valid values: "enable" or "disable" + +incoming_forwarding_en +---------------------- +When incoming_forwarding_en is set to enable, iSCSI initiator forwards all +incoming network traffic to the network driver, except for iSCSI TCP packets +destined to the iSCSI initiator. + +Valid values: "enable" or "disable" + +ttl +--- +IPv4 Time to Live (TTL) + +This attribute contain TTL value sent in IPv4 TCP packets transmitted on +iSCSI connections. + +Valid range: 8-bit value. [0-255] + +== IPv6 attributes == + +ipaddress +--------- +IP address in IPv6 format. + +link_local_addr +--------------- +Link local address in IPv6 format. + +router_addr +----------- +Router address in IPv6 format. + +ipaddr_autocfg +-------------- +Autoconfigure IPv6 Address. + +Valid values: nd, dhcpv6 or disable +qla4xxx don't support dhcpv6. + +link_local_autocfg +------------------ +Autoconfigure IPv6 Link Local Address. + +IPv6 neighbor discovery protocol to discover Link Local Address. + +Valid values: auto or disable + + +router_autocfg +-------------- +Autoconfigure IPv6 Router address. + +IPv6 neighbor discovery protocol to discover a default router address. + +Valid values: auto or disable + +link_local_state +---------------- +This Read-only attribute show Link Local IP address state in sysfs. + +Valid values: Unconfigured, Acquiring, Tentative, Valid, Disabling, Invalid, + Deprecated. + + +router_state +------------ +This Read-only attribute shows router state. + +Valid values: Unknown, Advertised, Manual, Stale. + + +grat_neighbor_adv_en +-------------------- +Enable Gratuitous Neighbor Advertisement + +Valid values: "enable" or "disable" + +mld_en +------ +Enable IPv6 Multicast Listener Discovery + +Valid values: "enable" or "disable" + +flow_label +---------- +This attribute specifies the default value of the Flow Label field in the +IPv6 header of TCP packets transmitted on iSCSI connections + +Valid range: 20-bit value. [0-1048575] +Value zero indicates that the traffic is not assigned to a labelled flow. + +traffic_class +------------- +This attribute specifies the IPv6 traffic class value to be used in IPv6 +TCP packets transmitted from the firmware on iSCSI connections. + +Valid range: 8-bit value. [0-255] + +hop_limit +--------- +This attribute specifies the IPv6 hop limit value to be used in IPv6 TCP +packets transmitted from the firmware on iSCSI connections + +Valid range: 8-bit value. [0-255] + +nd_reachable_tmo +---------------- +This attribute specifies the time (in milliseconds) that a node assumes +that the neighbor is reachable after confirmation. + +Valid range: 4-byte value. [0-4294967295] + +nd_rexmit_time +-------------- +This attribute specifies the time (in milliseconds) between retransmitted +neighbor solicitation messages. + +Valid range: 4-byte value. [0-4294967295] + +nd_stale_tmo +------------ +This attribute specifies the time (in milliseconds) after which a stale +neighbor or destination cache entry is discarded. + +Valid range: 4-byte value. [0-4294967295] + +dup_addr_detect_cnt +------------------- +This attribute specifies the IPv6 duplicate address detection count + +Valid range: 8-bit value. [0-255] + 0 - Disable + 1 - TryOnce + 2 - TryTwice, and so on + +router_adv_link_mtu +------------------- +IPv6 Router Advertised Link MTU Size. + +Valid range: 1280 bytes to 1500 bytes + +== Common == +enabled +------- +This attribute is used to enable or disable IPv4 or IPv6 protocol. + +Valid values: "enable" or "disable" + +vlan_id +------- +This attribute specifies 12-bit VLAN identifier (VID) + +Valid range: 12-bit value. [1-4094] + +vlan_priority +------------- +This attribute specifies Priority to outbound packets containing the +specified VLAN-ID (VID) + +Valid range: 3-bit value. [0-7] + +vlan_enabled +------------ +VLAN Tagging Enable. + +When this attribute is set to enable, use value set in vlan_id and +vlan_priority to transmit IP packets, and discards IP packets that were +received without a matching VLAN ID + +Valid values: "enable" or "disable" + +mtu +--- +Ethernet MTU Size. + +This field specifies the maximum payload length in byte of an +Ethernet frame supported by iSCSI initiator. + +Valid values: 576 bytes to 9000 bytes + +port +---- +This attribute shows the initiator iSCSI port number. + +ipaddress_state +--------------- +This Read-only attribute show IP address state. + +Valid values: Unconfigured, Acquiring, Tentative, Valid, Disabling, Invalid, + Deprecated. + +delayed_ack_en +-------------- +When this attribute is set to enable, TCP delayed ACK is enabled. + +Valid values: "enable" or "disable" + +tcp_nagle_disable +----------------- +When this attribute is set to disable, TCP Nagle algorithm is disabled. + +Valid values: "enable" or "disable" + +tcp_wsf_disable +--------------- +When this attribute is set to disable, TCP window scale is disabled. + +Valid values: "enable" or "disable" + +tcp_wsf +------- +This attribute specifies the TCP window scale factor to be negotiated +on TCP connections. + +Valid range: 8-bit value. [0-255] + +tcp_timer_scale +--------------- +The TCP Timer Scale is scale factor that adjusts the time interval between +timer ticks on a TCP connection. The scale factor allows for faster time-outs +for connections running on a very small network, versus connections running +on a very large network. + +Valid range: 3-bit value. [0-7] + +tcp_timestamp_en +---------------- +When this attribute is set to enable, iSCSI initiator negotiates to use time +stamps in TCP headers + +Valid values: "enable" or "disable" + +cache_id +-------- +This Read-only attribute is used to find the valid cache entries for the +interface. + +For IPv4, ARP cache entry +For IPv6, Neighbor cache entry + +redirect_en +----------- +For IPv4: +When this attribute is set to enable, an ARP redirect can modify the address +resolution protocol (ARP) table and any active connections. + +For IPv6: +When this attribute is set to enable and neighbor advertisements are received, +the connection table is examined and updated if any active connections match +the IP address on the neighbor advertisement. This action is required for +failover and redirect. + +Valid values: "enable" or "disable" + +def_taskmgmt_tmo +---------------- +This attribute specifies timeout interval in seconds that iSCSI uses for +timing out task-management commands. + +Valid range: 16-bit value [0-65535]. + +header_digest +------------- +When this attribute is set to enable iSCSI initiator negotiates for +HeaderDigest=CRC32 and when set to disable negotiates HeaderDigest=none. + +Valid values: "enable" or "disable" + +data_digest +----------- +When this attribute is set to enable iSCSI initiator negotiates for +DataDigest=CRC32 and when set to disable negotiates DataDigest=none. + +Valid values: "enable" or "disable" + +immediate_data +-------------- +When this attribute is set to enable iSCSI initiator negotiates for +ImmediateData=yes and When set to disable negotiates ImmediateData=none + +Valid values: "enable" or "disable" + +initial_r2t +----------- +When this attribute is set to enable iSCSI initiator negotiates for +InitialR2T=yes. When set to disable negotiates InitialR2T=no. + +Valid values: "enable" or "disable" + +data_seq_in_order +----------------- +When this attribute is set to enable iSCSI initiator set data sequences +in order + +Valid values: "enable" or "disable" +qla4xxx does not support out-of-order data sequences + +data_pdu_in_order +----------------- +When this attribute is set to enable iSCSI initiator set Data PDU +in order + +Valid values: "enable" or "disable" +qla4xxx does not support out-of-order Data PDUs. + +erl +--- +Error Recovery Level + +This attribute specifies error recovery level (ERL) supported by the +connection. + +Valid values: 2-bit value [0-2] + +max_recv_dlength +---------------- +iSCSI Maximum Receive Data Segment Length. + +This attribute specifies Maximum data segment length in bytes, that receive +in an iSCSI PDU. + +first_burst_len +--------------- +iSCSI First Burst Length + +This attribute Specifies the maximum amount of unsolicited data an iSCSI +initiator can send to the target during the execution of a single SCSI command, +in bytes. + +max_outstanding_r2t +------------------- +iSCSI Maximum Outstanding R2T + +This attribute Specifies how many R2T PDUs per command can be outstanding +during an iSCSI session. + +max_burst_len +------------- +This attribute Specifies the maximum length for unsolicited or immediate data +iSCSI session can send or receive. + +chap_auth +--------- +When this attribute is set to enable iSCSI session performs authentication +during the security state of login phase. + +Valid values: "enable" or "disable" + +bidi_chap +--------- +When this attribute is set to enable iSCSI session generates a CHAP challenge +to any target that has issued a CHAP challenge to the iSCSI session. +iSCSI session issues the challenge to the target after responding to the +targets challenge. This attribute is ignored if chap_auth is set to disable. + +Valid values: "enable" or "disable" + +discovery_auth_optional +----------------------- +When this attribute is set to enable and the chap_auth is set to enable, +iSCSI session does not require authentication on discovery sessions unless +requested by the peer. When this attribute is set to disable iSCSI session +requires CHAP authentication for a discovery session. + +Valid values: "enable" or "disable" + +discovery_logout +---------------- +When this attribute is set to enable, iSCSI initiator initiates an iSCSI logout +on a discovery session when discovery is complete (before closing the connection). +When this attribute is set to disable, iSCSI initiator closes the connection when +discovery is complete. + +Valid values: "enable" or "disable" + +strict_login_comp_en +-------------------- +When this attribute is set to enable, iSCSI initiator enforces the iSCSI login +negotiation rules. When this attribute is set to disable, iSCSI initiator does +not enforce iSCSI login negotiation. + +Valid values: "enable" or "disable" + +initiator_name +-------------- +This Read-only attribute contains the iSCSI Name string used by the firmware. diff -Nru open-iscsi-2.0.873+git0.3b4b4500/TODO open-iscsi-2.0.874/TODO --- open-iscsi-2.0.873+git0.3b4b4500/TODO 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/TODO 2016-09-29 18:33:24.000000000 +0000 @@ -89,7 +89,7 @@ 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. +use that to guard 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 @@ -175,7 +175,7 @@ --------------------------------------------------------------------------- 8. Improve the iscsi driver logging. Each driver has a different -way to control logging. We should unify them and make it managable +way to control logging. We should unify them and make it manageable by iscsiadm. So each driver would use a common format, there would be a common kernel interface to set the logging level, etc. @@ -210,7 +210,7 @@ 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 +a rare occurrence. 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? diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/actor.c open-iscsi-2.0.874/usr/actor.c --- open-iscsi-2.0.873+git0.3b4b4500/usr/actor.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/actor.c 2016-09-29 18:33:24.000000000 +0000 @@ -1,7 +1,8 @@ /* - * iSCSI usermode single-threaded scheduler + * iSCSI timeout & deferred work handling * * Copyright (C) 2004 Dmitry Yusupov, Alex Aizman + * Copyright (C) 2014 Red Hat Inc. * maintained by open-iscsi@googlegroups.com * * This program is free software; you can redistribute it and/or modify @@ -17,53 +18,32 @@ * See the file COPYING included with this distribution for more details. */ #include +#include +#include +#include +#include #include "actor.h" #include "log.h" #include "list.h" static LIST_HEAD(pend_list); -static LIST_HEAD(poll_list); -static LIST_HEAD(actor_list); -static volatile uint64_t previous_time; -static volatile uint32_t scheduler_loops; +static LIST_HEAD(ready_list); static volatile int poll_in_progress; -static volatile uint64_t actor_jiffies = 0; - -#define actor_diff(_time1, _time2) ({ \ - uint64_t __ret; \ - if ((_time2) >= (_time1)) \ - __ret = (_time2) - (_time1); \ - else \ - __ret = ((~0ULL) - (_time1)) + (_time2); \ - __ret; \ -}) - -#define ACTOR_TICKS actor_jiffies -#define ACTOR_TICKS_10MS(_a) (_a) -#define ACTOR_MS_TO_TICKS(_a) ((_a)/ACTOR_RESOLUTION) static uint64_t -actor_diff_time(actor_t *thread, uint64_t current_time) +actor_time_left(actor_t *thread, uint64_t current_time) { - uint64_t diff_time = actor_diff(thread->scheduled_at, current_time); - if(diff_time >= thread->ttschedule) + if (current_time > thread->ttschedule) return 0; - return (thread->ttschedule - diff_time); + else + return (thread->ttschedule - current_time); } #define time_after(a,b) \ ((int64_t)(b) - (int64_t)(a) < 0) void -actor_init(void) -{ - poll_in_progress = 0; - previous_time = 0; - scheduler_loops = 0; -} - -void -actor_new(actor_t *thread, void (*callback)(void *), void *data) +actor_init(actor_t *thread, void (*callback)(void *), void *data) { INIT_LIST_HEAD(&thread->list); thread->state = ACTOR_NOTSCHEDULED; @@ -77,11 +57,18 @@ log_debug(7, "thread %08lx delete: state %d", (long)thread, thread->state); switch(thread->state) { - case ACTOR_SCHEDULED: case ACTOR_WAITING: - case ACTOR_POLL_WAITING: + /* TODO: remove/reset alarm if we were 1st entry in pend_list */ + /* priority: low */ + /* fallthrough */ + case ACTOR_SCHEDULED: log_debug(1, "deleting a scheduled/waiting thread!"); list_del_init(&thread->list); + if (list_empty(&pend_list)) { + log_debug(7, "nothing left on pend_list, deactivating alarm"); + alarm(0); + } + break; default: break; @@ -89,73 +76,94 @@ thread->state = ACTOR_NOTSCHEDULED; } +/* + * Inserts actor on pend list and sets alarm if new item is + * sooner than previous entries. + */ +static void +actor_insert_on_pend_list(actor_t *thread, uint32_t delay_secs) +{ + struct actor *orig_head; + struct actor *new_head; + struct actor *next_thread; + + orig_head = list_first_entry_or_null(&pend_list, + struct actor, list); + + /* insert new entry in sort order */ + list_for_each_entry(next_thread, &pend_list, list) { + if (time_after(next_thread->ttschedule, thread->ttschedule)) { + log_debug(7, "next thread %p due %lld", next_thread, + (long long)next_thread->ttschedule); + log_debug(7, "new thread %p is before (%lld), inserting", thread, + (long long)thread->ttschedule); + + /* insert new thread before the next thread */ + __list_add(&thread->list, next_thread->list.prev, &next_thread->list); + goto inserted; + } + } + + if (orig_head) { + log_debug(7, "last thread %p due %lld", next_thread, + (long long)next_thread->ttschedule); + log_debug(7, "new thread %p is after (%lld), inserting at tail", thread, + (long long)thread->ttschedule); + } + else + log_debug(7, "new thread %p due %lld is first item on pend_list", thread, + (long long)thread->ttschedule); + + /* Not before any existing entries */ + list_add_tail(&thread->list, &pend_list); + +inserted: + new_head = list_first_entry(&pend_list, struct actor, list); + if (orig_head != new_head) { + int result = alarm(delay_secs); + log_debug(7, "new alarm set for %d seconds, old alarm %d", + delay_secs, result); + } +} + static void -actor_schedule_private(actor_t *thread, uint32_t ttschedule, int head) +actor_schedule_private(actor_t *thread, uint32_t delay_secs, int head) { - uint64_t delay_time, current_time; - actor_t *next_thread; + time_t current_time; + + struct timespec tv; + + if (clock_gettime(CLOCK_MONOTONIC_COARSE, &tv)) { + log_error("clock_getime failed, can't schedule!"); + return; + } - delay_time = ACTOR_MS_TO_TICKS(ttschedule); - current_time = ACTOR_TICKS; + current_time = tv.tv_sec; - log_debug(7, "thread %p schedule: delay %" PRIu64 " state %d", - thread, delay_time, thread->state); + log_debug(7, "thread %p schedule: delay %u state %d", + thread, delay_secs, thread->state); - /* convert ttscheduled msecs in 10s of msecs by dividing for now. - * later we will change param to 10s of msecs */ switch(thread->state) { case ACTOR_WAITING: log_error("rescheduling a waiting thread!"); list_del(&thread->list); + /* fall-through */ case ACTOR_NOTSCHEDULED: INIT_LIST_HEAD(&thread->list); - /* if ttschedule is 0, put in scheduled queue and change - * state to scheduled, else add current time to ttschedule and - * insert in the queue at the correct point */ - if (delay_time == 0) { - /* 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; - list_add_tail(&thread->list, - &poll_list); - } else { - thread->state = ACTOR_SCHEDULED; - if (head) - list_add(&thread->list, - &actor_list); - else - list_add_tail(&thread->list, - &actor_list); - } + + if (delay_secs == 0) { + thread->state = ACTOR_SCHEDULED; + if (head) + list_add(&thread->list, &ready_list); + else + list_add_tail(&thread->list, &ready_list); } else { thread->state = ACTOR_WAITING; - thread->ttschedule = delay_time; - thread->scheduled_at = current_time; + thread->ttschedule = current_time + delay_secs; - /* insert new entry in sort order */ - list_for_each_entry(next_thread, &pend_list, list) { - log_debug(7, "thread %p %" PRIu64 " %"PRIu64, - next_thread, - next_thread->scheduled_at + - next_thread->ttschedule, - current_time + delay_time); - - if (time_after(next_thread->scheduled_at + - next_thread->ttschedule, - current_time + delay_time)) { - list_add(&thread->list, - &next_thread->list); - goto done; - } - } - - list_add_tail(&thread->list, &pend_list); + actor_insert_on_pend_list(thread, delay_secs); } -done: break; - case ACTOR_POLL_WAITING: case ACTOR_SCHEDULED: // don't do anything break; @@ -180,117 +188,98 @@ } void -actor_timer(actor_t *thread, uint32_t timeout, void (*callback)(void *), +actor_timer(actor_t *thread, uint32_t timeout_secs, void (*callback)(void *), void *data) { - actor_new(thread, callback, data); - actor_schedule_private(thread, timeout, 0); + actor_init(thread, callback, data); + actor_schedule_private(thread, timeout_secs, 0); } -int -actor_timer_mod(actor_t *thread, uint32_t timeout, void *data) +void +actor_timer_mod(actor_t *thread, uint32_t new_timeout_secs, void *data) { - if (thread->state == ACTOR_WAITING) { - list_del_init(&thread->list); - thread->data = data; - actor_schedule_private(thread, timeout, 0); - return 1; - } - return 0; + actor_delete(thread); + thread->data = data; + actor_schedule_private(thread, new_timeout_secs, 0); } +/* + * Execute all items that have expired. + * + * Set an alarm if items remain. Caller must catch SIGALRM and + * then re-invoke this function. + */ void -actor_check(uint64_t current_time) +actor_poll(void) { struct actor *thread, *tmp; + uint64_t current_time; + struct timespec tv; + + if (poll_in_progress) { + log_error("recursive actor_poll() is not allowed"); + return; + } + + if (clock_gettime(CLOCK_MONOTONIC_COARSE, &tv)) { + log_error("clock_gettime failed, can't schedule!"); + return; + } + + current_time = tv.tv_sec; + + /* + * Move items that are ripe from pend_list to ready_list. + * Actors are in sorted order of ascending run time, so + * stop at the first unripe entry. + */ + log_debug(7, "current time %" PRIu64, current_time); list_for_each_entry_safe(thread, tmp, &pend_list, list) { - if (actor_diff_time(thread, current_time)) { - log_debug(7, "thread %08lx wait some more", - (long)thread); - /* wait some more */ + uint64_t time_left = actor_time_left(thread, current_time); + if (time_left) { + log_debug(7, "thread %08lx due %" PRIu64 ", wait %" PRIu64 " more", + (long)thread, thread->ttschedule, time_left); + + alarm(time_left); break; } - /* it is time to schedule this entry */ + /* This entry can be run now */ list_del_init(&thread->list); - log_debug(2, "thread %08lx was scheduled at %" PRIu64 ":" - "%" PRIu64 ", curtime %" PRIu64 " q_forw %p " - "&pend_list %p", - (long)thread, thread->scheduled_at, thread->ttschedule, - current_time, pend_list.next, &pend_list); - - if (poll_in_progress) { - thread->state = ACTOR_POLL_WAITING; - list_add_tail(&thread->list, &poll_list); - log_debug(7, "thread %08lx now in poll_list", - (long)thread); - } else { - thread->state = ACTOR_SCHEDULED; - list_add_tail(&thread->list, &actor_list); - log_debug(7, "thread %08lx now in actor_list", - (long)thread); - } - } -} - -void -actor_poll(void) -{ - uint64_t current_time; - struct actor *thread; + log_debug(2, "thread %08lx was scheduled for " + "%" PRIu64 ", curtime %" PRIu64 " q_forw %p " + "&pend_list %p", + (long)thread, thread->ttschedule, + current_time, pend_list.next, &pend_list); - /* check that there are no any concurrency */ - if (poll_in_progress) { - log_error("concurrent actor_poll() is not allowed"); + list_add_tail(&thread->list, &ready_list); + assert(thread->state == ACTOR_WAITING); + thread->state = ACTOR_SCHEDULED; + log_debug(7, "thread %08lx now in ready_list", + (long)thread); } - /* don't check wait list every single poll. - * get new time. Shift it to make 10s of msecs approx - * if new time is not same as old time */ - if (scheduler_loops++ > ACTOR_MAX_LOOPS) { - /* try coming in about every 100 msecs */ - current_time = ACTOR_TICKS; - scheduler_loops = 0; - /* checking whether we are in the same tick... */ - if ( ACTOR_TICKS_10MS(current_time) != - ACTOR_TICKS_10MS(previous_time)) { - previous_time = current_time; - actor_check(current_time); - } + /* Disable alarm if nothing else pending */ + if (list_empty(&pend_list)) { + log_debug(7, "nothing on pend_list, deactivating alarm"); + alarm(0); } - /* the following code to check in the main data path */ poll_in_progress = 1; - while (!list_empty(&actor_list)) { - thread = list_entry(actor_list.next, struct actor, list); + while (!list_empty(&ready_list)) { + thread = list_first_entry(&ready_list, struct actor, list); list_del_init(&thread->list); if (thread->state != ACTOR_SCHEDULED) - log_error("actor_list: thread state corrupted! " + log_error("ready_list: thread state corrupted! " "Thread with state %d in actor list.", thread->state); thread->state = ACTOR_NOTSCHEDULED; log_debug(7, "exec thread %08lx callback", (long)thread); thread->callback(thread->data); - log_debug(7, "thread removed\n"); + log_debug(7, "thread %08lx done", (long)thread); } poll_in_progress = 0; - - while (!list_empty(&poll_list)) { - thread = list_entry(poll_list.next, struct actor, list); - list_del_init(&thread->list); - - if (thread->state != ACTOR_POLL_WAITING) - log_error("poll_list: thread state corrupted!" - "Thread with state %d in poll list.", - thread->state); - thread->state = ACTOR_SCHEDULED; - list_add_tail(&thread->list, &actor_list); - log_debug(7, "thread %08lx removed from poll_list", - (long)thread); - } - - ACTOR_TICKS++; } diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/actor.h open-iscsi-2.0.874/usr/actor.h --- open-iscsi-2.0.873+git0.3b4b4500/usr/actor.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/actor.h 2016-09-29 18:33:24.000000000 +0000 @@ -22,15 +22,11 @@ #include "types.h" #include "list.h" -#define ACTOR_RESOLUTION 250 /* in millis */ -#define ACTOR_MAX_LOOPS 1 - typedef enum actor_state_e { ACTOR_INVALID, ACTOR_WAITING, ACTOR_SCHEDULED, ACTOR_NOTSCHEDULED, - ACTOR_POLL_WAITING } actor_state_e; typedef struct actor { @@ -38,18 +34,17 @@ actor_state_e state; void *data; void (*callback)(void * ); - uint64_t scheduled_at; - uint64_t ttschedule; + time_t ttschedule; } actor_t; -extern void actor_new(actor_t *thread, void (*callback)(void *), void * data); +extern void actor_init(actor_t *thread, void (*callback)(void *), void * data); extern void actor_delete(actor_t *thread); extern void actor_schedule_head(actor_t *thread); extern void actor_schedule(actor_t *thread); -extern void actor_timer(actor_t *thread, uint32_t timeout, +extern void actor_timer(actor_t *thread, uint32_t delay_secs, void (*callback)(void *), void *data); -extern int actor_timer_mod(actor_t *thread, uint32_t new_timeout, void *data); +extern void actor_timer_mod(actor_t *thread, uint32_t new_delay_secs, + void *data); extern void actor_poll(void); -extern void actor_init(void); #endif /* ACTOR_H */ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/auth.c open-iscsi-2.0.874/usr/auth.c --- open-iscsi-2.0.873+git0.3b4b4500/usr/auth.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/auth.c 2016-09-29 18:33:24.000000000 +0000 @@ -20,7 +20,7 @@ * RFC 3720. The code in this file is meant to be common for both kernel and * user level and makes use of only limited library functions, presently only * string.h. Routines specific to kernel, user level are implemented in - * seperate files under the appropriate directories. + * separate files under the appropriate directories. * This code in this files assumes a single thread of execution * for each iscsi_acl structure, and does no locking. */ @@ -109,13 +109,13 @@ /* the expected credentials are in the session */ if (session->username_in == NULL) { log_error("failing authentication, no incoming username " - "configured to authenticate target %s\n", + "configured to authenticate target %s", session->target_name); return AUTH_STATUS_FAIL; } if (strcmp(username, session->username_in) != 0) { log_error("failing authentication, received incorrect " - "username from target %s\n", session->target_name); + "username from target %s", session->target_name); return AUTH_STATUS_FAIL; } @@ -123,7 +123,7 @@ (session->password_in == NULL) || (session->password_in[0] == '\0')) { log_error("failing authentication, no incoming password " - "configured to authenticate target %s\n", + "configured to authenticate target %s", session->target_name); return AUTH_STATUS_FAIL; } @@ -132,7 +132,7 @@ if (rsp_length != sizeof(verify_data)) { log_error("failing authentication, received incorrect " - "CHAP response length %u from target %s\n", + "CHAP response length %u from target %s", rsp_length, session->target_name); return AUTH_STATUS_FAIL; } @@ -154,13 +154,13 @@ auth_md5_final(verify_data, &context); if (memcmp(response_data, verify_data, sizeof(verify_data)) == 0) { - log_debug(1, "initiator authenticated target %s\n", + log_debug(1, "initiator authenticated target %s", session->target_name); return AUTH_STATUS_PASS; } log_error("failing authentication, received incorrect CHAP " - "response from target %s\n", session->target_name); + "response from target %s", session->target_name); return AUTH_STATUS_FAIL; } @@ -1071,7 +1071,7 @@ /* * Should only happen if authentication - * protocol error occured. + * protocol error occurred. */ return; @@ -2002,7 +2002,7 @@ "AuthMethod negotiation failed", "AuthMethod negotiated to none", "CHAP algorithm negotiation failed", - "CHAP challange reflected", + "CHAP challenge reflected", "Local password same as remote", "Local password not set", "CHAP identifier bad", diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/be2iscsi.c open-iscsi-2.0.874/usr/be2iscsi.c --- open-iscsi-2.0.873+git0.3b4b4500/usr/be2iscsi.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/be2iscsi.c 2016-09-29 18:33:24.000000000 +0000 @@ -19,7 +19,6 @@ void be2iscsi_create_conn(struct iscsi_conn *conn) { struct iscsi_session *session = conn->session; - conn_rec_t *conn_rec = &session->nrec.conn[conn->id]; if (conn->max_recv_dlength > 65536) conn->max_recv_dlength = 65536; @@ -33,10 +32,6 @@ if (conn->max_xmit_dlength > 65536) conn->max_xmit_dlength = 65536; - if (!conn_rec->iscsi.MaxXmitDataSegmentLength || - conn_rec->iscsi.MaxXmitDataSegmentLength > 65536) - conn_rec->iscsi.MaxXmitDataSegmentLength = 65536; - session->erl = 0; session->initial_r2t_en = 1; } diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/config.h open-iscsi-2.0.874/usr/config.h --- open-iscsi-2.0.873+git0.3b4b4500/usr/config.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/config.h 2016-09-29 18:33:24.000000000 +0000 @@ -232,11 +232,59 @@ * 1 = enable */ uint16_t mtu; uint16_t port; + char delayed_ack[ISCSI_MAX_STR_LEN]; + char nagle[ISCSI_MAX_STR_LEN]; + char tcp_wsf_state[ISCSI_MAX_STR_LEN]; + uint8_t tcp_wsf; + uint8_t tcp_timer_scale; + char tcp_timestamp[ISCSI_MAX_STR_LEN]; + char dhcp_dns[ISCSI_MAX_STR_LEN]; + char dhcp_slp_da[ISCSI_MAX_STR_LEN]; + char tos_state[ISCSI_MAX_STR_LEN]; + uint8_t tos; + char gratuitous_arp[ISCSI_MAX_STR_LEN]; + char dhcp_alt_client_id_state[ISCSI_MAX_STR_LEN]; + char dhcp_alt_client_id[ISCSI_MAX_STR_LEN]; + char dhcp_req_vendor_id_state[ISCSI_MAX_STR_LEN]; + char dhcp_vendor_id_state[ISCSI_MAX_STR_LEN]; + char dhcp_vendor_id[ISCSI_MAX_STR_LEN]; + char dhcp_learn_iqn[ISCSI_MAX_STR_LEN]; + char fragmentation[ISCSI_MAX_STR_LEN]; + char incoming_forwarding[ISCSI_MAX_STR_LEN]; + uint8_t ttl; + char gratuitous_neighbor_adv[ISCSI_MAX_STR_LEN]; + char redirect[ISCSI_MAX_STR_LEN]; + char mld[ISCSI_MAX_STR_LEN]; + uint32_t flow_label; + uint32_t traffic_class; + uint8_t hop_limit; + uint32_t nd_reachable_tmo; + uint32_t nd_rexmit_time; + uint32_t nd_stale_tmo; + uint8_t dup_addr_detect_cnt; + uint32_t router_adv_link_mtu; + uint16_t def_task_mgmt_tmo; + char header_digest[ISCSI_MAX_STR_LEN]; + char data_digest[ISCSI_MAX_STR_LEN]; + char immediate_data[ISCSI_MAX_STR_LEN]; + char initial_r2t[ISCSI_MAX_STR_LEN]; + char data_seq_inorder[ISCSI_MAX_STR_LEN]; + char data_pdu_inorder[ISCSI_MAX_STR_LEN]; + uint8_t erl; + uint32_t max_recv_dlength; + uint32_t first_burst_len; + uint16_t max_out_r2t; + uint32_t max_burst_len; + char chap_auth[ISCSI_MAX_STR_LEN]; + char bidi_chap[ISCSI_MAX_STR_LEN]; + char strict_login_comp[ISCSI_MAX_STR_LEN]; + char discovery_auth[ISCSI_MAX_STR_LEN]; + char discovery_logout[ISCSI_MAX_STR_LEN]; char port_state[ISCSI_MAX_STR_LEN]; char port_speed[ISCSI_MAX_STR_LEN]; /* * TODO: we may have to make this bigger and interconnect - * specific for infinniband + * specific for infiniband */ char hwaddress[ISCSI_HWADDRESS_BUF_SIZE]; char transport_name[ISCSI_TRANSPORT_NAME_MAXLEN]; diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/discovery.c open-iscsi-2.0.874/usr/discovery.c --- open-iscsi-2.0.873+git0.3b4b4500/usr/discovery.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/discovery.c 2016-09-29 18:33:24.000000000 +0000 @@ -50,9 +50,9 @@ #include "iscsi_timer.h" #include "iscsi_err.h" /* libisns includes */ -#include "isns.h" -#include "paths.h" -#include "message.h" +#include +#include +#include #ifdef SLP_ENABLE #include "iscsi-slp-discovery.h" @@ -111,7 +111,7 @@ int len; if (port > USHRT_MAX) { - log_error("Invalid port %d\n", port); + log_error("Invalid port %d", port); return ISCSI_ERR_INVAL; } @@ -193,7 +193,7 @@ status = isns_query_response_get_objects(qry, &objects); if (status) { log_error("Unable to extract object list from query " - "response: %s\n", isns_strerror(status)); + "response: %s", isns_strerror(status)); rc = ISCSI_ERR; goto free_query; } @@ -391,7 +391,7 @@ rc = fw_get_targets(&targets); if (rc) { log_error("Could not get list of targets from firmware. " - "(err %d)\n", rc); + "(err %d)", rc); return rc; } if (list_empty(&targets)) @@ -406,7 +406,7 @@ rec = idbm_create_rec_from_boot_context(bcontext); if (!rec) { log_error("Could not convert firmware info to " - "node record.\n"); + "node record."); rc = ISCSI_ERR_NOMEM; goto free_targets; } @@ -456,7 +456,7 @@ */ rc = iscsid_exec_req(&req, &rsp, 1); if (rc) { - log_error("Could not offload sendtargets to %s.\n", + log_error("Could not offload sendtargets to %s.", drec->address); iscsi_err_print_msg(rc); return rc; @@ -817,7 +817,7 @@ 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 " - "then retry the command.\n", iface->transport_name); + "then retry the command.", iface->transport_name); *rc = ISCSI_ERR_TRANS_NOT_FOUND; goto fail; } @@ -1036,7 +1036,7 @@ rc = ipc->stop_conn(session->t->handle, session->id, conn->id, STOP_CONN_TERM); if (rc) { - log_error("Could not stop conn %d:%d cleanly (err %d)\n", + log_error("Could not stop conn %d:%d cleanly (err %d)", session->id, conn->id, rc); goto done; } @@ -1091,7 +1091,7 @@ */ conn->socket_fd = ipc->ctldev_open(); if (conn->socket_fd < 0) { - log_error("Could not open netlink interface (err %d)\n", + log_error("Could not open netlink interface (err %d)", errno); return ISCSI_ERR_INTERNAL; } @@ -1109,14 +1109,15 @@ rc = iscsi_host_set_net_params(iface, session); if (rc) { - log_error("Could not set host net params (err %d)\n", + log_error("Could not set host net params (err %d)", rc); - rc = ISCSI_ERR_INTERNAL; + if (rc != ISCSI_ERR_AGAIN) + rc = ISCSI_ERR_INTERNAL; goto close_ipc; } /* create interconnect endpoint */ - log_debug(2, "%s discovery ep connect\n", __FUNCTION__); + log_debug(2, "%s discovery ep connect", __FUNCTION__); rc = t->template->ep_connect(conn, 1); if (rc < 0) { rc = ISCSI_ERR_TRANS; @@ -1139,21 +1140,23 @@ break; } while (1); - log_debug(2, "%s discovery create session\n", __FUNCTION__); + log_debug(2, "%s discovery create session", __FUNCTION__); /* create kernel structs */ rc = ipc->create_session(session->t->handle, conn->transport_ep_handle, 1, 32, 1, &session->id, &host_no); if (rc) { - log_error("Could not create kernel session (err %d).\n", rc); + log_error("Could not create kernel session (err %d).", rc); rc = ISCSI_ERR_INTERNAL; goto disconnect; } - log_debug(2, "%s discovery created session %u\n", __FUNCTION__, + log_debug(2, "%s discovery created session %u", __FUNCTION__, session->id); - session->isid[3] = session->id; + session->isid[3] = (session->id >> 16) & 0xff; + session->isid[4] = (session->id >> 8) & 0xff; + session->isid[5] = session->id & 0xff; - log_debug(2, "%s discovery create conn\n", __FUNCTION__); + log_debug(2, "%s discovery create conn", __FUNCTION__); rc = ipc->create_conn(t->handle, session->id, conn->id, &conn->id); if (rc) { log_error("Could not create connection (err %d)", rc); @@ -1161,7 +1164,7 @@ goto disconnect; } - log_debug(2, "%s discovery bind conn\n", __FUNCTION__); + log_debug(2, "%s discovery bind conn", __FUNCTION__); if (ipc->bind_conn(t->handle, session->id, conn->id, conn->transport_ep_handle, (conn->id == 0), &rc) || rc) { @@ -1207,7 +1210,7 @@ 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); + log_debug(2, "%s: ev_size %d", __FUNCTION__, ev_size); ipc_ev_context.data = calloc(1, ev_size); if (!ipc_ev_context.data) @@ -1403,6 +1406,17 @@ iscsi_copy_operational_params(&session->conn[0], &config->session_conf, &config->conn_conf); + if (t->caps & CAP_TEXT_NEGO) { + log_debug(2, "%s discovery set params", __FUNCTION__); + rc = iscsi_session_set_params(conn); + if (rc) { + log_error("Could not set iscsi params for conn %d:%d " + "(err %d)", session->id, conn->id, rc); + rc = ISCSI_ERR_INTERNAL; + goto login_failed; + } + } + if ((session->t->caps & CAP_LOGIN_OFFLOAD)) goto start_conn; @@ -1477,7 +1491,7 @@ case ISCSI_LOGIN_STATUS_AUTH_FAILED: case ISCSI_LOGIN_STATUS_TGT_FORBIDDEN: log_error("discovery login to %s rejected: " - "initiator failed authorization\n", + "initiator failed authorization", conn->host); rc = ISCSI_ERR_LOGIN_AUTH_FAILED; goto login_failed; @@ -1509,16 +1523,16 @@ return 0; start_conn: - log_debug(2, "%s discovery set params\n", __FUNCTION__); - rc = iscsi_session_set_params(conn); + log_debug(2, "%s discovery set neg params", __FUNCTION__); + rc = iscsi_session_set_neg_params(conn); if (rc) { log_error("Could not set iscsi params for conn %d:%d (err " - "%d)\n", session->id, conn->id, rc); + "%d)", session->id, conn->id, rc); rc = ISCSI_ERR_INTERNAL; goto login_failed; } - log_debug(2, "%s discovery start conn\n", __FUNCTION__); + log_debug(2, "%s discovery start conn", __FUNCTION__); if (ipc->start_conn(t->handle, session->id, conn->id, &rc) || rc) { log_error("Cannot start conn %d:%d (err %d)", session->id, conn->id, rc); diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/discoveryd.c open-iscsi-2.0.874/usr/discoveryd.c --- open-iscsi-2.0.873+git0.3b4b4500/usr/discoveryd.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/discoveryd.c 2016-09-29 18:33:24.000000000 +0000 @@ -40,11 +40,11 @@ #include "iface.h" #include "session_mgmt.h" #include "session_info.h" -#include "isns-proto.h" -#include "isns.h" -#include "paths.h" -#include "message.h" #include "iscsi_err.h" +#include +#include +#include +#include #define DISC_DEF_POLL_INVL 30 @@ -211,7 +211,7 @@ exit(0); } else if (pid < 0) log_error("Fork failed (err %d - %s). Will not be able " - "to perform discovery to %s.\n", + "to perform discovery to %s.", errno, strerror(errno), drec->address); else { shutdown_callback(pid); @@ -254,7 +254,7 @@ nportals = isns_enumerate_portals(iflist, nportals); if (nportals == 0) { log_error("Unable to enumerate portals - " - "no usable interfaces found\n"); + "no usable interfaces found"); free(iflist); return ISCSI_ERR_NO_OBJS_FOUND; } @@ -557,7 +557,7 @@ status = isns_query_response_get_objects(rsp, &objs); if (status) { log_error("Unable to extract object list from " - "registration response: %s\n", + "registration response: %s", isns_strerror(status)); return ISCSI_ERR; } @@ -693,7 +693,7 @@ status = isns_simple_call(clnt->ic_socket, ®); if (status != ISNS_SUCCESS) { - log_error("SCN registration for node %s failed: %s\n", + log_error("SCN registration for node %s failed: %s", isns_source_name(node->source), isns_strerror(status)); /* @@ -907,7 +907,7 @@ function = isns_message_function(msg); if (function != ISNS_STATE_CHANGE_NOTIFICATION) { - log_warning("Discarding unexpected %s message\n", + log_warning("Discarding unexpected %s message", isns_function_name(function)); isns_message_release(msg); continue; diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/event_poll.c open-iscsi-2.0.874/usr/event_poll.c --- open-iscsi-2.0.873+git0.3b4b4500/usr/event_poll.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/event_poll.c 2016-09-29 18:33:24.000000000 +0000 @@ -26,6 +26,8 @@ #include #include #include +#include +#include #include "mgmt_ipc.h" #include "iscsi_ipc.h" @@ -37,7 +39,9 @@ #include "initiator.h" #include "iscsi_err.h" -static int reap_count; +static unsigned int reap_count; + +#define REAP_WAKEUP 1000 /* in millisecs */ void reap_inc(void) { @@ -50,7 +54,7 @@ /* * We don't really need reap_count, but calling wait() all the - * time seems execessive. + * time seems excessive. */ max_reaps = reap_count; for (i = 0; i < max_reaps; i++) { @@ -80,7 +84,7 @@ INIT_LIST_HEAD(&cb->list); cb->pid = pid; - log_debug(1, "adding %d for shutdown cb\n", pid); + log_debug(1, "adding %d for shutdown cb", pid); list_add_tail(&cb->list, &shutdown_callbacks); return 0; } @@ -90,7 +94,7 @@ struct shutdown_callback *cb; list_for_each_entry(cb, &shutdown_callbacks, list) { - log_debug(1, "Killing %d\n", cb->pid); + log_debug(1, "Killing %d", cb->pid); kill(cb->pid, SIGTERM); } } @@ -105,7 +109,7 @@ * sign that it is gone. */ if (waitpid(cb->pid, NULL, WNOHANG)) { - log_debug(1, "%d done\n", cb->pid); + log_debug(1, "%d done", cb->pid); list_del(&cb->list); free(cb); } @@ -116,12 +120,12 @@ #define POLL_CTRL 0 #define POLL_IPC 1 -#define POLL_MAX 2 +#define POLL_ALARM 2 +#define POLL_MAX 3 static int event_loop_stop; static queue_task_t *shutdown_qtask; - void event_loop_exit(queue_task_t *qtask) { shutdown_qtask = qtask; @@ -132,11 +136,26 @@ { struct pollfd poll_array[POLL_MAX]; int res, has_shutdown_children = 0; + sigset_t sigset; + int sig_fd; + + /* Mask off SIGALRM so we can recv it via signalfd */ + sigemptyset(&sigset); + sigaddset(&sigset, SIGALRM); + sigprocmask(SIG_SETMASK, &sigset, NULL); + + sig_fd = signalfd(-1, &sigset, SFD_NONBLOCK); + if (sig_fd == -1) { + log_error("signalfd failed: %m"); + return; + } poll_array[POLL_CTRL].fd = control_fd; poll_array[POLL_CTRL].events = POLLIN; poll_array[POLL_IPC].fd = mgmt_ipc_fd; poll_array[POLL_IPC].events = POLLIN; + poll_array[POLL_ALARM].fd = sig_fd; + poll_array[POLL_ALARM].events = POLLIN; event_loop_stop = 0; while (1) { @@ -149,7 +168,11 @@ break; } - res = poll(poll_array, POLL_MAX, ACTOR_RESOLUTION); + /* Runs actors and may set alarm for future actors */ + actor_poll(); + + res = poll(poll_array, POLL_MAX, reap_count ? REAP_WAKEUP : -1); + if (res > 0) { log_debug(6, "poll result %d", res); if (poll_array[POLL_CTRL].revents) @@ -157,6 +180,18 @@ if (poll_array[POLL_IPC].revents) mgmt_ipc_handle(mgmt_ipc_fd); + + if (poll_array[POLL_ALARM].revents) { + struct signalfd_siginfo si; + + if (read(sig_fd, &si, sizeof(si)) == -1) { + log_error("got sigfd read() error, errno (%d), " + "exiting", errno); + break; + } else { + log_debug(1, "Poll was woken by an alarm"); + } + } } else if (res < 0) { if (errno == EINTR) { log_debug(1, "event_loop interrupted"); @@ -165,15 +200,20 @@ "exiting", res, errno); break; } - } else - actor_poll(); + } + reap_proc(); + /* * flush sysfs cache since kernel objs may * have changed as a result of handling op */ sysfs_cleanup(); } + if (shutdown_qtask) mgmt_ipc_write_rsp(shutdown_qtask, ISCSI_SUCCESS); + + close(sig_fd); + sigprocmask(SIG_UNBLOCK, &sigset, NULL); } diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/flashnode.c open-iscsi-2.0.874/usr/flashnode.c --- open-iscsi-2.0.873+git0.3b4b4500/usr/flashnode.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/flashnode.c 2016-09-29 18:33:24.000000000 +0000 @@ -449,6 +449,12 @@ fnode->sess.portal_type, sizeof(fnode->sess.portal_type))) count++; + } else if (!strcmp(param->name, + to_key(FLASHNODE_SESS_CHAP_OUT_IDX))) { + if (!flashnode_fill_uint32(fnode, &iov[count], + ISCSI_FLASHNODE_CHAP_OUT_IDX, + fnode->sess.chap_out_idx)) + count++; } else if (!strcmp(param->name, to_key(FLASHNODE_CONN_PORT))) { if (fnode->conn[0].port) port = fnode->conn[0].port; diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/host.c open-iscsi-2.0.874/usr/host.c --- open-iscsi-2.0.873+git0.3b4b4500/usr/host.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/host.c 2016-09-29 18:33:24.000000000 +0000 @@ -34,6 +34,7 @@ #include "initiator.h" #include "iface.h" #include "iscsi_err.h" +#include "iscsi_netlink.h" static int match_host_to_session(void *data, struct session_info *info) { @@ -273,6 +274,7 @@ printf("iSCSI Transport Class version %s\n", version); printf("version %s\n", ISCSI_VERSION_STR); + free(version); } flags |= SESSION_INFO_SCSI_DEVS; @@ -314,3 +316,112 @@ } return 0; } + +static int chap_fill_param_uint(struct iovec *iov, int param, + uint32_t param_val, int param_len) +{ + struct iscsi_param_info *param_info; + struct nlattr *attr; + int len; + uint8_t val8 = 0; + uint16_t val16 = 0; + uint32_t val32 = 0; + char *val = NULL; + + len = sizeof(struct iscsi_param_info) + param_len; + iov->iov_base = iscsi_nla_alloc(param, len); + if (!iov->iov_base) + return 1; + + attr = iov->iov_base; + iov->iov_len = NLA_ALIGN(attr->nla_len); + + param_info = (struct iscsi_param_info *)ISCSI_NLA_DATA(attr); + param_info->param = param; + param_info->len = param_len; + + switch (param_len) { + case 1: + val8 = (uint8_t)param_val; + val = (char *)&val8; + break; + + case 2: + val16 = (uint16_t)param_val; + val = (char *)&val16; + break; + + case 4: + val32 = (uint32_t)param_val; + val = (char *)&val32; + break; + + default: + goto free; + } + memcpy(param_info->value, val, param_len); + + return 0; + +free: + free(iov->iov_base); + iov->iov_base = NULL; + iov->iov_len = 0; + return 1; +} + +static int chap_fill_param_str(struct iovec *iov, int param, char *param_val, + int param_len) +{ + struct iscsi_param_info *param_info; + struct nlattr *attr; + int len; + + len = sizeof(struct iscsi_param_info) + param_len; + iov->iov_base = iscsi_nla_alloc(param, len); + if (!iov->iov_base) + return 1; + + attr = iov->iov_base; + iov->iov_len = NLA_ALIGN(attr->nla_len); + + param_info = (struct iscsi_param_info *)ISCSI_NLA_DATA(attr); + param_info->param = param; + param_info->len = param_len; + memcpy(param_info->value, param_val, param_len); + return 0; +} + +int chap_build_config(struct iscsi_chap_rec *crec, struct iovec *iovs) +{ + struct iovec *iov = NULL; + int count = 0; + + /* start at 2, because 0 is for nlmsghdr and 1 for event */ + iov = iovs + 2; + + if (!chap_fill_param_uint(&iov[count], ISCSI_CHAP_PARAM_INDEX, + crec->chap_tbl_idx, + sizeof(crec->chap_tbl_idx))) + count++; + + if (!chap_fill_param_uint(&iov[count], ISCSI_CHAP_PARAM_CHAP_TYPE, + crec->chap_type, sizeof(crec->chap_type))) + count++; + + if (!chap_fill_param_str(&iov[count], ISCSI_CHAP_PARAM_USERNAME, + crec->username, strlen(crec->username))) + count++; + + if (!chap_fill_param_str(&iov[count], ISCSI_CHAP_PARAM_PASSWORD, + (char *)crec->password, + strlen((char *)crec->password))) + count++; + + if (!chap_fill_param_uint(&iov[count], ISCSI_CHAP_PARAM_PASSWORD_LEN, + crec->password_length, + sizeof(crec->password_length))) + count++; + + return count; +} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/host.h open-iscsi-2.0.874/usr/host.h --- open-iscsi-2.0.873+git0.3b4b4500/usr/host.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/host.h 2016-09-29 18:33:24.000000000 +0000 @@ -7,6 +7,7 @@ #define MAX_HOST_NO UINT_MAX +#define MAX_CHAP_ENTRIES 2048 #define MAX_CHAP_BUF_SZ 4096 #define REQ_CHAP_BUF_SZ (MAX_CHAP_BUF_SZ + sizeof(struct iscsi_uevent)) @@ -16,5 +17,6 @@ }; extern int host_info_print(int info_level, uint32_t host_no); +extern int chap_build_config(struct iscsi_chap_rec *crec, struct iovec *iovs); #endif diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/idbm.c open-iscsi-2.0.874/usr/idbm.c --- open-iscsi-2.0.873+git0.3b4b4500/usr/idbm.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/idbm.c 2016-09-29 18:33:24.000000000 +0000 @@ -237,6 +237,9 @@ idbm_recinfo_node(node_rec_t *r, recinfo_t *ri) { int num = 0, i; + int iface_type; + + iface_type = iface_get_iptype(&r->iface); __recinfo_str(NODE_NAME, ri, r, name, IDBM_SHOW, num, 0); __recinfo_int(NODE_TPGT, ri, r, tpgt, IDBM_SHOW, num, 0); @@ -252,13 +255,15 @@ * * Users should nornmally not want to change the iface ones * in the node record directly and instead do it through - * the iface mode which will do the right thing (althought that + * the iface mode which will do the right thing (although that * needs some locking). */ __recinfo_str(IFACE_HWADDR, ri, r, iface.hwaddress, IDBM_SHOW, num, 1); __recinfo_str(IFACE_IPADDR, ri, r, iface.ipaddress, IDBM_SHOW, num, 1); __recinfo_str(IFACE_ISCSINAME, ri, r, iface.name, IDBM_SHOW, num, 1); __recinfo_str(IFACE_NETNAME, ri, r, iface.netdev, IDBM_SHOW, num, 1); + __recinfo_str(IFACE_GATEWAY, ri, r, iface.gateway, IDBM_SHOW, num, 1); + __recinfo_str(IFACE_SUBNET_MASK, ri, r, iface.subnet_mask, IDBM_SHOW, num, 1); /* * svn 780 compat: older versions used node.transport_name and * rec->transport_name @@ -266,21 +271,6 @@ __recinfo_str(IFACE_TRANSPORTNAME, ri, r, iface.transport_name, IDBM_SHOW, num, 1); __recinfo_str(IFACE_INAME, ri, r, iface.iname, IDBM_SHOW, num, 1); - __recinfo_str(IFACE_BOOT_PROTO, ri, r, iface.bootproto, IDBM_SHOW, - num, 1); - __recinfo_str(IFACE_SUBNET_MASK, ri, r, iface.subnet_mask, - IDBM_SHOW, num, 1); - __recinfo_str(IFACE_GATEWAY, ri, r, iface.gateway, IDBM_SHOW, num, 1); - __recinfo_str(IFACE_IPV6_AUTOCFG, ri, r, iface.ipv6_autocfg, - IDBM_SHOW, num, 1); - __recinfo_str(IFACE_LINKLOCAL_AUTOCFG, ri, r, iface.linklocal_autocfg, - IDBM_SHOW, num, 1); - __recinfo_str(IFACE_ROUTER_AUTOCFG, ri, r, iface.router_autocfg, - IDBM_SHOW, num, 1); - __recinfo_str(IFACE_LINKLOCAL, ri, r, iface.ipv6_linklocal, - IDBM_SHOW, num, 1); - __recinfo_str(IFACE_ROUTER, ri, r, iface.ipv6_router, IDBM_SHOW, num, - 1); __recinfo_str(IFACE_STATE, ri, r, iface.state, IDBM_SHOW, num, 1); __recinfo_uint16(IFACE_VLAN_ID, ri, r, iface.vlan_id, IDBM_SHOW, num, 1); @@ -292,6 +282,115 @@ __recinfo_uint16(IFACE_MTU, ri, r, iface.mtu, IDBM_SHOW, num, 1); __recinfo_uint16(IFACE_PORT, ri, r, iface.port, IDBM_SHOW, num, 1); + if (iface_type == ISCSI_IFACE_TYPE_IPV4) { + __recinfo_str(IFACE_BOOT_PROTO, ri, r, iface.bootproto, + IDBM_SHOW, num, 1); + __recinfo_str(IFACE_DHCP_ALT_CID, ri, r, + iface.dhcp_alt_client_id_state, IDBM_SHOW, + num, 1); + __recinfo_str(IFACE_DHCP_ALT_CID_STR, ri, r, + iface.dhcp_alt_client_id, IDBM_SHOW, num, 1); + __recinfo_str(IFACE_DHCP_DNS, ri, r, iface.dhcp_dns, IDBM_SHOW, + num, 1); + __recinfo_str(IFACE_DHCP_LEARN_IQN, ri, r, + iface.dhcp_learn_iqn, IDBM_SHOW, num, 1); + __recinfo_str(IFACE_DHCP_REQ_VID, ri, r, + iface.dhcp_req_vendor_id_state, IDBM_SHOW, + num, 1); + __recinfo_str(IFACE_DHCP_VID, ri, r, iface.dhcp_vendor_id_state, + IDBM_SHOW, num, 1); + __recinfo_str(IFACE_DHCP_VID_STR, ri, r, iface.dhcp_vendor_id, + IDBM_SHOW, num, 1); + __recinfo_str(IFACE_DHCP_SLP_DA, ri, r, iface.dhcp_slp_da, + IDBM_SHOW, num, 1); + __recinfo_str(IFACE_FRAGMENTATION, ri, r, iface.fragmentation, + IDBM_SHOW, num, 1); + __recinfo_str(IFACE_GRAT_ARP, ri, r, iface.gratuitous_arp, + IDBM_SHOW, num, 1); + __recinfo_str(IFACE_IN_FORWARD, ri, r, + iface.incoming_forwarding, IDBM_SHOW, num, 1); + __recinfo_str(IFACE_TOS_STATE, ri, r, iface.tos_state, + IDBM_SHOW, num, 1); + __recinfo_uint8(IFACE_TOS, ri, r, iface.tos, IDBM_SHOW, num, 1); + __recinfo_uint8(IFACE_TTL, ri, r, iface.ttl, IDBM_SHOW, num, 1); + } else if (iface_type == ISCSI_IFACE_TYPE_IPV6) { + __recinfo_str(IFACE_IPV6_AUTOCFG, ri, r, iface.ipv6_autocfg, + IDBM_SHOW, num, 1); + __recinfo_str(IFACE_LINKLOCAL_AUTOCFG, ri, r, + iface.linklocal_autocfg, IDBM_SHOW, num, 1); + __recinfo_str(IFACE_ROUTER_AUTOCFG, ri, r, iface.router_autocfg, + IDBM_SHOW, num, 1); + __recinfo_str(IFACE_LINKLOCAL, ri, r, iface.ipv6_linklocal, + IDBM_SHOW, num, 1); + __recinfo_str(IFACE_ROUTER, ri, r, iface.ipv6_router, + IDBM_SHOW, num, 1); + __recinfo_uint8(IFACE_DUP_ADDR_DETECT_CNT, ri, r, + iface.dup_addr_detect_cnt, IDBM_SHOW, num, 1); + __recinfo_uint32(IFACE_FLOW_LABEL, ri, r, iface.flow_label, + IDBM_SHOW, num, 1); + __recinfo_str(IFACE_GRAT_NEIGHBOR_ADV, ri, r, + iface.gratuitous_neighbor_adv, IDBM_SHOW, num, 1); + __recinfo_uint8(IFACE_HOP_LIMIT, ri, r, iface.hop_limit, + IDBM_SHOW, num, 1); + __recinfo_str(IFACE_MLD, ri, r, iface.mld, IDBM_SHOW, num, 1); + __recinfo_uint32(IFACE_ND_REACHABLE_TMO, ri, r, + iface.nd_reachable_tmo, IDBM_SHOW, num, 1); + __recinfo_uint32(IFACE_ND_REXMIT_TIME, ri, r, + iface.nd_rexmit_time, IDBM_SHOW, num, 1); + __recinfo_uint32(IFACE_ND_STALE_TMO, ri, r, iface.nd_stale_tmo, + IDBM_SHOW, num, 1); + __recinfo_uint32(IFACE_RTR_ADV_LINK_MTU, ri, r, + iface.router_adv_link_mtu, IDBM_SHOW, num, 1); + __recinfo_uint8(IFACE_TRAFFIC_CLASS, ri, r, iface.traffic_class, + IDBM_SHOW, num, 1); + } + + __recinfo_str(IFACE_DELAYED_ACK, ri, r, iface.delayed_ack, IDBM_SHOW, + num, 1); + __recinfo_str(IFACE_TCP_NAGLE, ri, r, iface.nagle, IDBM_SHOW, num, 1); + __recinfo_str(IFACE_TCP_WSF_STATE, ri, r, iface.tcp_wsf_state, + IDBM_SHOW, num, 1); + __recinfo_uint8(IFACE_TCP_WSF, ri, r, iface.tcp_wsf, IDBM_SHOW, num, 1); + __recinfo_uint8(IFACE_TCP_TIMER_SCALE, ri, r, iface.tcp_timer_scale, + IDBM_SHOW, num, 1); + __recinfo_str(IFACE_TCP_TIMESTAMP, ri, r, iface.tcp_timestamp, + IDBM_SHOW, num, 1); + __recinfo_str(IFACE_REDIRECT, ri, r, iface.redirect, IDBM_SHOW, num, 1); + __recinfo_uint16(IFACE_DEF_TMF_TMO, ri, r, iface.def_task_mgmt_tmo, + IDBM_SHOW, num, 1); + __recinfo_str(IFACE_HDRDGST, ri, r, iface.header_digest, IDBM_SHOW, + num, 1); + __recinfo_str(IFACE_DATADGST, ri, r, iface.data_digest, IDBM_SHOW, + num, 1); + __recinfo_str(IFACE_IMM_DATA, ri, r, iface.immediate_data, IDBM_SHOW, + num, 1); + __recinfo_str(IFACE_INITIAL_R2T, ri, r, iface.initial_r2t, IDBM_SHOW, + num, 1); + __recinfo_str(IFACE_DSEQ_INORDER, ri, r, iface.data_seq_inorder, + IDBM_SHOW, num, 1); + __recinfo_str(IFACE_DPDU_INORDER, ri, r, iface.data_pdu_inorder, + IDBM_SHOW, num, 1); + __recinfo_uint8(IFACE_ERL, ri, r, iface.erl, IDBM_SHOW, num, 1); + __recinfo_uint32(IFACE_MAX_RECV_DLEN, ri, r, iface.max_recv_dlength, + IDBM_SHOW, num, 1); + __recinfo_uint32(IFACE_FIRST_BURST, ri, r, iface.first_burst_len, + IDBM_SHOW, num, 1); + __recinfo_uint16(IFACE_MAX_R2T, ri, r, iface.max_out_r2t, IDBM_SHOW, + num, 1); + __recinfo_uint32(IFACE_MAX_BURST, ri, r, iface.max_burst_len, IDBM_SHOW, + num, 1); + __recinfo_str(IFACE_CHAP_AUTH, ri, r, iface.chap_auth, IDBM_SHOW, + num, 1); + __recinfo_str(IFACE_BIDI_CHAP, ri, r, iface.bidi_chap, IDBM_SHOW, + num, 1); + __recinfo_str(IFACE_STRICT_LOGIN_COMP, ri, r, iface.strict_login_comp, + IDBM_SHOW, num, 1); + __recinfo_str(IFACE_DISCOVERY_AUTH, ri, r, iface.discovery_auth, + IDBM_SHOW, num, 1); + __recinfo_str(IFACE_DISCOVERY_LOGOUT, ri, r, iface.discovery_logout, + IDBM_SHOW, num, 1); + + __recinfo_str(NODE_DISC_ADDR, ri, r, disc_address, IDBM_SHOW, num, 0); __recinfo_int(NODE_DISC_PORT, ri, r, disc_port, IDBM_SHOW, @@ -425,6 +524,9 @@ void idbm_recinfo_iface(iface_rec_t *r, recinfo_t *ri) { int num = 0; + int iface_type; + + iface_type = iface_get_iptype(r); __recinfo_str(IFACE_ISCSINAME, ri, r, name, IDBM_SHOW, num, 0); __recinfo_str(IFACE_NETNAME, ri, r, netdev, IDBM_SHOW, num, 1); @@ -433,19 +535,6 @@ __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, @@ -454,9 +543,110 @@ __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); + + if (iface_type == ISCSI_IFACE_TYPE_IPV4) { + __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_DHCP_ALT_CID, ri, r, + dhcp_alt_client_id_state, IDBM_SHOW, num, 1); + __recinfo_str(IFACE_DHCP_ALT_CID_STR, ri, r, dhcp_alt_client_id, + IDBM_SHOW, num, 1); + __recinfo_str(IFACE_DHCP_DNS, ri, r, dhcp_dns, IDBM_SHOW, + num, 1); + __recinfo_str(IFACE_DHCP_LEARN_IQN, ri, r, dhcp_learn_iqn, + IDBM_SHOW, num, 1); + __recinfo_str(IFACE_DHCP_REQ_VID, ri, r, + dhcp_req_vendor_id_state, IDBM_SHOW, num, 1); + __recinfo_str(IFACE_DHCP_VID, ri, r, dhcp_vendor_id_state, + IDBM_SHOW, num, 1); + __recinfo_str(IFACE_DHCP_VID_STR, ri, r, dhcp_vendor_id, + IDBM_SHOW, num, 1); + __recinfo_str(IFACE_DHCP_SLP_DA, ri, r, dhcp_slp_da, IDBM_SHOW, + num, 1); + __recinfo_str(IFACE_FRAGMENTATION, ri, r, fragmentation, + IDBM_SHOW, num, 1); + __recinfo_str(IFACE_GRAT_ARP, ri, r, gratuitous_arp, IDBM_SHOW, + num, 1); + __recinfo_str(IFACE_IN_FORWARD, ri, r, incoming_forwarding, + IDBM_SHOW, num, 1); + __recinfo_str(IFACE_TOS_STATE, ri, r, tos_state, IDBM_SHOW, + num, 1); + __recinfo_uint8(IFACE_TOS, ri, r, tos, IDBM_SHOW, num, 1); + __recinfo_uint8(IFACE_TTL, ri, r, ttl, IDBM_SHOW, num, 1); + } else if (iface_type == ISCSI_IFACE_TYPE_IPV6) { + __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_uint8(IFACE_DUP_ADDR_DETECT_CNT, ri, r, + dup_addr_detect_cnt, IDBM_SHOW, num, 1); + __recinfo_uint32(IFACE_FLOW_LABEL, ri, r, flow_label, IDBM_SHOW, + num, 1); + __recinfo_str(IFACE_GRAT_NEIGHBOR_ADV, ri, r, + gratuitous_neighbor_adv, IDBM_SHOW, num, 1); + __recinfo_uint8(IFACE_HOP_LIMIT, ri, r, hop_limit, IDBM_SHOW, + num, 1); + __recinfo_str(IFACE_MLD, ri, r, mld, IDBM_SHOW, num, 1); + __recinfo_uint32(IFACE_ND_REACHABLE_TMO, ri, r, + nd_reachable_tmo, IDBM_SHOW, num, 1); + __recinfo_uint32(IFACE_ND_REXMIT_TIME, ri, r, nd_rexmit_time, + IDBM_SHOW, num, 1); + __recinfo_uint32(IFACE_ND_STALE_TMO, ri, r, nd_stale_tmo, + IDBM_SHOW, num, 1); + __recinfo_uint32(IFACE_RTR_ADV_LINK_MTU, ri, r, + router_adv_link_mtu, IDBM_SHOW, num, 1); + __recinfo_uint8(IFACE_TRAFFIC_CLASS, ri, r, traffic_class, + IDBM_SHOW, num, 1); + } + + __recinfo_str(IFACE_DELAYED_ACK, ri, r, delayed_ack, IDBM_SHOW, num, 1); + __recinfo_str(IFACE_TCP_NAGLE, ri, r, nagle, IDBM_SHOW, num, 1); + __recinfo_str(IFACE_TCP_WSF_STATE, ri, r, tcp_wsf_state, IDBM_SHOW, + num, 1); + __recinfo_uint8(IFACE_TCP_WSF, ri, r, tcp_wsf, IDBM_SHOW, num, 1); + __recinfo_uint8(IFACE_TCP_TIMER_SCALE, ri, r, tcp_timer_scale, + IDBM_SHOW, num, 1); + __recinfo_str(IFACE_TCP_TIMESTAMP, ri, r, tcp_timestamp, IDBM_SHOW, + num, 1); + __recinfo_str(IFACE_REDIRECT, ri, r, redirect, IDBM_SHOW, num, 1); + __recinfo_uint16(IFACE_DEF_TMF_TMO, ri, r, def_task_mgmt_tmo, IDBM_SHOW, + num, 1); + __recinfo_str(IFACE_HDRDGST, ri, r, header_digest, IDBM_SHOW, num, 1); + __recinfo_str(IFACE_DATADGST, ri, r, data_digest, IDBM_SHOW, num, 1); + __recinfo_str(IFACE_IMM_DATA, ri, r, immediate_data, IDBM_SHOW, num, 1); + __recinfo_str(IFACE_INITIAL_R2T, ri, r, initial_r2t, IDBM_SHOW, num, 1); + __recinfo_str(IFACE_DSEQ_INORDER, ri, r, data_seq_inorder, IDBM_SHOW, + num, 1); + __recinfo_str(IFACE_DPDU_INORDER, ri, r, data_pdu_inorder, IDBM_SHOW, + num, 1); + __recinfo_uint8(IFACE_ERL, ri, r, erl, IDBM_SHOW, num, 1); + __recinfo_uint32(IFACE_MAX_RECV_DLEN, ri, r, max_recv_dlength, + IDBM_SHOW, num, 1); + __recinfo_uint32(IFACE_FIRST_BURST, ri, r, first_burst_len, IDBM_SHOW, + num, 1); + __recinfo_uint16(IFACE_MAX_R2T, ri, r, max_out_r2t, IDBM_SHOW, num, 1); + __recinfo_uint32(IFACE_MAX_BURST, ri, r, max_burst_len, IDBM_SHOW, + num, 1); + __recinfo_str(IFACE_CHAP_AUTH, ri, r, chap_auth, IDBM_SHOW, num, 1); + __recinfo_str(IFACE_BIDI_CHAP, ri, r, bidi_chap, IDBM_SHOW, num, 1); + __recinfo_str(IFACE_STRICT_LOGIN_COMP, ri, r, strict_login_comp, + IDBM_SHOW, num, 1); + __recinfo_str(IFACE_DISCOVERY_AUTH, ri, r, discovery_auth, IDBM_SHOW, + num, 1); + __recinfo_str(IFACE_DISCOVERY_LOGOUT, ri, r, discovery_logout, + IDBM_SHOW, num, 1); } -static void idbm_recinfo_host_chap(struct iscsi_chap_rec *r, recinfo_t *ri) +void idbm_recinfo_host_chap(struct iscsi_chap_rec *r, recinfo_t *ri) { int num = 0; @@ -465,14 +655,14 @@ if (r->chap_type == CHAP_TYPE_OUT) { __recinfo_str(HOST_AUTH_USERNAME, ri, r, username, IDBM_SHOW, - num, 0); + num, 1); __recinfo_str(HOST_AUTH_PASSWORD, ri, r, password, IDBM_MASKED, num, 1); __recinfo_int(HOST_AUTH_PASSWORD_LEN, ri, r, password_length, IDBM_HIDE, num, 1); } else { __recinfo_str(HOST_AUTH_USERNAME_IN, ri, r, username, IDBM_SHOW, - num, 0); + num, 1); __recinfo_str(HOST_AUTH_PASSWORD_IN, ri, r, password, IDBM_MASKED, num, 1); __recinfo_int(HOST_AUTH_PASSWORD_IN_LEN, ri, r, password_length, @@ -852,6 +1042,8 @@ check_password_param(discovery.sendtargets.auth.password_in); check_password_param(discovery.slp.auth.password); check_password_param(discovery.slp.auth.password_in); + check_password_param(host.auth.password); + check_password_param(host.auth.password_in); return 0; } @@ -867,7 +1059,7 @@ if (strcmp(name, info[i].name)) continue; - log_debug(7, "verify %s %d\n", name, info[i].can_modify); + log_debug(7, "verify %s %d", name, info[i].can_modify); if (info[i].can_modify) return 0; else { @@ -970,20 +1162,20 @@ idbm_recinfo_node(&db->nrec, db->ninfo); if (!db->get_config_file) { - log_debug(1, "Could not get config file. No config file fn\n"); + log_debug(1, "Could not get config file. No config file fn"); return; } config_file = db->get_config_file(); if (!config_file) { - log_debug(1, "Could not get config file for sync config\n"); + log_debug(1, "Could not get config file for sync config"); return; } f = fopen(config_file, "r"); if (!f) { log_debug(1, "cannot open configuration file %s. " - "Default location is %s.\n", + "Default location is %s.", config_file, CONFIG_FILE); return; } @@ -1139,7 +1331,7 @@ if (access(LOCK_DIR, F_OK) != 0) { if (mkdir(LOCK_DIR, 0660) != 0) { - log_error("Could not open %s: %s\n", LOCK_DIR, + log_error("Could not open %s: %s", LOCK_DIR, strerror(errno)); return ISCSI_ERR_IDBM; } @@ -1219,7 +1411,7 @@ f = fopen(conf, "r"); if (!f) { - log_debug(5, "Could not open %s err %s\n", conf, + log_debug(5, "Could not open %s err %s", conf, strerror(errno)); rc = ISCSI_ERR_IDBM; goto unlock; @@ -1361,7 +1553,7 @@ !strcmp(entity_dent->d_name, "..")) continue; - log_debug(5, "found %s\n", entity_dent->d_name); + log_debug(5, "found %s", entity_dent->d_name); tmp_port = strchr(entity_dent->d_name, ','); if (!tmp_port) @@ -1507,7 +1699,7 @@ * This will run fn over all recs with the {targetname,tpgt,ip,port} * id. It does not iterate over the ifaces setup in /etc/iscsi/ifaces. * - * fn should return -1 if it skipped the rec, a ISCSI_ERR error code if + * fn should return -1 if it skipped the rec, an ISCSI_ERR error code if * the operation failed or 0 if fn was run successfully. */ static int idbm_for_each_iface(int *found, void *data, @@ -1618,7 +1810,7 @@ !strcmp(portal_dent->d_name, "..")) continue; - log_debug(5, "found %s\n", portal_dent->d_name); + log_debug(5, "found %s", portal_dent->d_name); tmp_port = strchr(portal_dent->d_name, ','); if (!tmp_port) continue; @@ -1660,7 +1852,7 @@ !strcmp(node_dent->d_name, "..")) continue; - log_debug(5, "searching %s\n", node_dent->d_name); + log_debug(5, "searching %s", node_dent->d_name); curr_rc = fn(found, data, node_dent->d_name); /* less than zero means it was not a match */ if (curr_rc > 0 && !rc) @@ -1736,7 +1928,7 @@ snprintf(portal, PATH_MAX, "%s/%s,%d", disc_type_to_config_vals[drec_type].config_root, addr, port); - log_debug(5, "Looking for config file %s\n", portal); + log_debug(5, "Looking for config file %s", portal); rc = idbm_lock(); if (rc) @@ -1745,7 +1937,7 @@ f = idbm_open_rec_r(portal, disc_type_to_config_vals[drec_type].config_name); if (!f) { - log_debug(1, "Could not open %s: %s\n", portal, + log_debug(1, "Could not open %s: %s", portal, strerror(errno)); rc = ISCSI_ERR_IDBM; goto unlock; @@ -1775,7 +1967,7 @@ FILE *f; int err; - log_debug(5, "Looking for config file %s\n", portal); + log_debug(5, "Looking for config file %s", portal); err = stat(portal, &statb); if (err) @@ -1787,14 +1979,14 @@ */ if (unlink(portal)) { log_error("Could not convert %s to %s/%s. " - "err %d\n", portal, portal, + "err %d", portal, portal, config, errno); return NULL; } mkdir_portal: if (mkdir(portal, 0660) != 0) { - log_error("Could not make dir %s err %d\n", + log_error("Could not make dir %s err %d", portal, errno); return NULL; } @@ -1804,7 +1996,7 @@ strlcat(portal, config, PATH_MAX); f = fopen(portal, "w"); if (!f) - log_error("Could not open %s err %d\n", portal, errno); + log_error("Could not open %s err %d", portal, errno); return f; } @@ -1817,14 +2009,14 @@ portal = malloc(PATH_MAX); if (!portal) { - log_error("Could not alloc portal\n"); + log_error("Could not alloc portal"); return ISCSI_ERR_NOMEM; } snprintf(portal, PATH_MAX, "%s", NODE_CONFIG_DIR); if (access(portal, F_OK) != 0) { if (mkdir(portal, 0660) != 0) { - log_error("Could not make %s: %s\n", portal, + log_error("Could not make %s: %s", portal, strerror(errno)); rc = ISCSI_ERR_IDBM; goto free_portal; @@ -1834,7 +2026,7 @@ snprintf(portal, PATH_MAX, "%s/%s", NODE_CONFIG_DIR, rec->name); if (access(portal, F_OK) != 0) { if (mkdir(portal, 0660) != 0) { - log_error("Could not make %s: %s\n", portal, + log_error("Could not make %s: %s", portal, strerror(errno)); rc = ISCSI_ERR_IDBM; goto free_portal; @@ -1877,7 +2069,7 @@ * Old style portal as a file, but with tpgt. Let's update it. */ if (unlink(portal)) { - log_error("Could not convert %s: %s\n", portal, + log_error("Could not convert %s: %s", portal, strerror(errno)); rc = ISCSI_ERR_IDBM; goto unlock; @@ -1892,7 +2084,7 @@ rec->name, rec->conn[0].address, rec->conn[0].port, rec->tpgt); if (stat(portal, &statb)) { if (mkdir(portal, 0660) != 0) { - log_error("Could not make dir %s: %s\n", + log_error("Could not make dir %s: %s", portal, strerror(errno)); rc = ISCSI_ERR_IDBM; goto unlock; @@ -1905,7 +2097,7 @@ open_conf: f = fopen(portal, "w"); if (!f) { - log_error("Could not open %s: %sd\n", portal, strerror(errno)); + log_error("Could not open %s: %s", portal, strerror(errno)); rc = ISCSI_ERR_IDBM; goto unlock; } @@ -1931,7 +2123,7 @@ portal = malloc(PATH_MAX); if (!portal) { - log_error("Could not alloc portal\n"); + log_error("Could not alloc portal"); return ISCSI_ERR_NOMEM; } @@ -1943,7 +2135,7 @@ disc_type_to_config_vals[rec->type].config_root); if (access(portal, F_OK) != 0) { if (mkdir(portal, 0660) != 0) { - log_error("Could not make %s: %s\n", portal, + log_error("Could not make %s: %s", portal, strerror(errno)); rc = ISCSI_ERR_IDBM; goto unlock; @@ -1957,7 +2149,7 @@ f = idbm_open_rec_w(portal, disc_type_to_config_vals[rec->type].config_name); if (!f) { - log_error("Could not open %s: %s\n", portal, strerror(errno)); + log_error("Could not open %s: %s", portal, strerror(errno)); rc = ISCSI_ERR_IDBM; goto unlock; } @@ -2329,10 +2521,10 @@ snprintf(portal, PATH_MAX, "%s/%s,%d", disc_type_to_config_vals[drec->type].config_root, drec->address, drec->port); - log_debug(5, "Removing config file %s\n", portal); + log_debug(5, "Removing config file %s", portal); if (stat(portal, &statb)) { - log_debug(5, "Could not stat %s to delete disc err %d\n", + log_debug(5, "Could not stat %s to delete disc err %d", portal, errno); goto free_portal; } @@ -2345,7 +2537,7 @@ } if (unlink(portal)) - log_debug(5, "Could not remove %s err %d\n", portal, errno); + log_debug(5, "Could not remove %s err %d", portal, errno); memset(portal, 0, PATH_MAX); snprintf(portal, PATH_MAX, "%s/%s,%d", @@ -2395,7 +2587,7 @@ goto done; } - log_debug(7, "found drec %s %d\n", + log_debug(7, "found drec %s %d", tmprec->disc_address, tmprec->disc_port); /* rm link from discovery source to node */ memset(portal, 0, PATH_MAX); @@ -2409,7 +2601,7 @@ if (!stat(portal, &statb)) { if (unlink(portal)) { - log_error("Could not remove link %s: %s\n", + log_error("Could not remove link %s: %s", portal, strerror(errno)); rc = ISCSI_ERR_IDBM; } else @@ -2446,7 +2638,7 @@ memset(portal, 0, PATH_MAX); snprintf(portal, PATH_MAX, "%s/%s/%s,%d", NODE_CONFIG_DIR, rec->name, rec->conn[0].address, rec->conn[0].port); - log_debug(5, "Removing config file %s iface id %s\n", + log_debug(5, "Removing config file %s iface id %s", portal, rec->iface.name); rc = idbm_lock(); @@ -2464,14 +2656,14 @@ if (!stat(portal, &statb)) goto rm_conf; - log_error("Could not stat %s to delete node: %s\n", + log_error("Could not stat %s to delete node: %s", portal, strerror(errno)); rc = ISCSI_ERR_IDBM; goto unlock; rm_conf: if (unlink(portal)) { - log_error("Could not remove %s: %s\n", portal, strerror(errno)); + log_error("Could not remove %s: %s", portal, strerror(errno)); rc = ISCSI_ERR_IDBM; goto unlock; } @@ -2649,7 +2841,7 @@ /* make sure root db dir is there */ if (access(ISCSI_CONFIG_ROOT, F_OK) != 0) { if (mkdir(ISCSI_CONFIG_ROOT, 0660) != 0) { - log_error("Could not make %s %d\n", ISCSI_CONFIG_ROOT, + log_error("Could not make %s %d", ISCSI_CONFIG_ROOT, errno); return errno; } diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/idbm_fields.h open-iscsi-2.0.874/usr/idbm_fields.h --- open-iscsi-2.0.873+git0.3b4b4500/usr/idbm_fields.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/idbm_fields.h 2016-09-29 18:33:24.000000000 +0000 @@ -89,6 +89,55 @@ #define IFACE_NUM "iface.iface_num" #define IFACE_MTU "iface.mtu" #define IFACE_PORT "iface.port" +#define IFACE_DELAYED_ACK "iface.delayed_ack" +#define IFACE_TCP_NAGLE "iface.tcp_nagle" +#define IFACE_TCP_WSF_STATE "iface.tcp_wsf_state" +#define IFACE_TCP_WSF "iface.tcp_wsf" +#define IFACE_TCP_TIMER_SCALE "iface.tcp_timer_scale" +#define IFACE_TCP_TIMESTAMP "iface.tcp_timestamp" +#define IFACE_DHCP_DNS "iface.dhcp_dns" +#define IFACE_DHCP_SLP_DA "iface.dhcp_slp_da" +#define IFACE_TOS_STATE "iface.tos_state" +#define IFACE_TOS "iface.tos" +#define IFACE_GRAT_ARP "iface.gratuitous_arp" +#define IFACE_DHCP_ALT_CID "iface.dhcp_alt_client_id_state" +#define IFACE_DHCP_ALT_CID_STR "iface.dhcp_alt_client_id" +#define IFACE_DHCP_REQ_VID "iface.dhcp_req_vendor_id_state" +#define IFACE_DHCP_VID "iface.dhcp_vendor_id_state" +#define IFACE_DHCP_VID_STR "iface.dhcp_vendor_id" +#define IFACE_DHCP_LEARN_IQN "iface.dhcp_learn_iqn" +#define IFACE_FRAGMENTATION "iface.fragmentation" +#define IFACE_IN_FORWARD "iface.incoming_forwarding" +#define IFACE_TTL "iface.ttl" +#define IFACE_GRAT_NEIGHBOR_ADV "iface.gratuitous_neighbor_adv" +#define IFACE_REDIRECT "iface.redirect" +#define IFACE_IGNORE_ICMP_ECHO_REQ "iface.ignore_icmp_echo_request" +#define IFACE_MLD "iface.mld" +#define IFACE_FLOW_LABEL "iface.flow_label" +#define IFACE_TRAFFIC_CLASS "iface.traffic_class" +#define IFACE_HOP_LIMIT "iface.hop_limit" +#define IFACE_ND_REACHABLE_TMO "iface.nd_reachable_tmo" +#define IFACE_ND_REXMIT_TIME "iface.nd_rexmit_time" +#define IFACE_ND_STALE_TMO "iface.nd_stale_tmo" +#define IFACE_DUP_ADDR_DETECT_CNT "iface.dup_addr_detect_cnt" +#define IFACE_RTR_ADV_LINK_MTU "iface.router_adv_link_mtu" +#define IFACE_DEF_TMF_TMO "iface.def_task_mgmt_timeout" +#define IFACE_HDRDGST "iface.header_digest" +#define IFACE_DATADGST "iface.data_digest" +#define IFACE_IMM_DATA "iface.immediate_data" +#define IFACE_INITIAL_R2T "iface.initial_r2t" +#define IFACE_DSEQ_INORDER "iface.data_seq_inorder" +#define IFACE_DPDU_INORDER "iface.data_pdu_inorder" +#define IFACE_ERL "iface.erl" +#define IFACE_MAX_RECV_DLEN "iface.max_receive_data_len" +#define IFACE_FIRST_BURST "iface.first_burst_len" +#define IFACE_MAX_R2T "iface.max_outstanding_r2t" +#define IFACE_MAX_BURST "iface.max_burst_len" +#define IFACE_CHAP_AUTH "iface.chap_auth" +#define IFACE_BIDI_CHAP "iface.bidi_chap" +#define IFACE_STRICT_LOGIN_COMP "iface.strict_login_compliance" +#define IFACE_DISCOVERY_AUTH "iface.discovery_auth" +#define IFACE_DISCOVERY_LOGOUT "iface.discovery_logout" /* discovery fields */ #define DISC_STARTUP "discovery.startup" diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/idbm.h open-iscsi-2.0.874/usr/idbm.h --- open-iscsi-2.0.873+git0.3b4b4500/usr/idbm.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/idbm.h 2016-09-29 18:33:24.000000000 +0000 @@ -185,6 +185,7 @@ idbm_create_rec_from_boot_context(struct boot_context *context); extern int idbm_print_host_chap_info(struct iscsi_chap_rec *chap); +extern void idbm_recinfo_host_chap(struct iscsi_chap_rec *r, recinfo_t *ri); extern int idbm_print_flashnode_info(struct flashnode_rec *target); extern void idbm_recinfo_flashnode(struct flashnode_rec *r, recinfo_t *ri); diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/iface.c open-iscsi-2.0.874/usr/iface.c --- open-iscsi-2.0.873+git0.3b4b4500/usr/iface.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/iface.c 2016-09-29 18:33:24.000000000 +0000 @@ -144,7 +144,7 @@ if (!f) { /* * if someone passes in default but has not defined - * a iface with default then we do it for them + * an iface with default then we do it for them */ if (!strcmp(iface->name, DEFAULT_IFACENAME)) { iface_setup_defaults(iface); @@ -227,7 +227,7 @@ def_iface = iface_match_default(iface); if (def_iface) { log_error("iface %s is a special interface and " - "cannot be deleted.\n", iface->name); + "cannot be deleted.", iface->name); return ISCSI_ERR_INVAL; } @@ -259,7 +259,7 @@ def_iface = iface_match_default(iface); if (def_iface) { log_error("iface %s is a special interface and " - "is not stored in %s.\n", iface->name, + "is not stored in %s.", iface->name, IFACE_CONFIG_DIR); return ISCSI_ERR_INVAL; } @@ -299,7 +299,7 @@ def_iface = iface_match_default(iface); if (def_iface) { log_error("iface %s is a special interface and " - "cannot be modified.\n", iface->name); + "cannot be modified.", iface->name); return ISCSI_ERR_INVAL; } @@ -450,8 +450,10 @@ /* try to figure out by name */ if (strstr(iface->name, "ipv4")) return ISCSI_IFACE_TYPE_IPV4; - else + else if (strstr(iface->name, "ipv6")) return ISCSI_IFACE_TYPE_IPV6; + else /* assume ipv4 by default */ + return ISCSI_IFACE_TYPE_IPV4; } else { if (strcmp(iface->bootproto, "dhcp") && !strstr(iface->ipaddress, ".")) @@ -470,17 +472,14 @@ if (!strlen(hinfo->iface.hwaddress)) { log_error("Invalid offload iSCSI host %u. Missing " - "hwaddress. Try upgrading %s driver.\n", + "hwaddress. Try upgrading %s driver.", 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; + memcpy(&iface, kern_iface, sizeof(iface)); snprintf(iface.name, sizeof(iface.name), "%s.%s.%s.%u", kern_iface->transport_name, @@ -492,6 +491,9 @@ hinfo->iface.transport_name, hinfo->iface.hwaddress); } + strcpy(iface.hwaddress, hinfo->iface.hwaddress); + strcpy(iface.transport_name, hinfo->iface.transport_name); + memset(iface_path, 0, sizeof(iface_path)); snprintf(iface_path, PATH_MAX, "%s/%s", IFACE_CONFIG_DIR, iface.name); @@ -601,6 +603,105 @@ dst->mtu = src->mtu; if (src->port) dst->port = src->port; + if (strlen(src->delayed_ack)) + strcpy(dst->delayed_ack, src->delayed_ack); + if (strlen(src->nagle)) + strcpy(dst->nagle, src->nagle); + if (strlen(src->tcp_wsf_state)) + strcpy(dst->tcp_wsf_state, src->tcp_wsf_state); + if (src->tcp_wsf) + dst->tcp_wsf = src->tcp_wsf; + if (src->tcp_timer_scale) + dst->tcp_timer_scale = src->tcp_timer_scale; + if (strlen(src->tcp_timestamp)) + strcpy(dst->tcp_timestamp, src->tcp_timestamp); + if (strlen(src->dhcp_dns)) + strcpy(dst->dhcp_dns, src->dhcp_dns); + if (strlen(src->dhcp_slp_da)) + strcpy(dst->dhcp_slp_da, src->dhcp_slp_da); + if (strlen(src->tos_state)) + strcpy(dst->tos_state, src->tos_state); + if (src->tos) + dst->tos = src->tos; + if (strlen(src->gratuitous_arp)) + strcpy(dst->gratuitous_arp, src->gratuitous_arp); + if (strlen(src->dhcp_alt_client_id_state)) + strcpy(dst->dhcp_alt_client_id_state, + src->dhcp_alt_client_id_state); + if (strlen(src->dhcp_alt_client_id)) + strcpy(dst->dhcp_alt_client_id, src->dhcp_alt_client_id); + if (strlen(src->dhcp_req_vendor_id_state)) + strcpy(dst->dhcp_req_vendor_id_state, + src->dhcp_req_vendor_id_state); + if (strlen(src->dhcp_vendor_id_state)) + strcpy(dst->dhcp_vendor_id_state, src->dhcp_vendor_id_state); + if (strlen(src->dhcp_vendor_id)) + strcpy(dst->dhcp_vendor_id, src->dhcp_vendor_id); + if (strlen(src->dhcp_learn_iqn)) + strcpy(dst->dhcp_learn_iqn, src->dhcp_learn_iqn); + if (strlen(src->fragmentation)) + strcpy(dst->fragmentation, src->fragmentation); + if (strlen(src->incoming_forwarding)) + strcpy(dst->incoming_forwarding, src->incoming_forwarding); + if (src->ttl) + dst->ttl = src->ttl; + if (strlen(src->gratuitous_neighbor_adv)) + strcpy(dst->gratuitous_neighbor_adv, + src->gratuitous_neighbor_adv); + if (strlen(src->redirect)) + strcpy(dst->redirect, src->redirect); + if (strlen(src->mld)) + strcpy(dst->mld, src->mld); + if (src->flow_label) + dst->flow_label = src->flow_label; + if (src->traffic_class) + dst->traffic_class = src->traffic_class; + if (src->hop_limit) + dst->hop_limit = src->hop_limit; + if (src->nd_reachable_tmo) + dst->nd_reachable_tmo = src->nd_reachable_tmo; + if (src->nd_rexmit_time) + dst->nd_rexmit_time = src->nd_rexmit_time; + if (src->nd_stale_tmo) + dst->nd_stale_tmo = src->nd_stale_tmo; + if (src->dup_addr_detect_cnt) + dst->dup_addr_detect_cnt = src->dup_addr_detect_cnt; + if (src->router_adv_link_mtu) + dst->router_adv_link_mtu = src->router_adv_link_mtu; + if (src->def_task_mgmt_tmo) + dst->def_task_mgmt_tmo = src->def_task_mgmt_tmo; + if (strlen(src->header_digest)) + strcpy(dst->header_digest, src->header_digest); + if (strlen(src->data_digest)) + strcpy(dst->data_digest, src->data_digest); + if (strlen(src->immediate_data)) + strcpy(dst->immediate_data, src->immediate_data); + if (strlen(src->initial_r2t)) + strcpy(dst->initial_r2t, src->initial_r2t); + if (strlen(src->data_seq_inorder)) + strcpy(dst->data_seq_inorder, src->data_seq_inorder); + if (strlen(src->data_pdu_inorder)) + strcpy(dst->data_pdu_inorder, src->data_pdu_inorder); + if (src->erl) + dst->erl = src->erl; + if (src->max_recv_dlength) + dst->max_recv_dlength = src->max_recv_dlength; + if (src->first_burst_len) + dst->first_burst_len = src->first_burst_len; + if (src->max_out_r2t) + dst->max_out_r2t = src->max_out_r2t; + if (src->max_burst_len) + dst->max_burst_len = src->max_burst_len; + if (strlen(src->chap_auth)) + strcpy(dst->chap_auth, src->chap_auth); + if (strlen(src->bidi_chap)) + strcpy(dst->bidi_chap, src->bidi_chap); + if (strlen(src->strict_login_comp)) + strcpy(dst->strict_login_comp, src->strict_login_comp); + if (strlen(src->discovery_auth)) + strcpy(dst->discovery_auth, src->discovery_auth); + if (strlen(src->discovery_logout)) + strcpy(dst->discovery_logout, src->discovery_logout); if (strlen(src->hwaddress)) strcpy(dst->hwaddress, src->hwaddress); if (strlen(src->transport_name)) @@ -901,7 +1002,8 @@ sizeof(iface->iname)); if (strlen(context->scsi_host_name)) { - if (sscanf(context->scsi_host_name, "iscsi_boot%u", &hostno) != 1) { + 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; @@ -926,11 +1028,11 @@ &rc); if (rc) { /* - * If the MAC in the boot info does not match a iscsi + * If the MAC in the boot info does not match an 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", + log_debug(3, "Could not match %s to host", context->mac); return 0; } @@ -967,7 +1069,7 @@ sizeof(iface->subnet_mask)); strlcpy(iface->gateway, context->gateway, sizeof(iface->gateway)); - log_debug(1, "iface " iface_fmt "\n", iface_str(iface)); + log_debug(1, "iface " iface_fmt "", iface_str(iface)); return 1; } @@ -976,8 +1078,8 @@ * @ifaces: list to store ifaces in * @targets: list of targets to create ifaces from * - * This function will create a iface struct based on the boot info - * and it will create (or update if existing already) a iface rec in + * This function will create an iface struct based on the boot info + * and it will create (or update if existing already) an iface rec in * the ifaces dir based on the info. */ int iface_create_ifaces_from_boot_contexts(struct list_head *ifaces, @@ -992,7 +1094,7 @@ /* use dummy name. If valid it will get overwritten below */ iface = iface_alloc(DEFAULT_IFACENAME, &rc); if (!iface) { - log_error("Could not setup iface %s for boot\n", + log_error("Could not setup iface %s for boot", context->iface); goto fail; } @@ -1026,6 +1128,79 @@ int count; }; +#define IFACE_NET_PARAM_EN_CNT(param_val, cnt) { \ + if (!strcmp(param_val, "disable") || \ + !strcmp(param_val, "enable")) \ + (*cnt)++; \ +} + +/** + * iface_get_common_param_count - Gets common parameters count for given iface + * @iface: iface to setup + * @count: number of parameters to set + */ +static void iface_get_common_param_count(struct iface_rec *iface, int *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)++; + + IFACE_NET_PARAM_EN_CNT(iface->delayed_ack, count); + IFACE_NET_PARAM_EN_CNT(iface->nagle, count); + IFACE_NET_PARAM_EN_CNT(iface->tcp_wsf_state, count); + IFACE_NET_PARAM_EN_CNT(iface->tcp_timestamp, count); + IFACE_NET_PARAM_EN_CNT(iface->redirect, count); + IFACE_NET_PARAM_EN_CNT(iface->header_digest, count); + IFACE_NET_PARAM_EN_CNT(iface->data_digest, count); + IFACE_NET_PARAM_EN_CNT(iface->immediate_data, count); + IFACE_NET_PARAM_EN_CNT(iface->initial_r2t, count); + IFACE_NET_PARAM_EN_CNT(iface->data_seq_inorder, count); + IFACE_NET_PARAM_EN_CNT(iface->data_pdu_inorder, count); + IFACE_NET_PARAM_EN_CNT(iface->chap_auth, count); + IFACE_NET_PARAM_EN_CNT(iface->bidi_chap, count); + IFACE_NET_PARAM_EN_CNT(iface->strict_login_comp, count); + IFACE_NET_PARAM_EN_CNT(iface->discovery_auth, count); + IFACE_NET_PARAM_EN_CNT(iface->discovery_logout, count); + + if (iface->tcp_wsf) + (*count)++; + + if (iface->tcp_timer_scale) + (*count)++; + + if (iface->def_task_mgmt_tmo) + (*count)++; + + if (iface->erl) + (*count)++; + + if (iface->max_recv_dlength) + (*count)++; + + if (iface->first_burst_len) + (*count)++; + + if (iface->max_burst_len) + (*count)++; + + if (iface->max_out_r2t) + (*count)++; +} + /** * __iface_get_param_count - Gets netconfig parameter count for given iface * @data: iface_param_count structure @@ -1044,10 +1219,10 @@ if (iptype == ISCSI_IFACE_TYPE_IPV4) { if (strcmp(iface->state, "disable")) { - if (strstr(iface->bootproto, "dhcp")) + if (strstr(iface->bootproto, "dhcp")) { /* DHCP enabled */ count++; - else { + } else { /* DHCP disabled */ count++; @@ -1062,12 +1237,13 @@ if (strstr(iface->gateway, ".")) /* User configured Gateway */ count++; - } else + } else { /* * IPv4 Address not valid, decrement * count of DHCP */ count--; + } } /* @@ -1078,37 +1254,68 @@ /* iface state */ count++; - if (strcmp(iface->vlan_state, "disable")) { - /* vlan_state enabled */ + IFACE_NET_PARAM_EN_CNT(iface->dhcp_dns, + &count); + + IFACE_NET_PARAM_EN_CNT(iface->dhcp_slp_da, + &count); + + IFACE_NET_PARAM_EN_CNT(iface->tos_state, + &count); + + IFACE_NET_PARAM_EN_CNT(iface->gratuitous_arp, + &count); + + IFACE_NET_PARAM_EN_CNT( + iface->dhcp_alt_client_id_state, + &count); + + if (iface->dhcp_alt_client_id[0]) count++; - if (iface->vlan_id) - /* For vlan value */ - count++; - } else - /* vlan_state disabled */ + IFACE_NET_PARAM_EN_CNT( + iface->dhcp_req_vendor_id_state, + &count); + + IFACE_NET_PARAM_EN_CNT( + iface->dhcp_vendor_id_state, + &count); + + if (iface->dhcp_vendor_id[0]) count++; - if (iface->mtu) + IFACE_NET_PARAM_EN_CNT(iface->dhcp_learn_iqn, + &count); + + IFACE_NET_PARAM_EN_CNT(iface->fragmentation, + &count); + + IFACE_NET_PARAM_EN_CNT( + iface->incoming_forwarding, + &count); + + if (iface->tos) count++; - if (iface->port) + if (iface->ttl) count++; + + iface_get_common_param_count(iface, &count); } - } else + } 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")) + strstr(iface->ipv6_autocfg, "dhcpv6")) { /* Autocfg enabled */ count++; - else { + } else { /* Autocfg disabled */ count++; @@ -1169,26 +1376,42 @@ /* iface state */ count++; - if (strcmp(iface->vlan_state, "disable")) { - /* vlan_state enabled */ + IFACE_NET_PARAM_EN_CNT( + iface->gratuitous_neighbor_adv, + &count); + + IFACE_NET_PARAM_EN_CNT(iface->mld, &count); + + if (iface->flow_label) count++; - if (iface->vlan_id) - /* For vlan value */ - count++; - } else - /* vlan_state disabled */ + if (iface->traffic_class) + count++; + + if (iface->hop_limit) + count++; + + if (iface->nd_reachable_tmo) + count++; + + if (iface->nd_rexmit_time) + count++; + + if (iface->nd_stale_tmo) count++; - if (iface->mtu) + if (iface->dup_addr_detect_cnt) count++; - if (iface->port) + if (iface->router_adv_link_mtu) count++; + + iface_get_common_param_count(iface, &count); } - } else + } else { /* IPv6 is disabled, iface state */ count++; + } } iface_params->count += count; @@ -1207,7 +1430,7 @@ int num_found = 0, rc; struct iface_param_count iface_params; - log_debug(8, "In iface_get_param_count\n"); + log_debug(8, "In iface_get_param_count"); iface_params.primary = iface; iface_params.count = 0; @@ -1218,63 +1441,73 @@ else rc = __iface_get_param_count(&iface_params, iface); - log_debug(8, "iface_get_param_count: rc = %d, count = %d\n", + log_debug(8, "iface_get_param_count: rc = %d, count = %d", 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) +/* write integer parameter value */ +static int iface_fill_int_param_val(struct iovec *iov, uint32_t iface_num, + uint8_t iface_type, uint16_t param, + uint8_t param_type, uint32_t param_len, + uint32_t param_val) { int len; struct iscsi_iface_param_info *net_param; - uint16_t port = 3260; struct nlattr *attr; + uint8_t val8 = 0; + uint16_t val16 = 0; + uint32_t val32 = 0; + char *val = NULL; - len = sizeof(struct iscsi_iface_param_info) + sizeof(port); - iov->iov_base = iscsi_nla_alloc(ISCSI_NET_PARAM_PORT, len); - if (!iov->iov_base) + len = sizeof(struct iscsi_iface_param_info) + param_len; + iov->iov_base = iscsi_nla_alloc(param, len); + if (!(iov->iov_base)) return 1; + attr = iov->iov_base; iov->iov_len = NLA_ALIGN(attr->nla_len); - net_param = (struct iscsi_iface_param_info *)ISCSI_NLA_DATA(attr); - net_param->param = ISCSI_NET_PARAM_PORT; + net_param->iface_num = iface_num; + net_param->len = param_len; + net_param->param = param; 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; -} + net_param->param_type = param_type; + switch (param_len) { + case 1: + val8 = (uint8_t)param_val; + val = (char *)&val8; + break; -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; - struct nlattr *attr; + case 2: + val16 = (uint16_t)param_val; + val = (char *)&val16; + break; - len = sizeof(struct iscsi_iface_param_info) + 2; - iov->iov_base = iscsi_nla_alloc(ISCSI_NET_PARAM_MTU, len); - if (!(iov->iov_base)) - return 1; - attr = iov->iov_base; - iov->iov_len = NLA_ALIGN(attr->nla_len); + case 4: + val32 = (uint32_t)param_val; + val = (char *)&val32; + break; - net_param = (struct iscsi_iface_param_info *)ISCSI_NLA_DATA(attr); - 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); + default: + goto free; + } + memcpy(net_param->value, val, param_len); return 0; +free: + free(iov->iov_base); + iov->iov_base = NULL; + iov->iov_len = 0; + return 1; +} + +#define IFACE_SET_PARAM_INTVAL(iov, inum, itype, param, ptype, plen, \ + ival, gcnt, lcnt) { \ + if (ival && !iface_fill_int_param_val(iov, inum, itype, param, \ + ptype, plen, ival)) { \ + (*gcnt)++; \ + (*lcnt)++; \ + } \ } /* IPv4/IPv6 VLAN_ID: decimal value <= 4095 */ @@ -1311,60 +1544,52 @@ 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) +/* disable/enable parameters */ +static int iface_fill_param_state(struct iovec *iov, uint32_t iface_num, + uint8_t iface_type, uint16_t param, + uint8_t param_type, char *param_val) { int len; struct iscsi_iface_param_info *net_param; struct nlattr *attr; - len = sizeof(struct iscsi_iface_param_info) + 1; - iov->iov_base = iscsi_nla_alloc(ISCSI_NET_PARAM_VLAN_ENABLED, len); - if (!(iov->iov_base)) + if (!param_val[0]) return 1; - attr = iov->iov_base; - iov->iov_len = NLA_ALIGN(attr->nla_len); - net_param = (struct iscsi_iface_param_info *)ISCSI_NLA_DATA(attr); - 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; - struct nlattr *attr; - len = sizeof(struct iscsi_iface_param_info) + 1; - iov->iov_base = iscsi_nla_alloc(ISCSI_NET_PARAM_IFACE_ENABLE, len); + iov->iov_base = iscsi_nla_alloc(param, len); if (!(iov->iov_base)) return 1; attr = iov->iov_base; iov->iov_len = NLA_ALIGN(attr->nla_len); net_param = (struct iscsi_iface_param_info *)ISCSI_NLA_DATA(attr); - 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->iface_num = iface_num; 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; + net_param->param = param; + net_param->iface_type = iface_type; + net_param->param_type = param_type; + if (!strcmp(param_val, "disable")) + net_param->value[0] = ISCSI_NET_PARAM_DISABLE; + else if (!strcmp(param_val, "enable")) + net_param->value[0] = ISCSI_NET_PARAM_ENABLE; + else + goto free; return 0; +free: + free(iov->iov_base); + iov->iov_base = NULL; + iov->iov_len = 0; + return 1; +} + +#define IFACE_SET_PARAM_STATE(iov, inum, itype, param, ptype, ival, \ + gcnt, lcnt) { \ + if (!iface_fill_param_state(iov, inum, itype, param, ptype, \ + ival)) { \ + (*gcnt)++; \ + (*lcnt)++; \ + } \ } /* IPv4 Bootproto: DHCP/static */ @@ -1484,8 +1709,8 @@ } /* IPv4 IPAddress/Subnet Mask/Gateway: 4 bytes */ -static int iface_fill_net_ipv4_addr(struct iovec *iov, struct iface_rec *iface, - uint32_t param) +static int iface_fill_net_ipv4_addr(struct iovec *iov, uint32_t iface_num, + uint16_t param, char *param_val) { int rc = 1; int len; @@ -1502,29 +1727,12 @@ net_param = (struct iscsi_iface_param_info *)ISCSI_NLA_DATA(attr); net_param->param = param; net_param->iface_type = ISCSI_IFACE_TYPE_IPV4; - net_param->iface_num = iface->iface_num; + net_param->iface_num = 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: + rc = inet_pton(AF_INET, param_val, net_param->value); + if (rc <= 0) goto free; - } /* validate */ if (!net_param->value[0] && !net_param->value[1] && @@ -1539,9 +1747,19 @@ return 1; } +#define IFACE_SET_NET_PARAM_IPV4_ADDR(iov, inum, param, ival, gcnt, \ + lcnt) { \ + if (strstr(ival, ".")) { \ + if (!iface_fill_net_ipv4_addr(iov, inum, param, ival)) {\ + (*gcnt)++; \ + (*lcnt)++; \ + } \ + } \ +} + /* IPv6 IPAddress/LinkLocal/Router: 16 bytes */ -static int iface_fill_net_ipv6_addr(struct iovec *iov, struct iface_rec *iface, - uint32_t param) +static int iface_fill_net_ipv6_addr(struct iovec *iov, uint32_t iface_num, + uint16_t param, char *param_val) { int rc; int len; @@ -1558,30 +1776,12 @@ net_param = (struct iscsi_iface_param_info *)ISCSI_NLA_DATA(attr); net_param->param = param; net_param->iface_type = ISCSI_IFACE_TYPE_IPV6; - net_param->iface_num = iface->iface_num; + net_param->iface_num = 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: + rc = inet_pton(AF_INET6, param_val, net_param->value); + if (rc <= 0) goto free; - } return 0; free: @@ -1591,6 +1791,54 @@ return 1; } +#define IFACE_SET_NET_PARAM_IPV6_ADDR(iov, inum, param, ival, gcnt, \ + lcnt) { \ + if (strstr(ival, ":")) { \ + if (!iface_fill_net_ipv6_addr(iov, inum, param, ival)) {\ + (*gcnt)++; \ + (*lcnt)++; \ + } \ + } \ +} + +/* write string parameter value */ +static int iface_fill_str_param_val(struct iovec *iov, uint32_t iface_num, + uint8_t iface_type, uint16_t param, + uint32_t param_len, char *param_val) +{ + int len; + struct iscsi_iface_param_info *net_param; + struct nlattr *attr; + + if (!param_val[0]) + return 1; + + len = sizeof(struct iscsi_iface_param_info) + param_len; + iov->iov_base = iscsi_nla_alloc(param, len); + if (!(iov->iov_base)) + return 1; + + attr = iov->iov_base; + iov->iov_len = NLA_ALIGN(attr->nla_len); + net_param = (struct iscsi_iface_param_info *)ISCSI_NLA_DATA(attr); + net_param->iface_num = iface_num; + net_param->len = param_len; + net_param->param = param; + net_param->iface_type = iface_type; + net_param->param_type = ISCSI_NET_PARAM; + memcpy(net_param->value, param_val, param_len); + return 0; +} + +#define IFACE_SET_NET_PARAM_STRVAL(iov, inum, itype, param, plen, \ + ival, gcnt, lcnt) { \ + if (!iface_fill_str_param_val(iov, inum, itype, param, plen, \ + ival)) { \ + (*gcnt)++; \ + (*lcnt)++; \ + } \ +} + struct iface_net_config { struct iface_rec *primary; struct iovec *iovs; @@ -1610,16 +1858,21 @@ /* start at 2, because 0 is for nlmsghdr and 1 for event */ iov = net_config->iovs + 2; + if (!iface->port) + iface->port = 3260; + iptype = iface_get_iptype(iface); - if (iptype == ISCSI_IFACE_TYPE_IPV4) { + switch (iptype) { + case 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++; - } - + IFACE_SET_PARAM_STATE(&iov[net_config->count], + iface->iface_num, + ISCSI_IFACE_TYPE_IPV4, + ISCSI_NET_PARAM_IFACE_ENABLE, + ISCSI_NET_PARAM, + iface->state, + &net_config->count, + &count); return 0; } @@ -1635,28 +1888,27 @@ 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++; - } - } + + IFACE_SET_NET_PARAM_IPV4_ADDR(&iov[net_config->count], + iface->iface_num, + ISCSI_NET_PARAM_IPV4_ADDR, + iface->ipaddress, + &net_config->count, + &count); + + IFACE_SET_NET_PARAM_IPV4_ADDR(&iov[net_config->count], + iface->iface_num, + ISCSI_NET_PARAM_IPV4_SUBNET, + iface->subnet_mask, + &net_config->count, + &count); + + IFACE_SET_NET_PARAM_IPV4_ADDR(&iov[net_config->count], + iface->iface_num, + ISCSI_NET_PARAM_IPV4_GW, + iface->gateway, + &net_config->count, + &count); } /* @@ -1664,51 +1916,146 @@ * 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++; - } - } + IFACE_SET_PARAM_STATE(&iov[net_config->count], + iface->iface_num, + ISCSI_IFACE_TYPE_IPV4, + ISCSI_NET_PARAM_IPV4_DHCP_DNS_ADDR_EN, + ISCSI_NET_PARAM, + iface->dhcp_dns, + &net_config->count, + &count); + + IFACE_SET_PARAM_STATE(&iov[net_config->count], + iface->iface_num, + ISCSI_IFACE_TYPE_IPV4, + ISCSI_NET_PARAM_IPV4_DHCP_SLP_DA_EN, + ISCSI_NET_PARAM, + iface->dhcp_slp_da, + &net_config->count, + &count); + + IFACE_SET_PARAM_STATE(&iov[net_config->count], + iface->iface_num, + ISCSI_IFACE_TYPE_IPV4, + ISCSI_NET_PARAM_IPV4_TOS_EN, + ISCSI_NET_PARAM, + iface->tos_state, + &net_config->count, + &count); + + IFACE_SET_PARAM_INTVAL(&iov[net_config->count], + iface->iface_num, + ISCSI_IFACE_TYPE_IPV4, + ISCSI_NET_PARAM_IPV4_TOS, + ISCSI_NET_PARAM, + 1, + iface->tos, + &net_config->count, + &count); + + IFACE_SET_PARAM_STATE(&iov[net_config->count], + iface->iface_num, + ISCSI_IFACE_TYPE_IPV4, + ISCSI_NET_PARAM_IPV4_GRAT_ARP_EN, + ISCSI_NET_PARAM, + iface->gratuitous_arp, + &net_config->count, + &count); + + IFACE_SET_PARAM_STATE(&iov[net_config->count], + iface->iface_num, + ISCSI_IFACE_TYPE_IPV4, + ISCSI_NET_PARAM_IPV4_DHCP_ALT_CLIENT_ID_EN, + ISCSI_NET_PARAM, + iface->dhcp_alt_client_id_state, + &net_config->count, + &count); + + IFACE_SET_NET_PARAM_STRVAL(&iov[net_config->count], + iface->iface_num, + ISCSI_IFACE_TYPE_IPV4, + ISCSI_NET_PARAM_IPV4_DHCP_ALT_CLIENT_ID, + strlen(iface->dhcp_alt_client_id), + iface->dhcp_alt_client_id, + &net_config->count, + &count); + + IFACE_SET_PARAM_STATE(&iov[net_config->count], + iface->iface_num, + ISCSI_IFACE_TYPE_IPV4, + ISCSI_NET_PARAM_IPV4_DHCP_REQ_VENDOR_ID_EN, + ISCSI_NET_PARAM, + iface->dhcp_req_vendor_id_state, + &net_config->count, + &count); + + IFACE_SET_PARAM_STATE(&iov[net_config->count], + iface->iface_num, + ISCSI_IFACE_TYPE_IPV4, + ISCSI_NET_PARAM_IPV4_DHCP_USE_VENDOR_ID_EN, + ISCSI_NET_PARAM, + iface->dhcp_vendor_id_state, + &net_config->count, + &count); + + IFACE_SET_NET_PARAM_STRVAL(&iov[net_config->count], + iface->iface_num, + ISCSI_IFACE_TYPE_IPV4, + ISCSI_NET_PARAM_IPV4_DHCP_VENDOR_ID, + strlen(iface->dhcp_vendor_id), + iface->dhcp_vendor_id, + &net_config->count, + &count); + + IFACE_SET_PARAM_STATE(&iov[net_config->count], + iface->iface_num, + ISCSI_IFACE_TYPE_IPV4, + ISCSI_NET_PARAM_IPV4_DHCP_LEARN_IQN_EN, + ISCSI_NET_PARAM, + iface->dhcp_learn_iqn, + &net_config->count, + &count); + + IFACE_SET_PARAM_STATE(&iov[net_config->count], + iface->iface_num, + ISCSI_IFACE_TYPE_IPV4, + ISCSI_NET_PARAM_IPV4_FRAGMENT_DISABLE, + ISCSI_NET_PARAM, + iface->fragmentation, + &net_config->count, + &count); + + IFACE_SET_PARAM_STATE(&iov[net_config->count], + iface->iface_num, + ISCSI_IFACE_TYPE_IPV4, + ISCSI_NET_PARAM_IPV4_IN_FORWARD_EN, + ISCSI_NET_PARAM, + iface->incoming_forwarding, + &net_config->count, + &count); + + IFACE_SET_PARAM_INTVAL(&iov[net_config->count], + iface->iface_num, + ISCSI_IFACE_TYPE_IPV4, + ISCSI_NET_PARAM_IPV4_TTL, + ISCSI_NET_PARAM, + 1, + iface->ttl, + &net_config->count, + &count); } - } else if (iptype == ISCSI_IFACE_TYPE_IPV6) { + break; + + case 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++; - } + IFACE_SET_PARAM_STATE(&iov[net_config->count], + iface->iface_num, + ISCSI_IFACE_TYPE_IPV6, + ISCSI_NET_PARAM_IFACE_ENABLE, + ISCSI_NET_PARAM, + iface->state, + &net_config->count, + &count); return 0; } @@ -1727,12 +2074,12 @@ 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++; - } + IFACE_SET_NET_PARAM_IPV6_ADDR(&iov[net_config->count], + iface->iface_num, + ISCSI_NET_PARAM_IPV6_ADDR, + iface->ipaddress, + &net_config->count, + &count); } /* For LinkLocal Address */ @@ -1751,12 +2098,12 @@ 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++; - } + IFACE_SET_NET_PARAM_IPV6_ADDR(&iov[net_config->count], + iface->iface_num, + ISCSI_NET_PARAM_IPV6_LINKLOCAL, + iface->ipv6_linklocal, + &net_config->count, + &count); } /* For Router Address */ @@ -1773,12 +2120,12 @@ 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++; - } + IFACE_SET_NET_PARAM_IPV6_ADDR(&iov[net_config->count], + iface->iface_num, + ISCSI_NET_PARAM_IPV6_ROUTER, + iface->ipv6_router, + &net_config->count, + &count); } /* @@ -1786,44 +2133,378 @@ * 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)) { + IFACE_SET_PARAM_STATE(&iov[net_config->count], + iface->iface_num, + ISCSI_IFACE_TYPE_IPV6, + ISCSI_NET_PARAM_IPV6_GRAT_NEIGHBOR_ADV_EN, + ISCSI_NET_PARAM, + iface->gratuitous_neighbor_adv, + &net_config->count, + &count); + + IFACE_SET_PARAM_STATE(&iov[net_config->count], + iface->iface_num, + ISCSI_IFACE_TYPE_IPV6, + ISCSI_NET_PARAM_IPV6_MLD_EN, + ISCSI_NET_PARAM, + iface->mld, + &net_config->count, + &count); + + IFACE_SET_PARAM_INTVAL(&iov[net_config->count], + iface->iface_num, + ISCSI_IFACE_TYPE_IPV6, + ISCSI_NET_PARAM_IPV6_FLOW_LABEL, + ISCSI_NET_PARAM, + 4, + iface->flow_label, + &net_config->count, + &count); + + IFACE_SET_PARAM_INTVAL(&iov[net_config->count], + iface->iface_num, + ISCSI_IFACE_TYPE_IPV6, + ISCSI_NET_PARAM_IPV6_TRAFFIC_CLASS, + ISCSI_NET_PARAM, + 1, + iface->traffic_class, + &net_config->count, + &count); + + IFACE_SET_PARAM_INTVAL(&iov[net_config->count], + iface->iface_num, + ISCSI_IFACE_TYPE_IPV6, + ISCSI_NET_PARAM_IPV6_HOP_LIMIT, + ISCSI_NET_PARAM, + 1, + iface->hop_limit, + &net_config->count, + &count); + + IFACE_SET_PARAM_INTVAL(&iov[net_config->count], + iface->iface_num, + ISCSI_IFACE_TYPE_IPV6, + ISCSI_NET_PARAM_IPV6_ND_REACHABLE_TMO, + ISCSI_NET_PARAM, + 4, + iface->nd_reachable_tmo, + &net_config->count, + &count); + + IFACE_SET_PARAM_INTVAL(&iov[net_config->count], + iface->iface_num, + ISCSI_IFACE_TYPE_IPV6, + ISCSI_NET_PARAM_IPV6_ND_REXMIT_TIME, + ISCSI_NET_PARAM, + 4, + iface->nd_rexmit_time, + &net_config->count, + &count); + + IFACE_SET_PARAM_INTVAL(&iov[net_config->count], + iface->iface_num, + ISCSI_IFACE_TYPE_IPV6, + ISCSI_NET_PARAM_IPV6_ND_STALE_TMO, + ISCSI_NET_PARAM, + 4, + iface->nd_stale_tmo, + &net_config->count, + &count); + + IFACE_SET_PARAM_INTVAL(&iov[net_config->count], + iface->iface_num, + ISCSI_IFACE_TYPE_IPV6, + ISCSI_NET_PARAM_IPV6_DUP_ADDR_DETECT_CNT, + ISCSI_NET_PARAM, + 1, + iface->dup_addr_detect_cnt, + &net_config->count, + &count); + + IFACE_SET_PARAM_INTVAL(&iov[net_config->count], + iface->iface_num, + ISCSI_IFACE_TYPE_IPV6, + ISCSI_NET_PARAM_IPV6_RTR_ADV_LINK_MTU, + ISCSI_NET_PARAM, + 4, + iface->router_adv_link_mtu, + &net_config->count, + &count); + } + break; + } + + /* Fill parameters common to IPv4 and IPv6 ifaces */ + if (count) { + IFACE_SET_PARAM_STATE(&iov[net_config->count], + iface->iface_num, + iptype, + ISCSI_NET_PARAM_IFACE_ENABLE, + ISCSI_NET_PARAM, + iface->state, + &net_config->count, + &count); + + IFACE_SET_PARAM_STATE(&iov[net_config->count], + iface->iface_num, + iptype, + ISCSI_NET_PARAM_VLAN_ENABLED, + ISCSI_NET_PARAM, + iface->vlan_state, + &net_config->count, + &count); + + if (strcmp(iface->vlan_state, "disable") && iface->vlan_id) { + if (!iface_fill_vlan_id(&iov[net_config->count], iface, + iptype)) { 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++; - } - } } + + IFACE_SET_PARAM_INTVAL(&iov[net_config->count], + iface->iface_num, + iptype, + ISCSI_NET_PARAM_MTU, + ISCSI_NET_PARAM, + 2, + iface->mtu, + &net_config->count, + &count); + + IFACE_SET_PARAM_INTVAL(&iov[net_config->count], + iface->iface_num, + iptype, + ISCSI_NET_PARAM_PORT, + ISCSI_NET_PARAM, + 2, + iface->port, + &net_config->count, + &count); + + IFACE_SET_PARAM_STATE(&iov[net_config->count], + iface->iface_num, + iptype, + ISCSI_NET_PARAM_DELAYED_ACK_EN, + ISCSI_NET_PARAM, + iface->delayed_ack, + &net_config->count, + &count); + + IFACE_SET_PARAM_STATE(&iov[net_config->count], + iface->iface_num, + iptype, + ISCSI_NET_PARAM_TCP_NAGLE_DISABLE, + ISCSI_NET_PARAM, + iface->nagle, + &net_config->count, + &count); + + IFACE_SET_PARAM_STATE(&iov[net_config->count], + iface->iface_num, + iptype, + ISCSI_NET_PARAM_TCP_WSF_DISABLE, + ISCSI_NET_PARAM, + iface->tcp_wsf_state, + &net_config->count, + &count); + + IFACE_SET_PARAM_INTVAL(&iov[net_config->count], + iface->iface_num, + iptype, + ISCSI_NET_PARAM_TCP_WSF, + ISCSI_NET_PARAM, + 1, + iface->tcp_wsf, + &net_config->count, + &count); + + IFACE_SET_PARAM_INTVAL(&iov[net_config->count], + iface->iface_num, + iptype, + ISCSI_NET_PARAM_TCP_TIMER_SCALE, + ISCSI_NET_PARAM, + 1, + iface->tcp_timer_scale, + &net_config->count, + &count); + + IFACE_SET_PARAM_STATE(&iov[net_config->count], + iface->iface_num, + iptype, + ISCSI_NET_PARAM_TCP_TIMESTAMP_EN, + ISCSI_NET_PARAM, + iface->tcp_timestamp, + &net_config->count, + &count); + + IFACE_SET_PARAM_STATE(&iov[net_config->count], + iface->iface_num, + iptype, + ISCSI_NET_PARAM_REDIRECT_EN, + ISCSI_NET_PARAM, + iface->redirect, + &net_config->count, + &count); + + IFACE_SET_PARAM_INTVAL(&iov[net_config->count], + iface->iface_num, + iptype, + ISCSI_IFACE_PARAM_DEF_TASKMGMT_TMO, + ISCSI_IFACE_PARAM, + 2, + iface->def_task_mgmt_tmo, + &net_config->count, + &count); + + IFACE_SET_PARAM_STATE(&iov[net_config->count], + iface->iface_num, + iptype, + ISCSI_IFACE_PARAM_HDRDGST_EN, + ISCSI_IFACE_PARAM, + iface->header_digest, + &net_config->count, + &count); + + IFACE_SET_PARAM_STATE(&iov[net_config->count], + iface->iface_num, + iptype, + ISCSI_IFACE_PARAM_DATADGST_EN, + ISCSI_IFACE_PARAM, + iface->data_digest, + &net_config->count, + &count); + + IFACE_SET_PARAM_STATE(&iov[net_config->count], + iface->iface_num, + iptype, + ISCSI_IFACE_PARAM_IMM_DATA_EN, + ISCSI_IFACE_PARAM, + iface->immediate_data, + &net_config->count, + &count); + + IFACE_SET_PARAM_STATE(&iov[net_config->count], + iface->iface_num, + iptype, + ISCSI_IFACE_PARAM_INITIAL_R2T_EN, + ISCSI_IFACE_PARAM, + iface->initial_r2t, + &net_config->count, + &count); + + IFACE_SET_PARAM_STATE(&iov[net_config->count], + iface->iface_num, + iptype, + ISCSI_IFACE_PARAM_DATASEQ_INORDER_EN, + ISCSI_IFACE_PARAM, + iface->data_seq_inorder, + &net_config->count, + &count); + + IFACE_SET_PARAM_STATE(&iov[net_config->count], + iface->iface_num, + iptype, + ISCSI_IFACE_PARAM_PDU_INORDER_EN, + ISCSI_IFACE_PARAM, + iface->data_pdu_inorder, + &net_config->count, + &count); + + IFACE_SET_PARAM_INTVAL(&iov[net_config->count], + iface->iface_num, + iptype, + ISCSI_IFACE_PARAM_ERL, + ISCSI_IFACE_PARAM, + 1, + iface->erl, + &net_config->count, + &count); + + IFACE_SET_PARAM_INTVAL(&iov[net_config->count], + iface->iface_num, + iptype, + ISCSI_IFACE_PARAM_MAX_RECV_DLENGTH, + ISCSI_IFACE_PARAM, + 4, + iface->max_recv_dlength, + &net_config->count, + &count); + + IFACE_SET_PARAM_INTVAL(&iov[net_config->count], + iface->iface_num, + iptype, + ISCSI_IFACE_PARAM_FIRST_BURST, + ISCSI_IFACE_PARAM, + 4, + iface->first_burst_len, + &net_config->count, + &count); + + IFACE_SET_PARAM_INTVAL(&iov[net_config->count], + iface->iface_num, + iptype, + ISCSI_IFACE_PARAM_MAX_R2T, + ISCSI_IFACE_PARAM, + 2, + iface->max_out_r2t, + &net_config->count, + &count); + + IFACE_SET_PARAM_INTVAL(&iov[net_config->count], + iface->iface_num, + iptype, + ISCSI_IFACE_PARAM_MAX_BURST, + ISCSI_IFACE_PARAM, + 4, + iface->max_burst_len, + &net_config->count, + &count); + + IFACE_SET_PARAM_STATE(&iov[net_config->count], + iface->iface_num, + iptype, + ISCSI_IFACE_PARAM_CHAP_AUTH_EN, + ISCSI_IFACE_PARAM, + iface->chap_auth, + &net_config->count, + &count); + + IFACE_SET_PARAM_STATE(&iov[net_config->count], + iface->iface_num, + iptype, + ISCSI_IFACE_PARAM_BIDI_CHAP_EN, + ISCSI_IFACE_PARAM, + iface->bidi_chap, + &net_config->count, + &count); + + IFACE_SET_PARAM_STATE(&iov[net_config->count], + iface->iface_num, + iptype, + ISCSI_IFACE_PARAM_STRICT_LOGIN_COMP_EN, + ISCSI_IFACE_PARAM, + iface->strict_login_comp, + &net_config->count, + &count); + + IFACE_SET_PARAM_STATE(&iov[net_config->count], + iface->iface_num, + iptype, + ISCSI_IFACE_PARAM_DISCOVERY_AUTH_OPTIONAL, + ISCSI_IFACE_PARAM, + iface->discovery_auth, + &net_config->count, + &count); + + IFACE_SET_PARAM_STATE(&iov[net_config->count], + iface->iface_num, + iptype, + ISCSI_IFACE_PARAM_DISCOVERY_LOGOUT_EN, + ISCSI_IFACE_PARAM, + iface->discovery_logout, + &net_config->count, + &count); } return 0; } @@ -1842,7 +2523,7 @@ int num_found = 0, rc; struct iface_net_config net_config; - log_debug(8, "In iface_build_net_config\n"); + log_debug(8, "In iface_build_net_config"); net_config.primary = iface; net_config.iovs = iovs; @@ -1854,7 +2535,7 @@ else rc = __iface_build_net_config(&net_config, iface); - log_debug(8, "iface_build_net_config: rc = %d, count = %d\n", + log_debug(8, "iface_build_net_config: rc = %d, count = %d", rc, net_config.count); return net_config.count; } diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/initiator.c open-iscsi-2.0.874/usr/initiator.c --- open-iscsi-2.0.873+git0.3b4b4500/usr/initiator.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/initiator.c 2016-09-29 18:33:24.000000000 +0000 @@ -55,10 +55,19 @@ #define PROC_DIR "/proc" +struct login_task_retry_info { + actor_t retry_actor; + queue_task_t *qtask; + node_rec_t *rec; + int retry_count; +}; + static void iscsi_login_timedout(void *data); static int iscsi_sched_ev_context(struct iscsi_ev_context *ev_context, struct iscsi_conn *conn, unsigned long tmo, int event); +static int queue_session_login_task_retry(struct login_task_retry_info *info, + node_rec_t *rec, queue_task_t *qtask); static int iscsi_ev_context_alloc(iscsi_conn_t *conn) { @@ -223,7 +232,7 @@ } case ISCSI_STATUS_CLS_TARGET_ERR: log_error("conn %d login rejected: target error " - "(%02x/%02x)\n", conn->id, status_class, status_detail); + "(%02x/%02x)", conn->id, status_class, status_detail); /* * We have no idea what the problem is. But spec says initiator * may retry later. @@ -231,7 +240,7 @@ return CONN_LOGIN_RETRY; default: log_error("conn %d login response with unknown status " - "class 0x%x, detail 0x%x\n", conn->id, status_class, + "class 0x%x, detail 0x%x", conn->id, status_class, status_detail); break; } @@ -253,6 +262,7 @@ conn->state = ISCSI_CONN_STATE_FREE; conn->session = session; + actor_init(&conn->login_timer, iscsi_login_timedout, NULL); /* * TODO: we must export the socket_fd/transport_eph from sysfs * so if iscsid is resyncing up we can pick that up and cleanup up @@ -266,7 +276,7 @@ conn->logout_timeout = conn_rec->timeo.logout_timeout; if (!conn->logout_timeout) { log_error("Invalid timeo.logout_timeout. Must be greater " - "than zero. Using default %d.\n", + "than zero. Using default %d.", DEF_LOGOUT_TIMEO); conn->logout_timeout = DEF_LOGOUT_TIMEO; } @@ -274,7 +284,7 @@ conn->login_timeout = conn_rec->timeo.login_timeout; if (!conn->login_timeout) { log_error("Invalid timeo.login_timeout. Must be greater " - "than zero. Using default %d.\n", + "than zero. Using default %d.", DEF_LOGIN_TIMEO); conn->login_timeout = DEF_LOGIN_TIMEO; } @@ -286,14 +296,14 @@ conn->noop_out_timeout = conn_rec->timeo.noop_out_timeout; if (conn->noop_out_interval && !conn->noop_out_timeout) { log_error("Invalid timeo.noop_out_timeout. Must be greater " - "than zero. Using default %d.\n", + "than zero. Using default %d.", DEF_NOOP_OUT_TIMEO); conn->noop_out_timeout = DEF_NOOP_OUT_TIMEO; } if (conn->noop_out_timeout && !conn->noop_out_interval) { log_error("Invalid timeo.noop_out_interval. Must be greater " - "than zero. Using default %d.\n", + "than zero. Using default %d.", DEF_NOOP_OUT_INTERVAL); conn->noop_out_interval = DEF_NOOP_OUT_INTERVAL; } @@ -324,14 +334,17 @@ } static iscsi_session_t* -__session_create(node_rec_t *rec, struct iscsi_transport *t) +__session_create(node_rec_t *rec, struct iscsi_transport *t, int *rc) { iscsi_session_t *session; - int hostno, rc = 0; + int hostno; + + *rc = 0; session = calloc(1, sizeof (*session)); if (session == NULL) { log_debug(1, "can not allocate memory for session"); + *rc = ISCSI_ERR_NOMEM; return NULL; } log_debug(2, "Allocted session %p", session); @@ -356,8 +369,8 @@ session->initiator_name = dconfig->initiator_name; else { log_error("No initiator name set. Cannot create session."); - free(session); - return NULL; + *rc = ISCSI_ERR_INVAL; + goto free_session; } if (strlen(session->nrec.iface.alias)) @@ -386,19 +399,29 @@ iscsi_session_init_params(session); - hostno = iscsi_sysfs_get_host_no_from_hwinfo(&rec->iface, &rc); - if (!rc) { - /* - * if the netdev or mac was set, then we are going to want - * to want to bind the all the conns/eps to a specific host - * if offload is used. - */ - session->conn[0].bind_ep = 1; - session->hostno = hostno; - } + if (t->template->bind_ep_required) { + hostno = iscsi_sysfs_get_host_no_from_hwinfo(&rec->iface, rc); + if (!*rc) { + /* + * if the netdev or mac was set, then we are going to want + * to want to bind the all the conns/eps to a specific host + * if offload is used. + */ + session->conn[0].bind_ep = 1; + session->hostno = hostno; + } else if (*rc == ISCSI_ERR_HOST_NOT_FOUND) { + goto free_session; + } else { + *rc = 0; + } + } list_add_tail(&session->list, &t->sessions); return session; + +free_session: + free(session); + return NULL; } static void iscsi_flush_context_pool(struct iscsi_session *session) @@ -422,7 +445,7 @@ static void __session_destroy(iscsi_session_t *session) { - log_debug(1, "destroying session\n"); + log_debug(1, "destroying session"); list_del(&session->list); iscsi_flush_context_pool(session); session_release(session); @@ -500,15 +523,13 @@ { iscsi_conn_t *conn = qtask->conn; - log_debug(4, "Requeue reopen attempt in %d secs\n", delay); + log_debug(4, "Requeue reopen attempt in %d secs", delay); /* * iscsi_login_eh can handle the login resched as * if it were login time out */ - actor_delete(&conn->login_timer); - actor_timer(&conn->login_timer, delay * 1000, - iscsi_login_timedout, qtask); + actor_timer_mod(&conn->login_timer, delay, qtask); } static int iscsi_conn_connect(struct iscsi_conn *conn, queue_task_t *qtask) @@ -543,53 +564,10 @@ iscsi_sched_ev_context(ev_context, conn, 0, EV_CONN_POLL); log_debug(3, "Setting login timer %p timeout %d", &conn->login_timer, conn->login_timeout); - actor_timer(&conn->login_timer, conn->login_timeout * 1000, - iscsi_login_timedout, qtask); + actor_timer_mod(&conn->login_timer, conn->login_timeout, qtask); return 0; } -static void iscsi_uio_poll_login_timedout(void *data) -{ - struct queue_task *qtask = data; - struct iscsi_conn *conn = qtask->conn; - iscsi_session_t *session = conn->session; - - log_debug(3, "timeout waiting for UIO ...\n"); - mgmt_ipc_write_rsp(qtask, ISCSI_ERR_TRANS_TIMEOUT); - conn_delete_timers(conn); - __session_destroy(session); -} - -static int iscsi_sched_uio_poll(queue_task_t *qtask) -{ - struct iscsi_conn *conn = qtask->conn; - struct iscsi_session *session = conn->session; - struct iscsi_transport *t = session->t; - struct iscsi_ev_context *ev_context; - - if (!t->template->set_net_config) - return 0; - - ev_context = iscsi_ev_context_get(conn, 0); - if (!ev_context) { - /* while reopening the recv pool should be full */ - log_error("BUG: __session_conn_reopen could " - "not get conn context for recv."); - return -ENOMEM; - } - - ev_context->data = qtask; - conn->state = ISCSI_CONN_STATE_XPT_WAIT; - - iscsi_sched_ev_context(ev_context, conn, 0, EV_UIO_POLL); - - log_debug(3, "Setting login UIO poll timer %p timeout %d", - &conn->login_timer, conn->login_timeout); - actor_timer(&conn->login_timer, conn->login_timeout * 1000, - iscsi_uio_poll_login_timedout, qtask); - return -EAGAIN; -} - static void __session_conn_reopen(iscsi_conn_t *conn, queue_task_t *qtask, int do_stop, int redirected) @@ -643,7 +621,7 @@ return; queue_reopen: - log_debug(4, "Waiting %u seconds before trying to reconnect.\n", delay); + log_debug(4, "Waiting %u seconds before trying to reconnect.", delay); queue_delayed_reopen(qtask, delay); } @@ -676,7 +654,7 @@ timeout.tv_sec = initial_login_retry_max * conn->login_timeout; if (gettimeofday(&now, NULL)) { log_error("Could not get time of day. Dropping down to " - "max retry check.\n"); + "max retry check."); return initial_login_retry_max > conn->session->reopen_cnt; } timeradd(&conn->initial_connect_time, &timeout, &fail_time); @@ -687,7 +665,7 @@ */ if (timercmp(&now, &fail_time, >)) { log_debug(1, "Giving up on initial login attempt after " - "%u seconds.\n", + "%u seconds.", initial_login_retry_max * conn->login_timeout); return 0; } @@ -794,7 +772,7 @@ break; default: - log_error("Ignoring login error %d in conn state %d.\n", + log_error("Ignoring login error %d in conn state %d.", err, conn->state); break; } @@ -868,7 +846,7 @@ "let connection stop"); return; default: - log_debug(8, "invalid state %d\n", conn->state); + log_debug(8, "invalid state %d", conn->state); return; } @@ -925,7 +903,7 @@ iscsi_session_t *session = conn->session; iscsi_login_context_t *c = &conn->login_context; - log_debug(3, "login redirect ...\n"); + log_debug(3, "login redirect ..."); if (session->r_stage == R_STAGE_NO_CHANGE) session->r_stage = R_STAGE_SESSION_REDIRECT; @@ -992,9 +970,9 @@ __send_nopout(conn); - actor_timer(&conn->nop_out_timer, conn->noop_out_timeout*1000, + actor_timer(&conn->nop_out_timer, conn->noop_out_timeout, conn_nop_out_timeout, conn); - log_debug(3, "noop out timeout timer %p start, timeout %d\n", + log_debug(3, "noop out timeout timer %p start, timeout %d", &conn->nop_out_timer, conn->noop_out_timeout); } @@ -1048,12 +1026,7 @@ 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)) { + if (iscsi_session_set_neg_params(conn)) { iscsi_login_eh(conn, c->qtask, ISCSI_ERR_LOGIN); return; } @@ -1100,9 +1073,9 @@ /* noop_out */ if (conn->userspace_nop && conn->noop_out_interval) { - actor_timer(&conn->nop_out_timer, conn->noop_out_interval*1000, + actor_timer(&conn->nop_out_timer, conn->noop_out_interval, conn_send_nop_out, conn); - log_debug(3, "noop out timer %p start\n", + log_debug(3, "noop out timer %p start", &conn->nop_out_timer); } } @@ -1117,7 +1090,7 @@ * assume we were in ISCSI_CONN_STATE_IN_LOGOUT or there * was some nasty error */ - log_debug(3, "logout timeout, dropping conn...\n"); + log_debug(3, "logout timeout, dropping conn..."); __conn_error_handle(conn->session, conn); } @@ -1148,7 +1121,7 @@ iscsi_sched_ev_context(ev_context, conn, conn->logout_timeout, EV_CONN_LOGOUT_TIMER); - log_debug(3, "logout timeout timer %u\n", + log_debug(3, "logout timeout timer %u", conn->logout_timeout * 1000); } @@ -1184,7 +1157,7 @@ /* noop out rsp */ actor_delete(&conn->nop_out_timer); /* schedule a new ping */ - actor_timer(&conn->nop_out_timer, conn->noop_out_interval*1000, + actor_timer(&conn->nop_out_timer, conn->noop_out_interval, conn_send_nop_out, conn); } else /* noop in req */ if (!__send_nopin_rsp(conn, (struct iscsi_nopin*)hdr, @@ -1197,7 +1170,7 @@ { struct iscsi_logout_rsp *logout_rsp = (struct iscsi_logout_rsp *)hdr; - log_debug(3, "Recv: logout response %d\n", logout_rsp->response); + log_debug(3, "Recv: logout response %d", logout_rsp->response); if (logout_rsp->response == 2 || logout_rsp->response == 3) { conn->session->def_time2wait = ntohs(logout_rsp->t2wait); log_debug(4, "logout rsp returned time2wait %u", @@ -1215,7 +1188,7 @@ unsigned int senselen; struct scsi_sense_hdr sshdr; - log_debug(3, "Read AEN %d\n", async_hdr->async_event); + log_debug(3, "Read AEN %d", async_hdr->async_event); switch (async_hdr->async_event) { case ISCSI_ASYNC_MSG_SCSI_EVENT: @@ -1233,33 +1206,33 @@ break; case ISCSI_ASYNC_MSG_REQUEST_LOGOUT: log_warning("Target requests logout within %u seconds for " - "connection\n", ntohs(async_hdr->param3)); + "connection", ntohs(async_hdr->param3)); if (iscsi_send_logout(conn)) log_error("Could not send logout in response to" - "logout request aen\n"); + "logout request aen"); break; case ISCSI_ASYNC_MSG_DROPPING_CONNECTION: log_warning("Target dropping connection %u, reconnect min %u " - "max %u\n", ntohs(async_hdr->param1), + "max %u", ntohs(async_hdr->param1), ntohs(async_hdr->param2), ntohs(async_hdr->param3)); session->def_time2wait = (uint32_t)ntohs(async_hdr->param2) & 0x0000FFFFFL; break; case ISCSI_ASYNC_MSG_DROPPING_ALL_CONNECTIONS: log_warning("Target dropping all connections, reconnect min %u " - "max %u\n", ntohs(async_hdr->param2), + "max %u", ntohs(async_hdr->param2), ntohs(async_hdr->param3)); session->def_time2wait = (uint32_t)ntohs(async_hdr->param2) & 0x0000FFFFFL; break; case ISCSI_ASYNC_MSG_PARAM_NEGOTIATION: log_warning("Received async event param negotiation, " - "dropping session\n"); + "dropping session"); __conn_error_handle(session, conn); break; case ISCSI_ASYNC_MSG_VENDOR_SPECIFIC: default: - log_warning("AEN not supported\n"); + log_warning("AEN not supported"); } } @@ -1374,7 +1347,7 @@ break; default: iscsi_ev_context_put(ev_context); - log_error("Invalid state. Dropping PDU.\n"); + log_error("Invalid state. Dropping PDU."); } } @@ -1458,7 +1431,7 @@ fail: log_error("Could not set session%d priority. " "READ/WRITE throughout and latency could be " - "affected.\n", session->id); + "affected.", session->id); } static int session_ipc_create(struct iscsi_session *session) @@ -1507,6 +1480,11 @@ return; } + if (iscsi_session_set_neg_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; @@ -1549,7 +1527,6 @@ rc = session->t->template->ep_poll(conn, 1); if (rc == 0) { log_debug(4, "poll not connected %d", rc); - /* timedout: Poll again. */ ev_context = iscsi_ev_context_get(conn, 0); if (!ev_context) { /* while polling the recv pool should be full */ @@ -1559,7 +1536,8 @@ return; } ev_context->data = qtask; - iscsi_sched_ev_context(ev_context, conn, 0, EV_CONN_POLL); + /* not connected yet, check later */ + iscsi_sched_ev_context(ev_context, conn, 1, EV_CONN_POLL); } else if (rc > 0) { /* connected! */ memset(c, 0, sizeof(iscsi_login_context_t)); @@ -1592,7 +1570,9 @@ * TODO: use the iface number or some other value * so this will be persistent */ - session->isid[3] = session->id; + session->isid[3] = (session->id >> 16) & 0xff; + session->isid[4] = (session->id >> 8) & 0xff; + session->isid[5] = session->id & 0xff; if (ipc->bind_conn(session->t->handle, session->id, conn->id, conn->transport_ep_handle, @@ -1618,6 +1598,16 @@ return; } + if (iscsi_session_set_params(conn)) { + iscsi_login_eh(conn, qtask, ISCSI_ERR_LOGIN); + return; + } + + if (iscsi_host_set_params(session)) { + iscsi_login_eh(conn, qtask, ISCSI_ERR_LOGIN); + return; + } + if (iscsi_login_begin(session, c)) { iscsi_login_eh(conn, qtask, ISCSI_ERR_LOGIN); return; @@ -1708,53 +1698,6 @@ } -static void session_conn_uio_poll(void *data) -{ - struct iscsi_ev_context *ev_context = data; - iscsi_conn_t *conn = ev_context->conn; - struct iscsi_session *session = conn->session; - queue_task_t *qtask = ev_context->data; - int rc; - - log_debug(4, "retrying uio poll"); - rc = iscsi_set_net_config(session->t, session, - &conn->session->nrec.iface); - if (rc != 0) { - if (rc == ISCSI_ERR_AGAIN) { - ev_context->data = qtask; - iscsi_sched_ev_context(ev_context, conn, 2, - EV_UIO_POLL); - return; - } else { - log_error("session_conn_uio_poll() " - "connection failure [0x%x]", rc); - actor_delete(&conn->login_timer); - iscsi_login_eh(conn, qtask, ISCSI_ERR_INTERNAL); - iscsi_ev_context_put(ev_context); - return; - } - } - - iscsi_ev_context_put(ev_context); - actor_delete(&conn->login_timer); - log_debug(4, "UIO ready trying connect"); - - /* uIP is ready try to connect */ - if (gettimeofday(&conn->initial_connect_time, NULL)) - log_error("Could not get initial connect time. If " - "login errors iscsid may give up the initial " - "login early. You should manually login."); - - conn->state = ISCSI_CONN_STATE_XPT_WAIT; - if (iscsi_conn_connect(conn, qtask)) { - int delay = ISCSI_CONN_ERR_REOPEN_DELAY; - - log_debug(4, "Waiting %u seconds before trying to reconnect.\n", - delay); - queue_delayed_reopen(qtask, delay); - } -} - static int iscsi_sched_ev_context(struct iscsi_ev_context *ev_context, struct iscsi_conn *conn, unsigned long tmo, int event) @@ -1767,14 +1710,14 @@ ev_context->conn = conn; switch (event) { case EV_CONN_RECV_PDU: - actor_new(&ev_context->actor, session_conn_recv_pdu, + actor_init(&ev_context->actor, session_conn_recv_pdu, ev_context); actor_schedule(&ev_context->actor); break; case EV_CONN_ERROR: error = *(enum iscsi_err *)ev_context->data; - actor_new(&ev_context->actor, session_conn_error, + actor_init(&ev_context->actor, session_conn_error, ev_context); /* * We handle invalid host, by killing the session. @@ -1787,26 +1730,20 @@ actor_schedule(&ev_context->actor); break; case EV_CONN_LOGIN: - actor_new(&ev_context->actor, session_conn_process_login, + actor_init(&ev_context->actor, session_conn_process_login, ev_context); actor_schedule(&ev_context->actor); break; case EV_CONN_POLL: - actor_new(&ev_context->actor, session_conn_poll, - ev_context); - actor_schedule(&ev_context->actor); - break; - case EV_UIO_POLL: - actor_new(&ev_context->actor, session_conn_uio_poll, - ev_context); - actor_schedule(&ev_context->actor); + actor_timer(&ev_context->actor, tmo, + session_conn_poll, ev_context); break; case EV_CONN_LOGOUT_TIMER: - actor_timer(&ev_context->actor, tmo * 1000, + actor_timer(&ev_context->actor, tmo, iscsi_logout_timedout, ev_context); break; case EV_CONN_STOP: - actor_new(&ev_context->actor, iscsi_stop, + actor_init(&ev_context->actor, iscsi_stop, ev_context); actor_schedule(&ev_context->actor); break; @@ -1836,7 +1773,7 @@ /* * a session could be running in the kernel but not in iscsid - * due to a resync or becuase some other app started the session + * due to a resync or because some other app started the session */ static int session_is_running(node_rec_t *rec) { @@ -1852,8 +1789,7 @@ return 0; } -int -session_login_task(node_rec_t *rec, queue_task_t *qtask) +static int __session_login_task(node_rec_t *rec, queue_task_t *qtask) { iscsi_session_t *session; iscsi_conn_t *conn; @@ -1876,7 +1812,7 @@ (!(t->caps & CAP_RECOVERY_L1) && rec->session.iscsi.ERL > 1)) { log_error("Transport '%s' does not support ERL %d." - "Setting ERL to ERL0.\n", + "Setting ERL to ERL0.", t->name, rec->session.iscsi.ERL); rec->session.iscsi.ERL = 0; } @@ -1909,19 +1845,21 @@ if (!(t->caps & CAP_MARKERS) && rec->conn[0].iscsi.IFMarker) { log_error("Transport '%s' does not support IFMarker. " - "Disabling IFMarkers.\n", t->name); + "Disabling IFMarkers.", t->name); rec->conn[0].iscsi.IFMarker = 0; } if (!(t->caps & CAP_MARKERS) && rec->conn[0].iscsi.OFMarker) { log_error("Transport '%s' does not support OFMarker." - "Disabling OFMarkers.\n", t->name); + "Disabling OFMarkers.", t->name); rec->conn[0].iscsi.OFMarker = 0; } - session = __session_create(rec, t); - if (!session) + session = __session_create(rec, t, &rc); + if (rc == ISCSI_ERR_HOST_NOT_FOUND) + return rc; + else if (!session) return ISCSI_ERR_LOGIN; /* FIXME: login all connections! marked as "automatic" */ @@ -1937,14 +1875,12 @@ rc = iscsi_host_set_net_params(&rec->iface, session); if (rc == ISCSI_ERR_AGAIN) { - iscsi_sched_uio_poll(qtask); /* - * Cannot block iscsid, so caller is going to internally - * retry the operation. + * host/iscsiuio not ready. Cannot block iscsid, so caller is + * going to internally retry the operation. */ - qtask->rsp.command = MGMT_IPC_SESSION_LOGIN; - qtask->rsp.err = ISCSI_SUCCESS; - return ISCSI_SUCCESS; + __session_destroy(session); + return ISCSI_ERR_HOST_NOT_FOUND; } else if (rc) { __session_destroy(session); return ISCSI_ERR_LOGIN; @@ -1961,7 +1897,7 @@ if (iscsi_conn_connect(conn, qtask)) { log_debug(4, "Initial connect failed. Waiting %u seconds " - "before trying to reconnect.\n", + "before trying to reconnect.", ISCSI_CONN_ERR_REOPEN_DELAY); queue_delayed_reopen(qtask, ISCSI_CONN_ERR_REOPEN_DELAY); } @@ -1969,6 +1905,74 @@ return ISCSI_SUCCESS; } +int +session_login_task(node_rec_t *rec, queue_task_t *qtask) +{ + int rc; + + rc = __session_login_task(rec, qtask); + if (rc == ISCSI_ERR_HOST_NOT_FOUND) { + rc = queue_session_login_task_retry(NULL, rec, qtask); + if (rc) + return rc; + /* + * we are going to internally retry. Will return final rc + * when completed + */ + return ISCSI_SUCCESS; + } + return rc; +} + +static void session_login_task_retry(void *data) +{ + struct login_task_retry_info *info = data; + struct node_rec *rec = info->rec; + int rc; + + rc = __session_login_task(rec, info->qtask); + if (rc == ISCSI_ERR_HOST_NOT_FOUND) { + if (info->retry_count == rec->conn[0].timeo.login_timeout) { + /* give up */ + goto write_rsp; + } + + rc = queue_session_login_task_retry(info, rec, info->qtask); + if (rc) + goto write_rsp; + /* we are going to internally retry */ + return; + } else if (rc) { + /* hard error - no retry */ + goto write_rsp; + } else + /* successfully started login operation */ + goto free; +write_rsp: + mgmt_ipc_write_rsp(info->qtask, rc); +free: + free(info); +} + +static int queue_session_login_task_retry(struct login_task_retry_info *info, + node_rec_t *rec, queue_task_t *qtask) +{ + if (!info) { + info = malloc(sizeof(*info)); + if (!info) + return ISCSI_ERR_NOMEM; + memset(info, 0, sizeof(*info)); + info->qtask = qtask; + info->rec = rec; + } + + info->retry_count++; + log_debug(4, "queue session setup attempt in %d secs, retries %d", + 1, info->retry_count); + actor_timer(&info->retry_actor, 1, session_login_task_retry, info); + return 0; +} + static int sync_conn(iscsi_session_t *session, uint32_t cid) { @@ -1996,14 +2000,14 @@ if (!t) return ISCSI_ERR_TRANS_NOT_FOUND; - session = __session_create(rec, t); + session = __session_create(rec, t, &err); if (!session) return ISCSI_ERR_LOGIN; session->id = sid; session->hostno = iscsi_sysfs_get_host_no_from_sid(sid, &err); if (err) { - log_error("Could not get hostno for session %d\n", sid); + log_error("Could not get hostno for session %d", sid); goto destroy_session; } @@ -2024,7 +2028,7 @@ destroy_session: __session_destroy(session); - log_error("Could not sync session%d err %d\n", sid, err); + log_error("Could not sync session%d err %d", sid, err); return err; } @@ -2035,7 +2039,7 @@ err = ipc->unbind_session(session->t->handle, session->id); if (err) /* older kernels did not support unbind */ - log_debug(2, "Could not unbind session %d.\n", err); + log_debug(2, "Could not unbind session %d.", err); return err; } @@ -2047,7 +2051,7 @@ session = session_find_by_sid(sid); if (!session) { - log_debug(1, "session sid %d not found.\n", sid); + log_debug(1, "session sid %d not found.", sid); return ISCSI_ERR_SESS_NOT_FOUND; } conn = &session->conn[0]; @@ -2062,10 +2066,16 @@ session->r_stage == R_STAGE_SESSION_REDIRECT))) { invalid_state: log_error("session in invalid state for logout. " - "Try again later\n"); + "Try again later"); return ISCSI_ERR_INTERNAL; } + if (dconfig->safe_logout && session_in_use(sid)) { + log_error("Session is actively in use for mounted storage, " + "and iscsid.safe_logout is configured."); + return ISCSI_ERR_BUSY; + } + /* FIXME: logout all active connections */ conn = &session->conn[0]; if (conn->logout_qtask) @@ -2087,7 +2097,7 @@ return ISCSI_SUCCESS; } - log_error("Could not send logout pdu. Dropping session\n"); + log_error("Could not send logout pdu. Dropping session"); /* fallthrough */ default: rc = session_conn_shutdown(conn, qtask, ISCSI_SUCCESS); @@ -2105,7 +2115,7 @@ t = iscsi_sysfs_get_transport_by_hba(host_no); if (!t) { - log_error("Invalid host no %d for sendtargets\n", host_no); + log_error("Invalid host no %d for sendtargets", host_no); return ISCSI_ERR_TRANS_NOT_FOUND; } if (!(t->caps & CAP_SENDTARGETS_OFFLOAD)) @@ -2118,7 +2128,7 @@ } /* - * HW drivers like qla4xxx present a interface that hides most of the iscsi + * HW drivers like qla4xxx present an interface that hides most of the iscsi * details. Userspace sends down a discovery event then it gets notified * if the sessions that were logged in as a result asynchronously, or * the card will have sessions preset in the FLASH and will log into them diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/initiator_common.c open-iscsi-2.0.874/usr/initiator_common.c --- open-iscsi-2.0.873+git0.3b4b4500/usr/initiator_common.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/initiator_common.c 2016-09-29 18:33:24.000000000 +0000 @@ -23,6 +23,8 @@ #include #include #include +#include +#include #include "initiator.h" #include "transport.h" @@ -51,21 +53,9 @@ return NULL; } -/* - * calculate parameter's padding - */ -static unsigned int -__padding(unsigned int param) -{ - int pad; - - pad = param & 3; - if (pad) { - pad = 4 - pad; - log_debug(1, "parameter's value %d padded to %d bytes\n", - param, param + pad); - } - return param + pad; +const static unsigned int align_32_down(unsigned int param) +{ + return param & ~0x3; } int iscsi_setup_authentication(struct iscsi_session *session, @@ -77,7 +67,7 @@ if (auth_cfg->username_in[0] || auth_cfg->password_in_length) { /* sanity check the config */ if (auth_cfg->password_length == 0) { - log_warning("CHAP configuratoin has incoming " + log_warning("CHAP configuration has incoming " "authentication credentials but has no " "outgoing credentials configured."); return EINVAL; @@ -151,11 +141,11 @@ conn->datadgst_en = conn_conf->DataDigest; conn->max_recv_dlength = - __padding(conn_conf->MaxRecvDataSegmentLength); + align_32_down(conn_conf->MaxRecvDataSegmentLength); if (conn->max_recv_dlength < ISCSI_MIN_MAX_RECV_SEG_LEN || conn->max_recv_dlength > ISCSI_MAX_MAX_RECV_SEG_LEN) { log_error("Invalid iscsi.MaxRecvDataSegmentLength. Must be " - "within %u and %u. Setting to %u\n", + "within %u and %u. Setting to %u", ISCSI_MIN_MAX_RECV_SEG_LEN, ISCSI_MAX_MAX_RECV_SEG_LEN, DEF_INI_MAX_RECV_SEG_LEN); @@ -166,13 +156,13 @@ /* zero indicates to use the target's value */ conn->max_xmit_dlength = - __padding(conn_conf->MaxXmitDataSegmentLength); + align_32_down(conn_conf->MaxXmitDataSegmentLength); if (conn->max_xmit_dlength == 0) conn->max_xmit_dlength = ISCSI_DEF_MAX_RECV_SEG_LEN; if (conn->max_xmit_dlength < ISCSI_MIN_MAX_RECV_SEG_LEN || conn->max_xmit_dlength > ISCSI_MAX_MAX_RECV_SEG_LEN) { log_error("Invalid iscsi.MaxXmitDataSegmentLength. Must be " - "within %u and %u. Setting to %u\n", + "within %u and %u. Setting to %u", ISCSI_MIN_MAX_RECV_SEG_LEN, ISCSI_MAX_MAX_RECV_SEG_LEN, DEF_INI_MAX_RECV_SEG_LEN); @@ -184,7 +174,7 @@ /* session's operational parameters */ session->initial_r2t_en = session_conf->InitialR2T; session->imm_data_en = session_conf->ImmediateData; - session->first_burst = __padding(session_conf->FirstBurstLength); + session->first_burst = align_32_down(session_conf->FirstBurstLength); /* * some targets like netapp fail the login if sent bad first_burst * and max_burst lens, even when immediate data=no and @@ -193,7 +183,7 @@ if (session->first_burst < ISCSI_MIN_FIRST_BURST_LEN || session->first_burst > ISCSI_MAX_FIRST_BURST_LEN) { log_error("Invalid iscsi.FirstBurstLength of %u. Must be " - "within %u and %u. Setting to %u\n", + "within %u and %u. Setting to %u", session->first_burst, ISCSI_MIN_FIRST_BURST_LEN, ISCSI_MAX_FIRST_BURST_LEN, @@ -202,11 +192,11 @@ session->first_burst = DEF_INI_FIRST_BURST_LEN; } - session->max_burst = __padding(session_conf->MaxBurstLength); + session->max_burst = align_32_down(session_conf->MaxBurstLength); if (session->max_burst < ISCSI_MIN_MAX_BURST_LEN || session->max_burst > ISCSI_MAX_MAX_BURST_LEN) { log_error("Invalid iscsi.MaxBurstLength of %u. Must be " - "within %u and %u. Setting to %u\n", + "within %u and %u. Setting to %u", session->max_burst, ISCSI_MIN_MAX_BURST_LEN, ISCSI_MAX_MAX_BURST_LEN, DEF_INI_MAX_BURST_LEN); session_conf->MaxBurstLength = DEF_INI_MAX_BURST_LEN; @@ -215,7 +205,7 @@ if (session->first_burst > session->max_burst) { log_error("Invalid iscsi.FirstBurstLength of %u. Must be " - "less than iscsi.MaxBurstLength. Setting to %u\n", + "less than iscsi.MaxBurstLength. Setting to %u", session->first_burst, session->max_burst); session_conf->FirstBurstLength = session->max_burst; session->first_burst = session->max_burst; @@ -261,7 +251,7 @@ return 0; } -int host_set_param(struct iscsi_transport *t, +static int host_set_param(struct iscsi_transport *t, uint32_t host_no, int param, char *value, int type) { @@ -273,7 +263,7 @@ log_error("can't set operational parameter %d for " "host %d, retcode %d (%d)", param, host_no, rc, errno); - return rc; + return ISCSI_ERR_INVAL; } return 0; } @@ -345,9 +335,9 @@ } } -#define MAX_SESSION_PARAMS 35 +#define MAX_SESSION_NEG_PARAMS 16 -int iscsi_session_set_params(struct iscsi_conn *conn) +int iscsi_session_set_neg_params(struct iscsi_conn *conn) { struct iscsi_session *session = conn->session; int i, rc; @@ -357,7 +347,7 @@ int type; void *value; int conn_only; - } conntbl[MAX_SESSION_PARAMS] = { + } conntbl[MAX_SESSION_NEG_PARAMS] = { { .param = ISCSI_PARAM_MAX_RECV_DLENGTH, .value = &conn->max_recv_dlength, @@ -431,18 +421,61 @@ }, { .param = ISCSI_PARAM_EXP_STATSN, .value = &conn->exp_statsn, - .type = ISCSI_INT, + .type = ISCSI_UINT, .conn_only = 1, }, { - .param = ISCSI_PARAM_TARGET_NAME, - .conn_only = 0, - .type = ISCSI_STRING, - .value = session->target_name, - }, { .param = ISCSI_PARAM_TPGT, .value = &session->portal_group_tag, .type = ISCSI_INT, .conn_only = 0, + }, + }; + + iscsi_session_init_params(session); + + /* Entered full-feature phase! */ + for (i = 0; i < MAX_SESSION_NEG_PARAMS; i++) { + if (conn->id != 0 && !conntbl[i].conn_only) + continue; + + 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); + if (rc && rc != -ENOSYS) { + log_error("can't set operational parameter %d for " + "connection %d:%d, retcode %d (%d)", + conntbl[i].param, session->id, conn->id, + rc, errno); + return EPERM; + } + + print_param_value(conntbl[i].param, conntbl[i].value, + conntbl[i].type); + } + + return 0; +} + +#define MAX_SESSION_PARAMS 20 + +int iscsi_session_set_params(struct iscsi_conn *conn) +{ + struct iscsi_session *session = conn->session; + int i, rc; + struct connparam { + int param; + int type; + void *value; + int conn_only; + } conntbl[MAX_SESSION_PARAMS] = { + { + .param = ISCSI_PARAM_TARGET_NAME, + .conn_only = 0, + .type = ISCSI_STRING, + .value = session->target_name, }, { .param = ISCSI_PARAM_PERSISTENT_ADDRESS, .value = session->nrec.conn[conn->id].address, @@ -512,22 +545,32 @@ .param = ISCSI_PARAM_IFACE_NAME, .value = session->nrec.iface.name, .type = ISCSI_STRING, + .conn_only = 0, }, { .param = ISCSI_PARAM_INITIATOR_NAME, .value = session->initiator_name, .type = ISCSI_STRING, + .conn_only = 0, }, { .param = ISCSI_PARAM_BOOT_ROOT, .value = session->nrec.session.boot_root, .type = ISCSI_STRING, + .conn_only = 0, }, { .param = ISCSI_PARAM_BOOT_NIC, .value = session->nrec.session.boot_nic, .type = ISCSI_STRING, + .conn_only = 0, }, { .param = ISCSI_PARAM_BOOT_TARGET, .value = session->nrec.session.boot_target, .type = ISCSI_STRING, + .conn_only = 0, + }, { + .param = ISCSI_PARAM_DISCOVERY_SESS, + .value = &session->type, + .type = ISCSI_INT, + .conn_only = 0, }, }; @@ -596,7 +639,7 @@ set */ hostno = iscsi_sysfs_get_host_no_from_hwinfo(iface, &rc); if (rc) { - log_debug(4, "Couldn't get host no.\n"); + log_debug(4, "Couldn't get host no."); return rc; } @@ -623,7 +666,7 @@ struct host_info hinfo; log_debug(3, "setting iface %s, dev %s, set ip %s, hw %s, " - "transport %s.\n", + "transport %s.", iface->name, iface->netdev, iface->ipaddress, iface->hwaddress, iface->transport_name); @@ -632,9 +675,18 @@ /* if we need to set the ip addr then set all the iface net settings */ if (!iface_is_bound_by_ipaddr(iface)) { - log_warning("Please set the iface.ipaddress for iface %s, " - "then retry the login command.\n", iface->name); - return EINVAL; + if (t->template->set_host_ip == SET_HOST_IP_REQ) { + log_warning("Please set the iface.ipaddress for iface " + "%s, then retry the login command.", + iface->name); + return ISCSI_ERR_INVAL; + } else if (t->template->set_host_ip == SET_HOST_IP_OPT) { + log_info("Optional iface.ipaddress for iface %s " + "not set.", iface->name); + return 0; + } else { + return ISCSI_ERR_INVAL; + } } /* these type of drivers need the netdev upd */ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/initiator.h open-iscsi-2.0.874/usr/initiator.h --- open-iscsi-2.0.873+git0.3b4b4500/usr/initiator.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/initiator.h 2016-09-29 18:33:24.000000000 +0000 @@ -83,7 +83,6 @@ EV_CONN_LOGOUT_TIMER, EV_CONN_STOP, EV_CONN_LOGIN, - EV_UIO_POLL, } iscsi_event_e; struct queue_task; @@ -344,6 +343,7 @@ extern void iscsi_initiator_init(void); /* initiator code common to discovery and normal sessions */ +extern int iscsi_session_set_neg_params(struct iscsi_conn *conn); extern int iscsi_session_set_params(struct iscsi_conn *conn); extern int iscsi_host_set_params(struct iscsi_session *session); extern int iscsi_host_set_net_params(struct iface_rec *iface, @@ -359,4 +359,5 @@ struct iface_rec *iface); extern void iscsi_session_init_params(struct iscsi_session *session); +extern int session_in_use(int sid); #endif /* INITIATOR_H */ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/io.c open-iscsi-2.0.874/usr/io.c --- open-iscsi-2.0.873+git0.3b4b4500/usr/io.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/io.c 2016-09-29 18:33:24.000000000 +0000 @@ -113,14 +113,14 @@ (void *)&(s4->sin_addr), buf, INET_ADDRSTRLEN)) continue; - log_debug(4, "name %s addr %s\n", ifa->ifa_name, buf); + log_debug(4, "name %s addr %s", ifa->ifa_name, buf); break; case AF_INET6: s6 = (struct sockaddr_in6 *)(ifa->ifa_addr); if (!inet_ntop(ifa->ifa_addr->sa_family, (void *)&(s6->sin6_addr), buf, INET6_ADDRSTRLEN)) continue; - log_debug(4, "name %s addr %s\n", ifa->ifa_name, buf); + log_debug(4, "name %s addr %s", ifa->ifa_name, buf); break; default: continue; @@ -239,7 +239,7 @@ if (setsockopt(conn->socket_fd, SOL_SOCKET, SO_BINDTODEVICE, session->netdev, strlen(session->netdev) + 1) < 0) { - log_error("Could not bind connection %d to %s\n", + log_error("Could not bind connection %d to %s", conn->id, session->netdev); return -1; } @@ -357,7 +357,7 @@ len = sizeof(int); if (getsockopt(conn->socket_fd, SOL_SOCKET, SO_ERROR, (char *) &rc, &len) < 0) { - log_error("getsockopt for connect poll failed\n"); + log_error("getsockopt for connect poll failed"); return -1; } if (rc) { @@ -366,7 +366,7 @@ conn->host, sizeof(conn->host), serv, sizeof(serv), NI_NUMERICHOST|NI_NUMERICSERV); - log_error("connect to %s:%s failed (%s)\n", + log_error("connect to %s:%s failed (%s)", conn->host, serv, strerror(rc)); return -rc; } @@ -391,9 +391,24 @@ void iscsi_io_tcp_disconnect(iscsi_conn_t *conn) { + struct linger so_linger = { .l_onoff = 1, .l_linger = 0 }; + if (conn->socket_fd >= 0) { log_debug(1, "disconnecting conn %p, fd %d", conn, conn->socket_fd); + + /* If the state is not IN_LOGOUT, this isn't a clean shutdown + * and there's some sort of error handling going on. In that + * case, set a 0 SO_LINGER to force an abortive close (RST) and + * free whatever is sitting in the TCP transmit queue. This is + * done to prevent stale data from being sent should the + * network connection be restored before TCP times out. + */ + if (conn->state != ISCSI_CONN_STATE_IN_LOGOUT) { + setsockopt(conn->socket_fd, SOL_SOCKET, SO_LINGER, + &so_linger, sizeof(so_linger)); + } + close(conn->socket_fd); conn->socket_fd = -1; } diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/iscsiadm.c open-iscsi-2.0.874/usr/iscsiadm.c --- open-iscsi-2.0.873+git0.3b4b4500/usr/iscsiadm.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/iscsiadm.c 2016-09-29 18:33:24.000000000 +0000 @@ -49,7 +49,7 @@ #include "idbm_fields.h" #include "session_mgmt.h" #include "iscsid_req.h" -#include "isns-proto.h" +#include #include "iscsi_err.h" #include "iscsi_ipc.h" #include "iscsi_timer.h" @@ -69,7 +69,8 @@ MODE_FW, MODE_PING, MODE_CHAP, - MODE_FLASHNODE + MODE_FLASHNODE, + MODE_HOST_STATS }; enum iscsiadm_op { @@ -115,7 +116,7 @@ {"packetsize", required_argument, NULL, 'b'}, {"count", required_argument, NULL, 'c'}, {"interval", required_argument, NULL, 'i'}, - {"flashnode_idx", optional_argument, NULL, 'x'}, + {"index", required_argument, NULL, 'x'}, {"portal_type", optional_argument, NULL, 'A'}, {NULL, 0, NULL, 0}, }; @@ -136,7 +137,7 @@ 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 | -H hostno|MAC ] [ [ -o operation ] [ -n name ] [ -v value ] ] [ -C ping [ -a ip ] [ -b packetsize ] [ -c count ] [ -i interval ] ]\n\ iscsiadm -m fw [ -d debug_level ] [ -l ]\n\ -iscsiadm -m host [ -P printlevel ] [ -H hostno|MAC ] [ [ -C chap [ -o operation ] [ -v chap_tbl_idx ] ] | [ -C flashnode [ -o operation ] [ -A portal_type ] [ -x flashnode_idx ] [ -n name ] [ -v value ] ] ]\n\ +iscsiadm -m host [ -P printlevel ] [ -H hostno|MAC ] [ [ -C chap [ -x chap_tbl_idx ] ] | [ -C flashnode [ -A portal_type ] [ -x flashnode_idx ] ] | [ -C stats ] ] [ [ -o operation ] [ -n name ] [ -v value ] ] \n\ iscsiadm -k priority\n"); } exit(status); @@ -207,6 +208,9 @@ sub_mode = MODE_CHAP; else if (!strcmp("flashnode", str)) sub_mode = MODE_FLASHNODE; + else if (!strcmp("stats", str)) + sub_mode = MODE_HOST_STATS; + else sub_mode = -1; @@ -274,7 +278,7 @@ if (rc) { iscsi_err_print_msg(rc); log_error("Could not stop iscsid. Trying sending iscsid " - "SIGTERM or SIGKILL signals manually\n"); + "SIGTERM or SIGKILL signals manually"); } } @@ -283,7 +287,7 @@ * And we can add a scsi_host mode which would display how * sessions are related to hosts * (scsi_host and iscsi_sessions are the currently running instance of - * a iface or node record). + * an iface or node record). */ static int print_ifaces(struct iface_rec *iface, int info_level) { @@ -299,7 +303,7 @@ if (iface) { err = iface_conf_read(iface); if (err) { - log_error("Could not read iface %s.\n", + log_error("Could not read iface %s.", iface->name); return err; } @@ -399,7 +403,7 @@ * this is due to a HW driver or some other driver * not hooked in */ - log_debug(7, "could not read data for [%s,%s.%d]\n", + log_debug(7, "could not read data for [%s,%s.%d]", info->targetname, info->persistent_address, info->persistent_port); return -1; @@ -570,7 +574,7 @@ * 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 + * prevents duplicate sessions if an iface has succeeded * for a particular target. */ } @@ -1191,7 +1195,7 @@ rc = iface_conf_read(iface); if (rc) { log_error("Could not read iface info for %s. " - "Make sure a iface config with the file " + "Make sure an iface config with the file " "name and iface.iscsi_ifacename %s is in %s.", iface->name, iface->name, IFACE_CONFIG_DIR); list_del(&iface->list); @@ -1236,7 +1240,7 @@ case DISCOVERY_TYPE_ISNS: return do_isns(drec, ifaces, info_level, do_login, op); default: - log_debug(1, "Unknown Discovery Type : %d\n", drec->type); + log_debug(1, "Unknown Discovery Type : %d", drec->type); return ISCSI_ERR_UNKNOWN_DISCOVERY_TYPE; } } @@ -1282,7 +1286,7 @@ int fd; log_debug(8, "Calling iscsid, to apply net config for" - "iface.name = %s\n", iface->name); + "iface.name = %s", iface->name); if (op == OP_APPLY_ALL) iface_all = 1; @@ -1426,18 +1430,192 @@ return rc; } -static int delete_host_chap_info(uint32_t host_no, char *value) +static int fill_host_chap_rec(struct list_head *params, + struct iscsi_chap_rec *crec, recinfo_t *cinfo, + uint16_t chap_tbl_idx, int type, int *param_count) +{ + struct user_param *param; + int rc = 0; + + crec->chap_tbl_idx = chap_tbl_idx; + crec->chap_type = type; + + idbm_recinfo_host_chap(crec, cinfo); + + list_for_each_entry(param, params, list) { + rc = idbm_rec_update_param(cinfo, param->name, param->value, 0); + if (rc) + break; + } + + if (!rc) + *param_count += 3; /* index, type and password_length */ + + return rc; +} + +static int verify_host_chap_params(struct list_head *params, int *type, + int *param_count) +{ + struct user_param *param; + int username = -1; + int password = -1; + int rc = 0; + + list_for_each_entry(param, params, list) { + *param_count += 1; + + if (!strcmp(param->name, HOST_AUTH_USERNAME)) + username = CHAP_TYPE_OUT; + else if (!strcmp(param->name, HOST_AUTH_PASSWORD)) + password = CHAP_TYPE_OUT; + else if (!strcmp(param->name, HOST_AUTH_USERNAME_IN)) + username = CHAP_TYPE_IN; + else if (!strcmp(param->name, HOST_AUTH_PASSWORD_IN)) + password = CHAP_TYPE_IN; + else + continue; + } + + if ((username == CHAP_TYPE_OUT) && (password == CHAP_TYPE_OUT)) { + if (type) + *type = CHAP_TYPE_OUT; + + rc = ISCSI_SUCCESS; + } else if ((username == CHAP_TYPE_IN) && (password == CHAP_TYPE_IN)) { + if (type) + *type = CHAP_TYPE_IN; + + rc = ISCSI_SUCCESS; + } else { + rc = ISCSI_ERR; + } + + return rc; +} + +static int set_host_chap_info(uint32_t host_no, uint64_t chap_index, + struct list_head *params) { struct iscsi_transport *t = NULL; - int fd, rc = 0; - uint16_t chap_tbl_idx; + struct iscsi_chap_rec crec; + recinfo_t *chap_info = NULL; + struct iovec *iovs = NULL; + struct iovec *iov = NULL; + int type; + int param_count = 0; + int param_used; + int rc = 0; + int fd, i = 0; - if (!value) { - log_error("CHAP deletion requires --value=table_index."); - return ISCSI_ERR_INVAL; + if (list_empty(params)) { + log_error("Chap username/password not provided."); + goto exit_set_chap; + } + + chap_info = idbm_recinfo_alloc(MAX_KEYS); + if (!chap_info) { + log_error("Out of Memory."); + rc = ISCSI_ERR_NOMEM; + goto exit_set_chap; + } + + t = iscsi_sysfs_get_transport_by_hba(host_no); + if (!t) { + log_error("Could not match hostno %d to transport.", host_no); + rc = ISCSI_ERR_TRANS_NOT_FOUND; + goto free_info_rec; + } + + rc = verify_host_chap_params(params, &type, ¶m_count); + if (rc) { + log_error("Invalid username/password pair passed. Unable to determine the type of chap entry"); + rc = ISCSI_ERR_INVAL; + goto free_info_rec; + } + + if (param_count > 2) { + log_error("Only one pair of username/password can be passed."); + rc = ISCSI_ERR; + goto free_info_rec; + } + + memset(&crec, 0, sizeof(crec)); + rc = fill_host_chap_rec(params, &crec, chap_info, chap_index, type, + ¶m_count); + if (rc) { + log_error("Unable to fill CHAP record"); + goto free_info_rec; + } + + /* +2 for event and nlmsghdr */ + param_count += 2; + iovs = calloc((param_count * sizeof(struct iovec)), + sizeof(char)); + if (!iovs) { + log_error("Out of Memory."); + rc = ISCSI_ERR_NOMEM; + goto free_info_rec; + } + + /* param_used gives actual number of iovecs used for chap */ + param_used = chap_build_config(&crec, iovs); + if (!param_used) { + log_error("Build chap config failed."); + rc = ISCSI_ERR; + goto free_iovec; + } + + fd = ipc->ctldev_open(); + if (fd < 0) { + rc = ISCSI_ERR_INTERNAL; + log_error("Netlink open failed."); + goto free_iovec; + } + + rc = ipc->set_chap(t->handle, host_no, iovs, param_count); + if (rc < 0) { + log_error("CHAP setting failed"); + if (rc == -EBUSY) { + rc = ISCSI_ERR_BUSY; + log_error("CHAP index %d is in use.", + crec.chap_tbl_idx); + } else { + rc = ISCSI_ERR; + } + + goto exit_set_chap; } - chap_tbl_idx = (uint16_t)atoi(value); + ipc->ctldev_close(); + +free_iovec: + /* 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); + +free_info_rec: + if (chap_info) + free(chap_info); + +exit_set_chap: + return rc; +} + +static int delete_host_chap_info(uint32_t host_no, uint16_t chap_tbl_idx) +{ + struct iscsi_transport *t = NULL; + int fd, rc = 0; + + if (chap_tbl_idx > MAX_CHAP_ENTRIES) { + log_error("Invalid chap table index."); + goto exit_delete_chap; + } t = iscsi_sysfs_get_transport_by_hba(host_no); if (!t) { @@ -1454,7 +1632,7 @@ goto exit_delete_chap; } - log_info("Deleteing CHAP index: %d\n", chap_tbl_idx); + log_info("Deleting CHAP index: %d", chap_tbl_idx); rc = ipc->delete_chap(t->handle, host_no, chap_tbl_idx); if (rc < 0) { log_error("CHAP Delete failed."); @@ -1472,7 +1650,7 @@ } static int exec_host_chap_op(int op, int info_level, uint32_t host_no, - char *value) + uint64_t chap_index, struct list_head *params) { int rc = ISCSI_ERR_INVAL; @@ -1480,8 +1658,12 @@ case OP_SHOW: rc = get_host_chap_info(host_no); break; + case OP_NEW: + case OP_UPDATE: + rc = set_host_chap_info(host_no, chap_index, params); + break; case OP_DELETE: - rc = delete_host_chap_info(host_no, value); + rc = delete_host_chap_info(host_no, chap_index); break; default: log_error("Invalid operation."); @@ -1716,11 +1898,34 @@ return rc; } +static int iscsi_check_session_use_count(uint32_t sid) { + char *config_file; + char *safe_logout; + + config_file = get_config_file(); + if (!config_file) { + log_error("Could not get config file from iscsid"); + return 0; + } + + safe_logout = cfg_get_string_param(config_file, "iscsid.safe_logout"); + if (!safe_logout || strcmp(safe_logout, "Yes")) + return 0; + + return session_in_use(sid); +} + int iscsi_logout_flashnode_sid(struct iscsi_transport *t, uint32_t host_no, uint32_t sid) { int fd, rc = 0; + if (iscsi_check_session_use_count(sid)) { + log_error("Session is actively in use for mounted storage, " + "and iscsid.safe_logout is configured."); + return ISCSI_ERR_BUSY; + } + fd = ipc->ctldev_open(); if (fd < 0) { log_error("Netlink open failed."); @@ -1847,6 +2052,232 @@ return rc; } +static void print_host_stats(struct iscsi_offload_host_stats *host_stats) +{ + /* MAC */ + printf("Host Statistics:\n" + "\tmactx_frames: %lld\n" + "\tmactx_bytes: %lld\n" + "\tmactx_multicast_frames: %lld\n" + "\tmactx_broadcast_frames: %lld\n" + "\tmactx_pause_frames: %lld\n" + "\tmactx_control_frames: %lld\n" + "\tmactx_deferral: %lld\n" + "\tmactx_excess_deferral: %lld\n" + "\tmactx_late_collision: %lld\n" + "\tmactx_abort: %lld\n" + "\tmactx_single_collision: %lld\n" + "\tmactx_multiple_collision: %lld\n" + "\tmactx_collision: %lld\n" + "\tmactx_frames_dropped: %lld\n" + "\tmactx_jumbo_frames: %lld\n" + "\tmacrx_frames: %lld\n" + "\tmacrx_bytes: %lld\n" + "\tmacrx_unknown_control_frames: %lld\n" + "\tmacrx_pause_frames: %lld\n" + "\tmacrx_control_frames: %lld\n" + "\tmacrx_dribble: %lld\n" + "\tmacrx_frame_length_error: %lld\n" + "\tmacrx_jabber: %lld\n" + "\tmacrx_carrier_sense_error: %lld\n" + "\tmacrx_frame_discarded: %lld\n" + "\tmacrx_frames_dropped: %lld\n" + "\tmac_crc_error: %lld\n" + "\tmac_encoding_error: %lld\n" + "\tmacrx_length_error_large: %lld\n" + "\tmacrx_length_error_small: %lld\n" + "\tmacrx_multicast_frames: %lld\n" + "\tmacrx_broadcast_frames: %lld\n" + /* IP */ + "\tiptx_packets: %lld\n" + "\tiptx_bytes: %lld\n" + "\tiptx_fragments: %lld\n" + "\tiprx_packets: %lld\n" + "\tiprx_bytes: %lld\n" + "\tiprx_fragments: %lld\n" + "\tip_datagram_reassembly: %lld\n" + "\tip_invalid_address_error: %lld\n" + "\tip_error_packets: %lld\n" + "\tip_fragrx_overlap: %lld\n" + "\tip_fragrx_outoforder: %lld\n" + "\tip_datagram_reassembly_timeout: %lld\n" + "\tipv6tx_packets: %lld\n" + "\tipv6tx_bytes: %lld\n" + "\tipv6tx_fragments: %lld\n" + "\tipv6rx_packets: %lld\n" + "\tipv6rx_bytes: %lld\n" + "\tipv6rx_fragments: %lld\n" + "\tipv6_datagram_reassembly: %lld\n" + "\tipv6_invalid_address_error: %lld\n" + "\tipv6_error_packets: %lld\n" + "\tipv6_fragrx_overlap: %lld\n" + "\tipv6_fragrx_outoforder: %lld\n" + "\tipv6_datagram_reassembly_timeout: %lld\n" + /* TCP */ + "\ttcptx_segments: %lld\n" + "\ttcptx_bytes: %lld\n" + "\ttcprx_segments: %lld\n" + "\ttcprx_byte: %lld\n" + "\ttcp_duplicate_ack_retx: %lld\n" + "\ttcp_retx_timer_expired: %lld\n" + "\ttcprx_duplicate_ack: %lld\n" + "\ttcprx_pure_ackr: %lld\n" + "\ttcptx_delayed_ack: %lld\n" + "\ttcptx_pure_ack: %lld\n" + "\ttcprx_segment_error: %lld\n" + "\ttcprx_segment_outoforder: %lld\n" + "\ttcprx_window_probe: %lld\n" + "\ttcprx_window_update: %lld\n" + "\ttcptx_window_probe_persist: %lld\n" + /* ECC */ + "\tecc_error_correction: %lld\n" + /* iSCSI */ + "\tiscsi_pdu_tx: %lld\n" + "\tiscsi_data_bytes_tx: %lld\n" + "\tiscsi_pdu_rx: %lld\n" + "\tiscsi_data_bytes_rx: %lld\n" + "\tiscsi_io_completed: %lld\n" + "\tiscsi_unexpected_io_rx: %lld\n" + "\tiscsi_format_error: %lld\n" + "\tiscsi_hdr_digest_error: %lld\n" + "\tiscsi_data_digest_error: %lld\n" + "\tiscsi_sequence_error: %lld\n", + /* MAC */ + (unsigned long long)host_stats->mactx_frames, + (unsigned long long)host_stats->mactx_bytes, + (unsigned long long)host_stats->mactx_multicast_frames, + (unsigned long long)host_stats->mactx_broadcast_frames, + (unsigned long long)host_stats->mactx_pause_frames, + (unsigned long long)host_stats->mactx_control_frames, + (unsigned long long)host_stats->mactx_deferral, + (unsigned long long)host_stats->mactx_excess_deferral, + (unsigned long long)host_stats->mactx_late_collision, + (unsigned long long)host_stats->mactx_abort, + (unsigned long long)host_stats->mactx_single_collision, + (unsigned long long)host_stats->mactx_multiple_collision, + (unsigned long long)host_stats->mactx_collision, + (unsigned long long)host_stats->mactx_frames_dropped, + (unsigned long long)host_stats->mactx_jumbo_frames, + (unsigned long long)host_stats->macrx_frames, + (unsigned long long)host_stats->macrx_bytes, + (unsigned long long)host_stats->macrx_unknown_control_frames, + (unsigned long long)host_stats->macrx_pause_frames, + (unsigned long long)host_stats->macrx_control_frames, + (unsigned long long)host_stats->macrx_dribble, + (unsigned long long)host_stats->macrx_frame_length_error, + (unsigned long long)host_stats->macrx_jabber, + (unsigned long long)host_stats->macrx_carrier_sense_error, + (unsigned long long)host_stats->macrx_frame_discarded, + (unsigned long long)host_stats->macrx_frames_dropped, + (unsigned long long)host_stats->mac_crc_error, + (unsigned long long)host_stats->mac_encoding_error, + (unsigned long long)host_stats->macrx_length_error_large, + (unsigned long long)host_stats->macrx_length_error_small, + (unsigned long long)host_stats->macrx_multicast_frames, + (unsigned long long)host_stats->macrx_broadcast_frames, + /* IP */ + (unsigned long long)host_stats->iptx_packets, + (unsigned long long)host_stats->iptx_bytes, + (unsigned long long)host_stats->iptx_fragments, + (unsigned long long)host_stats->iprx_packets, + (unsigned long long)host_stats->iprx_bytes, + (unsigned long long)host_stats->iprx_fragments, + (unsigned long long)host_stats->ip_datagram_reassembly, + (unsigned long long)host_stats->ip_invalid_address_error, + (unsigned long long)host_stats->ip_error_packets, + (unsigned long long)host_stats->ip_fragrx_overlap, + (unsigned long long)host_stats->ip_fragrx_outoforder, + (unsigned long long)host_stats->ip_datagram_reassembly_timeout, + (unsigned long long)host_stats->ipv6tx_packets, + (unsigned long long)host_stats->ipv6tx_bytes, + (unsigned long long)host_stats->ipv6tx_fragments, + (unsigned long long)host_stats->ipv6rx_packets, + (unsigned long long)host_stats->ipv6rx_bytes, + (unsigned long long)host_stats->ipv6rx_fragments, + (unsigned long long)host_stats->ipv6_datagram_reassembly, + (unsigned long long)host_stats->ipv6_invalid_address_error, + (unsigned long long)host_stats->ipv6_error_packets, + (unsigned long long)host_stats->ipv6_fragrx_overlap, + (unsigned long long)host_stats->ipv6_fragrx_outoforder, + (unsigned long long)host_stats->ipv6_datagram_reassembly_timeout, + /* TCP */ + (unsigned long long)host_stats->tcptx_segments, + (unsigned long long)host_stats->tcptx_bytes, + (unsigned long long)host_stats->tcprx_segments, + (unsigned long long)host_stats->tcprx_byte, + (unsigned long long)host_stats->tcp_duplicate_ack_retx, + (unsigned long long)host_stats->tcp_retx_timer_expired, + (unsigned long long)host_stats->tcprx_duplicate_ack, + (unsigned long long)host_stats->tcprx_pure_ackr, + (unsigned long long)host_stats->tcptx_delayed_ack, + (unsigned long long)host_stats->tcptx_pure_ack, + (unsigned long long)host_stats->tcprx_segment_error, + (unsigned long long)host_stats->tcprx_segment_outoforder, + (unsigned long long)host_stats->tcprx_window_probe, + (unsigned long long)host_stats->tcprx_window_update, + (unsigned long long)host_stats->tcptx_window_probe_persist, + /* ECC */ + (unsigned long long)host_stats->ecc_error_correction, + /* iSCSI */ + (unsigned long long)host_stats->iscsi_pdu_tx, + (unsigned long long)host_stats->iscsi_data_bytes_tx, + (unsigned long long)host_stats->iscsi_pdu_rx, + (unsigned long long)host_stats->iscsi_data_bytes_rx, + (unsigned long long)host_stats->iscsi_io_completed, + (unsigned long long)host_stats->iscsi_unexpected_io_rx, + (unsigned long long)host_stats->iscsi_format_error, + (unsigned long long)host_stats->iscsi_hdr_digest_error, + (unsigned long long)host_stats->iscsi_data_digest_error, + (unsigned long long)host_stats->iscsi_sequence_error); +} + +static int exec_host_stats_op(int op, int info_level, uint32_t host_no) +{ + struct iscsi_transport *t = NULL; + char *req_buf = NULL; + int rc = ISCSI_SUCCESS; + int fd = 0, buf_size = 0; + + t = iscsi_sysfs_get_transport_by_hba(host_no); + if (!t) { + log_error("Could not match hostno %u to transport.", host_no); + rc = ISCSI_ERR_TRANS_NOT_FOUND; + goto exit_host_stats; + } + + buf_size = sizeof(struct iscsi_offload_host_stats) + + sizeof(struct iscsi_uevent); + req_buf = calloc(1, buf_size); + if (!req_buf) { + log_error("Could not allocate memory for host stats request."); + rc = ISCSI_ERR_NOMEM; + goto exit_host_stats; + } + + fd = ipc->ctldev_open(); + if (fd < 0) { + rc = ISCSI_ERR_INTERNAL; + log_error("Netlink open failed."); + goto exit_host_stats; + } + + rc = ipc->get_host_stats(t->handle, host_no, req_buf); + if (rc < 0) { + log_error("get_host_stats failed. errno=%d", errno); + rc = ISCSI_ERR; + goto exit_host_stats; + } + + print_host_stats((struct iscsi_offload_host_stats *)(req_buf + + sizeof(struct iscsi_uevent))); + + ipc->ctldev_close(); + +exit_host_stats: + free(req_buf); + return rc; +} + static int verify_iface_params(struct list_head *params, struct node_rec *rec) { struct user_param *param; @@ -2214,7 +2645,7 @@ rc = iface_conf_read(iface); if (rc) { log_error("Could not read iface info for %s. " - "Make sure a iface config with the " + "Make sure an iface config with the " "file name and iface.iscsi_ifacename " "%s is in %s.", iface->name, iface->name, IFACE_CONFIG_DIR); @@ -2228,7 +2659,7 @@ /* * Next, check if we see any offload cards. If we do then - * we make a iface if needed. + * we make an iface if needed. * * Note1: if there is not a offload card we do not setup * software iscsi binding with the nic used for booting, @@ -2241,7 +2672,7 @@ rc = fw_get_targets(&targets); if (rc) { log_error("Could not get list of targets from firmware. " - "(err %d)\n", rc); + "(err %d)", rc); return rc; } rc = iface_create_ifaces_from_boot_contexts(&new_ifaces, &targets); @@ -2254,7 +2685,7 @@ rc = idbm_bind_ifaces_to_nodes(discovery_fw, drec, ifaces, &rec_list); if (rc) - log_error("Could not perform fw discovery.\n"); + log_error("Could not perform fw discovery."); else rc = exec_disc_op_on_recs(drec, &rec_list, info_level, do_login, op); @@ -2292,7 +2723,7 @@ rc = fw_get_targets(&targets); if (rc) { log_error("Could not get list of targets from firmware. " - "(err %d)\n", rc); + "(err %d)", rc); return rc; } @@ -2301,7 +2732,7 @@ rec = idbm_create_rec_from_boot_context(context); if (!rec) { log_error("Could not convert firmware info to " - "node record.\n"); + "node record."); rc = ISCSI_ERR_NOMEM; break; } @@ -2694,7 +3125,7 @@ static char *iscsi_ping_stat_to_str(uint32_t status) { if (status < 0 || status > ISCSI_PING_NO_ARP_RECEIVED) { - log_error("Invalid ping status %u\n", status); + log_error("Invalid ping status %u", status); return NULL; } @@ -2709,6 +3140,7 @@ struct iscsi_transport *t = NULL; uint32_t host_no, status = 0; struct sockaddr_storage addr; + struct host_info hinfo; int i; if (!iface) { @@ -2777,13 +3209,32 @@ for (i = 1; i <= count; i++) { /* * To support drivers like bnx2i that do not use - * the iscsi if to send a ping, we can add a transport + * the iscsi iface to send a ping, we invoke transport * callout here. */ status = 0; - rc = ipc->exec_ping(t->handle, host_no, - (struct sockaddr *)&addr, iface->iface_num, - iface_type, size, &status); + if (t->template->exec_ping) { + if (!strlen(iface->netdev)) { + memset(&hinfo, 0, sizeof(hinfo)); + hinfo.host_no = host_no; + iscsi_sysfs_get_hostinfo_by_host_no(&hinfo); + strcpy(iface->netdev, hinfo.iface.netdev); + } + + rc = iscsi_set_net_config(t, NULL, iface); + if (rc && (rc != ISCSI_ERR_AGAIN)) + goto ping_err; + + rc = t->template->exec_ping(t, iface, size, &addr, + &status); + } else { + rc = ipc->exec_ping(t->handle, host_no, + (struct sockaddr *)&addr, + iface->iface_num, iface_type, + (uint32_t)size, &status); + } + +ping_err: if (!rc && !status) printf("Ping %d completed\n", i); else if (status) @@ -2818,7 +3269,7 @@ struct iface_rec *iface = NULL, *tmp; struct node_rec *rec = NULL; uint64_t host_no = (uint64_t)MAX_HOST_NO + 1; - uint64_t flashnode_idx = (uint64_t)MAX_FLASHNODE_IDX + 1; + uint64_t index = ULLONG_MAX; struct user_param *param; struct list_head params; @@ -2962,9 +3413,9 @@ ISCSI_VERSION_STR); return 0; case 'x': - flashnode_idx = strtoull(optarg, NULL, 10); + index = strtoull(optarg, NULL, 10); if (errno) { - log_error("Invalid flashnode index %s. %s.", + log_error("Invalid index %s. %s.", optarg, strerror(errno)); rc = ISCSI_ERR_INVAL; goto free_ifaces; @@ -3040,8 +3491,12 @@ rc = ISCSI_ERR_INVAL; break; } + + if (index == ULLONG_MAX) + index = (uint64_t)MAX_CHAP_ENTRIES + 1; + rc = exec_host_chap_op(op, info_level, host_no, - value); + index, ¶ms); break; case MODE_FLASHNODE: if (host_no > MAX_HOST_NO) { @@ -3050,10 +3505,24 @@ break; } + if (index == ULLONG_MAX) + index = (uint64_t)MAX_FLASHNODE_IDX + 1; + rc = exec_flashnode_op(op, info_level, host_no, - flashnode_idx, - portal_type, ¶ms); + index, portal_type, + ¶ms); break; + case MODE_HOST_STATS: + if (host_no > MAX_HOST_NO) { + log_error("STATS mode requires host no"); + rc = ISCSI_ERR_INVAL; + break; + } + + rc = exec_host_stats_op(op, info_level, + host_no); + break; + default: log_error("Invalid Sub Mode"); break; diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/iscsid.c open-iscsi-2.0.874/usr/iscsid.c --- open-iscsi-2.0.873+git0.3b4b4500/usr/iscsid.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/iscsid.c 2016-09-29 18:33:24.000000000 +0000 @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -192,7 +193,7 @@ struct iscsi_transport *t; int rc, retries = 0; - log_debug(7, "sync session [%d][%s,%s.%d][%s]\n", info->sid, + log_debug(7, "sync session [%d][%s,%s.%d][%s]", info->sid, info->targetname, info->persistent_address, info->port, info->iface.hwaddress); @@ -234,7 +235,7 @@ info->persistent_address, info->persistent_port, &info->iface)) { log_warning("Could not read data from db. Using default and " - "currently negotiated values\n"); + "currently negotiated values"); setup_rec_from_negotiated_values(&rec, info); iface_copy(&rec.iface, &info->iface); } else { @@ -323,7 +324,7 @@ static void missing_iname_warn(char *initiatorname_file) { log_error("Warning: InitiatorName file %s does not exist or does not " - "contain a properly formated InitiatorName. If using " + "contain a properly formatted InitiatorName. If using " "software iscsi (iscsi_tcp or ib_iser) or partial offload " "(bnx2i or cxgbi iscsi), you may not be able to log " "into or discover targets. Please create a file %s that " @@ -331,7 +332,7 @@ "iqn.yyyy-mm.[:identifier].\n\n" "Example: InitiatorName=iqn.2001-04.com.redhat:fc6.\n" "If using hardware iscsi like qla4xxx this message can be " - "ignored.\n", initiatorname_file, initiatorname_file); + "ignored.", initiatorname_file, initiatorname_file); } int main(int argc, char *argv[]) @@ -340,6 +341,7 @@ char *config_file = CONFIG_FILE; char *initiatorname_file = INITIATOR_NAME_FILE; char *pid_file = PID_FILE; + char *safe_logout; int ch, longindex; uid_t uid = 0; struct sigaction sa_old; @@ -475,11 +477,25 @@ } } - if (uid && setuid(uid) < 0) - perror("setuid\n"); + if (gid && setgid(gid) < 0) { + log_error("Unable to setgid to %d", gid); + log_close(log_pid); + exit(ISCSI_ERR); + } + + if ((geteuid() == 0) && (getgroups(0, NULL))) { + if (setgroups(0, NULL) != 0) { + log_error("Unable to drop supplementary group ids"); + log_close(log_pid); + exit(ISCSI_ERR); + } + } - if (gid && setgid(gid) < 0) - perror("setgid\n"); + if (uid && setuid(uid) < 0) { + log_error("Unable to setuid to %d", uid); + log_close(log_pid); + exit(ISCSI_ERR); + } memset(&daemon_config, 0, sizeof (daemon_config)); daemon_config.pid_file = pid_file; @@ -505,6 +521,11 @@ daemon_config.initiator_name : "NOT SET"); log_debug(1, "InitiatorAlias=%s", daemon_config.initiator_alias); + safe_logout = cfg_get_string_param(config_file, "iscsid.safe_logout"); + if (safe_logout && !strcmp(safe_logout, "Yes")) + daemon_config.safe_logout = 1; + free(safe_logout); + pid = fork(); if (pid == 0) { int nr_found = 0; @@ -533,7 +554,6 @@ exit(ISCSI_ERR); } - actor_init(); event_loop(ipc, control_fd, mgmt_ipc_fd); idbm_terminate(); diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/iscsid.h open-iscsi-2.0.874/usr/iscsid.h --- open-iscsi-2.0.873+git0.3b4b4500/usr/iscsid.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/iscsid.h 2016-09-29 18:33:24.000000000 +0000 @@ -29,6 +29,7 @@ char *pid_file; char *initiator_name; char *initiator_alias; + int safe_logout; }; extern struct iscsi_daemon_config *dconfig; diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/iscsid_req.c open-iscsi-2.0.874/usr/iscsid_req.c --- open-iscsi-2.0.873+git0.3b4b4500/usr/iscsid_req.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/iscsid_req.c 2016-09-29 18:33:24.000000000 +0000 @@ -67,12 +67,7 @@ return ISCSI_ERR_ISCSID_NOTCONN; } - addr_len = offsetof(struct sockaddr_un, sun_path) + strlen(unix_sock_name) + 1; - - memset(&addr, 0, sizeof(addr)); - addr.sun_family = AF_LOCAL; - memcpy((char *) &addr.sun_path + 1, unix_sock_name, - strlen(unix_sock_name)); + addr_len = setup_abstract_addr(&addr, unix_sock_name); /* * Trying to connect with exponential backoff @@ -208,7 +203,7 @@ return ipc_connect(fd, ISCSID_UIP_NAMESPACE, 0); } -int uip_broadcast(void *buf, size_t buf_len) +int uip_broadcast(void *buf, size_t buf_len, int fd_flags, uint32_t *status) { int err; int fd; @@ -240,7 +235,11 @@ flags = fcntl(fd, F_GETFL, 0); if (flags == -1) flags = 0; - err = fcntl(fd, F_SETFL, flags | O_NONBLOCK); + + if (fd_flags) + flags |= fd_flags; + + err = fcntl(fd, F_SETFL, flags); if (err) { log_error("could not set uip broadcast to non-blocking: %d", errno); @@ -248,18 +247,18 @@ return ISCSI_ERR; } -#define MAX_UIP_BROADCAST_READ_TRIES 3 +#define MAX_UIP_BROADCAST_READ_TRIES 5 for (count = 0; count < MAX_UIP_BROADCAST_READ_TRIES; count++) { /* Wait for the response */ err = read(fd, &rsp, sizeof(rsp)); if (err == sizeof(rsp)) { log_debug(3, "Broadcasted to uIP with length: %ld " - "cmd: 0x%x rsp: 0x%x\n", buf_len, + "cmd: 0x%x rsp: 0x%x", buf_len, rsp.command, rsp.err); err = 0; break; } else if ((err == -1) && (errno == EAGAIN)) { - usleep(250000); + usleep(1000000); continue; } else { log_error("Could not read response (%d/%d), daemon " @@ -273,11 +272,34 @@ log_error("Could not broadcast to uIP after %d tries", count); err = ISCSI_ERR_AGAIN; - } else if (rsp.err != ISCSID_UIP_MGMT_IPC_DEVICE_UP) { - log_debug(3, "Device is not ready\n"); - err = ISCSI_ERR_AGAIN; } + if (err) + goto done; + + switch (rsp.command) { + case ISCSID_UIP_IPC_GET_IFACE: + if (rsp.err != ISCSID_UIP_MGMT_IPC_DEVICE_UP) { + log_debug(3, "Device is not ready\n"); + err = ISCSI_ERR_AGAIN; + } + + break; + case ISCSID_UIP_IPC_PING: + *status = rsp.ping_sc; + if (rsp.err == ISCSID_UIP_MGMT_IPC_DEVICE_INITIALIZING) { + log_debug(3, "Device is not ready\n"); + err = ISCSI_ERR_AGAIN; + } else if (*status) { + err = ISCSI_ERR; + } + + break; + default: + err = ISCSI_ERR; + } + +done: close(fd); return err; } diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/iscsid_req.h open-iscsi-2.0.874/usr/iscsid_req.h --- open-iscsi-2.0.873+git0.3b4b4500/usr/iscsid_req.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/iscsid_req.h 2016-09-29 18:33:24.000000000 +0000 @@ -33,6 +33,7 @@ extern int iscsid_req_by_sid_async(int cmd, int sid, int *fd); extern int iscsid_req_by_sid(int cmd, int sid); -extern int uip_broadcast(void *buf, size_t buf_len); +extern int uip_broadcast(void *buf, size_t buf_len, int fd_flags, + uint32_t *status); #endif diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/iscsi_err.c open-iscsi-2.0.874/usr/iscsi_err.c --- open-iscsi-2.0.873+git0.3b4b4500/usr/iscsi_err.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/iscsi_err.c 2016-09-29 18:33:24.000000000 +0000 @@ -51,6 +51,9 @@ /* 26 */ "iSNS registration failed", /* 27 */ "operation not supported", /* 28 */ "device or resource in use", + /* 29 */ "operation failed but retry may succeed", + /* 30 */ "unknown discovery type", + /* 31 */ "child process terminated", }; char *iscsi_err_to_str(int err) diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/iscsi_ipc.h open-iscsi-2.0.874/usr/iscsi_ipc.h --- open-iscsi-2.0.873+git0.3b4b4500/usr/iscsi_ipc.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/iscsi_ipc.h 2016-09-29 18:33:24.000000000 +0000 @@ -30,6 +30,7 @@ enum { ISCSI_INT, + ISCSI_UINT, ISCSI_STRING, }; @@ -143,6 +144,9 @@ uint16_t chap_tbl_idx, uint32_t num_entries, char *chap_buf, uint32_t *valid_chap_entries); + int (*set_chap) (uint64_t transport_handle, uint32_t host_no, + struct iovec *iovs, uint32_t param_count); + int (*delete_chap) (uint64_t transport_handle, uint32_t host_no, uint16_t chap_tbl_idx); int (*set_flash_node_params) (uint64_t transport_handle, @@ -158,6 +162,8 @@ uint32_t flashnode_idx); int (*logout_flash_node_sid) (uint64_t transport_handle, uint32_t host_no, uint32_t sid); + int (*get_host_stats) (uint64_t transport_handle, uint32_t host_no, + char *host_stats); }; #endif /* ISCSI_IPC_H */ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/iscsi_net_util.c open-iscsi-2.0.874/usr/iscsi_net_util.c --- open-iscsi-2.0.873+git0.3b4b4500/usr/iscsi_net_util.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/iscsi_net_util.c 2016-09-29 18:33:24.000000000 +0000 @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -27,6 +28,9 @@ #include #include #include +#include +#include +#include #include "sysdeps.h" #include "ethtool-copy.h" @@ -162,6 +166,45 @@ return 0; } +static char *find_vlan_dev(char *netdev, int vlan_id) { + struct ifreq if_hwaddr; + struct ifreq vlan_hwaddr; + struct vlan_ioctl_args vlanrq = { .cmd = GET_VLAN_VID_CMD, }; + struct if_nameindex *ifni; + char *vlan = NULL; + int sockfd, i, rc; + + sockfd = socket(AF_INET, SOCK_DGRAM, 0); + + strncpy(if_hwaddr.ifr_name, netdev, IFNAMSIZ); + ioctl(sockfd, SIOCGIFHWADDR, &if_hwaddr); + + if (if_hwaddr.ifr_hwaddr.sa_family != ARPHRD_ETHER) + return NULL; + + ifni = if_nameindex(); + for (i = 0; ifni[i].if_index && ifni[i].if_name; i++) { + strncpy(vlan_hwaddr.ifr_name, ifni[i].if_name, IFNAMSIZ); + ioctl(sockfd, SIOCGIFHWADDR, &vlan_hwaddr); + + if (vlan_hwaddr.ifr_hwaddr.sa_family != ARPHRD_ETHER) + continue; + + if (!memcmp(if_hwaddr.ifr_hwaddr.sa_data, vlan_hwaddr.ifr_hwaddr.sa_data, ETH_ALEN)) { + strncpy(vlanrq.device1, ifni[i].if_name, IFNAMSIZ); + rc = ioctl(sockfd, SIOCGIFVLAN, &vlanrq); + if ((rc == 0) && (vlanrq.u.VID == vlan_id)) { + vlan = strdup(vlanrq.device1); + break; + } + } + } + if_freenameindex(ifni); + + close(sockfd); + return vlan; +} + /** * net_setup_netdev - bring up NIC * @netdev: network device name @@ -175,7 +218,7 @@ * to force iSCSI traffic through correct NIC. */ int net_setup_netdev(char *netdev, char *local_ip, char *mask, char *gateway, - char *remote_ip, int needs_bringup) + char *vlan, char *remote_ip, int needs_bringup) { struct sockaddr_in sk_ipaddr = { .sin_family = AF_INET }; struct sockaddr_in sk_netmask = { .sin_family = AF_INET }; @@ -184,14 +227,29 @@ struct sockaddr_in sk_tgt_ipaddr = { .sin_family = AF_INET }; struct rtentry rt; struct ifreq ifr; + char *physdev = NULL; int sock; int ret; + int vlan_id; if (!strlen(netdev)) { - log_error("No netdev name in fw entry.\n"); + log_error("No netdev name in fw entry."); return EINVAL; } + vlan_id = atoi(vlan); + + if (vlan_id != 0) { + physdev = netdev; + netdev = find_vlan_dev(physdev, vlan_id); + } + + if (vlan_id && !netdev) { + /* TODO: create vlan if not found */ + log_error("No matching vlan found for fw entry."); + return EINVAL; + } + /* Create socket for making networking changes */ if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) == -1) { log_error("Could not open socket to manage network " @@ -203,13 +261,13 @@ * has already been handled (2 targets in IBFT may share one NIC) */ if (!inet_aton(local_ip, &sk_ipaddr.sin_addr)) { - log_error("Invalid or missing ipaddr in fw entry\n"); + log_error("Invalid or missing ipaddr in fw entry"); ret = EINVAL; goto done; } if (!inet_aton(mask, &sk_netmask.sin_addr)) { - log_error("Invalid or missing netmask in fw entry\n"); + log_error("Invalid or missing netmask in fw entry"); ret = EINVAL; goto done; } @@ -217,14 +275,26 @@ inet_aton("255.255.255.255", &sk_hostmask.sin_addr); if (!inet_aton(remote_ip, &sk_tgt_ipaddr.sin_addr)) { - log_error("Invalid or missing target ipaddr in fw entry\n"); + log_error("Invalid or missing target ipaddr in fw entry"); ret = EINVAL; goto done; } /* Only set IP/NM if this is a new interface */ if (needs_bringup) { - /* TODO: create vlan if strlen(vlan) */ + + if (physdev) { + /* Bring up interface */ + memset(&ifr, 0, sizeof(ifr)); + strlcpy(ifr.ifr_name, physdev, IFNAMSIZ); + ifr.ifr_flags = IFF_UP | IFF_RUNNING; + if (ioctl(sock, SIOCSIFFLAGS, &ifr) < 0) { + log_error("Could not bring up netdev %s (err %d - %s)", + physdev, errno, strerror(errno)); + ret = errno; + goto done; + } + } /* Bring up interface */ memset(&ifr, 0, sizeof(ifr)); @@ -246,7 +316,7 @@ ret = errno; goto done; } - + /* Set netmask */ memset(&ifr, 0, sizeof(ifr)); strlcpy(ifr.ifr_name, netdev, IFNAMSIZ); @@ -303,6 +373,8 @@ done: close(sock); + if (vlan_id) + free(netdev); return ret; } @@ -317,7 +389,7 @@ int ret = 0; if (!strlen(netdev)) { - log_error("No netdev name in fw entry.\n"); + log_error("No netdev name in fw entry."); return EINVAL; } @@ -338,11 +410,11 @@ } if (ifr.ifr_flags & IFF_UP) { - log_debug(3, "%s up\n", netdev); + log_debug(3, "%s up", netdev); goto done; } - log_debug(3, "bringing %s up\n", netdev); + log_debug(3, "bringing %s up", netdev); /* Bring up interface */ memset(&ifr, 0, sizeof(ifr)); diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/iscsistart.c open-iscsi-2.0.874/usr/iscsistart.c --- open-iscsi-2.0.873+git0.3b4b4500/usr/iscsistart.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/iscsistart.c 2016-09-29 18:33:24.000000000 +0000 @@ -97,7 +97,7 @@ -i, --initiatorname=name set InitiatorName to name (Required)\n\ -t, --targetname=name set TargetName to name (Required)\n\ -g, --tgpt=N set target portal group tag to N (Required)\n\ - -a, --address=A.B.C.D set IP addres to A.B.C.D (Required)\n\ + -a, --address=A.B.C.D set IP address to A.B.C.D (Required)\n\ -p, --port=N set port to N (Default 3260)\n\ -u, --username=N set username to N (optional)\n\ -w, --password=N set password to N (optional\n\ @@ -126,7 +126,7 @@ rc = iscsid_exec_req(&req, &rsp, 0); if (rc) { iscsi_err_print_msg(rc); - log_error("Could not stop event_loop\n"); + log_error("Could not stop event_loop"); } return rc; } @@ -279,6 +279,8 @@ return rc; } +int session_in_use(int sid) { return 0; } + static void catch_signal(int signo) { log_warning("pid %d caught signal -%d", getpid(), signo); @@ -287,22 +289,22 @@ static int check_params(char *initiatorname) { if (!initiatorname) { - log_error("InitiatorName not set. Exiting %s\n", program_name); + log_error("InitiatorName not set. Exiting %s", program_name); return EINVAL; } if (config_rec.tpgt == PORTAL_GROUP_TAG_UNKNOWN) { - log_error("Portal Group not set. Exiting %s\n", program_name); + log_error("Portal Group not set. Exiting %s", program_name); return EINVAL; } if (!strlen(config_rec.name)) { - log_error("TargetName not set. Exiting %s\n", program_name); + log_error("TargetName not set. Exiting %s", program_name); return EINVAL; } if (!strlen(config_rec.conn[0].address)) { - log_error("IP Address not set. Exiting %s\n", program_name); + log_error("IP Address not set. Exiting %s", program_name); return EINVAL; } @@ -472,7 +474,7 @@ mgmt_ipc_fd = mgmt_ipc_listen(); if (mgmt_ipc_fd < 0) { - log_error("Could not setup mgmt ipc\n"); + log_error("Could not setup mgmt ipc"); exit(ISCSI_ERR_NOMEM); } @@ -509,7 +511,6 @@ * Start Main Event Loop */ iscsi_initiator_init(); - actor_init(); event_loop(ipc, control_fd, mgmt_ipc_fd); ipc->ctldev_close(); mgmt_ipc_close(mgmt_ipc_fd); diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/iscsi_sysfs.c open-iscsi-2.0.874/usr/iscsi_sysfs.c --- open-iscsi-2.0.873+git0.3b4b4500/usr/iscsi_sysfs.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/iscsi_sysfs.c 2016-09-29 18:33:24.000000000 +0000 @@ -137,7 +137,7 @@ if (list_empty(&t->list)) free(t); else - log_error("Could not update %s.\n", + log_error("Could not update %s.", t->name); continue; } @@ -147,7 +147,7 @@ if (list_empty(&t->list)) free(t); else - log_error("Could not update %s.\n", + log_error("Could not update %s.", t->name); continue; } @@ -272,7 +272,7 @@ if (!sysfs_lookup_devpath_by_subsys_id(devpath, sizeof(devpath), ISCSI_SESSION_SUBSYS, id)) { log_error("Could not lookup devpath for %s. Possible sysfs " - "incompatibility.\n", id); + "incompatibility.", id); *err = ISCSI_ERR_SYSFS_LOOKUP; return 0; } @@ -280,7 +280,7 @@ session_dev = sysfs_device_get(devpath); if (!session_dev) { log_error("Could not get dev for %s. Possible sysfs " - "incompatibility.\n", id); + "incompatibility.", id); *err = ISCSI_ERR_SYSFS_LOOKUP; return 0; } @@ -305,7 +305,7 @@ if (!host_dev) { log_error("Could not get host dev for %s. Possible " - "sysfs incompatibility.\n", id); + "sysfs incompatibility.", id); *err = ISCSI_ERR_SYSFS_LOOKUP; return 0; } @@ -601,12 +601,12 @@ sysfs_get_str(sess_id, ISCSI_FLASHNODE_SUBSYS, "username", (fnode->sess).username, sizeof((fnode->sess).username)); sysfs_get_str(sess_id, ISCSI_FLASHNODE_SUBSYS, "username_in", - (fnode->sess).username, + (fnode->sess).username_in, sizeof((fnode->sess).username_in)); sysfs_get_str(sess_id, ISCSI_FLASHNODE_SUBSYS, "password", (fnode->sess).password, sizeof((fnode->sess).password)); sysfs_get_str(sess_id, ISCSI_FLASHNODE_SUBSYS, "password_in", - (fnode->sess).password, + (fnode->sess).password_in, sizeof((fnode->sess).password_in)); sysfs_get_uint(conn_id, ISCSI_FLASHNODE_SUBSYS, "statsn", &((fnode->conn[0]).stat_sn)); @@ -741,7 +741,7 @@ 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); + log_debug(7, "could not read hwaddress for host%d", host_no); if (iface_kern_id) ret = sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, @@ -752,14 +752,14 @@ 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", + log_debug(7, "could not read local address for host%d", host_no); /* if not found just print out default */ 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); + log_debug(7, "could not read netdev for host%d", host_no); /* * For drivers like qla4xxx we can only set the iname at the @@ -799,7 +799,7 @@ * global iname so we can just fill it in here. */ log_debug(7, "Could not read initiatorname for " - "host%d\n", host_no); + "host%d", host_no); /* optional so do not return error */ ret = 0; } @@ -818,14 +818,14 @@ if (session) { /* * this was added after 2.0.869 so we could be doing iscsi_tcp - * session binding, but there may not be a ifacename set + * session binding, but there may not be an ifacename set * if binding is not used. */ ret = sysfs_get_str(session, ISCSI_SESSION_SUBSYS, "ifacename", iface->name, sizeof(iface->name)); if (ret) { log_debug(7, "could not read iface name for " - "session %s\n", session); + "session %s", session); /* * if the ifacename file is not there then we are * using a older kernel and can try to find the @@ -834,7 +834,7 @@ */ if (iface_get_by_net_binding(iface, iface)) log_debug(7, "Could not find iface for session " - "bound to:" iface_fmt "\n", + "bound to:" iface_fmt "", iface_str(iface)); } } @@ -856,6 +856,71 @@ sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "subnet", iface->subnet_mask, sizeof(iface->subnet_mask)); + + sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, + "dhcp_alt_client_id_en", + iface->dhcp_alt_client_id_state, + sizeof(iface->dhcp_alt_client_id_state)); + + sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, + "dhcp_alt_client_id", + iface->dhcp_alt_client_id, + sizeof(iface->dhcp_alt_client_id)); + + sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, + "dhcp_dns_address_en", + iface->dhcp_dns, sizeof(iface->dhcp_dns)); + + sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, + "dhcp_learn_iqn_en", + iface->dhcp_learn_iqn, + sizeof(iface->dhcp_learn_iqn)); + + sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, + "dhcp_req_vendor_id_en", + iface->dhcp_req_vendor_id_state, + sizeof(iface->dhcp_req_vendor_id_state)); + + sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, + "dhcp_use_vendor_id_en", + iface->dhcp_vendor_id_state, + sizeof(iface->dhcp_vendor_id_state)); + + sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, + "dhcp_vendor_id", + iface->dhcp_vendor_id, + sizeof(iface->dhcp_vendor_id)); + + sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, + "dhcp_slp_da_info_en", + iface->dhcp_slp_da, sizeof(iface->dhcp_slp_da)); + + sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, + "fragment_disable", + iface->fragmentation, + sizeof(iface->fragmentation)); + + sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, + "grat_arp_en", + iface->gratuitous_arp, + sizeof(iface->gratuitous_arp)); + + sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, + "incoming_forwarding_en", + iface->incoming_forwarding, + sizeof(iface->incoming_forwarding)); + + sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, + "tos_en", + iface->tos_state, sizeof(iface->tos_state)); + + if (sysfs_get_uint8(iface_kern_id, ISCSI_IFACE_SUBSYS, + "tos", &iface->tos)) + iface->tos = 0; + + if (sysfs_get_uint8(iface_kern_id, ISCSI_IFACE_SUBSYS, + "ttl", &iface->ttl)) + iface->ttl = 0; } else { sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "ipaddr_autocfg", @@ -872,6 +937,53 @@ sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "router_addr", iface->ipv6_router, sizeof(iface->ipv6_router)); + + sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "router_state", + iface->router_autocfg, + sizeof(iface->router_autocfg)); + + if (sysfs_get_uint8(iface_kern_id, ISCSI_IFACE_SUBSYS, + "dup_addr_detect_cnt", + &iface->dup_addr_detect_cnt)) + iface->dup_addr_detect_cnt = 0; + + if (sysfs_get_uint(iface_kern_id, ISCSI_IFACE_SUBSYS, + "flow_label", &iface->flow_label)) + iface->flow_label = 0; + + sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, + "grat_neighbor_adv_en", + iface->gratuitous_neighbor_adv, + sizeof(iface->gratuitous_neighbor_adv)); + + if (sysfs_get_uint8(iface_kern_id, ISCSI_IFACE_SUBSYS, + "hop_limit", &iface->hop_limit)) + iface->hop_limit = 0; + + sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "mld_en", + iface->mld, sizeof(iface->mld)); + + if (sysfs_get_uint(iface_kern_id, ISCSI_IFACE_SUBSYS, + "nd_reachable_tmo", + &iface->nd_reachable_tmo)) + iface->nd_reachable_tmo = 0; + + if (sysfs_get_uint(iface_kern_id, ISCSI_IFACE_SUBSYS, + "nd_rexmit_time", &iface->nd_rexmit_time)) + iface->nd_rexmit_time = 0; + + if (sysfs_get_uint(iface_kern_id, ISCSI_IFACE_SUBSYS, + "nd_stale_tmo", &iface->nd_stale_tmo)) + iface->nd_stale_tmo = 0; + + if (sysfs_get_uint(iface_kern_id, ISCSI_IFACE_SUBSYS, + "router_adv_link_mtu", + &iface->router_adv_link_mtu)) + iface->router_adv_link_mtu = 0; + + if (sysfs_get_uint(iface_kern_id, ISCSI_IFACE_SUBSYS, + "traffic_class", &iface->traffic_class)) + iface->traffic_class = 0; } if (sysfs_get_uint16(iface_kern_id, ISCSI_IFACE_SUBSYS, "port", @@ -888,6 +1000,94 @@ &iface->vlan_priority)) iface->vlan_priority = UINT8_MAX; + sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "vlan_enabled", + iface->vlan_state, sizeof(iface->vlan_state)); + + sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "enabled", + iface->state, sizeof(iface->state)); + + sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "delayed_ack_en", + iface->delayed_ack, sizeof(iface->delayed_ack)); + + sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "tcp_nagle_disable", + iface->nagle, sizeof(iface->nagle)); + + sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "tcp_wsf_disable", + iface->tcp_wsf_state, sizeof(iface->tcp_wsf_state)); + + if (sysfs_get_uint8(iface_kern_id, ISCSI_IFACE_SUBSYS, "tcp_wsf", + &iface->tcp_wsf)) + iface->tcp_wsf = 0; + + if (sysfs_get_uint8(iface_kern_id, ISCSI_IFACE_SUBSYS, + "tcp_timer_scale", &iface->tcp_timer_scale)) + iface->tcp_timer_scale = 0; + + sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "tcp_timestamp_en", + iface->tcp_timestamp, sizeof(iface->tcp_timestamp)); + + sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "redirect_en", + iface->redirect, sizeof(iface->redirect)); + + if (sysfs_get_uint16(iface_kern_id, ISCSI_IFACE_SUBSYS, + "def_taskmgmt_tmo", &iface->def_task_mgmt_tmo)) + iface->def_task_mgmt_tmo = 0; + + sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "header_digest", + iface->header_digest, sizeof(iface->header_digest)); + + sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "data_digest", + iface->data_digest, sizeof(iface->data_digest)); + + sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "immediate_data", + iface->immediate_data, sizeof(iface->immediate_data)); + + sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "initial_r2t", + iface->initial_r2t, sizeof(iface->initial_r2t)); + + sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "data_seq_in_order", + iface->data_seq_inorder, sizeof(iface->data_seq_inorder)); + + sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "data_pdu_in_order", + iface->data_pdu_inorder, sizeof(iface->data_pdu_inorder)); + + if (sysfs_get_uint8(iface_kern_id, ISCSI_IFACE_SUBSYS, "erl", + &iface->erl)) + iface->erl = 0; + + if (sysfs_get_uint(iface_kern_id, ISCSI_IFACE_SUBSYS, + "max_recv_dlength", &iface->max_recv_dlength)) + iface->max_recv_dlength = 0; + + if (sysfs_get_uint(iface_kern_id, ISCSI_IFACE_SUBSYS, + "first_burst_len", &iface->first_burst_len)) + iface->first_burst_len = 0; + + if (sysfs_get_uint16(iface_kern_id, ISCSI_IFACE_SUBSYS, + "max_outstanding_r2t", &iface->max_out_r2t)) + iface->max_out_r2t = 0; + + if (sysfs_get_uint(iface_kern_id, ISCSI_IFACE_SUBSYS, + "max_burst_len", &iface->max_burst_len)) + iface->max_burst_len = 0; + + sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "chap_auth", + iface->chap_auth, sizeof(iface->chap_auth)); + + sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "bidi_chap", + iface->bidi_chap, sizeof(iface->bidi_chap)); + + sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "strict_login_comp_en", + iface->strict_login_comp, + sizeof(iface->strict_login_comp)); + + sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, + "discovery_auth_optional", + iface->discovery_auth, sizeof(iface->discovery_auth)); + + sysfs_get_str(iface_kern_id, ISCSI_IFACE_SUBSYS, "discovery_logout", + iface->discovery_logout, sizeof(iface->discovery_logout)); + if (sscanf(iface_kern_id, "ipv%d-iface-%u-%u", &iface_type, &tmp_host_no, &iface_num) == 3) iface->iface_num = iface_num; @@ -1016,7 +1216,7 @@ * /sys/devices/platform/hostH/sessionS * * return the sid S. If just the sid is passed in it will be converted - * to a int. + * to an int. */ int iscsi_sysfs_get_sid_from_path(char *session) { @@ -1031,7 +1231,7 @@ return sid; if (lstat(session, &statb)) { - log_error("%s is an invalid session ID or path\n", session); + log_error("%s is an invalid session ID or path", session); exit(1); } @@ -1048,7 +1248,7 @@ dev = sysfs_device_get(devpath); if (!dev) { log_error("Could not get dev for %s. Possible sysfs " - "incompatibility.\n", devpath); + "incompatibility.", devpath); return -1; } @@ -1272,13 +1472,27 @@ break; } - if ((chldrc > 0) && (rc == 0)) { + if (!WIFEXITED(chldrc)) { /* + * abnormal termination (signal, exception, etc.) + * * The non-parallel code path returns the first * error so this keeps the same semantics. */ - rc = chldrc; - } else if (chldrc == 0) { + if (rc == 0) + rc = ISCSI_ERR_CHILD_TERMINATED; + } else if ((WEXITSTATUS(chldrc) != 0) && + (WEXITSTATUS(chldrc) != 255)) { + /* + * 0 is success + * 255 is a truncated return code from exit(-1) + * and means no match + * anything else (this case) is an error + */ + if (rc == 0) + rc = WEXITSTATUS(chldrc); + } else if (WEXITSTATUS(chldrc) == 0) { + /* success */ (*nr_found)++; } } @@ -1322,7 +1536,7 @@ snprintf(id, sizeof(id), "%d:0:%d:%d", host_no, target, lun); 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); + log_debug(3, "Could not read attr state for %s", id); return ISCSI_ERR_SYSFS_LOOKUP; } @@ -1343,7 +1557,7 @@ snprintf(id, sizeof(id), "%d:0:%d:%d", host_no, target, lun); if (!sysfs_lookup_devpath_by_subsys_id(devpath, sizeof(devpath), SCSI_SUBSYS, id)) { - log_debug(3, "Could not lookup devpath for %s %s\n", + log_debug(3, "Could not lookup devpath for %s %s", SCSI_SUBSYS, id); return NULL; } @@ -1371,7 +1585,7 @@ * 2.6.25 dropped the symlink and now block is a dir. */ if (lstat(path_full, &statbuf)) { - log_error("Could not stat block path %s err %d\n", + log_error("Could not stat block path %s err %d", path_full, errno); break; } @@ -1390,7 +1604,7 @@ /* it should not be this hard should it? :) */ blk_dirfd = opendir(path_full); if (!blk_dirfd) { - log_debug(3, "Could not open blk path %s\n", + log_debug(3, "Could not open blk path %s", path_full); break; } @@ -1426,7 +1640,7 @@ snprintf(id, sizeof(id), "session%u", sid); if (!sysfs_lookup_devpath_by_subsys_id(devpath, sizeof(devpath), ISCSI_SESSION_SUBSYS, id)) { - log_debug(3, "Could not lookup devpath for %s %s\n", + log_debug(3, "Could not lookup devpath for %s %s", ISCSI_SESSION_SUBSYS, id); return 0; } @@ -1599,7 +1813,7 @@ snprintf(id, sizeof(id), "session%u", sid); if (!sysfs_lookup_devpath_by_subsys_id(devpath, sizeof(devpath), ISCSI_SESSION_SUBSYS, id)) { - log_debug(3, "Could not lookup devpath for %s %s\n", + log_debug(3, "Could not lookup devpath for %s %s", ISCSI_SESSION_SUBSYS, id); return ISCSI_ERR_SYSFS_LOOKUP; } @@ -1683,7 +1897,7 @@ snprintf(id, sizeof(id), ISCSI_HOST_ID, hostno); sysfs_set_param(id, SCSI_HOST_SUBSYS, "scan", write_buf, strlen(write_buf)); - log_debug(4, "scanning host%d completed\n", hostno); + log_debug(4, "scanning host%d completed", hostno); } else if (pid > 0) { log_debug(4, "scanning host%d from pid %d", hostno, pid); } else diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/iscsi_util.c open-iscsi-2.0.874/usr/iscsi_util.c --- open-iscsi-2.0.873+git0.3b4b4500/usr/iscsi_util.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/iscsi_util.c 2016-09-29 18:33:24.000000000 +0000 @@ -25,16 +25,28 @@ #include #include #include +#include +#include #include #include #include +#include "sysdeps.h" #include "log.h" #include "iscsi_settings.h" #include "iface.h" #include "session_info.h" #include "iscsi_util.h" +int setup_abstract_addr(struct sockaddr_un *addr, char *unix_sock_name) +{ + memset(addr, 0, sizeof(*addr)); + addr->sun_family = AF_LOCAL; + strlcpy(addr->sun_path + 1, unix_sock_name, sizeof(addr->sun_path) - 1); + return offsetof(struct sockaddr_un, sun_path) + + strlen(addr->sun_path + 1) + 1; +} + void daemon_init(void) { int fd; @@ -136,10 +148,10 @@ err = getrlimit(RLIMIT_NOFILE, &rl); if (err) { - log_debug(1, "Could not get file limit (err %d)\n", errno); + log_debug(1, "Could not get file limit (err %d)", errno); return errno; } - log_debug(1, "Max file limits %lu %lu\n", rl.rlim_cur, rl.rlim_max); + log_debug(1, "Max file limits %lu %lu", rl.rlim_cur, rl.rlim_max); if (rl.rlim_cur < ISCSI_MAX_FILES) rl.rlim_cur = ISCSI_MAX_FILES; @@ -148,7 +160,7 @@ err = setrlimit(RLIMIT_NOFILE, &rl); if (err) { - log_debug(1, "Could not set file limit to %lu/%lu (err %d)\n", + log_debug(1, "Could not set file limit to %lu/%lu (err %d)", rl.rlim_cur, rl.rlim_max, errno); return errno; } @@ -272,7 +284,7 @@ /* * didn't match so we have to resolve to see if one is a dnsname - * that matches a ip address. + * that matches an ip address. */ rc = getaddrinfo(address1, NULL, &hints1, &res1); if (rc) { @@ -307,7 +319,7 @@ unsigned sid) { if (!rec) { - log_debug(6, "no rec info to match\n"); + log_debug(6, "no rec info to match"); return 1; } diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/iscsi_util.h open-iscsi-2.0.874/usr/iscsi_util.h --- open-iscsi-2.0.873+git0.3b4b4500/usr/iscsi_util.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/iscsi_util.h 2016-09-29 18:33:24.000000000 +0000 @@ -26,4 +26,7 @@ extern char *strstrip(char *s); extern char *cfg_get_string_param(char *pathname, const char *key); +struct sockaddr_un; +extern int setup_abstract_addr(struct sockaddr_un *addr, char *unix_sock_name); + #endif diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/login.c open-iscsi-2.0.874/usr/login.c --- open-iscsi-2.0.873+git0.3b4b4500/usr/login.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/login.c 2016-09-29 18:33:24.000000000 +0000 @@ -50,16 +50,14 @@ int pdu_length = ntoh24(pdu->dlength); char *text = data; char *end = data + max_data_length; - char *pdu_text; /* find the end of the current text */ text += pdu_length; - pdu_text = text; pdu_length += length; if (text + length >= end) { log_warning("Failed to add login text " - "'%s=%s'\n", param, value); + "'%s=%s'", param, value); return 0; } @@ -170,7 +168,7 @@ if ((rc = getaddrinfo(host, port, &hints, &res))) { log_error("Cannot resolve host %s. getaddrinfo error: " - "[%s]\n", host, gai_strerror(rc)); + "[%s]", host, gai_strerror(rc)); return rc; } @@ -1558,10 +1556,10 @@ repoll: pfd.revents = 0; ret = poll(&pfd, 1, timeout); - log_debug(7, "%s: Poll return %d\n", __FUNCTION__, ret); + log_debug(7, "%s: Poll return %d", __FUNCTION__, ret); if (iscsi_timer_expired(&connection_timer)) { log_warning("Login response timeout. Waited %d " - "seconds and did not get reponse PDU.\n", + "seconds and did not get response PDU.", session->conn[0].active_timeout); c->ret = LOGIN_FAILED; return c->ret; @@ -1595,7 +1593,7 @@ } } else if (ret < 0) { - log_error("Login poll error.\n"); + log_error("Login poll error."); c->ret = LOGIN_FAILED; return c->ret; } diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/Makefile open-iscsi-2.0.874/usr/Makefile --- open-iscsi-2.0.873+git0.3b4b4500/usr/Makefile 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/Makefile 2016-09-29 18:33:24.000000000 +0000 @@ -28,14 +28,13 @@ endif endif -OPTFLAGS ?= -O2 -g +CFLAGS ?= -O2 -g WARNFLAGS ?= -Wall -Wstrict-prototypes -CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -I../include -I. -I../utils/open-isns \ - -D$(OSNAME) $(IPC_CFLAGS) +CFLAGS += $(WARNFLAGS) -I../include -I. -D$(OSNAME) $(IPC_CFLAGS) PROGRAMS = iscsid iscsiadm iscsistart # libc compat files -SYSDEPS_SRCS = $(wildcard ../utils/sysdeps/*.o) +SYSDEPS_SRCS = $(sort $(wildcard ../utils/sysdeps/*.o)) # sources shared between iscsid, iscsiadm and iscsistart 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 \ @@ -46,7 +45,7 @@ INITIATOR_SRCS = initiator.o scsi.o actor.o event_poll.o mgmt_ipc.o kern_err_table.o # fw boot files -FW_BOOT_SRCS = $(wildcard ../utils/fwparam_ibft/*.o) +FW_BOOT_SRCS = $(sort $(wildcard ../utils/fwparam_ibft/*.o)) # core discovery files DISCOVERY_SRCS = $(FW_BOOT_SRCS) strings.o discovery.o @@ -54,15 +53,15 @@ all: $(PROGRAMS) iscsid: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(DISCOVERY_SRCS) \ - iscsid.o session_mgmt.o discoveryd.o - $(CC) $(CFLAGS) $^ -o $@ -L../utils/open-isns -lisns + iscsid.o session_mgmt.o discoveryd.o mntcheck.o + $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -lisns -lcrypto -lrt -lmount -iscsiadm: $(ISCSI_LIB_SRCS) $(DISCOVERY_SRCS) iscsiadm.o session_mgmt.o - $(CC) $(CFLAGS) $^ -o $@ -L../utils/open-isns -lisns +iscsiadm: $(ISCSI_LIB_SRCS) $(DISCOVERY_SRCS) iscsiadm.o session_mgmt.o mntcheck.o + $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -lisns -lcrypto -lmount iscsistart: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(FW_BOOT_SRCS) \ iscsistart.o statics.o - $(CC) $(CFLAGS) -static $^ -o $@ + $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -lrt clean: rm -f *.o $(PROGRAMS) .depend $(LIBSYS) diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/md5.c open-iscsi-2.0.874/usr/md5.c --- open-iscsi-2.0.873+git0.3b4b4500/usr/md5.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/md5.c 2016-09-29 18:33:24.000000000 +0000 @@ -127,7 +127,7 @@ byteSwap(ctx->buf, 4); memcpy(digest, ctx->buf, 16); - memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */ + memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */ } #ifndef ASM_MD5 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/mgmt_ipc.c open-iscsi-2.0.874/usr/mgmt_ipc.c --- open-iscsi-2.0.873+git0.3b4b4500/usr/mgmt_ipc.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/mgmt_ipc.c 2016-09-29 18:33:24.000000000 +0000 @@ -36,6 +36,7 @@ #include "sysdeps.h" #include "iscsi_ipc.h" #include "iscsi_err.h" +#include "iscsi_util.h" #define PEERUSER_MAX 64 #define EXTMSG_MAX (64 * 1024) @@ -59,11 +60,7 @@ return fd; } - addr_len = offsetof(struct sockaddr_un, sun_path) + strlen(ISCSIADM_NAMESPACE) + 1; - - memset(&addr, 0, sizeof(addr)); - addr.sun_family = AF_LOCAL; - memcpy((char *) &addr.sun_path + 1, ISCSIADM_NAMESPACE, addr_len); + addr_len = setup_abstract_addr(&addr, ISCSIADM_NAMESPACE); if ((err = bind(fd, (struct sockaddr *) &addr, addr_len)) < 0 ) { log_error("Can not bind IPC socket"); @@ -467,7 +464,6 @@ qtask->rsp.err = err; 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); } diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/mntcheck.c open-iscsi-2.0.874/usr/mntcheck.c --- open-iscsi-2.0.873+git0.3b4b4500/usr/mntcheck.c 1970-01-01 00:00:00.000000000 +0000 +++ open-iscsi-2.0.874/usr/mntcheck.c 2016-09-29 18:33:24.000000000 +0000 @@ -0,0 +1,233 @@ +/* + * Common code for checking sessions for mnt use + * + * Copyright (C) 2014 - 2015 Chris Leech + * Copyright (C) 2014 - 2015 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. + * + * See the file COPYING included with this distribution for more details. + */ + +#include +#include +#include +#include +#include +#include + +#include "initiator.h" +#include "transport.h" +#include "iscsid.h" +#include "iscsi_ipc.h" +#include "log.h" +#include "iscsi_sysfs.h" +#include "iscsi_settings.h" +#include "iface.h" +#include "host.h" +#include "sysdeps.h" +#include "iscsi_err.h" +#include "iscsi_net_util.h" + +static struct libmnt_table *mtab, *swaps; +static struct libmnt_cache *mntcache; + +static void libmount_cleanup(void) +{ + mnt_free_table(mtab); + mnt_free_table(swaps); + mnt_free_cache(mntcache); + mtab = NULL; + swaps = NULL; + mntcache = NULL; +} + +static int libmount_init(void) +{ + mnt_init_debug(0); + mtab = mnt_new_table(); + swaps = mnt_new_table(); + mntcache = mnt_new_cache(); + if (!mtab || !swaps || !mntcache) { + libmount_cleanup(); + return -ENOMEM; + } + mnt_table_set_cache(mtab, mntcache); + mnt_table_set_cache(swaps, mntcache); + mnt_table_parse_mtab(mtab, NULL); + mnt_table_parse_swaps(swaps, NULL); + return 0; +} + +static int trans_filter(const struct dirent *d) +{ + if (!strcmp(".", d->d_name) || !strcmp("..", d->d_name)) + return 0; + return 1; +} + +static int subdir_filter(const struct dirent *d) +{ + if (!(d->d_type & DT_DIR)) + return 0; + return trans_filter(d); +} + +static int is_partition(const char *path) +{ + char *devtype; + int rc = 0; + + devtype = sysfs_get_uevent_devtype(path); + if (!devtype) + return 0; + if (strcmp(devtype, "partition") == 0) + rc = 1; + free(devtype); + return rc; +} + +static int blockdev_check_mnts(char *syspath) +{ + struct libmnt_fs *fs; + char *devname = NULL; + char *_devname = NULL; + int rc = 0; + + devname = sysfs_get_uevent_devname(syspath); + if (!devname) + goto out; + + _devname = calloc(1, PATH_MAX); + if (!_devname) + goto out; + snprintf(_devname, PATH_MAX, "/dev/%s", devname); + + fs = mnt_table_find_source(mtab, _devname, MNT_ITER_FORWARD); + if (fs) { + rc = 1; + goto out; + } + fs = mnt_table_find_source(swaps, _devname, MNT_ITER_FORWARD); + if (fs) + rc = 1; +out: + free(devname); + free(_devname); + return rc; +} + +static int count_device_users(char *syspath); + +static int blockdev_get_partitions(char *syspath) +{ + struct dirent **parts = NULL; + int n, i; + int count = 0; + + n = scandir(syspath, &parts, subdir_filter, alphasort); + for (i = 0; i < n; i++) { + char *newpath; + + newpath = calloc(1, PATH_MAX); + if (!newpath) + continue; + snprintf(newpath, PATH_MAX, "%s/%s", syspath, parts[i]->d_name); + free(parts[i]); + if (is_partition(newpath)) { + count += count_device_users(newpath); + } + free(newpath); + } + free(parts); + return count; +} + +static int blockdev_get_holders(char *syspath) +{ + char *path = NULL; + struct dirent **holds = NULL; + int n, i; + int count = 0; + + path = calloc(1, PATH_MAX); + if (!path) + return 0; + snprintf(path, PATH_MAX, "%s/holders", syspath); + + n = scandir(path, &holds, trans_filter, alphasort); + for (i = 0; i < n; i++) { + char *newpath; + char *rp; + + newpath = calloc(1, PATH_MAX); + if (!newpath) + continue; + snprintf(newpath, PATH_MAX, "%s/%s", path, holds[i]->d_name); + + free(holds[i]); + rp = realpath(newpath, NULL); + if (rp) + count += count_device_users(rp); + free(newpath); + free(rp); + } + free(path); + free(holds); + return count; +} + +static int count_device_users(char *syspath) +{ + int count = 0; + count += blockdev_check_mnts(syspath); + count += blockdev_get_partitions(syspath); + count += blockdev_get_holders(syspath); + return count; +}; + +static void device_in_use(void *data, int host_no, int target, int lun) +{ + char *syspath = NULL; + char *devname = NULL; + int *count = data; + + devname = iscsi_sysfs_get_blockdev_from_lun(host_no, target, lun); + if (!devname) + goto out; + syspath = calloc(1, PATH_MAX); + if (!syspath) + goto out; + snprintf(syspath, PATH_MAX, "/sys/class/block/%s", devname); + *count += count_device_users(syspath); +out: + free(syspath); + free(devname); +} + +int session_in_use(int sid) +{ + int host_no = -1, err = 0; + int count = 0; + + if (libmount_init()) { + log_error("Failed to initialize libmount, " + "not checking for active mounts on session [%d].", sid); + return 0; + } + + host_no = iscsi_sysfs_get_host_no_from_sid(sid, &err); + if (!err) + iscsi_sysfs_for_each_device(&count, host_no, sid, device_in_use); + + libmount_cleanup(); + return count; +} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/netlink.c open-iscsi-2.0.874/usr/netlink.c --- open-iscsi-2.0.873+git0.3b4b4500/usr/netlink.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/netlink.c 2016-09-29 18:33:24.000000000 +0000 @@ -339,6 +339,10 @@ } else if (ev->type == ISCSI_UEVENT_GET_CHAP) { /* kget_chap() will read */ return 0; + } else if (ev->type == ISCSI_UEVENT_GET_HOST_STATS) { + /* kget_host_stats() will read */ + return 0; + } else { if ((rc = nlpayload_read(ctrl_fd, (void*)ev, sizeof(*ev), 0)) < 0) { @@ -372,7 +376,7 @@ else if (addr->sa_family == PF_INET6) addrlen = sizeof(struct sockaddr_in6); else { - log_error("%s unknown addr family %d\n", + log_error("%s unknown addr family %d", __FUNCTION__, addr->sa_family); return -EINVAL; } @@ -382,7 +386,7 @@ iov[1].iov_len = sizeof(*ev) + addrlen; rc = __kipc_call(iov, 2); if (rc < 0) { - log_error("sendtargets failed rc%d\n", rc); + log_error("sendtargets failed rc%d", rc); return rc; } return 0; @@ -674,7 +678,7 @@ sprintf(param_str, "%s", (char *)value); break; default: - log_error("invalid type %d\n", type); + log_error("invalid type %d", type); return -EINVAL; } ev->u.set_host_param.len = len = strlen(param_str) + 1; @@ -712,13 +716,16 @@ case ISCSI_INT: sprintf(param_str, "%d", *((int *)value)); break; + case ISCSI_UINT: + sprintf(param_str, "%u", *((unsigned int *)value)); + break; case ISCSI_STRING: if (!strlen(value)) return 0; sprintf(param_str, "%s", (char *)value); break; default: - log_error("invalid type %d\n", type); + log_error("invalid type %d", type); return -EINVAL; } ev->u.set_param.len = len = strlen(param_str) + 1; @@ -866,7 +873,7 @@ else if (dst_addr->sa_family == PF_INET6) addrlen = sizeof(struct sockaddr_in6); else { - log_error("%s unknown addr family %d\n", + log_error("%s unknown addr family %d", __FUNCTION__, dst_addr->sa_family); return -EINVAL; } @@ -935,7 +942,7 @@ iov[1].iov_len = sizeof(ev); rc = __kipc_call(iov, 2); if (rc < 0) { - log_error("connnection %d:%d transport disconnect failed for " + log_error("connection %d:%d transport disconnect failed for " "ep %" PRIu64 " with error %d.", conn->session->id, conn->id, conn->transport_ep_handle, rc); } else @@ -1031,6 +1038,10 @@ /* fatal handling error or conn error */ goto exit; + /* unexpected event without a receive context */ + if (!conn->recv_context) + return -EAGAIN; + *state = *(enum iscsi_conn_state *)conn->recv_context->data; ipc_ev_clbk->put_ev_context(conn->recv_context); @@ -1068,7 +1079,7 @@ else if (addr->sa_family == PF_INET6) addrlen = sizeof(struct sockaddr_in6); else { - log_error("%s unknown addr family %d\n", + log_error("%s unknown addr family %d", __FUNCTION__, addr->sa_family); return -EINVAL; } @@ -1228,6 +1239,29 @@ return rc; } +static int kset_chap(uint64_t transport_handle, uint32_t host_no, + struct iovec *iovs, uint32_t param_count) +{ + int rc; + struct iscsi_uevent ev; + struct iovec *iov = iovs + 1; + + log_debug(8, "in %s", __func__); + + ev.type = ISCSI_UEVENT_SET_CHAP; + ev.transport_handle = transport_handle; + ev.u.set_path.host_no = host_no; + + iov->iov_base = &ev; + iov->iov_len = sizeof(ev); + + rc = __kipc_call(iovs, param_count); + if (rc < 0) + return rc; + + return 0; +} + static int kdelete_chap(uint64_t transport_handle, uint32_t host_no, uint16_t chap_tbl_idx) { @@ -1415,6 +1449,48 @@ return 0; } +static int kget_host_stats(uint64_t transport_handle, uint32_t host_no, + char *host_stats) +{ + int rc = 0; + int ev_size; + struct iscsi_uevent ev; + struct iovec iov[2]; + char nlm_ev[NLMSG_SPACE(sizeof(struct iscsi_uevent))]; + struct nlmsghdr *nlh; + + memset(&ev, 0, sizeof(struct iscsi_uevent)); + + ev.type = ISCSI_UEVENT_GET_HOST_STATS; + ev.transport_handle = transport_handle; + ev.u.get_host_stats.host_no = host_no; + + 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) { + log_error("can not read nlm_ev, error %d", rc); + return rc; + } + + nlh = (struct nlmsghdr *)nlm_ev; + ev_size = nlh->nlmsg_len - NLMSG_ALIGN(sizeof(struct nlmsghdr)); + + if ((rc = nlpayload_read(ctrl_fd, (void *)host_stats, + ev_size, 0)) < 0) { + log_error("can not read from NL socket, error %d", rc); + return rc; + } + + return rc; +} + + static void drop_data(struct nlmsghdr *nlh) { int ev_size; @@ -1444,7 +1520,7 @@ nlh = (struct nlmsghdr *)nlm_ev; ev = (struct iscsi_uevent *)NLMSG_DATA(nlm_ev); - log_debug(7, "%s got event type %u\n", __FUNCTION__, ev->type); + log_debug(7, "%s got event type %u", __FUNCTION__, ev->type); /* drivers like qla4xxx can be inserted after iscsid is started */ switch (ev->type) { case ISCSI_KEVENT_CREATE_SESSION: @@ -1487,15 +1563,15 @@ case ISCSI_KEVENT_HOST_EVENT: switch (ev->r.host_event.code) { case ISCSI_EVENT_LINKUP: - log_warning("Host%u: Link Up.\n", + log_warning("Host%u: Link Up.", ev->r.host_event.host_no); break; case ISCSI_EVENT_LINKDOWN: - log_warning("Host%u: Link Down.\n", + log_warning("Host%u: Link Down.", ev->r.host_event.host_no); break; default: - log_debug(7, "Host%u: Unknwon host event: %u.\n", + log_debug(7, "Host%u: Unknown host event: %u.", ev->r.host_event.host_no, ev->r.host_event.code); } @@ -1521,7 +1597,7 @@ * see their * stuff. Just drop it. */ - log_debug(7, "Got unknwon event %d. Dropping.", + log_debug(7, "Got unknown event %d. Dropping.", ev->type); drop_data(nlh); return 0; @@ -1535,7 +1611,7 @@ * nl interface. */ log_debug(1, "Could not verify connection %d:%d. Dropping " - "event.\n", sid, cid); + "event.", sid, cid); drop_data(nlh); return -ENXIO; } @@ -1545,8 +1621,8 @@ ev_context = ipc_ev_clbk->get_ev_context(conn, ev_size); if (!ev_context) { - /* retry later */ log_error("Can not allocate memory for receive context."); + drop_data(nlh); return -ENOMEM; } @@ -1705,6 +1781,7 @@ .recv_conn_state = krecv_conn_state, .exec_ping = kexec_ping, .get_chap = kget_chap, + .set_chap = kset_chap, .delete_chap = kdelete_chap, .set_flash_node_params = kset_flashnode_params, .new_flash_node = knew_flashnode, @@ -1712,6 +1789,7 @@ .login_flash_node = klogin_flashnode, .logout_flash_node = klogout_flashnode, .logout_flash_node_sid = klogout_flashnode_sid, + .get_host_stats = kget_host_stats, }; struct iscsi_ipc *ipc = &nl_ipc; diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/session_info.c open-iscsi-2.0.874/usr/session_info.c --- open-iscsi-2.0.873+git0.3b4b4500/usr/session_info.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/session_info.c 2016-09-29 18:33:24.000000000 +0000 @@ -390,6 +390,7 @@ printf("iSCSI Transport Class version %s\n", version); printf("version %s\n", ISCSI_VERSION_STR); + free(version); } flags |= (SESSION_INFO_SCSI_DEVS | SESSION_INFO_HOST_DEVS); diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/session_mgmt.c open-iscsi-2.0.874/usr/session_mgmt.c --- open-iscsi-2.0.873+git0.3b4b4500/usr/session_mgmt.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/session_mgmt.c 2016-09-29 18:33:24.000000000 +0000 @@ -343,7 +343,7 @@ } /** - * iscsi_logout_portal - logou tof portal + * iscsi_logout_portal - logout of portal * @info: session to log out of * @list: if async, this is the list to add the logout req to */ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/strings.c open-iscsi-2.0.874/usr/strings.c --- open-iscsi-2.0.873+git0.3b4b4500/usr/strings.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/strings.c 2016-09-29 18:33:24.000000000 +0000 @@ -74,7 +74,7 @@ if (s) { s->data_length += length; if (s->data_length > s->allocated_length) { - log_debug(7, "enlarge buffer from %lu to %lu\n", + log_debug(7, "enlarge buffer from %lu to %lu", s->allocated_length, s->data_length); new_buf = realloc(s->buffer, s->data_length); if (!new_buf) { diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/sysfs.c open-iscsi-2.0.874/usr/sysfs.c --- open-iscsi-2.0.873+git0.3b4b4500/usr/sysfs.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/sysfs.c 2016-09-29 18:33:24.000000000 +0000 @@ -63,15 +63,6 @@ /* device cache */ static LIST_HEAD(dev_list); -/* attribute value cache */ -static LIST_HEAD(attr_list); - -struct sysfs_attr { - struct list_head node; - char path[PATH_SIZE]; - char *value; /* points to value_local if value is cached */ - char value_local[NAME_SIZE]; -}; int sysfs_init(void) { const char *env; @@ -82,25 +73,17 @@ remove_trailing_chars(sysfs_path, '/'); } else strlcpy(sysfs_path, "/sys", sizeof(sysfs_path)); - dbg("sysfs_path='%s'\n", sysfs_path); + dbg("sysfs_path='%s'", sysfs_path); INIT_LIST_HEAD(&dev_list); - INIT_LIST_HEAD(&attr_list); return 0; } void sysfs_cleanup(void) { - struct sysfs_attr *attr_loop; - struct sysfs_attr *attr_temp; struct sysfs_device *dev_loop; struct sysfs_device *dev_temp; - list_for_each_entry_safe(attr_loop, attr_temp, &attr_list, node) { - list_del_init(&attr_loop->node); - free(attr_loop); - } - list_for_each_entry_safe(dev_loop, dev_temp, &dev_list, node) { list_del_init(&dev_loop->node); free(dev_loop); @@ -123,7 +106,7 @@ if (pos == NULL) return; strlcpy(dev->kernel, &pos[1], sizeof(dev->kernel)); - dbg("kernel='%s'\n", dev->kernel); + dbg("kernel='%s'", dev->kernel); /* some devices have '!' in their name, change that to '/' */ pos = dev->kernel; @@ -138,7 +121,7 @@ while (isdigit(pos[-1])) pos--; strlcpy(dev->kernel_number, pos, sizeof(dev->kernel_number)); - dbg("kernel_number='%s'\n", dev->kernel_number); + dbg("kernel_number='%s'", dev->kernel_number); } int sysfs_resolve_link(char *devpath, size_t size) @@ -155,11 +138,11 @@ if (len <= 0) return -1; link_target[len] = '\0'; - dbg("path link '%s' points to '%s'\n", devpath, link_target); + dbg("path link '%s' points to '%s'", devpath, link_target); for (back = 0; strncmp(&link_target[back * 3], "../", 3) == 0; back++) ; - dbg("base '%s', tail '%s', back %i\n", devpath, &link_target[back * 3], back); + dbg("base '%s', tail '%s', back %i", devpath, &link_target[back * 3], back); for (i = 0; i <= back; i++) { char *pos = strrchr(devpath, '/'); @@ -167,7 +150,7 @@ return -1; pos[0] = '\0'; } - dbg("after moving back '%s'\n", devpath); + dbg("after moving back '%s'", devpath); strlcat(devpath, "/", size); strlcat(devpath, &link_target[back * 3], size); return 0; @@ -195,7 +178,7 @@ strncmp(devpath, "/block/", 7) != 0) return NULL; - dbg("open '%s'\n", devpath); + dbg("open '%s'", devpath); strlcpy(devpath_real, devpath, sizeof(devpath_real)); remove_trailing_chars(devpath_real, '/'); if (devpath[0] == '\0' ) @@ -204,7 +187,7 @@ /* look for device already in cache (we never put an untranslated path in the cache) */ list_for_each_entry(dev_loop, &dev_list, node) { if (strcmp(dev_loop->devpath, devpath_real) == 0) { - dbg("found in cache '%s'\n", dev_loop->devpath); + dbg("found in cache '%s'", dev_loop->devpath); return dev_loop; } } @@ -213,7 +196,7 @@ strlcpy(path, sysfs_path, sizeof(path)); strlcat(path, devpath_real, sizeof(path)); if (lstat(path, &statbuf) != 0) { - dbg("stat '%s' failed: %s\n", path, strerror(errno)); + dbg("stat '%s' failed: %s", path, strerror(errno)); return NULL; } if (S_ISLNK(statbuf.st_mode)) { @@ -223,14 +206,14 @@ /* now look for device in cache after path translation */ list_for_each_entry(dev_loop, &dev_list, node) { if (strcmp(dev_loop->devpath, devpath_real) == 0) { - dbg("found in cache '%s'\n", dev_loop->devpath); + dbg("found in cache '%s'", dev_loop->devpath); return dev_loop; } } } /* it is a new device */ - dbg("new uncached device '%s'\n", devpath_real); + dbg("new uncached device '%s'", devpath_real); dev = malloc(sizeof(struct sysfs_device)); if (dev == NULL) return NULL; @@ -246,7 +229,7 @@ if (len > 0) { /* get subsystem from "subsystem" link */ link_target[len] = '\0'; - dbg("subsystem link '%s' points to '%s'\n", link_path, link_target); + dbg("subsystem link '%s' points to '%s'", link_path, link_target); pos = strrchr(link_target, '/'); if (pos != NULL) strlcpy(dev->subsystem, &pos[1], sizeof(dev->subsystem)); @@ -275,13 +258,13 @@ len = readlink(link_path, link_target, sizeof(link_target)); if (len > 0) { link_target[len] = '\0'; - dbg("driver link '%s' points to '%s'\n", link_path, link_target); + dbg("driver link '%s' points to '%s'", link_path, link_target); pos = strrchr(link_target, '/'); if (pos != NULL) strlcpy(dev->driver, &pos[1], sizeof(dev->driver)); } - dbg("add to cache 'devpath=%s', subsystem='%s', driver='%s'\n", dev->devpath, dev->subsystem, dev->driver); + dbg("add to cache 'devpath=%s', subsystem='%s', driver='%s'", dev->devpath, dev->subsystem, dev->driver); list_add(&dev->node, &dev_list); return dev; @@ -292,14 +275,14 @@ char parent_devpath[PATH_SIZE]; char *pos; - dbg("open '%s'\n", dev->devpath); + dbg("open '%s'", dev->devpath); /* look if we already know the parent */ if (dev->parent != NULL) return dev->parent; strlcpy(parent_devpath, dev->devpath, sizeof(parent_devpath)); - dbg("'%s'\n", parent_devpath); + dbg("'%s'", parent_devpath); /* strip last element */ pos = strrchr(parent_devpath, '/'); @@ -310,12 +293,12 @@ if (strncmp(parent_devpath, "/class", 6) == 0) { pos = strrchr(parent_devpath, '/'); if (pos == &parent_devpath[6] || pos == parent_devpath) { - dbg("/class top level, look for device link\n"); + dbg("/class top level, look for device link"); goto device_link; } } if (strcmp(parent_devpath, "/block") == 0) { - dbg("/block top level, look for device link\n"); + dbg("/block top level, look for device link"); goto device_link; } @@ -355,44 +338,22 @@ char *sysfs_attr_get_value(const char *devpath, const char *attr_name) { char path_full[PATH_SIZE]; - const char *path; - char value[NAME_SIZE]; - struct sysfs_attr *attr_loop; - struct sysfs_attr *attr; + char value[NAME_SIZE] = { '\0', }; struct stat statbuf; int fd; ssize_t size; size_t sysfs_len; - dbg("open '%s'/'%s'\n", devpath, attr_name); + dbg("open '%s'/'%s'", devpath, attr_name); sysfs_len = strlcpy(path_full, sysfs_path, 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, "/", sizeof(path_full)); strlcat(path_full, attr_name, sizeof(path_full)); - /* look for attribute in cache */ - list_for_each_entry(attr_loop, &attr_list, node) { - if (strcmp(attr_loop->path, path) == 0) { - dbg("found in cache '%s'\n", attr_loop->path); - return attr_loop->value; - } - } - - /* store attribute in cache (also negatives are kept in cache) */ - dbg("new uncached attribute '%s'\n", path_full); - attr = malloc(sizeof(struct sysfs_attr)); - if (attr == NULL) - return NULL; - memset(attr, 0x00, sizeof(struct sysfs_attr)); - strlcpy(attr->path, path, sizeof(attr->path)); - dbg("add to cache '%s'\n", path_full); - list_add(&attr->node, &attr_list); - if (lstat(path_full, &statbuf) != 0) { - dbg("stat '%s' failed: %s\n", path_full, strerror(errno)); + dbg("stat '%s' failed: %s", path_full, strerror(errno)); goto out; } @@ -407,9 +368,8 @@ link_target[len] = '\0'; pos = strrchr(link_target, '/'); if (pos != NULL) { - dbg("cache '%s' with link value '%s'\n", path_full, value); - strlcpy(attr->value_local, &pos[1], sizeof(attr->value_local)); - attr->value = attr->value_local; + dbg("cache '%s' with link value '%s'", path_full, value); + strlcpy(value, &pos[1], NAME_SIZE); } } goto out; @@ -426,7 +386,7 @@ /* read attribute value */ fd = open(path_full, O_RDONLY); if (fd < 0) { - dbg("attribute '%s' can not be opened\n", path_full); + dbg("attribute '%s' can not be opened", path_full); goto out; } size = read(fd, value, sizeof(value)); @@ -439,12 +399,11 @@ /* got a valid value, store and return it */ value[size] = '\0'; remove_trailing_chars(value, '\n'); - dbg("cache '%s' with attribute value '%s'\n", path_full, value); - strlcpy(attr->value_local, value, sizeof(attr->value_local)); - attr->value = attr->value_local; out: - return attr->value; + if (value[0] == '\0') + return NULL; + return strdup(value); } int sysfs_lookup_devpath_by_subsys_id(char *devpath_full, size_t len, const char *subsystem, const char *id) @@ -554,21 +513,23 @@ if (!sysfs_lookup_devpath_by_subsys_id(devpath, sizeof(devpath), subsys, id)) { - log_debug(3, "Could not lookup devpath for %s %s\n", + log_debug(3, "Could not lookup devpath for %s %s", subsys, id); return NULL; } sysfs_value = sysfs_attr_get_value(devpath, param); if (!sysfs_value) { - log_debug(3, "Could not read attr %s on path %s\n", + log_debug(3, "Could not read attr %s on path %s", param, devpath); return NULL; } if (!strncmp(sysfs_value, "", 6) || - !strncmp(sysfs_value, "(null)", 6)) + !strncmp(sysfs_value, "(null)", 6)) { + free(sysfs_value); return NULL; + } return sysfs_value; } @@ -585,6 +546,7 @@ errno = 0; *value = strtoul(sysfs_value, NULL, 0); + free(sysfs_value); if (errno) return errno; return 0; @@ -600,6 +562,7 @@ return EIO; *value = atoi(sysfs_value); + free(sysfs_value); return 0; } @@ -619,6 +582,7 @@ sysfs_value[len - 1] = '\0'; strncpy(value, sysfs_value, value_size); value[value_size - 1] = '\0'; + free(sysfs_value); return 0; } @@ -631,8 +595,11 @@ if (!sysfs_value) return EIO; - if (sscanf(sysfs_value, "%" PRIu64 "\n", value) != 1) + if (sscanf(sysfs_value, "%" PRIu64 "\n", value) != 1) { + free(sysfs_value); return EINVAL; + } + free(sysfs_value); return 0; } @@ -647,6 +614,7 @@ return EIO; *value = (uint8_t)atoi(sysfs_value); + free(sysfs_value); return 0; } @@ -661,6 +629,7 @@ return EIO; *value = (uint16_t)atoi(sysfs_value); + free(sysfs_value); return 0; } @@ -671,12 +640,11 @@ char devpath[PATH_SIZE]; size_t sysfs_len; char path_full[PATH_SIZE]; - const char *path; int rc = 0, fd; if (!sysfs_lookup_devpath_by_subsys_id(devpath, sizeof(devpath), subsys, id)) { - log_debug(3, "Could not lookup devpath for %s %s\n", + log_debug(3, "Could not lookup devpath for %s %s", subsys, id); return EIO; } @@ -684,25 +652,24 @@ sysfs_len = strlcpy(path_full, sysfs_path, 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, "/", sizeof(path_full)); strlcat(path_full, attr_name, sizeof(path_full)); if (lstat(path_full, &statbuf)) { - log_debug(3, "Could not stat %s\n", path_full); + log_debug(3, "Could not stat %s", path_full); return errno; } if ((statbuf.st_mode & S_IWUSR) == 0) { - log_error("Could not write to %s. Invalid permissions.\n", + log_error("Could not write to %s. Invalid permissions.", path_full); return EACCES; } fd = open(path_full, O_WRONLY); if (fd < 0) { - log_error("Could not open %s err %d\n", path_full, errno); + log_error("Could not open %s err %d", path_full, errno); return errno; } @@ -711,3 +678,43 @@ close(fd); return rc; } + +char *sysfs_get_uevent_field(const char *path, const char *field) +{ + char *uevent_path = NULL; + FILE *f = NULL; + char *line, buffer[1024]; + char *ff, *d; + char *out = NULL; + + uevent_path = calloc(1, PATH_MAX); + if (!uevent_path) + return NULL; + snprintf(uevent_path, PATH_MAX, "%s/uevent", path); + + f = fopen(uevent_path, "r"); + if (!f) + goto out; + while ((line = fgets(buffer, sizeof (buffer), f))) { + ff = strtok(line, "="); + d = strtok(NULL, "\n"); + if (strcmp(ff, field)) + continue; + out = strdup(d); + break; + } + fclose(f); +out: + free(uevent_path); + return out; +} + +char *sysfs_get_uevent_devtype(const char *path) +{ + return sysfs_get_uevent_field(path, "DEVTYPE"); +} + +char *sysfs_get_uevent_devname(const char *path) +{ + return sysfs_get_uevent_field(path, "DEVNAME"); +} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/sysfs.h open-iscsi-2.0.874/usr/sysfs.h --- open-iscsi-2.0.873+git0.3b4b4500/usr/sysfs.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/sysfs.h 2016-09-29 18:33:24.000000000 +0000 @@ -66,4 +66,8 @@ extern int sysfs_set_param(char *id, char *subsys, char *attr_name, char *write_buf, ssize_t buf_size); +extern char *sysfs_get_uevent_field(const char *path, const char *field); +extern char *sysfs_get_uevent_devtype(const char *path); +extern char *sysfs_get_uevent_devname(const char *path); + #endif diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/transport.c open-iscsi-2.0.874/usr/transport.c --- open-iscsi-2.0.873+git0.3b4b4500/usr/transport.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/transport.c 2016-09-29 18:33:24.000000000 +0000 @@ -58,7 +58,8 @@ struct iscsi_transport_template cxgb3i = { .name = "cxgb3i", - .set_host_ip = 1, + .set_host_ip = SET_HOST_IP_OPT, + .bind_ep_required = 1, .ep_connect = ktransport_ep_connect, .ep_poll = ktransport_ep_poll, .ep_disconnect = ktransport_ep_disconnect, @@ -67,7 +68,8 @@ struct iscsi_transport_template cxgb4i = { .name = "cxgb4i", - .set_host_ip = 1, + .set_host_ip = SET_HOST_IP_NOT_REQ, + .bind_ep_required = 1, .ep_connect = ktransport_ep_connect, .ep_poll = ktransport_ep_poll, .ep_disconnect = ktransport_ep_disconnect, @@ -76,16 +78,19 @@ struct iscsi_transport_template bnx2i = { .name = "bnx2i", - .set_host_ip = 1, + .set_host_ip = SET_HOST_IP_REQ, .use_boot_info = 1, + .bind_ep_required = 1, .ep_connect = ktransport_ep_connect, .ep_poll = ktransport_ep_poll, .ep_disconnect = ktransport_ep_disconnect, .set_net_config = uip_broadcast_params, + .exec_ping = uip_broadcast_ping_req, }; struct iscsi_transport_template be2iscsi = { .name = "be2iscsi", + .bind_ep_required = 1, .create_conn = be2iscsi_create_conn, .ep_connect = ktransport_ep_connect, .ep_poll = ktransport_ep_poll, @@ -94,7 +99,8 @@ struct iscsi_transport_template qla4xxx = { .name = "qla4xxx", - .set_host_ip = 0, + .set_host_ip = SET_HOST_IP_NOT_REQ, + .bind_ep_required = 1, .ep_connect = ktransport_ep_connect, .ep_poll = ktransport_ep_poll, .ep_disconnect = ktransport_ep_disconnect, @@ -102,6 +108,7 @@ struct iscsi_transport_template ocs = { .name = "ocs", + .bind_ep_required = 1, .ep_connect = ktransport_ep_connect, .ep_poll = ktransport_ep_poll, .ep_disconnect = ktransport_ep_disconnect, @@ -143,7 +150,7 @@ for (i = 0; ifni[i].if_index && ifni[i].if_name; i++) { struct if_nameindex *n = &ifni[i]; - log_debug(6, "kmod probe found %s\n", n->if_name); + log_debug(6, "kmod probe found %s", n->if_name); strlcpy(if_hwaddr.ifr_name, n->if_name, IFNAMSIZ); if (ioctl(sockfd, SIOCGIFHWADDR, &if_hwaddr) < 0) @@ -275,12 +282,12 @@ if (!strcmp(tmpl->name, t->name)) { t->template = tmpl; - log_debug(3, "Matched transport %s\n", t->name); + log_debug(3, "Matched transport %s", t->name); return 0; } } log_error("Could not find template for %s. An updated iscsiadm " - "is probably needed.\n", t->name); + "is probably needed.", t->name); return ENOSYS; } diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/transport.h open-iscsi-2.0.874/usr/transport.h --- open-iscsi-2.0.873+git0.3b4b4500/usr/transport.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/transport.h 2016-09-29 18:33:24.000000000 +0000 @@ -20,6 +20,12 @@ #include "types.h" #include "config.h" +enum set_host_ip_opts { + SET_HOST_IP_NOT_REQ, /* iface.ipaddress is not supported */ + SET_HOST_IP_REQ, /* iface.ipaddress must be specified */ + SET_HOST_IP_OPT, /* iface.ipaddress is not required */ +}; + struct iscsi_transport; struct iscsi_conn; @@ -32,6 +38,7 @@ */ uint8_t set_host_ip; uint8_t use_boot_info; + uint8_t bind_ep_required; int (*ep_connect) (struct iscsi_conn *conn, int non_blocking); int (*ep_poll) (struct iscsi_conn *conn, int timeout_ms); void (*ep_disconnect) (struct iscsi_conn *conn); @@ -39,6 +46,9 @@ int (*set_net_config) (struct iscsi_transport *t, struct iface_rec *iface, struct iscsi_session *session); + int (*exec_ping) (struct iscsi_transport *t, + struct iface_rec *iface, int datalen, + struct sockaddr_storage *dst_addr, uint32_t *status); }; /* represents data path provider */ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/uip_mgmt_ipc.c open-iscsi-2.0.874/usr/uip_mgmt_ipc.c --- open-iscsi-2.0.873+git0.3b4b4500/usr/uip_mgmt_ipc.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/uip_mgmt_ipc.c 2016-09-29 18:33:24.000000000 +0000 @@ -15,10 +15,12 @@ */ #include +#include #include "log.h" #include "uip_mgmt_ipc.h" #include "iscsid_req.h" +#include "iscsi_err.h" int uip_broadcast_params(struct iscsi_transport *t, struct iface_rec *iface, @@ -26,7 +28,7 @@ { struct iscsid_uip_broadcast broadcast; - log_debug(3, "broadcasting to uip\n"); + log_debug(3, "broadcasting to uip"); memset(&broadcast, 0, sizeof(broadcast)); @@ -37,5 +39,40 @@ return uip_broadcast(&broadcast, sizeof(iscsid_uip_broadcast_header_t) + - sizeof(*iface)); + sizeof(*iface), O_NONBLOCK, NULL); +} + +int uip_broadcast_ping_req(struct iscsi_transport *t, + struct iface_rec *iface, int datalen, + struct sockaddr_storage *dst_addr, uint32_t *status) +{ + struct iscsid_uip_broadcast broadcast; + int len = 0; + + log_debug(3, "broadcasting ping request to uip\n"); + + memset(&broadcast, 0, sizeof(broadcast)); + + broadcast.header.command = ISCSID_UIP_IPC_PING; + len = sizeof(*iface) + sizeof(*dst_addr) + sizeof(datalen); + broadcast.header.payload_len = len; + + memcpy(&broadcast.u.ping_rec.ifrec, iface, sizeof(*iface)); + + if (dst_addr->ss_family == PF_INET) { + len = sizeof(struct sockaddr_in); + } else if (dst_addr->ss_family == PF_INET6) { + len = sizeof(struct sockaddr_in6); + } else { + log_error("%s unknown addr family %d\n", + __FUNCTION__, dst_addr->ss_family); + return ISCSI_ERR_INVAL; + } + + memcpy(&broadcast.u.ping_rec.ipaddr, dst_addr, len); + broadcast.u.ping_rec.datalen = datalen; + + return uip_broadcast(&broadcast, + sizeof(iscsid_uip_broadcast_header_t) + + broadcast.header.payload_len, 0, status); } diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/uip_mgmt_ipc.h open-iscsi-2.0.874/usr/uip_mgmt_ipc.h --- open-iscsi-2.0.873+git0.3b4b4500/usr/uip_mgmt_ipc.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/uip_mgmt_ipc.h 2016-09-29 18:33:24.000000000 +0000 @@ -29,6 +29,7 @@ typedef enum iscsid_uip_cmd { ISCSID_UIP_IPC_UNKNOWN = 0, ISCSID_UIP_IPC_GET_IFACE = 1, + ISCSID_UIP_IPC_PING = 2, __ISCSID_UIP_IPC_MAX_COMMAND } iscsid_uip_cmd_e; @@ -47,6 +48,13 @@ struct ipc_broadcast_iface_rec { struct iface_rec rec; } iface_rec; + + struct ipc_broadcast_ping_rec { + struct iface_rec ifrec; + struct sockaddr_storage ipaddr; + int datalen; + int *status; + } ping_rec; } u; } iscsid_uip_broadcast_t; @@ -63,11 +71,16 @@ typedef struct iscsid_uip_mgmt_rsp { iscsid_uip_cmd_e command; iscsid_uip_mgmt_ipc_err_e err; + enum iscsi_ping_status_code ping_sc; } iscsid_uip_rsp_t; extern int uip_broadcast_params(struct iscsi_transport *t, struct iface_rec *iface, struct iscsi_session *session); +extern int uip_broadcast_ping_req(struct iscsi_transport *t, + struct iface_rec *iface, int datalen, + struct sockaddr_storage *dst_addr, + uint32_t *status); #endif /* UIP_MGMT_IPC_H */ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/usr/version.h open-iscsi-2.0.874/usr/version.h --- open-iscsi-2.0.873+git0.3b4b4500/usr/version.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/usr/version.h 2016-09-29 18:33:24.000000000 +0000 @@ -6,7 +6,7 @@ * This may not be the same value as the kernel versions because * some other maintainer could merge a patch without going through us */ -#define ISCSI_VERSION_STR "2.0-873" +#define ISCSI_VERSION_STR "2.0-874" #define ISCSI_VERSION_FILE "/sys/module/scsi_transport_iscsi/version" #endif diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/fwparam_ibft/fw_entry.c open-iscsi-2.0.874/utils/fwparam_ibft/fw_entry.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/fwparam_ibft/fw_entry.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/fwparam_ibft/fw_entry.c 2016-09-29 18:33:24.000000000 +0000 @@ -41,8 +41,6 @@ /** * fw_setup_nics - setup nics (ethXs) based on ibft net info * - * Currently does not support vlans. - * * If this is a offload card, this function does nothing. The * net info is used by the iscsi iface settings for the iscsi * function. @@ -67,21 +65,22 @@ * to force iSCSI traffic through correct NIC */ list_for_each_entry(context, &targets, list) { - /* if it is a offload nic ignore it */ - if (!net_get_transport_name_from_netdev(context->iface, + /* if it is a offload nic ignore it */ + if (!net_get_transport_name_from_netdev(context->iface, transport)) continue; if (iface_prev == NULL || strcmp(context->iface, iface_prev)) { /* Note: test above works because there is a - * maximum of two targets in the iBFT - */ + * maximum of two targets in the iBFT + */ iface_prev = context->iface; needs_bringup = 1; } err = net_setup_netdev(context->iface, context->ipaddr, context->mask, context->gateway, + context->vlan, context->target_ipaddr, needs_bringup); if (err) ret = err; @@ -192,10 +191,13 @@ if (strlen(context->mac)) printf("%s = %s\n", IFACE_HWADDR, context->mac); /* - * If this has a valid address then DHCP was used (broadcom sends - * 0.0.0.0). + * If the 'origin' field is 3 (IBFT_IP_PREFIX_ORIGIN_DHCP), + * then DHCP is used. + * Otherwise evaluate the 'dhcp' field, if this has a valid + * address then DHCP was used (broadcom sends 0.0.0.0). */ - if (strlen(context->dhcp) && strcmp(context->dhcp, "0.0.0.0")) + if ((context->origin == IBFT_IP_PREFIX_ORIGIN_DHCP) || + (strlen(context->dhcp) && strcmp(context->dhcp, "0.0.0.0"))) printf("%s = DHCP\n", IFACE_BOOT_PROTO); else printf("%s = STATIC\n", IFACE_BOOT_PROTO); diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/fwparam_ibft/fwparam_ibft_sysfs.c open-iscsi-2.0.874/utils/fwparam_ibft/fwparam_ibft_sysfs.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/fwparam_ibft/fwparam_ibft_sysfs.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/fwparam_ibft/fwparam_ibft_sysfs.c 2016-09-29 18:33:24.000000000 +0000 @@ -201,6 +201,8 @@ sizeof(context->secondary_dns)); sysfs_get_str(id, IBFT_SUBSYS, "dhcp", context->dhcp, sizeof(context->dhcp)); + sysfs_get_str(id, IBFT_SUBSYS, "origin", context->origin, + sizeof(context->origin)); return 0; } diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/fwparam_ibft/fwparam_sysfs.c open-iscsi-2.0.874/utils/fwparam_ibft/fwparam_sysfs.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/fwparam_ibft/fwparam_sysfs.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/fwparam_ibft/fwparam_sysfs.c 2016-09-29 18:33:24.000000000 +0000 @@ -170,6 +170,18 @@ { int rc; + rc = sysfs_get_int(id, subsys, "flags", &context->nic_flags); + /* + * Per spec we would need to check against Bit 0 + * (Block Valid Flag), but some firmware only + * sets Bit 1 (Firmware Booting Selected). + * So any setting is deemed okay. + */ + if (!rc && (context->nic_flags == 0)) + rc = ENODEV; + if (rc) + return rc; + rc = sysfs_get_str(id, subsys, "mac", context->mac, sizeof(context->mac)); if (rc) @@ -217,6 +229,7 @@ sizeof(context->secondary_dns)); sysfs_get_str(id, subsys, "dhcp", context->dhcp, sizeof(context->dhcp)); + sysfs_get_int(id, subsys, "origin", (int *)&context->origin); return 0; } @@ -235,6 +248,18 @@ { int rc; + rc = sysfs_get_int(id, subsys, "flags", &context->target_flags); + /* + * Per spec we would need to check against Bit 0 + * (Block Valid Flag), but some firmware only + * sets Bit 1 (Firmware Booting Selected). + * So any setting is deemed okay. + */ + if (!rc && (context->target_flags == 0)) + rc = ENODEV; + if (rc) + return rc; + rc = sysfs_get_str(id, subsys, "target-name", context->targetname, sizeof(context->targetname)); if (rc) @@ -323,7 +348,7 @@ nic_cnt = 0; tgt_cnt = 0; if (file_exist(initiator_dir)) { - /* Find the target's and the ethernet's */ + /* Find the targets and the ethernets */ rc = nftw(rootdir, find_sysfs_dirs, 20, 1); /* Find wihch target and which ethernet have @@ -399,7 +424,7 @@ nic_cnt = 0; tgt_cnt = 0; - /* Find the target's and the ethernet's */ + /* Find the targets and the ethernets */ nftw(rootdir, find_sysfs_dirs, 20, 1); for (i = 0; i < tgt_cnt; i++) { context = calloc(1, sizeof(*context)); diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/fwparam_ibft/Makefile open-iscsi-2.0.874/utils/fwparam_ibft/Makefile --- open-iscsi-2.0.873+git0.3b4b4500/utils/fwparam_ibft/Makefile 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/fwparam_ibft/Makefile 2016-09-29 18:33:24.000000000 +0000 @@ -21,14 +21,14 @@ # "Prasanna Mumbai" # -SYSDEPS_OBJS = $(wildcard ../sysdeps/*.o) +SYSDEPS_OBJS = $(sort $(wildcard ../sysdeps/*.o)) OBJS := fw_entry.o fwparam_sysfs.o $(SYSDEPS_OBJS) ../../usr/iscsi_net_util.o OBJS += prom_lex.o prom_parse.tab.o fwparam_ppc.o CLEANFILES = $(OBJS) *.output *~ -OPTFLAGS ?= -O2 -g -fPIC +CFLAGS ?= -O2 -g WARNFLAGS ?= -Wall -Wstrict-prototypes -CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -I../../include -I../../usr -D_GNU_SOURCE +CFLAGS += -fPIC $(WARNFLAGS) -I../../include -I../../usr -D_GNU_SOURCE all: $(OBJS) diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/iscsi_discovery open-iscsi-2.0.874/utils/iscsi_discovery --- open-iscsi-2.0.873+git0.3b4b4500/utils/iscsi_discovery 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/iscsi_discovery 2016-09-29 18:33:24.000000000 +0000 @@ -39,7 +39,7 @@ echo "Options:" echo "-p set the port number (defualt is 3260)." echo "-d print debugging information" - echo "-t set trasnpot (default is tcp)." + echo "-t set transport (default is tcp)." echo "-f force specific transport -disable the fallback to tcp (default is fallback enabled)." echo " force the transport specified by the argument of the -t flag." echo "-m manual startup - will set manual startup (default is automatic startup)." diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/iscsi-gen-initiatorname open-iscsi-2.0.874/utils/iscsi-gen-initiatorname --- open-iscsi-2.0.873+git0.3b4b4500/utils/iscsi-gen-initiatorname 1970-01-01 00:00:00.000000000 +0000 +++ open-iscsi-2.0.874/utils/iscsi-gen-initiatorname 2016-09-29 18:33:24.000000000 +0000 @@ -0,0 +1,73 @@ +#!/bin/bash +# +# /sbin/iscsi-gen-initiatorname +# +# Generate a default iSCSI Initiatorname for SUSE installations. +# +# Copyright (c) 2011 Hannes Reinecke, SUSE Labs +# This script is licensed under the GPL. +# + +if [ "$1" ] ; then + if [ "$1" = "-f" ] ; then + FORCE=1 + else + echo "Invalid option $1" + echo "Usage: $0 [-f]" + exit 1 + fi +fi + +if [ -d /sys/firmware/ibft/initiator ] ; then + read iSCSI_INITIATOR_NAME < /sys/firmware/ibft/initiator/initiator-name +fi + +if [ -f /etc/iscsi/initiatorname.iscsi -a -z "$FORCE" ] ; then + if [ "$iSCSI_INITIATOR_NAME" ] ; then + eval $(cat /etc/iscsi/initiatorname.iscsi | sed -e '/^#/d') + if [ "$iSCSI_INITIATOR_NAME" != "$InitiatorName" ] ; then + echo "iSCSI Initiatorname from iBFT is different from the current setting." + echo "Please call '/sbin/iscsi-gen-initiatorname -f' to update the iSCSI Initiatorname." + exit 1 + fi + fi +fi + +if [ "$iSCSI_INITIATOR_NAME" ] ; then + cat << EOF >> /etc/iscsi/initiatorname.iscsi +## +## /etc/iscsi/iscsi.initiatorname +## +## iSCSI Initiatorname taken from iBFT BIOS tables. +## +## DO NOT EDIT OR REMOVE THIS FILE! +## If you remove this file, the iSCSI daemon will not start. +## Any change here will not be reflected to the iBFT BIOS tables. +## If a different initiatorname is required please change the +## initiatorname in the BIOS setup and call +## /sbin/iscsi-gen-initiatorname -f +## to recreate an updated version of this file. +## +InitiatorName=$iSCSI_INITIATOR_NAME +EOF +fi + +if [ ! -f /etc/iscsi/initiatorname.iscsi ] ; then + cat << EOF >> /etc/iscsi/initiatorname.iscsi +## +## /etc/iscsi/iscsi.initiatorname +## +## Default iSCSI Initiatorname. +## +## DO NOT EDIT OR REMOVE THIS FILE! +## If you remove this file, the iSCSI daemon will not start. +## If you change the InitiatorName, existing access control lists +## may reject this initiator. The InitiatorName must be unique +## for each iSCSI initiator. Do NOT duplicate iSCSI InitiatorNames. +EOF + ISSUEDATE="1996-04" + INAME=$(/sbin/iscsi-iname -p iqn.$ISSUEDATE.de.suse:01) + printf "InitiatorName=$INAME\n" >>/etc/iscsi/initiatorname.iscsi + chmod 0600 /etc/iscsi/initiatorname.iscsi +fi + diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/iscsi_offload open-iscsi-2.0.874/utils/iscsi_offload --- open-iscsi-2.0.873+git0.3b4b4500/utils/iscsi_offload 1970-01-01 00:00:00.000000000 +0000 +++ open-iscsi-2.0.874/utils/iscsi_offload 2016-09-29 18:33:24.000000000 +0000 @@ -0,0 +1,378 @@ +#!/bin/bash +# +# iscsi_offload +# +# Configure iSCSI offload engines for use with open-iscsi +# Usage: +# iscsi_offload [-d | -f | -i | -t ] +# +# Copyright (c) 2011 Hannes Reinecke, SUSE Labs +# This script is licensed under the GPL. +# +# The script creates an open-iscsi interface definition +# in the style -, where matches the +# network interface passed on the commandline. +# If '-t' (test mode) is passed as an option, the script +# will not create nor modify any setting but just print +# the currently active ones. +# +# Currently the script works with Broadcom (bnx2i) and +# Chelsio T3 (cxgbi) iSCSI offload engines. +# Should work with Chelsio T4, but has not been tested. +# ServerEngines (be2iscsi) and QLogic (qla4xxx) can only +# be configured via BIOS, open-iscsi support is still in +# development. +# + +# +# Return codes: +# 0: Success +# 1: Invalid command line parameter +# 2: iSCSI offloading not supported +# 3: Error during module loading +# 4: Cannot configure interface via iscsiadm, use BIOS setup +# 5: internal error running iscsiadm +# +# Output: +# [none|dhcp|ip |ibft] +# where +# : MAC Address of the iSCSI offload engine +# none: No IP configuration set for the iSCSI offload engine +# dhcp: iSCSI offload engine configured for DHCP +# ip: iSCSI offload engine configured with static IP address +# ibft: iSCSI offload engine configured from iBFT values +# + +# +# Figure out the MAC address of the iSCSI offload engine +# corresponding to a NIC from a given PCI device. +# bnx2 is using one PCI device per port for both network and iSCSI offloading +# cxgb3 is using one PCI device for everything. +# +iscsi_macaddress_from_pcidevice() +{ + local path=$1 + local if=$2 + local h + local host + + for h in $path/host* ; do + if [ -d "$h" ] ; then + host=${h##*/} + read netdev < /sys/class/iscsi_host/$host/netdev + if [ "$netdev" = "$IFNAME" ] ; then + read mac < /sys/class/iscsi_host/$host/hwaddress + if [ "$mac" != "00:00:00:00:00:00" ] ; then + echo "$mac" + fi + break; + fi + fi + done +} + +# +# Figure out the MAC address of the iSCSI offload engine +# corresponding to a NIC from a given PCI function. +# It is assumed that the MAC address of the iSCSI offload +# engine is equal of the MAC address of the NIC plus one. +# Suitable for be2iscsi and qla4xxx +# +iscsi_macaddress_from_pcifn() +{ + local path=$1 + local if=$2 + local h + local host + local ifmac + + ifmac=$(ip addr show dev $if | sed -n 's/ *link\/ether \(.*\) brd.*/\1/p') + m5=$(( 0x${ifmac##*:} )) + m5=$(( $m5 + 1 )) + ifmac=$(printf "%s:%02x" ${ifmac%:*} $m5) + for host in /sys/class/iscsi_host/host* ; do + if [ -L "$host" ] ; then + read mac < $host/hwaddress + if [ "$mac" = "$ifmac" ] ; then + echo "$mac" + break; + fi + fi + done +} + +update_iface_setting() { + local iface="$1" + local name="$2" + local value="$3" + + iface_value=$(iscsiadm -m iface -I $iface | sed -n "s/$name = \(.*\)/\1/p") + if [ "$iface_value" = "" ] ; then + iface_value= + fi + if [ "$iface_value" != "$value" ] ; then + if ! iscsiadm -m iface -I $iface -o update -n "$name" -v "$value" ; then + return 1 + fi + fi + return 0 +} + +while getopts di:t options ; do + case $options in + d ) mode=dhcp;; + i ) mode=static + optaddr=$OPTARG + ;; + f ) mode=firmware;; + t ) dry_run=1;; + ?) printf "Usage: %s [-d|-t|-i ipaddr|-f] ifname\n" $0 + exit 1;; + esac +done +shift $(($OPTIND - 1)) + +IFNAME=$1 +ibft_mode="none" + +if [ -z "$IFNAME" ] ; then + echo "No interface specified" + exit 1 +fi + +if [ "$dry_run" ] ; then + if [ "$mode" = "dhcp" ] ; then + echo "'-t' specified, ignoring '-d'" + mode= + elif [ "$mode" = "static" ] ; then + echo "'-t' specified, ignoring '-s'" + mode= + fi +fi + +if [ ! -L /sys/class/net/$IFNAME ] ; then + echo "Interface $IFNAME not found" + exit 1 +fi + +if [ "$optaddr" ] && ! ip route get $optaddr ; then + echo "Invalid IP address $optaddr" + exit 1 +fi +if [ "$dry_run" ] ; then + mode= +fi + + +ifpath=$(cd -P /sys/class/net/$IFNAME; echo $PWD) +pcipath=$(cd -P $ifpath/device; echo $PWD) + +if [ -d $pcipath ] ; then + drvlink=$(readlink $pcipath/driver) + driver=${drvlink##*/} +fi + +if [ -z "$driver" ] ; then + echo "No driver found for interface $IFNAME" + exit 1 +fi + +case "$driver" in + bnx2*) + mod=bnx2i + ;; + cxgb*) + mod=cxgb3i + ;; + be2*) + mod=be2iscsi + ;; + qla*) + mod=qla4xxx + ;; +esac + +if [ -z "$mod" ] ; then + echo "iSCSI offloading not supported on interface $IFNAME" + exit 2 +fi + +# Check if the required modules are already loaded +loaded=$(sed -n "/^$mod/p" /proc/modules) +if [ -z "$loaded" ] ; then + modprobe $mod +fi + +loaded=$(sed -n "/^$mod/p" /proc/modules) +if [ -z "$loaded" ] ; then + echo "Loading of $mod.ko failed, please check dmesg" + exit 3 +fi + +# Get the correct MAC address for the various devices +if [ "$mod" = "bnx2i" ] ; then + mac=$(iscsi_macaddress_from_pcidevice $pcipath $IFNAME) +elif [ "$mod" = "cxgb3i" ] ; then + mac=$(iscsi_macaddress_from_pcidevice $pcipath $IFNAME) +elif [ "$mod" = "be2iscsi" ] ; then + mac=$(iscsi_macaddress_from_pcifn $pcipath $IFNAME) +elif [ "$mod" = "qla4xxx" ] ; then + mac=$(iscsi_macaddress_from_pcifn $pcipath $IFNAME) +fi + +if [ -z "$mac" ] ; then + echo "iSCSI offloading not supported on interface $IFNAME" + exit 2 +fi + +gen_iface="$mod.$mac" +ioe_iface="${IFNAME}-${mod}" + +# Get existing settings +if iscsiadm -m iface -I $ioe_iface > /dev/null 2>&1 ; then + ioe_mac=$(iscsiadm -m iface -I $ioe_iface 2> /dev/null| sed -n "s/iface\.hwaddress = \(.*\)/\1/p") + ioe_mod=$(iscsiadm -m iface -I $ioe_iface 2> /dev/null| sed -n "s/iface\.transport_name = \(.*\)/\1/p") + ipaddr=$(iscsiadm -m iface -I $ioe_iface 2> /dev/null| sed -n "s/iface\.ipaddress = \(.*\)/\1/p") + if [ "$ipaddr" == "" ] ; then + ipaddr= + fi +elif [ "$mod" = "be2iscsi" ] ; then + ioe_mac=$mac + ioe_mod=$mod +else + # Create new interface + iscsiadm -m iface -I $ioe_iface --op=new 2> /dev/null + ioe_mac= + ioe_mod= + ipaddr= +fi + +if [ -z "$dry_run" ] ; then + if [ "$ioe_mac" != "$mac" ] ; then + if [ -n "$ioe_mac" ] ; then + echo "Warning: Updating MAC address on iface $ioe_iface" + fi + update_iface_setting $ioe_iface iface.hwaddress "$mac" + fi + + if [ "$ioe_mod" != "$mod" ] ; then + if [ -n "$ioe_mod" ] ; then + echo "Warning: Update transport on iface $ioe_iface" + fi + update_iface_setting $ioe_iface iface.transport_name "$mod" + fi +elif [ -z "$ipaddr" ] ; then + ipaddr=$(iscsiadm -m iface -I $gen_iface 2> /dev/null| sed -n "s/iface\.ipaddress = \(.*\)/\1/p") + if [ "$ipaddr" = "" ] ; then + ipaddr= + fi +elif [ "$ioe_mod" != "$mod" ] ; then + echo "Warning: Transport mismatch on iface $ioe_iface: $ioe_mod should be $mod" +fi + +# Check iBFT setting +for d in /sys/firmware/* ; do + [ -d $d ] || continue + [ -d $d/ethernet0 ] || continue + iboot_dir=$d +done +if [ -n "$iboot_dir" ] && [ -d "$iboot_dir" ] ; then + for if in ${iboot_dir}/ethernet* ; do + read ibft_mac < $if/mac + [ "$ibft_mac" = "$mac" ] || continue + ibft_origin=0 + [ -f ${if}/origin ] && read ibft_origin < $if/origin + if [ "$ibft_origin" -eq 1 ] ; then + ibft_mode="static" + elif [ "$ibft_origin" -eq 3 ] ; then + ibft_mode="dhcp" + fi + [ -f $if/dhcp ] && read ibft_dhcp < $if/dhcp + if [ -n "$ibft_dhcp" -a "$ibft_mode" != "dhcp" ] ; then + ibft_mode=dhcp + fi + if [ "$ibft_mode" = "dhcp" ] ; then + ibft_ipaddr="0.0.0.0" + ibft_gateway= + ibft_mask= + break + fi + [ -f $if/ip-addr ] && read ibft_ipaddr < $if/ip-addr + [ -f $if/gateway ] && read ibft_gateway < $if/gateway + [ -f $if/subnet-mask ] && read ibft_mask < $if/subnet-mask + break + done +fi + +if [ -z "$optaddr" ] && [ "$ibft_ipaddr" ] ; then + optaddr=$ibft_ipaddr +fi + +# Check if the interface needs to be configured +if [ -z "$mode" ] ; then + if [ "$ibft_mode" != "none" ] ; then + echo "$mac ibft" + mode="ibft" + elif [ -z "$ipaddr" ] ; then + echo "$mac none" + mode="none" + elif [ "$ipaddr" = "0.0.0.0" ] ; then + echo "$mac dhcp" + ipaddr= + mode="dhcp" + else + echo "$mac ip $ipaddr" + mode="static" + fi + [ "$dry_run" ] && exit 0 +elif [ "$mode" = "dhcp" ] ; then + if [ "$ipaddr" = "0.0.0.0" ] ; then + echo "$mac dhcp" + exit 0 + fi + optaddr="0.0.0.0" +elif [ "$mode" = "static" ] && [ "$ipaddr" = "$optaddr" ] ; then + echo "$mac ip $ipaddr" + exit 0 +fi + +if [ "$mod" = "be2iscsi" ] ; then + exit 4 +fi + +if ! update_iface_setting $ioe_iface iface.ipaddress "$optaddr" ; then + echo "Failed to set IP address: $?" + exit 1 +fi +if ! update_iface_setting $gen_iface iface.ipaddress "$optaddr" ; then + echo "Failed to set IP address for generic interface: $?" + exit 1 +fi + +if ! update_iface_setting $ioe_iface iface.gateway "$ibft_gateway" ; then + echo "Failed to set gateway address: $?" + exit 1 +fi + +if ! update_iface_setting $gen_iface iface.gateway "$ibft_gateway" ; then + echo "Failed to set gateway address for generic interface: $?" + exit 1 +fi + +if ! update_iface_setting $ioe_iface iface.subnet_mask "$ibft_mask" ; then + echo "Failed to set subnet mask: $?" + exit 1 +fi + +if ! update_iface_setting $gen_iface iface.subnet_mask "$ibft_mask" ; then + echo "Failed to set subnet mask for generic interface: $?" + exit 1 +fi + +if [ "$mod" = "qla4xxx" ] ; then + iscsiadm -m iface -H $mac -o applyall +fi +ip link set dev $IFNAME up + +exit 0 + diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/Makefile open-iscsi-2.0.874/utils/Makefile --- open-iscsi-2.0.873+git0.3b4b4500/utils/Makefile 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/Makefile 2016-09-29 18:33:24.000000000 +0000 @@ -1,12 +1,13 @@ # This Makefile will work only with GNU make. -CFLAGS += $(OPTFLAGS) -O2 -fno-inline -Wall -Wstrict-prototypes -g +CFLAGS ?= -O2 -fno-inline -g +CFLAGS += -Wall -Wstrict-prototypes PROGRAMS = iscsi-iname all: $(PROGRAMS) iscsi-iname: md5.o iscsi-iname.o - $(CC) $(CFLAGS) $^ $(DBM_LIB) -o $@ + $(CC) $(CFLAGS) $(LDFLAGS) $^ $(DBM_LIB) -o $@ clean: rm -f *.o $(PROGRAMS) .depend diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/md5.c open-iscsi-2.0.874/utils/md5.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/md5.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/md5.c 2016-09-29 18:33:24.000000000 +0000 @@ -133,7 +133,7 @@ byteSwap(ctx->buf, 4); memcpy(digest, ctx->buf, 16); - memset(ctx, 0, sizeof (ctx)); /* In case it's sensitive */ + memset(ctx, 0, sizeof (*ctx)); /* In case it's sensitive */ } #ifndef ASM_MD5 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/aclocal/config.guess open-iscsi-2.0.874/utils/open-isns/aclocal/config.guess --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/aclocal/config.guess 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/aclocal/config.guess 1970-01-01 00:00:00.000000000 +0000 @@ -1,1499 +0,0 @@ -#! /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 Free Software Foundation, Inc. - -timestamp='2005-05-27' - -# 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 . -# Please send patches to . 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 ." - -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 -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 -q "$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 ;' - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # 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 ;; - *) 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 ;; - amd64:OpenBSD:*:*) - echo x86_64-unknown-openbsd${UNAME_RELEASE} - exit ;; - amiga:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit ;; - cats:OpenBSD:*:*) - echo arm-unknown-openbsd${UNAME_RELEASE} - exit ;; - hp300:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit ;; - luna88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit ;; - mac68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit ;; - macppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit ;; - mvme68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit ;; - mvme88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit ;; - mvmeppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit ;; - sgi:OpenBSD:*:*) - echo mips64-unknown-openbsd${UNAME_RELEASE} - exit ;; - sun3:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit ;; - *:OpenBSD:*:*) - echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} - exit ;; - *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit ;; - macppc:MirBSD:*:*) - echo powerppc-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@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.*:*) - 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 /* 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 - - 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:*:[45]) - 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 - #include - - 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 - # avoid double evaluation of $set_cc_for_build - test -n "$CC_FOR_BUILD" || 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 - 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:*:*) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; - i*: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 ;; - x86:Interix*:[34]*) - echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' - exit ;; - [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*:*:*) - 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:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - cris:Linux:*:*) - echo cris-axis-linux-gnu - exit ;; - crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu - exit ;; - frv:Linux:*:*) - echo frv-unknown-linux-gnu - exit ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - 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 | grep ^CPU=` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; 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 | grep ^CPU=` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - 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="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - 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-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; - esac - exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu - exit ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux - exit ;; - sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu - 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-gnu" - ;; - a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit ;; - coff-i386) - echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit ;; - "") - # Either a pre-BFD a.out linker (linux-gnuoldld) or - # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit ;; - esac - # Determine whether the default compiler is a.out or elf - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - #ifdef __ELF__ - # ifdef __GLIBC__ - # if __GLIBC__ >= 2 - LIBC=gnu - # else - LIBC=gnulibc1 - # endif - # else - LIBC=gnulibc1 - # endif - #else - #ifdef __INTEL_COMPILER - LIBC=gnu - #else - LIBC=gnuaout - #endif - #endif - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - 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' /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 - echo i586-unisys-sysv4 - exit ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; - i*86:VOS:*:*) - # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos - exit ;; - *:VOS:*:*) - # From Paul.Green@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 ;; - 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 ;; - 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 - *86) UNAME_PROCESSOR=i686 ;; - 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 ;; -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 < -# include -#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 - 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 -# 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 < 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 -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/aclocal/config.sub open-iscsi-2.0.874/utils/open-isns/aclocal/config.sub --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/aclocal/config.sub 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/aclocal/config.sub 1970-01-01 00:00:00.000000000 +0000 @@ -1,1570 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. - -timestamp='2005-05-12' - -# 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 . 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 ." - -version="\ -GNU config.sub ($timestamp) - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -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-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 - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | 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 \ - | bfin \ - | c4x | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64vr | mips64vrel \ - | mips64orion | mips64orionel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | msp430 \ - | ns16k | ns32k \ - | openrisc | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ - | pyramid \ - | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b \ - | strongarm \ - | tahoe | thumb | tic4x | tic80 | tron \ - | v850 | v850e \ - | we32k \ - | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ - | z8k) - basic_machine=$basic_machine-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12) - # Motorola 68HC11/12. - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ - | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | msp430-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ - | pyramid-* \ - | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tron-* \ - | v850-* | v850e-* | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ - | xstormy16-* | xtensa-* \ - | ymp-* \ - | z8k-*) - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - 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 - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - 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 - ;; - cr16c) - basic_machine=cr16c-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 - ;; - 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 - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - mingw32) - basic_machine=i386-pc - os=-mingw32 - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - 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 - ;; - 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 - ;; - or32 | or32-*) - basic_machine=or32-unknown - os=-coff - ;; - 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 - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - 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 - ;; - 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 - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - 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 - ;; - 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 - ;; - 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 - ;; - sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparc | sparcv8 | sparcv9 | sparcv9b) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - *-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* \ - | -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* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -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*) - # 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* \ - | -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 - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - 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 - ;; - 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 - ;; - *-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 -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/aclocal/install-sh open-iscsi-2.0.874/utils/open-isns/aclocal/install-sh --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/aclocal/install-sh 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/aclocal/install-sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,251 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5 (mit/util/scripts/install.sh). -# -# Copyright 1991 by the Massachusetts Institute of Technology -# -# Permission to use, copy, modify, distribute, and sell this software and its -# documentation for any purpose is hereby granted without fee, provided that -# the above copyright notice appear in all copies and that both that -# copyright notice and this permission notice appear in supporting -# documentation, and that the name of M.I.T. not be used in advertising or -# publicity pertaining to distribution of the software without specific, -# written prior permission. M.I.T. makes no representations about the -# suitability of this software for any purpose. It is provided "as is" -# without express or implied warranty. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. It can only install one file at a time, a restriction -# shared with many OS's install programs. - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -transformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - chmodcmd="" - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/attrs.c open-iscsi-2.0.874/utils/open-isns/attrs.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/attrs.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/attrs.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1618 +0,0 @@ -/* - * Handle iSNS attributes and attribute lists - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include -#include -#include -#include "util.h" -#include "vendor.h" -#include "attrs.h" -#include "isns.h" - -/* Implementation limit - sanity checking */ -#define ISNS_ATTR_MAX_LEN 8192 - -static void __isns_attr_set_value(isns_attr_t *, const isns_value_t *); - -/* - * Allocate an attribute - */ -isns_attr_t * -isns_attr_alloc(uint32_t tag, const isns_tag_type_t *tag_type, const isns_value_t *value) -{ - isns_attr_t *attr; - - if (tag_type == NULL) - tag_type = isns_tag_type_by_id(tag); - - attr = isns_calloc(1, sizeof(*attr)); - if (!attr) - isns_fatal("Out of memory!\n"); - - attr->ia_users = 1; - attr->ia_tag_id = tag; - attr->ia_tag = tag_type; - - __isns_attr_set_value(attr, value); - return attr; -} - -isns_attr_t * -isns_attr_get(isns_attr_t *attr) -{ - if (attr) { - isns_assert(attr->ia_users); - attr->ia_users++; - } - return attr; -} - -void -isns_attr_release(isns_attr_t *attr) -{ - const isns_attr_type_t *type; - - isns_assert(attr->ia_users); - if (--(attr->ia_users)) - return; - - type = attr->ia_value.iv_type; - if (type->it_destroy) - type->it_destroy(&attr->ia_value); - isns_free(attr); -} - -/* - * Assign a value to an attribute - */ -void -__isns_attr_set_value(isns_attr_t *attr, const isns_value_t *new_value) -{ - const isns_attr_type_t *type, *old_type; - isns_value_t *old_value; - - old_value = &attr->ia_value; - if (old_value == new_value) - return; - - old_type = old_value->iv_type; - if (old_type && old_type->it_destroy) - old_type->it_destroy(old_value); - - if (!new_value || !(type = new_value->iv_type)) - type = attr->ia_tag->it_type; - - /* When assigning the value to the attr, check - * whether it needs special attention. */ - if (new_value) { - if (type->it_assign) { - type->it_assign(&attr->ia_value, new_value); - } else { - attr->ia_value = *new_value; - } - } - attr->ia_value.iv_type = type; -} - -/* - * Compare two attributes. - * Returns non-null when attributes are the same, else 0. - */ -int -isns_attr_match(const isns_attr_t *a, const isns_attr_t *b) -{ - const isns_attr_type_t *type; - - if (a->ia_tag_id != b->ia_tag_id) - return 0; - - /* NIL acts as a wildcard */ - if (a->ia_value.iv_type == &isns_attr_type_nil - || b->ia_value.iv_type == &isns_attr_type_nil) - return 1; - - if (a->ia_value.iv_type != b->ia_value.iv_type) - return 0; - type = a->ia_value.iv_type; - - if (type->it_match) - return type->it_match(&a->ia_value, &b->ia_value); - - return !memcmp(&a->ia_value, &b->ia_value, sizeof(isns_value_t)); -} - -/* - * Lexicographical comparison of two attributes. - * Returns -1 when a is less than b, +1 when a is greater than - * b, and 0 if equal. - */ -int -isns_attr_compare(const isns_attr_t *a, const isns_attr_t *b) -{ - const isns_attr_type_t *type = a->ia_value.iv_type; - - isns_assert(a->ia_tag_id == b->ia_tag_id); - - if (type != b->ia_value.iv_type) { - /* One of them must be NIL */ - if (type == &isns_attr_type_nil) - return -1; - return 1; - } - - /* If both are NIL, consider them equal */ - if (type == &isns_attr_type_nil) - return 0; - - /* A few types need special comparison functions, but - * most don't. The reason is, we don't care whether the - * ordering this creates is the "canonical" ordering for - * this type, eg for integers. All that matters is that - * there is some consistent ordering suitable for - * DevGetNext. - */ - if (type->it_compare) - return type->it_compare(&a->ia_value, &b->ia_value); - - return memcmp(&a->ia_value, &b->ia_value, sizeof(isns_value_t)); -} - -/* - * Convert a string to an attribute - */ -isns_attr_t * -isns_attr_from_string(uint32_t tag, const char *string) -{ - const isns_tag_type_t *tag_type; - int (*parse)(isns_value_t *, const char *); - isns_value_t value; - - memset(&value, 0, sizeof(value)); - - tag_type = isns_tag_type_by_id(tag); - if (!tag_type) - return NULL; - - parse = tag_type->it_parse; - if (parse == NULL) - parse = tag_type->it_type->it_parse; - - if (!parse || !parse(&value, string)) - return NULL; - - return isns_attr_alloc(tag, tag_type, &value); -} - -/* - * Initialize an attribute list. - */ -void -isns_attr_list_init(isns_attr_list_t *list) -{ - memset(list, 0, sizeof(*list)); -} - -static inline void -__isns_attr_list_resize(isns_attr_list_t *list, unsigned int count) -{ - unsigned int max; - - max = (list->ial_count + 15) & ~15; - if (count < max) - return; - - count = (count + 15) & ~15; - list->ial_data = isns_realloc(list->ial_data, count * sizeof(isns_attr_t *)); - if (!list->ial_data) - isns_fatal("Out of memory!\n"); -} - -void -isns_attr_list_append_list(isns_attr_list_t *dst, - const isns_attr_list_t *src) -{ - unsigned int i, j; - - __isns_attr_list_resize(dst, dst->ial_count + src->ial_count); - j = dst->ial_count; - for (i = 0; i < src->ial_count; ++i, ++j) { - isns_attr_t *attr = src->ial_data[i]; - - dst->ial_data[j] = attr; - attr->ia_users++; - } - dst->ial_count = j; -} - -void -isns_attr_list_copy(isns_attr_list_t *dst, - const isns_attr_list_t *src) -{ - isns_attr_list_destroy(dst); - isns_attr_list_append_list(dst, src); -} - -void -isns_attr_list_destroy(isns_attr_list_t *list) -{ - unsigned int i; - - for (i = 0; i < list->ial_count; ++i) { - isns_attr_t *attr = list->ial_data[i]; - - isns_attr_release(attr); - } - - if (list->ial_data) - isns_free(list->ial_data); - memset(list, 0, sizeof(*list)); -} - -int -isns_attr_list_remove_tag(isns_attr_list_t *list, uint32_t tag) -{ - unsigned int i = 0, j = 0, removed = 0; - - for (i = 0; i < list->ial_count; ++i) { - isns_attr_t *attr = list->ial_data[i]; - - if (attr->ia_tag_id == tag) { - isns_attr_release(attr); - removed++; - } else { - list->ial_data[j++] = attr; - } - } - list->ial_count = j; - return removed; -} - -/* - * Locate the given attribute in the list, remove it - * and any following attributes that have a tag from the - * @subordinate_tags list. This is used by the DDDereg - * code to remove DD members. - */ -int -isns_attr_list_remove_member(isns_attr_list_t *list, - const isns_attr_t *match, - const uint32_t *subordinate_tags) -{ - unsigned int i = 0, j = 0, k, removed = 0, purging = 0; - - while (i < list->ial_count) { - isns_attr_t *attr = list->ial_data[i++]; - - if (purging && subordinate_tags) { - for (k = 0; subordinate_tags[k]; ++k) { - if (attr->ia_tag_id == subordinate_tags[k]) - goto purge_attr; - } - } - purging = 0; - - if (!isns_attr_match(attr, match)) { - list->ial_data[j++] = attr; - continue; - } - -purge_attr: - isns_attr_release(attr); - purging = 1; - removed++; - } - list->ial_count = j; - return removed; -} - -/* - * Find the first attribute with the given tag - */ -static inline isns_attr_t * -__isns_attr_list_find(const isns_attr_list_t *list, uint32_t tag) -{ - isns_attr_t *attr; - unsigned int i; - - for (i = 0; i < list->ial_count; ++i) { - attr = list->ial_data[i]; - - if (attr->ia_tag_id == tag) - return attr; - } - - return NULL; -} - -/* - * Add a new attribute at the end of the list - */ -static inline void -__isns_attr_list_append_attr(isns_attr_list_t *list, isns_attr_t *attr) -{ - __isns_attr_list_resize(list, list->ial_count + 1); - list->ial_data[list->ial_count++] = attr; -} - -void -isns_attr_list_append_attr(isns_attr_list_t *list, isns_attr_t *attr) -{ - attr->ia_users++; - __isns_attr_list_append_attr(list, attr); -} - -/* - * Append an element to an attribute list - */ -static void -__isns_attr_list_append(isns_attr_list_t *list, - uint32_t tag, const isns_tag_type_t *tag_type, - const isns_value_t *value) -{ - isns_attr_t *attr; - - if (tag_type == NULL) - tag_type = isns_tag_type_by_id(tag); - if (value->iv_type != &isns_attr_type_nil - && value->iv_type != tag_type->it_type) { - isns_warning("Using wrong type (%s) " - "when encoding attribute %04x (%s) - should be %s\n", - value->iv_type->it_name, - tag, tag_type->it_name, - tag_type->it_type->it_name); - } - - attr = isns_attr_alloc(tag, tag_type, value); - __isns_attr_list_append_attr(list, attr); -} - -/* - * Update an element to an attribute list - */ -static void -__isns_attr_list_update(isns_attr_list_t *list, - uint32_t tag, const isns_tag_type_t *tag_type, - const isns_value_t *value) -{ - const isns_attr_type_t *type = value->iv_type; - isns_attr_t *attr; - - if (tag_type == NULL) - tag_type = isns_tag_type_by_id(tag); - if (type != &isns_attr_type_nil - && type != tag_type->it_type) { - isns_warning("Using wrong type (%s) " - "when encoding attribute %04x (%s) - should be %s\n", - type->it_name, - tag, tag_type->it_name, - tag_type->it_type->it_name); - } - - if (tag_type->it_multiple - || (attr = __isns_attr_list_find(list, tag)) == NULL) { - attr = isns_attr_alloc(tag, tag_type, NULL); - __isns_attr_list_append_attr(list, attr); - } - - __isns_attr_set_value(attr, value); -} - -/* - * Append an element to an attribute list - public interface - */ -void -isns_attr_list_append_value(isns_attr_list_t *list, - uint32_t tag, const isns_tag_type_t *tag_type, - const isns_value_t *value) -{ - __isns_attr_list_append(list, tag, tag_type, value); -} - -/* - * Update an element of an attribute list - public interface - */ -void -isns_attr_list_update_value(isns_attr_list_t *list, - uint32_t tag, const isns_tag_type_t *tag_type, - const isns_value_t *value) -{ - __isns_attr_list_update(list, tag, tag_type, value); -} - -void -isns_attr_list_update_attr(isns_attr_list_t *list, - const isns_attr_t *attr) -{ - __isns_attr_list_update(list, attr->ia_tag_id, - attr->ia_tag, &attr->ia_value); -} - -/* - * Replace an attribute on a list - */ -int -isns_attr_list_replace_attr(isns_attr_list_t *list, - isns_attr_t *attr) -{ - unsigned int i; - - for (i = 0; i < list->ial_count; ++i) { - isns_attr_t *other = list->ial_data[i]; - - if (other->ia_tag_id == attr->ia_tag_id) { - list->ial_data[i] = attr; - attr->ia_users++; - isns_attr_release(other); - return 1; - } - } - return 0; -} - -/* - * Retrieve an element of an attribute list - */ -int -isns_attr_list_get_attr(const isns_attr_list_t *list, - uint32_t tag, isns_attr_t **result) -{ - *result = __isns_attr_list_find(list, tag); - return *result != NULL; -} - -int -isns_attr_list_get_value(const isns_attr_list_t *list, - uint32_t tag, isns_value_t *value) -{ - isns_attr_t *attr; - - if (!(attr = __isns_attr_list_find(list, tag))) - return 0; - - *value = attr->ia_value; - return 1; -} - -int -isns_attr_list_get_uint32(const isns_attr_list_t *list, - uint32_t tag, uint32_t *value) -{ - isns_attr_t *attr; - - if (!(attr = __isns_attr_list_find(list, tag)) - || !ISNS_ATTR_IS_UINT32(attr)) - return 0; - - *value = attr->ia_value.iv_uint32; - return 1; -} - -int -isns_attr_list_get_ipaddr(const isns_attr_list_t *list, - uint32_t tag, struct in6_addr *value) -{ - isns_attr_t *attr; - - if (!(attr = __isns_attr_list_find(list, tag)) - || !ISNS_ATTR_IS_IPADDR(attr)) - return 0; - - *value = attr->ia_value.iv_ipaddr; - return 1; -} - -int -isns_attr_list_get_string(const isns_attr_list_t *list, - uint32_t tag, const char **value) -{ - isns_attr_t *attr; - - if (!(attr = __isns_attr_list_find(list, tag)) - || !ISNS_ATTR_IS_STRING(attr)) - return 0; - - *value = attr->ia_value.iv_string; - return 1; -} - -int -isns_attr_list_contains(const isns_attr_list_t *list, - uint32_t tag) -{ - return __isns_attr_list_find(list, tag) != NULL; -} - -/* - * Some attribute types have an implied ordering, - * which is needed for GetNext. This is used to - * compare two lists. - */ - -/* - * Typed versions of isns_attr_list_append - */ -void -isns_attr_list_append_nil(isns_attr_list_t *list, uint32_t tag) -{ - isns_value_t var = ISNS_VALUE_INIT(nil, 0); - - __isns_attr_list_append(list, tag, NULL, &var); -} - -void -isns_attr_list_append_string(isns_attr_list_t *list, - uint32_t tag, const char *value) -{ - isns_value_t var = ISNS_VALUE_INIT(string, (char *) value); - - __isns_attr_list_append(list, tag, NULL, &var); -} - -void -isns_attr_list_append_uint32(isns_attr_list_t *list, - uint32_t tag, uint32_t value) -{ - isns_value_t var = ISNS_VALUE_INIT(uint32, value); - - __isns_attr_list_append(list, tag, NULL, &var); -} - -void -isns_attr_list_append_int32(isns_attr_list_t *list, - uint32_t tag, int32_t value) -{ - isns_value_t var = ISNS_VALUE_INIT(int32, value); - - __isns_attr_list_append(list, tag, NULL, &var); -} - -void -isns_attr_list_append_uint64(isns_attr_list_t *list, - uint32_t tag, int64_t value) -{ - isns_value_t var = ISNS_VALUE_INIT(uint64, value); - - __isns_attr_list_append(list, tag, NULL, &var); -} - -void -isns_attr_list_append_ipaddr(isns_attr_list_t *list, - uint32_t tag, const struct in6_addr *value) -{ - isns_value_t var = ISNS_VALUE_INIT(ipaddr, *value); - - __isns_attr_list_append(list, tag, NULL, &var); -} - -/* - * Untyped version of isns_attr_list_append and isns_attr_list_update. - * The caller must make sure that the type of @data matches the tag's type. - */ -int -isns_attr_list_append(isns_attr_list_t *list, uint32_t tag, const void *data) -{ - const isns_tag_type_t *tag_type; - isns_value_t var; - - if (!(tag_type = isns_tag_type_by_id(tag))) - return 0; - - var.iv_type = tag_type->it_type; - if (!var.iv_type->it_set(&var, data)) - return 0; - - __isns_attr_list_append(list, tag, tag_type, &var); - return 1; -} - -int -isns_attr_list_update(isns_attr_list_t *list, uint32_t tag, const void *data) -{ - const isns_tag_type_t *tag_type; - isns_attr_type_t *type; - isns_value_t var; - - if (!(tag_type = isns_tag_type_by_id(tag))) - return 0; - - type = tag_type->it_type; - var.iv_type = type; - if (!type->it_set(&var, data)) - return 0; - - __isns_attr_list_update(list, tag, tag_type, &var); - return 1; -} - -/* - * Validate the attribute list. - */ -int -isns_attr_validate(const isns_attr_t *attr, - const isns_policy_t *policy) -{ - const isns_tag_type_t *tag_type; - - tag_type = attr->ia_tag; - if (tag_type->it_validate == NULL) - return 1; - return tag_type->it_validate(&attr->ia_value, policy); -} - -int -isns_attr_list_validate(const isns_attr_list_t *list, - const isns_policy_t *policy, - unsigned int function) -{ - DECLARE_BITMAP(seen, __ISNS_TAG_MAX); - unsigned int i; - - for (i = 0; i < list->ial_count; ++i) { - const isns_tag_type_t *tag_type; - isns_attr_t *attr = list->ial_data[i]; - uint32_t tag = attr->ia_tag_id; - unsigned int bit; - - if (attr == NULL) - return ISNS_INTERNAL_ERROR; - - tag_type = attr->ia_tag; - if (tag_type == NULL) - return ISNS_INTERNAL_ERROR; - - bit = tag; - if (OPENISNS_IS_PRIVATE_ATTR(tag)) - bit -= OPENISNS_VENDOR_PREFIX; - if (bit >= __ISNS_TAG_MAX) - goto invalid; - - if (attr->ia_value.iv_type == &isns_attr_type_nil) { - if (test_bit(seen, bit)) - goto invalid; - } else - if (attr->ia_value.iv_type == tag_type->it_type) { - if (!tag_type->it_multiple && test_bit(seen, bit)) - goto invalid; - - if (!isns_attr_validate(attr, policy)) - goto invalid; - } else { - return ISNS_INTERNAL_ERROR; - } - - if (function == ISNS_DEVICE_ATTRIBUTE_REGISTER - && tag_type->it_readonly) - goto invalid; - - set_bit(seen, bit); - } - - return ISNS_SUCCESS; - -invalid: - switch (function) { - case ISNS_DEVICE_ATTRIBUTE_REGISTER: - return ISNS_INVALID_REGISTRATION; - - case ISNS_DEVICE_DEREGISTER: - return ISNS_INVALID_DEREGISTRATION; - - case ISNS_DEVICE_ATTRIBUTE_QUERY: - case ISNS_DEVICE_GET_NEXT: - return ISNS_INVALID_QUERY; - } - return ISNS_ATTRIBUTE_NOT_IMPLEMENTED; -} - -/* - * Debug helper: print attribute list - */ -void -isns_attr_list_print(const isns_attr_list_t *list, isns_print_fn_t *fn) -{ - unsigned int i; - - for (i = 0; i < list->ial_count; ++i) - isns_attr_print(list->ial_data[i], fn); -} - -char * -isns_attr_print_value(const isns_attr_t *attr, char *buffer, size_t size) -{ - const isns_tag_type_t *tag_type = attr->ia_tag; - const isns_attr_type_t *type = attr->ia_value.iv_type; - - if (tag_type->it_print && type == tag_type->it_type) - tag_type->it_print(&attr->ia_value, buffer, size); - else - type->it_print(&attr->ia_value, buffer, size); - return buffer; -} - -void -isns_attr_print(const isns_attr_t *attr, isns_print_fn_t *fn) -{ - const isns_tag_type_t *tag_type = attr->ia_tag; - const isns_attr_type_t *type = attr->ia_value.iv_type; - uint32_t tag; - char value[512], *vspec = ""; - - tag = attr->ia_tag_id; - if (OPENISNS_IS_PRIVATE_ATTR(tag)) { - tag -= OPENISNS_VENDOR_PREFIX; - vspec = "v"; - } - - fn(" %04x%1s %-12s: %s = %s\n", - tag, vspec, - type->it_name, - tag_type? tag_type->it_name : "Unknown Attribute", - isns_attr_print_value(attr, value, sizeof(value))); -} - -/* - * TLV encode a single attribute - */ -int -isns_attr_encode(buf_t *bp, const isns_attr_t *attr) -{ - const isns_value_t *value = &attr->ia_value; - const isns_attr_type_t *type = value->iv_type; - - if (!buf_put32(bp, attr->ia_tag_id) - || !type->it_encode(bp, value)) - return ISNS_INTERNAL_ERROR; - - return ISNS_SUCCESS; -} - -/* - * TLV decode a single attribute - */ -int -isns_attr_decode(buf_t *bp, isns_attr_t **result) -{ - isns_attr_t *attr = NULL; - isns_value_t *value; - uint32_t tag, len; - - if (!buf_get32(bp, &tag) - || !buf_get32(bp, &len)) - goto msg_fmt_error; - - /* Attributes MUST be word aligned */ - if (len & 3) - goto msg_fmt_error; - - if (len > ISNS_ATTR_MAX_LEN) - goto msg_fmt_error; - - /* Allocate the attribute */ - attr = isns_attr_alloc(tag, NULL, NULL); - - value = &attr->ia_value; - if (len == 0) - value->iv_type = &isns_attr_type_nil; - - if (!value->iv_type->it_decode(bp, len, value)) - goto msg_fmt_error; - - *result = attr; - return ISNS_SUCCESS; - -msg_fmt_error: - isns_error("Error decoding attribute, tag=0x%04x, len=%u\n", - tag, len); - if (attr) - isns_attr_release(attr); - return ISNS_MESSAGE_FORMAT_ERROR; -} - - -/* - * Decode the list of TLV encoded attributes inside an - * iSNS message. - */ -static int -__isns_attr_list_decode(buf_t *bp, isns_attr_list_t *list, int delimited) -{ - int status; - - while (buf_avail(bp)) { - isns_attr_t *attr; - - status = isns_attr_decode(bp, &attr); - if (status != ISNS_SUCCESS) - return status; - - if (delimited && attr->ia_tag_id == ISNS_TAG_DELIMITER) { - isns_attr_release(attr); - break; - } - - __isns_attr_list_append_attr(list, attr); - } - - return ISNS_SUCCESS; -} - -int -isns_attr_list_decode(buf_t *bp, isns_attr_list_t *list) -{ - return __isns_attr_list_decode(bp, list, 0); -} - -int -isns_attr_list_decode_delimited(buf_t *bp, isns_attr_list_t *list) -{ - return __isns_attr_list_decode(bp, list, 1); -} - -/* - * Remove all attributes from a list save those matching - * the given tags. - */ -void -isns_attr_list_prune(isns_attr_list_t *list, - const uint32_t *tags, unsigned int num_tags) -{ - unsigned int i, j, k; - - for (i = j = 0; i < list->ial_count; ++i) { - isns_attr_t *attr = list->ial_data[i]; - - for (k = 0; k < num_tags; ++k) { - if (attr->ia_tag_id == tags[k]) { - list->ial_data[j++] = attr; - goto next; - } - } - - isns_attr_release(attr); - -next: ; - } - - list->ial_count = j; -} - -/* - * TLV ecode the list of attributes to go with - * iSNS message. - */ -int -isns_attr_list_encode(buf_t *bp, const isns_attr_list_t *list) -{ - unsigned int i, status = ISNS_SUCCESS; - - for (i = 0; i < list->ial_count; ++i) { - struct isns_attr *attr = list->ial_data[i]; - - status = isns_attr_encode(bp, attr); - if (status) - break; - } - return status; -} - -/* - * Encode the delimiter attribute - */ -int -isns_encode_delimiter(buf_t *bp) -{ - uint32_t tag = 0, len = 0; - - if (!buf_put32(bp, tag) - || !buf_put32(bp, len)) - return ISNS_INTERNAL_ERROR; - - return ISNS_SUCCESS; -} - -/* - * Padded encoding - */ -static inline int -isns_encode_padded(buf_t *bp, const void *ptr, size_t len) -{ - if (!buf_put(bp, ptr, len)) - return 0; - - if ((len & 3) == 0) - return 1; - - return buf_put(bp, "\0\0\0", 4 - (len & 3)); -} - -/* - * Helper functions to deal with portal information - */ -void -isns_portal_init(isns_portal_info_t *portal, - const struct sockaddr *saddr, int proto) -{ - const struct sockaddr_in *sin; - - memset(portal, 0, sizeof(*portal)); - switch (saddr->sa_family) { - case AF_INET6: - portal->addr = *(const struct sockaddr_in6 *) saddr; - break; - - case AF_INET: - sin = (const struct sockaddr_in *) saddr; - portal->addr.sin6_addr.s6_addr32[3] = sin->sin_addr.s_addr; - portal->addr.sin6_port = sin->sin_port; - portal->addr.sin6_family = AF_INET6; - break; - default: - isns_warning("Unknown address family in isns_portal_init\n"); - return; - } - - portal->proto = proto; -} - -int -isns_portal_from_attr_list(isns_portal_info_t *portal, - uint32_t addr_tag, uint32_t port_tag, - const isns_attr_list_t *list) -{ - const isns_attr_t *addr_attr = NULL, *port_attr = NULL; - unsigned int i; - - for (i = 0; i + 1 < list->ial_count; ++i) { - const isns_attr_t *attr = list->ial_data[i]; - - if (!ISNS_ATTR_IS_IPADDR(attr)) - continue; - if (addr_tag && attr->ia_tag_id != addr_tag) - continue; - addr_attr = attr; - if (port_tag == 0) { - port_attr = list->ial_data[i + 1]; - goto extract_portal; - } - break; - } - - /* We have a specific port tag. */ - while (++i < list->ial_count) { - const isns_attr_t *attr = list->ial_data[i]; - - if (attr->ia_tag_id == port_tag) { - port_attr = attr; - goto extract_portal; - } - } - - return 0; - -extract_portal: - return isns_portal_from_attr_pair(portal, - addr_attr, port_attr); -} - -int -isns_portal_from_attr_pair(isns_portal_info_t *portal, - const isns_attr_t *addr_attr, - const isns_attr_t *port_attr) -{ - uint32_t portspec; - - memset(portal, 0, sizeof(*portal)); - portal->addr.sin6_family = AF_INET6; - - if (!ISNS_ATTR_IS_IPADDR(addr_attr) - || !ISNS_ATTR_IS_UINT32(port_attr)) - return 0; - - portal->addr.sin6_addr = addr_attr->ia_value.iv_ipaddr; - - portspec = port_attr->ia_value.iv_uint32; - portal->addr.sin6_port = htons(portspec & 0xffff); - portal->proto = (portspec & ISNS_PORTAL_PORT_UDP_MASK)? IPPROTO_UDP : IPPROTO_TCP; - - return 1; -} - -int -isns_portal_to_attr_list(const isns_portal_info_t *portal, - uint32_t addr_tag, uint32_t port_tag, - isns_attr_list_t *list) -{ - uint32_t portspec; - - portspec = htons(portal->addr.sin6_port); - if (portal->proto == IPPROTO_UDP) - portspec |= ISNS_PORTAL_PORT_UDP_MASK; - - { - isns_value_t addr_value = ISNS_VALUE_INIT(ipaddr, portal->addr.sin6_addr); - isns_value_t port_value = ISNS_VALUE_INIT(uint32, portspec); - - isns_attr_list_update_value(list, addr_tag, NULL, &addr_value); - isns_attr_list_update_value(list, port_tag, NULL, &port_value); - } - - return 1; -} - -const char * -isns_portal_string(const isns_portal_info_t *portal) -{ - const struct sockaddr_in6 *six = &portal->addr; - static char buffer[128]; - char abuf[128]; - - inet_ntop(six->sin6_family, &six->sin6_addr, abuf, sizeof(abuf)); - snprintf(buffer, sizeof(buffer), "[%s]:%d/%s", - abuf, ntohs(six->sin6_port), - (portal->proto == IPPROTO_UDP)? "udp" : "tcp"); - return buffer; -} - -int -isns_portal_is_wildcard(const isns_portal_info_t *portal) -{ - return !memcmp(&portal->addr.sin6_addr, - &in6addr_any, - sizeof(struct in6_addr)); -} - -int -isns_portal_equal(const isns_portal_info_t *a, - const isns_portal_info_t *b) -{ - if (a->proto != b->proto) - return 0; - return !memcmp(&a->addr, &b->addr, sizeof(a->addr)); -} - -uint32_t -isns_portal_tcpudp_port(const isns_portal_info_t *portal) -{ - uint32_t port; - - port = isns_addr_get_port((const struct sockaddr *) &portal->addr); - if (portal->proto == IPPROTO_UDP) - port |= ISNS_PORTAL_PORT_UDP_MASK; - return port; -} - -int -isns_portal_parse(isns_portal_info_t *portal, - const char *spec, - const char *default_port) -{ - struct sockaddr_storage addr; - char *copy, *psp; - int alen, proto = IPPROTO_TCP, sock_type = SOCK_STREAM; - - if (spec[0] == '/') { - isns_warning("%s: no AF_LOCAL addresses for portals!\n", - __FUNCTION__); - return 0; - } - - /* Look at trailing /tcp or /udp */ - copy = isns_strdup(spec); - if ((psp = strrchr(copy, '/')) != NULL) { - if (!strcasecmp(psp, "/udp")) { - sock_type = SOCK_DGRAM; - proto = IPPROTO_UDP; - *psp = '\0'; - } else - if (!strcasecmp(psp, "/tcp")) { - sock_type = SOCK_STREAM; - proto = IPPROTO_TCP; - *psp = '\0'; - } - } - - alen = isns_get_address(&addr, copy, default_port, 0, sock_type, 0); - isns_free(copy); - - if (alen < 0) - return 0; - - isns_portal_init(portal, (struct sockaddr *) &addr, proto); - return 1; -} - -/* - * Attribute type NIL - */ -static int -isns_attr_type_nil_encode(buf_t *bp, const isns_value_t *value) -{ - return buf_put32(bp, 0); -} - -static int -isns_attr_type_nil_decode(buf_t *bp, size_t len, isns_value_t *value) -{ - return len == 0; -} - -static void -isns_attr_type_nil_print(const isns_value_t *value, char *buf, size_t size) -{ - snprintf(buf, size, ""); -} - -static int -isns_attr_type_nil_parse(isns_value_t *value, const char *string) -{ - if (string && *string) - return 0; - return 1; -} - -isns_attr_type_t isns_attr_type_nil = { - .it_id = ISNS_ATTR_TYPE_NIL, - .it_name = "nil", - .it_encode = isns_attr_type_nil_encode, - .it_decode = isns_attr_type_nil_decode, - .it_print = isns_attr_type_nil_print, - .it_parse = isns_attr_type_nil_parse, -}; - -/* - * Attribute type UINT32 - */ -static int -isns_attr_type_uint32_encode(buf_t *bp, const isns_value_t *value) -{ - return buf_put32(bp, 4) && buf_put32(bp, value->iv_uint32); -} - -static int -isns_attr_type_uint32_decode(buf_t *bp, size_t len, isns_value_t *value) -{ - if (len != 4) - return 0; - return buf_get32(bp, &value->iv_uint32); -} - -static void -isns_attr_type_uint32_print(const isns_value_t *value, char *buf, size_t size) -{ - snprintf(buf, size, "%u", value->iv_uint32); -} - -static int -isns_attr_type_uint32_parse(isns_value_t *value, const char *string) -{ - char *end; - - value->iv_uint32 = strtoul(string, &end, 0); - return *end == '\0'; -} - -static void -isns_attr_type_int32_print(const isns_value_t *value, char *buf, size_t size) -{ - snprintf(buf, size, "%d", value->iv_uint32); -} - -static int -isns_attr_type_int32_parse(isns_value_t *value, const char *string) -{ - char *end; - - value->iv_int32 = strtol(string, &end, 0); - return *end == '\0'; -} - -isns_attr_type_t isns_attr_type_uint32 = { - .it_id = ISNS_ATTR_TYPE_UINT32, - .it_name = "uint32", - .it_encode = isns_attr_type_uint32_encode, - .it_decode = isns_attr_type_uint32_decode, - .it_print = isns_attr_type_uint32_print, - .it_parse = isns_attr_type_uint32_parse, -}; - -isns_attr_type_t isns_attr_type_int32 = { - .it_id = ISNS_ATTR_TYPE_INT32, - .it_name = "int32", - .it_encode = isns_attr_type_uint32_encode, - .it_decode = isns_attr_type_uint32_decode, - .it_print = isns_attr_type_int32_print, - .it_parse = isns_attr_type_int32_parse, -}; - -/* - * 16bit min/max - */ -static int -isns_attr_type_range16_encode(buf_t *bp, const isns_value_t *value) -{ - uint32_t word; - - word = (value->iv_range.max << 16) | value->iv_range.min; - return buf_put32(bp, 4) && buf_put32(bp, word); -} - -static int -isns_attr_type_range16_decode(buf_t *bp, size_t len, isns_value_t *value) -{ - uint32_t word; - - if (len != 4) - return 0; - if (!buf_get32(bp, &word)) - return 0; - value->iv_range.max = word >> 16; - value->iv_range.min = word & 0xFFFF; - return 1; -} - -static void -isns_attr_type_range16_print(const isns_value_t *value, char *buf, size_t size) -{ - snprintf(buf, size, "[%u, %u]", value->iv_range.min, value->iv_range.max); -} - -isns_attr_type_t isns_attr_type_range16 = { - .it_id = ISNS_ATTR_TYPE_RANGE16, - .it_name = "range16", - .it_encode = isns_attr_type_range16_encode, - .it_decode = isns_attr_type_range16_decode, - .it_print = isns_attr_type_range16_print, -// .it_parse = isns_attr_type_range16_parse, -}; - - -/* - * 64bit integers - */ -static int -isns_attr_type_uint64_encode(buf_t *bp, const isns_value_t *value) -{ - return buf_put32(bp, 8) && buf_put64(bp, value->iv_uint64); -} - -static int -isns_attr_type_uint64_decode(buf_t *bp, size_t len, isns_value_t *value) -{ - if (len != 8) - return 0; - return buf_get64(bp, &value->iv_uint64); -} - -static void -isns_attr_type_uint64_print(const isns_value_t *value, char *buf, size_t size) -{ - snprintf(buf, size, "%Lu", (unsigned long long) value->iv_uint64); -} - -static int -isns_attr_type_uint64_parse(isns_value_t *value, const char *string) -{ - char *end; - - value->iv_uint64 = strtoull(string, &end, 0); - return *end == '\0'; -} - -isns_attr_type_t isns_attr_type_uint64 = { - .it_id = ISNS_ATTR_TYPE_UINT64, - .it_name = "uint64", - .it_encode = isns_attr_type_uint64_encode, - .it_decode = isns_attr_type_uint64_decode, - .it_print = isns_attr_type_uint64_print, - .it_parse = isns_attr_type_uint64_parse, -}; - -/* - * Attribute type STRING - */ -static void -isns_attr_type_string_destroy(isns_value_t *value) -{ - isns_free(value->iv_string); - value->iv_string = NULL; -} - -static int -isns_attr_type_string_match(const isns_value_t *a, const isns_value_t *b) -{ - if (a->iv_string && b->iv_string) - return !strcmp(a->iv_string, b->iv_string); - - return a->iv_string == b->iv_string; -} - -static int -isns_attr_type_string_compare(const isns_value_t *a, const isns_value_t *b) -{ - if (a->iv_string && b->iv_string) - return strcmp(a->iv_string, b->iv_string); - - return a->iv_string? 1 : -1; -} - -static int -isns_attr_type_string_encode(buf_t *bp, const isns_value_t *value) -{ - uint32_t len; - - len = value->iv_string? strlen(value->iv_string) + 1 : 0; - - if (!buf_put32(bp, ISNS_PAD(len))) - return 0; - - if (len && !isns_encode_padded(bp, value->iv_string, len)) - return 0; - - return 1; -} - -static int -isns_attr_type_string_decode(buf_t *bp, size_t len, isns_value_t *value) -{ - /* Is this legal? */ - if (len == 0) - return 1; - - /* The string should be NUL terminated, but - * better be safe than sorry. */ - value->iv_string = isns_malloc(len + 1); - if (!buf_get(bp, value->iv_string, len)) { - isns_free(value->iv_string); - return 0; - } - value->iv_string[len] = '\0'; - return 1; -} - -static void -isns_attr_type_string_print(const isns_value_t *value, char *buf, size_t size) -{ - if (!value->iv_string) - snprintf(buf, size, "(empty)"); - else - snprintf(buf, size, "\"%s\"", value->iv_string); -} - -static int -isns_attr_type_string_parse(isns_value_t *value, const char *string) -{ - value->iv_string = isns_strdup(string); - return 1; -} - -static void -isns_attr_type_string_assign(isns_value_t *value, const isns_value_t *new_value) -{ - isns_assert(!value->iv_string); - if (new_value->iv_string) - value->iv_string = isns_strdup(new_value->iv_string); -} - -isns_attr_type_t isns_attr_type_string = { - .it_id = ISNS_ATTR_TYPE_STRING, - .it_name = "string", - .it_assign = isns_attr_type_string_assign, - .it_destroy = isns_attr_type_string_destroy, - .it_match = isns_attr_type_string_match, - .it_compare = isns_attr_type_string_compare, - .it_encode = isns_attr_type_string_encode, - .it_decode = isns_attr_type_string_decode, - .it_print = isns_attr_type_string_print, - .it_parse = isns_attr_type_string_parse, -}; - -/* - * Attribute type IPADDR - */ -static int -isns_attr_type_ipaddr_encode(buf_t *bp, const isns_value_t *value) -{ - if (!buf_put32(bp, 16) - || !buf_put(bp, &value->iv_ipaddr, 16)) - return 0; - - return 1; -} - -static int -isns_attr_type_ipaddr_decode(buf_t *bp, size_t len, isns_value_t *value) -{ - if (len != 16) - return 0; - - return buf_get(bp, &value->iv_ipaddr, 16); -} - -static void -isns_attr_type_ipaddr_print(const isns_value_t *value, char *buf, size_t size) -{ - const struct in6_addr *addr = &value->iv_ipaddr; - char buffer[INET6_ADDRSTRLEN + 1]; - - /* The standard requires IPv4 mapping, but - * some oldish implementations seem to use - * IPv4 compatible addresss. */ - if (IN6_IS_ADDR_V4MAPPED(addr) || IN6_IS_ADDR_V4COMPAT(addr)) { - struct in_addr ipv4; - - ipv4.s_addr = addr->s6_addr32[3]; - inet_ntop(AF_INET, &ipv4, buffer, sizeof(buffer)); - } else { - inet_ntop(AF_INET6, addr, buffer, sizeof(buffer)); - } - snprintf(buf, size, "%s", buffer); -} - -static int -isns_attr_type_ipaddr_parse(isns_value_t *value, const char *string) -{ - struct in_addr addr4; - - if (inet_pton(AF_INET, string, &addr4)) { - value->iv_ipaddr = in6addr_any; - value->iv_ipaddr.s6_addr32[3] = addr4.s_addr; - return 1; - } - - return inet_pton(AF_INET6, string, &value->iv_ipaddr); -} - -isns_attr_type_t isns_attr_type_ipaddr = { - .it_id = ISNS_ATTR_TYPE_IPADDR, - .it_name = "ipaddr", - .it_encode = isns_attr_type_ipaddr_encode, - .it_decode = isns_attr_type_ipaddr_decode, - .it_print = isns_attr_type_ipaddr_print, - .it_parse = isns_attr_type_ipaddr_parse, -}; - -/* - * Attribute type OPAQUE - */ -static void -isns_attr_type_opaque_assign(isns_value_t *value, const isns_value_t *new_value) -{ - size_t new_len = new_value->iv_opaque.len; - isns_assert(value->iv_opaque.len == 0); - if (new_len) { - value->iv_opaque.ptr = isns_malloc(new_len); - value->iv_opaque.len = new_len; - memcpy(value->iv_opaque.ptr, - new_value->iv_opaque.ptr, - new_len); - } -} - -static void -isns_attr_type_opaque_destroy(isns_value_t *value) -{ - isns_free(value->iv_opaque.ptr); - value->iv_opaque.ptr = NULL; - value->iv_opaque.len = 0; -} - -static int -isns_attr_type_opaque_match(const isns_value_t *a, const isns_value_t *b) -{ - if (a->iv_opaque.len != b->iv_opaque.len) - return 0; - return !memcmp(a->iv_opaque.ptr, b->iv_opaque.ptr, a->iv_opaque.len); -} - -static int -isns_attr_type_opaque_compare(const isns_value_t *a, const isns_value_t *b) -{ - long delta; - - delta = a->iv_opaque.len - b->iv_opaque.len; - if (delta) - return delta; - - return memcmp(a->iv_opaque.ptr, b->iv_opaque.ptr, a->iv_opaque.len); -} - -static int -isns_attr_type_opaque_encode(buf_t *bp, const isns_value_t *value) -{ - uint32_t len; - - len = value->iv_opaque.len; - if (len & 3) - return 0; - - if (!buf_put32(bp, len) - || !buf_put(bp, value->iv_opaque.ptr, len)) - return 0; - - return 1; -} - -static int -isns_attr_type_opaque_decode(buf_t *bp, size_t len, isns_value_t *value) -{ - value->iv_opaque.ptr = isns_malloc(len); - if (!buf_get(bp, value->iv_opaque.ptr, len)) { - isns_free(value->iv_opaque.ptr); - return 0; - } - - value->iv_opaque.len = len; - return 1; -} - -static void -isns_attr_type_opaque_print(const isns_value_t *value, char *buf, size_t size) -{ - unsigned char *data = value->iv_opaque.ptr; - unsigned int i, len; - - /* There must be room for "<...>\0" */ - if (size < 6) - return; - size -= 6; - - if ((len = value->iv_opaque.len) > 20) - len = 20; - if (size < 3 * len) - len = size / 3; - - *buf++ = '<'; - for (i = 0; i < len; ++i) { - if (i) - *buf++ = ' '; - sprintf(buf, "%02x", data[i]); - buf += 2; - } - if (len < value->iv_opaque.len) { - strcat(buf, "..."); - buf += 4; - } - *buf++ = '>'; - *buf++ = '\0'; -} - -isns_attr_type_t isns_attr_type_opaque = { - .it_id = ISNS_ATTR_TYPE_OPAQUE, - .it_name = "opaque", - .it_assign = isns_attr_type_opaque_assign, - .it_destroy = isns_attr_type_opaque_destroy, - .it_match = isns_attr_type_opaque_match, - .it_compare = isns_attr_type_opaque_compare, - .it_encode = isns_attr_type_opaque_encode, - .it_decode = isns_attr_type_opaque_decode, - .it_print = isns_attr_type_opaque_print, -}; - -/* - * Map attribute type IDs to attribute types - */ -static isns_attr_type_t * -isns_attr_types_builtin[__ISNS_ATTR_TYPE_BUILTIN_MAX] = { -[ISNS_ATTR_TYPE_NIL] = &isns_attr_type_nil, -[ISNS_ATTR_TYPE_OPAQUE] = &isns_attr_type_opaque, -[ISNS_ATTR_TYPE_STRING] = &isns_attr_type_string, -[ISNS_ATTR_TYPE_INT32] = &isns_attr_type_int32, -[ISNS_ATTR_TYPE_UINT32] = &isns_attr_type_uint32, -[ISNS_ATTR_TYPE_UINT64] = &isns_attr_type_uint64, -[ISNS_ATTR_TYPE_IPADDR] = &isns_attr_type_ipaddr, -[ISNS_ATTR_TYPE_RANGE16] = &isns_attr_type_range16, -}; - -const isns_attr_type_t * -isns_attr_type_by_id(unsigned int id) -{ - if (id < __ISNS_ATTR_TYPE_BUILTIN_MAX) - return isns_attr_types_builtin[id]; - - /* TODO: handle dynamic registration of attrtypes - * for vendor extensions. */ - return NULL; -} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/attrs.h open-iscsi-2.0.874/utils/open-isns/attrs.h --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/attrs.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/attrs.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,262 +0,0 @@ -/* - * iSNS object attributes - * - * Copyright (C) 2007 Olaf Kirch - */ - -#ifndef ISNS_ATTRS_H -#define ISNS_ATTRS_H - -#include -#include "buffer.h" -#include "isns.h" - -/* - * Type identifier - */ -enum { - ISNS_ATTR_TYPE_NIL = 0, - ISNS_ATTR_TYPE_OPAQUE, - ISNS_ATTR_TYPE_STRING, - ISNS_ATTR_TYPE_INT32, - ISNS_ATTR_TYPE_UINT32, - ISNS_ATTR_TYPE_UINT64, - ISNS_ATTR_TYPE_IPADDR, - ISNS_ATTR_TYPE_RANGE16, - - __ISNS_ATTR_TYPE_BUILTIN_MAX -}; - -/* - * Union holding an attribute value - */ -typedef struct isns_value { - const struct isns_attr_type * iv_type; - - /* Data is stuffed into an anonymous union */ - union { - uint32_t iv_nil; - struct __isns_opaque { - void * ptr; - size_t len; - } iv_opaque; - char * iv_string; - int32_t iv_int32; - uint32_t iv_uint32; - uint64_t iv_uint64; - struct in6_addr iv_ipaddr; - struct { - uint16_t min, max; - } iv_range; - }; -} isns_value_t; - -#define __ISNS_ATTRTYPE(type) isns_attr_type_##type -#define __ISNS_MEMBER(type) iv_##type -#define ISNS_VALUE_INIT(type, value) \ - (isns_value_t) { .iv_type = &__ISNS_ATTRTYPE(type), \ - { .__ISNS_MEMBER(type) = (value) } } - -#define isns_attr_initialize(attrp, tag, type, value) do { \ - isns_attr_t *__attr = (attrp); \ - uint32_t __tag = (tag); \ - __attr->ia_users = 1; \ - __attr->ia_tag_id = (__tag); \ - __attr->ia_tag = isns_tag_type_by_id(__tag); \ - __attr->ia_value = ISNS_VALUE_INIT(type, value); \ - } while (0) -#define ISNS_ATTR_INIT(tag, type, value) (isns_attr_t) { \ - .ia_users = 1, \ - .ia_tag_id = (tag), \ - .ia_tag = isns_tag_type_by_id(tag), \ - .ia_value = ISNS_VALUE_INIT(type, value) \ - } - -/* - * Attribute type - */ -typedef struct isns_attr_type { - uint32_t it_id; - const char * it_name; - - void (*it_assign)(isns_value_t *, const isns_value_t *); - int (*it_set)(isns_value_t *, const void *); - int (*it_get)(isns_value_t *, void *); - int (*it_match)(const isns_value_t *, const isns_value_t *); - int (*it_compare)(const isns_value_t *, const isns_value_t *); - int (*it_encode)(buf_t *, const isns_value_t *); - int (*it_decode)(buf_t *, size_t, isns_value_t *); - void (*it_destroy)(isns_value_t *); - void (*it_print)(const isns_value_t *, char *, size_t); - int (*it_parse)(isns_value_t *, const char *); -} isns_attr_type_t; - -/* - * Tag info: for each tag, provides a printable name, - * and the attribute type associated with it. - */ -struct isns_tag_type { - uint32_t it_id; - const char * it_name; - unsigned int it_multiple : 1, - it_readonly : 1; - isns_attr_type_t *it_type; - - int (*it_validate)(const isns_value_t *, - const isns_policy_t *); - void (*it_print)(const isns_value_t *, char *, size_t); - int (*it_parse)(isns_value_t *, const char *); - const char * (*it_help)(void); -}; - -/* - * Attribute - */ -struct isns_attr { - unsigned int ia_users; - uint32_t ia_tag_id; - const isns_tag_type_t * ia_tag; - isns_value_t ia_value; -}; - -extern isns_attr_type_t isns_attr_type_nil; -extern isns_attr_type_t isns_attr_type_opaque; -extern isns_attr_type_t isns_attr_type_string; -extern isns_attr_type_t isns_attr_type_int32; -extern isns_attr_type_t isns_attr_type_uint32; -extern isns_attr_type_t isns_attr_type_uint64; -extern isns_attr_type_t isns_attr_type_ipaddr; -extern isns_attr_type_t isns_attr_type_range16; - -extern isns_attr_t * isns_attr_alloc(uint32_t, const isns_tag_type_t *, - const isns_value_t *); - -extern void isns_attr_list_append_value(isns_attr_list_t *, - uint32_t tag, const isns_tag_type_t *, - const isns_value_t *); -extern void isns_attr_list_update_value(isns_attr_list_t *, - uint32_t tag, const isns_tag_type_t *, - const isns_value_t *); -extern int isns_attr_list_get_value(const isns_attr_list_t *, - uint32_t tag, - isns_value_t *); -extern int isns_attr_list_get_uint32(const isns_attr_list_t *, - uint32_t tag, - uint32_t *); -extern int isns_attr_list_get_string(const isns_attr_list_t *, - uint32_t tag, - const char **); - -extern int isns_attr_list_validate(const isns_attr_list_t *, - const isns_policy_t *, - unsigned int function); -extern int isns_attr_validate(const isns_attr_t *, - const isns_policy_t *); - -extern void isns_attr_list_prune(isns_attr_list_t *, - const uint32_t *, - unsigned int); -extern int isns_attr_list_remove_member(isns_attr_list_t *, - const isns_attr_t *, - const uint32_t *); -extern void isns_attr_list_update_attr(isns_attr_list_t *, - const isns_attr_t *); - -extern int isns_attr_decode(buf_t *, isns_attr_t **); -extern int isns_attr_encode(buf_t *, const isns_attr_t *); - -extern int isns_attr_list_decode(buf_t *, isns_attr_list_t *); -extern int isns_attr_list_decode_delimited(buf_t *, isns_attr_list_t *); -extern int isns_attr_list_encode(buf_t *, const isns_attr_list_t *); -extern int isns_encode_delimiter(buf_t *); - -extern const isns_tag_type_t *isns_tag_type_by_id(unsigned int); -extern const isns_attr_type_t *isns_attr_type_by_id(unsigned int); - -typedef struct isns_quick_attr_list isns_quick_attr_list_t; -struct isns_quick_attr_list { - isns_attr_list_t iqa_list; - isns_attr_t * iqa_attrs[1]; - isns_attr_t iqa_attr; -}; -#define ISNS_QUICK_ATTR_LIST_DECLARE(qlist, tag, type, value) \ - isns_quick_attr_list_t qlist = { \ - .iqa_list = (isns_attr_list_t) { \ - .ial_data = qlist.iqa_attrs, \ - .ial_count = 1 \ - }, \ - .iqa_attrs = { &qlist.iqa_attr }, \ - .iqa_attr = ISNS_ATTR_INIT(tag, type, value), \ - } - -/* - * The following is used to chop up an incoming attr list as - * given in eg. a DevAttrReg message into separate chunks, - * following the ordering constraints laid out in the RFC. - * - * isns_attr_list_scanner_init initializes the scanner state. - * - * isns_attr_list_scanner_next advances to the next object in - * the list, returning the keys and attrs for one object. - * - * The isns_attr_list_scanner struct should really be opaque, but - * we put it here so you can declare a scanner variable on the - * stack. - */ -struct isns_attr_list_scanner { - isns_source_t * source; - isns_policy_t * policy; - isns_object_t * key_obj; - isns_attr_list_t orig_attrs; - unsigned int pos; - - isns_attr_list_t keys; - isns_attr_list_t attrs; - isns_object_template_t *tmpl; - unsigned int num_key_attrs; - - unsigned int entities; - - uint32_t pgt_next_attr; - uint32_t pgt_value; - const char * pgt_iscsi_name; - isns_portal_info_t pgt_portal_info; - isns_object_t * pgt_base_object; - - unsigned int index_acceptable : 1; -}; - -extern void isns_attr_list_scanner_init(struct isns_attr_list_scanner *, - isns_object_t *key_obj, - const isns_attr_list_t *attrs); -extern int isns_attr_list_scanner_next(struct isns_attr_list_scanner *); -extern void isns_attr_list_scanner_destroy(struct isns_attr_list_scanner *); - -/* - * The following is used to parse attribute lists given as - * a bunch of strings. - */ -struct isns_attr_list_parser { - struct isns_tag_prefix *prefix; - const char * default_port; - - unsigned int multi_type_permitted : 1, - nil_permitted : 1; - - isns_attr_t * (*load_key)(const char *); - isns_attr_t * (*generate_key)(void); -}; - -extern int isns_attr_list_split(char *line, char **argv, unsigned int argc_max); -extern void isns_attr_list_parser_init(struct isns_attr_list_parser *, - isns_object_template_t *); -extern int isns_parse_attrs(unsigned int, char **, - isns_attr_list_t *, struct isns_attr_list_parser *); -extern int isns_parse_query_attrs(unsigned int, char **, - isns_attr_list_t *, isns_attr_list_t *, - struct isns_attr_list_parser *); -extern void isns_attr_list_parser_help(struct isns_attr_list_parser *); -extern isns_object_template_t *isns_attr_list_parser_context(const struct isns_attr_list_parser *); -extern int isns_print_attrs(isns_object_t *, char **, unsigned int); - -#endif /* ISNS_ATTRS_H */ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/authblock.c open-iscsi-2.0.874/utils/open-isns/authblock.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/authblock.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/authblock.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ -/* - * iSNS authentication functions - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include -#include -#include "isns.h" -#include "attrs.h" -#include "message.h" -#include "util.h" - -/* We impose an artificial limit on the size of - * the size of the authenticator - */ -#define ISNS_SPISTR_MAX 512 - -int -isns_authblock_decode(buf_t *bp, struct isns_authblk *auth) -{ - unsigned int avail = buf_avail(bp); - - if (!buf_get32(bp, &auth->iab_bsd) - || !buf_get32(bp, &auth->iab_length) - || !buf_get64(bp, &auth->iab_timestamp) - || !buf_get32(bp, &auth->iab_spi_len)) - return 0; - - /* Make sure the length specified by the auth block - * is reasonable. */ - if (auth->iab_length < ISNS_AUTHBLK_SIZE - || auth->iab_length > avail) - return 0; - - /* This chops off any data trailing the auth block. - * It also makes sure that we detect if iab_length - * exceeds the amount of available data. */ - if (!buf_truncate(bp, auth->iab_length - ISNS_AUTHBLK_SIZE)) - return 0; - - auth->iab_spi = buf_head(bp); - if (!buf_pull(bp, auth->iab_spi_len)) - return 0; - - auth->iab_sig = buf_head(bp); - auth->iab_sig_len = buf_avail(bp); - return 1; -} - -int -isns_authblock_encode(buf_t *bp, const struct isns_authblk *auth) -{ - if (!buf_put32(bp, auth->iab_bsd) - || !buf_put32(bp, auth->iab_length) - || !buf_put64(bp, auth->iab_timestamp) - || !buf_put32(bp, auth->iab_spi_len) - || !buf_put(bp, auth->iab_spi, auth->iab_spi_len) - || !buf_put(bp, auth->iab_sig, auth->iab_sig_len)) - return 0; - return 1; -} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/bitvector.c open-iscsi-2.0.874/utils/open-isns/bitvector.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/bitvector.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/bitvector.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,651 +0,0 @@ -/* - * Handle bit vector as a run length encoded array of - * 32bit words. - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include -#include -#include "isns.h" -#include "util.h" - -struct isns_bitvector { - unsigned int ib_count; - uint32_t * ib_words; -}; - -void -isns_bitvector_init(isns_bitvector_t *bv) -{ - memset(bv, 0, sizeof(*bv)); -} - -void -isns_bitvector_destroy(isns_bitvector_t *bv) -{ - isns_free(bv->ib_words); - memset(bv, 0, sizeof(*bv)); -} - -isns_bitvector_t * -isns_bitvector_alloc(void) -{ - return isns_calloc(1, sizeof(isns_bitvector_t)); -} - -void -isns_bitvector_free(isns_bitvector_t *bv) -{ - if (bv) { - isns_free(bv->ib_words); - memset(bv, 0xa5, sizeof(*bv)); - isns_free(bv); - } -} - -/* - * Helper function to locate bit - */ -uint32_t * -__isns_bitvector_find_word(const isns_bitvector_t *bv, unsigned int bit) -{ - uint32_t *wp, *end; - - if (bv->ib_words == NULL) - return NULL; - - wp = bv->ib_words; - end = wp + bv->ib_count; - while (wp < end) { - unsigned int base, rlen; - - base = wp[0]; - rlen = wp[1]; - - isns_assert(!(base % 32)); - if (base <= bit && bit < base + rlen * 32) - return wp + 2 + ((bit - base) / 32); - - wp += 2 + rlen; - isns_assert(wp <= end); - } - - return NULL; -} - -/* - * Insert words in the middle of the array - */ -static inline void -__isns_bitvector_insert_words(isns_bitvector_t *bv, - unsigned int offset, unsigned int count) -{ - bv->ib_words = isns_realloc(bv->ib_words, - (bv->ib_count + count) * sizeof(uint32_t)); - - /* If we insert in the middle, shift out the tail - * to make room for the new range. */ - isns_assert(offset <= bv->ib_count); - if (offset < bv->ib_count) { - memmove(bv->ib_words + offset + count, - bv->ib_words + offset, - (bv->ib_count - offset) * sizeof(uint32_t)); - } - - memset(bv->ib_words + offset, 0, count * sizeof(uint32_t)); - bv->ib_count += count; -} - -/* - * Insert a new range - */ -static inline uint32_t * -__isns_bitvector_insert_range(isns_bitvector_t *bv, - unsigned int offset, unsigned int base) -{ - uint32_t *pos; - - __isns_bitvector_insert_words(bv, offset, 3); - - pos = bv->ib_words + offset; - - *pos++ = base & ~31; - *pos++ = 1; - - return pos; -} - -/* - * Extend an existing range - * @offset marks the beginning of the existing range. - */ -static inline uint32_t * -__isns_bitvector_extend_range(isns_bitvector_t *bv, - unsigned int offset, unsigned int count) -{ - uint32_t *pos, rlen; - - /* Find the end of the range */ - pos = bv->ib_words + offset; - rlen = pos[1]; - - __isns_bitvector_insert_words(bv, offset + 2 + rlen, count); - - pos = bv->ib_words + offset; - pos[1] += count; - - /* Return pointer to the last word of the new range. */ - return pos + 2 + rlen + count - 1; -} - -/* - * Find a suitable range for insertion - */ -static uint32_t * -__isns_bitvector_find_insert_word(isns_bitvector_t *bv, unsigned int bit) -{ - uint32_t *wp, *end; - - if (bv->ib_words == NULL) - return __isns_bitvector_insert_range(bv, 0, bit); - - wp = bv->ib_words; - end = wp + bv->ib_count; - while (wp < end) { - unsigned int base, rlen, distance; - - base = wp[0]; - rlen = wp[1]; - - isns_assert(!(base % 32)); - - if (bit < base) { - return __isns_bitvector_insert_range(bv, - wp - bv->ib_words, bit); - } - - distance = (bit - base) / 32; - if (distance < rlen) { - /* This bit is within range */ - return wp + 2 + distance; - } - - /* Is it efficient to extend this range? - * The break even point is if we have to add - * 3 words to extend the range, because a new - * range would be at least that much. - */ - if (distance + 1 <= rlen + 3) { - return __isns_bitvector_extend_range(bv, - wp - bv->ib_words, - distance + 1 - rlen); - } - - wp += 2 + rlen; - isns_assert(wp <= end); - } - - /* No suitable range found. Append one at the end */ - return __isns_bitvector_insert_range(bv, - bv->ib_count, bit); -} - -/* - * After clearing a bit, check if the bitvector can be - * compacted. - */ -static void -__isns_bitvector_compact(isns_bitvector_t *bv) -{ - uint32_t *src, *dst, *end; - unsigned int dst_base = 0, dst_len = 0; - - if (bv->ib_words == NULL) - return; - - src = dst = bv->ib_words; - end = src + bv->ib_count; - while (src < end) { - unsigned int base, rlen; - - base = *src++; - rlen = *src++; - - /* Consume leading NUL words */ - while (rlen && *src == 0) { - base += 32; - src++; - rlen--; - } - - /* Consume trailing NUL words */ - while (rlen && src[rlen-1] == 0) - rlen--; - - if (rlen != 0) { - if (dst_len && dst_base + 32 * dst_len == base) { - /* We can extend the previous run */ - } else { - /* New run. Close off the previous one, - * if we had one. */ - if (dst_len != 0) { - dst[0] = dst_base; - dst[1] = dst_len; - dst += 2 + dst_len; - } - - dst_base = base; - dst_len = 0; - } - - while (rlen--) - dst[2 + dst_len++] = *src++; - } - - isns_assert(src <= end); - } - - - if (dst_len != 0) { - dst[0] = dst_base; - dst[1] = dst_len; - dst += 2 + dst_len; - } - - bv->ib_count = dst - bv->ib_words; - if (bv->ib_count == 0) - isns_bitvector_destroy(bv); -} - -/* - * Test the value of a single bit - */ -int -isns_bitvector_test_bit(const isns_bitvector_t *bv, unsigned int bit) -{ - const uint32_t *pos; - uint32_t mask; - - pos = __isns_bitvector_find_word(bv, bit); - if (pos == NULL) - return 0; - - mask = 1 << (bit % 32); - return !!(*pos & mask); -} - -int -isns_bitvector_clear_bit(isns_bitvector_t *bv, unsigned int bit) -{ - uint32_t *pos, oldval, mask; - - pos = __isns_bitvector_find_word(bv, bit); - if (pos == NULL) - return 0; - - mask = 1 << (bit % 32); - oldval = *pos; - *pos &= ~mask; - - __isns_bitvector_compact(bv); - return !!(oldval & mask); -} - -int -isns_bitvector_set_bit(isns_bitvector_t *bv, unsigned int bit) -{ - uint32_t *pos, oldval = 0, mask; - - mask = 1 << (bit % 32); - - pos = __isns_bitvector_find_insert_word(bv, bit); - if (pos != NULL) { - oldval = *pos; - *pos |= mask; - - return !!(oldval & mask); - } - - return 0; -} - -int -isns_bitvector_is_empty(const isns_bitvector_t *bv) -{ - uint32_t *wp, *end; - - if (bv == NULL || bv->ib_count == 0) - return 1; - - /* In theory, we should never have a non-compacted - * empty bitvector, as the only way to get one - * is through clear_bit. - * Better safe than sorry... - */ - - wp = bv->ib_words; - end = wp + bv->ib_count; - while (wp < end) { - unsigned int base, rlen; - - base = *wp++; - rlen = *wp++; - - while (rlen--) { - if (*wp++) - return 0; - } - isns_assert(wp <= end); - } - - return 1; -} - -int -isns_bitvector_intersect(const isns_bitvector_t *a, - const isns_bitvector_t *b, - isns_bitvector_t *result) -{ - const uint32_t *runa, *runb, *enda, *endb; - const uint32_t *wpa = NULL, *wpb = NULL; - uint32_t bita = 0, lena = 0, bitb = 0, lenb = 0; - int found = -1; - - if (a == NULL || b == NULL) - return -1; - - /* Returning the intersect is not implemented yet. */ - isns_assert(result == NULL); - - runa = a->ib_words; - enda = runa + a->ib_count; - runb = b->ib_words; - endb = runb + b->ib_count; - - while (1) { - unsigned int skip; - - if (lena == 0) { -next_a: - if (runa >= enda) - break; - bita = *runa++; - lena = *runa++; - wpa = runa; - runa += lena; - lena *= 32; - } - - if (lenb == 0) { -next_b: - if (runb >= endb) - break; - bitb = *runb++; - lenb = *runb++; - wpb = runb; - runb += lenb; - lenb *= 32; - } - - if (bita < bitb) { - skip = bitb - bita; - - /* range A ends before range B starts. - * Proceed to next run in vector A. */ - if (skip >= lena) - goto next_a; - - bita += skip; - lena -= skip; - wpa += skip / 32; - } else - if (bitb < bita) { - skip = bita - bitb; - - /* range B ends before range A starts. - * Proceed to next run in vector B. */ - if (skip >= lenb) - goto next_b; - - bitb += skip; - lenb -= skip; - wpb += skip / 32; - } - - isns_assert(bita == bitb); - - while (lena && lenb) { - uint32_t intersect; - - intersect = *wpa & *wpb; - - if (!intersect) - goto next_word; - - /* Find the bit */ - if (found < 0) { - uint32_t mask = intersect; - - found = bita; - while (!(mask & 1)) { - found++; - mask >>= 1; - } - } - - if (result == NULL) - return found; - - /* Append to result vector */ - /* FIXME: TBD */ - -next_word: - bita += 32; lena -= 32; wpa++; - bitb += 32; lenb -= 32; wpb++; - } - } - - return found; -} - -/* - * Iterate over the bit vector - */ -void -isns_bitvector_foreach(const isns_bitvector_t *bv, - int (*cb)(uint32_t, void *), - void *user_data) -{ - uint32_t *wp, *end; - - wp = bv->ib_words; - end = wp + bv->ib_count; - while (wp < end) { - unsigned int base, rlen, bits; - - base = wp[0]; - rlen = wp[1]; - bits = rlen * 32; - wp += 2; - - while (rlen--) { - uint32_t mask, word; - - word = *wp++; - for (mask = 1; mask; mask <<= 1, ++base) { - if (word & mask) - cb(base, user_data); - } - } - isns_assert(wp <= end); - } -} - -void -isns_bitvector_dump(const isns_bitvector_t *bv, isns_print_fn_t *fn) -{ - uint32_t *wp, *end; - - fn("Bit Vector %p (%u words):", bv, bv->ib_count); - - wp = bv->ib_words; - end = wp + bv->ib_count; - while (wp < end) { - unsigned int base, rlen, bits; - - base = wp[0]; - rlen = wp[1]; - bits = rlen * 32; - wp += 2; - - fn(" <%u:", base); - while (rlen--) - fn(" 0x%x", *wp++); - fn(">"); - - isns_assert(wp <= end); - } - - if (bv->ib_count == 0) - fn(""); - fn("\n"); -} - -static inline void -__isns_bitvector_print_next(uint32_t first, uint32_t last, - isns_print_fn_t *fn) -{ - switch (last - first) { - case 0: - return; - case 1: - fn(", %u", last); - break; - default: - fn("-%u", last); - break; - } -} - -void -isns_bitvector_print(const isns_bitvector_t *bv, - isns_print_fn_t *fn) -{ - uint32_t *wp, *end, first = 0, next = 0; - const char *sepa = ""; - - wp = bv->ib_words; - end = wp + bv->ib_count; - while (wp < end) { - unsigned int base, rlen, bits; - - base = wp[0]; - rlen = wp[1]; - bits = rlen * 32; - wp += 2; - - while (rlen--) { - uint32_t mask, word; - - word = *wp++; - for (mask = 1; mask; mask <<= 1, ++base) { - if (word & mask) { - if (next++) - continue; - fn("%s%u", sepa, base); - sepa = ", "; - first = base; - next = base + 1; - } else { - if (next) - __isns_bitvector_print_next(first, next - 1, fn); - first = next = 0; - } - } - } - isns_assert(wp <= end); - } - - if (next) - __isns_bitvector_print_next(first, next - 1, fn); - - if (*sepa == '\0') - fn(""); - fn("\n"); -} - -#ifdef TEST -int -main(void) -{ - isns_bitvector_t a, b; - int i; - - isns_bitvector_init(&a); - isns_bitvector_set_bit(&a, 0); - isns_bitvector_dump(&a, isns_print_stdout); - isns_bitvector_set_bit(&a, 1); - isns_bitvector_set_bit(&a, 16); - isns_bitvector_set_bit(&a, 32); - isns_bitvector_set_bit(&a, 64); - isns_bitvector_dump(&a, isns_print_stdout); - isns_bitvector_set_bit(&a, 8192); - isns_bitvector_set_bit(&a, 8196); - isns_bitvector_set_bit(&a, 8194); - isns_bitvector_dump(&a, isns_print_stdout); - isns_bitvector_set_bit(&a, 2052); - isns_bitvector_set_bit(&a, 2049); - isns_bitvector_set_bit(&a, 2051); - isns_bitvector_set_bit(&a, 2050); - isns_bitvector_dump(&a, isns_print_stdout); - isns_bitvector_print(&a, isns_print_stdout); - isns_bitvector_destroy(&a); - - isns_bitvector_init(&a); - for (i = 127; i >= 0; --i) - isns_bitvector_set_bit(&a, i); - isns_bitvector_dump(&a, isns_print_stdout); - printf("[Compacting]\n"); - __isns_bitvector_compact(&a); - isns_bitvector_dump(&a, isns_print_stdout); - isns_bitvector_print(&a, isns_print_stdout); - isns_bitvector_destroy(&a); - - isns_bitvector_init(&a); - for (i = 0; i < 128; ++i) - isns_bitvector_set_bit(&a, i); - isns_bitvector_dump(&a, isns_print_stdout); - isns_bitvector_print(&a, isns_print_stdout); - isns_bitvector_destroy(&a); - - isns_bitvector_init(&a); - isns_bitvector_init(&b); - isns_bitvector_set_bit(&a, 0); - isns_bitvector_set_bit(&a, 77); - isns_bitvector_set_bit(&a, 249); - isns_bitvector_set_bit(&a, 102); - - isns_bitvector_set_bit(&b, 1); - isns_bitvector_set_bit(&b, 76); - isns_bitvector_set_bit(&b, 250); - isns_bitvector_set_bit(&b, 102); - i = isns_bitvector_intersect(&a, &b, NULL); - if (i != 102) - fprintf(stderr, "*** BAD: Intersect should return 102 (got %d)! ***\n", i); - else - printf("Intersect okay: %d\n", i); - isns_bitvector_destroy(&a); - isns_bitvector_destroy(&b); - - isns_bitvector_init(&a); - isns_bitvector_set_bit(&a, 0); - isns_bitvector_set_bit(&a, 1); - isns_bitvector_clear_bit(&a, 1); - isns_bitvector_clear_bit(&a, 0); - isns_bitvector_dump(&a, isns_print_stdout); - isns_bitvector_print(&a, isns_print_stdout); - isns_bitvector_destroy(&a); - return 0; -} -#endif diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/buffer.c open-iscsi-2.0.874/utils/open-isns/buffer.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/buffer.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/buffer.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,407 +0,0 @@ -/* - * Buffer handling functions - * - * Copyright (C) 2003-2007, Olaf Kirch - */ - -#include -#include -#include -#include -#include -#include -#include /* ntohl&htonl */ -#include "buffer.h" -#include "util.h" /* htonll */ - -static int buf_drain(buf_t *bp); - -buf_t * -buf_alloc(size_t size) -{ - buf_t *bp; - - bp = isns_calloc(1, sizeof(*bp)); - buf_init_empty(bp, size); - - return bp; -} - -buf_t * -buf_open(const char *filename, int flags) -{ - static const unsigned int buflen = 4096; - buf_t *bp; - int oerr; - - if (!(bp = isns_calloc(1, sizeof(*bp) + buflen))) - return NULL; - buf_init(bp, (bp + 1), buflen); - - switch (flags & O_ACCMODE) { - case O_RDONLY: - bp->write_mode = 0; - break; - - case O_WRONLY: - bp->write_mode = 1; - break; - - default: - errno = EINVAL; - goto failed; - } - - if (!filename || !strcmp(filename, "-")) { - bp->fd = dup(bp->write_mode? 1 : 0); - } else { - bp->fd = open(filename, flags, 0666); - } - - if (bp->fd < 0) - goto failed; - - return bp; - -failed: oerr = errno; - isns_free(bp); - errno = oerr; - return NULL; -} - -buf_t * -buf_dup(const buf_t *src) -{ - buf_t *bp; - - bp = buf_alloc(src->max_size); - buf_put(bp, src->base + src->head, src->tail - src->head); - - bp->addr = src->addr; - bp->addrlen = src->addrlen; - return bp; -} - -void -buf_close(buf_t *bp) -{ - if (bp->write_mode) - buf_drain(bp); - if (bp->fd >= 0) - close(bp->fd); - bp->fd = -1; - isns_free(bp); -} - -void -buf_free(buf_t *bp) -{ - if (!bp) - return; - if (bp->allocated) - isns_free(bp->base); - isns_free(bp); -} - -void -buf_list_free(buf_t *bp) -{ - buf_t *next; - - while (bp) { - next = bp->next; - buf_free(bp); - bp = next; - } -} - -void -buf_init(buf_t *bp, void *mem, size_t len) -{ - memset(bp, 0, sizeof(*bp)); - bp->base = (unsigned char *) mem; - bp->size = len; - bp->max_size = len; - bp->fd = -1; -} - -void -buf_init_empty(buf_t *bp, size_t len) -{ - memset(bp, 0, sizeof(*bp)); - bp->max_size = len; - bp->fd = -1; -} - -void -buf_set(buf_t *bp, void *mem, size_t len) -{ - buf_init(bp, mem, len); - bp->tail = len; -} - -void -buf_clear(buf_t *bp) -{ - bp->head = bp->tail = 0; -} - -int -buf_fill(buf_t *bp) -{ - int n; - - if (bp->head || bp->tail) - buf_compact(bp); - - if (bp->write_mode || bp->fd < 0) - return 0; - - n = read(bp->fd, bp->base + bp->tail, buf_tailroom(bp)); - if (n < 0) { - warn("read error"); - return 0; - } - - bp->tail += n; - return n; -} - -int -buf_drain(buf_t *bp) -{ - int n; - - if (!bp->write_mode || bp->fd < 0) - return 0; - - n = write(bp->fd, bp->base + bp->head, buf_avail(bp)); - if (n < 0) { - warn("write error"); - return 0; - } - - bp->head += n; - return n; -} - -int -__buf_resize(buf_t *bp, size_t new_size) -{ - void *new_base; - - if (new_size > bp->max_size) - return 0; - isns_assert(bp->allocated || bp->base == NULL); - - new_size = (new_size + 127) & ~127; - if (new_size > bp->max_size) - new_size = bp->max_size; - - new_base = isns_realloc(bp->base, new_size); - if (new_base == NULL) - return 0; - - bp->base = new_base; - bp->size = new_size; - bp->allocated = 1; - return new_size; -} - -buf_t * -buf_split(buf_t **to_split, size_t size) -{ - buf_t *old = *to_split, *new; - size_t avail; - - avail = buf_avail(old); - if (size > avail) - return NULL; - - if (size == avail) { - *to_split = NULL; - return old; - } - - new = buf_alloc(size); - buf_put(new, buf_head(old), size); - buf_pull(old, size); - - return new; -} - -int -buf_seek(buf_t *bp, off_t offset) -{ - if (bp->write_mode && !buf_drain(bp)) - return 0; - if (lseek(bp->fd, offset, SEEK_SET) < 0) { - warn("cannot seek to offset %ld", (long) offset); - return 0; - } - return 1; -} - -int -buf_get(buf_t *bp, void *mem, size_t len) -{ - caddr_t dst = (caddr_t) mem; - unsigned int total = len, copy; - - while (len) { - if ((copy = buf_avail(bp)) > len) - copy = len; - if (copy == 0) { - if (!buf_fill(bp)) - return 0; - continue; - } - if (dst) { - memcpy(dst, bp->base + bp->head, copy); - dst += copy; - } - bp->head += copy; - len -= copy; - } - return total; -} - -int -buf_get32(buf_t *bp, uint32_t *vp) -{ - if (!buf_get(bp, vp, 4)) - return 0; - *vp = ntohl(*vp); - return 1; -} - -int -buf_get64(buf_t *bp, uint64_t *vp) -{ - if (!buf_get(bp, vp, 8)) - return 0; - *vp = ntohll(*vp); - return 1; -} - -int -buf_gets(buf_t *bp, char *stringbuf, size_t size) -{ - uint32_t len, copy; - - if (size == 0) - return 0; - - if (!buf_get32(bp, &len)) - return 0; - - if ((copy = len) >= size) - copy = size - 1; - - if (!buf_get(bp, stringbuf, copy)) - return 0; - stringbuf[copy] = '\0'; - - /* Pull remaining bytes */ - if (copy != len && !buf_pull(bp, len - copy)) - return 0; - - return copy + 1; -} - -int -buf_put(buf_t *bp, const void *mem, size_t len) -{ - caddr_t src = (caddr_t) mem; - unsigned int total = len, copy; - - while (len) { - if ((copy = bp->size - bp->tail) > len) - copy = len; - if (copy == 0) { - if (buf_drain(bp)) { - buf_compact(bp); - continue; - } - if (__buf_resize(bp, bp->tail + len)) { - buf_compact(bp); - continue; - } - return 0; - } - if (src) { - memcpy(bp->base + bp->tail, src, copy); - src += copy; - } - bp->tail += copy; - len -= copy; - } - return total; -} - -int -buf_putc(buf_t *bp, int byte) -{ - unsigned char c = byte; - - return buf_put(bp, &c, 1); -} - -int -buf_put32(buf_t *bp, uint32_t val) -{ - val = htonl(val); - if (!buf_put(bp, &val, 4)) - return 0; - return 1; -} - -int -buf_put64(buf_t *bp, uint64_t val) -{ - val = htonll(val); - return buf_put(bp, &val, 8); -} - -int -buf_puts(buf_t *bp, const char *sp) -{ - uint32_t len = 0; - - if (sp) - len = strlen(sp); - return buf_put32(bp, len) && buf_put(bp, sp, len); -} - -void -buf_compact(buf_t *bp) -{ - unsigned int count; - - if (bp->head == 0) - return; - - count = bp->tail - bp->head; - memmove(bp->base, bp->base + bp->head, count); - bp->tail -= bp->head; - bp->head = 0; -} - -void -buf_list_append(buf_t **list, buf_t *bp) -{ - bp->next = NULL; - while (*list) - list = &(*list)->next; - *list = bp; -} - -int -buf_truncate(buf_t *bp, size_t len) -{ - if (bp->head + len > bp->tail) - return 0; - - bp->tail = bp->head + len; - return 1; -} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/buffer.h open-iscsi-2.0.874/utils/open-isns/buffer.h --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/buffer.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/buffer.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,141 +0,0 @@ -/* - * Buffer handling functions - * - * Copyright (C) 2003-2006, Olaf Kirch - */ - -#ifndef BUFFER_H -#define BUFFER_H - -#include -#include -#include - -typedef struct isns_buf { - struct isns_buf * next; - unsigned char * base; - unsigned int head, tail, size, max_size; - unsigned int write_mode : 1, - allocated : 1; - int fd; - - /* Anonymous union for misc stuff */ - union { - struct { - struct sockaddr_storage addr; - socklen_t addrlen; - }; - }; -} buf_t; - -extern buf_t * buf_open(const char *, int); -extern buf_t * buf_alloc(size_t); -extern buf_t * buf_dup(const buf_t *); -extern void buf_init(buf_t *, void *, size_t); -extern void buf_init_empty(buf_t *, size_t); -extern void buf_set(buf_t *, void *, size_t); - -extern void buf_clear(buf_t *); -extern void buf_close(buf_t *); -extern void buf_destroy(buf_t *); -extern void buf_free(buf_t *); -extern void buf_list_free(buf_t *); - -extern int buf_get(buf_t *, void *, size_t); -extern int buf_get32(buf_t *, uint32_t *); -extern int buf_get64(buf_t *, uint64_t *); -extern int buf_gets(buf_t *, char *, size_t); -extern int buf_put(buf_t *, const void *, size_t); -extern int buf_put32(buf_t *, uint32_t); -extern int buf_put64(buf_t *, uint64_t); -extern int buf_puts(buf_t *, const char *); -extern int buf_putc(buf_t *, int); -extern int buf_read(buf_t *, int); -extern int buf_seek(buf_t *bp, off_t offset); -extern int buf_truncate(buf_t *, size_t); -extern void buf_compact(buf_t *); -extern buf_t * buf_split(buf_t **to_split, size_t len); -extern int __buf_resize(buf_t *, size_t); - -extern void buf_list_append(buf_t **, buf_t *); - -static inline size_t -buf_avail(const buf_t *bp) -{ - return bp->tail - bp->head; -} - -static inline size_t -buf_tailroom(const buf_t *bp) -{ - return bp->max_size - bp->tail; -} - -static inline size_t -buf_size(const buf_t *bp) -{ - return bp->size; -} - -static inline void * -buf_head(const buf_t *bp) -{ - return bp->base + bp->head; -} - -static inline void * -buf_tail(const buf_t *bp) -{ - return bp->base + bp->tail; -} - -static inline int -buf_reserve(buf_t *bp, size_t len) -{ - if (bp->head != bp->tail) - return 0; - if (bp->max_size - bp->head < len) - return 0; - bp->head += len; - bp->tail += len; - return 1; -} - -static inline int -buf_pull(buf_t *bp, size_t len) -{ - if (len > buf_avail(bp)) - return 0; - bp->head += len; - return 1; -} - -static inline void * -buf_push(buf_t *bp, size_t len) -{ - if (bp->max_size - bp->tail < len) - return NULL; - - if (bp->tail + len > bp->size - && !__buf_resize(bp, bp->tail + len)) - return NULL; - - bp->tail += len; - return bp->base + bp->tail - len; -} - -static inline void * -buf_push_head(buf_t *bp, size_t len) -{ - if (bp->head < len) - return NULL; - - if (bp->tail > bp->size - && !__buf_resize(bp, bp->tail)) - return NULL; - - bp->head -= len; - return bp->base + bp->head; -} - -#endif /* BUFFER_H */ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/callback.c open-iscsi-2.0.874/utils/open-isns/callback.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/callback.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/callback.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,148 +0,0 @@ -/* - * iSNS object callbacks for SCN and other stuff - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include -#include -#include "isns.h" -#include "objects.h" -#include "vendor.h" -#include "attrs.h" -#include "util.h" - -typedef struct isns_object_notifier isns_object_notifier_t; -struct isns_object_notifier { - isns_list_t list; - isns_db_callback_t * func; - void * data; -}; - -typedef struct isns_cb_event isns_cb_event_t; -struct isns_cb_event { - isns_list_t list; - isns_db_event_t info; -}; - -static ISNS_LIST_DECLARE(notifiers); -static ISNS_LIST_DECLARE(events); - -static inline void -__isns_db_event(isns_object_t *dst, - isns_object_t *obj, - unsigned int bits, - isns_object_t *trigger) -{ - isns_cb_event_t *ev; - - ev = isns_calloc(1, sizeof(*ev)); - ev->info.ie_recipient = isns_object_get(dst); - ev->info.ie_object = isns_object_get(obj); - ev->info.ie_bits = bits; - ev->info.ie_trigger = isns_object_get(trigger); - isns_list_append(&events, &ev->list); -} - -void -isns_object_event(isns_object_t *obj, - unsigned int bits, - isns_object_t *trigger) -{ - __isns_db_event(NULL, obj, bits, trigger); -} - -void -isns_unicast_event(isns_object_t *dst, - isns_object_t *obj, - unsigned int bits, - isns_object_t *trigger) -{ - __isns_db_event(dst, obj, bits, trigger); -} - -/* - * Given an object pair and an event bitmask, - * invoke all callbacks - */ -static inline void -isns_call_callbacks(isns_db_event_t *ev) -{ - isns_object_t *obj = ev->ie_object; - isns_list_t *pos, *next; - - ev->ie_bits |= obj->ie_scn_bits; - if (ev->ie_bits == 0) - return; - isns_list_foreach(¬ifiers, pos, next) { - isns_object_notifier_t *not; - - not = isns_list_item(isns_object_notifier_t, list, pos); - not->func(ev, not->data); - } - obj->ie_scn_bits = 0; -} - -void -isns_flush_events(void) -{ - while (!isns_list_empty(&events)) { - isns_cb_event_t *ev = isns_list_item(isns_cb_event_t, list, events.next); - - isns_call_callbacks(&ev->info); - isns_object_release(ev->info.ie_recipient); - isns_object_release(ev->info.ie_object); - isns_object_release(ev->info.ie_trigger); - isns_list_del(&ev->list); - isns_free(ev); - } -} - -void -isns_register_callback(isns_db_callback_t *func, - void *user_data) -{ - isns_object_notifier_t *not; - - not = isns_calloc(1, sizeof(*not)); - not->func = func; - not->data = user_data; - - isns_list_append(¬ifiers, ¬->list); -} - -const char * -isns_event_string(unsigned int bits) -{ - static const char *names[16] = { - [ISNS_SCN_DD_MEMBER_ADDED] = "member added", - [ISNS_SCN_DD_MEMBER_REMOVED] = "member removed", - [ISNS_SCN_OBJECT_UPDATED] = "updated", - [ISNS_SCN_OBJECT_ADDED] = "added", - [ISNS_SCN_OBJECT_REMOVED] = "removed", - [ISNS_SCN_MANAGEMENT_REGISTRATION]= "mgmt registration", - [ISNS_SCN_TARGET_AND_SELF_ONLY] = "target+self", - [ISNS_SCN_INITIATOR_AND_SELF_ONLY]= "initiator+self", - }; - static char buffer[128]; - unsigned int pos = 0, i; - - - for (i = 0; i < 16; ++i, bits >>= 1) { - if (!(bits & 1)) - continue; - - if (names[i]) { - snprintf(buffer + pos, sizeof(buffer) - pos, - "%s%s", pos? ", " : "", names[i]); - } else { - snprintf(buffer + pos, sizeof(buffer) - pos, - "%sevent %u", pos? ", " : "", i); - } - pos = strlen(buffer); - } - if (pos == 0) - return ""; - - return buffer; -} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/ChangeLog open-iscsi-2.0.874/utils/open-isns/ChangeLog --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/ChangeLog 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/ChangeLog 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -Under development: - -2007-09-27: - Fixed a serious interoperability bug - Added SLP support (using openslp) - Init script (courtesy Albert Pauw) - -2007-09-18: - Fixed a number of bugs - Added more test cases - Implemented default DD - Support autoconf, and building with/without openssl - -2007-08-24: - Improved discovery domain handling - Implemented DD deregistration - Backward compat fixes for older openssl versions - Made SCN more robust, SCN state now persists across server restarts - More regression tests - -2007-07-27: - Implemented SCN and ESI - Created iSNS discovery daemon (isnsdd) - Rewrote the policy handling a bit - Started to write some regression test code - Better manpages - -2007-07-12: - DevGetNext support - You can now define policies linking authentication - to permitted storage node names, permitted - entity names, etc. - Implemented DDReg - Queries and GetNext are now scoped to discovery domains - Lots of little bits and pieces for RFC conformance - -2005-07-18: - Public snapshot released - DSA based authentication - Deregistration - Simple file backed storage for the iSNS database - Entity Registration Period + Timestamp support (server side), - and entity expiration - isnsd now writes a pid file - Improved manual pages - DevGetNext support under development - -2007-05-11: - First public release, supporting register/query - diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/client.c open-iscsi-2.0.874/utils/open-isns/client.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/client.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/client.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,205 +0,0 @@ -/* - * Client functions - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include -#include -#include -#include -#include -#include - -#include -#include "security.h" -#include "util.h" -#include "internal.h" -#include "config.h" - -static isns_client_t * -__isns_create_default_client(isns_socket_t *sock, isns_security_t *ctx, - const char *source_name) -{ - isns_client_t *clnt; - - clnt = isns_calloc(1, sizeof(*clnt)); - - if (!source_name) - source_name = isns_config.ic_source_name; - - clnt->ic_source = isns_source_create_iscsi(source_name); - clnt->ic_socket = sock; - - isns_socket_set_security_ctx(clnt->ic_socket, ctx); - - return clnt; -} - -isns_client_t * -isns_create_client(isns_security_t *ctx, const char *source_name) -{ - isns_socket_t *sock; - const char *server_name; - - server_name = isns_config.ic_server_name; - if (!strcasecmp(server_name, "SLP:") - && !(server_name = isns_slp_find())) { - isns_error("Unable to locate iSNS server through SLP\n"); - return NULL; - } - - sock = isns_create_bound_client_socket( - isns_config.ic_bind_address, - server_name, - "isns", 0, SOCK_STREAM); - if (sock == NULL) { - isns_error("Unable to create socket for host \"%s\"\n", - isns_config.ic_server_name); - return NULL; - } - - return __isns_create_default_client(sock, - ctx? : isns_default_security_context(0), - source_name); -} - -isns_client_t * -isns_create_default_client(isns_security_t *ctx) -{ - return isns_create_client(ctx, isns_config.ic_source_name); -} - -isns_client_t * -isns_create_local_client(isns_security_t *ctx, const char *source_name) -{ - isns_socket_t *sock; - - if (isns_config.ic_control_socket == NULL) - isns_fatal("Cannot use local mode: no local control socket\n"); - - sock = isns_create_client_socket(isns_config.ic_control_socket, - NULL, 0, SOCK_STREAM); - if (sock == NULL) { - isns_error("Unable to create control socket (%s)\n", - isns_config.ic_control_socket); - return NULL; - } - - return __isns_create_default_client(sock, ctx, source_name); -} - -int -isns_client_call(isns_client_t *clnt, - isns_simple_t **inout) -{ - return isns_simple_call(clnt->ic_socket, inout); -} - -void -isns_client_destroy(isns_client_t *clnt) -{ - if (clnt->ic_socket) - isns_socket_free(clnt->ic_socket); - if (clnt->ic_source) - isns_source_release(clnt->ic_source); - isns_free(clnt); -} - -/* - * Get the local address - */ -int -isns_client_get_local_address(const isns_client_t *clnt, - isns_portal_info_t *portal_info) -{ - return isns_socket_get_portal_info(clnt->ic_socket, portal_info); -} - -/* - * Create a security context - */ -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; - -#ifndef WITH_SECURITY - isns_error("Cannot create security context: security disabled at build time\n"); - return NULL; -#else /* WITH_SECURITY */ - ctx = isns_create_dsa_context(); - if (ctx == NULL) - isns_fatal("Unable to create security context\n"); - - /* Load my own key */ - princ = isns_security_load_privkey(ctx, auth_key); - if (!princ) - isns_fatal("Unable to load private key from %s\n", - auth_key); - - isns_principal_set_name(princ, name); - isns_security_set_identity(ctx, princ); - - if (server_key) { - /* We're a client, and we want to load the - * server's public key in order to authenticate - * the server's responses. - */ - princ = isns_security_load_pubkey(ctx, server_key); - if (!princ) - isns_fatal("Unable to load public key from %s\n", - server_key); - - /* Do *not* set a name for this principal - - * this will be the default principal used when - * verifying the server's reply, which is a good thing - * because we don't know what SPI the server will - * be using. */ - isns_add_principal(ctx, princ); - - /* But set a policy for the server which allows it - to send ESI and SCN messages */ - isns_principal_set_policy(princ, isns_policy_server()); - } - - return ctx; -#endif /* WITH_SECURITY */ -} - -/* - * Create the default security context - */ -isns_security_t * -isns_default_security_context(int server_only) -{ - static isns_security_t *ctx; - - if (ctx == NULL) - ctx = __create_security_context(isns_config.ic_auth_name, - isns_config.ic_auth_key_file, - server_only? NULL : isns_config.ic_server_key_file); - return ctx; -} - -/* - * Create the control security context - */ -isns_security_t * -isns_control_security_context(int server_only) -{ - static isns_security_t *ctx; - - if (ctx == NULL) - ctx = __create_security_context(isns_config.ic_control_name, - isns_config.ic_control_key_file, - server_only? NULL : isns_config.ic_server_key_file); - return ctx; -} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/compat/my_getopt.c open-iscsi-2.0.874/utils/open-isns/compat/my_getopt.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/compat/my_getopt.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/compat/my_getopt.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,271 +0,0 @@ -/* - * my_getopt.c - my re-implementation of getopt. - * Copyright 1997, 2000, 2001, 2002, Benjamin Sittler - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, - * modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -#include -#include -#include -#include -#include "my_getopt.h" - -int my_optind=1, my_opterr=1, my_optopt=0; -char *my_optarg=0; - -/* this is the plain old UNIX getopt, with GNU-style extensions. */ -/* if you're porting some piece of UNIX software, this is all you need. */ -/* this supports GNU-style permution and optional arguments */ - -int my_getopt(int argc, char * argv[], const char *opts) -{ - static int charind=0; - const char *s; - char mode, colon_mode; - int off = 0, opt = -1; - - if(getenv("POSIXLY_CORRECT")) colon_mode = mode = '+'; - else { - if((colon_mode = *opts) == ':') off ++; - if(((mode = opts[off]) == '+') || (mode == '-')) { - off++; - if((colon_mode != ':') && ((colon_mode = opts[off]) == ':')) - off ++; - } - } - my_optarg = 0; - if(charind) { - my_optopt = argv[my_optind][charind]; - for(s=opts+off; *s; s++) if(my_optopt == *s) { - charind++; - if((*(++s) == ':') || ((my_optopt == 'W') && (*s == ';'))) { - if(argv[my_optind][charind]) { - my_optarg = &(argv[my_optind++][charind]); - charind = 0; - } else if(*(++s) != ':') { - charind = 0; - if(++my_optind >= argc) { - if(my_opterr) fprintf(stderr, - "%s: option requires an argument -- %c\n", - argv[0], my_optopt); - opt = (colon_mode == ':') ? ':' : '?'; - goto my_getopt_ok; - } - my_optarg = argv[my_optind++]; - } - } - opt = my_optopt; - goto my_getopt_ok; - } - if(my_opterr) fprintf(stderr, - "%s: illegal option -- %c\n", - argv[0], my_optopt); - opt = '?'; - if(argv[my_optind][++charind] == '\0') { - my_optind++; - charind = 0; - } - my_getopt_ok: - if(charind && ! argv[my_optind][charind]) { - my_optind++; - charind = 0; - } - } else if((my_optind >= argc) || - ((argv[my_optind][0] == '-') && - (argv[my_optind][1] == '-') && - (argv[my_optind][2] == '\0'))) { - my_optind++; - opt = -1; - } else if((argv[my_optind][0] != '-') || - (argv[my_optind][1] == '\0')) { - char *tmp; - int i, j, k; - - if(mode == '+') opt = -1; - else if(mode == '-') { - my_optarg = argv[my_optind++]; - charind = 0; - opt = 1; - } else { - for(i=j=my_optind; i j) { - tmp=argv[--i]; - for(k=i; k+1 argc) my_optind = argc; - return opt; -} - -/* this is the extended getopt_long{,_only}, with some GNU-like - * extensions. Implements _getopt_internal in case any programs - * expecting GNU libc getopt call it. - */ - -int _my_getopt_internal(int argc, char * argv[], const char *shortopts, - const struct option *longopts, int *longind, - int long_only) -{ - char mode, colon_mode = *shortopts; - int shortoff = 0, opt = -1; - - if(getenv("POSIXLY_CORRECT")) colon_mode = mode = '+'; - else { - if((colon_mode = *shortopts) == ':') shortoff ++; - if(((mode = shortopts[shortoff]) == '+') || (mode == '-')) { - shortoff++; - if((colon_mode != ':') && ((colon_mode = shortopts[shortoff]) == ':')) - shortoff ++; - } - } - my_optarg = 0; - if((my_optind >= argc) || - ((argv[my_optind][0] == '-') && - (argv[my_optind][1] == '-') && - (argv[my_optind][2] == '\0'))) { - my_optind++; - opt = -1; - } else if((argv[my_optind][0] != '-') || - (argv[my_optind][1] == '\0')) { - char *tmp; - int i, j, k; - - opt = -1; - if(mode == '+') return -1; - else if(mode == '-') { - my_optarg = argv[my_optind++]; - return 1; - } - for(i=j=my_optind; i j) { - tmp=argv[--i]; - for(k=i; k+1= argc) { - opt = (colon_mode == ':') ? ':' : '?'; - if(my_opterr) fprintf(stderr, - "%s: option `--%s' requires an argument\n", - argv[0], longopts[found].name); - } else my_optarg = argv[my_optind]; - } - if(!opt) { - if (longind) *longind = found; - if(!longopts[found].flag) opt = longopts[found].val; - else *(longopts[found].flag) = longopts[found].val; - } - my_optind++; - } else if(!hits) { - if(offset == 1) opt = my_getopt(argc, argv, shortopts); - else { - opt = '?'; - if(my_opterr) fprintf(stderr, - "%s: unrecognized option `%s'\n", - argv[0], argv[my_optind++]); - } - } else { - opt = '?'; - if(my_opterr) fprintf(stderr, - "%s: option `%s' is ambiguous\n", - argv[0], argv[my_optind++]); - } - } - if (my_optind > argc) my_optind = argc; - return opt; -} - -int my_getopt_long(int argc, char * argv[], const char *shortopts, - const struct option *longopts, int *longind) -{ - return _my_getopt_internal(argc, argv, shortopts, longopts, longind, 0); -} - -int my_getopt_long_only(int argc, char * argv[], const char *shortopts, - const struct option *longopts, int *longind) -{ - return _my_getopt_internal(argc, argv, shortopts, longopts, longind, 1); -} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/compat/my_getopt.h open-iscsi-2.0.874/utils/open-isns/compat/my_getopt.h --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/compat/my_getopt.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/compat/my_getopt.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,69 +0,0 @@ -/* - * my_getopt.h - interface to my re-implementation of getopt. - * Copyright 1997, 2000, 2001, 2002, Benjamin Sittler - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, - * modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -#ifndef MY_GETOPT_H_INCLUDED -#define MY_GETOPT_H_INCLUDED - -#ifdef __cplusplus -extern "C" { -#endif - -/* UNIX-style short-argument parser */ -extern int my_getopt(int argc, char * argv[], const char *opts); - -extern int my_optind, my_opterr, my_optopt; -extern char *my_optarg; - -struct option { - const char *name; - int has_arg; - int *flag; - int val; -}; - -/* human-readable values for has_arg */ -#undef no_argument -#define no_argument 0 -#undef required_argument -#define required_argument 1 -#undef optional_argument -#define optional_argument 2 - -/* GNU-style long-argument parsers */ -extern int my_getopt_long(int argc, char * argv[], const char *shortopts, - const struct option *longopts, int *longind); - -extern int my_getopt_long_only(int argc, char * argv[], const char *shortopts, - const struct option *longopts, int *longind); - -extern int _my_getopt_internal(int argc, char * argv[], const char *shortopts, - const struct option *longopts, int *longind, - int long_only); - -#ifdef __cplusplus -} -#endif - -#endif /* MY_GETOPT_H_INCLUDED */ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/config.c open-iscsi-2.0.874/utils/open-isns/config.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/config.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/config.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,278 +0,0 @@ -/* - * Config file reader - * - * Copyright (C) 2007 Olaf Kirch - */ -#include -#include -#include -#include - -#include "isns.h" -#include "util.h" -#include "paths.h" - -/* - * iSNS configuration - */ -struct isns_config isns_config = { - /* Security parameters */ - .ic_security = -1, - .ic_auth_key_file = ISNS_ETCDIR "/auth_key", - .ic_server_key_file = ISNS_ETCDIR "/server_key.pub", - .ic_client_keystore = "DB:", - .ic_control_socket = ISNS_RUNDIR "/isnsctl", - .ic_pidfile = ISNS_RUNDIR "/isnsd.pid", - .ic_local_registry_file = ISNS_DEFAULT_LOCAL_REGISTRY, - - .ic_control_name = "isns.control", - .ic_control_key_file = ISNS_ETCDIR "/control.key", - - .ic_registration_period = 3600, /* 1 hour */ - .ic_scn_timeout = 60, - .ic_scn_retries = 3, - - .ic_esi_max_interval = 600, /* 10 minutes */ - .ic_esi_min_interval = 60, /* 1 minute */ - .ic_esi_retries = 3, - - .ic_auth = { - .replay_window = 300, /* 5 min clock skew */ - .timestamp_jitter = 1, /* 1 sec timestamp jitter */ - .allow_unknown_peers = 1, - }, - .ic_network = { - .max_sockets = 1024, - .connect_timeout = 5, - .reconnect_timeout = 10, - .call_timeout = 60, - .udp_retrans_timeout = 10, - .tcp_retrans_timeout = 60, - .idle_timeout = 300, - }, - .ic_dsa = { - .param_file = ISNS_ETCDIR "/dsa.params", - }, -}; - -/* - * Default string values need to be dup'ed, - * so that later assignment does't try to free - * these strings. - */ -static inline void -__isns_config_defaults(void) -{ - static int defaults_init = 1; - - if (!defaults_init) - return; - -#define DUP(member) \ - if (isns_config.member) \ - isns_config.member = isns_strdup(isns_config.member) - - DUP(ic_source_name); - DUP(ic_database); - DUP(ic_server_name); - DUP(ic_bind_address); - DUP(ic_auth_key_file); - DUP(ic_server_key_file); - DUP(ic_client_keystore); - DUP(ic_control_socket); - DUP(ic_pidfile); - DUP(ic_control_name); - DUP(ic_control_key_file); - DUP(ic_local_registry_file); - DUP(ic_dsa.param_file); - -#undef DUP - - defaults_init = 0; -} - -/* - * Read the iSNS configuration file - */ -int -isns_read_config(const char *filename) -{ - FILE *fp; - char *name, *pos; - - __isns_config_defaults(); - - if ((fp = fopen(filename, "r")) == NULL) { - perror(filename); - return -1; - } - - while ((pos = parser_get_next_line(fp)) != NULL) { - pos[strcspn(pos, "#")] = '\0'; - - if (!(name = parser_get_next_word(&pos))) - continue; - - isns_config_set(name, pos); - } - - fclose(fp); - - /* Massage the config file */ - if (isns_config.ic_security < 0) { - /* By default, we will enable authentication - * whenever we find our private key, and - * the server's public key. */ - if (access(isns_config.ic_auth_key_file, R_OK) == 0 - && access(isns_config.ic_server_key_file, R_OK) == 0) - isns_config.ic_security = 1; - else - isns_config.ic_security = 0; - } - - isns_init_names(); - - return 0; -} - -int -isns_config_set(const char *name, char *pos) -{ - char *value; - - value = parser_get_rest_of_line(&pos); - if (value) - while (isspace(*value) || *value == '=') - ++value; - if (!strcasecmp(name, "HostName")) { - if (!value) - goto no_value; - isns_assign_string(&isns_config.ic_host_name, value); - } else if (!strcasecmp(name, "SourceName")) { - if (!value) - goto no_value; - isns_assign_string(&isns_config.ic_source_name, value); - } else if (!strcasecmp(name, "AuthName")) { - if (!value) - goto no_value; - isns_assign_string(&isns_config.ic_auth_name, value); - } else if (!strcasecmp(name, "Database")) { - if (!value) - goto no_value; - isns_assign_string(&isns_config.ic_database, value); - } else if (!strcasecmp(name, "ServerAddress")) { - if (!value) - goto no_value; - isns_assign_string(&isns_config.ic_server_name, value); - } else if (!strcasecmp(name, "BindAddress")) { - if (!value) - goto no_value; - isns_assign_string(&isns_config.ic_bind_address, value); - } else if (!strcasecmp(name, "ControlSocket")) { - if (!value) - goto no_value; - isns_assign_string(&isns_config.ic_control_socket, value); - } else if (!strcasecmp(name, "PIDFile")) { - if (!value) - goto no_value; - isns_assign_string(&isns_config.ic_pidfile, value); - } else if (!strcasecmp(name, "LocalRegistry")) { - if (!value) - goto no_value; - isns_assign_string(&isns_config.ic_local_registry_file, value); - } else if (!strcasecmp(name, "RegistrationPeriod")) { - if (!value) - goto no_value; - isns_config.ic_registration_period = parse_timeout(value); - } else if (!strcasecmp(name, "SCNTimeout")) { - if (!value) - goto no_value; - isns_config.ic_scn_timeout = parse_timeout(value); - } else if (!strcasecmp(name, "SCNRetries")) { - if (!value) - goto no_value; - isns_config.ic_scn_retries = parse_int(value); - } else if (!strcasecmp(name, "SCNCallout")) { - if (!value) - goto no_value; - isns_assign_string(&isns_config.ic_scn_callout, value); - } else if (!strcasecmp(name, "ESIMinInterval")) { - if (!value) - goto no_value; - isns_config.ic_esi_min_interval = parse_timeout(value); - } else if (!strcasecmp(name, "ESIMaxInterval")) { - if (!value) - goto no_value; - isns_config.ic_esi_max_interval = parse_timeout(value); - } else if (!strcasecmp(name, "ESIRetries")) { - if (!value) - goto no_value; - isns_config.ic_esi_retries = parse_int(value); - } else if (!strcasecmp(name, "DefaultDiscoveryDomain")) { - if (!value) - goto no_value; - isns_config.ic_use_default_domain = parse_int(value); - } else if (!strcasecmp(name, "SLPRegister")) { - if (!value) - goto no_value; - isns_config.ic_slp_register = parse_int(value); - } else if (!strcasecmp(name, "Security")) { - if (!value) - goto no_value; - isns_config.ic_security = parse_int(value); - } else if (!strcasecmp(name, "AuthKeyFile")) { - if (!value) - goto no_value; - isns_assign_string(&isns_config.ic_auth_key_file, value); - } else if (!strcasecmp(name, "ServerKeyFile")) { - if (!value) - goto no_value; - isns_assign_string(&isns_config.ic_server_key_file, value); - } else if (!strcasecmp(name, "ClientKeyStore") - || !strcasecmp(name, "KeyStore")) { - if (!value) - goto no_value; - isns_assign_string(&isns_config.ic_client_keystore, value); - } else if (!strcasecmp(name, "Control.SourceName")) { - if (!value) - goto no_value; - isns_assign_string(&isns_config.ic_control_name, value); - } else if (!strcasecmp(name, "Control.AuthKeyFile")) { - if (!value) - goto no_value; - isns_assign_string(&isns_config.ic_control_key_file, value); - } else if (!strcasecmp(name, "Auth.ReplayWindow")) { - if (!value) - goto no_value; - isns_config.ic_auth.replay_window = parse_timeout(value); - } else if (!strcasecmp(name, "Auth.TimestampJitter")) { - if (!value) - goto no_value; - isns_config.ic_auth.timestamp_jitter = parse_timeout(value); - } else if (!strcasecmp(name, "Network.MaxSockets")) { - if (!value) - goto no_value; - isns_config.ic_network.max_sockets = parse_timeout(value); - } else if (!strcasecmp(name, "Network.ConnectTimeout")) { - if (!value) - goto no_value; - isns_config.ic_network.connect_timeout = parse_timeout(value); - } else if (!strcasecmp(name, "Network.ReconnectTimeout")) { - if (!value) - goto no_value; - isns_config.ic_network.reconnect_timeout = parse_timeout(value); - } else if (!strcasecmp(name, "Network.CallTimeout")) { - if (!value) - goto no_value; - isns_config.ic_network.call_timeout = parse_timeout(value); - } else { - fprintf(stderr, "Unknown config item %s=%s\n", name, value); - } - return 0; - -no_value: - fprintf(stderr, - "*** Missing value in configuration assignment for %s ***\n", - name); - return -1; -} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/config.h.in open-iscsi-2.0.874/utils/open-isns/config.h.in --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/config.h.in 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/config.h.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,103 +0,0 @@ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* Define if building universal (internal helper macro) */ -#undef AC_APPLE_UNIVERSAL_BUILD - -/* Define to 1 if you have the header file. */ -#undef HAVE_ERRNO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_FCNTL_H - -/* Define if you have the header file. */ -#undef HAVE_GETOPT_H - -/* Define if you have the `getopt_long' function. */ -#undef HAVE_GETOPT_LONG - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LOCALE_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MALLOC_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_OPENSSL_CRYPTO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SLP_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TIME_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have that is POSIX.1 compatible. */ -#undef HAVE_SYS_WAIT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define if you want to support iSNS authentication */ -#undef WITH_SECURITY - -/* Define if you want to support SLP discovery */ -#undef WITH_SLP - -/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most - significant byte first (like Motorola and SPARC, unlike Intel). */ -#if defined AC_APPLE_UNIVERSAL_BUILD -# if defined __BIG_ENDIAN__ -# define WORDS_BIGENDIAN 1 -# endif -#else -# ifndef WORDS_BIGENDIAN -# undef WORDS_BIGENDIAN -# endif -#endif - -/* 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 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/configure open-iscsi-2.0.874/utils/open-isns/configure --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/configure 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/configure 1970-01-01 00:00:00.000000000 +0000 @@ -1,6727 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.63 for open-isns 0.90. -# -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008 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 more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - - - -# PATH needs CR -# 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 - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -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 -IFS=$as_save_IFS - - ;; -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 - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; 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 || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - -if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes -else - as_have_required=no -fi - - if test $as_have_required = yes && (eval ": -(as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } -") 2> /dev/null; then - : -else - as_candidate_shells= - 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=. - case $as_dir in - /*) - for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" - done;; - esac -done -IFS=$as_save_IFS - - - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -(as_func_return () { - (exit $1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = "$1" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test $exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - -_ASEOF -}; then - break -fi - -fi - - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } -fi - - -fi - -fi - - - -(eval "as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell bug-autoconf@gnu.org about your system, - echo including any error possibly output before this message. - echo This can help us improve future autoconf versions. - echo Configuration will now proceed without shell functions. -} - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # 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 after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, 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 - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_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 sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# 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'" - - - -exec 7<&0 &1 - -# 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` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Identity of this package. -PACKAGE_NAME='open-isns' -PACKAGE_TARNAME='open-isns' -PACKAGE_VERSION='0.90' -PACKAGE_STRING='open-isns 0.90' -PACKAGE_BUGREPORT='' - -ac_unique_file="isnsd.c" -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef STDC_HEADERS -# include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" - -ac_subst_vars='LTLIBOBJS -LIBOBJS -OPTIMIZE -SLPLIBS -SECLIBS -GETOPTSRC -SH -SET_MAKE -LN_S -INSTALL_DATA -INSTALL_SCRIPT -INSTALL_PROGRAM -EGREP -GREP -CPP -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -with_security -with_slp -enable_memdebug -' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= -# 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. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -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 - - case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -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) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$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 ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$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 ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - 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 ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=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 ;; - - -*) { $as_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 && - { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_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'` - { $as_echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 - { (exit 1); exit 1; }; } ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; } -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 - $as_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 - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { $as_echo "$as_me: error: working directory cannot be determined" >&2 - { (exit 1); exit 1; }; } -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 - { (exit 1); exit 1; }; } - - -# 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 the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | - 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 - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 - { (exit 1); exit 1; }; } - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# 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 open-isns 0.90 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 \`..'] - -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] - --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] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/open-isns] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -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 open-isns 0.90:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-memdebug Enable malloc debugging - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-security Enable iSNS authentication - requires OpenSSL - --with-slp Enable SLP for server discovery - requires OpenSLP - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CPP C preprocessor - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested 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 - else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -open-isns configure 0.90 -generated by GNU Autoconf 2.63 - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 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 -fi -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by open-isns $as_me 0.90, which was -generated by GNU Autoconf 2.63. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -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` -/usr/bin/hostinfo = `(/usr/bin/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=. - $as_echo "PATH: $as_dir" -done -IFS=$as_save_IFS - -} >&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_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=`$as_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_arg'" - ;; - 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: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -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, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## -## File substitutions. ## -## ------------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r 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 -f -r conftest* 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 an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - ac_site_file1=$CONFIG_SITE -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site -fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test -r "$ac_site_file"; then - { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -$as_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 - { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 -$as_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 $ac_precious_vars; 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,) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -$as_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 - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_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 - { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } -fi - - - - - - - - - - - - - - - - - - - - - - - - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - -ac_aux_dir= -for ac_dir in aclocal "$srcdir"/aclocal; 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 - { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in aclocal \"$srcdir\"/aclocal" >&5 -$as_echo "$as_me: error: cannot find install-sh or install.sh in aclocal \"$srcdir\"/aclocal" >&2;} - { (exit 1); exit 1; }; } -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - - -ac_config_headers="$ac_config_headers config.h" - - -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 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "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 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -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 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - - 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 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -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 - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - 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 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -$as_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. -$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - $as_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.out.dSYM 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. -{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { (ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi - -{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -if test -z "$ac_file"; then - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -$as_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 - -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&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' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_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 - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_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 -$as_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 -{ $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -$as_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 -{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if test "${ac_cv_objext+set}" = set; then - $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -$as_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 -{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then - $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_compiler_gnu=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_compiler_gnu=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - 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 { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CFLAGS="" - 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 { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - 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 { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$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 -{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std 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 -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 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 -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_c89=$ac_arg -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:$LINENO: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:$LINENO: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac - - -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 - -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 -$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} - { (exit 1); exit 1; }; } - -{ $as_echo "$as_me:$LINENO: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if test "${ac_cv_build+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} - { (exit 1); exit 1; }; } -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} - { (exit 1); exit 1; }; } - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 -$as_echo "$as_me: error: invalid value of canonical build" >&2;} - { (exit 1); exit 1; }; };; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:$LINENO: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if test "${ac_cv_host+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} - { (exit 1); exit 1; }; } -fi - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 -$as_echo "$as_me: error: invalid value of canonical host" >&2;} - { (exit 1); exit 1; }; };; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - - -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 -{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&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 - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&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 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - $as_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 nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&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 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - $as_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 -{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&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 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - $as_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 nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&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 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - $as_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 - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -$as_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 - - -{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if test "${ac_cv_path_GREP+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done -done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done -done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_stdc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_stdc=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -$as_echo "$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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - { $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -$as_echo_n "checking whether byte ordering is bigendian... " >&6; } -if test "${ac_cv_c_bigendian+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_c_bigendian=unknown - # See if we're dealing with a universal compiler. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifndef __APPLE_CC__ - not a universal capable compiler - #endif - typedef int dummy; - -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - - # Check for potential -arch flags. It is not universal unless - # there are some -arch flags. Note that *ppc* also matches - # ppc64. This check is also rather less than ideal. - case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in #( - *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;; - esac -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test $ac_cv_c_bigendian = unknown; then - # See if sys/param.h defines the BYTE_ORDER macro. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - #include - -int -main () -{ -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ - && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ - && LITTLE_ENDIAN) - bogus endian macros - #endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - # It does; now see whether it defined to BIG_ENDIAN or not. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - #include - -int -main () -{ -#if BYTE_ORDER != BIG_ENDIAN - not big endian - #endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_c_bigendian=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_c_bigendian=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -int -main () -{ -#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) - bogus endian macros - #endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - # It does; now see whether it defined to _BIG_ENDIAN or not. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -int -main () -{ -#ifndef _BIG_ENDIAN - not big endian - #endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_c_bigendian=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_c_bigendian=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # Compile a test program. - if test "$cross_compiling" = yes; then - # Try to guess by grepping values from an object file. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -short int ascii_mm[] = - { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; - short int ascii_ii[] = - { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; - int use_ascii (int i) { - return ascii_mm[i] + ascii_ii[i]; - } - short int ebcdic_ii[] = - { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; - short int ebcdic_mm[] = - { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; - int use_ebcdic (int i) { - return ebcdic_mm[i] + ebcdic_ii[i]; - } - extern int foo; - -int -main () -{ -return use_ascii (foo) == use_ebcdic (foo); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then - ac_cv_c_bigendian=yes - fi - if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi - fi -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -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 () -{ - - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long int l; - char c[sizeof (long int)]; - } u; - u.l = 1; - return u.c[sizeof (long int) - 1] == 1; - - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_bigendian=no -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_c_bigendian=yes -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - - fi -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -$as_echo "$ac_cv_c_bigendian" >&6; } - case $ac_cv_c_bigendian in #( - yes) - cat >>confdefs.h <<\_ACEOF -#define WORDS_BIGENDIAN 1 -_ACEOF -;; #( - no) - ;; #( - universal) - -cat >>confdefs.h <<\_ACEOF -#define AC_APPLE_UNIVERSAL_BUILD 1 -_ACEOF - - ;; #( - *) - { { $as_echo "$as_me:$LINENO: error: unknown endianness - presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -$as_echo "$as_me: error: unknown endianness - presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} - { (exit 1); exit 1; }; } ;; - esac - - -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 -{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&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 - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&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 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - $as_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 nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&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 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - $as_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 -{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&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 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - $as_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 nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&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 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - $as_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 - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -$as_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 - -# 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. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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 - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac - -done -IFS=$as_save_IFS - -rm -rf conftest.one conftest.two conftest.dir - -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. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 -$as_echo "$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' - -{ $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } -fi - -{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - -# Extract the first word of "sh", so it can be a program name with args. -set dummy sh; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_SH+set}" = set; then - $as_echo_n "(cached) " >&6 -else - case $SH in - [\\/]* | ?:[\\/]*) - ac_cv_path_SH="$SH" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_SH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - ;; -esac -fi -SH=$ac_cv_path_SH -if test -n "$SH"; then - { $as_echo "$as_me:$LINENO: result: $SH" >&5 -$as_echo "$SH" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - - -{ $as_echo "$as_me:$LINENO: checking for inline" >&5 -$as_echo_n "checking for inline... " >&6; } -if test "${ac_cv_c_inline+set}" = set; then - $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_c_inline=$ac_kw -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_inline" != no && break -done - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 -$as_echo "$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 - -if test "$GCC" = "yes"; then - CFLAGS="-Wall -fno-strict-aliasing $CFLAGS" - CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" -fi - -{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_stdc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_stdc=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - -{ $as_echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5 -$as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } -if test "${ac_cv_header_sys_wait_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#ifndef WEXITSTATUS -# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) -#endif -#ifndef WIFEXITED -# define WIFEXITED(stat_val) (((stat_val) & 255) == 0) -#endif - -int -main () -{ - int s; - wait (&s); - s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_sys_wait_h=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_sys_wait_h=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 -$as_echo "$ac_cv_header_sys_wait_h" >&6; } -if test $ac_cv_header_sys_wait_h = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_SYS_WAIT_H 1 -_ACEOF - -fi - - - - - - - - - - - -for ac_header in errno.h fcntl.h malloc.h stdlib.h string.h strings.h sys/time.h unistd.h locale.h getopt.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&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 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -# Check if socket() is in libsocket -{ $as_echo "$as_me:$LINENO: checking for socket in -lsocket" >&5 -$as_echo_n "checking for socket in -lsocket... " >&6; } -if test "${ac_cv_lib_socket_socket+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsocket $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char socket (); -int -main () -{ -return socket (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_socket_socket=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_socket_socket=no -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5 -$as_echo "$ac_cv_lib_socket_socket" >&6; } -if test "x$ac_cv_lib_socket_socket" = x""yes; then - LIBS="$LIBS -lsocket" -fi - - - - -{ $as_echo "$as_me:$LINENO: checking for getopt_long" >&5 -$as_echo_n "checking for getopt_long... " >&6; } -if test "${ac_cv_func_getopt_long+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define getopt_long to an innocuous variant, in case declares getopt_long. - For example, HP-UX 11i declares gettimeofday. */ -#define getopt_long innocuous_getopt_long - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char getopt_long (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef getopt_long - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char getopt_long (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_getopt_long || defined __stub___getopt_long -choke me -#endif - -int -main () -{ -return getopt_long (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_func_getopt_long=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_getopt_long=no -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_getopt_long" >&5 -$as_echo "$ac_cv_func_getopt_long" >&6; } -if test "x$ac_cv_func_getopt_long" = x""yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_GETOPT_LONG 1 -_ACEOF - -else - GETOPTSRC="$GETOPTSRC \$(top_srcdir)/compat/my_getopt.c" - CPPFLAGS="-I\$(top_srcdir)/compat/ $CPPFLAGS" - -cat >>confdefs.h <<\_ACEOF -#define HAVE_GETOPT_H 1 -_ACEOF - -fi - - -WITH_SECURITY=maybe - -# Check whether --with-security was given. -if test "${with_security+set}" = set; then - withval=$with_security; - if test "x$withval" = "xno" -o "x$withval" = "xyes"; then - WITH_SECURITY=$withval - else - WITH_SECURITY=yes - CPPFLAGS="$CPPFLAGS -I${withval}" - LDFLAGS="$LDFLAGS -L${withval}" - fi - - -fi - - -if test "x$WITH_SECURITY" != "xno" ; then - # Check for openssl support - very primitive, we just - # check for the presence of crypto.h - -for ac_header in openssl/crypto.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&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 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -else - have_libcrypto=no -fi - -done - - { $as_echo "$as_me:$LINENO: checking for EVP_PKEY_new in -lcrypto" >&5 -$as_echo_n "checking for EVP_PKEY_new in -lcrypto... " >&6; } -if test "${ac_cv_lib_crypto_EVP_PKEY_new+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcrypto $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char EVP_PKEY_new (); -int -main () -{ -return EVP_PKEY_new (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_crypto_EVP_PKEY_new=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_crypto_EVP_PKEY_new=no -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_EVP_PKEY_new" >&5 -$as_echo "$ac_cv_lib_crypto_EVP_PKEY_new" >&6; } -if test "x$ac_cv_lib_crypto_EVP_PKEY_new" = x""yes; then - SECLIBS="-lcrypto" -else - have_libcrypto=no -fi - - - if test "x$have_libcrypto" != "xno" ; then - -cat >>confdefs.h <<\_ACEOF -#define WITH_SECURITY 1 -_ACEOF - - else - if test "x$WITH_SECURITY" = "xyes" ; then - { { $as_echo "$as_me:$LINENO: error: Security requested, but unable to find libcrypto" >&5 -$as_echo "$as_me: error: Security requested, but unable to find libcrypto" >&2;} - { (exit 1); exit 1; }; } - fi - fi -fi - - -WITH_SLP=maybe - -# Check whether --with-slp was given. -if test "${with_slp+set}" = set; then - withval=$with_slp; - if test "x$withval" = "xno" -o "x$withval" = "xyes"; then - WITH_SLP=$withval - else - WITH_SLP=yes - CPPFLAGS="$CPPFLAGS -I${withval}" - LDFLAGS="$LDFLAGS -L${withval}" - fi - - -fi - - -if test "x$WITH_SLP" != "xno" ; then - # Check for openslp support - very primitive - -for ac_header in slp.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&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 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -else - have_openslp=no -fi - -done - - { $as_echo "$as_me:$LINENO: checking for SLPOpen in -lslp" >&5 -$as_echo_n "checking for SLPOpen in -lslp... " >&6; } -if test "${ac_cv_lib_slp_SLPOpen+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lslp $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char SLPOpen (); -int -main () -{ -return SLPOpen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_slp_SLPOpen=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_slp_SLPOpen=no -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_slp_SLPOpen" >&5 -$as_echo "$ac_cv_lib_slp_SLPOpen" >&6; } -if test "x$ac_cv_lib_slp_SLPOpen" = x""yes; then - SLPLIBS="-lslp" -else - have_openslp=no -fi - - - if test "x$have_openslp" != "xno" ; then - -cat >>confdefs.h <<\_ACEOF -#define WITH_SLP 1 -_ACEOF - - else - if test "x$WITH_SLP" = "xyes" ; then - { { $as_echo "$as_me:$LINENO: error: SLP requested, but unable to find openslp" >&5 -$as_echo "$as_me: error: SLP requested, but unable to find openslp" >&2;} - { (exit 1); exit 1; }; } - fi - fi -fi - - -MEMDEBUG= -# Check whether --enable-memdebug was given. -if test "${enable_memdebug+set}" = set; then - enableval=$enable_memdebug; - if test "x$enableval" = "xyes" ; then - CPPFLAGS="$CPPFLAGS -DMEMDEBUG" - fi - - -fi - - - -ac_config_files="$ac_config_files Makefile" - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && - { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file - else - { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - - - -: ${CONFIG_STATUS=./config.status} -ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - - - -# PATH needs CR -# 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 - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -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 -IFS=$as_save_IFS - - ;; -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 - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; 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 || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # 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 after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, 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 - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_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 sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# 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'" - - -exec 6>&1 - -# Save the log message, to keep $[0] and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by open-isns $as_me 0.90, which was -generated by GNU Autoconf 2.63. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTION]... [FILE]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Report bugs to ." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_version="\\ -open-isns config.status 0.90 -configured by $0, generated by GNU Autoconf 2.63, - with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" - -Copyright (C) 2008 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - { $as_echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) { $as_echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$ac_config_targets $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - $as_echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - - *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= - trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status -' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || -{ - $as_echo "$as_me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=' ' -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } -ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\).*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\).*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' >$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 -$as_echo "$as_me: error: could not setup config files machinery" >&2;} - { (exit 1); exit 1; }; } -_ACEOF - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ -s/:*$// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" - -# Set up the scripts for CONFIG_HEADERS section. -# No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. -if test -n "$CONFIG_HEADERS"; then -cat >"$tmp/defines.awk" <<\_ACAWK || -BEGIN { -_ACEOF - -# Transform confdefs.h into an awk script `defines.awk', embedded as -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. - -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_t=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_t"; then - break - elif $ac_last_try; then - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' >$CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - for (key in D) D_is_set[key] = 1 - FS = "" -} -/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 -$as_echo "$as_me: error: could not setup config headers machinery" >&2;} - { (exit 1); exit 1; }; } -fi # test -n "$CONFIG_HEADERS" - - -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 -$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} - { (exit 1); exit 1; }; };; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} - { (exit 1); exit 1; }; };; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - ac_file_inputs="$ac_file_inputs '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - { as_dir="$ac_dir" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= - -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p -' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} - - rm -f "$tmp/stdin" - case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; - esac \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } - ;; - :H) - # - # CONFIG_HEADER - # - if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" - } >"$tmp/config.h" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } - if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f "$ac_file" - mv "$tmp/config.h" "$ac_file" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } - fi - else - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ - || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 -$as_echo "$as_me: error: could not create -" >&2;} - { (exit 1); exit 1; }; } - fi - ;; - - - esac - -done # for ac_tag - - -{ (exit 0); exit 0; } -_ACEOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi - diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/configure.ac open-iscsi-2.0.874/utils/open-isns/configure.ac --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/configure.ac 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/configure.ac 1970-01-01 00:00:00.000000000 +0000 @@ -1,118 +0,0 @@ -AC_INIT(open-isns, [0.90]) -AC_CONFIG_SRCDIR([isnsd.c]) -AC_CONFIG_AUX_DIR([aclocal]) - -AC_CONFIG_HEADER(config.h) - -AC_PROG_CC -AC_CANONICAL_HOST -AC_C_BIGENDIAN - -AC_PROG_CPP -AC_PROG_INSTALL -AC_PROG_LN_S -AC_PROG_MAKE_SET -AC_PATH_PROG(SH, sh) - -dnl C Compiler features -AC_C_INLINE -if test "$GCC" = "yes"; then - CFLAGS="-Wall -fno-strict-aliasing $CFLAGS" - CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" -fi - -dnl Checks for header files. -AC_HEADER_STDC -AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS([errno.h fcntl.h malloc.h stdlib.h string.h strings.h sys/time.h unistd.h locale.h getopt.h]) - -# Check if socket() is in libsocket -AC_CHECK_LIB(socket, socket, [LIBS="$LIBS -lsocket"]) - - -AC_SUBST(GETOPTSRC) -AC_CHECK_FUNC(getopt_long, AC_DEFINE(HAVE_GETOPT_LONG, 1, [Define if you have the `getopt_long' function.]), - [GETOPTSRC="$GETOPTSRC \$(top_srcdir)/compat/my_getopt.c" - CPPFLAGS="-I\$(top_srcdir)/compat/ $CPPFLAGS" - AC_DEFINE(HAVE_GETOPT_H, 1, [Define if you have the header file.])]) - -WITH_SECURITY=maybe -AC_ARG_WITH(security, - [ --with-security Enable iSNS authentication - requires OpenSSL], - [ - if test "x$withval" = "xno" -o "x$withval" = "xyes"; then - WITH_SECURITY=$withval - else - WITH_SECURITY=yes - CPPFLAGS="$CPPFLAGS -I${withval}" - LDFLAGS="$LDFLAGS -L${withval}" - fi - ] -) - -if test "x$WITH_SECURITY" != "xno" ; then - # Check for openssl support - very primitive, we just - # check for the presence of crypto.h - AC_CHECK_HEADERS([openssl/crypto.h], - , - [have_libcrypto=no]) - AC_CHECK_LIB(crypto, EVP_PKEY_new, - [SECLIBS="-lcrypto"], - [have_libcrypto=no]) - - if test "x$have_libcrypto" != "xno" ; then - AC_DEFINE(WITH_SECURITY, 1, - [Define if you want to support iSNS authentication]) - else - if test "x$WITH_SECURITY" = "xyes" ; then - AC_MSG_ERROR([Security requested, but unable to find libcrypto]) - fi - fi -fi -AC_SUBST(SECLIBS) - -WITH_SLP=maybe -AC_ARG_WITH(slp, - [ --with-slp Enable SLP for server discovery - requires OpenSLP], - [ - if test "x$withval" = "xno" -o "x$withval" = "xyes"; then - WITH_SLP=$withval - else - WITH_SLP=yes - CPPFLAGS="$CPPFLAGS -I${withval}" - LDFLAGS="$LDFLAGS -L${withval}" - fi - ] -) - -if test "x$WITH_SLP" != "xno" ; then - # Check for openslp support - very primitive - AC_CHECK_HEADERS([slp.h],, - [have_openslp=no]) - AC_CHECK_LIB(slp, SLPOpen, - [SLPLIBS="-lslp"], - [have_openslp=no]) - - if test "x$have_openslp" != "xno" ; then - AC_DEFINE(WITH_SLP, 1, - [Define if you want to support SLP discovery]) - else - if test "x$WITH_SLP" = "xyes" ; then - AC_MSG_ERROR([SLP requested, but unable to find openslp]) - fi - fi -fi -AC_SUBST(SLPLIBS) - -MEMDEBUG= -AC_ARG_ENABLE(memdebug, - [ --enable-memdebug Enable malloc debugging], - [ - if test "x$enableval" = "xyes" ; then - CPPFLAGS="$CPPFLAGS -DMEMDEBUG" - fi - ] -) -AC_SUBST(OPTIMIZE) - -AC_OUTPUT(Makefile) diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/COPYING open-iscsi-2.0.874/utils/open-isns/COPYING --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/COPYING 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/COPYING 1970-01-01 00:00:00.000000000 +0000 @@ -1,504 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/db.c open-iscsi-2.0.874/utils/open-isns/db.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/db.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/db.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,994 +0,0 @@ -/* - * iSNS object database - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include -#include -#include -#include - -#include "isns.h" -#include "objects.h" -#include "db.h" -#include "util.h" - -enum { - IDT_INSERT, - IDT_REMOVE, - IDT_UPDATE -}; -struct isns_db_trans { - struct isns_db_trans * idt_next; - int idt_action; - isns_object_t * idt_object; -}; - -/* Internal helpers */ -static int isns_db_sanity_check(isns_db_t *); -static int isns_db_get_key_tags(const isns_attr_list_t *, - uint32_t *, unsigned int); -static int isns_db_keyed_compare(const isns_object_t *, - const isns_attr_list_t *, - const uint32_t *, unsigned int); - -/* - * Open a database - */ -static isns_db_t * -isns_db_create(isns_db_backend_t *backend) -{ - isns_db_t *db; - - db = isns_calloc(1, sizeof(*db)); - db->id_last_index = 1; - db->id_last_eid = 1; - db->id_backend = backend; - db->id_global_scope = isns_scope_alloc(db); - db->id_relations = isns_relation_soup_alloc(); - db->id_objects = &db->__id_objects; - - if (backend && backend->idb_reload) { - int status; - - status = backend->idb_reload(db); - /* "No such entry" is returned when the DB - * is still empty. */ - if (status != ISNS_SUCCESS - && status != ISNS_NO_SUCH_ENTRY) { - isns_error("Error loading database: %s\n", - isns_strerror(status)); - /* FIXME: isns_db_free(db); */ - return NULL; - } - - isns_db_sanity_check(db); - } - - return db; -} - -isns_db_t * -isns_db_open(const char *location) -{ - isns_db_backend_t *backend; - - if (location == NULL) { - isns_debug_state("Using in-memory DB\n"); - return isns_db_create(NULL); - } - - if (location[0] == '/') { - backend = isns_create_file_db_backend(location); - } else - if (!strncmp(location, "file:", 5)) { - backend = isns_create_file_db_backend(location + 5); - } else { - isns_error("Unsupported database type \"%s\"\n", - location); - return NULL; - } - - return isns_db_create(backend); -} - -isns_db_t * -isns_db_open_shadow(isns_object_list_t *list) -{ - isns_db_t *db; - - if ((db = isns_db_create(NULL)) != NULL) - db->id_objects = list; - return db; -} - -int -isns_db_sanity_check(isns_db_t *db) -{ - unsigned int i; - - i = 0; - while (i < db->id_objects->iol_count) { - isns_object_t *obj = db->id_objects->iol_data[i]; - - switch (obj->ie_state) { - case ISNS_OBJECT_STATE_MATURE: - /* Nothing yet. */ - break; - - case ISNS_OBJECT_STATE_LIMBO: - if (!ISNS_IS_ISCSI_NODE(obj) - && !ISNS_IS_PORTAL(obj)) { - isns_error("Unexpected object %u (%s) in limbo\n", - obj->ie_index, - obj->ie_template->iot_name); - isns_db_remove(db, obj); - } - break; - - default: - isns_error("Unexpected object state %d in object %u (%s)\n", - obj->ie_state, obj->ie_index, - obj->ie_template->iot_name); - isns_db_remove(db, obj); - break; - } - - i += 1; - } - - return 1; -} - -isns_object_t * -isns_db_lookup(isns_db_t *db, - isns_object_template_t *tmpl, - const isns_attr_list_t *keys) -{ - return isns_object_list_lookup(db->id_objects, tmpl, keys); -} - -int -isns_db_gang_lookup(isns_db_t *db, - isns_object_template_t *tmpl, - const isns_attr_list_t *keys, - isns_object_list_t *result) -{ - return isns_object_list_gang_lookup(db->id_objects, - tmpl, keys, result); -} - -/* - * Look up the storage node for the given source. - */ -isns_object_t * -isns_db_lookup_source_node(isns_db_t *db, - const isns_source_t *source) -{ - isns_attr_list_t attrs = ISNS_ATTR_LIST_INIT; - isns_object_t *node; - - isns_attr_list_append_attr(&attrs, isns_source_attr(source)); - node = isns_db_lookup(db, NULL, &attrs); - isns_attr_list_destroy(&attrs); - - return node; -} - -isns_object_t * -isns_db_vlookup(isns_db_t *db, - isns_object_template_t *tmpl, - ...) -{ - isns_attr_list_t keys = ISNS_ATTR_LIST_INIT; - isns_object_t *obj = NULL; - va_list ap; - - va_start(ap, tmpl); - while (1) { - const isns_tag_type_t *tag_type; - isns_value_t value; - uint32_t tag; - - tag = va_arg(ap, unsigned int); - if (tag == 0) - break; - - tag_type = isns_tag_type_by_id(tag); - if (tag_type == NULL) { - isns_error("isns_db_vlookup: unknown tag %u\n", tag); - goto out; - } - - memset(&value, 0, sizeof(value)); - value.iv_type = tag_type->it_type; - switch (tag_type->it_type->it_id) { - case ISNS_ATTR_TYPE_STRING: - value.iv_string = va_arg(ap, char *); - break; - - case ISNS_ATTR_TYPE_INT32: - value.iv_int32 = va_arg(ap, int32_t); - break; - - case ISNS_ATTR_TYPE_UINT32: - value.iv_int32 = va_arg(ap, uint32_t); - break; - - case ISNS_ATTR_TYPE_IPADDR: - value.iv_ipaddr = *va_arg(ap, struct in6_addr *); - break; - - default: - isns_error("isns_db_vlookup: unsupported tag type %s\n", - value.iv_type->it_name); - goto out; - } - - isns_attr_list_append_value(&keys, tag, tag_type, &value); - } - - obj = isns_db_lookup(db, tmpl, &keys); - -out: - isns_attr_list_destroy(&keys); - va_end(ap); - return obj; -} - -/* - * Find the next matching object - * - * This implementation could be a lot simpler if the - * RFC didn't make things so awfully complicated. - * It could simply have mandated the use of the object - * index attribute, period. - */ -isns_object_t * -__isns_db_get_next(const isns_object_list_t *list, - isns_object_template_t *tmpl, - const isns_attr_list_t *current, - const isns_attr_list_t *scope) -{ - isns_object_t *next = NULL; - uint32_t tags[16]; - unsigned int i; - int num_tags; - - if (!tmpl) - return NULL; - - /* Get the search attribute tags, and sort them. - * Note, these don't have to be the standard key - * attributes for a given object type; the RFC - * also permits index attributes. - */ - num_tags = isns_db_get_key_tags(current, tags, 16); - if (num_tags < 0) - return NULL; - - /* - * 5.6.5.3. - * If the TLV length of the Message Key Attribute(s) is zero, - * then the first object entry in the iSNS database matching the - * Message Key type SHALL be returned in the Message Key of the - * corresponding DevGetNextRsp message. - */ - for (i = 0; i < current->ial_count; ++i) { - isns_attr_t *attr = current->ial_data[i]; - - if (!ISNS_ATTR_IS_NIL(attr)) - goto non_nil; - } - current = NULL; -non_nil: - - for (i = 0; i < list->iol_count; ++i) { - isns_object_t *obj = list->iol_data[i]; - - if (obj->ie_template != tmpl) - continue; - if (scope && !isns_object_match(obj, scope)) - continue; - - /* compare returns -1 if the first list - * is "before" the second list, in terms of - * implicit ordering. */ - if (current - && isns_db_keyed_compare(obj, current, tags, num_tags) <= 0) { - /* obj less than or equal to current */ - continue; - } - - if (next == NULL - || isns_db_keyed_compare(obj, &next->ie_attrs, tags, num_tags) < 0) - next = obj; - } - - if (next) - isns_object_get(next); - return next; -} - -isns_object_t * -isns_db_get_next(isns_db_t *db, - isns_object_template_t *tmpl, - const isns_attr_list_t *current, - const isns_attr_list_t *scope, - const isns_source_t *source) -{ - return __isns_db_get_next(db->id_objects, - tmpl, current, scope); -} - -/* - * Get the search key tags - */ -static int -isns_db_get_key_tags(const isns_attr_list_t *keys, - uint32_t *tags, unsigned int max_tags) -{ - unsigned int i; - - /* Get the search attribute tags, and sort them */ - for (i = 0; i < keys->ial_count; ++i) { - if (i >= 16) - return -1; - tags[i] = keys->ial_data[i]->ia_tag_id; - } - - /* FIXME: qsort the list */ - return i; -} - -/* - * Helper function for GetNext - */ -static int -isns_db_keyed_compare(const isns_object_t *obj, - const isns_attr_list_t *attrs, - const uint32_t *tags, unsigned int num_tags) -{ - int ind = 0; - unsigned int i; - - for (i = 0; i < num_tags; ++i) { - isns_attr_t *attr1, *attr2; - uint32_t tag = tags[i]; - - if (!isns_attr_list_get_attr(&obj->ie_attrs, tag, &attr1)) - attr1 = NULL; - if (!isns_attr_list_get_attr(attrs, tag, &attr2)) - attr2 = NULL; - if (attr1 == attr2) { - ind = 0; - } else if (attr1 && attr2) { - ind = isns_attr_compare(attr1, attr2); - } else if (attr1 == NULL) { - ind = -1; - } else { - ind = 1; - } - if (ind) - break; - } - return ind; -} - -uint32_t -isns_db_allocate_index(isns_db_t *db) -{ - return db->id_last_index++; -} - -/* - * Insert an object into the database. - */ -void -__isns_db_insert(isns_db_t *db, isns_object_t *obj, unsigned int state) -{ - uint32_t idx_tag = obj->ie_template->iot_index; - - switch (obj->ie_state) { - case ISNS_OBJECT_STATE_LIMBO: - /* The object was in limbo; now it goes - * live (again). It should have an index, - * and it should be on the global id_objects - * list too. - */ - isns_assert(state == ISNS_OBJECT_STATE_MATURE); - isns_assert(obj->ie_index); - isns_assert(obj->ie_users > 1); - isns_object_list_remove(&db->id_limbo, obj); - break; - - case ISNS_OBJECT_STATE_DEAD: - /* A DevAttrReg with the F_REPLACE bit set will cause - * the key object to be removed from the DB, which may - * kill it for good. - * The subsequent call to db_insert will assign a new - * index, and re-add it to the database. - */ - - case ISNS_OBJECT_STATE_LARVAL: - /* Larval objects can go either to mature or - * limbo state. */ - obj->ie_index = db->id_last_index++; - - if (idx_tag) - isns_object_set_uint32(obj, - idx_tag, - obj->ie_index); - - isns_object_list_append(db->id_objects, obj); - break; - - case ISNS_OBJECT_STATE_MATURE: - /* If we call db_insert on a mature object, treat - this as a NOP. */ - isns_assert(state == ISNS_OBJECT_STATE_MATURE); - return; - - default: - isns_error("Internal error: unexpected object %u (%s) " - "state %u in db_insert\n", - obj->ie_index, - obj->ie_template->iot_name, - obj->ie_state); - return; - } - - obj->ie_state = state; - - /* Add it to the global scope */ - if (state == ISNS_OBJECT_STATE_MATURE) { - isns_scope_add(db->id_global_scope, obj); - obj->ie_references++; - - /* See if this object represents a relationship - * (eg a portal group). */ - if (obj->ie_template->iot_relation_type) { - if (!obj->ie_relation) { - isns_warning("DB: inserting %s object " - "without relation\n", - obj->ie_template->iot_name); - } else { - isns_relation_add(db->id_relations, - obj->ie_relation); - } - } - - isns_mark_object(obj, ISNS_SCN_OBJECT_ADDED); - } - - isns_debug_state("DB: added object %u (%s) state %u\n", - obj->ie_index, - obj->ie_template->iot_name, - obj->ie_state); - - if (db->id_backend) { - db->id_backend->idb_store(db, obj); - db->id_backend->idb_sync(db); - } -} - -void -isns_db_insert(isns_db_t *db, isns_object_t *obj) -{ - __isns_db_insert(db, obj, ISNS_OBJECT_STATE_MATURE); -} - -void -isns_db_insert_limbo(isns_db_t *db, isns_object_t *obj) -{ - isns_assert(obj->ie_state == ISNS_OBJECT_STATE_LARVAL); - __isns_db_insert(db, obj, ISNS_OBJECT_STATE_LIMBO); -} - -/* - * Save an object after updating it - */ -void -isns_db_sync(isns_db_t *db) -{ - isns_object_list_t *list = db->id_objects; - unsigned int i, saved = 0; - - if (!db->id_backend) - return; - - for (i = 0; i < list->iol_count; ++i) { - isns_object_t *obj = list->iol_data[i]; - - if (obj->ie_flags & ISNS_OBJECT_DIRTY) { - db->id_backend->idb_store(db, obj); - obj->ie_flags &= ~ISNS_OBJECT_DIRTY; - saved++; - } - } - if (saved) - db->id_backend->idb_sync(db); -} - -/* - * Remove an object from the database. - * This is slow and inefficient, due to the use - * of an object array. We should at least use - * a linked list, or maybe even a hash one day. - */ -static void -__isns_db_prepare_removal(isns_db_t *db, isns_object_t *obj) -{ - isns_object_t *child; - - obj->ie_flags |= ISNS_OBJECT_DEAD; - isns_object_get(obj); - - /* The node is dead; it's no longer interested in SCNs */ - obj->ie_scn_mask = 0; - - /* Trigger an SCN event. */ - if (obj->ie_state == ISNS_OBJECT_STATE_MATURE) - isns_mark_object(obj, ISNS_SCN_OBJECT_REMOVED); - - /* If the object represents a relation between - * two other objects, sever that relationship. - */ - if (obj->ie_relation) { - isns_relation_remove(db->id_relations, - obj->ie_relation); - isns_relation_sever(obj->ie_relation); - isns_relation_release(obj->ie_relation); - obj->ie_relation = NULL; - } - - /* Detach the object from its container */ - isns_object_detach(obj); - - /* Remove it from the database */ - if (isns_scope_remove(db->id_global_scope, obj)) { - obj->ie_references--; - } else { - isns_warning("Unable to remove object from scope\n"); - } - - /* Recursively remove all children */ - while (obj->ie_children.iol_count) { - child = obj->ie_children.iol_data[0]; - __isns_db_prepare_removal(db, child); - } - - isns_debug_state("DB: removed object %u (%s)\n", - obj->ie_index, - obj->ie_template->iot_name); - - isns_object_list_append(&db->id_deferred, obj); - isns_object_release(obj); -} - -int -isns_db_remove(isns_db_t *db, isns_object_t *obj) -{ - isns_object_t *entity; - unsigned int i; - - /* Don't even bother if the object was never added */ - if (obj->ie_index == 0) - goto out; - - /* Obtain the containing entity before removal */ - entity = isns_object_get_entity(obj); - - /* We don't remove the object for real yet; - * this will happen later during db_purge */ - __isns_db_prepare_removal(db, obj); - - /* - * 5.6.5.4. - * If all Nodes and Portals associated with a Network Entity are - * deregistered, then the Network Entity SHALL also be removed. - * - * If both the Portal and iSCSI Storage Node objects associated - * with a Portal Group object are removed, then that Portal Group - * object SHALL also be removed. The Portal Group object SHALL - * remain registered as long as either of its associated Portal - * or iSCSI Storage Node objects remain registered. If a deleted - * Storage Node or Portal object is subsequently re-registered, - * then a relationship between the re- registered object and - * an existing Portal or Storage Node object registration, - * indicated by the PG object, SHALL be restored. - */ - if (ISNS_IS_ENTITY(obj)) - goto out; - - if (entity == NULL || !ISNS_IS_ENTITY(entity)) - goto out; - - /* Don't do this for the CONTROL entity. */ - if (entity->ie_flags & ISNS_OBJECT_PRIVATE) - goto out; - - /* Step 1: Purge all relationship objects (read: portal groups) - * where both referenced objects are dead. - */ - for (i = 0; i < entity->ie_children.iol_count; ) { - isns_object_t *child = entity->ie_children.iol_data[i]; - - if (child->ie_relation - && isns_relation_is_dead(child->ie_relation)) { - __isns_db_prepare_removal(db, child); - continue; - } - - i += 1; - } - - /* Step 2: If all portals, nodes and PGs have been unregistered, - * the list of children should be empty. */ - if (entity->ie_children.iol_count == 0) { - isns_debug_state("Last portal/node unregistered, removing entity\n"); - __isns_db_prepare_removal(db, entity); - } - -out: - return ISNS_SUCCESS; -} - -/* - * Purge deregistered objects. - * If we find they're still part of some discovery - * domain, they're moved to id_limbo; otherwise we'll - * destroy them for good. - */ -void -isns_db_purge(isns_db_t *db) -{ - isns_object_list_t *list = &db->id_deferred; - unsigned int i; - - while (list->iol_count) { - isns_object_t *obj = list->iol_data[0]; - - if (obj->ie_references == 0) { - isns_debug_state("DB: destroying object %u (%s)\n", - obj->ie_index, - obj->ie_template->iot_name); - - if (db->id_backend) { - db->id_backend->idb_remove(db, obj); - /* db->id_backend->idb_sync(db); */ - } - - isns_object_list_remove(db->id_objects, obj); - obj->ie_state = ISNS_OBJECT_STATE_DEAD; - } else if (obj->ie_state != ISNS_OBJECT_STATE_LIMBO) { - isns_debug_state("DB: moving object %u (%s) to purgatory - " - "%u references left\n", - obj->ie_index, - obj->ie_template->iot_name, - obj->ie_references); - - isns_object_list_append(&db->id_limbo, obj); - obj->ie_state = ISNS_OBJECT_STATE_LIMBO; - isns_object_prune_attrs(obj); - - if (db->id_backend) { - db->id_backend->idb_store(db, obj); - db->id_backend->idb_sync(db); - } - } - - isns_object_list_remove(list, obj); - } - - /* Brute force - look at all objects in limbo and kill those - * that went out of scope */ - for (i = 0; i < db->id_limbo.iol_count; ) { - isns_object_t *obj = db->id_limbo.iol_data[i]; - - if (obj->ie_references == 0) { - isns_debug_state("DB: destroying object %u (%s)\n", - obj->ie_index, - obj->ie_template->iot_name); - - if (db->id_backend) { - db->id_backend->idb_remove(db, obj); - /* db->id_backend->idb_sync(db); */ - } - - obj->ie_state = ISNS_OBJECT_STATE_DEAD; - isns_object_list_remove(&db->id_limbo, obj); - isns_object_list_remove(db->id_objects, obj); - continue; - } - - i += 1; - } -} - -/* - * Expire old entities - * - * This code is still rather simple, but once we start - * using ESI things get rather complex quickly. - */ -time_t -isns_db_expire(isns_db_t *db) -{ - isns_object_list_t *list = db->id_objects; - time_t now = time(NULL), next_timeout; - unsigned int i = 0; - - next_timeout = now + 3600; - if (isns_config.ic_registration_period == 0) - return next_timeout; - - while (i < list->iol_count) { - isns_object_t *obj; - uint64_t stamp; - uint32_t period; - - obj = list->iol_data[i]; - if (!ISNS_IS_ENTITY(obj)) - goto next; - - if (!isns_object_get_uint32(obj, - ISNS_TAG_REGISTRATION_PERIOD, - &period)) { - isns_debug_state("No registration period for entity %u\n", - obj->ie_index); - goto next; - } - - if (!isns_object_get_uint64(obj, - ISNS_TAG_TIMESTAMP, - &stamp)) { - isns_debug_state("No timestamp for entity %u\n", - obj->ie_index); - goto next; - } - - stamp += period; - if (stamp <= now) { - /* removing the object will move one - * object from the tail to the free - * slot in the list. So don't increment - * the index here. */ - isns_debug_state("Expiring entity %u\n", obj->ie_index); - isns_db_remove(db, obj); - goto next; - } else { - isns_debug_state("Entity %u will expire in %u sec\n", - obj->ie_index, (int) (stamp - now)); - if (stamp < next_timeout) - next_timeout = stamp; - } - -next: - i += 1; - } - - /* Send out SCN notifications. - * This makes sure we won't have extraneous references - * on expired objects when we reach db_purge. */ - isns_flush_events(); - - return next_timeout; -} - -/* - * Very special function to make sure we always have a - * CONTROL entity. - */ -isns_object_t * -isns_db_get_control(isns_db_t *db) -{ - isns_attr_list_t keys = ISNS_ATTR_LIST_INIT; - isns_object_list_t *list = db->id_objects; - isns_object_t *found = NULL; - unsigned int i; - - isns_attr_list_append_string(&keys, - ISNS_TAG_ENTITY_IDENTIFIER, - ISNS_ENTITY_CONTROL); - - for (i = 0; i < list->iol_count; ++i) { - isns_object_t *obj; - - obj = list->iol_data[i]; - if (!ISNS_IS_ENTITY(obj)) - continue; - if (isns_object_match(obj, &keys)) { - obj->ie_users++; - found = obj; - goto done; - } - } - - found = isns_create_object(&isns_entity_template, - &keys, NULL); - found->ie_flags |= ISNS_OBJECT_PRIVATE; - isns_db_insert(db, found); - isns_db_sync(db); - -done: - return found; -} - -void -isns_db_get_domainless(isns_db_t *db, - isns_object_template_t *tmpl, - isns_object_list_t *result) -{ - isns_object_list_t *list = db->id_objects; - unsigned int i; - - if (!tmpl) - return; - - for (i = 0; i < list->iol_count; ++i) { - isns_object_t *obj = list->iol_data[i]; - - if (obj->ie_template == tmpl - && isns_bitvector_is_empty(obj->ie_membership)) - isns_object_list_append(result, obj); - } -} - -/* - * Create a relationship and store it in the DB - */ -void -isns_db_create_relation(isns_db_t *db, - isns_object_t *relating_object, - unsigned int relation_type, - isns_object_t *subordinate_object1, - isns_object_t *subordinate_object2) -{ - isns_relation_t *rel; - - rel = isns_create_relation(relating_object, - relation_type, - subordinate_object1, - subordinate_object2); - if (rel) { - isns_relation_add(db->id_relations, rel); - isns_relation_release(rel); - } -} - -/* - * Get all objects related to @left through a relation - * of type @type. - */ -void -isns_db_get_relationship_objects(isns_db_t *db, - const isns_object_t *left, - unsigned int relation_type, - isns_object_list_t *result) -{ - isns_relation_get_edge_objects(db->id_relations, - left, relation_type, - result); -} - -/* - * Get the object relating left and right. - * Usually called to find the portal group connecting - * a portal and a storage node, or a DD connecting - * two storage nodes. - */ -isns_object_t * -isns_db_get_relationship_object(isns_db_t *db, - const isns_object_t *left, - const isns_object_t *right, - unsigned int relation_type) -{ - isns_relation_t *rel; - - /* Find a relation of the given type, connecting - * the two objects. */ - rel = isns_relation_find_edge(db->id_relations, - left, right, relation_type); - - if (rel == NULL) - return NULL; - - return isns_object_get(rel->ir_object); -} - -/* - * See if a relationship exists - */ -int -isns_db_relation_exists(isns_db_t *db, - const isns_object_t *relating_object, - const isns_object_t *left, - const isns_object_t *right, - unsigned int relation_type) -{ - return isns_relation_exists(db->id_relations, - relating_object, - left, right, relation_type); -} - -/* - * Debug helper - */ -void -isns_db_print(isns_db_t *db, isns_print_fn_t *fn) -{ - const isns_object_list_t *list = db->id_objects; - unsigned int i; - - fn("Dumping database contents\n" - "Backend: %s\n" - "Last EID: %u\n" - "Last Index: %u\n" - , - db->id_backend->idb_name, - db->id_last_eid, - db->id_last_index); - - for (i = 0; i < list->iol_count; ++i) { - isns_object_t *obj = list->iol_data[i]; - - fn("--------------\n" - "Object: index=%u type=<%s> state=%s", - obj->ie_index, - obj->ie_template->iot_name, - isns_object_state_string(obj->ie_state)); - if (obj->ie_container) - fn(" parent=%u", obj->ie_container->ie_index); - if (obj->ie_flags & ISNS_OBJECT_DIRTY) - fn(" DIRTY"); - if (obj->ie_flags & ISNS_OBJECT_PRIVATE) - fn(" PRIVATE"); - fn("\n"); - isns_attr_list_print(&obj->ie_attrs, fn); - } -} - -/* - * Generate a "random" entity identifier. This is used when - * a DevAttrReg request does not specify an entity, and the - * client's policy doesn't specify one either. - */ -const char * -isns_db_generate_eid(isns_db_t *db, char *buf, size_t size) -{ - snprintf(buf, size, "isns.entity.%04d", db->id_last_eid); - db->id_last_eid++; - return buf; -} - -/* - * Highly primitive transaction handling. - * This is really just a hack for the iSNS server code, - * which wants to go along creating objects, and back out - * if something goes wrong. - */ -void -isns_db_begin_transaction(isns_db_t *db) -{ - if (db->id_in_transaction) { - isns_error("isns_db_begin_transaction: running into pending transaction\n"); - isns_db_rollback(db); - } - db->id_in_transaction = 1; -} - -void -isns_db_commit(isns_db_t *db) -{ - /* Nothing yet */ - db->id_in_transaction = 0; -} - -void -isns_db_rollback(isns_db_t *db) -{ - /* Nothing yet */ - db->id_in_transaction = 0; -} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/db-file.c open-iscsi-2.0.874/utils/open-isns/db-file.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/db-file.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/db-file.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,615 +0,0 @@ -/* - * iSNS object database - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "isns.h" -#include "objects.h" -#include "message.h" -#include "util.h" -#include "db.h" - -#define DBE_FILE_VERSION 1 - -struct isns_db_file_info { - uint32_t db_version; - uint32_t db_last_eid; - uint32_t db_last_index; -}; - -struct isns_db_object_info { - uint32_t db_version; - char db_type[64]; - uint32_t db_parent; - uint32_t db_state; - uint32_t db_flags; - uint32_t db_scn_mask; - /* reserved bytes */ - uint32_t __db_reserved[15]; -}; - -static int isns_dbe_file_sync(isns_db_t *); -static int isns_dbe_file_reload(isns_db_t *); -static int isns_dbe_file_store(isns_db_t *, - const isns_object_t *); -static int isns_dbe_file_remove(isns_db_t *, - const isns_object_t *); -static int __dbe_file_load_all(const char *, - isns_object_list_t *); - -/* - * Helper functions - */ -static const char * -__path_concat(const char *dirname, const char *basename) -{ - static char pathname[PATH_MAX]; - - snprintf(pathname, sizeof(pathname), "%s/%s", - dirname, basename); - return pathname; -} - -static const char * -__print_index(uint32_t index) -{ - static char namebuf[32]; - - snprintf(namebuf, sizeof(namebuf), "%08x", index); - return namebuf; -} - -static int -__get_index(const char *name, uint32_t *result) -{ - char *end; - - *result = strtoul(name, &end, 16); - if (*end) - return ISNS_INTERNAL_ERROR; - return ISNS_SUCCESS; -} - -/* - * Build path names for an object - */ -static const char * -__dbe_file_object_path(const char *dirname, const isns_object_t *obj) -{ - return __path_concat(dirname, __print_index(obj->ie_index)); -} - -/* - * Build a path name for a temporary file. - * Cannot use __path_concat, because we need both names - * when storing objects - */ -static const char * -__dbe_file_object_temp(const char *dirname, const isns_object_t *obj) -{ - static char pathname[PATH_MAX]; - - snprintf(pathname, sizeof(pathname), "%s/.%s", - dirname, __print_index(obj->ie_index)); - return pathname; -} - -/* - * Recursively create a directory - */ -static int -__dbe_mkdir_path(const char *dirname) -{ - unsigned int true_len = strlen(dirname); - char *copy, *s; - - copy = isns_strdup(dirname); - - /* Walk up until we find a directory that exists */ - while (1) { - s = strrchr(copy, '/'); - if (s == NULL) - break; - - *s = '\0'; - if (access(copy, F_OK) == 0) - break; - } - - while (strcmp(dirname, copy)) { - unsigned int len = strlen(copy); - - /* Better safe than sorry */ - isns_assert(len < true_len); - - /* Put the next slash back in */ - copy[len] = '/'; - - /* and try to create the directory */ - if (mkdir(copy, 0700) < 0) - return -1; - } - - return 0; -} - -/* - * Write an object to a file - */ -static int -__dbe_file_store_object(const char *dirname, const isns_object_t *obj) -{ - struct isns_db_object_info info; - const char *path = __dbe_file_object_path(dirname, obj); - const char *temp = __dbe_file_object_temp(dirname, obj); - buf_t *bp = NULL; - int status = ISNS_INTERNAL_ERROR; - - isns_debug_state("DB: Storing object %u -> %s\n", obj->ie_index, path); - if (access(dirname, F_OK) < 0 - && (errno != ENOENT || __dbe_mkdir_path(dirname) < 0)) { - isns_error("DB: Unable to create %s: %m\n", - dirname); - goto out; - } - - bp = buf_open(temp, O_CREAT|O_TRUNC|O_WRONLY); - if (bp == NULL) { - isns_error("Unable to open %s: %m\n", temp); - goto out; - } - - /* Encode the header info ... */ - memset(&info, 0, sizeof(info)); - info.db_version = htonl(DBE_FILE_VERSION); - info.db_state = htonl(obj->ie_state); - info.db_flags = htonl(obj->ie_flags); - info.db_scn_mask = htonl(obj->ie_scn_mask); - strcpy(info.db_type, obj->ie_template->iot_name); - if (obj->ie_container) - info.db_parent = htonl(obj->ie_container->ie_index); - - if (!buf_put(bp, &info, sizeof(info))) - goto out; - - /* ... and attributes */ - status = isns_attr_list_encode(bp, &obj->ie_attrs); - if (status != ISNS_SUCCESS) - goto out; - - /* Renaming an open file. NFS will hate this */ - if (rename(temp, path) < 0) { - isns_error("Cannot rename %s -> %s: %m\n", - temp, path); - unlink(temp); - status = ISNS_INTERNAL_ERROR; - } - -out: - if (bp) - buf_close(bp); - return status; -} - -/* - * Store all children of an object - */ -static int -__dbe_file_store_children(const char *dirname, const isns_object_t *obj) -{ - int status = ISNS_SUCCESS; - unsigned int i; - - for (i = 0; i < obj->ie_children.iol_count; ++i) { - isns_object_t *child; - - child = obj->ie_children.iol_data[i]; - status = __dbe_file_store_object(dirname, child); - if (status) - break; - status = __dbe_file_store_children(dirname, child); - if (status) - break; - } - - return status; -} - -/* - * Remove object and children - */ -static int -__dbe_file_remove_object(const char *dirname, const isns_object_t *obj) -{ - const char *path = __dbe_file_object_path(dirname, obj); - - isns_debug_state("DB: Purging object %u (%s)\n", obj->ie_index, path); - if (unlink(path) < 0) - isns_error("DB: Cannot remove %s: %m\n", path); - return ISNS_SUCCESS; -} - -static int -__dbe_file_remove_children(const char *dirname, const isns_object_t *obj) -{ - const isns_object_list_t *list = &obj->ie_children; - unsigned int i; - - for (i = 0; i < list->iol_count; ++i) - __dbe_file_remove_object(dirname, list->iol_data[i]); - - return ISNS_SUCCESS; -} - -/* - * Load an object from file - */ -static int -__dbe_file_load_object(const char *filename, const char *basename, - isns_object_list_t *result) -{ - struct isns_db_object_info info; - isns_attr_list_t attrs = ISNS_ATTR_LIST_INIT; - isns_object_template_t *tmpl; - isns_object_t *obj = NULL; - buf_t *bp = NULL; - uint32_t index; - int status; - - bp = buf_open(filename, O_RDONLY); - if (bp == NULL) { - isns_error("Unable to open %s: %m\n", filename); - goto internal_error; - } - - /* Decode the header ... */ - if (!buf_get(bp, &info, sizeof(info))) - goto internal_error; - if (info.db_version != htonl(DBE_FILE_VERSION)) { - /* If we ever have to deal with a DB version - * upgrade, we could do it here. */ - isns_fatal("Found iSNS database version %u; not supported\n", - ntohl(info.db_version)); - } - - /* ... and attributes */ - status = isns_attr_list_decode(bp, &attrs); - if (status != ISNS_SUCCESS) - goto out; - - /* Get the index from the file name */ - status = __get_index(basename, &index); - if (status != ISNS_SUCCESS) - goto out; - - tmpl = isns_object_template_by_name(info.db_type); - if (tmpl == NULL) { - isns_error("DB: Bad type name \"%s\" in object file\n", - info.db_type); - goto internal_error; - } - - obj = isns_create_object(tmpl, &attrs, NULL); - if (obj == NULL) - goto internal_error; - - obj->ie_state = ntohl(info.db_state); - obj->ie_flags = ntohl(info.db_flags) & ~(ISNS_OBJECT_DIRTY); - obj->ie_scn_mask = ntohl(info.db_scn_mask); - obj->ie_index = index; - - /* Stash away the parent's index; we resolve them later on - * once we've loaded all objects */ - obj->ie_container_idx = ntohl(info.db_parent); - - isns_object_list_append(result, obj); - -out: - if (bp) - buf_close(bp); - if (obj) - isns_object_release(obj); - isns_attr_list_destroy(&attrs); - return status; - -internal_error: - isns_error("Unable to load %s: Internal error\n", - filename); - status = ISNS_INTERNAL_ERROR; - goto out; -} - -/* - * Load contents of directory into our database. - * - * We take two passes over the directory. In the first pass, we load - * all regular files containing objects. The file names correspond to - * the DB index. - * - * In the second pass, we load all directories, containing children of - * an object. The directories names are formed by the object's index, - * with ".d" appended to it. - */ -static int -__dbe_file_load_all(const char *dirpath, isns_object_list_t *result) -{ - struct dirent *dp; - DIR *dir; - int status = ISNS_SUCCESS; - - if ((dir = opendir(dirpath)) == NULL) { - isns_error("DB: cannot open %s: %m\n", dirpath); - return ISNS_INTERNAL_ERROR; - } - - while ((dp = readdir(dir)) != NULL) { - struct stat stb; - const char *path; - - if (dp->d_name[0] == '.' - || !strcmp(dp->d_name, "DB")) - continue; - - path = __path_concat(dirpath, dp->d_name); - if (lstat(path, &stb) < 0) { - isns_error("DB: cannot stat %s: %m\n", path); - status = ISNS_INTERNAL_ERROR; - } else - if (S_ISREG(stb.st_mode)) { - status = __dbe_file_load_object(path, - dp->d_name, result); - } else { - isns_debug_state("DB: ignoring %s\n", path); - } - - if (status != ISNS_SUCCESS) - break; - } - - closedir(dir); - return status; -} - -/* - * Load and store DB metadata - */ -static int -__dbe_file_write_info(isns_db_t *db) -{ - isns_db_backend_t *back = db->id_backend; - const char *path; - buf_t *bp; - int status = ISNS_INTERNAL_ERROR; - - path = __path_concat(back->idb_name, "DB"); - if ((bp = buf_open(path, O_CREAT|O_TRUNC|O_WRONLY)) == NULL) { - isns_error("Unable to write %s: %m\n", path); - goto out; - } - - if (buf_put32(bp, DBE_FILE_VERSION) - && buf_put32(bp, db->id_last_eid) - && buf_put32(bp, db->id_last_index)) - status = ISNS_SUCCESS; - -out: - if (bp) - buf_close(bp); - return status; -} - -static int -__dbe_file_load_info(isns_db_t *db) -{ - isns_db_backend_t *back = db->id_backend; - struct isns_db_file_info info; - const char *path; - buf_t *bp = NULL; - int status; - - path = __path_concat(back->idb_name, "DB"); - if ((bp = buf_open(path, O_RDONLY)) == NULL) { - status = ISNS_NO_SUCH_ENTRY; - goto out; - } - - status = ISNS_INTERNAL_ERROR; - if (!buf_get32(bp, &info.db_version)) - goto out; - - if (info.db_version != DBE_FILE_VERSION) { - isns_error("DB file from unsupported version %04x\n", - info.db_version); - goto out; - } - - if (buf_get32(bp, &info.db_last_eid) - && buf_get32(bp, &info.db_last_index)) { - db->id_last_eid = info.db_last_eid; - db->id_last_index = info.db_last_index; - status = ISNS_SUCCESS; - } - -out: - if (bp) - buf_close(bp); - return status; -} - -/* - * Find object with the given index. - */ -static isns_object_t * -__dbe_find_object(isns_object_list_t *list, uint32_t index) -{ - unsigned int i; - - for (i = 0; i < list->iol_count; ++i) { - isns_object_t *obj = list->iol_data[i]; - - if (obj->ie_index == index) - return obj; - } - return NULL; -} - -int -isns_dbe_file_reload(isns_db_t *db) -{ - isns_db_backend_t *back = db->id_backend; - int status; - unsigned int i; - - isns_debug_state("DB: loading all objects from %s\n", - back->idb_name); - - if (access(back->idb_name, R_OK) < 0) { - if (errno == ENOENT) { - /* Empty database is okay */ - return ISNS_NO_SUCH_ENTRY; - } - isns_error("Cannot open database %s: %m\n", back->idb_name); - return ISNS_INTERNAL_ERROR; - } - - status = __dbe_file_load_info(db); - if (status) - return status; - - status = __dbe_file_load_all(back->idb_name, db->id_objects); - if (status) - return status; - - /* 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 = obj->ie_container_idx; - isns_object_t *parent; - - if (index == 0) - continue; - - obj->ie_container = NULL; - - parent = __dbe_find_object(db->id_objects, index); - if (parent == NULL) { - isns_warning("DB: object %u references " - "unknown container %u\n", - obj->ie_index, - index); - } else { - isns_object_attach(obj, parent); - } - } - - /* Add objects to the appropriate lists */ - for (i = 0; i < db->id_objects->iol_count; ++i) { - isns_object_template_t *tmpl; - isns_object_t *obj = db->id_objects->iol_data[i]; - - switch (obj->ie_state) { - case ISNS_OBJECT_STATE_MATURE: - isns_scope_add(db->id_global_scope, obj); - obj->ie_references++; - - tmpl = obj->ie_template; - if (tmpl->iot_build_relation - && !tmpl->iot_build_relation(db, obj, NULL)) - isns_warning("DB: cannot build relation for " - "object %u\n", - obj->ie_index); - - if (obj->ie_relation) - isns_relation_add(db->id_relations, - obj->ie_relation); - - if (ISNS_IS_ENTITY(obj)) - isns_esi_register(obj); - break; - - case ISNS_OBJECT_STATE_LIMBO: - isns_object_list_append(&db->id_limbo, obj); - break; - - default: - isns_error("Unexpected object state %d in object %u " - "loaded from %s\n", - obj->ie_state, obj->ie_index, - back->idb_name); - } - - /* Clear the dirty flag, which will be set when the - object is created. */ - obj->ie_flags &= ~ISNS_OBJECT_DIRTY; - } - - return ISNS_SUCCESS; -} - -int -isns_dbe_file_sync(isns_db_t *db) -{ - return __dbe_file_write_info(db); -} - -int -isns_dbe_file_store(isns_db_t *db, const isns_object_t *obj) -{ - isns_db_backend_t *back = db->id_backend; - int status; - - if (obj->ie_index == 0) { - isns_error("DB: Refusing to store object with index 0\n"); - return ISNS_INTERNAL_ERROR; - } - - status = __dbe_file_store_object(back->idb_name, obj); - if (status == ISNS_SUCCESS) - status = __dbe_file_store_children(back->idb_name, obj); - - return status; -} - -int -isns_dbe_file_remove(isns_db_t *db, const isns_object_t *obj) -{ - isns_db_backend_t *back = db->id_backend; - int status; - - status = __dbe_file_remove_object(back->idb_name, obj); - if (status == ISNS_SUCCESS) - status = __dbe_file_remove_children(back->idb_name, obj); - - return status; -} - -/* - * Create the file backend - */ -isns_db_backend_t * -isns_create_file_db_backend(const char *pathname) -{ - isns_db_backend_t *back; - - isns_debug_state("Creating file DB backend (%s)\n", pathname); - - back = isns_calloc(1, sizeof(*back)); - back->idb_name = isns_strdup(pathname); - back->idb_reload = isns_dbe_file_reload; - back->idb_sync = isns_dbe_file_sync; - back->idb_store = isns_dbe_file_store; - back->idb_remove = isns_dbe_file_remove; - - return back; -} - diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/db.h open-iscsi-2.0.874/utils/open-isns/db.h --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/db.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/db.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,147 +0,0 @@ -/* - * iSNS object database - * - * Copyright (C) 2007 Olaf Kirch - */ - -#ifndef ISNS_DB_H -#define ISNS_DB_H - -#include "attrs.h" - -typedef struct isns_db_backend isns_db_backend_t; - -/* - * In-memory portion of object database. - * Stable storage is provided by different - * backends. - */ -struct isns_db { - isns_object_list_t * id_objects; - isns_object_list_t __id_objects; - - isns_relation_soup_t * id_relations; - - uint32_t id_last_eid; - uint32_t id_last_index; - - isns_scope_t * id_global_scope; - isns_scope_t * id_default_scope; - - isns_db_backend_t * id_backend; - - unsigned int id_in_transaction : 1; - struct isns_db_trans * id_transact; - - /* This is for objects in limbo. When a client - * calls DevAttrDereg, the object will first be - * placed on the id_deferred list. - * When we're done processing the message, we - * invoke isns_db_purge, which looks at these - * objects. - * - if the reference count is 1, the object - * is deleted. - * - otherwise, we assume the object is referenced - * by a discovery domain. In this case, we prune - * the attribute list down to the key attr(s) - * plus the index attribute, and move it to - * the id_limbo list. - */ - isns_object_list_t id_deferred; - isns_object_list_t id_limbo; -}; - - -struct isns_db_backend { - char * idb_name; - - int (*idb_reload)(isns_db_t *); - int (*idb_sync)(isns_db_t *); - int (*idb_store)(isns_db_t *, - const isns_object_t *); - int (*idb_remove)(isns_db_t *, - const isns_object_t *); -}; - -extern isns_db_backend_t *isns_create_file_db_backend(const char *); -extern isns_object_t * __isns_db_get_next(const isns_object_list_t *, - isns_object_template_t *, - const isns_attr_list_t *, - const isns_attr_list_t *); - -extern isns_relation_soup_t *isns_relation_soup_alloc(void); -extern isns_relation_t *isns_create_relation(isns_object_t *relating_object, - unsigned int relation_type, - isns_object_t *subordinate_object1, - isns_object_t *subordinate_object2); -extern void isns_relation_sever(isns_relation_t *); -extern void isns_relation_release(isns_relation_t *); -extern void isns_relation_add(isns_relation_soup_t *, - isns_relation_t *); -extern void isns_relation_remove(isns_relation_soup_t *, - isns_relation_t *); -extern isns_object_t * isns_relation_get_other(const isns_relation_t *, - const isns_object_t *); -extern isns_relation_t *isns_relation_find_edge(isns_relation_soup_t *, - const isns_object_t *, - const isns_object_t *, - unsigned int); -extern void isns_relation_halfspace(isns_relation_soup_t *, - const isns_object_t *, - unsigned int, - isns_object_list_t *); -extern void isns_relation_get_edge_objects(isns_relation_soup_t *, - const isns_object_t *, - unsigned int, - isns_object_list_t *); -extern int isns_relation_exists(isns_relation_soup_t *, - const isns_object_t *relating_object, - const isns_object_t *left, - const isns_object_t *right, - unsigned int relation_type); -extern int isns_relation_is_dead(const isns_relation_t *); - -extern void isns_db_create_relation(isns_db_t *db, - isns_object_t *relating_object, - unsigned int relation_type, - isns_object_t *subordinate_object1, - isns_object_t *subordinate_object2); -extern void isns_db_get_relationship_objects(isns_db_t *, - const isns_object_t *, - unsigned int relation_type, - isns_object_list_t *); -extern isns_object_t * isns_db_get_relationship_object(isns_db_t *, - const isns_object_t *, - const isns_object_t *, - unsigned int relation_type); -extern int isns_db_relation_exists(isns_db_t *db, - const isns_object_t *relating_object, - const isns_object_t *left, - const isns_object_t *right, - unsigned int relation_type); -extern int isns_db_create_pg_relation(isns_db_t *, - isns_object_t *); - -extern isns_scope_t * isns_scope_for_call(isns_db_t *, const isns_simple_t *); -extern isns_scope_t * isns_scope_alloc(isns_db_t *); -extern void isns_scope_release(isns_scope_t *); -extern void isns_scope_add(isns_scope_t *, - isns_object_t *); -extern int isns_scope_remove(isns_scope_t *, - isns_object_t *); -extern int isns_scope_gang_lookup(isns_scope_t *, - isns_object_template_t *, - const isns_attr_list_t *, - isns_object_list_t *); -extern isns_object_t * isns_scope_get_next(isns_scope_t *, - isns_object_template_t *, - const isns_attr_list_t *current, - const isns_attr_list_t *scope); -extern void isns_scope_get_related(isns_scope_t *, - const isns_object_t *, - unsigned int, - isns_object_list_t *); -extern isns_db_t * isns_scope_get_db(const isns_scope_t *); - - -#endif /* ISNS_DB_H */ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/db-policy.c open-iscsi-2.0.874/utils/open-isns/db-policy.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/db-policy.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/db-policy.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,187 +0,0 @@ -/* - * Use database as policy and keystore - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include -#include -#include -#ifdef WITH_SECURITY -#include -#include -#endif -#include "isns.h" -#include "security.h" -#include "objects.h" -#include "vendor.h" -#include "util.h" -#include "config.h" - -/* - * DB keystore - */ -typedef struct isns_db_keystore isns_db_keystore_t; -struct isns_db_keystore { - isns_keystore_t sd_base; - isns_db_t * sd_db; - isns_object_t * sd_control; -}; - -/* - * Look up the policy object given its SPI - */ -isns_object_t * -__isns_db_keystore_lookup(isns_db_keystore_t *store, - const char *name, size_t namelen) -{ - isns_attr_list_t keys = ISNS_ATTR_LIST_INIT; - char namebuf[256]; - - if (namelen >= sizeof(namebuf)) - return NULL; - memcpy(namebuf, name, namelen); - namebuf[namelen] = '\0'; - - isns_attr_list_append_string(&keys, - OPENISNS_TAG_POLICY_SPI, - namebuf); - return isns_db_lookup(store->sd_db, NULL, &keys); -} - -/* - * Load a DSA key from the DB store - */ -static EVP_PKEY * -__isns_db_keystore_find(isns_keystore_t *store_base, - const char *name, size_t namelen) -{ -#ifdef WITH_SECURITY - isns_db_keystore_t *store = (isns_db_keystore_t *) store_base; - isns_object_t *obj; - const void *key_data; - size_t key_size; - - obj = __isns_db_keystore_lookup(store, name, namelen); - if (obj == NULL) - return NULL; - - if (!isns_object_get_opaque(obj, OPENISNS_TAG_POLICY_KEY, - &key_data, &key_size)) - return NULL; - - return isns_dsa_decode_public(key_data, key_size); -#else - return NULL; -#endif -} - -/* - * Retrieve policy from database - */ -static void -__isns_db_keystore_copy_policy_string(isns_object_t *obj, - uint32_t tag, char **var) -{ - const char *value; - - if (!isns_object_get_string(obj, tag, &value)) - return; - isns_assign_string(var, value); -} - -static void -__isns_db_keystore_copy_policy_strings(isns_object_t *obj, - uint32_t tag, struct string_array *array) -{ - isns_attr_list_t *attrs = &obj->ie_attrs; - unsigned int i; - - for (i = 0; i < attrs->ial_count; ++i) { - isns_attr_t *attr = attrs->ial_data[i]; - - if (attr->ia_tag_id != tag - || !ISNS_ATTR_IS_STRING(attr)) - continue; - isns_string_array_append(array, attr->ia_value.iv_string); - } -} - -static isns_policy_t * -__isns_db_keystore_get_policy(isns_keystore_t *store_base, - const char *name, size_t namelen) -{ - isns_db_keystore_t *store = (isns_db_keystore_t *) store_base; - isns_policy_t *policy; - isns_object_t *obj; - uint32_t intval; - - obj = __isns_db_keystore_lookup(store, name, namelen); - if (obj == NULL) - return NULL; - - policy = __isns_policy_alloc(name, namelen); - - /* retrieve policy bits from object */ -#if 0 - __isns_db_keystore_copy_policy_string(obj, - OPENISNS_TAG_POLICY_SOURCE_NAME, - &policy->ip_source); -#endif - __isns_db_keystore_copy_policy_string(obj, - OPENISNS_TAG_POLICY_ENTITY, - &policy->ip_entity); - __isns_db_keystore_copy_policy_string(obj, - OPENISNS_TAG_POLICY_DEFAULT_DD, - &policy->ip_dd_default); - __isns_db_keystore_copy_policy_strings(obj, - OPENISNS_TAG_POLICY_NODE_NAME, - &policy->ip_node_names); - - if (isns_object_get_uint32(obj, OPENISNS_TAG_POLICY_OBJECT_TYPE, &intval)) - policy->ip_object_types = intval; - if (isns_object_get_uint32(obj, OPENISNS_TAG_POLICY_NODE_TYPE, &intval)) - policy->ip_node_types = intval; - if (isns_object_get_uint32(obj, OPENISNS_TAG_POLICY_FUNCTIONS, &intval)) - policy->ip_functions = intval; - - return policy; -} - -void -__isns_db_keystore_change_notify(const isns_db_event_t *ev, void *handle) -{ - isns_db_keystore_t *store = handle; - isns_object_t *obj = ev->ie_object; - - if (isns_object_get_entity(obj) == store->sd_control) { - isns_debug_auth("DB keystore: policy data was modified\n"); - store->sd_base.ic_generation++; - } -} - -isns_keystore_t * -isns_create_db_keystore(isns_db_t *db) -{ - isns_db_keystore_t *store; - isns_object_t *entity; - - isns_debug_auth("Creating DB keystore\n"); - if (!(entity = isns_db_get_control(db))) { - isns_error("Could not create control entity in database\n"); - return NULL; - } - isns_debug_auth("Control entity is 0x%08x\n", entity->ie_index); - - store = isns_calloc(1, sizeof(*store)); - store->sd_base.ic_name = "database key store"; - store->sd_base.ic_find = __isns_db_keystore_find; - store->sd_base.ic_get_policy = __isns_db_keystore_get_policy; - store->sd_control = entity; - store->sd_db = db; - - isns_register_callback(__isns_db_keystore_change_notify, store); - - return (isns_keystore_t *) store; -} - diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/dd.c open-iscsi-2.0.874/utils/open-isns/dd.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/dd.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/dd.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1307 +0,0 @@ -/* - * Handle DD registration/deregistration - * - * Discovery domains are weird, even in the context of - * iSNS. For once thing, all other objects have unique - * attributes; DDs attributes can appear several times. - * They should really have made each DD member an object - * in its own right. - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include -#include -#include "isns.h" -#include "attrs.h" -#include "objects.h" -#include "message.h" -#include "security.h" -#include "util.h" -#include "db.h" - -#define DD_DEBUG - -enum { - ISNS_DD_MEMBER_ISCSI_NODE = 1, - ISNS_DD_MEMBER_IFCP_NODE, - ISNS_DD_MEMBER_PORTAL, -}; -/* Must be zero/one: */ -enum { - NOTIFY_MEMBER_ADDED = 0, - NOTIFY_MEMBER_REMOVED = 1 -}; - -typedef struct isns_dd isns_dd_t; -typedef struct isns_dd_list isns_dd_list_t; -typedef struct isns_dd_member isns_dd_member_t; - -struct isns_dd { - uint32_t dd_id; - char * dd_name; - uint32_t dd_features; - isns_dd_member_t * dd_members; - - unsigned int dd_inserted : 1; - - isns_object_t * dd_object; -}; - -struct isns_dd_member { - isns_dd_member_t * ddm_next; - unsigned int ddm_type; - isns_object_ref_t ddm_object; - - unsigned int ddm_added : 1; - union { - uint32_t ddm_index; - - /* Index must be first in all structs below. - * Yeah, I know. Aliasing is bad. */ - struct isns_dd_portal { - uint32_t index; - isns_portal_info_t info; - } ddm_portal; - struct isns_dd_iscsi_node { - uint32_t index; - char * name; - } ddm_iscsi_node; - struct isns_dd_ifcp_node { - uint32_t index; - char * name; - } ddm_ifcp_node; - }; -}; - -struct isns_dd_list { - unsigned int ddl_count; - isns_dd_t ** ddl_data; -}; - -/* - * List of all discovery domains. - * This duplicates the DD information from the database, - * but unfortunately this can't be helped - we need to - * have fast algorithms to compute the membership of a - * node, and the relative visibility of two nodes. - */ -static int isns_dd_list_initialized = 0; -static isns_dd_list_t isns_dd_list; -static uint32_t isns_dd_next_id = 1; - -static isns_dd_t * isns_dd_alloc(void); -static isns_dd_t * isns_dd_clone(const isns_dd_t *); -static void isns_dd_release(isns_dd_t *); -static int isns_dd_parse_attrs(isns_dd_t *, - isns_db_t *, const isns_attr_list_t *, - const isns_dd_t *, int); -static int isns_dd_remove_members(isns_dd_t *, - isns_db_t *, - isns_dd_t *); -static void isns_dd_notify(const isns_dd_t *, - isns_dd_member_t *, - isns_dd_member_t *, - int); -static void isns_dd_add_members(isns_dd_t *, - isns_db_t *, - isns_dd_t *); -static void isns_dd_store(isns_db_t *, const isns_dd_t *, int); -static void isns_dd_destroy(isns_db_t *, isns_dd_t *); -static void isns_dd_insert(isns_dd_t *); -static isns_dd_t * isns_dd_by_id(uint32_t); -static isns_dd_t * isns_dd_by_name(const char *); -static isns_dd_member_t * isns_dd_create_member(isns_object_t *); -static inline void isns_dd_member_free(isns_dd_member_t *); -static int isns_dd_remove_member(isns_dd_t *, isns_object_t *); -static void isns_dd_list_resize(isns_dd_list_t *, unsigned int); -static void isns_dd_list_insert(isns_dd_list_t *, isns_dd_t *); -static void isns_dd_list_remove(isns_dd_list_t *, isns_dd_t *); - -static isns_object_t * isns_dd_get_member_object(isns_db_t *, - const isns_attr_t *, const isns_attr_t *, - int); - -/* - * Create DDReg messages - */ -isns_simple_t * -isns_create_dd_registration(isns_client_t *clnt, const isns_attr_list_t *attrs) -{ - isns_simple_t *msg; - isns_attr_t *id_attr; - - msg = isns_simple_create(ISNS_DD_REGISTER, clnt->ic_source, NULL); - if (msg == NULL) - return NULL; - - /* If the caller specified a DD_ID, use it in the - * message key. */ - if (isns_attr_list_get_attr(attrs, ISNS_TAG_DD_ID, &id_attr)) - isns_attr_list_append_attr(&msg->is_message_attrs, id_attr); - - isns_attr_list_copy(&msg->is_operating_attrs, attrs); - return msg; -} - -isns_simple_t * -isns_create_dd_deregistration(isns_client_t *clnt, - uint32_t dd_id, const isns_attr_list_t *attrs) -{ - isns_simple_t *msg; - - msg = isns_simple_create(ISNS_DD_DEREGISTER, clnt->ic_source, NULL); - if (msg == NULL) - return NULL; - - isns_attr_list_append_uint32(&msg->is_message_attrs, - ISNS_TAG_DD_ID, dd_id); - - isns_attr_list_copy(&msg->is_operating_attrs, attrs); - return msg; -} - -/* - * Process a DD registration - */ -int -isns_process_dd_registration(isns_server_t *srv, isns_simple_t *call, isns_simple_t **result) -{ - isns_simple_t *reply = NULL; - isns_attr_list_t *keys = &call->is_message_attrs; - isns_attr_list_t *attrs = &call->is_operating_attrs; - isns_db_t *db = srv->is_db; - isns_dd_t *dd = NULL, *temp_dd = NULL; - isns_attr_t *attr; - uint32_t id = 0; - int status; - - /* - * 5.6.5.9. - * The Message Key, if used, contains the DD_ID of the Discovery - * Domain to be registered. If the Message Key contains a DD_ID - * of an existing DD entry in the iSNS database, then the DDReg - * message SHALL attempt to update the existing entry. If the - * DD_ID in the Message Key (if used) does not match an existing - * DD entry, then the iSNS server SHALL reject the DDReg message - * with a status code of 3 (Invalid Registration). - */ - switch (keys->ial_count) { - case 0: - /* Security: check if the client is allowed to - * create a discovery domain */ - if (!isns_policy_validate_object_creation(call->is_policy, - call->is_source, - &isns_dd_template, - keys, attrs, - call->is_function)) - goto unauthorized; - break; - - case 1: - attr = keys->ial_data[0]; - if (attr->ia_tag_id != ISNS_TAG_DD_ID) - goto reject; - if (ISNS_ATTR_IS_NIL(attr)) - break; - if (!ISNS_ATTR_IS_UINT32(attr)) - goto reject; - - id = attr->ia_value.iv_uint32; - if (id == 0) - goto reject; - - dd = isns_dd_by_id(id); - if (dd == NULL) { - isns_debug_state("DDReg for unknown ID=%u\n", id); - goto reject; - } - - /* Security: check if the client is allowed to - * mess with this DD. */ - isns_assert(dd->dd_object); - if (!isns_policy_validate_object_update(call->is_policy, - call->is_source, - dd->dd_object, attrs, - call->is_function)) - goto unauthorized; - - break; - - default: - goto reject; - } - - temp_dd = isns_dd_alloc(); - - /* Parse the attributes and build a DD object. */ - status = isns_dd_parse_attrs(temp_dd, db, attrs, dd, 1); - if (status != ISNS_SUCCESS) - goto out; - - if (dd == NULL) { - /* Create the DD, and copy the general information - * such asn features and symbolic name from temp_dd */ - dd = isns_dd_clone(temp_dd); - - /* Don't assign the attrs to the DD right away. - * First and foremost, they may be unsorted. Second, - * we really want to hand-pick through them due to - * the weird semantics mandated by the RFC. */ - dd->dd_object = isns_create_object(&isns_dd_template, NULL, NULL); - if (dd->dd_object == NULL) - goto reject; - - /* Insert new domain into database */ - isns_db_insert(db, dd->dd_object); - - /* Add it to the internal list. Assign DD_ID and - * symbolic name if none were given. - */ - isns_dd_insert(dd); - } else { - if (!dd->dd_id) - dd->dd_id = temp_dd->dd_id; - dd->dd_features = temp_dd->dd_features; - isns_assign_string(&dd->dd_name, temp_dd->dd_name); - } - - /* Send notifications. This must be done before merging - * the list of new members into the DD. - */ - isns_dd_notify(dd, dd->dd_members, temp_dd->dd_members, - NOTIFY_MEMBER_ADDED); - - /* Update the DD */ - isns_dd_add_members(dd, db, temp_dd); - - /* And add it to the database. */ - isns_dd_store(db, dd, 0); - - reply = isns_simple_create(ISNS_DD_REGISTER, srv->is_source, NULL); - isns_object_extract_all(dd->dd_object, &reply->is_operating_attrs); - - status = ISNS_SUCCESS; - -out: - isns_dd_release(temp_dd); - isns_dd_release(dd); - *result = reply; - return status; - -reject: - status = ISNS_INVALID_REGISTRATION; - goto out; - -unauthorized: - status = ISNS_SOURCE_UNAUTHORIZED; - goto out; -} - -/* - * Process a DD deregistration - */ -int -isns_process_dd_deregistration(isns_server_t *srv, isns_simple_t *call, isns_simple_t **result) -{ - isns_simple_t *reply = NULL; - isns_attr_list_t *keys = &call->is_message_attrs; - isns_attr_list_t *attrs = &call->is_operating_attrs; - isns_db_t *db = srv->is_db; - isns_dd_t *dd = NULL, *temp_dd = NULL; - isns_attr_t *attr; - uint32_t id = 0; - int status; - - /* - * 5.6.5.10. - * The Message Key Attribute for a DDDereg message is the DD - * ID for the Discovery Domain being removed or having members - * removed. - */ - if (keys->ial_count != 1) - goto reject; - - attr = keys->ial_data[0]; - if (attr->ia_tag_id != ISNS_TAG_DD_ID - || ISNS_ATTR_IS_NIL(attr) - || !ISNS_ATTR_IS_UINT32(attr)) - goto reject; - - id = attr->ia_value.iv_uint32; - if (id == 0) - goto reject; - - dd = isns_dd_by_id(id); - if (dd == NULL) - goto reject; - - /* Security: check if the client is permitted to - * modify the DD object. - */ - if (!isns_policy_validate_object_update(call->is_policy, - call->is_source, - dd->dd_object, attrs, - call->is_function)) - goto unauthorized; - - /* - * 5.6.5.10. - * If the DD ID matches an existing DD and there are - * no Operating Attributes, then the DD SHALL be removed and a - * success Status Code returned. Any existing members of that - * DD SHALL remain in the iSNS database without membership in - * the just-removed DD. - */ - if (attrs->ial_count == 0) { - isns_dd_member_t *mp; - - /* Zap the membership bit */ - for (mp = dd->dd_members; mp; mp = mp->ddm_next) { - isns_object_t *obj = mp->ddm_object.obj; - - isns_object_clear_membership(obj, dd->dd_id); - } - - /* Notify all DD members that they will lose the other - * nodes. */ - isns_dd_notify(dd, NULL, dd->dd_members, NOTIFY_MEMBER_REMOVED); - - isns_dd_destroy(db, dd); - } else { - /* Parse the attributes and build a temporary DD object. */ - temp_dd = isns_dd_alloc(); - status = isns_dd_parse_attrs(temp_dd, db, attrs, dd, 0); - if (status != ISNS_SUCCESS) - goto out; - - /* Update the DD object */ - status = isns_dd_remove_members(dd, db, temp_dd); - if (status != ISNS_SUCCESS) - goto out; - - /* Send notifications. This must be done before after - * updating the DD. - */ - isns_dd_notify(dd, dd->dd_members, temp_dd->dd_members, - NOTIFY_MEMBER_REMOVED); - - /* Store it in the database. */ - isns_dd_store(db, dd, 1); - } - - reply = isns_simple_create(ISNS_DD_DEREGISTER, srv->is_source, NULL); - status = ISNS_SUCCESS; - -out: - isns_dd_release(temp_dd); - isns_dd_release(dd); - *result = reply; - return status; - -reject: - status = ISNS_INVALID_DEREGISTRATION; - goto out; - -unauthorized: - status = ISNS_SOURCE_UNAUTHORIZED; - goto out; -} - -static isns_dd_t * -isns_dd_alloc(void) -{ - return isns_calloc(1, sizeof(isns_dd_t)); -} - -/* - * Allocate a clone of the orig_dd, but without - * copying the members. - */ -static isns_dd_t * -isns_dd_clone(const isns_dd_t *orig_dd) -{ - isns_dd_t *dd; - - dd = isns_dd_alloc(); - - dd->dd_id = orig_dd->dd_id; - dd->dd_features = orig_dd->dd_features; - dd->dd_object = isns_object_get(orig_dd->dd_object); - isns_assign_string(&dd->dd_name, orig_dd->dd_name); - - return dd; -} - -static void -isns_dd_release(isns_dd_t *dd) -{ - isns_dd_member_t *member; - - if (dd == NULL || dd->dd_inserted) - return; - - while ((member = dd->dd_members) != NULL) { - dd->dd_members = member->ddm_next; - isns_dd_member_free(member); - } - - if (dd->dd_object) - isns_object_release(dd->dd_object); - - isns_free(dd->dd_name); - isns_free(dd); -} - -static isns_dd_member_t * -isns_dd_create_member(isns_object_t *obj) -{ - isns_dd_member_t *new; - - new = isns_calloc(1, sizeof(*new)); - new->ddm_added = 1; - - if (ISNS_IS_ISCSI_NODE(obj)) - new->ddm_type = ISNS_DD_MEMBER_ISCSI_NODE; - else if (ISNS_IS_PORTAL(obj)) - new->ddm_type = ISNS_DD_MEMBER_PORTAL; - else if (ISNS_IS_FC_NODE(obj)) - new->ddm_type = ISNS_DD_MEMBER_IFCP_NODE; - else { - isns_free(new); - return NULL; - } - - isns_object_reference_set(&new->ddm_object, obj); - return new; -} - -static inline void -isns_dd_member_free(isns_dd_member_t *member) -{ - switch (member->ddm_type) { - case ISNS_DD_MEMBER_ISCSI_NODE: - isns_free(member->ddm_iscsi_node.name); - break; - - case ISNS_DD_MEMBER_IFCP_NODE: - isns_free(member->ddm_ifcp_node.name); - break; - } - - isns_object_reference_drop(&member->ddm_object); - isns_free(member); -} - -void -isns_dd_get_members(uint32_t dd_id, isns_object_list_t *list, int active_only) -{ - isns_dd_t *dd; - isns_dd_member_t *mp; - - dd = isns_dd_by_id(dd_id); - if (dd == NULL) - return; - - for (mp = dd->dd_members; mp; mp = mp->ddm_next) { - isns_object_t *obj = mp->ddm_object.obj; - - if (active_only - && obj->ie_state != ISNS_OBJECT_STATE_MATURE) - continue; - - isns_object_list_append(list, obj); - } -} - -/* - * Helper function to remove a member referencing the given object - */ -static int -isns_dd_remove_member(isns_dd_t *dd, isns_object_t *obj) -{ - isns_dd_member_t *mp, **pos; - - pos = &dd->dd_members; - while ((mp = *pos) != NULL) { - if (mp->ddm_object.obj == obj) { - *pos = mp->ddm_next; - isns_dd_member_free(mp); - return 1; - } else { - pos = &mp->ddm_next; - } - } - - return 0; -} - -static void -isns_dd_insert(isns_dd_t *dd) -{ - if (dd->dd_inserted) - return; - - if (dd->dd_id == 0) { - uint32_t id = isns_dd_next_id; - unsigned int i; - - for (i = 0; i < isns_dd_list.ddl_count; ++i) { - isns_dd_t *cur = isns_dd_list.ddl_data[i]; - - if (cur->dd_id > id) - break; - if (cur->dd_id == id) - ++id; - } - isns_debug_state("Allocated new DD_ID %d\n", id); - dd->dd_id = id; - isns_dd_next_id = id + 1; - } - - /* - * When creating a new DD, if the DD_Symbolic_Name is - * not included in the Operating Attributes, or if it - * is included with a zero-length TLV, then the iSNS - * server SHALL provide a unique DD_Symbolic_Name value - * for the created DD. The assigned DD_Symbolic_Name - * value SHALL be returned in the DDRegRsp message. - */ - if (dd->dd_name == NULL) { - char namebuf[64]; - - snprintf(namebuf, sizeof(namebuf), "isns.dd%u", dd->dd_id); - isns_assign_string(&dd->dd_name, namebuf); - } - - isns_dd_list_insert(&isns_dd_list, dd); - dd->dd_inserted = 1; - -#ifdef DD_DEBUG - /* Safety first - make sure domains are sorted by DD_ID */ - { - unsigned int i, prev_id = 0; - - for (i = 0; i < isns_dd_list.ddl_count; ++i) { - isns_dd_t *cur = isns_dd_list.ddl_data[i]; - - isns_assert(cur->dd_id > prev_id); - prev_id = cur->dd_id; - } - } -#endif -} - -/* - * Resize the DD list - */ -#define LIST_SIZE(n) (((n) + 15) & ~15) -void -isns_dd_list_resize(isns_dd_list_t *list, unsigned int last_index) -{ - unsigned int new_size, cur_size; - isns_dd_t **new_data; - - cur_size = LIST_SIZE(list->ddl_count); - new_size = LIST_SIZE(last_index + 1); - if (new_size < list->ddl_count) - return; - - /* We don't use realloc here because we need - * to zero the new pointers anyway. */ - new_data = isns_calloc(new_size, sizeof(void *)); - isns_assert(new_data); - - memcpy(new_data, list->ddl_data, - list->ddl_count * sizeof(void *)); - isns_free(list->ddl_data); - - list->ddl_data = new_data; - list->ddl_count = last_index + 1; -} - -/* - * Find the insert position for a given DD ID. - * returns true iff the DD was found in the list. - */ -static int -__isns_dd_list_find_pos(isns_dd_list_t *list, unsigned int id, - unsigned int *where) -{ - unsigned int hi, lo, md; - - lo = 0; - hi = list->ddl_count; - - /* binary search */ - while (lo < hi) { - isns_dd_t *cur; - - md = (lo + hi) / 2; - cur = list->ddl_data[md]; - - if (id == cur->dd_id) { - *where = md; - return 1; - } - - if (id < cur->dd_id) { - hi = md; - } else { - lo = md + 1; - } - } - - *where = hi; - return 0; -} - -/* - * In-order insert - */ -static void -isns_dd_list_insert(isns_dd_list_t *list, isns_dd_t *dd) -{ - unsigned int pos; - - if (__isns_dd_list_find_pos(list, dd->dd_id, &pos)) { - isns_error("Internal error in %s: DD already listed\n", - __FUNCTION__); - return; - } - - isns_dd_list_resize(list, list->ddl_count); - /* Shift the tail of the list to make room for new entry. */ - memmove(list->ddl_data + pos + 1, - list->ddl_data + pos, - (list->ddl_count - pos - 1) * sizeof(void *)); - list->ddl_data[pos] = dd; -} - -/* - * Remove DD from list - */ -void -isns_dd_list_remove(isns_dd_list_t *list, isns_dd_t *dd) -{ - unsigned int pos; - - if (!__isns_dd_list_find_pos(list, dd->dd_id, &pos)) - return; - - /* Shift the tail of the list */ - memmove(list->ddl_data + pos, - list->ddl_data + pos + 1, - (list->ddl_count - pos - 1) * sizeof(void *)); - list->ddl_count -= 1; -} - -isns_dd_t * -isns_dd_by_id(uint32_t id) -{ - unsigned int i; - - for (i = 0; i < isns_dd_list.ddl_count; ++i) { - isns_dd_t *dd = isns_dd_list.ddl_data[i]; - - if (dd && dd->dd_id == id) - return dd; - } - - return NULL; -} - -static isns_dd_t * -isns_dd_by_name(const char *name) -{ - unsigned int i; - - for (i = 0; i < isns_dd_list.ddl_count; ++i) { - isns_dd_t *dd = isns_dd_list.ddl_data[i]; - - if (dd && !strcmp(dd->dd_name, name)) - return dd; - } - - return NULL; -} - -/* - * Validate the operating attributes, which is surprisingly - * tedious for DDs. It appears as if the whole DD/DDset - * stuff has been slapped onto iSNS as an afterthought. - * - * DDReg has some funky rules about how eg iSCSI nodes - * can be identified by either name or index, and how they - * relate to each other. Unfortunately, the RFC is very vague - * in describing how to treat DDReg message that mix these - * two types of identification, except by saying they - * need to be consistent. - */ -static int -isns_dd_parse_attrs(isns_dd_t *dd, isns_db_t *db, - const isns_attr_list_t *attrs, - const isns_dd_t *orig_dd, - int is_registration) -{ - isns_dd_member_t **tail; - const isns_dd_t *conflict; - unsigned int i; - int rv = ISNS_SUCCESS; - - if (orig_dd) { - dd->dd_id = orig_dd->dd_id; - dd->dd_features = orig_dd->dd_features; - isns_assign_string(&dd->dd_name, orig_dd->dd_name); - } - - isns_assert(dd->dd_members == NULL); - tail = &dd->dd_members; - - for (i = 0; i < attrs->ial_count; ++i) { - isns_object_t *obj = NULL; - isns_attr_t *attr, *next = NULL; - const char *name; - uint32_t id; - - attr = attrs->ial_data[i]; - - if (!isns_object_attr_valid(&isns_dd_template, attr->ia_tag_id)) - return ISNS_INVALID_REGISTRATION; - - switch (attr->ia_tag_id) { - case ISNS_TAG_DD_ID: - /* Ignore this attribute in DDDereg messages */ - if (!is_registration) - continue; - - /* - * 5.6.5.9. - * A DDReg message with no Message Key SHALL result - * in the attempted creation of a new Discovery Domain - * (DD). If the DD_ID attribute (with non-zero length) - * is included among the Operating Attributes in the - * DDReg message, then the new Discovery Domain SHALL be - * assigned the value contained in that DD_ID attribute. - * - * If the DD_ID is included in both the Message - * Key and Operating Attributes, then the DD_ID - * value in the Message Key MUST be the same as - * the DD_ID value in the Operating Attributes. - * - * Implementer's note: It's not clear why the standard - * makes an exception for the DD_ID, while all other - * index attributes are read-only. - */ - if (ISNS_ATTR_IS_NIL(attr)) - break; - - id = attr->ia_value.iv_uint32; - if (dd->dd_id != 0) { - if (dd->dd_id != id) - goto invalid; - } else if ((conflict = isns_dd_by_id(id)) != NULL) { - isns_debug_state("DDReg: requested ID %d " - "clashes with existing DD (%s)\n", - id, conflict->dd_name); - goto invalid; - } - dd->dd_id = id; - break; - - case ISNS_TAG_DD_SYMBOLIC_NAME: - /* Ignore this attribute in DDDereg messages */ - if (!is_registration) - continue; - - /* - * If the DD_Symbolic_Name is an operating - * attribute and its value is unique (i.e., it - * does not match the registered DD_Symbolic_Name - * for another DD), then the value SHALL be stored - * in the iSNS database as the DD_Symbolic_Name - * for the specified Discovery Domain. If the - * value for the DD_Symbolic_Name is not unique, - * then the iSNS server SHALL reject the attempted - * DD registration with a status code of 3 - * (Invalid Registration). - */ - if (ISNS_ATTR_IS_NIL(attr)) - break; - - name = attr->ia_value.iv_string; - if (dd->dd_name && strcmp(name, dd->dd_name)) { - isns_debug_state("DDReg: symbolic name conflict: " - "id=%d name=%s requested=%s\n", - dd->dd_id, dd->dd_name, name); - goto invalid; - } - if (dd->dd_name) - break; - - if ((conflict = isns_dd_by_name(name)) != NULL) { - isns_debug_state("DDReg: requested symbolic name (%s) " - "clashes with existing DD (id=%d)\n", - name, conflict->dd_id); - goto invalid; - } - isns_assign_string(&dd->dd_name, name); - break; - - case ISNS_TAG_DD_FEATURES: - /* Ignore this attribute in DDDereg messages */ - if (!is_registration) - continue; - - /* - * When creating a new DD, if the DD_Features - * attribute is not included in the Operating - * Attributes, then the iSNS server SHALL assign - * the default value. The default value for - * DD_Features is 0. - */ - if (ISNS_ATTR_IS_UINT32(attr)) - dd->dd_features = attr->ia_value.iv_uint32; - break; - - case ISNS_TAG_DD_MEMBER_PORTAL_IP_ADDR: - /* portal address must be followed by port */ - if (i + 1 >= attrs->ial_count) - goto invalid; - - next = attrs->ial_data[i + 1]; - if (next->ia_tag_id != ISNS_TAG_DD_MEMBER_PORTAL_TCP_UDP_PORT) - goto invalid; - i += 1; - /* fallthru to normal case */ - - case ISNS_TAG_DD_MEMBER_PORTAL_INDEX: - case ISNS_TAG_DD_MEMBER_ISCSI_INDEX: - case ISNS_TAG_DD_MEMBER_ISCSI_NAME: - case ISNS_TAG_DD_MEMBER_FC_PORT_NAME: - if (ISNS_ATTR_IS_NIL(attr)) - goto invalid; - - obj = isns_dd_get_member_object(db, - attr, next, - is_registration); - /* For a DD deregistration, it's okay if the - * object does not exist. */ - if (obj == NULL && is_registration) - goto invalid; - break; - - invalid: - rv = ISNS_INVALID_REGISTRATION; - continue; - - } - - if (obj) { - if (is_registration - && isns_object_test_membership(obj, dd->dd_id)) { - /* Duplicates are ignored */ - isns_debug_state("Ignoring duplicate DD registration " - "for %s %u\n", - obj->ie_template->iot_name, - obj->ie_index); - } else { - /* This just adds the member to the temporary DD object, - * without changing any state in the database. */ - isns_dd_member_t *new; - - new = isns_dd_create_member(obj); - if (new) { - *tail = new; - tail = &new->ddm_next; - } - } - isns_object_release(obj); - } - } - - return rv; -} - -/* - * Helper function: extract live nodes from the DD member list - */ -static inline void -isns_dd_get_member_nodes(isns_dd_member_t *members, isns_object_list_t *result) -{ - isns_dd_member_t *mp; - - /* Extract iSCSI nodes from both list. */ - for (mp = members; mp; mp = mp->ddm_next) { - isns_object_t *obj = mp->ddm_object.obj; - - if (ISNS_IS_ISCSI_NODE(obj) - && obj->ie_state == ISNS_OBJECT_STATE_MATURE) - isns_object_list_append(result, obj); - } -} - -void -isns_dd_notify(const isns_dd_t *dd, isns_dd_member_t *unchanged, - isns_dd_member_t *changed, int removed) -{ - isns_object_list_t dd_objects = ISNS_OBJECT_LIST_INIT; - isns_object_list_t changed_objects = ISNS_OBJECT_LIST_INIT; - unsigned int i, j, event; - - /* Extract iSCSI nodes from both list. */ - isns_dd_get_member_nodes(unchanged, &dd_objects); - isns_dd_get_member_nodes(changed, &changed_objects); - - /* Send a management SCN multicast to all - * control nodes that care. */ - event = removed? ISNS_SCN_DD_MEMBER_REMOVED_MASK : ISNS_SCN_DD_MEMBER_ADDED_MASK; - for (i = 0; i < changed_objects.iol_count; ++i) { - isns_object_t *obj = changed_objects.iol_data[i]; - - isns_object_event(obj, - event | ISNS_SCN_MANAGEMENT_REGISTRATION_MASK, - dd->dd_object); - } - -#ifdef notagoodidea - /* Not sure - it may be good to send OBJECT ADDED/REMOVED instead - * of the DD membership messages. However, right now the SCN code - * will nuke all SCN registrations for a node when it sees a - * REMOVE event for it. - */ - event = removed? ISNS_SCN_OBJECT_REMOVED_MASK : ISNS_SCN_OBJECT_ADDED_MASK; -#endif - - /* If we added an iscsi node, loop over all members - * and send unicast events to each iscsi node, - * informing them that a new member has been added/removed. - */ - for (j = 0; j < changed_objects.iol_count; ++j) { - isns_object_t *changed = changed_objects.iol_data[j]; - - for (i = 0; i < dd_objects.iol_count; ++i) { - isns_object_t *obj = dd_objects.iol_data[i]; - - /* For member removal, do not send notifications - * if the two nodes are still visible to each - * other through a different discovery domain */ - if (removed && isns_object_test_visibility(obj, changed)) - continue; - - /* Inform the old node that the new node was - * added/removed. */ - isns_unicast_event(obj, changed, event, NULL); - - /* Inform the new node that the old node became - * (in)accessible to it. */ - isns_unicast_event(changed, obj, event, NULL); - } - - /* Finally, inform each changed node of the other - * DD members that became (in)accessible to it. */ - for (i = 0; i < changed_objects.iol_count; ++i) { - isns_object_t *obj = changed_objects.iol_data[i]; - - if (obj == changed) - continue; - - if (removed && isns_object_test_visibility(obj, changed)) - continue; - - isns_unicast_event(changed, obj, event, NULL); - } - } -} - -void -isns_dd_add_members(isns_dd_t *dd, isns_db_t *db, isns_dd_t *new_dd) -{ - isns_dd_member_t *mp, **tail; - - for (mp = new_dd->dd_members; mp; mp = mp->ddm_next) { - const char *node_name; - isns_object_t *obj = mp->ddm_object.obj; - - /* - * If the Operating Attributes contain a DD - * Member iSCSI Name value for a Storage Node - * that is currently not registered in the iSNS - * database, then the iSNS server MUST allocate an - * unused iSCSI Node Index for that Storage Node. - * The assigned iSCSI Node Index SHALL be returned - * in the DDRegRsp message as the DD Member iSCSI - * Node Index. The allocated iSCSI Node Index - * value SHALL be assigned to the Storage Node - * if and when it registers in the iSNS database. - * [And likewise for portals] - */ - if (obj->ie_index == 0) - isns_db_insert_limbo(db, obj); - mp->ddm_index = obj->ie_index; - - /* Record the fact that the object is a member of - * this DD */ - isns_object_mark_membership(obj, dd->dd_id); - - switch (mp->ddm_type) { - case ISNS_DD_MEMBER_ISCSI_NODE: - if (isns_object_get_string(obj, ISNS_TAG_ISCSI_NAME, &node_name)) - isns_assign_string(&mp->ddm_iscsi_node.name, node_name); - - break; - - case ISNS_DD_MEMBER_IFCP_NODE: - if (isns_object_get_string(obj, ISNS_TAG_FC_PORT_NAME_WWPN, &node_name)) - isns_assign_string(&mp->ddm_ifcp_node.name, node_name); - - break; - - case ISNS_DD_MEMBER_PORTAL: - isns_portal_from_object(&mp->ddm_portal.info, - ISNS_TAG_PORTAL_IP_ADDRESS, - ISNS_TAG_PORTAL_TCP_UDP_PORT, - obj); - break; - } - } - - /* Find the tail of the DD member list */ - tail = &dd->dd_members; - while ((mp = *tail) != NULL) - tail = &mp->ddm_next; - - /* Append the new list of members */ - *tail = new_dd->dd_members; - new_dd->dd_members = NULL; -} - -/* - * Remove members from a DD - */ -int -isns_dd_remove_members(isns_dd_t *dd, isns_db_t *db, isns_dd_t *temp_dd) -{ - isns_dd_member_t *mp; - - for (mp = temp_dd->dd_members; mp; mp = mp->ddm_next) { - isns_object_t *obj = mp->ddm_object.obj; - - /* Clear the membership bit. If the object wasn't in this - * DD to begin with, bail out right away. */ - if (!isns_object_clear_membership(obj, dd->dd_id)) { - isns_debug_state("DD dereg: object %d is not in this DD\n", - obj->ie_index); - continue; - } - - if (!isns_dd_remove_member(dd, obj)) - isns_error("%s: DD member not found in internal list\n", - __FUNCTION__); - } - - return ISNS_SUCCESS; -} - -void -isns_dd_store(isns_db_t *db, const isns_dd_t *dd, int rewrite) -{ - isns_object_t *obj = dd->dd_object; - isns_dd_member_t *member; - - if (rewrite) - isns_object_prune_attrs(obj); - - isns_object_set_uint32(obj, ISNS_TAG_DD_ID, dd->dd_id); - isns_object_set_string(obj, ISNS_TAG_DD_SYMBOLIC_NAME, dd->dd_name); - isns_object_set_uint32(obj, ISNS_TAG_DD_FEATURES, dd->dd_features); - - for (member = dd->dd_members; member; member = member->ddm_next) { - struct isns_dd_iscsi_node *node; - struct isns_dd_portal *portal; - - if (!member->ddm_added && !rewrite) - continue; - - switch (member->ddm_type) { - case ISNS_DD_MEMBER_ISCSI_NODE: - node = &member->ddm_iscsi_node; - - isns_object_set_uint32(obj, - ISNS_TAG_DD_MEMBER_ISCSI_INDEX, - node->index); - if (node->name) - isns_object_set_string(obj, - ISNS_TAG_DD_MEMBER_ISCSI_NAME, - node->name); - break; - - case ISNS_DD_MEMBER_PORTAL: - portal = &member->ddm_portal; - - isns_object_set_uint32(obj, - ISNS_TAG_DD_MEMBER_PORTAL_INDEX, - portal->index); - if (portal->info.addr.sin6_family != AF_UNSPEC) { - isns_portal_to_object(&portal->info, - ISNS_TAG_DD_MEMBER_PORTAL_IP_ADDR, - ISNS_TAG_DD_MEMBER_PORTAL_TCP_UDP_PORT, - obj); - } - break; - } - - member->ddm_added = 0; - } -} - -/* - * Destroy a DD - * The caller should call isns_dd_release to free the DD object. - */ -void -isns_dd_destroy(isns_db_t *db, isns_dd_t *dd) -{ - isns_db_remove(db, dd->dd_object); - isns_dd_list_remove(&isns_dd_list, dd); - dd->dd_inserted = 0; -} - -int -isns_dd_load_all(isns_db_t *db) -{ - isns_object_list_t list = ISNS_OBJECT_LIST_INIT; - unsigned int i; - int rc; - - if (isns_dd_list_initialized) - return ISNS_SUCCESS; - - rc = isns_db_gang_lookup(db, &isns_dd_template, NULL, &list); - if (rc != ISNS_SUCCESS) - return rc; - - for (i = 0; i < list.iol_count; ++i) { - isns_object_t *obj = list.iol_data[i]; - isns_dd_t *dd = NULL, *temp_dd = NULL; - isns_dd_member_t *mp; - - temp_dd = isns_dd_alloc(); - - rc = isns_dd_parse_attrs(temp_dd, db, &obj->ie_attrs, NULL, 1); - if (rc) { - if (temp_dd->dd_id == 0) { - isns_error("Problem converting DD object (index 0x%x). No DD_ID\n", - obj->ie_index); - goto next; - } - isns_error("Problem converting DD %u. Proceeding anyway.\n", - temp_dd->dd_id); - } else { - isns_debug_state("Loaded DD %d from database\n", temp_dd->dd_id); - } - - dd = isns_dd_clone(temp_dd); - - dd->dd_object = isns_object_get(obj); - - isns_dd_insert(dd); - isns_dd_add_members(dd, db, temp_dd); - - /* Clear the ddm_added flag for all members, to - * prevent all information from being duplicated - * to the DB on the next DD modification. */ - for (mp = dd->dd_members; mp; mp = mp->ddm_next) - mp->ddm_added = 0; - -next: - isns_dd_release(temp_dd); - } - - isns_object_list_destroy(&list); - isns_dd_list_initialized = 1; - return ISNS_SUCCESS; -} - -isns_object_t * -isns_dd_get_member_object(isns_db_t *db, const isns_attr_t *key1, - const isns_attr_t *key2, - int create) -{ - isns_attr_list_t query = ISNS_ATTR_LIST_INIT; - isns_object_template_t *tmpl = NULL; - isns_object_t *obj; - isns_portal_info_t portal_info; - const char *key_string = NULL; - uint32_t key_index = 0; - - switch (key1->ia_tag_id) { - case ISNS_TAG_DD_MEMBER_ISCSI_INDEX: - key_index = key1->ia_value.iv_uint32; - isns_attr_list_append_uint32(&query, - ISNS_TAG_ISCSI_NODE_INDEX, - key_index); - tmpl = &isns_iscsi_node_template; - break; - - case ISNS_TAG_DD_MEMBER_ISCSI_NAME: - key_string = key1->ia_value.iv_string; - isns_attr_list_append_string(&query, - ISNS_TAG_ISCSI_NAME, - key_string); - tmpl = &isns_iscsi_node_template; - break; - - case ISNS_TAG_DD_MEMBER_FC_PORT_NAME: - key_string = key1->ia_value.iv_string; - isns_attr_list_append_string(&query, - ISNS_TAG_FC_PORT_NAME_WWPN, - key_string); - tmpl = &isns_fc_port_template; - break; - - case ISNS_TAG_DD_MEMBER_PORTAL_INDEX: - key_index = key1->ia_value.iv_uint32; - isns_attr_list_append_uint32(&query, - ISNS_TAG_PORTAL_INDEX, - key_index); - tmpl = &isns_portal_template; - break; - - case ISNS_TAG_DD_MEMBER_PORTAL_IP_ADDR: - if (!isns_portal_from_attr_pair(&portal_info, key1, key2) - || !isns_portal_to_attr_list(&portal_info, - ISNS_TAG_PORTAL_IP_ADDRESS, - ISNS_TAG_PORTAL_TCP_UDP_PORT, - &query)) - return NULL; - - key_string = isns_portal_string(&portal_info); - tmpl = &isns_portal_template; - break; - - default: - return NULL; - } - - obj = isns_db_lookup(db, tmpl, &query); - if (!obj && create) { - if (!key_string) { - isns_debug_state("Attempt to register %s DD member " - "with unknown index %u\n", - tmpl->iot_name, key_index); - goto out; - } - - obj = isns_create_object(tmpl, &query, NULL); - if (obj != NULL) - isns_debug_state("Created limbo object for " - "%s DD member %s\n", - tmpl->iot_name, key_string); - } - -out: - isns_attr_list_destroy(&query); - return obj; - -} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/deregister.c open-iscsi-2.0.874/utils/open-isns/deregister.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/deregister.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/deregister.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,271 +0,0 @@ -/* - * Handle iSNS Device Deregistration - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include -#include -#include "isns.h" -#include "attrs.h" -#include "objects.h" -#include "message.h" -#include "security.h" -#include "util.h" -#include "db.h" - -extern isns_source_t * isns_server_source; - - -/* - * Create a registration, and set the source name - */ -static isns_simple_t * -__isns_create_deregistration(isns_source_t *source, const isns_attr_list_t *attrs) -{ - isns_simple_t *simp; - - simp = isns_simple_create(ISNS_DEVICE_DEREGISTER, source, NULL); - if (simp && attrs) - isns_attr_list_copy(&simp->is_operating_attrs, attrs); - return simp; -} - -isns_simple_t * -isns_create_deregistration(isns_client_t *clnt, const isns_attr_list_t *attrs) -{ - return __isns_create_deregistration(clnt->ic_source, attrs); -} - -/* - * Get the next object identified by the operating attrs. - */ -static int -isns_deregistration_get_next_object(isns_db_t *db, - struct isns_attr_list_scanner *st, - isns_object_list_t *result) -{ - isns_object_t *current; - int status; - - status = isns_attr_list_scanner_next(st); - if (status) - return status; - - /* - * 5.6.5.4. - * Valid Operating Attributes for DevDereg - * --------------------------------------- - * Entity Identifier - * Portal IP-Address & Portal TCP/UDP Port - * Portal Index - * iSCSI Name - * iSCSI Index - * FC Port Name WWPN - * FC Node Name WWNN - * - * In other words, deregistration is restricted to Entity, - * portal, and node - */ - if (st->tmpl != &isns_entity_template - && st->tmpl != &isns_iscsi_node_template - && st->tmpl != &isns_portal_template) - return ISNS_INVALID_DEREGISTRATION; - - /* Only key attrs allowed */ - if (st->attrs.ial_count) { - /* MS Initiators send the Entity protocol along - * with the Entity Identifier. */ - isns_debug_protocol("Client included invalid operating attrs " - "with %s:\n", st->tmpl->iot_name); - isns_attr_list_print(&st->attrs, isns_debug_protocol); - /* return ISNS_INVALID_DEREGISTRATION; */ - } - - /* - * 5.6.5.4 - * Attempted deregistration of non-existing entries SHALL not - * be considered an isns_error. - */ - current = isns_db_lookup(db, st->tmpl, &st->keys); - if (current != NULL) { - isns_object_list_append(result, current); - isns_object_release(current); - } - - return ISNS_SUCCESS; -} - -/* - * Extract the list of objects to be deregistered from - * the list of operating attributes. - */ -static int -isns_deregistration_get_objects(isns_simple_t *reg, isns_db_t *db, - isns_object_list_t *result) -{ - struct isns_attr_list_scanner state; - int status = ISNS_SUCCESS; - - isns_attr_list_scanner_init(&state, NULL, ®->is_operating_attrs); - state.index_acceptable = 1; - state.source = reg->is_source; - - while (state.pos < state.orig_attrs.ial_count) { - status = isns_deregistration_get_next_object(db, - &state, result); - - if (status == 0) - continue; - - /* Translate error codes */ - if (status == ISNS_NO_SUCH_ENTRY) - status = ISNS_SUCCESS; - else - if (status == ISNS_INVALID_REGISTRATION) - status = ISNS_INVALID_DEREGISTRATION; - break; - } - - isns_attr_list_scanner_destroy(&state); - return status; -} - -/* - * Process a deregistration - * - * Normally, you would expect that a deregistration removes the - * object from the database, and that's the end of the story. - * Unfortunately, someone added Discovery Domains to the protocol, - * requiring _some_ information to survive as long as an object - * is referenced by a discovery domain. Specifically, we need to - * retain the relationship between key attributes (eg iscsi node - * name) and the object index. - * - * Thus, deregistration consists of the following steps - * - the object is removed from the database's global scope, - * so that it's no longer visible to DB lookups. - * - * - the object is detached from its containing Network - * Entity. - * - * - all attributes except the key attr(s) and the index - * attribute are removed. - */ -int -isns_process_deregistration(isns_server_t *srv, isns_simple_t *call, isns_simple_t **result) -{ - isns_object_list_t objects = ISNS_OBJECT_LIST_INIT; - isns_simple_t *reply = NULL; - isns_db_t *db = srv->is_db; - int status, dereg_status; - unsigned int i; - - /* Get the objects to deregister */ - status = isns_deregistration_get_objects(call, db, &objects); - if (status != ISNS_SUCCESS) - goto done; - - /* - * 5.6.5.4 - * - * For messages that change the contents of the iSNS database, - * the iSNS server MUST verify that the Source Attribute - * identifies either a Control Node or a Storage Node that is - * a part of the Network Entity containing the added, deleted, - * or modified objects. - */ - /* - * Implementation note: this can be implemented either by - * explicitly checking the object's owner in isns_db_remove - * (which is what we do right now), or by matching only - * those objects that have the right owner anyway. - * - * The latter sounds like a better choice if the client - * uses NIL attributes, because it limits the scope of - * the operation; but then the RFC doesn't say whether - * this kind of deregistration would be valid at all. - */ - - /* Success: create a new simple message, and - * send it in our reply. */ - reply = __isns_create_deregistration(srv->is_source, NULL); - if (reply == NULL) { - status = ISNS_INTERNAL_ERROR; - goto done; - } - - dereg_status = ISNS_SUCCESS; - for (i = 0; i < objects.iol_count; ++i) { - isns_object_t *obj = objects.iol_data[i]; - - /* Policy: check that the client is permitted - * to deregister this object */ - if (!isns_policy_validate_object_access(call->is_policy, - call->is_source, obj, - call->is_function)) - status = ISNS_SOURCE_UNAUTHORIZED; - - if (status == ISNS_SUCCESS) - status = isns_db_remove(db, obj); - if (status != ISNS_SUCCESS) { - /* - * 5.7.5.4 - * - * In the event of an error, this response message - * contains the appropriate status code as well - * as a list of objects from the original DevDereg - * message that were not successfully deregistered - * from the iSNS database. This list of objects - * is contained in the Operating Attributes - * of the DevDeregRsp message. Note that an - * attempted deregistration of a non-existent - * object does not constitute an isns_error, and - * non-existent entries SHALL not be returned - * in the DevDeregRsp message. - */ - /* - * Implementation: right now this doesn't work - * at all, because isns_msg_set_error will - * discard the entire message except for the - * status word. - */ - isns_debug_message("Failed to deregister object: %s (0x%04x)\n", - isns_strerror(status), status); - - isns_object_extract_all(obj, &reply->is_operating_attrs); - dereg_status = status; - continue; - } - - /* - * 5.7.5.4 - * If all Nodes and Portals associated with a Network - * Entity are deregistered, then the Network Entity - * SHALL also be removed. - * [...] - * If both the Portal and iSCSI Storage Node objects - * associated with a Portal Group object are removed, - * then that Portal Group object SHALL also be removed. - * The Portal Group object SHALL remain registered - * as long as either of its associated Portal or - * iSCSI Storage Node objects remain registered. If a - * deleted Storage Node or Portal object is subsequently - * re-registered, then a relationship between the re- - * registered object and an existing Portal or Storage - * Node object registration, indicated by the PG object, - * SHALL be restored. - */ - /* isns_db_remove takes care of removing dead entities, - * and dead portal groups. - */ - } - - if (status == ISNS_SUCCESS) - status = dereg_status; - -done: - isns_object_list_destroy(&objects); - *result = reply; - return status; -} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/doc/isnsadm.8 open-iscsi-2.0.874/utils/open-isns/doc/isnsadm.8 --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/doc/isnsadm.8 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/doc/isnsadm.8 1970-01-01 00:00:00.000000000 +0000 @@ -1,672 +0,0 @@ -'\" t -.TH ISNSADM 8 "11 May 2007" -.SH NAME -isnsadm \- iSNS client utility -.SH SYNOPSIS -.B isnsadm -.RI [ options... ] -.RI --register " object... -.PP -.B isnsadm -.RB [ ... ] -.RI --query " attr" [= value ] -.PP -.B isnsadm -.RB [ ... ] -.RI --deregister " attr=value -.PP -.B isnsadm -.RB [ ... ] -.RI --list " type attr=value -.PP -.B isnsadm -.RB [ ... ] -.RI --dd-register " attr=value -.PP -.B isnsadm -.RB [ ... ] -.RI --enroll " client-name attr=value -.PP -.B isnsadm -.RB [ ... ] -.RI --edit-policy " attr=value - -.SH DESCRIPTION -.B Isnsadm -is a command line utility for interacting with an iSNS -server. It operates in one of several modes, which are -mutually exclusive. -Currently, -.B isnsadm -supports registration, query, and deregistration. -.SH OPTIONS -By default, -.B isnsadm -will take most of its settings from the configuration -file -.BR /etc/isns/isnsadm.conf , -with the exception of the following options: -.TP -.BI \--config " filename\fR, " \-c " filename -This option overrides the default configuration file. -.TP -.BI \--debug " facility\fR, " \-d " facility -enables debugging. Valid facilities are -.PP -.TS -tab(,),box,center; -lb|lr. -socket,network send/receive -auth,authentication and security related information -message,iSNS protocol layer -state,database state -scn,SCN (state change notification) messages -esi,ESI (entity status inquiry) messages -all,all of the above -.TE -.PP -.TP -.BI \--local -makes -.B isnsadm -use a Local (aka Unix) socket when talking to the iSNS -server. This can be used by the administrator to perform -management tasks, such as enrolling new clients, editing -access control and so on. Local mode is only available -to the super user. -.TP -.BI \--control -makes -.B isnsadm -assume the identity of a control node. Control nodes are -special in that they have more rights in accessing and -modifying the database than normal storage nodes have. -.PP -When using this option, -.B isnsadm -will use the source name and DSA key specified by the -.BR Control.SourceName " and " Control.AuthKeyFile -configuration options, respectively. -.PP -.TP -.BI \--key " attr" = value -This option is recognized in registration mode only, and -lets you specify an object key. For a more detailed explanation, -refer to section -.BR "Registration mode" . -.TP -.BI \--keyfile= filename -When creating a policy for a new iSNS client, -.B isnsadm -is able to generate a DSA key for the client. The public -part of the key is stored in a policy object in the iSNS -server's database, whereas the private portion is stored in the -file specified by the -.B keyfile -option. -.B -.TP -.BI \--help -This will print a help message and exit. -.\"--------------------------- -.SS Built-in help -.B Isnsadm -has built-in help functions. When invoked with -.BR \--help , -it will print a general help message showing all supported -command modes, and exit. Specific help on an individual -command mode is available by invoking that mode with a -single argument of -.BR help , -like this: -.PP -.B isnsadm --register help -.PP -This will print a help message describing how to use this -command mode, followed by a list of attributes this command supports -and a help text describing the attribute. -.\"--------------------------- -.SS Supported attributes -Most command modes take a list of attributes as arguments on the -command line. The naming and syntax of these attributes as -the same for all commands modes, however certain modes support -only a limited set of attributes. -.PP -Attributes are usually given as -.IB name = value -pairs. Where empty (or NIL) attributes are supported, the -attribute name by itself can be given. -.PP -The syntax of attribute -.I value -depends on the attribute type. For strings and numeric values, -no special conventions apply, but bitfields have a special syntax -described below. -.PP -The attribute name is usually preceded by the object -type it applies to (such as -.BR entity ), -followed by a hyphen and the name itself. However, where the -context clearly determines a specific object type, the prefix -can be omitted. For instance, when editing a policy object -using -.BR \--edit-policy , -it is acceptable to use -.B node-type -as shorthand for -.BR policy-node-type . -.PP -Likewise, in a query command, it is not permitted to mix attributes -from different object types. Thus, the first attribute of a -query string establishes a type context, so that the following -two invocations are equivalent: -.PP -.B isnsadm --query pg-name=iqn.com.foo pg-addr=10.1.1.1 pg-port=860/tcp -.br -.B isnsadm --query pg-name=iqn.com.foo addr=10.1.1.1 port=860/tcp -.PP -.B Isnsadm -currently supports the following attributes: -.PP -.TS -tab(,),box,center; -li|lilili -lt|lbrlb. -Context,Attribute,iSNS tag,Aliases -_ -Network Entity,entity-id,1,eid -\^,entity-prot,2 -\^,entity-index,7 -iSCSI Storage Node,iscsi-name,32 -\^,iscsi-node-type,33 -\^,iscsi-alias,34 -\^,iscsi-idx,36 -\^,iscsi-authmethod,42 -Portal,portal-addr,16 -\^,portal-port,17 -\^,portal-name,18 -\^,portal-esi-port,20 -\^,portal-esi-interval,21 -\^,portal-idx,22 -\^,portal-scn-port,23 -Portal Group,portal-group-index,52 -\^,pg-name,48 -\^,pg-addr,49 -\^,pg-port,50 -\^,pg-tag,51,pgt -\^,pg-idx,52 -Discovery Domain,dd-id,2065 -\^,dd-name,2066 -\^,dd-member-iscsi-idx,2067 -\^,dd-member-name,2068 -\^,dd-member-fc-name,2069, -\^,dd-member-portal-idx,2070, -\^,dd-member-addr,2071, -\^,dd-member-port,2072, -\^,dd-features,2078, -Policy Object,policy-name,-,spi -\^,policy-key,- -\^,policy-entity,- -\^,policy-node-type,- -\^,policy-object-type,- -\^,policy-functions,- -.TE -.PP -.\"--------------------------- -.SS Portal attributes -Portal information is conveyed by two separate attributes -in iSNS; an address attribute holding the IP address, and -a TCP/UDP port attribute holding the port number and an indication -of the protocol to be used (TCP or UDP). -.PP -When parsing a TCP/UDP port, Open-iSNS will expect a port number, -optionally followed by a slash and the protocol. Port names -such as "iscsi-target" are not supported. -.PP -As a convenience, -.B isnsadm -supports a notation representing a portal as one pseudo-attribute. -Separating address and port by a colon. Thus, the following two -are equivalent, with the latter being the shorthand representation -of the former: -.PP -.BI addr=
" port=" [/ protocol ] \fR. -.BI portal= : port [/ protocol ] -.PP -This notation can be used in any context where an -.BR addr / port -attribute pair can appear, and may be prefixed by a type name, -as in -.BR pg-portal=... . -.PP -When using literal IPv6 addresses, the address has to be surrounded -by square brackets, otherwise the embedded colons would create -ambiguity: -.BR portal=[2001:5c0:0:2::24]:860/tcp -.PP -.\"--------------------------- -.SS Bitfield attributes -Some iSNS attributes are words representing a bit field. -.B Isnsadm -displays and parses these attributes in human-readable form -rather than using the numerical value. The names of the bit -values are displayed by built-in help facilities. When specifying -a bitfield attribute on the command line, you can combine them -using the plus (\fB+\fP) or comma (\fB,\fR) character, like this: -.PP -.B node-type=control+initiator -.PP -.\"--------------------------- -.SS Registration mode -Registration mode is selected by using the -.B --register -option, followed by a list of one or more objects -to register with the iSNS server. -By default, this will create a network entity for the -client (if none exists), and place the new objects inside -it. Usually, you register all objects for -a network entity in one operation, rather than each -one separately. -.PP -Each object is specified as a type, optionally followed -by a comma-separated list of attributes, such as -this: -.PP -.B target=iqn.2005-01.org.open-iscsi.foo:disk1,alias=disk1 -.PP -The following object types are currently supported: -.TP -.BI entity= name -Tells the server to group all objects in the specified -Network Entity container object. -Normally, the iSNS server will automatically assign an -entity name that is in line with its policies, and there is -no need to specify it explicitly. -.TP -.BI initiator[= name ] -This will register an iSCSI storage node of type initiator. -By default, the name is set to the iSNS source name. -.IP -This can be followed by any number of iSCSI storage node -attributes. -.TP -.BI target[= name ] -This will register an iSCSI storage node of type target. -By default, the name is set to the iSNS source name. -.IP -This object accepts the same set of attributes as -.BR initiator . -.TP -.BI control[= name ] -This will register an iSCSI storage node of type control. -By default, the name is set to the iSNS source name. -Only management nodes should be registered as control -nodes, as this gives a node complete control over the -iSNS database. -.IP -This object accepts the same set of attributes as -.BR initiator . -.TP -.BI portal=[ address:port/proto ] -This will register a portal using the given address, -port and protocol triple. If the triple is omitted, -.B isnsadm -will use the client host's IP address. If the portal -is preceded by an initiator registration (on the command -line), the port defaults to 860/tcp; if it is preceded by -a target registration, the port defaults to 3260/tcp. -For multi-homed hosts, the choice of address is -implementation dependant. -.IP -This can be followed by any number of portal attributes. -.TP -.B pg -This will register a portal group joining the preceding -portal and node. Portal groups can be used to describe -the preferred portals for a given node; please refer -to RFC 4711 for details. -.IP -This can be followed by any number of portal group attributes. -The attribute list must specify a portal group tag (PGT) -via the -.BR pgt -attribute. -.PP -There are two additional command line options of interest, -which are used exclusively with Registration mode. One is -.BR \--replace . -Normally, registration mode will -.I add -new objects to the network entity associated with the client -host. If you specify -.B \--replace -on the command line, the server will wipe the network -entity completely, and remove all portals and storage -nodes it contained. Then it will create a new network -entity, and place the portals and storage nodes provided -by the caller inside. -.PP -In addition, it is possible to replace just parts of a -network entity. This is achieved by using the command line -option -.B \--key -to specify the object that should be replaced. -.PP -For instance, assume a network entity -contains the portal -.BR 10.1.1.1:860 , -and the client's network address changed to -.BR 10.2.7.7 . -Then the following command will atomically update the -database, replacing just the portal without touching the -registered storage nodes: -.PP -.B " isnsadm --replace --key portal=10.1.1.1:860 portal=10.2.7.7:860 -.PP -The -.B \--key -option recognizes only a subset of the usual attributes: -.RS -.TS -tab(,),box; -li|li -lb|lb. -Object type,Syntax -_ -Entity,eid=\fIidentifier -Portal,portal=\fIaddress\fP:\fPport -iSCSI Node,iscsi-name=\fIname -.TE -.RE -.PP -To get a list of supported attributes, invoke -.BR "isnsadm --register help" . -.\"--------------------------- -.SS Query mode -Query mode is selected by using the -.B --query -option. A query consists of a list of -.BR attr = \fI value -pairs. All attributes must belong to the same object type, -i.e. queries that mix a Network Entity attribute with e.g. -a Portal attribute will be rejected. -.PP -It is also possible to specify an attribute name without -value (i.e. just -.BR attr ), -which will -will match any object that has such an attribute, regardless -of its value. This is useful when you want to query for all -objects of a given type. -.PP -To obtain a list of supported attributes, invoke -.BR "isnsadm --query help" . -.\"--------------------------- -.SS List Mode -In this mode, -.B isnsadm -will display all objects of a given type, optionally -restricted to those matching certain attribute values. -.PP -The arguments to list mode are a -.IR "type name" , -optionally followed by one or more -.IB attr = value -pairs. Only attributes pertaining to the given -type are permitted; for instance, if you specify a -type name of -.BR portals , -only portal attributes are permitted. -.PP -Possible type names are: -.BR entities , -.BR nodes , -.BR portals , -.BR dds , -.BR ddsets , -.BR portal-groups ", and " -.BR policies . -.PP -Additional information is available via -.BR "isnsadm --list help" . -.\"--------------------------- -.SS Deregistration mode -In this mode, you can deregister objects previously registered. -Only the node which registered an entity in the first place is -permitted to remove it, or any of its child objects. (Control -nodes are not bound by this restriction). -.PP -In deregistration mode, the argument list consists of a list of -.IB attr = value -pairs. Deregistration supports the same set of attributes as -query mode. -.\"--------------------------- -.SS Discovery Domain Registration -This mode, allows to register a discovery domain or to add -new members to an existing discovery domain. Again, attributes -are specified as a list of -.IB attr = value -pairs. Only discovery domain attributes are recognized. -.PP -Note, in order to add members to an existing domain, you must -specify the domain's numeric ID. The domain's symbolic name -is not a valid handle when referring to a discovery domain. -.\"--------------------------- -.SS Client Enrollment -This mode only works when the server recognizes the client -as having control node capabilities, which is possible in -two ways: -.TP -Invoke -.B isnsadm \--local -as super user on the host -.B isnsd -is running on. The -.B \--local -options tells it to communicate with the server through -the local control socket. -.TP -Invoke -.BR "isnsadm \--control" , -which tells it to assume the identity of a control node. -When given this option, -.B isnsadm -will use the source name and DSA key specified by the -.BR Control.SourceName " and " Control.AuthKeyFile -configuration options, respectively. -The server must be configured to grant this identity -control node status. -.PP -To enroll a client, use the -.B \--enroll -option, followed by the (source) name of the client to enroll. -This string will be used as the name of the security policy -the client will use to identify itself. -.PP -This is followed by a list of attribute/value pairs, where the -following set of attributes is supported: -.PP -.TS -tab(,),box,center; -li|lilili -lb|lrlb. -Attribute,Description,Aliases -_ -name,Policy Name,spi -key,Client's DSA public key -entity,Assigned Entity Identifier -node-type,Permitted node type(s) -node-name,Permitted node name(s) -functions,Bitmap of permitted functions -object-type,Object access mask -.TE -.PP -The -.B key -attribute is used to specify the DSA -public key that the server should use to authenticate -messages from this client. You can either provide a -file name; in which case -.B isnsadm -will try to read the PEM encoded public key from that file. -If no -.B key -attribute is given, or when using -.BR key=gen ", " isnsadm -will generate a DSA key. The private portion of the newly -generated key will be stored in the file specified by -.BI --keyfile= filename \fR. -.PP -The -.B object-type -attribute is used to specify which object types the client -is permitted to access. This is a comma separated list of -.IB type : perm -pairs, where -.I type -can be any of -.BR entity ", " iscsi-node ", " portal ", " portal-group ", " dd ", " ddset ", and " policy . -The permissions can be either -.BR rw ", or " r . -.PP -The -.B functions -attribute can be used to restrict which functions the client is -permitted to invoke. This is a bitfield, using the standard function -names from RFC 4171, such as -.BR DevAttrReg ", " DevAttrQry ", etc." -.PP -For a description of the open-isns security model -and policies, please refer to the -.BR isns_config (5) -manual page. -.PP -.BR "Important note" : -In order to generate a DSA key, you have to have a set of DSA -parameters installed. By default, -.B isnsadm -expects to find them in -.BR /etc/isns/dsa.params . -These parameters are created by calling -.B isnsd \--init -once on the server machine. Alternatively, you can use -the following command: -.PP -.ti +8 -openssl dsaparam 1024 -out /etc/isns/dsa.params -.ti -8 -.PP -where 1024 is the chosen DSA key size, in bits. -.SH EXAMPLES -If you want to use Open-iSNS in authenticated mode, -you first need to initialize the server's DSA key and -DSA parameters. This can be done conveniently by using -.PP -.B isnsd --init -.PP -This will create the server's private and public key, -and place them in -.B /etc/isns/auth_key -and -.BR auth_key.pub , -respectively. -.PP -The following command will create a policy object for a -node named -.B isns.control , -and grant it control privileges: -.PP -.B isnsadm --local --keyfile=control.key -.B --enroll isns.control \(rs -.br -.B " node-type=ALL functions=ALL object-type=ALL -.PP -In the process of entrolling the client, this will generate -a DSA key pair, and place the private key portion in the -file -.BR control.key . -This file must be installed as -.BR /etc/isns/control.key -on the host you wish to use as an iSNS management station. -.PP -Next, you need to create a storage node object for the -management station: -.PP -.B isnsadm --local --register control -.PP -On the management station, you can then enroll additional -hosts: -.PP -.B isnsadm --control --keyfile=somehost.key -.B --enroll iqn.2005-01.org.open-iscsi.somehost \(rs -.br -.B " node-type=target+initiator -.PP -Again, this will generate a DSA key pair and store the private -key portion in auth_key. Note the use of the -.B \--control -option that tells -.B isnsadm -to use the identity of the control node instead of the default -key and source name. -.PP -You then need to copy -.B somehost.key -to the client host and install it as -.BR /etc/isns/auth_key . -Likewise, the server's public key (which resides in -.BR /etc/isns/auth_key.pub -on the server) needs to be copied to the client machine, -and placed in -.BR /etc/isns/server_key.pub . -.PP -By default, when a client registers a storage node (be -it initiator or target) with iSNS, the client will not be -able to see any other storage nodes. In order for targets -to be visible to a given initiator, you need to create -so-called Discovery Domains (or DDs for short). -.PP -Currently, domain membership operations require administrator -privilege. Future extensions may allow iSNS clients to -add themselves to one or more DDs upon registration. -.PP -To create a discovery domain, and add nodes to it, you can -use -.PP -.B isnsadm --control --dd-register dd-name=mydomain \(rs -.br -.B " member-name=iqn.org.bozo.client iqn.org.bozo.jbod ... -.PP -In order to add members to an existing DD, you have to -specify the numeric domain ID - using the DD name is not -sufficient, unfortunately (this is a requirement of the -RFC, not an implementation issue): -.PP -.B isnsadm --control --dd-register dd-id=42 \(rs -.br -.B " member-name=iqn.com.foo member-name=iqn.com.bar -.PP -The DD ID can be obtained by doing a query for the DD name: -.PP -.B isnsadm --control --query dd-name=mydomain -.PP -In management mode, you can also register and deregister -nodes and portals manually, in case you want to fix up -an inconsisteny in the database. For instance, this will -register a node and portal on a host named client.bozo.org: -.PP -.B isnsadm --control --register entity=client.bozo.org \(rs -.br -.B " initiator=iqn.org.bozo.client portal=191.168.7.1:860 -.PP -Note that this registration explicitly specifies the network -entity in which to place the new objects. If you omit this, -the new objects will be placed in an entity named -.BR CONTROL , -which is decidedly not what you want. -.SH SEE ALSO -RFC 4171, -.BR isnsd (8), -.BR isns_config (5). -.SH AUTHORS -Olaf Kirch diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/doc/isns_config.5 open-iscsi-2.0.874/utils/open-isns/doc/isns_config.5 --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/doc/isns_config.5 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/doc/isns_config.5 1970-01-01 00:00:00.000000000 +0000 @@ -1,387 +0,0 @@ -.TH ISNS_CONFIG 8 "11 May 2007" -.SH NAME -isns_config - iSNS configuration file -.SH SYNOPSIS -.B /etc/isns/isnsadm.conf -.br -.B /etc/isns/isnsd.conf -.br -.B /etc/isns/isnsdd.conf - -.SH DESCRIPTION -All Open-iSNS utilities read their configuration -from a file in -.BR /etc/isns . -There is a separate configuration file for each application, -.BR isnsd ", " isnsadm ", and " isnsdd . -The syntax and the set of supported options is identical, -even though some options are specific to e.g. the server. -Unless indicated, options are applicable to all utilities. -.PP -An Open-iSNS configuration file contains keyword-argument pairs, -one per line. All keywords are case insensitive. -.PP -A -.B # -character introduces a comment, which extends until the -end of the line. Empty lines are ignored. -.PP -There are no line continuations, and you cannot use quotes -around arguments. -.PP -Some options specify timeout values, which are given in -units of seconds by default. You can specify an explicit -unit, however, such as -.BR d " (days), -.BR h " (hours), -.BR m " (minutes), or -.BR s " (seconds). -.\" ------------------------------------------------------------------ -.SS Generic Options -.TP -.BR HostName -By default, Open-iSNS applications will retrieve the machine's -hostname using the -.BR gethostname (3) -system call, and use a DNS lookup to look up the canonical name. -Using the -.BR HostName -option, you can overried this. This option is rarely needed. -.TP -.BR SourceName -This option is mandatory for all Open-iSNS applications. -This should be a name which identifies the client uniquely. -There are two readings of RFC 4171; one requires that this -is an iSCSI qualified name such as -.BR iqn.2001-04.com.example.host , -whereas other language in the RFC suggests that this is -pretty much a free-format string that just has to be -unique (using e.g. the client's fully qualified domain name). -.IP -When using DSA authentication, Open-iSNS currently requires the source -name to match the key identifier (SPI) of the client's public -key. -.IP -If left empty, the source name is derived from the client's hostname. -.TP -.BR ServerAddress " (client): -This options specifies the host name or address of -the iSNS server to talk to. It can optionally be followed -by a colon, and a port number. -.IP -Instead of a hostname, IPv4 or IPv6 addresses can be used. -In order to avoid ambiguities, literal -IPv6 addresses must be surrounded by square brackets, -as in -.BR [2001:4e5f::1] . -.IP -When specifying a port number, you can use either the -numeric port, or a string name to be looked up in -.BR /etc/services . -When the port is omitted, it defaults to 3205, the IANA -assigned port number of iSNS. -.IP -If the special string -.B SLP: -is used, the client will try to locate the iSNS server -through SLP. -.TP -.BR SLPRegister " (server): -If set to 1, the iSNS daemon will register itself will -the SLP service. This allows clients to contact the -server without having to configure its address -statically. -.TP -.BR PIDFile " (server): -This specifies the name of the server's PID file, which is -.B /var/run/isnsd.pid -by default. -.\" ------------------------------------------------------------------ -.SS Database Related Options -These options apply to the iSNS server only, and control operation -of the iSNS database. -.TP -.BR Database -This option is used to specify how the database is stored. -Setting this to an absolute path name will make -.B isnsd -keep its database in the specified directory. -.IP -If you leave this empty, -.B isnsd -will keep its database in memory. -This is also the default setting. -.TP -.BR DefaultDiscoveryDomain -iSNS scopes visibility of other nodes using so-called -Discovery Domains. A storage node A will only "see" -storage node B, if both are members of the same -discovery domain. -.IP -So if a storage node is registered which is not part of -any discovery domain, it will not see any other nodes. -.IP -By setting -.BR DefaultDiscoveryDomain=1 , -you can tell isnsd to create a virtual "default discovery domain", which -holds all nodes that are not part of any administratively configured -discovery domain. -.IP -By default, there is no default discovery domain. -.TP -.BR RegistrationPeriod -The iSNS server can purge registered entities after a certain period -of inactivity. This is called the registration period. Clients who -register objects are supposed to refresh their registration within -this period. -.IP -The default value is 1 hour. Setting it to 0 disables expiry -of entities from the database. -.TP -.BR ESIRetries -Open-iSNS is able to monitor the reachability of storage nodes -and their portals by using a protocol feature called ESI -(Entity status inquiry). Clients request ESI monitoring by -registering an ESI port along with each portal. The server -will send ESI messages to these portals at regular intervals. -If the portal fails to reply several times in a row, it is -considered dead, and will be removed from the database. -.IP -.B ESIRetries -specifies the maximum number of attempts the server will make -at contacting the portal before pronouncing it dead. If set -to 0, the server will disable ESI and reject any registrations -that specify an ESI port with an error code of "ESI not -supported". -.IP -The default value is 3. -.TP -.BR ESIMinInterval -This timeout value specifies the minimum ESI interval. -If a client requests an ESI interval less than this value, -it is silently rounded up. -.IP -The default value is 60 seconds. -.TP -.BR ESIMaxInterval -This timeout value specifies the maximum ESI interval. -If a client requests an ESI interval greater than this value, -it is silently rounded down. -.IP -The default value is 10 minutes. -.IP -The maximum ESI interval must not exceed half the value -of the registration period. -.TP -.B SCNRetries -iSNS clients can register to receive State Change Notification -(SCN) messages to learn about changes in the iSNS database. -This value specifies how often the server will try to retransmit -an SCN message until giving up. -.IP -The default value is 3. -.TP -.B SCNCallout -This is the path name of a helper program that -.B isnsdd -will invoke whenever it processes a state change notification from the -server. The helper program will be invoked with an argument indicating -the type of event, being one of -.BR add ", " update ", or " remove . -This is followed by a list of attributes in -.IB name = value -notation, using the names and conventions described in -.BR isnsadm (8). -.\" ------------------------------------------------------------------ -.SS Security Related Options -The iSNS standard defines an authentication method based on -the DSA algorithm. Participants in a message exchange authenticate -messages by adding an "authentication block" containing a time stamp, -a string identifying the key used, and a digital signature of the -message. The same method is also used by SLP, the Service Location -Protocol. -.PP -The string contained in the authentication block is referred to -as the -.IR "Security Policy Index" (SPI). -This string can be used by the server to look up the client's public -key by whatever mechanism; so the string could be used as the name of -a public key file in a directory, or to retrieve an X509 certificate -from LDAP. -.PP -From the perspective of Open-iSNS client applications, there are -only two keys: the client's own (private) key, used to sign the -messages it sends to the server, and the server's public key, -used to verify the signatures of incoming server messages. -.PP -The iSNS server needs, in addition to its own private key, access to all -public keys of clients that will communicate to it. The latter are kept -in what is called a key store. Key stores and their operation will -be discussed in section -.B Key Stores and Policy -below. -.PP -The following configuration options control authentication: -.TP -.BR Security -This enables or disables DSA authentication. -When set to 1, the client will sign all messages, and expect all server -messages to be signed. -.IP -When enabling security in the server, incoming messages are checked -for the presence of an auth block. If none is present, or if the server -cannot find a public key corresponding to the SPI, the message is treated -as originating from an anonymous source. If the SPI is known but the -signature is incorrect, the message is dropped silently. -.IP -Messages from an anonymous source will be assigned a very restrictive -policy that allows database queries only. -.IP -Setting this option to 0 will turn off authentication. -.IP -The default value is -1, which tells iSNS to use authentication -if the required keys are installed, and use unauthenticated iSNS -otherwise. -.TP -.BR AuthName -This is the string that will be used as the SPI in all outgoing -messages that have an auth block. It defaults to the host name -(please refer to option -.BR HostName ). -.TP -.BR AuthKeyFile -This is the path name of a file containing a PEM encoded DSA key. -This key is used to sign outgoing messages. -The default is -.BR /etc/isns/auth_key . -.TP -.BR ServerKeyFile -This option is used by client applications only, and specifies -the path name of a file containing a PEM encoded DSA key. -This key is used to authenticate the server's replies. -The default is -.BR /etc/isns/server_key.pub . -.TP -.BR KeyStore -This server-side option specifies the key store to use, -described in the next section. -.PP -The following two options control how iSNS will verify the -time stamp contained in the authentication block, which -is supposed to prevent replay attacks. -.TP -.B Auth.ReplayWindow -In order to compensate for clock drift between two hosts exchanging -iSNS messages, Open-iSNS will apply a little fuzz when comparing -the time stamp contained in the message -to the local system time. If the difference between -time stamp and local system time is less than the number of seconds -given by this option, the message is acceptable. Otherwise, it is -rejected. -.IP -The default value is -.BR 5m . -.TP -.B Auth.TimestampJitter -When verifying incoming messages, Open-iSNS checks that the time -stamps sent by the peer are increasing monotonically. In order to -compensate for the reordering of messages by the network (eg when -using UDP as transport), a certain time stamp jitter is accepted. -If the time stamp of an incoming messages is no earlier than -.B TimestampJitter -seconds before the last time stamp received, then the message is acceptable. -Otherwise, it is rejected. -.IP -The default value is -.BR 1s . -.\" ------------------------------------------------------------------ -.SS Key Stores and Policy -The current implementation supports two types of key stores. -.PP -The simple key store uses a flat directory to store public keys, each -key in a file of its own. The file is expected to hold the client's -PEM-encoded public key, and it must use the client's SPI as the name. -This type of key store is not really recommended, as it does not -store any policy information. -.PP -A simple key store can be configured by setting the -.B KeyStore -option to the path name of the directory. -.PP -The recommended approach is to use the database as key store. This -uses vendor-specific policy objects to tie SPI string, public key, -entity name, source name and other bits of policy together, and -store them in a persistent way. -.PP -The database key store is configured by setting the -.B KeyStore -option to the reserved value -.BR DB: , -which is also the default. -.PP -Currently, Open-iSNS policy objects have the following attributes, -besides the SPI: -.TP -Source: -This is the source node name the client must use. It defaults to -the SPI string. -.TP -Functions: -This is a bitmap detailing which functions the client is permitted -to invoke. The bit names correspond to the shorthand names used in -RFC 4711, such as -.BR DevAttrReg , -.BR DevAttrQry , -etc. The default is to allow registration, query and deregistration, -as well as SCNRegister. -.TP -Entity name: -This is the entity name assigned to the client. If set, a registration -by the client is not permitted to use a different entity name. If -the client sends a registration without Entity identifier, the -server will assign the entity name given in the policy. -The default is to not restrict the entity name. -.TP -Object access: -This is a bitfield describing access permissions for each object type. -For each object type, you can grant Read and/or Write permissions. -Read access applies to the Query and GetNext calls; all other operations -require write permission. -The default grants read and write access to objects of type Entity, Storage -Node, Portal and Portal Group; and read access to Discovery Domains. -.TP -Node types: -This bitfield describes which types of storage nodes a client is -allowed to register; the valid bit names are -.BR target ", " initiator " and " control . -The default is to restrict nodes to register initiators only. -.\" ------------------------------------------------------------------ -.SS Network Related Options -.TP -.BR Network.MaxSockets -This is the number of incoming connections accepted, and defaults to -1024. This usually applies to server side only, but is relevant if you -create a passive TCP socket for ESI or SCN. -.TP -.BR Network.ConnectTimeout -This is a timeout value, which specifies the time to wait for a TCP -connection to be established. It defaults to -.BR 60s . -.TP -.BR Network.ReconnectTimeout -When a connection attempt failed, we wait for a short time before we -try connecting again. This is intended to take the pressure off -overloaded servers. The default value is -.BR 10s . -.TP -.BR Network.CallTimeout -Total amount of time to wait before timing out a call to the iSNS server. -The default value is -.BR 60s . -.\" ------------------------------------------------------------------ -.SH SEE ALSO -RFC 4171, -.BR isnsd (8), -.BR isnsadm (8). -.SH AUTHORS -Olaf Kirch diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/doc/isnsd.8 open-iscsi-2.0.874/utils/open-isns/doc/isnsd.8 --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/doc/isnsd.8 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/doc/isnsd.8 1970-01-01 00:00:00.000000000 +0000 @@ -1,93 +0,0 @@ -.TH ISNSD 8 "11 May 2007" -.SH NAME -isnsd \- iSNS server daemon -.SH SYNOPSIS -.B isnsd -.RB [ "\-f" ] -.RB [ "\-4" ] -.RB [ "\-6" ] -.RB [ "\-c \fIfilename" ] -.RB [ "\-d \fIdebug-facility" ] -.RB [ \--dump-db ] -.RB [ \--init ] - -.SH DESCRIPTION -.B Isnsd -implements the iSNS protocol as defined in RFC 4171. -iSNS is a discovery protocol for iSCSI and iFCP. -.SH OPTIONS -By default, -.B isnsd -will take most of its settings from the configuration -file -.BR /etc/isns/isnsd.conf , -with the exception of the following options: -.TP -.BI \--config " filename\fR, " \-c " filename -This option overrides the default configuration file. -.TP -.BR \--foreground , \-f -By default, -.B isnsd -will put itself into the background. By specifying this option, you can -tell it to run in the foreground. Any error messages or debug output -will be printed to the console rather than being sent to syslog. -.TP -.BI \-4 -tells -.B isnsd -to create an IPv4 socket only. Normally, it defaults -to IPv6 (which will accept both IPv4 and IPv6 connections). -.TP -.BI \-6 -tells -.B isnsd -explicitly -to create an IPv6 socket only. Since it defaults -to IPv6 anyway, this is really a no-op. -.TP -.BI \--debug " facility\fR, " \-d " facility -enables debugging. Valid facilities are -.PP -.TS -tab(,),box,center; -lb|lr. -socket,network send/receive -auth,authentication and security related information -message,iSNS protocol layer -state,database state -scn,SCN (state change notification) messages -esi,ESI (entity status inquiry) messages -all,all of the above -.TE -.PP -.TP -.B \--dump-db -This is a helper function that will read the database from the -file system, and display it in human readable form. When using -this option, -.B isnsd -will not open any sockets, and terminate immediately after display -the database. -.IP -This option is intended to be used by the administrator when suspecting -that the database contains bad/inconsistent information. -.TP -.B \--init -This option will create the server's authentication key, and -the required DSA parameters. The private key is stored in the -file specified by the -.B AuthKey -option (usually -.BR /etc/isns/auth_key ). -The public portion of the key is written to same directory, -with the suffix -.B .pub -appended to the key file name. -.SH SEE ALSO -RFC 4171, -.BR isnsadm (8), -.BR isnsdd (8), -.BR isns_config (5). -.SH AUTHORS -Olaf Kirch diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/doc/isnsdd.8 open-iscsi-2.0.874/utils/open-isns/doc/isnsdd.8 --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/doc/isnsdd.8 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/doc/isnsdd.8 1970-01-01 00:00:00.000000000 +0000 @@ -1,75 +0,0 @@ -.TH ISNSDD 8 "11 May 2007" -.SH NAME -isnsdd \- iSNS discovery daemon -.SH SYNOPSIS -.B isnsdd -.RB [ "\-f" ] -.RB [ "\-c \fIfilename" ] -.RB [ "\-d \fIdebug-facility" ] - -.SH DESCRIPTION -.B Isnsdd -is a client side daemon for iSNS. It registers storage -nodes and portals with the iSNS service, and refreshes -these registrations in a timely manner. -.PP -The daemon also registers itself to receive SCN notifications, -and processes these. It can be configured to invoke an -external helper application for each status notification -received. The path name of the helper application can be -specified via the -.B SCNCallout -option in the configuration file. -.SH OPTIONS -By default, -.B isnsd -will take most of its settings from the configuration -file -.BR /etc/isns/isnsdd.conf , -with the addition of the following command line options: -.TP -.BI \--config " filename\fR, " \-c " filename -This option overrides the default configuration file. -.TP -.BR \--foreground , \-f -By default, -.B isnsd -will put itself into the background. By specifying this option, you can -tell it to run in the foreground. Any error messages or debug output -will be printed to the console rather than being sent to syslog. -.TP -.BI \--role " role -This tells the discovery daemon in which capacity is should register itself -with the iSNS server. -.I Role -can be either -.BR initiator ", or " control . -The default is to register as an initiator. -.IP -Registering target nodes needs to use a different mechanism, as -the iSCSI target server needs to inform the discovery daemon -about each exported target separately. This is not implemented -yet. -.TP -.BI \--debug " facility\fR, " \-d " facility -enables debugging. Valid facilities are -.PP -.TS -tab(,),box,center; -lb|lr. -socket,network send/receive -auth,authentication and security related information -message,iSNS protocol layer -state,database state -scn,SCN (state change notification) messages -esi,ESI (entity status inquiry) messages -all,all of the above -.TE -.PP -.SH SEE ALSO -RFC 4171, -.BR isnsd (8), -.BR isnsadm (8), -.BR isns_config (5). -.SH AUTHORS -Olaf Kirch diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/domain.c open-iscsi-2.0.874/utils/open-isns/domain.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/domain.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/domain.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,208 +0,0 @@ -/* - * iSNS object model - discovery domain specific code - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include -#include -#include -#include "isns.h" -#include "objects.h" -#include "util.h" - -static int -__isns_default_dd_rebuild(isns_object_t *obj, isns_db_t *db) -{ - isns_object_list_t list = ISNS_OBJECT_LIST_INIT; - unsigned int i; - - isns_object_prune_attrs(obj); - - isns_db_get_domainless(db, &isns_iscsi_node_template, &list); - for (i = 0; i < list.iol_count; ++i) { - isns_object_t *node = list.iol_data[i]; - const char *name; - uint32_t type; - - if (!isns_object_get_uint32(node, - ISNS_TAG_ISCSI_NODE_TYPE, - &type)) - continue; - if (type & ISNS_ISCSI_CONTROL_MASK) - continue; - if (!isns_object_get_string(node, - ISNS_TAG_ISCSI_NAME, - &name)) - continue; - isns_object_set_string(obj, - ISNS_TAG_DD_MEMBER_ISCSI_NAME, - name); - } - - return ISNS_SUCCESS; -} - -/* - * Create the default domain - */ -isns_object_t * -isns_create_default_domain(void) -{ - isns_object_t *obj; - - obj = isns_create_object(&isns_dd_template, NULL, NULL); - if (!obj) - return NULL; - - isns_object_set_uint32(obj, ISNS_TAG_DD_ID, 0); - obj->ie_rebuild = __isns_default_dd_rebuild; - return obj; -} - -/* - * Check object type - */ -int -isns_object_is_dd(const isns_object_t *obj) -{ - return ISNS_IS_DD(obj); -} - -int -isns_object_is_ddset(const isns_object_t *obj) -{ - return ISNS_IS_DDSET(obj); -} - -/* - * Keep track of DD membership through a bit vector - */ -int -isns_object_mark_membership(isns_object_t *obj, uint32_t id) -{ - if (!obj->ie_membership) - obj->ie_membership = isns_bitvector_alloc(); - - return isns_bitvector_set_bit(obj->ie_membership, id); -} - -int -isns_object_test_membership(const isns_object_t *obj, uint32_t id) -{ - if (!obj->ie_membership) - return 0; - - return isns_bitvector_test_bit(obj->ie_membership, id); -} - -int -isns_object_clear_membership(isns_object_t *obj, uint32_t id) -{ - if (!obj->ie_membership) - return 0; - - return isns_bitvector_clear_bit(obj->ie_membership, id); -} - -/* - * Check whether the two objects share a discovery domain, - * and if so, return the DD_ID. - * Returns -1 otherwise. - */ -int -isns_object_test_visibility(const isns_object_t *a, const isns_object_t *b) -{ - /* The admin can tell isnsd to put all nodes which are *not* - * in any discovery domain, into the so-called default domain */ - if (isns_config.ic_use_default_domain - && a->ie_template == b->ie_template - && isns_bitvector_is_empty(a->ie_membership) - && isns_bitvector_is_empty(b->ie_membership)) - return 1; - - return isns_bitvector_intersect(a->ie_membership, b->ie_membership, NULL) >= 0; -} - -/* - * Return all visible nodes and portals - */ -static int -__isns_object_vis_callback(uint32_t dd_id, void *ptr) -{ - isns_object_list_t *list = ptr; - - /* Get all active members */ - isns_dd_get_members(dd_id, list, 1); - return 0; -} - -void -isns_object_get_visible(const isns_object_t *obj, - isns_db_t *db, - isns_object_list_t *result) -{ - if (isns_bitvector_is_empty(obj->ie_membership)) { - /* Get all other nodes not in any DD */ - if (isns_config.ic_use_default_domain) - isns_db_get_domainless(db, - obj->ie_template, - result); - return; - } - - isns_bitvector_foreach(obj->ie_membership, - __isns_object_vis_callback, - result); -} - -/* - * Object templates - */ -static uint32_t discovery_domain_attrs[] = { - ISNS_TAG_DD_ID, - ISNS_TAG_DD_SYMBOLIC_NAME, - ISNS_TAG_DD_MEMBER_ISCSI_INDEX, - ISNS_TAG_DD_MEMBER_ISCSI_NAME, - ISNS_TAG_DD_MEMBER_FC_PORT_NAME, - ISNS_TAG_DD_MEMBER_PORTAL_INDEX, - ISNS_TAG_DD_MEMBER_PORTAL_IP_ADDR, - ISNS_TAG_DD_MEMBER_PORTAL_TCP_UDP_PORT, - ISNS_TAG_DD_FEATURES, -}; - -static uint32_t discovery_domain_key_attrs[] = { - ISNS_TAG_DD_ID, -}; - -isns_object_template_t isns_dd_template = { - .iot_name = "Discovery Domain", - .iot_handle = ISNS_OBJECT_TYPE_DD, - .iot_attrs = discovery_domain_attrs, - .iot_num_attrs = array_num_elements(discovery_domain_attrs), - .iot_keys = discovery_domain_key_attrs, - .iot_num_keys = array_num_elements(discovery_domain_key_attrs), - .iot_index = ISNS_TAG_DD_ID, - .iot_next_index = ISNS_TAG_DD_NEXT_ID, -}; - -static uint32_t dd_set_attrs[] = { - ISNS_TAG_DD_SET_ID, - ISNS_TAG_DD_SET_SYMBOLIC_NAME, - ISNS_TAG_DD_SET_STATUS, -}; - -static uint32_t dd_set_key_attrs[] = { - ISNS_TAG_DD_SET_ID, -}; - -isns_object_template_t isns_ddset_template = { - .iot_name = "Discovery Domain Set", - .iot_handle = ISNS_OBJECT_TYPE_DDSET, - .iot_attrs = dd_set_attrs, - .iot_num_attrs = array_num_elements(dd_set_attrs), - .iot_keys = dd_set_key_attrs, - .iot_num_keys = array_num_elements(dd_set_key_attrs), - .iot_next_index = ISNS_TAG_DD_SET_NEXT_ID, -}; - diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/entity.c open-iscsi-2.0.874/utils/open-isns/entity.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/entity.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/entity.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,127 +0,0 @@ -/* - * iSNS object model - network entity specific code - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include -#include -#include -#include "isns.h" -#include "objects.h" -#include "util.h" - -/* - * Create a network entity - */ -isns_object_t * -isns_create_entity(int protocol, const char *name) -{ - isns_object_t *obj; - - obj = isns_create_object(&isns_entity_template, NULL, NULL); - isns_object_set_string(obj, - ISNS_TAG_ENTITY_IDENTIFIER, - name); - isns_object_set_uint32(obj, - ISNS_TAG_ENTITY_PROTOCOL, - protocol); - - return obj; -} - -isns_object_t * -isns_create_entity_for_source(const isns_source_t *source, - const char *eid) -{ - switch (isns_source_type(source)) { - case ISNS_TAG_ISCSI_NAME: - return isns_create_entity(ISNS_ENTITY_PROTOCOL_ISCSI, eid); - - case ISNS_TAG_FC_PORT_NAME_WWPN: - return isns_create_entity(ISNS_ENTITY_PROTOCOL_IFCP, eid); - } - - return NULL; -} - -const char * -isns_entity_name(const isns_object_t *node) -{ - const isns_attr_t *attr; - - if (node->ie_attrs.ial_count == 0) - return NULL; - attr = node->ie_attrs.ial_data[0]; - if (attr->ia_value.iv_type != &isns_attr_type_string - || attr->ia_tag_id != ISNS_TAG_ENTITY_IDENTIFIER) - return NULL; - - return attr->ia_value.iv_string; - -} - -int -isns_object_is_entity(const isns_object_t *obj) -{ - return ISNS_IS_ENTITY(obj); -} - -/* - * 6.2.4. Entity Registration Timestamp - * - * This field indicates the most recent time when the Network Entity - * registration occurred or when an associated object attribute was - * updated or queried by the iSNS client registering the Network Entity. - * The time format is, in seconds, the update period since the standard - * base time of 00:00:00 GMT on January 1, 1970. This field cannot be - * explicitly registered. This timestamp TLV format is also used in - * the SCN and ESI messages. - * - * Implementer's note: we consider any kind of activity from - * the client an indication that it is still alive. - * Only exception is the pseudo-entity that holds the access control - * information; we never assign it a timestamp so it is never subject - * to expiry. - */ -void -isns_entity_touch(isns_object_t *obj) -{ - /* Do not add a timestamp to entity CONTROL */ - if (obj == NULL - || (obj->ie_flags & ISNS_OBJECT_PRIVATE) - || obj->ie_template != &isns_entity_template) - return; - isns_object_set_uint64(obj, ISNS_TAG_TIMESTAMP, time(NULL)); -} - -/* - * Object template - */ -static uint32_t entity_attrs[] = { - ISNS_TAG_ENTITY_IDENTIFIER, - ISNS_TAG_ENTITY_PROTOCOL, - ISNS_TAG_MGMT_IP_ADDRESS, - ISNS_TAG_TIMESTAMP, - ISNS_TAG_PROTOCOL_VERSION_RANGE, - ISNS_TAG_REGISTRATION_PERIOD, - ISNS_TAG_ENTITY_INDEX, - ISNS_TAG_ENTITY_ISAKMP_PHASE_1, - ISNS_TAG_ENTITY_CERTIFICATE, -}; - -static uint32_t entity_key_attrs[] = { - ISNS_TAG_ENTITY_IDENTIFIER, -}; - -isns_object_template_t isns_entity_template = { - .iot_name = "Network Entity", - .iot_handle = ISNS_OBJECT_TYPE_ENTITY, - .iot_attrs = entity_attrs, - .iot_num_attrs = array_num_elements(entity_attrs), - .iot_keys = entity_key_attrs, - .iot_num_keys = array_num_elements(entity_key_attrs), - .iot_index = ISNS_TAG_ENTITY_INDEX, - .iot_next_index = ISNS_TAG_ENTITY_NEXT_INDEX, -}; - diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/error.c open-iscsi-2.0.874/utils/open-isns/error.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/error.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/error.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,65 +0,0 @@ -/* - * iSNS error strings etc. - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include "isns.h" - -const char * -isns_strerror(enum isns_status status) -{ - switch (status) { - case ISNS_SUCCESS: - return "Success"; - case ISNS_UNKNOWN_ERROR: - return "Unknown error"; - case ISNS_MESSAGE_FORMAT_ERROR: - return "Message format error"; - case ISNS_INVALID_REGISTRATION: - return "Invalid registration"; - case ISNS_INVALID_QUERY: - return "Invalid query"; - case ISNS_SOURCE_UNKNOWN: - return "Source unknown"; - case ISNS_SOURCE_ABSENT: - return "Source absent"; - case ISNS_SOURCE_UNAUTHORIZED: - return "Source unauthorized"; - case ISNS_NO_SUCH_ENTRY: - return "No such entry"; - case ISNS_VERSION_NOT_SUPPORTED: - return "Version not supported"; - case ISNS_INTERNAL_ERROR: - return "Internal error"; - case ISNS_BUSY: - return "Busy"; - case ISNS_OPTION_NOT_UNDERSTOOD: - return "Option not understood"; - case ISNS_INVALID_UPDATE: - return "Invalid update"; - case ISNS_MESSAGE_NOT_SUPPORTED: - return "Message not supported"; - case ISNS_SCN_EVENT_REJECTED: - return "SCN event rejected"; - case ISNS_SCN_REGISTRATION_REJECTED: - return "SCN registration rejected"; - case ISNS_ATTRIBUTE_NOT_IMPLEMENTED: - return "Attribute not implemented"; - case ISNS_FC_DOMAIN_ID_NOT_AVAILABLE: - return "FC domain id not available"; - case ISNS_FC_DOMAIN_ID_NOT_ALLOCATED: - return "FC domain id not allocated"; - case ISNS_ESI_NOT_AVAILABLE: - return "ESI not available"; - case ISNS_INVALID_DEREGISTRATION: - return "Invalid deregistration"; - case ISNS_REGISTRATION_FEATURE_NOT_SUPPORTED: - return "Registration feature not supported"; - default: - break; - } - - return "Unknown iSNS status code"; -} - diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/esi.c open-iscsi-2.0.874/utils/open-isns/esi.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/esi.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/esi.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,576 +0,0 @@ -/* - * Handle ESI events - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include -#include -#include -#include "isns.h" -#include "attrs.h" -#include "objects.h" -#include "message.h" -#include "security.h" -#include "util.h" -#include "db.h" - -#define ESI_RETRANS_TIMEOUT 60 - -typedef struct isns_esi isns_esi_t; -typedef struct isns_esi_portal isns_esi_portal_t; - -struct isns_esi { - isns_list_t esi_list; - isns_object_t * esi_object; - isns_list_t esi_portals; - - unsigned int esi_update : 1; -}; - -struct isns_esi_portal { - isns_list_t esp_list; - isns_object_t * esp_object; - isns_portal_info_t esp_portal; - unsigned int esp_interval; - isns_portal_info_t esp_dest; - - isns_socket_t * esp_socket; - unsigned int esp_retries; - unsigned int esp_timeout; - time_t esp_start; - time_t esp_next_xmit; - uint32_t esp_xid; -}; - -int isns_esi_enabled = 0; -static isns_server_t * isns_esi_server = NULL; -static ISNS_LIST_DECLARE(isns_esi_list); - -static void isns_esi_transmit(void *); -static void isns_esi_sendto(isns_esi_t *, isns_esi_portal_t *); -static void isns_process_esi_response(uint32_t, int, - isns_simple_t *); -static void isns_esi_disconnect(isns_esi_portal_t *); -static void isns_esi_restart(isns_esi_portal_t *); -static void isns_esi_drop_portal(isns_esi_portal_t *, isns_db_t *, int); -static void isns_esi_drop_entity(isns_esi_t *, isns_db_t *, int); -static int isns_esi_update(isns_esi_t *); -static void isns_esi_schedule(int); -static void isns_esi_callback(const isns_db_event_t *, void *); - -void -isns_esi_init(isns_server_t *srv) -{ - if (isns_config.ic_esi_retries == 0) { - isns_debug_esi("ESI disabled by administrator\n"); - } else { - unsigned int max_interval; - - isns_register_callback(isns_esi_callback, NULL); - isns_esi_schedule(0); - - max_interval = isns_config.ic_registration_period / 2; - if (isns_config.ic_esi_max_interval > max_interval) { - isns_warning("Max ESI interval adjusted to %u sec " - "to match registration period\n", - max_interval); - isns_config.ic_esi_max_interval = max_interval; - if (isns_config.ic_esi_min_interval > max_interval) - isns_config.ic_esi_min_interval = max_interval; - } - isns_esi_server = srv; - isns_esi_enabled = 1; - } -} - -/* - * Timer callback to send out ESI messages. - */ -void -isns_esi_transmit(void *ptr) -{ - isns_db_t *db = isns_esi_server->is_db; - isns_list_t *esi_pos, *esi_next; - time_t now; - isns_object_t *obj; - time_t next_timeout; - - now = time(NULL); - next_timeout = now + 3600; - - isns_list_foreach(&isns_esi_list, esi_pos, esi_next) { - isns_list_t *esp_pos, *esp_next; - isns_esi_t *esi = isns_list_item(isns_esi_t, esi_list, esi_pos); - - if (esi->esi_update) { - esi->esi_update = 0; - if (!isns_esi_update(esi)) - continue; - } - - isns_list_foreach(&esi->esi_portals, esp_pos, esp_next) { - isns_esi_portal_t *esp = isns_list_item(isns_esi_portal_t, - esp_list, esp_pos); - - /* Check whether the portal object still exist */ - obj = esp->esp_object; - if (obj->ie_state != ISNS_OBJECT_STATE_MATURE) { - isns_esi_drop_portal(esp, db, 0); - continue; - } - - if (esp->esp_next_xmit <= now) { - if (esp->esp_retries == 0) { - isns_debug_esi("No ESI response from %s - dropping\n", - isns_portal_string(&esp->esp_dest)); - isns_esi_drop_portal(esp, db, 1); - continue; - } - - esp->esp_retries -= 1; - esp->esp_next_xmit = now + esp->esp_timeout; - isns_esi_sendto(esi, esp); - } - if (esp->esp_next_xmit < next_timeout) - next_timeout = esp->esp_next_xmit; - } - - if (isns_list_empty(&esi->esi_portals)) - isns_esi_drop_entity(esi, db, 1); - } - - isns_debug_esi("Next ESI message in %d seconds\n", next_timeout - now); - isns_esi_schedule(next_timeout - now); -} - -/* - * Send an ESI message - */ -void -isns_esi_sendto(isns_esi_t *esi, isns_esi_portal_t *esp) -{ - isns_attr_list_t attrs = ISNS_ATTR_LIST_INIT; - isns_socket_t *sock; - isns_simple_t *msg; - - /* For TCP portals, kill the TCP socket every time. */ - if (esp->esp_dest.proto == IPPROTO_TCP) - isns_esi_disconnect(esp); - - if (esp->esp_socket == NULL) { - sock = isns_connect_to_portal(&esp->esp_dest); - if (sock == NULL) - return; - - isns_socket_set_security_ctx(sock, - isns_default_security_context(0)); - /* sock->is_disconnect_fatal = 1; */ - esp->esp_socket = sock; - } - - isns_attr_list_append_uint64(&attrs, - ISNS_TAG_TIMESTAMP, - time(NULL)); - /* The following will extract the ENTITY IDENTIFIER */ - isns_object_extract_keys(esi->esi_object, &attrs); - isns_portal_to_attr_list(&esp->esp_portal, - ISNS_TAG_PORTAL_IP_ADDRESS, - ISNS_TAG_PORTAL_TCP_UDP_PORT, - &attrs); - - msg = isns_simple_create(ISNS_ENTITY_STATUS_INQUIRY, - NULL, &attrs); - if (msg == NULL) - return; - - isns_debug_esi("*** Sending ESI message to %s (xid=0x%x); %u retries left\n", - isns_portal_string(&esp->esp_dest), - msg->is_xid, esp->esp_retries); - isns_simple_transmit(esp->esp_socket, msg, - NULL, esp->esp_timeout - 1, - isns_process_esi_response); - esp->esp_xid = msg->is_xid; - isns_simple_free(msg); -} - -/* - * A new entity was added. See if it uses ESI, and create - * portals and such. - */ -static void -isns_esi_add_entity(isns_object_t *obj) -{ - isns_esi_t *esi; - - isns_debug_esi("Enable ESI monitoring for entity %u\n", obj->ie_index); - esi = isns_calloc(1, sizeof(*esi)); - esi->esi_object = isns_object_get(obj); - esi->esi_update = 1; - isns_list_init(&esi->esi_list); - isns_list_init(&esi->esi_portals); - - isns_list_append(&isns_esi_list, &esi->esi_list); -} - -/* - * Given an entity, see if we can find ESI state for it. - */ -static isns_esi_t * -isns_esi_find(isns_object_t *obj) -{ - isns_list_t *pos, *next; - - isns_list_foreach(&isns_esi_list, pos, next) { - isns_esi_t *esi = isns_list_item(isns_esi_t, esi_list, pos); - - if (esi->esi_object == obj) - return esi; - } - return NULL; -} - -/* - * Update the ESI state after an entity has changed - */ -static int -isns_esi_update(isns_esi_t *esi) -{ - isns_object_t *entity = esi->esi_object; - ISNS_LIST_DECLARE(hold); - isns_esi_portal_t *esp; - unsigned int i; - - isns_debug_esi("Updating ESI state for entity %u\n", entity->ie_index); - - isns_list_move(&hold, &esi->esi_portals); - for (i = 0; i < entity->ie_children.iol_count; ++i) { - isns_object_t *child = entity->ie_children.iol_data[i]; - isns_portal_info_t esi_portal, portal_info; - uint32_t esi_interval; - isns_list_t *pos, *next; - int changed = 0; - - if (!ISNS_IS_PORTAL(child)) - continue; - - if (!isns_portal_from_object(&portal_info, - ISNS_TAG_PORTAL_IP_ADDRESS, - ISNS_TAG_PORTAL_TCP_UDP_PORT, - child) - || !isns_portal_from_object(&esi_portal, - ISNS_TAG_PORTAL_IP_ADDRESS, - ISNS_TAG_ESI_PORT, - child) - || !isns_object_get_uint32(child, - ISNS_TAG_ESI_INTERVAL, - &esi_interval)) - continue; - - isns_list_foreach(&hold, pos, next) { - esp = isns_list_item(isns_esi_portal_t, esp_list, pos); - - if (esp->esp_object == child) { - isns_debug_esi("Updating ESI state for %s\n", - isns_portal_string(&portal_info)); - isns_list_del(&esp->esp_list); - goto update; - } - } - - isns_debug_esi("Creating ESI state for %s\n", - isns_portal_string(&portal_info)); - esp = isns_calloc(1, sizeof(*esp)); - esp->esp_object = isns_object_get(child); - isns_list_init(&esp->esp_list); - changed = 1; - -update: - if (!isns_portal_equal(&esp->esp_portal, &portal_info)) { - esp->esp_portal = portal_info; - changed++; - } - if (!isns_portal_equal(&esp->esp_dest, &esi_portal)) { - isns_esi_disconnect(esp); - esp->esp_dest = esi_portal; - changed++; - } - if (esp->esp_interval != esi_interval) { - esp->esp_interval = esi_interval; - changed++; - } - - isns_esi_restart(esp); - - isns_list_append(&esi->esi_portals, &esp->esp_list); - } - - /* Destroy any old ESI portals */ - while (!isns_list_empty(&hold)) { - esp = isns_list_item(isns_esi_portal_t, esp_list, hold.next); - - isns_esi_drop_portal(esp, NULL, 0); - } - - /* If the client explicitly unregistered all ESI portals, - * stop monitoring it but *without* destroying the entity. */ - if (isns_list_empty(&esi->esi_portals)) { - isns_esi_drop_entity(esi, NULL, 0); - return 0; - } - - return 1; -} - -void -isns_esi_restart(isns_esi_portal_t *esp) -{ - unsigned int timeo; - - isns_esi_disconnect(esp); - - esp->esp_start = time(NULL); - esp->esp_retries = isns_config.ic_esi_retries; - esp->esp_next_xmit = esp->esp_start + esp->esp_interval; - esp->esp_xid = 0; - - timeo = esp->esp_interval / esp->esp_retries; - if (timeo == 0) - timeo = 1; - else if (timeo > ESI_RETRANS_TIMEOUT) - timeo = ESI_RETRANS_TIMEOUT; - esp->esp_timeout = timeo; -} - -void -isns_esi_disconnect(isns_esi_portal_t *esp) -{ - if (esp->esp_socket) - isns_socket_free(esp->esp_socket); - esp->esp_socket = NULL; -} - -/* - * Generic wrapper to dropping an object - */ -static inline void -__isns_esi_drop_object(isns_db_t *db, isns_object_t *obj, unsigned int dead) -{ - if (db && obj && obj->ie_state == ISNS_OBJECT_STATE_MATURE && dead) - isns_db_remove(db, obj); - isns_object_release(obj); -} - -/* - * Portal did not respond in time. Drop it - */ -void -isns_esi_drop_portal(isns_esi_portal_t *esp, isns_db_t *db, int dead) -{ - isns_debug_esi("ESI: dropping portal %s\n", - isns_portal_string(&esp->esp_portal)); - - isns_list_del(&esp->esp_list); - isns_esi_disconnect(esp); - __isns_esi_drop_object(db, esp->esp_object, dead); - isns_free(esp); -} - -/* - * We ran out of ESI portals for this entity. - */ -void -isns_esi_drop_entity(isns_esi_t *esi, isns_db_t *db, int dead) -{ - isns_debug_esi("ESI: dropping entity %u\n", - esi->esi_object->ie_index); - - isns_list_del(&esi->esi_list); - __isns_esi_drop_object(db, esi->esi_object, dead); - - while (!isns_list_empty(&esi->esi_portals)) { - isns_esi_portal_t *esp; - - esp = isns_list_item(isns_esi_portal_t, esp_list, - esi->esi_portals.next); - isns_esi_drop_portal(esp, db, dead); - } - isns_free(esi); -} - -/* - * When receiving an ESI response, find the portal we sent the - * original message to. - */ -static isns_esi_portal_t * -isns_esi_get_msg_portal(uint32_t xid, isns_esi_t **esip) -{ - isns_list_t *esi_pos, *esi_next; - - isns_list_foreach(&isns_esi_list, esi_pos, esi_next) { - isns_esi_t *esi = isns_list_item(isns_esi_t, esi_list, esi_pos); - isns_list_t *esp_pos, *esp_next; - - isns_list_foreach(&esi->esi_portals, esp_pos, esp_next) { - isns_esi_portal_t *esp = isns_list_item(isns_esi_portal_t, - esp_list, esp_pos); - - if (esp->esp_xid == xid) { - *esip = esi; - return esp; - } - } - } - - return NULL; -} - -/* - * Handle incoming ESI request - */ -int -isns_process_esi(isns_server_t *srv, isns_simple_t *call, isns_simple_t **reply) -{ - const isns_attr_list_t *attrs = &call->is_message_attrs; - isns_object_t *portal = NULL; - - /* We just echo back the attributes sent to us by the server, - * without further checking. */ - *reply = isns_simple_create(ISNS_ENTITY_STATUS_INQUIRY, - srv->is_source, attrs); - - /* Look up the portal and update its mtime. - * This can help the application find out if a portal has - * seen ESIs recently, and react. - */ - if (srv->is_db && attrs->ial_count == 4) { - const isns_attr_t *addr_attr, *port_attr; - - addr_attr = attrs->ial_data[2]; - port_attr = attrs->ial_data[3]; - if (addr_attr->ia_tag_id == ISNS_TAG_PORTAL_IP_ADDRESS - && port_attr->ia_tag_id == ISNS_TAG_PORTAL_TCP_UDP_PORT) { - isns_attr_list_t key; - - key.ial_count = 2; - key.ial_data = attrs->ial_data + 2; - portal = isns_db_lookup(srv->is_db, - &isns_portal_template, - &key); - } - - if (portal) - portal->ie_mtime = time(NULL); - } - return ISNS_SUCCESS; -} - -void -isns_process_esi_response(uint32_t xid, int status, isns_simple_t *msg) -{ - isns_portal_info_t portal_info; - isns_esi_portal_t *esp; - isns_esi_t *esi; - - if (msg == NULL) { - isns_debug_esi("ESI call 0x%x timed out\n", xid); - return; - } - - /* FIXME: As a matter of security, we should probably - * verify that the ESI response originated from the - * portal we sent it to; or at least that it was authenticated - * by the client we think we're talking to. */ - - /* Get the portal */ - if (!isns_portal_from_attr_list(&portal_info, - ISNS_TAG_PORTAL_IP_ADDRESS, - ISNS_TAG_PORTAL_TCP_UDP_PORT, - &msg->is_message_attrs)) { - isns_debug_esi("Ignoring unintelligible ESI response\n"); - return; - } - - if (!(esp = isns_esi_get_msg_portal(xid, &esi))) { - isns_debug_esi("Ignoring unmatched ESI reply\n"); - return; - } - - if (!isns_portal_equal(&esp->esp_portal, &portal_info)) { - isns_warning("Faked ESI response for portal %s\n", - isns_portal_string(&portal_info)); - return; - } - - isns_debug_esi("Good ESI response from %s\n", - isns_portal_string(&portal_info)); - isns_esi_restart(esp); - - /* Refresh the entity's registration timestamp */ - isns_object_set_uint64(esi->esi_object, - ISNS_TAG_TIMESTAMP, - time(NULL)); - isns_db_sync(isns_esi_server->is_db); -} - -/* - * Helper function to schedule the next timeout - */ -static void -isns_esi_schedule(int timeout) -{ - isns_cancel_timer(isns_esi_transmit, NULL); - isns_add_oneshot_timer(timeout, isns_esi_transmit, NULL); -} - -/* - * Register an entity for ESI monitoring. - * This is called when reloading the database. - */ -void -isns_esi_register(isns_object_t *obj) -{ - if (!isns_esi_find(obj)) - isns_esi_add_entity(obj); - /* We do not call esi_schedule(0) here; that happens in - * isns_esi_init already. */ -} - -/* - * This callback is invoked whenever an object is added/removed/modified. - * We use this to keep track of ESI portals and such. - */ -void -isns_esi_callback(const isns_db_event_t *ev, void *ptr) -{ - isns_object_t *obj, *entity; - isns_esi_t *esi; - uint32_t event; - - obj = ev->ie_object; - event = ev->ie_bits; - - if (obj->ie_flags & ISNS_OBJECT_PRIVATE) - return; - - isns_debug_esi("isns_esi_callback(%p, 0x%x)\n", obj, event); - - if (ISNS_IS_ENTITY(obj) - && (event & ISNS_SCN_OBJECT_ADDED_MASK)) { - if (!isns_esi_find(obj)) - isns_esi_add_entity(obj); - /* Schedule an immediate ESI timer run */ - isns_esi_schedule(0); - return; - } - - if (!(entity = isns_object_get_entity(obj))) - return; - - esi = isns_esi_find(entity); - if (esi != NULL) - esi->esi_update = 1; - - /* Schedule an immediate ESI timer run */ - isns_esi_schedule(0); -} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/etc/isnsadm.conf open-iscsi-2.0.874/utils/open-isns/etc/isnsadm.conf --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/etc/isnsadm.conf 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/etc/isnsadm.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ -# -# Sample iSNS client configuration file -# - -# The source name. This is an iSCSI qualified name, -# and identifies the client uniquely. -# -# If left empty, the source name is derived from -# the client's hostname. -# -#SourceName = iqn.2006-01.com.example.host1 - -# Name and port of the iSNS server. -# Possible formats: -# foo.example.com -# foo.example.com:3205 -# 192.168.1.7:isns -# [2001:4e5f::1]:isns -# SLP: -# If the special string "SLP:" is given, Open-iSNS will -# query the SLP directory service to find the iSNS server. -#ServerAddress = isns.example.com - - -# Authentication enable/disable. -# When set to 1, the client will sign -# all messages, and expect all server messages -# to be signed. -# -# Authentication requires a valid private DSA -# key in AuthKeyFile, and the server's DSA public -# key in ServerKeyFile. -# -# The default is to use authentication if the -# requires keys are installed, and use unauthenticated -# iSNS otherwise. -#Security = 1 - -# Location of the client's private key. -# The file must contain a PEM encoded DSA key. -# The default is /etc/isns/auth_key -#AuthKeyFile = /etc/isns/auth_key - -# Location of the servers's public key. -# The file must contain a PEM encoded DSA key. -# The default is /etc/isns/server_key.pub -#ServerKeyFile = /etc/isns/server_key.pub - -# In order to prevent replay attacks, the -# authentication blocks carried by iSNS -# include a time stamp. The following two -# parameters control how we verify the -# time stamp -Auth.ReplayWindow = 2m -Auth.TimeStampJitter = 1s - -# Maximum number of incoming connections -# accepted. This usually applies to server -# side only, but is relevant if you create -# a passive TCP socket for ESI or SCN. -# Network.MaxSockets = 1024 - -# Time to wait for a TCP connection to be -# established. -# Network.ConnectTimeout = 60 - -# When a connection attempt failed, we wait -# before we try connecting again. -# Network.ReonnectTimeout = 10 - -# Total amount of time to wait before timing -# out a call to the iSNS server. -# Network.CallTimeout = 60 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/etc/isnsd.conf open-iscsi-2.0.874/utils/open-isns/etc/isnsd.conf --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/etc/isnsd.conf 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/etc/isnsd.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,129 +0,0 @@ -# -# Sample iSNS Server configuration file -# - -# The source name. This is an iSCSI qualified name, -# and identifies the client uniquely. -# -# If left empty, the source name is derived from -# the client's hostname. -# -#SourceName = iqn.2006-01.com.example.host1 - -# Where to store the database. -# If you leave this empty, isnsd will keep its -# database in memory. -# Setting this to an absolute path name will -# make isnsd keep its database in a directory -# hierarchy below that directory. -Database = /var/lib/isns - -# The iSNS server can purge registered entities -# after a certain period of inactivity. This is -# called the registration period. -# Clients who register objects are supposed to -# refresh their registration within this period. -# -# The default value is 0, which disables this -# feature. -RegistrationPeriod = 10m - -# iSNS scopes visibility of other nodes using so-called -# Discovery Domains. A storage node A will only "see" -# storage node B, if both are members of the same -# discovery domain. -# -# So if a storage node is registered which is not part of -# any discovery domain, it will not see any other nodes. -# -# By setting DefaultDiscoveryDomain=1, you can tell isnsd to -# create a virtual "default discovery domain", which -# holds all nodes that are not part of any administratively -# configured discovery domain. -DefaultDiscoveryDomain = 1 - -# Make the iSNS server register itself with SLP. -# Clients will be able to discover the server by -# querying for service type "iscsi:sms", and a query -# of "(protocols=isns)" -SLPRegister = 1 - -# Authentication enable/disable. -# When set to 1, the client will sign -# all messages, and expect all server messages -# to be signed. -# -# Authentication requires a valid private DSA -# key in AuthKeyFile, and the server's DSA public -# key in ServerKeyFile. -# -# The default is to use authentication if the -# requires keys are installed, and use unauthenticated -# iSNS otherwise. -#Security = 1 - -# Location of the client's private key. -# The file must contain a PEM encoded DSA key. -# The default is /etc/isns/auth_key -#AuthKeyFile = /etc/isns/auth_key - -# Location of the servers's public key. -# The file must contain a PEM encoded DSA key. -# The default is /etc/isns/server_key.pub -#ServerKeyFile = /etc/isns/server_key.pub - -# This describes where the iSNS server stores -# authentication keys and policy information. -# Two options are currently supported: a -# simple key store (flat directory with public -# keys in PEM encoded files), and the iSNS -# database itself -#ClientKeyStore = /etc/isns/keystores -ClientKeyStore = DB: - -# When transmitting State Change Notification, -# we expect the client to ack them. If the -# ACK doesn't arrive in due time, we retransmit -# for a limited number of attempts, cycling -# through the available portals. -SCNTimeout = 60 -SCNRetries = 3 - -# Configuration of ESI. -# Defaults are -# ESIMaxInterval = 1h -# ESIMinInterval = 60s -# ESIRetries = 3 -# Setting ESIRetries to 0 disables ESI support, and makes -# the server reject any portal registrations that specify -# an ESI portal. -ESIMinInterval = 1m -ESIMaxInterval = 2m -ESIRetries = 3 - -# In order to prevent replay attacks, the -# authentication blocks carried by iSNS -# include a time stamp. The following two -# parameters control how we verify the -# time stamp -Auth.ReplayWindow = 2m -Auth.TimeStampJitter = 1s - -# Maximum number of incoming connections -# accepted. -# Network.MaxSockets = 1024 - -# Time to wait for a TCP connection to be -# established. -# (Client only) -# Network.ConnectTimeout = 60 - -# When a connection attempt failed, we wait -# before we try connecting again. -# (Client only) -# Network.ReonnectTimeout = 10 - -# Total amount of time to wait before timing -# out a call to the iSNS server. -# (Client only) -# Network.CallTimeout = 60 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/etc/isnsdd.conf open-iscsi-2.0.874/utils/open-isns/etc/isnsdd.conf --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/etc/isnsdd.conf 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/etc/isnsdd.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,72 +0,0 @@ -# -# Sample iSNS Discovery Daemon configuration file -# - -# The source name. This is an iSCSI qualified name, -# and identifies the client uniquely. -# -# If left empty, the source name is derived from -# the client's hostname. -# -#SourceName = iqn.2006-01.com.example.host1:monitor - -# Name and port of the iSNS server. -# Possible formats: -# foo.example.com -# foo.example.com:3205 -# 192.168.1.7:isns -# [2001:4e5f::1]:isns -# SLP: -# If the special string "SLP:" is given, Open-iSNS will -# query the SLP directory service to find the iSNS server. -#ServerAddress = isns.example.com - -# Authentication enable/disable. -# When set to 1, the client will sign -# all messages, and expect all server messages -# to be signed. -# -# Authentication requires a valid private DSA -# key in AuthKeyFile, and the server's DSA public -# key in ServerKeyFile. -# -# The default is to use authentication if the -# required keys are installed, and use unauthenticated -# iSNS otherwise. -#Security = 1 - -# Location of the client's private key. -# The file must contain a PEM encoded DSA key. -# The default is /etc/isns/auth_key -#AuthKeyFile = /etc/isns/auth_key - -# Location of the servers's public key. -# The file must contain a PEM encoded DSA key. -# The default is /etc/isns/server_key.pub -#ServerKeyFile = /etc/isns/server_key.pub - -# In order to prevent replay attacks, the -# authentication blocks carried by iSNS -# include a time stamp. The following two -# parameters control how we verify the -# time stamp -Auth.ReplayWindow = 2m -Auth.TimeStampJitter = 1s - -# Maximum number of incoming connections -# accepted. This usually applies to server -# side only, but is relevant if you create -# a passive TCP socket for ESI or SCN. -# Network.MaxSockets = 1024 - -# Time to wait for a TCP connection to be -# established. -# Network.ConnectTimeout = 60 - -# When a connection attempt failed, we wait -# before we try connecting again. -# Network.ReonnectTimeout = 10 - -# Total amount of time to wait before timing -# out a call to the iSNS server. -# Network.CallTimeout = 60 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/etc/openisns.init open-iscsi-2.0.874/utils/open-isns/etc/openisns.init --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/etc/openisns.init 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/etc/openisns.init 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ -#!/bin/sh -# -# Init script for Open-iSNS. -# -# Copyright (C) 2007 Albert Pauw -# -# chkconfig: 345 13 89 -# description: Starts and stops the iSCSI isns server -# -# processname: isnsd -# pidfile: /var/run/isnsd.pid -# config: /etc/isns/isnsd.conf - -# Source function library. -. /etc/init.d/functions - -PATH=/sbin:/bin:/usr/sbin:/usr/bin -#OPTIONS="-4 -d all" -CONFIG="-c /etc/isns/isnsd.conf" -RETVAL=0 - -start() -{ - echo -n "Starting iSCSI isns service: " - daemon isnsd $OPTIONS $CONFIG - RETVAL=$? - success - echo - [ $RETVAL -eq 0 ] || return - touch /var/lock/subsys/open-isns -} - -stop() -{ - echo -n "Stopping iSCSI isns service: " - killproc isnsd - [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/open-isns - success - echo - -} - -restart() -{ - stop - start -} - -case "$1" in -start) - start - ;; -stop) - stop - ;; -restart) - restart - ;; -status) - status isnsd - RETVAL=$? - ;; -condrestart) - [ -f /var/lock/subsys/open-isns ] && restart - ;; -*) - echo $"Usage: $0 {start|stop|restart|status|condrestart}" - exit 1 -esac - -exit $RETVAL diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/export.c open-iscsi-2.0.874/utils/open-isns/export.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/export.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/export.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,547 +0,0 @@ -/* - * Helper functions to represent iSNS objects as text, - * and/or to parse objects represented in textual form. - * These functions can be used by command line utilities - * such as isnsadm, as well as applications like iscsid - * or stgtd when talking to the iSNS discovery daemon. - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include -#include -#include -#include -#include - -#include "isns.h" -#include "util.h" -#include "vendor.h" -#include "attrs.h" -#include "security.h" -#include "objects.h" -#include "paths.h" - -#define MAX_ALIASES 4 - -struct isns_tag_prefix { - const char * name; - unsigned int name_len; - isns_object_template_t *context; -}; - -struct tag_name { - const char * name; - uint32_t tag; - struct isns_tag_prefix *prefix; - const char * alias[MAX_ALIASES]; -}; - -static struct isns_tag_prefix all_prefixes[__ISNS_OBJECT_TYPE_MAX] = { -[ISNS_OBJECT_TYPE_ENTITY] = { "entity-", 7, &isns_entity_template }, -[ISNS_OBJECT_TYPE_NODE] = { "iscsi-", 6, &isns_iscsi_node_template }, -[ISNS_OBJECT_TYPE_PORTAL] = { "portal-", 7, &isns_portal_template }, -[ISNS_OBJECT_TYPE_PG] = { "pg-", 3, &isns_iscsi_pg_template }, -[ISNS_OBJECT_TYPE_DD] = { "dd-", 3, &isns_dd_template }, -[ISNS_OBJECT_TYPE_POLICY] = { "policy-", 7, &isns_policy_template }, -}; - -static struct tag_name all_attrs[] = { -{ "id", ISNS_TAG_ENTITY_IDENTIFIER, - .alias = { "eid", }, -}, -{ "prot", ISNS_TAG_ENTITY_PROTOCOL }, -{ "idx", ISNS_TAG_ENTITY_INDEX }, - -{ "name", ISNS_TAG_ISCSI_NAME }, -{ "node-type", ISNS_TAG_ISCSI_NODE_TYPE }, -{ "alias", ISNS_TAG_ISCSI_ALIAS }, -{ "authmethod", ISNS_TAG_ISCSI_AUTHMETHOD }, -{ "idx", ISNS_TAG_ISCSI_NODE_INDEX }, - -{ "addr", ISNS_TAG_PORTAL_IP_ADDRESS }, -{ "port", ISNS_TAG_PORTAL_TCP_UDP_PORT }, -{ "name", ISNS_TAG_PORTAL_SYMBOLIC_NAME }, -{ "esi-port", ISNS_TAG_ESI_PORT }, -{ "esi-interval", ISNS_TAG_ESI_INTERVAL }, -{ "scn-port", ISNS_TAG_SCN_PORT }, -{ "idx", ISNS_TAG_PORTAL_INDEX }, - -{ "name", ISNS_TAG_PG_ISCSI_NAME }, -{ "addr", ISNS_TAG_PG_PORTAL_IP_ADDR }, -{ "port", ISNS_TAG_PG_PORTAL_TCP_UDP_PORT }, -{ "tag", ISNS_TAG_PG_TAG }, -{ "pgt", ISNS_TAG_PG_TAG }, -{ "idx", ISNS_TAG_PG_INDEX }, - -{ "id", ISNS_TAG_DD_ID }, -{ "name", ISNS_TAG_DD_SYMBOLIC_NAME }, -{ "member-name", ISNS_TAG_DD_MEMBER_ISCSI_NAME }, -{ "member-iscsi-idx", ISNS_TAG_DD_MEMBER_ISCSI_INDEX }, -{ "member-fc-name", ISNS_TAG_DD_MEMBER_FC_PORT_NAME }, -{ "member-portal-idx", ISNS_TAG_DD_MEMBER_PORTAL_INDEX }, -{ "member-addr", ISNS_TAG_DD_MEMBER_PORTAL_IP_ADDR }, -{ "member-port", ISNS_TAG_DD_MEMBER_PORTAL_TCP_UDP_PORT }, -{ "features", ISNS_TAG_DD_FEATURES }, - -{ "name", OPENISNS_TAG_POLICY_SPI, - .alias = { "spi" }, -}, -{ "key", OPENISNS_TAG_POLICY_KEY }, -{ "entity", OPENISNS_TAG_POLICY_ENTITY }, -{ "object-type", OPENISNS_TAG_POLICY_OBJECT_TYPE }, -{ "node-type", OPENISNS_TAG_POLICY_NODE_TYPE }, -{ "node-name", OPENISNS_TAG_POLICY_NODE_NAME }, -{ "functions", OPENISNS_TAG_POLICY_FUNCTIONS }, - -{ NULL } -}; - -/* - * Initialize tag array - */ -static void -init_tags(void) -{ - struct tag_name *t; - - for (t = all_attrs; t->name; ++t) { - isns_object_template_t *tmpl; - - tmpl = isns_object_template_for_tag(t->tag); - if (tmpl == NULL) - isns_fatal("Bug: cannot find object type for tag %s\n", - t->name); - t->prefix = &all_prefixes[tmpl->iot_handle]; - } -} - -/* - * Match prefix - */ -static struct isns_tag_prefix * -find_prefix(const char *name) -{ - struct isns_tag_prefix *p; - unsigned int i; - - for (i = 0, p = all_prefixes; i < __ISNS_OBJECT_TYPE_MAX; ++i, ++p) { - if (p->name && !strncmp(name, p->name, p->name_len)) - return p; - } - return NULL; -} - -/* - * Look up the tag for a given attribute name. - * By default, attr names come with a disambiguating - * prefix that defines the object type the attribute applies - * to, such as "entity-" or "portal-". Once a context has - * been established (ie we know the object type subsequent - * attributes apply to), specifying the prefix is optional. - * - * For instance, in a portal context, "addr=10.1.1.1 port=616 name=foo" - * specifies three portal related attributes. Whereas in a portal - * group context, the same string would specify three portal group - * related attributes. To disambiguate, the first attribute in - * this list should be prefixed by "portal-" or "pg-", respectively. - */ -static uint32_t -tag_by_name(const char *name, struct isns_attr_list_parser *st) -{ - const char *orig_name = name; - unsigned int nmatch = 0, i; - struct tag_name *t, *match[8]; - struct isns_tag_prefix *specific = NULL; - - if (all_attrs[0].prefix == NULL) - init_tags(); - - specific = find_prefix(name); - if (specific != NULL) { - if (st->prefix - && st->prefix != specific - && !st->multi_type_permitted) { - isns_error("Cannot mix attributes of different types\n"); - return 0; - } - name += specific->name_len; - st->prefix = specific; - } - - for (t = all_attrs; t->name; ++t) { - if (specific && t->prefix != specific) - continue; - if (!st->multi_type_permitted - && st->prefix && t->prefix != st->prefix) - continue; - if (!strcmp(name, t->name)) - goto match; - for (i = 0; i < MAX_ALIASES && t->alias[i]; ++i) { - if (!strcmp(name, t->alias[i])) - goto match; - } - continue; - -match: - if (nmatch < 8) - match[nmatch++] = t; - } - - if (nmatch > 1) { - char conflict[128]; - unsigned int i; - - conflict[0] = '\0'; - for (i = 0; i < nmatch; ++i) { - if (i) - strcat(conflict, ", "); - t = match[i]; - strcat(conflict, t->prefix->name); - strcat(conflict, t->name); - } - isns_error("tag name \"%s\" not unique in this context " - "(could be one of %s)\n", - orig_name, conflict); - return 0; - } - - if (nmatch == 0) { - isns_error("tag name \"%s\" not known in this context\n", - orig_name); - return 0; - } - - st->prefix = match[0]->prefix; - return match[0]->tag; -} - -static const char * -name_by_tag(uint32_t tag, struct isns_attr_list_parser *st) -{ - struct tag_name *t; - - for (t = all_attrs; t->name; ++t) { - if (st->prefix && t->prefix != st->prefix) - continue; - if (t->tag == tag) - return t->name; - } - return NULL; -} - -static int -parse_one_attr(const char *name, const char *value, - isns_attr_list_t *attrs, - struct isns_attr_list_parser *st) -{ - isns_attr_t *attr; - uint32_t tag; - - /* Special case: "portal=" is translated to - * addr=
port= - * If no context has been set, assume portal context. - */ - if (!strcasecmp(name, "portal")) { - isns_portal_info_t portal_info; - uint32_t addr_tag, port_tag; - - if (st->prefix == NULL) { - addr_tag = tag_by_name("portal-addr", st); - port_tag = tag_by_name("portal-port", st); - } else { - addr_tag = tag_by_name("addr", st); - port_tag = tag_by_name("port", st); - } - - if (!addr_tag || !port_tag) { - isns_error("portal=... not supported in this context\n"); - return 0; - } - if (value == NULL) { - isns_attr_list_append_nil(attrs, addr_tag); - isns_attr_list_append_nil(attrs, port_tag); - return 1; - } - if (!isns_portal_parse(&portal_info, value, st->default_port)) - return 0; - isns_portal_to_attr_list(&portal_info, addr_tag, port_tag, attrs); - return 1; - } - - if (!(tag = tag_by_name(name, st))) - return 0; - - /* Special handling for key objects */ - if (tag == OPENISNS_TAG_POLICY_KEY) { - if (!value || !strcasecmp(value, "gen")) { - if (st->generate_key == NULL) { - isns_error("Key generation not supported in this context\n"); - return 0; - } - attr = st->generate_key(); - } else { - if (st->load_key == NULL) { - isns_error("Policy-key attribute not supported in this context\n"); - return 0; - } - attr = st->load_key(value); - } - goto append_attr; - } - - if (value == NULL) { - isns_attr_list_append_nil(attrs, tag); - return 1; - } - - attr = isns_attr_from_string(tag, value); - if (!attr) - return 0; - -append_attr: - isns_attr_list_append_attr(attrs, attr); - return 1; -} - -void -isns_attr_list_parser_init(struct isns_attr_list_parser *st, - isns_object_template_t *tmpl) -{ - if (all_attrs[0].prefix == NULL) - init_tags(); - - memset(st, 0, sizeof(*st)); - if (tmpl) - st->prefix = &all_prefixes[tmpl->iot_handle]; -} - -int -isns_attr_list_split(char *line, char **argv, unsigned int argc_max) -{ - char *src = line; - unsigned int argc = 0, quoted = 0; - - if (!line) - return 0; - - while (1) { - char *dst; - - while (isspace(*src)) - ++src; - if (!*src) - break; - - argv[argc] = dst = src; - while (*src) { - char cc = *src++; - - if (cc == '"') { - quoted = !quoted; - continue; - } - if (!quoted && isspace(cc)) { - *dst = '\0'; - break; - } - *dst++ = cc; - } - - if (quoted) { - isns_error("%s: Unterminated quoted string: \"%s\"\n", - __FUNCTION__, argv[argc]); - return -1; - } - argc++; - } - - return argc; -} - -int -isns_parse_attrs(unsigned int argc, char **argv, - isns_attr_list_t *attrs, - struct isns_attr_list_parser *st) -{ - unsigned int i; - - for (i = 0; i < argc; ++i) { - char *name, *value; - - name = argv[i]; - if ((value = strchr(name, '=')) != NULL) - *value++ = '\0'; - - if (!value && !st->nil_permitted) { - isns_error("Missing value for atribute %s\n", name); - return 0; - } - - if (!parse_one_attr(name, value, attrs, st)) { - isns_error("Unable to parse %s=%s\n", name, value); - return 0; - } - } - - return 1; -} - -/* - * Query strings may contain a mix of query keys (foo=bar), - * and requested attributes (?foo). The former are used by - * the server in its object search, whereas the latter instruct - * it which attributes to return. - */ -int -isns_parse_query_attrs(unsigned int argc, char **argv, - isns_attr_list_t *keys, - isns_attr_list_t *requested_attrs, - struct isns_attr_list_parser *st) -{ - struct isns_attr_list_parser query_state; - unsigned int i; - - query_state = *st; - query_state.multi_type_permitted = 1; - - for (i = 0; i < argc; ++i) { - char *name, *value; - - name = argv[i]; - if ((value = strchr(name, '=')) != NULL) - *value++ = '\0'; - - if (name[0] == '?') { - uint32_t tag; - - if (value) { - isns_error("No value allowed for query attribute %s\n", - name); - return 0; - } - - if ((tag = tag_by_name(name + 1, &query_state)) != 0) { - isns_attr_list_append_nil(requested_attrs, tag); - continue; - } - } else { - if (!value && !st->nil_permitted) { - isns_error("Missing value for atribute %s\n", name); - return 0; - } - - if (parse_one_attr(name, value, keys, st)) - continue; - } - - isns_error("Unable to parse %s=%s\n", name, value); - return 0; - } - - return 1; -} - -void -isns_attr_list_parser_help(struct isns_attr_list_parser *st) -{ - isns_object_template_t *tmpl, *current = NULL; - struct tag_name *t; - - if (all_attrs[0].prefix == NULL) - init_tags(); - - for (t = all_attrs; t->name; ++t) { - const isns_tag_type_t *tag_type; - char namebuf[64]; - const char *help; - unsigned int i; - - if (st && !st->multi_type_permitted - && st->prefix && t->prefix != st->prefix) - continue; - - tmpl = t->prefix->context; - if (tmpl != current) { - printf("\nAttributes for object type %s; using prefix %s\n", - tmpl->iot_name, t->prefix->name); - current = tmpl; - } - - snprintf(namebuf, sizeof(namebuf), "%s%s", t->prefix->name, t->name); - printf(" %-20s ", namebuf); - - tag_type = isns_tag_type_by_id(t->tag); - if (tag_type == NULL) { - printf("Unknown\n"); - continue; - } - printf("%s (%s", tag_type->it_name, - tag_type->it_type->it_name); - - if (tag_type->it_readonly) - printf("; readonly"); - if (tag_type->it_multiple) - printf("; multiple instances"); - printf(")"); - - help = NULL; - if (t->tag == OPENISNS_TAG_POLICY_KEY) { - help = "name of key file, or \"gen\" for key generation"; - } else - if (tag_type->it_help) - help = tag_type->it_help(); - - if (help) { - if (strlen(help) < 20) - printf(" [%s]", help); - else - printf("\n%25s[%s]", "", help); - } - printf("\n"); - - if (t->alias[0]) { - printf("%25sAliases:", ""); - for (i = 0; i < MAX_ALIASES && t->alias[i]; ++i) - printf(" %s", t->alias[i]); - printf("\n"); - } - } -} - -isns_object_template_t * -isns_attr_list_parser_context(const struct isns_attr_list_parser *st) -{ - if (st->prefix) - return st->prefix->context; - return NULL; -} - -int -isns_print_attrs(isns_object_t *obj, char **argv, unsigned int argsmax) -{ - struct isns_attr_list_parser st; - unsigned int i, argc = 0; - - isns_attr_list_parser_init(&st, obj->ie_template); - - for (i = 0; i < obj->ie_attrs.ial_count; ++i) { - isns_attr_t *attr = obj->ie_attrs.ial_data[i]; - char argbuf[512], value[512]; - const char *name; - - name = name_by_tag(attr->ia_tag_id, &st); - if (name == NULL) - continue; - if (argc + 1 >= argsmax) - break; - - snprintf(argbuf, sizeof(argbuf), "%s%s=%s", - st.prefix->name, name, - isns_attr_print_value(attr, value, sizeof(value))); - argv[argc++] = isns_strdup(argbuf); - } - - argv[argc] = NULL; - return argc; -} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/getnext.c open-iscsi-2.0.874/utils/open-isns/getnext.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/getnext.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/getnext.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,257 +0,0 @@ -/* - * Handle iSNS DevGetNext - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include -#include -#include "isns.h" -#include "attrs.h" -#include "message.h" -#include "security.h" -#include "objects.h" -#include "db.h" -#include "util.h" - -/* - * Create a GetNext query, and set the source name - */ -static isns_simple_t * -__isns_create_getnext(isns_source_t *source, - const isns_attr_list_t *key, - const isns_attr_list_t *scope) -{ - isns_simple_t *simp; - - simp = isns_simple_create(ISNS_DEVICE_GET_NEXT, source, key); - if (simp && scope) - isns_attr_list_copy(&simp->is_operating_attrs, - scope); - return simp; -} - -isns_simple_t * -isns_create_getnext(isns_client_t *clnt, - isns_object_template_t *tmpl, - const isns_attr_list_t *scope) -{ - isns_simple_t *simp; - unsigned int i; - - simp = __isns_create_getnext(clnt->ic_source, NULL, scope); - if (simp == NULL) - return NULL; - - for (i = 0; i < tmpl->iot_num_keys; ++i) { - isns_attr_list_append_nil(&simp->is_message_attrs, - tmpl->iot_keys[i]); - } - return simp; -} - -isns_simple_t * -isns_create_getnext_followup(isns_client_t *clnt, - const isns_simple_t *resp, - const isns_attr_list_t *scope) -{ - return __isns_create_getnext(clnt->ic_source, - &resp->is_message_attrs, scope); -} - -/* - * Get the list of objects matching this query - */ -static int -isns_getnext_get_object(isns_simple_t *qry, isns_db_t *db, - isns_object_t **result) -{ - isns_scope_t *scope; - isns_attr_list_t *keys = &qry->is_message_attrs, match; - isns_object_template_t *tmpl; - unsigned int i; - - /* - * 5.6.5.3. - * The Message Key Attribute may be an Entity Identifier (EID), - * iSCSI Name, iSCSI Index, Portal IP Address and TCP/UDP Port, - * Portal Index, PG Index, FC Node Name WWNN, or FC Port Name - * WWPN. - * - * Implementer's comment: In other words, it must be the - * key attr(s) of a specific object type, or an index attribute. - */ - if ((tmpl = isns_object_template_for_key_attrs(keys)) != NULL) { - if (keys->ial_count != tmpl->iot_num_keys) - return ISNS_INVALID_QUERY; - } else if (keys->ial_count == 1) { - isns_attr_t *attr = keys->ial_data[0]; - - tmpl = isns_object_template_for_index_tag(attr->ia_tag_id); - } - if (tmpl == NULL) - return ISNS_INVALID_QUERY; - - /* Verify whether the client is permitted to retrieve - * objects of the given type. */ - if (!isns_policy_validate_object_type(qry->is_policy, tmpl, - qry->is_function)) - return ISNS_SOURCE_UNAUTHORIZED; - - /* - * 5.6.5.3. - * The Operating Attributes can be used to specify the scope - * of the DevGetNext request, and to specify the attributes of - * the next object, which are to be returned in the DevGetNext - * response message. All Operating Attributes MUST be attributes - * of the object type identified by the Message Key. - */ - match = qry->is_operating_attrs; - for (i = 0; i < match.ial_count; ++i) { - isns_attr_t *attr = match.ial_data[i]; - - if (tmpl != isns_object_template_for_tag(attr->ia_tag_id)) - return ISNS_INVALID_QUERY; - } - - /* - * 5.6.5.3. - * Non-zero-length TLV attributes in the Operating Attributes - * are used to scope the DevGetNext message. - * [...] - * Zero-length TLV attributes MUST be listed after non-zero-length - * attributes in the Operating Attributes of the DevGetNext - * request message. - */ - for (i = 0; i < match.ial_count; ++i) { - if (ISNS_ATTR_IS_NIL(match.ial_data[i])) { - match.ial_count = i; - break; - } - } - - /* Get the scope for the originating node. */ - scope = isns_scope_for_call(db, qry); - - *result = isns_scope_get_next(scope, tmpl, keys, &match); - - isns_scope_release(scope); - - if (*result == NULL) - return ISNS_NO_SUCH_ENTRY; - return ISNS_SUCCESS; -} - -/* - * Create a Query Response - */ -static isns_simple_t * -isns_create_getnext_response(isns_source_t *source, - const isns_simple_t *qry, isns_object_t *obj) -{ - const isns_attr_list_t *req_attrs = NULL; - isns_attr_list_t requested; - isns_simple_t *resp; - unsigned int i; - - resp = __isns_create_getnext(source, NULL, NULL); - - /* - * 5.7.5.3. Device Get Next Response (DevGetNextRsp) - * The Message Key Attribute field returns the object keys - * for the next object after the Message Key Attribute in the - * original DevGetNext message. - * - * Implementer's note: slightly convoluted English here. - * I *think* this means the key attributes of the object - * we matched. - */ - if (!isns_object_get_key_attrs(obj, &resp->is_message_attrs)) - return NULL; - - /* - * 5.7.5.3. - * The Operating Attribute field returns the Operating Attributes - * of the next object as requested in the original DevGetNext - * message. The values of the Operating Attributes are those - * associated with the object identified by the Message Key - * Attribute field of the DevGetNextRsp message. - * - * Implementer's note: the RFC doesn't say clearly what to - * do when the list of operating attributes does not - * contain any NIL TLVs. Let's default to the same - * behavior as elsewhere, and return all attributes - * in this case. - */ - req_attrs = &qry->is_operating_attrs; - for (i = 0; i < req_attrs->ial_count; ++i) { - if (ISNS_ATTR_IS_NIL(req_attrs->ial_data[i])) - break; - } - requested.ial_count = req_attrs->ial_count - i; - requested.ial_data = req_attrs->ial_data + i; - if (requested.ial_count) - req_attrs = &requested; - else - req_attrs = NULL; - - isns_object_get_attrlist(obj, - &resp->is_operating_attrs, - req_attrs); - return resp; -} - -/* - * Process a GetNext request - */ -int -isns_process_getnext(isns_server_t *srv, isns_simple_t *call, isns_simple_t **result) -{ - isns_simple_t *reply = NULL; - isns_object_t *obj = NULL; - isns_db_t *db = srv->is_db; - int status; - - /* Get the next object */ - status = isns_getnext_get_object(call, db, &obj); - if (status != ISNS_SUCCESS) - goto done; - - /* If it's a virtual object, rebuild it */ - if (obj->ie_rebuild) - obj->ie_rebuild(obj, srv->is_db); - - /* Success: create a new simple message, and - * send it in our reply. */ - reply = isns_create_getnext_response(srv->is_source, call, obj); - if (reply == NULL) - status = ISNS_INTERNAL_ERROR; - -done: - if (obj) - isns_object_release(obj); - *result = reply; - return status; -} - -/* - * Parse the object in a getnext response - */ -int -isns_getnext_response_get_object(isns_simple_t *qry, - isns_object_t **result) -{ - isns_object_template_t *tmpl; - - tmpl = isns_object_template_for_key_attrs(&qry->is_operating_attrs); - if (tmpl == NULL) { - isns_error("Cannot determine object type in GetNext response\n"); - return ISNS_ATTRIBUTE_NOT_IMPLEMENTED; - } - - *result = isns_create_object(tmpl, - &qry->is_operating_attrs, - NULL); - return ISNS_SUCCESS; -} - diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/HACKING open-iscsi-2.0.874/utils/open-isns/HACKING --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/HACKING 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/HACKING 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ - -When hacking on open-isns, or when trying to locate a problem, -the following information may be useful: - - - You can start the daemon using the -f option, which - prevents it from backgrounding itself. Crucial if - you want to run it in a debugger, or under strace. - - This option works for isnsd and isnsdd - - - All tools support the "-d" option to enable debugging. - In general, you want to use "-d all" to turn on all - debugging options. However, you can select individual - debug facilities - check out the manpages and/or - the source code in logging.c - - - If isnsd crashes, and you suspect memory corruption, - you can compile open-isns with memory debugging enabled. Re-run - the configure script and add the option --enable-memdebug. Then - run "make clean all" to rebuild everything. - - Memory debugging can be chosen at run-time by setting the - ISNS_MDEBUG environment variable, and re-starting the application: - - export ISNS_MDEBUG=1 - ./isnsd -f -d all - - Memory debugging works for all memory allocations done by the - Open-iSNS code, but does not affect memory allocations by other - libraries (such as glibc or openssl). diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/internal.h open-iscsi-2.0.874/utils/open-isns/internal.h --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/internal.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/internal.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -/* - * iSNS implementation - internal functions and types - * - * Copyright (C) 2007 Olaf Kirch - */ - -#ifndef ISNS_INTERNAL_H -#define ISNS_INTERNAL_H - -extern char * isns_slp_build_url(uint16_t); -extern int isns_slp_register(const char *); -extern int isns_slp_unregister(const char *); -extern char * isns_slp_find(void); - -#endif /* ISNS_INTERNAL_H */ - diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/isnsadm.c open-iscsi-2.0.874/utils/open-isns/isnsadm.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/isnsadm.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/isnsadm.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1149 +0,0 @@ -/* - * isnsadm - helper utility - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include -#include -#include -#include -#include -#include - -#include "isns.h" -#include "util.h" -#include "vendor.h" -#include "attrs.h" -#include "security.h" -#include "objects.h" -#include "paths.h" -#include "config.h" - -#define ISNS_DEFAULT_PORT_INITIATOR 860 -#define ISNS_DEFAULT_PORT_TARGET 3260 - - -enum { - DO_REGISTER = 1024, - DO_QUERY, - DO_QUERY_EID, - DO_LIST, - DO_DEREGISTER, - DO_DD_REGISTER, - DO_DD_DEREGISTER, - DO_ENROLL, - DO_EDIT_POLICY, - DO_DELETE_POLICY, -}; - -static struct option options[] = { - { "help", no_argument, NULL, 'h' }, - { "config", required_argument, NULL, 'c' }, - { "debug", required_argument, NULL, 'd' }, - { "keyfile", required_argument, NULL, 'K', }, - { "key", required_argument, NULL, 'k', }, - { "local", no_argument, NULL, 'l' }, - { "control", no_argument, NULL, 'C' }, - { "replace", no_argument, NULL, 'r' }, - { "query", no_argument, NULL, DO_QUERY }, - { "query-eid", no_argument, NULL, DO_QUERY_EID }, - { "list", no_argument, NULL, DO_LIST }, - { "register", no_argument, NULL, DO_REGISTER }, - { "deregister", no_argument, NULL, DO_DEREGISTER }, - { "dd-register", no_argument, NULL, DO_DD_REGISTER }, - { "dd-deregister", no_argument, NULL, DO_DD_DEREGISTER}, - - { "enroll", no_argument, NULL, DO_ENROLL }, - { "edit-policy", no_argument, NULL, DO_EDIT_POLICY }, - { "delete-policy", no_argument, NULL, DO_DELETE_POLICY }, - - { "version", no_argument, NULL, 'V' }, - { NULL } -}; - - -static const char * opt_configfile = ISNS_DEFAULT_ISNSADM_CONFIG; -static int opt_af = AF_UNSPEC; -static int opt_action = 0; -static int opt_local = 0; -static int opt_control = 0; -static int opt_replace = 0; -static const char * opt_keyfile = NULL; -static char * opt_key = NULL; -static struct sockaddr_storage opt_myaddr; - -static void usage(int, const char *); - -static int register_objects(isns_client_t *, int, char **); -static int query_objects(isns_client_t *, int, char **); -static int query_entity_id(isns_client_t *, int, char **); -static int list_objects(isns_client_t *, int, char **); -static int deregister_objects(isns_client_t *, int, char **); -static int register_domain(isns_client_t *, int, char **); -static int deregister_domain(isns_client_t *, int, char **); -static int enroll_client(isns_client_t *, int, char **); -static int edit_policy(isns_client_t *, int, char **); - -static isns_attr_t * load_key_callback(const char *); -static isns_attr_t * generate_key_callback(void); - -int -main(int argc, char **argv) -{ - isns_client_t *clnt; - isns_security_t *security = NULL; - int c, status; - - while ((c = getopt_long(argc, argv, "46Cc:d:hK:k:l", options, NULL)) != -1) { - switch (c) { - case '4': - opt_af = AF_INET; - break; - - case '6': - opt_af = AF_INET6; - break; - - case 'C': - opt_control = 1; - break; - - case 'c': - opt_configfile = optarg; - break; - - case 'd': - isns_enable_debugging(optarg); - break; - - case 'h': - usage(0, NULL); - break; - - case 'K': - opt_keyfile = optarg; - break; - - case 'k': - opt_key = optarg; - break; - - case 'l': - opt_local = 1; - break; - - case 'r': - opt_replace = 1; - break; - - case 'V': - printf("Open-iSNS version %s\n" - "Copyright (C) 2007, Olaf Kirch \n", - OPENISNS_VERSION_STRING); - return 0; - - case DO_REGISTER: - case DO_QUERY: - case DO_QUERY_EID: - case DO_LIST: - case DO_DEREGISTER: - case DO_DD_REGISTER: - case DO_DD_DEREGISTER: - case DO_ENROLL: - case DO_EDIT_POLICY: - case DO_DELETE_POLICY: - if (opt_action) - usage(1, "You cannot specify more than one mode\n"); - opt_action = c; - break; - - default: - usage(1, "Unknown option"); - } - } - - isns_read_config(opt_configfile); - - if (!isns_config.ic_source_name) - usage(1, "Please specify an iSNS source name"); - if (!isns_config.ic_server_name) - usage(1, "Please specify an iSNS server name"); - if (!opt_action) - usage(1, "Please specify an operating mode"); - - if (opt_control) { - if (!isns_config.ic_security) - isns_fatal("Cannot use control mode, security disabled\n"); - security = isns_control_security_context(0); - if (!security) - isns_fatal("Unable to create control security context\n"); - - /* Create a networked client, using isns.control as - * the source name */ - clnt = isns_create_client(security, isns_config.ic_control_name); - } else if (opt_local) { - /* Create a local client, using isns.control as - * the source name */ - clnt = isns_create_local_client(security, - isns_config.ic_control_name); - } else { - /* Create a networked client, using the configured - * source name */ - clnt = isns_create_default_client(security); - } - - if (clnt == NULL) - return 1; - - /* We're an interactive app, and don't want to retry - * forever if the server refuses us. */ - isns_socket_set_disconnect_fatal(clnt->ic_socket); - - /* Get the IP address we use to talk to the iSNS server */ - if (opt_myaddr.ss_family == AF_UNSPEC && !opt_local) { - if (!isns_socket_get_local_addr(clnt->ic_socket, &opt_myaddr)) - isns_fatal("Unable to obtain my IP address\n"); - isns_addr_set_port((struct sockaddr *) &opt_myaddr, 860); - } - - argv += optind; argc -= optind; - switch (opt_action) { - case DO_REGISTER: - status = register_objects(clnt, argc, argv); - break; - - case DO_QUERY: - status = query_objects(clnt, argc, argv); - break; - - case DO_QUERY_EID: - status = query_entity_id(clnt, argc, argv); - break; - - case DO_LIST: - status = list_objects(clnt, argc, argv); - break; - - case DO_DEREGISTER: - status = deregister_objects(clnt, argc, argv); - break; - - case DO_DD_REGISTER: - status = register_domain(clnt, argc, argv); - break; - - case DO_DD_DEREGISTER: - status = deregister_domain(clnt, argc, argv); - break; - - - case DO_ENROLL: - status = enroll_client(clnt, argc, argv); - break; - - case DO_EDIT_POLICY: - status = edit_policy(clnt, argc, argv); - break; - - // case DO_DELETE_POLICY: - - default: - isns_fatal("Not yet implemented\n"); - status = 1; /* compiler food */ - } - - return status != ISNS_SUCCESS; -} - -void -usage(int exval, const char *msg) -{ - if (msg) - fprintf(stderr, "Error: %s\n", msg); - fprintf(stderr, - "Usage: isnsadm [options] --action ...\n" - " --config Specify alternative config fille\n" - " --debug Enable debugging (list of debug flags)\n" - " --keyfile Where to store newly generated private key\n" - " --local Use local Unix socket to talk to isnsd\n" - " --control Assume control node identity for authentication\n" - " --replace Use replace mode (--register only)\n" - "\nThe following actions are supported:\n" - " --register Register one or more objects\n" - " --deregister Deregister an object (and children)\n" - " --query Query iSNS server for objects\n" - " --list List all objects of a given type\n" - " --enroll Create a new policy object for a client\n" - " --edit-policy Edit a policy object\n" - " --delete-policy Edit a policy object\n" - " --help Display this message\n" - "\nUse \"--query help\" to get help on e.g. the query action\n" - ); - exit(exval); -} - -int -parse_registration(char **argv, int argc, isns_object_list_t *objs, isns_object_t *key_obj) -{ - struct sockaddr_storage def_addr; - isns_object_t *entity = NULL, *last_portal = NULL, *last_node = NULL; - const char *def_port = NULL; - int i; - - if (argc == 1 && !strcmp(argv[0], "help")) { - printf("Object registration:\n" - " isnsadm [-key attr=value] --register type,attr=value,... type,attr=value,...\n" - "Where type can be one of:\n" - " entity create/update network entity\n" - " initiator create iSCSI initiator storage node\n" - " target create iSCSI target storage node\n" - " control create control node\n" - " portal create portal\n" - " pg create portal group\n" - "\nThe following attributes are recognized:\n"); - - isns_attr_list_parser_help(NULL); - exit(0); - } - - if (argc == 0) - usage(1, "Missing object list\n"); - - if (key_obj) { - //isns_object_list_append(objs, key_obj); - if (isns_object_is_entity(key_obj)) - entity = key_obj; - } - - def_addr = opt_myaddr; - - for (i = 0; i < argc; ++i) { - isns_attr_list_t attrlist = ISNS_ATTR_LIST_INIT; - struct isns_attr_list_parser state; - isns_object_t *obj; - char *type, *name, *value, *next_attr; - char *attrs[128]; - unsigned int nattrs = 0; - - name = argv[i]; - - if ((next_attr = strchr(name, ',')) != NULL) - *next_attr++ = '\0'; - - while (next_attr && *next_attr) { - if (nattrs > 128) - isns_fatal("Too many attributes\n"); - - /* Show mercy with fat fingered - * people,,,,who,cannot,,,type,properly */ - if (next_attr[0] != ',') - attrs[nattrs++] = next_attr; - if ((next_attr = strchr(next_attr, ',')) != NULL) - *next_attr++ = '\0'; - } - - if ((value = strchr(name, '=')) != NULL) - *value++ = '\0'; - - type = name; - if (!strcmp(name, "entity")) { - if (entity == NULL) { - isns_error("Cannot create entity object " - "within this key object\n"); - return 0; - } - - if (value != NULL) - isns_object_set_string(entity, - ISNS_TAG_ENTITY_IDENTIFIER, - value); - obj = isns_object_get(entity); - goto handle_attributes; - } else - if (!strcmp(name, "node") - || !strcmp(name, "initiator")) { - const char *node_name; - - node_name = isns_config.ic_source_name; - if (value) - node_name = value; - - obj = isns_create_storage_node(node_name, - ISNS_ISCSI_INITIATOR_MASK, - entity); - last_node = obj; - - isns_addr_set_port((struct sockaddr *) &def_addr, - ISNS_DEFAULT_PORT_INITIATOR); - def_port = "iscsi"; - } else - if (!strcmp(name, "target")) { - const char *node_name; - - node_name = isns_config.ic_source_name; - if (value) - node_name = value; - obj = isns_create_storage_node(node_name, - ISNS_ISCSI_TARGET_MASK, - entity); - last_node = obj; - - isns_addr_set_port((struct sockaddr *) &def_addr, - ISNS_DEFAULT_PORT_TARGET); - def_port = "iscsi-target"; - } else - if (!strcmp(name, "control")) { - const char *node_name; - - node_name = isns_config.ic_control_name; - if (value) - node_name = value; - obj = isns_create_storage_node(node_name, - ISNS_ISCSI_CONTROL_MASK, - entity); - last_node = obj; - - def_port = NULL; - } else - if (!strcmp(name, "portal")) { - isns_portal_info_t portal_info; - - if (value == NULL) { - if (def_port == NULL) - isns_fatal("portal must follow initiator or target\n"); - isns_portal_init(&portal_info, - (struct sockaddr *) &def_addr, - IPPROTO_TCP); - } else - if (!isns_portal_parse(&portal_info, value, def_port)) - isns_fatal("Unable to parse portal=%s\n", value); - obj = isns_create_portal(&portal_info, entity); - last_portal = obj; - } else - if (!strcmp(name, "pg")) { - if (value) - isns_fatal("Unexpected value for portal group\n"); - if (!last_portal || !last_node) - isns_fatal("Portal group registration must follow portal and node\n"); - obj = isns_create_portal_group(last_portal, last_node, 10); - } else { - isns_error("Unknown object type \"%s\"\n", name); - return 0; - } - - if (obj == NULL) { - isns_error("Failure to create %s object\n", name); - return 0; - } - isns_object_list_append(objs, obj); - -handle_attributes: - isns_attr_list_parser_init(&state, obj->ie_template); - state.default_port = def_port; - - if (!isns_parse_attrs(nattrs, attrs, &attrlist, &state) - || !isns_object_set_attrlist(obj, &attrlist)) { - isns_error("Failure to set all %s attributes\n", name); - isns_attr_list_destroy(&attrlist); - return 0; - } - - isns_attr_list_destroy(&attrlist); - isns_object_release(obj); - } - - return 1; -} - -static int -__register_objects(isns_client_t *clnt, - isns_object_t *key_obj, - const isns_object_list_t *objects) -{ - isns_source_t *source = NULL; - isns_simple_t *reg; - uint32_t status; - unsigned int i; - - for (i = 0; i < objects->iol_count && !source; ++i) { - isns_object_t *obj = objects->iol_data[i]; - - if (!isns_object_is_iscsi_node(obj)) - continue; - source = isns_source_from_object(obj); - } - - reg = isns_create_registration2(clnt, key_obj, source); - isns_registration_set_replace(reg, opt_replace); - - /* Add all objects to be registered */ - for (i = 0; i < objects->iol_count; ++i) - isns_registration_add_object(reg, objects->iol_data[i]); - - status = isns_client_call(clnt, ®); - isns_simple_free(reg); - - if (status == ISNS_SUCCESS) - printf("Successfully registered object(s)\n"); - else - isns_error("Failed to register object(s): %s\n", - isns_strerror(status)); - - if (source) - isns_source_release(source); - return status; -} - -int -register_objects(isns_client_t *clnt, - int argc, char **argv) -{ - isns_object_list_t objects = ISNS_OBJECT_LIST_INIT; - isns_object_t *key_obj = NULL; - uint32_t status; - - if (opt_key != NULL) { - isns_attr_list_t key_attrs = ISNS_ATTR_LIST_INIT; - struct isns_attr_list_parser state; - - isns_attr_list_parser_init(&state, NULL); - - if (!isns_parse_attrs(1, &opt_key, &key_attrs, &state)) { - isns_error("Cannot parse registration key \"%s\"\n", - opt_key); - return 0; - } - - key_obj = isns_create_object(isns_attr_list_parser_context(&state), - &key_attrs, NULL); - isns_attr_list_destroy(&key_attrs); - - if (!key_obj) { - isns_error("Cannot create registration key object\n"); - return 0; - } - } else { - /* If the user does not provide a key object, - * create/update an entity. - */ - key_obj = isns_create_entity(ISNS_ENTITY_PROTOCOL_ISCSI, NULL); - } - - if (!parse_registration(argv, argc, &objects, key_obj)) - isns_fatal("Unable to parse registration\n"); - - status = __register_objects(clnt, key_obj, &objects); - isns_object_list_destroy(&objects); - - isns_object_release(key_obj); - return status; -} - -/* - * Parse the query string given by the user - * - * 5.6.5.2 - * The Message Key may contain key or non-key attributes or no - * attributes at all. If multiple attributes are used as the - * Message Key, then they MUST all be from the same object type - * (e.g., IP address and TCP/UDP Port are attributes of the - * Portal object type). - */ -int -parse_query(char **argv, int argc, isns_attr_list_t *keys, isns_attr_list_t *query) -{ - struct isns_attr_list_parser state; - - isns_attr_list_parser_init(&state, NULL); - state.nil_permitted = 1; - - if (argc == 1 && !strcmp(argv[0], "help")) { - printf("Object query:\n" - " isnsadm --query attr=value attr=value ... ?query-attr ?query-attr ...\n" - "All key attributes must refer to a common object type.\n" - "Query attributes specify the attributes the server should return," - "and can refer to any object type.\n" - "The following attributes are recognized:\n"); - isns_attr_list_parser_help(&state); - exit(0); - } - - if (argc == 0) - isns_fatal("Missing query attributes\n"); - - return isns_parse_query_attrs(argc, argv, keys, query, &state); -} - -int -query_objects(isns_client_t *clnt, int argc, char **argv) -{ - isns_attr_list_t query_key = ISNS_ATTR_LIST_INIT; - isns_attr_list_t oper_attrs = ISNS_ATTR_LIST_INIT; - isns_object_list_t objects = ISNS_OBJECT_LIST_INIT; - uint32_t status; - isns_simple_t *qry; - unsigned int i; - - if (!parse_query(argv, argc, &query_key, &oper_attrs)) - isns_fatal("Unable to parse query\n"); - - qry = isns_create_query(clnt, &query_key); - isns_attr_list_destroy(&query_key); - - /* Add the list of attributes we request */ - for (i = 0; i < oper_attrs.ial_count; ++i) - isns_query_request_attr(qry, oper_attrs.ial_data[i]); - isns_attr_list_destroy(&oper_attrs); - - status = isns_client_call(clnt, &qry); - if (status != ISNS_SUCCESS) { - isns_error("Query failed: %s\n", isns_strerror(status)); - return status; - } - - status = isns_query_response_get_objects(qry, &objects); - if (status) { - isns_error("Unable to extract object list from query response: %s\n", - isns_strerror(status), status); - return status; - } - - isns_object_list_print(&objects, isns_print_stdout); - isns_object_list_destroy(&objects); - isns_simple_free(qry); - - return status; -} - -int -query_entity_id(isns_client_t *clnt, int argc, char **argv) -{ - isns_attr_list_t query_key = ISNS_ATTR_LIST_INIT; - isns_object_list_t objects = ISNS_OBJECT_LIST_INIT; - uint32_t status; - isns_simple_t *qry; - const char *eid; - - if (argc == 1 && !strcmp(argv[0], "help")) { - printf("Query iSNS for own entity ID.\n" - "No arguments allowed\n"); - exit(0); - } - if (argc != 0) - isns_fatal("EID query - no arguments accepted\n"); - - isns_attr_list_append_string(&query_key, - ISNS_TAG_ISCSI_NAME, - isns_config.ic_source_name); - qry = isns_create_query(clnt, &query_key); - isns_attr_list_destroy(&query_key); - - isns_query_request_attr_tag(qry, ISNS_TAG_ENTITY_IDENTIFIER); - - status = isns_client_call(clnt, &qry); - if (status != ISNS_SUCCESS) { - isns_error("Query failed: %s\n", isns_strerror(status)); - return status; - } - - status = isns_query_response_get_objects(qry, &objects); - if (status) { - isns_error("Unable to extract object list from query response: %s\n", - isns_strerror(status), status); - return status; - } - - status = ISNS_NO_SUCH_ENTRY; - if (objects.iol_count == 0) { - isns_error("Node %s not registered with iSNS\n", - isns_config.ic_source_name); - } else - if (!isns_object_get_string(objects.iol_data[0], - ISNS_TAG_ENTITY_IDENTIFIER, &eid)) { - isns_error("Query for %s returned an object without EID\n", - isns_config.ic_source_name); - } else { - printf("%s\n", eid); - status = ISNS_SUCCESS; - } - - isns_object_list_destroy(&objects); - isns_simple_free(qry); - - return status; -} - -/* - * Parse the list query string given by the user - */ -int -parse_list(int argc, char **argv, isns_object_template_t **type_p, isns_attr_list_t *keys) -{ - struct isns_attr_list_parser state; - isns_object_template_t *query_type = NULL; - char *type_name; - - if (argc == 0) - usage(1, "Missing object type"); - - if (argc == 1 && !strcmp(argv[0], "help")) { - printf("Object query:\n" - " isnsadm --list type attr=value attr=value ...\n" - "Possible value for :\n" - " entities - list all network entites\n" - " nodes - list all storage nodes\n" - " portals - list all portals\n" - " portal-groups - list all portal groups\n" - " dds - list all discovery domains\n" - " ddsets - list all discovery domains sets\n" - " policies - list all policies (privileged)\n" - "Additional attributes can be specified to scope the\n" - "search. They must match the specified object type.\n" - "\nThe following attributes are recognized:\n"); - isns_attr_list_parser_help(NULL); - exit(0); - } - - type_name = *argv++; --argc; - if (!strcasecmp(type_name, "entities")) - query_type = &isns_entity_template; - else - if (!strcasecmp(type_name, "nodes")) - query_type = &isns_iscsi_node_template; - else - if (!strcasecmp(type_name, "portals")) - query_type = &isns_portal_template; - else - if (!strcasecmp(type_name, "portal-groups")) - query_type = &isns_iscsi_pg_template; - else - if (!strcasecmp(type_name, "dds")) - query_type = &isns_dd_template; - else - if (!strcasecmp(type_name, "ddsets")) - query_type = &isns_ddset_template; - else - if (!strcasecmp(type_name, "policies")) - query_type = &isns_policy_template; - else { - isns_error("Unknown object type \"%s\"\n", - type_name); - return 0; - } - - *type_p = query_type; - - isns_attr_list_parser_init(&state, query_type); - state.nil_permitted = 1; - - return isns_parse_attrs(argc, argv, keys, &state); -} - -int -list_objects(isns_client_t *clnt, int argc, char **argv) -{ - isns_attr_list_t query_keys = ISNS_ATTR_LIST_INIT; - isns_object_template_t *query_type = NULL; - isns_simple_t *simp; - int status, count = 0; - - if (!parse_list(argc, argv, &query_type, &query_keys)) - isns_fatal("Unable to parse parameters\n"); - - simp = isns_create_getnext(clnt, query_type, &query_keys); - while (1) { - isns_object_t *obj = NULL; - isns_simple_t *followup; - - status = isns_client_call(clnt, &simp); - if (status) - break; - - status = isns_getnext_response_get_object(simp, &obj); - if (status) - break; - - printf("Object %u:\n", count++); - isns_object_print(obj, isns_print_stdout); - isns_object_release(obj); - - followup = isns_create_getnext_followup(clnt, - simp, &query_keys); - isns_simple_free(simp); - simp = followup; - } - - if (status == ISNS_SOURCE_UNAUTHORIZED - && query_type == &isns_policy_template - && !opt_local) - isns_warning("Please use --local trying to list policies\n"); - - if (status != ISNS_NO_SUCH_ENTRY) { - isns_error("GetNext call failed: %s\n", - isns_strerror(status)); - return status; - } - return ISNS_SUCCESS; -} - -/* - * Parse the deregistration string given by the user - * - * 5.6.5.2 - * The Message Key may contain key or non-key attributes or no - * attributes at all. If multiple attributes are used as the - * Message Key, then they MUST all be from the same object type - * (e.g., IP address and TCP/UDP Port are attributes of the - * Portal object type). - */ -int -parse_deregistration(char **argv, int argc, isns_attr_list_t *keys) -{ - struct isns_attr_list_parser state; - - isns_attr_list_parser_init(&state, NULL); - state.multi_type_permitted = 1; - state.nil_permitted = 1; - - if (argc == 1 && !strcmp(argv[0], "help")) { - printf("Object deregistration:\n" - " isnsadm --deregister attr=value attr=value ...\n" - "All attributes must refer to a common object type.\n" - "\nThe following attributes are recognized:\n"); - isns_attr_list_parser_help(&state); - exit(0); - } - - return isns_parse_attrs(argc, argv, keys, &state); -} - -int -deregister_objects(isns_client_t *clnt, int argc, char **argv) -{ - isns_attr_list_t query_key = ISNS_ATTR_LIST_INIT; - isns_object_list_t objects = ISNS_OBJECT_LIST_INIT; - isns_simple_t *dereg; - uint32_t status; - - if (!parse_deregistration(argv, argc, &query_key)) - isns_fatal("Unable to parse unregistration\n"); - - dereg = isns_create_deregistration(clnt, &query_key); - isns_attr_list_destroy(&query_key); - - status = isns_client_call(clnt, &dereg); - if (status != ISNS_SUCCESS) { - isns_error("Deregistration failed: %s\n", - isns_strerror(status)); - return status; - } - -#if 0 - status = isns_dereg_msg_response_get_objects(dereg, &objects); - if (status) { - isns_error("Unable to extract object list from deregistration response: %s\n", - isns_strerror(status), status); - goto done; - } - isns_object_list_print(&objects, isns_print_stdout); -#endif - - isns_object_list_destroy(&objects); - isns_simple_free(dereg); - - return status; -} - -/* - * Handle discovery domain registration/deregistration - */ -int -parse_dd_registration(char **argv, int argc, isns_attr_list_t *keys) -{ - struct isns_attr_list_parser state; - - isns_attr_list_parser_init(&state, &isns_dd_template); - if (argc == 1 && !strcmp(argv[0], "help")) { - printf("Object query:\n" - " isnsadm --dd-register attr=value attr=value ...\n" - "You cannot specify more than one domain.\n" - "If you want to modify an existing domain, you must specify its ID.\n" - "The following attributes are recognized:\n"); - isns_attr_list_parser_help(&state); - exit(0); - } - - return isns_parse_attrs(argc, argv, keys, &state); -} - -int -register_domain(isns_client_t *clnt, int argc, char **argv) -{ - isns_attr_list_t attrs = ISNS_ATTR_LIST_INIT; - isns_simple_t *msg; - uint32_t status; - - if (!parse_dd_registration(argv, argc, &attrs)) - isns_fatal("Unable to parse DD registration\n"); - - msg = isns_create_dd_registration(clnt, &attrs); - isns_attr_list_destroy(&attrs); - - if (msg == NULL) { - isns_error("Cannot create message\n"); - return ISNS_INTERNAL_ERROR; - } - - status = isns_client_call(clnt, &msg); - if (status != ISNS_SUCCESS) { - isns_error("Registration failed: %s\n", - isns_strerror(status)); - return status; - } - - if (status == ISNS_SUCCESS) { - printf("Registered DD:\n"); - isns_attr_list_print( - isns_simple_get_attrs(msg), - isns_print_stdout); - } - isns_simple_free(msg); - - return status; -} - -int -parse_dd_deregistration(char **argv, int argc, - uint32_t *dd_id, isns_attr_list_t *keys) -{ - struct isns_attr_list_parser state; - - isns_attr_list_parser_init(&state, &isns_dd_template); - if (argc == 0 || (argc == 1 && !strcmp(argv[0], "help"))) { - printf("DD deregistration:\n" - " isnsadm --dd-deregister dd-id attr=value attr=value ...\n" - "You cannot specify more than one domain.\n" - "The following attributes are recognized:\n"); - isns_attr_list_parser_help(&state); - exit(0); - } - - *dd_id = parse_count(argv[0]); - - return isns_parse_attrs(argc - 1, argv + 1, keys, &state); -} - -int -deregister_domain(isns_client_t *clnt, int argc, char **argv) -{ - isns_attr_list_t attrs = ISNS_ATTR_LIST_INIT; - isns_simple_t *msg; - uint32_t dd_id, status; - - if (!parse_dd_deregistration(argv, argc, &dd_id, &attrs)) - isns_fatal("Unable to parse DD registration\n"); - - msg = isns_create_dd_deregistration(clnt, dd_id, &attrs); - isns_attr_list_destroy(&attrs); - - if (msg == NULL) { - isns_error("Cannot create message\n"); - return ISNS_INTERNAL_ERROR; - } - - status = isns_client_call(clnt, &msg); - if (status != ISNS_SUCCESS) { - isns_error("Deregistration failed: %s\n", - isns_strerror(status)); - return status; - } - - isns_simple_free(msg); - return status; -} - -/* - * Parse a policy - */ -int -parse_policy(int argc, char **argv, isns_attr_list_t *attrs, - const char *help_title, const char *help_action) -{ - struct isns_attr_list_parser state; - - isns_attr_list_parser_init(&state, &isns_policy_template); - state.nil_permitted = 0; - state.load_key = load_key_callback; - state.generate_key = generate_key_callback; - - if (argc == 1 && !strcmp(argv[0], "help")) { - printf("%s:\n" - " isnsadm %s attr=value attr=value ...\n" - "Specifying a Security Policy Index is mandatory.\n" - "\nThe following attributes are recognized:\n", - help_title, help_action); - isns_attr_list_parser_help(&state); - exit(0); - } - - return isns_parse_attrs(argc, argv, attrs, &state); -} - -static int -__create_policy(isns_client_t *clnt, const isns_attr_list_t *attrs) -{ - isns_object_list_t objects = ISNS_OBJECT_LIST_INIT; - isns_object_t *obj; - int status; - - obj = isns_create_object(&isns_policy_template, attrs, NULL); - if (!obj) - isns_fatal("Cannot create policy object\n"); - isns_object_list_append(&objects, obj); - - status = __register_objects(clnt, NULL, &objects); - isns_object_list_destroy(&objects); - return status; -} - -/* - * Enroll a new client - */ -int -enroll_client(isns_client_t *clnt, int argc, char **argv) -{ - isns_attr_list_t attrs = ISNS_ATTR_LIST_INIT; - const char *client_name; - int status; - - if (argc == 0) - usage(1, "Missing client name"); - - client_name = *argv++; --argc; - - isns_attr_list_append_string(&attrs, - OPENISNS_TAG_POLICY_SPI, - client_name); -#if 0 - isns_attr_list_append_string(&attrs, - OPENISNS_TAG_POLICY_SOURCE_NAME, - client_name); -#endif - - if (!opt_keyfile) { - static char namebuf[PATH_MAX]; - - snprintf(namebuf, sizeof(namebuf), "%s.key", client_name); - opt_keyfile = namebuf; - } - - if (argc && !parse_policy(argc, argv, &attrs, - "Enroll an iSNS client", - "--enroll hostname")) - isns_fatal("Cannot parse policy\n"); - - /* If no key is given, generate one */ - if (!isns_attr_list_contains(&attrs, OPENISNS_TAG_POLICY_KEY)) { - printf("No key given, generating one\n"); - isns_attr_list_append_attr(&attrs, - generate_key_callback()); - } - - status = __create_policy(clnt, &attrs); - isns_attr_list_destroy(&attrs); - return status; -} - - -/* - * Create a new policy - */ -int -edit_policy(isns_client_t *clnt, int argc, char **argv) -{ - isns_attr_list_t attrs = ISNS_ATTR_LIST_INIT; - int status; - - if (!parse_policy(argc, argv, &attrs, - "Edit an existing policy", - "--edit-policy")) - isns_fatal("Cannot parse policy\n"); - - status = __create_policy(clnt, &attrs); - isns_attr_list_destroy(&attrs); - - return status; -} - -#ifdef WITH_SECURITY -static isns_attr_t * -__key_to_attr(EVP_PKEY *pkey) -{ - struct __isns_opaque key; - isns_value_t value; - isns_attr_t *attr = NULL; - - if (!isns_dsa_encode_public(pkey, &key.ptr, &key.len)) - goto out; - - /* Must pad key. This means we may end up encoding a few - * bytes of trash. Oh well. */ - key.len = ISNS_PAD(key.len); - - value = ISNS_VALUE_INIT(opaque, key); - attr = isns_attr_alloc(OPENISNS_TAG_POLICY_KEY, NULL, &value); - - isns_free(key.ptr); - -out: - EVP_PKEY_free(pkey); - return attr; -} - -isns_attr_t * -generate_key_callback(void) -{ - EVP_PKEY *pkey; - - if (opt_keyfile == NULL) - isns_fatal("Key generation requires --keyfile option\n"); - - if (!(pkey = isns_dsa_generate_key())) - isns_fatal("Key generation failed\n"); - - if (!isns_dsa_store_private(opt_keyfile, pkey)) - isns_fatal("Unable to write private key to %s\n", - opt_keyfile); - - printf("Stored DSA private key in %s\n", opt_keyfile); - return __key_to_attr(pkey); -} - -isns_attr_t * -load_key_callback(const char *pathname) -{ - EVP_PKEY *pkey; - - if (!(pkey = isns_dsa_load_public(pathname))) - isns_fatal("Unable to load public key from file %s\n", pathname); - - return __key_to_attr(pkey); -} - -#else /* WITH_SECURITY */ -isns_attr_t * -generate_key_callback(void) -{ - isns_fatal("Authentication disabled in this build\n"); - return NULL; -} - -isns_attr_t * -load_key_callback(const char *pathname) -{ - isns_fatal("Authentication disabled in this build\n"); - return NULL; -} - -#endif diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/isnsd.c open-iscsi-2.0.874/utils/open-isns/isnsd.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/isnsd.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/isnsd.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,299 +0,0 @@ -/* - * isnsd - the iSNS Daemon - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include -#include -#include -#include -#include -#include - -#ifdef MTRACE -# include -#endif - -#include -#include "security.h" -#include "util.h" -#include "paths.h" -#include "internal.h" - -enum { - MODE_NORMAL, - MODE_DUMP_DB, - MODE_INIT, -}; - -static const char * opt_configfile = ISNS_DEFAULT_ISNSD_CONFIG; -static int opt_af = AF_UNSPEC; -static int opt_mode = MODE_NORMAL; -static int opt_foreground = 0; - -static char * slp_url; - -static int init_server(void); -static void run_server(isns_server_t *, isns_db_t *); -static void usage(int, const char *); -static void cleanup(int); - -static struct option options[] = { - { "config", required_argument, NULL, 'c' }, - { "debug", required_argument, NULL, 'd' }, - { "foreground", no_argument, NULL, 'f' }, - { "init", no_argument, NULL, MODE_INIT }, - { "dump-db", no_argument, NULL, MODE_DUMP_DB }, - { "help", no_argument, NULL, 'h' }, - { "version", no_argument, NULL, 'V' }, - { NULL } -}; - -int -main(int argc, char **argv) -{ - isns_server_t *server; - isns_source_t *source; - isns_db_t *db; - int c; - -#ifdef MTRACE - mtrace(); -#endif - - while ((c = getopt_long(argc, argv, "46c:d:fh", options, NULL)) != -1) { - switch (c) { - case '4': - opt_af = AF_INET; - break; - - case '6': - opt_af = AF_INET6; - break; - - case 'c': - opt_configfile = optarg; - break; - - case 'd': - isns_enable_debugging(optarg); - break; - - case 'f': - opt_foreground = 1; - break; - - case MODE_DUMP_DB: - case MODE_INIT: - opt_mode = c; - break; - - case 'h': - usage(0, NULL); - - case 'V': - printf("Open-iSNS version %s\n" - "Copyright (C) 2007, Olaf Kirch \n", - OPENISNS_VERSION_STRING); - return 0; - - default: - usage(1, "Unknown option"); - } - } - - if (optind != argc) - usage(1, NULL); - - isns_read_config(opt_configfile); - - if (!isns_config.ic_source_name) - usage(1, "Please specify an iSNS source name"); - source = isns_source_create_iscsi(isns_config.ic_source_name); - - if (opt_mode == MODE_INIT) - return !init_server(); - - if (opt_mode == MODE_NORMAL) - isns_write_pidfile(isns_config.ic_pidfile); - - db = isns_db_open(isns_config.ic_database); - if (db == NULL) - isns_fatal("Unable to open database\n"); - - if (opt_mode == MODE_DUMP_DB) { - isns_db_print(db, isns_print_stdout); - exit(0); - } - - if (!opt_foreground) { - if (daemon(0, 0) < 0) - isns_fatal("Unable to background server process\n"); - isns_log_background(); - isns_update_pidfile(isns_config.ic_pidfile); - } - - signal(SIGTERM, cleanup); - signal(SIGINT, cleanup); - - server = isns_create_server(source, db, &isns_default_service_ops); - - run_server(server, db); - return 0; -} - -void -usage(int exval, const char *msg) -{ - if (msg) - fprintf(stderr, "Error: %s\n", msg); - fprintf(stderr, - "Usage: isnsd [options]\n\n" - " --config Specify alternative config fille\n" - " --foreground Do not put daemon in the background\n" - " --debug Enable debugging (list of debug flags)\n" - " --init Initialize the server (key generation etc)\n" - " --dump-db Display the database contents and exit\n" - " --help Print this message\n" - ); - exit(exval); -} - -void -cleanup(int sig) -{ - isns_remove_pidfile(isns_config.ic_pidfile); - exit(1); -} - -static void -slp_cleanup(void) -{ - char *url = slp_url; - - slp_url = NULL; - if (url) { - isns_slp_unregister(url); - isns_free(url); - } -} - -/* - * Initialize server - */ -int -init_server(void) -{ - if (!isns_security_init()) - return 0; - - /* Anything else? */ - - return 1; -} - -/* - * Server main loop - */ -void -run_server(isns_server_t *server, isns_db_t *db) -{ - isns_socket_t *sock; - isns_security_t *ctx = NULL; - isns_message_t *msg, *resp; - int status; - - if (isns_config.ic_security) { - const char *ksname; - isns_keystore_t *ks; - - ctx = isns_default_security_context(1); - if (!(ksname = isns_config.ic_client_keystore)) - isns_fatal("config problem: no key store specified\n"); - if (!strcasecmp(ksname, "db:")) - ks = isns_create_db_keystore(db); - else - ks = isns_create_keystore(ksname); - if (ks == NULL) - isns_fatal("Unable to create keystore %s\n", ksname); - isns_security_set_keystore(ctx, ks); - } - - status = isns_dd_load_all(db); - if (status != ISNS_SUCCESS) - isns_fatal("Problem loading Discovery Domains from database\n"); - - if (isns_config.ic_control_socket) { - sock = isns_create_server_socket(isns_config.ic_control_socket, - NULL, AF_UNSPEC, SOCK_STREAM); - if (sock == NULL) - isns_fatal("Unable to create control socket\n"); - /* - isns_socket_set_security_ctx(sock, ctx); - */ - } - - sock = isns_create_server_socket(isns_config.ic_bind_address, - "isns", opt_af, SOCK_STREAM); - if (sock == NULL) - isns_fatal("Unable to create server socket\n"); - isns_socket_set_security_ctx(sock, ctx); - - if (isns_config.ic_slp_register) { - slp_url = isns_slp_build_url(0); - isns_slp_register(slp_url); - - atexit(slp_cleanup); - } - - isns_esi_init(server); - isns_scn_init(server); - - while (1) { - struct timeval timeout = { 0, 0 }; - time_t now, then, next_timeout = time(NULL) + 3600; - - /* Expire entities that haven't seen any activity - * for a while. */ - if (isns_config.ic_registration_period) { - then = isns_db_expire(db); - if (then && then < next_timeout) - next_timeout = then; - } - - /* Run any timers (eg for ESI) */ - then = isns_run_timers(); - if (then && then < next_timeout) - next_timeout = then; - - /* There may be pending SCNs, push them out now */ - then = isns_scn_transmit_all(); - if (then && then < next_timeout) - next_timeout = then; - - /* Purge any objects that have been marked for removal - * from the DB (deleting them, or moving them to limbo - * state). */ - isns_db_purge(db); - - /* Determine how long we can sleep before working - * the ESI queues and DB expiry again. */ - now = time(NULL); - if (next_timeout <= now) - continue; - timeout.tv_sec = next_timeout - now; - - if ((msg = isns_recv_message(&timeout)) == NULL) - continue; - - if ((resp = isns_process_message(server, msg)) != NULL) { - isns_socket_t *sock = isns_message_socket(msg); - - isns_socket_send(sock, resp); - isns_message_release(resp); - } - - isns_message_release(msg); - } -} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/isnsdd.c open-iscsi-2.0.874/utils/open-isns/isnsdd.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/isnsdd.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/isnsdd.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1153 +0,0 @@ -/* - * isnsdd - the iSNS Discovery Daemon - * - * Copyright (C) 2007 Olaf Kirch - * - * The way isnsdd communicates with local services (initiator, - * target) is via a set of files and signals. That sounds rather - * awkward, but it's a lot simpler to add to these services - * than another socket based communication mechanism I guess. - */ - -#include -#include -#include -#include -#include -#include -#include - -#ifdef MTRACE -# include -#endif - -#include -#include "security.h" -#include "util.h" -#include "isns-proto.h" -#include "paths.h" -#include "attrs.h" - -enum { - ROLE_INITIATOR = 1, - ROLE_MONITOR = 2, -}; - -#define ISNSDD_REG_NAME "isns" -#define ISNSDD_PGT_OFFSET 10000 -#define MAX_RETRY_TIMEOUT 300 - -typedef struct isns_proxy isns_proxy_t; -struct isns_proxy { - isns_list_t ip_list; - char * ip_eid; - isns_object_t * ip_entity; - isns_client_t * ip_client; - isns_object_list_t ip_objects; - time_t ip_last_registration; -}; - -static const char * opt_configfile = ISNS_DEFAULT_ISNSDD_CONFIG; -static int opt_af = AF_INET6; -static int opt_foreground = 0; -static int opt_role = ROLE_INITIATOR; -static int opt_scn_bits = ISNS_SCN_OBJECT_UPDATED_MASK | - ISNS_SCN_OBJECT_ADDED_MASK | - ISNS_SCN_OBJECT_REMOVED_MASK | - ISNS_SCN_TARGET_AND_SELF_ONLY_MASK; -static unsigned int opt_retry_timeout = 10; -static int opt_esi = 1; - -static isns_socket_t * server_socket; -static ISNS_LIST_DECLARE(proxies); -static isns_object_list_t local_registry = ISNS_OBJECT_LIST_INIT; -static isns_object_list_t local_portals = ISNS_OBJECT_LIST_INIT; -static isns_object_list_t visible_nodes = ISNS_OBJECT_LIST_INIT; -static unsigned int esi_interval; -static int should_reexport; - -static void run_discovery(isns_server_t *srv); -static void scn_callback(isns_db_t *, uint32_t, - isns_object_template_t *, - const char *, const char *); -static void refresh_registration(void *); -static void retry_registration(void *); -static void load_exported_objects(void); -static void store_imported_objects(void); -static void usage(int, const char *); - -static void install_sighandler(int, void (*func)(int)); -static void sig_cleanup(int); -static void sig_reread(int); - -static struct option options[] = { - { "config", required_argument, NULL, 'c' }, - { "debug", required_argument, NULL, 'd' }, - { "foreground", no_argument, NULL, 'f' }, - { "role", required_argument, NULL, 'r' }, - { "no-esi", no_argument, NULL, 'E' }, - { "help", no_argument, NULL, 'h' }, - { "version", no_argument, NULL, 'V' }, - { NULL } -}; - -int -main(int argc, char **argv) -{ - isns_server_t *server; - isns_source_t *source; - isns_db_t *db; - int c; - -#ifdef MTRACE - mtrace(); -#endif - - while ((c = getopt_long(argc, argv, "46c:d:Efhr:", options, NULL)) != -1) { - switch (c) { - case '4': - opt_af = AF_INET; - break; - - case '6': - opt_af = AF_INET6; - break; - - case 'c': - opt_configfile = optarg; - break; - - case 'd': - isns_enable_debugging(optarg); - break; - - case 'E': - opt_esi = 0; - break; - - case 'f': - opt_foreground = 1; - break; - - case 'h': - usage(0, NULL); - - case 'r': - if (!strcasecmp(optarg, "initiator")) - opt_role = ROLE_INITIATOR; - else - if (!strcasecmp(optarg, "control") - || !strcasecmp(optarg, "monitor")) - opt_role = ROLE_MONITOR; - else { - isns_error("Unknown role \"%s\"\n", optarg); - usage(1, NULL); - } - break; - - case 'V': - printf("Open-iSNS version %s\n" - "Copyright (C) 2007, Olaf Kirch \n", - OPENISNS_VERSION_STRING); - return 0; - - default: - usage(1, "Unknown option"); - } - } - - if (optind != argc) - usage(1, NULL); - - /* If the config code derives the source name - * automatically, we want it to be distinct from - * any other source name (chosen by eg the iSCSI - * initiator). Adding a suffix of ":isns" is a - * somewhat lame attempt. - */ - isns_config.ic_source_suffix = "isns"; - - isns_read_config(opt_configfile); - - if (!isns_config.ic_source_name) - usage(1, "Please specify an iSNS source name"); - source = isns_source_create_iscsi(isns_config.ic_source_name); - - isns_write_pidfile(isns_config.ic_pidfile); - - if (!opt_foreground) { - if (daemon(0, 0) < 0) - isns_fatal("Unable to background server process\n"); - isns_log_background(); - isns_update_pidfile(isns_config.ic_pidfile); - } - - install_sighandler(SIGTERM, sig_cleanup); - install_sighandler(SIGINT, sig_cleanup); - install_sighandler(SIGUSR2, sig_reread); - - /* Create a DB object that shadows our portal list. This is for ESI - - * when an ESI comes in, the library will look up the portal in this - * database, and update its mtime. By checking the mtime at regular - * intervals, we can verify whether the server's ESIs actually - * reach us. - */ - db = isns_db_open_shadow(&local_portals); - - server = isns_create_server(source, db, &isns_callback_service_ops); - isns_server_set_scn_callback(server, scn_callback); - - run_discovery(server); - return 0; -} - -void -usage(int exval, const char *msg) -{ - if (msg) - fprintf(stderr, "Error: %s\n", msg); - fprintf(stderr, - "Usage: isnsdd [options]\n\n" - " --role Specify role (one of initiator, control)\n" - " --config Specify alternative config fille\n" - " --foreground Do not put daemon in the background\n" - " --no-esi Do not try to register an portals for ESI status inquiries\n" - " --debug Enable debugging (list of debug flags)\n" - " --help Print this message\n" - ); - exit(exval); -} - -void -install_sighandler(int signo, void (*func)(int)) -{ - struct sigaction act; - - memset(&act, 0, sizeof(act)); - act.sa_handler = func; - sigaction(signo, &act, NULL); -} - -void -sig_reread(int sig) -{ - should_reexport = 1; -} - -void -sig_cleanup(int sig) -{ - isns_remove_pidfile(isns_config.ic_pidfile); - exit(1); -} - -/* - * Proxy handling functions - */ -static isns_proxy_t * -isns_create_proxy(const char *eid) -{ - isns_proxy_t *proxy; - - proxy = calloc(1, sizeof(*proxy)); - isns_list_init(&proxy->ip_list); - proxy->ip_eid = strdup(eid); - return proxy; -} - -static isns_proxy_t * -__isns_proxy_find(isns_list_t *head, const char *eid) -{ - isns_list_t *pos, *next; - - isns_list_foreach(head, pos, next) { - isns_proxy_t *proxy = isns_list_item(isns_proxy_t, ip_list, pos); - - if (!strcmp(proxy->ip_eid, eid)) - return proxy; - } - return NULL; -} - -static isns_proxy_t * -isns_proxy_by_entity(const isns_object_t *entity) -{ - isns_list_t *pos, *next; - - isns_list_foreach(&proxies, pos, next) { - isns_proxy_t *proxy = isns_list_item(isns_proxy_t, ip_list, pos); - - if (proxy->ip_entity == entity) - return proxy; - } - return NULL; -} - -static void -isns_proxy_erase(isns_proxy_t *proxy) -{ - isns_object_list_destroy(&proxy->ip_objects); - if (proxy->ip_client) { - isns_client_destroy(proxy->ip_client); - proxy->ip_client = NULL; - } - if (proxy->ip_entity) { - isns_object_release(proxy->ip_entity); - proxy->ip_entity = NULL; - } - isns_cancel_timer(refresh_registration, proxy); -} - -static void -isns_proxy_free(isns_proxy_t *proxy) -{ - isns_proxy_erase(proxy); - isns_list_del(&proxy->ip_list); - free(&proxy->ip_eid); - free(proxy); -} - -/* - * Force a re-registration of the whole object set. - */ -static void -force_reregistration(isns_proxy_t *proxy) -{ - isns_cancel_timer(refresh_registration, proxy); - isns_add_oneshot_timer(0, retry_registration, proxy); -} - -/* - * Refresh the registration by calling DevAttrQry - */ -static void -refresh_registration(void *ptr) -{ - isns_proxy_t *proxy = ptr; - isns_client_t *clnt = proxy->ip_client; - isns_object_list_t objects = ISNS_OBJECT_LIST_INIT; - isns_attr_list_t query_key = ISNS_ATTR_LIST_INIT; - isns_simple_t *qry = NULL; - uint32_t status; - - isns_debug_state("Refreshing registration for %s\n", proxy->ip_eid); - isns_attr_list_append_string(&query_key, - ISNS_TAG_ENTITY_IDENTIFIER, - proxy->ip_eid); - - qry = isns_create_query(clnt, &query_key); - isns_attr_list_destroy(&query_key); - - /* We should have an async call mechanism. If the server - * is wedged, we'll block here, unable to service any other - * functions. - */ - status = isns_simple_call(clnt->ic_socket, &qry); - if (status != ISNS_SUCCESS) { - isns_error("Query failed: %s\n", isns_strerror(status)); - goto re_register; - } - - status = isns_query_response_get_objects(qry, &objects); - isns_simple_free(qry); - - if (status == ISNS_SUCCESS) { - if (objects.iol_count != 0) - return; - } else { - isns_error("Unable to parse query response\n"); - } - -re_register: - isns_warning("Lost registration, trying to re-register\n"); - force_reregistration(proxy); -} - -/* - * Check if all portals have seen ESI messages from the server - */ -static void -check_portal_registration(void *ptr) -{ - isns_object_list_t bad_portals = ISNS_OBJECT_LIST_INIT; - unsigned int i, need_reregister = 0, good_portals = 0; - time_t now; - - isns_debug_state("%s()\n", __FUNCTION__); - now = time(NULL); - for (i = 0; i < local_portals.iol_count; ++i) { - isns_object_t *obj = local_portals.iol_data[i]; - isns_portal_info_t portal_info; - isns_proxy_t *proxy; - time_t last_modified; - uint32_t interval; - - if (!isns_object_get_uint32(obj, ISNS_TAG_ESI_INTERVAL, &interval)) - continue; - - last_modified = isns_object_last_modified(obj); - if (last_modified + 2 * interval > now) { - good_portals++; - continue; - } - - isns_portal_from_object(&portal_info, - ISNS_TAG_PORTAL_IP_ADDRESS, - ISNS_TAG_PORTAL_TCP_UDP_PORT, - obj); - - isns_notice("Portal %s did not receive ESIs within %u seconds - " - "server may have lost us.\n", - isns_portal_string(&portal_info), - now - last_modified); - - proxy = isns_proxy_by_entity(isns_object_get_entity(obj)); - if (!proxy) - continue; - - /* If we haven't received ANY ESIs, ever, the portal - * may be using a non-routable IP */ - if (last_modified <= proxy->ip_last_registration) - isns_object_list_append(&bad_portals, obj); - - force_reregistration(proxy); - need_reregister++; - } - - for (i = 0; i < bad_portals.iol_count; ++i) - isns_object_list_remove(&local_portals, bad_portals.iol_data[i]); - isns_object_list_destroy(&bad_portals); - - if (need_reregister && local_portals.iol_count == 0) { - /* Force a re-registration from scratch. - * This time without ESI. - */ - isns_notice("Suspiciously little ESI traffic - server may be broken\n"); - isns_notice("Disabling ESI\n"); - opt_esi = 0; - } -} - -static void -setup_esi_watchdog(void) -{ - unsigned int i; - - isns_cancel_timer(check_portal_registration, NULL); - esi_interval = 0; - - for (i = 0; i < local_portals.iol_count; ++i) { - isns_object_t *obj = local_portals.iol_data[i]; - uint32_t interval; - - /* should always succeed */ - if (isns_object_get_uint32(obj, ISNS_TAG_ESI_INTERVAL, &interval)) - continue; - - if (!esi_interval || interval < esi_interval) - esi_interval = interval; - } - - if (esi_interval) { - isns_debug_state("Setting up timer to check for ESI reachability\n"); - isns_add_timer(esi_interval * 4 / 5, - check_portal_registration, - NULL); - } -} - -static void -load_exported_objects(void) -{ - isns_debug_state("Reading list of exported objects\n"); - isns_object_list_destroy(&local_registry); - if (!isns_local_registry_load("!" ISNSDD_REG_NAME, 0, &local_registry)) { - isns_warning("Unable to obtain locally registered objects\n"); - return; - } -} - -static void -store_imported_objects(void) -{ - if (!isns_local_registry_store(ISNSDD_REG_NAME, 0, &visible_nodes)) - isns_warning("Unable to store discovered objects\n"); -} - -/* - * Given the DevAttrReg response, extract the entity ID we - * have been assigned. - */ -static int -extract_entity_id(isns_proxy_t *proxy, isns_simple_t *resp) -{ - isns_object_list_t resp_objects = ISNS_OBJECT_LIST_INIT; - isns_object_t *entity = NULL; - int status; - unsigned int i; - - status = isns_query_response_get_objects(resp, &resp_objects); - if (status) { - isns_error("Unable to extract object list from " - "registration response: %s\n", - isns_strerror(status), status); - goto out; - } - - for (i = 0; i < resp_objects.iol_count; ++i) { - isns_object_t *obj = resp_objects.iol_data[i]; - uint32_t interval; - - if (!isns_object_is_entity(obj)) - continue; - - if (entity) { - isns_error("Server returns more than one entity " - "in registration response. What a weirdo.\n"); - continue; - } - entity = obj; - - if (!isns_object_get_uint32(obj, - ISNS_TAG_REGISTRATION_PERIOD, - &interval)) - continue; - - if (interval == 0) { - isns_error("Server returns a registration period of 0\n"); - continue; - } - - isns_debug_state("Setting up timer for registration refresh\n"); - isns_add_timer(interval / 2, - refresh_registration, - proxy); - } - - for (i = 0; i < resp_objects.iol_count; ++i) { - isns_attr_list_t key_attrs = ISNS_ATTR_LIST_INIT; - isns_object_t *obj = resp_objects.iol_data[i]; - uint32_t interval; - - if (!isns_object_is_portal(obj) - || !isns_object_get_uint32(obj, ISNS_TAG_ESI_INTERVAL, &interval)) - continue; - - if (interval == 0) { - isns_error("Server returns an ESI interval of 0\n"); - continue; - } - - isns_object_get_key_attrs(obj, &key_attrs); - if (!(obj = isns_object_list_lookup(&proxy->ip_objects, NULL, &key_attrs))) { - isns_error("Server response includes a portal we never registered\n"); - continue; - } - - isns_object_set_uint32(obj, ISNS_TAG_ESI_INTERVAL, interval); - - /* Server enabled ESI for this portal, so add it to - * the list of local portals we regularly check for - * incoming ESI messages. */ - isns_object_list_append(&local_portals, obj); - } - - proxy->ip_last_registration = time(NULL); -out: - isns_object_list_destroy(&resp_objects); - return status; -} - -static inline void -__add_release_object(isns_object_list_t *objects, isns_object_t *cur) -{ - if (cur == NULL) - return; - isns_object_list_append(objects, cur); - isns_object_release(cur); -} - -/* - * Rebuild the list of proxies given the set of entities - */ -void -rebuild_proxy_list(isns_object_list_t *entities, isns_list_t *old_list) -{ - isns_proxy_t *proxy; - unsigned int i; - - isns_list_move(old_list, &proxies); - - for (i = 0; i < entities->iol_count; ++i) { - isns_object_t *entity = entities->iol_data[i]; - isns_object_t *node; - const char *eid; - - eid = isns_entity_name(entity); - if (eid == NULL) { - isns_error("Whoopee, entity without name\n"); - continue; - } - - proxy = __isns_proxy_find(old_list, eid); - if (proxy == NULL) { - proxy = isns_create_proxy(eid); - } else { - isns_proxy_erase(proxy); - } - - isns_object_list_append(&proxy->ip_objects, entity); - isns_object_get_descendants(entity, NULL, &proxy->ip_objects); - - node = isns_object_list_lookup(&proxy->ip_objects, - &isns_iscsi_node_template, - NULL); - if (node == NULL) { - isns_warning("Service %s did not register any " - "storage nodes - skipped\n", eid); - continue; - } - - proxy->ip_client = isns_create_client(NULL, - isns_storage_node_name(node)); - proxy->ip_entity = isns_object_get(entity); - - isns_list_del(&proxy->ip_list); - isns_list_append(&proxies, &proxy->ip_list); - } -} - -/* - * Unregister old proxies - */ -static void -unregister_entities(isns_list_t *list) -{ - while (!isns_list_empty(list)) { - isns_proxy_t *proxy = isns_list_item(isns_proxy_t, ip_list, list->next); - - /* XXX send a DevDereg */ - isns_proxy_free(proxy); - } -} - -/* - * The local registry creates fake entities to group objects - * registered by the same service. We use this to perform - * several registration calls, each with a different EID - */ -static int -register_entity(isns_proxy_t *proxy) -{ - isns_client_t *clnt = proxy->ip_client; - isns_simple_t *call = NULL; - int status; - - call = isns_create_registration(clnt, proxy->ip_entity); - isns_registration_set_replace(call, 1); - isns_registration_add_object_list(call, &proxy->ip_objects); - - status = isns_simple_call(clnt->ic_socket, &call); - if (status == ISNS_SUCCESS) { - /* Extract the EID and registration period */ - extract_entity_id(proxy, call); - } - - isns_simple_free(call); - return status; -} - -static int -register_exported_entities(void) -{ - int status = ISNS_SUCCESS; - isns_list_t *pos, *next; - - isns_list_foreach(&proxies, pos, next) { - isns_proxy_t *proxy = isns_list_item(isns_proxy_t, ip_list, pos); - - status = register_entity(proxy); - if (status != ISNS_SUCCESS) - break; - } - - setup_esi_watchdog(); - return status; -} - -static void -all_objects_set(isns_object_list_t *list, uint32_t tag, uint32_t value) -{ - unsigned int i; - - for (i = 0; i < list->iol_count; ++i) { - isns_object_t *obj = list->iol_data[i]; - - isns_object_set_uint32(obj, tag, value); - } -} - -static void -all_objects_unset(isns_object_list_t *list, uint32_t tag) -{ - unsigned int i; - - for (i = 0; i < list->iol_count; ++i) { - isns_object_t *obj = list->iol_data[i]; - - isns_object_delete_attr(obj, tag); - } -} - -static int -register_exported_objects(isns_client_t *clnt) -{ - isns_portal_info_t portal_info; - isns_object_list_t entities = ISNS_OBJECT_LIST_INIT; - isns_object_list_t portals = ISNS_OBJECT_LIST_INIT; - isns_simple_t *call = NULL; - int status, with_esi; - unsigned int i, my_port; - isns_list_t old_proxies; - - if (!isns_socket_get_portal_info(server_socket, &portal_info)) - isns_fatal("Unable to get portal info\n"); - my_port = isns_portal_tcpudp_port(&portal_info); - - /* Look up all entites and portals */ - isns_object_list_gang_lookup(&local_registry, - &isns_entity_template, NULL, - &entities); - isns_object_list_gang_lookup(&local_registry, - &isns_portal_template, NULL, - &portals); - - isns_list_init(&old_proxies); - rebuild_proxy_list(&entities, &old_proxies); - unregister_entities(&old_proxies); - - /* Enable SCN on all portals we're about to register */ - all_objects_set(&portals, ISNS_TAG_SCN_PORT, my_port); - - /* Try ESI first. If the server doesn't support it, or doesn't - * have the resources to serve us, fall back to normal - * registration refresh. */ - if (opt_esi) { - all_objects_set(&portals, - ISNS_TAG_ESI_INTERVAL, - isns_config.ic_esi_min_interval); - all_objects_set(&portals, - ISNS_TAG_ESI_PORT, - my_port); - } - - for (with_esi = opt_esi; 1; with_esi--) { - status = register_exported_entities(); - - /* At some point, we need to add these portals - * to the local_portals list so that ESI works - * properly. - * Right now, we extract the portals from the response - * and add those. The down side of this is that we no - * longer use the same object (pointer) to refer to the - * same thing. The up side is that the information returned - * by the server reflects the correct ESI interval. - */ - if (status == ISNS_SUCCESS) - break; - - if (status != ISNS_ESI_NOT_AVAILABLE || with_esi == 0) { - isns_error("Failed to register object(s): %s\n", - isns_strerror(status)); - goto out; - } - - /* Continue and retry without ESI */ - all_objects_unset(&portals, ISNS_TAG_ESI_INTERVAL); - all_objects_unset(&portals, ISNS_TAG_ESI_PORT); - } - - for (i = 0; i < local_registry.iol_count; ++i) { - isns_object_t *obj = local_registry.iol_data[i]; - isns_source_t *source; - int status; - - if (!isns_object_is_iscsi_node(obj) - && !isns_object_is_fc_port(obj)) - continue; - - if (!(source = isns_source_from_object(obj))) - continue; - call = isns_create_scn_registration2(clnt, opt_scn_bits, source); - status = isns_simple_call(clnt->ic_socket, &call); - if (status != ISNS_SUCCESS) { - isns_error("SCN registration for %s failed: %s\n", - isns_storage_node_name(obj), - isns_strerror(status)); - } - isns_source_release(source); - } - -out: - if (call) - isns_simple_free(call); - isns_object_list_destroy(&entities); - isns_object_list_destroy(&portals); - return status; -} - -static void -retry_registration(void *ptr) -{ - isns_proxy_t *proxy = ptr; - static unsigned int timeout = 0; - int status; - - status = register_exported_objects(proxy->ip_client); - if (status) { - if (timeout == 0) - timeout = opt_retry_timeout; - else if (timeout >= MAX_RETRY_TIMEOUT) - timeout = MAX_RETRY_TIMEOUT; - - isns_debug_state("Retrying to register in %u seconds\n", timeout); - isns_add_oneshot_timer(timeout, retry_registration, proxy); - - /* Exponential backoff */ - timeout <<= 1; - } -} - -/* - * Get a list of all visible storage nodes - */ -static int -get_objects_from_query(isns_simple_t *resp) -{ - isns_object_list_t resp_objects = ISNS_OBJECT_LIST_INIT; - unsigned int i; - int status; - - status = isns_query_response_get_objects(resp, &resp_objects); - if (status) { - isns_error("Unable to extract object list from " - "query response: %s\n", - isns_strerror(status)); - return status; - } - - isns_debug_state("Initial query returned %u object(s)\n", resp_objects.iol_count); - for (i = 0; i < resp_objects.iol_count; ++i) { - isns_attr_list_t key_attrs = ISNS_ATTR_LIST_INIT; - isns_object_t *obj = resp_objects.iol_data[i]; - isns_object_t *found; - - if (!isns_object_extract_keys(obj, &key_attrs)) - continue; - - /* Don't add an object twice, and don't add objects - * that *we* registered. - * This still leaves any default PGs created by the server, - * but we cannot help that (for now). - */ - found = isns_object_list_lookup(&visible_nodes, NULL, &key_attrs); - if (!found) - found = isns_object_list_lookup(&local_registry, NULL, &key_attrs); - if (found) { - isns_object_release(found); - } else { - isns_object_list_append(&visible_nodes, obj); - } - isns_attr_list_destroy(&key_attrs); - } - - isns_object_list_destroy(&resp_objects); - return status; -} - -static int -query_storage_node(isns_source_t *source, const char *name) -{ - isns_attr_list_t key_attrs = ISNS_ATTR_LIST_INIT; - isns_simple_t *call; - uint32_t tag; - int status; - isns_client_t *clnt; - - if (isns_source_type(source) != ISNS_TAG_ISCSI_NAME) { - isns_error("FC source node - doesn't work yet\n"); - return ISNS_SUCCESS; - } - clnt = isns_create_client(NULL, isns_source_name(source)); - - tag = isns_source_type(source); - if (name) { - isns_attr_list_append_string(&key_attrs, tag, name); - } else { - /* Query for visible nodes */ - isns_attr_list_append_nil(&key_attrs, tag); - } - - call = isns_create_query2(clnt, &key_attrs, source); - isns_attr_list_destroy(&key_attrs); - - isns_query_request_attr_tag(call, tag); - switch (tag) { - case ISNS_TAG_ISCSI_NAME: - isns_query_request_attr_tag(call, ISNS_TAG_ISCSI_NODE_TYPE); - isns_query_request_attr_tag(call, ISNS_TAG_ISCSI_ALIAS); - isns_query_request_attr_tag(call, ISNS_TAG_ISCSI_NODE_INDEX); - - isns_query_request_attr_tag(call, ISNS_TAG_PORTAL_IP_ADDRESS); - isns_query_request_attr_tag(call, ISNS_TAG_PORTAL_TCP_UDP_PORT); - isns_query_request_attr_tag(call, ISNS_TAG_PORTAL_INDEX); - - isns_query_request_attr_tag(call, ISNS_TAG_PG_ISCSI_NAME); - isns_query_request_attr_tag(call, ISNS_TAG_PG_PORTAL_IP_ADDR); - isns_query_request_attr_tag(call, ISNS_TAG_PG_PORTAL_TCP_UDP_PORT); - isns_query_request_attr_tag(call, ISNS_TAG_PG_TAG); - isns_query_request_attr_tag(call, ISNS_TAG_PG_INDEX); - break; - - default: ; - } - - status = isns_simple_call(clnt->ic_socket, &call); - if (status == ISNS_SUCCESS) - status = get_objects_from_query(call); - - isns_simple_free(call); - isns_client_destroy(clnt); - return status; -} - -/* - * Query for visible iscsi nodes - */ -static int -query_visible(void) -{ - unsigned int i; - - for (i = 0; i < local_registry.iol_count; ++i) { - isns_object_t *obj = local_registry.iol_data[i]; - isns_source_t *source; - int status; - - if (!isns_object_is_iscsi_node(obj) - && !isns_object_is_fc_port(obj)) - continue; - - if (isns_object_is_fc_port(obj)) { - isns_error("FC source node - sorry, won't work yet\n"); - continue; - } - - if (!(source = isns_source_from_object(obj))) - continue; - status = query_storage_node(source, NULL); - if (status != ISNS_SUCCESS) { - isns_warning("Unable to run query on behalf of %s: %s\n", - isns_storage_node_name(obj), - isns_strerror(status)); - } - isns_source_release(source); - } - return ISNS_SUCCESS; -} - -/* - * Invoke the registered callout program - */ -static void -callout(const char *how, isns_object_t *obj, unsigned int bitmap) -{ - char *argv[128]; - int fargc, argc = 0; - pid_t pid; - - if (!isns_config.ic_scn_callout) - return; - - argv[argc++] = isns_config.ic_scn_callout; - argv[argc++] = (char *) how; - fargc = argc; - - argc += isns_print_attrs(obj, argv + argc, 128 - argc); - - pid = fork(); - if (pid == 0) { - execv(argv[0], argv); - isns_fatal("Cannot execute %s: %m\n", argv[0]); - } - - while (fargc < argc) - isns_free(argv[fargc++]); - - if (pid < 0) { - isns_error("fork: %m\n"); - return; - } - - while (waitpid(pid, NULL, 0) < 0) - ; -} - -/* - * This is called when we receive a State Change Notification - */ -static void -scn_callback(isns_db_t *db, uint32_t bitmap, - isns_object_template_t *node_type, - const char *node_name, - const char *dst_name) -{ - isns_attr_list_t key_attrs = ISNS_ATTR_LIST_INIT; - uint32_t key_tag; - isns_object_t *node = NULL, *recipient = NULL; - - isns_notice("%s \"%s\" %s\n", - isns_object_template_name(node_type), - node_name, isns_event_string(bitmap)); - - /* This is either an iSCSI node or a FC node - in - both cases the storage node name is the key attr */ - if (node_type == &isns_iscsi_node_template) { - key_tag = ISNS_TAG_ISCSI_NAME; - } else if (node_type == &isns_fc_node_template) { - key_tag = ISNS_TAG_FC_PORT_NAME_WWPN; - } else - return; - - isns_attr_list_append_string(&key_attrs, key_tag, dst_name); - recipient = isns_object_list_lookup(&local_registry, node_type, &key_attrs); - if (recipient == NULL) { - isns_error("Received SCN for unknown recipient \"%s\"\n", - dst_name); - goto out; - } - isns_attr_list_destroy(&key_attrs); - - isns_attr_list_append_string(&key_attrs, key_tag, node_name); - node = isns_object_list_lookup(&visible_nodes, node_type, &key_attrs); - - if (bitmap & (ISNS_SCN_OBJECT_REMOVED_MASK|ISNS_SCN_DD_MEMBER_REMOVED_MASK)) { - if (node) { - isns_object_list_remove(&visible_nodes, node); - /* FIXME: We also want to remove any PGs associated with - * this node. */ - } - store_imported_objects(); - callout("remove", node, bitmap); - } else - if (bitmap & (ISNS_SCN_OBJECT_ADDED_MASK|ISNS_SCN_OBJECT_UPDATED_MASK|ISNS_SCN_DD_MEMBER_ADDED_MASK)) { - const char *how = "add"; - isns_source_t *source; - - if (bitmap & ISNS_SCN_OBJECT_UPDATED_MASK) - how = "update"; - if (!node) { - node = isns_create_object(node_type, &key_attrs, NULL); - if (!node) - goto out; - isns_object_list_append(&visible_nodes, node); - } - - /* Query the server for information on this node */ - source = isns_source_from_object(recipient); - query_storage_node(source, node_name); - isns_source_release(source); - - store_imported_objects(); - callout(how, node, bitmap); - - } - -out: - if (node) - isns_object_release(node); - if (recipient) - isns_object_release(recipient); - isns_attr_list_destroy(&key_attrs); -} - -/* - * Server main loop - */ -void -run_discovery(isns_server_t *server) -{ - isns_client_t *clnt; - isns_security_t *ctx = NULL; - isns_message_t *msg, *resp; - - /* Create the server socket */ - ctx = isns_default_security_context(0); - server_socket = isns_create_server_socket(isns_config.ic_bind_address, - NULL, opt_af, SOCK_DGRAM); - if (server_socket == NULL) - isns_fatal("Unable to create server socket\n"); - isns_socket_set_security_ctx(server_socket, ctx); - - /* Create the client socket */ - clnt = isns_create_default_client(NULL); - if (clnt == NULL) - isns_fatal("Cannot connect to server\n"); - - /* Load all objects registered by local services */ - should_reexport = 1; - - while (1) { - struct timeval timeout = { 0, 0 }; - time_t now, then, next_timeout; - unsigned int function; - - next_timeout = time(NULL) + 3600; - - /* Run timers */ - then = isns_run_timers(); - if (then && then < next_timeout) - next_timeout = then; - - /* Determine how long we can sleep */ - now = time(NULL); - if (next_timeout <= now) - continue; - timeout.tv_sec = next_timeout - now; - - if (should_reexport) { - load_exported_objects(); - - if (register_exported_objects(clnt)) - isns_error("Failed to register exported objects.\n"); - - /* Prime the list of visible storage nodes */ - if (query_visible()) - isns_error("Unable to query list of visible nodes.\n"); - store_imported_objects(); - - should_reexport = 0; - } - - if ((msg = isns_recv_message(&timeout)) == NULL) - continue; - - function = isns_message_function(msg); - if (function != ISNS_STATE_CHANGE_NOTIFICATION - && function != ISNS_ENTITY_STATUS_INQUIRY) { - isns_warning("Discarding unexpected %s message\n", - isns_function_name(function)); - isns_message_release(msg); - continue; - } - - if ((resp = isns_process_message(server, msg)) != NULL) { - isns_socket_t *sock = isns_message_socket(msg); - - isns_socket_send(sock, resp); - isns_message_release(resp); - } - - isns_message_release(msg); - } -} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/isns.h open-iscsi-2.0.874/utils/open-isns/isns.h --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/isns.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/isns.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,673 +0,0 @@ -/* - * iSNS implementation - library header file. - * - * Copyright (C) 2007 Olaf Kirch - * - * This file contains all declarations and definitions - * commonly required by users of libisns. - */ - -#ifndef ISNS_H -#define ISNS_H - -#include -#include -#include - -#include -#include "types.h" - -#define ISNS_MAX_BUFFER 8192 -#define ISNS_MAX_MESSAGE 8192 - - -/* - * Client handle - */ -typedef struct isns_client isns_client_t; -struct isns_client { - isns_source_t * ic_source; - isns_socket_t * ic_socket; -}; - -/* - * Server operations - */ -typedef int isns_service_fn_t(isns_server_t *, isns_simple_t *, isns_simple_t **); -typedef void isns_scn_callback_fn_t(isns_db_t *, uint32_t scn_bits, - isns_object_template_t *node_type, - const char *node_name, - const char *recipient); -struct isns_service_ops { - isns_service_fn_t * process_registration; - isns_service_fn_t * process_query; - isns_service_fn_t * process_getnext; - isns_service_fn_t * process_deregistration; - isns_service_fn_t * process_scn_registration; - isns_service_fn_t * process_scn_deregistration; - isns_service_fn_t * process_scn_event; - isns_service_fn_t * process_scn; - isns_service_fn_t * process_dd_registration; - isns_service_fn_t * process_dd_deregistration; - isns_service_fn_t * process_esi; - isns_service_fn_t * process_heartbeat; -}; - -extern struct isns_service_ops isns_default_service_ops; -extern struct isns_service_ops isns_callback_service_ops; - -/* - * Output function - */ -void isns_print_stdout(const char *, ...); - -/* - * Database events - */ -struct isns_db_event { - isns_object_t * ie_recipient; /* Recipient node or NULL */ - isns_object_t * ie_object; /* Affected object */ - isns_object_t * ie_trigger; /* Triggering object */ - unsigned int ie_bits; /* SCN bitmask */ -}; -typedef void isns_db_callback_t(const isns_db_event_t *, - void *user_data); - -/* - * Handling of client objects - */ -extern isns_client_t * isns_create_default_client(isns_security_t *); -extern isns_client_t * isns_create_client(isns_security_t *, - const char *source_name); -extern isns_client_t * isns_create_local_client(isns_security_t *, - const char *source_name); -extern int isns_client_call(isns_client_t *, - isns_simple_t **inout); -extern void isns_client_destroy(isns_client_t *); -extern int isns_client_get_local_address(const isns_client_t *, - isns_portal_info_t *); - -/* - * Handling of server objects - */ -extern isns_server_t * isns_create_server(isns_source_t *, - isns_db_t *, - struct isns_service_ops *); -extern void isns_server_set_scn_callback(isns_server_t *, - isns_scn_callback_fn_t *); - - -/* - * Handling of source names - */ -extern int isns_init_names(void); -extern const char * isns_default_source_name(void); -extern isns_source_t * isns_source_create(isns_attr_t *); -extern isns_source_t * isns_source_create_iscsi(const char *name); -extern isns_source_t * isns_source_create_ifcp(const char *name); -extern uint32_t isns_source_type(const isns_source_t *); -extern const char * isns_source_name(const isns_source_t *); -extern isns_attr_t * isns_source_attr(const isns_source_t *); -extern isns_source_t * isns_source_get(isns_source_t *); -extern isns_source_t * isns_source_from_object(const isns_object_t *); -extern void isns_source_release(isns_source_t *); -extern int isns_source_match(const isns_source_t *, - const isns_source_t *); - -extern void isns_server_set_source(isns_source_t *); -extern isns_message_t * isns_process_message(isns_server_t *, isns_message_t *); - -extern void isns_simple_print(isns_simple_t *, - isns_print_fn_t *); -extern int isns_simple_call(isns_socket_t *, - isns_simple_t **); -extern int isns_simple_transmit(isns_socket_t *, - isns_simple_t *, - const isns_portal_info_t *, - unsigned int, - void (*callback)(uint32_t, int, - isns_simple_t *)); -extern void isns_simple_free(isns_simple_t *); -extern const isns_attr_list_t *isns_simple_get_attrs(isns_simple_t *); - -extern isns_simple_t * isns_create_query(isns_client_t *clnt, - const isns_attr_list_t *query_key); -extern isns_simple_t * isns_create_query2(isns_client_t *clnt, - const isns_attr_list_t *query_key, - isns_source_t *source); -extern int isns_query_request_attr_tag(isns_simple_t *, - uint32_t); -extern int isns_query_request_attr(isns_simple_t *, - isns_attr_t *); -extern int isns_query_response_get_objects(isns_simple_t *qry, - isns_object_list_t *result); - -extern isns_simple_t * isns_create_registration(isns_client_t *clnt, - isns_object_t *key_object); -extern isns_simple_t * isns_create_registration2(isns_client_t *clnt, - isns_object_t *key_object, - isns_source_t *source); -extern void isns_registration_set_replace(isns_simple_t *, int); -extern void isns_registration_add_object(isns_simple_t *, - isns_object_t *object); -extern void isns_registration_add_object_list(isns_simple_t *, - isns_object_list_t *); -extern int isns_registration_response_get_objects(isns_simple_t *, - isns_object_list_t *); - -extern isns_simple_t * isns_create_getnext(isns_client_t *, - isns_object_template_t *, - const isns_attr_list_t *); -extern int isns_getnext_response_get_object(isns_simple_t *, - isns_object_t **); -extern isns_simple_t * isns_create_getnext_followup(isns_client_t *, - const isns_simple_t *, - const isns_attr_list_t *); - -extern isns_simple_t * isns_create_deregistration(isns_client_t *clnt, - const isns_attr_list_t *); - -extern isns_simple_t * isns_create_scn_registration(isns_client_t *clnt, - unsigned int); -extern isns_simple_t * isns_create_scn_registration2(isns_client_t *clnt, - unsigned int, - isns_source_t *); - -extern int isns_dd_load_all(isns_db_t *); -extern void isns_dd_get_members(uint32_t, isns_object_list_t *, int); -extern isns_simple_t * isns_create_dd_registration(isns_client_t *, - const isns_attr_list_t *); -extern isns_simple_t * isns_create_dd_deregistration(isns_client_t *, - uint32_t, const isns_attr_list_t *); - -extern isns_object_t * isns_create_object(isns_object_template_t *, - const isns_attr_list_t *, - isns_object_t *); -extern isns_object_t * isns_create_entity(int, const char *); -extern isns_object_t * isns_create_entity_for_source(const isns_source_t *, - const char *); -extern const char * isns_entity_name(const isns_object_t *); -extern isns_object_t * isns_create_portal(const isns_portal_info_t *, - isns_object_t *parent); -extern isns_object_t * isns_create_storage_node(const char *name, - uint32_t type_mask, - isns_object_t *parent); -extern isns_object_t * isns_create_storage_node2(const isns_source_t *, - uint32_t type_mask, - isns_object_t *parent); -extern isns_object_t * isns_create_iscsi_initiator(const char *name, - isns_object_t *parent); -extern isns_object_t * isns_create_iscsi_target(const char *name, - isns_object_t *parent); -extern const char * isns_storage_node_name(const isns_object_t *); -extern isns_attr_t * isns_storage_node_key_attr(const isns_object_t *); -extern isns_object_t * isns_create_portal_group(isns_object_t *portal, - isns_object_t *iscsi_node, uint32_t pg_tag); -extern isns_object_t * isns_create_default_portal_group(isns_db_t *, - isns_object_t *portal, - isns_object_t *node); -extern void isns_get_portal_groups(isns_object_t *portal, - isns_object_t *node, - isns_object_list_t *result); - -extern const char * isns_object_template_name(isns_object_template_t *); -extern int isns_object_set_attr(isns_object_t *, isns_attr_t *); -extern int isns_object_set_attrlist(isns_object_t *, const isns_attr_list_t *); -extern isns_object_t * isns_object_get(isns_object_t *); -extern int isns_object_get_attrlist(isns_object_t *obj, - isns_attr_list_t *result, - const isns_attr_list_t *requested_attrs); -extern int isns_object_get_key_attrs(isns_object_t *, - isns_attr_list_t *); -extern int isns_object_get_attr(const isns_object_t *, uint32_t, - isns_attr_t **); -extern void isns_object_get_related(isns_db_t *, - isns_object_t *, isns_object_list_t *); -extern void isns_object_get_descendants(const isns_object_t *, - isns_object_template_t *, - isns_object_list_t *); -extern void isns_object_release(isns_object_t *); -extern int isns_object_match(const isns_object_t *, - const isns_attr_list_t *); -extern isns_object_t * isns_object_get_entity(isns_object_t *); -extern int isns_object_attr_valid(isns_object_template_t *, uint32_t); -extern int isns_object_contains(const isns_object_t *, const isns_object_t *); -extern int isns_object_delete_attr(isns_object_t *, uint32_t); -extern int isns_object_is(const isns_object_t *, - isns_object_template_t *); -extern int isns_object_is_entity(const isns_object_t *); -extern int isns_object_is_iscsi_node(const isns_object_t *); -extern int isns_object_is_fc_port(const isns_object_t *); -extern int isns_object_is_fc_node(const isns_object_t *); -extern int isns_object_is_portal(const isns_object_t *); -extern int isns_object_is_pg(const isns_object_t *); -extern int isns_object_is_policy(const isns_object_t *); -extern int isns_object_is_dd(const isns_object_t *); -extern int isns_object_is_ddset(const isns_object_t *); -extern void isns_object_print(isns_object_t *, - isns_print_fn_t *); -extern time_t isns_object_last_modified(const isns_object_t *); -extern int isns_object_mark_membership(isns_object_t *, uint32_t); -extern int isns_object_clear_membership(isns_object_t *, uint32_t); -extern int isns_object_test_membership(const isns_object_t *, uint32_t); -extern int isns_object_test_visibility(const isns_object_t *, - const isns_object_t *); -extern void isns_object_get_visible(const isns_object_t *, - isns_db_t *, isns_object_list_t *); -extern void isns_entity_touch(isns_object_t *); -extern int isns_object_extract_keys(const isns_object_t *, - isns_attr_list_t *); -extern int isns_object_extract_all(const isns_object_t *, - isns_attr_list_t *); -extern int isns_object_extract_writable(const isns_object_t *, - isns_attr_list_t *); - - -extern int isns_object_set_nil(isns_object_t *obj, - uint32_t tag); -extern int isns_object_set_string(isns_object_t *obj, - uint32_t tag, - const char *value); -extern int isns_object_set_uint32(isns_object_t *obj, - uint32_t tag, - uint32_t value); -extern int isns_object_set_uint64(isns_object_t *obj, - uint32_t tag, - uint64_t value); -extern int isns_object_set_ipaddr(isns_object_t *obj, - uint32_t tag, - const struct in6_addr *value); - -extern int isns_object_get_string(const isns_object_t *, - uint32_t, - const char **); -extern int isns_object_get_ipaddr(const isns_object_t *, - uint32_t, - struct in6_addr *); -extern int isns_object_get_uint32(const isns_object_t *, - uint32_t, - uint32_t *); -extern int isns_object_get_uint64(const isns_object_t *, - uint32_t, - uint64_t *); -extern int isns_object_get_opaque(const isns_object_t *, - uint32_t, - const void **, size_t *); - - -extern int isns_object_find_descendants(isns_object_t *obj, - isns_object_template_t *, - const isns_attr_list_t *keys, - isns_object_list_t *result); -extern isns_object_t * isns_object_find_descendant(isns_object_t *obj, - const isns_attr_list_t *keys); -extern int isns_object_detach(isns_object_t *); -extern int isns_object_attach(isns_object_t *, isns_object_t *); -extern void isns_object_prune_attrs(isns_object_t *); -extern void isns_mark_object(isns_object_t *, unsigned int); - -extern int isns_get_entity_identifier(isns_object_t *, const char **); -extern int isns_get_entity_protocol(isns_object_t *, isns_entity_protocol_t *); -extern int isns_get_entity_index(isns_object_t *, uint32_t *); - -extern int isns_get_portal_ipaddr(isns_object_t *, struct in6_addr *); -extern int isns_get_portal_tcpudp_port(isns_object_t *, - int *ipprotocol, uint16_t *port); -extern int isns_get_portal_index(isns_object_t *, uint32_t *); - -extern int isns_get_address(struct sockaddr_storage *, - const char *, const char *, int, int, int); -extern char * isns_get_canon_name(const char *); - -extern isns_db_t * isns_db_open(const char *location); -extern isns_db_t * isns_db_open_shadow(isns_object_list_t *); -extern isns_object_t * isns_db_lookup(isns_db_t *, - isns_object_template_t *, - const isns_attr_list_t *); -extern isns_object_t * isns_db_vlookup(isns_db_t *, - isns_object_template_t *, - ...); -extern int isns_db_gang_lookup(isns_db_t *, - isns_object_template_t *, - const isns_attr_list_t *, - isns_object_list_t *); -extern isns_object_t * isns_db_get_next(isns_db_t *, - isns_object_template_t *, - const isns_attr_list_t *current, - const isns_attr_list_t *scope, - const isns_source_t *source); -extern isns_object_t * isns_db_lookup_source_node(isns_db_t *, - const isns_source_t *); -extern void isns_db_get_domainless(isns_db_t *, - isns_object_template_t *, - isns_object_list_t *); -extern uint32_t isns_db_allocate_index(isns_db_t *); -extern void isns_db_insert(isns_db_t *, isns_object_t *); -extern void isns_db_insert_limbo(isns_db_t *, isns_object_t *); -extern int isns_db_remove(isns_db_t *, isns_object_t *); -extern time_t isns_db_expire(isns_db_t *); -extern void isns_db_purge(isns_db_t *); -extern void isns_db_sync(isns_db_t *); -extern const char * isns_db_generate_eid(isns_db_t *, char *, size_t); -extern isns_object_t * isns_db_get_control(isns_db_t *); -extern void isns_db_print(isns_db_t *, - isns_print_fn_t *); - -extern void isns_db_begin_transaction(isns_db_t *); -extern void isns_db_commit(isns_db_t *); -extern void isns_db_rollback(isns_db_t *); - -extern void isns_object_event(isns_object_t *obj, - unsigned int bits, - isns_object_t *trigger); -extern void isns_unicast_event(isns_object_t *dst, - isns_object_t *obj, - unsigned int bits, - isns_object_t *trigger); -extern void isns_register_callback(isns_db_callback_t *, - void *); -extern void isns_flush_events(void); -extern const char * isns_event_string(unsigned int); - -extern void isns_add_timer(unsigned int, - isns_timer_callback_t *, void *); -extern void isns_add_oneshot_timer(unsigned int, - isns_timer_callback_t *, void *); -extern void isns_cancel_timer(isns_timer_callback_t *, void *); -extern time_t isns_run_timers(void); - -extern void isns_object_list_init(isns_object_list_t *); -extern void isns_object_list_destroy(isns_object_list_t *); -extern int isns_object_list_contains(const isns_object_list_t *, - isns_object_t *); -extern void isns_object_list_append(isns_object_list_t *, - isns_object_t *); -extern void isns_object_list_append_list(isns_object_list_t *, - const isns_object_list_t *); -extern isns_object_t * isns_object_list_lookup(const isns_object_list_t *, - isns_object_template_t *, - const isns_attr_list_t *); -extern int isns_object_list_gang_lookup(const isns_object_list_t *, - isns_object_template_t *, - const isns_attr_list_t *, - isns_object_list_t *); -extern int isns_object_list_remove(isns_object_list_t *, - isns_object_t *); -extern void isns_object_list_uniq(isns_object_list_t *); -extern void isns_object_list_print(const isns_object_list_t *, - isns_print_fn_t *); - -isns_object_template_t *isns_object_template_for_key_attrs(const isns_attr_list_t *); -isns_object_template_t *isns_object_template_for_tag(uint32_t); -isns_object_template_t *isns_object_template_for_index_tag(uint32_t); -isns_object_template_t *isns_object_template_find(uint32_t); - -extern int isns_attr_set(isns_attr_t *, const void *); -extern isns_attr_t * isns_attr_get(isns_attr_t *); -extern void isns_attr_release(isns_attr_t *); -extern void isns_attr_print(const isns_attr_t *, - isns_print_fn_t *); -extern char * isns_attr_print_value(const isns_attr_t *, - char *, size_t); -extern int isns_attr_match(const isns_attr_t *, - const isns_attr_t *); -extern int isns_attr_compare(const isns_attr_t *, - const isns_attr_t *); -extern isns_attr_t * isns_attr_from_string(uint32_t, const char *); - -extern void isns_attr_list_print(const isns_attr_list_t *, - isns_print_fn_t *); - -extern void isns_attr_list_init(isns_attr_list_t *); -extern void isns_attr_list_copy(isns_attr_list_t *, - const isns_attr_list_t *); -extern void isns_attr_list_destroy(isns_attr_list_t *); -extern int isns_attr_list_remove_tag(isns_attr_list_t *, - uint32_t); - -extern void isns_attr_list_append_attr(isns_attr_list_t *, - isns_attr_t *); -extern void isns_attr_list_append_list(isns_attr_list_t *, - const isns_attr_list_t *); -extern int isns_attr_list_replace_attr(isns_attr_list_t *, - isns_attr_t *); -/* Warning: this does *NOT* return a reference to the attribute */ -extern int isns_attr_list_get_attr(const isns_attr_list_t *, - uint32_t tag, - isns_attr_t **); - -extern void isns_attr_list_append_nil(isns_attr_list_t *, - uint32_t tag); -extern void isns_attr_list_append_string(isns_attr_list_t *, - uint32_t tag, const char *value); -extern void isns_attr_list_append_uint32(isns_attr_list_t *, - uint32_t tag, uint32_t value); -extern void isns_attr_list_append_uint64(isns_attr_list_t *, - uint32_t, int64_t); -extern void isns_attr_list_append_int32(isns_attr_list_t *, - uint32_t tag, int32_t value); -extern void isns_attr_list_append_opaque(isns_attr_list_t *, - uint32_t tag, const void *ptr, size_t len); -extern void isns_attr_list_append_ipaddr(isns_attr_list_t *, - uint32_t tag, const struct in6_addr *); - -extern int isns_attr_list_append(isns_attr_list_t *, - uint32_t tag, const void *); -extern int isns_attr_list_update(isns_attr_list_t *, - uint32_t tag, const void *); - -extern int isns_attr_list_contains(const isns_attr_list_t *, - uint32_t tag); -extern int isns_attr_list_compare(const isns_attr_list_t *, - const isns_attr_list_t *); - -/* - * Helper macros - */ -#define ISNS_ATTR_TYPE_CHECK(attr, type) \ - ((attr)->ia_value.iv_type == &isns_attr_type_##type) -#define ISNS_ATTR_IS_NIL(attr) \ - ISNS_ATTR_TYPE_CHECK(attr, nil) -#define ISNS_ATTR_IS_STRING(attr) \ - ISNS_ATTR_TYPE_CHECK(attr, string) -#define ISNS_ATTR_IS_IPADDR(attr) \ - ISNS_ATTR_TYPE_CHECK(attr, ipaddr) -#define ISNS_ATTR_IS_UINT32(attr) \ - ISNS_ATTR_TYPE_CHECK(attr, uint32) -#define ISNS_ATTR_IS_UINT64(attr) \ - ISNS_ATTR_TYPE_CHECK(attr, uint64) -#define ISNS_ATTR_IS_OPAQUE(attr) \ - ISNS_ATTR_TYPE_CHECK(attr, opaque) - - - -extern isns_socket_t * isns_create_server_socket(const char *hostname, const char *portname, - int af_hint, int sock_type); -extern isns_socket_t * isns_create_client_socket(const char *hostname, const char *portname, - int af_hint, int sock_type); -extern isns_socket_t * isns_create_bound_client_socket(const char *myaddr, - const char *hostname, const char *portname, - int af_hint, int sock_type); -extern isns_socket_t * isns_connect_to_portal(const isns_portal_info_t *); -extern void isns_socket_set_report_failure(isns_socket_t *); -extern void isns_socket_set_disconnect_fatal(isns_socket_t *); -extern int isns_socket_get_local_addr(const isns_socket_t *, - struct sockaddr_storage *); -extern int isns_socket_get_portal_info(const isns_socket_t *, - isns_portal_info_t *); -extern void isns_socket_set_security_ctx(isns_socket_t *, - isns_security_t *); -extern isns_message_t * isns_recv_message(struct timeval *timeout); -extern isns_message_t * isns_socket_call(isns_socket_t *, isns_message_t *, long); -extern int isns_socket_send(isns_socket_t *, isns_message_t *); -extern void isns_socket_free(isns_socket_t *); -extern int isns_addr_get_port(const struct sockaddr *); -extern void isns_addr_set_port(struct sockaddr *, unsigned int); -extern isns_socket_t * isns_socket_find_server(const isns_portal_info_t *); - -extern isns_message_t * isns_create_message(uint16_t function, uint16_t flags); -extern isns_message_t * isns_create_reply(const isns_message_t *); -extern int isns_message_init(isns_message_t *, - uint16_t, uint16_t, size_t); -extern int isns_message_status(isns_message_t *); -extern void isns_message_release(isns_message_t *); -extern unsigned int isns_message_function(const isns_message_t *); -extern isns_socket_t * isns_message_socket(const isns_message_t *); -extern void isns_message_set_error(isns_message_t *, uint32_t); - -extern const char * isns_strerror(enum isns_status); -extern const char * isns_function_name(unsigned int); - -/* - * Security related functions - */ -extern int isns_security_init(void); -extern isns_principal_t *isns_security_load_privkey(isns_security_t *, - const char *filename); -extern isns_principal_t *isns_security_load_pubkey(isns_security_t *, - const char *filename); -extern isns_security_t *isns_default_security_context(int server_only); -extern isns_security_t *isns_control_security_context(int server_only); -extern isns_security_t *isns_create_dsa_context(void); -extern void isns_security_set_identity(isns_security_t *, isns_principal_t *); -extern void isns_principal_free(isns_principal_t *); -extern void isns_add_principal(isns_security_t *, isns_principal_t *); -extern isns_keystore_t *isns_create_keystore(const char *); -extern void isns_security_set_keystore(isns_security_t *, - isns_keystore_t *); -extern void isns_principal_set_name(isns_principal_t *, const char *); -extern const char * isns_principal_name(const isns_principal_t *); - -extern isns_object_template_t isns_entity_template; -extern isns_object_template_t isns_portal_template; -extern isns_object_template_t isns_iscsi_node_template; -extern isns_object_template_t isns_fc_port_template; -extern isns_object_template_t isns_fc_node_template; -extern isns_object_template_t isns_iscsi_pg_template; -extern isns_object_template_t isns_dd_template; -extern isns_object_template_t isns_ddset_template; - -/* - * Config file parser - */ -struct isns_config { - char * ic_host_name; - char * ic_auth_name; - char * ic_source_name; - char * ic_source_suffix; - char * ic_entity_name; - - char * ic_server_name; - char * ic_bind_address; - char * ic_database; - char * ic_auth_key_file; - char * ic_server_key_file; - char * ic_client_keystore; - char * ic_control_socket; - char * ic_pidfile; - char * ic_local_registry_file; - int ic_security; - int ic_slp_register; - - char * ic_control_name; - char * ic_control_key_file; - - unsigned int ic_registration_period; - unsigned int ic_scn_timeout; - unsigned int ic_scn_retries; - char * ic_scn_callout; - - unsigned int ic_esi_max_interval; - unsigned int ic_esi_min_interval; - unsigned int ic_esi_retries; - - unsigned int ic_use_default_domain; - - struct { - unsigned int policy; - unsigned int replay_window; - unsigned int timestamp_jitter; - int allow_unknown_peers; - } ic_auth; - struct { - unsigned int max_sockets; - unsigned int connect_timeout; - unsigned int reconnect_timeout; - unsigned int call_timeout; - unsigned int udp_retrans_timeout; - unsigned int tcp_retrans_timeout; - unsigned int idle_timeout; - } ic_network; - struct { - char * param_file; - unsigned int key_bits; - } ic_dsa; - -}; - -extern struct isns_config isns_config; -extern int isns_read_config(const char *); -extern int isns_config_set(const char *, char *); - -/* - * Reserved entity name for Policy information - */ -#define ISNS_ENTITY_CONTROL "CONTROL" - - -/* - * Helpers to deal with portal information - */ -struct isns_portal_info { - struct sockaddr_in6 addr; - int proto; -}; - -extern void isns_portal_init(isns_portal_info_t *, - const struct sockaddr *, int); -extern int isns_portal_parse(isns_portal_info_t *portal, - const char *addr_spec, - const char *default_port); -extern int isns_portal_from_attr_list(isns_portal_info_t *, - uint32_t addr_tag, uint32_t port_tag, - const isns_attr_list_t *); -extern int isns_portal_from_attr_pair(isns_portal_info_t *, - const isns_attr_t *, - const isns_attr_t *); -extern int isns_portal_from_object(isns_portal_info_t *, - uint32_t addr_tag, uint32_t port_tag, - const isns_object_t *); -extern int isns_portal_from_sockaddr(isns_portal_info_t *, - const struct sockaddr_storage *); -extern int isns_portal_to_sockaddr(const isns_portal_info_t *, - struct sockaddr_storage *); -extern int isns_portal_to_attr_list(const isns_portal_info_t *, - uint32_t addr_tag, uint32_t port_tag, - isns_attr_list_t *); -extern int isns_portal_to_object(const isns_portal_info_t *, - uint32_t addr_tag, uint32_t port_tag, - isns_object_t *); -extern int isns_portal_is_wildcard(const isns_portal_info_t *); -extern uint32_t isns_portal_tcpudp_port(const isns_portal_info_t *); -extern const char * isns_portal_string(const isns_portal_info_t *); -extern int isns_portal_equal(const isns_portal_info_t *, - const isns_portal_info_t *); -extern int isns_enumerate_portals(isns_portal_info_t *, - unsigned int); -extern int isns_get_nr_portals(void); - -/* Local registry stuff */ -extern int isns_local_registry_load(const char *, pid_t, isns_object_list_t *); -extern int isns_local_registry_store(const char *, pid_t, const isns_object_list_t *); -extern int isns_local_registry_purge(const char *, pid_t); - -/* Should go somwhere else .*/ -extern int isns_esi_enabled; - -extern void isns_esi_init(isns_server_t *); -extern void isns_esi_register(isns_object_t *); - -extern void isns_scn_init(isns_server_t *); -extern time_t isns_scn_transmit_all(void); - -#endif /* ISNS_H */ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/isns-proto.h open-iscsi-2.0.874/utils/open-isns/isns-proto.h --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/isns-proto.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/isns-proto.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,259 +0,0 @@ -/* - * iSNS protocol definitions - * - * Copyright (C) 2007 Olaf Kirch - */ - -#ifndef ISNS_PROTO_H -#define ISNS_PROTO_H - -#include - -struct isns_hdr { - uint16_t i_version; - uint16_t i_function; - uint16_t i_length; - uint16_t i_flags; - uint16_t i_xid; - uint16_t i_seq; -}; - -#define ISNS_VERSION 0x0001 -#define ISNS_MAX_PDU_SIZE 65535 -#define ISNS_DEFAULT_PORT 3205 - -/* - * Values for the i_flags field: - */ -#define ISNS_F_CLIENT 0x8000 -#define ISNS_F_SERVER 0x4000 -#define ISNS_F_AUTHBLK_PRESENT 0x2000 -#define ISNS_F_REPLACE 0x1000 -#define ISNS_F_LAST_PDU 0x0800 -#define ISNS_F_FIRST_PDU 0x0400 - -/* - * Function values - */ -enum isns_function { - ISNS_DEVICE_ATTRIBUTE_REGISTER = 1, - ISNS_DEVICE_ATTRIBUTE_QUERY = 2, - ISNS_DEVICE_GET_NEXT = 3, - ISNS_DEVICE_DEREGISTER = 4, - ISNS_SCN_REGISTER = 5, - ISNS_SCN_DEREGISTER = 6, - ISNS_SCN_EVENT = 7, - ISNS_STATE_CHANGE_NOTIFICATION = 8, - ISNS_DD_REGISTER = 9, - ISNS_DD_DEREGISTER = 10, - ISNS_DDS_REGISTER = 11, - ISNS_DDS_DEREGISTER = 12, - ISNS_ENTITY_STATUS_INQUIRY = 13, - ISNS_HEARTBEAT = 14, -}; - -/* - * iSNS status codes: - */ -enum isns_status { - ISNS_SUCCESS = 0, - ISNS_UNKNOWN_ERROR, - ISNS_MESSAGE_FORMAT_ERROR, - ISNS_INVALID_REGISTRATION, - __ISNS_RESERVED_STATUS, - ISNS_INVALID_QUERY, - ISNS_SOURCE_UNKNOWN, - ISNS_SOURCE_ABSENT, - ISNS_SOURCE_UNAUTHORIZED, - ISNS_NO_SUCH_ENTRY, - ISNS_VERSION_NOT_SUPPORTED, - ISNS_INTERNAL_ERROR, - ISNS_BUSY, - ISNS_OPTION_NOT_UNDERSTOOD, - ISNS_INVALID_UPDATE, - ISNS_MESSAGE_NOT_SUPPORTED, - ISNS_SCN_EVENT_REJECTED, - ISNS_SCN_REGISTRATION_REJECTED, - ISNS_ATTRIBUTE_NOT_IMPLEMENTED, - ISNS_FC_DOMAIN_ID_NOT_AVAILABLE, - ISNS_FC_DOMAIN_ID_NOT_ALLOCATED, - ISNS_ESI_NOT_AVAILABLE, - ISNS_INVALID_DEREGISTRATION, - ISNS_REGISTRATION_FEATURE_NOT_SUPPORTED, -}; - -enum isns_tag { - ISNS_TAG_DELIMITER = 0, - ISNS_TAG_ENTITY_IDENTIFIER = 1, - ISNS_TAG_ENTITY_PROTOCOL = 2, - ISNS_TAG_MGMT_IP_ADDRESS = 3, - ISNS_TAG_TIMESTAMP = 4, - ISNS_TAG_PROTOCOL_VERSION_RANGE = 5, - ISNS_TAG_REGISTRATION_PERIOD = 6, - ISNS_TAG_ENTITY_INDEX = 7, - ISNS_TAG_ENTITY_NEXT_INDEX = 8, - ISNS_TAG_ENTITY_ISAKMP_PHASE_1 = 11, - ISNS_TAG_ENTITY_CERTIFICATE = 12, - ISNS_TAG_PORTAL_IP_ADDRESS = 16, - ISNS_TAG_PORTAL_TCP_UDP_PORT = 17, - ISNS_TAG_PORTAL_SYMBOLIC_NAME = 18, - ISNS_TAG_ESI_INTERVAL = 19, - ISNS_TAG_ESI_PORT = 20, - ISNS_TAG_PORTAL_INDEX = 22, - ISNS_TAG_SCN_PORT = 23, - ISNS_TAG_PORTAL_NEXT_INDEX = 24, - ISNS_TAG_PORTAL_SECURITY_BITMAP = 27, - ISNS_TAG_PORTAL_ISAKMP_PHASE_1 = 28, - ISNS_TAG_PORTAL_ISAKMP_PHASE_2 = 29, - ISNS_TAG_PORTAL_CERTIFICATE = 31, - ISNS_TAG_ISCSI_NAME = 32, - ISNS_TAG_ISCSI_NODE_TYPE = 33, - ISNS_TAG_ISCSI_ALIAS = 34, - ISNS_TAG_ISCSI_SCN_BITMAP = 35, - ISNS_TAG_ISCSI_NODE_INDEX = 36, - ISNS_TAG_WWNN_TOKEN = 37, - ISNS_TAG_ISCSI_NODE_NEXT_INDEX = 38, - ISNS_TAG_ISCSI_AUTHMETHOD = 42, - ISNS_TAG_PG_ISCSI_NAME = 48, - ISNS_TAG_PG_PORTAL_IP_ADDR = 49, - ISNS_TAG_PG_PORTAL_TCP_UDP_PORT = 50, - ISNS_TAG_PG_TAG = 51, - ISNS_TAG_PG_INDEX = 52, - ISNS_TAG_PG_NEXT_INDEX = 53, - ISNS_TAG_FC_PORT_NAME_WWPN = 64, - ISNS_TAG_PORT_ID = 65, - ISNS_TAG_FC_PORT_TYPE = 66, - ISNS_TAG_SYMBOLIC_PORT_NAME = 67, - ISNS_TAG_FABRIC_PORT_NAME = 68, - ISNS_TAG_HARD_ADDRESS = 69, - ISNS_TAG_PORT_IP_ADDRESS = 70, - ISNS_TAG_CLASS_OF_SERVICE = 71, - ISNS_TAG_FC4_TYPES = 72, - ISNS_TAG_FC4_DESCRIPTOR = 73, - ISNS_TAG_FC4_FEATURES = 74, - ISNS_TAG_IFCP_SCN_BITMAP = 75, - ISNS_TAG_PORT_ROLE = 76, - ISNS_TAG_PERMANENT_PORT_NAME = 77, - ISNS_TAG_FC4_TYPE_CODE = 95, - ISNS_TAG_FC_NODE_NAME_WWNN = 96, - ISNS_TAG_SYMBOLIC_NODE_NAME = 97, - ISNS_TAG_NODE_IP_ADDRESS = 98, - ISNS_TAG_NODE_IPA = 99, - ISNS_TAG_PROXY_ISCSI_NAME = 101, - ISNS_TAG_SWITCH_NAME = 128, - ISNS_TAG_PREFERRED_ID = 129, - ISNS_TAG_ASSIGNED_ID = 130, - ISNS_TAG_VIRTUAL_FABRIC_ID = 131, - ISNS_TAG_SERVER_VENDOR_OUI = 256, - ISNS_TAG_DD_SET_ID = 2049, - ISNS_TAG_DD_SET_SYMBOLIC_NAME = 2050, - ISNS_TAG_DD_SET_STATUS = 2051, - ISNS_TAG_DD_SET_NEXT_ID = 2052, - ISNS_TAG_DD_ID = 2065, - ISNS_TAG_DD_SYMBOLIC_NAME = 2066, - ISNS_TAG_DD_MEMBER_ISCSI_INDEX = 2067, - ISNS_TAG_DD_MEMBER_ISCSI_NAME = 2068, - ISNS_TAG_DD_MEMBER_FC_PORT_NAME = 2069, - ISNS_TAG_DD_MEMBER_PORTAL_INDEX = 2070, - ISNS_TAG_DD_MEMBER_PORTAL_IP_ADDR = 2071, - ISNS_TAG_DD_MEMBER_PORTAL_TCP_UDP_PORT = 2072, - ISNS_TAG_DD_FEATURES = 2078, - ISNS_TAG_DD_NEXT_ID = 2079, - - __ISNS_TAG_MAX, - - ISNS_VENDOR_SPECIFIC_SERVER_BASE = 257, /* end 384 */ - ISNS_VENDOR_SPECIFIC_ENTITY_BASE = 385, /* end 512 */ - ISNS_VENDOR_SPECIFIC_PORTAL_BASE = 513, /* end 640 */ - ISNS_VENDOR_SPECIFIC_NODE_BASE = 641, /* end 768 */ - ISNS_VENDOR_SPECIFIC_DD_BASE = 1024, /* end 1280 */ - ISNS_VENDOR_SPECIFIC_DDSET_BASE = 1281, /* end 1536 */ - ISNS_VENDOR_SPECIFIC_OTHER_BASE = 1537, /* end 2048 */ -}; - -typedef enum isns_entity_protocol { - ISNS_ENTITY_PROTOCOL_NONE = 1, - ISNS_ENTITY_PROTOCOL_ISCSI = 2, - ISNS_ENTITY_PROTOCOL_IFCP = 3, -} isns_entity_protocol_t; - -enum isns_iscsi_node_type_bits { - ISNS_ISCSI_NODE_TYPE_TARGET = 0, - ISNS_ISCSI_NODE_TYPE_INITIATOR = 1, - ISNS_ISCSI_NODE_TYPE_CONTROL = 2, -}; -#define ISNS_ISCSI_INITIATOR_MASK (1 << ISNS_ISCSI_NODE_TYPE_INITIATOR) -#define ISNS_ISCSI_TARGET_MASK (1 << ISNS_ISCSI_NODE_TYPE_TARGET) -#define ISNS_ISCSI_CONTROL_MASK (1 << ISNS_ISCSI_NODE_TYPE_CONTROL) - -enum isns_portal_port_bits { - ISNS_PORTAL_PORT_UDP = 16, -}; -#define ISNS_PORTAL_PORT_UDP_MASK (1 << ISNS_PORTAL_PORT_UDP) - -enum isns_portal_security_bits { - ISNS_PORTAL_SEC_BITMAP_VALID = 0, - ISNS_PORTAL_SEC_IPSEC_ENABLED = 1, - ISNS_PORTAL_SEC_MAIN_MODE_ENABLED = 2, - ISNS_PORTAL_SEC_AGGR_MODE_ENABLED = 3, - ISNS_PORTAL_SEC_PFS_ENABLED = 4, - ISNS_PORTAL_SEC_TRANSPORT_MODE_PREFERRED = 5, - ISNS_PORTAL_SEC_TUNNEL_MODE_PREFERRED = 6, -}; -#define ISNS_PORTAL_SEC_BITMAP_VALID_MASK (1 << ISNS_PORTAL_SEC_BITMAP_VALID) -#define ISNS_PORTAL_SEC_IPSEC_ENABLED_MASK (1 << ISNS_PORTAL_SEC_IPSEC_ENABLED) -#define ISNS_PORTAL_SEC_MAIN_MODE_ENABLED_MASK (1 << ISNS_PORTAL_SEC_MAIN_MODE_ENABLED) -#define ISNS_PORTAL_SEC_AGGR_MODE_ENABLED_MASK (1 << ISNS_PORTAL_SEC_AGGR_MODE_ENABLED) -#define ISNS_PORTAL_SEC_PFS_ENABLED_MASK (1 << ISNS_PORTAL_SEC_PFS_ENABLED) -#define ISNS_PORTAL_SEC_TRANSPORT_MODE_PREFERRED_MASK (1 << ISNS_PORTAL_SEC_TRANSPORT_MODE_PREFERRED) -#define ISNS_PORTAL_SEC_TUNNEL_MODE_PREFERRED_MASK (1 << ISNS_PORTAL_SEC_TUNNEL_MODE_PREFERRED) - -enum isns_scn_bits { - ISNS_SCN_DD_MEMBER_ADDED = 0, - ISNS_SCN_DD_MEMBER_REMOVED = 1, - ISNS_SCN_OBJECT_UPDATED = 2, - ISNS_SCN_OBJECT_ADDED = 3, - ISNS_SCN_OBJECT_REMOVED = 4, - ISNS_SCN_MANAGEMENT_REGISTRATION = 5, - ISNS_SCN_TARGET_AND_SELF_ONLY = 6, - ISNS_SCN_INITIATOR_AND_SELF_ONLY = 7, -}; -#define ISNS_SCN_DD_MEMBER_ADDED_MASK (1 << ISNS_SCN_DD_MEMBER_ADDED) -#define ISNS_SCN_DD_MEMBER_REMOVED_MASK (1 << ISNS_SCN_DD_MEMBER_REMOVED) -#define ISNS_SCN_OBJECT_UPDATED_MASK (1 << ISNS_SCN_OBJECT_UPDATED) -#define ISNS_SCN_OBJECT_ADDED_MASK (1 << ISNS_SCN_OBJECT_ADDED) -#define ISNS_SCN_OBJECT_REMOVED_MASK (1 << ISNS_SCN_OBJECT_REMOVED) -#define ISNS_SCN_MANAGEMENT_REGISTRATION_MASK (1 << ISNS_SCN_MANAGEMENT_REGISTRATION) -#define ISNS_SCN_TARGET_AND_SELF_ONLY_MASK (1 << ISNS_SCN_TARGET_AND_SELF_ONLY) -#define ISNS_SCN_INITIATOR_AND_SELF_ONLY_MASK (1 << ISNS_SCN_INITIATOR_AND_SELF_ONLY) - -enum isns_dds_status_bits { - ISNS_DDS_ENABLED = 0, -}; -#define ISNS_DDS_ENABLED_MASK (1 << ISNS_DDS_ENABLED) - -enum isns_dd_feature_bits { - ISNS_DD_BOOT_LIST_ENABLED = 0, -}; -#define ISNS_DD_BOOT_LIST_ENABLED_MASK (1 << ISN_BOOT_LIST_DDS_ENABLED) - -#define ISNS_PAD(len) (((len) + 3) & ~3UL) - -/* - * iSNS auth block - */ -#define ISNS_AUTHBLK_SIZE 20 -struct isns_authblk { - uint32_t iab_bsd; /* 16bit in SLP */ - uint32_t iab_length; /* 16bit in SLP */ - uint64_t iab_timestamp; /* 32bit in SLP */ - uint32_t iab_spi_len; /* 16bit in SLP */ - - char * iab_spi; - void * iab_sig; - uint32_t iab_sig_len; -} __attribute__((packed)); - -#define ISNS_AUTH_TYPE_SHA1_DSA 0x0002 - -#endif /* ISNS_PROTO_H */ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/isnssetup open-iscsi-2.0.874/utils/open-isns/isnssetup --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/isnssetup 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/isnssetup 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -#!/bin/sh -# -# isnssetup - bootstrap open-isns server -# -# Copyright (C) 2007 Olaf Kirch -# -# This is a very simple script to bootstrap an iSNS server. -# It creates the necessary keys, enrolls a control node, -# and enrolls the local host as target and initiator. - -hostname=`hostname -f` - -if [ -f isnsd -a -d isnsadm ]; then - PATH=.:$PATH -fi - -# Massage the configuration file -for f in isnsadm.conf isnsdd.conf; do - etcfile=/etc/isns/$f - sed -e 's/^#*\(ServerAddress[[:space:]]*=\).*/\1 localhost/' \ - -e 's/^#*\(Security[[:space:]]*=\).*/\1 1/' \ - $etcfile > $etcfile.tmp - mv $etcfile.tmp $etcfile -done - -echo "*** Initializing server security ***" -isnsd --init -cp /etc/isns/auth_key.pub /etc/isns/server_key.pub - -if ps ax|grep isnsd | grep -qv grep; then - killall -TERM isnsd - sleep 1 -fi -isnsd -sleep 1 - -echo "*** Registering control node policy ***" -rm -f /etc/isns/control.key -isnsadm --local \ - --keyfile=/etc/isns/control.key \ - --enroll isns.control \ - node-type=ALL functions=ALL object-type=ALL - -echo "*** Registering control node ***" -isnsadm --local \ - --register control - -echo "*** Registering policy for server ***" -isnsadm --control \ - --enroll $hostname \ - key=/etc/isns/auth_key.pub \ - node-type=target+initiator diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/local.c open-iscsi-2.0.874/utils/open-isns/local.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/local.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/local.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,353 +0,0 @@ -/* - * Local iSNS registration - * - * Copyright (C) 2007 Olaf Kirch - * - * The way isnsdd communicates with local services (initiator, - * target) is via a file and signals. That sounds rather - * awkward, but it's a lot simpler to add to these services - * than another socket based communication mechanism I guess. - * - * The file format is simple: - * owner= - * owner= - * ... - * - * identifies the service owning these entries. - * This is a service name, such as iscsid, tgtd, isnsdd, - * optionally followed by a colon and a PID. This allows - * removal of all entries created by one service in one go. - * - * is the description of one iSNS object, using the - * syntax used by all other open-isns apps. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include "security.h" -#include "util.h" -#include "isns-proto.h" -#include "paths.h" -#include "attrs.h" -#include "util.h" - -typedef int __isns_local_registry_cb_fn_t(const char *line, - int argc, char **argv, - void *user_data); - -/* - * Build the owner=: tag - */ -static const char * -__isns_local_registry_make_owner(const char *svcname, pid_t pid) -{ - static char owner[128]; - - if (pid == 0) { - return svcname; - } - snprintf(owner, sizeof(owner), "%s:%u", svcname, pid); - return owner; -} - -/* - * Read the registry file, match each entry against the given owner= tag, - * and invoke the callback function. - * This is used for both reading the registry, and rewriting it. - */ -static int -__isns_local_registry_read(const char *match_owner, - __isns_local_registry_cb_fn_t handle_matching, - __isns_local_registry_cb_fn_t handle_nonmatching, - void *user_data) -{ - const char *filename = isns_config.ic_local_registry_file; - char *line, *copy = NULL; - FILE *fp; - int rv = 0, owner_len; - - if (!(fp = fopen(filename, "r"))) { - if (errno == ENOENT) { - isns_debug_state("Unable to open %s: %m\n", filename); - return 1; - } - isns_error("Unable to open %s: %m\n", filename); - return 0; - } - - owner_len = match_owner? strlen(match_owner) : 0; - while ((line = parser_get_next_line(fp)) != NULL) { - __isns_local_registry_cb_fn_t *cb; - char *argv[256], *owner; - int argc = 0; - - isns_assign_string(©, line); - - argc = isns_attr_list_split(line, argv, 255); - if (argc <= 0) - continue; - - /* Last attr should be owner */ - if (strncasecmp(argv[argc-1], "owner=", 6)) { - isns_error("%s: syntax error (missing owner field)\n", - filename); - goto out; - } - owner = argv[argc-1] + 6; - - if (!strncasecmp(owner, match_owner, owner_len) - && (owner[owner_len] == '\0' || owner[owner_len] == ':')) - cb = handle_matching; - else - cb = handle_nonmatching; - - if (cb && !cb(copy, argc, argv, user_data)) - goto out; - - } - rv = 1; - -out: - free(copy); - fclose(fp); - return rv; -} - -/* - * Open and lock the registry file for writing. Returns an - * open stream and the name of the lock file. - * Follow up with _finish_write when done. - */ -static FILE * -__isns_local_registry_open_write(char **lock_name) -{ - char lock_path[PATH_MAX]; - FILE *fp; - int fd, retry; - - snprintf(lock_path, sizeof(lock_path), "%s.lock", - isns_config.ic_local_registry_file); - - for (retry = 0; retry < 5; ++retry) { - fd = open(lock_path, O_RDWR|O_CREAT|O_EXCL, 0644); - if (fd >= 0) - break; - if (errno != EEXIST) { - isns_error("Unable to create %s: %m\n", - lock_path); - return NULL; - } - isns_error("Cannot lock %s - retry in 1 sec\n", - isns_config.ic_local_registry_file); - sleep(1); - } - - if (!(fp = fdopen(fd, "w"))) { - isns_error("fdopen failed: %m\n"); - close(fd); - return NULL; - } - isns_assign_string(lock_name, lock_path); - return fp; -} - -/* - * We're done with (re)writing the registry. Commit the changes, - * or discard them. - * Also frees the lock_name returned by registry_open_write. - */ -static int -__isns_local_registry_finish_write(FILE *fp, char *lock_name, int commit) -{ - int rv = 1; - - fclose(fp); - if (!commit) { - if (unlink(lock_name)) - isns_error("Failed to unlink %s: %m\n", lock_name); - } else - if (rename(lock_name, isns_config.ic_local_registry_file)) { - isns_error("Failed to rename %s to %s: %m\n", - lock_name, isns_config.ic_local_registry_file); - rv = 0; - } - - free(lock_name); - return rv; -} - -/* - * Get the entity name for this service - */ -static char * -__isns_local_registry_entity_name(const char *owner) -{ - static char namebuf[1024]; - - snprintf(namebuf, sizeof(namebuf), "%s:%s", - isns_config.ic_entity_name, - owner); - return namebuf; -} - -/* - * Callback function which builds an iSNS object from the - * list of attr=tag values. - */ -static int -__isns_local_registry_load_object(const char *line, - int argc, char **argv, void *user_data) -{ - isns_attr_list_t attrs = ISNS_ATTR_LIST_INIT; - struct isns_attr_list_parser state; - isns_object_list_t *list = user_data; - isns_object_t *obj, *entity = NULL; - - for (; argc > 0; --argc) { - char *attr = argv[argc-1]; - - if (!strncasecmp(attr, "owner=", 6)) { - char *eid = __isns_local_registry_entity_name(attr + 6); - ISNS_QUICK_ATTR_LIST_DECLARE(key_attrs, - ISNS_TAG_ENTITY_IDENTIFIER, - string, eid); - - if (entity) { - isns_error("Duplicate owner entry in registry\n"); - continue; - } - isns_attr_print(&key_attrs.iqa_attr, isns_print_stdout); - entity = isns_object_list_lookup(list, - &isns_entity_template, - &key_attrs.iqa_list); - if (entity != NULL) - continue; - - isns_debug_state("Creating fake entity %s\n", eid); - entity = isns_create_entity(ISNS_ENTITY_PROTOCOL_ISCSI, eid); - isns_object_list_append(list, entity); - } else { - break; - } - } - - isns_attr_list_parser_init(&state, NULL); - if (!isns_parse_attrs(argc, argv, &attrs, &state)) { - isns_error("Unable to parse attrs\n"); - isns_attr_list_destroy(&attrs); - return 0; - } - - obj = isns_create_object(isns_attr_list_parser_context(&state), - &attrs, entity); - isns_attr_list_destroy(&attrs); - - if (obj == NULL) { - isns_error("Unable to create object\n"); - return 0; - } - - isns_object_list_append(list, obj); - return 1; -} - -/* - * Callback function that simply writes out the line as-is - */ -static int -__isns_local_registry_rewrite_object(const char *line, - int argc, char **argv, void *user_data) -{ - FILE *ofp = user_data; - - fprintf(ofp, "%s\n", line); - return 1; -} - -/* - * Load all objects owner by a specific service from the local registry. - * If the svcname starts with "!", all entries except those matching this - * particular service are returned. - */ -int -isns_local_registry_load(const char *svcname, pid_t pid, isns_object_list_t *objs) -{ - __isns_local_registry_cb_fn_t *if_matching = NULL, *if_nonmatching = NULL; - - if (svcname == NULL) { - isns_error("%s: no svcname given\n", __FUNCTION__); - return 0; - } - if (*svcname == '!') { - if_nonmatching = __isns_local_registry_load_object; - svcname++; - } else { - if_matching = __isns_local_registry_load_object; - } - - return __isns_local_registry_read( - __isns_local_registry_make_owner(svcname, pid), - if_matching, if_nonmatching, objs); -} - -/* - * Store the given list of objects in the registry. - * This replaces all objects previously registered by this service. - */ -int -isns_local_registry_store(const char *svcname, pid_t pid, const isns_object_list_t *objs) -{ - const char *owner = __isns_local_registry_make_owner(svcname, pid); - char *lock_name = NULL; - FILE *ofp; - - if (!(ofp = __isns_local_registry_open_write(&lock_name))) { - isns_error("%s: could not open registry for writing\n", __FUNCTION__); - return 0; - } - - /* First, purge all entries previously belonging to this owner */ - if (!__isns_local_registry_read(owner, NULL, __isns_local_registry_rewrite_object, ofp)) - goto failed; - - if (objs) { - unsigned int i; - - for (i = 0; i < objs->iol_count; ++i) { - isns_object_t *obj = objs->iol_data[i]; - char *argv[256]; - int i, argc; - - argc = isns_print_attrs(obj, argv, 256); - for (i = 0; i < argc; ++i) - fprintf(ofp, "%s ", argv[i]); - fprintf(ofp, "owner=%s\n", owner); - } - } - - return __isns_local_registry_finish_write(ofp, lock_name, 1); - -failed: - isns_error("%s: error rewriting registry file\n", __FUNCTION__); - __isns_local_registry_finish_write(ofp, lock_name, 0); - return 0; -} - -/* - * Purge the local registry of all objects owned by the - * given service. - */ -int -isns_local_registry_purge(const char *svcname, pid_t pid) -{ - return isns_local_registry_store(svcname, pid, NULL); -} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/logging.c open-iscsi-2.0.874/utils/open-isns/logging.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/logging.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/logging.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,228 +0,0 @@ -/* - * Logging related utility functions. - * - * Copyright (C) 2004-2007 Olaf Kirch - */ - -#include -#include -#include -#include -#include - -#include "util.h" - -static unsigned int log_stdout = 1; -static unsigned int debugging = 0; - -/* - * When backgrounding, any logging output should - * go to syslog instead of stdout - */ -void -isns_log_background(void) -{ - log_stdout = 0; -} - -/* - * For output to syslog, sanitize the format string - * by removing newlines. - */ -static const char * -sanitize_format(const char *fmt) -{ - static char __fmt[1024]; - unsigned int len; - - /* Don't bother unless there's a newline */ - if (!strchr(fmt, '\n')) - return fmt; - - len = strlen(fmt); - - /* Decline if the buffer would overflow */ - if (len >= sizeof(__fmt)) - return fmt; - - strcpy(__fmt, fmt); - while (len-- && __fmt[len] == '\n') - __fmt[len] = '\0'; - - while (len) { - if (__fmt[len] == '\n') - __fmt[len] = ' '; - --len; - } - - return __fmt; -} - -/* - * Output to stderr or syslog - */ -static void -voutput(int severity, const char *fmt, va_list ap) -{ - if (log_stdout) { - switch (severity) { - case LOG_ERR: - fprintf(stderr, "Error: "); - break; - case LOG_WARNING: - fprintf(stderr, "Warning: "); - break; - case LOG_DEBUG: - fprintf(stderr, " "); - break; - } - vfprintf(stderr, fmt, ap); - } else { - fmt = sanitize_format(fmt); - if (!fmt || !*fmt) - return; - vsyslog(severity, fmt, ap); - } -} - -void -isns_assert_failed(const char *condition, const char *file, unsigned int line) -{ - isns_error("Assertion failed (%s:%d): %s\n", - file, line, condition); - abort(); -} - -void -isns_fatal(const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - if (log_stdout) - fprintf(stderr, "** FATAL ERROR **\n"); - voutput(LOG_ERR, fmt, ap); - va_end(ap); - exit(1); -} - -void -isns_error(const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - voutput(LOG_WARNING, fmt, ap); - va_end(ap); -} - -void -isns_warning(const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - voutput(LOG_NOTICE, fmt, ap); - va_end(ap); -} - -void -isns_notice(const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - voutput(LOG_INFO, fmt, ap); - va_end(ap); -} - -void -isns_enable_debugging(const char *what) -{ - char *copy, *s, *next; - - if (!strcmp(what, "all")) { - debugging = ~0U; - return; - } - - copy = isns_strdup(what); - - for (s = copy; s; s = next) { - if ((next = strchr(s, ',')) != NULL) - *next++ = '\0'; - - if (!strcmp(s, "general")) - debugging |= (1 << DBG_GENERAL); - else if (!strcmp(s, "socket")) - debugging |= (1 << DBG_SOCKET); - else if (!strcmp(s, "protocol")) - debugging |= (1 << DBG_PROTOCOL); - else if (!strcmp(s, "state")) - debugging |= (1 << DBG_STATE); - else if (!strcmp(s, "message")) - debugging |= (1 << DBG_MESSAGE); - else if (!strcmp(s, "auth")) - debugging |= (1 << DBG_AUTH); - else if (!strcmp(s, "scn")) - debugging |= (1 << DBG_SCN); - else if (!strcmp(s, "esi")) - debugging |= (1 << DBG_ESI); - else { - isns_error("Ignoring unknown isns_debug facility <<%s>>\n", - s); - } - } - isns_free(copy); -} - -#define DEFINE_DEBUG_FUNC(name, NAME) \ -void \ -isns_debug_##name(const char *fmt, ...) \ -{ \ - va_list ap; \ - \ - if (!(debugging & (1 << DBG_##NAME))) \ - return; \ - \ - va_start(ap, fmt); \ - voutput(LOG_DEBUG, fmt, ap); \ - va_end(ap); \ -} -DEFINE_DEBUG_FUNC(general, GENERAL) -DEFINE_DEBUG_FUNC(socket, SOCKET) -DEFINE_DEBUG_FUNC(protocol, PROTOCOL) -DEFINE_DEBUG_FUNC(message, MESSAGE) -DEFINE_DEBUG_FUNC(auth, AUTH) -DEFINE_DEBUG_FUNC(state, STATE) -DEFINE_DEBUG_FUNC(scn, SCN) -DEFINE_DEBUG_FUNC(esi, ESI) - -int -isns_debug_enabled(int fac) -{ - return (debugging & (1 << fac)) != 0; -} - -/* - * Misc isns_print_fn_t implementations - */ -void -isns_print_stdout(const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - vfprintf(stdout, fmt, ap); - va_end(ap); -} - -void -isns_print_stderr(const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - vfprintf(stderr, fmt, ap); - va_end(ap); -} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/Makefile.in open-iscsi-2.0.874/utils/open-isns/Makefile.in --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/Makefile.in 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,81 +0,0 @@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ -sbindir = @sbindir@ -mandir = @mandir@ -etcdir = /etc -vardir = /var/lib/isns - -SBINDIR = $(INSTALL_ROOT)$(sbindir) -ETCDIR = $(INSTALL_ROOT)$(etcdir) -CFGDIR = $(ETCDIR)/isns -MANDIR = $(INSTALL_ROOT)$(mandir) -VARDIR = $(INSTALL_ROOT)$(vardir) - -CC = @CC@ -CPPFLAGS= @CPPFLAGS@ -CFLAGS = @CFLAGS@ -I. -LDFLAGS = @LDFLAGS@ - -LIB = libisns.a -LIBOBJS = server.o \ - client.o \ - objects.o \ - callback.o \ - timer.o \ - vendor.o \ - db.o \ - db-file.o \ - db-policy.o \ - relation.o \ - scope.o \ - message.o \ - security.o \ - authblock.o \ - policy.o \ - register.o \ - query.o \ - getnext.o \ - deregister.o \ - esi.o \ - scn.o \ - dd.o \ - entity.o \ - portal-group.o \ - storage-node.o \ - domain.o \ - simple.o \ - tags.o \ - attrs.o \ - export.o \ - socket.o \ - slp.o \ - error.o \ - logging.o \ - config.o \ - parser.o \ - buffer.o \ - pidfile.o \ - sysdep-unix.o \ - util.o \ - bitvector.o \ - mdebug.o -SECLINK = @SECLIBS@ -SLPLINK = @SLPLIBS@ -SLPLIN = @SLPLIBS@ - -all: $(LIB) - -clean distclean:: - rm -f *.o $(LIB) *~ - -distclean:: - rm -f config.h Makefile config.status config.log - rm -rf autom4te.cache - -$(LIB): $(LIBOBJS) - ar cr $@ $(LIBOBJS) - -depend: - gcc $(CFLAGS) -M `ls *.c` > .depend - --include .depend diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/mdebug.c open-iscsi-2.0.874/utils/open-isns/mdebug.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/mdebug.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/mdebug.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,295 +0,0 @@ -/* - * Stupid malloc debugger. I think I wrote something like - * this a couple of times already. Where does all the old - * source code go? - */ - -#ifdef MDEBUG - -#include -#include -#include "util.h" - -static void * isns_malloc_default(size_t, const char *, unsigned int); -static void * isns_calloc_default(unsigned int, size_t, - const char *, unsigned int); -static void * isns_realloc_default(void *, size_t, - const char *, unsigned int); -static char * isns_strdup_default(const char *, const char *, unsigned int); -static void isns_free_default(void *, const char *, unsigned int); - -/* - * These are the function pointers used to redirect malloc and such. - */ -void * (*isns_malloc_fn)(size_t, const char *, unsigned int) = isns_malloc_default; -void * (*isns_calloc_fn)(unsigned int, size_t, - const char *, unsigned int) = isns_calloc_default; -void * (*isns_realloc_fn)(void *, size_t, - const char *, unsigned int) = isns_realloc_default; -char * (*isns_strdup_fn)(const char *, const char *, unsigned int) = isns_strdup_default; -void (*isns_free_fn)(void *, const char *, unsigned int) = isns_free_default; - -#define H_MAGIC 0xfeedbeef -#define T_MAGIC 0xbadf00d -#define CHUNK_OVERHEAD (sizeof(struct m_header) + sizeof(struct m_trailer)) - -struct m_header { - struct isns_list h_list; - uint32_t h_magic; - size_t h_size; - - const char * h_file; - unsigned int h_line; -}; - -struct m_trailer { - uint32_t t_magic[8]; - size_t t_size; -}; - -static ISNS_LIST_DECLARE(m_list); -static void * m_low_addr; -static void * m_high_addr; -static int m_init = 0; - -static void -__isns_check_chunk(const struct m_header *head) -{ - const struct m_trailer *tail; - int i; - - if ((void *) head < m_low_addr - || (void *) head > m_high_addr) { - isns_error("%s: m_list corrupted!\n", __FUNCTION__); - abort(); - } - - if (head->h_magic != H_MAGIC) { - isns_error("%s: m_list item %p with bad header magic %08x\n", - __FUNCTION__, head, head->h_magic); - isns_error(" Allocated from %s:%u\n", - head->h_file, head->h_line); - abort(); - } - - tail = ((void *) head) + sizeof(*head) + head->h_size; - for (i = 0; i < 8; ++i) { - if (tail->t_magic[i] == T_MAGIC) - continue; - - isns_error("%s: m_list item %p with bad trailer magic[%d] %08x\n", - __FUNCTION__, head, i, tail->t_magic[i]); - isns_error(" Allocated from %s:%u\n", - head->h_file, head->h_line); - abort(); - } - - if (tail->t_size != head->h_size) { - isns_error("%s: m_list item %p size mismatch; head=%u tail=%u\n", - __FUNCTION__, head, - head->h_size, tail->t_size); - isns_error(" Allocated from %s:%u\n", - head->h_file, head->h_line); - abort(); - } -} - -static void -__isns_verify_all(void) -{ - struct isns_list *pos, *next; - - isns_list_foreach(&m_list, pos, next) { - __isns_check_chunk(isns_list_item(struct m_header, h_list, pos)); - } -} - -void * -__isns_malloc(size_t size, const char *file, unsigned int line) -{ - struct m_header *head; - struct m_trailer *tail; - size_t true_size; - void *ptr; - int i; - - __isns_verify_all(); - - true_size = size + sizeof(*head) + sizeof(*tail); - isns_assert(size < true_size); - - ptr = malloc(true_size); - if (!ptr) - return NULL; - - if (!m_low_addr) { - m_low_addr = m_high_addr = ptr; - } else if (ptr < m_low_addr) { - m_low_addr = ptr; - } else if (ptr > m_high_addr) { - m_high_addr = ptr; - } - - head = ptr; - head->h_magic = H_MAGIC; - head->h_size = size; - head->h_file = file; - head->h_line = line; - isns_list_append(&m_list, &head->h_list); - - ptr += sizeof(*head); - - tail = ptr + size; - for (i = 0; i < 8; ++i) - tail->t_magic[i] = T_MAGIC; - tail->t_size = size; - - return ptr; -} - -void * -__isns_calloc(unsigned int nele, size_t size, - const char *file, unsigned int line) -{ - void *ptr; - - ptr = __isns_malloc(nele * size, file, line); - if (ptr) - memset(ptr, 0, nele * size); - return ptr; -} - -void * -__isns_realloc(void *old, size_t new_size, - const char *file, unsigned int line) -{ - struct m_header *old_head = NULL; - void *new; - - if (old) { - old_head = (old - sizeof(struct m_header)); - __isns_check_chunk(old_head); - } - - new = __isns_malloc(new_size, file, line); - if (new && old) { - memcpy(new, old, old_head->h_size); - isns_free_fn(old, file, line); - } - - return new; -} - - -char * -__isns_strdup(const char *s, const char *file, unsigned int line) -{ - size_t len; - char *ptr; - - len = s? strlen(s) : 0; - ptr = __isns_malloc(len + 1, file, line); - if (ptr) { - memcpy(ptr, s, len); - ptr[len] = '\0'; - } - return ptr; -} - -void -__isns_free(void *ptr, const char *file, unsigned int line) -{ - struct m_header *head; - size_t true_size; - - if (ptr == NULL) - return; - - head = ptr - sizeof(struct m_header); - __isns_check_chunk(head); - - /* - printf("__isns_free(%u from %s:%u): freed by %s:%u\n", - head->h_size, head->h_file, head->h_line, - file, line); - */ - true_size = head->h_size + CHUNK_OVERHEAD; - isns_list_del(&head->h_list); - - memset(head, 0xa5, true_size); - free(head); - - __isns_verify_all(); -} - -/* - * Enable memory debugging - */ -static void -__isns_mdebug_init(void) -{ - const char *tracefile; - - tracefile = getenv("ISNS_MTRACE"); - if (tracefile) - isns_error("MTRACE not yet supported\n"); - - if (getenv("ISNS_MDEBUG")) { - isns_malloc_fn = __isns_malloc; - isns_calloc_fn = __isns_calloc; - isns_realloc_fn = __isns_realloc; - isns_strdup_fn = __isns_strdup; - isns_free_fn = __isns_free; - isns_notice("Enabled memory debugging\n"); - } - - m_init = 1; -} - -static inline void -isns_mdebug_init(void) -{ - if (!m_init) - __isns_mdebug_init(); -} - -/* - * Default implementations of malloc and friends - */ -static void * -isns_malloc_default(size_t size, const char *file, unsigned int line) -{ - isns_mdebug_init(); - return malloc(size); -} - -static void * -isns_calloc_default(unsigned int nele, size_t size, - const char *file, unsigned int line) -{ - isns_mdebug_init(); - return calloc(nele, size); -} - -static void * -isns_realloc_default(void *old, size_t size, - const char *file, unsigned int line) -{ - isns_mdebug_init(); - return realloc(old, size); -} - -static char * -isns_strdup_default(const char *s, const char *file, unsigned int line) -{ - isns_mdebug_init(); - return strdup(s); -} - -static void -isns_free_default(void *ptr, const char *file, unsigned int line) -{ - isns_mdebug_init(); - return free(ptr); -} -#endif diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/message.c open-iscsi-2.0.874/utils/open-isns/message.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/message.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/message.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,681 +0,0 @@ -/* - * iSNS message handling functions - * - * Copyright (C) 2007 Olaf Kirch - * - * - */ - -#include -#include -#include /* for timercmp */ -#include /* gethostname */ -#include -#include "isns.h" -#include "attrs.h" -#include "message.h" -#include "socket.h" -#include "util.h" - -/* iSCSI qualified names include the year and - * month in which the domain was assigned. - * See RFC 3720, section 3.2.6.3.1. - * That's one of these wonderful committee - * type of ideas that makes it hard for everyone, - * from coder to sysadmin. - * Since we have no way of finding out here, - * we fake it by assigning a date before the - * dawn of time. - */ -#define DUMMY_IQN_PREFIX "iqn.1967-12." - -static uint32_t isns_xid = 1; - -/* - * Initialize a message object - */ -isns_message_t * -__isns_alloc_message(uint32_t xid, size_t size, void (*destroy)(isns_message_t *)) -{ - isns_message_t *msg; - - isns_assert(size >= sizeof(*msg)); - msg = isns_calloc(1, size); - - isns_list_init(&msg->im_list); - msg->im_users = 1; - msg->im_xid = xid; - msg->im_destroy = destroy; - - return msg; -} - -static int -__isns_message_init(isns_message_t *msg, - uint16_t function, uint16_t flags, - size_t payload_len) -{ - struct isns_hdr *hdr = &msg->im_header; - - /* Pad to multiple of 4 octets */ - payload_len = (payload_len + 3) & ~3UL; - - /* For now, we don't do segmentation */ - if (payload_len > ISNS_MAX_PDU_SIZE) - return 0; - - /* msg->im_header is in host byte order */ - hdr->i_version = ISNS_VERSION; - hdr->i_function = function; - hdr->i_flags = flags; - hdr->i_length = payload_len; - hdr->i_xid = msg->im_xid; - hdr->i_seq = 0; - - /* Allocate buffer and reserve room for header */ - msg->im_payload = buf_alloc(sizeof(*hdr) + payload_len); - buf_push(msg->im_payload, sizeof(*hdr)); - - return 1; -} - -/* - * Allocate a message object. - */ -static isns_message_t * -__isns_create_message(uint32_t xid, uint16_t function, uint16_t flags) -{ - isns_message_t *msg; - - msg = __isns_alloc_message(xid, sizeof(*msg), NULL); - __isns_message_init(msg, function, flags, ISNS_MAX_MESSAGE); - - return msg; -} - -/* - * Allocate a request message - */ -isns_message_t * -isns_create_message(uint16_t function, uint16_t flags) -{ - return __isns_create_message(isns_xid++, function, flags); -} - -/* - * Allocate a response message - */ -isns_message_t * -isns_create_reply(const isns_message_t *msg) -{ - uint16_t function = msg->im_header.i_function;; - isns_message_t *resp; - - resp = __isns_create_message(msg->im_xid, function | 0x8000, ISNS_F_SERVER); - resp->im_addr = msg->im_addr; - resp->im_addrlen = msg->im_addrlen; - - /* Default to ISNS_SUCCESS */ - buf_put32(resp->im_payload, ISNS_SUCCESS); - - return resp; -} - -/* - * Delete a message - */ -void -isns_message_release(isns_message_t *msg) -{ - if (msg == NULL) - return; - - isns_assert(msg->im_users); - if (--(msg->im_users)) - return; - - if (msg->im_destroy) - msg->im_destroy(msg); - if (msg->im_payload) - buf_free(msg->im_payload); - isns_principal_free(msg->im_security); - - isns_list_del(&msg->im_list); - isns_free(msg); -} - -/* - * Extract the status from a reply message - */ -int -isns_message_status(isns_message_t *msg) -{ - uint32_t status; - - if (!(msg->im_header.i_function & 0x8000) - || !buf_get32(msg->im_payload, &status)) - return ISNS_MESSAGE_FORMAT_ERROR; - return status; -} - -/* - * Obtain the socket on which the message was received. - */ -isns_socket_t * -isns_message_socket(const isns_message_t *msg) -{ - return msg->im_socket; -} - -/* - * Obtain the message's security context - */ -isns_security_t * -isns_message_security(const isns_message_t *msg) -{ - if (!msg->im_socket) - return NULL; - return msg->im_socket->is_security; -} - -unsigned int -isns_message_function(const isns_message_t *msg) -{ - return msg->im_header.i_function; -} - -/* - * Reset the response message, and encode isns_error - * status - */ -void -isns_message_set_error(isns_message_t *msg, uint32_t status) -{ - /* Clear the buffer. This just resets head + tail */ - buf_clear(msg->im_payload); - - /* Now move past the header, and overwrite the - * status word. */ - buf_push(msg->im_payload, sizeof(struct isns_hdr)); - buf_put32(msg->im_payload, status); -} - -/* - * Message queue handling. Most related functions are - * in message.h - */ -void -isns_message_queue_move(isns_message_queue_t *dstq, - isns_message_t *msg) -{ - unsigned int src_ref = 0; - - /* If the message was on a different queue, - * the source queue will hold a reference - * to it. Account for that and fix up the - * refcount after we've appended it to the - * destination queue. */ - if (isns_message_unlink(msg)) - src_ref = 1; - - isns_message_queue_append(dstq, msg); - msg->im_users -= src_ref; -} - -/* - * Insert a messsage into a queue sorted by resend timeout - */ -void -isns_message_queue_insert_sorted(isns_message_queue_t *q, - int sort, isns_message_t *msg) -{ - isns_list_t *pos; - isns_message_t *__m; - - isns_assert(msg->im_queue == NULL); - if (sort == ISNS_MQ_SORT_RESEND_TIMEOUT) { - isns_message_queue_foreach(q, pos, __m) { - if (timercmp(&msg->im_resend_timeout, - &__m->im_resend_timeout, <)) - break; - } - } else { - isns_message_queue_append(q, msg); - return; - } - - /* Insert before pos */ - __isns_list_insert(pos->prev, &msg->im_list, pos); - q->imq_count++; - - msg->im_queue = q; - msg->im_users++; -} - -/* - * Message queue handling - */ -void -isns_message_queue_destroy(isns_message_queue_t *q) -{ - isns_message_t *msg; - - while ((msg = isns_message_dequeue(q)) != NULL) - isns_message_release(msg); -} - -/* - * Find a message with matching xid and address. - * (address, alen) may be NULL. - */ -isns_message_t * -isns_message_queue_find(isns_message_queue_t *q, uint32_t xid, - const struct sockaddr_storage *addr, socklen_t alen) -{ - isns_message_t *msg; - isns_list_t *pos; - - isns_message_queue_foreach(q, pos, msg) { - if (msg->im_xid != xid) - continue; - if (alen == 0) - return msg; - - if (msg->im_addrlen == alen - && !memcmp(&msg->im_addr, addr, alen)) - return msg; - } - - return NULL; -} - -/* - * Convert a hostname into an iSCSI qualified name - * We omit the dismbiguating YYYY-MM infix because - * we have no way of finding out, short of bothering - * whois. - */ -static char * -__revert_fqdn(const char *prefix, const char *__fqdn, const char *suffix) -{ - static char namebuf[1024] = { '\0' }; - char *fqdn, *result = NULL; - int pos, count = 0; - - if (prefix) - strcpy(namebuf, prefix); - pos = strlen(namebuf); - - fqdn = isns_strdup(__fqdn); - while (1) { - char *dot, *comp; - int comp_len; - - if ((dot = strrchr(fqdn, '.')) != NULL) { - *dot++ = '\0'; - comp = dot; - } else { - comp = fqdn; - } - - if (*comp == '\0') - continue; - comp_len = strlen(comp); - if (pos + comp_len + 2 > sizeof(namebuf)) { - isns_error("%s: FQDN too long\n", __FUNCTION__); - goto out; - } - if (count++) - namebuf[pos++] = '.'; - strcpy(namebuf + pos, comp); - pos += comp_len; - - if (dot == NULL) - break; - } - - if (suffix) { - int sfx_len = strlen(suffix); - - if (pos + sfx_len + 2 > sizeof(namebuf)) { - isns_error("%s: name too long\n", __FUNCTION__); - goto out; - } - namebuf[pos++] = ':'; - strcpy(namebuf + pos, suffix); - pos += sfx_len; - } - - result = isns_strdup(namebuf); - -out: isns_free(fqdn); - return result; -} - -/* - * Initialize all names - */ -int -isns_init_names(void) -{ - if (isns_config.ic_host_name == NULL) { - char namebuf[1024], *fqdn; - - if (gethostname(namebuf, sizeof(namebuf)) < 0) { - isns_error("gehostname: %m\n"); - return 0; - } - fqdn = isns_get_canon_name(namebuf); - if (fqdn == NULL) { - /* FIXME: we could get some unique value here - * such as the IP address, and concat that - * with iqn.2005-01.org.open-iscsi.ip for the - * source name. - */ - isns_error("Unable to get fully qualified hostname\n"); - return 0; - } - isns_config.ic_host_name = fqdn; - } - - if (isns_config.ic_auth_name == NULL) { - isns_config.ic_auth_name = isns_config.ic_host_name; - } - - if (isns_config.ic_entity_name == NULL) { - isns_config.ic_entity_name = isns_config.ic_auth_name; - } - - if (isns_config.ic_source_name == NULL) { - isns_config.ic_source_name = __revert_fqdn(DUMMY_IQN_PREFIX, - isns_config.ic_host_name, - isns_config.ic_source_suffix); - if (isns_config.ic_source_name == NULL) { - isns_error("Unable to build source name\n"); - return 0; - } - } - - return 1; -} - -/* - * Match a source name to a pattern (which is really just - * the entity identifier, usually). - * - * If the pattern is of the form "match:rev-fqdn", the - * source name must match - * iqn.[YYYY-MM.] - * optionally followed by dot, colon or hyphen and arbitrary - * text. - * - * If the pattern does not start with "match:", the source name - * must match the pattern literally (case insensitively). - */ -int -isns_source_pattern_match(const char *pattern, const char *source) -{ - unsigned int rev_len; - - isns_debug_message("%s(%s, %s)\n", - __FUNCTION__, pattern, source); - - if (!strcmp(pattern, "*")) - return 1; - - if (strncmp(pattern, "match:", 6)) - return !strcasecmp(pattern, source); - pattern += 6; - - if (strncasecmp(source, "iqn.", 4)) - return 0; - source += 4; - - rev_len = strlen(pattern); - if (strncasecmp(source, pattern, rev_len)) { - /* See if the next component is YYYY-MM */ - if (!(isdigit(source[0]) - && isdigit(source[1]) - && isdigit(source[2]) - && isdigit(source[3]) - && source[4] == '-' - && isdigit(source[5]) - && isdigit(source[6]) - && source[7] == '.')) - return 0; - source += 8; - - if (strncasecmp(source, pattern, rev_len)) - return 0; - } - - source += rev_len; - if (source[0] != '.' - && source[0] != ':' - && source[0] != '-' - && source[0] != '\0') - return 0; - - return 1; -} - -/* - * This really just reverts the FQDN so it can - * be used in isns_source_entity_match - */ -char * -isns_build_source_pattern(const char *fqdn) -{ - return __revert_fqdn("match:", fqdn, NULL); -} - -/* - * Manage source objects - */ -static isns_source_t * -__isns_source_create(isns_attr_t *name_attr) -{ - isns_source_t *source = isns_calloc(1, sizeof(*source)); - - source->is_users = 1; - source->is_attr = name_attr; - return source; -} - -isns_source_t * -isns_source_create(isns_attr_t *name_attr) -{ - if (name_attr->ia_tag_id != ISNS_TAG_ISCSI_NAME - && name_attr->ia_tag_id != ISNS_TAG_FC_PORT_NAME_WWPN) - return NULL; - - name_attr->ia_users++; - return __isns_source_create(name_attr); -} - -isns_source_t * -isns_source_from_object(const isns_object_t *node) -{ - isns_attr_t *attr; - - if (!(attr = isns_storage_node_key_attr(node))) - return NULL; - return isns_source_create(attr); -} - -isns_source_t * -isns_source_create_iscsi(const char *name) -{ - isns_value_t var = ISNS_VALUE_INIT(string, (char *) name); - isns_attr_t *attr; - - attr = isns_attr_alloc(ISNS_TAG_ISCSI_NAME, NULL, &var); - return __isns_source_create(attr); -} - -/* - * This is used to attach a dummy source to iSNS responses - * until I fixed up all the code that relies on msg->is_source - * to be valid all the time. - */ -isns_source_t * -isns_source_dummy(void) -{ - static isns_source_t *dummy = NULL; - - if (!dummy) - dummy = isns_source_create_iscsi(".dummy."); - return isns_source_get(dummy); -} - -uint32_t -isns_source_type(const isns_source_t *source) -{ - return source->is_attr->ia_tag_id; -} - -const char * -isns_source_name(const isns_source_t *source) -{ - return source->is_attr->ia_value.iv_string; -} - -isns_attr_t * -isns_source_attr(const isns_source_t *source) -{ - return source->is_attr; -} - -/* - * Obtain an additional reference on the source object - */ -isns_source_t * -isns_source_get(isns_source_t *source) -{ - if (source) - source->is_users++; - return source; -} - -/* - * Look up the node corresponding to this source name - * When we get here, we have already verified that the - * client is permitted (by policy) to use this source node. - */ -int -isns_source_set_node(isns_source_t *source, isns_db_t *db) -{ - isns_object_t *node, *entity; - uint32_t node_type; - - if (source->is_node) - return 1; - - if (db == NULL) - return 0; - - node = isns_db_lookup_source_node(db, source); - if (node == NULL) - return 0; - - if (!isns_object_get_uint32(node, ISNS_TAG_ISCSI_NODE_TYPE, &node_type)) - node_type = 0; - - source->is_node = node; - source->is_node_type = node_type; - - if ((entity = isns_object_get_entity(node)) != NULL) - source->is_entity = isns_object_get(entity); - return 1; -} - -void -isns_source_set_entity(isns_source_t *source, isns_object_t *obj) -{ - if (obj) - isns_object_get(obj); - isns_object_release(source->is_entity); - source->is_entity = obj; -} - -/* - * Release a reference on the source object - */ -void -isns_source_release(isns_source_t *source) -{ - if (source && --source->is_users == 0) { - isns_attr_release(source->is_attr); - isns_object_release(source->is_node); - isns_object_release(source->is_entity); - memset(source, 0xa5, sizeof(*source)); - isns_free(source); - } -} - -/* - * Compare two source objects - */ -int -isns_source_match(const isns_source_t *a, - const isns_source_t *b) -{ - if (a && b) - return isns_attr_match(a->is_attr, b->is_attr); - return 0; -} - -/* - * Encode/decode source object - */ -int -isns_source_encode(buf_t *bp, const isns_source_t *source) -{ - if (source == NULL) { - isns_attr_t nil = ISNS_ATTR_INIT(ISNS_TAG_DELIMITER, nil, 0); - - return isns_attr_encode(bp, &nil); - } - return isns_attr_encode(bp, source->is_attr); -} - -int -isns_source_decode(buf_t *bp, isns_source_t **result) -{ - isns_attr_t *attr; - int status; - - status = isns_attr_decode(bp, &attr); - if (status == ISNS_SUCCESS) { - /* - * 5.6.1 - * The Source Attribute uniquely identifies the source of the - * message. Valid Source Attribute types are shown below. - * - * Valid Source Attributes - * ----------------------- - * iSCSI Name - * FC Port Name WWPN - */ - switch (attr->ia_tag_id) { -#if 0 - case ISNS_TAG_DELIMITER: - *result = NULL; - break; -#endif - - case ISNS_TAG_ISCSI_NAME: - *result = __isns_source_create(attr); - break; - - case ISNS_TAG_FC_PORT_NAME_WWPN: - *result = __isns_source_create(attr); - break; - - default: - isns_attr_release(attr); - return ISNS_SOURCE_UNKNOWN; - } - } - return status; -} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/message.h open-iscsi-2.0.874/utils/open-isns/message.h --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/message.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/message.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,196 +0,0 @@ -/* - * iSNS message definitions and functions - * - * Copyright (C) 2007 Olaf Kirch - */ - -#ifndef ISNS_MESSAGE_H -#define ISNS_MESSAGE_H - -#include "attrs.h" -#include "source.h" -#include "util.h" - -typedef struct isns_message_queue isns_message_queue_t; - -struct isns_simple { - uint32_t is_function; - isns_source_t * is_source; - isns_policy_t * is_policy; - uint16_t is_xid; - - unsigned int is_replace : 1; - - isns_attr_list_t is_message_attrs; - isns_attr_list_t is_operating_attrs; -}; - -struct isns_message { - unsigned int im_users; - isns_list_t im_list; - struct sockaddr_storage im_addr; - socklen_t im_addrlen; - uint32_t im_xid; - struct isns_hdr im_header; - struct isns_buf * im_payload; - isns_socket_t * im_socket; - isns_principal_t * im_security; - struct ucred * im_creds; - - isns_message_queue_t * im_queue; - - /* When to retransmit */ - struct timeval im_resend_timeout; - struct timeval im_timeout; - - void (*im_destroy)(isns_message_t *); - void (*im_callback)(isns_message_t *, - isns_message_t *); - void * im_calldata; -}; - -enum { - ISNS_MQ_SORT_NONE, - ISNS_MQ_SORT_RESEND_TIMEOUT, -}; - -struct isns_message_queue { - isns_list_t imq_list; - size_t imq_count; -}; - -struct isns_server { - isns_source_t * is_source; - isns_db_t * is_db; - - isns_scn_callback_fn_t *is_scn_callback; - struct isns_service_ops *is_ops; -}; - -extern isns_message_t * __isns_alloc_message(uint32_t, size_t, void (*)(isns_message_t *)); -extern isns_security_t *isns_message_security(const isns_message_t *); - -extern isns_message_t * isns_message_queue_find(isns_message_queue_t *, uint32_t, - const struct sockaddr_storage *, socklen_t); -extern void isns_message_queue_insert_sorted(isns_message_queue_t *, - int, isns_message_t *); -extern void isns_message_queue_move(isns_message_queue_t *, - isns_message_t *); -extern void isns_message_queue_destroy(isns_message_queue_t *); - -extern isns_simple_t * isns_simple_create(uint32_t, - isns_source_t *, - const isns_attr_list_t *); -extern void isns_simple_free(isns_simple_t *); -extern int isns_simple_encode(isns_simple_t *, - isns_message_t **result); -extern int isns_simple_decode(isns_message_t *, - isns_simple_t **); -extern int isns_simple_encode_response(isns_simple_t *, - const isns_message_t *, isns_message_t **); -extern int isns_simple_response_get_objects(isns_simple_t *, - isns_object_list_t *); -extern const char * isns_function_name(uint32_t); - -extern isns_source_t * isns_simple_get_source(isns_simple_t *); - -extern int isns_process_registration(isns_server_t *, isns_simple_t *, isns_simple_t **); -extern int isns_process_query(isns_server_t *, isns_simple_t *, isns_simple_t **); -extern int isns_process_getnext(isns_server_t *, isns_simple_t *, isns_simple_t **); -extern int isns_process_deregistration(isns_server_t *, isns_simple_t *, isns_simple_t **); -extern int isns_process_scn_register(isns_server_t *, isns_simple_t *, isns_simple_t **); -extern int isns_process_scn_deregistration(isns_server_t *, isns_simple_t *, isns_simple_t **); -extern int isns_process_dd_registration(isns_server_t *, isns_simple_t *, isns_simple_t **); -extern int isns_process_dd_deregistration(isns_server_t *, isns_simple_t *, isns_simple_t **); -extern int isns_process_esi(isns_server_t *, isns_simple_t *, isns_simple_t **); -extern int isns_process_scn(isns_server_t *, isns_simple_t *, isns_simple_t **); - -/* - * Inline functions for message queues. - */ -static inline void -isns_message_queue_init(isns_message_queue_t *q) -{ - isns_list_init(&q->imq_list); - q->imq_count = 0; -} - -static inline isns_message_t * -isns_message_queue_head(const isns_message_queue_t *q) -{ - isns_list_t *pos = q->imq_list.next; - - if (pos == &q->imq_list) - return NULL; - return isns_list_item(isns_message_t, im_list, pos); -} - -static inline void -isns_message_queue_append(isns_message_queue_t *q, isns_message_t *msg) -{ - isns_assert(msg->im_queue == NULL); - isns_list_append(&q->imq_list, &msg->im_list); - q->imq_count++; - - msg->im_queue = q; - msg->im_users++; -} - -static inline isns_message_t * -isns_message_queue_remove(isns_message_queue_t *q, isns_message_t *msg) -{ - isns_assert(msg->im_queue == q); - isns_list_del(&msg->im_list); - msg->im_queue = NULL; - q->imq_count--; - - return msg; -} - -static inline isns_message_t * -isns_message_unlink(isns_message_t *msg) -{ - if (msg->im_queue) - return isns_message_queue_remove(msg->im_queue, msg); - return NULL; -} - -static inline isns_message_t * -isns_message_dequeue(isns_message_queue_t *q) -{ - isns_message_t *msg; - - if ((msg = isns_message_queue_head(q)) != NULL) { - isns_list_del(&msg->im_list); - msg->im_queue = NULL; - q->imq_count--; - } - return msg; -} - -/* - * Iterator for looping over all messages in a queue - */ -static inline void -isns_message_queue_begin(isns_message_queue_t *q, isns_list_t **pos) -{ - *pos = q->imq_list.next; -} - -static inline isns_message_t * -isns_message_queue_next(isns_message_queue_t *q, isns_list_t **pos) -{ - isns_list_t *next = *pos; - - if (next == &q->imq_list) - return NULL; - *pos = next->next; - return isns_list_item(isns_message_t, im_list, next); -} - -#define isns_message_queue_foreach(q, pos, item) \ - for (isns_message_queue_begin(q, &pos); \ - (item = isns_message_queue_next(q, &pos)) != NULL; \ - ) - -#endif /* ISNS_MESSAGE_H */ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/objects.c open-iscsi-2.0.874/utils/open-isns/objects.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/objects.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/objects.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1320 +0,0 @@ -/* - * iSNS object model - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include -#include -#include -#include "isns.h" -#include "objects.h" -#include "source.h" -#include "vendor.h" -#include "attrs.h" -#include "util.h" - -/* For relationship stuff - should go */ -#include "db.h" - -static isns_object_template_t * isns_object_templates[] = { - &isns_entity_template, - &isns_portal_template, - &isns_iscsi_node_template, - &isns_fc_port_template, - &isns_fc_node_template, - &isns_iscsi_pg_template, - &isns_dd_template, - &isns_ddset_template, - - /* vendor-specific templates */ - &isns_policy_template, - - NULL -}; - -/* - * Quick lookup of (key) tag to template - */ -#define MAX_QUICK_TAG 2100 -static isns_object_template_t * isns_object_template_key_map[MAX_QUICK_TAG]; -static isns_object_template_t * isns_object_template_any_map[MAX_QUICK_TAG]; -static isns_object_template_t * isns_object_template_idx_map[MAX_QUICK_TAG]; -static int isns_object_maps_inizialized = 0; - - -static void -__isns_object_maps_init(void) -{ - isns_object_template_t *tmpl; - uint32_t i, j, tag; - - isns_object_maps_inizialized = 1; - - for (i = 0; (tmpl = isns_object_templates[i]) != NULL; ++i) { - if (tmpl->iot_vendor_specific) - continue; - - tag = tmpl->iot_keys[0]; - isns_assert(tag < MAX_QUICK_TAG); - isns_object_template_key_map[tag] = tmpl; - - for (j = 0; j < tmpl->iot_num_attrs; ++j) { - tag = tmpl->iot_attrs[j]; - isns_assert(tag < MAX_QUICK_TAG); - isns_object_template_any_map[tag] = tmpl; - } - - if ((tag = tmpl->iot_index) != 0) - isns_object_template_idx_map[tag] = tmpl; - } -} - -static void -isns_object_maps_init(void) -{ - if (!isns_object_maps_inizialized) - __isns_object_maps_init(); -} - -/* - * Based on a given key attribute, find the corresponding - * object type. - */ -isns_object_template_t * -isns_object_template_find(uint32_t key_tag) -{ - isns_object_template_t *tmpl; - unsigned int i; - - isns_object_maps_init(); - if (key_tag < MAX_QUICK_TAG) - return isns_object_template_key_map[key_tag]; - - for (i = 0; (tmpl = isns_object_templates[i]) != NULL; ++i) { - if (tmpl->iot_keys[0] == key_tag) - return tmpl; - } - - return NULL; -} - -/* - * Given a set of attributes, find the corresponding - * object type. - * Any attributes in the list in *addition to* the keys - * attributes are ignored. - */ -isns_object_template_t * -isns_object_template_for_key_attrs(const isns_attr_list_t *attrs) -{ - isns_object_template_t *tmpl; - const isns_attr_t *attr; - unsigned int i; - - if (attrs->ial_count == 0) - return NULL; - attr = attrs->ial_data[0]; - - tmpl = isns_object_template_find(attr->ia_tag_id); - if (tmpl == NULL) - return NULL; - - /* - * 5.6.4. - * - * Some objects are keyed by more than one object key attribute - * value. For example, the Portal object is keyed by attribute - * tags 16 and 17. When describing an object keyed by more than one - * key attribute, every object key attribute of that object MUST be - * listed sequentially by tag value in the message before non-key - * attributes of that object and key attributes of the next object. - * A group of key attributes of this kind is treated as a single - * logical key attribute when identifying an object. - */ - for (i = 1; i < tmpl->iot_num_keys; ++i) { - attr = attrs->ial_data[i]; - - if (attr->ia_tag_id != tmpl->iot_keys[i]) - return NULL; - } - - return tmpl; -} - -isns_object_template_t * -isns_object_template_for_tag(uint32_t tag) -{ - isns_object_template_t *tmpl; - unsigned int i, j; - - isns_object_maps_init(); - if (tag < MAX_QUICK_TAG) - return isns_object_template_any_map[tag]; - - for (i = 0; (tmpl = isns_object_templates[i]) != NULL; ++i) { - for (j = 0; j < tmpl->iot_num_attrs; ++j) { - if (tmpl->iot_attrs[j] == tag) - return tmpl; - } - } - - return NULL; -} - -isns_object_template_t * -isns_object_template_for_index_tag(uint32_t tag) -{ - isns_object_maps_init(); - if (tag >= MAX_QUICK_TAG) - return NULL; - - return isns_object_template_idx_map[tag]; -} - -isns_object_template_t * -isns_object_template_by_name(const char *name) -{ - isns_object_template_t **pp, *tmpl; - - pp = isns_object_templates; - while ((tmpl = *pp++) != NULL) { - if (!strcasecmp(tmpl->iot_name, name)) - return tmpl; - } - return NULL; -} - -const char * -isns_object_template_name(isns_object_template_t *tmpl) -{ - if (!tmpl) - return NULL; - return tmpl->iot_name; -} - -/* - * Notify any listeners that the object has changed, - * and mark it dirty. - * dd_or_dds is used for DD_MEMBER_ADDED and - * DD_MEMBER_REMOVED events, and refers to the - * domain or domain set the object was added to or - * removed from. - */ -void -isns_mark_object(isns_object_t *obj, unsigned int how) -{ - obj->ie_flags |= ISNS_OBJECT_DIRTY; - obj->ie_mtime = time(NULL); - obj->ie_scn_bits |= (1 << how); - isns_object_event(obj, 0, NULL); -} - -static void -__isns_mark_object(isns_object_t *obj) -{ - obj->ie_flags |= ISNS_OBJECT_DIRTY; - obj->ie_mtime = time(NULL); -} - -/* - * Create an object given its object template - */ -isns_object_t * -isns_create_object(isns_object_template_t *tmpl, - const isns_attr_list_t *attrs, - isns_object_t *parent) -{ - isns_object_t *obj; - unsigned int i; - - /* Enforce containment rules. */ - if (parent) - isns_assert(tmpl->iot_container == parent->ie_template); - -#ifdef notdef - /* This check is somewhat costly: */ - if (attrs && tmpl != isns_object_template_for_key_attrs(attrs)) - return NULL; -#endif - - obj = isns_calloc(1, sizeof(*obj)); - - obj->ie_users = 1; - obj->ie_template = tmpl; - isns_attr_list_init(&obj->ie_attrs); - - if (parent) - isns_object_attach(obj, parent); - - if (attrs == NULL) { - /* Make sure that all key attrs are instantiated - * and in sequence. */ - for (i = 0; i < tmpl->iot_num_keys; ++i) - isns_attr_list_append_nil(&obj->ie_attrs, - tmpl->iot_keys[i]); - } else { - /* We rely on the caller to ensure that - * attributes are in proper sequence. */ - isns_attr_list_copy(&obj->ie_attrs, attrs); - } - - /* Just mark it dirty, but do not schedule a - * SCN event. */ - __isns_mark_object(obj); - - return obj; -} - -/* - * Obtain an additional reference on the object - */ -isns_object_t * -isns_object_get(isns_object_t *obj) -{ - if (obj) { - isns_assert(obj->ie_users); - obj->ie_users++; - } - return obj; -} - -/* - * Release a reference on the object - */ -void -isns_object_release(isns_object_t *obj) -{ - unsigned int i; - isns_object_t *child; - - if (!obj) - return; - - isns_assert(obj->ie_users); - if (--(obj)->ie_users != 0) - return; - - /* Must not have any live references to it */ - isns_assert(obj->ie_references == 0); - - /* Must be detached from parent */ - isns_assert(obj->ie_container == NULL); - - /* Release all children. We explicitly clear - * ie_container because the destructor - * checks for this (in order to catch - * refcounting bugs) */ - for (i = 0; i < obj->ie_children.iol_count; ++i) { - child = obj->ie_children.iol_data[i]; - child->ie_container = NULL; - } - isns_object_list_destroy(&obj->ie_children); - - isns_attr_list_destroy(&obj->ie_attrs); - - isns_bitvector_free(obj->ie_membership); - isns_free(obj); -} - -/* - * Get the topmost container (ie Network Entity) - * for the given object - */ -isns_object_t * -isns_object_get_entity(isns_object_t *obj) -{ - if (obj == NULL) - return NULL; - while (obj->ie_container) - obj = obj->ie_container; - if (!ISNS_IS_ENTITY(obj)) - return NULL; - return obj; -} - -int -isns_object_contains(const isns_object_t *ancestor, - const isns_object_t *descendant) -{ - while (descendant) { - if (descendant == ancestor) - return 1; - descendant = descendant->ie_container; - } - return 0; -} - -/* - * Get all children of the specified type - */ -void -isns_object_get_descendants(const isns_object_t *obj, - isns_object_template_t *tmpl, - isns_object_list_t *result) -{ - isns_object_t *child; - unsigned int i; - - for (i = 0; i < obj->ie_children.iol_count; ++i) { - child = obj->ie_children.iol_data[i]; - if (!tmpl || child->ie_template == tmpl) - isns_object_list_append(result, child); - } -} - -/* - * Attach an object to a new container - */ -int -isns_object_attach(isns_object_t *obj, isns_object_t *parent) -{ - isns_assert(obj->ie_container == NULL); - - if (parent) { - /* Copy the owner (ie source) from the parent - * object. - * Make sure the parent object type is a valid - * container for this object. - */ - if (parent->ie_template != obj->ie_template->iot_container) { - isns_error("You are not allowed to add a %s object " - "to a %s!\n", - obj->ie_template->iot_name, - parent->ie_template->iot_name); - return 0; - } - obj->ie_flags = parent->ie_flags & ISNS_OBJECT_PRIVATE; - isns_object_list_append(&parent->ie_children, obj); - } - obj->ie_container = parent; - return 1; -} - -int -isns_object_is_valid_container(const isns_object_t *container, - isns_object_template_t *child_type) -{ - return child_type->iot_container == container->ie_template; -} - -/* - * Detach an object from its container - */ -int -isns_object_detach(isns_object_t *obj) -{ - isns_object_t *parent; - - /* Detach from parent */ - if ((parent = obj->ie_container) != NULL) { - int removed; - - obj->ie_container = NULL; - removed = isns_object_list_remove( - &parent->ie_children, obj); - - isns_assert(removed != 0); - } - - return 0; -} - -/* - * Check the type of an object - */ -int -isns_object_is(const isns_object_t *obj, - isns_object_template_t *tmpl) -{ - return obj->ie_template == tmpl; -} - -int -isns_object_is_iscsi_node(const isns_object_t *obj) -{ - return ISNS_IS_ISCSI_NODE(obj); -} - -int -isns_object_is_fc_port(const isns_object_t *obj) -{ - return ISNS_IS_FC_PORT(obj); -} - -int -isns_object_is_fc_node(const isns_object_t *obj) -{ - return ISNS_IS_FC_NODE(obj); -} - -int -isns_object_is_portal(const isns_object_t *obj) -{ - return ISNS_IS_PORTAL(obj); -} - -int -isns_object_is_pg(const isns_object_t *obj) -{ - return ISNS_IS_PG(obj); -} - -int -isns_object_is_policy(const isns_object_t *obj) -{ - return ISNS_IS_POLICY(obj); -} - -/* - * Match an object against a list of attributes. - */ -int -isns_object_match(const isns_object_t *obj, - const isns_attr_list_t *attrs) -{ - isns_object_template_t *tmpl = obj->ie_template; - isns_attr_t *self, *match; - unsigned int i, j, from = 0; - uint32_t tag; - - /* Fast path: try to compare in-order */ - while (from < attrs->ial_count) { - match = attrs->ial_data[from]; - self = obj->ie_attrs.ial_data[from]; - - if (match->ia_tag_id != self->ia_tag_id) - goto slow_path; - - if (!isns_attr_match(self, match)) - return 0; - - from++; - } - - return 1; - -slow_path: - for (i = from; i < attrs->ial_count; ++i) { - isns_attr_t *found = NULL; - - match = attrs->ial_data[i]; - - /* - * 5.6.5.2 - * A Message Key with zero-length TLV(s) is scoped to - * every object of the type indicated by the zero-length - * TLV(s) - */ - if (match->ia_value.iv_type == &isns_attr_type_nil) { - tag = match->ia_tag_id; - if (isns_object_attr_valid(tmpl, tag)) - continue; - return 0; - } - - for (j = from; j < obj->ie_attrs.ial_count; ++j) { - self = obj->ie_attrs.ial_data[j]; - - if (match->ia_tag_id == self->ia_tag_id) { - found = self; - break; - } - } - - if (found == NULL) - return 0; - - if (!isns_attr_match(self, match)) - return 0; - } - return 1; -} - -/* - * Find descendant object matching the given key - */ -isns_object_t * -isns_object_find_descendant(isns_object_t *obj, const isns_attr_list_t *keys) -{ - isns_object_list_t list = ISNS_OBJECT_LIST_INIT; - isns_object_t *found; - - if (!isns_object_find_descendants(obj, NULL, keys, &list)) - return NULL; - - found = isns_object_get(list.iol_data[0]); - isns_object_list_destroy(&list); - - return found; -} - -int -isns_object_find_descendants(isns_object_t *obj, - isns_object_template_t *tmpl, - const isns_attr_list_t *keys, - isns_object_list_t *result) -{ - isns_object_t *child; - unsigned int i; - - if ((tmpl == NULL || tmpl == obj->ie_template) - && (keys == NULL || isns_object_match(obj, keys))) - isns_object_list_append(result, obj); - - for (i = 0; i < obj->ie_children.iol_count; ++i) { - child = obj->ie_children.iol_data[i]; - isns_object_find_descendants(child, tmpl, keys, result); - } - - return result->iol_count; -} - -/* - * Return the object's modification time stamp - */ -time_t -isns_object_last_modified(const isns_object_t *obj) -{ - return obj->ie_mtime; -} - -/* - * Set the SCN bitmap - */ -void -isns_object_set_scn_mask(isns_object_t *obj, uint32_t bitmap) -{ - obj->ie_scn_mask = bitmap; - __isns_mark_object(obj); -} - -/* - * Debugging utility: print the object - */ -void -isns_object_print(isns_object_t *obj, isns_print_fn_t *fn) -{ - isns_attr_list_print(&obj->ie_attrs, fn); -} - -/* - * Return a string representing the object state - */ -const char * -isns_object_state_string(unsigned int state) -{ - switch (state) { - case ISNS_OBJECT_STATE_LARVAL: - return "larval"; - case ISNS_OBJECT_STATE_MATURE: - return "mature"; - case ISNS_OBJECT_STATE_LIMBO: - return "limbo"; - case ISNS_OBJECT_STATE_DEAD: - return "dead"; - } - return "UNKNOWN"; -} - -/* - * This is needed when deregistering an object. - * Remove all attributes except the key and index attrs. - */ -void -isns_object_prune_attrs(isns_object_t *obj) -{ - isns_object_template_t *tmpl = obj->ie_template; - uint32_t tags[16]; - unsigned int i; - - isns_assert(tmpl->iot_num_keys + 1 <= 16); - for (i = 0; i < tmpl->iot_num_keys; ++i) - tags[i] = tmpl->iot_keys[i]; - if (tmpl->iot_index) - tags[i++] = tmpl->iot_index; - isns_attr_list_prune(&obj->ie_attrs, tags, i); -} - -/* - * Convenience functions - */ - -/* - * Create a portal object. - * For now, always assume TCP. - */ -isns_object_t * -isns_create_portal(const isns_portal_info_t *info, - isns_object_t *parent) -{ - isns_object_t *obj; - - obj = isns_create_object(&isns_portal_template, NULL, parent); - isns_portal_to_object(info, - ISNS_TAG_PORTAL_IP_ADDRESS, - ISNS_TAG_PORTAL_TCP_UDP_PORT, - obj); - return obj; -} - -/* - * Extract all key attrs and place them - * in the attribute list. - */ -int -isns_object_extract_keys(const isns_object_t *obj, - isns_attr_list_t *list) -{ - isns_object_template_t *tmpl = obj->ie_template; - const isns_attr_list_t *src = &obj->ie_attrs; - unsigned int i; - - for (i = 0; i < tmpl->iot_num_keys; ++i) { - isns_attr_t *attr; - - if (!isns_attr_list_get_attr(src, tmpl->iot_keys[i], &attr)) - return 0; - isns_attr_list_append_attr(list, attr); - } - - return 1; -} - -/* - * Extract all attributes we are permitted to overwrite and place them - * in the attribute list. - */ -int -isns_object_extract_writable(const isns_object_t *obj, - isns_attr_list_t *list) -{ - const isns_attr_list_t *src = &obj->ie_attrs; - unsigned int i; - - for (i = 0; i < src->ial_count; ++i) { - isns_attr_t *attr = src->ial_data[i]; - - if (attr->ia_tag->it_readonly) - continue; - isns_attr_list_append_attr(list, attr); - } - - return 1; -} - -/* - * Extract all attrs and place them - * in the attribute list. We copy the attributes - * as they appear inside the object; which allows - * duplicate attributes (eg inside a discovery domain). - */ -int -isns_object_extract_all(const isns_object_t *obj, isns_attr_list_t *list) -{ - isns_attr_list_append_list(list, &obj->ie_attrs); - return 1; -} - -/* - * Check if the given object is valid - */ -int -isns_object_attr_valid(isns_object_template_t *tmpl, uint32_t tag) -{ - const uint32_t *attr_tags = tmpl->iot_attrs; - unsigned int i; - - for (i = 0; i < tmpl->iot_num_attrs; ++i) { - if (*attr_tags == tag) - return 1; - ++attr_tags; - } - return 0; -} - -/* - * Set an object attribute - */ -static int -__isns_object_set_attr(isns_object_t *obj, uint32_t tag, - const isns_attr_type_t *type, - const isns_value_t *value) -{ - const isns_tag_type_t *tag_type; - - if (!isns_object_attr_valid(obj->ie_template, tag)) - return 0; - - tag_type = isns_tag_type_by_id(tag); - if (type != &isns_attr_type_nil - && type != tag_type->it_type) { - isns_warning("application bug: cannot set attr %s(id=%u, " - "type=%s) to a value of type %s\n", - tag_type->it_name, tag, - tag_type->it_type->it_name, - type->it_name); - return 0; - } - - isns_attr_list_update_value(&obj->ie_attrs, - tag, tag_type, value); - - /* Timestamp updates should just be written out, but we - * do not want to trigger SCN messages and such. */ - if (tag != ISNS_TAG_TIMESTAMP) - isns_mark_object(obj, ISNS_SCN_OBJECT_UPDATED); - else - __isns_mark_object(obj); - return 1; -} - -/* - * Copy an attribute to the object - */ -int -isns_object_set_attr(isns_object_t *obj, isns_attr_t *attr) -{ - isns_attr_list_t *list = &obj->ie_attrs; - uint32_t tag = attr->ia_tag_id; - - /* If this attribute exists within the object, - * and it cannot occur multiple times, replace it. */ - if (!attr->ia_tag->it_multiple - && isns_attr_list_replace_attr(list, attr)) - goto done; - - /* It doesn't exist; make sure it's a valid - * attribute. */ - if (!isns_object_attr_valid(obj->ie_template, tag)) - return 0; - - isns_attr_list_append_attr(list, attr); - -done: - isns_mark_object(obj, ISNS_SCN_OBJECT_UPDATED); - return 1; -} - -int -isns_object_set_attrlist(isns_object_t *obj, const isns_attr_list_t *attrs) -{ - unsigned int i; - - for (i = 0; i < attrs->ial_count; ++i) { - isns_attr_t *attr = attrs->ial_data[i]; - if (!isns_object_set_attr(obj, attr)) - return 0; - } - isns_mark_object(obj, ISNS_SCN_OBJECT_UPDATED); - return 1; -} - -/* - * Untyped version of isns_object_set. - * Any type checking must be done by the caller; - * failure to do so will result in the end of the world. - */ -int -isns_object_set_value(isns_object_t *obj, uint32_t tag, const void *data) -{ - return isns_attr_list_update(&obj->ie_attrs, tag, data); -} - -/* - * Typed versions of isns_object_set - */ -int -isns_object_set_nil(isns_object_t *obj, uint32_t tag) -{ - return __isns_object_set_attr(obj, tag, - &isns_attr_type_nil, NULL); -} - -int -isns_object_set_string(isns_object_t *obj, uint32_t tag, - const char *value) -{ - isns_value_t var = ISNS_VALUE_INIT(string, (char *) value); - int rc; - - rc = __isns_object_set_attr(obj, tag, - &isns_attr_type_string, &var); - return rc; -} - -int -isns_object_set_uint32(isns_object_t *obj, uint32_t tag, - uint32_t value) -{ - isns_value_t var = ISNS_VALUE_INIT(uint32, value); - - return __isns_object_set_attr(obj, tag, - &isns_attr_type_uint32, &var); -} - -int -isns_object_set_uint64(isns_object_t *obj, - uint32_t tag, - uint64_t value) -{ - isns_value_t var = ISNS_VALUE_INIT(uint64, value); - - return __isns_object_set_attr(obj, tag, - &isns_attr_type_uint64, &var); -} - -int -isns_object_set_ipaddr(isns_object_t *obj, uint32_t tag, - const struct in6_addr *value) -{ - isns_value_t var = ISNS_VALUE_INIT(ipaddr, *value); - - return __isns_object_set_attr(obj, tag, - &isns_attr_type_ipaddr, &var); -} - -/* - * Query object attributes - */ -int -isns_object_get_attr(const isns_object_t *obj, uint32_t tag, - isns_attr_t **result) -{ - return isns_attr_list_get_attr(&obj->ie_attrs, tag, result); -} - -int -isns_object_get_attrlist(isns_object_t *obj, - isns_attr_list_t *result, - const isns_attr_list_t *req_attrs) -{ - isns_attr_list_t *attrs = &obj->ie_attrs; - isns_attr_t *attr; - unsigned int i; - - if (req_attrs == NULL) { - /* Retrieve all attributes */ - isns_attr_list_append_list(result, attrs); - } else { - for (i = 0; i < req_attrs->ial_count; ++i) { - uint32_t tag = req_attrs->ial_data[i]->ia_tag_id; - - if (tag == obj->ie_template->iot_next_index) { - /* FIXME: for now, we fake this value. - * We need the DB object at this point - * to find out what the next unused - * index is. - */ - isns_attr_list_append_uint32(result, - tag, 0); - } else - if (isns_attr_list_get_attr(attrs, tag, &attr)) - isns_attr_list_append_attr(result, attr); - } - } - return 1; -} - -int -isns_object_get_key_attrs(isns_object_t *obj, - isns_attr_list_t *result) -{ - isns_object_template_t *tmpl = obj->ie_template; - isns_attr_list_t *attrs = &obj->ie_attrs; - isns_attr_t *attr; - unsigned int i; - - for (i = 0; i < tmpl->iot_num_keys; ++i) { - uint32_t tag = tmpl->iot_keys[i]; - - if (!isns_attr_list_get_attr(attrs, tag, &attr)) { - isns_error("%s: %s object is missing key attr %u\n", - __FUNCTION__, - tmpl->iot_name, - tag); - return 0; - } - isns_attr_list_append_attr(result, attr); - } - return 1; -} - -int -isns_object_get_string(const isns_object_t *obj, uint32_t tag, - const char **result) -{ - isns_attr_t *attr; - - if (!isns_object_get_attr(obj, tag, &attr) - || !ISNS_ATTR_IS_STRING(attr)) - return 0; - - *result = attr->ia_value.iv_string; - return 1; -} - -int -isns_object_get_ipaddr(const isns_object_t *obj, uint32_t tag, - struct in6_addr *result) -{ - isns_attr_t *attr; - - if (!isns_object_get_attr(obj, tag, &attr) - || !ISNS_ATTR_IS_IPADDR(attr)) - return 0; - - *result = attr->ia_value.iv_ipaddr; - return 1; -} - -int -isns_object_get_uint32(const isns_object_t *obj, uint32_t tag, - uint32_t *result) -{ - isns_attr_t *attr; - - if (!isns_object_get_attr(obj, tag, &attr) - || !ISNS_ATTR_IS_UINT32(attr)) - return 0; - - *result = attr->ia_value.iv_uint32; - return 1; -} - -int -isns_object_get_uint64(const isns_object_t *obj, uint32_t tag, - uint64_t *result) -{ - isns_attr_t *attr; - - if (!isns_object_get_attr(obj, tag, &attr) - || !ISNS_ATTR_IS_UINT64(attr)) - return 0; - - *result = attr->ia_value.iv_uint64; - return 1; -} - -int -isns_object_get_opaque(const isns_object_t *obj, uint32_t tag, - const void **ptr, size_t *len) -{ - isns_attr_t *attr; - - if (!isns_object_get_attr(obj, tag, &attr) - || !ISNS_ATTR_IS_OPAQUE(attr)) - return 0; - - *ptr = attr->ia_value.iv_opaque.ptr; - *len = attr->ia_value.iv_opaque.len; - return 1; -} - -int -isns_object_delete_attr(isns_object_t *obj, uint32_t tag) -{ - return isns_attr_list_remove_tag(&obj->ie_attrs, tag); -} - -int -isns_object_remove_member(isns_object_t *obj, - const isns_attr_t *attr, - const uint32_t *subordinate_tags) -{ - return isns_attr_list_remove_member(&obj->ie_attrs, - attr, subordinate_tags); -} - -/* - * Object list functions - */ -void -isns_object_list_init(isns_object_list_t *list) -{ - memset(list, 0, sizeof(*list)); -} - -static inline void -__isns_object_list_resize(isns_object_list_t *list, unsigned int count) -{ - unsigned int max; - - max = (list->iol_count + 15) & ~15; - if (count < max) - return; - - count = (count + 15) & ~15; - list->iol_data = isns_realloc(list->iol_data, count * sizeof(isns_object_t *)); - if (!list->iol_data) - isns_fatal("Out of memory!\n"); -} - -void -isns_object_list_append(isns_object_list_t *list, isns_object_t *obj) -{ - __isns_object_list_resize(list, list->iol_count + 1); - list->iol_data[list->iol_count++] = obj; - obj->ie_users++; -} - -void -isns_object_list_append_list(isns_object_list_t *dst, - const isns_object_list_t *src) -{ - unsigned int i, j; - - __isns_object_list_resize(dst, dst->iol_count + src->iol_count); - j = dst->iol_count; - for (i = 0; i < src->iol_count; ++i, ++j) { - isns_object_t *obj = src->iol_data[i]; - - dst->iol_data[j] = obj; - obj->ie_users++; - } - dst->iol_count = j; -} - -int -isns_object_list_contains(const isns_object_list_t *list, - isns_object_t *obj) -{ - unsigned int i; - - for (i = 0; i < list->iol_count; ++i) { - if (obj == list->iol_data[i]) - return 1; - } - return 0; -} - -isns_object_t * -isns_object_list_lookup(const isns_object_list_t *list, - isns_object_template_t *tmpl, - const isns_attr_list_t *keys) -{ - unsigned int i; - - if (!tmpl && !keys) - return NULL; - - if (!tmpl && !(tmpl = isns_object_template_for_key_attrs(keys))) - return NULL; - - for (i = 0; i < list->iol_count; ++i) { - isns_object_t *obj = list->iol_data[i]; - - if (obj->ie_template != tmpl) - continue; - if (keys && !isns_object_match(obj, keys)) - continue; - - obj->ie_users++; - return obj; - } - - return NULL; -} - - -int -isns_object_list_gang_lookup(const isns_object_list_t *list, - isns_object_template_t *tmpl, - const isns_attr_list_t *keys, - isns_object_list_t *result) -{ - unsigned int i; - - if (!tmpl && !keys) - return ISNS_INVALID_QUERY; - - if (!tmpl && !(tmpl = isns_object_template_for_key_attrs(keys))) - return ISNS_INVALID_QUERY; - - for (i = 0; i < list->iol_count; ++i) { - isns_object_t *obj = list->iol_data[i]; - - if (obj->ie_template != tmpl) - continue; - if (keys && !isns_object_match(obj, keys)) - continue; - - isns_object_list_append(result, obj); - } - - return ISNS_SUCCESS; -} - - -void -isns_object_list_destroy(isns_object_list_t *list) -{ - unsigned int i; - - for (i = 0; i < list->iol_count; ++i) { - isns_object_t *obj = list->iol_data[i]; - - isns_object_release(obj); - } - - isns_free(list->iol_data); - memset(list, 0, sizeof(*list)); -} - -int -isns_object_list_remove(isns_object_list_t *list, isns_object_t *tbr) -{ - unsigned int i, last; - - last = list->iol_count - 1; - for (i = 0; i < list->iol_count; ++i) { - isns_object_t *obj = list->iol_data[i]; - - if (obj == tbr) { - list->iol_data[i] = list->iol_data[last]; - list->iol_count--; - isns_object_release(tbr); - return 1; - } - } - return 0; -} - -static int -isns_object_compare_id(const void *pa, const void *pb) -{ - const isns_object_t *a = *(const isns_object_t **) pa; - const isns_object_t *b = *(const isns_object_t **) pb; - - return (int) a->ie_index - (int) b->ie_index; -} - -void -isns_object_list_sort(isns_object_list_t *list) -{ - if (list->iol_count == 0) - return; - - qsort(list->iol_data, list->iol_count, - sizeof(void *), isns_object_compare_id); -} - -void -isns_object_list_uniq(isns_object_list_t *list) -{ - isns_object_t *prev = NULL, *this; - unsigned int i, j; - - isns_object_list_sort(list); - for (i = j = 0; i < list->iol_count; i++) { - this = list->iol_data[i]; - if (this != prev) - list->iol_data[j++] = this; - prev = this; - } - list->iol_count = j; -} - -void -isns_object_list_print(const isns_object_list_t *list, isns_print_fn_t *fn) -{ - unsigned int i; - - if (list->iol_count == 0) { - fn("(Object list empty)\n"); - return; - } - - for (i = 0; i < list->iol_count; ++i) { - isns_object_t *obj; - - obj = list->iol_data[i]; - fn("object[%u] = <%s>\n", i, - obj->ie_template->iot_name); - isns_object_print(obj, fn); - } -} - -/* - * Handle object references - */ -void -isns_object_reference_set(isns_object_ref_t *ref, isns_object_t *obj) -{ - isns_object_t *old; - - if (obj) { - isns_assert(obj->ie_users); - obj->ie_references++; - obj->ie_users++; - } - if ((old = ref->obj) != NULL) { - isns_assert(old->ie_references); - old->ie_references--; - isns_object_release(old); - } - ref->obj = obj; -} - -void -isns_object_reference_drop(isns_object_ref_t *ref) -{ - isns_object_reference_set(ref, NULL); -} - -/* - * Helper function for portal/object conversion - */ -int -isns_portal_from_object(isns_portal_info_t *portal, - uint32_t addr_tag, uint32_t port_tag, - const isns_object_t *obj) -{ - return isns_portal_from_attr_list(portal, - addr_tag, port_tag, &obj->ie_attrs); -} - -int -isns_portal_to_object(const isns_portal_info_t *portal, - uint32_t addr_tag, uint32_t port_tag, - isns_object_t *obj) -{ - return isns_portal_to_attr_list(portal, - addr_tag, port_tag, - &obj->ie_attrs); -} - -/* - * Portal - */ -static uint32_t portal_attrs[] = { - ISNS_TAG_PORTAL_IP_ADDRESS, - ISNS_TAG_PORTAL_TCP_UDP_PORT, - ISNS_TAG_PORTAL_SYMBOLIC_NAME, - ISNS_TAG_ESI_INTERVAL, - ISNS_TAG_ESI_PORT, - ISNS_TAG_PORTAL_INDEX, - ISNS_TAG_SCN_PORT, - ISNS_TAG_PORTAL_NEXT_INDEX, - ISNS_TAG_PORTAL_SECURITY_BITMAP, - ISNS_TAG_PORTAL_ISAKMP_PHASE_1, - ISNS_TAG_PORTAL_ISAKMP_PHASE_2, - ISNS_TAG_PORTAL_CERTIFICATE, -}; - -static uint32_t portal_key_attrs[] = { - ISNS_TAG_PORTAL_IP_ADDRESS, - ISNS_TAG_PORTAL_TCP_UDP_PORT, -}; - -isns_object_template_t isns_portal_template = { - .iot_name = "Portal", - .iot_handle = ISNS_OBJECT_TYPE_PORTAL, - .iot_attrs = portal_attrs, - .iot_num_attrs = array_num_elements(portal_attrs), - .iot_keys = portal_key_attrs, - .iot_num_keys = array_num_elements(portal_key_attrs), - .iot_index = ISNS_TAG_PORTAL_INDEX, - .iot_next_index = ISNS_TAG_PORTAL_NEXT_INDEX, - .iot_container = &isns_entity_template, -}; diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/objects.h open-iscsi-2.0.874/utils/open-isns/objects.h --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/objects.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/objects.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,168 +0,0 @@ -/* - * iSNS object model - * - * Copyright (C) 2007 Olaf Kirch - */ - -#ifndef ISNS_OBJECTS_H -#define ISNS_OBJECTS_H - -#include "isns.h" -#include "attrs.h" - -enum isns_object_id { - ISNS_OBJECT_TYPE_ENTITY = 1, - ISNS_OBJECT_TYPE_NODE, - ISNS_OBJECT_TYPE_PORTAL, - ISNS_OBJECT_TYPE_PG, - ISNS_OBJECT_TYPE_DD, - ISNS_OBJECT_TYPE_DDSET, - ISNS_OBJECT_TYPE_POLICY, - ISNS_OBJECT_TYPE_FC_PORT, - ISNS_OBJECT_TYPE_FC_NODE, - - __ISNS_OBJECT_TYPE_MAX -}; - - -struct isns_object_template { - const char * iot_name; - unsigned int iot_handle; /* internal handle */ - unsigned int iot_num_attrs; - unsigned int iot_num_keys; - uint32_t * iot_attrs; - uint32_t * iot_keys; - uint32_t iot_index; - uint32_t iot_next_index; - - isns_object_template_t *iot_container; - - unsigned int iot_relation_type; - isns_relation_t * (*iot_build_relation)(isns_db_t *, - isns_object_t *, - const isns_object_list_t *); - - unsigned int iot_vendor_specific : 1; -}; - -struct isns_object { - /* There are two kinds of users of an object - * - Temporary references that result from the - * object being examined; being on a list, - * etc. The main purpose of these references - * is to make sure the object doesn't go away - * while being used. - * - * These are accounted for by ie_users. - * - * - Permanent references that result from the - * object being references by other objects - * (usually relations) such as a Portal Group, - * or a Discovery Domain. - * - * These are accounted for by ie_references. - * - * The main purpose of these references is to - * model some of the weirder life cycle states - * described in RFC 4711. - * - * Every reference via ie_references implies a - * reference via ie_users. - */ - unsigned int ie_users; - unsigned int ie_references; - - uint32_t ie_index; - - unsigned int ie_state; - unsigned int ie_flags; - time_t ie_mtime; - - uint32_t ie_scn_mask; /* Events this node listens for */ - uint32_t ie_scn_bits; /* Current event bits */ - - 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; - isns_object_list_t ie_children; - - /* Bit vector describing DD membership */ - isns_bitvector_t * ie_membership; - - /* Support for virtual objects */ - int (*ie_rebuild)(isns_object_t *, isns_db_t *); -}; - -typedef struct isns_object_ref { - isns_object_t * obj; -} isns_object_ref_t; - -enum { - ISNS_RELATION_NONE = 0, - ISNS_RELATION_PORTAL_GROUP, -}; - -struct isns_relation { - unsigned int ir_type; - unsigned int ir_users; - isns_object_t * ir_object; - isns_object_ref_t ir_subordinate[2]; -}; - -typedef struct isns_relation_soup isns_relation_soup_t; - -typedef struct isns_relation_list isns_relation_list_t; -struct isns_relation_list { - unsigned int irl_count; - isns_relation_t ** irl_data; -}; -#define ISNS_RELATION_LIST_INIT { .irl_count = 0, .irl_data = NULL } - -#define ISNS_OBJECT_DIRTY 0x0001 -#define ISNS_OBJECT_PRIVATE 0x0002 -#define ISNS_OBJECT_DEAD 0x0004 - -enum { - ISNS_OBJECT_STATE_LARVAL, - ISNS_OBJECT_STATE_MATURE, - ISNS_OBJECT_STATE_LIMBO, - ISNS_OBJECT_STATE_DEAD, -}; - -extern int isns_object_remove_member(isns_object_t *obj, - const isns_attr_t *attr, - const uint32_t *subordinate_tags); - -extern void isns_object_reference_set(isns_object_ref_t *ref, - isns_object_t *obj); -extern void isns_object_reference_drop(isns_object_ref_t *ref); - -extern const char *isns_object_state_string(unsigned int); - -extern isns_object_template_t *isns_object_template_by_name(const char *); -extern int isns_object_is_valid_container(const isns_object_t *, - isns_object_template_t *); - -extern void isns_object_set_scn_mask(isns_object_t *, uint32_t); - -extern isns_object_t *isns_create_default_domain(void); - -/* - * Helper macros for object type check - */ -#define __ISNS_OBJECT_TYPE_CHECK(obj, type) \ - ((obj)->ie_template == &isns_##type##_template) -#define ISNS_IS_ENTITY(obj) __ISNS_OBJECT_TYPE_CHECK(obj, entity) -#define ISNS_IS_ISCSI_NODE(obj) __ISNS_OBJECT_TYPE_CHECK(obj, iscsi_node) -#define ISNS_IS_FC_PORT(obj) __ISNS_OBJECT_TYPE_CHECK(obj, fc_port) -#define ISNS_IS_FC_NODE(obj) __ISNS_OBJECT_TYPE_CHECK(obj, fc_node) -#define ISNS_IS_PORTAL(obj) __ISNS_OBJECT_TYPE_CHECK(obj, portal) -#define ISNS_IS_PG(obj) __ISNS_OBJECT_TYPE_CHECK(obj, iscsi_pg) -#define ISNS_IS_POLICY(obj) __ISNS_OBJECT_TYPE_CHECK(obj, policy) -#define ISNS_IS_DD(obj) __ISNS_OBJECT_TYPE_CHECK(obj, dd) -#define ISNS_IS_DDSET(obj) __ISNS_OBJECT_TYPE_CHECK(obj, ddset) - -#endif /* ISNS_OBJECTS_H */ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/parser.c open-iscsi-2.0.874/utils/open-isns/parser.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/parser.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/parser.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,134 +0,0 @@ -/* - * parser.c - simple line based parser - * - * Copyright (C) 2006, 2007 Olaf Kirch - */ - -#include -#include -#include -#include -#include -#include -#include "util.h" - -/* - * By default, the parser will recognize any white space - * as "word" separators. - * If you need additional separators, you can put them - * here. - */ -const char * parser_separators = NULL; -const char * parser_punctuation = "="; - -char * -parser_get_next_line(FILE *fp) -{ - static char buffer[8192]; - unsigned int n = 0, count = 0; - int c, continuation = 0; - - while (n < sizeof(buffer) - 1) { - c = fgetc(fp); - if (c == EOF) - break; - - count++; - if (c == '\r') - continue; - /* Discard all blanks - * following a backslash-newline - */ - if (continuation) { - if (c == ' ' || c == '\t') - continue; - continuation = 0; - } - - if (c == '\n') { - if (n && buffer[n-1] == '\\') { - buffer[--n] = '\0'; - continuation = 1; - } - while (n && isspace(buffer[n-1])) - buffer[--n] = '\0'; - if (!continuation) - break; - buffer[n++] = ' '; - continue; - } - - buffer[n++] = c; - } - - if (count == 0) - return NULL; - - buffer[n] = '\0'; - return buffer; -} - -static inline int -is_separator(char c) -{ - if (isspace(c)) - return 1; - return parser_separators && c && strchr(parser_separators, c); -} - -static inline int -is_punctuation(char c) -{ - return parser_punctuation && c && strchr(parser_punctuation, c); -} - -char * -parser_get_next_word(char **sp) -{ - static char buffer[512]; - char *s = *sp, *p = buffer; - - while (is_separator(*s)) - ++s; - - if (*s == '\0') - goto done; - - if (is_punctuation(*s)) { - *p++ = *s++; - goto done; - } - - while (*s && !is_separator(*s) && !is_punctuation(*s)) - *p++ = *s++; - -done: - *p++ = '\0'; - *sp = s; - return buffer[0]? buffer : NULL; -} - -int -parser_split_line(char *line, unsigned int argsmax, char **argv) -{ - unsigned int argc = 0; - char *s; - - while (argc < argsmax && (s = parser_get_next_word(&line))) - argv[argc++] = strdup(s); - return argc; -} - -char * -parser_get_rest_of_line(char **sp) -{ - char *s = *sp, *res = NULL; - - while (is_separator(*s)) - ++s; - - *sp = ""; - if (*s != '\0') - res = s; - return res; -} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/paths.h open-iscsi-2.0.874/utils/open-isns/paths.h --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/paths.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/paths.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -/* - * Compile time configuration. - * For now, let's keep it simple and ignore autoconf... - * - * Copyright (C) 2006, 2007 Olaf Kirch - */ - -#ifndef ISNS_CONFIG_H -#define ISNS_CONFIG_H - -#define __OPENISNS_MKVERSION(maj, min) (((maj) << 8) + (min)) -#define OPENISNS_VERSION __OPENISNS_MKVERSION(0, 90); -#define OPENISNS_VERSION_STRING "0.90" - -#define ISNS_ETCDIR "/etc/isns" -#define ISNS_RUNDIR "/var/run" -#define ISNS_DEFAULT_ISNSD_CONFIG ISNS_ETCDIR "/isnsd.conf" -#define ISNS_DEFAULT_ISNSDD_CONFIG ISNS_ETCDIR "/isnsdd.conf" -#define ISNS_DEFAULT_ISNSADM_CONFIG ISNS_ETCDIR "/isnsadm.conf" -#define ISNS_DEFAULT_LOCAL_REGISTRY ISNS_RUNDIR "/isns.registry" - -#endif /* ISNS_CONFIG_H */ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/pidfile.c open-iscsi-2.0.874/utils/open-isns/pidfile.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/pidfile.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/pidfile.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,98 +0,0 @@ -/* - * write pidfile - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include -#include -#include -#include -#include -#include - -#include "util.h" - -static void -__update_pidfile(int fd) -{ - char pidbuf[32]; - - snprintf(pidbuf, sizeof(pidbuf), "%u\n", getpid()); - if (write(fd, pidbuf, strlen(pidbuf)) < 0) - isns_fatal("Error writing pid file: %m\n"); - close(fd); -} - -static pid_t -__read_pidfile(const char *filename) -{ - char pidbuf[32]; - FILE *fp; - pid_t pid = -1; - - fp = fopen(filename, "r"); - if (fp != NULL) { - if (fgets(pidbuf, sizeof(pidbuf), fp)) - pid = strtoul(pidbuf, NULL, 0); - fclose(fp); - } - return pid; -} - -void -isns_write_pidfile(const char *filename) -{ - int fd; - pid_t pid; - - fd = open(filename, O_CREAT|O_EXCL|O_WRONLY, 0644); - if (fd >= 0) { - __update_pidfile(fd); - return; - } - - if (errno != EEXIST) - isns_fatal("Error creating pid file %s: %m\n", - filename); - - /* If the pid file is stale, remove it. - * Not really needed in real life, but - * highly convenient for debugging :) */ - if ((pid = __read_pidfile(filename)) > 0 - && kill(pid, 0) < 0 - && errno == ESRCH) { - isns_debug_general( - "Removing stale PID file %s\n", - filename); - unlink(filename); - } - - /* Try again */ - fd = open(filename, O_CREAT|O_EXCL|O_WRONLY, 0644); - if (fd < 0) - isns_fatal("PID file exists; another daemon " - "seems to be running\n"); - - __update_pidfile(fd); -} - -void -isns_update_pidfile(const char *filename) -{ - int fd; - - fd = open(filename, O_WRONLY); - if (fd < 0) { - isns_fatal("Error opening pid file %s: %m\n", - filename); - } - - __update_pidfile(fd); -} - -void -isns_remove_pidfile(const char *filename) -{ - unlink(filename); -} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/pki.c open-iscsi-2.0.874/utils/open-isns/pki.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/pki.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/pki.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,536 +0,0 @@ -/* - * PKI related functions - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include -#include -#include -#include -#include -#include -#include -#include "isns.h" -#include "security.h" -#include "util.h" -#include "config.h" - -#ifdef WITH_SECURITY - -/* versions prior to 9.6.8 didn't seem to have these */ -#if OPADDRCONFIGENSSL_VERSION_NUMBER < 0x00906080L -# define EVP_MD_CTX_init(c) do { } while (0) -# define EVP_MD_CTX_cleanup(c) do { } while (0) -#endif -#if OPADDRCONFIGENSSL_VERSION_NUMBER < 0x00906070L -# define i2d_DSA_PUBKEY i2d_DSA_PUBKEY_backwards - -static int i2d_DSA_PUBKEY_backwards(DSA *, unsigned char **); -#endif - -static int isns_openssl_init = 0; - -static int isns_dsasig_verify(isns_security_t *ctx, - isns_principal_t *peer, - buf_t *pdu, - const struct isns_authblk *); -static int isns_dsasig_sign(isns_security_t *ctx, - isns_principal_t *peer, - buf_t *pdu, - struct isns_authblk *); -static EVP_PKEY *isns_dsasig_load_private_pem(isns_security_t *ctx, - const char *filename); -static EVP_PKEY *isns_dsasig_load_public_pem(isns_security_t *ctx, - const char *filename); -static DSA * isns_dsa_load_params(const char *); - - -/* - * Create a DSA security context - */ -isns_security_t * -isns_create_dsa_context(void) -{ - isns_security_t *ctx; - - if (!isns_openssl_init) { - ERR_load_crypto_strings(); - OpenSSL_add_all_algorithms(); - OpenSSL_add_all_ciphers(); - OpenSSL_add_all_digests(); - isns_openssl_init = 1; - } - - ctx = isns_calloc(1, sizeof(*ctx)); - - ctx->is_name = "DSA"; - ctx->is_type = ISNS_AUTH_TYPE_SHA1_DSA; - ctx->is_replay_window = isns_config.ic_auth.replay_window; - ctx->is_timestamp_jitter = isns_config.ic_auth.timestamp_jitter; - - ctx->is_verify = isns_dsasig_verify; - ctx->is_sign = isns_dsasig_sign; - ctx->is_load_private = isns_dsasig_load_private_pem; - ctx->is_load_public = isns_dsasig_load_public_pem; - - isns_debug_auth("Created DSA authentication context\n"); - return ctx; -} - -/* - * DSA signature generation and verification - */ -static void -isns_message_digest(EVP_MD_CTX *md, const buf_t *pdu, - const struct isns_authblk *blk) -{ - uint64_t stamp; - - EVP_DigestUpdate(md, buf_head(pdu), buf_avail(pdu)); - - /* The RFC doesn't say which pieces of the - * message should be hashed. - * We make an educated guess. - */ - stamp = htonll(blk->iab_timestamp); - EVP_DigestUpdate(md, &stamp, sizeof(stamp)); -} - -static void -isns_dsasig_report_errors(const char *msg, isns_print_fn_t *fn) -{ - unsigned long code; - - fn("%s - OpenSSL errors follow:\n", msg); - while ((code = ERR_get_error()) != 0) - fn("> %s: %s\n", - ERR_func_error_string(code), - ERR_reason_error_string(code)); -} - -int -isns_dsasig_sign(isns_security_t *ctx, - isns_principal_t *peer, - buf_t *pdu, - struct isns_authblk *blk) -{ - static unsigned char signature[1024]; - unsigned int sig_len = sizeof(signature); - EVP_MD_CTX md_ctx; - EVP_PKEY *pkey; - int err; - - if ((pkey = peer->is_key) == NULL) - return 0; - - if (pkey->type != EVP_PKEY_DSA) { - isns_debug_message( - "Incompatible public key (spi=%s)\n", - peer->is_name); - return 0; - } - if (EVP_PKEY_size(pkey) > sizeof(signature)) { - isns_error("isns_dsasig_sign: signature buffer too small\n"); - return 0; - } - if (pkey->pkey.dsa->priv_key == NULL) { - isns_error("isns_dsasig_sign: oops, seems to be a public key\n"); - return 0; - } - - isns_debug_auth("Signing messages with spi=%s, DSA/%u\n", - peer->is_name, EVP_PKEY_bits(pkey)); - - EVP_MD_CTX_init(&md_ctx); - EVP_SignInit(&md_ctx, EVP_dss1()); - isns_message_digest(&md_ctx, pdu, blk); - err = EVP_SignFinal(&md_ctx, - signature, &sig_len, - pkey); - EVP_MD_CTX_cleanup(&md_ctx); - - if (err == 0) { - isns_dsasig_report_errors("EVP_SignFinal failed", isns_error); - return 0; - } - - blk->iab_sig = signature; - blk->iab_sig_len = sig_len; - return 1; -} - -int -isns_dsasig_verify(isns_security_t *ctx, - isns_principal_t *peer, - buf_t *pdu, - const struct isns_authblk *blk) -{ - EVP_MD_CTX md_ctx; - EVP_PKEY *pkey; - int err; - - if ((pkey = peer->is_key) == NULL) - return 0; - - if (pkey->type != EVP_PKEY_DSA) { - isns_debug_message( - "Incompatible public key (spi=%s)\n", - peer->is_name); - return 0; - } - - EVP_MD_CTX_init(&md_ctx); - EVP_VerifyInit(&md_ctx, EVP_dss1()); - isns_message_digest(&md_ctx, pdu, blk); - err = EVP_VerifyFinal(&md_ctx, - blk->iab_sig, blk->iab_sig_len, - pkey); - EVP_MD_CTX_cleanup(&md_ctx); - - if (err == 0) { - isns_debug_auth("*** Incorrect signature ***\n"); - return 0; - } - if (err < 0) { - isns_dsasig_report_errors("EVP_VerifyFinal failed", isns_error); - return 0; - } - - isns_debug_message("Good signature from %s\n", - peer->is_name?: ""); - return 1; -} - -EVP_PKEY * -isns_dsasig_load_private_pem(isns_security_t *ctx, const char *filename) -{ - EVP_PKEY *pkey; - FILE *fp; - - if (!(fp = fopen(filename, "r"))) { - isns_error("Unable to open DSA keyfile %s: %m\n", - filename); - return 0; - } - - pkey = PEM_read_PrivateKey(fp, NULL, NULL, NULL); - fclose(fp); - return pkey; -} - -EVP_PKEY * -isns_dsasig_load_public_pem(isns_security_t *ctx, const char *filename) -{ - EVP_PKEY *pkey; - FILE *fp; - - if (!(fp = fopen(filename, "r"))) { - isns_error("Unable to open DSA keyfile %s: %m\n", - filename); - return 0; - } - - pkey = PEM_read_PUBKEY(fp, NULL, NULL, NULL); - if (pkey == NULL) { - isns_dsasig_report_errors("Error loading DSA public key", - isns_error); - } - - fclose(fp); - return pkey; -} - -EVP_PKEY * -isns_dsa_decode_public(const void *ptr, size_t len) -{ - const unsigned char *der = ptr; - EVP_PKEY *evp; - DSA *dsa; - - /* Assigning ptr to a temporary variable avoids a silly - * compiled warning about type-punning. */ - dsa = d2i_DSA_PUBKEY(NULL, &der, len); - if (dsa == NULL) - return NULL; - - evp = EVP_PKEY_new(); - EVP_PKEY_assign_DSA(evp, dsa); - return evp; -} - -int -isns_dsa_encode_public(EVP_PKEY *pkey, void **ptr, size_t *len) -{ - int bytes; - - *ptr = NULL; - bytes = i2d_DSA_PUBKEY(pkey->pkey.dsa, (unsigned char **) ptr); - if (bytes < 0) - return 0; - - *len = bytes; - return 1; -} - -EVP_PKEY * -isns_dsa_load_public(const char *name) -{ - return isns_dsasig_load_public_pem(NULL, name); -} - -int -isns_dsa_store_private(const char *name, EVP_PKEY *key) -{ - FILE *fp; - int rv, fd; - - if ((fd = open(name, O_WRONLY|O_CREAT|O_EXCL, 0600)) < 0) { - isns_error("Cannot save DSA key to %s: %m\n", name); - return 0; - } - - if (!(fp = fdopen(fd, "w"))) { - isns_error("fdopen(%s): %m\n", name); - close(fd); - return 0; - } - - rv = PEM_write_PrivateKey(fp, key, NULL, NULL, 0, 0, NULL); - fclose(fp); - - if (rv == 0) - isns_dsasig_report_errors("Failed to store private key", - isns_error); - - return rv; -} - -int -isns_dsa_store_public(const char *name, EVP_PKEY *key) -{ - FILE *fp; - int rv; - - if (!(fp = fopen(name, "w"))) { - isns_error("Unable to open %s: %m\n", name); - return 0; - } - - rv = PEM_write_PUBKEY(fp, key); - fclose(fp); - - if (rv == 0) - isns_dsasig_report_errors("Failed to store public key", - isns_error); - - return rv; -} - - -/* - * DSA key generation - */ -EVP_PKEY * -isns_dsa_generate_key(void) -{ - EVP_PKEY *pkey; - DSA *dsa = NULL; - - if (!(dsa = isns_dsa_load_params(isns_config.ic_dsa.param_file))) - goto failed; - - if (!DSA_generate_key(dsa)) { - isns_dsasig_report_errors("Failed to generate DSA key", - isns_error); - goto failed; - } - - pkey = EVP_PKEY_new(); - EVP_PKEY_assign_DSA(pkey, dsa); - return pkey; - -failed: - if (dsa) - DSA_free(dsa); - return NULL; -} - -DSA * -isns_dsa_load_params(const char *filename) -{ - FILE *fp; - DSA *dsa; - - if (!filename) { - isns_error("Cannot generate key - no DSA parameter file\n"); - return NULL; - } - if (!(fp = fopen(filename, "r"))) { - isns_error("Unable to open %s: %m\n", filename); - return NULL; - } - - dsa = PEM_read_DSAparams(fp, NULL, NULL, NULL); - fclose(fp); - - if (dsa == NULL) { - isns_dsasig_report_errors("Error loading DSA parameters", - isns_error); - } - - return dsa; -} - -static void -isns_dsa_param_gen_callback(int stage, int index, void *dummy) -{ - if (stage == 0) - write(1, "+", 1); - else if (stage == 1) - write(1, ".", 1); - else if (stage == 2) - write(1, "/", 1); -} - -int -isns_dsa_init_params(const char *filename) -{ - FILE *fp; - DSA *dsa; - - if (access(filename, R_OK) == 0) - return 1; - - isns_mkdir_recursive(isns_dirname(filename)); - if (!(fp = fopen(filename, "w"))) { - isns_error("Unable to open %s: %m\n", filename); - return 0; - } - - isns_notice("Generating DSA parameters; this may take a while\n"); - dsa = DSA_generate_parameters(1024, NULL, 0, - NULL, NULL, isns_dsa_param_gen_callback, NULL); - write(1, "\n", 1); - - if (dsa == NULL) { - isns_dsasig_report_errors("Error generating DSA parameters", - isns_error); - fclose(fp); - return 0; - } - - if (!PEM_write_DSAparams(fp, dsa)) { - isns_dsasig_report_errors("Error writing DSA parameters", - isns_error); - DSA_free(dsa); - fclose(fp); - return 0; - } - DSA_free(dsa); - fclose(fp); - return 1; -} - -/* - * Make sure the authentication key is present. - */ -int -isns_dsa_init_key(const char *filename) -{ - char pubkey_path[1024]; - EVP_PKEY *pkey; - - isns_mkdir_recursive(isns_dirname(filename)); - snprintf(pubkey_path, sizeof(pubkey_path), - "%s.pub", filename); - if (access(filename, R_OK) == 0 - && access(pubkey_path, R_OK) == 0) - return 1; - - if (!(pkey = isns_dsa_generate_key())) { - isns_error("Failed to generate AuthKey\n"); - return 0; - } - - if (!isns_dsa_store_private(filename, pkey)) { - isns_error("Unable to write private key to %s\n", filename); - return 0; - } - isns_notice("Stored private key in %s\n", filename); - - if (!isns_dsa_store_public(pubkey_path, pkey)) { - isns_error("Unable to write public key to %s\n", pubkey_path); - return 0; - } - isns_notice("Stored private key in %s\n", pubkey_path); - - return 1; -} - -/* - * Simple keystore - this is a flat directory, with - * public key files using the SPI as their name. - */ -typedef struct isns_simple_keystore isns_simple_keystore_t; -struct isns_simple_keystore { - isns_keystore_t sc_base; - char * sc_dirpath; -}; - -/* - * Load a DSA key from the cert store - * In fact, this will load RSA keys as well. - */ -static EVP_PKEY * -__isns_simple_keystore_find(isns_keystore_t *store_base, - const char *name, size_t namelen) -{ - isns_simple_keystore_t *store = (isns_simple_keystore_t *) store_base; - char pathname[PATH_MAX]; - - /* Refuse to open key files with names - * that refer to parent directories */ - if (memchr(name, '/', namelen) || name[0] == '.') - return NULL; - - snprintf(pathname, sizeof(pathname), - "%s/%.*s", store->sc_dirpath, - (int) namelen, name); - if (access(pathname, R_OK) < 0) - return NULL; - return isns_dsasig_load_public_pem(NULL, pathname); -} - -isns_keystore_t * -isns_create_simple_keystore(const char *dirname) -{ - isns_simple_keystore_t *store; - - store = isns_calloc(1, sizeof(*store)); - store->sc_base.ic_name = "simple key store"; - store->sc_base.ic_find = __isns_simple_keystore_find; - store->sc_dirpath = isns_strdup(dirname); - - return (isns_keystore_t *) store; -} - -#if OPADDRCONFIGENSSL_VERSION_NUMBER < 0x00906070L -#undef i2d_DSA_PUBKEY - -int -i2d_DSA_PUBKEY_backwards(DSA *dsa, unsigned char **ptr) -{ - unsigned char *buf; - int len; - - len = i2d_DSA_PUBKEY(dsa, NULL); - if (len < 0) - return 0; - - *ptr = buf = OPENSSL_malloc(len); - return i2d_DSA_PUBKEY(dsa, &buf); -} -#endif - -#endif /* WITH_SECURITY */ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/policy.c open-iscsi-2.0.874/utils/open-isns/policy.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/policy.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/policy.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,577 +0,0 @@ -/* - * Open-iSNS policy engine - * - * Copyright (C) 2007 Olaf Kirch - * - * For now, policy is static. We can make it configurable - * later. - */ - -#include -#include "isns.h" -#include "security.h" -#include "objects.h" -#include "message.h" -#include "util.h" - -/* - A brief discussion of policy - - For now, a principal's name (ie its SPI string) *must* match - the iSNS source name it uses. - - Special care needs to be taken to restrict which principals - are permitted to act as a control node. For now, we don't - implement control node semantics. - - */ - -static unsigned int isns_policy_gen = 0; - -/* - * Administrative policy (everything allowed, - * talks to entity "CONTROL" - */ -static isns_policy_t isns_superhero_powers = { - .ip_name = "administrator", - .ip_users = 1, - .ip_gen = 0, - - .ip_entity = ISNS_ENTITY_CONTROL, - .ip_functions = ~0, - .ip_object_types = ~0, - .ip_node_types = ~0, -}; - -/* - * Policy for anon user - */ -static isns_policy_t isns_dweeb_powers = { - .ip_name = "anonymous", - .ip_users = 1, - .ip_gen = 0, - - .ip_functions = 1 << ISNS_DEVICE_ATTRIBUTE_QUERY, - .ip_object_types = 0, - .ip_node_types = 0, -}; - -#define IS_ANON_POLICY(p) ((p) == &isns_dweeb_powers) - -/* - * These are used when security is turned off. - * Essentially the same as superhero, except - * no eid specified. - */ -static isns_policy_t isns_flyingpigs_powers = { - .ip_name = "insecure", - .ip_users = 1, - .ip_gen = 0, - - .ip_functions = ~0, - .ip_object_types = ~0, - .ip_node_types = ~0, -}; - - -isns_policy_t * -isns_policy_bind(const isns_message_t *msg) -{ - isns_policy_t *policy = NULL; - isns_principal_t *princ = NULL; - - /* When the admin turns off gravity, - * pigs can fly, too. */ - if (isns_config.ic_security == 0) { - policy = &isns_flyingpigs_powers; - goto found; - } - - /* If the caller is the local root user, s/he can - * do anything. */ - if (msg->im_creds && msg->im_creds->uid == 0) { - policy = &isns_superhero_powers; - goto found; - } - - /* Tie the SPI given in the auth block to a - * source name. - * For now, the names have to match. Down the road, - * there may be more flexible schemes. - */ - if ((princ = msg->im_security) != NULL) { - if ((policy = princ->is_policy) != NULL) - goto found; - - isns_error("Internal error - no policy for " - "principal %s!\n", - princ->is_name); - } - - policy = &isns_dweeb_powers; - -found: - policy->ip_users++; - return policy; -} - -/* - * Check whether the call is permitted. - * This is particularly useful to prevent rogue - * clients from messing with Discovery Domains. - */ -int -isns_policy_validate_function(const isns_policy_t *policy, - const isns_message_t *msg) -{ - uint32_t function = msg->im_header.i_function; - int rv = 0; - - if (function >= 32) { - isns_debug_auth("Bad function code %08x\n", function); - return 0; - } - - if (!(policy->ip_functions & (1 << function))) - goto reject; - - rv = 1; - -reject: - isns_debug_auth(":: policy %s function %s (%04x) %s\n", - policy->ip_name, - isns_function_name(function), function, - rv? "permitted" : "DENIED"); - return rv; -} - -/* - * Helper function to validate node names and source names - */ -static int -__validate_node_name(const isns_policy_t *policy, const char *name) -{ - const struct string_array *ap; - unsigned int i; - - /* Control nodes get to do everything */ - if (policy->ip_node_types & ISNS_ISCSI_CONTROL_MASK) - return 1; - - ap = &policy->ip_node_names; - for (i = 0; i < ap->count; ++i) { - const char *s; - - s = ap->list[i]; - if (s == NULL) - continue; - if (isns_source_pattern_match(s, name)) - return 1; - } - return 0; -} - -/* - * Validate the source of a message - */ -int -isns_policy_validate_source(const isns_policy_t *policy, - const isns_source_t *source) -{ - const char *src_name = isns_source_name(source); - int rv = 0; - - if (!__validate_node_name(policy, src_name)) - goto reject; - - rv = 1; - -reject: - isns_debug_auth(":: policy %s source %s %s\n", - policy->ip_name, src_name, - rv? "permitted" : "DENIED"); - return rv; -} - -/* - * Check whether the entity name specified by the client - * is actually his to use. - */ -int -isns_policy_validate_entity(const isns_policy_t *policy, - const char *eid) -{ - int rv = 0, eidlen; - - /* Control nodes get to do everything */ - if (policy->ip_node_types & ISNS_ISCSI_CONTROL_MASK) - goto accept; - - /* For anonymous clients, refuse any attempt to - * create an entity */ - if (IS_ANON_POLICY(policy)) - goto reject; - - /* If no entity is assigned, this means the client - * is not permitted to specify its own entity name, - * and accept what we assign it. - */ - if (policy->ip_entity == NULL) - goto reject; - - eidlen = strlen(policy->ip_entity); - if (strncasecmp(policy->ip_entity, eid, eidlen) - && (eid[eidlen] == ':' || eid[eidlen] == '\0')) - goto reject; - -accept: rv = 1; - -reject: - isns_debug_auth(":: policy %s entity ID %s %s\n", - policy->ip_name, eid, - rv? "permitted" : "DENIED"); - return rv; -} - -const char * -isns_policy_default_entity(const isns_policy_t *policy) -{ - return policy->ip_entity; -} - -int -isns_policy_validate_node_name(const isns_policy_t *policy, - const char *node_name) -{ - int rv = 0; - - /* Control nodes get to do everything */ - if (policy->ip_node_types & ISNS_ISCSI_CONTROL_MASK) - goto accept; - - if (!__validate_node_name(policy, node_name)) - goto reject; - -accept: rv = 1; -reject: - isns_debug_auth(":: policy %s storage node name %s %s\n", - policy->ip_name, node_name, - rv? "permitted" : "DENIED"); - return rv; -} - -/* - * Check whether the client is allowed to access - * the given object in a particular way. - */ -static int -__isns_policy_validate_object_access(const isns_policy_t *policy, - const isns_source_t *source, - const isns_object_t *obj, - isns_object_template_t *tmpl, - unsigned int function) -{ - uint32_t mask, perm = ISNS_PERMISSION_WRITE; - int rv = 0; - - /* Control nodes get to do everything */ - if (policy->ip_node_types & ISNS_ISCSI_CONTROL_MASK) - goto accept; - - if (function == ISNS_DEVICE_ATTRIBUTE_QUERY - || function == ISNS_DEVICE_GET_NEXT) - perm = ISNS_PERMISSION_READ; - - /* - * 5.6.1. Source Attribute - * - * For messages that change the contents of the iSNS - * database, the iSNS server MUST verify that the Source - * Attribute identifies either a Control Node or a Storage - * Node that is a part of the Network Entity containing - * the added, deleted, or modified objects. - * - * Note: this statement makes sense for nodes, portals - * etc, but not for discovery domains, which are not - * part of any network entity (but the Control Node clause - * above still applies). - */ - if (perm == ISNS_PERMISSION_WRITE && obj != NULL) { - const isns_object_t *entity; - - entity = obj->ie_container; - if (entity && entity != source->is_entity) - goto refuse; - - /* You're not allowed to modify virtual objects */ - if (obj->ie_rebuild) - goto refuse; - } - - /* Check whether the client is permitted - to access such an object */ - mask = ISNS_ACCESS(tmpl->iot_handle, perm); - if (!(policy->ip_object_types & mask)) - goto refuse; - - if (source->is_untrusted && (obj->ie_flags & ISNS_OBJECT_PRIVATE)) - goto refuse; - -accept: - rv = 1; - -refuse: - if (obj) { - isns_debug_auth(":: policy %s operation %s on object %08x (%s) %s\n", - policy->ip_name, - isns_function_name(function), - obj->ie_index, - tmpl->iot_name, - rv? "permitted" : "DENIED"); - } else { - isns_debug_auth(":: policy %s operation %s on %s object %s\n", - policy->ip_name, - isns_function_name(function), - tmpl->iot_name, - rv? "permitted" : "DENIED"); - } - return rv; -} - -/* - * Check whether the client is allowed to access - * the given object. This is called for read functions. - */ -int -isns_policy_validate_object_access(const isns_policy_t *policy, - const isns_source_t *source, - const isns_object_t *obj, - unsigned int function) -{ - return __isns_policy_validate_object_access(policy, source, - obj, obj->ie_template, - function); -} - -/* - * Check whether the client is allowed to update - * the given object. - */ -int -isns_policy_validate_object_update(const isns_policy_t *policy, - const isns_source_t *source, - const isns_object_t *obj, - const isns_attr_list_t *attrs, - unsigned int function) -{ - return __isns_policy_validate_object_access(policy, source, - obj, obj->ie_template, - function); -} - -/* - * Check whether the client is allowed to create an object - * with the given attrs. - */ -int -isns_policy_validate_object_creation(const isns_policy_t *policy, - const isns_source_t *source, - isns_object_template_t *tmpl, - const isns_attr_list_t *keys, - const isns_attr_list_t *attrs, - unsigned int function) -{ - const char *name = NULL; - - if (tmpl == &isns_entity_template) { - /* DevReg messages may contain an empty EID - * string, which means the server should select - * one. */ - if (isns_attr_list_get_string(keys, - ISNS_TAG_ENTITY_IDENTIFIER, &name) - && !isns_policy_validate_entity(policy, name)) - return 0; - } - - if (tmpl == &isns_iscsi_node_template) { - if (isns_attr_list_get_string(keys, - ISNS_TAG_ISCSI_NAME, &name) - && !isns_policy_validate_node_name(policy, name)) - return 0; - } - - /* Should we also include the permitted portals - * in the policy? */ - - return __isns_policy_validate_object_access(policy, source, - NULL, tmpl, function); -} - -/* - * Check whether the client is permitted to access - * or create an object of this type. - * FIXME: Pass R/W permission bit - */ -int -isns_policy_validate_object_type(const isns_policy_t *policy, - isns_object_template_t *tmpl, - unsigned int function) -{ - uint32_t mask; - int rv = 0; - - /* Control nodes get to do everything */ - if (policy->ip_node_types & ISNS_ISCSI_CONTROL_MASK) - goto accept; - - mask = ISNS_ACCESS_R(tmpl->iot_handle); - if (!(policy->ip_object_types & mask)) - goto reject; - -accept: rv = 1; - -reject: - isns_debug_auth(":: policy %s operation %s on object type %s %s\n", - policy->ip_name, - isns_function_name(function), - tmpl->iot_name, - rv? "permitted" : "DENIED"); - return rv; -} - -int -isns_policy_validate_node_type(const isns_policy_t *policy, uint32_t type) -{ - int rv = 0; - - if ((~policy->ip_node_types & type) == 0) - rv = 1; - - isns_debug_auth(":: policy %s registration of node type 0x%x %s\n", - policy->ip_name, type, - rv? "permitted" : "DENIED"); - return rv; -} - -/* - * 6.4.4. - * Management SCNs provide information about all changes to the network, - * regardless of discovery domain membership. Registration for management - * SCNs is indicated by setting bit 26 to 1. Only Control Nodes may - * register for management SCNs. Bits 30 and 31 may only be enabled if - * bit 26 is set to 1. - */ -int -isns_policy_validate_scn_bitmap(const isns_policy_t *policy, - uint32_t bitmap) -{ - int rv = 1; - - if (policy->ip_node_types & ISNS_ISCSI_CONTROL_MASK) - goto accept; - - if (!(bitmap & ISNS_SCN_MANAGEMENT_REGISTRATION_MASK)) { - if (bitmap & (ISNS_SCN_DD_MEMBER_ADDED_MASK | - ISNS_SCN_DD_MEMBER_REMOVED_MASK)) - goto reject; - goto accept; - } - -reject: - rv = 0; - -accept: - isns_debug_auth(":: policy %s scn bitmap 0x%x %s\n", - policy->ip_name, bitmap, - rv? "permitted" : "DENIED"); - return rv; -} - -/* - * Create the default policy for a given SPI - */ -isns_policy_t * -isns_policy_default(const char *spi, size_t len) -{ - return __isns_policy_alloc(spi, len); -} - -/* - * Create the policy object for the server we're - * talking to. The server is allowed to send us - * ESI and SCN messages, and that's about it. - */ -isns_policy_t * -isns_policy_server(void) -{ - isns_policy_t *policy; - - policy = __isns_policy_alloc("", 8); - - policy->ip_functions = - (1 << ISNS_ENTITY_STATUS_INQUIRY) | - (1 << ISNS_STATE_CHANGE_NOTIFICATION); - policy->ip_node_types = 0; - policy->ip_object_types = 0; - isns_string_array_append(&policy->ip_node_names, "*"); - return policy; -} - -/* - * Allocate an empty policy object - */ -isns_policy_t * -__isns_policy_alloc(const char *spi, size_t len) -{ - isns_policy_t *policy; - - policy = isns_calloc(1, sizeof(*policy)); - policy->ip_name = isns_malloc(len + 1); - policy->ip_users = 1; - policy->ip_gen = isns_policy_gen; - - memcpy(policy->ip_name, spi, len); - policy->ip_name[len] = '\0'; - - /* Only register/query allowed */ - policy->ip_functions = - (1 << ISNS_DEVICE_ATTRIBUTE_REGISTER) | - (1 << ISNS_DEVICE_ATTRIBUTE_QUERY) | - (1 << ISNS_DEVICE_GET_NEXT) | - (1 << ISNS_DEVICE_DEREGISTER) | - (1 << ISNS_SCN_REGISTER); - - /* Can only register initiator node(s) */ - policy->ip_node_types = - ISNS_ISCSI_INITIATOR_MASK; - - /* Can only view/modify standard objects */ - policy->ip_object_types = ISNS_DEFAULT_OBJECT_ACCESS; - - return policy; -} - -/* - * Release a policy object - */ -void -isns_policy_release(isns_policy_t *policy) -{ - if (!policy) - return; - - isns_assert(policy->ip_users); - if (--(policy->ip_users)) - return; - - isns_assert(policy != &isns_superhero_powers); - isns_assert(policy != &isns_flyingpigs_powers); - isns_assert(policy != &isns_dweeb_powers); - - isns_free(policy->ip_name); - isns_free(policy->ip_entity); - isns_free(policy->ip_dd_default); - isns_string_array_destroy(&policy->ip_node_names); - - isns_free(policy); -} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/portal-group.c open-iscsi-2.0.874/utils/open-isns/portal-group.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/portal-group.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/portal-group.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,307 +0,0 @@ -/* - * iSNS object model - portal group specific code - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include -#include -#include "isns.h" -#include "objects.h" -#include "vendor.h" -#include "attrs.h" -#include "util.h" - -/* For relationship stuff - should go */ -#include "db.h" - - -/* - * Retrieve attribute @old_tag from object @obj, create a copy with - * tag @new_tag, and append it to list @dst. - * (Helper function for the portal group stuff) - */ -static int -__isns_object_translate_attr(isns_object_t *obj, - uint32_t old_tag, uint32_t new_tag, - isns_attr_list_t *dst) -{ - isns_value_t value; - - if (!isns_attr_list_get_value(&obj->ie_attrs, old_tag, &value)) - return 0; - isns_attr_list_append_value(dst, new_tag, NULL, &value); - return 1; -} - - -/* - * Portal Group - */ -static isns_object_t * -__isns_pg_create(const isns_attr_list_t *attrs, uint32_t pg_tag, - isns_object_t *portal, isns_object_t *node) -{ - isns_object_t *obj; - - obj = isns_create_object(&isns_iscsi_pg_template, attrs, - isns_object_get_entity(portal)); - - /* - * 3.4 - * - * Each Portal and iSCSI Storage Node registered in an Entity can - * be associated using a Portal Group (PG) object. The PG Tag - * (PGT), if non-NULL, indicates that the associated Portal - * provides access to the associated iSCSI Storage Node in - * the Entity. All Portals that have the same PGT value for - * a specific iSCSI Storage Node allow coordinated access to - * that node. - * - * 5.6.5.2 - * - * If the PGT of the Portal Group is not NULL, then a relationship - * exists between the indicated Storage Node and Portal; if the - * PGT is NULL, then no relationship exists. - */ - if (pg_tag != 0) { - isns_object_set_uint32(obj, - ISNS_TAG_PG_TAG, pg_tag); - } else { - /* A NULL PGT indicates that the - * storage node cannot be accessed through - * this portal. */ - isns_object_set_nil(obj, ISNS_TAG_PG_TAG); - } - - /* This object represents a relationship between portal - and storage node. Create a relation. */ - obj->ie_relation = isns_create_relation(obj, - ISNS_RELATION_PORTAL_GROUP, - portal, node); - - return obj; -} - -/* - * Find the portal for a given portal group - */ -static isns_object_t * -__isns_pg_find_portal(isns_db_t *db, isns_object_t *pg, - const isns_object_list_t *extra_objs) -{ - isns_attr_list_t key_attrs = ISNS_ATTR_LIST_INIT; - isns_object_t *obj = NULL; - - /* FIXME: ISNS_TAG_PG_PORTAL_IP_ADDR -> ...ADDRESS */ - if (!__isns_object_translate_attr(pg, - ISNS_TAG_PG_PORTAL_IP_ADDR, - ISNS_TAG_PORTAL_IP_ADDRESS, - &key_attrs)) - goto out; - if (!__isns_object_translate_attr(pg, - ISNS_TAG_PG_PORTAL_TCP_UDP_PORT, - ISNS_TAG_PORTAL_TCP_UDP_PORT, - &key_attrs)) - goto out; - - obj = isns_db_lookup(db, &isns_portal_template, &key_attrs); - if (!obj && extra_objs) - obj = isns_object_list_lookup(extra_objs, - &isns_portal_template, &key_attrs); - -out: - isns_attr_list_destroy(&key_attrs); - return obj; -} - -/* - * Find the node for a given portal group - */ -static isns_object_t * -__isns_pg_find_node(isns_db_t *db, isns_object_t *pg, - const isns_object_list_t *extra_objs) -{ - isns_attr_list_t key_attrs = ISNS_ATTR_LIST_INIT; - isns_object_t *obj = NULL; - - if (!__isns_object_translate_attr(pg, - ISNS_TAG_PG_ISCSI_NAME, - ISNS_TAG_ISCSI_NAME, - &key_attrs)) - goto out; - - obj = isns_db_lookup(db, &isns_iscsi_node_template, &key_attrs); - if (!obj && extra_objs) - obj = isns_object_list_lookup(extra_objs, - &isns_iscsi_node_template, &key_attrs); - -out: - isns_attr_list_destroy(&key_attrs); - return obj; -} - -/* - * When creating a portal group, it must not connect nodes and - * portals from other entities. However, it is perfectly fine to - * link objects in limbo. - */ -static inline int -__isns_pg_may_relate(isns_object_t *entity, isns_object_t *subordinate) -{ - isns_object_t *other; - - other = isns_object_get_entity(subordinate); - return other == NULL || other == entity; -} - -/* - * Given a portal group object, create the relationship - */ -isns_relation_t * -isns_db_build_pg_relation(isns_db_t *db, isns_object_t *pg, - const isns_object_list_t *extra_objs) -{ - isns_object_t *entity, *node = NULL, *portal = NULL; - - entity = isns_object_get_entity(pg); - - node = __isns_pg_find_node(db, pg, extra_objs); - if (node == NULL) { - isns_error("Trying to register PG for non-existant node\n"); - goto failed; - } - if (!__isns_pg_may_relate(entity, node)) { - isns_error("Trying to register PG for node in other entity\n"); - goto failed; - } - - portal = __isns_pg_find_portal(db, pg, extra_objs); - if (portal == NULL) { - isns_error("Trying to register PG for non-existant portal\n"); - goto failed; - } - if (!__isns_pg_may_relate(entity, portal)) { - isns_error("Trying to register PG for portal in other entity\n"); - goto failed; - } - - pg->ie_relation = isns_create_relation(pg, - ISNS_RELATION_PORTAL_GROUP, - node, portal); - isns_object_release(portal); - isns_object_release(node); - - return pg->ie_relation; - -failed: - if (portal) - isns_object_release(portal); - if (node) - isns_object_release(node); - return NULL; -} - -/* - * Create a portal group given node, portal and PGT - */ -isns_object_t * -isns_create_portal_group(isns_object_t *portal, - isns_object_t *node, uint32_t pg_tag) -{ - isns_attr_list_t key_attrs = ISNS_ATTR_LIST_INIT; - isns_object_t *obj = NULL; - - if (portal == NULL || node == NULL) - return NULL; - - if (node->ie_container != portal->ie_container) { - isns_error("Refusing to create portal group " - "linking objects from different entities\n"); - return NULL; - } - - if (__isns_object_translate_attr(node, - ISNS_TAG_ISCSI_NAME, - ISNS_TAG_PG_ISCSI_NAME, - &key_attrs) - && __isns_object_translate_attr(portal, - ISNS_TAG_PORTAL_IP_ADDRESS, - ISNS_TAG_PG_PORTAL_IP_ADDR, - &key_attrs) - && __isns_object_translate_attr(portal, - ISNS_TAG_PORTAL_TCP_UDP_PORT, - ISNS_TAG_PG_PORTAL_TCP_UDP_PORT, - &key_attrs)) { - obj = __isns_pg_create(&key_attrs, pg_tag, portal, node); - } - - isns_attr_list_destroy(&key_attrs); - return obj; -} - -/* - * 5.6.5.1 - * New PG objects are registered when an associated Portal or - * iSCSI Node object is registered. An explicit PG object - * registration MAY follow a Portal or iSCSI Node object - * registration in a DevAttrReg message. - * [...] - * If the PGT value is not included in the Storage Node or - * Portal object registration, and if a PGT value was not - * previously registered for the relationship, then the PGT for - * the corresponding PG object SHALL be registered with a value - * of 0x00000001. - * - * We return non-NULL if the object was created. - */ -isns_object_t * -isns_create_default_portal_group(isns_db_t *db, - isns_object_t *portal, isns_object_t *node) -{ - isns_object_t *obj; - - if (portal == NULL || node == NULL) - return 0; - - /* See if there is a PG already */ - obj = isns_db_get_relationship_object(db, node, portal, - ISNS_RELATION_PORTAL_GROUP); - if (obj != NULL) { - isns_object_release(obj); - return NULL; - } - - return isns_create_portal_group(portal, node, 1); -} - -static uint32_t iscsi_pg_attrs[] = { - ISNS_TAG_PG_ISCSI_NAME, - ISNS_TAG_PG_PORTAL_IP_ADDR, - ISNS_TAG_PG_PORTAL_TCP_UDP_PORT, - ISNS_TAG_PG_TAG, - ISNS_TAG_PG_INDEX, -}; - -static uint32_t iscsi_pg_key_attrs[] = { - ISNS_TAG_PG_ISCSI_NAME, - ISNS_TAG_PG_PORTAL_IP_ADDR, - ISNS_TAG_PG_PORTAL_TCP_UDP_PORT, -}; - -isns_object_template_t isns_iscsi_pg_template = { - .iot_name = "iSCSI Portal Group", - .iot_handle = ISNS_OBJECT_TYPE_PG, - .iot_attrs = iscsi_pg_attrs, - .iot_num_attrs = array_num_elements(iscsi_pg_attrs), - .iot_keys = iscsi_pg_key_attrs, - .iot_num_keys = array_num_elements(iscsi_pg_key_attrs), - .iot_attrs = iscsi_pg_attrs, - .iot_keys = iscsi_pg_key_attrs, - .iot_index = ISNS_TAG_PG_INDEX, - .iot_next_index = ISNS_TAG_PG_NEXT_INDEX, - .iot_container = &isns_entity_template, - .iot_relation_type = ISNS_RELATION_PORTAL_GROUP, - .iot_build_relation = isns_db_build_pg_relation, -}; - diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/query.c open-iscsi-2.0.874/utils/open-isns/query.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/query.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/query.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,238 +0,0 @@ -/* - * Handle iSNS Device Attribute Query - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include -#include -#include "isns.h" -#include "attrs.h" -#include "message.h" -#include "security.h" -#include "objects.h" -#include "db.h" -#include "util.h" - -/* - * Create a query, and set the source name - */ -static isns_simple_t * -__isns_create_query(isns_source_t *source, const isns_attr_list_t *key) -{ - return isns_simple_create(ISNS_DEVICE_ATTRIBUTE_QUERY, source, key); -} - -isns_simple_t * -isns_create_query(isns_client_t *clnt, const isns_attr_list_t *key) -{ - return __isns_create_query(clnt->ic_source, key); -} - -isns_simple_t * -isns_create_query2(isns_client_t *clnt, const isns_attr_list_t *key, isns_source_t *source) -{ - return __isns_create_query(source?: clnt->ic_source, key); -} - -int -isns_query_request_attr_tag(isns_simple_t *qry, uint32_t tag) -{ - isns_attr_list_append_nil(&qry->is_operating_attrs, tag); - return ISNS_SUCCESS; -} - -int -isns_query_request_attr(isns_simple_t *qry, isns_attr_t *attr) -{ - if (!ISNS_ATTR_IS_NIL(attr)) { - isns_error("Query operating attribute must be NIL\n"); - return ISNS_INVALID_QUERY; - } - isns_attr_list_append_attr(&qry->is_operating_attrs, attr); - return ISNS_SUCCESS; -} - -static unsigned int -isns_query_get_requested_types(const isns_attr_list_t *attrs) -{ - unsigned int i, mask = 0; - - for (i = 0; i < attrs->ial_count; ++i) { - uint32_t tag = attrs->ial_data[i]->ia_tag_id; - isns_object_template_t *tmpl; - - tmpl = isns_object_template_find(tag); - /* Ignore unknown tags */ - if (tmpl == NULL) - continue; - - mask |= 1 << tmpl->iot_handle; - } - return mask; -} - -/* - * Get the list of objects matching this query - */ -static int -isns_query_get_objects(isns_simple_t *qry, isns_db_t *db, isns_object_list_t *result) -{ - isns_scope_t *scope = NULL; - isns_object_list_t matching = ISNS_OBJECT_LIST_INIT; - isns_attr_list_t *keys = &qry->is_message_attrs; - isns_object_template_t *query_type = NULL; - unsigned int i, qry_mask = 0; - int status; - - /* 5.6.5.2 - * If multiple attributes are used as the Message Key, then they - * MUST all be from the same object type (e.g., IP address and - * TCP/UDP Port are attributes of the Portal object type). - */ - for (i = 0; i < keys->ial_count; ++i) { - isns_object_template_t *tmpl; - uint32_t tag = keys->ial_data[i]->ia_tag_id; - - tmpl = isns_object_template_for_tag(tag); - if (tmpl == NULL) - return ISNS_ATTRIBUTE_NOT_IMPLEMENTED; - if (query_type == NULL) - query_type = tmpl; - else if (tmpl != query_type) - return ISNS_INVALID_QUERY; - } - - /* - * 5.6.5.2 - * An empty Message Key field indicates the query is scoped to - * the entire database accessible by the source Node. - */ - if (keys->ial_count == 0) { - query_type = &isns_entity_template; - keys = NULL; - } - - /* Policy: check whether the client is allowed to - * query this type of object. */ - if (!isns_policy_validate_object_type(qry->is_policy, - query_type, qry->is_function)) - return ISNS_SOURCE_UNAUTHORIZED; - - /* No scope means that the source is not part of - * any discovery domain, and there's no default DD. - * Just return an empty reply. */ - scope = isns_scope_for_call(db, qry); - if (scope == NULL) - return ISNS_SUCCESS; - - status = isns_scope_gang_lookup(scope, query_type, keys, &matching); - if (status != ISNS_SUCCESS) - goto out; - - /* Extract the mask of requested objects */ - qry_mask = isns_query_get_requested_types(&qry->is_operating_attrs); - - /* - * 5.6.5.2 - * The DevAttrQry response message returns attributes of objects - * listed in the Operating Attributes that are related to the - * Message Key of the original DevAttrQry message. - */ - for (i = 0; i < matching.iol_count; ++i) { - isns_object_t *obj = matching.iol_data[i]; - - if (!isns_policy_validate_object_access(qry->is_policy, - qry->is_source, obj, - qry->is_function)) - continue; - - if (obj->ie_container) - isns_object_list_append(result, obj->ie_container); - isns_object_list_append(result, obj); - isns_scope_get_related(scope, obj, qry_mask, result); - } - -out: - isns_object_list_destroy(&matching); - isns_scope_release(scope); - return status; -} - -/* - * Create a Query Response - */ -static isns_simple_t * -isns_create_query_response(isns_server_t *srv, - const isns_simple_t *qry, const isns_object_list_t *objects) -{ - const isns_attr_list_t *req_attrs = NULL; - isns_simple_t *resp; - unsigned int i; - - resp = __isns_create_query(srv->is_source, &qry->is_message_attrs); - - /* - * 5.7.5.2. - * If no Operating Attributes are included in the original - * query, then all Operating Attributes SHALL be returned - * in the response. - */ - if (qry->is_operating_attrs.ial_count != 0) - req_attrs = &qry->is_operating_attrs; - - for (i = 0; i < objects->iol_count; ++i) { - isns_object_t *obj = objects->iol_data[i]; - - if (obj->ie_rebuild) - obj->ie_rebuild(obj, srv->is_db); - isns_object_get_attrlist(obj, - &resp->is_operating_attrs, - req_attrs); - } - return resp; -} - -int -isns_process_query(isns_server_t *srv, isns_simple_t *call, isns_simple_t **result) -{ - isns_object_list_t objects = ISNS_OBJECT_LIST_INIT; - isns_simple_t *reply = NULL; - isns_db_t *db = srv->is_db; - int status; - - /* Get the objects matching the query */ - status = isns_query_get_objects(call, db, &objects); - if (status != ISNS_SUCCESS) - goto done; - - /* Success: build the response */ - reply = isns_create_query_response(srv, call, &objects); - if (reply == NULL) { - status = ISNS_INTERNAL_ERROR; - goto done; - } - - /* There's nothing in the spec that tells us what to - * return if the query matches no object. - */ - if (objects.iol_count == 0) { - status = ISNS_NO_SUCH_ENTRY; - goto done; - } - -done: - isns_object_list_destroy(&objects); - *result = reply; - return status; -} - -/* - * Parse the list of objects in a query response - */ -int -isns_query_response_get_objects(isns_simple_t *qry, - isns_object_list_t *result) -{ - return isns_simple_response_get_objects(qry, result); -} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/README open-iscsi-2.0.874/utils/open-isns/README --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/README 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/README 1970-01-01 00:00:00.000000000 +0000 @@ -1,173 +0,0 @@ - -Welcome to Open-iSNS -==================== - -This is a partial implementation of iSNS, according to RFC4171. -The implementation is still somewhat incomplete, but I'm releasing -it for your reading pleasure. - -The distribution comprises - - isnsd - This is the iSNS server, supporting persistent storage - of registrations in a file based database. - - isnsadm - A command line utility for querying the iSNS database, - and for registering/deregistering nodes and portals - - isnsdd - An iSNS Discovery Daemon, which is still very much work - in progress. The daemon is supposed to handle all the - bit banging and server communications required to register - a node, its portals, and to maintain the registration. - It is also supposed to use the iSNS State Change Notification - framework to learn of new targets or initiators coming online, - and inform local services (such as the iSCSI initiator daemon) - about these changes. - -Thanks! -------- - -Many thanks to Albert Pauw for his fearless testing of snapshots, -and his copious feedback! - -What works, after a fashion: ----------------------------- - - - For now, I've been focusing on getting the iSCSI part to - work. There is some very basic support for FC objects, but - this will be hardly useful yet. - - - Registration, deregistration, query, getnext - You can use isnsadm to register iSCSI nodes, and portals. - isnsadm also illustrates how this is supposed to be used from - the client perspective. - - - Discovery domains are supported mostly. The administrator - can create discovery domains using isnsadm, and place storage - nodes in domains. Queries by clients are scoped by their - discovery domains membership, so that they will be unable to - see nodes not part of a shared DD. - - Open-iSNS currently does not allow clients to place themselves - in a DD. - - Optionally, storage nodes that are not in any discovery domain - will be placed in a "default DD" (see the DefaultDiscoveryDomain - in isnsd.conf). - - - ESI, supported both by the server and the discovery daemon - - - SCN, supported by the server and the discovery daemon - -What is still missing ---------------------- - - - Better documentation (esp. a HOWTO on getting started with iSNS) - - DD Sets - - Various bits and pieces of the protocol - - FC support - - -Building Open-iSNS ------------------- - -The Open-iSNS build is now based on autoconf. The distributed tarball -should include a configure script and a config.h.in file generated -from configure.ac. If these are missing, you can generate them -by running - - autoconf - autoheader - -For most people, it should be sufficient to run configure without any -arguments, or at most with the option --prefix. If run without --prefix, -program files, manpages etc will be installed below /usr/local. To have -everything installed /usr/bin, /usr/share/man etc, run it as - - ./configure --prefix=/usr - -Dependencies: - - - If you want to build Open-iSNS with support for authentication, - you need the OpenSSL libraries and header files installed. - - The configure script should pick up the presence of these - libraries, and enable security support automatically. To disable - this explicitly in your build, pass the --without-security option - to configure. - - - If you want to build Open-iSNS with SLP support, you need the - OpenSLP library and header file installed. - - The configure script should pick up the presence of this library, - and enable SLP support automatically. To disable this explicitly - in your build, pass the --without-slp option to configure. - -When configure is run, it checks for a the presence of a number of -headers and libraries in your system (the results of most of these checks -are currently ignored :-). Then, it creates a Makefile and a config.h -include file. With these in place, you can build the binaries and libraries: - - make - make install - -Getting started ---------------- - -On the iSNS server, you need to generate a server key and install it. The -simplest way is probably to use the isnssetup script included in the -source package. - -For each client you wish to use, you should then - -iSNS Security -------------- - -This implementation of iSNS supports authentication, as descibed in RFC -4171. In order to use it, you have to create DSA keys for the server and -all clients. - -iSNS uses conceptually the same security mechanism as SLP, and identifies -principals by a "Security Parameter Index", which is essentially a string -identifying a key. - -Open-iSNS fully supports DSA based security, and offers a flexible -policy mechanism that ties an SPI to a network entity and the storage -node names it is allowed to use. For an introduction to the security -model used by Open-iSNS, refer to the isns_config(5) manual page. An -overview on setting up the iSNS server for authentication is given in -the EXAMPLES section of the isnsadm(8) manual page. - -Downloading Open-iSNS ---------------------- - -Open-iSNS is available for download from - - http://oss.oracle.com/~okir/open-isns - -You have to grab the latest tarball and compile it; fancy things such -as RPMs are not available yet. - ------------------------------------------------------------------- - - - COPYRIGHT NOTICE - - Copyright (C) 2007 Olaf Kirch. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/register.c open-iscsi-2.0.874/utils/open-isns/register.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/register.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/register.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,934 +0,0 @@ -/* - * Handle iSNS Device Attribute Registration - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include -#include -#include -#include "isns.h" -#include "attrs.h" -#include "objects.h" -#include "message.h" -#include "security.h" -#include "util.h" -#include "db.h" - - -static int isns_create_default_pgs_for_object(isns_db_t *, isns_object_t *); - -/* - * Create a registration, and set the source name - */ -static isns_simple_t * -__isns_create_registration(isns_source_t *source, isns_object_t *key_obj) -{ - isns_simple_t *reg; - - reg = isns_simple_create(ISNS_DEVICE_ATTRIBUTE_REGISTER, source, NULL); - if (reg == NULL) - return NULL; - - /* - * When sending a registration, you can either specify - * the object to be modified in the key attrs, or leave - * the key empty. - */ - if (key_obj == NULL) - return reg; - - /* User gave us a key object. We need to put the key - * attributes into the message attrs, and *all* attrs - * into the operating attrs. */ - if (!isns_object_extract_keys(key_obj, ®->is_message_attrs)) { - /* bummer - seems the object is missing some - * vital organs. */ - isns_warning("%s: object not fully specified, key attrs missing\n", - __FUNCTION__); - goto failed; - } - - /* - * The Message Key identifies the object the DevAttrReg message - * acts upon. [...] The key attribute(s) identifying this object - * MUST also be included among the Operating Attributes. - * - * We do not enforce this here, we rely on the caller to get this - * right. - */ -#if 0 - if (!isns_object_extract_all(key_obj, ®->is_operating_attrs)) { - isns_warning("%s: unable to extract attrs from key objects\n", - __FUNCTION__); - goto failed; - } -#endif - - return reg; - -failed: - isns_simple_free(reg); - return NULL; -} - -isns_simple_t * -isns_create_registration(isns_client_t *clnt, isns_object_t *key_obj) -{ - return __isns_create_registration(clnt->ic_source, key_obj); -} - -isns_simple_t * -isns_create_registration2(isns_client_t *clnt, isns_object_t *key_obj, - isns_source_t *source) -{ - return __isns_create_registration(source?: clnt->ic_source, key_obj); -} - -/* - * Set the replace flag - */ -void -isns_registration_set_replace(isns_simple_t *reg, int replace) -{ - reg->is_replace = !!replace; -} - -/* - * Add an object to the registration - */ -void -isns_registration_add_object(isns_simple_t *reg, isns_object_t *obj) -{ - isns_object_extract_writable(obj, ®->is_operating_attrs); -} - -void -isns_registration_add_object_list(isns_simple_t *reg, isns_object_list_t *list) -{ - unsigned int i; - - for (i = 0; i < list->iol_count; ++i) { - isns_object_extract_writable(list->iol_data[i], - ®->is_operating_attrs); - } -} - -/* - * Get the key object given in this message - * - * It doesn't say anywhere explicitly in the RFC, but - * the message key can contain both key and non-key - * attributes. For instance, you can search by - * Portal Group Index (section 3.4). - */ -static int -isns_registration_get_key(isns_simple_t *reg, isns_db_t *db, isns_object_t **key_obj) -{ - isns_attr_list_t *keys = ®->is_message_attrs; - isns_attr_list_t dummy_keys = ISNS_ATTR_LIST_INIT; - isns_attr_t *attr; - isns_object_t *obj = NULL; - const char *eid = NULL; - char eidbuf[128]; - int status = ISNS_SUCCESS; - int obj_must_exist = 0; - - /* - * 5.6.5.1 - * If the Message Key is not present, then the DevAttrReg message - * implicitly registers a new Network Entity. In this case, - * the replace bit SHALL be ignored; a new Network Entity SHALL - * be created. - * - * Note that some clients seem to leave the message key - * empty, but hide the entity identifier in the operating - * attrs. - */ - if (keys->ial_count != 0) { - attr = keys->ial_data[0]; - - /* - * 5.6.5.1 - * If the Message Key does not contain an EID, and no - * pre-existing objects match the Message Key, then the - * DevAttrReg message SHALL be rejected with a status - * code of 3 (Invalid Registration). - */ - if (keys->ial_count != 1 - || attr->ia_tag_id != ISNS_TAG_ENTITY_IDENTIFIER) - obj_must_exist = 1; - } else { - /* Empty message key. But the client may have hidden - * the EID in the operating attrs :-/ - */ - if (reg->is_operating_attrs.ial_count == 0) - goto create_entity; - - attr = reg->is_operating_attrs.ial_data[0]; - if (attr->ia_tag_id != ISNS_TAG_ENTITY_IDENTIFIER) - goto create_entity; - - isns_attr_list_append_attr(&dummy_keys, attr); - keys = &dummy_keys; - } - - /* If the caller specifies an EID, extract it while - * we know what we're doing :-) */ - if (attr->ia_tag_id == ISNS_TAG_ENTITY_IDENTIFIER - && ISNS_ATTR_IS_STRING(attr)) - eid = attr->ia_value.iv_string; - - /* Look up the object identified by the keys. - * We do not scope the lookup, as the client - * may want to add nodes to an entity that's - * currently empty - and hence not visible to - * any DD. */ - if (!ISNS_ATTR_IS_NIL(attr)) - obj = isns_db_lookup(db, NULL, keys); - - if (obj == NULL && obj_must_exist) - goto err_invalid; - - if (obj != NULL) { - /* - * Policy: verify that the client is permitted - * to access this object. - * - * This includes - * - the client node must be the object owner, - * or a control node. - * - the policy must allow modification of - * this object type. - */ - if (!isns_policy_validate_object_access(reg->is_policy, - reg->is_source, - obj, reg->is_function)) - goto err_unauthorized; - -found_object: - if (reg->is_replace) { - isns_object_t *container = NULL; - - if (!ISNS_IS_ENTITY(obj)) { - container = isns_object_get_entity(obj); - if (container == NULL) { - isns_error("Trying to replace %s (id %u) " - "which has no container\n", - obj->ie_template->iot_name, - obj->ie_index); - goto err_invalid; - } - } - - isns_debug_state("Replacing %s (id %u)\n", - obj->ie_template->iot_name, - obj->ie_index); - isns_db_remove(db, obj); - isns_object_release(obj); - - /* Purge the deleted objects from the database now */ - isns_db_purge(db); - - /* We need to flush pending SCNs because the - * objects may be resurrected from limbo, - * and we might be looking at stale data. */ - isns_scn_transmit_all(); - - /* It's an entity. Nuke it and create - * a new one. */ - if (container == NULL) { - isns_source_set_entity(reg->is_source, NULL); - goto create_entity; - } - - obj = isns_object_get(container); - } - - goto out; - } - - /* - * If the Message Key contains an EID and no pre-existing objects - * match the Message Key, then the DevAttrReg message SHALL create a - * new Entity with the specified EID and any new object(s) specified - * by the Operating Attributes. The replace bit SHALL be ignored. - * - * Implementer's note: the EID attribute may be empty, in which case - * we also create a new entity. - */ - -create_entity: - if (!isns_policy_validate_object_creation(reg->is_policy, - reg->is_source, - &isns_entity_template, keys, NULL, - reg->is_function)) - goto err_unauthorized; - - /* - * 5.6.5.1 - * A registration message that creates a new Network Entity object - * MUST contain at least one Portal or one Storage Node. If the - * message does not, then it SHALL be considered invalid and result - * in a response with Status Code of 3 (Invalid Registration). - */ - /* FIXME: Implement this check */ - - /* We try to play nice with lazy clients and attempt to - * look up the network entity given the source name. - * But we don't do this if a non-NULL EID was given, - * because the client may explicitly want to specify more - * than one Network Entity. - */ - if (eid == NULL) { - obj = reg->is_source->is_entity; - if (obj != NULL) { - isns_object_get(obj); - goto found_object; - } - - /* The policy may define a default entity name. - * If that is the case, use it. - */ - eid = isns_policy_default_entity(reg->is_policy); - if (eid) { - obj = isns_db_vlookup(db, &isns_entity_template, - ISNS_TAG_ENTITY_IDENTIFIER, eid, - 0); - if (obj) { - reg->is_source->is_entity = isns_object_get(obj); - goto found_object; - } - } - } - - /* - * 5.6.5.1 - * If the Message Key and Operating Attributes do not contain - * an EID attribute, or if the EID attribute has a length of 0, - * then a new Network Entity object SHALL be created and the iSNS - * server SHALL supply a unique EID value for it. - */ - if (eid == NULL) - eid = isns_db_generate_eid(db, eidbuf, sizeof(eidbuf)); - - /* - * 6.2.2. Entity Protocol - * - * This attribute is required during initial registration of - * the Network Entity. - * - * Implementer's note: we don't rely on this. Instead, the - * Entity Protocol is selected based on the source type. - * If the client specifies the protocol, the auto-selected - * value is overwritten. - */ - obj = isns_create_entity_for_source(reg->is_source, eid); - if (obj == NULL) - goto err_invalid; - - isns_source_set_entity(reg->is_source, obj); - - /* - * 6.2.6 - * If a Registration Period is not requested by the iSNS - * client and Entity Status Inquiry (ESI) messages are not - * enabled for that client, then the Registration Period - * SHALL be set to a non-zero value by the iSNS server. - * This implementation-specific value for the Registration - * Period SHALL be returned in the registration response to the - * iSNS client. The Registration Period may be set to zero, - * indicating its non-use, only if ESI messages are enabled for - * that Network Entity. - * - * Implementer's note: we diverge from this in two ways: - * - the admin may choose to disable registration timeout, - * by setting RegistrationPeriod=0 in the config file - * - * - When a new entity is created, we always set the - * registration interval because we cannot know yet - * whether the client will subsequently enable ESI or - * not. - * - * - The control entity (holding policy objects) will - * not expire. - */ - if (isns_config.ic_registration_period - && strcasecmp(eid, ISNS_ENTITY_CONTROL)) { - isns_object_set_uint32(obj, - ISNS_TAG_REGISTRATION_PERIOD, - isns_config.ic_registration_period); - isns_object_set_uint64(obj, - ISNS_TAG_TIMESTAMP, - time(NULL)); - } - - /* Insert into database, and set the object's owner */ - isns_db_insert(db, obj); - - reg->is_replace = 0; - -out: - *key_obj = obj; - isns_attr_list_destroy(&dummy_keys); - return ISNS_SUCCESS; - -error: - if (obj) - isns_object_release(obj); - isns_attr_list_destroy(&dummy_keys); - return status; - -err_unauthorized: - status = ISNS_SOURCE_UNAUTHORIZED; - goto error; - -err_invalid: - status = ISNS_INVALID_REGISTRATION; - goto error; -} - -static int -isns_registration_get_next_object(isns_db_t *db, - struct isns_attr_list_scanner *st, - isns_object_list_t *result) -{ - isns_object_t *current; - int status, esi = 0; - - status = isns_attr_list_scanner_next(st); - /* We get here if the registration has a trailing PGT */ - if (status == ISNS_NO_SUCH_ENTRY) - return ISNS_SUCCESS; - if (status) - return status; - - /* - * Validate the attrlist. - * This makes sure the client does not include - * duplicate attributes, readonly attributes - * such as Registration Timestamp, Index and Next Index, - * or privileged data (such as marking a storage node as - * control node). - */ - status = isns_attr_list_validate(&st->attrs, - st->policy, - ISNS_DEVICE_ATTRIBUTE_REGISTER); - if (status) { - isns_debug_protocol("invalid attr in message\n"); - return status; - } - - /* - * 6.3.4. Entity Status Inquiry Interval - * - * If the iSNS server is unable to support ESI messages - * or the ESI Interval requested, it SHALL [...] reject - * the ESI request by returning an "ESI Not Available" - * Status Code [...] - * - * Implementer's note: In section 5.7.5.1, the RFC talks - * about modifying the requested ESI interval; so it seems - * it's okay to be liberal about the ESI intervals we accept, - * and update them quietly. - */ - if (isns_attr_list_contains(&st->attrs, ISNS_TAG_ESI_PORT)) { - if (!isns_esi_enabled) { - isns_debug_esi("Refusing to accept portal " - "registration with ESI port\n"); - return ISNS_ESI_NOT_AVAILABLE; - } - esi = 1; - } - - /* - * Override any registration period specified by the client. - */ - if (isns_attr_list_contains(&st->attrs, ISNS_TAG_REGISTRATION_PERIOD)) { - isns_value_t value = ISNS_VALUE_INIT(uint32, - isns_config.ic_registration_period); - - isns_attr_list_update_value(&st->attrs, - ISNS_TAG_REGISTRATION_PERIOD, NULL, - &value); - } - - if (st->tmpl == &isns_entity_template) { - /* - * 5.6.5.1. - * A maximum of one Network Entity object can be - * created or updated with a single DevAttrReg - * message. Consequently, the Operating Attributes - * MUST NOT contain more than one Network Entity - * object. - */ - if (st->entities++) { - isns_debug_protocol("More than one entity in DevAttrReg msg\n"); - return ISNS_INVALID_REGISTRATION; - } - - /* This should be the key object. - * The EID specified by by the client may be - * empty, so don't overwrite the value we - * assigned with something else. - */ - if (!isns_object_match(st->key_obj, &st->keys)) { - isns_debug_protocol("Entity mismatch in message vs. operating attrs\n"); - return ISNS_INVALID_REGISTRATION; - } - current = isns_object_get(st->key_obj); - } else - if (st->tmpl == &isns_dd_template || st->tmpl == &isns_ddset_template) { - isns_debug_protocol("DevAttrReg of type %s not allowed\n", - st->tmpl->iot_name); - return ISNS_INVALID_REGISTRATION; - } else { - /* This will also catch objects in limbo. */ - current = isns_db_lookup(db, st->tmpl, &st->keys); - } - - if (current != NULL) { - /* - * If the replace bit is not set, then the message updates - * the attributes of the object identified by the Message Key - * and its subordinate objects. Existing object containment - * relationships MUST NOT be changed. For existing objects, - * key attributes MUST NOT be modified, but new subordinate - * objects MAY be added. - */ - - /* - * [...] - * If the Node identified by the Source Attribute is - * not a Control Node, then the objects in the operating - * attributes MUST be members of the same Network Entity - * as the Source Node. - */ - if (!isns_policy_validate_object_update(st->policy, - st->source, current, &st->attrs, - ISNS_DEVICE_ATTRIBUTE_REGISTER)) { - isns_object_release(current); - return ISNS_SOURCE_UNAUTHORIZED; - } - - /* We shouldn't allow messages affecting one Entity - * to modify objects owned by a different Entity. - * - * However, there may be orphan objects (created - * while populating discovery domains). These will - * not be associated with any Network Entity, so - * they're up for grabs. - */ - if (st->key_obj == current - || st->key_obj == current->ie_container) { - /* All is well. The current object is the - * key object itself, or a direct descendant of the - * key object. */ - /* FIXME: with FC we can get deeper nesting; - * this needs work. */ - } else - if (!isns_object_is_valid_container(st->key_obj, st->tmpl)) { - isns_error("Client attempts to add %s object to a %s - tsk tsk.\n", - st->tmpl->iot_name, - st->key_obj->ie_template->iot_name); - goto invalid_registration; - } else if (current->ie_container) { - /* We shouldn't get here in authenticated mode, - * but in insecure mode we still may. */ - isns_error("Client attempts to move %s %u to a different %s\n", - current->ie_template->iot_name, - current->ie_index, - st->key_obj->ie_template->iot_name); - goto invalid_registration; - } - } else { - if (!isns_object_is_valid_container(st->key_obj, st->tmpl)) { - isns_error("Client attempts to add %s object to a %s - tsk tsk.\n", - st->tmpl->iot_name, - st->key_obj->ie_template->iot_name); - goto invalid_registration; - } - - if (!isns_policy_validate_object_creation(st->policy, - st->source, st->tmpl, - &st->keys, &st->attrs, - ISNS_DEVICE_ATTRIBUTE_REGISTER)) { - return ISNS_SOURCE_UNAUTHORIZED; - } - current = isns_create_object(st->tmpl, &st->keys, - isns_object_get_entity(st->key_obj)); - - /* We do not insert the new object into the database yet. - * That happens after we're done with parsing *all* - * objects. */ - } - - if (!isns_object_set_attrlist(current, &st->attrs)) { - isns_debug_state("Error updating object's attrlist\n"); - isns_object_release(current); - return ISNS_INTERNAL_ERROR; - } - - /* If the client specifies an ESI port, make sure the - * ESI interval is set and within bounds. */ - if (esi) { - uint32_t esi_interval; - - if (!isns_object_get_uint32(current, - ISNS_TAG_ESI_INTERVAL, &esi_interval)) { - esi_interval = isns_config.ic_esi_min_interval; - } else - if (esi_interval < isns_config.ic_esi_min_interval) { - esi_interval = isns_config.ic_esi_min_interval; - } else - if (esi_interval > isns_config.ic_esi_max_interval) { - esi_interval = isns_config.ic_esi_max_interval; - } else { - esi_interval = 0; - } - - if (esi_interval) - isns_object_set_uint32(current, - ISNS_TAG_ESI_INTERVAL, esi_interval); - } - - /* Append it to the result list. - * We do not return the key object, otherwise - * we end up putting it into the response twice. - */ - if (current != st->key_obj) - isns_object_list_append(result, current); - - /* - * When a Portal is registered, the Portal attributes MAY immediately be - * followed by a PGT attribute. - * [...] - * When an iSCSI Storage Node is registered, the Storage Node attributes - * MAY immediately be followed by a PGT attribute. - */ - if (st->tmpl == &isns_portal_template - || st->tmpl == &isns_iscsi_node_template) { - st->pgt_next_attr = ISNS_TAG_PG_TAG; - st->pgt_base_object = current; - } else if (st->tmpl != &isns_iscsi_pg_template) { - st->pgt_next_attr = 0; - st->pgt_base_object = NULL; - } - - isns_object_release(current); - return ISNS_SUCCESS; - -invalid_registration: - if (current) - isns_object_release(current); - return ISNS_INVALID_REGISTRATION; -} - -/* - * Extract the list of objects to be registered from - * the list of operating attributes. - */ -static int -isns_registration_get_objects(isns_simple_t *reg, isns_db_t *db, - isns_object_t *key_obj, - isns_object_list_t *result) -{ - struct isns_attr_list_scanner state; - int status = ISNS_SUCCESS; - - isns_attr_list_scanner_init(&state, key_obj, ®->is_operating_attrs); - state.source = reg->is_source; - state.policy = reg->is_policy; - - /* - * 5.6.4. - * The ordering of Operating Attributes in the message is - * important for determining the relationships among objects - * and their ownership of non-key attributes. iSNS protocol - * messages that violate these ordering rules SHALL be rejected - * with the Status Code of 2 (Message Format Error). - */ - /* FIXME: Implement this check */ - - while (state.pos < state.orig_attrs.ial_count) { - status = isns_registration_get_next_object(db, - &state, result); - - if (status) - break; - } - - isns_attr_list_scanner_destroy(&state); - return status; -} - -/* - * 5.6.5.1 - * New PG objects are registered when an associated Portal or - * iSCSI Node object is registered. An explicit PG object - * registration MAY follow a Portal or iSCSI Node object - * registration in a DevAttrReg message. - * [...] - * If the PGT value is not included in the Storage Node or - * Portal object registration, and if a PGT value was not - * previously registered for the relationship, then the PGT for - * the corresponding PG object SHALL be registered with a value - * of 0x00000001. - */ -static int -isns_create_registration_pgs(isns_db_t *db, - const isns_object_list_t *list) -{ - unsigned int i, num_created = 0; - - for (i = 0; i < list->iol_count; ++i) { - isns_object_t *obj = list->iol_data[i]; - - if (ISNS_IS_ISCSI_NODE(obj) || ISNS_IS_PORTAL(obj)) - num_created += isns_create_default_pgs_for_object(db, obj); - } - return num_created; -} - -static int -isns_create_default_pgs_for_object(isns_db_t *db, isns_object_t *this) -{ - isns_object_template_t *match_tmpl; - isns_object_t *entity; - unsigned int i, num_created = 0; - - if (ISNS_IS_ISCSI_NODE(this)) - match_tmpl = &isns_portal_template; - else - match_tmpl = &isns_iscsi_node_template; - - entity = isns_object_get_entity(this); - for (i = 0; i < entity->ie_children.iol_count; ++i) { - isns_object_t *that = entity->ie_children.iol_data[i], *pg; - - if (that->ie_template != match_tmpl) - continue; - - /* Create the portal group if it does not - * exist. - * Note: we do not return these implicitly - * created portal groups - that's a matter - * of sheer laziness. We would have to - * splice these into the list in the - * appropriate location, and I guess it's - * not really worth the hassle. - */ - if (ISNS_IS_ISCSI_NODE(this)) - pg = isns_create_default_portal_group(db, that, this); - else - pg = isns_create_default_portal_group(db, this, that); - - /* There already is a PG linking these two - * objects. */ - if (pg == NULL) - continue; - - isns_db_insert(db, pg); - - isns_debug_message("--Created default PG:--\n"); - isns_object_print(pg, isns_debug_message); - - isns_object_release(pg); - num_created++; - } - - return num_created; -} - -/* - * Commit all changes to the DB - */ -static int -isns_commit_registration(isns_db_t *db, isns_object_t *key_obj, isns_object_list_t *list) -{ - unsigned int i; - - /* - * If there are any Portal Groups in this registration, build - * the relationship handle: - * - * 3.4 - * A new PG object can only be registered by referencing - * its associated iSCSI Storage Node or Portal object. - * A pre-existing PG object can be modified or queried - * by using its Portal Group Index as message key, or - * by referencing its associated iSCSI Storage Node or - * Portal object. - * - * Implementation note: isns_db_create_pg_relation - * checks whether the referenced node and portal exist, - * and belong to the same entity as the PG. If this is - * not the case, NULL is returned, and no relation is - * defined. - */ - for (i = 0; i < list->iol_count; ++i) { - isns_object_t *obj = list->iol_data[i]; - isns_object_template_t *tmpl; - - tmpl = obj->ie_template; - if (tmpl->iot_build_relation && !obj->ie_relation - && !tmpl->iot_build_relation(db, obj, list)) { - isns_debug_protocol("Unable to build relation for new %s\n", - tmpl->iot_name); - return ISNS_INVALID_REGISTRATION; - } - } - - for (i = 0; i < list->iol_count; ++i) { - isns_object_t *obj = list->iol_data[i]; - isns_object_template_t *tmpl; - - tmpl = obj->ie_template; - if (key_obj != obj && !obj->ie_container) { - if (!isns_object_attach(obj, key_obj)) { - /* This should not fail any longer */ - isns_debug_protocol("Unable to attach %s %u to %s\n", - tmpl->iot_name, obj->ie_index, - key_obj->ie_template->iot_name); - return ISNS_INVALID_REGISTRATION; - } - } - - if (obj->ie_state != ISNS_OBJECT_STATE_MATURE) - isns_db_insert(db, obj); - } - - return ISNS_SUCCESS; -} - -/* - * Process a registration - */ -int -isns_process_registration(isns_server_t *srv, isns_simple_t *call, isns_simple_t **result) -{ - isns_object_list_t objects = ISNS_OBJECT_LIST_INIT; - isns_simple_t *reply = NULL; - isns_object_t *key_obj = NULL; - isns_db_t *db = srv->is_db; - int status; - unsigned int i; - - /* - * 5.6.1 - * For messages that change the contents of the iSNS database, - * the iSNS server MUST verify that the Source Attribute - * identifies either a Control Node or a Storage Node that is - * a part of the Network Entity containing the added, deleted, - * or modified objects. - * - * This check happens in isns_registration_get_key by calling - * isns_policy_validate_object_access. - */ - - /* Get the key object (usually a Network Entity) */ - status = isns_registration_get_key(call, db, &key_obj); - if (status) - goto done; - - /* Get the objects to register */ - status = isns_registration_get_objects(call, db, key_obj, &objects); - if (status != ISNS_SUCCESS) - goto done; - - /* We parsed the request alright; all semantic checks passed. - * Now insert the modified/new objects. - * We do this in two passes, by first committing all nodes and - * portals, and then committing the portal groups. - */ - status = isns_commit_registration(db, key_obj, &objects); - if (status != ISNS_SUCCESS) - goto done; - - /* The client may have registered a bunch of storage nodes, - * and created an entity in the process. However, there's the - * odd chance that the source node name it used was not - * registered. However, we need to be able to later find - * the entity it registered based on its source name. - * So we implicitly create a dummy storage node with the given - * source name and attach it. - */ -#if 1 - if (ISNS_IS_ENTITY(key_obj) - && !isns_source_set_node(call->is_source, db)) { - isns_attr_list_t attrs = ISNS_ATTR_LIST_INIT; - isns_source_t *source = call->is_source; - isns_object_t *obj; - - isns_attr_list_append_attr(&attrs, isns_source_attr(source)); - isns_attr_list_append_uint32(&attrs, - ISNS_TAG_ISCSI_NODE_TYPE, - 0); - obj = isns_create_object(&isns_iscsi_node_template, - &attrs, key_obj); - if (obj) { - isns_db_insert(db, obj); - } else { - isns_warning("Unable to create dummy storage node " - "for source %s\n", - isns_source_name(source)); - } - isns_attr_list_destroy(&attrs); - } -#endif - - /* - * 5.6.5.1 - * New PG objects are registered when an associated Portal or - * iSCSI Node object is registered. An explicit PG object - * registration MAY follow a Portal or iSCSI Node object - * registration in a DevAttrReg message. - * [...] - * If the PGT value is not included in the Storage Node or - * Portal object registration, and if a PGT value was not - * previously registered for the relationship, then the PGT for - * the corresponding PG object SHALL be registered with a value - * of 0x00000001. - */ - isns_create_registration_pgs(db, &objects); - - /* Success: create a new registration message, and - * send it in our reply. */ - reply = __isns_create_registration(srv->is_source, key_obj); - if (reply == NULL) { - status = ISNS_INTERNAL_ERROR; - goto done; - } - - /* If the key object was modified (or created) - * include it in the response. - * We really ought to restrict ourselves to the - * key attrs plus those that were modified by this - * registration. But right now have no way of - * finding out. - */ - if (key_obj->ie_flags & ISNS_OBJECT_DIRTY) - isns_registration_add_object(reply, key_obj); - - for (i = 0; i < objects.iol_count; ++i) { - isns_registration_add_object(reply, - objects.iol_data[i]); - } - - -done: - isns_object_list_destroy(&objects); - isns_object_release(key_obj); - *result = reply; - return status; -} - -/* - * Extract the list of objects from the DevAttrReg response - */ -int -isns_registration_response_get_objects(isns_simple_t *reg, - isns_object_list_t *result) -{ - return isns_simple_response_get_objects(reg, result); -} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/relation.c open-iscsi-2.0.874/utils/open-isns/relation.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/relation.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/relation.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,281 +0,0 @@ -/* - * iSNS object relationships - * - * Relations are used to express a connection between two - * objects. Currently, two relationship types are implemented: - * - * - portal group: this relates a storage node and a portal - * - visibility: this relates a nodes nodes that share a - * common discovery domain. - * - * Relation objects are nice for portals groups, but kind of - * awkward for DDs. A better way of expressing DD membership - * (which also allows for a fast visibility check) could be - * to store a [bit] vector of DD IDs in each storage node. - * A visibility check would amount to just doing the bitwise - * AND of two vectors, and checking for NULL. The only thing - * to take care of would be to make sure a DD object takes a - * reference on its members (this is necessary so that objects - * maintain their ID/name associations even when removed from - * the database). - * - * Aug 22 2007 - changed DD code to use bit vectors. A lot - * of code in this file is now obsolete. - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include -#include -#include -#include - -#include "isns.h" -#include "objects.h" -#include "util.h" -#include "db.h" - -struct isns_relation_soup { - /* For now, use one plain list. For better - * scalability, we'll need a hash table or - * something similar later. */ - isns_relation_list_t irs_data; -}; - -static void isns_relation_list_append(isns_relation_list_t *, - isns_relation_t *); -static int isns_relation_list_remove(isns_relation_list_t *, - isns_relation_t *); - -isns_relation_soup_t * -isns_relation_soup_alloc(void) -{ - return isns_calloc(1, sizeof(isns_relation_soup_t)); -} - -void -isns_relation_add(isns_relation_soup_t *soup, - isns_relation_t *rp) -{ - isns_relation_list_append(&soup->irs_data, rp); -} - -isns_relation_t * -isns_relation_find_edge(isns_relation_soup_t *soup, - const isns_object_t *left, - const isns_object_t *right, - unsigned int relation_type) -{ - isns_relation_list_t *list = &soup->irs_data; - unsigned int i; - - for (i = 0; i < list->irl_count; ++i) { - isns_relation_t *rp = list->irl_data[i]; - - if (rp->ir_type != relation_type) - continue; - if (rp->ir_subordinate[0].obj == left - && rp->ir_subordinate[1].obj == right) - return rp; - if (rp->ir_subordinate[0].obj == right - && rp->ir_subordinate[1].obj == left) - return rp; - } - return NULL; -} - -void -isns_relation_get_edge_objects(isns_relation_soup_t *soup, - const isns_object_t *left, - unsigned int relation_type, - isns_object_list_t *result) -{ - isns_relation_list_t *list = &soup->irs_data; - unsigned int i; - - for (i = 0; i < list->irl_count; ++i) { - isns_relation_t *rp = list->irl_data[i]; - - if (rp->ir_type != relation_type) - continue; - if (rp->ir_object == NULL) - continue; - if (rp->ir_subordinate[0].obj == left - || rp->ir_subordinate[1].obj == left) { - isns_object_list_append(result, - rp->ir_object); - } - } -} - - - -void -isns_relation_halfspace(isns_relation_soup_t *soup, - const isns_object_t *left, - unsigned int relation_type, - isns_object_list_t *result) -{ - isns_relation_list_t *list = &soup->irs_data; - unsigned int i; - - for (i = 0; i < list->irl_count; ++i) { - isns_relation_t *rp = list->irl_data[i]; - - if (rp->ir_type != relation_type) - continue; - if (rp->ir_subordinate[0].obj == left) { - isns_object_list_append(result, - rp->ir_subordinate[1].obj); - } else - if (rp->ir_subordinate[1].obj == left) { - isns_object_list_append(result, - rp->ir_subordinate[0].obj); - } - } -} - -int -isns_relation_exists(isns_relation_soup_t *soup, - const isns_object_t *relating_object, - const isns_object_t *left, - const isns_object_t *right, - unsigned int relation_type) -{ - isns_relation_list_t *list = &soup->irs_data; - unsigned int i; - - for (i = 0; i < list->irl_count; ++i) { - isns_relation_t *rp = list->irl_data[i]; - - if (rp->ir_type != relation_type) - continue; - if (rp->ir_object != relating_object) - continue; - if (rp->ir_subordinate[0].obj == left - && rp->ir_subordinate[1].obj == right) - return 1; - if (rp->ir_subordinate[0].obj == right - && rp->ir_subordinate[1].obj == left) - return 1; - } - return 0; -} - -isns_object_t * -isns_relation_get_other(const isns_relation_t *rp, - const isns_object_t *this) -{ - if (rp->ir_subordinate[0].obj == this) - return rp->ir_subordinate[1].obj; - if (rp->ir_subordinate[1].obj == this) - return rp->ir_subordinate[0].obj; - return NULL; -} - -void -isns_relation_remove(isns_relation_soup_t *soup, - isns_relation_t *rp) -{ - isns_object_release(rp->ir_object); - rp->ir_object = NULL; - - isns_relation_list_remove(&soup->irs_data, rp); -} - -isns_relation_t * -isns_create_relation(isns_object_t *relating_object, - unsigned int relation_type, - isns_object_t *subordinate_object1, - isns_object_t *subordinate_object2) -{ - isns_relation_t *rp; - - rp = isns_calloc(1, sizeof(*rp)); - rp->ir_type = relation_type; - rp->ir_users = 1; - rp->ir_object = isns_object_get(relating_object); - isns_object_reference_set(&rp->ir_subordinate[0], subordinate_object1); - isns_object_reference_set(&rp->ir_subordinate[1], subordinate_object2); - -#if 0 - if (relating_object) { - relating_object->ie_relation = rp; - rp->ir_users++; - } -#endif - - return rp; -} - -void -isns_relation_sever(isns_relation_t *rp) -{ - isns_object_release(rp->ir_object); - rp->ir_object = NULL; - - isns_object_reference_drop(&rp->ir_subordinate[0]); - isns_object_reference_drop(&rp->ir_subordinate[1]); -} - -void -isns_relation_release(isns_relation_t *rp) -{ - if (--(rp->ir_users)) - return; - - isns_relation_sever(rp); - isns_free(rp); -} - -/* - * Check whether the relation references two dead/limbo objects. - * This is used for dead PG removal. - */ -int -isns_relation_is_dead(const isns_relation_t *rel) -{ - isns_object_t *left, *right; - - left = rel->ir_subordinate[0].obj; - right = rel->ir_subordinate[1].obj; - if ((left->ie_flags & ISNS_OBJECT_DEAD) - && (right->ie_flags & ISNS_OBJECT_DEAD)) - return 1; - - return 0; -} - -void -isns_relation_list_append(isns_relation_list_t *list, - isns_relation_t *rp) -{ - if ((list->irl_count % 128) == 0) { - list->irl_data = isns_realloc(list->irl_data, - (list->irl_count + 128) * sizeof(void *)); - if (list->irl_data == NULL) - isns_fatal("out of memory!\n"); - } - - list->irl_data[list->irl_count++] = rp; - rp->ir_users++; -} - -int -isns_relation_list_remove(isns_relation_list_t *list, - isns_relation_t *rp) -{ - unsigned int i, count = list->irl_count; - - for (i = 0; i < count; ++i) { - if (list->irl_data[i] != rp) - continue; - if (i < count - 1) - list->irl_data[i] = list->irl_data[count-1]; - isns_relation_release(rp); - list->irl_count -= 1; - return 1; - } - - return 0; -} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/scn.c open-iscsi-2.0.874/utils/open-isns/scn.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/scn.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/scn.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,926 +0,0 @@ -/* - * Handle SCN registration/deregistration/events - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include -#include -#include -#include "isns.h" -#include "attrs.h" -#include "objects.h" -#include "message.h" -#include "security.h" -#include "util.h" -#include "db.h" - -typedef struct isns_scn isns_scn_t; -typedef struct isns_scn_funnel isns_scn_funnel_t; - -struct isns_scn { - isns_scn_t * scn_next; - char * scn_name; - isns_object_t * scn_entity; - isns_object_t * scn_owner; - isns_attr_t * scn_attr; - - isns_simple_t * scn_message; - isns_simple_t * scn_pending; - unsigned int scn_retries; - time_t scn_timeout; - uint16_t scn_xid; - - time_t scn_last_update; - isns_scn_funnel_t * scn_current_funnel; - isns_scn_funnel_t * scn_funnels; -}; - -struct isns_scn_funnel { - isns_scn_funnel_t * scn_next; - isns_portal_info_t scn_portal; - isns_socket_t * scn_socket; - unsigned int scn_bad; -}; - -static isns_server_t * isns_scn_server = NULL; -static isns_scn_t * isns_scn_list; - -static isns_scn_t * isns_scn_create_scn(isns_object_t *, uint32_t, isns_db_t *); -static void isns_scn_delete_scn(isns_object_t *); -static isns_scn_t * isns_scn_setup(isns_scn_t *, isns_object_t *); -static void isns_scn_callback(const isns_db_event_t *, void *); -static void isns_scn_free(isns_scn_t *); - -/* - * Initialize SCN machinery - */ -void -isns_scn_init(isns_server_t *srv) -{ - isns_db_t *db = srv->is_db; - isns_object_list_t nodes = ISNS_OBJECT_LIST_INIT; - isns_scn_t **tail; - unsigned int i; - - isns_scn_server = srv; - isns_register_callback(isns_scn_callback, db); - - /* Recover SCN state. */ - isns_db_gang_lookup(db, &isns_iscsi_node_template, NULL, &nodes); -#ifdef notyet - isns_db_gang_lookup(db, &isns_fc_node_template, NULL, &nodes); -#endif - - tail = &isns_scn_list; - for (i = 0; i < nodes.iol_count; ++i) { - isns_object_t *node = nodes.iol_data[i]; - isns_scn_t *scn; - - if (!node->ie_scn_mask) - continue; - - isns_debug_state("Recovering SCN state for %s %u\n", - node->ie_template->iot_name, - node->ie_index); - scn = isns_scn_setup(NULL, node); - if (scn) { - *tail = scn; - tail = &scn->scn_next; - } - } -} - -/* - * Support for SCNRegister calls - */ -isns_simple_t * -isns_create_scn_registration2(isns_client_t *clnt, unsigned int bitmap, isns_source_t *source) -{ - isns_simple_t *call; - - if (!source) - source = clnt->ic_source; - call = isns_simple_create(ISNS_SCN_REGISTER, source, NULL); - if (call) { - isns_attr_list_append_attr(&call->is_message_attrs, - isns_source_attr(source)); - isns_attr_list_append_uint32(&call->is_operating_attrs, - ISNS_TAG_ISCSI_SCN_BITMAP, - bitmap); - } - return call; -} - -isns_simple_t * -isns_create_scn_registration(isns_client_t *clnt, unsigned int bitmap) -{ - return isns_create_scn_registration2(clnt, bitmap, clnt->ic_source); -} - -/* - * Create an SCN - */ -isns_simple_t * -isns_create_scn(isns_source_t *source, isns_attr_t *nodeattr, isns_attr_t *tsattr) -{ - isns_simple_t *call; - - call = isns_simple_create(ISNS_STATE_CHANGE_NOTIFICATION, source, NULL); - if (call && nodeattr) - isns_attr_list_append_attr(&call->is_message_attrs, nodeattr); - if (call && tsattr) - isns_attr_list_append_attr(&call->is_message_attrs, tsattr); - return call; -} - -static void -isns_scn_add_event(isns_simple_t *call, uint32_t scn_bits, - const isns_object_t *obj, - const isns_object_t *dd) -{ - isns_attr_list_t *attrs = &call->is_message_attrs; - - isns_attr_list_append_uint32(attrs, - ISNS_TAG_ISCSI_SCN_BITMAP, - scn_bits); - isns_object_extract_keys(obj, attrs); - if (dd) - isns_object_extract_keys(dd, attrs); -} - -/* - * Process a SCN registration - */ -int -isns_process_scn_register(isns_server_t *srv, isns_simple_t *call, isns_simple_t **result) -{ - isns_attr_list_t *keys = &call->is_message_attrs; - isns_attr_list_t *attrs = &call->is_operating_attrs; - isns_db_t *db = srv->is_db; - isns_attr_t *attr; - isns_object_t *node = NULL; - uint32_t scn_bitmap; - isns_scn_t *scn; - int status = ISNS_SUCCESS; - - /* - * 5.6.5.5 - * The SCNReg request PDU Payload contains a Source Attribute, a Message - * Key Attribute, and an Operating Attribute. Valid Message Key - * Attributes for a SCNReg are shown below: - * - * Valid Message Key Attributes for SCNReg - * --------------------------------------- - * iSCSI Name - * FC Port Name WWPN - */ - if (keys->ial_count != 1 || attrs->ial_count != 1) - return ISNS_SCN_REGISTRATION_REJECTED; - - attr = keys->ial_data[0]; - if (attr->ia_tag_id != ISNS_TAG_ISCSI_NAME && - attr->ia_tag_id != ISNS_TAG_FC_PORT_NAME_WWPN) - return ISNS_SCN_REGISTRATION_REJECTED; - - /* Look up the storage node for this source. If it does - * not exist, reject the message. */ - node = isns_db_lookup(db, NULL, keys); - if (node == NULL) - return ISNS_SOURCE_UNKNOWN; - - /* - * Policy: verify that the client is permitted - * to access this entity. - * - * This includes - * - the client node must be the object owner, - * or a control node. - * - the policy must allow monitoring of - * this object type. - */ - if (!isns_policy_validate_object_access(call->is_policy, - call->is_source, - node, call->is_function)) - goto unauthorized; - - /* - * 5.6.5.5 - * The SCN Bitmap is the only operating attribute of this message - * [...] - * Control Nodes MAY conduct registrations for management SCNs; - * iSNS clients that are not supporting Control Nodes MUST NOT - * conduct registrations for management SCNs. - * - * Implementer's note: for iFCP sources, we should check for - * ISNS_TAG_IFCP_SCN_BITMAP. - */ - attr = attrs->ial_data[0]; - if (attr->ia_tag_id != ISNS_TAG_ISCSI_SCN_BITMAP - || !ISNS_ATTR_IS_UINT32(attr)) - goto rejected; - - scn_bitmap = attr->ia_value.iv_uint32; - if (!isns_policy_validate_scn_bitmap(call->is_policy, scn_bitmap)) - goto unauthorized; - - /* - * 5.6.5.5 - * If no SCN Port fields of any Portals of the Storage Node are - * registered to receive SCN messages, then the SCNReg message SHALL - * be rejected with Status Code 17 (SCN Registration Rejected). - */ - if (!(scn = isns_scn_create_scn(node, scn_bitmap, db))) - goto rejected; - - *result = isns_simple_create(ISNS_SCN_REGISTER, srv->is_source, NULL); - status = ISNS_SUCCESS; - -out: - if (node) - isns_object_release(node); - - return status; - -rejected: - status = ISNS_SCN_REGISTRATION_REJECTED; - goto out; - -unauthorized: - status = ISNS_SOURCE_UNAUTHORIZED; - goto out; -} - -/* - * Process a SCNDereg message - */ -int -isns_process_scn_deregistration(isns_server_t *srv, isns_simple_t *call, isns_simple_t **result) -{ - isns_attr_list_t *keys = &call->is_message_attrs; - isns_db_t *db = srv->is_db; - isns_attr_t *attr; - isns_object_t *node = NULL; - int status = ISNS_SUCCESS; - - /* - * 5.6.5.6 - * The SCNDereg request message PDU Payload contains a Source Attribute - * and Message Key Attribute(s). Valid Message Key Attributes for a - * SCNDereg are shown below: - * - * Valid Message Key Attributes for SCNDereg - * ----------------------------------------- - * iSCSI Name - * FC Port Name WWPN - * - * There are no Operating Attributes in the SCNDereg message. - */ - - if (keys->ial_count != 1) - return ISNS_SCN_REGISTRATION_REJECTED; - - attr = keys->ial_data[0]; - if (attr->ia_tag_id != ISNS_TAG_ISCSI_NAME && - attr->ia_tag_id != ISNS_TAG_FC_PORT_NAME_WWPN) - return ISNS_SCN_REGISTRATION_REJECTED; - - /* Look up the storage node for this source. If it does - * not exist, reject the message. */ - node = isns_db_lookup(db, NULL, keys); - if (node == NULL) - return ISNS_SUCCESS; - - /* - * Policy: verify that the client is permitted - * to access this entity. - * - * This includes - * - the client node must be the object owner, - * or a control node. - * - the policy must allow monitoring of - * this object type. - */ - if (!isns_policy_validate_object_access(call->is_policy, - call->is_source, - node, call->is_function)) - goto unauthorized; - - isns_object_set_scn_mask(node, 0); - isns_scn_delete_scn(node); - - *result = isns_simple_create(ISNS_SCN_DEREGISTER, srv->is_source, NULL); - status = ISNS_SUCCESS; - -out: - if (node) - isns_object_release(node); - - return status; - -unauthorized: - status = ISNS_SOURCE_UNAUTHORIZED; - goto out; -} - -/* - * Set up the SCN object. - */ -static isns_scn_t * -isns_scn_setup(isns_scn_t *scn, isns_object_t *node) -{ - isns_object_list_t portals = ISNS_OBJECT_LIST_INIT; - isns_object_t *entity; - unsigned int i; - - entity = isns_object_get_entity(node); - if (entity == NULL - || !isns_object_find_descendants(entity, - &isns_portal_template, NULL, &portals)) - return NULL; - - for (i = 0; i < portals.iol_count; ++i) { - isns_object_t *portal = portals.iol_data[i]; - isns_portal_info_t info; - isns_scn_funnel_t *funnel; - - /* Extract address and SCN port from portal */ - if (!isns_portal_from_object(&info, - ISNS_TAG_PORTAL_IP_ADDRESS, - ISNS_TAG_SCN_PORT, - portal)) - continue; - - /* We know where to send our notifications! */ - if (scn == NULL) { - isns_attr_t *attr; - - if (!isns_object_get_attr(node, ISNS_TAG_ISCSI_NAME, &attr) - && !isns_object_get_attr(node, ISNS_TAG_FC_PORT_NAME_WWPN, &attr)) { - isns_error("Attempt to set up SCN for strange node type\n"); - return NULL; - } - - scn = isns_calloc(1, sizeof(*scn)); - scn->scn_entity = isns_object_get(entity); - scn->scn_owner = isns_object_get(node); - scn->scn_attr = isns_attr_get(attr); - scn->scn_name = isns_strdup(attr->ia_value.iv_string); - } - - funnel = isns_calloc(1, sizeof(*funnel)); - funnel->scn_portal = info; - funnel->scn_next = scn->scn_funnels; - scn->scn_funnels = funnel; - } - - isns_object_list_destroy(&portals); - return scn; -} - -/* - * See if an SCN object exists for the given target; - * if it doesn't, then create one. - */ -static isns_scn_t * -isns_scn_create_scn(isns_object_t *node, uint32_t bitmap, isns_db_t *db) -{ - isns_scn_t *scn; - - for (scn = isns_scn_list; scn; scn = scn->scn_next) { - if (scn->scn_owner == node) - goto done; - } - - /* Not found - create it */ - scn = isns_scn_setup(NULL, node); - if (scn == NULL) - return NULL; - - scn->scn_next = isns_scn_list; - isns_scn_list = scn; - -done: - /* We're all set - update the bitmap */ - isns_object_set_scn_mask(node, bitmap); - return scn; -} - -static void -isns_scn_delete_scn(isns_object_t *node) -{ - isns_scn_t *scn, **pos; - - pos = &isns_scn_list; - while ((scn = *pos) != NULL) { - if (scn->scn_owner == node) { - isns_debug_scn("Deregistering SCN for node %u\n", - node->ie_index); - *pos = scn->scn_next; - isns_scn_free(scn); - return; - } - pos = &scn->scn_next; - } -} - -static void -isns_scn_release_funnels(isns_scn_t *scn) -{ - isns_scn_funnel_t *funnel; - - while ((funnel = scn->scn_funnels) != NULL) { - scn->scn_funnels = funnel->scn_next; - if (funnel->scn_socket) - isns_socket_free(funnel->scn_socket); - isns_free(funnel); - } -} - -static void -isns_scn_free(isns_scn_t *scn) -{ - isns_scn_release_funnels(scn); - isns_object_release(scn->scn_owner); - isns_object_release(scn->scn_entity); - isns_attr_release(scn->scn_attr); - isns_free(scn->scn_name); - isns_free(scn); -} - -/* - * Check whether we should send an event to the target - */ -static inline int -isns_scn_match(isns_scn_t *scn, uint32_t event, - const isns_object_t *node, - uint32_t node_type) -{ - if (event == 0) - return 0; - - if (node->ie_scn_mask & ISNS_SCN_MANAGEMENT_REGISTRATION_MASK) - return event | ISNS_SCN_MANAGEMENT_REGISTRATION_MASK; - -#if 0 - /* This is a normal (non-control) node. Check whether the object - * is in the scope of this client. */ - if (!isns_object_in_scope(scn->scn_owner, node)) - return 0; -#endif - - if (node->ie_scn_mask & ISNS_SCN_TARGET_AND_SELF_ONLY_MASK) { - if (node != scn->scn_owner && !(node_type & ISNS_ISCSI_TARGET_MASK)) - return 0; - } - if (node->ie_scn_mask & ISNS_SCN_INITIATOR_AND_SELF_ONLY_MASK) { - if (node != scn->scn_owner && !(node_type & ISNS_ISCSI_INITIATOR_MASK)) - return 0; - } - - return event; -} - -/* - * Helper to create time stamp attr - */ -static isns_attr_t * -isns_create_timestamp_attr(void) -{ - isns_value_t value = ISNS_VALUE_INIT(uint64, time(NULL)); - - return isns_attr_alloc(ISNS_TAG_TIMESTAMP, NULL, &value); -} - -/* - * This function is invoked whenever someone changes the - * database. - * - * SCNs are another area where the RFC is fabulously wishy washy. - * It is not entirely clear when DD/DDS information should be - * included in a management SCN - one *reasonable* interpretation - * would be that this happens for DDReg/DDDereg/DDSReg/DDSDereg - * events only. But some sections make it sound as if DD - * information is included for all management SCNs. - */ -void -isns_scn_callback(const isns_db_event_t *ev, void *ptr) -{ - isns_object_t *obj = ev->ie_object; - isns_scn_t *scn, **pos; - isns_attr_t *timestamp; - uint32_t node_type; - - /* Never send out notifications for policy objects and the like. */ - if (obj->ie_flags & ISNS_OBJECT_PRIVATE) - return; - - /* When an entity is nuked, remove all SCNs to nodes - * that registered from there */ - if (ISNS_IS_ENTITY(obj) && (ev->ie_bits & ISNS_SCN_OBJECT_REMOVED_MASK)) { - pos = &isns_scn_list; - while ((scn = *pos) != NULL) { - if (scn->scn_entity != obj) { - pos = &scn->scn_next; - continue; - } - isns_debug_scn("Deleting SCN registration for %s\n", - scn->scn_name); - *pos = scn->scn_next; - isns_scn_free(scn); - } - return; - } - - /* For now we handle iSCSI nodes only. Maybe later we'll - * do iFC nodes as well. */ - if (!ISNS_IS_ISCSI_NODE(obj)) - return; - if (!isns_object_get_uint32(obj, ISNS_TAG_ISCSI_NODE_TYPE, &node_type)) - return; - - if (ev->ie_recipient) { - isns_object_t *dst = ev->ie_recipient; - - isns_debug_scn("SCN unicast <%s %u, %s> -> %s %u\n", - obj->ie_template->iot_name, obj->ie_index, - isns_event_string(ev->ie_bits), - dst->ie_template->iot_name, dst->ie_index); - } else { - isns_debug_scn("SCN multicast <%s %u, %s>\n", - obj->ie_template->iot_name, obj->ie_index, - isns_event_string(ev->ie_bits)); - } - timestamp = isns_create_timestamp_attr(); - - pos = &isns_scn_list; - while ((scn = *pos) != NULL) { - unsigned int scn_bits, management; - isns_object_t *recipient, *dd = NULL; - isns_simple_t *call; - - recipient = scn->scn_owner; - - /* Check if the node has gone away completely. */ - if (recipient->ie_scn_mask == 0) { - *pos = scn->scn_next; - isns_scn_free(scn); - continue; - } - - if (recipient->ie_container == NULL) { - isns_warning("Internal bug - SCN recipient without container\n"); - /* Clear the bitmask and loop over - this will remove it */ - recipient->ie_scn_mask = 0; - continue; - } - - /* See if portals were added/removed. - * This does not catch updates that modified *just* - * the SCN port */ - if (recipient->ie_container->ie_mtime != scn->scn_last_update) { - /* Rebuild the list of SCN portals */ - isns_scn_release_funnels(scn); - scn->scn_last_update = 0; - } - pos = &scn->scn_next; - - /* Check for unicast events (triggered for DD addition/removal). - * For unicast events, we do not mask the SCN bits, so that - * clients who have registered for non-management events - * will see the membership events for their DDs nevertheless. */ - if (ev->ie_recipient == NULL) { - scn_bits = ev->ie_bits & recipient->ie_scn_mask; - if (scn_bits == 0) - continue; - /* Management SCNs should not be delivered to nodes - * that have not registered for them. */ - if ((ev->ie_bits & ISNS_SCN_MANAGEMENT_REGISTRATION_MASK) - && !(recipient->ie_scn_mask & ISNS_SCN_MANAGEMENT_REGISTRATION_MASK)) - continue; - } else if (recipient == ev->ie_recipient) { - scn_bits = ev->ie_bits; - } else { - /* No match, skip this recipient */ - continue; - } - - if (scn->scn_last_update == 0) { - scn->scn_last_update = recipient->ie_container->ie_mtime; - isns_scn_setup(scn, recipient); - } - - /* We check for SCN capable portals when processing - * the SCN registration. But the portals may go away - * in the meantime. */ - if (scn->scn_funnels == NULL) - continue; - - /* Check SCN bitmask. This will modify the event bits. */ - scn_bits = isns_scn_match(scn, scn_bits, obj, node_type); - if (scn_bits == 0) - continue; - management = !!(scn_bits & ISNS_SCN_MANAGEMENT_REGISTRATION_MASK); - - /* - * 2.2.3 - * A regular SCN registration indicates that the - * Discovery Domain Service SHALL be used to control the - * distribution of SCN messages. Receipt of regular - * SCNs is limited to the discovery domains in which - * the SCN-triggering event takes place. Regular SCNs - * do not contain information about discovery domains. - * - * Implementer's note: We override check for unicast events. - * The reason is that DDDereg will sever the - * relationship, and we would never send an SCN for that - * event. - */ - if (!management && !ev->ie_recipient) { - if (!isns_object_test_visibility(obj, recipient)) - continue; - } - - isns_debug_scn("preparing to send SCN to %s\n", - scn->scn_name); - - if ((call = scn->scn_message) == NULL) { - call = isns_create_scn(isns_scn_server->is_source, - scn->scn_attr, - timestamp); - if (call == NULL) - continue; - scn->scn_message = call; - } - - /* - * If the SCN is a Management SCN, then the SCN message - * SHALL also list the DD_ID and/or DDS_ID of the - * Discovery Domains and Discovery Domain Sets (if any) - * that caused the change in state for that Storage Node. - * These additional attributes (i.e., DD_ID and/or DDS_ID) - * shall immediately follow the iSCSI Name or FC Port - * Name and precede the next SCN bitmap for the next - * notification message (if any). - */ - if (management && ev->ie_trigger) - dd = ev->ie_trigger; - - isns_scn_add_event(call, scn_bits, obj, dd); - - } - - isns_attr_release(timestamp); -} - -/* - * Obtain a socket to talk to this guy. - * Not entirely trivial - this can be both an established - * (incoming) connection, or one that we should establish. - * - * Note, we do not support transmission on the incoming - * connection yet. - */ -static isns_socket_t * -isns_scn_get_socket(isns_scn_t *scn) -{ - isns_scn_funnel_t *f, *best = NULL; - isns_socket_t *sock; - unsigned int worst = 0, loops = 0, nfunnels; - - /* Keep it simple for now */ - if ((f = scn->scn_current_funnel) != NULL && f->scn_socket) { - if (!f->scn_bad) - return f->scn_socket; - /* Oops, we've seen timeouts on this socket. */ - isns_socket_free(f->scn_socket); - f->scn_socket = NULL; - } - -again: - nfunnels = 0; - for (f = scn->scn_funnels; f; f = f->scn_next) { - unsigned int badness = f->scn_bad; - - if (!best || badness < best->scn_bad) - best = f; - if (badness > worst) - worst = badness; - nfunnels++; - } - - if (!best) - return NULL; - - sock = isns_connect_to_portal(&best->scn_portal); - if (sock == NULL) { - /* Make sure we try each funnel exactly once */ - best->scn_bad = worst + 1; - if (++loops < nfunnels) - goto again; - return NULL; - } - - /* Set the security context */ - isns_socket_set_security_ctx(sock, - isns_default_security_context(1)); - - isns_debug_scn("SCN: %s using portal %s\n", - scn->scn_name, - isns_portal_string(&best->scn_portal)); - scn->scn_current_funnel = best; - best->scn_socket = sock; - return sock; -} - -/* - * This is the callback function invoked when the SCN message reply - * comes in, or when the message timed out. - */ -static void -isns_process_scn_response(uint32_t xid, int status, isns_simple_t *msg) -{ - isns_scn_t *scn; - - if (msg == NULL) { - isns_debug_scn("SCN timed out\n"); - return; - } - - isns_debug_scn("Received an SCN response\n"); - for (scn = isns_scn_list; scn; scn = scn->scn_next) { - if (scn->scn_pending && scn->scn_xid == xid) { - isns_debug_scn("SCN: %s acknowledged notification\n", - scn->scn_name); - isns_simple_free(scn->scn_pending); - scn->scn_pending = NULL; - - if (scn->scn_current_funnel) - scn->scn_current_funnel->scn_bad = 0; - } - } -} -/* - * Transmit all pending SCN messages - * - * 2.9.2 - * If a Network Entity has multiple Portals with registered SCN UDP Ports, - * then SCN messages SHALL be delivered to each Portal registered to - * receive such messages. - * - * FIXME: we should make this timer based just as the ESI code. - */ -time_t -isns_scn_transmit_all(void) -{ - time_t now = time(NULL), next_timeout; - isns_scn_t *scn; - - for (scn = isns_scn_list; scn; scn = scn->scn_next) { - isns_simple_t *call; - isns_socket_t *sock; - - /* We do not allow more than one outstanding - * notification for now. */ - if ((call = scn->scn_pending) != NULL) { - if (scn->scn_timeout > now) - continue; - scn->scn_current_funnel->scn_bad++; - if (--(scn->scn_retries)) - goto retry; - isns_warning("SCN for %s timed out\n", - scn->scn_name); - isns_simple_free(call); - scn->scn_pending = NULL; - } - - if ((call = scn->scn_message) == NULL) - continue; - - isns_debug_scn("SCN: transmit pending message for %s\n", - scn->scn_name); - scn->scn_retries = isns_config.ic_scn_retries; - scn->scn_pending = call; - scn->scn_message = NULL; - -retry: - if ((sock = isns_scn_get_socket(scn)) == NULL) { - /* Sorry, no can do. */ - isns_warning("SCN for %s dropped - no portal\n", - scn->scn_name); - scn->scn_pending = NULL; - isns_simple_free(call); - continue; - } - - isns_simple_transmit(sock, call, NULL, - isns_config.ic_scn_timeout, - isns_process_scn_response); - scn->scn_xid = call->is_xid; - scn->scn_timeout = now + isns_config.ic_scn_timeout; - } - - next_timeout = now + 3600; - for (scn = isns_scn_list; scn; scn = scn->scn_next) { - if (scn->scn_pending && scn->scn_timeout < next_timeout) - next_timeout = scn->scn_timeout; - } - - return next_timeout; -} - -/* - * Process an incoming State Change Notification - */ -int -isns_process_scn(isns_server_t *srv, isns_simple_t *call, isns_simple_t **reply) -{ - isns_attr_list_t *list = &call->is_message_attrs; - isns_attr_t *dstattr, *tsattr; - const char *dst_name; - unsigned int i; - - /* The first attribute is the destination, and should match - * our source name. Don't bother checking. The second is the - * time stamp. - */ - if (list->ial_count < 2) - goto rejected; - - dstattr = list->ial_data[0]; - if (dstattr->ia_tag_id != ISNS_TAG_ISCSI_NAME - && dstattr->ia_tag_id != ISNS_TAG_FC_PORT_NAME_WWPN) - goto rejected; - if (!ISNS_ATTR_IS_STRING(dstattr)) - goto rejected; - dst_name = dstattr->ia_value.iv_string; - - tsattr = list->ial_data[1]; - if (tsattr->ia_tag_id != ISNS_TAG_TIMESTAMP) - return ISNS_SCN_EVENT_REJECTED; - - for (i = 2; i < list->ial_count; ) { - isns_object_template_t *tmpl; - isns_attr_t *bmattr, *srcattr; - const char *node_name; - uint32_t bitmap; - - if (i + 1 >= list->ial_count) - goto rejected; - - bmattr = list->ial_data[i++]; - srcattr = list->ial_data[i++]; - - /* Validate that bitmap and node type match */ - switch (bmattr->ia_tag_id) { - case ISNS_TAG_ISCSI_SCN_BITMAP: - if (srcattr->ia_tag_id != ISNS_TAG_ISCSI_NAME) - goto rejected; - tmpl = &isns_iscsi_node_template; - break; - - case ISNS_TAG_IFCP_SCN_BITMAP: - if (srcattr->ia_tag_id != ISNS_TAG_FC_PORT_NAME_WWPN) - goto rejected; - tmpl = &isns_fc_port_template; - break; - - default: - goto rejected; - } - - /* Skip over and DD_ID or DDS_ID attrs */ - while (i < list->ial_count) { - isns_attr_t *ddattr = list->ial_data[i]; - - if (ddattr->ia_tag_id == ISNS_TAG_ISCSI_SCN_BITMAP - || ddattr->ia_tag_id == ISNS_TAG_IFCP_SCN_BITMAP) - break; - ++i; - } - - if (!ISNS_ATTR_IS_UINT32(bmattr)) - goto rejected; - bitmap = bmattr->ia_value.iv_uint32; - - if (!ISNS_ATTR_IS_STRING(srcattr)) - goto rejected; - node_name = srcattr->ia_value.iv_string; - - if (srv->is_scn_callback) - srv->is_scn_callback(srv->is_db, bitmap, tmpl, node_name, dst_name); - } - - /* - * 5.7.5.8. SCN Response (SCNRsp) - * The SCNRsp response contains the SCN Destination Attribute - * representing the Node identifier that received the SCN. - */ - *reply = isns_create_scn(srv->is_source, - list->ial_data[0], - NULL); - return ISNS_SUCCESS; - -rejected: - return ISNS_SCN_EVENT_REJECTED; -} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/scope.c open-iscsi-2.0.874/utils/open-isns/scope.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/scope.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/scope.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,513 +0,0 @@ -/* - * Handle object visibility and scope. - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include -#include -#include "isns.h" -#include "attrs.h" -#include "objects.h" -#include "message.h" -#include "security.h" -#include "util.h" -#include "db.h" - -struct isns_scope { - isns_db_t * ic_db; - unsigned int ic_users; - isns_object_t * ic_source_node; - - isns_object_template_t * ic_query_class; - - isns_object_list_t ic_dd_nodes; - isns_object_list_t ic_dd_portals; - isns_object_list_t ic_objects; -}; - -static int __isns_scope_collect_dd(uint32_t, void *); - -/* - * Allocate an empty scope - */ -isns_scope_t * -isns_scope_alloc(isns_db_t *db) -{ - isns_scope_t *scope; - - scope = isns_calloc(1, sizeof(*scope)); - - scope->ic_db = db; - scope->ic_users = 1; - return scope; -} - -isns_scope_t * -isns_scope_get(isns_scope_t *scope) -{ - if (scope) { - isns_assert(scope->ic_users); - scope->ic_users++; - } - return scope; -} - -void -isns_scope_release(isns_scope_t *scope) -{ - if (!scope) - return; - - isns_assert(scope->ic_users); - if (--(scope->ic_users)) - return; - - isns_object_release(scope->ic_source_node); - isns_object_list_destroy(&scope->ic_dd_nodes); - isns_object_list_destroy(&scope->ic_dd_portals); - isns_object_list_destroy(&scope->ic_objects); - isns_free(scope); -} - -/* - * Get the scope for this operation - */ -isns_scope_t * -isns_scope_for_call(isns_db_t *db, const isns_simple_t *call) -{ - isns_source_t *source = call->is_source; - isns_object_t *node; - isns_scope_t *scope; - uint32_t node_type; - - /* FIXME use source->is_node and source->is_node_type */ - - /* When we get here, we already know that the client - * represents the specified source node. */ - node = isns_db_lookup_source_node(db, source); - - /* Allow unknown nodes to query the DB */ - if (node == NULL) { - node = isns_create_storage_node2(source, 0, NULL); - if (node == NULL) - return NULL; - source->is_untrusted = 1; - } - - if (isns_object_get_uint32(node, ISNS_TAG_ISCSI_NODE_TYPE, &node_type) - && (node_type & ISNS_ISCSI_CONTROL_MASK)) { - isns_object_release(node); - return isns_scope_get(db->id_global_scope); - } - - scope = isns_scope_alloc(db); - scope->ic_source_node = node; - - { - isns_object_list_t members = ISNS_OBJECT_LIST_INIT; - unsigned int i; - - isns_object_get_visible(node, db, &members); - isns_object_list_uniq(&members); - - /* If the node is not a member of any DD, allow it - * to at least talk to itself. */ - if (members.iol_count == 0) - isns_object_list_append(&members, node); - - /* Sort DD members into nodes and portals */ - for (i = 0; i < members.iol_count; ++i) { - isns_object_t *obj = members.iol_data[i]; - - if (obj->ie_state != ISNS_OBJECT_STATE_MATURE) - continue; - if (!isns_policy_validate_object_access(call->is_policy, - source, obj, - call->is_function)) - continue; - if (ISNS_IS_ISCSI_NODE(obj)) - isns_object_list_append(&scope->ic_dd_nodes, obj); - else - if (ISNS_IS_PORTAL(obj)) - isns_object_list_append(&scope->ic_dd_portals, obj); - } - isns_object_list_destroy(&members); - } - - return scope; -} - -/* - * Add an object to a scope - */ -void -isns_scope_add(isns_scope_t *scope, isns_object_t *obj) -{ - isns_object_list_append(&scope->ic_objects, obj); -} - -int -isns_scope_remove(isns_scope_t *scope, isns_object_t *obj) -{ - return isns_object_list_remove(&scope->ic_objects, obj); -} - -/* - * Get all objects related through a portal group, optionally - * including the portal group objects themselves - */ -static void -__isns_scope_get_pg_related(isns_scope_t *scope, - const isns_object_t *obj, - isns_object_list_t *result) -{ - isns_object_list_t temp = ISNS_OBJECT_LIST_INIT; - unsigned int i; - - /* Get all portal groups related to this object */ - isns_db_get_relationship_objects(scope->ic_db, - obj, ISNS_RELATION_PORTAL_GROUP, &temp); - - /* Include all portals/nodes that we can reach. */ - for (i = 0; i < temp.iol_count; ++i) { - isns_object_t *pg, *other; - uint32_t pgt; - - pg = temp.iol_data[i]; - - /* Skip any portal group objects with a PG tag of 0; - * these actually deny access. */ - if (!isns_object_get_uint32(pg, ISNS_TAG_PG_TAG, &pgt) - || pgt == 0) - continue; - - /* Get the other object. - * Note that isns_relation_get_other doesn't - * bump the reference count, so there's no need - * to call isns_object_release(other). */ - other = isns_relation_get_other(pg->ie_relation, obj); - if (other->ie_state != ISNS_OBJECT_STATE_MATURE) - continue; - - isns_object_list_append(result, other); - isns_object_list_append(result, pg); - } - - isns_object_list_destroy(&temp); -} - -/* - * Get all portals related to the given node. - * - * 2.2.2 - * Placing Portals of a Network Entity into Discovery Domains allows - * administrators to indicate the preferred IP Portal interface through - * which storage traffic should access specific Storage Nodes of that - * Network Entity. If no Portals of a Network Entity have been placed - * into a DD, then queries scoped to that DD SHALL report all Portals of - * that Network Entity. If one or more Portals of a Network Entity have - * been placed into a DD, then queries scoped to that DD SHALL report - * only those Portals that have been explicitly placed in the DD. - */ -static void -__isns_scope_get_portals(isns_scope_t *scope, - const isns_object_t *node, - isns_object_list_t *portals, - isns_object_list_t *pgs, - int unique) -{ - isns_object_list_t related = ISNS_OBJECT_LIST_INIT; - unsigned int i, specific = 0; - - /* Get all portals and portal groups related to the - * given node. This will put pairs of (portal, portal-group) - * on the list. - */ - __isns_scope_get_pg_related(scope, node, &related); - - /* If we're querying for our own portals, don't limit - * visibility. */ - if (node == scope->ic_source_node) - goto report_all_portals; - - /* Check if any of the portals is mentioned in the DD - * FIXME: There is some ambiguity over what the right - * answer is when you have two nodes (initiator, target), - * and two discovery domains linking the two. One - * DD mentions a specific portal through which target - * should be accessed; the other DD does not (allowing - * use of any portal in that entity). Which portals - * to return here? - * We go for the strict interpretation, ie if *any* DD - * restricts access to certain portals, we report only - * those. - */ - for (i = 0; i < related.iol_count; i += 2) { - isns_object_t *portal = related.iol_data[i]; - - if (isns_object_list_contains(&scope->ic_dd_portals, portal)) { - if (portals - && !(unique || isns_object_list_contains(portals, portal))) - isns_object_list_append(portals, portal); - if (pgs) - isns_object_list_append(pgs, - related.iol_data[i + 1]); - specific++; - } - } - - if (specific) - goto out; - -report_all_portals: - /* No specific portal given for this node. Add them all. */ - for (i = 0; i < related.iol_count; i += 2) { - isns_object_t *portal = related.iol_data[i]; - - if (portals - && !(unique && isns_object_list_contains(portals, portal))) - isns_object_list_append(portals, portal); - if (pgs) - isns_object_list_append(pgs, - related.iol_data[i + 1]); - } - -out: - isns_object_list_destroy(&related); -} - -/* - * Get all nodes reachable through a given portal - * This is really the same as __isns_scope_get_portals - * minus the special casing for preferred portals. - * Still, let's put this into it's own function - the whole - * thing is already complex enough already. - */ -static void -__isns_scope_get_nodes(isns_scope_t *scope, - const isns_object_t *portal, - isns_object_list_t *nodes, - isns_object_list_t *pgs, - int unique) -{ - isns_object_list_t related = ISNS_OBJECT_LIST_INIT; - unsigned int i; - - /* Get all nodes and portal groups related to the - * given node. This will put pairs of (nodes, portal-group) - * on the list. - */ - __isns_scope_get_pg_related(scope, portal, &related); - - for (i = 0; i < related.iol_count; i += 2) { - isns_object_t *node = related.iol_data[i]; - - if (nodes - && !(unique && isns_object_list_contains(nodes, node))) - isns_object_list_append(nodes, node); - if (pgs) - isns_object_list_append(pgs, - related.iol_data[i + 1]); - } - - isns_object_list_destroy(&related); -} - -static void -__isns_scope_get_default_dd(isns_scope_t *scope) -{ - isns_object_t *obj; - - if (isns_config.ic_use_default_domain) { - obj = isns_create_default_domain(); - isns_object_list_append(&scope->ic_objects, obj); - isns_object_release(obj); - } -} - - -/* - * Scope the query - */ -static void -__isns_scope_prepare_query(isns_scope_t *scope, - isns_object_template_t *tmpl) -{ - isns_object_list_t *nodes; - unsigned int i; - - /* Global and default scope have no source node; they're just - * a list of objects. - */ - if (scope->ic_source_node == NULL) - return; - - if (scope->ic_query_class) { - if (scope->ic_query_class == tmpl) - return; - isns_object_list_destroy(&scope->ic_objects); - } - scope->ic_query_class = tmpl; - - nodes = &scope->ic_dd_nodes; - if (tmpl == &isns_entity_template) { - for (i = 0; i < nodes->iol_count; ++i) { - isns_object_t *obj = nodes->iol_data[i]; - - if (obj->ie_container) - isns_object_list_append(&scope->ic_objects, - obj->ie_container); - } - } else - if (tmpl == &isns_iscsi_node_template) { - for (i = 0; i < nodes->iol_count; ++i) { - isns_object_t *obj = nodes->iol_data[i]; - - isns_object_list_append(&scope->ic_objects, obj); - } - } else - if (tmpl == &isns_portal_template) { - for (i = 0; i < nodes->iol_count; ++i) { - isns_object_t *obj = nodes->iol_data[i]; - - __isns_scope_get_portals(scope, obj, - &scope->ic_objects, NULL, 0); - } - } else - if (tmpl == &isns_iscsi_pg_template) { - for (i = 0; i < nodes->iol_count; ++i) { - isns_object_t *obj = nodes->iol_data[i]; - - __isns_scope_get_portals(scope, obj, - NULL, &scope->ic_objects, 0); - } - } else - if (tmpl == &isns_dd_template) { - isns_object_t *node = scope->ic_source_node; - - if (node && !isns_bitvector_is_empty(node->ie_membership)) - isns_bitvector_foreach(node->ie_membership, - __isns_scope_collect_dd, - scope); - else - __isns_scope_get_default_dd(scope); - } - - isns_object_list_uniq(&scope->ic_objects); -} - -static int -__isns_scope_collect_dd(uint32_t dd_id, void *ptr) -{ - isns_scope_t *scope = ptr; - isns_object_t *dd; - - dd = isns_db_vlookup(scope->ic_db, &isns_dd_template, - ISNS_TAG_DD_ID, dd_id, - 0); - if (dd) { - isns_object_list_append(&scope->ic_objects, dd); - isns_object_release(dd); - } - - return 0; -} - -/* - * Lookup functions for scope - */ -int -isns_scope_gang_lookup(isns_scope_t *scope, - isns_object_template_t *tmpl, - const isns_attr_list_t *match, - isns_object_list_t *result) -{ - isns_assert(tmpl); - - if (!scope) - return 0; - - __isns_scope_prepare_query(scope, tmpl); - return isns_object_list_gang_lookup(&scope->ic_objects, - tmpl, match, result); -} - -/* - * Get related objects. - * This is used by the query code. - */ -void -isns_scope_get_related(isns_scope_t *scope, - const isns_object_t *origin, - unsigned int type_mask, - isns_object_list_t *result) -{ - isns_object_template_t *tmpl = origin->ie_template; - isns_object_list_t nodes_result = ISNS_OBJECT_LIST_INIT; - isns_object_list_t portals_result = ISNS_OBJECT_LIST_INIT; - isns_object_list_t *members = &scope->ic_dd_nodes; - unsigned int i; - - if (tmpl == &isns_entity_template) { - /* Entity: include all storage nodes contained, - * the portals through which to reach them, and - * the portal groups for those. */ - for (i = 0; i < members->iol_count; ++i) { - isns_object_t *obj = members->iol_data[i]; - - if (obj->ie_container != origin) - continue; - - isns_object_list_append(&nodes_result, obj); - __isns_scope_get_portals(scope, obj, - &portals_result, - &portals_result, 1); - } - } else - if (tmpl == &isns_iscsi_node_template) { - /* Storage node: include all portals through - * which it can be reached, and the portal - * groups for those. */ - __isns_scope_get_portals(scope, origin, - &portals_result, - &portals_result, 1); - /* FIXME: Include all discovery domains the - * node is a member of. */ - } else - if (tmpl == &isns_portal_template) { - /* Portal: include all storage nodes which can - * be reached through it, and the portal groups - * for those. */ - __isns_scope_get_nodes(scope, origin, - &portals_result, - &portals_result, 1); - } else - if (tmpl == &isns_iscsi_pg_template) { - /* Portal group: PGs *are* a relationship, but - * unclear how this should be handled. - * Return nothing for now. */ - } else - if (tmpl == &isns_dd_template) { - /* Discovery domain: no related objects. */ - } - - isns_object_list_append_list(result, &nodes_result); - isns_object_list_append_list(result, &portals_result); - - isns_object_list_destroy(&nodes_result); - isns_object_list_destroy(&portals_result); -} - -isns_object_t * -isns_scope_get_next(isns_scope_t *scope, - isns_object_template_t *tmpl, - const isns_attr_list_t *current, - const isns_attr_list_t *match) -{ - if (!tmpl || !scope) - return NULL; - - __isns_scope_prepare_query(scope, tmpl); - return __isns_db_get_next(&scope->ic_objects, tmpl, current, match); -} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/security.c open-iscsi-2.0.874/utils/open-isns/security.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/security.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/security.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,437 +0,0 @@ -/* - * Security functions for iSNS - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include -#include -#include -#include "isns.h" -#include "security.h" -#include "source.h" -#include "util.h" -#include "config.h" - -#ifdef WITH_SECURITY - -/* - * Allocate a security peer - */ -static isns_principal_t * -isns_create_principal(const char *spi, size_t spi_len, EVP_PKEY *pk) -{ - char keydesc[32]; - isns_principal_t *peer; - - peer = isns_calloc(1, sizeof(*peer)); - peer->is_users = 1; - if (spi) { - peer->is_name = isns_malloc(spi_len + 1); - memcpy(peer->is_name, spi, spi_len); - peer->is_name[spi_len] = '\0'; - peer->is_namelen = spi_len; - } - - peer->is_key = pk; - if (pk) { - const char *algo; - - switch (pk->type) { - case EVP_PKEY_DSA: algo = "DSA"; break; - case EVP_PKEY_RSA: algo = "RSA"; break; - default: algo = "unknown"; break; - } - - snprintf(keydesc, sizeof(keydesc), " (%s/%u)", - algo, EVP_PKEY_bits(pk)); - } - - isns_debug_auth("Created security principal \"%s\"%s\n", - peer->is_name, keydesc); - return peer; -} - -static void -isns_principal_set_key(isns_principal_t *princ, EVP_PKEY *key) -{ - if (princ->is_key == key) - return; - if (princ->is_key) - EVP_PKEY_free(princ->is_key); - princ->is_key = key; -} - -void -isns_principal_free(isns_principal_t *peer) -{ - if (!peer) - return; - - isns_assert(peer->is_users); - if (--(peer->is_users)) - return; - - if (peer->is_name) - isns_free(peer->is_name); - if (peer->is_key) - EVP_PKEY_free(peer->is_key); - isns_policy_release(peer->is_policy); - isns_free(peer); -} - -/* - * Set the principal's name - */ -void -isns_principal_set_name(isns_principal_t *princ, const char *spi) -{ - isns_assign_string(&princ->is_name, spi); - isns_debug_auth("Setting principal name to \"%s\"\n", spi); -} - -const char * -isns_principal_name(const isns_principal_t *princ) -{ - return princ->is_name; -} - -/* - * Cache policy in the principal object. - */ -void -isns_principal_set_policy(isns_principal_t *princ, - isns_policy_t *policy) -{ - if (policy) - policy->ip_users++; - isns_policy_release(princ->is_policy); - princ->is_policy = policy; -} - -/* - * Key management functions for a security context. - */ -isns_principal_t * -isns_security_load_privkey(isns_security_t *ctx, const char *filename) -{ - EVP_PKEY *pkey; - - isns_debug_auth("Loading private %s key from %s\n", - ctx->is_name, filename); - if (!ctx->is_load_private) - return NULL; - if (!(pkey = ctx->is_load_private(ctx, filename))) { - isns_error("Unable to load private %s key from %s\n", - ctx->is_name, filename); - return NULL; - } - - return isns_create_principal(NULL, 0, pkey); -} - -isns_principal_t * -isns_security_load_pubkey(isns_security_t *ctx, const char *filename) -{ - EVP_PKEY *pkey; - - isns_debug_auth("Loading public %s key from %s\n", - ctx->is_name, filename); - if (!ctx->is_load_public) - return NULL; - if (!(pkey = ctx->is_load_public(ctx, filename))) { - isns_error("Unable to load public %s key from %s\n", - ctx->is_name, filename); - return NULL; - } - - return isns_create_principal(NULL, 0, pkey); -} - -void -isns_security_set_identity(isns_security_t *ctx, isns_principal_t *princ) -{ - if (princ) - princ->is_users++; - if (ctx->is_self) - isns_principal_free(ctx->is_self); - ctx->is_self = princ; -} - -void -isns_add_principal(isns_security_t *ctx, isns_principal_t *princ) -{ - if (princ) - princ->is_users++; - princ->is_next = ctx->is_peers; - ctx->is_peers = princ; -} - -isns_principal_t * -isns_get_principal(isns_security_t *ctx, const char *spi, size_t spi_len) -{ - isns_principal_t *princ; - isns_policy_t *policy; - isns_keystore_t *ks; - EVP_PKEY *pk; - - ks = ctx->is_peer_keys; - - for (princ = ctx->is_peers; princ; princ = princ->is_next) { - /* In a client socket, we set the (expected) - * public key of the peer through - * isns_security_set_peer_key, which will - * just put it on the peers list. - * This key usually has no name. - */ - if (princ->is_name == NULL) { - princ->is_users++; - return princ; - } - if (spi_len == princ->is_namelen - && !memcmp(princ->is_name, spi, spi_len)) { - /* Check whether the cached key and policy - * might be stale. */ - if (ks && ks->ic_generation != princ->is_generation) { - pk = ks->ic_find(ks, spi, spi_len); - if (pk == NULL) { - isns_debug_auth("Unable to refresh key " - "for principal %.*s - probably deleted\n", - spi_len, spi); - return NULL; - } - isns_debug_auth("Refresh key for principal %.*s\n", - spi_len, spi); - isns_principal_set_key(princ, pk); - princ->is_users++; - goto refresh_policy; - } - princ->is_users++; - return princ; - } - } - - if ((ks = ctx->is_peer_keys) == NULL) - return NULL; - - if (!(pk = ks->ic_find(ks, spi, spi_len))) - return NULL; - princ = isns_create_principal(spi, spi_len, pk); - - /* Add it to the list */ - princ->is_next = ctx->is_peers; - ctx->is_peers = princ; - princ->is_users++; - - /* Bind the policy for this peer */ -refresh_policy: - if (!ks->ic_get_policy - || !(policy = ks->ic_get_policy(ks, spi, spi_len))) - policy = isns_policy_default(spi, spi_len); - - /* If no entity is set, use the SPI */ - if (policy->ip_entity == NULL) - isns_assign_string(&policy->ip_entity, policy->ip_name); - - /* If the list of permitted node names is empty, - * default to the standard pattern derived from - * the reversed entity name */ - if (policy->ip_node_names.count == 0) { - char *pattern; - - pattern = isns_build_source_pattern(policy->ip_entity); - if (pattern != NULL) - isns_string_array_append(&policy->ip_node_names, - pattern); - isns_free(pattern); - } - - isns_principal_set_policy(princ, policy); - isns_policy_release(policy); - - /* Remember the keystore generation number */ - princ->is_generation = ks->ic_generation; - - return princ; -} - -/* - * Create a keystore for a security context. - * Key stores let the server side retrieve the - * keys associated with a given SPI. - * - * For now, we support just simple key stores, - * but this could be extended to support - * URLs such as ldaps://ldap.example.com - */ -isns_keystore_t * -isns_create_keystore(const char *spec) -{ - if (*spec != '/') - return NULL; - - return isns_create_simple_keystore(spec); -} - -/* - * Attach the keystore to the security context - */ -void -isns_security_set_keystore(isns_security_t *ctx, - isns_keystore_t *ks) -{ - ctx->is_peer_keys = ks; -} - -/* - * Check that the client supplied time stamp is within a - * certain window. - */ -static int -isns_security_check_timestamp(isns_security_t *ctx, - isns_principal_t *peer, - uint64_t timestamp) -{ - int64_t delta; - - /* The time stamp must not be earlier than timestamp_jitter - * before the last message received. */ - if (peer->is_timestamp) { - delta = timestamp - peer->is_timestamp; - if (delta < -(int64_t) ctx->is_timestamp_jitter) - return 0; - } - - /* We allow the client's clock to diverge from ours, within - * certain limits. */ - if (ctx->is_replay_window != 0) { - time_t now = time(NULL); - - delta = timestamp - now; - if (delta < 0) - delta = -delta; - if (delta > ctx->is_replay_window) - return 0; - } - - peer->is_timestamp = timestamp; - return 1; -} - -int -isns_security_sign(isns_security_t *ctx, isns_principal_t *peer, - buf_t *bp, struct isns_authblk *auth) -{ - if (!ctx->is_sign) { - isns_debug_auth("isns_security_sign: auth context without " - "sign handler.\n"); - return 0; - } - if (!ctx->is_sign(ctx, peer, bp, auth)) { - isns_debug_auth("Failed to sign message, spi=%s\n", - peer->is_name); - return 0; - } - - return 1; -} - -int -isns_security_verify(isns_security_t *ctx, isns_principal_t *peer, - buf_t *bp, struct isns_authblk *auth) -{ - if (!isns_security_check_timestamp(ctx, peer, auth->iab_timestamp)) { - isns_debug_auth("Possible replay attack (bad timestamp) " - "from spi=%s\n", peer->is_name); - return 0; - } - - if (!ctx->is_verify) { - isns_debug_auth("isns_security_verify: auth context without " - "verify handler.\n"); - return 0; - } - if (!ctx->is_verify(ctx, peer, bp, auth)) { - isns_debug_auth("Failed to authenticate message, spi=%s\n", - peer->is_name); - return 0; - } - - return 1; -} - -/* - * Initialize security services. - */ -int -isns_security_init(void) -{ - if (!isns_config.ic_dsa.param_file) { - isns_error("No DSA parameter file - please edit configuration\n"); - return 0; - } - - if (!isns_dsa_init_params(isns_config.ic_dsa.param_file)) - return 0; - - if (!isns_config.ic_auth_key_file) { - isns_error("No AuthKey specified; please edit configuration\n"); - return 0; - } - - if (!isns_dsa_init_key(isns_config.ic_auth_key_file)) - return 0; - - return 1; -} - -#else /* WITH_SECURITY */ - -static void -isns_no_security(void) -{ - static int complain = 0; - - if (complain++ < 5) - isns_error("iSNS authentication disabled in this build\n"); -} - -int -isns_security_init(void) -{ - isns_no_security(); - return 0; -} - -isns_keystore_t * -isns_create_keystore(const char *spec) -{ - isns_no_security(); - return NULL; -} - -void -isns_security_set_keystore(isns_security_t *ctx, - isns_keystore_t *ks) -{ - isns_no_security(); -} - -void -isns_principal_free(isns_principal_t *peer) -{ -} - -isns_principal_t * -isns_get_principal(isns_security_t *ctx, const char *spi, size_t spi_len) -{ - return NULL; -} - -const char * -isns_principal_name(const isns_principal_t *princ) -{ - return NULL; -} - -#endif /* WITH_SECURITY */ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/security.h open-iscsi-2.0.874/utils/open-isns/security.h --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/security.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/security.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,185 +0,0 @@ -/* - * Security functions for iSNS - * - * Copyright (C) 2007 Olaf Kirch - */ - -#ifndef ISNS_SECURITY_H -#define ISNS_SECURITY_H -#include "buffer.h" -#include "util.h" - - -#ifdef WITH_SECURITY -#include -#else -#define EVP_PKEY void -#endif - -/* - * Security context - */ -struct isns_security { - const char * is_name; - unsigned int is_type; - unsigned int is_replay_window; - unsigned int is_timestamp_jitter; - - /* Our own key and identity */ - isns_principal_t * is_self; - - /* Key store for peer keys */ - isns_principal_t * is_peers; - isns_keystore_t * is_peer_keys; - - EVP_PKEY * (*is_load_private)(isns_security_t *ctx, - const char *filename); - EVP_PKEY * (*is_load_public)(isns_security_t *ctx, - const char *filename); - int (*is_verify)(isns_security_t *ctx, - isns_principal_t *peer, - buf_t *pdu, - const struct isns_authblk *); - int (*is_sign)(isns_security_t *ctx, - isns_principal_t *peer, - buf_t *pdu, - struct isns_authblk *); -}; - -struct isns_principal { - unsigned int is_users; - isns_principal_t * is_next; - char * is_name; - unsigned int is_namelen; - EVP_PKEY * is_key; - unsigned int is_generation; - uint64_t is_timestamp; - - isns_policy_t * is_policy; -}; - -struct isns_policy { - unsigned int ip_users; - unsigned int ip_gen; - - /* SPI */ - char * ip_name; - - /* The client's entity name. This is usually - * the FQDN. */ - char * ip_entity; - - /* Bitmap of functions the client is - * permitted to call. */ - unsigned int ip_functions; - - /* Bitmap of object types the client is - * permitted to register (uses iot_handle) */ - unsigned int ip_object_types; - - /* Names of storage nodes the client is permitted - * to register. */ - struct string_array ip_node_names; - - /* Storage node types the client is permitted - * to read or modify. */ - unsigned int ip_node_types; - - /* The client's default Discovery Domain */ - char * ip_dd_default; -}; - -#define ISNS_PERMISSION_READ 0x01 -#define ISNS_PERMISSION_WRITE 0x02 -#define ISNS_ACCESS(t, p) ((p) << (2 * (t))) -#define ISNS_ACCESS_W(t) ISNS_ACCESS(t, ISNS_PERMISSION_WRITE) -#define ISNS_ACCESS_R(t) ISNS_ACCESS(t, ISNS_PERMISSION_READ) -#define ISNS_ACCESS_RW(t) ISNS_ACCESS(t, ISNS_PERMISSION_READ|ISNS_PERMISSION_WRITE) - -#define ISNS_DEFAULT_OBJECT_ACCESS \ - ISNS_ACCESS_RW(ISNS_OBJECT_TYPE_ENTITY) | \ - ISNS_ACCESS_RW(ISNS_OBJECT_TYPE_NODE) | \ - ISNS_ACCESS_RW(ISNS_OBJECT_TYPE_FC_PORT) | \ - ISNS_ACCESS_RW(ISNS_OBJECT_TYPE_FC_NODE) | \ - ISNS_ACCESS_RW(ISNS_OBJECT_TYPE_PORTAL) | \ - ISNS_ACCESS_RW(ISNS_OBJECT_TYPE_PG) | \ - ISNS_ACCESS_R(ISNS_OBJECT_TYPE_DD) - -struct isns_keystore { - char * ic_name; - unsigned int ic_generation; - EVP_PKEY * (*ic_find)(isns_keystore_t *, - const char *, size_t); - isns_policy_t * (*ic_get_policy)(isns_keystore_t *, - const char *, size_t); -}; - -extern isns_principal_t * isns_get_principal(isns_security_t *, - const char *, size_t); -extern int isns_security_sign(isns_security_t *, - isns_principal_t *, buf_t *, - struct isns_authblk *); -extern int isns_security_verify(isns_security_t *, - isns_principal_t *, buf_t *, - struct isns_authblk *); -extern int isns_security_protected_entity(isns_security_t *, - const char *); - -extern isns_keystore_t * isns_create_keystore(const char *); -extern isns_keystore_t * isns_create_simple_keystore(const char *); -extern isns_keystore_t * isns_create_db_keystore(isns_db_t *); - -extern int isns_authblock_encode(buf_t *, - const struct isns_authblk *); -extern int isns_authblock_decode(buf_t *, - struct isns_authblk *); - -extern isns_policy_t * __isns_policy_alloc(const char *, size_t); -extern isns_policy_t * isns_policy_bind(const isns_message_t *); -extern void isns_principal_set_policy(isns_principal_t *, - isns_policy_t *); -extern void isns_policy_release(isns_policy_t *); -extern int isns_policy_validate_function(const isns_policy_t *, - const isns_message_t *); -extern int isns_policy_validate_source(const isns_policy_t *, - const isns_source_t *); -extern int isns_policy_validate_object_access(const isns_policy_t *, - const isns_source_t *, - const isns_object_t *, - unsigned int); -extern int isns_policy_validate_object_update(const isns_policy_t *, - const isns_source_t *, - const isns_object_t *, - const isns_attr_list_t *, - unsigned int); -extern int isns_policy_validate_object_creation(const isns_policy_t *, - const isns_source_t *, - isns_object_template_t *, - const isns_attr_list_t *, - const isns_attr_list_t *, - unsigned int); -extern int isns_policy_validate_object_type(const isns_policy_t *, - isns_object_template_t *, - unsigned int function); -extern int isns_policy_validate_node_type(const isns_policy_t *, - uint32_t type); -extern int isns_policy_validate_entity(const isns_policy_t *, - const char *); -extern int isns_policy_validate_node_name(const isns_policy_t *, - const char *); -extern int isns_policy_validate_scn_bitmap(const isns_policy_t *, - uint32_t); -extern const char * isns_policy_default_entity(const isns_policy_t *); -extern isns_policy_t * isns_policy_default(const char *, size_t); -extern isns_policy_t * isns_policy_server(void); - -extern EVP_PKEY * isns_dsa_decode_public(const void *, size_t); -extern int isns_dsa_encode_public(EVP_PKEY *, - void **, size_t *); -extern EVP_PKEY * isns_dsa_load_public(const char *); -extern int isns_dsa_store_private(const char *, EVP_PKEY *); -extern EVP_PKEY * isns_dsa_generate_key(void); -extern int isns_dsa_init_params(const char *); -extern int isns_dsa_init_key(const char *); - -#endif /* ISNS_SECURITY_H */ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/server.c open-iscsi-2.0.874/utils/open-isns/server.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/server.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/server.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,236 +0,0 @@ -/* - * iSNS server side functions - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include "isns.h" -#include "util.h" -#include "security.h" -#include "message.h" - -static int isns_not_supported(isns_server_t *, isns_simple_t *, isns_simple_t **); - -struct isns_service_ops isns_default_service_ops = { - .process_registration = isns_process_registration, - .process_query = isns_process_query, - .process_getnext = isns_process_getnext, - .process_deregistration = isns_process_deregistration, - .process_scn_registration = isns_process_scn_register, - .process_scn_deregistration = isns_process_scn_deregistration, - .process_scn_event = isns_not_supported, - .process_dd_registration = isns_process_dd_registration, - .process_dd_deregistration= isns_process_dd_deregistration, -}; - -struct isns_service_ops isns_callback_service_ops = { - .process_esi = isns_process_esi, - .process_scn = isns_process_scn, -}; - -/* - * Create a server object - */ -isns_server_t * -isns_create_server(isns_source_t *source, isns_db_t *db, - struct isns_service_ops *ops) -{ - isns_server_t *srv; - - if (source == NULL) { - isns_error("%s: source name not set\n", __FUNCTION__); - return NULL; - } - - srv = isns_calloc(1, sizeof(*srv)); - srv->is_source = isns_source_get(source); - srv->is_db = db; - srv->is_ops = ops; - - return srv; -} - -void -isns_server_set_scn_callback(isns_server_t *srv, isns_scn_callback_fn_t *func) -{ - srv->is_scn_callback = func; -} - -/* - * Try to handle transactions safely. - * This isn't perfect, because there's state outside the DB (for instance - * the DD information) - */ -static int -isns_begin_write_operation(isns_server_t *srv, isns_simple_t *msg, int *status) -{ - isns_db_begin_transaction(srv->is_db); - return 1; -} - -static void -isns_end_write_operation(isns_server_t *srv, isns_simple_t *msg, int *status) -{ - if (*status == ISNS_SUCCESS) - isns_db_commit(srv->is_db); - else - isns_db_rollback(srv->is_db); -} - -static inline int -isns_begin_read_operation(isns_server_t *srv, isns_simple_t *msg, int *status) -{ - return 1; -} - -static void -isns_end_read_operation(isns_server_t *srv, isns_simple_t *msg, int *status) -{ -} - -/* - * Process an incoming message - */ -isns_message_t * -isns_process_message(isns_server_t *srv, isns_message_t *msg) -{ - struct isns_service_ops *ops = srv->is_ops; - uint16_t function = msg->im_header.i_function; - int status = ISNS_SUCCESS; - isns_simple_t *call = NULL, *reply = NULL; - isns_message_t *res_msg = NULL; - isns_db_t *db = srv->is_db; - - status = isns_simple_decode(msg, &call); - if (status) { - isns_debug_message("Failed to decode %s request: %s\n", - isns_function_name(msg->im_header.i_function), - isns_strerror(status)); - goto reply; - } - - isns_simple_print(call, isns_debug_message); - - /* Set policy and privileges based on the - * sender's identity. */ - if (!(call->is_policy = isns_policy_bind(msg))) - goto err_unauthorized; - - if (!isns_policy_validate_function(call->is_policy, msg)) - goto err_unauthorized; - - /* Checks related to the message source. - * Note - some messages do not use a source. - */ - if (call->is_source) { - /* Validate the message source. This checks whether the client - * is permitted to use this source node name. - * Beware - not all messages include a source. - */ - if (!isns_policy_validate_source(call->is_policy, call->is_source)) - goto err_unauthorized; - - /* This may fail if the source node isn't in the DB yet. */ - isns_source_set_node(call->is_source, db); - - /* - * 6.2.6. Registration Period - * - * The registration SHALL be removed from the iSNS database - * if an iSNS Protocol message is not received from the - * iSNS client before the registration period has expired. - * Receipt of any iSNS Protocol message from the iSNS client - * automatically refreshes the Entity Registration Period and - * Entity Registration Timestamp. To prevent a registration - * from expiring, the iSNS client should send an iSNS Protocol - * message to the iSNS server at intervals shorter than the - * registration period. Such a message can be as simple as a - * query for one of its own attributes, using its associated - * iSCSI Name or FC Port Name WWPN as the Source attribute. - */ - /* Thusly, we update the timestamps of all entities - * registered by this source. */ - isns_entity_touch(call->is_source->is_entity); - } - - /* Handle the requested function. If the function vector is - * NULL, silently discard the message. */ - switch (function) { -#define DO(rw, FUNCTION, __function) \ - case FUNCTION: \ - if (!ops->__function) \ - goto no_reply; \ - \ - if (!isns_begin_##rw##_operation(srv, call, &status)) \ - break; \ - status = ops->__function(srv, call, &reply); \ - isns_end_##rw##_operation(srv, call, &status); \ - break - - DO(write, ISNS_DEVICE_ATTRIBUTE_REGISTER, process_registration); - DO(read, ISNS_DEVICE_ATTRIBUTE_QUERY, process_query); - DO(read, ISNS_DEVICE_GET_NEXT, process_getnext); - DO(write, ISNS_DEVICE_DEREGISTER, process_deregistration); - DO(write, ISNS_DD_REGISTER, process_dd_registration); - DO(write, ISNS_DD_DEREGISTER, process_dd_deregistration); - DO(read, ISNS_SCN_REGISTER, process_scn_registration); - DO(read, ISNS_SCN_DEREGISTER, process_scn_deregistration); - DO(read, ISNS_SCN_EVENT, process_scn_event); - DO(read, ISNS_STATE_CHANGE_NOTIFICATION, process_scn); - DO(read, ISNS_ENTITY_STATUS_INQUIRY, process_esi); - DO(read, ISNS_HEARTBEAT, process_heartbeat); -#undef DO - - default: - isns_error("Function %s not supported\n", - isns_function_name(function)); - status = ISNS_MESSAGE_NOT_SUPPORTED; - break; - } - -reply: - /* Commit any changes to the DB before we reply */ - if (db) - isns_db_sync(db); - - /* Send out SCN notifications */ - isns_flush_events(); - - if (reply != NULL) { - reply->is_function |= 0x8000; - isns_simple_print(reply, isns_debug_message); - - /* Encode the whole thing */ - status = isns_simple_encode_response(reply, msg, &res_msg); - } - - /* No reply, or error when encoding it: - * just send the error, nothing else. */ - if (res_msg == NULL) { - res_msg = isns_create_reply(msg); - if (status == ISNS_SUCCESS) - status = ISNS_INTERNAL_ERROR; - } - - isns_debug_message("response status 0x%04x (%s)\n", - status, isns_strerror(status)); - - if (status != ISNS_SUCCESS) - isns_message_set_error(res_msg, status); - -no_reply: - isns_simple_free(call); - if (reply) - isns_simple_free(reply); - return res_msg; - -err_unauthorized: - status = ISNS_SOURCE_UNAUTHORIZED; - goto reply; -} - -int -isns_not_supported(isns_server_t *srv, isns_simple_t *call, isns_simple_t **replyp) -{ - return ISNS_MESSAGE_NOT_SUPPORTED; -} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/simple.c open-iscsi-2.0.874/utils/open-isns/simple.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/simple.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/simple.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,727 +0,0 @@ -/* - * Common handling for iSNS message parsing - * - * Copyright (C) 2007 Olaf Kirch - * - */ - -#include -#include -#include "isns.h" -#include "attrs.h" -#include "message.h" -#include "objects.h" -#include "security.h" -#include "socket.h" -#include "util.h" - -typedef void isns_simple_callback_fn_t(uint32_t, int status, isns_simple_t *); - -static int isns_attr_list_scanner_get_pg(struct isns_attr_list_scanner *st); - -/* - * Allocate an empty simple message - */ -static isns_simple_t * -__isns_alloc_simple(void) -{ - isns_simple_t *simp; - - simp = isns_calloc(1, sizeof(*simp)); - - isns_attr_list_init(&simp->is_message_attrs); - isns_attr_list_init(&simp->is_operating_attrs); - - return simp; -} - -/* - * Create a simple message, and set the source name - */ -isns_simple_t * -isns_simple_create(uint32_t function, isns_source_t *source, - const isns_attr_list_t *key) -{ - isns_simple_t *simp; - - simp = __isns_alloc_simple(); - simp->is_function = function; - simp->is_source = source; - if (source != NULL) - source->is_users++; - - if (key) - isns_attr_list_copy(&simp->is_message_attrs, key); - - return simp; -} - -/* - * Perform a call to the server, waiting for the response. - */ -int -isns_simple_call(isns_socket_t *sock, isns_simple_t **inout) -{ - isns_simple_t *simp = *inout; - isns_message_t *msg, *resp; - int status; - - isns_simple_print(simp, isns_debug_message); - - status = isns_simple_encode(simp, &msg); - if (status != ISNS_SUCCESS) { - isns_error("Unable to encode %s: %s\n", - isns_function_name(simp->is_function), - isns_strerror(status)); - return status; - } - - isns_debug_message("Sending request, len=%d\n", - buf_avail(msg->im_payload)); - - resp = isns_socket_call(sock, msg, - isns_config.ic_network.call_timeout); - isns_assert(msg->im_users == 1); - isns_message_release(msg); - - if (resp == NULL) { - isns_error("Timed out while waiting for reply\n"); - return ISNS_INTERNAL_ERROR; - } - - isns_debug_message("Received reply, len=%d\n", - buf_avail(resp->im_payload)); - isns_assert(resp->im_users == 1); - - status = isns_message_status(resp); - if (status != ISNS_SUCCESS) { - isns_message_release(resp); - return status; - } - - status = isns_simple_decode(resp, &simp); - isns_message_release(resp); - - if (status) { - isns_error("Unable to decode server response: %s (status 0x%04x)\n", - isns_strerror(status), status); - return status; - } - - isns_simple_print(simp, isns_debug_message); - - isns_simple_free(*inout); - *inout = simp; - return ISNS_SUCCESS; -} - -/* - * This callback is invoked from the network layer when - * we received a response to an async message - */ -static void -isns_simple_recv_response(isns_message_t *cmsg, isns_message_t *rmsg) -{ - isns_simple_callback_fn_t *user_callback; - isns_simple_t *resp = NULL; - int status = ISNS_INTERNAL_ERROR; - - /* rmsg being NULL means the call timed out. */ - if (rmsg == NULL) - goto callback; - - status = isns_message_status(rmsg); - if (status != ISNS_SUCCESS) { - isns_error("Server flags error: %s (status 0x%04x)\n", - isns_strerror(status), status); - goto callback; - } - - status = isns_simple_decode(rmsg, &resp); - if (status) { - isns_error("Unable to decode server response: %s (status 0x%04x)\n", - isns_strerror(status), status); - resp = NULL; - goto callback; - } - - isns_simple_print(resp, isns_debug_message); - -callback: - user_callback = cmsg->im_calldata; - if (user_callback) - user_callback(cmsg->im_xid, status, resp); - if (resp) - isns_simple_free(resp); -} - -/* - * Transmit a call, without waiting for the response. - */ -int -isns_simple_transmit(isns_socket_t *sock, isns_simple_t *call, - const isns_portal_info_t *dest, - unsigned int timeout, - isns_simple_callback_fn_t *user_callback) -{ - isns_message_t *msg; - int status; - - isns_simple_print(call, isns_debug_message); - - status = isns_simple_encode(call, &msg); - if (status != ISNS_SUCCESS) { - isns_error("Unable to encode %s: %s\n", - isns_function_name(call->is_function), - isns_strerror(status)); - return status; - } - - isns_debug_message("Sending message, len=%d\n", - buf_avail(msg->im_payload)); - - if (user_callback) { - msg->im_callback = isns_simple_recv_response; - msg->im_calldata = user_callback; - } - - if (!isns_socket_submit(sock, msg, timeout)) - status = ISNS_INTERNAL_ERROR; - isns_message_release(msg); - return status; -} - -/* - * Delete the simple message object - */ -void -isns_simple_free(isns_simple_t *simp) -{ - if (simp == NULL) - return; - - isns_attr_list_destroy(&simp->is_message_attrs); - isns_attr_list_destroy(&simp->is_operating_attrs); - isns_source_release(simp->is_source); - isns_policy_release(simp->is_policy); - isns_free(simp); -} - -/* - * Get the source associated with this simple message - */ -isns_source_t * -isns_simple_get_source(isns_simple_t *simp) -{ - return simp->is_source; -} - -const isns_attr_list_t * -isns_simple_get_attrs(isns_simple_t *simp) -{ - return &simp->is_operating_attrs; -} - -/* - * Determine whether message includes a source attr. - */ -static inline int -isns_simple_include_source(uint16_t function) -{ - if (function & 0x8000) - return 0; - switch (function) { - case ISNS_STATE_CHANGE_NOTIFICATION: - case ISNS_ENTITY_STATUS_INQUIRY: - return 0; - } - return 1; -} - -/* - * Decode a simple message - */ -int -isns_simple_decode(isns_message_t *msg, isns_simple_t **result) -{ - isns_simple_t *simp = __isns_alloc_simple(); - buf_t *bp = msg->im_payload; - int status = ISNS_SUCCESS; - - simp->is_function = msg->im_header.i_function; - simp->is_xid = msg->im_xid; - - if (isns_simple_include_source(simp->is_function)) { - status = isns_source_decode(bp, &simp->is_source); - if (status != ISNS_SUCCESS) - goto out; - } - - switch (simp->is_function & 0x7FFF) { - case ISNS_ENTITY_STATUS_INQUIRY: - case ISNS_STATE_CHANGE_NOTIFICATION: - /* Server messages do not include a source */ - status = isns_attr_list_decode(bp, - &simp->is_message_attrs); - break; - - default: - status = isns_attr_list_decode_delimited(bp, - &simp->is_message_attrs); - if (status == ISNS_SUCCESS) - status = isns_attr_list_decode(bp, - &simp->is_operating_attrs); - } - - if (msg->im_header.i_flags & ISNS_F_REPLACE) - simp->is_replace = 1; - -out: - if (status == ISNS_SUCCESS) { - *result = simp; - } else { - isns_simple_free(simp); - *result = NULL; - } - return status; -} - -/* - * Encode a simple message reply or response - */ -static int -__isns_simple_encode(isns_simple_t *simp, buf_t *bp) -{ - int status = ISNS_SUCCESS; - - if (isns_simple_include_source(simp->is_function)) { - if (simp->is_source == NULL) { - isns_error("Cannot encode %s message - caller forgot to set source\n", - isns_function_name(simp->is_function)); - return ISNS_SOURCE_UNKNOWN; - } - status = isns_source_encode(bp, simp->is_source); - } - - if (status == ISNS_SUCCESS) - status = isns_attr_list_encode(bp, &simp->is_message_attrs); - - /* Some functions have just one set of attrs. */ - switch (simp->is_function & 0x7fff) { - /* It's not entirely clear which calls actually have the delimiter. - * The spec is sometimes a little vague on this. */ - case ISNS_SCN_DEREGISTER: - case ISNS_ENTITY_STATUS_INQUIRY: - case ISNS_STATE_CHANGE_NOTIFICATION: - break; - - default: - if (status == ISNS_SUCCESS) - status = isns_encode_delimiter(bp); - if (status == ISNS_SUCCESS) - status = isns_attr_list_encode(bp, &simp->is_operating_attrs); - break; - } - - return status; -} - -int -isns_simple_encode(isns_simple_t *simp, isns_message_t **result) -{ - isns_message_t *msg; - int status, flags; - - flags = ISNS_F_CLIENT; - if (simp->is_replace) - flags |= ISNS_F_REPLACE; - msg = isns_create_message(simp->is_function, flags); - - /* FIXME: for UDP sockets, isns_simple_t may contain a - destination address. */ - - status = __isns_simple_encode(simp, msg->im_payload); - if (status != ISNS_SUCCESS) { - isns_message_release(msg); - msg = NULL; - } - - /* Report the XID to the caller */ - simp->is_xid = msg->im_xid; - - *result = msg; - return status; -} - -int -isns_simple_encode_response(isns_simple_t *reg, - const isns_message_t *request, isns_message_t **result) -{ - isns_message_t *msg; - int status; - - msg = isns_create_reply(request); - - status = __isns_simple_encode(reg, msg->im_payload); - if (status != ISNS_SUCCESS) { - isns_message_release(msg); - msg = NULL; - } - - *result = msg; - return status; -} - -int -isns_simple_decode_response(isns_message_t *resp, isns_simple_t **result) -{ - return isns_simple_decode(resp, result); -} - -/* - * Extract the list of objects from a DevAttrReg/DevAttrQry - * response or similar. - */ -int -isns_simple_response_get_objects(isns_simple_t *resp, - isns_object_list_t *result) -{ - struct isns_attr_list_scanner state; - int status = ISNS_SUCCESS; - - isns_attr_list_scanner_init(&state, NULL, &resp->is_operating_attrs); - while (1) { - isns_object_t *obj; - - status = isns_attr_list_scanner_next(&state); - if (status == ISNS_NO_SUCH_ENTRY) { - status = ISNS_SUCCESS; - break; - } - if (status) - break; - - obj = isns_create_object(state.tmpl, &state.keys, NULL); - - isns_object_set_attrlist(obj, &state.attrs); - if (obj != state.key_obj) - isns_object_list_append(result, obj); - isns_object_release(obj); - } - - isns_attr_list_scanner_destroy(&state); - return status; -} - -/* - * Print a simple message object - */ -void -isns_simple_print(isns_simple_t *simp, isns_print_fn_t *fn) -{ - char buffer[256]; - - if (fn == isns_debug_message - && !isns_debug_enabled(DBG_MESSAGE)) - return; - - fn("---%s%s---\n", - isns_function_name(simp->is_function), - simp->is_replace? "[REPLACE]" : ""); - if (simp->is_source) { - fn("Source:\n", buffer); - isns_attr_print(simp->is_source->is_attr, fn); - } else { - fn("Source: \n"); - } - - if (simp->is_message_attrs.ial_count == 0) { - fn("Message attributes: \n"); - } else { - fn("Message attributes:\n"); - isns_attr_list_print(&simp->is_message_attrs, fn); - } - if (simp->is_operating_attrs.ial_count == 0) { - fn("Operating attributes: \n"); - } else { - fn("Operating attributes:\n"); - isns_attr_list_print(&simp->is_operating_attrs, fn); - } -} - -/* - * This set of functions analyzes the operating attrs of a registration, - * or a query response, and chops it up into separate chunks, one - * per objects. - * - * It always returns the keys and attrs for one object, - * following the ordering constraints laid out in the RFC. - */ -void -isns_attr_list_scanner_init(struct isns_attr_list_scanner *st, - isns_object_t *key_obj, - const isns_attr_list_t *attrs) -{ - memset(st, 0, sizeof(*st)); - st->orig_attrs = *attrs; - st->key_obj = key_obj; -} - -void -isns_attr_list_scanner_destroy(struct isns_attr_list_scanner *st) -{ - isns_attr_list_destroy(&st->keys); - isns_attr_list_destroy(&st->attrs); - memset(st, 0, sizeof(*st)); -} - -int -isns_attr_list_scanner_next(struct isns_attr_list_scanner *st) -{ - isns_attr_t *attr; - unsigned int i, pos = st->pos; - - isns_attr_list_destroy(&st->keys); - isns_attr_list_destroy(&st->attrs); - - if (st->orig_attrs.ial_count <= pos) - return ISNS_NO_SUCH_ENTRY; - - attr = st->orig_attrs.ial_data[pos]; - - /* handle those funky inlined PGT definitions */ - if (st->pgt_next_attr && attr->ia_tag_id == st->pgt_next_attr) - return isns_attr_list_scanner_get_pg(st); - - /* This isn't really structured programming anymore */ - if (st->index_acceptable - && (st->tmpl = isns_object_template_for_index_tag(attr->ia_tag_id))) - goto copy_attrs; - - /* - * Find the object template for the given key attr(s). - * This function also enforces restrictions on the - * order of key attributes. - */ - st->tmpl = isns_object_template_find(attr->ia_tag_id); - if (st->tmpl == NULL) { - isns_debug_protocol("%s: attr %u is not a key attr\n", - __FUNCTION__, attr->ia_tag_id); - return ISNS_INVALID_REGISTRATION; - } - - /* Copy the key attrs */ - for (i = 0; i < st->tmpl->iot_num_keys; ++i, ++pos) { - if (pos >= st->orig_attrs.ial_count) { - isns_debug_protocol("%s: incomplete %s object " - "(key attr %u missing)\n", - __FUNCTION__, st->tmpl->iot_name, pos); - return ISNS_INVALID_REGISTRATION; - } - attr = st->orig_attrs.ial_data[pos]; - - /* Make sure key attrs are complete and in order */ - if (attr->ia_tag_id != st->tmpl->iot_keys[i]) { - isns_debug_protocol("%s: incomplete %s object " - "(key attr %u missing)\n", - __FUNCTION__, st->tmpl->iot_name, pos); - return ISNS_INVALID_REGISTRATION; - } - - isns_attr_list_append_attr(&st->keys, attr); - } - - /* - * Consume all non-key attributes corresponding to the - * object class. We stop whenever we hit another - * key attribute, or an attribute that does not belong to - * the object type (eg when a storage node is followed by - * a PGT attribute, as described in section 5.6.5.1). - */ -copy_attrs: - while (pos < st->orig_attrs.ial_count) { - uint32_t tag; - - attr = st->orig_attrs.ial_data[pos]; - tag = attr->ia_tag_id; - - if (!isns_object_attr_valid(st->tmpl, tag) - || isns_object_template_find(tag) != NULL) - break; - - pos++; - isns_attr_list_append_attr(&st->attrs, attr); - } - st->pos = pos; - - return ISNS_SUCCESS; -} - -int -isns_attr_list_scanner_get_pg(struct isns_attr_list_scanner *st) -{ - isns_attr_t *attr, *next = NULL; - unsigned int pos = st->pos; - - - attr = st->orig_attrs.ial_data[st->pos++]; - if (st->pgt_next_attr == ISNS_TAG_PG_TAG) { - isns_object_t *base = st->pgt_base_object; - - if (ISNS_ATTR_IS_NIL(attr)) - st->pgt_value = 0; - else if (ISNS_ATTR_IS_UINT32(attr)) - st->pgt_value = attr->ia_value.iv_uint32; - else - return ISNS_INVALID_REGISTRATION; - - if (ISNS_IS_PORTAL(base) - && isns_portal_from_object(&st->pgt_portal_info, - ISNS_TAG_PORTAL_IP_ADDRESS, - ISNS_TAG_PORTAL_TCP_UDP_PORT, - base)) { - st->pgt_next_attr = ISNS_TAG_PG_ISCSI_NAME; - } else - if (ISNS_IS_ISCSI_NODE(base) - && isns_object_get_string(base, - ISNS_TAG_ISCSI_NAME, - &st->pgt_iscsi_name)) { - st->pgt_next_attr = ISNS_TAG_PORTAL_IP_ADDRESS; - } else { - return ISNS_INTERNAL_ERROR; - } - - /* Trailing PGT at end of list. Shrug. */ - if (st->pos >= st->orig_attrs.ial_count) - return ISNS_NO_SUCH_ENTRY; - - attr = st->orig_attrs.ial_data[st->pos++]; - if (attr->ia_tag_id != st->pgt_next_attr) { - /* Some clients may do this; catch them so - * we can fix it. */ - isns_error("Oops, client sends PGT followed by <%s>\n", - attr->ia_tag->it_name); - return ISNS_INVALID_REGISTRATION; - } - } - - st->tmpl = &isns_iscsi_pg_template; - if (st->pgt_next_attr == ISNS_TAG_PG_ISCSI_NAME) { - isns_attr_list_append_attr(&st->keys, attr); - isns_portal_to_attr_list(&st->pgt_portal_info, - ISNS_TAG_PG_PORTAL_IP_ADDR, - ISNS_TAG_PG_PORTAL_TCP_UDP_PORT, - &st->keys); - } else - if (st->pgt_next_attr == ISNS_TAG_PG_PORTAL_IP_ADDR) { - if (st->pos >= st->orig_attrs.ial_count) - return ISNS_INVALID_REGISTRATION; - - next = st->orig_attrs.ial_data[st->pos++]; - if (next->ia_tag_id != ISNS_TAG_PORTAL_TCP_UDP_PORT) - return ISNS_INVALID_REGISTRATION; - - isns_attr_list_append_string(&st->keys, - ISNS_TAG_PG_ISCSI_NAME, - st->pgt_iscsi_name); - isns_attr_list_append_attr(&st->keys, attr); - isns_attr_list_append_attr(&st->keys, next); - } else { - return ISNS_INTERNAL_ERROR; - } - - isns_attr_list_append_uint32(&st->attrs, - ISNS_TAG_PG_TAG, - st->pgt_value); - - /* Copy other PG attributes if present */ - for (pos = st->pos; pos < st->orig_attrs.ial_count; ++pos) { - uint32_t tag; - - attr = st->orig_attrs.ial_data[pos]; - tag = attr->ia_tag_id; - - /* - * Additional sets of PGTs and PG iSCSI Names to be - * associated to the registered Portal MAY follow. - */ - if (tag == ISNS_TAG_PG_TAG) { - st->pgt_next_attr = tag; - break; - } - - if (tag == ISNS_TAG_PG_ISCSI_NAME - || tag == ISNS_TAG_PG_PORTAL_IP_ADDR - || tag == ISNS_TAG_PG_PORTAL_TCP_UDP_PORT - || !isns_object_attr_valid(st->tmpl, tag)) - break; - - isns_attr_list_append_attr(&st->attrs, attr); - } - st->pos = pos; - - return ISNS_SUCCESS; -} - -/* - * Get the name of a function - */ -#define __ISNS_MAX_FUNCTION 16 -static const char * isns_req_function_names[__ISNS_MAX_FUNCTION] = { -[ISNS_DEVICE_ATTRIBUTE_REGISTER]= "DevAttrReg", -[ISNS_DEVICE_ATTRIBUTE_QUERY] = "DevAttrQry", -[ISNS_DEVICE_GET_NEXT] = "DevGetNext", -[ISNS_DEVICE_DEREGISTER] = "DevDereg", -[ISNS_SCN_REGISTER] = "SCNReg", -[ISNS_SCN_DEREGISTER] = "SCNDereg", -[ISNS_SCN_EVENT] = "SCNEvent", -[ISNS_STATE_CHANGE_NOTIFICATION]= "SCN", -[ISNS_DD_REGISTER] = "DDReg", -[ISNS_DD_DEREGISTER] = "DDDereg", -[ISNS_DDS_REGISTER] = "DDSReg", -[ISNS_DDS_DEREGISTER] = "DDSDereg", -[ISNS_ENTITY_STATUS_INQUIRY] = "ESI", -[ISNS_HEARTBEAT] = "Heartbeat", -}; -static const char * isns_resp_function_names[__ISNS_MAX_FUNCTION] = { -[ISNS_DEVICE_ATTRIBUTE_REGISTER]= "DevAttrRegResp", -[ISNS_DEVICE_ATTRIBUTE_QUERY] = "DevAttrQryResp", -[ISNS_DEVICE_GET_NEXT] = "DevGetNextResp", -[ISNS_DEVICE_DEREGISTER] = "DevDeregResp", -[ISNS_SCN_REGISTER] = "SCNRegResp", -[ISNS_SCN_DEREGISTER] = "SCNDeregResp", -[ISNS_SCN_EVENT] = "SCNEventResp", -[ISNS_STATE_CHANGE_NOTIFICATION]= "SCNResp", -[ISNS_DD_REGISTER] = "DDRegResp", -[ISNS_DD_DEREGISTER] = "DDDeregResp", -[ISNS_DDS_REGISTER] = "DDSRegResp", -[ISNS_DDS_DEREGISTER] = "DDSDeregResp", -[ISNS_ENTITY_STATUS_INQUIRY] = "ESIRsp", -/* No response code for heartbeat */ -}; - -const char * -isns_function_name(uint32_t function) -{ - static char namebuf[32]; - const char **names, *name; - unsigned int num = function; - - names = isns_req_function_names; - if (num & 0x8000) { - names = isns_resp_function_names; - num &= 0x7fff; - } - name = NULL; - if (num < __ISNS_MAX_FUNCTION) - name = names[num]; - if (name == NULL) { - snprintf(namebuf, sizeof(namebuf), - "", - function); - name = namebuf; - } - - return name; -} - diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/slp.c open-iscsi-2.0.874/utils/open-isns/slp.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/slp.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/slp.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,242 +0,0 @@ -/* - * SLP registration and query of iSNS - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include "config.h" -#include -#ifdef HAVE_SLP_H -# include -#endif - -#include "isns.h" -#include "util.h" -#include "internal.h" - -#define ISNS_SLP_SERVICE_NAME "iscsi:sms" -/* - * RFC 4018 says we would use scope initiator-scope-list. - * But don't we want targets to find the iSNS server, too? - */ -#define ISNS_SLP_SCOPE "initiator-scope-list" - -#ifdef WITH_SLP - -struct isns_slp_url_state { - SLPError slp_err; - char * slp_url; -}; - -static void -isns_slp_report(SLPHandle handle, SLPError err, void *cookie) -{ - *(SLPError *) cookie = err; -} - -/* - * Register a service with SLP - */ -int -isns_slp_register(const char *url) -{ - SLPError err, callbackerr; - SLPHandle handle = NULL; - - err = SLPOpen("en", SLP_FALSE, &handle); - if(err != SLP_OK) { - isns_error("Unable to obtain SLP handle (err %d)\n", err); - return 0; - } - - err = SLPReg(handle, url, SLP_LIFETIME_MAXIMUM, - ISNS_SLP_SCOPE, - "(description=iSNS Server),(protocols=isns)", - SLP_TRUE, - isns_slp_report, &callbackerr); - - SLPClose(handle); - - if (err == SLP_OK) - err = callbackerr; - if (err != SLP_OK) { - isns_error("Failed to register with SLP (err %d)\n", err); - return 0; - } - - return 1; -} - -/* - * DeRegister a service - */ -int -isns_slp_unregister(const char *url) -{ - SLPError err, callbackerr; - SLPHandle handle = NULL; - - isns_debug_general("SLP: Unregistering \"%s\"\n", url); - - err = SLPOpen("en", SLP_FALSE, &handle); - if(err != SLP_OK) { - isns_error("Unable to obtain SLP handle (err %d)\n", err); - return 0; - } - - err = SLPDereg(handle, url, isns_slp_report, &callbackerr); - - SLPClose(handle); - - if (err == SLP_OK) - err = callbackerr; - if (err != SLP_OK) { - isns_error("Failed to deregister with SLP (err %d)\n", err); - return 0; - } - - return 1; -} - -/* - * Find an iSNS server through SLP - */ -static SLPBoolean -isns_slp_url_callback(SLPHandle handle, - const char *url, unsigned short lifetime, - SLPError err, void *cookie) -{ - struct isns_slp_url_state *sp = cookie; - SLPSrvURL *parsed_url = NULL; - int want_more = SLP_TRUE; - char buffer[1024]; - - if (err != SLP_OK && err != SLP_LAST_CALL) - return SLP_FALSE; - - if (!url) - goto out; - - isns_debug_general("SLP: Found URL \"%s\"\n", url); - err = SLPParseSrvURL(url, &parsed_url); - if (err != SLP_OK) { - isns_error("Error parsing SLP service URL \"%s\"\n", url); - goto out; - } - - if (parsed_url->s_pcNetFamily - && parsed_url->s_pcNetFamily[0] - && strcasecmp(parsed_url->s_pcNetFamily, "ip")) { - isns_error("Ignoring SLP service URL \"%s\"\n", url); - goto out; - } - - if (parsed_url->s_iPort) { - snprintf(buffer, sizeof(buffer), "%s:%u", - parsed_url->s_pcHost, - parsed_url->s_iPort); - isns_assign_string(&sp->slp_url, buffer); - } else { - isns_assign_string(&sp->slp_url, - parsed_url->s_pcHost); - } - want_more = SLP_FALSE; - -out: - if (parsed_url) - SLPFree(parsed_url); - sp->slp_err = SLP_OK; - - return want_more; -} - -/* - * Locate the iSNS server using SLP. - * This is not really an instantaneous process. Maybe we could - * speed this up by using a cache. - */ -char * -isns_slp_find(void) -{ - static struct isns_slp_url_state state; - SLPHandle handle = NULL; - SLPError err; - - if (state.slp_url) - return state.slp_url; - - isns_debug_general("Using SLP to locate iSNS server\n"); - - err = SLPOpen("en", SLP_FALSE, &handle); - if(err != SLP_OK) { - isns_error("Unable to obtain SLP handle (err %d)\n", err); - return NULL; - } - - err = SLPFindSrvs(handle, ISNS_SLP_SERVICE_NAME, - NULL, "(protocols=isns)", - isns_slp_url_callback, &state); - - SLPClose(handle); - - if (err == SLP_OK) - err = state.slp_err; - if (err != SLP_OK) { - isns_error("Failed to find service in SLP (err %d)\n", err); - return NULL; - } - - if (state.slp_url == NULL) { - isns_error("Service %s not registered with SLP\n", - ISNS_SLP_SERVICE_NAME); - return NULL; - - } - - isns_debug_general("Using iSNS server at %s\n", state.slp_url); - return state.slp_url; -} - -#else /* WITH_SLP */ - -int -isns_slp_register(const char *url) -{ - isns_error("SLP support disabled in this build\n"); - return 0; -} - -int -isns_slp_unregister(const char *url) -{ - isns_error("SLP support disabled in this build\n"); - return 0; -} - -char * -isns_slp_find(void) -{ - isns_error("SLP support disabled in this build\n"); - return NULL; -} - -#endif /* WITH_SLP */ - -char * -isns_slp_build_url(uint16_t port) -{ - char buffer[1024]; - - if (port) - snprintf(buffer, sizeof(buffer), - "service:%s://%s:%u", - ISNS_SLP_SERVICE_NAME, - isns_config.ic_host_name, port); - else - snprintf(buffer, sizeof(buffer), - "service:%s://%s", - ISNS_SLP_SERVICE_NAME, - isns_config.ic_host_name); - return isns_strdup(buffer); -} - diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/socket.c open-iscsi-2.0.874/utils/open-isns/socket.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/socket.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/socket.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,2304 +0,0 @@ -/* - * Socket handling code - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "buffer.h" -#include "isns.h" -#include "socket.h" -#include "security.h" -#include "util.h" -#include "config.h" - -#define SOCK_DEBUG_VERBOSE 0 - -#ifndef AI_ADDRCONFIG -# define AI_ADDRCONFIG 0 -#endif -#ifndef AI_V4MAPPED -# define AI_V4MAPPED 0 -#endif - -enum { - ISNS_MSG_DISCARD, - ISNS_MSG_DONE, - ISNS_MSG_RETURN -}; - -static isns_socket_t *__isns_create_socket(struct addrinfo *src, - struct addrinfo *dst, - int sock_type); -static struct addrinfo *isns_get_address_list(const char *, const char *, - int, int, int); -static void release_addrinfo(struct addrinfo *); -static void isns_net_dgram_recv(isns_socket_t *); -static void isns_net_dgram_xmit(isns_socket_t *); -static void isns_net_stream_accept(isns_socket_t *); -static void isns_net_stream_recv(isns_socket_t *); -static void isns_net_stream_xmit(isns_socket_t *); -static void isns_net_stream_hup(isns_socket_t *); -static void isns_net_stream_error(isns_socket_t *, int); -static void isns_net_stream_reconnect(isns_socket_t *); -static void isns_net_stream_disconnect(isns_socket_t *); -static isns_socket_t *isns_net_alloc(int); -static int isns_socket_open(isns_socket_t *); -static int isns_socket_queue_message(isns_socket_t *, isns_message_t *); -static int isns_socket_retransmit_queued(isns_socket_t *); - -static ISNS_LIST_DECLARE(all_sockets); - -#define debug_verbose(args ...) do { \ - if (SOCK_DEBUG_VERBOSE >= 1) isns_debug_socket(args); \ -} while (0) -#define debug_verbose2(args ...) do { \ - if (SOCK_DEBUG_VERBOSE >= 2) isns_debug_socket(args); \ -} while (0) - -/* - * Helper function for looking at incoming PDUs - */ -static inline buf_t * -isns_socket_next_pdu(isns_socket_t *sock) -{ - buf_t *bp = sock->is_recv_buf; - unsigned int avail; - struct isns_hdr *hdr; - uint32_t pdu_len = 0; - - if (bp == NULL) - return NULL; - - avail = buf_avail(bp); - if (avail < sizeof(*hdr)) - return NULL; - hdr = buf_head(bp); - pdu_len = sizeof(*hdr) + ntohs(hdr->i_length); - - if (avail < pdu_len) - return NULL; - - /* Check for presence of authentication block */ - if (hdr->i_flags & htons(ISNS_F_AUTHBLK_PRESENT)) { - uint32_t *authblk, authlen; - - authblk = (uint32_t *) ((char *) hdr + pdu_len); - if (avail < pdu_len + ISNS_AUTHBLK_SIZE) - return NULL; - - authlen = ntohl(authblk[1]); - if (authlen < 20 || authlen > ISNS_MAX_MESSAGE) { - /* The authblock is garbage. - * The only reliable way to signal such a problem - * is by dropping the connection. - */ - isns_error("socket error: bad auth block\n"); - sock->is_state = ISNS_SOCK_DEAD; - return NULL; - } - - pdu_len += authlen; - if (avail < pdu_len) - return NULL; - } - - return buf_split(&sock->is_recv_buf, pdu_len); -} - -/* - * Try to assemble the message from PDUs - */ -static inline int -isns_msg_complete(struct isns_partial_msg *msg) -{ - buf_t *msg_buf, **chain, *bp; - - /* Return if we haven't seen first and last frag */ - if (((~msg->imp_flags) & (ISNS_F_FIRST_PDU|ISNS_F_LAST_PDU))) - return 0; - - /* Simple - unfragmented case: just move - * the PDU on the chain to the payload */ - if (msg->imp_first_seq == msg->imp_last_seq) { - msg->imp_payload = msg->imp_chain; - buf_pull(msg->imp_payload, sizeof(struct isns_hdr)); - msg->imp_chain = NULL; - return 1; - } - - /* Do we have all fragments? */ - if (msg->imp_last_seq - msg->imp_first_seq + 1 - != msg->imp_pdu_count) - return 0; - - msg_buf = buf_alloc(msg->imp_msg_size); - - chain = &msg->imp_chain; - while ((bp = *chain) != NULL) { - /* Pull the header off */ - buf_pull(bp, sizeof(struct isns_hdr)); - buf_put(msg_buf, buf_head(bp), buf_avail(bp)); - - *chain = bp->next; - buf_free(bp); - } - - return 0; -} - -/* - * Clear the "partial" part of the message - */ -static void -__isns_msg_clear_partial(struct isns_partial_msg *msg) -{ - buf_list_free(msg->imp_chain); - msg->imp_chain = NULL; -} - -/* - * Add an authentication block to an outgoing PDU - */ -#ifdef WITH_SECURITY -static int -isns_pdu_seal(isns_security_t *ctx, buf_t *pdu) -{ - struct isns_authblk auth; - isns_principal_t *self; - - if (!(self = ctx->is_self)) { - isns_error("Cannot sign PDU: no sender identity for socket\n"); - return 0; - } - - auth.iab_bsd = ctx->is_type; - auth.iab_timestamp = time(NULL); - auth.iab_spi = self->is_name; - auth.iab_spi_len = strlen(self->is_name); - - if (!isns_security_sign(ctx, self, pdu, &auth)) { - isns_error("Cannot sign PDU: error creating signature\n"); - return 0; - } - - auth.iab_length = ISNS_AUTHBLK_SIZE + - auth.iab_spi_len + - auth.iab_sig_len; - if (!isns_authblock_encode(pdu, &auth)) - return 0; - - isns_debug_message("Successfully signed message (authlen=%u, spilen=%u, siglen=%u)\n", - auth.iab_length, auth.iab_spi_len, auth.iab_sig_len); - - return 1; -} - -/* - * Authenticate a PDU - * - * The RFC is doing a bit of handwaving around the - * authentication issue. For example, it never - * spells out exactly which parts of the message - * are included in the SHA1 hash to be signed. - * - * It also says that the auth block "is identical in format - * to the SLP authentication block", but all fields - * are twice as wide. - * - * There's not even an error code to tell the client - * we were unable to authenticate him :-( - * - * Interoperability problems, here I come... - */ -static int -isns_pdu_authenticate(isns_security_t *sec, - struct isns_partial_msg *msg, buf_t *bp) -{ - struct isns_hdr *hdr = buf_head(bp); - unsigned int pdu_len, avail; - struct isns_authblk authblk; - isns_principal_t * peer = NULL; - buf_t auth_buf; - - isns_debug_auth("Message has authblock; trying to authenticate\n"); - - /* In the TCP path, we checked this before, but - * better safe than sorry. */ - avail = buf_avail(bp); - pdu_len = sizeof(*hdr) + ntohs(hdr->i_length); - if (avail < pdu_len + ISNS_AUTHBLK_SIZE) { - isns_debug_auth("authblock truncated\n"); - return 0; - } - - /* Get the auth block */ - buf_set(&auth_buf, buf_head(bp) + pdu_len, avail - pdu_len); - if (!isns_authblock_decode(&auth_buf, &authblk)) { - isns_debug_auth("error decoding authblock\n"); - return 0; - } - - /* Truncate the buffer (this just sets the - * tail pointer, but doesn't free memory */ - if (!buf_truncate(bp, pdu_len)) { - isns_debug_auth("buf_truncate failed - cosmic particles?\n"); - return 0; - } - - /* If the socket doesn't have a security context, - * just ignore the auth block. */ - if (sec == NULL) { - msg->imp_header.i_flags &= ~ISNS_F_AUTHBLK_PRESENT; - return 1; - } - - if (authblk.iab_bsd != sec->is_type) - goto failed; - - peer = isns_get_principal(sec, authblk.iab_spi, authblk.iab_spi_len); - if (peer == NULL) { - /* If the admin allows unknown peers, we must make - * sure, however, to not allow an unauthenticated - * PDU to be inserted into an authenticated message. - */ - if (isns_config.ic_auth.allow_unknown_peers - && msg->imp_security == NULL) { - isns_debug_message( - "Accepting unknown peer spi=\"%.*s\" as " - "anonymous peer\n", - authblk.iab_spi_len, authblk.iab_spi); - return 1; - } - - isns_debug_message( - "Unable to create security peer for spi=%.*s\n", - authblk.iab_spi_len, authblk.iab_spi); - - goto failed; - } - - if (!isns_security_verify(sec, peer, bp, &authblk)) { - /* Authentication failed */ - goto failed; - } - - /* The RFC doesn't say how to deal with fragmented - * messages with different BSDs or SPIs. - * kickban seems the right approach. - * We discard this segment rather than failing - * the entire message. - */ - if (msg->imp_chain == NULL) { - msg->imp_security = peer; - peer->is_users++; - } else - if (msg->imp_security != peer) { - goto failed; - } - - isns_principal_free(peer); - return 1; - -failed: - isns_principal_free(peer); - return 0; -} -#else /* WITH_SECURITY */ -static int -isns_pdu_authenticate(isns_security_t *sec, - struct isns_partial_msg *msg, buf_t *bp) -{ - return 0; -} - -#endif - -/* - * Enqueue an incoming PDU on the socket. - * - * A single iSNS message may be split up into - * several PDUs, so we need to perform - * reassembly here. - * - * This function also verifies the authentication - * block, if present. - */ -static void -isns_pdu_enqueue(isns_socket_t *sock, - struct sockaddr_storage *addr, socklen_t alen, - buf_t *segment, struct ucred *creds) -{ - isns_message_queue_t *q = &sock->is_partial; - struct isns_partial_msg *msg; - buf_t **chain, *bp; - struct isns_hdr *hdr; - uint32_t xid, seq, flags; - - hdr = (struct isns_hdr *) buf_head(segment); - xid = ntohs(hdr->i_xid); - seq = ntohs(hdr->i_seq); - flags = ntohs(hdr->i_flags); - - isns_debug_socket("Incoming PDU xid=%04x seq=%u len=%u func=%s%s%s%s%s%s\n", - xid, seq, ntohs(hdr->i_length), - isns_function_name(ntohs(hdr->i_function)), - (flags & ISNS_F_CLIENT)? " client" : "", - (flags & ISNS_F_SERVER)? " server" : "", - (flags & ISNS_F_AUTHBLK_PRESENT)? " authblk" : "", - (flags & ISNS_F_FIRST_PDU)? " first" : "", - (flags & ISNS_F_LAST_PDU)? " last" : ""); - - /* Find the message matching (addr, xid) */ - msg = (struct isns_partial_msg *) isns_message_queue_find(q, xid, addr, alen); - if (msg != NULL) { - if (msg->imp_creds - && (!creds || memcmp(msg->imp_creds, creds, sizeof(*creds)))) { - isns_warning("socket: credentials mismatch! Dropping PDU\n"); - goto drop; - } - hdr = &msg->imp_header; - goto found; - } - - msg = (struct isns_partial_msg *) __isns_alloc_message(xid, sizeof(*msg), - (void (*)(isns_message_t *)) __isns_msg_clear_partial); - memcpy(&msg->imp_addr, addr, alen); - msg->imp_addrlen = alen; - - msg->imp_header = *hdr; - msg->imp_header.i_seq = 0; - - isns_message_queue_append(q, &msg->imp_base); - isns_message_release(&msg->imp_base); - /* Message is owned by is_partial now */ - - /* Fix up the PDU header */ - hdr = &msg->imp_header; - hdr->i_version = ntohs(hdr->i_version); - hdr->i_function = ntohs(hdr->i_function); - hdr->i_length = ntohs(hdr->i_length); - hdr->i_flags = ntohs(hdr->i_flags); - hdr->i_xid = ntohs(hdr->i_xid); - hdr->i_seq = ntohs(hdr->i_seq); - - if (creds) { - msg->imp_credbuf = *creds; - msg->imp_creds = &msg->imp_credbuf; - } - -found: - if (flags & ISNS_F_AUTHBLK_PRESENT) { - /* When authentication fails - should we drop the - * message or treat it as unauthenticated? - * For now we drop it, but a more user friendly - * approach might be to just treat it as - * unauthenticated. - */ - if (!isns_pdu_authenticate(sock->is_security, msg, segment)) - goto drop; - } else - if (msg->imp_header.i_flags & ISNS_F_AUTHBLK_PRESENT) { - /* Oops, unauthenticated fragment in an - * authenticated message. */ - isns_debug_message( - "Oops, unauthenticated fragment in an " - "authenticated message!\n"); - goto drop; - } - - if ((flags & ISNS_F_FIRST_PDU) - && !(msg->imp_flags & ISNS_F_FIRST_PDU)) { - /* FIXME: first seq must be zero */ - msg->imp_first_seq = seq; - msg->imp_flags |= ISNS_F_FIRST_PDU; - } - if ((flags & ISNS_F_LAST_PDU) - && !(msg->imp_flags & ISNS_F_LAST_PDU)) { - msg->imp_last_seq = seq; - msg->imp_flags |= ISNS_F_LAST_PDU; - } - - chain = &msg->imp_chain; - while ((bp = *chain) != NULL) { - struct isns_hdr *ohdr = buf_head(bp); - - /* Duplicate? Drop it! */ - if (seq == ohdr->i_seq) - goto drop; - if (seq < ohdr->i_seq) - break; - chain = &bp->next; - } - segment->next = *chain; - *chain = segment; - - msg->imp_msg_size += buf_avail(segment) - sizeof(*hdr); - msg->imp_pdu_count++; - - /* We received first and last PDU - check if the - * chain is complete */ - if (isns_msg_complete(msg)) { - /* Remove from partial queue. - * We clean the part of the message that is - * not in imp_base, so that we can pass this - * to the caller and have him call - * isns_message_release on it. - */ - __isns_msg_clear_partial(msg); - - /* Move from partial queue to complete queue. */ - isns_message_queue_move(&sock->is_complete, - &msg->imp_base); - msg->imp_base.im_socket = sock; - } - - return; - -drop: - buf_free(segment); - return; -} - -/* - * Send side handling - */ -static void -isns_send_update(isns_socket_t *sock) -{ - buf_t *bp = sock->is_xmit_buf; - - if (bp && buf_avail(bp) == 0) { - sock->is_xmit_buf = bp->next; - buf_free(bp); - } - - if (sock->is_xmit_buf) - sock->is_poll_mask |= POLLOUT; - else - sock->is_poll_mask &= ~POLLOUT; -} - -/* - * Close the socket - */ -static void -isns_net_close(isns_socket_t *sock, int next_state) -{ - if (sock->is_desc >= 0) { - close(sock->is_desc); - sock->is_desc = -1; - } - sock->is_poll_mask &= ~(POLLIN|POLLOUT); - sock->is_state = next_state; - - buf_list_free(sock->is_xmit_buf); - sock->is_xmit_buf = NULL; - - buf_free(sock->is_recv_buf); - sock->is_recv_buf = NULL; - - isns_message_queue_destroy(&sock->is_partial); - isns_message_queue_destroy(&sock->is_complete); -} - -static void -isns_net_set_timeout(isns_socket_t *sock, - void (*func)(isns_socket_t *), - unsigned int timeout) -{ - gettimeofday(&sock->is_deadline, NULL); - sock->is_deadline.tv_sec += timeout; - sock->is_timeout = func; -} - -static void -isns_net_cancel_timeout(isns_socket_t *sock) -{ - timerclear(&sock->is_deadline); -} - -void -isns_net_error(isns_socket_t *sock, int err_code) -{ - if (sock->is_error) - sock->is_error(sock, err_code); -} - -/* - * Create a passive socket (server side) - */ -isns_socket_t * -isns_create_server_socket(const char *src_spec, const char *portspec, int af_hint, int sock_type) -{ - struct addrinfo *src; - - src = isns_get_address_list(src_spec, portspec, - af_hint, sock_type, AI_PASSIVE); - if (src == NULL) - return NULL; - - return __isns_create_socket(src, NULL, sock_type); -} - -/* - * Accept incoming connections. - */ -void -isns_net_stream_accept(isns_socket_t *sock) -{ - isns_socket_t *child; - socklen_t optlen; - int fd, passcred = 0; - - fd = accept(sock->is_desc, NULL, NULL); - if (fd < 0) { - if (errno != EINTR) - isns_error("Error accepting connection: %m\n"); - return; - } - - optlen = sizeof(passcred); - if (getsockopt(sock->is_desc, SOL_SOCKET, SO_PASSCRED, - &passcred, &optlen) >= 0) { - setsockopt(fd, SOL_SOCKET, SO_PASSCRED, - &passcred, sizeof(passcred)); - } - - child = isns_net_alloc(fd); - child->is_type = SOCK_STREAM; - child->is_autoclose = 1; - child->is_disconnect_fatal = 1; - child->is_poll_in = isns_net_stream_recv; - child->is_poll_out = isns_net_stream_xmit; - child->is_poll_hup = isns_net_stream_hup; - child->is_error = isns_net_stream_error; - child->is_poll_mask = POLLIN|POLLHUP; - child->is_security = sock->is_security; - - if (isns_config.ic_network.idle_timeout) - isns_net_set_timeout(child, - isns_net_stream_disconnect, - isns_config.ic_network.idle_timeout); - - isns_list_append(&all_sockets, &child->is_list); -} - -/* - * This is called from the socket code when it detects - * an error condition. - */ -static void -isns_net_stream_error(isns_socket_t *sock, int err_code) -{ - int timeo = 0, next_state = ISNS_SOCK_DEAD; - - if (err_code == EAGAIN) - return; - - isns_debug_socket("isns_net_stream_error: %s\n", strerror(err_code)); - - switch (err_code) { - case EINTR: /* ignored */ - return; - - case ECONNREFUSED: - case ECONNRESET: - case EHOSTUNREACH: - case ENETUNREACH: - case ENOTCONN: - case EPIPE: - if (sock->is_disconnect_fatal) { - isns_warning("socket disconnect, killing socket\n"); - break; - } - - /* fallthrough to disconnect */ - timeo = isns_config.ic_network.reconnect_timeout; - - case ETIMEDOUT: - /* Disconnect and try to reconnect */ - if (sock->is_client) { - /* FIXME: We don't want this warning for ESI and - * SCN sockets on the server side. */ - isns_warning("socket disconnect, retrying in %u sec\n", - timeo); - isns_net_set_timeout(sock, - isns_net_stream_reconnect, - timeo); - next_state = ISNS_SOCK_DISCONNECTED; - break; - } - - /* fallthru */ - - default: - isns_error("socket error: %s\n", strerror(err_code)); - } - - /* Close the socket right away */ - isns_net_close(sock, next_state); -} - -/* - * recvmsg wrapper handling SCM_CREDENTIALS passing - */ -static int -isns_net_recvmsg(isns_socket_t *sock, - void *buffer, size_t count, - struct sockaddr *addr, socklen_t *alen, - struct ucred **cred) -{ - static struct ucred cred_buf; - unsigned int control[128]; - struct cmsghdr *cmsg; - struct msghdr msg; - struct iovec iov; - int len; - - *cred = NULL; - - iov.iov_base = buffer; - iov.iov_len = count; - - memset(&msg, 0, sizeof(msg)); - msg.msg_name = addr; - msg.msg_namelen = *alen; - msg.msg_iov = &iov; - msg.msg_iovlen = 1; - msg.msg_control = control; - msg.msg_controllen = sizeof(control); - - len = recvmsg(sock->is_desc, &msg, MSG_DONTWAIT); - - if (len < 0) - return len; - - cmsg = CMSG_FIRSTHDR(&msg); - while (cmsg) { - if (cmsg->cmsg_level == SOL_SOCKET - && cmsg->cmsg_type == SCM_CREDENTIALS) { - memcpy(&cred_buf, CMSG_DATA(cmsg), sizeof(cred_buf)); - *cred = &cred_buf; - break; - } - - cmsg = CMSG_NXTHDR(&msg, cmsg); - } - - *alen = msg.msg_namelen; - return len; -} - -void -isns_net_stream_recv(isns_socket_t *sock) -{ - unsigned char buffer[ISNS_MAX_BUFFER]; - struct sockaddr_storage addr; - struct ucred *creds = NULL; - socklen_t alen = sizeof(addr); - buf_t *bp; - size_t count, total = 0; - int len; - -again: - if ((bp = sock->is_recv_buf) == NULL) { - bp = buf_alloc(ISNS_MAX_MESSAGE); - sock->is_recv_buf = bp; - } - - if ((count = buf_tailroom(bp)) > sizeof(buffer)) - count = sizeof(buffer); - - if (count == 0) { - /* Message too large */ - isns_net_stream_error(sock, EMSGSIZE); - return; - } - -#if 0 - len = recvfrom(sock->is_desc, buffer, count, MSG_DONTWAIT, - (struct sockaddr *) &addr, &alen); -#else - len = isns_net_recvmsg(sock, buffer, count, - (struct sockaddr *) &addr, &alen, - &creds); -#endif - if (len < 0) { - isns_net_stream_error(sock, errno); - return; - } - if (len == 0) { - if (total == 0) - sock->is_poll_mask &= ~POLLIN; - return; - } - - /* We received some data from client, re-arm the - * idle disconnect timer */ - if (sock->is_autoclose - && isns_config.ic_network.idle_timeout) - isns_net_set_timeout(sock, - isns_net_stream_disconnect, - isns_config.ic_network.idle_timeout); - - buf_put(bp, buffer, len); - total += len; - - /* Chop up the recv buffer into PDUs */ - while ((bp = isns_socket_next_pdu(sock)) != NULL) { - /* We have a full PDU; enqueue it */ - /* We shouldn't have more than one partial message - * on a TCP connection; we could check this here. - */ - isns_pdu_enqueue(sock, &addr, alen, bp, creds); - } - - goto again; -} - -void -isns_net_stream_xmit(isns_socket_t *sock) -{ - unsigned int count; - buf_t *bp = sock->is_xmit_buf; - int len; - - /* If a connecting socket can send, it has - * the TCP three-way handshake. */ - if (sock->is_state == ISNS_SOCK_CONNECTING) { - sock->is_state = ISNS_SOCK_IDLE; - sock->is_poll_mask |= POLLIN; - isns_net_cancel_timeout(sock); - } - - if (bp == NULL) - return; - - count = buf_avail(bp); - len = send(sock->is_desc, buf_head(bp), count, MSG_DONTWAIT); - if (len < 0) { - isns_net_stream_error(sock, errno); - return; - } - - debug_verbose("isns_net_stream_xmit(%p, count=%u): transmitted %d\n", - sock, count, len); - buf_pull(bp, len); - isns_send_update(sock); -} - -void -isns_net_stream_hup(isns_socket_t *sock) -{ - sock->is_poll_mask &= ~(POLLIN|POLLOUT); - /* POLLHUP while connecting means we failed */ - if (sock->is_state == ISNS_SOCK_CONNECTING) - isns_net_stream_error(sock, ECONNREFUSED); -} - -/* - * Clone an addrinfo list - */ -static struct addrinfo * -clone_addrinfo(const struct addrinfo *ai) -{ - struct addrinfo *res = NULL, **p; - - p = &res; - for (; ai; ai = ai->ai_next) { - struct addrinfo *new; - - if (ai->ai_addrlen > sizeof(struct sockaddr_storage)) - continue; - - new = isns_calloc(1, sizeof(*new) + ai->ai_addrlen); - new->ai_family = ai->ai_family; - new->ai_socktype = ai->ai_socktype; - new->ai_protocol = ai->ai_protocol; - new->ai_addrlen = ai->ai_addrlen; - new->ai_addr = (struct sockaddr *) (new + 1); - memcpy(new->ai_addr, ai->ai_addr, new->ai_addrlen); - - *p = new; - p = &new->ai_next; - } - - return res; -} - -static struct addrinfo * -__make_addrinfo(const struct sockaddr *ap, socklen_t alen, int socktype) -{ - struct addrinfo *new; - - new = isns_calloc(1, sizeof(*new) + alen); - new->ai_family = ap->sa_family; - new->ai_socktype = socktype; - new->ai_protocol = 0; - new->ai_addrlen = alen; - new->ai_addr = (struct sockaddr *) (new + 1); - memcpy(new->ai_addr, ap, alen); - - return new; -} - -static struct addrinfo * -make_addrinfo_unix(const char *pathname, int socktype) -{ - unsigned int len = strlen(pathname); - struct sockaddr_un sun; - - if (len + 1 > sizeof(sun.sun_path)) { - isns_error("Can't set AF_LOCAL address: path too long!\n"); - return NULL; - } - - sun.sun_family = AF_LOCAL; - strcpy(sun.sun_path, pathname); - return __make_addrinfo((struct sockaddr *) &sun, SUN_LEN(&sun) + 1, socktype); -} - -static struct addrinfo * -make_addrinfo_any(int family, int socktype) -{ - struct sockaddr_storage addr = { .ss_family = AF_UNSPEC }; - struct addrinfo *res; - - if (family != AF_UNSPEC) { - addr.ss_family = family; - res = __make_addrinfo((struct sockaddr *) &addr, sizeof(addr), socktype); - } else { - addr.ss_family = AF_INET6; - res = __make_addrinfo((struct sockaddr *) &addr, sizeof(addr), socktype); - addr.ss_family = AF_INET; - res->ai_next = __make_addrinfo((struct sockaddr *) &addr, sizeof(addr), socktype); - } - - return res; -} - -/* - * Release addrinfo created by functions above. - * We cannot use freeaddrinfo, as we don't know how it - * is implemented. - */ -static void -release_addrinfo(struct addrinfo *ai) -{ - struct addrinfo *next; - - for (; ai; ai = next) { - next = ai->ai_next; - isns_free(ai); - } -} - -static void -__isns_sockaddr_set_current(struct __isns_socket_addr *info, - const struct addrinfo *ai) -{ - if (!ai) - return; - - /* Cannot overflow; we check addrlen in clone_addrinfo */ - memcpy(&info->addr, ai->ai_addr, ai->ai_addrlen); - info->addrlen = ai->ai_addrlen; -} - -static void -isns_sockaddr_init(struct __isns_socket_addr *info, - struct addrinfo *ai) -{ - if (ai == NULL) - return; - - __isns_sockaddr_set_current(info, ai); - - /* keep a copy so that we can loop through - * all addrs */ - info->list = ai; - - /* Make the list circular */ - while (ai->ai_next) - ai = ai->ai_next; - ai->ai_next = info->list; -} - -static void -isns_sockaddr_destroy(struct __isns_socket_addr *info) -{ - struct addrinfo *ai, *next; - - if ((ai = info->list) != NULL) { - /* Break the circular list */ - info->list = NULL; - next = ai->ai_next; - ai->ai_next = NULL; - isns_assert(next); - - /* Can't use freeaddrinfo on homegrown - * addrinfo lists. */ - release_addrinfo(next); - } -} - -static int -isns_sockaddr_set_next(struct __isns_socket_addr *info) -{ - struct addrinfo *ai; - - if (!(ai = info->list)) - return 0; - - info->list = ai->ai_next; - __isns_sockaddr_set_current(info, info->list); - return 1; -} - -/* - * This function is used to pick a matching source address - * when connecting to some server. - */ -static int -isns_sockaddr_select(struct __isns_socket_addr *info, - const struct sockaddr_storage *hint) -{ - struct addrinfo *head = info->list, *ai; - - if (info->list == NULL) - return 0; - - if (hint->ss_family == AF_INET6) { - struct addrinfo *good = NULL, *best = NULL; - - ai = head; - do { - if (ai->ai_family == AF_INET) { - /* Possible improvement: when - * destination is not a private network, - * prefer non-private source. */ - good = ai; - } else - if (ai->ai_family == AF_INET6) { - /* Possible improvement: prefer IPv6 addr - * with same address scope (local, global) - */ - best = ai; - break; - } - - ai = ai->ai_next; - } while (ai != head); - - if (!best) - best = good; - if (best) { - __isns_sockaddr_set_current(info, best); - return 1; - } - } else - if (hint->ss_family == AF_INET || hint->ss_family == AF_LOCAL) { - ai = head; - do { - if (ai->ai_family == hint->ss_family) { - __isns_sockaddr_set_current(info, ai); - return 1; - } - ai = ai->ai_next; - } while (ai != head); - } - - return 0; -} - -void -isns_net_stream_reconnect(isns_socket_t *sock) -{ - struct sockaddr *addr = (struct sockaddr *) &sock->is_dst.addr; - - debug_verbose("isns_net_stream_reconnect(%p)\n", sock); - - /* If we timed out while connecting, close the socket - * and try again. */ - if (sock->is_state == ISNS_SOCK_CONNECTING) { - isns_net_close(sock, ISNS_SOCK_DISCONNECTED); - isns_sockaddr_set_next(&sock->is_dst); - } - - if (!isns_socket_open(sock)) { - isns_error("isns_net_stream_reconnect: cannot create socket\n"); - sock->is_state = ISNS_SOCK_DEAD; - return; - } - - if (connect(sock->is_desc, addr, sock->is_dst.addrlen) >= 0) { - sock->is_state = ISNS_SOCK_IDLE; - sock->is_poll_mask |= POLLIN; - } else - if (errno == EINTR || errno == EINPROGRESS) { - sock->is_state = ISNS_SOCK_CONNECTING; - isns_net_set_timeout(sock, - isns_net_stream_reconnect, - isns_config.ic_network.connect_timeout); - sock->is_poll_mask |= POLLOUT; - } else { - isns_net_stream_error(sock, errno); - return; - } - - /* We're connected, or in the process of doing so. - * Check if there are any pending messages, and - * retransmit them. */ - isns_socket_retransmit_queued(sock); -} - -void -isns_net_stream_disconnect(isns_socket_t *sock) -{ - isns_debug_socket("Disconnecting idle socket\n"); - isns_net_close(sock, ISNS_SOCK_DEAD); -} - -/* - * Datagram send/recv - */ -static int -isns_net_dgram_connect(isns_socket_t *sock) -{ - return connect(sock->is_desc, - (struct sockaddr *) &sock->is_dst.addr, - sock->is_dst.addrlen); -} - -void -isns_net_dgram_recv(isns_socket_t *sock) -{ - unsigned char buffer[ISNS_MAX_BUFFER]; - struct sockaddr_storage addr; - socklen_t alen = sizeof(addr); - buf_t *bp; - int len; - - len = recvfrom(sock->is_desc, buffer, sizeof(buffer), - MSG_DONTWAIT, (struct sockaddr *) &addr, &alen); - if (len < 0) { - isns_error("recv: %m\n"); - return; - } - if (len == 0) - return; - - bp = buf_alloc(len); - if (bp == NULL) - return; - - buf_put(bp, buffer, len); - isns_pdu_enqueue(sock, &addr, alen, bp, NULL); -} - -void -isns_net_dgram_xmit(isns_socket_t *sock) -{ - unsigned int count; - buf_t *bp = sock->is_xmit_buf; - int len; - - count = buf_avail(bp); - if (bp->addrlen) { - len = sendto(sock->is_desc, buf_head(bp), count, MSG_DONTWAIT, - (struct sockaddr *) &bp->addr, bp->addrlen); - } else { - len = sendto(sock->is_desc, buf_head(bp), count, MSG_DONTWAIT, - NULL, 0); - } - - /* Even if sendto failed, we will pull the pending buffer - * off the send chain. Else we'll loop forever on an - * unreachable host. */ - if (len < 0) - isns_error("send: %m\n"); - - buf_pull(bp, count); - isns_send_update(sock); -} - -/* - * Bind socket to random port - */ -static int -__isns_socket_bind_random(int fd, - const struct sockaddr *orig_addr, - socklen_t src_len) -{ - struct sockaddr_storage addr; - struct sockaddr *src_addr; - uint16_t min = 888, max = 1024; - unsigned int loop = 0; - - /* Copy the address to a writable location */ - isns_assert(src_len <= sizeof(addr)); - memcpy(&addr, orig_addr, src_len); - src_addr = (struct sockaddr *) &addr; - - /* Bind to a random port */ - do { - uint16_t port; - - port = random(); - port = min + (port % (max - min)); - - isns_addr_set_port(src_addr, port); - - if (bind(fd, src_addr, src_len) == 0) - return 1; - - if (errno == EACCES && min < 1024) { - min = 1024; - max = 65535; - continue; - } - } while (errno == EADDRINUSE && ++loop < 128); - - isns_error("Unable to bind socket\n"); - return 0; -} - -/* - * Create a socket - */ -isns_socket_t * -__isns_create_socket(struct addrinfo *src, struct addrinfo *dst, int sock_type) -{ - isns_socket_t *sock; - - sock = isns_net_alloc(-1); - sock->is_type = sock_type; - - /* Set address lists */ - isns_sockaddr_init(&sock->is_dst, dst); - isns_sockaddr_init(&sock->is_src, src); - - if (dst) { - /* This is an outgoing connection. */ - sock->is_client = 1; - - if (!isns_socket_open(sock)) - goto failed; - - if (sock_type == SOCK_DGRAM) { - sock->is_poll_in = isns_net_dgram_recv; - sock->is_poll_out = isns_net_dgram_xmit; - sock->is_poll_mask = POLLIN; - - sock->is_retrans_timeout = isns_config.ic_network.udp_retrans_timeout; - - while (isns_net_dgram_connect(sock) < 0) { - if (isns_sockaddr_set_next(&sock->is_dst) - && sock->is_dst.list != dst) - continue; - isns_error("Unable to connect: %m\n"); - goto failed; - } - } else { - /* Stream socket */ - sock->is_poll_in = isns_net_stream_recv; - sock->is_poll_out = isns_net_stream_xmit; - sock->is_poll_hup = isns_net_stream_hup; - sock->is_error = isns_net_stream_error; - sock->is_poll_mask = POLLHUP; - - sock->is_retrans_timeout = isns_config.ic_network.tcp_retrans_timeout; - - isns_net_stream_reconnect(sock); - } - } else { - if (!isns_socket_open(sock)) - goto failed; - - if (sock_type == SOCK_DGRAM) { - sock->is_poll_in = isns_net_dgram_recv; - sock->is_poll_out = isns_net_dgram_xmit; - sock->is_state = ISNS_SOCK_IDLE; - } else { - sock->is_poll_in = isns_net_stream_accept; - sock->is_error = isns_net_stream_error; - sock->is_state = ISNS_SOCK_LISTENING; - } - sock->is_poll_mask = POLLIN; - } - - isns_list_append(&all_sockets, &sock->is_list); - return sock; - -failed: - isns_socket_free(sock); - return NULL; -} - -/* - * Connect to the master process - */ -isns_socket_t * -isns_create_bound_client_socket(const char *src_spec, const char *dst_spec, - const char *portspec, int af_hint, int sock_type) -{ - struct addrinfo *src = NULL, *dst; - - if (src_spec) { - src = isns_get_address_list(src_spec, NULL, af_hint, sock_type, 0); - if (src == NULL) - return NULL; - } - - dst = isns_get_address_list(dst_spec, portspec, af_hint, sock_type, 0); - if (dst == NULL) { - release_addrinfo(src); - return NULL; - } - - return __isns_create_socket(src, dst, sock_type); -} - -isns_socket_t * -isns_create_client_socket(const char *dst_spec, const char *portspec, int af_hint, int sock_type) -{ - return isns_create_bound_client_socket(NULL, dst_spec, portspec, af_hint, sock_type); -} - -static inline int -isns_socket_type_from_portal(const isns_portal_info_t *info) -{ - switch (info->proto) { - case IPPROTO_TCP: - return SOCK_STREAM; - case IPPROTO_UDP: - return SOCK_DGRAM; - default: - isns_error("Unknown protocol %d in portal\n", info->proto); - } - return -1; -} - -isns_socket_t * -isns_connect_to_portal(const isns_portal_info_t *info) -{ - struct sockaddr_storage dst_addr; - struct addrinfo *ai; - int dst_alen, sock_type; - - if ((sock_type = isns_socket_type_from_portal(info)) < 0) - return NULL; - - dst_alen = isns_portal_to_sockaddr(info, &dst_addr); - ai = __make_addrinfo((struct sockaddr *) &dst_addr, dst_alen, sock_type); - - return __isns_create_socket(NULL, ai, sock_type); -} - -/* - * Make server side disconnects isns_fatal. - * Nice for command line apps. - */ -void -isns_socket_set_disconnect_fatal(isns_socket_t *sock) -{ - sock->is_disconnect_fatal = 1; -} - -void -isns_socket_set_report_failure(isns_socket_t *sock) -{ - sock->is_report_failure = 1; -} - -/* - * Set the socket's security context - */ -void -isns_socket_set_security_ctx(isns_socket_t *sock, - isns_security_t *ctx) -{ - sock->is_security = ctx; -} - -/* - * Create a socket - */ -static isns_socket_t * -isns_net_alloc(int fd) -{ - isns_socket_t *new; - - new = isns_calloc(1, sizeof(*new)); - new->is_desc = fd; - if (fd >= 0) - new->is_state = ISNS_SOCK_IDLE; - else - new->is_state = ISNS_SOCK_DISCONNECTED; - - isns_message_queue_init(&new->is_partial); - isns_message_queue_init(&new->is_complete); - isns_message_queue_init(&new->is_pending); - isns_list_init(&new->is_list); - - return new; -} - -/* - * Open the socket - */ -static int -isns_socket_open(isns_socket_t *sock) -{ - int af, fd, state = ISNS_SOCK_IDLE; - - if (sock->is_desc >= 0) - return 1; - - af = sock->is_dst.addr.ss_family; - if (af != AF_UNSPEC) { - /* Select a matching source address */ - if (sock->is_src.list - && !isns_sockaddr_select(&sock->is_src, &sock->is_dst.addr)) { - isns_warning("No matching source address for given destination\n"); - return 0; - } - } else { - af = sock->is_src.addr.ss_family; - if (af == AF_UNSPEC) - return 0; - } - - if ((fd = socket(af, sock->is_type, 0)) < 0) { - isns_error("Unable to create socket: %m\n"); - return 0; - } - - if (sock->is_src.addr.ss_family != AF_UNSPEC) { - const struct sockaddr *src_addr; - int src_len, on = 1, bound = 0; - - src_addr = (struct sockaddr *) &sock->is_src.addr; - src_len = sock->is_src.addrlen; - - /* For debugging only! */ - if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) < 0) { - isns_error("setsockopt(SO_REUSEADDR) failed: %m\n"); - goto failed; - } - - switch (af) { - case AF_LOCAL: - unlink(((struct sockaddr_un *) src_addr)->sun_path); - - if (sock->is_type == SOCK_STREAM - && setsockopt(fd, SOL_SOCKET, SO_PASSCRED, - &on, sizeof(on)) < 0) { - isns_error("setsockopt(SO_PASSCRED) failed: %m\n"); - goto failed; - } - break; - - case AF_INET: - case AF_INET6: - if (isns_addr_get_port(src_addr) == 0) { - if (!__isns_socket_bind_random(fd, src_addr, src_len)) - goto failed; - bound++; - } - break; - } - - if (!bound && bind(fd, src_addr, src_len) < 0) { - isns_error("Unable to bind socket: %m\n"); - goto failed; - } - } - - if (sock->is_client) { - /* Set to nonblocking behavior; makes the connect - * call return instantly. */ - fcntl(fd, F_SETFL, O_NONBLOCK); - } else { - if (sock->is_type == SOCK_STREAM) { - if (listen(fd, 128) < 0) { - isns_error("Unable to listen on socket: %m\n"); - goto failed; - } - state = ISNS_SOCK_LISTENING; - } - } - - sock->is_desc = fd; - sock->is_state = state; - return 1; - -failed: - close(fd); - return 0; -} - -/* - * Destroy a socket - */ -static inline void -isns_socket_destroy(isns_socket_t *sock) -{ - isns_sockaddr_destroy(&sock->is_dst); - isns_sockaddr_destroy(&sock->is_src); - isns_free(sock); -} - -void -isns_socket_free(isns_socket_t *sock) -{ - isns_net_close(sock, ISNS_SOCK_DEAD); - isns_list_del(&sock->is_list); - - sock->is_destroy = 1; - if (sock->is_users == 0) - isns_socket_destroy(sock); -} - -int -isns_socket_release(isns_socket_t *sock) -{ - isns_assert(sock->is_users); - sock->is_users -= 1; - - if (sock->is_destroy) { - if (!sock->is_users) - isns_socket_destroy(sock); - return 0; - } - return 1; -} - -/* - * Display a socket - */ -#if SOCK_DEBUG_VERBOSE > 0 -static const char * -isns_socket_state_name(int state) -{ - static char xbuf[16]; - - switch (state) { - case ISNS_SOCK_LISTENING: - return "listening"; - case ISNS_SOCK_CONNECTING: - return "connecting"; - case ISNS_SOCK_IDLE: - return "idle"; - case ISNS_SOCK_FAILED: - return "failed"; - case ISNS_SOCK_DISCONNECTED: - return "disconnected"; - case ISNS_SOCK_DEAD: - return "dead"; - } - snprintf(xbuf, sizeof(xbuf), "<%u>", state); - return xbuf; -} - -static void -isns_print_socket(const isns_socket_t *sock) -{ - isns_message_t *msg = NULL; - char buffer[8192]; - size_t pos = 0, size = sizeof(buffer); - - snprintf(buffer + pos, size - pos, - "socket %p desc %d state %s", - sock, sock->is_desc, - isns_socket_state_name(sock->is_state)); - pos = strlen(buffer); - - if (timerisset(&sock->is_deadline)) { - snprintf(buffer + pos, size - pos, " deadline=%ldms", - __timeout_millisec(NULL, &sock->is_deadline)); - pos = strlen(buffer); - } - - if ((msg = isns_message_queue_head(&sock->is_pending)) != NULL) { - snprintf(buffer + pos, size - pos, " msg timeout=%ldms", - __timeout_millisec(NULL, &msg->im_timeout)); - pos = strlen(buffer); - } - - isns_debug_socket("%s\n", buffer); -} -#else -#define isns_print_socket(p) do { } while (0) -#endif - -/* - * Process incoming messages, and timeouts - */ -static int -isns_net_validate(isns_socket_t *sock, isns_message_t *msg, - const isns_message_t *check_msg) -{ - isns_message_t *orig = NULL; - int verdict = ISNS_MSG_DISCARD; - - if (sock->is_security && !msg->im_security) { - /* Rude server, or malicious man in the - * middle. */ - isns_debug_message("Ignoring unauthenticated message\n"); - goto out; - } - - /* If this is a request, return it. */ - if (!(msg->im_header.i_function & 0x8000)) { - if (check_msg == NULL) { - verdict = ISNS_MSG_RETURN; - } else { - /* Else: see if there's a server attached to this - * socket. */ - } - goto out; - } - - orig = isns_message_queue_find(&sock->is_pending, msg->im_xid, NULL, 0); - if (orig == NULL) { - isns_debug_message("Ignoring spurious response message (xid=%04x)\n", - msg->im_xid); - goto out; - } - - isns_message_unlink(orig); - if (orig->im_header.i_function != (msg->im_header.i_function & 0x7FFF)) { - isns_debug_message("Response message doesn't match function\n"); - goto out; - } - - if (check_msg == orig) { - verdict = ISNS_MSG_RETURN; - } else { - isns_debug_message("Received response for pending message 0x%x\n", - msg->im_xid); - if (orig->im_callback) - orig->im_callback(orig, msg); - verdict = ISNS_MSG_DONE; - } - -out: - isns_message_release(orig); - return verdict; -} - -static void -isns_net_timeout(isns_socket_t *sock, isns_message_t *msg) -{ - if (msg->im_callback) - msg->im_callback(msg, NULL); - isns_message_release(msg); -} - -/* - * Helper function to update timeout - */ -static inline void -__set_timeout(struct timeval *end, unsigned long timeout) -{ - gettimeofday(end, NULL); - end->tv_sec += timeout; -} - -static inline int -__timeout_expired(const struct timeval *now, const struct timeval *expires) -{ - /* FIXME: Should ignore sub-millisecond remainder */ - return timercmp(now, expires, >=); -} - -static long -__timeout_millisec(const struct timeval *now, const struct timeval *expires) -{ - struct timeval __now, delta = { 0, 0 }; - - if (now == NULL) { - gettimeofday(&__now, NULL); - now = &__now; - } - - timersub(expires, now, &delta); - - return delta.tv_sec * 1000 + delta.tv_usec / 1000; -} - -static inline void -__update_timeout(struct timeval *end, const struct timeval *timeout) -{ - if (!timerisset(end) || timercmp(timeout, end, <)) - *end = *timeout; -} - -/* - * Get the next iSNS message - */ -isns_message_t * -__isns_recv_message(const struct timeval *end_time, isns_message_t *watch_msg) -{ - isns_socket_t *sock, **sock_list; - isns_list_t *pos, *next; - struct pollfd *pfd; - unsigned int i, count, max_sockets; - struct timeval now, this_end; - int r; - - max_sockets = isns_config.ic_network.max_sockets; - sock_list = alloca(max_sockets * sizeof(sock_list[0])); - pfd = alloca(max_sockets * sizeof(pfd[0])); - -again: - timerclear(&this_end); - gettimeofday(&now, NULL); - - if (end_time) { - if (__timeout_expired(&now, end_time)) - return NULL; - this_end = *end_time; - } - - i = 0; - isns_list_foreach(&all_sockets, pos, next) { - isns_socket_t *sock = isns_list_item(isns_socket_t, is_list, pos); - isns_message_t *msg = NULL; - - /* We need to be a little careful here; callbacks may - * mark the socket for destruction. - * Bumping is_users while we're busy with the socket - * prevents mayhem. */ - sock->is_users++; - - while ((msg = isns_message_dequeue(&sock->is_complete)) != NULL) { - switch (isns_net_validate(sock, msg, watch_msg)) { - case ISNS_MSG_RETURN: - isns_assert(!sock->is_destroy); - isns_socket_release(sock); - return msg; - default: - isns_message_release(msg); - isns_socket_release(sock); - return NULL; - } - } - - isns_print_socket(sock); - - /* This handles reconnect, idle disconnect etc. */ - while (timerisset(&sock->is_deadline)) { - if (__timeout_expired(&now, &sock->is_deadline)) { - timerclear(&sock->is_deadline); - sock->is_timeout(sock); - isns_print_socket(sock); - continue; - } - __update_timeout(&this_end, &sock->is_deadline); - break; - } - - /* No more input and output means closed&dead */ - if (sock->is_state == ISNS_SOCK_IDLE - && !(sock->is_poll_mask & (POLLIN|POLLOUT))) { - isns_debug_socket("connection closed by peer, killing socket\n"); - isns_net_close(sock, ISNS_SOCK_FAILED); - } - - /* Check whether pending messages have timed out. */ - while ((msg = isns_message_queue_head(&sock->is_pending)) != - NULL) { - if (__timeout_expired(&now, &msg->im_timeout)) { - isns_debug_socket("sock %p message %04x timed out\n", - sock, msg->im_xid); - isns_message_unlink(msg); - if (msg == watch_msg) { - isns_message_release(msg); - isns_socket_release(sock); - return NULL; - } - - isns_net_timeout(sock, msg); - continue; - } - - if (!__timeout_expired(&now, &msg->im_resend_timeout)) { - __update_timeout(&this_end, - &msg->im_resend_timeout); - /* In odd configurations, the call_timeout - * may be lower than the resend_timeout */ - __update_timeout(&this_end, - &msg->im_timeout); - break; - } - - isns_debug_socket("sock %p message %04x - " - "minor timeout, resending.\n", - sock, msg->im_xid); - - /* If a TCP socket times out, something is - * fishy. Force a reconnect, which will resend - * all pending messages. */ - if (sock->is_type == SOCK_STREAM) { - isns_net_close(sock, ISNS_SOCK_DISCONNECTED); - isns_net_set_timeout(sock, - isns_net_stream_reconnect, - 0); - break; - } - - /* UDP socket - retransmit this one message */ - isns_message_queue_remove(&sock->is_pending, msg); - isns_socket_queue_message(sock, msg); - isns_message_release(msg); - } - - /* - * If the socket on which we're waiting right - * now got disconnected, or had any other kind of - * error, return right away to let the caller know. - */ - if (sock->is_state == ISNS_SOCK_FAILED) { - if (sock->is_disconnect_fatal) - goto kill_socket; - if (sock->is_report_failure) { - isns_socket_release(sock); - return NULL; - } - sock->is_state = ISNS_SOCK_DISCONNECTED; - isns_socket_release(sock); - continue; - } - - if (sock->is_state == ISNS_SOCK_DEAD) { -kill_socket: - isns_list_del(&sock->is_list); - if (sock->is_report_failure) { - isns_socket_release(sock); - return NULL; - } - if (!sock->is_client) - isns_socket_free(sock); - isns_socket_release(sock); - continue; - } - - /* This will return 0 if the socket was marked for - * destruction. */ - if (!isns_socket_release(sock)) - continue; - - /* should not happen */ - if (i >= max_sockets) - break; - - pfd[i].fd = sock->is_desc; - pfd[i].events = sock->is_poll_mask; - sock_list[i] = sock; - i++; - } - count = i; - - if (timerisset(&this_end)) { - long millisec; - - /* timeval arithmetic can yield sub-millisecond timeouts. - * Round up to prevent looping. */ - millisec = __timeout_millisec(&now, &this_end); - if (millisec == 0) - millisec += 1; - - debug_verbose2("poll(%p, %u, %d)\n", pfd, count, millisec); - r = poll(pfd, count, millisec); - } else { - r = poll(pfd, count, -1); - } - - if (r < 0) { - if (errno != EINTR) - isns_error("poll returned error: %m\n"); - return NULL; - } - - /* Any new incoming connections will be added to the - * head of the list. */ - for (i = 0; i < count; ++i) { - sock = sock_list[i]; - if (pfd[i].revents & POLLIN) - sock->is_poll_in(sock); - if (pfd[i].revents & POLLOUT) - sock->is_poll_out(sock); - if (pfd[i].revents & POLLHUP) - sock->is_poll_hup(sock); - } - - goto again; -} - -isns_message_t * -isns_recv_message(struct timeval *timeout) -{ - isns_message_t *msg; - struct timeval end; - - if (timeout == NULL) - return __isns_recv_message(NULL, NULL); - - gettimeofday(&end, NULL); - timeradd(&end, timeout, &end); - msg = __isns_recv_message(&end, NULL); - - if (msg == NULL) - return msg; - isns_debug_socket("Next message xid=%04x\n", msg->im_xid); - if (msg->im_security) { - isns_debug_message("Received authenticated message from \"%s\"\n", - isns_principal_name(msg->im_security)); - } else if (isns_config.ic_security) { - isns_debug_message("Received unauthenticated message\n"); - } else { - isns_debug_message("Received message\n"); - } - return msg; -} - -int -isns_socket_send(isns_socket_t *sock, isns_message_t *msg) -{ - struct isns_hdr *hdr; - size_t pdu_len; - buf_t *bp; - - /* If the socket is disconnected, and the - * reconnect timeout is not set, force a - * reconnect right away. */ - if (sock->is_state == ISNS_SOCK_DISCONNECTED - && !timerisset(&sock->is_deadline)) { - isns_net_set_timeout(sock, - isns_net_stream_reconnect, 0); - } - - if (!(bp = msg->im_payload)) - return 0; - - pdu_len = buf_avail(bp); - if (pdu_len < sizeof(*hdr)) - return 0; - - /* Pad PDU to multiple of 4 bytes, if needed */ - if (pdu_len & 3) { - unsigned int pad = 4 - (pdu_len & 3); - - if (!buf_put(bp, "\0\0\0", pad)) - return 0; - pdu_len += pad; - } - - if (!(bp = buf_dup(bp))) - return 0; - - hdr = buf_head(bp); - - hdr->i_version = htons(msg->im_header.i_version); - hdr->i_function = htons(msg->im_header.i_function); - hdr->i_flags = htons(msg->im_header.i_flags); - hdr->i_length = htons(pdu_len - sizeof(*hdr)); - hdr->i_xid = htons(msg->im_header.i_xid); - hdr->i_seq = htons(msg->im_header.i_seq); - - /* For now, we deal with unfragmented messages only. */ - hdr->i_flags |= htons(ISNS_F_FIRST_PDU|ISNS_F_LAST_PDU); - - if (sock->is_security) { -#ifdef WITH_SECURITY - hdr->i_flags |= htons(ISNS_F_AUTHBLK_PRESENT); - if (!isns_pdu_seal(sock->is_security, bp)) { - isns_debug_message("Error adding auth block to outgoing PDU\n"); - goto error; - } -#else - isns_debug_message("%s: Authentication not supported\n", - __FUNCTION__); - goto error; -#endif - } - - bp->addr = msg->im_addr; - bp->addrlen = msg->im_addrlen; - - buf_list_append(&sock->is_xmit_buf, bp); - sock->is_poll_mask |= POLLOUT; - - /* Set the retransmit timeout */ - __set_timeout(&msg->im_resend_timeout, sock->is_retrans_timeout); - return 1; - -error: - buf_free(bp); - return 0; -} - -/* - * Queue a message to a socket - */ -int -isns_socket_queue_message(isns_socket_t *sock, isns_message_t *msg) -{ - if (!isns_socket_send(sock, msg)) - return 0; - - /* Insert sorted by timeout. For now, this amounts to - * appending at the end of the list, but that may change - * if we implement exponential backoff for UDP */ - isns_message_queue_insert_sorted(&sock->is_pending, - ISNS_MQ_SORT_RESEND_TIMEOUT, msg); - msg->im_socket = sock; - return 1; -} - -/* - * Retransmit any queued messages - */ -int -isns_socket_retransmit_queued(isns_socket_t *sock) -{ - isns_message_t *msg; - isns_list_t *pos; - - isns_debug_socket("%s(%p)\n", __FUNCTION__, sock); - isns_message_queue_foreach(&sock->is_pending, pos, msg) { - if (!isns_socket_send(sock, msg)) - isns_warning("Unable to retransmit message\n"); - } - return 1; -} - -/* - * Submit a message to the socket, for asynchronous calls - */ -int -isns_socket_submit(isns_socket_t *sock, isns_message_t *msg, long timeout) -{ - if (timeout <= 0) - timeout = isns_config.ic_network.call_timeout; - - __set_timeout(&msg->im_timeout, timeout); - return isns_socket_queue_message(sock, msg); -} - -/* - * Transmit a message and wait for a response. - */ -isns_message_t * -isns_socket_call(isns_socket_t *sock, isns_message_t *msg, long timeout) -{ - isns_message_t *resp; - - debug_verbose("isns_socket_call(sock=%p, msg=%p, timeout=%ld)\n", - sock, msg, timeout); - if (timeout <= 0) - timeout = isns_config.ic_network.call_timeout; - - __set_timeout(&msg->im_timeout, timeout); - if (!isns_socket_queue_message(sock, msg)) - return NULL; - - sock->is_report_failure = 1; - resp = __isns_recv_message(NULL, msg); - sock->is_report_failure = 0; - - if (isns_message_unlink(msg)) { - /* We can get here if __isns_recv_message returned - * due to a fatal socket error. */ - isns_debug_socket("%s: msg not unlinked!\n", __FUNCTION__); - isns_message_release(msg); - } - - if (resp == NULL && sock->is_type == SOCK_STREAM) - isns_net_close(sock, ISNS_SOCK_DISCONNECTED); - - return resp; -} - -/* - * Resolve a hostname - */ -struct addrinfo * -isns_get_address_list(const char *addrspec, const char *port, - int af_hint, int sock_type, int flags) -{ - struct addrinfo hints, *found = NULL, *res = NULL; - char *copy = NULL, *host = NULL, *s; - int rv; - - memset(&hints, 0, sizeof(hints)); - hints.ai_flags = AI_ADDRCONFIG; - - if (addrspec && addrspec[0] == '/') { - if (af_hint != AF_LOCAL && af_hint != AF_UNSPEC) { - isns_debug_socket("Path as address, but af_hint=%d\n", - af_hint); - goto bad_address; - } - - res = make_addrinfo_unix(addrspec, SOCK_STREAM); - goto out; - } - - if (addrspec) { - copy = host = isns_strdup(addrspec); - if (*host == '[') { - hints.ai_flags |= AI_NUMERICHOST; - if ((s = strchr(host, ']')) == NULL) - goto bad_address; - - *s++ = '\0'; - if (*s == ':') - port = ++s; - else if (*s) - goto bad_address; - } else if ((s = strchr(host, ':')) != NULL) { - *s++ = '\0'; - if (!*s) - goto bad_address; - port = s; - } - - if (*host == '\0') - host = NULL; - } else if (port == NULL) { - /* Just wildcard */ - res = make_addrinfo_any(af_hint, sock_type); - goto out; - } - - hints.ai_family = af_hint; - hints.ai_flags |= flags; - hints.ai_socktype = sock_type; - if (af_hint == AF_INET6) - hints.ai_flags |= AI_V4MAPPED; - - rv = getaddrinfo(host, port, &hints, &found); - if (rv) { - isns_error("Cannot resolve address \"%s\": %s\n", - addrspec, gai_strerror(rv)); - goto out; - } - - if (found == NULL) { - isns_error("No useable addresses returned.\n"); - goto out; - } - - res = clone_addrinfo(found); - -out: - if (found) - freeaddrinfo(found); - isns_free(copy); - return res; - -bad_address: - isns_error("Cannot parse address spec \"%s\"\n", - addrspec); - goto out; -} - -int -isns_get_address(struct sockaddr_storage *result, - const char *addrspec, - const char *port, - int af_hint, int sock_type, int flags) -{ - struct addrinfo *ai; - int alen; - - if (!(ai = isns_get_address_list(addrspec, port, af_hint, sock_type, flags))) - return -1; - - alen = ai->ai_addrlen; - if (alen > sizeof(*result)) - return -1; - memcpy(result, ai->ai_addr, alen); - release_addrinfo(ai); - return alen; -} - -/* - * Get the canonical hostname - */ -char * -isns_get_canon_name(const char *hostname) -{ - struct addrinfo hints, *res = NULL; - char *fqdn = NULL; - int rv; - - memset(&hints, 0, sizeof(hints)); - hints.ai_flags = AI_CANONNAME; - - rv = getaddrinfo(hostname, NULL, &hints, &res); - if (rv) { - isns_error("Cannot resolve hostname \"%s\": %s\n", - hostname, gai_strerror(rv)); - goto out; - } - - if (res == NULL) { - isns_error("No useable addresses returned.\n"); - goto out; - } - - - fqdn = isns_strdup(res->ai_canonname); - -out: - if (res) - freeaddrinfo(res); - return fqdn; -} - -int -isns_socket_get_local_addr(const isns_socket_t *sock, - struct sockaddr_storage *addr) -{ - socklen_t alen; - - if (sock->is_desc < 0) - return 0; - if (getsockname(sock->is_desc, - (struct sockaddr *) addr, &alen) < 0) { - isns_error("getsockname: %m\n"); - return 0; - } - - return 1; -} - -int -isns_socket_get_portal_info(const isns_socket_t *sock, - isns_portal_info_t *portal) -{ - struct sockaddr_storage addr; - socklen_t alen; - int fd, success = 0; - - memset(portal, 0, sizeof(*portal)); - - /* If the socket is currently closed (eg because the - * server shut down the connection), we cannot get the - * local address easily. Create a temporary UDP socket, - * connect it, and query that socket. */ - if ((fd = sock->is_desc) < 0) { - const struct sockaddr *daddr; - - daddr = (struct sockaddr *) &sock->is_dst.addr; - fd = socket(daddr->sa_family, SOCK_DGRAM, 0); - if (fd < 0) - goto out; - if (connect(fd, daddr, sizeof(sock->is_dst.addr)) < 0) - goto out; - } - - alen = sizeof(addr); - if (getsockname(fd, (struct sockaddr *) &addr, &alen) < 0) { - isns_error("getsockname: %m\n"); - goto out; - } - - if (!isns_portal_from_sockaddr(portal, &addr)) - goto out; - if (sock->is_type == SOCK_STREAM) - portal->proto = IPPROTO_TCP; - else - portal->proto = IPPROTO_UDP; - - debug_verbose("socket_get_portal: %s\n", isns_portal_string(portal)); - success = 1; - -out: - /* If we used a temp UDP socket, close it */ - if (fd >= 0 && fd != sock->is_desc) - close(fd); - return success; -} - -isns_socket_t * -isns_socket_find_server(const isns_portal_info_t *portal) -{ - struct sockaddr_storage bound_addr; - int sock_type, addr_len; - isns_list_t *pos, *next; - - addr_len = isns_portal_to_sockaddr(portal, &bound_addr); - if ((sock_type = isns_socket_type_from_portal(portal)) < 0) - return NULL; - - isns_list_foreach(&all_sockets, pos, next) { - isns_socket_t *sock = isns_list_item(isns_socket_t, is_list, pos); - - if (!sock->is_client - && sock->is_type == sock_type - && sock->is_dst.addrlen == addr_len - && !memcmp(&sock->is_dst.addr, &bound_addr, addr_len)) { - sock->is_users++; - return sock; - } - } - - return NULL; -} - -int -isns_addr_get_port(const struct sockaddr *addr) -{ - const struct sockaddr_in *sin; - const struct sockaddr_in6 *six; - - switch (addr->sa_family) { - case AF_INET: - sin = (const struct sockaddr_in *) addr; - return ntohs(sin->sin_port); - - case AF_INET6: - six = (const struct sockaddr_in6 *) addr; - return ntohs(six->sin6_port); - } - return 0; -} - -void -isns_addr_set_port(struct sockaddr *addr, unsigned int port) -{ - struct sockaddr_in *sin; - struct sockaddr_in6 *six; - - switch (addr->sa_family) { - case AF_INET: - sin = (struct sockaddr_in *) addr; - sin->sin_port = htons(port); - break; - - case AF_INET6: - six = (struct sockaddr_in6 *) addr; - six->sin6_port = htons(port); - break; - } -} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/socket.h open-iscsi-2.0.874/utils/open-isns/socket.h --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/socket.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/socket.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,95 +0,0 @@ -/* - * iSNS network code - * - * Copyright (C) 2007 Olaf Kirch - */ - -#ifndef ISNS_SOCKET_H -#define ISNS_SOCKET_H - -#include "isns.h" -#include "buffer.h" -#include "message.h" - -struct isns_partial_msg { - isns_message_t imp_base; - uint32_t imp_flags; - uint32_t imp_first_seq; - uint32_t imp_last_seq; - unsigned int imp_pdu_count; - unsigned int imp_msg_size; - buf_t * imp_chain; - - struct ucred imp_credbuf; -}; - -#define imp_users imp_base.im_users -#define imp_list imp_base.im_list -#define imp_xid imp_base.im_xid -#define imp_header imp_base.im_header -#define imp_addr imp_base.im_addr -#define imp_addrlen imp_base.im_addrlen -#define imp_header imp_base.im_header -#define imp_payload imp_base.im_payload -#define imp_security imp_base.im_security -#define imp_creds imp_base.im_creds - -enum { - ISNS_SOCK_LISTENING, - ISNS_SOCK_CONNECTING, - ISNS_SOCK_IDLE, - ISNS_SOCK_FAILED, - ISNS_SOCK_DISCONNECTED, - ISNS_SOCK_DEAD, -}; - -/* Helper class */ -struct __isns_socket_addr { - struct sockaddr_storage addr; - socklen_t addrlen; - struct addrinfo * list; -}; - -struct isns_socket { - isns_list_t is_list; - int is_desc; - int is_type; - unsigned int is_client : 1, - is_autoclose : 1, - is_disconnect_fatal : 1, - is_report_failure : 1, - is_destroy : 1; - unsigned int is_users; - int is_poll_mask; - int is_state; - - isns_security_t * is_security; - - struct __isns_socket_addr is_src, is_dst; - - unsigned int is_retrans_timeout; - - /* If we're past this time, is_timeout() is called. */ - struct timeval is_deadline; - - buf_t * is_recv_buf; - buf_t * is_xmit_buf; - - size_t is_queue_size; - isns_message_queue_t is_partial; - isns_message_queue_t is_complete; - isns_message_queue_t is_pending; - - void (*is_poll_in)(isns_socket_t *); - void (*is_poll_out)(isns_socket_t *); - void (*is_poll_hup)(isns_socket_t *); - void (*is_poll_err)(isns_socket_t *); - void (*is_timeout)(isns_socket_t *); - void (*is_error)(isns_socket_t *, int); -}; - -extern int isns_socket_submit(isns_socket_t *, - isns_message_t *, - long); - -#endif /* ISNS_SOCKET_H */ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/source.h open-iscsi-2.0.874/utils/open-isns/source.h --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/source.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/source.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -/* - * iSNS source attribute handling - * - * Copyright (C) 2007 Olaf Kirch - */ - -#ifndef ISNS_SOURCE_H -#define ISNS_SOURCE_H - -#include "attrs.h" - -struct isns_source { - unsigned int is_users; - isns_attr_t * is_attr; - unsigned int is_untrusted : 1; - - isns_object_t * is_node; - unsigned int is_node_type; - - isns_object_t * is_entity; -}; - -extern int isns_source_encode(buf_t *, const isns_source_t *); -extern int isns_source_decode(buf_t *, isns_source_t **); -extern int isns_source_set_node(isns_source_t *, isns_db_t *); -extern void isns_source_set_entity(isns_source_t *, isns_object_t *); -extern isns_source_t * isns_source_dummy(void); - -extern char * isns_build_source_pattern(const char *); -extern int isns_source_pattern_match(const char *, const char *); - -#endif /* ISNS_SOURCE_H */ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/storage-node.c open-iscsi-2.0.874/utils/open-isns/storage-node.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/storage-node.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/storage-node.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,202 +0,0 @@ -/* - * iSNS object model - storage node - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include -#include -#include -#include "isns.h" -#include "objects.h" -#include "util.h" - -isns_object_t * -isns_create_storage_node(const char *name, uint32_t type, - isns_object_t *parent) -{ - isns_object_t *obj; - - if (parent && !ISNS_IS_ENTITY(parent)) { - isns_warning("Invalid container type \"%s\" for storage node: " - "should be \"%s\"\n", - parent->ie_template->iot_name, - isns_entity_template.iot_name); - return NULL; - } - - obj = isns_create_object(&isns_iscsi_node_template, NULL, parent); - isns_object_set_string(obj, - ISNS_TAG_ISCSI_NAME, name); - isns_object_set_uint32(obj, - ISNS_TAG_ISCSI_NODE_TYPE, type); - - return obj; -} - -isns_object_t * -isns_create_storage_node2(const isns_source_t *source, - uint32_t type, - isns_object_t *parent) -{ - isns_attr_t *name_attr; - isns_object_t *obj; - - if (parent && !ISNS_IS_ENTITY(parent)) { - isns_warning("Invalid container type \"%s\" for storage node: " - "should be \"%s\"\n", - parent->ie_template->iot_name, - isns_entity_template.iot_name); - return NULL; - } - if ((name_attr = isns_source_attr(source)) == NULL) { - isns_warning("No source attribute\n"); - return NULL; - } - - if (name_attr->ia_tag_id == ISNS_TAG_ISCSI_NAME) { - obj = isns_create_object(&isns_iscsi_node_template, NULL, parent); - isns_attr_list_update_attr(&obj->ie_attrs, name_attr); - isns_object_set_uint32(obj, - ISNS_TAG_ISCSI_NODE_TYPE, type); - } else { - /* No iFCP yet, sorry */ - isns_warning("%s: source tag type %u not supported\n", - __FUNCTION__); - return NULL; - } - - return obj; -} - -isns_object_t * -isns_create_iscsi_initiator(const char *name, - isns_object_t *parent) -{ - return isns_create_storage_node(name, - 1 << ISNS_ISCSI_NODE_TYPE_INITIATOR, - parent); -} - -isns_object_t * -isns_create_iscsi_target(const char *name, - isns_object_t *parent) -{ - return isns_create_storage_node(name, - 1 << ISNS_ISCSI_NODE_TYPE_TARGET, - parent); -} - -const char * -isns_storage_node_name(const isns_object_t *node) -{ - const isns_attr_t *attr; - - if (node->ie_attrs.ial_count == 0) - return NULL; - attr = node->ie_attrs.ial_data[0]; - if (attr->ia_value.iv_type != &isns_attr_type_string) - return NULL; - - switch (attr->ia_tag_id) { - case ISNS_TAG_ISCSI_NAME: - case ISNS_TAG_FC_PORT_NAME_WWPN: - return attr->ia_value.iv_string; - } - - return 0; - -} - -isns_attr_t * -isns_storage_node_key_attr(const isns_object_t *node) -{ - if (node->ie_attrs.ial_count == 0) - return NULL; - return node->ie_attrs.ial_data[0]; -} - -static uint32_t iscsi_node_attrs[] = { - ISNS_TAG_ISCSI_NAME, - ISNS_TAG_ISCSI_NODE_TYPE, - ISNS_TAG_ISCSI_ALIAS, - ISNS_TAG_ISCSI_SCN_BITMAP, - ISNS_TAG_ISCSI_NODE_INDEX, - ISNS_TAG_WWNN_TOKEN, - ISNS_TAG_ISCSI_AUTHMETHOD, - /* RFC 4171 lists a "iSCSI node certificate" - * as an option attribute of an iSCSI - * storage node, but doesn't define it anywhere - * in the spec. - */ -}; - -static uint32_t iscsi_node_key_attrs[] = { - ISNS_TAG_ISCSI_NAME, -}; - -isns_object_template_t isns_iscsi_node_template = { - .iot_name = "iSCSI Storage Node", - .iot_handle = ISNS_OBJECT_TYPE_NODE, - .iot_attrs = iscsi_node_attrs, - .iot_num_attrs = array_num_elements(iscsi_node_attrs), - .iot_keys = iscsi_node_key_attrs, - .iot_num_keys = array_num_elements(iscsi_node_key_attrs), - .iot_index = ISNS_TAG_ISCSI_NODE_INDEX, - .iot_next_index = ISNS_TAG_ISCSI_NODE_NEXT_INDEX, - .iot_container = &isns_entity_template, -}; - -static uint32_t fc_port_attrs[] = { - ISNS_TAG_FC_PORT_NAME_WWPN, - ISNS_TAG_PORT_ID, - ISNS_TAG_FC_PORT_TYPE, - ISNS_TAG_SYMBOLIC_PORT_NAME, - ISNS_TAG_FABRIC_PORT_NAME, - ISNS_TAG_HARD_ADDRESS, - ISNS_TAG_PORT_IP_ADDRESS, - ISNS_TAG_CLASS_OF_SERVICE, - ISNS_TAG_FC4_TYPES, - ISNS_TAG_FC4_DESCRIPTOR, - ISNS_TAG_FC4_FEATURES, - ISNS_TAG_IFCP_SCN_BITMAP, - ISNS_TAG_PORT_ROLE, - ISNS_TAG_PERMANENT_PORT_NAME, -}; - -static uint32_t fc_port_key_attrs[] = { - ISNS_TAG_FC_PORT_NAME_WWPN, -}; - -isns_object_template_t isns_fc_port_template = { - .iot_name = "iFCP Port", - .iot_handle = ISNS_OBJECT_TYPE_FC_PORT, - .iot_attrs = fc_port_attrs, - .iot_num_attrs = array_num_elements(fc_port_attrs), - .iot_keys = fc_port_key_attrs, - .iot_num_keys = array_num_elements(fc_port_key_attrs), - .iot_container = &isns_entity_template, -}; - -static uint32_t fc_node_attrs[] = { - ISNS_TAG_FC_NODE_NAME_WWNN, - ISNS_TAG_SYMBOLIC_NODE_NAME, - ISNS_TAG_NODE_IP_ADDRESS, - ISNS_TAG_NODE_IPA, - ISNS_TAG_PROXY_ISCSI_NAME, -}; - -static uint32_t fc_node_key_attrs[] = { - ISNS_TAG_FC_NODE_NAME_WWNN, -}; - -isns_object_template_t isns_fc_node_template = { - .iot_name = "iFCP Device Node", - .iot_handle = ISNS_OBJECT_TYPE_FC_NODE, - .iot_attrs = fc_node_attrs, - .iot_num_attrs = array_num_elements(fc_node_attrs), - .iot_keys = fc_node_key_attrs, - .iot_num_keys = array_num_elements(fc_node_key_attrs), - .iot_container = &isns_fc_port_template, -}; - diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/sysdep-unix.c open-iscsi-2.0.874/utils/open-isns/sysdep-unix.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/sysdep-unix.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/sysdep-unix.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,186 +0,0 @@ -/* - * System dependent stuff - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include -#include -#include -#include -#include "isns.h" -#include "util.h" - -int isns_get_nr_portals(void) -{ - char buffer[8192], *end, *ptr; - struct ifconf ifc; - unsigned int nportals = 0; - int fd = -1; - - if ((fd = socket(PF_INET, SOCK_DGRAM, 0)) < 0) { - isns_error("%s: no socket - %m\n", __FUNCTION__); - return 0; - } - - ifc.ifc_buf = buffer; - ifc.ifc_len = sizeof(buffer); - if (ioctl(fd, SIOCGIFCONF, &ifc) < 0) { - isns_error("ioctl(SIOCGIFCONF): %m\n"); - goto out; - } - - ptr = buffer; - end = buffer + ifc.ifc_len; - while (ptr < end) { - struct ifreq ifr; - struct sockaddr_storage ifaddr; - int ifflags; - - memcpy(&ifr, ptr, sizeof(ifr)); - ptr += sizeof(ifr); - - /* Get the interface addr */ - memcpy(&ifaddr, &ifr.ifr_addr, sizeof(ifr.ifr_addr)); - - if (ioctl(fd, SIOCGIFFLAGS, &ifr) < 0) { - isns_error("ioctl(%s, SIOCGIFFLAGS): %m\n", - ifr.ifr_name); - continue; - } - ifflags = ifr.ifr_flags; - - if ((ifflags & IFF_UP) == 0) - continue; - if ((ifflags & IFF_LOOPBACK) != 0) - continue; - - if (ifaddr.ss_family == AF_INET6 || ifaddr.ss_family == AF_INET) - nportals++; - } - -out: - if (fd >= 0) - close(fd); - return nportals; -} - -int -isns_enumerate_portals(isns_portal_info_t *result, unsigned int max) -{ - char buffer[8192], *end, *ptr; - struct ifconf ifc; - unsigned int nportals = 0; - int fd = -1; - - if ((fd = socket(PF_INET, SOCK_DGRAM, 0)) < 0) { - isns_error("%s: no socket - %m\n", __FUNCTION__); - return 0; - } - - ifc.ifc_buf = buffer; - ifc.ifc_len = sizeof(buffer); - if (ioctl(fd, SIOCGIFCONF, &ifc) < 0) { - isns_error("ioctl(SIOCGIFCONF): %m\n"); - goto out; - } - - ptr = buffer; - end = buffer + ifc.ifc_len; - while (ptr < end) { - struct ifreq ifr; - struct sockaddr_storage ifaddr; - isns_portal_info_t portal; - int ifflags; - - memcpy(&ifr, ptr, sizeof(ifr)); - ptr += sizeof(ifr); - - /* Get the interface addr */ - memcpy(&ifaddr, &ifr.ifr_addr, sizeof(ifr.ifr_addr)); - - if (ioctl(fd, SIOCGIFFLAGS, &ifr) < 0) { - isns_error("ioctl(%s, SIOCGIFFLAGS): %m\n", - ifr.ifr_name); - continue; - } - ifflags = ifr.ifr_flags; - - if ((ifflags & IFF_UP) == 0) - continue; - if ((ifflags & IFF_LOOPBACK) != 0) - continue; - - if (!isns_portal_from_sockaddr(&portal, &ifaddr)) - continue; - - isns_debug_socket("Got interface %u: %s %s\n", - nportals, ifr.ifr_name, - isns_portal_string(&portal)); - if (nportals < max) - result[nportals++] = portal; - } - -out: - if (fd >= 0) - close(fd); - return nportals; -} - -int -isns_portal_from_sockaddr(isns_portal_info_t *portal, - const struct sockaddr_storage *addr) -{ - struct sockaddr_in6 *six; - struct sockaddr_in *sin; - - memset(portal, 0, sizeof(*portal)); - - /* May have to convert AF_INET to AF_INET6 */ - six = &portal->addr; - switch (addr->ss_family) { - case AF_INET6: - memcpy(six, addr, sizeof(*six)); - break; - - case AF_INET: - sin = (struct sockaddr_in *) addr; - six->sin6_family = AF_INET6; - six->sin6_addr.s6_addr32[3] = sin->sin_addr.s_addr; - six->sin6_port = sin->sin_port; - break; - - default: - return 0; - } - - return 1; -} - -int -isns_portal_to_sockaddr(const isns_portal_info_t *portal, - struct sockaddr_storage *addr) -{ - const struct sockaddr_in6 *six = &portal->addr; - struct sockaddr_in *sin; - - /* Check if this is really a v4 address is disguise. - * If so, explicitly use an AF_INET socket - the - * stack may not support IPv6. - */ - if (IN6_IS_ADDR_V4MAPPED(&six->sin6_addr) - || IN6_IS_ADDR_V4COMPAT(&six->sin6_addr)) { - sin = (struct sockaddr_in *) addr; - - memset(sin, 0, sizeof(*sin)); - sin->sin_family = AF_INET; - sin->sin_addr.s_addr = six->sin6_addr.s6_addr32[3]; - sin->sin_port = six->sin6_port; - - return sizeof(*sin); - } - - /* This is the genuine article */ - memcpy(addr, six, sizeof(*six)); - return sizeof(*six); -} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tags.c open-iscsi-2.0.874/utils/open-isns/tags.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tags.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tags.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,740 +0,0 @@ -/* - * Define all iSNS tags with their types, etc. - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include -#include -#include -#include "isns-proto.h" -#include "vendor.h" -#include "attrs.h" -#include "security.h" -#include "objects.h" -#include "util.h" - -#define ISNS_MAX_BUILTIN_TAG 4096 - - -static void print_bitfield(unsigned long, char **, char *, size_t); -static int parse_bitfield( char **, const char *, uint32_t *); -static const char *help_bitfield(char **); - -#define DECLARE_VALIDATOR(name) \ -static int isns_##name##_validate(const isns_value_t *, const isns_policy_t *); -#define DECLARE_ACCESSORS(name) \ -static int isns_##name##_parse(isns_value_t *, const char *buf); \ -static void isns_##name##_print(const isns_value_t *, char *buf, size_t size); \ -static const char * isns_##name##_help(void) -#define USE_VALIDATOR(name) \ - .it_validate = isns_##name##_validate -#define USE_ACCESSORS(name) \ - .it_parse = isns_##name##_parse, \ - .it_print = isns_##name##_print, \ - .it_help = isns_##name##_help - -DECLARE_VALIDATOR(entity_protocol); -DECLARE_ACCESSORS(entity_protocol); -DECLARE_ACCESSORS(tcpudp_port); -DECLARE_VALIDATOR(iscsi_node_type); -DECLARE_ACCESSORS(iscsi_node_type); -DECLARE_ACCESSORS(timestamp); -DECLARE_ACCESSORS(portal_secbitmap); -DECLARE_ACCESSORS(scn_bitmap); -DECLARE_ACCESSORS(dd_features); -DECLARE_ACCESSORS(policy_object_type); -DECLARE_ACCESSORS(policy_function); - -static const char *isns_authmethod_help(void); - -#define TAG(ID, name, type, args...) \ -[ISNS_TAG_##ID] = { \ - .it_id = ISNS_TAG_##ID, \ - .it_name = name, \ - .it_type = &isns_attr_type_##type, \ - args \ -} - -static isns_tag_type_t isns_tags[ISNS_MAX_BUILTIN_TAG] = { -TAG(DELIMITER, "Delimiter", nil), -TAG(ENTITY_IDENTIFIER, "Entity identifier", string), -TAG(ENTITY_PROTOCOL, "Entity protocol", uint32, - USE_VALIDATOR(entity_protocol), - USE_ACCESSORS(entity_protocol)), -TAG(MGMT_IP_ADDRESS, "Mgmt IP address", ipaddr), -TAG(TIMESTAMP, "Timestamp", uint64, - USE_ACCESSORS(timestamp), - .it_readonly = 1), -TAG(PROTOCOL_VERSION_RANGE, "Protocol version range", range16), -TAG(REGISTRATION_PERIOD, "Registration Period", uint32), -TAG(ENTITY_INDEX, "Entity index", uint32, - .it_readonly = 1), -TAG(ENTITY_NEXT_INDEX, "Entity next index", uint32, - .it_readonly = 1), -TAG(PORTAL_IP_ADDRESS, "Portal IP address", ipaddr), -TAG(PORTAL_TCP_UDP_PORT, "Portal TCP/UDP port", uint32, - USE_ACCESSORS(tcpudp_port)), -TAG(ESI_INTERVAL, "ESI interval", uint32), -TAG(ESI_PORT, "ESI port", uint32, - USE_ACCESSORS(tcpudp_port)), -TAG(PORTAL_SYMBOLIC_NAME, "Portal name", string), -TAG(PORTAL_INDEX, "Portal index", uint32), -TAG(SCN_PORT, "SCN port", uint32, - USE_ACCESSORS(tcpudp_port)), -TAG(PORTAL_SECURITY_BITMAP, "Portal security bitmap", uint32, - USE_ACCESSORS(portal_secbitmap)), -TAG(PORTAL_NEXT_INDEX, "Portal next index", uint32, - .it_readonly = 1), - -TAG(ISCSI_NAME, "iSCSI name", string), -TAG(ISCSI_NODE_TYPE, "iSCSI node type", uint32, - USE_VALIDATOR(iscsi_node_type), - USE_ACCESSORS(iscsi_node_type)), -TAG(ISCSI_ALIAS, "iSCSI alias", string), -TAG(ISCSI_SCN_BITMAP, "iSCSI SCN bitmap", uint32, - USE_ACCESSORS(scn_bitmap)), -TAG(ISCSI_NODE_INDEX, "iSCSI node index", uint32, - .it_readonly = 1), -TAG(WWNN_TOKEN, "WWNN token", uint64), -TAG(ISCSI_NODE_NEXT_INDEX, "iSCSI node next index",uint32, - .it_readonly = 1), -TAG(ISCSI_AUTHMETHOD, "iSCSI auth method", string, - .it_help = isns_authmethod_help), - -TAG(PG_ISCSI_NAME, "Portal group name", string), -TAG(PG_PORTAL_IP_ADDR, "Portal group address", ipaddr), -TAG(PG_PORTAL_TCP_UDP_PORT, "Portal group port", uint32, - USE_ACCESSORS(tcpudp_port)), -TAG(PG_TAG, "Portal group tag", uint32), -TAG(PG_INDEX, "Portal group index", uint32, - .it_readonly = 1), -TAG(PG_NEXT_INDEX, "Portal group next index",uint32, - .it_readonly = 1), - -/* FC Port */ -TAG(FC_PORT_NAME_WWPN, "FC port name WWPN", uint64), -TAG(PORT_ID, "FC port ID", uint32), -TAG(FC_PORT_TYPE, "FC port type", uint32), -TAG(SYMBOLIC_PORT_NAME, "FC symbolic port name",string), -TAG(FABRIC_PORT_NAME, "FC fabric port name", uint64), -TAG(HARD_ADDRESS, "FC hard", uint32), -TAG(PORT_IP_ADDRESS, "FC Port IP address", ipaddr), -TAG(CLASS_OF_SERVICE, "FC service class", uint32), -TAG(FC4_TYPES, "FC4 types", opaque), -TAG(FC4_DESCRIPTOR, "FC4 descriptor", string), -TAG(FC4_FEATURES, "FC4 features", opaque), -TAG(IFCP_SCN_BITMAP, "iFCP SCN bitmap", uint32, - USE_ACCESSORS(scn_bitmap)), -TAG(PORT_ROLE, "FC port role", uint32), -TAG(PERMANENT_PORT_NAME, "FC permanent port name",uint64), -TAG(FC4_TYPE_CODE, "FC4 type code", uint32), - -/* FC Node */ -TAG(FC_NODE_NAME_WWNN, "FC node name", uint64), -TAG(SYMBOLIC_NODE_NAME, "FC symbolic node name",string), -TAG(NODE_IP_ADDRESS, "FC node IP address", ipaddr), -TAG(NODE_IPA, "FC node IPA", uint64), -TAG(PROXY_ISCSI_NAME, "FC node proxy iSCSI name",string), - -/* Other FC tags to go here */ - -/* Discovery domain set */ -TAG(DD_SET_ID, "DD set ID", uint32), -TAG(DD_SET_SYMBOLIC_NAME, "DD set name", string), -TAG(DD_SET_STATUS, "DD set status", uint32), -TAG(DD_SET_NEXT_ID, "DD set next ID", uint32, - .it_readonly = 1), - -/* Discovery domain */ -TAG(DD_ID, "DD ID", uint32), -TAG(DD_SYMBOLIC_NAME, "DD name", string), -TAG(DD_MEMBER_ISCSI_INDEX, "DD member iSCSI index",uint32, - .it_multiple = 1), -TAG(DD_MEMBER_ISCSI_NAME, "DD member iSCSI name", string, - .it_multiple = 1), -TAG(DD_MEMBER_FC_PORT_NAME, "DD member FC WWPN", string, - .it_multiple = 1), -TAG(DD_MEMBER_PORTAL_INDEX, "DD member portal index",uint32, - .it_multiple = 1), -TAG(DD_MEMBER_PORTAL_IP_ADDR, "DD member portal addr",ipaddr, - .it_multiple = 1), -TAG(DD_MEMBER_PORTAL_TCP_UDP_PORT,"DD member portal port",uint32, - USE_ACCESSORS(tcpudp_port), - .it_multiple = 1), -TAG(DD_FEATURES, "DD features", uint32, - USE_ACCESSORS(dd_features)), -TAG(DD_NEXT_ID, "DD next ID", uint32, - .it_readonly = 1), -}; - -/* - * End of RFC defined tags - */ -#undef TAG - -/* - * Open-iSNS vendor specific tags - */ -#define TAG(ID, name, type, args...) \ -{ \ - .it_id = OPENISNS_TAG_##ID, \ - .it_name = name, \ - .it_type = &isns_attr_type_##type, \ - args \ -} - -static isns_tag_type_t isns_vendor_tags[] = { -TAG(POLICY_SPI, "Security Policy Index", string), -TAG(POLICY_KEY, "DSA security key", opaque), -TAG(POLICY_ENTITY, "Policy allowed entity name", string), -TAG(POLICY_OBJECT_TYPE, "Policy allowed object types", uint32, - USE_ACCESSORS(policy_object_type)), -TAG(POLICY_NODE_NAME, "Policy allowed node name", string, - .it_multiple = 1), -TAG(POLICY_NODE_TYPE, "Policy allowed node type", uint32, - USE_VALIDATOR(iscsi_node_type), - USE_ACCESSORS(iscsi_node_type)), -TAG(POLICY_FUNCTIONS, "Policy allowed functions", uint32, - USE_ACCESSORS(policy_function)), -TAG(POLICY_VISIBLE_DD, "Visible Discovery Domain", string, - .it_multiple = 1), -TAG(POLICY_DEFAULT_DD, "Default Discovery Domain", string), - -{ 0 } -}; - -/* - * End of vendor-specific tags - */ - -static isns_tag_type_t isns_unknown_tag = { - .it_id = 0xffff, - .it_name = "unknown", - .it_type = &isns_attr_type_opaque, -}; - -/* - * Map iSNS attribute tag to its data type - */ -const isns_tag_type_t * -isns_tag_type_by_id(uint32_t id) -{ - isns_tag_type_t *tag; - - if (id < ISNS_MAX_BUILTIN_TAG) { - tag = &isns_tags[id]; - if (tag->it_type == NULL) { - *tag = isns_unknown_tag; - tag->it_id = id; - } - return tag; - } - - for (tag = isns_vendor_tags; tag->it_name; ++tag) { - if (tag->it_id == id) - return tag; - } - - return &isns_unknown_tag; -} - -/* - * Specific validators/pretty printers - */ -int -isns_entity_protocol_validate(const isns_value_t *value, const isns_policy_t *policy) -{ - enum isns_entity_protocol protocol = value->iv_uint32; - - switch (protocol) { - case ISNS_ENTITY_PROTOCOL_NONE: - case ISNS_ENTITY_PROTOCOL_ISCSI: - case ISNS_ENTITY_PROTOCOL_IFCP: - return 1; - } - return 0; -} - -int -isns_entity_protocol_parse(isns_value_t *value, const char *string) -{ - uint32_t prot; - - if (!strcasecmp(string, "none")) - prot = ISNS_ENTITY_PROTOCOL_NONE; - else if (!strcasecmp(string, "iscsi")) - prot = ISNS_ENTITY_PROTOCOL_ISCSI; - else if (!strcasecmp(string, "ifcp")) - prot = ISNS_ENTITY_PROTOCOL_IFCP; - else - return 0; - value->iv_uint32 = prot; - return 1; -} - -void -isns_entity_protocol_print(const isns_value_t *value, char *buf, size_t size) -{ - enum isns_entity_protocol protocol = value->iv_uint32; - const char *prot_name; - - switch (protocol) { - case ISNS_ENTITY_PROTOCOL_NONE: - prot_name = "None"; - break; - - case ISNS_ENTITY_PROTOCOL_ISCSI: - prot_name = "iSCSI"; - break; - - case ISNS_ENTITY_PROTOCOL_IFCP: - prot_name = "iFCP"; - break; - - default: - prot_name = "Unknown"; - } - snprintf(buf, size, "%s (%u)", prot_name, protocol); -} - -const char * -isns_entity_protocol_help(void) -{ - return "one of None, iSCSI, iFCP"; -} - -/* - * TCP/UDP port - */ -int -isns_tcpudp_port_parse(isns_value_t *value, const char *string) -{ - uint32_t num; - const char *ep; - - num = strtoul(string, (char **) &ep, 0); - if (ep && *ep) { - if (!strcasecmp(ep, "/udp")) - num |= ISNS_PORTAL_PORT_UDP_MASK; - else - if (!strcasecmp(ep, "/tcp")) - /* nothing */; - else { - isns_error("Cannot parse port spec \"%s\"\n", - string); - return 0; - } - } - value->iv_uint32 = num; - return 1; -} - -void -isns_tcpudp_port_print(const isns_value_t *value, char *buf, size_t size) -{ - uint32_t portspec = value->iv_uint32, num; - - if (portspec == 0) { - snprintf(buf, size, "[default]"); - } else { - num = portspec & 0xffff; - if (portspec & ISNS_PORTAL_PORT_UDP_MASK) { - snprintf(buf, size, "%u/udp", num); - } else { - snprintf(buf, size, "%u/tcp", num); - } - } -} - -const char * -isns_tcpudp_port_help(void) -{ - return "/tcp, /udp, or (defaults to TCP)"; -} - -int -isns_timestamp_parse(isns_value_t *value, const char *string) -{ - isns_error("Timestamp parsing not implemented\n"); - return 0; -} - -void -isns_timestamp_print(const isns_value_t *value, char *buf, size_t size) -{ - time_t timestamp = value->iv_uint64; - char *str, *s; - - str = ctime(×tamp); - if ((s = strchr(str, '\n')) != NULL) - *s = '\0'; - - snprintf(buf, size, "%s", str); -} - -const char * -isns_timestamp_help(void) -{ - return NULL; -} - -/* - * Helper macros to implement the off-the-shelf bitfield - * accessors. - */ -#define IMPLEMENT_BITFIELD_ACCESSORS(name) \ -int isns_##name##_parse(isns_value_t *value, const char *string) \ -{ \ - return parse_bitfield(name##_bit_names, string, \ - &value->iv_uint32); \ -} \ - \ -void \ -isns_##name##_print(const isns_value_t *value, char *buf, size_t size) \ -{ \ - print_bitfield(value->iv_uint32, name##_bit_names, \ - buf, size); \ -} \ - \ -const char * \ -isns_##name##_help(void) \ -{ \ - return help_bitfield(name##_bit_names); \ -} - - -static char * iscsi_node_type_bit_names[32] = { -[ISNS_ISCSI_NODE_TYPE_TARGET] = "Target", -[ISNS_ISCSI_NODE_TYPE_INITIATOR] = "Initiator", -[ISNS_ISCSI_NODE_TYPE_CONTROL] = "Control", -}; - -int -isns_iscsi_node_type_validate(const isns_value_t *value, const isns_policy_t *policy) -{ - uint32_t bits = value->iv_uint32, permitted; - - permitted = ISNS_ISCSI_INITIATOR_MASK | - ISNS_ISCSI_TARGET_MASK | - ISNS_ISCSI_CONTROL_MASK; - if (bits & ~permitted) - return 0; - - if (policy && !isns_policy_validate_node_type(policy, bits)) - return 0; - - return 1; -} - -IMPLEMENT_BITFIELD_ACCESSORS(iscsi_node_type); - -/* - * Portal Security Bitmap - */ -static char * portal_secbitmap_bit_names[32] = { -[ISNS_PORTAL_SEC_BITMAP_VALID] = "bitmap valid", -[ISNS_PORTAL_SEC_IPSEC_ENABLED] = "ipsec enabled", -[ISNS_PORTAL_SEC_MAIN_MODE_ENABLED] = "main mode enabled", -[ISNS_PORTAL_SEC_AGGR_MODE_ENABLED] = "aggressive mode enabled", -[ISNS_PORTAL_SEC_PFS_ENABLED] = "pfs enabled", -[ISNS_PORTAL_SEC_TRANSPORT_MODE_PREFERRED] = "transport mode preferred", -[ISNS_PORTAL_SEC_TUNNEL_MODE_PREFERRED] = "tunnel mode preferred", -}; - -IMPLEMENT_BITFIELD_ACCESSORS(portal_secbitmap); - -/* - * SCN bitmap - */ -static char * scn_bitmap_bit_names[32] = { -[ISNS_SCN_DD_MEMBER_ADDED] = "DD/DDS member added", -[ISNS_SCN_DD_MEMBER_REMOVED] = "DD/DDS member removed", -[ISNS_SCN_OBJECT_UPDATED] = "object updated", -[ISNS_SCN_OBJECT_ADDED] = "object added", -[ISNS_SCN_OBJECT_REMOVED] = "object removed", -[ISNS_SCN_MANAGEMENT_REGISTRATION] = "management registration", -[ISNS_SCN_TARGET_AND_SELF_ONLY] = "target and self information only", -[ISNS_SCN_INITIATOR_AND_SELF_ONLY] = "initiator and self information only", -}; - -IMPLEMENT_BITFIELD_ACCESSORS(scn_bitmap); - -/* - * DD features bitmap - */ -static char * dd_features_bit_names[32] = { -[ISNS_DD_BOOT_LIST_ENABLED] = "Boot list enabled", -}; - -IMPLEMENT_BITFIELD_ACCESSORS(dd_features); - -/* - * Policy: list of allowed functions - */ -static char * policy_function_bit_names[32] = { -[ISNS_DEVICE_ATTRIBUTE_REGISTER]= "DevAttrReg", -[ISNS_DEVICE_ATTRIBUTE_QUERY] = "DevAttrQry", -[ISNS_DEVICE_GET_NEXT] = "DevGetNext", -[ISNS_DEVICE_DEREGISTER] = "DevDereg", -[ISNS_SCN_REGISTER] = "SCNReg", -[ISNS_SCN_DEREGISTER] = "SCNDereg", -[ISNS_SCN_EVENT] = "SCNEvent", -[ISNS_STATE_CHANGE_NOTIFICATION]= "SCN", -[ISNS_DD_REGISTER] = "DDReg", -[ISNS_DD_DEREGISTER] = "DDDereg", -[ISNS_DDS_REGISTER] = "DDSReg", -[ISNS_DDS_DEREGISTER] = "DDSDereg", -[ISNS_ENTITY_STATUS_INQUIRY] = "ESI", -[ISNS_HEARTBEAT] = "Heartbeat", -}; - -IMPLEMENT_BITFIELD_ACCESSORS(policy_function); - -/* - * Policy: list of allowed node types - */ -static char * policy_object_type_bit_names[32] = { -[ISNS_OBJECT_TYPE_ENTITY] = "entity", -[ISNS_OBJECT_TYPE_NODE] = "iscsi-node", -[ISNS_OBJECT_TYPE_PORTAL] = "portal", -[ISNS_OBJECT_TYPE_PG] = "portal-group", -[ISNS_OBJECT_TYPE_DD] = "dd", -[ISNS_OBJECT_TYPE_DDSET] = "ddset", -[ISNS_OBJECT_TYPE_POLICY] = "policy", -}; - -static int -isns_policy_object_type_parse(isns_value_t *vp, const char *buf) -{ - char *copy, *s, *next; - int rv = 0; - - if (!strcasecmp(buf, "ALL")) { - vp->iv_uint32 = ~0; - return 1; - } - if (!strcasecmp(buf, "DEFAULT")) { - vp->iv_uint32 = ISNS_DEFAULT_OBJECT_ACCESS; - return 1; - } - - vp->iv_uint32 = 0; - copy = isns_strdup(buf); - for (s = copy; s; s = next) { - char *perm; - int bit, mask = 0; - - while (1) { - unsigned int n; - - n = strcspn(s, ",+;|"); - if (n) { - next = s + n; - if (*next) - *next++ = '\0'; - break; - } - ++n; - } - - mask = ISNS_PERMISSION_READ; - if ((perm = strchr(s, ':')) != NULL) { - *perm++ = '\0'; - mask = 0; - while (*perm) { - switch (*perm++) { - case 'R': case 'r': - mask = ISNS_PERMISSION_READ; - break; - case 'W': case 'w': - mask = ISNS_PERMISSION_READ; - break; - default: - goto failed; - } - } - } - - for (bit = 0; bit < 32; ++bit) { - if (policy_object_type_bit_names[bit] - && !strcasecmp(policy_object_type_bit_names[bit], s)) - goto found; - } - goto failed; - -found: vp->iv_uint32 |= ISNS_ACCESS(bit, mask); - } - rv = 1; - -failed: - isns_free(copy); - return rv; -} - -static void -isns_policy_object_type_print(const isns_value_t *vp, char *buf, size_t size) -{ - unsigned int i, pos = 0; - uint32_t mask; - const char *sepa = ""; - - mask = vp->iv_uint32; - if (mask == 0) { - snprintf(buf, size, ""); - return; - } - - for (i = 0; i < 32; ++i, mask >>= 2) { - const char *name; - - if (!(mask & 3)) - continue; - - name = policy_object_type_bit_names[i]; - if (name) - snprintf(buf + pos, size - pos, "%s%s:%s%s", sepa, name, - (mask & ISNS_PERMISSION_READ)? "r" : "", - (mask & ISNS_PERMISSION_WRITE)? "w" : ""); - else - snprintf(buf + pos, size - pos, "%sbit%u:%s%s",sepa, i, - (mask & ISNS_PERMISSION_READ)? "r" : "", - (mask & ISNS_PERMISSION_WRITE)? "w" : ""); - sepa = ", "; - pos = strlen(buf); - } -} - -static const char * -isns_policy_object_type_help(void) -{ - static char buffer[256]; - unsigned int i, n; - char *sepa = ""; - - strcpy(buffer, "bitfield (type:perm): perm=R, W, or RW; type="); - n = strlen(buffer); - - for (i = 0; i < 32; ++i) { - if (policy_object_type_bit_names[i]) { - snprintf(buffer + n, sizeof(buffer) - n, - "%s%s", sepa, - policy_object_type_bit_names[i]); - sepa = ", "; - } - } - return buffer; -} - -/* - * Help message for AuthMethod - */ -const char * -isns_authmethod_help(void) -{ - return "comma separated list, including of KRB5, SPKM1, SPKM2, SRP, CHAP, none"; -} - -/* - * Helper functions to deal with bitfields - */ -static void -print_bitfield(unsigned long value, char **bit_names, - char *buf, size_t size) -{ - unsigned int bit, mask; - const char *sepa = ""; - char *buf_end; - - if (value == 0) { - snprintf(buf, size, ""); - return; - } - - buf_end = buf + size; - for (bit = 0, mask = 1; mask; ++bit, mask <<= 1) { - char namebuf[16], *name; - - if (!(value & mask)) - continue; - - if ((name = bit_names[bit]) == NULL) { - sprintf(namebuf, "bit%u", bit); - name = namebuf; - } - - snprintf(buf, buf_end - buf, "%s%s", sepa, name); - buf += strlen(buf); - sepa = ", "; - } -} - -static int -parse_bitfield(char **bit_names, - const char *string, - uint32_t *result) -{ - *result = 0; - - if (!strcasecmp(string, "ALL")) { - unsigned int bit; - - for (bit = 0; bit < 32; ++bit) { - if (bit_names[bit]) - *result |= 1 << bit; - } - return 1; - } - - if (!strcasecmp(string, "NONE")) - return 1; - - while (*string) { - unsigned int n, bit, match = 0; - - n = strcspn(string, ",+;|"); - if (n == 0) - goto next; - - for (bit = 0; bit < 32; ++bit) { - if (!bit_names[bit]) - continue; - if (!strncasecmp(bit_names[bit], string, n)) { - *result |= 1 << bit; - match++; - } - } - if (!match) - return 0; - -next: - string += n; - string += strspn(string, ",+;|"); - } - - return 1; -} - -static const char * -help_bitfield(char **bit_names) -{ - static char buffer[1024]; - char *pos, sepa = ':'; - unsigned int bit; - - strcpy(buffer, "bitfield"); - pos = strchr(buffer, '\0'); - - for (bit = 0; bit < 32; ++bit) { - if (bit_names[bit] == NULL) - continue; - - snprintf(pos, sizeof(buffer) - (pos - buffer), - "%c %s", sepa, bit_names[bit]); - - pos += strlen(pos); - sepa = ','; - } - return buffer; -} - diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/client.conf open-iscsi-2.0.874/utils/open-isns/tests/client.conf --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/client.conf 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/client.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -SourceName = @NOT_SET@ -AuthName = @NOT_SET@ -ServerAddress = @NOT_SET@ -BindAddress = @NOT_SET@ -Security = @NOT_SET@ -AuthKeyFile = @NOT_SET@ -ServerKeyFile = @NOT_SET@ -ControlSocket = @NOT_SET@ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/.cvsignore open-iscsi-2.0.874/utils/open-isns/tests/.cvsignore --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/.cvsignore 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/.cvsignore 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -*.swp -pauw[1-9] diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test01/01-enroll open-iscsi-2.0.874/utils/open-isns/tests/data/test01/01-enroll --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test01/01-enroll 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test01/01-enroll 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test01/server0/database -Last EID: 1 -Last Index: 4 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b7 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test01/02-registration open-iscsi-2.0.874/utils/open-isns/tests/data/test01/02-registration --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test01/02-registration 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test01/02-registration 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test01/server0/database -Last EID: 1 -Last Index: 8 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b6 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 --------------- -Object: index=4 type= state=mature - 0001 string : Entity identifier = "client1.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 12:40:58 2007 - 0007 uint32 : Entity index = 4 --------------- -Object: index=5 type= state=mature parent=4 - 0020 string : iSCSI name = "isns.client1" - 0021 uint32 : iSCSI node type = Initiator - 0024 uint32 : iSCSI node index = 5 --------------- -Object: index=6 type= state=mature parent=4 - 0010 ipaddr : Portal IP address = 127.0.0.1 - 0011 uint32 : Portal TCP/UDP port = 860/tcp - 0016 uint32 : Portal index = 6 --------------- -Object: index=7 type= state=mature parent=4 - 0030 string : Portal group name = "isns.client1" - 0031 ipaddr : Portal group address = 127.0.0.1 - 0032 uint32 : Portal group port = 860/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 7 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test01/03-query open-iscsi-2.0.874/utils/open-isns/tests/data/test01/03-query --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test01/03-query 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test01/03-query 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -object[0] = - 0001 string : Entity identifier = "client1.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 12:41:41 2007 - 0007 uint32 : Entity index = 4 -object[1] = - 0020 string : iSCSI name = "isns.client1" - 0021 uint32 : iSCSI node type = Initiator - 0024 uint32 : iSCSI node index = 5 -object[2] = - 0010 ipaddr : Portal IP address = 127.0.0.1 - 0011 uint32 : Portal TCP/UDP port = 860/tcp - 0016 uint32 : Portal index = 6 -object[3] = - 0030 string : Portal group name = "isns.client1" - 0031 ipaddr : Portal group address = 127.0.0.1 - 0032 uint32 : Portal group port = 860/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 7 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test01/03-registration open-iscsi-2.0.874/utils/open-isns/tests/data/test01/03-registration --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test01/03-registration 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test01/03-registration 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test01/server0/database -Last EID: 1 -Last Index: 4 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "isns.client1" - 0602v string : Policy allowed source name = "isns.client1" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b7 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "isns.client2" - 0602v string : Policy allowed source name = "isns.client2" - 0607v string : Policy allowed node name = "isns.client2" - 0603v opaque : DSA security key = <30 82 01 b7 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test01/99-unregistration open-iscsi-2.0.874/utils/open-isns/tests/data/test01/99-unregistration --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test01/99-unregistration 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test01/99-unregistration 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test01/server0/database -Last EID: 1 -Last Index: 8 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b6 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test02/01-enroll open-iscsi-2.0.874/utils/open-isns/tests/data/test02/01-enroll --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test02/01-enroll 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test02/01-enroll 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test02/server0/database -Last EID: 1 -Last Index: 4 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b7 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test02/02-enroll open-iscsi-2.0.874/utils/open-isns/tests/data/test02/02-enroll --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test02/02-enroll 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test02/02-enroll 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test02/server0/database -Last EID: 1 -Last Index: 5 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b7 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 --------------- -Object: index=4 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client2.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client2" - 0603v opaque : DSA security key = <30 82 01 b6 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... - 0608v uint32 : Policy allowed node type = Target diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test02/03-registration open-iscsi-2.0.874/utils/open-isns/tests/data/test02/03-registration --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test02/03-registration 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test02/03-registration 1970-01-01 00:00:00.000000000 +0000 @@ -1,72 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test02/server0/database -Last EID: 1 -Last Index: 13 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b7 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 --------------- -Object: index=4 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client2.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client2" - 0603v opaque : DSA security key = <30 82 01 b6 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... - 0608v uint32 : Policy allowed node type = Target --------------- -Object: index=5 type= state=mature - 0001 string : Entity identifier = "client1.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:18:53 2007 - 0007 uint32 : Entity index = 5 --------------- -Object: index=6 type= state=mature parent=5 - 0020 string : iSCSI name = "isns.client1" - 0021 uint32 : iSCSI node type = Initiator - 0024 uint32 : iSCSI node index = 6 --------------- -Object: index=7 type= state=mature parent=5 - 0010 ipaddr : Portal IP address = 127.1.0.1 - 0011 uint32 : Portal TCP/UDP port = 860/tcp - 0016 uint32 : Portal index = 7 --------------- -Object: index=8 type= state=mature parent=5 - 0030 string : Portal group name = "isns.client1" - 0031 ipaddr : Portal group address = 127.1.0.1 - 0032 uint32 : Portal group port = 860/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 8 --------------- -Object: index=9 type= state=mature - 0001 string : Entity identifier = "client2.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:18:53 2007 - 0007 uint32 : Entity index = 9 --------------- -Object: index=10 type= state=mature parent=9 - 0020 string : iSCSI name = "isns.client2" - 0021 uint32 : iSCSI node type = Target - 0024 uint32 : iSCSI node index = 10 --------------- -Object: index=11 type= state=mature parent=9 - 0010 ipaddr : Portal IP address = 127.1.0.2 - 0011 uint32 : Portal TCP/UDP port = 3260/tcp - 0016 uint32 : Portal index = 11 --------------- -Object: index=12 type= state=mature parent=9 - 0030 string : Portal group name = "isns.client2" - 0031 ipaddr : Portal group address = 127.1.0.2 - 0032 uint32 : Portal group port = 3260/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 12 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test02/04-query open-iscsi-2.0.874/utils/open-isns/tests/data/test02/04-query --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test02/04-query 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test02/04-query 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -object[0] = - 0001 string : Entity identifier = "client1.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:18:54 2007 - 0007 uint32 : Entity index = 5 -object[1] = - 0020 string : iSCSI name = "isns.client1" - 0021 uint32 : iSCSI node type = Initiator - 0024 uint32 : iSCSI node index = 6 -object[2] = - 0010 ipaddr : Portal IP address = 127.1.0.1 - 0011 uint32 : Portal TCP/UDP port = 860/tcp - 0016 uint32 : Portal index = 7 -object[3] = - 0030 string : Portal group name = "isns.client1" - 0031 ipaddr : Portal group address = 127.1.0.1 - 0032 uint32 : Portal group port = 860/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 8 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test02/05-query open-iscsi-2.0.874/utils/open-isns/tests/data/test02/05-query --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test02/05-query 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test02/05-query 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -object[0] = - 0001 string : Entity identifier = "client2.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:18:54 2007 - 0007 uint32 : Entity index = 9 -object[1] = - 0020 string : iSCSI name = "isns.client2" - 0021 uint32 : iSCSI node type = Target - 0024 uint32 : iSCSI node index = 10 -object[2] = - 0010 ipaddr : Portal IP address = 127.1.0.2 - 0011 uint32 : Portal TCP/UDP port = 3260/tcp - 0016 uint32 : Portal index = 11 -object[3] = - 0030 string : Portal group name = "isns.client2" - 0031 ipaddr : Portal group address = 127.1.0.2 - 0032 uint32 : Portal group port = 3260/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 12 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test02/06-dd-registration open-iscsi-2.0.874/utils/open-isns/tests/data/test02/06-dd-registration --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test02/06-dd-registration 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test02/06-dd-registration 1970-01-01 00:00:00.000000000 +0000 @@ -1,81 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test02/server0/database -Last EID: 1 -Last Index: 14 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b7 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 --------------- -Object: index=4 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client2.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client2" - 0603v opaque : DSA security key = <30 82 01 b6 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... - 0608v uint32 : Policy allowed node type = Target --------------- -Object: index=5 type= state=mature - 0001 string : Entity identifier = "client1.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:18:54 2007 - 0007 uint32 : Entity index = 5 --------------- -Object: index=6 type= state=mature parent=5 - 0020 string : iSCSI name = "isns.client1" - 0021 uint32 : iSCSI node type = Initiator - 0024 uint32 : iSCSI node index = 6 --------------- -Object: index=7 type= state=mature parent=5 - 0010 ipaddr : Portal IP address = 127.1.0.1 - 0011 uint32 : Portal TCP/UDP port = 860/tcp - 0016 uint32 : Portal index = 7 --------------- -Object: index=8 type= state=mature parent=5 - 0030 string : Portal group name = "isns.client1" - 0031 ipaddr : Portal group address = 127.1.0.1 - 0032 uint32 : Portal group port = 860/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 8 --------------- -Object: index=9 type= state=mature - 0001 string : Entity identifier = "client2.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:18:54 2007 - 0007 uint32 : Entity index = 9 --------------- -Object: index=10 type= state=mature parent=9 - 0020 string : iSCSI name = "isns.client2" - 0021 uint32 : iSCSI node type = Target - 0024 uint32 : iSCSI node index = 10 --------------- -Object: index=11 type= state=mature parent=9 - 0010 ipaddr : Portal IP address = 127.1.0.2 - 0011 uint32 : Portal TCP/UDP port = 3260/tcp - 0016 uint32 : Portal index = 11 --------------- -Object: index=12 type= state=mature parent=9 - 0030 string : Portal group name = "isns.client2" - 0031 ipaddr : Portal group address = 127.1.0.2 - 0032 uint32 : Portal group port = 3260/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 12 --------------- -Object: index=13 type= state=mature - 0811 uint32 : DD ID = 1 - 0812 string : DD name = "isns.dd1" - 081e uint32 : DD features = - 0813 uint32 : DD member iSCSI index = 6 - 0814 string : DD member iSCSI name = "isns.client1" - 0813 uint32 : DD member iSCSI index = 10 - 0814 string : DD member iSCSI name = "isns.client2" diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test02/07-query open-iscsi-2.0.874/utils/open-isns/tests/data/test02/07-query --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test02/07-query 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test02/07-query 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -object[0] = - 0001 string : Entity identifier = "client1.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:18:54 2007 - 0007 uint32 : Entity index = 5 -object[1] = - 0020 string : iSCSI name = "isns.client1" - 0021 uint32 : iSCSI node type = Initiator - 0024 uint32 : iSCSI node index = 6 -object[2] = - 0010 ipaddr : Portal IP address = 127.1.0.1 - 0011 uint32 : Portal TCP/UDP port = 860/tcp - 0016 uint32 : Portal index = 7 -object[3] = - 0030 string : Portal group name = "isns.client1" - 0031 ipaddr : Portal group address = 127.1.0.1 - 0032 uint32 : Portal group port = 860/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 8 -object[4] = - 0001 string : Entity identifier = "client2.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:18:54 2007 - 0007 uint32 : Entity index = 9 -object[5] = - 0020 string : iSCSI name = "isns.client2" - 0021 uint32 : iSCSI node type = Target - 0024 uint32 : iSCSI node index = 10 -object[6] = - 0010 ipaddr : Portal IP address = 127.1.0.2 - 0011 uint32 : Portal TCP/UDP port = 3260/tcp - 0016 uint32 : Portal index = 11 -object[7] = - 0030 string : Portal group name = "isns.client2" - 0031 ipaddr : Portal group address = 127.1.0.2 - 0032 uint32 : Portal group port = 3260/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 12 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test02/08-query open-iscsi-2.0.874/utils/open-isns/tests/data/test02/08-query --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test02/08-query 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test02/08-query 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -object[0] = - 0001 string : Entity identifier = "client1.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:18:54 2007 - 0007 uint32 : Entity index = 5 -object[1] = - 0020 string : iSCSI name = "isns.client1" - 0021 uint32 : iSCSI node type = Initiator - 0024 uint32 : iSCSI node index = 6 -object[2] = - 0010 ipaddr : Portal IP address = 127.1.0.1 - 0011 uint32 : Portal TCP/UDP port = 860/tcp - 0016 uint32 : Portal index = 7 -object[3] = - 0030 string : Portal group name = "isns.client1" - 0031 ipaddr : Portal group address = 127.1.0.1 - 0032 uint32 : Portal group port = 860/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 8 -object[4] = - 0001 string : Entity identifier = "client2.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:18:54 2007 - 0007 uint32 : Entity index = 9 -object[5] = - 0020 string : iSCSI name = "isns.client2" - 0021 uint32 : iSCSI node type = Target - 0024 uint32 : iSCSI node index = 10 -object[6] = - 0010 ipaddr : Portal IP address = 127.1.0.2 - 0011 uint32 : Portal TCP/UDP port = 3260/tcp - 0016 uint32 : Portal index = 11 -object[7] = - 0030 string : Portal group name = "isns.client2" - 0031 ipaddr : Portal group address = 127.1.0.2 - 0032 uint32 : Portal group port = 3260/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 12 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test02/09-query open-iscsi-2.0.874/utils/open-isns/tests/data/test02/09-query --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test02/09-query 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test02/09-query 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -object[0] = - 0001 string : Entity identifier = "client2.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:18:54 2007 - 0007 uint32 : Entity index = 9 -object[1] = - 0020 string : iSCSI name = "isns.client2" - 0021 uint32 : iSCSI node type = Target - 0024 uint32 : iSCSI node index = 10 -object[2] = - 0010 ipaddr : Portal IP address = 127.1.0.2 - 0011 uint32 : Portal TCP/UDP port = 3260/tcp - 0016 uint32 : Portal index = 11 -object[3] = - 0030 string : Portal group name = "isns.client2" - 0031 ipaddr : Portal group address = 127.1.0.2 - 0032 uint32 : Portal group port = 3260/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 12 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test02/10-dd-registration open-iscsi-2.0.874/utils/open-isns/tests/data/test02/10-dd-registration --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test02/10-dd-registration 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test02/10-dd-registration 1970-01-01 00:00:00.000000000 +0000 @@ -1,87 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test02/server0/database -Last EID: 1 -Last Index: 15 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b7 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 --------------- -Object: index=4 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client2.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client2" - 0603v opaque : DSA security key = <30 82 01 b6 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... - 0608v uint32 : Policy allowed node type = Target --------------- -Object: index=5 type= state=mature - 0001 string : Entity identifier = "client1.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:18:54 2007 - 0007 uint32 : Entity index = 5 --------------- -Object: index=6 type= state=mature parent=5 - 0020 string : iSCSI name = "isns.client1" - 0021 uint32 : iSCSI node type = Initiator - 0024 uint32 : iSCSI node index = 6 --------------- -Object: index=7 type= state=mature parent=5 - 0010 ipaddr : Portal IP address = 127.1.0.1 - 0011 uint32 : Portal TCP/UDP port = 860/tcp - 0016 uint32 : Portal index = 7 --------------- -Object: index=8 type= state=mature parent=5 - 0030 string : Portal group name = "isns.client1" - 0031 ipaddr : Portal group address = 127.1.0.1 - 0032 uint32 : Portal group port = 860/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 8 --------------- -Object: index=9 type= state=mature - 0001 string : Entity identifier = "client2.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:18:54 2007 - 0007 uint32 : Entity index = 9 --------------- -Object: index=10 type= state=mature parent=9 - 0020 string : iSCSI name = "isns.client2" - 0021 uint32 : iSCSI node type = Target - 0024 uint32 : iSCSI node index = 10 --------------- -Object: index=11 type= state=mature parent=9 - 0010 ipaddr : Portal IP address = 127.1.0.2 - 0011 uint32 : Portal TCP/UDP port = 3260/tcp - 0016 uint32 : Portal index = 11 --------------- -Object: index=12 type= state=mature parent=9 - 0030 string : Portal group name = "isns.client2" - 0031 ipaddr : Portal group address = 127.1.0.2 - 0032 uint32 : Portal group port = 3260/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 12 --------------- -Object: index=13 type= state=mature - 0811 uint32 : DD ID = 1 - 0812 string : DD name = "isns.dd1" - 081e uint32 : DD features = - 0813 uint32 : DD member iSCSI index = 6 - 0814 string : DD member iSCSI name = "isns.client1" - 0813 uint32 : DD member iSCSI index = 10 - 0814 string : DD member iSCSI name = "isns.client2" - 0813 uint32 : DD member iSCSI index = 14 - 0814 string : DD member iSCSI name = "iqn.com.foobar:disk1" --------------- -Object: index=14 type= state=limbo - 0020 string : iSCSI name = "iqn.com.foobar:disk1" - 0024 uint32 : iSCSI node index = 14 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test02/11-query open-iscsi-2.0.874/utils/open-isns/tests/data/test02/11-query --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test02/11-query 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test02/11-query 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -object[0] = - 0811 uint32 : DD ID = 1 - 0812 string : DD name = "isns.dd1" - 081e uint32 : DD features = - 0813 uint32 : DD member iSCSI index = 6 - 0814 string : DD member iSCSI name = "isns.client1" - 0813 uint32 : DD member iSCSI index = 10 - 0814 string : DD member iSCSI name = "isns.client2" - 0813 uint32 : DD member iSCSI index = 14 - 0814 string : DD member iSCSI name = "iqn.com.foobar:disk1" diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test02/12-dd-deregistration open-iscsi-2.0.874/utils/open-isns/tests/data/test02/12-dd-deregistration --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test02/12-dd-deregistration 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test02/12-dd-deregistration 1970-01-01 00:00:00.000000000 +0000 @@ -1,85 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test02/server0/database -Last EID: 1 -Last Index: 15 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b6 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 --------------- -Object: index=4 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client2.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client2" - 0603v opaque : DSA security key = <30 82 01 b7 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... - 0608v uint32 : Policy allowed node type = Target --------------- -Object: index=5 type= state=mature - 0001 string : Entity identifier = "client1.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:20:33 2007 - 0007 uint32 : Entity index = 5 --------------- -Object: index=6 type= state=mature parent=5 - 0020 string : iSCSI name = "isns.client1" - 0021 uint32 : iSCSI node type = Initiator - 0024 uint32 : iSCSI node index = 6 --------------- -Object: index=7 type= state=mature parent=5 - 0010 ipaddr : Portal IP address = 127.1.0.1 - 0011 uint32 : Portal TCP/UDP port = 860/tcp - 0016 uint32 : Portal index = 7 --------------- -Object: index=8 type= state=mature parent=5 - 0030 string : Portal group name = "isns.client1" - 0031 ipaddr : Portal group address = 127.1.0.1 - 0032 uint32 : Portal group port = 860/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 8 --------------- -Object: index=9 type= state=mature - 0001 string : Entity identifier = "client2.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:20:33 2007 - 0007 uint32 : Entity index = 9 --------------- -Object: index=10 type= state=mature parent=9 - 0020 string : iSCSI name = "isns.client2" - 0021 uint32 : iSCSI node type = Target - 0024 uint32 : iSCSI node index = 10 --------------- -Object: index=11 type= state=mature parent=9 - 0010 ipaddr : Portal IP address = 127.1.0.2 - 0011 uint32 : Portal TCP/UDP port = 3260/tcp - 0016 uint32 : Portal index = 11 --------------- -Object: index=12 type= state=mature parent=9 - 0030 string : Portal group name = "isns.client2" - 0031 ipaddr : Portal group address = 127.1.0.2 - 0032 uint32 : Portal group port = 3260/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 12 --------------- -Object: index=13 type= state=mature - 0811 uint32 : DD ID = 1 - 0812 string : DD name = "isns.dd1" - 081e uint32 : DD features = - 0813 uint32 : DD member iSCSI index = 6 - 0814 string : DD member iSCSI name = "isns.client1" - 0813 uint32 : DD member iSCSI index = 14 - 0814 string : DD member iSCSI name = "iqn.com.foobar:disk1" --------------- -Object: index=14 type= state=limbo - 0020 string : iSCSI name = "iqn.com.foobar:disk1" - 0024 uint32 : iSCSI node index = 14 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test02/13-dd-deregistration open-iscsi-2.0.874/utils/open-isns/tests/data/test02/13-dd-deregistration --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test02/13-dd-deregistration 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test02/13-dd-deregistration 1970-01-01 00:00:00.000000000 +0000 @@ -1,83 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test02/server0/database -Last EID: 1 -Last Index: 15 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b6 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 --------------- -Object: index=4 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client2.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client2" - 0603v opaque : DSA security key = <30 82 01 b6 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... - 0608v uint32 : Policy allowed node type = Target --------------- -Object: index=5 type= state=mature - 0001 string : Entity identifier = "client1.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:24:04 2007 - 0007 uint32 : Entity index = 5 --------------- -Object: index=6 type= state=mature parent=5 - 0020 string : iSCSI name = "isns.client1" - 0021 uint32 : iSCSI node type = Initiator - 0024 uint32 : iSCSI node index = 6 --------------- -Object: index=7 type= state=mature parent=5 - 0010 ipaddr : Portal IP address = 127.1.0.1 - 0011 uint32 : Portal TCP/UDP port = 860/tcp - 0016 uint32 : Portal index = 7 --------------- -Object: index=8 type= state=mature parent=5 - 0030 string : Portal group name = "isns.client1" - 0031 ipaddr : Portal group address = 127.1.0.1 - 0032 uint32 : Portal group port = 860/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 8 --------------- -Object: index=9 type= state=mature - 0001 string : Entity identifier = "client2.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:24:04 2007 - 0007 uint32 : Entity index = 9 --------------- -Object: index=10 type= state=mature parent=9 - 0020 string : iSCSI name = "isns.client2" - 0021 uint32 : iSCSI node type = Target - 0024 uint32 : iSCSI node index = 10 --------------- -Object: index=11 type= state=mature parent=9 - 0010 ipaddr : Portal IP address = 127.1.0.2 - 0011 uint32 : Portal TCP/UDP port = 3260/tcp - 0016 uint32 : Portal index = 11 --------------- -Object: index=12 type= state=mature parent=9 - 0030 string : Portal group name = "isns.client2" - 0031 ipaddr : Portal group address = 127.1.0.2 - 0032 uint32 : Portal group port = 3260/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 12 --------------- -Object: index=13 type= state=mature - 0811 uint32 : DD ID = 1 - 0812 string : DD name = "isns.dd1" - 081e uint32 : DD features = - 0813 uint32 : DD member iSCSI index = 6 - 0814 string : DD member iSCSI name = "isns.client1" --------------- -Object: index=14 type= state=limbo - 0020 string : iSCSI name = "iqn.com.foobar:disk1" - 0024 uint32 : iSCSI node index = 14 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test02/14-dd-registration open-iscsi-2.0.874/utils/open-isns/tests/data/test02/14-dd-registration --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test02/14-dd-registration 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test02/14-dd-registration 1970-01-01 00:00:00.000000000 +0000 @@ -1,85 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test02/server0/database -Last EID: 1 -Last Index: 15 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b6 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 --------------- -Object: index=4 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client2.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client2" - 0603v opaque : DSA security key = <30 82 01 b6 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... - 0608v uint32 : Policy allowed node type = Target --------------- -Object: index=5 type= state=mature - 0001 string : Entity identifier = "client1.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:24:04 2007 - 0007 uint32 : Entity index = 5 --------------- -Object: index=6 type= state=mature parent=5 - 0020 string : iSCSI name = "isns.client1" - 0021 uint32 : iSCSI node type = Initiator - 0024 uint32 : iSCSI node index = 6 --------------- -Object: index=7 type= state=mature parent=5 - 0010 ipaddr : Portal IP address = 127.1.0.1 - 0011 uint32 : Portal TCP/UDP port = 860/tcp - 0016 uint32 : Portal index = 7 --------------- -Object: index=8 type= state=mature parent=5 - 0030 string : Portal group name = "isns.client1" - 0031 ipaddr : Portal group address = 127.1.0.1 - 0032 uint32 : Portal group port = 860/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 8 --------------- -Object: index=9 type= state=mature - 0001 string : Entity identifier = "client2.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:24:04 2007 - 0007 uint32 : Entity index = 9 --------------- -Object: index=10 type= state=mature parent=9 - 0020 string : iSCSI name = "isns.client2" - 0021 uint32 : iSCSI node type = Target - 0024 uint32 : iSCSI node index = 10 --------------- -Object: index=11 type= state=mature parent=9 - 0010 ipaddr : Portal IP address = 127.1.0.2 - 0011 uint32 : Portal TCP/UDP port = 3260/tcp - 0016 uint32 : Portal index = 11 --------------- -Object: index=12 type= state=mature parent=9 - 0030 string : Portal group name = "isns.client2" - 0031 ipaddr : Portal group address = 127.1.0.2 - 0032 uint32 : Portal group port = 3260/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 12 --------------- -Object: index=13 type= state=mature - 0811 uint32 : DD ID = 1 - 0812 string : DD name = "isns.dd1" - 081e uint32 : DD features = - 0813 uint32 : DD member iSCSI index = 6 - 0814 string : DD member iSCSI name = "isns.client1" - 0813 uint32 : DD member iSCSI index = 10 - 0814 string : DD member iSCSI name = "isns.client2" --------------- -Object: index=14 type= state=limbo - 0020 string : iSCSI name = "iqn.com.foobar:disk1" - 0024 uint32 : iSCSI node index = 14 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test02/15-dd-deregistration open-iscsi-2.0.874/utils/open-isns/tests/data/test02/15-dd-deregistration --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test02/15-dd-deregistration 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test02/15-dd-deregistration 1970-01-01 00:00:00.000000000 +0000 @@ -1,76 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test02/server0/database -Last EID: 1 -Last Index: 15 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b6 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 --------------- -Object: index=4 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client2.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client2" - 0603v opaque : DSA security key = <30 82 01 b6 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... - 0608v uint32 : Policy allowed node type = Target --------------- -Object: index=5 type= state=mature - 0001 string : Entity identifier = "client1.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:24:04 2007 - 0007 uint32 : Entity index = 5 --------------- -Object: index=6 type= state=mature parent=5 - 0020 string : iSCSI name = "isns.client1" - 0021 uint32 : iSCSI node type = Initiator - 0024 uint32 : iSCSI node index = 6 --------------- -Object: index=7 type= state=mature parent=5 - 0010 ipaddr : Portal IP address = 127.1.0.1 - 0011 uint32 : Portal TCP/UDP port = 860/tcp - 0016 uint32 : Portal index = 7 --------------- -Object: index=8 type= state=mature parent=5 - 0030 string : Portal group name = "isns.client1" - 0031 ipaddr : Portal group address = 127.1.0.1 - 0032 uint32 : Portal group port = 860/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 8 --------------- -Object: index=9 type= state=mature - 0001 string : Entity identifier = "client2.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:24:04 2007 - 0007 uint32 : Entity index = 9 --------------- -Object: index=10 type= state=mature parent=9 - 0020 string : iSCSI name = "isns.client2" - 0021 uint32 : iSCSI node type = Target - 0024 uint32 : iSCSI node index = 10 --------------- -Object: index=11 type= state=mature parent=9 - 0010 ipaddr : Portal IP address = 127.1.0.2 - 0011 uint32 : Portal TCP/UDP port = 3260/tcp - 0016 uint32 : Portal index = 11 --------------- -Object: index=12 type= state=mature parent=9 - 0030 string : Portal group name = "isns.client2" - 0031 ipaddr : Portal group address = 127.1.0.2 - 0032 uint32 : Portal group port = 3260/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 12 --------------- -Object: index=14 type= state=limbo - 0020 string : iSCSI name = "iqn.com.foobar:disk1" - 0024 uint32 : iSCSI node index = 14 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test03/01-enroll open-iscsi-2.0.874/utils/open-isns/tests/data/test03/01-enroll --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test03/01-enroll 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test03/01-enroll 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test03/server0/database -Last EID: 1 -Last Index: 4 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b6 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test03/02-registration open-iscsi-2.0.874/utils/open-isns/tests/data/test03/02-registration --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test03/02-registration 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test03/02-registration 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test03/server0/database -Last EID: 1 -Last Index: 8 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b7 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 --------------- -Object: index=4 type= state=mature - 0001 string : Entity identifier = "client1.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:36:35 2007 - 0007 uint32 : Entity index = 4 --------------- -Object: index=5 type= state=mature parent=4 - 0020 string : iSCSI name = "isns.client1" - 0021 uint32 : iSCSI node type = Initiator - 0024 uint32 : iSCSI node index = 5 --------------- -Object: index=6 type= state=mature parent=4 - 0010 ipaddr : Portal IP address = 127.0.0.1 - 0011 uint32 : Portal TCP/UDP port = 860/tcp - 0016 uint32 : Portal index = 6 --------------- -Object: index=7 type= state=mature parent=4 - 0030 string : Portal group name = "isns.client1" - 0031 ipaddr : Portal group address = 127.0.0.1 - 0032 uint32 : Portal group port = 860/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 7 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test03/03-unregistration open-iscsi-2.0.874/utils/open-isns/tests/data/test03/03-unregistration --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test03/03-unregistration 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test03/03-unregistration 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test03/server0/database -Last EID: 1 -Last Index: 8 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b7 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 --------------- -Object: index=4 type= state=mature - 0001 string : Entity identifier = "client1.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:25:47 2007 - 0007 uint32 : Entity index = 4 --------------- -Object: index=5 type= state=mature parent=4 - 0020 string : iSCSI name = "isns.client1" - 0021 uint32 : iSCSI node type = Initiator - 0024 uint32 : iSCSI node index = 5 --------------- -Object: index=6 type= state=limbo - 0010 ipaddr : Portal IP address = 127.0.0.1 - 0011 uint32 : Portal TCP/UDP port = 860/tcp - 0016 uint32 : Portal index = 6 --------------- -Object: index=7 type= state=mature parent=4 - 0030 string : Portal group name = "isns.client1" - 0031 ipaddr : Portal group address = 127.0.0.1 - 0032 uint32 : Portal group port = 860/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 7 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test03/04-unregistration open-iscsi-2.0.874/utils/open-isns/tests/data/test03/04-unregistration --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test03/04-unregistration 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test03/04-unregistration 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test03/server0/database -Last EID: 1 -Last Index: 8 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b7 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test03/99-unregistration open-iscsi-2.0.874/utils/open-isns/tests/data/test03/99-unregistration --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test03/99-unregistration 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test03/99-unregistration 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test03/server0/database -Last EID: 1 -Last Index: 7 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b7 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test04/01-enroll open-iscsi-2.0.874/utils/open-isns/tests/data/test04/01-enroll --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test04/01-enroll 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test04/01-enroll 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test04/server0/database -Last EID: 1 -Last Index: 4 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b7 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test04/02-registration open-iscsi-2.0.874/utils/open-isns/tests/data/test04/02-registration --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test04/02-registration 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test04/02-registration 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test04/server0/database -Last EID: 1 -Last Index: 8 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b7 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 --------------- -Object: index=4 type= state=mature - 0001 string : Entity identifier = "client1.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:38:41 2007 - 0007 uint32 : Entity index = 4 --------------- -Object: index=5 type= state=mature parent=4 - 0020 string : iSCSI name = "isns.client1" - 0021 uint32 : iSCSI node type = Initiator - 0024 uint32 : iSCSI node index = 5 --------------- -Object: index=6 type= state=mature parent=4 - 0010 ipaddr : Portal IP address = 127.0.0.1 - 0011 uint32 : Portal TCP/UDP port = 860/tcp - 0016 uint32 : Portal index = 6 --------------- -Object: index=7 type= state=mature parent=4 - 0030 string : Portal group name = "isns.client1" - 0031 ipaddr : Portal group address = 127.0.0.1 - 0032 uint32 : Portal group port = 860/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 7 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test04/03-restart open-iscsi-2.0.874/utils/open-isns/tests/data/test04/03-restart --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test04/03-restart 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test04/03-restart 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test04/server0/database -Last EID: 1 -Last Index: 8 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b7 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 --------------- -Object: index=4 type= state=mature - 0001 string : Entity identifier = "client1.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:38:41 2007 - 0007 uint32 : Entity index = 4 --------------- -Object: index=5 type= state=mature parent=4 - 0020 string : iSCSI name = "isns.client1" - 0021 uint32 : iSCSI node type = Initiator - 0024 uint32 : iSCSI node index = 5 --------------- -Object: index=6 type= state=mature parent=4 - 0010 ipaddr : Portal IP address = 127.0.0.1 - 0011 uint32 : Portal TCP/UDP port = 860/tcp - 0016 uint32 : Portal index = 6 --------------- -Object: index=7 type= state=mature parent=4 - 0030 string : Portal group name = "isns.client1" - 0031 ipaddr : Portal group address = 127.0.0.1 - 0032 uint32 : Portal group port = 860/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 7 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test04/04-query open-iscsi-2.0.874/utils/open-isns/tests/data/test04/04-query --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test04/04-query 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test04/04-query 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -object[0] = - 0001 string : Entity identifier = "client1.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:38:42 2007 - 0007 uint32 : Entity index = 4 -object[1] = - 0020 string : iSCSI name = "isns.client1" - 0021 uint32 : iSCSI node type = Initiator - 0024 uint32 : iSCSI node index = 5 -object[2] = - 0010 ipaddr : Portal IP address = 127.0.0.1 - 0011 uint32 : Portal TCP/UDP port = 860/tcp - 0016 uint32 : Portal index = 6 -object[3] = - 0030 string : Portal group name = "isns.client1" - 0031 ipaddr : Portal group address = 127.0.0.1 - 0032 uint32 : Portal group port = 860/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 7 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test05/01-enroll open-iscsi-2.0.874/utils/open-isns/tests/data/test05/01-enroll --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test05/01-enroll 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test05/01-enroll 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test05/server0/database -Last EID: 1 -Last Index: 4 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b6 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test05/02-registration open-iscsi-2.0.874/utils/open-isns/tests/data/test05/02-registration --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test05/02-registration 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test05/02-registration 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test05/server0/database -Last EID: 1 -Last Index: 8 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b6 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 --------------- -Object: index=4 type= state=mature - 0001 string : Entity identifier = "client1.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 20 - 0004 uint64 : Timestamp = Fri Sep 14 13:40:40 2007 - 0007 uint32 : Entity index = 4 --------------- -Object: index=5 type= state=mature parent=4 - 0020 string : iSCSI name = "isns.client1" - 0021 uint32 : iSCSI node type = Initiator - 0024 uint32 : iSCSI node index = 5 --------------- -Object: index=6 type= state=mature parent=4 - 0010 ipaddr : Portal IP address = 127.0.0.1 - 0011 uint32 : Portal TCP/UDP port = 860/tcp - 0016 uint32 : Portal index = 6 --------------- -Object: index=7 type= state=mature parent=4 - 0030 string : Portal group name = "isns.client1" - 0031 ipaddr : Portal group address = 127.0.0.1 - 0032 uint32 : Portal group port = 860/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 7 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test05/03-expired open-iscsi-2.0.874/utils/open-isns/tests/data/test05/03-expired --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test05/03-expired 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test05/03-expired 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test05/server0/database -Last EID: 1 -Last Index: 8 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b6 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test06/01-enroll open-iscsi-2.0.874/utils/open-isns/tests/data/test06/01-enroll --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test06/01-enroll 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test06/01-enroll 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test06/server0/database -Last EID: 1 -Last Index: 4 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b7 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test06/02-registration open-iscsi-2.0.874/utils/open-isns/tests/data/test06/02-registration --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test06/02-registration 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test06/02-registration 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test06/server0/database -Last EID: 1 -Last Index: 8 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b7 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 --------------- -Object: index=4 type= state=mature - 0001 string : Entity identifier = "client1.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:41:51 2007 - 0007 uint32 : Entity index = 4 --------------- -Object: index=5 type= state=mature parent=4 - 0020 string : iSCSI name = "isns.client1" - 0021 uint32 : iSCSI node type = Initiator - 0024 uint32 : iSCSI node index = 5 --------------- -Object: index=6 type= state=mature parent=4 - 0010 ipaddr : Portal IP address = 127.0.0.1 - 0011 uint32 : Portal TCP/UDP port = 860/tcp - 0016 uint32 : Portal index = 6 --------------- -Object: index=7 type= state=mature parent=4 - 0030 string : Portal group name = "isns.client1" - 0031 ipaddr : Portal group address = 127.0.0.1 - 0032 uint32 : Portal group port = 860/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 7 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test06/03-registration open-iscsi-2.0.874/utils/open-isns/tests/data/test06/03-registration --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test06/03-registration 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test06/03-registration 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test06/server0/database -Last EID: 1 -Last Index: 12 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b7 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 --------------- -Object: index=8 type= state=mature - 0001 string : Entity identifier = "client1.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:41:51 2007 - 0007 uint32 : Entity index = 8 --------------- -Object: index=9 type= state=mature parent=8 - 0020 string : iSCSI name = "isns.client1" - 0021 uint32 : iSCSI node type = Initiator - 0024 uint32 : iSCSI node index = 9 --------------- -Object: index=10 type= state=mature parent=8 - 0010 ipaddr : Portal IP address = 192.168.1.1 - 0011 uint32 : Portal TCP/UDP port = 860/tcp - 0016 uint32 : Portal index = 10 --------------- -Object: index=11 type= state=mature parent=8 - 0030 string : Portal group name = "isns.client1" - 0031 ipaddr : Portal group address = 192.168.1.1 - 0032 uint32 : Portal group port = 860/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 11 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test06/04-registration open-iscsi-2.0.874/utils/open-isns/tests/data/test06/04-registration --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test06/04-registration 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test06/04-registration 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test06/server0/database -Last EID: 1 -Last Index: 16 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b7 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 --------------- -Object: index=12 type= state=mature - 0001 string : Entity identifier = "client1.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:41:51 2007 - 0007 uint32 : Entity index = 12 --------------- -Object: index=13 type= state=mature parent=12 - 0020 string : iSCSI name = "isns.client1" - 0021 uint32 : iSCSI node type = Initiator - 0024 uint32 : iSCSI node index = 13 --------------- -Object: index=14 type= state=mature parent=12 - 0010 ipaddr : Portal IP address = 192.168.1.2 - 0011 uint32 : Portal TCP/UDP port = 860/tcp - 0016 uint32 : Portal index = 14 --------------- -Object: index=15 type= state=mature parent=12 - 0030 string : Portal group name = "isns.client1" - 0031 ipaddr : Portal group address = 192.168.1.2 - 0032 uint32 : Portal group port = 860/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 15 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test06/05-dd-registration open-iscsi-2.0.874/utils/open-isns/tests/data/test06/05-dd-registration --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test06/05-dd-registration 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test06/05-dd-registration 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test06/server0/database -Last EID: 1 -Last Index: 17 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b7 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 --------------- -Object: index=12 type= state=mature - 0001 string : Entity identifier = "client1.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:41:52 2007 - 0007 uint32 : Entity index = 12 --------------- -Object: index=13 type= state=mature parent=12 - 0020 string : iSCSI name = "isns.client1" - 0021 uint32 : iSCSI node type = Initiator - 0024 uint32 : iSCSI node index = 13 --------------- -Object: index=14 type= state=mature parent=12 - 0010 ipaddr : Portal IP address = 192.168.1.2 - 0011 uint32 : Portal TCP/UDP port = 860/tcp - 0016 uint32 : Portal index = 14 --------------- -Object: index=15 type= state=mature parent=12 - 0030 string : Portal group name = "isns.client1" - 0031 ipaddr : Portal group address = 192.168.1.2 - 0032 uint32 : Portal group port = 860/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 15 --------------- -Object: index=16 type= state=mature - 0811 uint32 : DD ID = 1 - 0812 string : DD name = "isns.dd1" - 081e uint32 : DD features = - 0813 uint32 : DD member iSCSI index = 13 - 0814 string : DD member iSCSI name = "isns.client1" diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test06/06-registration open-iscsi-2.0.874/utils/open-isns/tests/data/test06/06-registration --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test06/06-registration 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test06/06-registration 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test06/server0/database -Last EID: 1 -Last Index: 20 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b7 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 --------------- -Object: index=17 type= state=mature - 0001 string : Entity identifier = "client1.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:41:52 2007 - 0007 uint32 : Entity index = 17 --------------- -Object: index=13 type= state=mature parent=17 - 0020 string : iSCSI name = "isns.client1" - 0021 uint32 : iSCSI node type = Initiator - 0024 uint32 : iSCSI node index = 13 --------------- -Object: index=18 type= state=mature parent=17 - 0010 ipaddr : Portal IP address = 192.168.1.1 - 0011 uint32 : Portal TCP/UDP port = 860/tcp - 0016 uint32 : Portal index = 18 --------------- -Object: index=19 type= state=mature parent=17 - 0030 string : Portal group name = "isns.client1" - 0031 ipaddr : Portal group address = 192.168.1.1 - 0032 uint32 : Portal group port = 860/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 19 --------------- -Object: index=16 type= state=mature - 0811 uint32 : DD ID = 1 - 0812 string : DD name = "isns.dd1" - 081e uint32 : DD features = - 0813 uint32 : DD member iSCSI index = 13 - 0814 string : DD member iSCSI name = "isns.client1" diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test06/07-dd-registration open-iscsi-2.0.874/utils/open-isns/tests/data/test06/07-dd-registration --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test06/07-dd-registration 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test06/07-dd-registration 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test06/server0/database -Last EID: 1 -Last Index: 20 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b7 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 --------------- -Object: index=17 type= state=mature - 0001 string : Entity identifier = "client1.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:41:52 2007 - 0007 uint32 : Entity index = 17 --------------- -Object: index=13 type= state=mature parent=17 - 0020 string : iSCSI name = "isns.client1" - 0021 uint32 : iSCSI node type = Initiator - 0024 uint32 : iSCSI node index = 13 --------------- -Object: index=18 type= state=mature parent=17 - 0010 ipaddr : Portal IP address = 192.168.1.1 - 0011 uint32 : Portal TCP/UDP port = 860/tcp - 0016 uint32 : Portal index = 18 --------------- -Object: index=19 type= state=mature parent=17 - 0030 string : Portal group name = "isns.client1" - 0031 ipaddr : Portal group address = 192.168.1.1 - 0032 uint32 : Portal group port = 860/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 19 --------------- -Object: index=16 type= state=mature - 0811 uint32 : DD ID = 1 - 0812 string : DD name = "isns.dd1" - 081e uint32 : DD features = - 0813 uint32 : DD member iSCSI index = 13 - 0814 string : DD member iSCSI name = "isns.client1" - 0816 uint32 : DD member portal index = 18 - 0817 ipaddr : DD member portal addr = 192.168.1.1 - 0818 uint32 : DD member portal port = 860/tcp diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test06/08-registration open-iscsi-2.0.874/utils/open-isns/tests/data/test06/08-registration --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test06/08-registration 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test06/08-registration 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test06/server0/database -Last EID: 1 -Last Index: 22 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b7 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 --------------- -Object: index=17 type= state=mature - 0001 string : Entity identifier = "client1.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:41:52 2007 - 0007 uint32 : Entity index = 17 --------------- -Object: index=13 type= state=mature parent=17 - 0020 string : iSCSI name = "isns.client1" - 0021 uint32 : iSCSI node type = Initiator - 0024 uint32 : iSCSI node index = 13 --------------- -Object: index=18 type= state=limbo - 0010 ipaddr : Portal IP address = 192.168.1.1 - 0011 uint32 : Portal TCP/UDP port = 860/tcp - 0016 uint32 : Portal index = 18 --------------- -Object: index=19 type= state=mature parent=17 - 0030 string : Portal group name = "isns.client1" - 0031 ipaddr : Portal group address = 192.168.1.1 - 0032 uint32 : Portal group port = 860/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 19 --------------- -Object: index=16 type= state=mature - 0811 uint32 : DD ID = 1 - 0812 string : DD name = "isns.dd1" - 081e uint32 : DD features = - 0813 uint32 : DD member iSCSI index = 13 - 0814 string : DD member iSCSI name = "isns.client1" - 0816 uint32 : DD member portal index = 18 - 0817 ipaddr : DD member portal addr = 192.168.1.1 - 0818 uint32 : DD member portal port = 860/tcp --------------- -Object: index=20 type= state=mature parent=17 - 0010 ipaddr : Portal IP address = 192.168.1.2 - 0011 uint32 : Portal TCP/UDP port = 860/tcp - 0016 uint32 : Portal index = 20 --------------- -Object: index=21 type= state=mature parent=17 - 0030 string : Portal group name = "isns.client1" - 0031 ipaddr : Portal group address = 192.168.1.2 - 0032 uint32 : Portal group port = 860/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 21 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test06/09-registration open-iscsi-2.0.874/utils/open-isns/tests/data/test06/09-registration --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test06/09-registration 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test06/09-registration 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test06/server0/database -Last EID: 1 -Last Index: 22 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b7 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 --------------- -Object: index=17 type= state=mature - 0001 string : Entity identifier = "client1.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:41:52 2007 - 0007 uint32 : Entity index = 17 --------------- -Object: index=13 type= state=mature parent=17 - 0020 string : iSCSI name = "isns.client1" - 0021 uint32 : iSCSI node type = Initiator - 0024 uint32 : iSCSI node index = 13 --------------- -Object: index=18 type= state=mature parent=17 - 0010 ipaddr : Portal IP address = 192.168.1.1 - 0011 uint32 : Portal TCP/UDP port = 860/tcp - 0016 uint32 : Portal index = 18 --------------- -Object: index=19 type= state=mature parent=17 - 0030 string : Portal group name = "isns.client1" - 0031 ipaddr : Portal group address = 192.168.1.1 - 0032 uint32 : Portal group port = 860/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 19 --------------- -Object: index=16 type= state=mature - 0811 uint32 : DD ID = 1 - 0812 string : DD name = "isns.dd1" - 081e uint32 : DD features = - 0813 uint32 : DD member iSCSI index = 13 - 0814 string : DD member iSCSI name = "isns.client1" - 0816 uint32 : DD member portal index = 18 - 0817 ipaddr : DD member portal addr = 192.168.1.1 - 0818 uint32 : DD member portal port = 860/tcp --------------- -Object: index=20 type= state=limbo - 0010 ipaddr : Portal IP address = 192.168.1.2 - 0011 uint32 : Portal TCP/UDP port = 860/tcp - 0016 uint32 : Portal index = 20 --------------- -Object: index=21 type= state=mature parent=17 - 0030 string : Portal group name = "isns.client1" - 0031 ipaddr : Portal group address = 192.168.1.2 - 0032 uint32 : Portal group port = 860/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 21 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test06/10-unregistration open-iscsi-2.0.874/utils/open-isns/tests/data/test06/10-unregistration --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test06/10-unregistration 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test06/10-unregistration 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test06/server0/database -Last EID: 1 -Last Index: 22 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b7 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 --------------- -Object: index=13 type= state=limbo - 0020 string : iSCSI name = "isns.client1" - 0024 uint32 : iSCSI node index = 13 --------------- -Object: index=18 type= state=limbo - 0010 ipaddr : Portal IP address = 192.168.1.1 - 0011 uint32 : Portal TCP/UDP port = 860/tcp - 0016 uint32 : Portal index = 18 --------------- -Object: index=16 type= state=mature - 0811 uint32 : DD ID = 1 - 0812 string : DD name = "isns.dd1" - 081e uint32 : DD features = - 0813 uint32 : DD member iSCSI index = 13 - 0814 string : DD member iSCSI name = "isns.client1" - 0816 uint32 : DD member portal index = 18 - 0817 ipaddr : DD member portal addr = 192.168.1.1 - 0818 uint32 : DD member portal port = 860/tcp diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test06/11-registration open-iscsi-2.0.874/utils/open-isns/tests/data/test06/11-registration --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test06/11-registration 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test06/11-registration 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test06/server0/database -Last EID: 1 -Last Index: 24 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b7 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 --------------- -Object: index=22 type= state=mature - 0001 string : Entity identifier = "client1.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 21 11:23:54 2007 - 0007 uint32 : Entity index = 22 --------------- -Object: index=13 type= state=mature parent=22 - 0020 string : iSCSI name = "isns.client1" - 0024 uint32 : iSCSI node index = 13 - 0021 uint32 : iSCSI node type = Initiator --------------- -Object: index=18 type= state=mature parent=22 - 0010 ipaddr : Portal IP address = 192.168.1.1 - 0011 uint32 : Portal TCP/UDP port = 860/tcp - 0016 uint32 : Portal index = 18 --------------- -Object: index=23 type= state=mature parent=22 - 0030 string : Portal group name = "isns.client1" - 0031 ipaddr : Portal group address = 192.168.1.1 - 0032 uint32 : Portal group port = 860/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 23 --------------- -Object: index=16 type= state=mature - 0811 uint32 : DD ID = 1 - 0812 string : DD name = "isns.dd1" - 081e uint32 : DD features = - 0813 uint32 : DD member iSCSI index = 13 - 0814 string : DD member iSCSI name = "isns.client1" - 0816 uint32 : DD member portal index = 18 - 0817 ipaddr : DD member portal addr = 192.168.1.1 - 0818 uint32 : DD member portal port = 860/tcp diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test07/01-enroll open-iscsi-2.0.874/utils/open-isns/tests/data/test07/01-enroll --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test07/01-enroll 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test07/01-enroll 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test07/server0/database -Last EID: 1 -Last Index: 4 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 - 0004 uint64 : Timestamp = Fri Sep 14 13:42:57 2007 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b6 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test07/02-registration open-iscsi-2.0.874/utils/open-isns/tests/data/test07/02-registration --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test07/02-registration 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test07/02-registration 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test07/server0/database -Last EID: 1 -Last Index: 8 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 - 0004 uint64 : Timestamp = Fri Sep 14 13:42:57 2007 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b6 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 --------------- -Object: index=4 type= state=mature - 0001 string : Entity identifier = "client1.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:42:57 2007 - 0007 uint32 : Entity index = 4 --------------- -Object: index=5 type= state=mature parent=4 - 0020 string : iSCSI name = "isns.client1" - 0024 uint32 : iSCSI node index = 5 - 0021 uint32 : iSCSI node type = Initiator --------------- -Object: index=6 type= state=mature parent=4 - 0010 ipaddr : Portal IP address = 127.0.0.1 - 0011 uint32 : Portal TCP/UDP port = 860/tcp - 0016 uint32 : Portal index = 6 - 0014 uint32 : ESI port = 65535/tcp - 0013 uint32 : ESI interval = 5 --------------- -Object: index=7 type= state=mature parent=4 - 0030 string : Portal group name = "isns.client1" - 0031 ipaddr : Portal group address = 127.0.0.1 - 0032 uint32 : Portal group port = 860/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 7 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test07/03-expired open-iscsi-2.0.874/utils/open-isns/tests/data/test07/03-expired --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test07/03-expired 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test07/03-expired 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test07/server0/database -Last EID: 1 -Last Index: 8 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 - 0004 uint64 : Timestamp = Fri Sep 14 13:42:57 2007 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b6 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test07/04-registration open-iscsi-2.0.874/utils/open-isns/tests/data/test07/04-registration --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test07/04-registration 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test07/04-registration 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test07/server0/database -Last EID: 1 -Last Index: 14 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 - 0004 uint64 : Timestamp = Fri Sep 14 13:43:12 2007 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b6 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 --------------- -Object: index=8 type= state=mature - 0001 string : Entity identifier = "client1.isns-test.eu" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 14 13:43:12 2007 - 0007 uint32 : Entity index = 8 --------------- -Object: index=9 type= state=mature parent=8 - 0020 string : iSCSI name = "isns.client1" - 0024 uint32 : iSCSI node index = 9 - 0021 uint32 : iSCSI node type = Initiator --------------- -Object: index=10 type= state=mature parent=8 - 0010 ipaddr : Portal IP address = 127.0.0.1 - 0011 uint32 : Portal TCP/UDP port = 860/tcp - 0016 uint32 : Portal index = 10 - 0014 uint32 : ESI port = 65535/tcp - 0013 uint32 : ESI interval = 5 --------------- -Object: index=11 type= state=mature parent=8 - 0010 ipaddr : Portal IP address = 127.0.0.1 - 0011 uint32 : Portal TCP/UDP port = 1/tcp - 0016 uint32 : Portal index = 11 --------------- -Object: index=12 type= state=mature parent=8 - 0030 string : Portal group name = "isns.client1" - 0031 ipaddr : Portal group address = 127.0.0.1 - 0032 uint32 : Portal group port = 860/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 12 --------------- -Object: index=13 type= state=mature parent=8 - 0030 string : Portal group name = "isns.client1" - 0031 ipaddr : Portal group address = 127.0.0.1 - 0032 uint32 : Portal group port = 1/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 13 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test07/05-expired open-iscsi-2.0.874/utils/open-isns/tests/data/test07/05-expired --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test07/05-expired 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test07/05-expired 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test07/server0/database -Last EID: 1 -Last Index: 14 --------------- -Object: index=1 type= state=mature PRIVATE - 0001 string : Entity identifier = "CONTROL" - 0007 uint32 : Entity index = 1 - 0004 uint64 : Timestamp = Fri Sep 14 13:43:12 2007 --------------- -Object: index=2 type= state=mature parent=1 PRIVATE - 0601v string : Security Policy Index = "client1.isns-test.eu" - 0607v string : Policy allowed node name = "isns.client1" - 0603v opaque : DSA security key = <30 82 01 b6 30 82 01 2b 06 07 2a 86 48 ce 38 04 01 30 82 01... --------------- -Object: index=3 type= state=mature parent=1 PRIVATE - 0020 string : iSCSI name = "isns.control" - 0021 uint32 : iSCSI node type = - 0024 uint32 : iSCSI node index = 3 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test08/01-pauw1 open-iscsi-2.0.874/utils/open-isns/tests/data/test08/01-pauw1 --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test08/01-pauw1 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test08/01-pauw1 1970-01-01 00:00:00.000000000 +0000 @@ -1,100 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test08/server0/database -Last EID: 1 -Last Index: 15 --------------- -Object: index=1 type= state=mature - 0001 string : Entity identifier = "cyan.pauw.homeunix.net" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Mon Sep 17 15:15:41 2007 - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 - 0020 string : iSCSI name = "iqn.2000-05.com.wasabisystems.storagebuilder:cyan-0" - 0024 uint32 : iSCSI node index = 2 - 0021 uint32 : iSCSI node type = Target - 0022 string : iSCSI alias = "Test (10 GB)" - 002a string : iSCSI auth method = "None" --------------- -Object: index=3 type= state=mature parent=1 - 0020 string : iSCSI name = "iqn.2000-05.com.wasabisystems.storagebuilder:cyan-1" - 0024 uint32 : iSCSI node index = 3 - 0021 uint32 : iSCSI node type = Target - 0022 string : iSCSI alias = "160 GB disk (ntfs)" - 002a string : iSCSI auth method = "None" --------------- -Object: index=4 type= state=mature parent=1 - 0020 string : iSCSI name = "iqn.2000-05.com.wasabisystems.storagebuilder:cyan-2" - 0024 uint32 : iSCSI node index = 4 - 0021 uint32 : iSCSI node type = Target - 0022 string : iSCSI alias = "160 GB disk (ext3)" - 002a string : iSCSI auth method = "CHAP" --------------- -Object: index=5 type= state=mature parent=1 - 0020 string : iSCSI name = "iqn.2000-05.com.wasabisystems.storagebuilder:cyan-3" - 0024 uint32 : iSCSI node index = 5 - 0021 uint32 : iSCSI node type = Target - 0022 string : iSCSI alias = "Test (1 GB)" - 002a string : iSCSI auth method = "None" --------------- -Object: index=6 type= state=mature parent=1 - 0020 string : iSCSI name = "iqn.2000-05.com.wasabisystems.storagebuilder:cyan-4" - 0024 uint32 : iSCSI node index = 6 - 0021 uint32 : iSCSI node type = Target - 0022 string : iSCSI alias = "Test (40 GB)" - 002a string : iSCSI auth method = "CHAP" --------------- -Object: index=7 type= state=mature parent=1 - 0020 string : iSCSI name = "iqn.2000-05.com.wasabisystems.storagebuilder:cyan-5" - 0024 uint32 : iSCSI node index = 7 - 0021 uint32 : iSCSI node type = Target - 0022 string : iSCSI alias = "test" - 002a string : iSCSI auth method = "None" --------------- -Object: index=8 type= state=mature parent=1 - 0010 ipaddr : Portal IP address = 10.0.0.1 - 0011 uint32 : Portal TCP/UDP port = 3260/tcp - 0016 uint32 : Portal index = 8 --------------- -Object: index=9 type= state=mature parent=1 - 0030 string : Portal group name = "iqn.2000-05.com.wasabisystems.storagebuilder:cyan-0" - 0031 ipaddr : Portal group address = 10.0.0.1 - 0032 uint32 : Portal group port = 3260/tcp - 0034 uint32 : Portal group index = 9 - 0033 uint32 : Portal group tag = 1 --------------- -Object: index=10 type= state=mature parent=1 - 0030 string : Portal group name = "iqn.2000-05.com.wasabisystems.storagebuilder:cyan-1" - 0031 ipaddr : Portal group address = 10.0.0.1 - 0032 uint32 : Portal group port = 3260/tcp - 0034 uint32 : Portal group index = 10 - 0033 uint32 : Portal group tag = 1 --------------- -Object: index=11 type= state=mature parent=1 - 0030 string : Portal group name = "iqn.2000-05.com.wasabisystems.storagebuilder:cyan-2" - 0031 ipaddr : Portal group address = 10.0.0.1 - 0032 uint32 : Portal group port = 3260/tcp - 0034 uint32 : Portal group index = 11 - 0033 uint32 : Portal group tag = 1 --------------- -Object: index=12 type= state=mature parent=1 - 0030 string : Portal group name = "iqn.2000-05.com.wasabisystems.storagebuilder:cyan-3" - 0031 ipaddr : Portal group address = 10.0.0.1 - 0032 uint32 : Portal group port = 3260/tcp - 0034 uint32 : Portal group index = 12 - 0033 uint32 : Portal group tag = 1 --------------- -Object: index=13 type= state=mature parent=1 - 0030 string : Portal group name = "iqn.2000-05.com.wasabisystems.storagebuilder:cyan-4" - 0031 ipaddr : Portal group address = 10.0.0.1 - 0032 uint32 : Portal group port = 3260/tcp - 0034 uint32 : Portal group index = 13 - 0033 uint32 : Portal group tag = 1 --------------- -Object: index=14 type= state=mature parent=1 - 0030 string : Portal group name = "iqn.2000-05.com.wasabisystems.storagebuilder:cyan-5" - 0031 ipaddr : Portal group address = 10.0.0.1 - 0032 uint32 : Portal group port = 3260/tcp - 0034 uint32 : Portal group index = 14 - 0033 uint32 : Portal group tag = 1 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test09/01-pauw2 open-iscsi-2.0.874/utils/open-isns/tests/data/test09/01-pauw2 --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test09/01-pauw2 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test09/01-pauw2 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test09/server0/database -Last EID: 1 -Last Index: 9 --------------- -Object: index=5 type= state=mature - 0001 string : Entity identifier = "blue.pauw.homeunix.net" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Mon Sep 17 15:18:04 2007 - 0007 uint32 : Entity index = 5 --------------- -Object: index=6 type= state=mature parent=5 - 0010 ipaddr : Portal IP address = 192.168.1.2 - 0011 uint32 : Portal TCP/UDP port = 33849/tcp - 0016 uint32 : Portal index = 6 - 0014 uint32 : ESI port = 56288/tcp - 0013 uint32 : ESI interval = 300 --------------- -Object: index=7 type= state=mature parent=5 - 0020 string : iSCSI name = "iqn.2005-03.org.open-iscsi:blue" - 0024 uint32 : iSCSI node index = 7 - 0021 uint32 : iSCSI node type = Initiator - 0022 string : iSCSI alias = "blue.pauw.homeunix.net" --------------- -Object: index=8 type= state=mature parent=5 - 0030 string : Portal group name = "iqn.2005-03.org.open-iscsi:blue" - 0031 ipaddr : Portal group address = 192.168.1.2 - 0032 uint32 : Portal group port = 33849/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 8 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test10/01-pauw3 open-iscsi-2.0.874/utils/open-isns/tests/data/test10/01-pauw3 --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test10/01-pauw3 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test10/01-pauw3 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test10/server0/database -Last EID: 1 -Last Index: 9 --------------- -Object: index=5 type= state=mature - 0001 string : Entity identifier = "blue.pauw.homeunix.net" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Mon Sep 17 16:34:30 2007 - 0007 uint32 : Entity index = 5 --------------- -Object: index=6 type= state=mature parent=5 - 0010 ipaddr : Portal IP address = 192.168.1.2 - 0011 uint32 : Portal TCP/UDP port = 33849/tcp - 0016 uint32 : Portal index = 6 - 0014 uint32 : ESI port = 56288/tcp - 0013 uint32 : ESI interval = 10 --------------- -Object: index=7 type= state=mature parent=5 - 0020 string : iSCSI name = "iqn.2005-03.org.open-iscsi:blue" - 0024 uint32 : iSCSI node index = 7 - 0021 uint32 : iSCSI node type = Initiator - 0022 string : iSCSI alias = "blue.pauw.homeunix.net" --------------- -Object: index=8 type= state=mature parent=5 - 0030 string : Portal group name = "iqn.2005-03.org.open-iscsi:blue" - 0031 ipaddr : Portal group address = 192.168.1.2 - 0032 uint32 : Portal group port = 33849/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 8 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test10/02-expired open-iscsi-2.0.874/utils/open-isns/tests/data/test10/02-expired --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test10/02-expired 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test10/02-expired 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test10/server0/database -Last EID: 1 -Last Index: 9 --------------- -Object: index=5 type= state=mature - 0001 string : Entity identifier = "blue.pauw.homeunix.net" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Mon Sep 17 16:34:30 2007 - 0007 uint32 : Entity index = 5 --------------- -Object: index=6 type= state=mature parent=5 - 0010 ipaddr : Portal IP address = 192.168.1.2 - 0011 uint32 : Portal TCP/UDP port = 33849/tcp - 0016 uint32 : Portal index = 6 - 0014 uint32 : ESI port = 56288/tcp - 0013 uint32 : ESI interval = 10 --------------- -Object: index=7 type= state=mature parent=5 - 0020 string : iSCSI name = "iqn.2005-03.org.open-iscsi:blue" - 0024 uint32 : iSCSI node index = 7 - 0021 uint32 : iSCSI node type = Initiator - 0022 string : iSCSI alias = "blue.pauw.homeunix.net" --------------- -Object: index=8 type= state=mature parent=5 - 0030 string : Portal group name = "iqn.2005-03.org.open-iscsi:blue" - 0031 ipaddr : Portal group address = 192.168.1.2 - 0032 uint32 : Portal group port = 33849/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 8 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test10/03-pauw3 open-iscsi-2.0.874/utils/open-isns/tests/data/test10/03-pauw3 --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test10/03-pauw3 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test10/03-pauw3 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test10/server0/database -Last EID: 1 -Last Index: 9 --------------- -Object: index=5 type= state=mature - 0001 string : Entity identifier = "blue.pauw.homeunix.net" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Mon Sep 17 16:34:51 2007 - 0007 uint32 : Entity index = 5 --------------- -Object: index=6 type= state=mature parent=5 - 0010 ipaddr : Portal IP address = 192.168.1.2 - 0011 uint32 : Portal TCP/UDP port = 33849/tcp - 0016 uint32 : Portal index = 6 - 0014 uint32 : ESI port = 56288/tcp - 0013 uint32 : ESI interval = 10 --------------- -Object: index=7 type= state=mature parent=5 - 0020 string : iSCSI name = "iqn.2005-03.org.open-iscsi:blue" - 0024 uint32 : iSCSI node index = 7 - 0021 uint32 : iSCSI node type = Initiator - 0022 string : iSCSI alias = "blue.pauw.homeunix.net" --------------- -Object: index=8 type= state=mature parent=5 - 0030 string : Portal group name = "iqn.2005-03.org.open-iscsi:blue" - 0031 ipaddr : Portal group address = 192.168.1.2 - 0032 uint32 : Portal group port = 33849/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 8 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test10/04-expired open-iscsi-2.0.874/utils/open-isns/tests/data/test10/04-expired --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test10/04-expired 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test10/04-expired 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test10/server0/database -Last EID: 1 -Last Index: 9 --------------- -Object: index=5 type= state=mature - 0001 string : Entity identifier = "blue.pauw.homeunix.net" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Mon Sep 17 16:34:51 2007 - 0007 uint32 : Entity index = 5 --------------- -Object: index=6 type= state=mature parent=5 - 0010 ipaddr : Portal IP address = 192.168.1.2 - 0011 uint32 : Portal TCP/UDP port = 33849/tcp - 0016 uint32 : Portal index = 6 - 0014 uint32 : ESI port = 56288/tcp - 0013 uint32 : ESI interval = 10 --------------- -Object: index=7 type= state=mature parent=5 - 0020 string : iSCSI name = "iqn.2005-03.org.open-iscsi:blue" - 0024 uint32 : iSCSI node index = 7 - 0021 uint32 : iSCSI node type = Initiator - 0022 string : iSCSI alias = "blue.pauw.homeunix.net" --------------- -Object: index=8 type= state=mature parent=5 - 0030 string : Portal group name = "iqn.2005-03.org.open-iscsi:blue" - 0031 ipaddr : Portal group address = 192.168.1.2 - 0032 uint32 : Portal group port = 33849/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 8 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test11/01-pauw4 open-iscsi-2.0.874/utils/open-isns/tests/data/test11/01-pauw4 --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/data/test11/01-pauw4 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/data/test11/01-pauw4 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -Dumping database contents -Backend: /tmp/isns-test/test11/server0/database -Last EID: 1 -Last Index: 5 --------------- -Object: index=1 type= state=mature - 0001 string : Entity identifier = "troopa.nki.nl" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 7200 - 0004 uint64 : Timestamp = Fri Sep 21 09:37:10 2007 - 0007 uint32 : Entity index = 1 --------------- -Object: index=2 type= state=mature parent=1 - 0010 ipaddr : Portal IP address = 192.168.1.40 - 0011 uint32 : Portal TCP/UDP port = 3229/tcp - 0017 uint32 : SCN port = 3230/tcp - 0014 uint32 : ESI port = 3230/tcp - 0013 uint32 : ESI interval = 300 - 0016 uint32 : Portal index = 2 --------------- -Object: index=3 type= state=mature parent=1 - 0030 string : Portal group name = "iqn.1991-05.com.microsoft:orange" - 0031 ipaddr : Portal group address = 192.168.1.40 - 0032 uint32 : Portal group port = 3229/tcp - 0033 uint32 : Portal group tag = 1 - 0034 uint32 : Portal group index = 3 --------------- -Object: index=4 type= state=mature parent=1 - 0020 string : iSCSI name = "iqn.1991-05.com.microsoft:orange" - 0021 uint32 : iSCSI node type = Initiator - 0022 string : iSCSI alias = "" - 0024 uint32 : iSCSI node index = 4 diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/genkey open-iscsi-2.0.874/utils/open-isns/tests/genkey --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/genkey 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/genkey 1970-01-01 00:00:00.000000000 +0000 @@ -1,175 +0,0 @@ -#!/bin/bash -# -# This is a very simple script to generate a DSA -# key pair for authenticated iSNS. -# -# Copyright (C) 2007 Olaf Kirch -# -# This script is supposed to be run on the iSNS server. -# For the first time, run as -# isnsgenkey -s 1024 -# This will generate a DSA params file, and a DSA private -# and public key for the server. -# -# For each client, generate a key using -# isnsgenkey -# where is the fully qualified domain name. -# This script will convert the FQDN to a valid iSNS -# source name (isns.com.foobar.host) - -myname=`basename $0` -etcdir=/etc/isns -keystore=$etcdir/keystore -dsa_parms=$etcdir/dsa.params -dsa_bits=1024 -opt_force=0 -opt_server=0 - -function usage { - cat <<-EOF >&2 - $* - Usage: - $myname -s [-f] bits - $myname clientname - EOF - exit 1 -} - -function make_isns_name { - OFS="$IFS" - IFS=. - set -- $* - - __result=$1; shift - for part; do - __result=$part.$__result - done - echo "isns.$__result" - IFS="$OFS" -} - -set -- `getopt b:fk:s $*` -while [ $# -gt 0 ]; do - opt=$1; shift - case $opt in - --) break;; - -b) dsa_bits=$1; shift;; - -f) opt_force=1;; - -k) dsa_priv=$1; shift;; - -s) opt_server=1;; - *) usage "Unknown option $opt";; - esac -done - -if [ `id -un` != "root" -a $opt_force -eq 0 ]; then - echo "$myname: should be run by super user only" >&2 - exit 1 -fi - -# All newly generated files should have restricted -# access by default. -umask 077 - -tmpdir=`mktemp -d /tmp/isnsgenkey.XXXXXX` -trap "rm -rf $tmpdir" 0 1 2 15 - -if [ $opt_server -ne 0 ]; then - [ $# -eq 1 ] || usage "Expected DSA key length" - dsa_bits=$1 - - install -m 755 -d $etcdir - if [ -z $dsa_priv ]; then - dsa_priv=$etcdir/auth_key - fi - dsa_pub=$dsa_priv.pub - dsa_copy= -else - [ $# -eq 1 ] || usage "Expected client name" - client=`make_isns_name $1` - - mkdir -p $tmpdir$etcdir - # build_client_conf $client > $tmpdir$etcdir/client.conf - - if [ -z $dsa_priv ]; then - dsa_priv=$tmpdir$etcdir/auth_key - fi - dsa_pub=$dsa_priv.pub - dsa_copy=$keystore/$client -fi - -if [ -f $dsa_priv -a $opt_force -eq 0 ]; then - cat <<-EOF - - ------------------------------------------------------------------ - | There is already a DSA key installed in $dsa_priv. In order to - | generate a new key, please specify the -f [force] option. - ------------------------------------------------------------------ - EOF - exit 1 -fi - -if [ ! -r $dsa_parms ]; then - if [ $opt_server -eq 0 ]; then - echo "Please run $myname in server-initialization mode first" >&2 - exit 1 - fi - - cat <<-EOF - - ------------------------------------------------------------------ - | I will now try to generate a set of DSA parameters. This can be - | a slow process, so please be patient. - ------------------------------------------------------------------ - EOF - - mkdir -p `dirname $dsa_parms` - openssl dsaparam $dsa_bits -out $dsa_parms || - exit 1 - - # DSA parameters are public - chmod 644 $dsa_parms -fi - -cat <&2 - exit 1 -fi -if ! openssl dgst -dss1 -verify $dsa_pub -signature $tmpdir/test-sig /etc/hosts; then - echo "DSA verification failed - aborting!" >&2 - exit 1 -fi -od -tx1 $tmpdir/test-sig - -if [ $opt_server -eq 0 ]; then - echo "Installing DSA public key as $dsa_copy" - install -d -m 755 $keystore - install -m 644 $dsa_pub $dsa_copy - install -m 644 $etcdir/auth_key.pub $tmpdir$etcdir/server.pub - - tarball=auth-$client.tar.gz - tar -C $tmpdir -czf $tarball .$etcdir - - cat <<-EOF - ------------------------------------------------------------------ - | Successfully packaged $tarball - | Please copy this file to client $client and install - ------------------------------------------------------------------ - EOF -fi diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/harness.pl open-iscsi-2.0.874/utils/open-isns/tests/harness.pl --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/harness.pl 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/harness.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,929 +0,0 @@ -#!/usr/bin/perl - -use Getopt::Long; - -$__isns_verbose = 1; -$__isns_security = 1; - -$__isns_bin = "../"; -$__isns_seq = 0; -$__isns_test_base = '/tmp/isns-test'; -$__isns_test_dir = '/tmp/isns-test/test'; -$__isns_stage = 1; -$__isns_test_data = ''; -$__isns_test_dump = ''; -$__isns_passed = 0; -$__isns_failed = 0; -$__isns_warned = 0; -@__isns_servers = (); - -%__isns_ignore_tag = ( - "0004" => 1, # Timestamp - "0603v" => 1, # DSA public key -); - -sub isns_fail { - - print "*** FAILURE ***\n"; - $__isns_failed++; - - my $line; - foreach $line (@_) { - print "*** $line ***\n"; - } -} - -sub isns_pass { - - print "*** SUCCESS ***\n" if ($__isns_verbose > 1); - $__isns_passed++; -} - -sub isns_warn { - - printf "*** WARNING: %s ***\n", join(' ', @_); - $__isns_warned++; -} - -sub isns_die { - - printf "*** TERMINAL FAILURE: %s ***\n", join(' ', @_); - $__isns_failed++; - - &isns_finish; - die "Test aborted\n"; -} - -sub isns_finish { - - my $pid; - foreach $pid (@__isns_servers) { - kill 15, $pid or &isns_warn("Cannot kill server process (pid=$pid): $!\n"); - } - - &isns_report; -} - -sub isns_report { - - print "*** Test $__isns_test_name complete."; - print " PASSED: $__isns_passed" if ($__isns_passed); - print " FAILED: $__isns_failed" if ($__isns_failed); - print " WARNINGS: $__isns_warned" if ($__isns_warned); - print " ***\n"; -} - -sub isns_info { - - print @_ if ($__isns_verbose > 1); -} - -sub isns_notice { - - print @_ if ($__isns_verbose > 0); -} - -sub isns_stage { - - local($name, @msg) = @_; - - if ($name =~ m/^[0-9]/o) { - $__isns_stage_name = $name; - } else { - $__isns_stage_name = sprintf "%02d-%s", - $__isns_stage++, $name; - } - &isns_notice("*** $__isns_stage_name: ", @msg, " ***\n"); -} - -sub build_config { - - local($src_file, $dst_file, *__subst) = @_; - my $key; - my $okey; - my $value; - my $sepa; - my %subst; - - &isns_info("*** Building $src_file -> $dst_file\n"); - - # Translate all keys to lower case. - foreach $key (keys(%__subst)) { - $value = $__subst{$key}; - $key =~ tr/A-Z/a-z/; - $subst{$key} = $value; - } -# foreach $key (keys(%subst)) { -# printf " %s -> %s\n", $key, $subst{$key}; -# } - - open IN, "<$src_file" or die "$src_file: $!\n"; - open OUT, ">$dst_file" or die "$dst_file: $!\n"; - - while () { - $line = $_; - if (m:(\S+)(\s*=\s*)(.*):o) { - ($okey, $sepa, $value) = ($1, $2, $3); - - $key = $okey; - $key =~ tr/A-Z/a-z/; - - if ($subst{$key}) { - $line = "$okey$sepa$subst{$key}\n"; - } - } - - # Ignore unconfigured lines. - next if ($line =~ m/\@[A-Z_]*\@/o); - print OUT $line; - } - close OUT; - close IN; -} - -sub get_config_value { - local($cfg_file, $item_name) = @_; - my $result; - my $name; - my $value; - - $item_name =~ tr/A-Z/a-z/; - - open IN, "<$cfg_file" or die "$cfg_file: $!\n"; - while () { - chop; - ($name, $value) = split(/\s+=\s+/, $_); - - $name =~ tr/A-Z/a-z/; - if ($name eq $item_name) { - $result = $value; - last; - } - } - close IN; - - return $result; -} - -sub create_key { - - local($keyfile) = @_; - - if ($__isns_security) { - &isns_info("*** Creating key at $keyfile\n"); - system "./genkey -fsk $keyfile 2048 >${keyfile}.log 2>&1"; - } - return $keyfile; -} - -sub create_server { - - local(*override) = @_; - my %local_config; - my $my_dir; - my $handle; - my $config; - - $handle = sprintf "server%d", $__isns_seq++; - $my_dir = "$__isns_test_dir/${handle}"; - - mkdir $my_dir, 0700 or die "Cannot create $my_dir: $!\n"; - - $server_addr = "127.0.0.1:7770" unless ($server_addr); - - $config = "$my_dir/config"; - - $local_config{"SourceName"} = "isns.$handle"; - $local_config{"Database"} = "$my_dir/database"; - $local_config{"BindAddress"} = "$server_addr"; - $local_config{"PIDFile"} = "$my_dir/pid"; - $local_config{"ControlSocket"} = "$my_dir/control"; - $local_config{"Security"} = $__isns_security; - $local_config{"AuthKeyFile"} = &create_key("$my_dir/auth_key"); - - foreach $key (keys(%override)) { - $local_config{$key} = $override{$key}; - } - - &build_config('server.conf', $config, \%local_config); - return $config; -} - -sub create_client { - - local($server_config, $client_address) = @_; - my %local_config; - my $server_key; - my $control_socket; - my $server_addr; - my $my_dir; - my $handle; - my $config; - - $handle = sprintf "client%d", $__isns_seq++; - $my_dir = "$__isns_test_dir/${handle}"; - - mkdir $my_dir, 0700 or die "Cannot create $my_dir: $!\n"; - - $control_socket = &get_config_value($server_config, "ControlSocket"); - $server_addr = &get_config_value($server_config, "BindAddress"); - $server_addr = "127.0.0.1" unless ($server_addr); - - $config = "$my_dir/config"; - - $local_config{"SourceName"} = "isns.$handle"; - $local_config{"AuthName"} = "$handle.isns-test.eu"; - $local_config{"ServerAddress"} = $server_addr; - $local_config{"ControlSocket"} = $control_socket; - $local_config{"BindAddress"} = $client_address if ($client_address); - $local_config{"server_config"} = $server_config; - $local_config{"Security"} = $__isns_security; - $local_config{"AuthKeyFile"} = &create_key("$my_dir/auth_key"); - $local_config{"ServerKeyFile"} = - &get_config_value($server_config, "AuthKeyFile") . ".pub"; - - &build_config('client.conf', $config, \%local_config); - - $__isns_data{$config,"server_config"} = $server_config; - $__isns_data{$config} = %local_config; - return $config; -} - -sub get_logfile { - - local($config) = @_; - my $dir; - - $dir = $config; - $dir =~ s|/+[^/]+$||o; - - return "$dir/logfile"; -} - -sub run_command { - - local(@cmd) = @_; - my $status; - my $cmd; - - $cmd = join(' ', @cmd); - &isns_info("$cmd\n"); - - system "$cmd"; - - $status = $?; - if ($status) { - &isns_warn("Command failed, exit status $status"); - print "*** Command was: $cmd ***\n"; - return undef; - } - - return 1; -} - -sub isns_start_server { - - local($server_config) = @_; - my $logfile; - my $pidfile; - my $pid; - - die "restart_server: missing server config argument!\n" - unless(-f $server_config); - $logfile = &get_logfile($server_config); - $pidfile = &get_config_value($server_config, "PIDFile"); - - &isns_info("*** Starting server (logging to $logfile)\n"); - - $pid = fork(); - if ($pid) { - my $retry; - - if ($pidfile) { - for ($retry = 0; $retry < 5; $retry++) { - last if (-f $pidfile); - sleep 1; - } - $pid = `cat $pidfile` if ($pidfile); - chop($pid); - } - &isns_info("*** Started server (pid=$pid) ***\n"); - push(@__isns_servers, $pid); - return $pid; - } - - &isns_info("${__isns_bin}isnsd -c $server_config -f -d all\n"); - exec "${__isns_bin}isnsd -c $server_config -f -d all >$logfile 2>&1 &" - or die "Unable to run isnsd: $!\n"; -} - -sub isns_stop_server { - - local($pid) = @_; - my @list; - my $p; - - kill 15, $pid or &isns_warn("Cannot kill server process (pid=$pid): $!\n"); - foreach $p (@__isns_servers) { - append(@list, $p) unless ($p == $pid); - } - @__isns_servers = @list; -} - -sub isns_restart_server { - - local($pid, $server_config); - - if ($_[0] =~ m:^\d+$:o) { - $pid = shift(@_); - } else { - if ($#__isns_servers < 0) { - &isns_warn("isns_restart_server: no server running\n"); - return 0; - } - $pid = $__isns_servers[0]; - } - $server_config = shift(@_); - - &isns_stop_server($pid); - return &isns_start_server($server_config); -} - -sub isns_verify_db { - - local($stage, $server_config); - my $dump_file; - my $data_file; - - if ($_[0] =~ m/^\d/o) { - $stage = shift(@_); - } else { - $stage = $__isns_stage_name; - } - $server_config = shift(@_); - - die "Test case forgot to call test_prep" unless($__isns_test_data); - - $dump_file = "$__isns_test_dump/$stage"; - unless (&run_command("${__isns_bin}/isnsd -c $server_config --dump-db > $dump_file")) { - &isns_fail; - return 0; - } - - # See if the reference data file exists. If it - # doesn't, this means we're priming the test case. - # Just copy the dump file. - $data_file = "$__isns_test_data/$stage"; - unless (-f $data_file) { - print "*** Saving database dump for stage $stage ***\n"; - mkdir $__isns_test_data, 0755; - system "cp $dump_file $data_file"; - return 1; - } - - &isns_info("*** Verifying database dump for stage $stage ***\n"); - if (&verify_dump($stage, $data_file, $dump_file)) { - &isns_pass; - } else { - if ($__isns_verbose > 1) { - system("diff -u -ITimestamp -I'DSA security key' $data_file $dump_file"); - } - &isns_fail; - } - - return 1; -} - -sub verify_db { - - &isns_verify_db(@_); -} - -sub verify_response { - - local($stage, $client_config) = @_; - my $dump_file; - my $data_file; - - die "Test case forgot to call test_prep" unless($__isns_test_data); - - $dump_file = &get_logfile($client_config); - - # See if the reference data file exists. If it - # doesn't, this means we're priming the test case. - # Just copy the dump file. - $data_file = "$__isns_test_data/$stage"; - unless (-f $data_file) { - print "*** Saving data for stage $stage ***\n"; - mkdir $__isns_test_data, 0755; - system "cp $dump_file $data_file"; - return 1; - } - - &isns_info("*** Verifying data for stage $stage ***\n"); - if (&verify_query($stage, $data_file, $dump_file)) { - &isns_pass; - } else { - &isns_fail("Query response returns unexpected data"); - system "cp $dump_file $__isns_test_dump/$stage"; - print "*** Saved dump as $__isns_test_dump/$stage\n"; - print "*** Reference data in $data_file\n"; - if ($__isns_verbose > 1) { - system("diff -u -ITimestamp -I'DSA security key' $data_file $dump_file"); - } - } - - return 1; -} - -sub verify_dump { - - local($stage, $data_file, $dump_file) = @_; - my $line; - my @dump; - my @data; - my @obj1; - my @obj2; - - @dump = &load_dump($dump_file); - @data = &load_dump($data_file); - - &skip_header(\@dump); - &skip_header(\@data); - - while (1) { - $line++; - - @obj1 = &get_next_object(\@dump); - @obj2 = &get_next_object(\@data); - - last unless(@obj1 || @obj2); - - unless (@obj1 && @obj2) { - print STDERR "*** $stage: Excess data at end of dump\n"; - return 0; - } - - unless (&compare_objects(\@obj1, \@obj2)) { - print STDERR "*** Object mismatch (object $line):\n"; - print STDERR "Expected:\n "; - print STDERR join("\n ", @obj2), "\n"; - print STDERR "Got:\n "; - print STDERR join("\n ", @obj1), "\n"; - return 0; - } - } - - if (@data) { - print STDERR "*** $stage: Unexpected end of dump at line $line\n"; - return 0; - } - - return 1; -} - -sub skip_header { - - local(*list) = @_; - local($_); - - while ($_ = shift(@list)) { - last if (/^-/o); - } -} - -sub get_next_object { - - local(*list) = @_; - local($_, $header, @result); - my @tags; - - while ($_ = shift(@list)) { - next if (/^-/o); - if (/^\s+([0-9a-fv]+)\s+/o) { - next if ($__isns_ignore_tag{$1}); - push(@tags, $_); - } else { - if (@result) { - unshift(@list, $_); - last; - } - push(@result, $_); - } - #print "### $_\n"; - } - - if (@tags) { - push(@result, sort(@tags)); - } - return @result; -} - -sub compare_objects { - - local(*a, *b) = @_; - local($i); - - return 0 unless ($#a == $#b); - for ($i = 0; $i <= $#a; $i++) { - return 0 unless ($a[$i] eq $b[$i]); - } - - return 1; -} - - -sub verify_query { - - local($stage, $data_file, $dump_file) = @_; - my $line; - my @dump; - my @data; - - @dump = &load_dump($dump_file); - @data = &load_dump($data_file); - - while (@dump) { - $line++; - unless (@data) { - print STDERR "*** $stage: Excess data in dump at line $line\n"; - return 0; - } - - $a = shift(@dump); - $b = shift(@data); - if ($a =~ /^\S/o) { - next if ($a eq $b); - print STDERR "*** $stage: Mismatch at line $line ***\n"; - print STDERR "*** Found: $a\n"; - print STDERR "*** Expected: $b\n"; - return 0; - } - - ($nix, $a_tag, $a_value) = split(/\s+/, $a, 3); - ($nix, $b_tag, $b_value) = split(/\s+/, $b, 3); - if ($a_tag ne $b_tag) { - print STDERR "*** $stage: Tag mismatch at line $line\n"; - print STDERR "*** Found: $a\n"; - print STDERR "*** Expected: $b\n"; - return 0; - } - - next if ($__isns_ignore_tag{$a_tag}); - if ($a_value ne $b_value) { - print STDERR "*** $stage: Value mismatch at line $line (tag $a_tag)\n"; - print STDERR "*** Found: $a\n"; - print STDERR "*** Expected: $b\n"; - return 0; - } - } - - if (@data) { - print STDERR "*** $stage: Unexpected end of dump at line $line\n"; - return 0; - } - - return 1; -} - -sub load_dump { - - local($filename) = @_; - my @result; - - open IN, $filename or die "Unable to open $filename: $!\n"; - while () { - chop; - push(@result, $_); - } - close IN; - return @result; -} - - -sub run_client { - - local($config, @args) = @_; - my $logfile; - my $cmd; - - $logfile = &get_logfile($config); - - $cmd = "${__isns_bin}/isnsadm -c $client_config " . join(' ', @args); - if (&run_command("$cmd >$logfile")) { - return $logfile; - } - return undef; -} - -sub __isns_enroll_client { - - local($client_config, @extra_args) = @_; - my $source_name; - my $auth_name; - my $auth_key; - my @args; - - $source_name = &get_config_value($client_config, "SourceName"); - $auth_name = &get_config_value($client_config, "AuthName"); - $auth_key = &get_config_value($client_config, "AuthKeyFile"); - - push(@args, "--local --enroll $auth_name node-name=$source_name"); - push(@args, " key=${auth_key}.pub") if ($auth_key); - push(@args, @extra_args) if (@extra_args); - - &run_client($client_config, @args); -} - -sub isns_enroll_client { - - local($client, @args) = @_; - my $server; - - $server = $__isns_data{$client,"server_config"}; - &isns_stage("enroll", "Enrolling client"); - &__isns_enroll_client($client, @args); - &verify_db($__isns_stage_name, $server); -} - -sub enroll_client { - - print "*** Enrolling client ***\n"; - &__isns_enroll_client(@_); -} - -sub __isns_register_client { - - local($client_config, @extra_args) = @_; - my @args; - - push(@args, "--register"); - push(@args, @extra_args) if (@extra_args); - - &run_client($client_config, @args); -} - -sub isns_register_client { - - local($client, @args) = @_; - my $server; - - $server = $__isns_data{$client,"server_config"}; - &isns_stage("registration", "Registering client " . join(' ', @args)); - &__isns_register_client($client, @args); - &verify_db($__isns_stage_name, $server); -} - -sub register_client { - - print "*** Registering client ***\n"; - &__isns_register_client(@_); -} - -sub __isns_query_objects { - - local($client_config, @extra_args) = @_; - my @args; - - push(@args, "--query"); - push(@args, @extra_args) if (@extra_args); - - return &run_client($client_config, @args); -} - -sub isns_query_objects { - - local($client, @args) = @_; - - &isns_stage("query", "Querying " . join(' ', @args)); - &__isns_query_objects($client, @args); - &verify_response($__isns_stage_name, $client); -} - -sub query_objects { - - print "*** Querying objects ***\n"; - __isns_query_objects(@_); -} - -sub isns_query_eid { - - local($client_config, @extra_args) = @_; - my $logfile; - my @args; - local($eid); - - push(@args, "--query-eid"); - push(@args, @extra_args) if (@extra_args); - - &isns_info("*** Querying for EID ***\n"); - $logfile = &run_client($client_config, @args); - - if ($logfile) { - $eid = `cat $logfile`; - unless ($eid) { - &isns_fail("Server reports empty EID"); - } - chop($eid); - } - - return $eid; -} - -sub __isns_unregister_client { - - local($client_config, @extra_args) = @_; - my @args; - - push(@args, "--deregister"); - push(@args, @extra_args) if (@extra_args); - - &run_client($client_config, @args); -} - -sub isns_unregister_client { - - my $stage = 0; - my $client; - my $server; - my $eid; - - if ($_[0] =~ m/^\d/o) { - &isns_stage(shift(@_), "Unregister client"); - } else { - &isns_stage("unregistration", "Unregister client"); - } - - $client = shift(@_); - - unless (@_) { - $eid = &isns_query_eid($client); - push(@_, "eid=$eid"); - } - - &__isns_unregister_client($client, @_); - - $server = $__isns_data{$client,"server_config"}; - &verify_db($__isns_stage_name, $server); -} - -sub unregister_client { - - &isns_info("*** Unregistering client ***\n"); - &__isns_unregister_client(@_); -} - -sub __isns_register_domain { - - local($client_config, @extra_args) = @_; - my @args; - - push(@args, "--local --dd-register"); - push(@args, @extra_args) if (@extra_args); - - &run_client($client_config, @args); -} - -sub isns_register_domain { - - local($client, @args) = @_; - my $server; - - &isns_stage("dd-registration", "Registering DD " . join(' ', @args)); - &__isns_register_domain($client, @args); - - $server = $__isns_data{$client,"server_config"}; - &isns_verify_db($server); -} - -sub register_domain { - - &isns_info("*** Registering DD ***\n"); - &__isns_register_domain(@_); -} - -sub __isns_deregister_domain { - - local($client_config, @extra_args) = @_; - my @args; - - push(@args, "--local --dd-deregister"); - push(@args, @extra_args) if (@extra_args); - - &run_client($client_config, @args); -} - -sub isns_deregister_domain { - - local($client, @args) = @_; - my $server; - - &isns_stage("dd-deregistration", "Deregistering DD (members)" . join(' ', @args)); - &__isns_deregister_domain($client, @args); - - $server = $__isns_data{$client,"server_config"}; - &isns_verify_db($server); -} - -sub isns_external_test { - - local($client, @args) = @_; - my $logfile; - my $stage; - my $cmd; - - $logfile = &get_logfile($client); - - $cmd = shift(@args); - $stage = $cmd; - $stage =~ s:.*/::o; - - $cmd = "${__isns_bin}/$cmd -c $client " . join(' ', @args); - - &isns_stage($stage, "Running external $cmd " . join(' ', @args)); - unless (&run_command("$cmd >$logfile")) { - return undef; - } - - $server = $__isns_data{$client,"server_config"}; - &isns_verify_db($server); -} - -sub __isns_prep_test { - - local($name, $duration, @ARGV) = @_; - - GetOptions('verbose+' => \$__isns_verbose, - "quiet" => \$__isns_quiet, - "fast" => \$__isns_quick, - "insecure" => \$__isns_insecure); - $__isns_verbose = 0 if ($__isns_quiet); - $__isns_security = 0 if ($__isns_insecure); - - if ($__isns_quick && $duration > 15) { - print "*** Skipping $name (duration ~ $duration seconds) ***\n"; - exit(0); - } - - print "*** Starting $name ***\n"; - printf "*** This test case will take about %u sec ***\n", $duration - if ($duration); - $__isns_test_name = $name; - $__isns_test_dir = "$__isns_test_base/$name"; - $__isns_test_dump = "$__isns_test_dir/dump"; - $__isns_test_data = "data/$name"; - - # Be careful when removing test dir - system "rm -rf $__isns_test_dir" if ($__isns_test_dir =~ m:/tmp/:o); - - mkdir $__isns_test_base, 0700; - mkdir $__isns_test_dir, 0700; - mkdir $__isns_test_dump, 0700; -} - -sub test_prep { - - local($name, @args) = @_; - - __isns_prep_test($name, 0, @args); -} - -sub isns_prep_slow_test { - - __isns_prep_test(@_); -} - -# Sleep for a few seconds, giving the user some dots to keep -# him occupied. -sub isns_idle { - - local($time) = @_; - - if ($__isns_verbose == 0) { - sleep $time; - return; - } - - $| = 1; - print "Snooze"; - while ($time--) { - print "."; - sleep 1; - } - print "\n"; - $| = 0; -} - -sub main { - - my $server_config; - my $client_config; - - &test_prep; - - $server_config = &create_server; - $client_config = &create_client($server_config); -} - -#&main; -1; diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/Makefile open-iscsi-2.0.874/utils/open-isns/tests/Makefile --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/Makefile 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/Makefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -# -# Simple makefile to run regression tests, and to -# document how to run them. - -# -# Each test case is a perl script, testXX.pl. Run as -# perl testXX.pl -# Optionally followed by -# -q quiet - just print a header line, and the overall result -# -v verbose - display more detailed information, including the -# commands being run -# -f fast - skip tests that take more than 15 seconds -# -# The default is to be slightly verbose, and display a comment -# about each stage of the test. - -# All test related data is kept in /tmp/isns-test, with a -# subdirectory for each test. -# For instance, test01 will create -# /tmp/isns-test/test01/server0 -# /tmp/isns-test/test01/client1 -# /tmp/isns-test/test01/dump -# -# The server and client directories will contain configuration -# data, logfiles, and (for the server) the Unix socket, the -# PID file, and the database. -# -# The dump directory contains snapshots of the on-disk database -# for each test stage (if the test stage involves a verification -# of the database). - -tests: - @for test in test*.pl; do \ - perl $$test -q; \ - done - -quick: - @for test in test*.pl; do \ - perl $$test -q --fast; \ - done diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/pauw1.c open-iscsi-2.0.874/utils/open-isns/tests/pauw1.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/pauw1.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/pauw1.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,179 +0,0 @@ -/* - * Test case, captured from a Wasabi Storage Builder - * registering itself. - */ -#include -#include -#include -#include -#include - -int -main(int argc, char **argv) -{ - const char *opt_configfile = ISNS_DEFAULT_ISNSADM_CONFIG; - isns_client_t *clnt; - isns_attr_list_t *attrs; - isns_simple_t *reg; - isns_portal_info_t portal_info; - uint32_t status; - int c; - - while ((c = getopt(argc, argv, "c:d:")) != -1) { - switch (c) { - case 'c': - opt_configfile = optarg; - break; - - case 'd': - isns_enable_debugging(optarg); - break; - - default: - isns_fatal("Unknown option\n"); - } - } - - isns_read_config(opt_configfile); - isns_assign_string(&isns_config.ic_source_name, - "iqn.2000-05.com.wasabisystems.storagebuilder:cyan-0"); - - clnt = isns_create_default_client(NULL); - - reg = isns_simple_create(ISNS_DEVICE_ATTRIBUTE_REGISTER, - clnt->ic_source, NULL); - - attrs = ®->is_operating_attrs; - -#define ADD(type, tag, value) \ - isns_attr_list_append_##type(attrs, ISNS_TAG_##tag, value) -#define STR(tag, value) ADD(string, tag, value) -#define U32(tag, value) ADD(uint32, tag, value) -#define NIL(tag) isns_attr_list_append_nil(attrs, ISNS_TAG_##tag) -#define TARGET(name, alias, auth) \ - STR(ISCSI_NAME, name); \ - U32(ISCSI_NODE_TYPE, ISNS_ISCSI_TARGET_MASK); \ - STR(ISCSI_ALIAS, alias); \ - STR(ISCSI_AUTHMETHOD, auth) - - STR(ENTITY_IDENTIFIER, "cyan.pauw.homeunix.net"); - U32(ENTITY_PROTOCOL, 2); - U32(REGISTRATION_PERIOD, 31536000); - - TARGET("iqn.2000-05.com.wasabisystems.storagebuilder:cyan-0", - "Test (10 GB)", - "None"); - TARGET("iqn.2000-05.com.wasabisystems.storagebuilder:cyan-1", - "160 GB disk (ntfs)", - "None"); - TARGET("iqn.2000-05.com.wasabisystems.storagebuilder:cyan-2", - "160 GB disk (ext3)", - "CHAP"); - TARGET("iqn.2000-05.com.wasabisystems.storagebuilder:cyan-3", - "Test (1 GB)", - "None"); - TARGET("iqn.2000-05.com.wasabisystems.storagebuilder:cyan-4", - "Test (40 GB)", - "CHAP"); - TARGET("iqn.2000-05.com.wasabisystems.storagebuilder:cyan-5", - "test", - "None"); - - isns_portal_parse(&portal_info, "10.0.0.1:3260/tcp", NULL); - isns_portal_to_attr_list(&portal_info, - ISNS_TAG_PORTAL_IP_ADDRESS, - ISNS_TAG_PORTAL_TCP_UDP_PORT, - attrs); - - /* Mumbo jumbo encoding of portal groups */ - U32(PG_TAG, 1); - STR(PG_ISCSI_NAME, "iqn.2000-05.com.wasabisystems.storagebuilder:cyan-0"); - STR(PG_ISCSI_NAME, "iqn.2000-05.com.wasabisystems.storagebuilder:cyan-1"); - STR(PG_ISCSI_NAME, "iqn.2000-05.com.wasabisystems.storagebuilder:cyan-2"); - STR(PG_ISCSI_NAME, "iqn.2000-05.com.wasabisystems.storagebuilder:cyan-3"); - STR(PG_ISCSI_NAME, "iqn.2000-05.com.wasabisystems.storagebuilder:cyan-4"); - STR(PG_ISCSI_NAME, "iqn.2000-05.com.wasabisystems.storagebuilder:cyan-5"); - - /* Strictly speaking, a PGT not followed by any data is invalid. - * - * 5.6.5.1. - * When a Portal is registered, the Portal attributes MAY - * immediately be followed by a PGT attribute. The PGT attribute - * SHALL be followed by the set of PG iSCSI Names representing - * nodes that will be associated to the Portal using the indicated - * PGT value. - */ - NIL(PG_TAG); - - isns_simple_print(reg, isns_print_stdout); - - status = isns_client_call(clnt, ®); - - if (status != ISNS_SUCCESS) - isns_fatal("Unable to register object: %s\n", - isns_strerror(status)); - - printf("Successfully registered object(s)\n"); - isns_simple_print(reg, isns_print_stdout); - - return 0; -} - -/* - Creating file DB backend (/var/lib/isns) - DB: loading all objects from /var/lib/isns - Next ESI message in 3600 seconds - Incoming PDU xid=0001 seq=0 len=1208 func=DevAttrReg client first last - Next message xid=0001 - Received message - ---DevAttrReg--- - Source: - 0020 string : iSCSI name = "iqn.2000-05.com.wasabisystems.storagebuilder:cyan-0" - Message attributes: - Operating attributes: - 0001 string : Entity identifier = "cyan.pauw.homeunix.net" - 0002 uint32 : Entity protocol = iSCSI (2) - 0006 uint32 : Registration Period = 31536000 - 0020 string : iSCSI name = "iqn.2000-05.com.wasabisystems.storagebuilder:cyan-0" - 0021 uint32 : iSCSI node type = Target - 0022 string : iSCSI alias = "Test (10 GB)" - 002a string : iSCSI auth method = "None" - 0020 string : iSCSI name = "iqn.2000-05.com.wasabisystems.storagebuilder:cyan-1" - 0021 uint32 : iSCSI node type = Target - 0022 string : iSCSI alias = "160 GB disk (ntfs)" - 002a string : iSCSI auth method = "None" - 0020 string : iSCSI name = "iqn.2000-05.com.wasabisystems.storagebuilder:cyan-2" - 0021 uint32 : iSCSI node type = Target - 0022 string : iSCSI alias = "160 GB disk (ext3)" - 002a string : iSCSI auth method = "CHAP" - 0020 string : iSCSI name = "iqn.2000-05.com.wasabisystems.storagebuilder:cyan-3" - 0021 uint32 : iSCSI node type = Target - 0022 string : iSCSI alias = "Test (1 GB)" - 002a string : iSCSI auth method = "None" - 0020 string : iSCSI name = "iqn.2000-05.com.wasabisystems.storagebuilder:cyan-4" - 0021 uint32 : iSCSI node type = Target - 0022 string : iSCSI alias = "Test (40 GB)" - 002a string : iSCSI auth method = "CHAP" - 0020 string : iSCSI name = "iqn.2000-05.com.wasabisystems.storagebuilder:cyan-5" - 0021 uint32 : iSCSI node type = Target - 0022 string : iSCSI alias = "test" - 002a string : iSCSI auth method = "None" - 0010 ipaddr : Portal IP address = 10.0.0.1 - 0011 uint32 : Portal TCP/UDP port = 3260/tcp - 0033 uint32 : Portal group tag = 1 - 0030 string : Portal group name = "iqn.2000-05.com.wasabisystems.storagebuilder:cyan-0" - 0030 string : Portal group name = "iqn.2000-05.com.wasabisystems.storagebuilder:cyan-1" - 0030 string : Portal group name = "iqn.2000-05.com.wasabisystems.storagebuilder:cyan-2" - 0030 string : Portal group name = "iqn.2000-05.com.wasabisystems.storagebuilder:cyan-3" - 0030 string : Portal group name = "iqn.2000-05.com.wasabisystems.storagebuilder:cyan-4" - 0030 string : Portal group name = "iqn.2000-05.com.wasabisystems.storagebuilder:cyan-5" - 0033 nil : Portal group tag = - :: policy insecure function DevAttrReg (0001) permitted - :: policy insecure source -iqn.2000-05.com.wasabisystems.storagebuilder:cyan-0 permitted - :: policy insecure operation DevAttrReg on Network Entity object -permitted - DB: Storing object 00000001 -> /var/lib/isns/00000001 - DB: added object 1 (Network Entity) state 1 -Segmentation fault - */ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/pauw2.c open-iscsi-2.0.874/utils/open-isns/tests/pauw2.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/pauw2.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/pauw2.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,212 +0,0 @@ -/* - * Test case, captured from iscsi-target - * registering itself. - */ -#include -#include -#include -#include -#include - -#define ADD(type, tag, value) \ - isns_attr_list_append_##type(attrs, ISNS_TAG_##tag, value) -#define STR(tag, value) ADD(string, tag, value) -#define U32(tag, value) ADD(uint32, tag, value) -#define NIL(tag) isns_attr_list_append_nil(attrs, ISNS_TAG_##tag) -#define TARGET(name, alias, auth) \ - STR(ISCSI_NAME, name); \ - U32(ISCSI_NODE_TYPE, ISNS_ISCSI_TARGET_MASK); \ - STR(ISCSI_ALIAS, alias); \ - STR(ISCSI_AUTHMETHOD, auth) - -int -main(int argc, char **argv) -{ - const char *opt_configfile = ISNS_DEFAULT_ISNSADM_CONFIG; - isns_client_t *clnt; - isns_attr_list_t *attrs; - isns_simple_t *reg; - isns_portal_info_t portal_info; - uint32_t status; - int c; - - while ((c = getopt(argc, argv, "c:d:")) != -1) { - switch (c) { - case 'c': - opt_configfile = optarg; - break; - - case 'd': - isns_enable_debugging(optarg); - break; - - default: - isns_fatal("Unknown option\n"); - } - } - - isns_read_config(opt_configfile); - - /* - ---DevAttrReg[REPLACE]--- - Source: - 0020 string : iSCSI name = "iqn.2007-03.com.example:stgt.disk" - Message attributes: - 0001 string : Entity identifier = "blue.pauw.homeunix.net" - Operating attributes: - 0001 string : Entity identifier = "blue.pauw.homeunix.net" - 0002 uint32 : Entity protocol = iSCSI (2) - 0010 ipaddr : Portal IP address = 192.168.1.2 - 0011 uint32 : Portal TCP/UDP port = 3260/tcp - 0017 uint32 : SCN port = 42138/tcp - 0020 string : iSCSI name = "iqn.2007-03.com.example:stgt.disk" - 0021 uint32 : iSCSI node type = Target - */ - isns_assign_string(&isns_config.ic_source_name, - "iqn.2007-03.com.example:stgt.disk"); - - clnt = isns_create_default_client(NULL); - reg = isns_simple_create(ISNS_DEVICE_ATTRIBUTE_REGISTER, - clnt->ic_source, NULL); - reg->is_replace = 1; - - /* Message attributes */ - attrs = ®->is_message_attrs; - STR(ENTITY_IDENTIFIER, "blue.pauw.homeunix.net"); - - /* Operating attributes */ - attrs = ®->is_operating_attrs; - - STR(ENTITY_IDENTIFIER, "blue.pauw.homeunix.net"); - U32(ENTITY_PROTOCOL, 2); - - isns_portal_parse(&portal_info, "192.168.1.2:3260/tcp", NULL); - isns_portal_to_attr_list(&portal_info, - ISNS_TAG_PORTAL_IP_ADDRESS, - ISNS_TAG_PORTAL_TCP_UDP_PORT, - attrs); - - U32(SCN_PORT, 42138); - STR(ISCSI_NAME, "iqn.2007-03.com.example:stgt.disk"); - U32(ISCSI_NODE_TYPE, ISNS_ISCSI_TARGET_MASK); - isns_simple_print(reg, isns_print_stdout); - - status = isns_client_call(clnt, ®); - - if (status != ISNS_SUCCESS) - isns_fatal("Unable to register object: %s\n", - isns_strerror(status)); - - printf("Successfully registered object #1\n"); - // isns_simple_print(reg, isns_print_stdout); - isns_simple_free(reg); - isns_client_destroy(clnt); - - /* - ---DevAttrReg[REPLACE]--- - Source: - 0020 string : iSCSI name = "iqn.2005-03.org.open-iscsi:blue" - Message attributes: - 0001 string : Entity identifier = "blue.pauw.homeunix.net" - Operating attributes: - 0001 string : Entity identifier = "blue.pauw.homeunix.net" - 0002 uint32 : Entity protocol = iSCSI (2) - 0010 ipaddr : Portal IP address = 192.168.1.2 - 0011 uint32 : Portal TCP/UDP port = 33849/tcp - 0014 uint32 : ESI port = 56288/tcp - 0020 string : iSCSI name = "iqn.2005-03.org.open-iscsi:blue" - 0021 uint32 : iSCSI node type = Initiator - 0022 string : iSCSI alias = "blue.pauw.homeunix.net" - - [...] - response status 0x0003 (Invalid registration) - - This would fail because we got confused about EID in - the replace case. - */ - isns_assign_string(&isns_config.ic_source_name, - "iqn.2005-03.org.open-iscsi:blue"); - - clnt = isns_create_default_client(NULL); - reg = isns_simple_create(ISNS_DEVICE_ATTRIBUTE_REGISTER, - clnt->ic_source, NULL); - reg->is_replace = 1; - - /* Message attributes */ - attrs = ®->is_message_attrs; - STR(ENTITY_IDENTIFIER, "blue.pauw.homeunix.net"); - - /* Operating attributes */ - attrs = ®->is_operating_attrs; - - STR(ENTITY_IDENTIFIER, "blue.pauw.homeunix.net"); - U32(ENTITY_PROTOCOL, 2); - - isns_portal_parse(&portal_info, "192.168.1.2:33849/tcp", NULL); - isns_portal_to_attr_list(&portal_info, - ISNS_TAG_PORTAL_IP_ADDRESS, - ISNS_TAG_PORTAL_TCP_UDP_PORT, - attrs); - - U32(ESI_PORT, 56288); - STR(ISCSI_NAME, "iqn.2005-03.org.open-iscsi:blue"); - U32(ISCSI_NODE_TYPE, ISNS_ISCSI_INITIATOR_MASK); - STR(ISCSI_ALIAS, "blue.pauw.homeunix.net"); - isns_simple_print(reg, isns_print_stdout); - - status = isns_client_call(clnt, ®); - - if (status != ISNS_SUCCESS) - isns_fatal("Unable to register object: %s\n", - isns_strerror(status)); - - printf("Successfully registered object #2\n"); - // isns_simple_print(reg, isns_print_stdout); - isns_simple_free(reg); - isns_client_destroy(clnt); - - return 0; -} - -/* - Creating file DB backend (/var/lib/isns) - DB: loading all objects from /var/lib/isns - Next ESI message in 3600 seconds - Incoming PDU xid=0001 seq=0 len=232 func=DevAttrReg client first last - Next message xid=0001 - Received message - - :: policy insecure function DevAttrReg (0001) permitted - :: policy insecure source iqn.2005-03.org.open-iscsi:blue permitted - :: policy insecure operation DevAttrReg on object 00000001 (Network -Entity) permitted - Replacing Network Entity (id 1) - DB: removed object 2 (Portal) - DB: removed object 4 (iSCSI Portal Group) - DB: removed object 3 (iSCSI Storage Node) - DB: removed object 1 (Network Entity) - DB: destroying object 2 (Portal) - DB: Purging object 2 (/var/lib/isns/00000002) - DB: destroying object 1 (Network Entity) - DB: Purging object 1 (/var/lib/isns/00000001) - DB: destroying object 3 (iSCSI Storage Node) - DB: Purging object 3 (/var/lib/isns/00000003) - DB: destroying object 4 (iSCSI Portal Group) - DB: Purging object 4 (/var/lib/isns/00000004) - :: policy insecure entity ID blue.pauw.homeunix.net permitted - :: policy insecure operation DevAttrReg on Network Entity object -permitted - DB: Storing object 5 -> /var/lib/isns/00000005 - DB: added object 5 (Network Entity) state 1 - DB: Storing object 5 -> /var/lib/isns/00000005 - isns_esi_callback(0x9dee788, 0x10) - Deleting SCN registration for iqn.2007-03.com.example:stgt.disk - isns_esi_callback(0x9deeae0, 0x10) - isns_esi_callback(0x9deea30, 0x10) - isns_esi_callback(0x9deec80, 0x10) - SCN multicast - isns_scn_callback(0x9deec80, 0x10) - isns_esi_callback(0x9def4b0, 0xc) - Enable ESI monitoring for entity 5 - - */ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/pauw3.c open-iscsi-2.0.874/utils/open-isns/tests/pauw3.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/pauw3.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/pauw3.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,139 +0,0 @@ -/* - * This tests another problem reported by Albert, where a - * re-registration shortly before ESI expiry would fail - * to resurrect the registration properly. - * - * Usage: - * pauw3 [options] timeout - * - * Where timeout is the delay until we try to re-register - */ - -#include -#include - -#include -#include -#include -#include - -#define ADD(type, tag, value) \ - isns_attr_list_append_##type(attrs, ISNS_TAG_##tag, value) -#define STR(tag, value) ADD(string, tag, value) -#define U32(tag, value) ADD(uint32, tag, value) -#define NIL(tag) isns_attr_list_append_nil(attrs, ISNS_TAG_##tag) -#define TARGET(name, alias, auth) \ - STR(ISCSI_NAME, name); \ - U32(ISCSI_NODE_TYPE, ISNS_ISCSI_TARGET_MASK); \ - STR(ISCSI_ALIAS, alias); \ - STR(ISCSI_AUTHMETHOD, auth) - -int -main(int argc, char **argv) -{ - const char *opt_configfile = ISNS_DEFAULT_ISNSADM_CONFIG; - isns_client_t *clnt; - isns_attr_list_t *attrs; - isns_simple_t *reg; - isns_portal_info_t portal_info; - uint32_t status; - int opt_replace = 1; - int c, n, timeout; - - while ((c = getopt(argc, argv, "c:d:n")) != -1) { - switch (c) { - case 'c': - opt_configfile = optarg; - break; - - case 'd': - isns_enable_debugging(optarg); - break; - - case 'n': - opt_replace = 0; - break; - - default: - isns_fatal("Unknown option\n"); - } - } - - if (optind != argc - 1) - isns_fatal("Need timeout argument\n"); - timeout = parse_timeout(argv[optind]); - - isns_read_config(opt_configfile); - - /* - ---DevAttrReg[REPLACE]--- - Source: - 0020 string : iSCSI name = "iqn.2005-03.org.open-iscsi:blue" - Message attributes: - 0001 string : Entity identifier = "blue.pauw.homeunix.net" - Operating attributes: - 0001 string : Entity identifier = "blue.pauw.homeunix.net" - 0002 uint32 : Entity protocol = iSCSI (2) - 0010 ipaddr : Portal IP address = 192.168.1.2 - 0011 uint32 : Portal TCP/UDP port = 33849/tcp - 0014 uint32 : ESI port = 56288/tcp - 0020 string : iSCSI name = "iqn.2005-03.org.open-iscsi:blue" - 0021 uint32 : iSCSI node type = Initiator - 0022 string : iSCSI alias = "blue.pauw.homeunix.net" - - [...] - response status 0x0003 (Invalid registration) - - This would fail because we got confused about EID in - the replace case. - */ - isns_assign_string(&isns_config.ic_source_name, - "iqn.2005-03.org.open-iscsi:blue"); - - for (n = 0; n < 2; ++n) { - clnt = isns_create_default_client(NULL); - reg = isns_simple_create(ISNS_DEVICE_ATTRIBUTE_REGISTER, - clnt->ic_source, NULL); - reg->is_replace = opt_replace; - - /* Message attributes */ - attrs = ®->is_message_attrs; - STR(ENTITY_IDENTIFIER, "blue.pauw.homeunix.net"); - - /* Operating attributes */ - attrs = ®->is_operating_attrs; - - STR(ENTITY_IDENTIFIER, "blue.pauw.homeunix.net"); - U32(ENTITY_PROTOCOL, 2); - - isns_portal_parse(&portal_info, "192.168.1.2:33849/tcp", NULL); - isns_portal_to_attr_list(&portal_info, - ISNS_TAG_PORTAL_IP_ADDRESS, - ISNS_TAG_PORTAL_TCP_UDP_PORT, - attrs); - - U32(ESI_PORT, 56288); - STR(ISCSI_NAME, "iqn.2005-03.org.open-iscsi:blue"); - U32(ISCSI_NODE_TYPE, ISNS_ISCSI_INITIATOR_MASK); - STR(ISCSI_ALIAS, "blue.pauw.homeunix.net"); - isns_simple_print(reg, isns_print_stdout); - - status = isns_client_call(clnt, ®); - - if (status != ISNS_SUCCESS) - isns_fatal("Unable to register object: %s\n", - isns_strerror(status)); - - printf("Successfully registered object\n"); - // isns_simple_print(reg, isns_print_stdout); - isns_simple_free(reg); - isns_client_destroy(clnt); - - if (n == 0) { - printf("Sleeping for %d seconds\n", timeout); - sleep(timeout); - } - } - - return 0; -} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/pauw4.c open-iscsi-2.0.874/utils/open-isns/tests/pauw4.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/pauw4.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/pauw4.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,137 +0,0 @@ -/* - * Test MS initiator registration. - * The oddity about this is that the PG object precedes the - * initiator object in the message. - */ - -#include -#include - -#include -#include -#include -#include - -#define ADD(type, tag, value) \ - isns_attr_list_append_##type(attrs, ISNS_TAG_##tag, value) -#define STR(tag, value) ADD(string, tag, value) -#define U32(tag, value) ADD(uint32, tag, value) -#define NIL(tag) isns_attr_list_append_nil(attrs, ISNS_TAG_##tag) -#define TARGET(name, alias, auth) \ - STR(ISCSI_NAME, name); \ - U32(ISCSI_NODE_TYPE, ISNS_ISCSI_TARGET_MASK); \ - STR(ISCSI_ALIAS, alias); \ - STR(ISCSI_AUTHMETHOD, auth) - -int -main(int argc, char **argv) -{ - const char *opt_configfile = ISNS_DEFAULT_ISNSADM_CONFIG; - isns_client_t *clnt; - isns_attr_list_t *attrs; - isns_simple_t *reg; - isns_portal_info_t portal_info; - uint32_t status; - int opt_replace = 1; - int c; - - while ((c = getopt(argc, argv, "c:d:n")) != -1) { - switch (c) { - case 'c': - opt_configfile = optarg; - break; - - case 'd': - isns_enable_debugging(optarg); - break; - - case 'n': - opt_replace = 0; - break; - - default: - isns_fatal("Unknown option\n"); - } - } - - isns_read_config(opt_configfile); - - isns_assign_string(&isns_config.ic_source_name, - "iqn.1991-05.com.microsoft:orange"); - - clnt = isns_create_default_client(NULL); - - reg = isns_simple_create(ISNS_SCN_DEREGISTER, clnt->ic_source, NULL); - - /* Message attributes */ - attrs = ®->is_message_attrs; - STR(ISCSI_NAME, "iqn.1991-05.com.microsoft:orange"); - - status = isns_client_call(clnt, ®); - if (status != ISNS_SUCCESS) - isns_error("SCNDereg failed: %s\n", isns_strerror(status)); - isns_simple_free(reg); - - - reg = isns_simple_create(ISNS_DEVICE_DEREGISTER, clnt->ic_source, NULL); - - attrs = ®->is_operating_attrs; - STR(ENTITY_IDENTIFIER, "troopa.nki.nl"); - U32(ENTITY_PROTOCOL, 2); - - isns_portal_parse(&portal_info, "192.168.1.40:3229/tcp", NULL); - isns_portal_to_attr_list(&portal_info, - ISNS_TAG_PORTAL_IP_ADDRESS, - ISNS_TAG_PORTAL_TCP_UDP_PORT, - attrs); - - STR(ISCSI_NAME, "iqn.1991-05.com.microsoft:orange"); - - status = isns_client_call(clnt, ®); - if (status != ISNS_SUCCESS) - isns_fatal("DevDereg failed: %s\n", isns_strerror(status)); - isns_simple_free(reg); - - reg = isns_simple_create(ISNS_DEVICE_ATTRIBUTE_REGISTER, clnt->ic_source, NULL); - reg->is_replace = opt_replace; - - attrs = ®->is_operating_attrs; - STR(ENTITY_IDENTIFIER, "troopa.nki.nl"); - U32(ENTITY_PROTOCOL, 2); - - isns_portal_parse(&portal_info, "192.168.1.40:3229/tcp", NULL); - isns_portal_to_attr_list(&portal_info, - ISNS_TAG_PORTAL_IP_ADDRESS, - ISNS_TAG_PORTAL_TCP_UDP_PORT, - attrs); - - U32(SCN_PORT, 3230); - U32(ESI_PORT, 3230); - - U32(PG_TAG, 1); - STR(PG_ISCSI_NAME, "iqn.1991-05.com.microsoft:orange"); - - STR(ISCSI_NAME, "iqn.1991-05.com.microsoft:orange"); - U32(ISCSI_NODE_TYPE, ISNS_ISCSI_INITIATOR_MASK); - STR(ISCSI_ALIAS, ""); - - status = isns_client_call(clnt, ®); - if (status != ISNS_SUCCESS) - isns_fatal("DevAttrReg failed: %s\n", isns_strerror(status)); - isns_simple_free(reg); - - reg = isns_simple_create(ISNS_DEVICE_GET_NEXT, clnt->ic_source, NULL); - attrs = ®->is_message_attrs; - NIL(ISCSI_NAME); - - attrs = ®->is_operating_attrs; - U32(ISCSI_NODE_TYPE, ISNS_ISCSI_TARGET_MASK); - NIL(ISCSI_NODE_TYPE); - - status = isns_client_call(clnt, ®); - if (status != ISNS_SUCCESS) - isns_fatal("DevGetNext failed: %s\n", isns_strerror(status)); - isns_simple_free(reg); - - return 0; -} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/server.conf open-iscsi-2.0.874/utils/open-isns/tests/server.conf --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/server.conf 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/server.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -BindAddress = @SERVER_ADDRESS@ -SourceName = @SOURCE_NAME@ -Database = @DB_PATH@ -RegistrationPeriod = 2h -ESIMinInterval = 1m -ESIMinInterval = 5m -Security = @NOT_SET@ -AuthKeyFile = @AUTH_KEY@ -ClientKeyStore = DB: -PIDFile = @MYDIR@/pid -ControlSocket = @MYDIR@/control diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/test01.pl open-iscsi-2.0.874/utils/open-isns/tests/test01.pl --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/test01.pl 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/test01.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -#!/usr/bin/perl -# -# Copyright (C) 2007 Olaf Kirch -# -# This test case validates registration and simple query of -# single client. - -push(@INC, "."); -require "harness.pl"; - -&test_prep("test01", @ARGV); - -$server = &create_server; -$client = &create_client($server); - -&isns_start_server($server); - -# 1: Enroll the test client -&isns_enroll_client($client); - -# 2: Register an initiator with default portal -&isns_register_client($client, "initiator portal"); - -# 3: Run a simple query -&isns_query_objects($client, "eid"); - -# 99: Unregister client -&isns_unregister_client("99-unregistration", $client); - -&isns_finish; diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/test02.pl open-iscsi-2.0.874/utils/open-isns/tests/test02.pl --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/test02.pl 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/test02.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -#!/usr/bin/perl -# -# Copyright (C) 2007 Olaf Kirch -# -# This test case validates registration and simple query of -# two clients, and simple DD functionality. - -push(@INC, "."); -require "harness.pl"; - -&test_prep("test02", @ARGV); - -$server = &create_server; -$client1 = &create_client($server, "127.1.0.1"); -$client2 = &create_client($server, "127.1.0.2"); - -&isns_start_server($server); - -# 1: Enroll the client1 -&isns_enroll_client($client1); - -# 2: Enroll the client1 -&isns_enroll_client($client2, "node-type=target"); - -&isns_stage("registration", "Registering both clients"); -&__isns_register_client($client1, "initiator portal"); -&__isns_register_client($client2, "target portal"); -&isns_verify_db($server); - -# Now each of the two clients should just see -# itself -&isns_query_objects($client1, "eid"); -&isns_query_objects($client2, "eid"); - -# Register a DD linking the two nodes -&isns_register_domain($client1, "member-name=isns.client1", "member-name=isns.client2"); - -# Now the clients should see each other -&isns_query_objects($client1, "eid"); -&isns_query_objects($client2, "eid"); - -# Initiator querying for target: -&isns_query_objects($client1, "iscsi-node-type=Target"); - -# Add another member to this DD, and re-add client2 (making -# sure the server doesn't generate dupes) -&isns_register_domain($client1, "dd-id=1", "member-name=isns.client2", "member-name=iqn.com.foobar:disk1"); - -# Query the list of DDs we're a member of -&isns_query_objects($client1, "dd-id"); - -# Remove some entries from the DD -&isns_deregister_domain($client1, "1", "member-iscsi-idx=10"); -&isns_deregister_domain($client1, "1", "member-name=iqn.com.foobar:disk1"); -&isns_register_domain($client1, "dd-id=1", "member-name=isns.client2"); -&isns_deregister_domain($client1, "1"); - -&isns_finish; diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/test03.pl open-iscsi-2.0.874/utils/open-isns/tests/test03.pl --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/test03.pl 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/test03.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -#!/usr/bin/perl -# -# Copyright (C) 2007 Olaf Kirch -# -# This test case validates registration and unregistration. - -push(@INC, "."); -require "harness.pl"; - -&test_prep("test03", @ARGV); - -$server = &create_server; -$client = &create_client($server); - -&isns_start_server($server); - -&isns_enroll_client($client); -&isns_register_client($client, "initiator portal"); - -# Unregistering the portal should leave the iscsi node and -# portal group active, and move the portal to state limbo. -&isns_unregister_client($client, "portal=127.0.0.1:860"); - -# As the iscsi node goes away, so should the whole entity -&isns_unregister_client($client, "iscsi-name=isns.client1"); - -&isns_finish; diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/test04.pl open-iscsi-2.0.874/utils/open-isns/tests/test04.pl --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/test04.pl 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/test04.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -#!/usr/bin/perl -# -# Copyright (C) 2007 Olaf Kirch -# -# This test case verifies that the database remains intact -# across server restarts. - -push(@INC, "."); -require "harness.pl"; - -&test_prep("test04", @ARGV); - -$server = &create_server; -$client = &create_client($server); - -&isns_start_server($server); - -&isns_enroll_client($client); -&isns_register_client($client, "initiator portal"); - -# Restart the server, and make sure it still displays -# the database properly -&isns_stage("restart", "Restarting server process"); -&isns_restart_server($server); -&isns_verify_db($server); - -# Run a simple query -&isns_query_objects($client, "iscsi-name"); - -&isns_finish; diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/test05.pl open-iscsi-2.0.874/utils/open-isns/tests/test05.pl --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/test05.pl 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/test05.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -#!/usr/bin/perl -# -# Copyright (C) 2007 Olaf Kirch -# -# This test case verifies entity expiry - -push(@INC, "."); -require "harness.pl"; - -&isns_prep_slow_test("test05", 30, @ARGV); - -$server = &create_server({ "RegistrationPeriod" => "20s" }); -$client = &create_client($server); - -&isns_start_server($server); - -&isns_enroll_client($client); -&isns_register_client($client, "initiator portal"); - -&isns_stage("expired", "Waiting for registration period to expire (25s)"); -&isns_idle(25); -&isns_verify_db($server); - -&isns_finish; - diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/test06.pl open-iscsi-2.0.874/utils/open-isns/tests/test06.pl --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/test06.pl 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/test06.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -#!/usr/bin/perl -# -# Copyright (C) 2007 Olaf Kirch -# -# This test case validates DevAttrReg replace mode. - -push(@INC, "."); -require "harness.pl"; - -&test_prep("test06", @ARGV); - -$server = &create_server; -$client = &create_client($server); - -&isns_start_server($server); - -# 1: Enroll the client -&isns_enroll_client($client); - -# 2: Register a simple initiator with one portal -&isns_register_client($client, "initiator portal"); - -$eid = &isns_query_eid($client); -unless ($eid) { - &isns_die("Cannot obtain entity ID"); -} - -# Now replace the portal with different values -&isns_register_client($client, "--replace entity=$eid initiator portal=192.168.1.1:iscsi"); -&isns_register_client($client, "--replace entity=$eid initiator portal=192.168.1.2:iscsi"); - -&isns_register_domain($client, "member-name=isns.client1"); - -# Replace our registration once more. Now the object index of the -# initiator should not change, since it's a domain member now. -&isns_register_client($client, "--replace entity=$eid initiator portal=192.168.1.1:iscsi"); - -# Make the portal a domain member too. Now even the portal index should stay -# the same. Note that we do not replace the whole entity now, but just the -# portal -&isns_register_domain($client, "dd-id=1 member-addr=192.168.1.1 member-port=860"); -&isns_register_client($client, "--replace --key portal=192.168.1.1:iscsi portal=192.168.1.2:iscsi"); -&isns_register_client($client, "--replace --key portal=192.168.1.2:iscsi portal=192.168.1.1:iscsi"); - -# Now unregister the whole client, and re-register. -# Portal and client index should remain the same -&isns_unregister_client($client, "eid=$eid"); -&isns_register_client($client, "initiator portal=192.168.1.1:iscsi"); - -&isns_finish; diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/test07.pl open-iscsi-2.0.874/utils/open-isns/tests/test07.pl --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/test07.pl 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/test07.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -#!/usr/bin/perl -# -# Copyright (C) 2007 Olaf Kirch -# -# This test case validates that the server discards portals -# that do not respond to ESI messages - -push(@INC, "."); -require "harness.pl"; - -&isns_prep_slow_test("test07", 30, @ARGV); - -$server = &create_server({ "ESIMinInterval" => "5s" }); -$client = &create_client($server); - -&isns_start_server($server); - -# 1: Enroll the client -&isns_enroll_client($client); - -# 2: Register a simple initiator with one portal -&isns_register_client($client, "initiator portal,esi-port=65535,esi-interval=5"); - -&isns_stage("expired", "Waiting for ESI to expire (~15 sec)"); -&isns_idle(15); -&isns_verify_db($server); - -# 3: Register a simple initiator with two portals, one with ESI and one without. -# When the ESI monitored portal expires, this should still take down -# the whole network entity. -&isns_register_client($client, "initiator portal,esi-port=65535,esi-interval=5 portal=127.0.0.1:1"); - -&isns_stage("expired", "Waiting for ESI to expire (~15 sec)"); -&isns_idle(15); -&isns_verify_db($server); - -&isns_finish; diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/test08.pl open-iscsi-2.0.874/utils/open-isns/tests/test08.pl --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/test08.pl 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/test08.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -#!/usr/bin/perl -# -# Copyright (C) 2007 Olaf Kirch -# -# This test case validates registration and simple query of -# single client. - -push(@INC, "."); -require "harness.pl"; - -# For now, this one will run w/o security only -push(@ARGV, '-i'); - -&test_prep("test08", @ARGV); - -$server = &create_server; -$client = &create_client($server); - -&isns_start_server($server); - -&isns_external_test($client, "tests/pauw1"); - -&isns_finish; diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/test09.pl open-iscsi-2.0.874/utils/open-isns/tests/test09.pl --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/test09.pl 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/test09.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -#!/usr/bin/perl -# -# Copyright (C) 2007 Olaf Kirch -# -# This test case validates registration and simple query of -# single client. - -push(@INC, "."); -require "harness.pl"; - -# For now, this one will run w/o security only -push(@ARGV, '-i'); - -&test_prep("test09", @ARGV); - -$server = &create_server; -$client = &create_client($server); - -&isns_start_server($server); - -&isns_external_test($client, "tests/pauw2"); - -&isns_finish; diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/test10.pl open-iscsi-2.0.874/utils/open-isns/tests/test10.pl --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/test10.pl 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/test10.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -#!/usr/bin/perl -# -# Copyright (C) 2007 Olaf Kirch -# -# This test case validates registration and simple query of -# single client. - -push(@INC, "."); -require "harness.pl"; - -# For now, this one will run w/o security only -push(@ARGV, '-i'); - -&isns_prep_slow_test("test10", 20, @ARGV); - -$server = &create_server({ "ESIMinInterval" => "10s" }); -$client = &create_client($server); - -&isns_start_server($server); - -&isns_external_test($client, "tests/pauw3", "16"); - -&isns_stage("expired", "Waiting for ESI to come around"); -&isns_idle(5); -&isns_verify_db($server); - -&isns_external_test($client, "tests/pauw3", "-n", "16"); - -&isns_stage("expired", "Waiting for ESI to come around"); -&isns_idle(5); -&isns_verify_db($server); - -&isns_finish; diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/test11.pl open-iscsi-2.0.874/utils/open-isns/tests/test11.pl --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/tests/test11.pl 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/tests/test11.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -#!/usr/bin/perl -# -# Copyright (C) 2007 Olaf Kirch -# -# This test case validates registration and simple query of -# single client. - -push(@INC, "."); -require "harness.pl"; - -# For now, this one will run w/o security only -push(@ARGV, '-i'); - -&test_prep("test11", @ARGV); - -$server = &create_server; -$client = &create_client($server); - -&isns_start_server($server); - -&isns_external_test($client, "tests/pauw4"); - -&isns_finish; diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/timer.c open-iscsi-2.0.874/utils/open-isns/timer.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/timer.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/timer.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,126 +0,0 @@ -/* - * Timers (one-short and periodic) - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include -#include -#include "isns.h" -#include "util.h" - -typedef struct isns_timer isns_timer_t; -struct isns_timer { - isns_list_t it_list; - time_t it_when; - unsigned int it_period; - isns_timer_callback_t * it_func; - void * it_data; -}; - - -static ISNS_LIST_DECLARE(timers); - -static void -__isns_arm_timer(isns_timer_t *tm) -{ - isns_list_t *pos, *next; - time_t when = tm->it_when; - - isns_list_foreach(&timers, pos, next) { - isns_timer_t *cur = isns_list_item(isns_timer_t, it_list, pos); - - if (when < cur->it_when) - break; - } - isns_item_insert_before(pos, &tm->it_list); -} - -static isns_timer_t * -__isns_create_timer(time_t when, - unsigned int period, - isns_timer_callback_t *fn, - void *data) -{ - isns_timer_t *tm; - - tm = isns_calloc(1, sizeof(*tm)); - tm->it_when = when; - tm->it_period = period; - tm->it_func = fn; - tm->it_data = data; - return tm; -} - -void -isns_add_timer(unsigned int period, - isns_timer_callback_t *fn, - void *data) -{ - isns_timer_t *tm; - - isns_assert(period); - tm = __isns_create_timer(time(NULL) + period, period, fn, data); - __isns_arm_timer(tm); -} - -void -isns_add_oneshot_timer(unsigned int expires, - isns_timer_callback_t *fn, - void *data) -{ - isns_timer_t *tm; - - tm = __isns_create_timer(time(NULL) + expires, 0, fn, data); - __isns_arm_timer(tm); -} - -void -isns_cancel_timer(isns_timer_callback_t *fn, void *data) -{ - isns_list_t *pos, *next; - - isns_list_foreach(&timers, pos, next) { - isns_timer_t *tm = isns_list_item(isns_timer_t, it_list, pos); - - if (tm->it_func == fn - && (data == NULL || tm->it_data == data)) { - isns_list_del(pos); - isns_free(tm); - } - } -} - -time_t -isns_run_timers(void) -{ - - while (!isns_list_empty(&timers)) { - isns_timer_t *tm = isns_list_item(isns_timer_t, it_list, timers.next); - isns_timer_callback_t *func; - time_t expire; - void *data; - - expire = tm->it_when; - if (time(NULL) < expire) - return expire; - - isns_list_del(&tm->it_list); - func = tm->it_func; - data = tm->it_data; - expire = 0; - - /* If it's a periodic timer, rearm it now. This allows - * the timer callback to cancel the timer. */ - if (tm->it_period) { - tm->it_when = time(NULL) + tm->it_period; - __isns_arm_timer(tm); - } else { - isns_free(tm); - } - - func(data); - } - - return 0; -} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/TODO open-iscsi-2.0.874/utils/open-isns/TODO --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/TODO 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/TODO 1970-01-01 00:00:00.000000000 +0000 @@ -1,100 +0,0 @@ -Documentation: - - Add HOWTO - -isnsd: - - When registering a node, use the default EID given in its - policy (avoid the isns.control trap) - - make PGs children of the iSCSI storage node they're associated - with? - - Implement missing functions - -isnsadm: - - support iSNS server discovery through DNS SRV - records, and SLP - -isnsdd: - - support iSNS server discovery through DNS SRV - records, and SLP - - At startup, query the server for the list of - visible nodes/portals - - When receiving an SCN, query for the node's - portals, authmethod and such, and compare that - to what we have cached - - At regular intervals, repeat the query for - all visible nodes/portals, and do a diff with - our shadow DB - - At regular intervals, check whether the portals - we registered for ESI are seeing the server's - ESI messages. - -DevAttrReg: - - Refuse registration of nodes inside the CONTROL - entity, unless it's a control node. - - If the client uses REPLACE, is it okay for the - entity's index to change? - - security: optionally validate the IP addresses - a client registers (either against a static policy, - or using DNS). - - relaxed security model: require privilege - for registration of targets; anyone can register - an initiator? - - Gracefully handle registrations where the client - specifies an index attribute, as long as it matches - the next_index - -DevAttrQuery: - - fix --local --query policy-index=iqn.1969-12.brummo - and write test case - - fix the way we enumerate related objects - - ensure DD discovery works (5.6.5.2): - DD membership can be discovered through the DevAttrQry message - by including either DD member attributes (i.e., DD Member - iSCSI Index, DD Member iSCSI Node, DD Member iFCP Node, DD - Member Portal Index, DD Member Portal IP Addr, and DD Member - Portal TCP/UDP) or the object key of the Storage Node or - Portal (i.e., iSCSI Name, iSCSI Index, Portal IP Addr, Portal - TCP/UDP Port, and Portal Index) in the Operating Attributes. - Using DD member attributes SHALL return both registered and - unregistered member Storage Nodes and/or Portals of a DD. - DevAttrQry messages using the Storage Node and/or Portal - object key SHALL return only member Storage Nodes or Portals - that are currently registered in the iSNS database. - -DevAttrDereg: - - PG Removal code: ignore nodes/portal that are dead - - review security - - cancel any SCN/ESI callbacks - -SCN: - - Trigger a mgmt reg SCN when accepting a mgmt registration - -SCNEvent: - - Implement - -ESI: - - Right now the way we re-establish ESI state after database - reload is awkward. - -DDReg: - - Write test cases - -DDDereg: - - Write test cases - -DDSReg/DDSDereg: - - Implement - -Heartbeat: - - Implement message send - - Implement failover? - -Security: - - Allow policies without key? - - Implement simple default policies linking client IP + - hostname (network entity) + storage node names - -Renaming - - Add isns_ prefix to all visible functions - -Socket code: - - impose upper limit on the reassembly buffer diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/types.h open-iscsi-2.0.874/utils/open-isns/types.h --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/types.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/types.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ -/* - * Open-iSNS types - * - * Copyright (C) 2007 Olaf Kirch - */ - -#ifndef ISNS_TYPES_H -#define ISNS_TYPES_H - -typedef struct isns_simple isns_simple_t; -typedef struct isns_source isns_source_t; -typedef struct isns_object isns_object_t; -typedef struct isns_relation isns_relation_t; -typedef struct isns_attr isns_attr_t; -typedef struct isns_attr_list isns_attr_list_t; -typedef struct isns_message isns_message_t; -typedef struct isns_socket isns_socket_t; -typedef struct isns_db isns_db_t; -typedef struct isns_tag_type isns_tag_type_t; -typedef const struct isns_object_template isns_object_template_t; -typedef struct isns_authdata isns_authdata_t; -typedef struct isns_security isns_security_t; -typedef struct isns_principal isns_principal_t; -typedef struct isns_policy isns_policy_t; -typedef struct isns_keystore isns_keystore_t; -typedef struct isns_scope isns_scope_t; -typedef struct isns_portal_info isns_portal_info_t; -typedef struct isns_server isns_server_t; -typedef struct isns_db_event isns_db_event_t; -typedef struct isns_bitvector isns_bitvector_t; - -typedef struct isns_object_list { - unsigned int iol_count; - isns_object_t ** iol_data; -} isns_object_list_t; - -#define ISNS_OBJECT_LIST_INIT { .iol_count = 0, .iol_data = NULL } - -/* - * An attribute list - */ -struct isns_attr_list { - unsigned int ial_count; - isns_attr_t ** ial_data; -}; -#define ISNS_ATTR_LIST_INIT { .ial_count = 0, .ial_data = NULL } - -/* - * Function types. - */ -typedef void isns_print_fn_t(const char *, ...); -typedef void isns_timer_callback_t(void *); - - -#endif /* ISNS_TYPES_H */ - - diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/util.c open-iscsi-2.0.874/utils/open-isns/util.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/util.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/util.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,263 +0,0 @@ -/* - * util.c - * - * Misc utility functions - * - * Copyright (C) 2006, 2007 Olaf Kirch - */ - -#include -#include -#include -#include -#include -#include "util.h" - -unsigned long -parse_size(const char *arg) -{ - unsigned long mult = 1, ret; - char *s; - - ret = strtol(arg, &s, 0); - - switch (*s++) { - case 'g': - case 'G': - mult = 1024 * 1024 * 1024; - break; - case 'm': - case 'M': - mult = 1024 * 1024; - break; - case 'k': - case 'K': - mult = 1024; - break; - - case '\0': - return ret; - - default: - bad: - err(1, "parse_size: unknown unit in \"%s\"\n", arg); - } - - if (*s != '\0') - goto bad; - - return mult * ret; -} - -char * -print_size(unsigned long size) -{ - static char unit[] = "-kMG"; - static char buffer[64]; - unsigned int power = 0; - - while (size && !(size % 1024) && power < sizeof(unit)) { - size /= 1024; - power++; - } - - if (!power) { - snprintf(buffer, sizeof(buffer), "%lu", size); - } else { - snprintf(buffer, sizeof(buffer), "%lu%c", - size, unit[power]); - } - return buffer; -} - -unsigned int -parse_count(const char *arg) -{ - unsigned long ret; - char *s; - - ret = strtoul(arg, &s, 0); - if (*s != '\0') - err(1, "parse_count: unexpected character in \"%s\"\n", arg); - - return ret; -} - -int -parse_int(const char *arg) -{ - long ret; - char *s; - - ret = strtol(arg, &s, 0); - if (*s != '\0') - err(1, "parse_count: unexpected character in \"%s\"\n", arg); - - return ret; -} - -long long -parse_longlong(const char *arg) -{ - long long ret; - char *s; - - ret = strtoll(arg, &s, 0); - if (*s != '\0') - err(1, "parse_count: unexpected character in \"%s\"\n", arg); - - return ret; -} - -double -parse_double(const char *arg) -{ - double ret; - char *s; - - ret = strtod(arg, &s); - if (*s != '\0') - err(1, "parse_count: unexpected character in \"%s\"\n", arg); - - return ret; -} - -unsigned int -parse_timeout(const char *arg) -{ - unsigned int v, ret = 0; - char *s; - - do { - v = strtoul(arg, &s, 10); - switch (*s) { - case '\0': - ret += v; - break; - case 'd': - v *= 24; - case 'h': - v *= 60; - case 'm': - v *= 60; - case 's': - ret += v; - ++s; - break; - - default: - errx(1, "parse_timeout: unexpected character in \"%s\"\n", - arg); - } - - arg = s; - } while (*arg); - - return ret; -} - -void -isns_string_array_append(struct string_array *array, const char *val) -{ - if (!(array->count % 32)) { - array->list = isns_realloc(array->list, - (array->count + 32) * sizeof(val)); - } - array->list[array->count++] = val? isns_strdup(val) : NULL; -} - -void -isns_string_array_destroy(struct string_array *array) -{ - unsigned int i; - - for (i = 0; i < array->count; ++i) - isns_free(array->list[i]); - isns_free(array->list); - memset(array, 0, sizeof(*array)); -} - -void -isns_assign_string(char **var, const char *val) -{ - char *s = NULL; - - if (val && !(s = isns_strdup(val))) - errx(1, "out of memory"); - - if (*var) - isns_free(*var); - *var = s; -} - -/* - * Recursively create a directory - */ -int -isns_mkdir_recursive(const char *pathname) -{ - const char *orig_pathname = pathname; - char *squirrel[64]; - char *copy = NULL, *s; - int ns = 0; - - if (!pathname || !strcmp(pathname, ".")) - return 0; - while (1) { - if (mkdir(pathname, 0755) >= 0) { - if (ns == 0) - break; - *squirrel[--ns] = '/'; - continue; - } - - if (errno == EEXIST) - goto good; - if (errno != ENOENT) - goto bad; - - if (copy == NULL) { - copy = isns_strdup(pathname); - pathname = copy; - } - - s = strrchr(copy, '/'); - while (s > copy && s[-1] == '/') - --s; - *s = '\0'; - - isns_assert(ns < 64); - squirrel[ns++] = s; - - if (s == copy) - goto bad; - } - -good: if (copy) - isns_free(copy); - errno = 0; - return 0; - -bad: if (copy) - isns_free(copy); - perror(orig_pathname); - return -1; -} - -/* - * This one differs from POSIX dirname; it does not - * modify its argument - */ -const char * -isns_dirname(const char *pathname) -{ - static char buffer[4096]; - char *s; - - strcpy(buffer, pathname); - if ((s = strrchr(buffer, '/')) != NULL) { - *s = '\0'; - return buffer; - } - return "."; -} diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/util.h open-iscsi-2.0.874/utils/open-isns/util.h --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/util.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/util.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,289 +0,0 @@ -/* - * Utility functions - * - * Copyright (C) 2006, 2007 Olaf Kirch - */ - -#ifndef UTIL_H -#define UTIL_H - -#include -#include -#include -#include -#include -#include // for strdup -#include "types.h" - -#define array_num_elements(a) (sizeof(a) / sizeof((a)[0])) - -const char * isns_dirname(const char *); -int isns_mkdir_recursive(const char *); - -extern const char *parser_separators; -char * parser_get_next_line(FILE *); -char * parser_get_next_word(char **); -char * parser_get_rest_of_line(char **); -int parser_split_line(char *, unsigned int, char **); - -unsigned long parse_size(const char *); -unsigned int parse_count(const char *); -int parse_int(const char *); -long long parse_longlong(const char *); -double parse_double(const char *); -unsigned int parse_timeout(const char *); - -char * print_size(unsigned long); - -/* - * Very simple and stupid string array. - */ -struct string_array { - unsigned int count; - char ** list; -}; - -void isns_string_array_append(struct string_array *, const char *); -void isns_string_array_destroy(struct string_array *); - -void isns_assign_string(char **, const char *); - -void isns_write_pidfile(const char *); -void isns_update_pidfile(const char *); -void isns_remove_pidfile(const char *); - -extern void isns_log_background(void); -extern void isns_assert_failed(const char *, - const char *, unsigned int); -extern void isns_fatal(const char *, ...); -extern void isns_warning(const char *, ...); -extern void isns_error(const char *, ...); -extern void isns_notice(const char *, ...); -extern void isns_debug_general(const char *, ...); -extern void isns_debug_socket(const char *, ...); -extern void isns_debug_protocol(const char *, ...); -extern void isns_debug_message(const char *, ...); -extern void isns_debug_state(const char *, ...); -extern void isns_debug_auth(const char *, ...); -extern void isns_debug_scn(const char *, ...); -extern void isns_debug_esi(const char *, ...); -extern void isns_enable_debugging(const char *); -extern int isns_debug_enabled(int); - -enum { - DBG_GENERAL = 0, - DBG_SOCKET, - DBG_PROTOCOL, - DBG_MESSAGE, - DBG_STATE, - DBG_AUTH, - DBG_SCN, - DBG_ESI, -}; - -/* - * There's no htonll yet - */ -#ifndef htonll -# include -# include -# if __BYTE_ORDER == __BIG_ENDIAN -# define htonll(x) (x) -# define ntohll(x) (x) -# elif __BYTE_ORDER == __LITTLE_ENDIAN -# define htonll(x) __bswap_64(x) -# define ntohll(x) __bswap_64(x) -# endif -#endif - -/* - * One of the those eternal staples of C coding: - */ -#ifndef MIN -# define MIN(a, b) ((a) < (b)? (a) : (b)) -# define MAX(a, b) ((a) > (b)? (a) : (b)) -#endif - -#define DECLARE_BITMAP(name, NBITS) \ - uint32_t name[(NBITS+31) >> 5] = { 0 } - -#define __BIT_INDEX(nr) (nr >> 5) -#define __BIT_MASK(nr) (1 << (nr & 31)) - -static inline void -set_bit(uint32_t *map, unsigned int nr) -{ - map[__BIT_INDEX(nr)] |= __BIT_MASK(nr); -} - -static inline void -clear_bit(uint32_t *map, unsigned int nr) -{ - map[__BIT_INDEX(nr)] &= ~__BIT_MASK(nr); -} - -static inline int -test_bit(const uint32_t *map, unsigned int nr) -{ - return !!(map[__BIT_INDEX(nr)] & __BIT_MASK(nr)); -} - -/* - * Dynamically sized bit vector - */ -extern isns_bitvector_t *isns_bitvector_alloc(void); -extern void isns_bitvector_init(isns_bitvector_t *); -extern void isns_bitvector_destroy(isns_bitvector_t *); -extern void isns_bitvector_free(isns_bitvector_t *); -extern int isns_bitvector_test_bit(const isns_bitvector_t *, unsigned int); -extern int isns_bitvector_set_bit(isns_bitvector_t *, unsigned int); -extern int isns_bitvector_clear_bit(isns_bitvector_t *, unsigned int); -extern int isns_bitvector_is_empty(const isns_bitvector_t *); -extern int isns_bitvector_intersect(const isns_bitvector_t *a, - const isns_bitvector_t *b, - isns_bitvector_t *result); -extern void isns_bitvector_print(const isns_bitvector_t *, - isns_print_fn_t *); -extern void isns_bitvector_foreach(const isns_bitvector_t *bv, - int (*cb)(uint32_t, void *), - void *user_data); - -/* - * List manipulation primites - */ -typedef struct isns_list isns_list_t; -struct isns_list { - isns_list_t * next; - isns_list_t * prev; -}; - -#define ISNS_LIST_DECLARE(list) \ - isns_list_t list = { &list, &list } - -static inline void -isns_list_init(isns_list_t *head) -{ - head->next = head->prev = head; -} - -static inline void -__isns_list_insert(isns_list_t *prev, isns_list_t *item, isns_list_t *next) -{ - item->next = next; - item->prev = prev; - next->prev = item; - prev->next = item; -} - -static inline void -isns_list_append(isns_list_t *head, isns_list_t *item) -{ - __isns_list_insert(head->prev, item, head); -} - -static inline void -isns_list_insert(isns_list_t *head, isns_list_t *item) -{ - __isns_list_insert(head, item, head->next); -} - -static inline void -isns_item_insert_before(isns_list_t *where, isns_list_t *item) -{ - __isns_list_insert(where->prev, item, where); -} - -static inline void -isns_item_insert_after(isns_list_t *where, isns_list_t *item) -{ - __isns_list_insert(where, item, where->next); -} - -static inline void -isns_list_del(isns_list_t *item) -{ - isns_list_t *prev = item->prev; - isns_list_t *next = item->next; - - prev->next = next; - next->prev = prev; - item->next = item->prev = item; -} - -static inline int -isns_list_empty(const isns_list_t *head) -{ - return head == head->next; -} - -static inline void -isns_list_move(isns_list_t *dst, isns_list_t *src) -{ - isns_list_t *prev, *next; - isns_list_t *head, *tail; - - if (isns_list_empty(src)) - return; - - prev = dst->prev; - next = dst; - - head = src->next; - tail = src->prev; - - next->prev = tail; - prev->next = head; - head->prev = prev; - tail->next = next; - - src->next = src->prev = src; -} - -#define isns_list_item(type, member, ptr) \ - container_of(type, member, ptr) - -#define isns_list_foreach(list, __pos, __next) \ - for (__pos = (list)->next; \ - (__pos != list) && (__next = __pos->next, 1); \ - __pos = __next) - -#if 0 -/* This is defined in stddef */ -#define offsetof(type, member) ((unsigned long) &(((type *) 0)->member)) -#endif -#define container_of(type, member, ptr) \ - ((type *) (((unsigned char *) ptr) - offsetof(type, member))) - -/* - * Use isns_assert instead of libc's assert, so that the - * message can be captured and sent to syslog. - */ -#define isns_assert(condition) do { \ - if (!(condition)) \ - isns_assert_failed(#condition, \ - __FILE__, __LINE__); \ -} while (0) - -#ifndef MDEBUG -# define isns_malloc(size) malloc(size) -# define isns_calloc(n, size) calloc(n, size) -# define isns_realloc(p, size) realloc(p, size) -# define isns_strdup(s) strdup(s) -# define isns_free(p) free(p) -#else -# define isns_malloc(size) isns_malloc_fn(size, __FILE__, __LINE__) -# define isns_calloc(n, size) isns_calloc_fn(n, size, __FILE__, __LINE__) -# define isns_realloc(p, size) isns_realloc_fn(p, size, __FILE__, __LINE__) -# define isns_strdup(s) isns_strdup_fn(s, __FILE__, __LINE__) -# define isns_free(p) isns_free_fn(p, __FILE__, __LINE__) - -extern void * (*isns_malloc_fn)(size_t, const char *, unsigned int); -extern void * (*isns_calloc_fn)(unsigned int, size_t, - const char *, unsigned int); -extern void * (*isns_realloc_fn)(void *, size_t, - const char *, unsigned int); -extern char * (*isns_strdup_fn)(const char *, const char *, unsigned int); -extern void (*isns_free_fn)(void *, const char *, unsigned int); -#endif - -#endif /* UTIL_H */ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/vendor.c open-iscsi-2.0.874/utils/open-isns/vendor.c --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/vendor.c 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/vendor.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -/* - * iSNS vendor specific objects - * - * Copyright (C) 2007 Olaf Kirch - */ - -#include -#include -#include "isns.h" -#include "objects.h" -#include "attrs.h" -#include "vendor.h" -#include "util.h" - -static uint32_t policy_attrs[] = { - OPENISNS_TAG_POLICY_SPI, - OPENISNS_TAG_POLICY_KEY, - OPENISNS_TAG_POLICY_ENTITY, - OPENISNS_TAG_POLICY_OBJECT_TYPE, - OPENISNS_TAG_POLICY_NODE_NAME, - OPENISNS_TAG_POLICY_NODE_TYPE, - OPENISNS_TAG_POLICY_FUNCTIONS, - OPENISNS_TAG_POLICY_VISIBLE_DD, - OPENISNS_TAG_POLICY_DEFAULT_DD, -}; - -static uint32_t policy_key_attrs[] = { - OPENISNS_TAG_POLICY_SPI, -}; - -isns_object_template_t isns_policy_template = { - .iot_name = "Policy", - .iot_handle = ISNS_OBJECT_TYPE_POLICY, - .iot_attrs = policy_attrs, - .iot_num_attrs = array_num_elements(policy_attrs), - .iot_keys = policy_key_attrs, - .iot_num_keys = array_num_elements(policy_key_attrs), - .iot_container = &isns_entity_template, - .iot_vendor_specific = 1, -}; - diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/vendor.h open-iscsi-2.0.874/utils/open-isns/vendor.h --- open-iscsi-2.0.873+git0.3b4b4500/utils/open-isns/vendor.h 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/open-isns/vendor.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ -/* - * iSNS "vendor-specific" protocol definitions - * - * Copyright (C) 2007 Olaf Kirch - */ - -#ifndef ISNS_VENDOR_H -#define ISNS_VENDOR_H - -#include "isns-proto.h" - -/* - * We're poor, we don't own a OUI. Let's fake one. - */ -#define OPENISNS_VENDOR_OUI 0xFFFF00 -#define OPENISNS_VENDOR_PREFIX (OPENISNS_VENDOR_OUI << 8) -#define OPENISNS_IS_PRIVATE_ATTR(tag) (((tag) >> 16) == 0xFFFF) - -enum openisns_vendor_tag { - /* Security Policy Identifier */ - OPENISNS_TAG_POLICY_SPI = OPENISNS_VENDOR_PREFIX + ISNS_VENDOR_SPECIFIC_OTHER_BASE, - - __OPENISNS_TAG_POLICY_RESERVED, - - /* DSA signature key (public) */ - OPENISNS_TAG_POLICY_KEY, - - /* Entity name to use */ - OPENISNS_TAG_POLICY_ENTITY, - - /* Functions the client is permitted to invoke */ - OPENISNS_TAG_POLICY_FUNCTIONS, - - /* Object types the client is permitted to see. */ - OPENISNS_TAG_POLICY_OBJECT_TYPE, - - /* iSCSI node name the client is permitted to register. - * This attribute may occur multiple times. - * If absent, it defaults to POLICY_SOURCE_NAME - */ - OPENISNS_TAG_POLICY_NODE_NAME, - - /* Node type bitmap the client is permitted to register */ - OPENISNS_TAG_POLICY_NODE_TYPE, - - /* Default discovery domain the client will be - * placed in. - * Not used yet. - */ - OPENISNS_TAG_POLICY_DEFAULT_DD, - OPENISNS_TAG_POLICY_VISIBLE_DD, -}; - -extern const struct isns_object_template isns_policy_template; - -#endif /* ISNS_VENDOR_H */ diff -Nru open-iscsi-2.0.873+git0.3b4b4500/utils/sysdeps/Makefile open-iscsi-2.0.874/utils/sysdeps/Makefile --- open-iscsi-2.0.873+git0.3b4b4500/utils/sysdeps/Makefile 2013-09-12 07:01:13.000000000 +0000 +++ open-iscsi-2.0.874/utils/sysdeps/Makefile 2016-09-29 18:33:24.000000000 +0000 @@ -1,6 +1,7 @@ # This Makefile will work only with GNU make. -CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -O2 -fno-inline -Wall -Wstrict-prototypes -g +CFLAGS ?= -O2 -fno-inline -g +CFLAGS += $(WARNFLAGS) -Wall -Wstrict-prototypes SYSDEPS_OBJS=sysdeps.o