Project import
diff --git a/libunwind/AUTHORS b/libunwind/AUTHORS
new file mode 100644
index 0000000..719eee5
--- /dev/null
+++ b/libunwind/AUTHORS
@@ -0,0 +1 @@
+David Mosberger <dmosberger@gmail.org>
diff --git a/libunwind/Android.bp b/libunwind/Android.bp
new file mode 100644
index 0000000..538476a
--- /dev/null
+++ b/libunwind/Android.bp
@@ -0,0 +1,470 @@
+//
+// Copyright (C) 2014 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+// Set to true to enable a debug build of the libraries.
+// To control what is logged, set the environment variable UNW_DEBUG_LEVEL=x,
+// where x controls the verbosity (from 1 to 20).
+//libunwind_debug = false
+
+cc_defaults {
+    name: "libunwind_defaults",
+    host_supported: true,
+
+    cppflags: [
+        "-Wno-old-style-cast",
+    ],
+
+    cflags: [
+        "-Werror",
+        "-Wno-#pragma-messages",
+        "-Wno-unused-parameter",
+
+        "-DHAVE_CONFIG_H",
+        "-D_GNU_SOURCE",
+        "-DNDEBUG",
+    ],
+
+    arch: {
+        arm: {
+            local_include_dirs: ["include/tdep-arm"],
+        },
+        arm64: {
+            local_include_dirs: ["include/tdep-aarch64"],
+        },
+        mips: {
+            local_include_dirs: ["include/tdep-mips"],
+        },
+        mips64: {
+            local_include_dirs: ["include/tdep-mips"],
+        },
+        x86: {
+            local_include_dirs: ["include/tdep-x86"],
+        },
+        x86_64: {
+            local_include_dirs: ["include/tdep-x86_64"],
+        },
+    },
+
+    target: {
+        android: {
+            // gcc 4.8 appears to be overeager declaring that a variable is uninitialized,
+            // under certain circumstances. Turn off this warning only for target so that
+            // coverage is still present for the host code. When the entire build system
+            // is switched to 4.9, then this can be removed.
+            cflags: ["-Wno-maybe-uninitialized"],
+        },
+        darwin: {
+            enabled: false,
+        },
+    },
+
+    clang_cflags: [
+        // src/mi/backtrace.c is misdetected as a bogus header guard by clang 3.5
+        // src/x86_64/Gstash_frame.c has unnecessary calls to labs.
+        "-Wno-header-guard",
+        "-Wno-absolute-value",
+        // The latest clang (r230699) does not allow SP/PC to be declared in inline asm lists.
+        "-Wno-inline-asm",
+    ],
+
+    debug: {
+        cflags: [
+            "-UNDEBUG",
+            "-DDEBUG",
+            "-U_FORTIFY_SOURCE",
+        ],
+    },
+
+    local_include_dirs: [
+        "src",
+        "include",
+    ],
+}
+
+//-----------------------------------------------------------------------
+// libunwind shared and static library
+//-----------------------------------------------------------------------
+
+cc_library {
+    name: "libunwind",
+    defaults: ["libunwind_defaults"],
+    sdk_version: "21",
+
+    srcs: [
+        "src/mi/init.c",
+        "src/mi/flush_cache.c",
+        "src/mi/mempool.c",
+        "src/mi/strerror.c",
+        "src/mi/backtrace.c",
+        "src/mi/dyn-cancel.c",
+        "src/mi/dyn-info-list.c",
+        "src/mi/dyn-register.c",
+        "src/mi/map.c",
+        "src/mi/Lmap.c",
+        "src/mi/Ldyn-extract.c",
+        "src/mi/Lfind_dynamic_proc_info.c",
+        "src/mi/Lget_proc_info_by_ip.c",
+        "src/mi/Lget_proc_name.c",
+        "src/mi/Lput_dynamic_unwind_info.c",
+        "src/mi/Ldestroy_addr_space.c",
+        "src/mi/Lget_reg.c",
+        "src/mi/Lset_reg.c",
+        "src/mi/Lget_fpreg.c",
+        "src/mi/Lset_fpreg.c",
+        "src/mi/Lset_caching_policy.c",
+        "src/mi/Gdyn-extract.c",
+        "src/mi/Gdyn-remote.c",
+        "src/mi/Gfind_dynamic_proc_info.c",
+        "src/mi/Gget_accessors.c",
+        "src/mi/Gget_proc_info_by_ip.c",
+        "src/mi/Gget_proc_name.c",
+        "src/mi/Gput_dynamic_unwind_info.c",
+        "src/mi/Gdestroy_addr_space.c",
+        "src/mi/Gget_reg.c",
+        "src/mi/Gset_reg.c",
+        "src/mi/Gget_fpreg.c",
+        "src/mi/Gset_fpreg.c",
+        "src/mi/Gset_caching_policy.c",
+        "src/dwarf/Lexpr.c",
+        "src/dwarf/Lfde.c",
+        "src/dwarf/Lparser.c",
+        "src/dwarf/Lpe.c",
+        "src/dwarf/Lstep_dwarf.c",
+        "src/dwarf/Lfind_proc_info-lsb.c",
+        "src/dwarf/Lfind_unwind_table.c",
+        "src/dwarf/Gexpr.c",
+        "src/dwarf/Gfde.c",
+        "src/dwarf/Gfind_proc_info-lsb.c",
+        "src/dwarf/Gfind_unwind_table.c",
+        "src/dwarf/Gparser.c",
+        "src/dwarf/Gpe.c",
+        "src/dwarf/Gstep_dwarf.c",
+        "src/dwarf/global.c",
+        "src/os-common.c",
+        "src/os-linux.c",
+        "src/Los-common.c",
+
+        // ptrace files for remote unwinding.
+        "src/ptrace/_UPT_accessors.c",
+        "src/ptrace/_UPT_access_fpreg.c",
+        "src/ptrace/_UPT_access_mem.c",
+        "src/ptrace/_UPT_access_reg.c",
+        "src/ptrace/_UPT_create.c",
+        "src/ptrace/_UPT_destroy.c",
+        "src/ptrace/_UPT_find_proc_info.c",
+        "src/ptrace/_UPT_get_dyn_info_list_addr.c",
+        "src/ptrace/_UPT_put_unwind_info.c",
+        "src/ptrace/_UPT_get_proc_name.c",
+        "src/ptrace/_UPT_reg_offset.c",
+        "src/ptrace/_UPT_resume.c",
+     ],
+
+    arch: {
+        arm: {
+            srcs: [
+                "src/arm/is_fpreg.c",
+                "src/arm/regname.c",
+                "src/arm/Gcreate_addr_space.c",
+                "src/arm/Gget_proc_info.c",
+                "src/arm/Gget_save_loc.c",
+                "src/arm/Gglobal.c",
+                "src/arm/Ginit.c",
+                "src/arm/Ginit_local.c",
+                "src/arm/Ginit_remote.c",
+                "src/arm/Gregs.c",
+                "src/arm/Gresume.c",
+                "src/arm/Gstep.c",
+                "src/arm/Lcreate_addr_space.c",
+                "src/arm/Lget_proc_info.c",
+                "src/arm/Lget_save_loc.c",
+                "src/arm/Lglobal.c",
+                "src/arm/Linit.c",
+                "src/arm/Linit_local.c",
+                "src/arm/Linit_remote.c",
+                "src/arm/Lregs.c",
+                "src/arm/Lresume.c",
+                "src/arm/Lstep.c",
+
+                "src/arm/getcontext.S",
+                "src/arm/Gis_signal_frame.c",
+                "src/arm/Gex_tables.c",
+                "src/arm/Lis_signal_frame.c",
+                "src/arm/Lex_tables.c",
+            ],
+        },
+        arm64: {
+            srcs: [
+                "src/aarch64/is_fpreg.c",
+                "src/aarch64/regname.c",
+                "src/aarch64/Gcreate_addr_space.c",
+                "src/aarch64/Gget_proc_info.c",
+                "src/aarch64/Gget_save_loc.c",
+                "src/aarch64/Gglobal.c",
+                "src/aarch64/Ginit.c",
+                "src/aarch64/Ginit_local.c",
+                "src/aarch64/Ginit_remote.c",
+                "src/aarch64/Gregs.c",
+                "src/aarch64/Gresume.c",
+                "src/aarch64/Gstep.c",
+                "src/aarch64/Lcreate_addr_space.c",
+                "src/aarch64/Lget_proc_info.c",
+                "src/aarch64/Lget_save_loc.c",
+                "src/aarch64/Lglobal.c",
+                "src/aarch64/Linit.c",
+                "src/aarch64/Linit_local.c",
+                "src/aarch64/Linit_remote.c",
+                "src/aarch64/Lregs.c",
+                "src/aarch64/Lresume.c",
+                "src/aarch64/Lstep.c",
+
+                "src/aarch64/Gis_signal_frame.c",
+                "src/aarch64/Lis_signal_frame.c",
+            ],
+        },
+        mips: {
+            srcs: [
+                "src/mips/is_fpreg.c",
+                "src/mips/regname.c",
+                "src/mips/Gcreate_addr_space.c",
+                "src/mips/Gget_proc_info.c",
+                "src/mips/Gget_save_loc.c",
+                "src/mips/Gglobal.c",
+                "src/mips/Ginit.c",
+                "src/mips/Ginit_local.c",
+                "src/mips/Ginit_remote.c",
+                "src/mips/Gregs.c",
+                "src/mips/Gresume.c",
+                "src/mips/Gstep.c",
+                "src/mips/Lcreate_addr_space.c",
+                "src/mips/Lget_proc_info.c",
+                "src/mips/Lget_save_loc.c",
+                "src/mips/Lglobal.c",
+                "src/mips/Linit.c",
+                "src/mips/Linit_local.c",
+                "src/mips/Linit_remote.c",
+                "src/mips/Lregs.c",
+                "src/mips/Lresume.c",
+                "src/mips/Lstep.c",
+
+                "src/mips/getcontext-android.S",
+                "src/mips/Gis_signal_frame.c",
+                "src/mips/Lis_signal_frame.c",
+            ],
+        },
+        // mips and mips64 use the same sources but define _MIP_SIM differently
+        // to change the behavior.
+        //   mips uses o32 abi (_MIPS_SIM == _ABIO32).
+        //   mips64 uses n64 abi (_MIPS_SIM == _ABI64).
+        mips64: {
+            srcs: [
+                "src/mips/is_fpreg.c",
+                "src/mips/regname.c",
+                "src/mips/Gcreate_addr_space.c",
+                "src/mips/Gget_proc_info.c",
+                "src/mips/Gget_save_loc.c",
+                "src/mips/Gglobal.c",
+                "src/mips/Ginit.c",
+                "src/mips/Ginit_local.c",
+                "src/mips/Ginit_remote.c",
+                "src/mips/Gregs.c",
+                "src/mips/Gresume.c",
+                "src/mips/Gstep.c",
+                "src/mips/Lcreate_addr_space.c",
+                "src/mips/Lget_proc_info.c",
+                "src/mips/Lget_save_loc.c",
+                "src/mips/Lglobal.c",
+                "src/mips/Linit.c",
+                "src/mips/Linit_local.c",
+                "src/mips/Linit_remote.c",
+                "src/mips/Lregs.c",
+                "src/mips/Lresume.c",
+                "src/mips/Lstep.c",
+
+                "src/mips/getcontext-android.S",
+                "src/mips/Gis_signal_frame.c",
+                "src/mips/Lis_signal_frame.c",
+            ],
+        },
+        x86: {
+            srcs: [
+                "src/x86/is_fpreg.c",
+                "src/x86/regname.c",
+                "src/x86/Gcreate_addr_space.c",
+                "src/x86/Gget_proc_info.c",
+                "src/x86/Gget_save_loc.c",
+                "src/x86/Gglobal.c",
+                "src/x86/Ginit.c",
+                "src/x86/Ginit_local.c",
+                "src/x86/Ginit_remote.c",
+                "src/x86/Gregs.c",
+                "src/x86/Gresume.c",
+                "src/x86/Gstep.c",
+                "src/x86/Lcreate_addr_space.c",
+                "src/x86/Lget_proc_info.c",
+                "src/x86/Lget_save_loc.c",
+                "src/x86/Lglobal.c",
+                "src/x86/Linit.c",
+                "src/x86/Linit_local.c",
+                "src/x86/Linit_remote.c",
+                "src/x86/Lregs.c",
+                "src/x86/Lresume.c",
+                "src/x86/Lstep.c",
+
+                "src/x86/getcontext-linux.S",
+                "src/x86/Gos-linux.c",
+                "src/x86/Los-linux.c",
+            ],
+        },
+        x86_64: {
+            srcs: [
+                "src/x86_64/is_fpreg.c",
+                "src/x86_64/regname.c",
+                "src/x86_64/Gcreate_addr_space.c",
+                "src/x86_64/Gget_proc_info.c",
+                "src/x86_64/Gget_save_loc.c",
+                "src/x86_64/Gglobal.c",
+                "src/x86_64/Ginit.c",
+                "src/x86_64/Ginit_local.c",
+                "src/x86_64/Ginit_remote.c",
+                "src/x86_64/Gregs.c",
+                "src/x86_64/Gresume.c",
+                "src/x86_64/Gstep.c",
+                "src/x86_64/Lcreate_addr_space.c",
+                "src/x86_64/Lget_proc_info.c",
+                "src/x86_64/Lget_save_loc.c",
+                "src/x86_64/Lglobal.c",
+                "src/x86_64/Linit.c",
+                "src/x86_64/Linit_local.c",
+                "src/x86_64/Linit_remote.c",
+                "src/x86_64/Lregs.c",
+                "src/x86_64/Lresume.c",
+                "src/x86_64/Lstep.c",
+
+                "src/x86_64/getcontext.S",
+                "src/x86_64/Gstash_frame.c",
+                "src/x86_64/Gtrace.c",
+                "src/x86_64/Gos-linux.c",
+                "src/x86_64/Lstash_frame.c",
+                "src/x86_64/Ltrace.c",
+                "src/x86_64/Los-linux.c",
+                "src/x86_64/setcontext.S",
+            ],
+        },
+    },
+
+    multilib: {
+        lib32: {
+            srcs: ["src/elf32.c"],
+        },
+        lib64: {
+            srcs: ["src/elf64.c"],
+        },
+    },
+
+    target: {
+        android: {
+            shared_libs: ["libdl"],
+        },
+        host: {
+            ldflags: ["-nostdlib"],
+            host_ldlibs: [
+                "-lc",
+                "-lpthread",
+            ],
+        },
+    },
+
+    export_include_dirs: ["include"],
+
+    shared_libs: ["liblzma"],
+
+    debug: {
+        //shared_libs: ["liblog"],
+    },
+}
+
+//-----------------------------------------------------------------------
+// libunwindbacktrace static library
+//-----------------------------------------------------------------------
+cc_library_static {
+    name: "libunwindbacktrace",
+    defaults: ["libunwind_defaults"],
+    sdk_version: "21",
+    srcs: [
+        "src/unwind/BacktraceWrapper.c",
+        "src/unwind/DeleteException.c",
+        "src/unwind/FindEnclosingFunction.c",
+        "src/unwind/ForcedUnwind.c",
+        "src/unwind/GetBSP.c",
+        "src/unwind/GetCFA.c",
+        "src/unwind/GetDataRelBase.c",
+        "src/unwind/GetGR.c",
+        "src/unwind/GetIP.c",
+        "src/unwind/GetIPInfo.c",
+        "src/unwind/GetLanguageSpecificData.c",
+        "src/unwind/GetRegionStart.c",
+        "src/unwind/GetTextRelBase.c",
+        "src/unwind/RaiseException.c",
+        "src/unwind/Resume.c",
+        "src/unwind/Resume_or_Rethrow.c",
+        "src/unwind/SetGR.c",
+        "src/unwind/SetIP.c",
+    ],
+
+    cflags: [
+        "-Wno-old-style-declaration",
+        "-fvisibility=hidden",
+    ],
+
+    whole_static_libs: ["libunwind"],
+}
+
+//-----------------------------------------------------------------------
+// libunwind testing
+//-----------------------------------------------------------------------
+cc_test {
+    name: "libunwind-unit-tests",
+    srcs: ["android/tests/local_test.cpp"],
+    defaults: ["libunwind_defaults"],
+
+    cflags: [
+        "-fno-builtin",
+        "-O0",
+        "-g",
+    ],
+
+    local_include_dirs: ["include"],
+    shared_libs: ["libunwind"],
+}
+
+/*
+// Run the unit tests built for x86 or x86_64.
+// ANDROIDMK TRANSLATION ERROR: unsupported conditional
+// ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64))
+// ANDROIDMK TRANSLATION ERROR: unsupported conditional
+// ifneq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86))
+LINKER = ["linker64"]
+TEST_SUFFIX = ["64"]
+// ANDROIDMK TRANSLATION ERROR: else from unsupported contitional
+// else
+LINKER = ["linker"]
+TEST_SUFFIX = ["32"]
+// ANDROIDMK TRANSLATION ERROR: endif from unsupported contitional
+// endif
+
+// ANDROIDMK TRANSLATION ERROR: endif from unsupported contitional
+// endif
+*/
diff --git a/libunwind/COPYING b/libunwind/COPYING
new file mode 100644
index 0000000..41e7d8a
--- /dev/null
+++ b/libunwind/COPYING
@@ -0,0 +1,20 @@
+Copyright (c) 2002 Hewlett-Packard Co.
+
+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.
diff --git a/libunwind/ChangeLog b/libunwind/ChangeLog
new file mode 100644
index 0000000..dfa24b9
--- /dev/null
+++ b/libunwind/ChangeLog
@@ -0,0 +1,55 @@
+***********************************************************
+
+ Discontinued.  See git log instead at
+
+   http://www.kernel.org/git/gitweb.cgi?p=libs/libunwind/libunwind.git;a=log
+
+***********************************************************
+
+2002-11-08  David Mosberger-Tang  <David.Mosberger@acm.org>
+
+	* src/ia64/unwind_i.h (ia64_getfp): Change from macro to inline
+	function.  Check "loc" argument for being NULL before dereferencing it.
+	(ia64_putfp): Ditto.
+	(ia64_get): Ditto.
+	(ia64_put): Ditto.
+
+2002-01-18  David Mosberger-Tang  <David.Mosberger@acm.org>
+
+	* src/ia64/parser.c (__ia64_unw_create_state_record): Set
+	IA64_FLAG_HAS_HANDLER if the unwind info descriptors indicate that
+	there a handler.
+
+	* src/ia64/regs.c (__ia64_access_reg): Return zero for UNW_REG_HANDLER
+	in frames that don't have a personality routine.
+
+	* src/ia64/unwind_i.h (IA64_FLAG_HAS_HANDLER): New flag.
+
+	* src/ia64/regs.c (__ia64_access_reg): When reading UNW_REG_HANDLER,
+	account for the fact that the personality address is gp-relative.
+
+	* src/ia64/parser.c (__ia64_unw_create_state_record): Fix
+	initialization of segbase and len.
+
+2002-01-17  David Mosberger-Tang  <David.Mosberger@acm.org>
+
+	* include/unwind-ia64.h: Include via "unwind.h" to ensure
+	the file is picked up from same directory.
+
+2002-01-16  David Mosberger-Tang  <David.Mosberger@acm.org>
+
+	* include/unwind.h: Define UNW_ESTOPUNWIND.  This error code may
+	be returned by acquire_unwind_info() to force termination of
+	unwinding.  An application may want to do this when encountering a
+	call frame for dynamically generated code, for example.
+
+	* unwind.h: Pass opaque argument pointer to acquire_unwind_info()
+	and release_unwind_info() like we do for access_mem() etc.
+
+2002-01-14  David Mosberger-Tang  <David.Mosberger@acm.org>
+
+	* Version 0.0 released.
+
+2002-01-11  David Mosberger-Tang  <David.Mosberger@acm.org>
+
+	* ChangeLog created.
diff --git a/libunwind/LICENSE b/libunwind/LICENSE
new file mode 100644
index 0000000..c9b44cb
--- /dev/null
+++ b/libunwind/LICENSE
@@ -0,0 +1,18 @@
+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.
diff --git a/libunwind/MODULE_LICENSE_MIT b/libunwind/MODULE_LICENSE_MIT
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/libunwind/MODULE_LICENSE_MIT
diff --git a/libunwind/Makefile.am b/libunwind/Makefile.am
new file mode 100644
index 0000000..e24fe1e
--- /dev/null
+++ b/libunwind/Makefile.am
@@ -0,0 +1,86 @@
+include_HEADERS = include/libunwind-dynamic.h \
+    include/libunwind-ptrace.h \
+    include/libunwind-coredump.h
+
+if ARCH_AARCH64
+include_HEADERS += include/libunwind-aarch64.h
+endif
+if ARCH_ARM
+include_HEADERS += include/libunwind-arm.h
+endif
+if ARCH_IA64
+include_HEADERS += include/libunwind-ia64.h
+endif
+if ARCH_HPPA
+include_HEADERS += include/libunwind-hppa.h
+endif
+if ARCH_MIPS
+include_HEADERS += include/libunwind-mips.h
+endif
+if ARCH_X86
+include_HEADERS += include/libunwind-x86.h
+endif
+if ARCH_X86_64
+include_HEADERS += include/libunwind-x86_64.h
+endif
+if ARCH_PPC32
+include_HEADERS += include/libunwind-ppc32.h
+endif
+if ARCH_PPC64
+include_HEADERS += include/libunwind-ppc64.h
+endif
+if ARCH_SH
+include_HEADERS += include/libunwind-sh.h
+endif
+
+if !REMOTE_ONLY
+include_HEADERS += include/libunwind.h include/unwind.h
+endif
+
+nodist_include_HEADERS = include/libunwind-common.h
+
+SUBDIRS = src tests doc
+
+noinst_HEADERS = include/dwarf.h include/dwarf_i.h include/dwarf-eh.h	\
+	include/compiler.h include/libunwind_i.h include/mempool.h	\
+	include/remote.h						\
+	include/tdep-aarch64/dwarf-config.h				\
+	include/tdep-aarch64/jmpbuf.h					\
+	include/tdep-aarch64/libunwind_i.h				\
+	include/tdep-arm/dwarf-config.h	include/tdep-arm/ex_tables.h	\
+	include/tdep-arm/jmpbuf.h include/tdep-arm/libunwind_i.h	\
+	include/tdep-ia64/jmpbuf.h include/tdep-ia64/rse.h 		\
+	include/tdep-ia64/libunwind_i.h	include/tdep-ia64/script.h	\
+	include/tdep-hppa/libunwind_i.h					\
+	include/tdep-hppa/jmpbuf.h include/tdep-hppa/dwarf-config.h	\
+	include/tdep-mips/libunwind_i.h					\
+	include/tdep-mips/jmpbuf.h include/tdep-mips/dwarf-config.h	\
+	include/tdep-x86/libunwind_i.h					\
+	include/tdep-x86/jmpbuf.h include/tdep-x86/dwarf-config.h	\
+	include/tdep-x86_64/libunwind_i.h				\
+	include/tdep-x86_64/jmpbuf.h include/tdep-x86_64/dwarf-config.h \
+	include/tdep-ppc32/dwarf-config.h				\
+	include/tdep-ppc32/jmpbuf.h include/tdep-ppc32/libunwind_i.h	\
+	include/tdep-ppc64/dwarf-config.h				\
+	include/tdep-ppc64/jmpbuf.h include/tdep-ppc64/libunwind_i.h	\
+	include/tdep-sh/dwarf-config.h					\
+	include/tdep-sh/jmpbuf.h include/tdep-sh/libunwind_i.h		\
+	include/tdep/libunwind_i.h					\
+	include/tdep/jmpbuf.h include/tdep/dwarf-config.h
+
+EXTRA_DIST = include/libunwind-common.h.in
+
+MAINTAINERCLEANFILES = \
+	Makefile.in \
+	INSTALL \
+	aclocal.m4 \
+	configure \
+	config/compile \
+	config/config.guess \
+	config/config.sub \
+	config/depcomp \
+	config/install-sh \
+	config/ltmain.sh \
+	config/missing \
+	include/config.h.in \
+	include/config.h.in~
diff --git a/libunwind/NEWS b/libunwind/NEWS
new file mode 100644
index 0000000..e26d1c9
--- /dev/null
+++ b/libunwind/NEWS
@@ -0,0 +1,229 @@
+-*-Mode: outline-*-
+
+* News for v1.1:
+
+** coredump unwind support
+** New arch: SuperH
+** Improved support for PowerPC, ARM
+** Lots of cleanups, perf tweaks
+** pkg-config support
+
+* News for v1.0:
+
+** Fast unwind (rbp, rsp, rip only) on x86_64 with a fallback to 
+   slow code path (Lassi Tuura)
+** Improved local and remote unwinding on ARM (Ken Werner)
+** Testing, stability and many fixes on x86 (Paul Pluzhnikov)
+** FreeBSD port and clean separation of OS specific bits 
+   (Konstantin Belousov)
+** Thanks for all the bug reports, contributions and testing!
+
+* News for v0.99:
+
+** Greatly improved x86-64 support thanks to Arun Sharma.
+** Support for PPC64 added by  Jose Flavio Aguilar Paulino.
+
+* News for v0.98.6:
+
+** Fix address-leak triggered by invalid byte-order.  Fixed by Andreas Schwab.
+** On ia64, get_static_proc_name() no longer uses a weak reference to
+   _Uelf64_get_proc_name(), since that was causing problems with archive
+   libraries and no longer served any apparent purpose.  Fixed by
+   Curt Wohlgemuth.
+
+* News for v0.98.5:
+
+** Fix a typo in the man-page of unw_create_addr_space().
+** Fix an off-by-1 bug in the handling of the dynamic ALIAS directive
+   for ia64.  Reported by Todd L. Miller.
+** Fix a bug in libunwind-ptrace which could cause crash due to extraneous
+   munmap() calls.
+
+* News for v0.98.4:
+
+** Fix a typo in _ReadSLEB.c which caused hangs when throwing exceptions
+   from Intel ICC-compiled programs.  Reported by Tommy Hoffner.
+
+* News for v0.98.3:
+
+** Make it possible to link against libunwind-ia64.a only (i.e., without
+   requiring libunwind.a as well).  This keeps apps which need only
+   remote unwinding cleaner, since they logically have no dependency
+   on libunwind.a.
+** Dont link against libatomic_ops for now.  Due to a packaging bug on
+   Debian, linking against this library causes libunwind.so to get
+   a dependency on libatomic_ops.so, which is not at all what we want.
+   Fortunately, we don't have to link against that library on x86 or
+   ia64 since the library is strictly needed only for platforms with
+   poor atomic operation support.  Once the libatomic_ops package is fixed,
+   we can re-enable linking against libatomic_ops.
+
+* News for v0.98.2:
+
+** Fixed bug which caused _UPT_get_dyn_info_list_addr() to sometimes fail
+   needlessly.  Found by Todd L. Miller.
+
+** When using GCC to build libunwind on ia64, libunwind.so had an
+   unresolved reference to __divdi3.  This is undesirable since it
+   creates an implicit dependency on libgcc.  This problem has been
+   fixed in the 0.98.2 release by explicitly linking against libgcc.a
+   when building libunwind.
+
+* News for v0.98.1:
+
+** Fixed a bug which caused "make install" to install libunwind-common.h.in
+   instead of libunwind-common.h.
+** Fixed a bug in the ia64 {sig,}longjmp() which showed on
+   SuSE Linux 9 because it's using a newer compiler & the EPC-based system
+   call stubs.
+** Fixed incorrect offsets in tests/ia64-test-nat-asm.S.
+   Warning: you'll need a GNU assembler dated later than 21-Sep-2004 to
+   get this file translated correctly.  With an old assembler, "make check"
+   will get lots of failures when running Gia64-test-nat or Lia64-test-nat!
+** Convert tests/bt into a full-blown test-case.  It's designed to
+   trigger a (rarely-encountered) bug in the GNU assembler on ia64.
+   The assembler has been fixed and once the libraries (libc etc)
+   have been rebuilt, this test will pass.
+** Added test-case tests/run-ptrace-misc which, on ia64, triggers a bug in
+   current GCC (including v3.4.2) which causes bad unwind info.
+
+* News for v0.98:
+
+** Update libunwind to be compliant with the updated/expanded
+   ia64 unwind specificiation by HJ Lu [1].  This is needed for
+   GCC 3.4 compatibility.
+
+   [1] http://www.kernel.org/pub/linux/devel/gcc/unwind/
+
+** Initial support for x86-64 has been added courtesy of Max Asbock.
+   Along with this came a bunch of DWARF2 unwinder fixes.
+
+** A new rountine unw_strerror() has been added courtesy of
+   Thomas Hallgren.
+
+** Including <libunwind.h> now defines 4 macros that can be used
+   to determine the version number of libunwind.  Specifically,
+   UNW_VERSION_MAJOR, UNW_VERSION_MINOR, UNW_VERSION, and
+   UNW_VERSION_CODE are defined by the header now.
+
+** Bug fixes
+*** Fix a memory-leak in _UPT_get_dyn_info_list_addr() courtesy of Ed Connell.
+*** Fix a crash in libunwind-ptrace courtesy of Mark Young.
+*** Fix a bug in ia64-version of unw_init_remote() which prevented
+    it from working correctly for the local address space.  Reported by
+    Troy Heber.
+*** Many other small and not so small fixes.
+
+* News for v0.97:
+
+** unw_get_proc_name() may now be called from signal-handler.
+
+** The ptrace-helper routines are now declared in libunwind-ptrace.h.
+   Applications which use ptrace-based unwinding should include
+   <libunwind-ptrace.h> to get the _UPT_*() routines declared.
+
+** libunwind has been split into a "local-only" and a "generic" versions.
+   The former is optimized for local unwinding (within a process) and
+   is called libunwind.so (shared version) or libunwind.a (archive
+   version).  The generic version is not limited to unwinding within a
+   process and is called libunwind-generic.so (shared version)
+   libunwind-generic.a (archive version).  Similarly, the ptrace()
+   support has been separated out into a convenience library called
+   libunwind-ptrace.a.  For the most part, backwards-compatibility
+   is retained.  However, when building an application which uses
+   libunwind, it may be necessary to change the linker command-line
+   as shown in the table below:
+
+    Application which does: Before v0.97:  With v0.97:
+    ----------------------- -------------  -----------
+    local unwinding only:   -lunwind       -lunwind
+    remote unwinding:       -lunwind       -lunwind-generic
+    cross unwinding:        -lunwind-PLAT  -lunwind-PLAT
+    ptrace-based unwinding: -lunwind       -lunwind-ptrace -lunwind-generic
+
+   The motivation for this splitting is to keep libunwind.so as minimal
+   as possible.  This library will eventually be loaded by most (if not
+   all) executables and hence it is important to ensure that it can
+   be loaded as quickly as possible.
+
+** unw_getcontext() tuned on IA-64.
+
+   The unw_getcontext() routine used to be provided by (GNU) libc
+   (getcontext()).  This caused unnecessary overhead (e.g., an
+   unnecessary system-call to sigprocmask()).  The new
+   unw_getcontext() only does the work really needed for libunwind and
+   hence performs much better.  However, this change implies that
+   programs linked against libunwind v0.97 won't be
+   backwards-compatible with earlier versions (there would be an
+   unresolved symbol for _Uia64_getcontext()).
+
+** Fix NaT-bit handling on IA-64.
+
+   New test-cases have been added to test the handling of the NaT bit
+   (and floating-point NaT values) and all discovered/known bugs have
+   been fixed.
+
+** Initial DWARF-based unwinder for x86.
+
+   There is a beginning for a DWARF-based unwinder for x86.  Work for
+   x86-64-support based on this DWARF unwinder is currently underway
+   at IBM and it is expected that this support will be merged into the
+   official tree soon.
+
+
+* News for v0.96:
+
+** _Unwind_*() routines defined by the C++ ABI are now included in
+   libunwind.
+
+
+* News for v0.95:
+
+** Bigger, better, faster, or so the theory goes.
+
+
+* News for v0.93:
+
+** More bug-fixes & improved HP-UX support.
+
+
+* News for v0.92:
+
+** Bug-fix release.  IA-64 unwinder can now be built with Intel compiler (ECC).
+
+
+* News for v0.91:
+
+** Lots of documentation updates
+** Some portability fixes.
+
+
+* News for v0.9:
+
+** The libunwind API is mostly feature-complete at this point (hence the
+   version jump from v0.2 to v0.9).
+
+
+* News for v0.2:
+
+** Automated configuration/build with autoconf and automake.
+** Added support for building libunwind as a shared library.
+** Added support for remote unwinding.
+** Added support for cross-building.
+** Added two new routines to the API:
+	- unw_is_fpreg()
+	- unw_get_save_loc()
+** Added multi-architecture supports (lets a single application use
+   the unwind libraries for multiple target architectures; this is useful,
+   e.g., useful for building a debugger that can support multiple targets
+   such as x86, ia64, etc.)
+
+
+* News for v0.1:
+
+** Added support for exception handling.
+
+
+* News for v0.0:
+
+** It's a brand new package.
diff --git a/libunwind/NOTICE b/libunwind/NOTICE
new file mode 100644
index 0000000..c9b44cb
--- /dev/null
+++ b/libunwind/NOTICE
@@ -0,0 +1,18 @@
+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.
diff --git a/libunwind/README b/libunwind/README
new file mode 100644
index 0000000..511fb0c
--- /dev/null
+++ b/libunwind/README
@@ -0,0 +1,214 @@
+-*- mode: Outline -*-
+
+This is version 1.0 of the unwind library.  This library supports
+several architecture/operating-system combinations:
+
+ Linux/x86-64:	Works well.
+ Linux/x86:	Works well.
+ Linux/ARM:	Works well.
+ Linux/IA-64:	Fully tested and supported.
+ Linux/PARISC:	Works well, but C library missing unwind-info.
+ HP-UX/IA-64:	Mostly works but known to have some serious limitations.
+ Linux/AArch64:	Newly added.
+ Linux/PPC64:	Newly added.
+ Linux/SuperH:	Newly added.
+ FreeBSD/i386:	Newly added.
+ FreeBSD/x86-64: Newly added (FreeBSD architecture is known as amd64).
+
+
+* General Build Instructions
+
+In general, this library can be built and installed with the following
+commands:
+
+	$ autoreconf -i # Needed only for building from git. Depends on libtool.
+	$ ./configure
+	$ make
+	$ make install prefix=PREFIX
+
+where PREFIX is the installation prefix.  By default, a prefix of
+/usr/local is used, such that libunwind.a is installed in
+/usr/local/lib and unwind.h is installed in /usr/local/include.  For
+testing, you may want to use a prefix of /usr/local instead.
+
+
+* Building with Intel compiler
+
+** Version 8 and later
+
+Starting with version 8, the preferred name for the IA-64 Intel
+compiler is "icc" (same name as on x86).  Thus, the configure-line
+should look like this:
+
+    $ ./configure CC=icc CFLAGS="-g -O3 -ip" CXX=icc CCAS=gcc CCASFLAGS=-g \
+		LDFLAGS="-L$PWD/src/.libs"
+
+
+* Building on HP-UX
+
+For the time being, libunwind must be built with GCC on HP-UX.
+
+libunwind should be configured and installed on HP-UX like this:
+
+    $ ./configure CFLAGS="-g -O2 -mlp64" CXXFLAGS="-g -O2 -mlp64"
+
+Caveat: Unwinding of 32-bit (ILP32) binaries is not supported
+	at the moment.
+
+** Workaround for older versions of GCC
+
+GCC v3.0 and GCC v3.2 ship with a bad version of sys/types.h.  The
+workaround is to issue the following commands before running
+"configure":
+
+    $ mkdir $top_dir/include/sys
+    $ cp /usr/include/sys/types.h $top_dir/include/sys
+
+GCC v3.3.2 or later have been fixed and do not require this
+workaround.
+
+* Building for PowerPC64 / Linux
+
+For building for power64 you should use:
+
+  $ ./configure CFLAGS="-g -O2 -m64" CXXFLAGS="-g -O2 -m64"
+
+If your power support altivec registers:
+  $ ./configure CFLAGS="-g -O2 -m64 -maltivec" CXXFLAGS="-g -O2 -m64 -maltivec"
+
+To check if your processor has support for vector registers (altivec):
+    cat /proc/cpuinfo | grep altivec
+and should have something like this:
+    cpu             : PPC970, altivec supported
+
+If libunwind seems to not work (backtracing failing), try to compile
+it with -O0, without optimizations. There are some compiler problems
+depending on the version of your gcc.
+
+* Building on FreeBSD
+
+General building instructions apply. To build and execute several tests,
+you need libexecinfo library available in ports as devel/libexecinfo.
+
+Development of the port was done of FreeBSD 8.0-STABLE. The library
+was build with the system compiler that is modified version of gcc 4.2.1,
+as well as the gcc 4.4.3.
+
+* Regression Testing
+
+After building the library, you can run a set of regression tests with:
+
+	$ make check
+
+** Expected results on IA-64 Linux
+
+Unless you have a very recent C library and compiler installed, it is
+currently expected to have the following tests fail on IA-64 Linux:
+
+	Gtest-init		(should pass starting with glibc-2.3.x/gcc-3.4)
+	Ltest-init		(should pass starting with glibc-2.3.x/gcc-3.4)
+	test-ptrace		(should pass starting with glibc-2.3.x/gcc-3.4)
+	run-ia64-test-dyn1	(should pass starting with glibc-2.3.x)
+
+This does not mean that libunwind cannot be used with older compilers
+or C libraries, it just means that for certain corner cases, unwinding
+will fail.  Since they're corner cases, it is not likely for
+applications to trigger them.
+
+Note: If you get lots of errors in Gia64-test-nat and Lia64-test-nat, it's
+      almost certainly a sign of an old assembler.  The GNU assembler used
+      to encode previous-stack-pointer-relative offsets incorrectly.
+      This bug was fixed on 21-Sep-2004 so any later assembler will be
+      fine.
+
+** Expected results on x86 Linux
+
+The following tests are expected to fail on x86 Linux:
+
+	Gtest-resume-sig	(fails to get SIGUSR2)
+	Ltest-resume-sig	(likewise)
+	Gtest-dyn1		(no dynamic unwind info support yet)
+	Ltest-dyn1		(no dynamic unwind info support yet)
+	test-setjmp		(longjmp() not implemented yet)
+	run-check-namespace	(no _Ux86_getcontext yet)
+	test-ptrace
+
+** Expected results on x86-64 Linux
+
+The following tests are expected to fail on x86-64 Linux:
+
+	Gtest-dyn1		(no dynamic unwind info support yet)
+	Ltest-dyn1		(no dynamic unwind info support yet)
+	Gtest-init (see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18743)
+	Ltest-init		(likewise)
+	test-async-sig		(crashes due to bad unwind-info?)
+	test-setjmp		(longjmp() not implemented yet)
+	run-check-namespace	(no _Ux86_64_getcontext yet)
+	run-ptrace-mapper	(??? investigate)
+	run-ptrace-misc	(see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18748
+			 and http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18749)
+
+** Expected results on PARISC Linux
+
+Caveat: GCC v3.4 or newer is needed on PA-RISC Linux.  Earlier
+versions of the compiler failed to generate the exception-handling
+program header (GNU_EH_FRAME) needed for unwinding.
+
+The following tests are expected to fail on x86-64 Linux:
+
+	Gtest-bt   (backtrace truncated at kill() due to lack of unwind-info)
+	Ltest-bt   (likewise)
+	Gtest-resume-sig  (Gresume.c:my_rt_sigreturn() is wrong somehow)
+	Ltest-resume-sig  (likewise)
+	Gtest-init (likewise)
+	Ltest-init (likewise)
+	Gtest-dyn1 (no dynamic unwind info support yet)
+	Ltest-dyn1 (no dynamic unwind info support yet)
+	test-setjmp		(longjmp() not implemented yet)
+	run-check-namespace	(toolchain doesn't support HIDDEN yet)
+
+** Expected results on HP-UX
+
+"make check" is currently unsupported for HP-UX.  You can try to run
+it, but most tests will fail (and some may fail to terminate).  The
+only test programs that are known to work at this time are:
+
+     tests/bt
+     tests/Gperf-simple
+     tests/test-proc-info
+     tests/test-static-link
+     tests/Gtest-init
+     tests/Ltest-init
+     tests/Gtest-resume-sig
+     tests/Ltest-resume-sig
+
+** Expected results on PPC64 Linux
+
+"make check" should run with no more than 10 out of 24 tests failed.
+
+
+* Performance Testing
+
+This distribution includes a few simple performance tests which give
+some idea of the basic cost of various libunwind operations.  After
+building the library, you can run these tests with the following
+commands:
+
+ $ cd tests
+ $ make perf
+
+* Contacting the Developers
+
+Please direct all questions regarding this library to:
+
+	libunwind-devel@nongnu.org
+
+You can do this by sending a mail to libunwind-request@nongnu.org with
+a body of:
+
+	subscribe libunwind-devel
+
+or you can subscribe and manage your subscription via the
+web-interface at:
+
+	https://savannah.nongnu.org/mail/?group=libunwind
diff --git a/libunwind/TODO b/libunwind/TODO
new file mode 100644
index 0000000..8b2e026
--- /dev/null
+++ b/libunwind/TODO
@@ -0,0 +1,97 @@
+- Update the libunwind man page for the new/fixed cache-flushing behavior.
+  Effectively, that unw_flush_cache() doesn't have to be called by
+  applications except for extraordinary circumstances (e.g., if application
+  implements its own runtime loader).
+- document split local-only/generic libraries and separate libunwind-ptrace.a
+  convenience-library
+- document new "tdep" member in unw_proc_info_t structure
+- for DWARF 2, use a dummy CIE entry with an augmentation that
+  provides the dyn-info-list-address
+
+=== taken care of:
+
+Testing:
+	+ ensure that saving r4-r7 in a stacked register properly preserves
+	  the NaT bit, even in the face of register-rotation
+	+ ensure that IA64_INSN_MOVE_STACKED works correctly in the face of
+	  register rotation
+	+ on Linux, test access to f32-f127 in a signal handler (e.g., verify
+	  that fph partition gets initialized properly)
++ According to Nicholas S. Wourms <nwourms@netscape.net>, adding this to the
+  Makefile.am:
+	AUTOMAKE_OPTIONS = 1.6 subdir-objects
+  ensures that object-files are build in separate subdirectories and that
+  in turn makes it possible for source files in different directories to
+  have the same filename, thus avoiding the need for those ugly -x86, -ia64,
+  etc., postfixes.
++ Switch ia64 (and rest over) to using Debug() instead of debug()
++ implement non-local versions of dwarf_readXX()
++ consolidate mostly architecture-independent code such as
+  unw_get_accessors() into shared files
++ caching is pretty fundamentally broken, what should happen is this:
+   o On unw_init_local()/unw_init_remote(), libunwind should validate
+     that the cached information is still valid and, if not, flush the
+     cache on its own.  Rationale: once unw_init_local() has been
+     called, it is clear that the unwind info for the calling thread
+     cannot change (otherwise the program would be buggy anyhow) and
+     hence it is sufficient to validate the cache at this point.
+     Similarly, once unw_init_remote() has been called, the target
+     address space must have been stopped, because the unwinding would
+     otherwise be unreliable anyhow.
+   o glibc currently lacks a feature for dl_iterate_phdr() to support
+     safe caching; I proposed on 12/16/2003 that glibc maintain two
+     atomic counters which get inremented whenever something is added
+     to/removed from the dl_iterate_phdr-list.  Once we have such counters,
+     we can use them in libunwind to implement an efficient version of a
+     cache-validation routine.
+   Once this has been fixed, update the libunwind man page accordingly.
+   Effectively, what this means is that unw_flush_cache() doesn't have
+   to be called by applications except for extraordinary circumstances
+   (e.g., if application implements its own runtime loader).
++ man-page for unw_is_fpreg()
++ man-page for _U_dyn_cancel()
++ man-page for _U_dyn_register()
++ global data is not protected by a lock; causes problems if two threads
+  call ia64_init() at almost the same time
++ cache the value of *cfm_loc; each rotate_FOO() call needs it!
++ implement the remote-lookup of the dynamic registration list
++ when doing sigreturn, must restore fp regs (and perhaps other regs) the same
+  way as the (user-level) gate.S sigreturn path does!
++ unw_resume() must at least restore gp (r1)!  consider restoring all
+  scratch regs (but what's the performance impact on exception handling?);
+  alternative: restore scratch regs that may be used during procedure
+  call/return (e.g., r8-r11, f8-f11)
++ implement unw_resume() for the case where the current register frame is split
+  across multiple backing stores
++ document restricions on using unw_resume():
++ implement remote cases of unw_resume()
++ test both with UNW_LOCAL_ONLY and without where this makes sense
++ allow region-length (insn_count) in unw_dyn_region_info_t to be negative
+  to indicate counting from the end of the procedure (to make it possible
+  for differently-sized procedures to share the same region list if they
+  share the same prologue/epilogue).
++ it appears that it is currently not possible to read register UNW_IA64_TP;
+  fix that => no, attempts to access r13 will result in access_reg() callbacks,
+  as desired; for local-case, access to r13 will fail though (since
+  getcontext() doesn't, and shouldn't, capture r13)
++ document the special nature of UNW_IA64_GP: read-only, but adjusted
+  automatically if the IP is changed
++ use pthread-mutexes where necessary, atomic ops where possible
++ man-page for unw_init_local()
++ man-page for unw_init_remote()
++ man-page for unw_create_addr_space()
++ man-page for unw_destroy_addr_space()
++ man-page for unw_get_proc_info()
++ man-page for unw_get_proc_name()
++ man-page for unw_get_accessors()
++ man-page for unw_regname()
++ man-page for unw_flush_cache()
++ man-page for unw_set_caching_policy()
++ man-page for unw_getcontext()
++ man-page for unw_is_signal_frame()
++ man-page for unw_step()
++ man-page for unw_get_reg()
++ man-page for unw_set_reg()
++ man-page for unw_get_fpreg()
++ man-page for unw_set_fpreg()
++ test with Intel compiler
diff --git a/libunwind/acinclude.m4 b/libunwind/acinclude.m4
new file mode 100644
index 0000000..b536a1f
--- /dev/null
+++ b/libunwind/acinclude.m4
@@ -0,0 +1,57 @@
+AC_DEFUN([LIBUNWIND___THREAD],
+[dnl Check whether the compiler supports the __thread keyword.
+if test "x$enable___thread" != xno; then
+  AC_CACHE_CHECK([for __thread], libc_cv_gcc___thread,
+		 [cat > conftest.c <<\EOF
+    __thread int a = 42;
+EOF
+  if AC_TRY_COMMAND([${CC-cc} $CFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
+    libc_cv_gcc___thread=yes
+  else
+    libc_cv_gcc___thread=no
+  fi
+  rm -f conftest*])
+  if test "$libc_cv_gcc___thread" = yes; then
+    AC_DEFINE(HAVE___THREAD, 1,
+	[Define to 1 if __thread keyword is supported by the C compiler.])
+  fi
+else
+  libc_cv_gcc___thread=no
+fi])
+
+AC_DEFUN([CHECK_ATOMIC_OPS],
+[dnl Check whether the system has the atomic_ops package installed.
+  AC_CHECK_HEADERS(atomic_ops.h)
+#
+# Don't link against libatomic_ops for now.  We don't want libunwind
+# to depend on libatomic_ops.so.  Fortunately, none of the platforms
+# we care about so far need libatomic_ops.a (everything is done via
+# inline macros).
+#
+#  AC_CHECK_LIB(atomic_ops, main)
+])
+
+# ANDROID support update.
+AC_DEFUN([CHECK_ANDROID],
+[dnl Check whether the system has __ANDROID__ defined.
+if test "x$enable_conserve_stack" != xno; then
+  AC_CACHE_CHECK([for __ANDROID__], ac_cv_android,
+         [cat > conftest.c <<\EOF
+  #if !defined(__ANDROID__)
+    value = fail
+  #endif
+EOF
+  if AC_TRY_COMMAND([${CC-cc} $CFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
+    ac_cv_android=yes
+  else
+    ac_cv_android=no
+  fi
+  rm -f conftest*])
+  if test "$ac_cv_android" = yes; then
+    AC_DEFINE([CONSERVE_STACK], [],
+              [Allocate large structures rather than place them on the stack.])
+  fi
+else
+  ac_cv_android=no
+fi])
+# End of ANDROID update.
diff --git a/libunwind/android/README b/libunwind/android/README
new file mode 100644
index 0000000..105304a
--- /dev/null
+++ b/libunwind/android/README
@@ -0,0 +1,26 @@
+This version of libunwind based on libunwind 1.1.
+
+--------------------------------------------------------------------------
+To configure a libunwind install for arm:
+
+source build/envsetup.sh
+lunch aosp_arm-eng
+make -jXX
+cd external/libuwnind
+android/conf_arm.sh
+
+To configure a libunwind install for mips:
+
+source build/envsetup.sh
+lunch aosp_mips-eng
+make -jXX
+cd external/libuwnind
+android/conf_mips.sh
+
+To configure a libunwind install for x86:
+
+source build/envsetup.sh
+lunch aosp_x86-eng
+make -jXX
+cd external/libuwnind
+android/conf_x86.sh
diff --git a/libunwind/android/conf_arm.sh b/libunwind/android/conf_arm.sh
new file mode 100755
index 0000000..cab3175
--- /dev/null
+++ b/libunwind/android/conf_arm.sh
@@ -0,0 +1,66 @@
+#!/bin/bash
+
+if [[ "$OUT" == "" ]]; then
+  echo "In order for this script to function, please choose an arm target"
+  echo "using source build/envsetup.sh and lunch XXX\n"
+  exit 1
+fi
+
+arm_cc="${ANDROID_TOOLCHAIN}/arm-linux-androideabi-gcc"
+arm_cpp="${ANDROID_TOOLCHAIN}/arm-linux-androideabi-g++"
+
+includes=(
+  "-isystem ${ANDROID_BUILD_TOP}/system/core/include"
+  "-isystem ${ANDROID_BUILD_TOP}/hardware/libhardware/include"
+  "-isystem ${ANDROID_BUILD_TOP}/hardware/libhardware_legacy/include"
+  "-isystem ${ANDROID_BUILD_TOP}/hardware/ril/include"
+  "-isystem ${ANDROID_BUILD_TOP}/libnativehelper/include"
+  "-isystem ${ANDROID_BUILD_TOP}/frameworks/native/include"
+  "-isystem ${ANDROID_BUILD_TOP}/frameworks/native/opengl/include"
+  "-isystem ${ANDROID_BUILD_TOP}/frameworks/av/include"
+  "-isystem ${ANDROID_BUILD_TOP}/frameworks/base/include"
+  "-isystem ${ANDROID_BUILD_TOP}/external/skia/include"
+  "-isystem ${OUT}/obj/include"
+  "-isystem ${ANDROID_BUILD_TOP}/bionic/libc/arch-arm/include"
+  "-isystem ${ANDROID_BUILD_TOP}/bionic/libc/include"
+  "-isystem ${ANDROID_BUILD_TOP}/bionic/libstdc++/include"
+  "-isystem ${ANDROID_BUILD_TOP}/bionic/libc/kernel/uapi"
+  "-isystem ${ANDROID_BUILD_TOP}/bionic/libc/kernel/uapi/asm-arm"
+  "-isystem ${ANDROID_BUILD_TOP}/bionic/libm/include"
+  "-isystem ${ANDROID_BUILD_TOP}/bionic/libm/include/arm"
+  "-isystem ${ANDROID_BUILD_TOP}/bionic/libthread_db/include"
+  "-include ${ANDROID_BUILD_TOP}/build/core/combo/include/arch/linux-arm/AndroidConfig.h"
+  "-I ${ANDROID_BUILD_TOP}/build/core/combo/include/arch/linux-arm/"
+)
+
+ldflags=(
+  "-nostdlib"
+  "-Bdynamic"
+  "-fPIE"
+  "-pie"
+  "-Wl,-dynamic-linker,/system/bin/linker"
+  "-Wl,--gc-sections"
+  "-Wl,-z,nocopyreloc"
+  "-L${OUT}/obj/lib"
+  "-Wl,-rpath-link=${OUT}/obj/lib"
+  "-Wl,--whole-archive"
+  "-Wl,--no-whole-archive"
+  "-lc"
+  "-lstdc++"
+  "-lm"
+  "-Wl,-z,noexecstack"
+  "-Wl,-z,relro"
+  "-Wl,-z,now"
+  "-Wl,--warn-shared-textrel"
+  "-Wl,--fatal-warnings"
+  "-Wl,--icf=safe"
+  "-Wl,--no-undefined"
+  "-ldl"
+)
+
+eval ./configure CC=\"${arm_cc} ${includes[@]}\" \
+                 CPP=\"${arm_cc} ${includes[@]} -E\" \
+                 CXX=\"${arm_cpp} ${includes[@]}\" \
+                 CXXCPP=\"${arm_cpp} ${includes[@]} -E\" \
+                 LDFLAGS=\"${ldflags[@]}\" \
+                 --host=arm
diff --git a/libunwind/android/conf_mips.sh b/libunwind/android/conf_mips.sh
new file mode 100755
index 0000000..f932d48
--- /dev/null
+++ b/libunwind/android/conf_mips.sh
@@ -0,0 +1,63 @@
+#!/bin/bash
+
+if [[ "$OUT" == "" ]]; then
+  echo "In order for this script to function, please choose an arm target"
+  echo "using source build/envsetup.sh and lunch XXX\n"
+  exit 1
+fi
+
+cc="${ANDROID_TOOLCHAIN}/mipsel-linux-android-gcc"
+cpp="${ANDROID_TOOLCHAIN}/mipsel-linux-android-g++"
+
+includes=(
+  "-isystem ${ANDROID_BUILD_TOP}/system/core/include"
+  "-isystem ${ANDROID_BUILD_TOP}/hardware/libhardware/include"
+  "-isystem ${ANDROID_BUILD_TOP}/hardware/libhardware_legacy/include"
+  "-isystem ${ANDROID_BUILD_TOP}/hardware/ril/include"
+  "-isystem ${ANDROID_BUILD_TOP}/libnativehelper/include"
+  "-isystem ${ANDROID_BUILD_TOP}/frameworks/native/include"
+  "-isystem ${ANDROID_BUILD_TOP}/frameworks/native/opengl/include"
+  "-isystem ${ANDROID_BUILD_TOP}/frameworks/av/include"
+  "-isystem ${ANDROID_BUILD_TOP}/frameworks/base/include"
+  "-isystem ${ANDROID_BUILD_TOP}/external/skia/include"
+  "-isystem ${OUT}/obj/include"
+  "-isystem ${ANDROID_BUILD_TOP}/bionic/libc/arch-mips/include"
+  "-isystem ${ANDROID_BUILD_TOP}/bionic/libc/include"
+  "-isystem ${ANDROID_BUILD_TOP}/bionic/libstdc++/include"
+  "-isystem ${ANDROID_BUILD_TOP}/bionic/libc/kernel/uapi"
+  "-isystem ${ANDROID_BUILD_TOP}/bionic/libc/kernel/uapi/asm-mips"
+  "-isystem ${ANDROID_BUILD_TOP}/bionic/libm/include"
+  "-isystem ${ANDROID_BUILD_TOP}/bionic/libm/include/mips"
+  "-isystem ${ANDROID_BUILD_TOP}/bionic/libthread_db/include"
+)
+
+ldflags=(
+  "-nostdlib"
+  "-Bdynamic"
+  "-fPIE"
+  "-pie"
+  "-Wl,-dynamic-linker,/system/bin/linker"
+  "-Wl,--gc-sections"
+  "-Wl,-z,nocopyreloc"
+  "-L${OUT}/obj/lib"
+  "-Wl,-rpath-link=${OUT}/obj/lib"
+  "-Wl,--whole-archive"
+  "-Wl,--no-whole-archive"
+  "-lc"
+  "-lstdc++"
+  "-lm"
+  "-Wl,-z,noexecstack"
+  "-Wl,-z,relro"
+  "-Wl,-z,now"
+  "-Wl,--warn-shared-textrel"
+  "-EL"
+  "-Wl,--no-undefined"
+  "-ldl"
+)
+
+eval ./configure CC=\"${cc} ${includes[@]}\" \
+                 CPP=\"${cc} ${includes[@]} -E\" \
+                 CXX=\"${cpp} ${includes[@]}\" \
+                 CXXCPP=\"${cpp} ${includes[@]} -E\" \
+                 LDFLAGS=\"${ldflags[@]}\" \
+                 --host=mips
diff --git a/libunwind/android/conf_x86.sh b/libunwind/android/conf_x86.sh
new file mode 100755
index 0000000..62de348
--- /dev/null
+++ b/libunwind/android/conf_x86.sh
@@ -0,0 +1,63 @@
+#!/bin/bash
+
+if [[ "$OUT" == "" ]]; then
+  echo "In order for this script to function, please choose an arm target"
+  echo "using source build/envsetup.sh and lunch XXX\n"
+  exit 1
+fi
+
+cc="${ANDROID_TOOLCHAIN}/i686-linux-android-gcc"
+cpp="${ANDROID_TOOLCHAIN}/i686-linux-android-g++"
+
+includes=(
+  "-isystem ${ANDROID_BUILD_TOP}/system/core/include"
+  "-isystem ${ANDROID_BUILD_TOP}/hardware/libhardware/include"
+  "-isystem ${ANDROID_BUILD_TOP}/hardware/libhardware_legacy/include"
+  "-isystem ${ANDROID_BUILD_TOP}/hardware/ril/include"
+  "-isystem ${ANDROID_BUILD_TOP}/libnativehelper/include"
+  "-isystem ${ANDROID_BUILD_TOP}/frameworks/native/include"
+  "-isystem ${ANDROID_BUILD_TOP}/frameworks/native/opengl/include"
+  "-isystem ${ANDROID_BUILD_TOP}/frameworks/av/include"
+  "-isystem ${ANDROID_BUILD_TOP}/frameworks/base/include"
+  "-isystem ${ANDROID_BUILD_TOP}/external/skia/include"
+  "-isystem ${OUT}/obj/include"
+  "-isystem ${ANDROID_BUILD_TOP}/bionic/libc/arch-x86/include"
+  "-isystem ${ANDROID_BUILD_TOP}/bionic/libc/include"
+  "-isystem ${ANDROID_BUILD_TOP}/bionic/libstdc++/include"
+  "-isystem ${ANDROID_BUILD_TOP}/bionic/libc/kernel/uapi"
+  "-isystem ${ANDROID_BUILD_TOP}/bionic/libc/kernel/uapi/asm-x86"
+  "-isystem ${ANDROID_BUILD_TOP}/bionic/libm/include"
+  "-isystem ${ANDROID_BUILD_TOP}/bionic/libm/include/i387"
+  "-isystem ${ANDROID_BUILD_TOP}/bionic/libthread_db/include"
+)
+
+ldflags=(
+  "-m32"
+  "-Wl,-z,noexecstack"
+  "-Wl,-z,relro"
+  "-Wl,-z,now"
+  "-Wl,--warn-shared-textrel"
+  "-Wl,--gc-sections"
+  "-nostdlib"
+  "-Bdynamic"
+  "-Wl,-dynamic-linker,/system/bin/linker"
+  "-Wl,-z,nocopyreloc"
+  "-fPIE"
+  "-pie"
+  "-L${OUT}/obj/lib"
+  "-Wl,-rpath-link=${OUT}/obj/lib"
+  "-Wl,--whole-archive"
+  "-Wl,--no-whole-archive"
+  "-lc"
+  "-lstdc++"
+  "-lm"
+  "-Wl,--no-undefined"
+  "-ldl"
+)
+
+eval ./configure CC=\"${cc} ${includes[@]}\" \
+                 CPP=\"${cc} ${includes[@]} -E\" \
+                 CXX=\"${cpp} ${includes[@]}\" \
+                 CXXCPP=\"${cpp} ${includes[@]} -E\" \
+                 LDFLAGS=\"${ldflags[@]}\" \
+                 --host=i386
diff --git a/libunwind/android/tests/local_test.cpp b/libunwind/android/tests/local_test.cpp
new file mode 100644
index 0000000..d1f3436
--- /dev/null
+++ b/libunwind/android/tests/local_test.cpp
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdint.h>
+
+#include <gtest/gtest.h>
+
+#define UNW_LOCAL_ONLY
+#include <libunwind.h>
+
+#define EXTRA_CONTEXT_BYTES 1024
+
+TEST(libbacktrace, getcontext_size) {
+  unw_context_t* context;
+  context = reinterpret_cast<unw_context_t*>(malloc(sizeof(unw_context_t) + EXTRA_CONTEXT_BYTES));
+  ASSERT_TRUE(context != NULL);
+  uint8_t* extra = reinterpret_cast<uint8_t*>(reinterpret_cast<uintptr_t>(context) + sizeof(unw_context_t));
+  for (size_t i = 0; i < EXTRA_CONTEXT_BYTES; i++) {
+    extra[i] = (i % 255) + 1;
+  }
+  ASSERT_TRUE(unw_getcontext(context) == 0);
+  /* Check that nothing was written past the end of the structure. */
+  for (size_t i = 0; i < EXTRA_CONTEXT_BYTES; i++) {
+    ASSERT_EQ((i % 255) + 1, extra[i]);
+  }
+
+  free(context);
+}
diff --git a/libunwind/aux/config.guess b/libunwind/aux/config.guess
new file mode 100644
index 0000000..ed2e03b
--- /dev/null
+++ b/libunwind/aux/config.guess
@@ -0,0 +1,1321 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002 Free Software Foundation, Inc.
+
+timestamp='2002-03-20'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Per Bothner <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub.  If it succeeds, it prints the system name on stdout, and
+# exits with 0.  Otherwise, it exits with 1.
+#
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit build system type.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit 0 ;;
+    --version | -v )
+       echo "$version" ; exit 0 ;;
+    --help | --h* | -h )
+       echo "$usage"; exit 0 ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help" >&2
+       exit 1 ;;
+    * )
+       break ;;
+  esac
+done
+
+if test $# != 0; then
+  echo "$me: too many arguments$help" >&2
+  exit 1
+fi
+
+
+dummy=dummy-$$
+trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script.
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,)    echo "int dummy(){}" > $dummy.c ;
+	for c in cc gcc c89 c99 ; do
+	  ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
+	  if test $? = 0 ; then
+	     CC_FOR_BUILD="$c"; break ;
+	  fi ;
+	done ;
+	rm -f $dummy.c $dummy.o $dummy.rel ;
+	if test x"$CC_FOR_BUILD" = x ; then
+	  CC_FOR_BUILD=no_compiler_found ;
+	fi
+	;;
+ ,,*)   CC_FOR_BUILD=$CC ;;
+ ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
+esac'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@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
+	    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
+	release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+	# contains redundant information, the shorter form:
+	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+	echo "${machine}-${os}${release}"
+	exit 0 ;;
+    amiga:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    arc:OpenBSD:*:*)
+	echo mipsel-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    hp300:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mac68k:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    macppc:OpenBSD:*:*)
+	echo powerpc-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mvme68k:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mvme88k:OpenBSD:*:*)
+	echo m88k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mvmeppc:OpenBSD:*:*)
+	echo powerpc-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    pmax:OpenBSD:*:*)
+	echo mipsel-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    sgi:OpenBSD:*:*)
+	echo mipseb-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    sun3:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    wgrisc:OpenBSD:*:*)
+	echo mipsel-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    *:OpenBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    alpha:OSF1:*:*)
+	if test $UNAME_RELEASE = "V4.0"; then
+		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+	fi
+	# A Vn.n version is a released version.
+	# A Tn.n version is a released field test version.
+	# A Xn.n version is an unreleased experimental baselevel.
+	# 1.2 uses "1.2" for uname -r.
+	cat <<EOF >$dummy.s
+	.data
+\$Lformat:
+	.byte 37,100,45,37,120,10,0	# "%d-%x\n"
+
+	.text
+	.globl main
+	.align 4
+	.ent main
+main:
+	.frame \$30,16,\$26,0
+	ldgp \$29,0(\$27)
+	.prologue 1
+	.long 0x47e03d80 # implver \$0
+	lda \$2,-1
+	.long 0x47e20c21 # amask \$2,\$1
+	lda \$16,\$Lformat
+	mov \$0,\$17
+	not \$1,\$18
+	jsr \$26,printf
+	ldgp \$29,0(\$26)
+	mov 0,\$16
+	jsr \$26,exit
+	.end main
+EOF
+	eval $set_cc_for_build
+	$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
+	if test "$?" = 0 ; then
+		case `./$dummy` in
+			0-0)
+				UNAME_MACHINE="alpha"
+				;;
+			1-0)
+				UNAME_MACHINE="alphaev5"
+				;;
+			1-1)
+				UNAME_MACHINE="alphaev56"
+				;;
+			1-101)
+				UNAME_MACHINE="alphapca56"
+				;;
+			2-303)
+				UNAME_MACHINE="alphaev6"
+				;;
+			2-307)
+				UNAME_MACHINE="alphaev67"
+				;;
+			2-1307)
+				UNAME_MACHINE="alphaev68"
+				;;
+		esac
+	fi
+	rm -f $dummy.s $dummy
+	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+	exit 0 ;;
+    Alpha\ *:Windows_NT*:*)
+	# How do we know it's Interix rather than the generic POSIX subsystem?
+	# Should we change UNAME_MACHINE based on the output of uname instead
+	# of the specific Alpha model?
+	echo alpha-pc-interix
+	exit 0 ;;
+    21064:Windows_NT:50:3)
+	echo alpha-dec-winnt3.5
+	exit 0 ;;
+    Amiga*:UNIX_System_V:4.0:*)
+	echo m68k-unknown-sysv4
+	exit 0;;
+    *:[Aa]miga[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-amigaos
+	exit 0 ;;
+    *:[Mm]orph[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-morphos
+	exit 0 ;;
+    *:OS/390:*:*)
+	echo i370-ibm-openedition
+	exit 0 ;;
+    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+	echo arm-acorn-riscix${UNAME_RELEASE}
+	exit 0;;
+    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+	echo hppa1.1-hitachi-hiuxmpp
+	exit 0;;
+    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+	if test "`(/bin/universe) 2>/dev/null`" = att ; then
+		echo pyramid-pyramid-sysv3
+	else
+		echo pyramid-pyramid-bsd
+	fi
+	exit 0 ;;
+    NILE*:*:*:dcosx)
+	echo pyramid-pyramid-svr4
+	exit 0 ;;
+    sun4H:SunOS:5.*:*)
+	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit 0 ;;
+    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit 0 ;;
+    i86pc:SunOS:5.*:*)
+	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit 0 ;;
+    sun4*:SunOS:6*:*)
+	# According to config.sub, this is the proper way to canonicalize
+	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
+	# it's likely to be more like Solaris than SunOS4.
+	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit 0 ;;
+    sun4*:SunOS:*:*)
+	case "`/usr/bin/arch -k`" in
+	    Series*|S4*)
+		UNAME_RELEASE=`uname -v`
+		;;
+	esac
+	# Japanese Language versions have a version number like `4.1.3-JL'.
+	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+	exit 0 ;;
+    sun3*:SunOS:*:*)
+	echo m68k-sun-sunos${UNAME_RELEASE}
+	exit 0 ;;
+    sun*:*:4.2BSD:*)
+	UNAME_RELEASE=`(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 0 ;;
+    aushp:SunOS:*:*)
+	echo sparc-auspex-sunos${UNAME_RELEASE}
+	exit 0 ;;
+    # The situation for MiNT is a little confusing.  The machine name
+    # can be virtually everything (everything which is not
+    # "atarist" or "atariste" at least should have a processor
+    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
+    # to the lowercase version "mint" (or "freemint").  Finally
+    # the system name "TOS" denotes a system which is actually not
+    # MiNT.  But MiNT is downward compatible to TOS, so this should
+    # be no problem.
+    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+	exit 0 ;;
+    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+	echo m68k-atari-mint${UNAME_RELEASE}
+        exit 0 ;;
+    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+	exit 0 ;;
+    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+        echo m68k-milan-mint${UNAME_RELEASE}
+        exit 0 ;;
+    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+        echo m68k-hades-mint${UNAME_RELEASE}
+        exit 0 ;;
+    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+        echo m68k-unknown-mint${UNAME_RELEASE}
+        exit 0 ;;
+    powerpc:machten:*:*)
+	echo powerpc-apple-machten${UNAME_RELEASE}
+	exit 0 ;;
+    RISC*:Mach:*:*)
+	echo mips-dec-mach_bsd4.3
+	exit 0 ;;
+    RISC*:ULTRIX:*:*)
+	echo mips-dec-ultrix${UNAME_RELEASE}
+	exit 0 ;;
+    VAX*:ULTRIX*:*:*)
+	echo vax-dec-ultrix${UNAME_RELEASE}
+	exit 0 ;;
+    2020:CLIX:*:* | 2430:CLIX:*:*)
+	echo clipper-intergraph-clix${UNAME_RELEASE}
+	exit 0 ;;
+    mips:*:*:UMIPS | mips:*:*:RISCos)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h>  /* for printf() prototype */
+	int main (int argc, char *argv[]) {
+#else
+	int main (argc, argv) int argc; char *argv[]; {
+#endif
+	#if defined (host_mips) && defined (MIPSEB)
+	#if defined (SYSTYPE_SYSV)
+	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+	#endif
+	#if defined (SYSTYPE_SVR4)
+	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+	#endif
+	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+	#endif
+	#endif
+	  exit (-1);
+	}
+EOF
+	$CC_FOR_BUILD $dummy.c -o $dummy \
+	  && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+	  && rm -f $dummy.c $dummy && exit 0
+	rm -f $dummy.c $dummy
+	echo mips-mips-riscos${UNAME_RELEASE}
+	exit 0 ;;
+    Motorola:PowerMAX_OS:*:*)
+	echo powerpc-motorola-powermax
+	exit 0 ;;
+    Night_Hawk:Power_UNIX:*:*)
+	echo powerpc-harris-powerunix
+	exit 0 ;;
+    m88k:CX/UX:7*:*)
+	echo m88k-harris-cxux7
+	exit 0 ;;
+    m88k:*:4*:R4*)
+	echo m88k-motorola-sysv4
+	exit 0 ;;
+    m88k:*:3*:R3*)
+	echo m88k-motorola-sysv3
+	exit 0 ;;
+    AViiON:dgux:*:*)
+        # DG/UX returns AViiON for all architectures
+        UNAME_PROCESSOR=`/usr/bin/uname -p`
+	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+	then
+	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+	       [ ${TARGET_BINARY_INTERFACE}x = x ]
+	    then
+		echo m88k-dg-dgux${UNAME_RELEASE}
+	    else
+		echo m88k-dg-dguxbcs${UNAME_RELEASE}
+	    fi
+	else
+	    echo i586-dg-dgux${UNAME_RELEASE}
+	fi
+ 	exit 0 ;;
+    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
+	echo m88k-dolphin-sysv3
+	exit 0 ;;
+    M88*:*:R3*:*)
+	# Delta 88k system running SVR3
+	echo m88k-motorola-sysv3
+	exit 0 ;;
+    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+	echo m88k-tektronix-sysv3
+	exit 0 ;;
+    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+	echo m68k-tektronix-bsd
+	exit 0 ;;
+    *:IRIX*:*:*)
+	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+	exit 0 ;;
+    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+	echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
+	exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
+    i*86:AIX:*:*)
+	echo i386-ibm-aix
+	exit 0 ;;
+    ia64:AIX:*:*)
+	if [ -x /usr/bin/oslevel ] ; then
+		IBM_REV=`/usr/bin/oslevel`
+	else
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+	fi
+	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+	exit 0 ;;
+    *:AIX:2:3)
+	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+		eval $set_cc_for_build
+		sed 's/^		//' << EOF >$dummy.c
+		#include <sys/systemcfg.h>
+
+		main()
+			{
+			if (!__power_pc())
+				exit(1);
+			puts("powerpc-ibm-aix3.2.5");
+			exit(0);
+			}
+EOF
+		$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
+		rm -f $dummy.c $dummy
+		echo rs6000-ibm-aix3.2.5
+	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+		echo rs6000-ibm-aix3.2.4
+	else
+		echo rs6000-ibm-aix3.2
+	fi
+	exit 0 ;;
+    *:AIX:*:[45])
+	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | 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 0 ;;
+    *:AIX:*:*)
+	echo rs6000-ibm-aix
+	exit 0 ;;
+    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+	echo romp-ibm-bsd4.4
+	exit 0 ;;
+    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
+	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
+	exit 0 ;;                           # report: romp-ibm BSD 4.3
+    *:BOSX:*:*)
+	echo rs6000-bull-bosx
+	exit 0 ;;
+    DPX/2?00:B.O.S.:*:*)
+	echo m68k-bull-sysv3
+	exit 0 ;;
+    9000/[34]??:4.3bsd:1.*:*)
+	echo m68k-hp-bsd
+	exit 0 ;;
+    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+	echo m68k-hp-bsd4.4
+	exit 0 ;;
+    9000/[34678]??:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	case "${UNAME_MACHINE}" in
+	    9000/31? )            HP_ARCH=m68000 ;;
+	    9000/[34]?? )         HP_ARCH=m68k ;;
+	    9000/[678][0-9][0-9])
+		if [ -x /usr/bin/getconf ]; then
+		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+                    case "${sc_cpu_version}" in
+                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+                      532)                      # CPU_PA_RISC2_0
+                        case "${sc_kernel_bits}" in
+                          32) HP_ARCH="hppa2.0n" ;;
+                          64) HP_ARCH="hppa2.0w" ;;
+			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
+                        esac ;;
+                    esac
+		fi
+		if [ "${HP_ARCH}" = "" ]; then
+		    eval $set_cc_for_build
+		    sed 's/^              //' << EOF >$dummy.c
+
+              #define _HPUX_SOURCE
+              #include <stdlib.h>
+              #include <unistd.h>
+
+              int main ()
+              {
+              #if defined(_SC_KERNEL_BITS)
+                  long bits = sysconf(_SC_KERNEL_BITS);
+              #endif
+                  long cpu  = sysconf (_SC_CPU_VERSION);
+
+                  switch (cpu)
+              	{
+              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+              	case CPU_PA_RISC2_0:
+              #if defined(_SC_KERNEL_BITS)
+              	    switch (bits)
+              		{
+              		case 64: puts ("hppa2.0w"); break;
+              		case 32: puts ("hppa2.0n"); break;
+              		default: puts ("hppa2.0"); break;
+              		} break;
+              #else  /* !defined(_SC_KERNEL_BITS) */
+              	    puts ("hppa2.0"); break;
+              #endif
+              	default: puts ("hppa1.0"); break;
+              	}
+                  exit (0);
+              }
+EOF
+		    (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy`
+		    if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
+		    rm -f $dummy.c $dummy
+		fi ;;
+	esac
+	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+	exit 0 ;;
+    ia64:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	echo ia64-hp-hpux${HPUX_REV}
+	exit 0 ;;
+    3050*:HI-UX:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#include <unistd.h>
+	int
+	main ()
+	{
+	  long cpu = sysconf (_SC_CPU_VERSION);
+	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
+	     results, however.  */
+	  if (CPU_IS_PA_RISC (cpu))
+	    {
+	      switch (cpu)
+		{
+		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+		  default: puts ("hppa-hitachi-hiuxwe2"); break;
+		}
+	    }
+	  else if (CPU_IS_HP_MC68K (cpu))
+	    puts ("m68k-hitachi-hiuxwe2");
+	  else puts ("unknown-hitachi-hiuxwe2");
+	  exit (0);
+	}
+EOF
+	$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
+	rm -f $dummy.c $dummy
+	echo unknown-hitachi-hiuxwe2
+	exit 0 ;;
+    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+	echo hppa1.1-hp-bsd
+	exit 0 ;;
+    9000/8??:4.3bsd:*:*)
+	echo hppa1.0-hp-bsd
+	exit 0 ;;
+    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+	echo hppa1.0-hp-mpeix
+	exit 0 ;;
+    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+	echo hppa1.1-hp-osf
+	exit 0 ;;
+    hp8??:OSF1:*:*)
+	echo hppa1.0-hp-osf
+	exit 0 ;;
+    i*86:OSF1:*:*)
+	if [ -x /usr/sbin/sysversion ] ; then
+	    echo ${UNAME_MACHINE}-unknown-osf1mk
+	else
+	    echo ${UNAME_MACHINE}-unknown-osf1
+	fi
+	exit 0 ;;
+    parisc*:Lites*:*:*)
+	echo hppa1.1-hp-lites
+	exit 0 ;;
+    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+	echo c1-convex-bsd
+        exit 0 ;;
+    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+        exit 0 ;;
+    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+	echo c34-convex-bsd
+        exit 0 ;;
+    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+	echo c38-convex-bsd
+        exit 0 ;;
+    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+	echo c4-convex-bsd
+        exit 0 ;;
+    CRAY*Y-MP:*:*:*)
+	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    CRAY*[A-Z]90:*:*:*)
+	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+	      -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    CRAY*TS:*:*:*)
+	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    CRAY*T3D:*:*:*)
+	echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    CRAY*T3E:*:*:*)
+	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    CRAY*SV1:*:*:*)
+	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+        exit 0 ;;
+    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+	exit 0 ;;
+    sparc*:BSD/OS:*:*)
+	echo sparc-unknown-bsdi${UNAME_RELEASE}
+	exit 0 ;;
+    *:BSD/OS:*:*)
+	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+	exit 0 ;;
+    *:FreeBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+	exit 0 ;;
+    i*:CYGWIN*:*)
+	echo ${UNAME_MACHINE}-pc-cygwin
+	exit 0 ;;
+    i*:MINGW*:*)
+	echo ${UNAME_MACHINE}-pc-mingw32
+	exit 0 ;;
+    i*:PW*:*)
+	echo ${UNAME_MACHINE}-pc-pw32
+	exit 0 ;;
+    x86:Interix*:3*)
+	echo i386-pc-interix3
+	exit 0 ;;
+    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+	# How do we know it's Interix rather than the generic POSIX subsystem?
+	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+	# UNAME_MACHINE based on the output of uname instead of i386?
+	echo i386-pc-interix
+	exit 0 ;;
+    i*:UWIN*:*)
+	echo ${UNAME_MACHINE}-pc-uwin
+	exit 0 ;;
+    p*:CYGWIN*:*)
+	echo powerpcle-unknown-cygwin
+	exit 0 ;;
+    prep*:SunOS:5.*:*)
+	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit 0 ;;
+    *:GNU:*:*)
+	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+	exit 0 ;;
+    i*86:Minix:*:*)
+	echo ${UNAME_MACHINE}-pc-minix
+	exit 0 ;;
+    arm*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    ia64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    m68*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    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=`
+	rm -f $dummy.c
+	test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0
+	;;
+    ppc:Linux:*:*)
+	echo powerpc-unknown-linux-gnu
+	exit 0 ;;
+    ppc64:Linux:*:*)
+	echo powerpc64-unknown-linux-gnu
+	exit 0 ;;
+    alpha:Linux:*:*)
+	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+	  EV5)   UNAME_MACHINE=alphaev5 ;;
+	  EV56)  UNAME_MACHINE=alphaev56 ;;
+	  PCA56) UNAME_MACHINE=alphapca56 ;;
+	  PCA57) UNAME_MACHINE=alphapca56 ;;
+	  EV6)   UNAME_MACHINE=alphaev6 ;;
+	  EV67)  UNAME_MACHINE=alphaev67 ;;
+	  EV68*) UNAME_MACHINE=alphaev68 ;;
+        esac
+	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+	exit 0 ;;
+    parisc:Linux:*:* | hppa:Linux:*:*)
+	# Look for CPU level
+	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
+	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
+	  *)    echo hppa-unknown-linux-gnu ;;
+	esac
+	exit 0 ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+	echo hppa64-unknown-linux-gnu
+	exit 0 ;;
+    s390:Linux:*:* | s390x:Linux:*:*)
+	echo ${UNAME_MACHINE}-ibm-linux
+	exit 0 ;;
+    sh*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    sparc:Linux:*:* | sparc64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    x86_64:Linux:*:*)
+	echo x86_64-unknown-linux-gnu
+	exit 0 ;;
+    i*86:Linux:*:*)
+	# The BFD linker knows what the default object file format is, so
+	# first see if it will tell us. cd to the root directory to prevent
+	# problems with other programs or directories called `ld' in the path.
+	# 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 0 ;;		
+	  coff-i386)
+		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+		exit 0 ;;
+	  "")
+		# Either a pre-BFD a.out linker (linux-gnuoldld) or
+		# one that does not give us useful --help.
+		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+		exit 0 ;;
+	esac
+	# Determine whether the default compiler is a.out or elf
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#include <features.h>
+	#ifdef __ELF__
+	# ifdef __GLIBC__
+	#  if __GLIBC__ >= 2
+	LIBC=gnu
+	#  else
+	LIBC=gnulibc1
+	#  endif
+	# else
+	LIBC=gnulibc1
+	# endif
+	#else
+	#ifdef __INTEL_COMPILER
+	LIBC=gnu
+	#else
+	LIBC=gnuaout
+	#endif
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+	rm -f $dummy.c
+	test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
+	test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
+	;;
+    i*86:DYNIX/ptx:4*:*)
+	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+	# earlier versions are messed up and put the nodename in both
+	# sysname and nodename.
+	echo i386-sequent-sysv4
+	exit 0 ;;
+    i*86:UNIX_SV:4.2MP:2.*)
+        # Unixware is an offshoot of SVR4, but it has its own version
+        # number series starting with 2...
+        # I am not positive that other SVR4 systems won't match this,
+	# I just have to hope.  -- rms.
+        # Use sysv4.2uw... so that sysv4* matches it.
+	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+	exit 0 ;;
+    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+	else
+		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+	fi
+	exit 0 ;;
+    i*86:*:5:[78]*)
+	case `/bin/uname -X | grep "^Machine"` in
+	    *486*)	     UNAME_MACHINE=i486 ;;
+	    *Pentium)	     UNAME_MACHINE=i586 ;;
+	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+	esac
+	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+	exit 0 ;;
+    i*86:*:3.2:*)
+	if test -f /usr/options/cb.name; then
+		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+	elif /bin/uname -X 2>/dev/null >/dev/null ; then
+		UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
+		(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
+		(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
+			&& UNAME_MACHINE=i586
+		(/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
+			&& UNAME_MACHINE=i686
+		(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
+			&& UNAME_MACHINE=i686
+		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+	else
+		echo ${UNAME_MACHINE}-pc-sysv32
+	fi
+	exit 0 ;;
+    i*86:*DOS:*:*)
+	echo ${UNAME_MACHINE}-pc-msdosdjgpp
+	exit 0 ;;
+    pc:*:*:*)
+	# Left here for compatibility:
+        # uname -m prints for DJGPP always 'pc', but it prints nothing about
+        # the processor, so we play safe by assuming i386.
+	echo i386-pc-msdosdjgpp
+        exit 0 ;;
+    Intel:Mach:3*:*)
+	echo i386-pc-mach3
+	exit 0 ;;
+    paragon:*:*:*)
+	echo i860-intel-osf1
+	exit 0 ;;
+    i860:*:4.*:*) # i860-SVR4
+	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+	else # Add other i860-SVR4 vendors below as they are discovered.
+	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
+	fi
+	exit 0 ;;
+    mini*:CTIX:SYS*5:*)
+	# "miniframe"
+	echo m68010-convergent-sysv
+	exit 0 ;;
+    M68*:*:R3V[567]*:*)
+	test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+    3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0)
+	OS_REL=''
+	test -r /etc/.relid \
+	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+	  && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+	  && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
+    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+          && echo i486-ncr-sysv4 && exit 0 ;;
+    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+	echo m68k-unknown-lynxos${UNAME_RELEASE}
+	exit 0 ;;
+    mc68030:UNIX_System_V:4.*:*)
+	echo m68k-atari-sysv4
+	exit 0 ;;
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+	echo i386-unknown-lynxos${UNAME_RELEASE}
+	exit 0 ;;
+    TSUNAMI:LynxOS:2.*:*)
+	echo sparc-unknown-lynxos${UNAME_RELEASE}
+	exit 0 ;;
+    rs6000:LynxOS:2.*:*)
+	echo rs6000-unknown-lynxos${UNAME_RELEASE}
+	exit 0 ;;
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+	echo powerpc-unknown-lynxos${UNAME_RELEASE}
+	exit 0 ;;
+    SM[BE]S:UNIX_SV:*:*)
+	echo mips-dde-sysv${UNAME_RELEASE}
+	exit 0 ;;
+    RM*:ReliantUNIX-*:*:*)
+	echo mips-sni-sysv4
+	exit 0 ;;
+    RM*:SINIX-*:*:*)
+	echo mips-sni-sysv4
+	exit 0 ;;
+    *:SINIX-*:*:*)
+	if uname -p 2>/dev/null >/dev/null ; then
+		UNAME_MACHINE=`(uname -p) 2>/dev/null`
+		echo ${UNAME_MACHINE}-sni-sysv4
+	else
+		echo ns32k-sni-sysv
+	fi
+	exit 0 ;;
+    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+                      # says <Richard.M.Bartel@ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit 0 ;;
+    *:UNIX_System_V:4*:FTX*)
+	# From Gerald Hewes <hewes@openmarket.com>.
+	# How about differentiating between stratus architectures? -djm
+	echo hppa1.1-stratus-sysv4
+	exit 0 ;;
+    *:*:*:FTX*)
+	# From seanf@swdc.stratus.com.
+	echo i860-stratus-sysv4
+	exit 0 ;;
+    *:VOS:*:*)
+	# From Paul.Green@stratus.com.
+	echo hppa1.1-stratus-vos
+	exit 0 ;;
+    mc68*:A/UX:*:*)
+	echo m68k-apple-aux${UNAME_RELEASE}
+	exit 0 ;;
+    news*:NEWS-OS:6*:*)
+	echo mips-sony-newsos6
+	exit 0 ;;
+    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+	if [ -d /usr/nec ]; then
+	        echo mips-nec-sysv${UNAME_RELEASE}
+	else
+	        echo mips-unknown-sysv${UNAME_RELEASE}
+	fi
+        exit 0 ;;
+    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
+	echo powerpc-be-beos
+	exit 0 ;;
+    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
+	echo powerpc-apple-beos
+	exit 0 ;;
+    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
+	echo i586-pc-beos
+	exit 0 ;;
+    SX-4:SUPER-UX:*:*)
+	echo sx4-nec-superux${UNAME_RELEASE}
+	exit 0 ;;
+    SX-5:SUPER-UX:*:*)
+	echo sx5-nec-superux${UNAME_RELEASE}
+	exit 0 ;;
+    Power*:Rhapsody:*:*)
+	echo powerpc-apple-rhapsody${UNAME_RELEASE}
+	exit 0 ;;
+    *:Rhapsody:*:*)
+	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+	exit 0 ;;
+    *:Darwin:*:*)
+	echo `uname -p`-apple-darwin${UNAME_RELEASE}
+	exit 0 ;;
+    *:procnto*:*:* | *:QNX:[0123456789]*:*)
+	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 0 ;;
+    *:QNX:*:4*)
+	echo i386-pc-qnx
+	exit 0 ;;
+    NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*)
+	echo nsr-tandem-nsk${UNAME_RELEASE}
+	exit 0 ;;
+    *:NonStop-UX:*:*)
+	echo mips-compaq-nonstopux
+	exit 0 ;;
+    BS2000:POSIX*:*:*)
+	echo bs2000-siemens-sysv
+	exit 0 ;;
+    DS/*:UNIX_System_V:*:*)
+	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+	exit 0 ;;
+    *:Plan9:*:*)
+	# "uname -m" is not consistent, so use $cputype instead. 386
+	# is converted to i386 for consistency with other x86
+	# operating systems.
+	if test "$cputype" = "386"; then
+	    UNAME_MACHINE=i386
+	else
+	    UNAME_MACHINE="$cputype"
+	fi
+	echo ${UNAME_MACHINE}-unknown-plan9
+	exit 0 ;;
+    i*86:OS/2:*:*)
+	# If we were able to find `uname', then EMX Unix compatibility
+	# is probably installed.
+	echo ${UNAME_MACHINE}-pc-os2-emx
+	exit 0 ;;
+    *:TOPS-10:*:*)
+	echo pdp10-unknown-tops10
+	exit 0 ;;
+    *:TENEX:*:*)
+	echo pdp10-unknown-tenex
+	exit 0 ;;
+    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+	echo pdp10-dec-tops20
+	exit 0 ;;
+    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+	echo pdp10-xkl-tops20
+	exit 0 ;;
+    *:TOPS-20:*:*)
+	echo pdp10-unknown-tops20
+	exit 0 ;;
+    *:ITS:*:*)
+	echo pdp10-unknown-its
+	exit 0 ;;
+    i*86:XTS-300:*:STOP)
+	echo ${UNAME_MACHINE}-unknown-stop
+	exit 0 ;;
+    i*86:atheos:*:*)
+	echo ${UNAME_MACHINE}-unknown-atheos
+	exit 0 ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
+     I don't know....  */
+  printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+  printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+          "4"
+#else
+	  ""
+#endif
+         ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+  printf ("arm-acorn-riscix"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+  printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+  int version;
+  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+  if (version < 4)
+    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+  else
+    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+  exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+  printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+  printf ("ns32k-encore-mach\n"); exit (0);
+#else
+  printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+  printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+  printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+  printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+    struct utsname un;
+
+    uname(&un);
+
+    if (strncmp(un.version, "V2", 2) == 0) {
+	printf ("i386-sequent-ptx2\n"); exit (0);
+    }
+    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+	printf ("i386-sequent-ptx1\n"); exit (0);
+    }
+    printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+#  include <sys/param.h>
+#  if defined (BSD)
+#   if BSD == 43
+      printf ("vax-dec-bsd4.3\n"); exit (0);
+#   else
+#    if BSD == 199006
+      printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#    else
+      printf ("vax-dec-bsd\n"); exit (0);
+#    endif
+#   endif
+#  else
+    printf ("vax-dec-bsd\n"); exit (0);
+#  endif
+# else
+    printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+  printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+  exit (1);
+}
+EOF
+
+$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
+rm -f $dummy.c $dummy
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+    case `getsysinfo -f cpu_type` in
+    c1*)
+	echo c1-convex-bsd
+	exit 0 ;;
+    c2*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+	exit 0 ;;
+    c34*)
+	echo c34-convex-bsd
+	exit 0 ;;
+    c38*)
+	echo c38-convex-bsd
+	exit 0 ;;
+    c4*)
+	echo c4-convex-bsd
+	exit 0 ;;
+    esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+    ftp://ftp.gnu.org/pub/gnu/config/
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo               = `(hostinfo) 2>/dev/null`
+/bin/universe          = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch              = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM  = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/libunwind/aux/config.sub b/libunwind/aux/config.sub
new file mode 100644
index 0000000..f365797
--- /dev/null
+++ b/libunwind/aux/config.sub
@@ -0,0 +1,1443 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002 Free Software Foundation, Inc.
+
+timestamp='2002-03-07'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine.  It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Please send patches to <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support.  The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+       $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit 0 ;;
+    --version | -v )
+       echo "$version" ; exit 0 ;;
+    --help | --h* | -h )
+       echo "$usage"; exit 0 ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help"
+       exit 1 ;;
+
+    *local*)
+       # First pass through any local machine types.
+       echo $1
+       exit 0;;
+
+    * )
+       break ;;
+  esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+    exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+    exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+  nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-* | 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)
+		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] \
+	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+	| c4x | clipper \
+	| d10v | d30v | dsp16xx \
+	| fr30 \
+	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+	| i370 | i860 | i960 | ia64 \
+	| m32r | m68000 | m68k | m88k | mcore \
+	| mips | mips16 | mips64 | mips64el | mips64orion | mips64orionel \
+	| mips64vr4100 | mips64vr4100el | mips64vr4300 \
+	| mips64vr4300el | mips64vr5000 | mips64vr5000el \
+	| mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \
+	| mipsisa32 | mipsisa64 \
+	| mn10200 | mn10300 \
+	| ns16k | ns32k \
+	| openrisc | or32 \
+	| pdp10 | pdp11 | pj | pjl \
+	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+	| pyramid \
+	| sh | sh[34] | sh[34]eb | shbe | shle | sh64 \
+	| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
+	| strongarm \
+	| tahoe | thumb | tic80 | tron \
+	| v850 | v850e \
+	| we32k \
+	| x86 | xscale | 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-* | armv*-* \
+	| avr-* \
+	| bs2000-* \
+	| c[123]* | c30-* | [cjt]90-* | c54x-* \
+	| clipper-* | cydra-* \
+	| d10v-* | d30v-* \
+	| elxsi-* \
+	| f30[01]-* | f700-* | fr30-* | fx80-* \
+	| h8300-* | h8500-* \
+	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+	| i*86-* | i860-* | i960-* | ia64-* \
+	| m32r-* \
+	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+	| m88110-* | m88k-* | mcore-* \
+	| mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \
+	| mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \
+	| mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \
+	| mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \
+	| none-* | np1-* | ns16k-* | ns32k-* \
+	| orion-* \
+	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+	| pyramid-* \
+	| romp-* | rs6000-* \
+	| sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* | sh64-* \
+	| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
+	| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+	| tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \
+	| v850-* | v850e-* | vax-* \
+	| we32k-* \
+	| x86-* | x86_64-* | xps100-* | xscale-* | 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
+		;;
+	adobe68k)
+		basic_machine=m68010-adobe
+		os=-scout
+		;;
+	alliant | fx80)
+		basic_machine=fx80-alliant
+		;;
+	altos | altos3068)
+		basic_machine=m68k-altos
+		;;
+	am29k)
+		basic_machine=a29k-none
+		os=-bsd
+		;;
+	amdahl)
+		basic_machine=580-amdahl
+		os=-sysv
+		;;
+	amiga | amiga-*)
+		basic_machine=m68k-unknown
+		;;
+	amigaos | amigados)
+		basic_machine=m68k-unknown
+		os=-amigaos
+		;;
+	amigaunix | amix)
+		basic_machine=m68k-unknown
+		os=-sysv4
+		;;
+	apollo68)
+		basic_machine=m68k-apollo
+		os=-sysv
+		;;
+	apollo68bsd)
+		basic_machine=m68k-apollo
+		os=-bsd
+		;;
+	aux)
+		basic_machine=m68k-apple
+		os=-aux
+		;;
+	balance)
+		basic_machine=ns32k-sequent
+		os=-dynix
+		;;
+	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
+		;;
+	crds | unos)
+		basic_machine=m68k-crds
+		;;
+	cris | cris-* | etrax*)
+		basic_machine=cris-axis
+		;;
+	da30 | da30-*)
+		basic_machine=m68k-da30
+		;;
+	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+		basic_machine=mips-dec
+		;;
+	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
+		;;
+	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
+		;;
+	mmix*)
+		basic_machine=mmix-knuth
+		os=-mmixware
+		;;
+	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
+		;;
+	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)
+		basic_machine=i686-pc
+		;;
+	pentiumii | pentium2)
+		basic_machine=i686-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-*)
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pn)
+		basic_machine=pn-gould
+		;;
+	power)	basic_machine=power-ibm
+		;;
+	ppc)	basic_machine=powerpc-unknown
+	        ;;
+	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppcle | powerpclittle | ppc-le | powerpc-little)
+		basic_machine=powerpcle-unknown
+	        ;;
+	ppcle-* | powerpclittle-*)
+		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppc64)	basic_machine=powerpc64-unknown
+	        ;;
+	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+		basic_machine=powerpc64le-unknown
+	        ;;
+	ppc64le-* | powerpc64little-*)
+		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ps2)
+		basic_machine=i386-ibm
+		;;
+	pw32)
+		basic_machine=i586-unknown
+		os=-pw32
+		;;
+	rom68k)
+		basic_machine=m68k-rom68k
+		os=-coff
+		;;
+	rm[46]00)
+		basic_machine=mips-siemens
+		;;
+	rtpc | rtpc-*)
+		basic_machine=romp-ibm
+		;;
+	s390 | s390-*)
+		basic_machine=s390-ibm
+		;;
+	s390x | s390x-*)
+		basic_machine=s390x-ibm
+		;;
+	sa29200)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	sequent)
+		basic_machine=i386-sequent
+		;;
+	sh)
+		basic_machine=sh-hitachi
+		os=-hms
+		;;
+	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
+		;;
+	t3d)
+		basic_machine=alpha-cray
+		os=-unicos
+		;;
+	t3e)
+		basic_machine=alphaev5-cray
+		os=-unicos
+		;;
+	t90)
+		basic_machine=t90-cray
+		os=-unicos
+		;;
+	tic54x | c54x*)
+		basic_machine=tic54x-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
+		;;
+	udi29k)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	ultra3)
+		basic_machine=a29k-nyu
+		os=-sym1
+		;;
+	v810 | necv810)
+		basic_machine=v810-nec
+		os=-none
+		;;
+	vaxv)
+		basic_machine=vax-dec
+		os=-sysv
+		;;
+	vms)
+		basic_machine=vax-dec
+		os=-vms
+		;;
+	vpp*|vx|vx-*)
+               basic_machine=f301-fujitsu
+               ;;
+	vxworks960)
+		basic_machine=i960-wrs
+		os=-vxworks
+		;;
+	vxworks68)
+		basic_machine=m68k-wrs
+		os=-vxworks
+		;;
+	vxworks29k)
+		basic_machine=a29k-wrs
+		os=-vxworks
+		;;
+	w65*)
+		basic_machine=w65-wdc
+		os=-none
+		;;
+	w89k-*)
+		basic_machine=hppa1.1-winbond
+		os=-proelf
+		;;
+	windows32)
+		basic_machine=i386-pc
+		os=-windows32-msvcrt
+		;;
+        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
+		;;
+	rs6000)
+		basic_machine=rs6000-ibm
+		;;
+	vax)
+		basic_machine=vax-dec
+		;;
+	pdp10)
+		# there are many clones, so DEC is not a safe bet
+		basic_machine=pdp10-unknown
+		;;
+	pdp11)
+		basic_machine=pdp11-dec
+		;;
+	we32k)
+		basic_machine=we32k-att
+		;;
+	sh3 | sh4 | sh3eb | sh4eb)
+		basic_machine=sh-unknown
+		;;
+	sh64)
+		basic_machine=sh64-unknown
+		;;
+	sparc | sparcv9 | sparcv9b)
+		basic_machine=sparc-sun
+		;;
+        cydra)
+		basic_machine=cydra-cydrome
+		;;
+	orion)
+		basic_machine=orion-highlevel
+		;;
+	orion105)
+		basic_machine=clipper-highlevel
+		;;
+	mac | mpw | mac-mpw)
+		basic_machine=m68k-apple
+		;;
+	pmac | pmac-mpw)
+		basic_machine=powerpc-apple
+		;;
+	c4x*)
+		basic_machine=c4x-none
+		os=-coff
+		;;
+	*-unknown)
+		# Make sure to match an already-canonicalized machine name.
+		;;
+	*)
+		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+		exit 1
+		;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+	*-digital*)
+		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+		;;
+	*-commodore*)
+		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+		;;
+	*)
+		;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+        # First match some system type aliases
+        # that might get confused with valid system types.
+	# -solaris* is a basic system type, with this one exception.
+	-solaris1 | -solaris1.*)
+		os=`echo $os | sed -e 's|solaris1|sunos4|'`
+		;;
+	-solaris)
+		os=-solaris2
+		;;
+	-svr4*)
+		os=-sysv4
+		;;
+	-unixware*)
+		os=-sysv4.2uw
+		;;
+	-gnu/linux*)
+		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+		;;
+	# First accept the basic system types.
+	# The portable systems comes first.
+	# Each alternative MUST END IN A *, to match a version number.
+	# -sysv* is not here because it comes later, after sysvr4.
+	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+	      | -aos* \
+	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+	      | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
+	      | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+	      | -chorusos* | -chorusrdb* \
+	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+	      | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
+	      | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
+	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+	      | -morphos* | -superux* | -rtmk* | -rtmk-nova*)
+	# Remember, each alternative MUST END IN *, to match a version number.
+		;;
+	-qnx*)
+		case $basic_machine in
+		    x86-* | i*86-*)
+			;;
+		    *)
+			os=-nto$os
+			;;
+		esac
+		;;
+	-nto*)
+		os=-nto-qnx
+		;;
+	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+		;;
+	-mac*)
+		os=`echo $os | sed -e 's|mac|macos|'`
+		;;
+	-linux*)
+		os=`echo $os | sed -e 's|linux|linux-gnu|'`
+		;;
+	-sunos5*)
+		os=`echo $os | sed -e 's|sunos5|solaris2|'`
+		;;
+	-sunos6*)
+		os=`echo $os | sed -e 's|sunos6|solaris3|'`
+		;;
+	-opened*)
+		os=-openedition
+		;;
+	-wince*)
+		os=-wince
+		;;
+	-osfrose*)
+		os=-osfrose
+		;;
+	-osf*)
+		os=-osf
+		;;
+	-utek*)
+		os=-bsd
+		;;
+	-dynix*)
+		os=-bsd
+		;;
+	-acis*)
+		os=-aos
+		;;
+	-atheos*)
+		os=-atheos
+		;;
+	-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
+		;;
+	-triton*)
+		os=-sysv3
+		;;
+	-oss*)
+		os=-sysv3
+		;;
+	-svr4)
+		os=-sysv4
+		;;
+	-svr3)
+		os=-sysv3
+		;;
+	-sysvr4)
+		os=-sysv4
+		;;
+	# This must come after -sysvr4.
+	-sysv*)
+		;;
+	-ose*)
+		os=-ose
+		;;
+	-es1800*)
+		os=-ose
+		;;
+	-xenix)
+		os=-xenix
+		;;
+        -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+	        os=-mint
+		;;
+	-none)
+		;;
+	*)
+		# Get rid of the `-' at the beginning of $os.
+		os=`echo $os | sed 's/[^-]*-//'`
+		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+		exit 1
+		;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system.  Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+	*-acorn)
+		os=-riscix1.2
+		;;
+	arm*-rebel)
+		os=-linux
+		;;
+	arm*-semi)
+		os=-aout
+		;;
+	# 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
+		;;
+	*-wec)
+		os=-proelf
+		;;
+	*-winbond)
+		os=-proelf
+		;;
+	*-oki)
+		os=-proelf
+		;;
+	*-hp)
+		os=-hpux
+		;;
+	*-hitachi)
+		os=-hiux
+		;;
+	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+		os=-sysv
+		;;
+	*-cbm)
+		os=-amigaos
+		;;
+	*-dg)
+		os=-dgux
+		;;
+	*-dolphin)
+		os=-sysv3
+		;;
+	m68k-ccur)
+		os=-rtu
+		;;
+	m88k-omron*)
+		os=-luna
+		;;
+	*-next )
+		os=-nextstep
+		;;
+	*-sequent)
+		os=-ptx
+		;;
+	*-crds)
+		os=-unos
+		;;
+	*-ns)
+		os=-genix
+		;;
+	i370-*)
+		os=-mvs
+		;;
+	*-next)
+		os=-nextstep3
+		;;
+        *-gould)
+		os=-sysv
+		;;
+        *-highlevel)
+		os=-bsd
+		;;
+	*-encore)
+		os=-bsd
+		;;
+        *-sgi)
+		os=-irix
+		;;
+        *-siemens)
+		os=-sysv4
+		;;
+	*-masscomp)
+		os=-rtu
+		;;
+	f30[01]-fujitsu | f700-fujitsu)
+		os=-uxpv
+		;;
+	*-rom68k)
+		os=-coff
+		;;
+	*-*bug)
+		os=-coff
+		;;
+	*-apple)
+		os=-macos
+		;;
+	*-atari*)
+		os=-mint
+		;;
+	*)
+		os=-none
+		;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer.  We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+	*-unknown)
+		case $os in
+			-riscix*)
+				vendor=acorn
+				;;
+			-sunos*)
+				vendor=sun
+				;;
+			-aix*)
+				vendor=ibm
+				;;
+			-beos*)
+				vendor=be
+				;;
+			-hpux*)
+				vendor=hp
+				;;
+			-mpeix*)
+				vendor=hp
+				;;
+			-hiux*)
+				vendor=hitachi
+				;;
+			-unos*)
+				vendor=crds
+				;;
+			-dgux*)
+				vendor=dg
+				;;
+			-luna*)
+				vendor=omron
+				;;
+			-genix*)
+				vendor=ns
+				;;
+			-mvs* | -opened*)
+				vendor=ibm
+				;;
+			-ptx*)
+				vendor=sequent
+				;;
+			-vxsim* | -vxworks*)
+				vendor=wrs
+				;;
+			-aux*)
+				vendor=apple
+				;;
+			-hms*)
+				vendor=hitachi
+				;;
+			-mpw* | -macos*)
+				vendor=apple
+				;;
+			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+				vendor=atari
+				;;
+			-vos*)
+				vendor=stratus
+				;;
+		esac
+		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+		;;
+esac
+
+echo $basic_machine$os
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/libunwind/aux/ltmain.sh b/libunwind/aux/ltmain.sh
new file mode 100644
index 0000000..6fc6900
--- /dev/null
+++ b/libunwind/aux/ltmain.sh
@@ -0,0 +1,5107 @@
+# 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
+# Free Software Foundation, Inc.
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# 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 "$0" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+  # used as fallback echo
+  shift
+  cat <<EOF
+$*
+EOF
+  exit 0
+fi
+
+# The name of this program.
+progname=`$echo "$0" | ${SED} 's%^.*/%%'`
+modename="$progname"
+
+# Constants.
+PROGRAM=ltmain.sh
+PACKAGE=libtool
+VERSION=1.4.3
+TIMESTAMP=" (1.922.2.111 2002/10/23 02:54:36)"
+
+default_mode=
+help="Try \`$progname --help' for more information."
+magic="%%%MAGIC variable%%%"
+mkdir="mkdir"
+mv="mv -f"
+rm="rm -f"
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed="${SED}"' -e 1s/^X//'
+sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
+# test EBCDIC or ASCII                                                         
+case `echo A|od -x` in                                                         
+ *[Cc]1*) # EBCDIC based system                                                
+  SP2NL="tr '\100' '\n'"                                                       
+  NL2SP="tr '\r\n' '\100\100'"                                                 
+  ;;                                                                           
+ *) # Assume ASCII based system                                                
+  SP2NL="tr '\040' '\012'"                                                     
+  NL2SP="tr '\015\012' '\040\040'"                                             
+  ;;                                                                           
+esac                                                                           
+
+# NLS nuisances.
+# Only set LANG and LC_ALL to C if already set.
+# These must not be set unconditionally because not all systems understand
+# e.g. LANG=C (notably SCO).
+# We save the old values to restore during execute mode.
+if test "${LC_ALL+set}" = set; then
+  save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
+fi
+if test "${LANG+set}" = set; then
+  save_LANG="$LANG"; LANG=C; export LANG
+fi
+
+# Make sure IFS has a sensible default
+: ${IFS=" 	"}
+
+if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+  echo "$modename: not configured to build any kind of library" 1>&2
+  echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
+  exit 1
+fi
+
+# Global variables.
+mode=$default_mode
+nonopt=
+prev=
+prevopt=
+run=
+show="$echo"
+show_help=
+execute_dlfiles=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+
+# 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"
+      ;;
+    *)
+      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"
+    exit 0
+    ;;
+
+  --config)
+    ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
+    exit 0
+    ;;
+
+  --debug)
+    echo "$progname: enabling shell trace mode"
+    set -x
+    ;;
+
+  --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 0
+    ;;
+
+  --finish) mode="finish" ;;
+
+  --mode) prevopt="--mode" prev=mode ;;
+  --mode=*) mode="$optarg" ;;
+
+  --preserve-dup-deps) duplicate_deps="yes" ;;
+
+  --quiet | --silent)
+    show=:
+    ;;
+
+  -dlopen)
+    prevopt="-dlopen"
+    prev=execute_dlfiles
+    ;;
+
+  -*)
+    $echo "$modename: unrecognized option \`$arg'" 1>&2
+    $echo "$help" 1>&2
+    exit 1
+    ;;
+
+  *)
+    nonopt="$arg"
+    break
+    ;;
+  esac
+done
+
+if test -n "$prevopt"; then
+  $echo "$modename: option \`$prevopt' requires an argument" 1>&2
+  $echo "$help" 1>&2
+  exit 1
+fi
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end.  This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+if test -z "$show_help"; then
+
+  # Infer the operation mode.
+  if test -z "$mode"; then
+    case $nonopt in
+    *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 1
+  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=
+    prev=
+    lastarg=
+    srcfile="$nonopt"
+    suppress_output=
+
+    user_target=no
+    for arg
+    do
+      case $prev in
+      "") ;;
+      xcompiler)
+	# Aesthetically quote the previous argument.
+	prev=
+	lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+
+	case $arg in
+	# Double-quote args containing other shell metacharacters.
+	# Many Bourne shells cannot handle close brackets correctly
+	# in scan sets, so we specify it separately.
+	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	  arg="\"$arg\""
+	  ;;
+	esac
+
+	# Add the previous argument to base_compile.
+	if test -z "$base_compile"; then
+	  base_compile="$lastarg"
+	else
+	  base_compile="$base_compile $lastarg"
+	fi
+	continue
+	;;
+      esac
+
+      # Accept any command-line options.
+      case $arg in
+      -o)
+	if test "$user_target" != "no"; then
+	  $echo "$modename: you cannot specify \`-o' more than once" 1>&2
+	  exit 1
+	fi
+	user_target=next
+	;;
+
+      -static)
+	build_old_libs=yes
+	continue
+	;;
+
+      -prefer-pic)
+	pic_mode=yes
+	continue
+	;;
+
+      -prefer-non-pic)
+	pic_mode=no
+	continue
+	;;
+
+      -Xcompiler)
+	prev=xcompiler
+	continue
+	;;
+
+      -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.
+	if test -z "$base_compile"; then
+	  base_compile="$lastarg"
+	else
+	  base_compile="$base_compile $lastarg"
+	fi
+	continue
+	;;
+      esac
+
+      case $user_target in
+      next)
+	# The next one is the -o target name
+	user_target=yes
+	continue
+	;;
+      yes)
+	# We got the output file
+	user_target=set
+	libobj="$arg"
+	continue
+	;;
+      esac
+
+      # Accept the current argument as the source file.
+      lastarg="$srcfile"
+      srcfile="$arg"
+
+      # Aesthetically quote the previous argument.
+
+      # Backslashify any backslashes, double quotes, and dollar signs.
+      # These are the only characters that are still specially
+      # interpreted inside of double-quoted scrings.
+      lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
+
+      # Double-quote args containing other shell metacharacters.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      case $lastarg in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	lastarg="\"$lastarg\""
+	;;
+      esac
+
+      # Add the previous argument to base_compile.
+      if test -z "$base_compile"; then
+	base_compile="$lastarg"
+      else
+	base_compile="$base_compile $lastarg"
+      fi
+    done
+
+    case $user_target in
+    set)
+      ;;
+    no)
+      # Get the name of the library object.
+      libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
+      ;;
+    *)
+      $echo "$modename: you must specify a target with \`-o'" 1>&2
+      exit 1
+      ;;
+    esac
+
+    # Recognize several different file suffixes.
+    # If the user specifies -o file.o, it is replaced with file.lo
+    xform='[cCFSfmso]'
+    case $libobj in
+    *.ada) xform=ada ;;
+    *.adb) xform=adb ;;
+    *.ads) xform=ads ;;
+    *.asm) xform=asm ;;
+    *.c++) xform=c++ ;;
+    *.cc) xform=cc ;;
+    *.cpp) xform=cpp ;;
+    *.cxx) xform=cxx ;;
+    *.f90) xform=f90 ;;
+    *.for) xform=for ;;
+    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 1
+      ;;
+    esac
+
+    if test -z "$base_compile"; then
+      $echo "$modename: you must specify a compilation command" 1>&2
+      $echo "$help" 1>&2
+      exit 1
+    fi
+
+    # Delete any leftover library objects.
+    if test "$build_old_libs" = yes; then
+      removelist="$obj $libobj"
+    else
+      removelist="$libobj"
+    fi
+
+    $run $rm $removelist
+    trap "$run $rm $removelist; exit 1" 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 1" 1 2 15
+    else
+      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 "$0" "$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 1
+      fi
+      echo $srcfile > "$lockfile"
+    fi
+
+    if test -n "$fix_srcfile_path"; then
+      eval srcfile=\"$fix_srcfile_path\"
+    fi
+
+    # Only build a PIC object if we are building libtool libraries.
+    if test "$build_libtool_libs" = yes; then
+      # Without this assignment, base_compile gets emptied.
+      fbsd_hideous_sh_bug=$base_compile
+
+      if test "$pic_mode" != no; then
+	# All platforms use -DPIC, to notify preprocessed assembler code.
+	command="$base_compile $srcfile $pic_flag -DPIC"
+      else
+	# Don't build PIC code
+	command="$base_compile $srcfile"
+      fi
+      if test "$build_old_libs" = yes; then
+	lo_libobj="$libobj"
+	dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
+	if test "X$dir" = "X$libobj"; then
+	  dir="$objdir"
+	else
+	  dir="$dir/$objdir"
+	fi
+	libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
+
+	if test -d "$dir"; then
+	  $show "$rm $libobj"
+	  $run $rm $libobj
+	else
+	  $show "$mkdir $dir"
+	  $run $mkdir $dir
+	  status=$?
+	  if test $status -ne 0 && test ! -d $dir; then
+	    exit $status
+	  fi
+	fi
+      fi
+      if test "$compiler_o_lo" = yes; then
+	output_obj="$libobj"
+	command="$command -o $output_obj"
+      elif test "$compiler_c_o" = yes; then
+	output_obj="$obj"
+	command="$command -o $output_obj"
+      fi
+
+      $run $rm "$output_obj"
+      $show "$command"
+      if $run eval "$command"; then :
+      else
+	test -n "$output_obj" && $run $rm $removelist
+	exit 1
+      fi
+
+      if test "$need_locks" = warn &&
+	 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
+	echo "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$run $rm $removelist
+	exit 1
+      fi
+
+      # Just move the object if needed, then go on to compile the next one
+      if test x"$output_obj" != x"$libobj"; then
+	$show "$mv $output_obj $libobj"
+	if $run $mv $output_obj $libobj; then :
+	else
+	  error=$?
+	  $run $rm $removelist
+	  exit $error
+	fi
+      fi
+
+      # If we have no pic_flag, then copy the object into place and finish.
+      if (test -z "$pic_flag" || test "$pic_mode" != default) &&
+	 test "$build_old_libs" = yes; then
+	# Rename the .lo from within objdir to obj
+	if test -f $obj; then
+	  $show $rm $obj
+	  $run $rm $obj
+	fi
+
+	$show "$mv $libobj $obj"
+	if $run $mv $libobj $obj; then :
+	else
+	  error=$?
+	  $run $rm $removelist
+	  exit $error
+	fi
+
+	xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
+	if test "X$xdir" = "X$obj"; then
+	  xdir="."
+	else
+	  xdir="$xdir"
+	fi
+	baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
+	libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
+	# Now arrange that obj and lo_libobj become the same file
+	$show "(cd $xdir && $LN_S $baseobj $libobj)"
+	if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
+	  # Unlock the critical section if it was locked
+	  if test "$need_locks" != no; then
+	    $run $rm "$lockfile"
+	  fi
+	  exit 0
+	else
+	  error=$?
+	  $run $rm $removelist
+	  exit $error
+	fi
+      fi
+
+      # Allow error messages only from the first compilation.
+      suppress_output=' >/dev/null 2>&1'
+    fi
+
+    # Only build a position-dependent object if we build old libraries.
+    if test "$build_old_libs" = yes; then
+      if test "$pic_mode" != yes; then
+	# Don't build PIC code
+	command="$base_compile $srcfile"
+      else
+	# All platforms use -DPIC, to notify preprocessed assembler code.
+	command="$base_compile $srcfile $pic_flag -DPIC"
+      fi
+      if test "$compiler_c_o" = yes; then
+	command="$command -o $obj"
+	output_obj="$obj"
+      fi
+
+      # Suppress compiler output if we already did a PIC compilation.
+      command="$command$suppress_output"
+      $run $rm "$output_obj"
+      $show "$command"
+      if $run eval "$command"; then :
+      else
+	$run $rm $removelist
+	exit 1
+      fi
+
+      if test "$need_locks" = warn &&
+	 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
+	echo "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$run $rm $removelist
+	exit 1
+      fi
+
+      # Just move the object if needed
+      if 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
+
+      # Create an invalid libtool object if no PIC, so that we do not
+      # accidentally link it into a program.
+      if test "$build_libtool_libs" != yes; then
+	$show "echo timestamp > $libobj"
+	$run eval "echo timestamp > \$libobj" || exit $?
+      else
+	# Move the .lo from within objdir
+	$show "$mv $libobj $lo_libobj"
+	if $run $mv $libobj $lo_libobj; then :
+	else
+	  error=$?
+	  $run $rm $removelist
+	  exit $error
+	fi
+      fi
+    fi
+
+    # Unlock the critical section if it was locked
+    if test "$need_locks" != no; then
+      $run $rm "$lockfile"
+    fi
+
+    exit 0
+    ;;
+
+  # libtool link mode
+  link | relink)
+    modename="$modename: link"
+    case $host in
+    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+      # It is impossible to link a dll without this setting, and
+      # we shouldn't force the makefile maintainer to figure out
+      # which system we are compiling for in order to pass an extra
+      # flag for every libtool invokation.
+      # allow_undefined=no
+
+      # FIXME: Unfortunately, there are problems with the above when trying
+      # to make a dll which has undefined symbols, in which case not
+      # even a static library is built.  For now, we need to specify
+      # -no-undefined on the libtool link line when we can be certain
+      # that all symbols are satisfied, otherwise we get a static library.
+      allow_undefined=yes
+      ;;
+    *)
+      allow_undefined=yes
+      ;;
+    esac
+    libtool_args="$nonopt"
+    compile_command="$nonopt"
+    finalize_command="$nonopt"
+
+    compile_rpath=
+    finalize_rpath=
+    compile_shlibpath=
+    finalize_shlibpath=
+    convenience=
+    old_convenience=
+    deplibs=
+    old_deplibs=
+    compiler_flags=
+    linker_flags=
+    dllsearchpath=
+    lib_search_path=`pwd`
+    inst_prefix_dir=
+
+    avoid_version=no
+    dlfiles=
+    dlprefiles=
+    dlself=no
+    export_dynamic=no
+    export_symbols=
+    export_symbols_regex=
+    generated=
+    libobjs=
+    ltlibs=
+    module=no
+    no_install=no
+    objs=
+    prefer_static_libs=no
+    preload=no
+    prev=
+    prevarg=
+    release=
+    rpath=
+    xrpath=
+    perm_rpath=
+    temp_rpath=
+    thread_safe=no
+    vinfo=
+
+    # We need to know -static, to get the right output filenames.
+    for arg
+    do
+      case $arg in
+      -all-static | -static)
+	if test "X$arg" = "X-all-static"; then
+	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+	    $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
+	  fi
+	  if test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	else
+	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	fi
+	build_libtool_libs=no
+	build_old_libs=yes
+	prefer_static_libs=yes
+	break
+	;;
+      esac
+    done
+
+    # See if our shared archives depend on static archives.
+    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+    # Go through the arguments, transforming them on the way.
+    while test $# -gt 0; do
+      arg="$1"
+      shift
+      case $arg in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
+	;;
+      *) qarg=$arg ;;
+      esac
+      libtool_args="$libtool_args $qarg"
+
+      # If the previous option needs an argument, assign it.
+      if test -n "$prev"; then
+	case $prev in
+	output)
+	  compile_command="$compile_command @OUTPUT@"
+	  finalize_command="$finalize_command @OUTPUT@"
+	  ;;
+	esac
+
+	case $prev in
+	dlfiles|dlprefiles)
+	  if test "$preload" = no; then
+	    # Add the symbol object into the linking commands.
+	    compile_command="$compile_command @SYMFILE@"
+	    finalize_command="$finalize_command @SYMFILE@"
+	    preload=yes
+	  fi
+	  case $arg in
+	  *.la | *.lo) ;;  # We handle these cases below.
+	  force)
+	    if test "$dlself" = no; then
+	      dlself=needless
+	      export_dynamic=yes
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  self)
+	    if test "$prev" = dlprefiles; then
+	      dlself=yes
+	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+	      dlself=yes
+	    else
+	      dlself=needless
+	      export_dynamic=yes
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  *)
+	    if test "$prev" = dlfiles; then
+	      dlfiles="$dlfiles $arg"
+	    else
+	      dlprefiles="$dlprefiles $arg"
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  esac
+	  ;;
+	expsyms)
+	  export_symbols="$arg"
+	  if test ! -f "$arg"; then
+	    $echo "$modename: symbol file \`$arg' does not exist"
+	    exit 1
+	  fi
+	  prev=
+	  continue
+	  ;;
+	expsyms_regex)
+	  export_symbols_regex="$arg"
+	  prev=
+	  continue
+	  ;;
+	inst_prefix)
+	  inst_prefix_dir="$arg"
+	  prev=
+	  continue
+	  ;;
+	release)
+	  release="-$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 1
+	    ;;
+	  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
+	  ;;
+	*)
+	  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 1
+	fi
+	if test "X$arg" = "X-export-symbols"; then
+	  prev=expsyms
+	else
+	  prev=expsyms_regex
+	fi
+	continue
+	;;
+
+      -inst-prefix-dir)
+       prev=inst_prefix
+       continue
+       ;;
+
+      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+      # so, if we see these flags be careful not to treat them like -L
+      -L[A-Z][A-Z]*:*)
+	case $with_gcc/$host in
+	no/*-*-irix* | no/*-*-nonstopux*)
+	  compile_command="$compile_command $arg"
+	  finalize_command="$finalize_command $arg"
+	  ;;
+	esac
+	continue
+	;;
+
+      -L*)
+	dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
+	# We need an absolute path.
+	case $dir in
+	[\\/]* | [A-Za-z]:[\\/]*) ;;
+	*)
+	  absdir=`cd "$dir" && pwd`
+	  if test -z "$absdir"; then
+	    $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
+	    exit 1
+	  fi
+	  dir="$absdir"
+	  ;;
+	esac
+	case "$deplibs " in
+	*" -L$dir "*) ;;
+	*)
+	  deplibs="$deplibs -L$dir"
+	  lib_search_path="$lib_search_path $dir"
+	  ;;
+	esac
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+	  case :$dllsearchpath: in
+	  *":$dir:"*) ;;
+	  *) dllsearchpath="$dllsearchpath:$dir";;
+	  esac
+	  ;;
+	esac
+	continue
+	;;
+
+      -l*)
+	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+	  case $host in
+	  *-*-cygwin* | *-*-pw32* | *-*-beos*)
+	    # These systems don't actually have a C or math library (as such)
+	    continue
+	    ;;
+	  *-*-mingw* | *-*-os2*)
+	    # These systems don't actually have a C library (as such)
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  *-*-openbsd* | *-*-freebsd*)
+	    # Do not include libc due to us having libc/libc_r.
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  esac
+	 elif test "X$arg" = "X-lc_r"; then
+	  case $host in
+	 *-*-openbsd* | *-*-freebsd*)
+	    # Do not include libc_r directly, use -pthread flag.
+	    continue
+	    ;;
+	  esac
+	fi
+	deplibs="$deplibs $arg"
+	continue
+	;;
+
+      -module)
+	module=yes
+	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
+	;;
+
+      -o) prev=output ;;
+
+      -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 1
+	  ;;
+	esac
+	case "$xrpath " in
+	*" $dir "*) ;;
+	*) xrpath="$xrpath $dir" ;;
+	esac
+	continue
+	;;
+
+      -static)
+	# The effects of -static are defined in a previous loop.
+	# We used to do the same as -all-static on platforms that
+	# didn't have a PIC flag, but the assumption that the effects
+	# would be equivalent was wrong.  It would break on at least
+	# Digital Unix and AIX.
+	continue
+	;;
+
+      -thread-safe)
+	thread_safe=yes
+	continue
+	;;
+
+      -version-info)
+	prev=vinfo
+	continue
+	;;
+
+      -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
+	;;
+
+      # 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
+	;;
+
+      *.lo | *.$objext)
+	# A library or standard object.
+	if test "$prev" = dlfiles; then
+	  # This file was specified with -dlopen.
+	  if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+	    dlfiles="$dlfiles $arg"
+	    prev=
+	    continue
+	  else
+	    # If libtool objects are unsupported, then we need to preload.
+	    prev=dlprefiles
+	  fi
+	fi
+
+	if test "$prev" = dlprefiles; then
+	  # Preload the old-style object.
+	  dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
+	  prev=
+	else
+	  case $arg in
+	  *.lo) libobjs="$libobjs $arg" ;;
+	  *) objs="$objs $arg" ;;
+	  esac
+	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 1
+    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
+
+    # calculate the name of the file, without its directory
+    outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
+    libobjs_save="$libobjs"
+
+    if test -n "$shlibpath_var"; then
+      # get the directories listed in $shlibpath_var
+      eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
+    else
+      shlib_search_path=
+    fi
+    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+    output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
+    if test "X$output_objdir" = "X$output"; then
+      output_objdir="$objdir"
+    else
+      output_objdir="$output_objdir/$objdir"
+    fi
+    # Create the object directory.
+    if test ! -d $output_objdir; then
+      $show "$mkdir $output_objdir"
+      $run $mkdir $output_objdir
+      status=$?
+      if test $status -ne 0 && test ! -d $output_objdir; then
+	exit $status
+      fi
+    fi
+
+    # Determine the type of output
+    case $output in
+    "")
+      $echo "$modename: you must specify an output file" 1>&2
+      $echo "$help" 1>&2
+      exit 1
+      ;;
+    *.$libext) linkmode=oldlib ;;
+    *.lo | *.$objext) linkmode=obj ;;
+    *.la) linkmode=lib ;;
+    *) linkmode=prog ;; # Anything else should be a program.
+    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
+    deplibs=
+    newdependency_libs=
+    newlib_search_path=
+    need_relink=no # whether we're linking any uninstalled libtool libraries
+    notinst_deplibs= # not-installed libtool libraries
+    notinst_path= # paths that contain not-installed libtool libraries
+    case $linkmode in
+    lib)
+	passes="conv link"
+	for file in $dlfiles $dlprefiles; do
+	  case $file in
+	  *.la) ;;
+	  *)
+	    $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
+	    exit 1
+	    ;;
+	  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 = prog; then
+	# Determine which files to process
+	case $pass in
+	dlopen)
+	  libs="$dlfiles"
+	  save_deplibs="$deplibs" # Collect dlpreopened libraries
+	  deplibs=
+	  ;;
+	dlpreopen) libs="$dlprefiles" ;;
+	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+	esac
+      fi
+      for deplib in $libs; do
+	lib=
+	found=no
+	case $deplib in
+	-l*)
+	  if test $linkmode = oldlib && test $linkmode = obj; then
+	    $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
+	    continue
+	  fi
+	  if test $pass = conv; then
+	    deplibs="$deplib $deplibs"
+	    continue
+	  fi
+	  name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
+	  for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
+	    # Search the libtool library
+	    lib="$searchdir/lib${name}.la"
+	    if test -f "$lib"; then
+	      found=yes
+	      break
+	    fi
+	  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
+	  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"
+	      newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+	    else
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    fi
+	    ;;
+	  *)
+	    $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
+	    ;;
+	  esac # linkmode
+	  continue
+	  ;; # -L
+	-R*)
+	  if test $pass = link; then
+	    dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
+	    # Make sure the xrpath contains only unique directories.
+	    case "$xrpath " in
+	    *" $dir "*) ;;
+	    *) xrpath="$xrpath $dir" ;;
+	    esac
+	  fi
+	  deplibs="$deplib $deplibs"
+	  continue
+	  ;;
+	*.la) lib="$deplib" ;;
+	*.$libext)
+	  if test $pass = conv; then
+	    deplibs="$deplib $deplibs"
+	    continue
+	  fi
+	  case $linkmode in
+	  lib)
+	    if test "$deplibs_check_method" != pass_all; then
+	      echo
+	      echo "*** Warning: Trying to link with static lib archive $deplib."
+	      echo "*** I have the capability to make that library automatically link in when"
+	      echo "*** you link to this library.  But I can only do this if you have a"
+	      echo "*** shared version of the library, which you do not appear to have"
+	      echo "*** because the file extensions .$libext of this argument makes me believe"
+	      echo "*** that it is just a static archive that I should not used here."
+	    else
+	      echo
+	      echo "*** Warning: Linking the shared library $output against the"
+	      echo "*** static library $deplib is not portable!"
+	      deplibs="$deplib $deplibs"
+	    fi
+	    continue
+	    ;;
+	  prog)
+	    if test $pass != link; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    fi
+	    continue
+	    ;;
+	  esac # linkmode
+	  ;; # *.$libext
+	*.lo | *.$objext)
+	  if test $pass = 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
+	  continue
+	  ;;
+	%DEPLIBS%)
+	  alldeplibs=yes
+	  continue
+	  ;;
+	esac # case $deplib
+	if test $found = yes || test -f "$lib"; then :
+	else
+	  $echo "$modename: cannot find the library \`$lib'" 1>&2
+	  exit 1
+	fi
+
+	# Check to see that this really is a libtool archive.
+	if (${SED} -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+	else
+	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+	  exit 1
+	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 variable installed.
+	installed=yes
+
+	# Read the .la file
+	case $lib in
+	*/* | *\\*) . $lib ;;
+	*) . ./$lib ;;
+	esac
+
+	if test "$linkmode,$pass" = "lib,link" ||
+	   test "$linkmode,$pass" = "prog,scan" ||
+	   { test $linkmode = oldlib && test $linkmode = obj; }; then
+	   # Add dl[pre]opened files of deplib
+	  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 1
+	    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 1
+	  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 1
+	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 1
+	  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.
+	    dlprefiles="$dlprefiles $lib"
+	  else
+	    newdlfiles="$newdlfiles $lib"
+	  fi
+	  continue
+	fi # $pass = dlopen
+
+	# We need an absolute path.
+	case $ladir in
+	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+	*)
+	  abs_ladir=`cd "$ladir" && pwd`
+	  if test -z "$abs_ladir"; then
+	    $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
+	    $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
+	    abs_ladir="$ladir"
+	  fi
+	  ;;
+	esac
+	laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+
+	# Find the relevant object directory and library name.
+	if test "X$installed" = Xyes; then
+	  if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+	    $echo "$modename: warning: library \`$lib' was moved." 1>&2
+	    dir="$ladir"
+	    absdir="$abs_ladir"
+	    libdir="$abs_ladir"
+	  else
+	    dir="$libdir"
+	    absdir="$libdir"
+	  fi
+	else
+	  dir="$ladir/$objdir"
+	  absdir="$abs_ladir/$objdir"
+	  # Remove this search path later
+	  notinst_path="$notinst_path $abs_ladir"
+	fi # $installed = yes
+	name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+
+	# This library was specified with -dlpreopen.
+	if test $pass = dlpreopen; then
+	  if test -z "$libdir"; then
+	    $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
+	    exit 1
+	  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"
+	  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...
+
+	link_static=no # Whether the deplib will be linked statically
+	if test -n "$library_names" &&
+	   { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+	  # Link against this shared library
+
+	  if test "$linkmode,$pass" = "prog,link" ||
+	   { 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
+	    if test $linkmode = prog; then
+	      # We need to hardcode the library path
+	      if test -n "$shlibpath_var"; then
+		# Make sure the rpath contains only unique directories.
+		case "$temp_rpath " in
+		*" $dir "*) ;;
+		*" $absdir "*) ;;
+		*) temp_rpath="$temp_rpath $dir" ;;
+		esac
+	      fi
+	    fi
+	  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
+
+	  if test "$installed" = no; then
+	    notinst_deplibs="$notinst_deplibs $lib"
+	    need_relink=yes
+	  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*)
+		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='~'
+	      eval cmds=\"$extract_expsyms_cmds\"
+	      for cmd in $cmds; do
+		IFS="$save_ifs"
+		$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='~'
+	      eval cmds=\"$old_archive_from_expsyms_cmds\"
+	      for cmd in $cmds; do
+		IFS="$save_ifs"
+		$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"
+	      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="-L$inst_prefix_dir$libdir $add_dir"
+		    ;;
+		  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 1
+	    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"
+	    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="-L$inst_prefix_dir$libdir $add_dir"
+		  ;;
+		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
+	  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
+
+	  # Try to link the static library
+	  # Here we assume that one of hardcode_direct or hardcode_minus_L
+	  # is not unsupported.  This is valid on all known static and
+	  # shared platforms.
+	  if test "$hardcode_direct" != unsupported; then
+	    test -n "$old_library" && linklib="$old_library"
+	    compile_deplibs="$dir/$linklib $compile_deplibs"
+	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
+	  else
+	    compile_deplibs="-l$name -L$dir $compile_deplibs"
+	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+	  fi
+	elif test "$build_libtool_libs" = yes; then
+	  # Not a shared library
+	  if test "$deplibs_check_method" != pass_all; then
+	    # We're trying link a shared library against a static one
+	    # but the system doesn't support it.
+
+	    # Just print a warning and add the library to dependency_libs so
+	    # that the program can be linked against the static library.
+	    echo
+	    echo "*** Warning: This system can not link to static lib archive $lib."
+	    echo "*** I have the capability to make that library automatically link in when"
+	    echo "*** you link to this library.  But I can only do this if you have a"
+	    echo "*** shared version of the library, which you do not appear to have."
+	    if test "$module" = yes; then
+	      echo "*** But as you try to build a module library, libtool will still create "
+	      echo "*** a static module, that should work as long as the dlopening application"
+	      echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+	      if test -z "$global_symbol_pipe"; then
+		echo
+		echo "*** However, this would only work if libtool was able to extract symbol"
+		echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+		echo "*** not find such a program.  So, this module is probably useless."
+		echo "*** \`nm' from GNU binutils and a full rebuild may help."
+	      fi
+	      if test "$build_old_libs" = no; then
+		build_libtool_libs=module
+		build_old_libs=yes
+	      else
+		build_libtool_libs=no
+	      fi
+	    fi
+	  else
+	    convenience="$convenience $dir/$old_library"
+	    old_convenience="$old_convenience $dir/$old_library"
+	    deplibs="$dir/$old_library $deplibs"
+	    link_static=yes
+	  fi
+	fi # link shared/static library?
+
+	if test $linkmode = lib; then
+	  if test -n "$dependency_libs" &&
+	     { test $hardcode_into_libs != yes || test $build_old_libs = yes ||
+	       test $link_static = yes; }; then
+	    # Extract -R from dependency_libs
+	    temp_deplibs=
+	    for libdir in $dependency_libs; do
+	      case $libdir in
+	      -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
+		   case " $xrpath " in
+		   *" $temp_xrpath "*) ;;
+		   *) xrpath="$xrpath $temp_xrpath";;
+		   esac;;
+	      *) temp_deplibs="$temp_deplibs $libdir";;
+	      esac
+	    done
+	    dependency_libs="$temp_deplibs"
+	  fi
+
+	  newlib_search_path="$newlib_search_path $absdir"
+	  # Link against this library
+	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+	  # ... and its dependency_libs
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    newdependency_libs="$deplib $newdependency_libs"
+	    if test "X$duplicate_deps" = "Xyes" ; then
+	      case "$tmp_libs " in
+	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	      esac
+	    fi
+	    tmp_libs="$tmp_libs $deplib"
+	  done
+
+	  if test $link_all_deplibs != no; then
+	    # Add the search paths of all dependency libraries
+	    for deplib in $dependency_libs; do
+	      case $deplib in
+	      -L*) path="$deplib" ;;
+	      *.la)
+		dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
+		test "X$dir" = "X$deplib" && dir="."
+		# We need an absolute path.
+		case $dir in
+		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+		*)
+		  absdir=`cd "$dir" && pwd`
+		  if test -z "$absdir"; then
+		    $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
+		    absdir="$dir"
+		  fi
+		  ;;
+		esac
+		if grep "^installed=no" $deplib > /dev/null; then
+		  path="-L$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 1
+		  fi
+		  if test "$absdir" != "$libdir"; then
+		    $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
+		  fi
+		  path="-L$absdir"
+		fi
+		;;
+	      *) continue ;;
+	      esac
+	      case " $deplibs " in
+	      *" $path "*) ;;
+	      *) deplibs="$deplibs $path" ;;
+	      esac
+	    done
+	  fi # link_all_deplibs != no
+	fi # linkmode = lib
+      done # for deplib in $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
+	test $pass != scan && dependency_libs="$newdependency_libs"
+	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
+	    case $deplib in
+	    -L*) new_libs="$deplib $new_libs" ;;
+	    *)
+	      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
+      if test "$pass" = "conv" &&
+       { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then
+	libs="$deplibs" # reset libs
+	deplibs=
+      fi
+    done # for pass
+    if test $linkmode = prog; then
+      dlfiles="$newdlfiles"
+      dlprefiles="$newdlprefiles"
+    fi
+
+    case $linkmode in
+    oldlib)
+      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' 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 libname=\"$libname_spec\"
+	;;
+      *)
+	if test "$module" = no; then
+	  $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
+	  $echo "$help" 1>&2
+	  exit 1
+	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 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 1
+	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.
+	  libext=al
+	  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' 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 1
+	fi
+
+	current="$2"
+	revision="$3"
+	age="$4"
+
+	# 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]) ;;
+	*)
+	  $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
+	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+	  exit 1
+	  ;;
+	esac
+
+	case $revision in
+	0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
+	*)
+	  $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
+	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+	  exit 1
+	  ;;
+	esac
+
+	case $age in
+	0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
+	*)
+	  $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
+	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+	  exit 1
+	  ;;
+	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 1
+	fi
+
+	# Calculate the version variables.
+	major=
+	versuffix=
+	verstring=
+	case $version_type in
+	none) ;;
+
+	darwin)
+	  # Like Linux, but with the current version available in
+	  # verstring for coding it into the library header
+	  major=.`expr $current - $age`
+	  versuffix="$major.$age.$revision"
+	  # Darwin ld doesn't like 0 for these options...
+	  minor_current=`expr $current + 1`
+	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+	  ;;
+
+	freebsd-aout)
+	  major=".$current"
+	  versuffix=".$current.$revision";
+	  ;;
+
+	freebsd-elf)
+	  major=".$current"
+	  versuffix=".$current";
+	  ;;
+
+	irix | nonstopux)
+	  major=`expr $current - $age + 1`
+
+	  case $version_type in
+	    nonstopux) verstring_prefix=nonstopux ;;
+	    *)         verstring_prefix=sgi ;;
+	  esac
+	  verstring="$verstring_prefix$major.$revision"
+
+	  # Add in all the interfaces that we are compatible with.
+	  loop=$revision
+	  while test $loop != 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 != 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 1
+	  ;;
+	esac
+
+	# Clear the version info if we defaulted, and they specified a release.
+	if test -z "$vinfo" && test -n "$release"; then
+	  major=
+	  verstring="0.0"
+	  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.
+	$show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
+	$run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
+      fi
+
+      # Now set the variables for building old libraries.
+      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+	oldlibs="$oldlibs $output_objdir/$libname.$libext"
+
+	# Transform .lo files to .o files.
+	oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
+      fi
+
+      # Eliminate all temporary directories.
+      for path in $notinst_path; do
+	lib_search_path=`echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
+	deplibs=`echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
+	dependency_libs=`echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
+      done
+
+      if test -n "$xrpath"; then
+	# If the user specified any rpath flags, then add them.
+	temp_xrpath=
+	for libdir in $xrpath; do
+	  temp_xrpath="$temp_xrpath -R$libdir"
+	  case "$finalize_rpath " in
+	  *" $libdir "*) ;;
+	  *) finalize_rpath="$finalize_rpath $libdir" ;;
+	  esac
+	done
+	if test $hardcode_into_libs != yes || test $build_old_libs = yes; then
+	  dependency_libs="$temp_xrpath $dependency_libs"
+	fi
+      fi
+
+      # Make sure dlfiles contains only unique files that won't be dlpreopened
+      old_dlfiles="$dlfiles"
+      dlfiles=
+      for lib in $old_dlfiles; do
+	case " $dlprefiles $dlfiles " in
+	*" $lib "*) ;;
+	*) dlfiles="$dlfiles $lib" ;;
+	esac
+      done
+
+      # Make sure dlprefiles contains only unique files
+      old_dlprefiles="$dlprefiles"
+      dlprefiles=
+      for lib in $old_dlprefiles; do
+	case "$dlprefiles " in
+	*" $lib "*) ;;
+	*) dlprefiles="$dlprefiles $lib" ;;
+	esac
+      done
+
+      if test "$build_libtool_libs" = yes; then
+	if test -n "$rpath"; then
+	  case $host in
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
+	    # these systems don't actually have a c library (as such)!
+	    ;;
+	  *-*-rhapsody* | *-*-darwin1.[012])
+	    # Rhapsody C library is in the System framework
+	    deplibs="$deplibs -framework System"
+	    ;;
+	  *-*-netbsd*)
+	    # Don't link with libc until the a.out ld.so is fixed.
+	    ;;
+	  *-*-openbsd* | *-*-freebsd*)
+	    # Do not include libc due to us having libc/libc_r.
+	    ;;
+	  *)
+	    # 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 behaviour.
+	  newdeplibs=$deplibs
+	  ;;
+	test_compile)
+	  # This code stresses the "libraries are programs" paradigm to its
+	  # limits. Maybe even breaks it.  We compile a program, linking it
+	  # against the deplibs as a proxy for the library.  Then we can check
+	  # whether they linked in statically or dynamically with ldd.
+	  $rm conftest.c
+	  cat > conftest.c <<EOF
+	  int main() { return 0; }
+EOF
+	  $rm conftest
+	  $CC -o conftest conftest.c $deplibs
+	  if test $? -eq 0 ; then
+	    ldd_output=`ldd conftest`
+	    for i in $deplibs; do
+	      name="`expr $i : '-l\(.*\)'`"
+	      # If $name is empty we are operating on a -L argument.
+	      if test -n "$name" && test "$name" != "0"; then
+		libname=`eval \\$echo \"$libname_spec\"`
+		deplib_matches=`eval \\$echo \"$library_names_spec\"`
+		set dummy $deplib_matches
+		deplib_match=$2
+		if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		  newdeplibs="$newdeplibs $i"
+		else
+		  droppeddeps=yes
+		  echo
+		  echo "*** Warning: dynamic linker does not accept needed library $i."
+		  echo "*** I have the capability to make that library automatically link in when"
+		  echo "*** you link to this library.  But I can only do this if you have a"
+		  echo "*** shared version of the library, which I believe you do not have"
+		  echo "*** because a test_compile did reveal that the linker did not use it for"
+		  echo "*** its dynamic dependency list that programs get resolved with at runtime."
+		fi
+	      else
+		newdeplibs="$newdeplibs $i"
+	      fi
+	    done
+	  else
+	    # Error occured in the first compile.  Let's try to salvage
+	    # the situation: Compile a separate program for each library.
+	    for i in $deplibs; do
+	      name="`expr $i : '-l\(.*\)'`"
+	     # If $name is empty we are operating on a -L argument.
+	      if test -n "$name" && test "$name" != "0"; then
+		$rm conftest
+		$CC -o conftest conftest.c $i
+		# Did it work?
+		if test $? -eq 0 ; then
+		  ldd_output=`ldd conftest`
+		  libname=`eval \\$echo \"$libname_spec\"`
+		  deplib_matches=`eval \\$echo \"$library_names_spec\"`
+		  set dummy $deplib_matches
+		  deplib_match=$2
+		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		    newdeplibs="$newdeplibs $i"
+		  else
+		    droppeddeps=yes
+		    echo
+		    echo "*** Warning: dynamic linker does not accept needed library $i."
+		    echo "*** I have the capability to make that library automatically link in when"
+		    echo "*** you link to this library.  But I can only do this if you have a"
+		    echo "*** shared version of the library, which you do not appear to have"
+		    echo "*** because a test_compile did reveal that the linker did not use this one"
+		    echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+		  fi
+		else
+		  droppeddeps=yes
+		  echo
+		  echo "*** Warning!  Library $i is needed by this library but I was not able to"
+		  echo "***  make it link in!  You will probably need to install it or some"
+		  echo "*** library that it depends on before this library will be fully"
+		  echo "*** functional.  Installing it before continuing would be even better."
+		fi
+	      else
+		newdeplibs="$newdeplibs $i"
+	      fi
+	    done
+	  fi
+	  ;;
+	file_magic*)
+	  set dummy $deplibs_check_method
+	  file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+	  for a_deplib in $deplibs; do
+	    name="`expr $a_deplib : '-l\(.*\)'`"
+	    # If $name is empty we are operating on a -L argument.
+	    if test -n "$name" && test "$name" != "0"; then
+	      libname=`eval \\$echo \"$libname_spec\"`
+	      for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+		    potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+		    for potent_lib in $potential_libs; do
+		      # Follow soft links.
+		      if ls -lLd "$potent_lib" 2>/dev/null \
+			 | grep " -> " >/dev/null; then
+			continue
+		      fi
+		      # The statement above tries to avoid entering an
+		      # endless loop below, in case of cyclic links.
+		      # We might still enter an endless loop, since a link
+		      # loop can be closed while we follow links,
+		      # but so what?
+		      potlib="$potent_lib"
+		      while test -h "$potlib" 2>/dev/null; do
+			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+			case $potliblink in
+			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+			*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
+			esac
+		      done
+		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
+			 | ${SED} 10q \
+			 | egrep "$file_magic_regex" > /dev/null; then
+			newdeplibs="$newdeplibs $a_deplib"
+			a_deplib=""
+			break 2
+		      fi
+		    done
+	      done
+	      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
+	      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 below 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
+	      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=""
+	  if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
+	       -e 's/ -[LR][^ ]*//g' -e 's/[ 	]//g' |
+	     grep . >/dev/null; then
+	    echo
+	    if test "X$deplibs_check_method" = "Xnone"; then
+	      echo "*** Warning: inter-library dependencies are not supported in this platform."
+	    else
+	      echo "*** Warning: inter-library dependencies are not known to be supported."
+	    fi
+	    echo "*** All declared inter-library dependencies are being dropped."
+	    droppeddeps=yes
+	  fi
+	  ;;
+	esac
+	versuffix=$versuffix_save
+	major=$major_save
+	release=$release_save
+	libname=$libname_save
+	name=$name_save
+
+	case $host in
+	*-*-rhapsody* | *-*-darwin1.[012])
+	  # On Rhapsody replace the C library is the System framework
+	  newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
+	  ;;
+	esac
+
+	if test "$droppeddeps" = yes; then
+	  if test "$module" = yes; then
+	    echo
+	    echo "*** Warning: libtool could not satisfy all declared inter-library"
+	    echo "*** dependencies of module $libname.  Therefore, libtool will create"
+	    echo "*** a static module, that should work as long as the dlopening"
+	    echo "*** application is linked with the -dlopen flag."
+	    if test -z "$global_symbol_pipe"; then
+	      echo
+	      echo "*** However, this would only work if libtool was able to extract symbol"
+	      echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+	      echo "*** not find such a program.  So, this module is probably useless."
+	      echo "*** \`nm' from GNU binutils and a full rebuild may help."
+	    fi
+	    if test "$build_old_libs" = no; then
+	      oldlibs="$output_objdir/$libname.$libext"
+	      build_libtool_libs=module
+	      build_old_libs=yes
+	    else
+	      build_libtool_libs=no
+	    fi
+	  else
+	    echo "*** The inter-library dependencies that have been dropped here will be"
+	    echo "*** automatically added whenever a program is linked with this library"
+	    echo "*** or is declared to -dlopen it."
+
+	    if test $allow_undefined = no; then
+	      echo
+	      echo "*** Since this library must not contain undefined symbols,"
+	      echo "*** because either the platform does not support them or"
+	      echo "*** it was explicitly requested with -no-undefined,"
+	      echo "*** libtool will only create a static version of it."
+	      if test "$build_old_libs" = no; then
+		oldlibs="$output_objdir/$libname.$libext"
+		build_libtool_libs=module
+		build_old_libs=yes
+	      else
+		build_libtool_libs=no
+	      fi
+	    fi
+	  fi
+	fi
+	# Done checking deplibs!
+	deplibs=$newdeplibs
+      fi
+
+      # All the library-specific variables (install_libdir is set above).
+      library_names=
+      old_library=
+      dlname=
+
+      # Test again, we may have decided not to build it any more
+      if test "$build_libtool_libs" = yes; then
+	if test $hardcode_into_libs = yes; then
+	  # Hardcode the library paths
+	  hardcode_libdirs=
+	  dep_rpath=
+	  rpath="$finalize_rpath"
+	  test "$mode" != relink && rpath="$compile_rpath$rpath"
+	  for libdir in $rpath; do
+	    if test -n "$hardcode_libdir_flag_spec"; then
+	      if test -n "$hardcode_libdir_separator"; then
+		if test -z "$hardcode_libdirs"; then
+		  hardcode_libdirs="$libdir"
+		else
+		  # Just accumulate the unique libdirs.
+		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		    ;;
+		  *)
+		    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		    ;;
+		  esac
+		fi
+	      else
+		eval flag=\"$hardcode_libdir_flag_spec\"
+		dep_rpath="$dep_rpath $flag"
+	      fi
+	    elif test -n "$runpath_var"; then
+	      case "$perm_rpath " in
+	      *" $libdir "*) ;;
+	      *) perm_rpath="$perm_rpath $libdir" ;;
+	      esac
+	    fi
+	  done
+	  # Substitute the hardcoded libdirs into the rpath.
+	  if test -n "$hardcode_libdir_separator" &&
+	     test -n "$hardcode_libdirs"; then
+	    libdir="$hardcode_libdirs"
+	    eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+	  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 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
+	test -z "$dlname" && dlname=$soname
+
+	lib="$output_objdir/$realname"
+	for link
+	do
+	  linknames="$linknames $link"
+	done
+
+	# Ensure that we have .o objects for linkers which dislike .lo
+	# (e.g. aix) in case we are running --disable-static
+	for obj in $libobjs; do
+	  xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
+	  if test "X$xdir" = "X$obj"; then
+	    xdir="."
+	  else
+	    xdir="$xdir"
+	  fi
+	  baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+	  oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
+	  if test ! -f $xdir/$oldobj; then
+	    $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
+	    $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
+	  fi
+	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
+	    eval cmds=\"$export_symbols_cmds\"
+	    save_ifs="$IFS"; IFS='~'
+	    for cmd in $cmds; do
+	      IFS="$save_ifs"
+	      $show "$cmd"
+	      $run eval "$cmd" || exit $?
+	    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
+
+	if test -n "$convenience"; then
+	  if test -n "$whole_archive_flag_spec"; then
+	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+	  else
+	    gentop="$output_objdir/${outputname}x"
+	    $show "${rm}r $gentop"
+	    $run ${rm}r "$gentop"
+	    $show "mkdir $gentop"
+	    $run mkdir "$gentop"
+	    status=$?
+	    if test $status -ne 0 && test ! -d "$gentop"; then
+	      exit $status
+	    fi
+	    generated="$generated $gentop"
+
+	    for xlib in $convenience; do
+	      # Extract the objects.
+	      case $xlib in
+	      [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+	      *) xabs=`pwd`"/$xlib" ;;
+	      esac
+	      xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
+	      xdir="$gentop/$xlib"
+
+	      $show "${rm}r $xdir"
+	      $run ${rm}r "$xdir"
+	      $show "mkdir $xdir"
+	      $run mkdir "$xdir"
+	      status=$?
+	      if test $status -ne 0 && test ! -d "$xdir"; then
+		exit $status
+	      fi
+	      $show "(cd $xdir && $AR x $xabs)"
+	      $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+
+	      libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
+	    done
+	  fi
+	fi
+
+	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+	  eval flag=\"$thread_safe_flag_spec\"
+	  linker_flags="$linker_flags $flag"
+	fi
+
+	# Make a backup of the uninstalled library when relinking
+	if test "$mode" = relink; then
+	  $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
+	fi
+
+	# Do each of the archive commands.
+	if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+	  eval cmds=\"$archive_expsym_cmds\"
+	else
+	  save_deplibs="$deplibs"
+	  for conv in $convenience; do
+	    tmp_deplibs=
+	    for test_deplib in $deplibs; do
+	      if test "$test_deplib" != "$conv"; then
+		tmp_deplibs="$tmp_deplibs $test_deplib"
+	      fi
+	    done
+	    deplibs="$tmp_deplibs"
+	  done
+	  eval cmds=\"$archive_cmds\"
+	  deplibs="$save_deplibs"
+	fi
+	save_ifs="$IFS"; IFS='~'
+	for cmd in $cmds; do
+	  IFS="$save_ifs"
+	  $show "$cmd"
+	  $run eval "$cmd" || exit $?
+	done
+	IFS="$save_ifs"
+
+	# Restore the uninstalled library and exit
+	if test "$mode" = relink; then
+	  $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
+	  exit 0
+	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 1
+	fi
+	libobj="$output"
+	obj=`$echo "X$output" | $Xsed -e "$lo2o"`
+	;;
+      *)
+	libobj=
+	obj="$output"
+	;;
+      esac
+
+      # Delete the old objects.
+      $run $rm $obj $libobj
+
+      # Objects from convenience libraries.  This assumes
+      # single-version convenience libraries.  Whenever we create
+      # different ones for PIC/non-PIC, this we'll have to duplicate
+      # the extraction.
+      reload_conv_objs=
+      gentop=
+      # reload_cmds runs $LD directly, so let us get rid of
+      # -Wl from whole_archive_flag_spec
+      wl=
+
+      if test -n "$convenience"; then
+	if test -n "$whole_archive_flag_spec"; then
+	  eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
+	else
+	  gentop="$output_objdir/${obj}x"
+	  $show "${rm}r $gentop"
+	  $run ${rm}r "$gentop"
+	  $show "mkdir $gentop"
+	  $run mkdir "$gentop"
+	  status=$?
+	  if test $status -ne 0 && test ! -d "$gentop"; then
+	    exit $status
+	  fi
+	  generated="$generated $gentop"
+
+	  for xlib in $convenience; do
+	    # Extract the objects.
+	    case $xlib in
+	    [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+	    *) xabs=`pwd`"/$xlib" ;;
+	    esac
+	    xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
+	    xdir="$gentop/$xlib"
+
+	    $show "${rm}r $xdir"
+	    $run ${rm}r "$xdir"
+	    $show "mkdir $xdir"
+	    $run mkdir "$xdir"
+	    status=$?
+	    if test $status -ne 0 && test ! -d "$xdir"; then
+	      exit $status
+	    fi
+	    $show "(cd $xdir && $AR x $xabs)"
+	    $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+
+	    reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
+	  done
+	fi
+      fi
+
+      # Create the old-style object.
+      reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+      output="$obj"
+      eval cmds=\"$reload_cmds\"
+      save_ifs="$IFS"; IFS='~'
+      for cmd in $cmds; do
+	IFS="$save_ifs"
+	$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 0
+      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 0
+      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"
+	eval cmds=\"$reload_cmds\"
+	save_ifs="$IFS"; IFS='~'
+	for cmd in $cmds; do
+	  IFS="$save_ifs"
+	  $show "$cmd"
+	  $run eval "$cmd" || exit $?
+	done
+	IFS="$save_ifs"
+      else
+	# Just create a symlink.
+	$show $rm $libobj
+	$run $rm $libobj
+	xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
+	if test "X$xdir" = "X$libobj"; then
+	  xdir="."
+	else
+	  xdir="$xdir"
+	fi
+	baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
+	oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
+	$show "(cd $xdir && $LN_S $oldobj $baseobj)"
+	$run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
+      fi
+
+      if test -n "$gentop"; then
+	$show "${rm}r $gentop"
+	$run ${rm}r $gentop
+      fi
+
+      exit 0
+      ;;
+
+    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 /'`
+	case $host in
+	*darwin*)
+	  # Don't allow lazy linking, it breaks C++ global constructors
+	  compile_command="$compile_command ${wl}-bind_at_load"
+	  finalize_command="$finalize_command ${wl}-bind_at_load"
+	  ;;
+	esac
+	;;
+      esac
+
+      compile_command="$compile_command $compile_deplibs"
+      finalize_command="$finalize_command $finalize_deplibs"
+
+      if test -n "$rpath$xrpath"; then
+	# If the user specified any rpath flags, then add them.
+	for libdir in $rpath $xrpath; do
+	  # This is the magic to use -rpath.
+	  case "$finalize_rpath " in
+	  *" $libdir "*) ;;
+	  *) finalize_rpath="$finalize_rpath $libdir" ;;
+	  esac
+	done
+      fi
+
+      # Now hardcode the library paths
+      rpath=
+      hardcode_libdirs=
+      for libdir in $compile_rpath $finalize_rpath; do
+	if test -n "$hardcode_libdir_flag_spec"; then
+	  if test -n "$hardcode_libdir_separator"; then
+	    if test -z "$hardcode_libdirs"; then
+	      hardcode_libdirs="$libdir"
+	    else
+	      # Just accumulate the unique libdirs.
+	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		;;
+	      *)
+		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		;;
+	      esac
+	    fi
+	  else
+	    eval flag=\"$hardcode_libdir_flag_spec\"
+	    rpath="$rpath $flag"
+	  fi
+	elif test -n "$runpath_var"; then
+	  case "$perm_rpath " in
+	  *" $libdir "*) ;;
+	  *) perm_rpath="$perm_rpath $libdir" ;;
+	  esac
+	fi
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+	  case :$dllsearchpath: in
+	  *":$libdir:"*) ;;
+	  *) dllsearchpath="$dllsearchpath:$libdir";;
+	  esac
+	  ;;
+	esac
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+	 test -n "$hardcode_libdirs"; then
+	libdir="$hardcode_libdirs"
+	eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      compile_rpath="$rpath"
+
+      rpath=
+      hardcode_libdirs=
+      for libdir in $finalize_rpath; do
+	if test -n "$hardcode_libdir_flag_spec"; then
+	  if test -n "$hardcode_libdir_separator"; then
+	    if test -z "$hardcode_libdirs"; then
+	      hardcode_libdirs="$libdir"
+	    else
+	      # Just accumulate the unique libdirs.
+	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		;;
+	      *)
+		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		;;
+	      esac
+	    fi
+	  else
+	    eval flag=\"$hardcode_libdir_flag_spec\"
+	    rpath="$rpath $flag"
+	  fi
+	elif test -n "$runpath_var"; then
+	  case "$finalize_perm_rpath " in
+	  *" $libdir "*) ;;
+	  *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
+	  esac
+	fi
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+	 test -n "$hardcode_libdirs"; then
+	libdir="$hardcode_libdirs"
+	eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      finalize_rpath="$rpath"
+
+      if test -n "$libobjs" && test "$build_old_libs" = yes; then
+	# Transform all the library objects into standard objects.
+	compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+	finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+      fi
+
+      dlsyms=
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	if test -n "$NM" && test -n "$global_symbol_pipe"; then
+	  dlsyms="${outputname}S.c"
+	else
+	  $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
+	fi
+      fi
+
+      if test -n "$dlsyms"; then
+	case $dlsyms in
+	"") ;;
+	*.c)
+	  # Discover the nlist of each of the dlfiles.
+	  nlist="$output_objdir/${outputname}.nm"
+
+	  $show "$rm $nlist ${nlist}S ${nlist}T"
+	  $run $rm "$nlist" "${nlist}S" "${nlist}T"
+
+	  # Parse the name list into a source file.
+	  $show "creating $output_objdir/$dlsyms"
+
+	  test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
+/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
+/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+/* Prevent the only kind of declaration conflicts we can make. */
+#define lt_preloaded_symbols some_other_symbol
+
+/* External symbol declarations for the compiler. */\
+"
+
+	  if test "$dlself" = yes; then
+	    $show "generating symbol list for \`$output'"
+
+	    test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
+
+	    # Add our own program objects to the symbol list.
+	    progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+	    for arg in $progfiles; do
+	      $show "extracting global C symbols from \`$arg'"
+	      $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+	    done
+
+	    if test -n "$exclude_expsyms"; then
+	      $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+	      $run eval '$mv "$nlist"T "$nlist"'
+	    fi
+
+	    if test -n "$export_symbols_regex"; then
+	      $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+	      $run eval '$mv "$nlist"T "$nlist"'
+	    fi
+
+	    # Prepare the list of exported symbols
+	    if test -z "$export_symbols"; then
+	      export_symbols="$output_objdir/$output.exp"
+	      $run $rm $export_symbols
+	      $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+	    else
+	      $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
+	      $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
+	      $run eval 'mv "$nlist"T "$nlist"'
+	    fi
+	  fi
+
+	  for arg in $dlprefiles; do
+	    $show "extracting global C symbols from \`$arg'"
+	    name=`echo "$arg" | ${SED} -e 's%^.*/%%'`
+	    $run eval 'echo ": $name " >> "$nlist"'
+	    $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+	  done
+
+	  if test -z "$run"; then
+	    # Make sure we have at least an empty file.
+	    test -f "$nlist" || : > "$nlist"
+
+	    if test -n "$exclude_expsyms"; then
+	      egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+	      $mv "$nlist"T "$nlist"
+	    fi
+
+	    # Try sorting and uniquifying the output.
+	    if grep -v "^: " < "$nlist" |
+		if sort -k 3 </dev/null >/dev/null 2>&1; then
+		  sort -k 3
+		else
+		  sort +2
+		fi |
+		uniq > "$nlist"S; then
+	      :
+	    else
+	      grep -v "^: " < "$nlist" > "$nlist"S
+	    fi
+
+	    if test -f "$nlist"S; then
+	      eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
+	    else
+	      echo '/* NONE */' >> "$output_objdir/$dlsyms"
+	    fi
+
+	    $echo >> "$output_objdir/$dlsyms" "\
+
+#undef lt_preloaded_symbols
+
+#if defined (__STDC__) && __STDC__
+# define lt_ptr void *
+#else
+# define lt_ptr char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+  const char *name;
+  lt_ptr address;
+}
+lt_preloaded_symbols[] =
+{\
+"
+
+	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
+
+	    $echo >> "$output_objdir/$dlsyms" "\
+  {0, (lt_ptr) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+	  fi
+
+	  pic_flag_for_symtable=
+	  case $host in
+	  # compiling the symbol table file with pic_flag works around
+	  # a FreeBSD bug that causes programs to crash when -lm is
+	  # linked before any other PIC object.  But we must not use
+	  # pic_flag when linking with -static.  The problem exists in
+	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+	    case "$compile_command " in
+	    *" -static "*) ;;
+	    *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
+	    esac;;
+	  *-*-hpux*)
+	    case "$compile_command " in
+	    *" -static "*) ;;
+	    *) pic_flag_for_symtable=" $pic_flag -DPIC";;
+	    esac
+	  esac
+
+	  # Now compile the dynamic symbol file.
+	  $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
+	  $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
+
+	  # Clean up the generated files.
+	  $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
+	  $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
+
+	  # Transform the symbol file into the correct name.
+	  compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+	  finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+	  ;;
+	*)
+	  $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
+	  exit 1
+	  ;;
+	esac
+      else
+	# We keep going just in case the user didn't refer to
+	# lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
+	# really was required.
+
+	# Nullify the symbol file.
+	compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
+	finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+      fi
+
+      if test $need_relink = no || test "$build_libtool_libs" != yes; then
+	# Replace the output file specification.
+	compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+	link_command="$compile_command$compile_rpath"
+
+	# We have no uninstalled library dependencies, so finalize right now.
+	$show "$link_command"
+	$run eval "$link_command"
+	status=$?
+
+	# Delete the generated files.
+	if test -n "$dlsyms"; then
+	  $show "$rm $output_objdir/${outputname}S.${objext}"
+	  $run $rm "$output_objdir/${outputname}S.${objext}"
+	fi
+
+	exit $status
+      fi
+
+      if test -n "$shlibpath_var"; then
+	# We should set the shlibpath_var
+	rpath=
+	for dir in $temp_rpath; do
+	  case $dir in
+	  [\\/]* | [A-Za-z]:[\\/]*)
+	    # Absolute path.
+	    rpath="$rpath$dir:"
+	    ;;
+	  *)
+	    # Relative path: add a thisdir entry.
+	    rpath="$rpath\$thisdir/$dir:"
+	    ;;
+	  esac
+	done
+	temp_rpath="$rpath"
+      fi
+
+      if test -n "$compile_shlibpath$finalize_shlibpath"; then
+	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+      fi
+      if test -n "$finalize_shlibpath"; then
+	finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+      fi
+
+      compile_var=
+      finalize_var=
+      if test -n "$runpath_var"; then
+	if test -n "$perm_rpath"; then
+	  # We should set the runpath_var.
+	  rpath=
+	  for dir in $perm_rpath; do
+	    rpath="$rpath$dir:"
+	  done
+	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+	fi
+	if test -n "$finalize_perm_rpath"; then
+	  # We should set the runpath_var.
+	  rpath=
+	  for dir in $finalize_perm_rpath; do
+	    rpath="$rpath$dir:"
+	  done
+	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+	fi
+      fi
+
+      if test "$no_install" = yes; then
+	# We don't need to create a wrapper script.
+	link_command="$compile_var$compile_command$compile_rpath"
+	# Replace the output file specification.
+	link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+	# Delete the old output file.
+	$run $rm $output
+	# Link the executable and exit
+	$show "$link_command"
+	$run eval "$link_command" || exit $?
+	exit 0
+      fi
+
+      if test "$hardcode_action" = relink; then
+	# Fast installation is not supported
+	link_command="$compile_var$compile_command$compile_rpath"
+	relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+	$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
+	$echo "$modename: \`$output' will be relinked during installation" 1>&2
+      else
+	if test "$fast_install" != no; then
+	  link_command="$finalize_var$compile_command$finalize_rpath"
+	  if test "$fast_install" = yes; then
+	    relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
+	  else
+	    # fast_install is set to needless
+	    relink_command=
+	  fi
+	else
+	  link_command="$compile_var$compile_command$compile_rpath"
+	  relink_command="$finalize_var$finalize_command$finalize_rpath"
+	fi
+      fi
+
+      # Replace the output file specification.
+      link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+      # Delete the old output files.
+      $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+      $show "$link_command"
+      $run eval "$link_command" || exit $?
+
+      # Now create the wrapper script.
+      $show "creating $output"
+
+      # Quote the relink command for shipping.
+      if test -n "$relink_command"; then
+	# Preserve any variables that may affect compiler behavior
+	for var in $variables_saved_for_relink; do
+	  if eval test -z \"\${$var+set}\"; then
+	    relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
+	  elif eval var_value=\$$var; test -z "$var_value"; then
+	    relink_command="$var=; export $var; $relink_command"
+	  else
+	    var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
+	    relink_command="$var=\"$var_value\"; export $var; $relink_command"
+	  fi
+	done
+	relink_command="(cd `pwd`; $relink_command)"
+	relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+      fi
+
+      # Quote $echo for shipping.
+      if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
+	case $0 in
+	[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
+	*) qecho="$SHELL `pwd`/$0 --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 ;;
+	  *) exeext= ;;
+	esac
+	$rm $output
+	trap "$rm $output; exit 1" 1 2 15
+
+	$echo > $output "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed="${SED}"' -e 1s/^X//'
+sed_quote_subst='$sed_quote_subst'
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+  # install mode needs the following variable:
+  notinst_deplibs='$notinst_deplibs'
+else
+  # When we are sourced in execute mode, \$file and \$echo are already set.
+  if test \"\$libtool_execute_magic\" != \"$magic\"; then
+    echo=\"$qecho\"
+    file=\"\$0\"
+    # Make sure echo works.
+    if test \"X\$1\" = X--no-reexec; then
+      # Discard the --no-reexec flag, and continue.
+      shift
+    elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
+      # Yippee, \$echo works!
+      :
+    else
+      # Restart under the correct shell, and then maybe \$echo will work.
+      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
+    fi
+  fi\
+"
+	$echo >> $output "\
+
+  # Find the directory that this script lives in.
+  thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
+  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+  # Follow symbolic links until we get to the real thisdir.
+  file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
+  while test -n \"\$file\"; do
+    destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+
+    # If there was a directory component, then change thisdir.
+    if test \"x\$destdir\" != \"x\$file\"; then
+      case \"\$destdir\" in
+      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+      *) thisdir=\"\$thisdir/\$destdir\" ;;
+      esac
+    fi
+
+    file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
+    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
+  done
+
+  # Try to get the absolute directory name.
+  absdir=\`cd \"\$thisdir\" && pwd\`
+  test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+	if test "$fast_install" = yes; then
+	  echo >> $output "\
+  program=lt-'$outputname'$exeext
+  progdir=\"\$thisdir/$objdir\"
+
+  if test ! -f \"\$progdir/\$program\" || \\
+     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+    file=\"\$\$-\$program\"
+
+    if test ! -d \"\$progdir\"; then
+      $mkdir \"\$progdir\"
+    else
+      $rm \"\$progdir/\$file\"
+    fi"
+
+	  echo >> $output "\
+
+    # relink executable if necessary
+    if test -n \"\$relink_command\"; then
+      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+      else
+	$echo \"\$relink_command_output\" >&2
+	$rm \"\$progdir/\$file\"
+	exit 1
+      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
+	# win32 systems need to use the prog path for dll
+	# lookup to work
+	*-*-cygwin* | *-*-pw32*)
+	  $echo >> $output "\
+      exec \$progdir/\$program \${1+\"\$@\"}
+"
+	  ;;
+
+	# Backslashes separate directories on plain windows
+	*-*-mingw | *-*-os2*)
+	  $echo >> $output "\
+      exec \$progdir\\\\\$program \${1+\"\$@\"}
+"
+	  ;;
+
+	*)
+	  $echo >> $output "\
+      # Export the path to the program.
+      PATH=\"\$progdir:\$PATH\"
+      export PATH
+
+      exec \$program \${1+\"\$@\"}
+"
+	  ;;
+	esac
+	$echo >> $output "\
+      \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
+      exit 1
+    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 1
+  fi
+fi\
+"
+	chmod +x $output
+      fi
+      exit 0
+      ;;
+    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="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
+	fi
+	addlibs="$old_convenience"
+      fi
+
+      if test -n "$addlibs"; then
+	gentop="$output_objdir/${outputname}x"
+	$show "${rm}r $gentop"
+	$run ${rm}r "$gentop"
+	$show "mkdir $gentop"
+	$run mkdir "$gentop"
+	status=$?
+	if test $status -ne 0 && test ! -d "$gentop"; then
+	  exit $status
+	fi
+	generated="$generated $gentop"
+
+	# Add in members from convenience archives.
+	for xlib in $addlibs; do
+	  # Extract the objects.
+	  case $xlib in
+	  [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+	  *) xabs=`pwd`"/$xlib" ;;
+	  esac
+	  xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
+	  xdir="$gentop/$xlib"
+
+	  $show "${rm}r $xdir"
+	  $run ${rm}r "$xdir"
+	  $show "mkdir $xdir"
+	  $run mkdir "$xdir"
+	  status=$?
+	  if test $status -ne 0 && test ! -d "$xdir"; then
+	    exit $status
+	  fi
+	  $show "(cd $xdir && $AR x $xabs)"
+	  $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+
+	  oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
+	done
+      fi
+
+      # Do each command in the archive commands.
+      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+	eval cmds=\"$old_archive_from_new_cmds\"
+      else
+	# Ensure that we have .o objects in place in case we decided
+	# not to build a shared library, and have fallen back to building
+	# static libs even though --disable-static was passed!
+	for oldobj in $oldobjs; do
+	  if test ! -f $oldobj; then
+	    xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
+	    if test "X$xdir" = "X$oldobj"; then
+	      xdir="."
+	    else
+	      xdir="$xdir"
+	    fi
+	    baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
+	    obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
+	    $show "(cd $xdir && ${LN_S} $obj $baseobj)"
+	    $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
+	  fi
+	done
+
+	eval cmds=\"$old_archive_cmds\"
+      fi
+      save_ifs="$IFS"; IFS='~'
+      for cmd in $cmds; do
+	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 $0 --mode=relink $libtool_args @inst_prefix_dir@)"
+      relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+
+      # 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 1
+		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 1
+	      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 1
+	      fi
+	      newdlprefiles="$newdlprefiles $libdir/$name"
+	    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) 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
+
+# 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 0
+    ;;
+
+  # libtool install mode
+  install)
+    modename="$modename: install"
+
+    # There may be an optional sh(1) argument at the beginning of
+    # install_prog (especially on Windows NT).
+    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+       # Allow the use of GNU shtool's install command.
+       $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
+      # Aesthetically quote it.
+      arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
+      case $arg in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
+	arg="\"$arg\""
+	;;
+      esac
+      install_prog="$arg "
+      arg="$1"
+      shift
+    else
+      install_prog=
+      arg="$nonopt"
+    fi
+
+    # The real first argument should be the name of the installation program.
+    # Aesthetically quote it.
+    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+    case $arg in
+    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
+      arg="\"$arg\""
+      ;;
+    esac
+    install_prog="$install_prog$arg"
+
+    # We need to accept at least all the BSD install flags.
+    dest=
+    files=
+    opts=
+    prev=
+    install_type=
+    isdir=no
+    stripme=
+    for arg
+    do
+      if test -n "$dest"; then
+	files="$files $dest"
+	dest="$arg"
+	continue
+      fi
+
+      case $arg in
+      -d) isdir=yes ;;
+      -f) prev="-f" ;;
+      -g) prev="-g" ;;
+      -m) prev="-m" ;;
+      -o) prev="-o" ;;
+      -s)
+	stripme=" -s"
+	continue
+	;;
+      -*) ;;
+
+      *)
+	# If the previous option needed an argument, then skip it.
+	if test -n "$prev"; then
+	  prev=
+	else
+	  dest="$arg"
+	  continue
+	fi
+	;;
+      esac
+
+      # Aesthetically quote the argument.
+      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+      case $arg in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
+	arg="\"$arg\""
+	;;
+      esac
+      install_prog="$install_prog $arg"
+    done
+
+    if test -z "$install_prog"; then
+      $echo "$modename: you must specify an install program" 1>&2
+      $echo "$help" 1>&2
+      exit 1
+    fi
+
+    if test -n "$prev"; then
+      $echo "$modename: the \`$prev' option requires an argument" 1>&2
+      $echo "$help" 1>&2
+      exit 1
+    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 1
+    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 1
+      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 1
+	  ;;
+	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 | egrep "^# 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 1
+	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.
+          if test "$inst_prefix_dir" = "$destdir"; then
+            $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
+            exit 1
+          fi
+ 
+          if test -n "$inst_prefix_dir"; then
+            # Stick the inst_prefix_dir data into the link command.
+            relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+          else
+            relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"`
+          fi
+
+	  $echo "$modename: warning: relinking \`$file'" 1>&2
+	  $show "$relink_command"
+	  if $run eval "$relink_command"; then :
+	  else
+	    $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+	    exit 1
+	  fi
+	fi
+
+	# See the names of the shared library.
+	set dummy $library_names
+	if test -n "$2"; then
+	  realname="$2"
+	  shift
+	  shift
+
+	  srcname="$realname"
+	  test -n "$relink_command" && srcname="$realname"T
+
+	  # Install the shared library and build the symlinks.
+	  $show "$install_prog $dir/$srcname $destdir/$realname"
+	  $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
+	  if test -n "$stripme" && test -n "$striplib"; then
+	    $show "$striplib $destdir/$realname"
+	    $run eval "$striplib $destdir/$realname" || exit $?
+	  fi
+
+	  if test $# -gt 0; then
+	    # Delete the old symlinks, and create new ones.
+	    for linkname
+	    do
+	      if test "$linkname" != "$realname"; then
+		$show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
+		$run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
+	      fi
+	    done
+	  fi
+
+	  # Do each command in the postinstall commands.
+	  lib="$destdir/$realname"
+	  eval cmds=\"$postinstall_cmds\"
+	  save_ifs="$IFS"; IFS='~'
+	  for cmd in $cmds; do
+	    IFS="$save_ifs"
+	    $show "$cmd"
+	    $run eval "$cmd" || exit $?
+	  done
+	  IFS="$save_ifs"
+	fi
+
+	# Install the pseudo-library for information purposes.
+	name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+	instname="$dir/$name"i
+	$show "$install_prog $instname $destdir/$name"
+	$run eval "$install_prog $instname $destdir/$name" || exit $?
+
+	# Maybe install the static library, too.
+	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+	;;
+
+      *.lo)
+	# Install (i.e. copy) a libtool object.
+
+	# Figure out destination file name, if it wasn't already specified.
+	if test -n "$destname"; then
+	  destfile="$destdir/$destname"
+	else
+	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+	  destfile="$destdir/$destfile"
+	fi
+
+	# Deduce the name of the destination old-style object file.
+	case $destfile in
+	*.lo)
+	  staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
+	  ;;
+	*.$objext)
+	  staticdest="$destfile"
+	  destfile=
+	  ;;
+	*)
+	  $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
+	  $echo "$help" 1>&2
+	  exit 1
+	  ;;
+	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 0
+	;;
+
+      *)
+	# 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
+
+	# 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 | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
+	  notinst_deplibs=
+	  relink_command=
+
+	  # If there is no directory component, then add one.
+	  case $file 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 1
+	  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=
+	  # If there is no directory component, then add one.
+	  case $file in
+	  */* | *\\*) . $wrapper ;;
+	  *) . ./$wrapper ;;
+	  esac
+
+	  outputname=
+	  if test "$fast_install" = no && test -n "$relink_command"; then
+	    if test "$finalize" = yes && test -z "$run"; then
+	      tmpdir="/tmp"
+	      test -n "$TMPDIR" && tmpdir="$TMPDIR"
+	      tmpdir="$tmpdir/libtool-$$"
+	      if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
+	      else
+		$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
+		continue
+	      fi
+	      file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+	      outputname="$tmpdir/$file"
+	      # Replace the output file specification.
+	      relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+
+	      $show "$relink_command"
+	      if $run eval "$relink_command"; then :
+	      else
+		$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+		${rm}r "$tmpdir"
+		continue
+	      fi
+	      file="$outputname"
+	    else
+	      $echo "$modename: warning: cannot relink \`$file'" 1>&2
+	    fi
+	  else
+	    # Install the binary that we compiled earlier.
+	    file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+	  fi
+	fi
+
+	# remove .exe since cygwin /usr/bin/install will append another
+	# one anyways
+	case $install_prog,$host in
+	/usr/bin/install*,*cygwin*)
+	  case $file:$destfile in
+	  *.exe:*.exe)
+	    # this is ok
+	    ;;
+	  *.exe:*)
+	    destfile=$destfile.exe
+	    ;;
+	  *:*.exe)
+	    destfile=`echo $destfile | ${SED} -e 's,.exe$,,'`
+	    ;;
+	  esac
+	  ;;
+	esac
+	$show "$install_prog$stripme $file $destfile"
+	$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
+	test -n "$outputname" && ${rm}r "$tmpdir"
+	;;
+      esac
+    done
+
+    for file in $staticlibs; do
+      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+
+      # Set up the ranlib parameters.
+      oldlib="$destdir/$name"
+
+      $show "$install_prog $file $oldlib"
+      $run eval "$install_prog \$file \$oldlib" || exit $?
+
+      if test -n "$stripme" && test -n "$striplib"; then
+	$show "$old_striplib $oldlib"
+	$run eval "$old_striplib $oldlib" || exit $?
+      fi
+
+      # Do each command in the postinstall commands.
+      eval cmds=\"$old_postinstall_cmds\"
+      save_ifs="$IFS"; IFS='~'
+      for cmd in $cmds; do
+	IFS="$save_ifs"
+	$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 $0 --finish$current_libdirs'
+    else
+      exit 0
+    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.
+	  eval cmds=\"$finish_cmds\"
+	  save_ifs="$IFS"; IFS='~'
+	  for cmd in $cmds; do
+	    IFS="$save_ifs"
+	    $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 0
+
+    echo "----------------------------------------------------------------------"
+    echo "Libraries have been installed in:"
+    for libdir in $libdirs; do
+      echo "   $libdir"
+    done
+    echo
+    echo "If you ever happen to want to link against installed libraries"
+    echo "in a given directory, LIBDIR, you must either use libtool, and"
+    echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+    echo "flag during linking and do at least one of the following:"
+    if test -n "$shlibpath_var"; then
+      echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
+      echo "     during execution"
+    fi
+    if test -n "$runpath_var"; then
+      echo "   - add LIBDIR to the \`$runpath_var' environment variable"
+      echo "     during linking"
+    fi
+    if test -n "$hardcode_libdir_flag_spec"; then
+      libdir=LIBDIR
+      eval flag=\"$hardcode_libdir_flag_spec\"
+
+      echo "   - use the \`$flag' linker flag"
+    fi
+    if test -n "$admincmds"; then
+      echo "   - have your system administrator run these commands:$admincmds"
+    fi
+    if test -f /etc/ld.so.conf; then
+      echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+    fi
+    echo
+    echo "See any operating system documentation about shared libraries for"
+    echo "more information, such as the ld(1) and ld.so(8) manual pages."
+    echo "----------------------------------------------------------------------"
+    exit 0
+    ;;
+
+  # 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 1
+    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 1
+      fi
+
+      dir=
+      case $file in
+      *.la)
+	# Check to see that this really is a libtool archive.
+	if (${SED} -e '2q' $file | egrep "^# 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 1
+	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 1
+	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 | egrep "^# 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 enviroment variables
+      if test "${save_LC_ALL+set}" = set; then
+	LC_ALL="$save_LC_ALL"; export LC_ALL
+      fi
+      if test "${save_LANG+set}" = set; then
+	LANG="$save_LANG"; export LANG
+      fi
+
+      # Now prepare to actually exec the command.
+      exec_cmd="\$cmd$args"
+    else
+      # Display what would be done.
+      if test -n "$shlibpath_var"; then
+	eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
+	$echo "export $shlibpath_var"
+      fi
+      $echo "$cmd$args"
+      exit 0
+    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 1
+    fi
+
+    rmdirs=
+
+    for file in $files; do
+      dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+      if test "X$dir" = "X$file"; then
+	dir=.
+	objdir="$objdir"
+      else
+	objdir="$dir/$objdir"
+      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 | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	  . $dir/$name
+
+	  # Delete the libtool libraries and symlinks.
+	  for n in $library_names; do
+	    rmfiles="$rmfiles $objdir/$n"
+	  done
+	  test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
+	  test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+
+	  if test $mode = uninstall; then
+	    if test -n "$library_names"; then
+	      # Do each command in the postuninstall commands.
+	      eval cmds=\"$postuninstall_cmds\"
+	      save_ifs="$IFS"; IFS='~'
+	      for cmd in $cmds; do
+		IFS="$save_ifs"
+		$show "$cmd"
+		$run eval "$cmd"
+		if test $? != 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.
+	      eval cmds=\"$old_postuninstall_cmds\"
+	      save_ifs="$IFS"; IFS='~'
+	      for cmd in $cmds; do
+		IFS="$save_ifs"
+		$show "$cmd"
+		$run eval "$cmd"
+		if test $? != 0 && test "$rmforce" != yes; then
+		  exit_status=1
+		fi
+	      done
+	      IFS="$save_ifs"
+	    fi
+	    # FIXME: should reinstall the best remaining shared library.
+	  fi
+	fi
+	;;
+
+      *.lo)
+	if test "$build_old_libs" = yes; then
+	  oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
+	  rmfiles="$rmfiles $dir/$oldobj"
+	fi
+	;;
+
+      *)
+	# Do a test to see if this is a libtool program.
+	if test $mode = clean &&
+	   (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	  relink_command=
+	  . $dir/$file
+
+	  rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
+	  if test "$fast_install" = yes && test -n "$relink_command"; then
+	    rmfiles="$rmfiles $objdir/lt-$name"
+	  fi
+	fi
+	;;
+      esac
+      $show "$rm $rmfiles"
+      $run $rm $rmfiles || exit_status=1
+    done
+
+    # 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 1
+    ;;
+  esac
+
+  if test -z "$exec_cmd"; then
+    $echo "$modename: invalid operation mode \`$mode'" 1>&2
+    $echo "$generic_help" 1>&2
+    exit 1
+  fi
+fi # test -z "$show_help"
+
+if test -n "$exec_cmd"; then
+  eval exec $exec_cmd
+  exit 1
+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
+    --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."
+  exit 0
+  ;;
+
+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
+  -release RELEASE  specify package release information
+  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
+  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
+  -static           do not do any dynamic linking of libtool libraries
+  -version-info CURRENT[:REVISION[:AGE]]
+		    specify library version info [each variable defaults to 0]
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename.  Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+  ;;
+
+uninstall)
+  $echo \
+"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+  ;;
+
+*)
+  $echo "$modename: invalid operation mode \`$mode'" 1>&2
+  $echo "$help" 1>&2
+  exit 1
+  ;;
+esac
+
+echo
+$echo "Try \`$modename --help' for more information about other modes."
+
+exit 0
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
diff --git a/libunwind/configure.ac b/libunwind/configure.ac
new file mode 100644
index 0000000..70f6af8
--- /dev/null
+++ b/libunwind/configure.ac
@@ -0,0 +1,390 @@
+define(pkg_major, 1)
+define(pkg_minor, 1)
+define(pkg_extra, )
+define(pkg_maintainer, libunwind-devel@nongnu.org)
+define(mkvers, $1.$2$3)
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT([libunwind],[mkvers(pkg_major, pkg_minor, pkg_extra)],[pkg_maintainer])
+AC_CONFIG_SRCDIR(src/mi/backtrace.c)
+AC_CONFIG_AUX_DIR(config)
+AC_CANONICAL_TARGET
+AM_INIT_AUTOMAKE([1.6 subdir-objects])
+AM_MAINTAINER_MODE
+AC_CONFIG_HEADERS([include/config.h])
+
+dnl Checks for programs.
+AC_PROG_CC
+AC_PROG_CXX
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+LT_INIT
+AM_PROG_AS
+AM_PROG_CC_C_O
+
+dnl Checks for libraries.
+AC_CHECK_LIB(uca, __uc_get_grs)
+OLD_LIBS=${LIBS}
+AC_SEARCH_LIBS(dlopen, dl)
+LIBS=${OLD_LIBS}
+case "$ac_cv_search_dlopen" in
+  -l*) DLLIB=$ac_cv_search_dlopen;;
+  *) DLLIB="";;
+esac
+
+CHECK_ATOMIC_OPS
+
+# ANDROID support update.
+CHECK_ANDROID
+# End of ANDROID update.
+
+dnl Checks for header files.
+AC_HEADER_STDC
+AC_CHECK_HEADERS(asm/ptrace_offsets.h endian.h sys/endian.h execinfo.h \
+		ia64intrin.h sys/uc_access.h unistd.h signal.h sys/types.h \
+		sys/procfs.h sys/ptrace.h byteswap.h elf.h sys/elf.h link.h sys/link.h)
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_C_INLINE
+AC_TYPE_SIZE_T
+AC_CHECK_SIZEOF(off_t)
+
+CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE"
+
+AC_CHECK_MEMBERS([struct dl_phdr_info.dlpi_subs],,,[#include <link.h>])
+AC_CHECK_TYPES([struct elf_prstatus, struct prstatus], [], [],
+[$ac_includes_default
+#if HAVE_SYS_PROCFS_H
+# include <sys/procfs.h>
+#endif
+])
+
+AC_CHECK_DECLS([PTRACE_POKEUSER, PTRACE_POKEDATA,
+PTRACE_TRACEME, PTRACE_CONT, PTRACE_SINGLESTEP,
+PTRACE_SYSCALL, PT_IO, PT_GETREGS,
+PT_GETFPREGS, PT_CONTINUE, PT_TRACE_ME,
+PT_STEP, PT_SYSCALL], [], [],
+[$ac_includes_default
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#include <sys/ptrace.h>
+])
+
+dnl Checks for library functions.
+AC_CHECK_FUNCS(dl_iterate_phdr dl_phdr_removals_counter dlmodinfo getunwind \
+		ttrace mincore)
+
+AC_MSG_CHECKING([if building with AltiVec])
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+#ifndef __ALTIVEC__
+# error choke
+#endif
+]])], [use_altivec=yes],[use_altivec=no])
+AM_CONDITIONAL(USE_ALTIVEC, [test x$use_altivec = xyes])
+AC_MSG_RESULT([$use_altivec])
+
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+#ifndef __powerpc64__
+# error choke
+#endif
+]])], [ppc_bits=64], [ppc_bits=32])
+
+AC_DEFUN([SET_ARCH],[
+    AS_CASE([$1],
+        [arm*],[$2=arm],
+        [i?86],[$2=x86],
+        [hppa*],[$2=hppa],
+        [mips*],[$2=mips],
+        [powerpc*],[$2=ppc$ppc_bits],
+        [sh*],[$2=sh],
+        [amd64],[$2=x86_64],
+        [$2=$1])
+]) dnl SET_ARCH
+
+SET_ARCH([$build_cpu],[build_arch])
+SET_ARCH([$host_cpu],[host_arch])
+SET_ARCH([$target_cpu],[target_arch])
+
+AC_ARG_ENABLE(coredump,
+	AS_HELP_STRING([--enable-coredump],[building libunwind-coredump library]),,
+        [AS_CASE([$host_arch], [aarch64*|arm*|mips*|sh*|x86*], [enable_coredump=yes], [enable_coredump=no])]
+)
+
+AC_MSG_CHECKING([if we should build libunwind-coredump])
+AC_MSG_RESULT([$enable_coredump])
+
+AC_ARG_ENABLE(ptrace,
+	AS_HELP_STRING([--enable-ptrace],[building libunwind-ptrace library]),,
+        [AC_CHECK_HEADER([sys/ptrace.h], [enable_ptrace=yes], [enable_ptrace=no])]
+)
+
+AC_MSG_CHECKING([if we should build libunwind-ptrace])
+AC_MSG_RESULT([$enable_ptrace])
+
+AC_ARG_ENABLE(setjmp,
+	AS_HELP_STRING([--enable-setjmp],[building libunwind-setjmp library]),,
+        [AS_IF([test x$target_arch == x$host_arch], [enable_setjmp=yes], [enable_setjmp=no])]
+)
+
+AC_MSG_CHECKING([if we should build libunwind-setjmp])
+AC_MSG_RESULT([$enable_setjmp])
+
+AC_MSG_CHECKING([for build architecture])
+AC_MSG_RESULT([$build_arch])
+AC_MSG_CHECKING([for host architecture])
+AC_MSG_RESULT([$host_arch])
+AC_MSG_CHECKING([for target architecture])
+AC_MSG_RESULT([$target_arch])
+AC_MSG_CHECKING([for target operating system])
+AC_MSG_RESULT([$target_os])
+
+AM_CONDITIONAL(BUILD_COREDUMP, test x$enable_coredump = xyes)
+AM_CONDITIONAL(BUILD_PTRACE, test x$enable_ptrace = xyes)
+AM_CONDITIONAL(BUILD_SETJMP, test x$enable_setjmp = xyes)
+AM_CONDITIONAL(REMOTE_ONLY, test x$target_arch != x$host_arch)
+AM_CONDITIONAL(ARCH_AARCH64, test x$target_arch = xaarch64)
+AM_CONDITIONAL(ARCH_ARM, test x$target_arch = xarm)
+AM_CONDITIONAL(ARCH_IA64, test x$target_arch = xia64)
+AM_CONDITIONAL(ARCH_HPPA, test x$target_arch = xhppa)
+AM_CONDITIONAL(ARCH_MIPS, test x$target_arch = xmips)
+AM_CONDITIONAL(ARCH_X86, test x$target_arch = xx86)
+AM_CONDITIONAL(ARCH_X86_64, test x$target_arch = xx86_64)
+AM_CONDITIONAL(ARCH_PPC32, test x$target_arch = xppc32)
+AM_CONDITIONAL(ARCH_PPC64, test x$target_arch = xppc64)
+AM_CONDITIONAL(ARCH_SH, test x$target_arch = xsh)
+AM_CONDITIONAL(OS_LINUX, expr x$target_os : xlinux >/dev/null)
+AM_CONDITIONAL(OS_HPUX, expr x$target_os : xhpux >/dev/null)
+AM_CONDITIONAL(OS_FREEBSD, expr x$target_os : xfreebsd >/dev/null)
+AM_CONDITIONAL(OS_QNX, expr x$target_os : xnto-qnx >/dev/null)
+
+AC_MSG_CHECKING([for ELF helper width])
+case "${target_arch}" in
+(arm|hppa|ppc32|x86|sh) use_elf32=yes; AC_MSG_RESULT([32]);;
+(aarch64|ia64|ppc64|x86_64)    use_elf64=yes; AC_MSG_RESULT([64]);;
+(mips)                 use_elfxx=yes; AC_MSG_RESULT([xx]);;
+*)                     AC_MSG_ERROR([Unknown ELF target: ${target_arch}])
+esac
+AM_CONDITIONAL(USE_ELF32, [test x$use_elf32 = xyes])
+AM_CONDITIONAL(USE_ELF64, [test x$use_elf64 = xyes])
+AM_CONDITIONAL(USE_ELFXX, [test x$use_elfxx = xyes])
+
+AC_MSG_CHECKING([whether to include DWARF support])
+if test x$target_arch != xia64; then
+  use_dwarf=yes
+else
+  use_dwarf=no
+fi
+AM_CONDITIONAL(USE_DWARF, [test x$use_dwarf = xyes])
+AC_MSG_RESULT([$use_dwarf])
+
+if test x$target_arch = xppc64; then
+        libdir='${exec_prefix}/lib64'
+        AC_MSG_NOTICE([PowerPC64 detected, lib will be installed ${libdir}]);
+        AC_SUBST([libdir])
+fi
+
+AC_MSG_CHECKING([whether to restrict build to remote support])
+if test x$target_arch != x$host_arch; then
+  CPPFLAGS="${CPPFLAGS} -DUNW_REMOTE_ONLY"
+  remote_only=yes
+else
+  remote_only=no
+fi
+AC_MSG_RESULT([$remote_only])
+
+AC_MSG_CHECKING([whether to enable debug support])
+AC_ARG_ENABLE(debug,
+AS_HELP_STRING([--enable-debug],[turn on debug support (slows down execution)]))
+if test x$enable_debug = xyes; then
+  CPPFLAGS="${CPPFLAGS} -DDEBUG"
+else
+  CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+fi
+AC_MSG_RESULT([$enable_debug])
+
+AC_MSG_CHECKING([whether to enable C++ exception support])
+AC_ARG_ENABLE(cxx_exceptions,
+AS_HELP_STRING([--enable-cxx-exceptions],[use libunwind to handle C++ exceptions]),,
+[
+# C++ exception handling doesn't work too well on x86
+case $target_arch in
+  x86*) enable_cxx_exceptions=no;;
+  aarch64*) enable_cxx_exceptions=no;;
+  arm*) enable_cxx_exceptions=no;;
+  mips*) enable_cxx_exceptions=no;;
+  *) enable_cxx_exceptions=yes;;
+esac
+])
+
+AM_CONDITIONAL([SUPPORT_CXX_EXCEPTIONS], [test x$enable_cxx_exceptions = xyes])
+AC_MSG_RESULT([$enable_cxx_exceptions])
+
+AC_MSG_CHECKING([whether to load .debug_frame sections])
+AC_ARG_ENABLE(debug_frame,
+AS_HELP_STRING([--enable-debug-frame],[Load the ".debug_frame" section if available]),, [
+case "${target_arch}" in
+  (arm) enable_debug_frame=yes;;
+  (*)   enable_debug_frame=no;;
+esac])
+if test x$enable_debug_frame = xyes; then
+  AC_DEFINE([CONFIG_DEBUG_FRAME], [], [Enable Debug Frame])
+fi
+AC_MSG_RESULT([$enable_debug_frame])
+
+AC_MSG_CHECKING([whether to block signals during mutex ops])
+AC_ARG_ENABLE(block_signals,
+AS_HELP_STRING([--enable-block-signals],[Block signals before performing mutex operations]),,
+[enable_block_signals=yes])
+if test x$enable_block_signals = xyes; then
+  AC_DEFINE([CONFIG_BLOCK_SIGNALS], [], [Block signals before mutex operations])
+fi
+AC_MSG_RESULT([$enable_block_signals])
+
+AC_MSG_CHECKING([whether to validate memory addresses before use])
+AC_ARG_ENABLE(conservative_checks,
+AS_HELP_STRING([--enable-conservative-checks],[Validate all memory addresses before use]),,
+[enable_conservative_checks=yes])
+if test x$enable_conservative_checks = xyes; then
+  AC_DEFINE(CONSERVATIVE_CHECKS, 1,
+	[Define to 1 if you want every memory access validated])
+fi
+AC_MSG_RESULT([$enable_conservative_checks])
+
+AC_MSG_CHECKING([whether to enable msabi support])
+AC_ARG_ENABLE(msabi_support,
+AS_HELP_STRING([--enable-msabi-support],[Enables support for Microsoft ABI extensions]))
+if test x$enable_msabi_support = xyes; then
+  AC_DEFINE([CONFIG_MSABI_SUPPORT], [], [Support for Microsoft ABI extensions])
+fi
+AC_MSG_RESULT([$enable_msabi_support])
+
+LIBLZMA=
+AC_MSG_CHECKING([whether to support LZMA-compressed symbol tables])
+AC_ARG_ENABLE(minidebuginfo,
+AS_HELP_STRING([--enable-minidebuginfo], [Enables support for LZMA-compressed symbol tables]),, [enable_minidebuginfo=auto])
+AC_MSG_RESULT([$enable_minidebuginfo])
+if test x$enable_minidebuginfo != xno; then
+   AC_CHECK_LIB([lzma], [lzma_mf_is_supported],
+   [LIBLZMA=-llzma
+    AC_DEFINE([HAVE_LZMA], [1], [Define if you have liblzma])
+    enable_minidebuginfo=yes],
+   [if test x$enable_minidebuginfo = xyes; then
+      AC_MSG_FAILURE([liblzma not found])
+    fi])
+fi
+AC_SUBST([LIBLZMA])
+AM_CONDITIONAL(HAVE_LZMA, test x$enable_minidebuginfo = xyes)
+
+LIBUNWIND___THREAD
+
+AC_MSG_CHECKING([for Intel compiler])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[#ifndef __INTEL_COMPILER
+#error choke me
+#endif]])],[intel_compiler=yes],[intel_compiler=no])
+
+if test x$GCC = xyes -a x$intel_compiler != xyes; then
+  CFLAGS="${CFLAGS} -fexceptions -Wall -Wsign-compare"
+fi
+AC_MSG_RESULT([$intel_compiler])
+
+AC_MSG_CHECKING([for QCC compiler])
+AS_CASE([$CC], [qcc*|QCC*], [qcc_compiler=yes], [qcc_compiler=no])
+AC_MSG_RESULT([$qcc_compiler])
+
+if test x$intel_compiler = xyes; then
+  AC_MSG_CHECKING([if linker supports -static-libcxa])
+  save_LDFLAGS="$LDFLAGS"
+  LDFLAGS="$LDFLAGS -static-libcxa"
+  AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[have_static_libcxa=yes],[have_static_libcxa=no])
+  LDFLAGS="$save_LDFLAGS"
+  if test "x$have_static_libcxa" = xyes; then
+    LDFLAGS_STATIC_LIBCXA="-XCClinker -static-libcxa"
+  fi
+  AC_MSG_RESULT([$have_static_libcxa])
+fi
+
+if test x$qcc_compiler = xyes; then
+    LDFLAGS_NOSTARTFILES="-XCClinker -Wc,-nostartfiles"
+else
+    LDFLAGS_NOSTARTFILES="-XCClinker -nostartfiles"
+fi
+
+if test x$GCC = xyes -a x$intel_compiler != xyes -a x$qcc_compiler != xyes; then
+  LIBCRTS="-lgcc"
+fi
+
+AC_MSG_CHECKING([for __builtin___clear_cache])
+AC_LINK_IFELSE(
+  [AC_LANG_PROGRAM([[]], [[__builtin___clear_cache(0, 0)]])],
+  [have__builtin___clear_cache=yes],
+  [have__builtin___clear_cache=no])
+if test x$have__builtin___clear_cache = xyes; then
+  AC_DEFINE([HAVE__BUILTIN___CLEAR_CACHE], [1],
+            [Defined if __builtin___clear_cache() is available])
+fi
+AC_MSG_RESULT([$have__builtin___clear_cache])
+
+AC_MSG_CHECKING([for __builtin_unreachable])
+AC_LINK_IFELSE(
+  [AC_LANG_PROGRAM([[]], [[__builtin_unreachable()]])],
+  [have__builtin_unreachable=yes],
+  [have__builtin_unreachable=no])
+if test x$have__builtin_unreachable = xyes; then
+  AC_DEFINE([HAVE__BUILTIN_UNREACHABLE], [1],
+            [Defined if __builtin_unreachable() is available])
+fi
+AC_MSG_RESULT([$have__builtin_unreachable])
+
+AC_MSG_CHECKING([for __sync atomics])
+AC_LINK_IFELSE(
+  [AC_LANG_PROGRAM([[]], [[
+    __sync_bool_compare_and_swap((int *)0, 0, 1);
+    __sync_fetch_and_add((int *)0, 1);
+    ]])],
+  [have_sync_atomics=yes],
+  [have_sync_atomics=no])
+if test x$have_sync_atomics = xyes; then
+  AC_DEFINE([HAVE_SYNC_ATOMICS], [1],
+            [Defined if __sync atomics are available])
+fi
+AC_MSG_RESULT([$have_sync_atomics])
+
+CCASFLAGS="${CCASFLAGS} ${CPPFLAGS}"
+
+arch="$target_arch"
+ARCH=`echo $target_arch | tr [a-z] [A-Z]`
+
+dnl create shell variables from the M4 macros:
+PKG_MAJOR=pkg_major
+PKG_MINOR=pkg_minor
+PKG_EXTRA=pkg_extra
+PKG_MAINTAINER=pkg_maintainer
+
+old_LIBS="$LIBS"
+LIBS=""
+AC_SEARCH_LIBS(backtrace, execinfo)
+LIBS="$old_LIBS"
+
+AC_SUBST(build_arch)
+AC_SUBST(target_os)
+AC_SUBST(arch)
+AC_SUBST(ARCH)
+AC_SUBST(LDFLAGS_STATIC_LIBCXA)
+AC_SUBST(LDFLAGS_NOSTARTFILES)
+AC_SUBST(LIBCRTS)
+AC_SUBST(PKG_MAJOR)
+AC_SUBST(PKG_MINOR)
+AC_SUBST(PKG_EXTRA)
+AC_SUBST(PKG_MAINTAINER)
+AC_SUBST(enable_cxx_exceptions)
+AC_SUBST(enable_debug_frame)
+AC_SUBST(DLLIB)
+
+AC_CONFIG_FILES(Makefile src/Makefile tests/Makefile tests/check-namespace.sh
+		doc/Makefile doc/common.tex include/libunwind-common.h
+                include/libunwind.h include/tdep/libunwind_i.h)
+AC_CONFIG_FILES(src/unwind/libunwind.pc src/coredump/libunwind-coredump.pc
+                src/ptrace/libunwind-ptrace.pc src/setjmp/libunwind-setjmp.pc
+                src/libunwind-generic.pc)
+AC_OUTPUT
diff --git a/libunwind/doc/Makefile.am b/libunwind/doc/Makefile.am
new file mode 100644
index 0000000..2534066
--- /dev/null
+++ b/libunwind/doc/Makefile.am
@@ -0,0 +1,73 @@
+# man pages that go into section 3:
+man3_MANS = libunwind.man libunwind-dynamic.man libunwind-ia64.man	\
+	libunwind-ptrace.man libunwind-setjmp.man			\
+	unw_backtrace.man						\
+	unw_flush_cache.man						\
+	unw_get_accessors.man						\
+	unw_get_proc_info.man						\
+	unw_get_proc_info_by_ip.man					\
+	unw_get_proc_name.man						\
+	unw_get_fpreg.man						\
+	unw_get_reg.man							\
+	unw_getcontext.man						\
+	unw_init_local.man unw_init_remote.man				\
+	unw_is_fpreg.man						\
+	unw_is_signal_frame.man						\
+	unw_create_addr_space.man					\
+	unw_destroy_addr_space.man					\
+	unw_regname.man unw_resume.man					\
+	unw_set_caching_policy.man					\
+	unw_set_fpreg.man						\
+	unw_set_reg.man							\
+	unw_step.man							\
+	unw_strerror.man						\
+	_U_dyn_register.man						\
+	_U_dyn_cancel.man
+
+EXTRA_DIST = NOTES libunwind.trans					\
+	libunwind.tex libunwind-dynamic.tex libunwind-ia64.tex		\
+	libunwind-ptrace.tex libunwind-setjmp.tex			\
+	unw_backtrace.tex						\
+	unw_flush_cache.tex						\
+	unw_get_accessors.tex						\
+	unw_get_proc_info.tex						\
+	unw_get_proc_info_by_ip.tex					\
+	unw_get_proc_name.tex						\
+	unw_get_fpreg.tex						\
+	unw_get_reg.tex							\
+	unw_getcontext.tex						\
+	unw_init_local.tex unw_init_remote.tex				\
+	unw_is_fpreg.tex						\
+	unw_is_signal_frame.tex						\
+	unw_create_addr_space.tex unw_destroy_addr_space.tex		\
+	unw_regname.tex unw_resume.tex unw_set_caching_policy.tex	\
+	unw_set_fpreg.tex						\
+	unw_set_reg.tex							\
+	unw_step.tex							\
+	unw_strerror.tex						\
+	_U_dyn_register.tex						\
+	_U_dyn_cancel.tex						\
+	$(man3_MANS)
+
+L2M	= latex2man
+L2P	= pdflatex
+L2M_CMD	= $(L2M) -t $(srcdir)/libunwind.trans
+L2H_CMD	= $(L2M) -H -t $(srcdir)/libunwind.trans
+
+.tex.man:
+	$(L2M_CMD) $< $@
+	-cp $@ $(srcdir)/$@
+
+html:
+	for n in $(man3_MANS); do					\
+		page=`basename $$n .man`;				\
+		$(L2H_CMD) $(srcdir)/$$page.tex "$$page(3).raw";	\
+	done
+
+pdf:
+	for n in $(man3_MANS); do					\
+		page=`basename $$n .man`;				\
+		$(L2P) $(srcdir)/$$page.tex "$$page(3).pdf";		\
+	done
+
+MAINTAINERCLEANFILES = Makefile.in
diff --git a/libunwind/doc/NOTES b/libunwind/doc/NOTES
new file mode 100644
index 0000000..3f3caa9
--- /dev/null
+++ b/libunwind/doc/NOTES
@@ -0,0 +1,127 @@
+The central data structure of the unwind API is the unwind cursor.
+This structure tracks the register contents.  The unwind API defines a
+handful of well-known frame "registers":
+
+        - ip: the instruction pointer (pc)
+        - rp: the return pointer (rp, aka "return address" or "return link")
+        - sp: the stack pointer (memory stack pointer, in the case of ia64)
+        - fp: the frame pointer
+        - first_ip: the starting address of the current "procedure"
+        - handler: a pointer to an architecture & language-specific
+          "personality" routine
+        - lsda: a pointer to an architecture & language-specific
+          data-area
+
+The API defines no well-known preserved registers.  Each architecture
+can define additional registers as needed.  Of course, a portable
+application may only rely on well-known registers.  The names for
+preserved registers are defined in the architecture-specific header
+file <unwind-ARCH.h>.  For example, to get the IA-64-specific register
+names, an application would do:
+
+	#include <unwind-ia64.h>
+
+The API is designed to handle two primary cases: unwinding within the
+current (local) process and unwinding of another ("remote") process
+(e.g., through ptrace()).  In the local case, the initial machine
+state is captured by an unwind context (currently the same as
+ucontext_t).  In the remote case, the initial machine state is
+captured by an unwind accessor structure, which provides callback
+routines for reading/writing memory and registers and for obtaining
+unwind information.
+
+Once a cursor has been initialized, you can step through the call
+chain with the unw_step() routine.  The frame registers and the
+preserved state can then be accessed with unw_get_reg() or modified
+with unw_set_reg().  For floating-point registers, there are separate
+unw_get_fpreg() and unw_set_fpreg() routines (on some arches, e.g.,
+Alpha, these could be just aliases for unw_{g,s}et_reg()).  The
+unw_resume() routine can be used to resume execution at an arbitrary
+point in the call-chain (as identified by an unwind cursor).  This is
+intended for exception handling and, at least for now, the intention
+is to support this routine only for the local case.  Kevin, if you
+feel gdb could benefit from such a routine, I'd be interested to hear
+about it.
+
+Note that it is perfectly legal to make copies of the unwind cursor.
+This makes it possible, e.g., to obtain an unwind context, modify the
+state in an earlier call frame, and then resume execution at the point
+at which the unwind context was captured.
+
+Here is a quick example of how to use the unwind API to do a simple
+stack trace:
+
+    unw_cursor_t cursor;
+    unw_word_t ip, sp;
+    unw_context_t uc;
+
+    unw_getcontext(&uc);
+    unw_init_local(&cursor, &uc);
+    do
+      {
+        unw_get_reg(&cursor, UNW_REG_IP, &ip);
+        unw_get_reg(&cursor, UNW_REG_SP, &sp);
+        printf ("ip=%016lx sp=%016lx\n", ip, sp);
+      }
+    while (unw_step (&cursor) > 0);
+
+Note that this particular example should work on pretty much any
+architecture, as it doesn't rely on any arch-specific registers.
+
+* Multiarchitecture support
+
+If libunwind is configured for a target other than the local (native)
+host, the library is installed as libunwind-$ARCH, where $ARCH is
+the target architecture name (e.g., ia32, ia64, or alpha).  Similarly,
+the header file is installed as libunwind-$ARCH.
+
+With this setup, an application should:
+
+	- include <libunwind.h>, and
+	- link against -lunwind
+
+if the application needs to use the unwinder of the host.  An
+application wanting to use the unwinder for a different target (e.g.,
+a cross-debugger) should:
+
+	- include <libunwind-$ARCH.h>, and
+	- link against -lunwind-$ARCH
+
+The global symbols exported by -lunwind-$ARCH are unique such that the
+same application can be linked against the separate unwind libraries
+of multiple targets.  However, a single compilation unit can include
+the header file for only one target.  For example, foo.c might include
+<libunwind-ia64.h> and bar.c might include <libunwind.h> and the
+entire application would have to be linked against both -lunwind and
+-lunwind-ia64.
+
+Note: the unwind header files of all targets have a common dependency
+on libunwind-common.h.  To avoid version conflicts, it is necessary to
+ensure that the unwind libraries for all targets were derived from the
+same release of libunwind.  That is, if the unwind library for one
+target is upgraded to a newer version, the libraries for all other
+targets also need to be upgraded.
+
+Note 2: The assumption is that a cross-unwinder can handle all
+interesting flavors of a target.  For example, the unwinder for the
+ia64 target is expected to be able to handle both Linux and HP-UX.
+
+* IA-64 Specific Information
+
+Apart from the normal frame-registers, the IA-64 implementation of
+libunwind provides the means to access the current value of the
+register backing store pointer (bsp).  One quirk with this
+frame-register is that it corresponds to the address that would be in
+register ar.bsp after flushing the current register stack to the
+backing store (i.e., as if a "flushrs" instruction had been executed).
+Of course, given this value and the contents of the current frame
+marker (CFM), it's easy to calculate the original value of ar.bsp:
+
+	unw_word_t cfm, bsp, bsp_after_flushrs, sof;
+
+	unw_get_reg (&cursor, UNW_IA64_BSP, &bsp_after_flushrs);
+	unw_get_reg (&cursor, UNW_IA64_CFM, &cfm);
+	bsp = ia64_rse_skip_regs (bsp_after_flushrs, -(cfm & 0x7f));
+
+** Dynamic Unwind Info
+
diff --git a/libunwind/doc/_U_dyn_cancel.man b/libunwind/doc/_U_dyn_cancel.man
new file mode 100644
index 0000000..a420a6d
--- /dev/null
+++ b/libunwind/doc/_U_dyn_cancel.man
@@ -0,0 +1,66 @@
+'\" t
+.\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007
+.\" NOTE: This file is generated, DO NOT EDIT.
+.de Vb
+.ft CW
+.nf
+..
+.de Ve
+.ft R
+
+.fi
+..
+.TH "\\_U\\_DYN\\_CANCEL" "3" "16 August 2007" "Programming Library " "Programming Library "
+.SH NAME
+_U_dyn_cancel
+\-\- cancel unwind\-info for dynamically generated code 
+.PP
+.SH SYNOPSIS
+
+.PP
+#include <libunwind.h>
+.br
+.PP
+void
+_U_dyn_cancel(unw_dyn_info_t *di);
+.br
+.PP
+.SH DESCRIPTION
+
+.PP
+The _U_dyn_cancel()
+routine cancels the registration of the 
+unwind\-info for a dynamically generated procedure. Argument di
+is the pointer to the unw_dyn_info_t
+structure that 
+describes the procedure\&'s unwind\-info. 
+.PP
+The _U_dyn_cancel()
+routine is guaranteed to execute in 
+constant time (in the absence of contention from concurrent calls to 
+_U_dyn_register()
+or _U_dyn_cancel()).
+.PP
+.SH THREAD AND SIGNAL SAFETY
+
+.PP
+_U_dyn_cancel()
+is thread\-safe but \fInot\fP
+safe to use 
+from a signal handler. 
+.PP
+.SH SEE ALSO
+
+.PP
+libunwind\-dynamic(3),
+_U_dyn_register(3)
+.PP
+.SH AUTHOR
+
+.PP
+David Mosberger\-Tang
+.br
+Email: \fBdmosberger@gmail.com\fP
+.br
+WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
+.\" NOTE: This file is generated, DO NOT EDIT.
diff --git a/libunwind/doc/_U_dyn_cancel.tex b/libunwind/doc/_U_dyn_cancel.tex
new file mode 100644
index 0000000..ca5a12a
--- /dev/null
+++ b/libunwind/doc/_U_dyn_cancel.tex
@@ -0,0 +1,46 @@
+\documentclass{article}
+\usepackage[fancyhdr,pdf]{latex2man}
+
+\input{common.tex}
+
+\begin{document}
+
+\begin{Name}{3}{\_U\_dyn\_cancel}{David Mosberger-Tang}{Programming Library}{\_U\_dyn\_cancel}\_U\_dyn\_cancel -- cancel unwind-info for dynamically generated code
+\end{Name}
+
+\section{Synopsis}
+
+\File{\#include $<$libunwind.h$>$}\\
+
+\Type{void} \Func{\_U\_dyn\_cancel}(\Type{unw\_dyn\_info\_t~*}\Var{di});\\
+
+\section{Description}
+
+The \Func{\_U\_dyn\_cancel}() routine cancels the registration of the
+unwind-info for a dynamically generated procedure.  Argument \Var{di}
+is the pointer to the \Type{unw\_dyn\_info\_t} structure that
+describes the procedure's unwind-info.
+
+The \Func{\_U\_dyn\_cancel}() routine is guaranteed to execute in
+constant time (in the absence of contention from concurrent calls to
+\Func{\_U\_dyn\_register}() or \Func{\_U\_dyn\_cancel}()).
+
+
+\section{Thread and Signal Safety}
+
+\Func{\_U\_dyn\_cancel}() is thread-safe but \emph{not} safe to use
+from a signal handler.
+
+\section{See Also}
+
+\SeeAlso{libunwind-dynamic(3)}, \SeeAlso{\_U\_dyn\_register(3)}
+
+\section{Author}
+
+\noindent
+David Mosberger-Tang\\
+Email: \Email{dmosberger@gmail.com}\\
+WWW: \URL{http://www.nongnu.org/libunwind/}.
+\LatexManEnd
+
+\end{document}
diff --git a/libunwind/doc/_U_dyn_register.man b/libunwind/doc/_U_dyn_register.man
new file mode 100644
index 0000000..107e5fd
--- /dev/null
+++ b/libunwind/doc/_U_dyn_register.man
@@ -0,0 +1,68 @@
+'\" t
+.\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007
+.\" NOTE: This file is generated, DO NOT EDIT.
+.de Vb
+.ft CW
+.nf
+..
+.de Ve
+.ft R
+
+.fi
+..
+.TH "\\_U\\_DYN\\_REGISTER" "3" "16 August 2007" "Programming Library " "Programming Library "
+.SH NAME
+_U_dyn_register
+\-\- register unwind\-info for dynamically generated code 
+.PP
+.SH SYNOPSIS
+
+.PP
+#include <libunwind.h>
+.br
+.PP
+void
+_U_dyn_register(unw_dyn_info_t *di);
+.br
+.PP
+.SH DESCRIPTION
+
+.PP
+The _U_dyn_register()
+routine registers unwind\-info for a 
+dynamically generated procedure. The procedure\&'s unwind\-info is 
+described by a structure of type unw_dyn_info_t
+(see 
+libunwind\-dynamic(3)).
+A pointer to this structure is 
+passed in argument di\&.
+.PP
+The _U_dyn_register()
+routine is guaranteed to execute in 
+constant time (in the absence of contention from concurrent calls to 
+_U_dyn_register()
+or _U_dyn_cancel()).
+.PP
+.SH THREAD AND SIGNAL SAFETY
+
+.PP
+_U_dyn_register()
+is thread\-safe but \fInot\fP
+safe to use 
+from a signal handler. 
+.PP
+.SH SEE ALSO
+
+.PP
+libunwind\-dynamic(3),
+_U_dyn_cancel(3)
+.PP
+.SH AUTHOR
+
+.PP
+David Mosberger\-Tang
+.br
+Email: \fBdmosberger@gmail.com\fP
+.br
+WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
+.\" NOTE: This file is generated, DO NOT EDIT.
diff --git a/libunwind/doc/_U_dyn_register.tex b/libunwind/doc/_U_dyn_register.tex
new file mode 100644
index 0000000..ab23b5c
--- /dev/null
+++ b/libunwind/doc/_U_dyn_register.tex
@@ -0,0 +1,47 @@
+\documentclass{article}
+\usepackage[fancyhdr,pdf]{latex2man}
+
+\input{common.tex}
+
+\begin{document}
+
+\begin{Name}{3}{\_U\_dyn\_register}{David Mosberger-Tang}{Programming Library}{\_U\_dyn\_register}\_U\_dyn\_register -- register unwind-info for dynamically generated code
+\end{Name}
+
+\section{Synopsis}
+
+\File{\#include $<$libunwind.h$>$}\\
+
+\Type{void} \Func{\_U\_dyn\_register}(\Type{unw\_dyn\_info\_t~*}\Var{di});\\
+
+\section{Description}
+
+The \Func{\_U\_dyn\_register}() routine registers unwind-info for a
+dynamically generated procedure.  The procedure's unwind-info is
+described by a structure of type \Type{unw\_dyn\_info\_t} (see
+\SeeAlso{libunwind-dynamic(3)}).  A pointer to this structure is
+passed in argument \Var{di}.
+
+The \Func{\_U\_dyn\_register}() routine is guaranteed to execute in
+constant time (in the absence of contention from concurrent calls to
+\Func{\_U\_dyn\_register}() or \Func{\_U\_dyn\_cancel}()).
+
+
+\section{Thread and Signal Safety}
+
+\Func{\_U\_dyn\_register}() is thread-safe but \emph{not} safe to use
+from a signal handler.
+
+\section{See Also}
+
+\SeeAlso{libunwind-dynamic(3)}, \SeeAlso{\_U\_dyn\_cancel(3)}
+
+\section{Author}
+
+\noindent
+David Mosberger-Tang\\
+Email: \Email{dmosberger@gmail.com}\\
+WWW: \URL{http://www.nongnu.org/libunwind/}.
+\LatexManEnd
+
+\end{document}
diff --git a/libunwind/doc/common.tex.in b/libunwind/doc/common.tex.in
new file mode 100644
index 0000000..91c96a9
--- /dev/null
+++ b/libunwind/doc/common.tex.in
@@ -0,0 +1,11 @@
+\setVersion{@VERSION@}
+
+\sloppy
+
+\newcommand{\Lt}{\symbol{"3C}}
+\newcommand{\Gt}{\symbol{"3E}}
+\newcommand{\Type}[1]{\File{#1}}        % see libunwind.trans
+\newcommand{\Func}[1]{\Prog{#1}}        % see libunwind.trans
+\newcommand{\Var}[1]{\Prog{#1}}         % see libunwind.trans
+\newcommand{\Const}[1]{\File{#1}}       % see libunwind.trans
+\newcommand{\SeeAlso}[2]{\File{#1}}	% see libunwind.trans
diff --git a/libunwind/doc/libunwind-dynamic.man b/libunwind/doc/libunwind-dynamic.man
new file mode 100644
index 0000000..7c7507c
--- /dev/null
+++ b/libunwind/doc/libunwind-dynamic.man
@@ -0,0 +1,538 @@
+'\" t
+.\" Manual page created with latex2man on Thu Aug 16 09:44:44 MDT 2007
+.\" NOTE: This file is generated, DO NOT EDIT.
+.de Vb
+.ft CW
+.nf
+..
+.de Ve
+.ft R
+
+.fi
+..
+.TH "LIBUNWIND\-DYNAMIC" "3" "16 August 2007" "Programming Library " "Programming Library "
+.SH NAME
+libunwind\-dynamic
+\-\- libunwind\-support for runtime\-generated code 
+.PP
+.SH INTRODUCTION
+
+.PP
+For libunwind
+to do its job, it needs to be able to reconstruct 
+the \fIframe state\fP
+of each frame in a call\-chain. The frame state 
+describes the subset of the machine\-state that consists of the 
+\fIframe registers\fP
+(typically the instruction\-pointer and the 
+stack\-pointer) and all callee\-saved registers (preserved registers). 
+The frame state describes each register either by providing its 
+current value (for frame registers) or by providing the location at 
+which the current value is stored (callee\-saved registers). 
+.PP
+For statically generated code, the compiler normally takes care of 
+emitting \fIunwind\-info\fP
+which provides the minimum amount of 
+information needed to reconstruct the frame\-state for each instruction 
+in a procedure. For dynamically generated code, the runtime code 
+generator must use the dynamic unwind\-info interface provided by 
+libunwind
+to supply the equivalent information. This manual 
+page describes the format of this information in detail. 
+.PP
+For the purpose of this discussion, a \fIprocedure\fP
+is defined to 
+be an arbitrary piece of \fIcontiguous\fP
+code. Normally, each 
+procedure directly corresponds to a function in the source\-language 
+but this is not strictly required. For example, a runtime 
+code\-generator could translate a given function into two separate 
+(discontiguous) procedures: one for frequently\-executed (hot) code and 
+one for rarely\-executed (cold) code. Similarly, simple 
+source\-language functions (usually leaf functions) may get translated 
+into code for which the default unwind\-conventions apply and for such 
+code, it is not strictly necessary to register dynamic unwind\-info. 
+.PP
+A procedure logically consists of a sequence of \fIregions\fP\&.
+Regions are nested in the sense that the frame state at the end of one 
+region is, by default, assumed to be the frame state for the next 
+region. Each region is thought of as being divided into a 
+\fIprologue\fP,
+a \fIbody\fP,
+and an \fIepilogue\fP\&.
+Each of them 
+can be empty. If non\-empty, the prologue sets up the frame state for 
+the body. For example, the prologue may need to allocate some space 
+on the stack and save certain callee\-saved registers. The body 
+performs the actual work of the procedure but does not change the 
+frame state in any way. If non\-empty, the epilogue restores the 
+previous frame state and as such it undoes or cancels the effect of 
+the prologue. In fact, a single epilogue may undo the effect of the 
+prologues of several (nested) regions. 
+.PP
+We should point out that even though the prologue, body, and epilogue 
+are logically separate entities, optimizing code\-generators will 
+generally interleave instructions from all three entities. For this 
+reason, the dynamic unwind\-info interface of libunwind
+makes no 
+distinction whatsoever between prologue and body. Similarly, the 
+exact set of instructions that make up an epilogue is also irrelevant. 
+The only point in the epilogue that needs to be described explicitly 
+by the dynamic unwind\-info is the point at which the stack\-pointer 
+gets restored. The reason this point needs to be described is that 
+once the stack\-pointer is restored, all values saved in the 
+deallocated portion of the stack frame become invalid and hence 
+libunwind
+needs to know about it. The portion of the frame 
+state not saved on the stack is assume to remain valid through the end 
+of the region. For this reason, there is usually no need to describe 
+instructions which restore the contents of callee\-saved registers. 
+.PP
+Within a region, each instruction that affects the frame state in some 
+fashion needs to be described with an operation descriptor. For this 
+purpose, each instruction in the region is assigned a unique index. 
+Exactly how this index is derived depends on the architecture. For 
+example, on RISC and EPIC\-style architecture, instructions have a 
+fixed size so it\&'s possible to simply number the instructions. In 
+contrast, most CISC use variable\-length instruction encodings, so it 
+is usually necessary to use a byte\-offset as the index. Given the 
+instruction index, the operation descriptor specifies the effect of 
+the instruction in an abstract manner. For example, it might express 
+that the instruction stores calle\-saved register r1
+at offset 16 
+in the stack frame. 
+.PP
+.SH PROCEDURES
+
+.PP
+A runtime code\-generator registers the dynamic unwind\-info of a 
+procedure by setting up a structure of type unw_dyn_info_t
+and calling _U_dyn_register(),
+passing the address of the 
+structure as the sole argument. The members of the 
+unw_dyn_info_t
+structure are described below: 
+.TP
+void *next
+ Private to libunwind\&.
+Must not be used 
+by the application. 
+.TP
+void *prev
+ Private to libunwind\&.
+Must not be used 
+by the application. 
+.TP
+unw_word_t start_ip
+ The start\-address of the 
+instructions of the procedure (remember: procedure are defined to be 
+contiguous pieces of code, so a single code\-range is sufficient). 
+.TP
+unw_word_t end_ip
+ The end\-address of the 
+instructions of the procedure (non\-inclusive, that is, 
+end_ip\-start_ip
+is the size of the procedure in 
+bytes). 
+.TP
+unw_word_t gp
+ The global\-pointer value in use 
+for this procedure. The exact meaing of the global\-pointer is 
+architecture\-specific and on some architecture, it is not used at 
+all. 
+.TP
+int32_t format
+ The format of the unwind\-info. 
+This member can be one of UNW_INFO_FORMAT_DYNAMIC,
+UNW_INFO_FORMAT_TABLE,
+or 
+UNW_INFO_FORMAT_REMOTE_TABLE\&.
+.TP
+union u
+ This union contains one sub\-member 
+structure for every possible unwind\-info format: 
+.RS
+.TP
+unw_dyn_proc_info_t pi
+ This member is used 
+for format UNW_INFO_FORMAT_DYNAMIC\&.
+.TP
+unw_dyn_table_info_t ti
+ This member is used 
+for format UNW_INFO_FORMAT_TABLE\&.
+.TP
+unw_dyn_remote_table_info_t rti
+ This member 
+is used for format UNW_INFO_FORMAT_REMOTE_TABLE\&.
+.RE
+.RS
+.PP
+The format of these sub\-members is described in detail below. 
+.RE
+.PP
+.SS PROC\-INFO FORMAT
+.PP
+This is the preferred dynamic unwind\-info format and it is generally 
+the one used by full\-blown runtime code\-generators. In this format, 
+the details of a procedure are described by a structure of type 
+unw_dyn_proc_info_t\&.
+This structure contains the following 
+members: 
+.PP
+.RE
+.TP
+unw_word_t name_ptr
+ The address of a 
+(human\-readable) name of the procedure or 0 if no such name is 
+available. If non\-zero, The string stored at this address must be 
+ASCII NUL terminated. For source languages that use name\-mangling 
+(such as C++ or Java) the string stored at this address should be 
+the \fIdemangled\fP
+version of the name. 
+.PP
+.TP
+unw_word_t handler
+ The address of the 
+personality\-routine for this procedure. Personality\-routines are 
+used in conjunction with exception handling. See the C++ ABI draft 
+(http://www.codesourcery.com/cxx\-abi/) for an overview and a 
+description of the personality routine. If the procedure has no 
+personality routine, handler
+must be set to 0. 
+.PP
+.TP
+uint32_t flags
+ A bitmask of flags. At the 
+moment, no flags have been defined and this member must be 
+set to 0. 
+.PP
+.TP
+unw_dyn_region_info_t *regions
+ A NULL\-terminated 
+linked list of region\-descriptors. See section ``Region 
+descriptors\&'' below for more details. 
+.PP
+.SS TABLE\-INFO FORMAT
+.PP
+This format is generally used when the dynamically generated code was 
+derived from static code and the unwind\-info for the dynamic and the 
+static versions is identical. For example, this format can be useful 
+when loading statically\-generated code into an address\-space in a 
+non\-standard fashion (i.e., through some means other than 
+dlopen()).
+In this format, the details of a group of procedures 
+is described by a structure of type unw_dyn_table_info\&.
+This structure contains the following members: 
+.PP
+.TP
+unw_word_t name_ptr
+ The address of a 
+(human\-readable) name of the procedure or 0 if no such name is 
+available. If non\-zero, The string stored at this address must be 
+ASCII NUL terminated. For source languages that use name\-mangling 
+(such as C++ or Java) the string stored at this address should be 
+the \fIdemangled\fP
+version of the name. 
+.PP
+.TP
+unw_word_t segbase
+ The segment\-base value 
+that needs to be added to the segment\-relative values stored in the 
+unwind\-info. The exact meaning of this value is 
+architecture\-specific. 
+.PP
+.TP
+unw_word_t table_len
+ The length of the 
+unwind\-info (table_data)
+counted in units of words 
+(unw_word_t).
+.PP
+.TP
+unw_word_t table_data
+ A pointer to the actual 
+data encoding the unwind\-info. The exact format is 
+architecture\-specific (see architecture\-specific sections below). 
+.PP
+.SS REMOTE TABLE\-INFO FORMAT
+.PP
+The remote table\-info format has the same basic purpose as the regular 
+table\-info format. The only difference is that when libunwind
+uses the unwind\-info, it will keep the table data in the target 
+address\-space (which may be remote). Consequently, the type of the 
+table_data
+member is unw_word_t
+rather than a pointer. 
+This implies that libunwind
+will have to access the table\-data 
+via the address\-space\&'s access_mem()
+call\-back, rather than 
+through a direct memory reference. 
+.PP
+From the point of view of a runtime\-code generator, the remote 
+table\-info format offers no advantage and it is expected that such 
+generators will describe their procedures either with the proc\-info 
+format or the normal table\-info format. The main reason that the 
+remote table\-info format exists is to enable the 
+address\-space\-specific find_proc_info()
+callback (see 
+unw_create_addr_space(3))
+to return unwind tables whose 
+data remains in remote memory. This can speed up unwinding (e.g., for 
+a debugger) because it reduces the amount of data that needs to be 
+loaded from remote memory. 
+.PP
+.SH REGIONS DESCRIPTORS
+
+.PP
+A region descriptor is a variable length structure that describes how 
+each instruction in the region affects the frame state. Of course, 
+most instructions in a region usualy do not change the frame state and 
+for those, nothing needs to be recorded in the region descriptor. A 
+region descriptor is a structure of type 
+unw_dyn_region_info_t
+and has the following members: 
+.TP
+unw_dyn_region_info_t *next
+ A pointer to the 
+next region. If this is the last region, next
+is NULL\&.
+.TP
+int32_t insn_count
+ The length of the region in 
+instructions. Each instruction is assumed to have a fixed size (see 
+architecture\-specific sections for details). The value of 
+insn_count
+may be negative in the last region of a procedure 
+(i.e., it may be negative only if next
+is NULL).
+A 
+negative value indicates that the region covers the last \fIN\fP
+instructions of the procedure, where \fIN\fP
+is the absolute value 
+of insn_count\&.
+.TP
+uint32_t op_count
+ The (allocated) length of 
+the op_count
+array. 
+.TP
+unw_dyn_op_t op
+ An array of dynamic unwind 
+directives. See Section ``Dynamic unwind directives\&'' for a 
+description of the directives. 
+.PP
+A region descriptor with an insn_count
+of zero is an 
+\fIempty region\fP
+and such regions are perfectly legal. In fact, 
+empty regions can be useful to establish a particular frame state 
+before the start of another region. 
+.PP
+A single region list can be shared across multiple procedures provided 
+those procedures share a common prologue and epilogue (their bodies 
+may differ, of course). Normally, such procedures consist of a canned 
+prologue, the body, and a canned epilogue. This could be described by 
+two regions: one covering the prologue and one covering the epilogue. 
+Since the body length is variable, the latter region would need to 
+specify a negative value in insn_count
+such that 
+libunwind
+knows that the region covers the end of the procedure 
+(up to the address specified by end_ip).
+.PP
+The region descriptor is a variable length structure to make it 
+possible to allocate all the necessary memory with a single 
+memory\-allocation request. To facilitate the allocation of a region 
+descriptors libunwind
+provides a helper routine with the 
+following synopsis: 
+.PP
+size_t
+_U_dyn_region_size(int
+op_count);
+.PP
+This routine returns the number of bytes needed to hold a region 
+descriptor with space for op_count
+unwind directives. Note 
+that the length of the op
+array does not have to match exactly 
+with the number of directives in a region. Instead, it is sufficient 
+if the op
+array contains at least as many entries as there are 
+directives, since the end of the directives can always be indicated 
+with the UNW_DYN_STOP
+directive. 
+.PP
+.SH DYNAMIC UNWIND DIRECTIVES
+
+.PP
+A dynamic unwind directive describes how the frame state changes 
+at a particular point within a region. The description is in 
+the form of a structure of type unw_dyn_op_t\&.
+This 
+structure has the following members: 
+.TP
+int8_t tag
+ The operation tag. Must be one 
+of the unw_dyn_operation_t
+values described below. 
+.TP
+int8_t qp
+ The qualifying predicate that controls 
+whether or not this directive is active. This is useful for 
+predicated architecturs such as IA\-64 or ARM, where the contents of 
+another (callee\-saved) register determines whether or not an 
+instruction is executed (takes effect). If the directive is always 
+active, this member should be set to the manifest constant 
+_U_QP_TRUE
+(this constant is defined for all 
+architectures, predicated or not). 
+.TP
+int16_t reg
+ The number of the register affected 
+by the instruction. 
+.TP
+int32_t when
+ The region\-relative number of 
+the instruction to which this directive applies. For example, 
+a value of 0 means that the effect described by this directive 
+has taken place once the first instruction in the region has 
+executed. 
+.TP
+unw_word_t val
+ The value to be applied by the 
+operation tag. The exact meaning of this value varies by tag. See 
+Section ``Operation tags\&'' below. 
+.PP
+It is perfectly legitimate to specify multiple dynamic unwind 
+directives with the same when
+value, if a particular instruction 
+has a complex effect on the frame state. 
+.PP
+Empty regions by definition contain no actual instructions and as such 
+the directives are not tied to a particular instruction. By 
+convention, the when
+member should be set to 0, however. 
+.PP
+There is no need for the dynamic unwind directives to appear 
+in order of increasing when
+values. If the directives happen to 
+be sorted in that order, it may result in slightly faster execution, 
+but a runtime code\-generator should not go to extra lengths just to 
+ensure that the directives are sorted. 
+.PP
+IMPLEMENTATION NOTE: should libunwind
+implementations for 
+certain architectures prefer the list of unwind directives to be 
+sorted, it is recommended that such implementations first check 
+whether the list happens to be sorted already and, if not, sort the 
+directives explicitly before the first use. With this approach, the 
+overhead of explicit sorting is only paid when there is a real benefit 
+and if the runtime code\-generator happens to generated sorted lists 
+naturally, the performance penalty is limited to a simple O(N) check. 
+.PP
+.SS OPERATIONS TAGS
+.PP
+The possible operation tags are defined by enumeration type 
+unw_dyn_operation_t
+which defines the following 
+values: 
+.PP
+.TP
+UNW_DYN_STOP
+ Marks the end of the dynamic unwind 
+directive list. All remaining entries in the op
+array of the 
+region\-descriptor are ignored. This tag is guaranteed to have a 
+value of 0. 
+.PP
+.TP
+UNW_DYN_SAVE_REG
+ Marks an instruction which saves 
+register reg
+to register val\&.
+.PP
+.TP
+UNW_DYN_SPILL_FP_REL
+ Marks an instruction which 
+spills register reg
+to a frame\-pointer\-relative location. The 
+frame\-pointer\-relative offset is given by the value stored in member 
+val\&.
+See the architecture\-specific sections for a description 
+of the stack frame layout. 
+.PP
+.TP
+UNW_DYN_SPILL_SP_REL
+ Marks an instruction which 
+spills register reg
+to a stack\-pointer\-relative location. The 
+stack\-pointer\-relative offset is given by the value stored in member 
+val\&.
+See the architecture\-specific sections for a description 
+of the stack frame layout. 
+.PP
+.TP
+UNW_DYN_ADD
+ Marks an instruction which adds 
+the constant value val
+to register reg\&.
+To add subtract 
+a constant value, store the two\&'s\-complement of the value in 
+val\&.
+The set of registers that can be specified for this tag 
+is described in the architecture\-specific sections below. 
+.PP
+.TP
+UNW_DYN_POP_FRAMES
+ .PP
+.TP
+UNW_DYN_LABEL_STATE
+ .PP
+.TP
+UNW_DYN_COPY_STATE
+ .PP
+.TP
+UNW_DYN_ALIAS
+ .PP
+unw_dyn_op_t 
+.PP
+_U_dyn_op_save_reg(); 
+_U_dyn_op_spill_fp_rel(); 
+_U_dyn_op_spill_sp_rel(); 
+_U_dyn_op_add(); 
+_U_dyn_op_pop_frames(); 
+_U_dyn_op_label_state(); 
+_U_dyn_op_copy_state(); 
+_U_dyn_op_alias(); 
+_U_dyn_op_stop(); 
+.PP
+.SH IA\-64 SPECIFICS
+
+.PP
+\- meaning of segbase member in table\-info/table\-remote\-info format 
+\- format of table_data in table\-info/table\-remote\-info format 
+\- instruction size: each bundle is counted as 3 instructions, regardless 
+of template (MLX) 
+\- describe stack\-frame layout, especially with regards to sp\-relative 
+and fp\-relative addressing 
+\- UNW_DYN_ADD can only add to ``sp\&'' (always a negative value); use 
+POP_FRAMES otherwise 
+.PP
+.SH SEE ALSO
+
+.PP
+libunwind(3),
+_U_dyn_register(3),
+_U_dyn_cancel(3)
+.PP
+.SH AUTHOR
+
+.PP
+David Mosberger\-Tang
+.br
+Email: \fBdmosberger@gmail.com\fP
+.br
+WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
+.\" NOTE: This file is generated, DO NOT EDIT.
diff --git a/libunwind/doc/libunwind-dynamic.tex b/libunwind/doc/libunwind-dynamic.tex
new file mode 100644
index 0000000..21e895a
--- /dev/null
+++ b/libunwind/doc/libunwind-dynamic.tex
@@ -0,0 +1,401 @@
+\documentclass{article}
+\usepackage[fancyhdr,pdf]{latex2man}
+
+\input{common.tex}
+
+\begin{document}
+
+\begin{Name}{3}{libunwind-dynamic}{David Mosberger-Tang}{Programming Library}{Introduction to dynamic unwind-info}libunwind-dynamic -- libunwind-support for runtime-generated code
+\end{Name}
+
+\section{Introduction}
+
+For \Prog{libunwind} to do its job, it needs to be able to reconstruct
+the \emph{frame state} of each frame in a call-chain.  The frame state
+describes the subset of the machine-state that consists of the
+\emph{frame registers} (typically the instruction-pointer and the
+stack-pointer) and all callee-saved registers (preserved registers).
+The frame state describes each register either by providing its
+current value (for frame registers) or by providing the location at
+which the current value is stored (callee-saved registers).
+
+For statically generated code, the compiler normally takes care of
+emitting \emph{unwind-info} which provides the minimum amount of
+information needed to reconstruct the frame-state for each instruction
+in a procedure.  For dynamically generated code, the runtime code
+generator must use the dynamic unwind-info interface provided by
+\Prog{libunwind} to supply the equivalent information.  This manual
+page describes the format of this information in detail.
+
+For the purpose of this discussion, a \emph{procedure} is defined to
+be an arbitrary piece of \emph{contiguous} code.  Normally, each
+procedure directly corresponds to a function in the source-language
+but this is not strictly required.  For example, a runtime
+code-generator could translate a given function into two separate
+(discontiguous) procedures: one for frequently-executed (hot) code and
+one for rarely-executed (cold) code.  Similarly, simple
+source-language functions (usually leaf functions) may get translated
+into code for which the default unwind-conventions apply and for such
+code, it is not strictly necessary to register dynamic unwind-info.
+
+A procedure logically consists of a sequence of \emph{regions}.
+Regions are nested in the sense that the frame state at the end of one
+region is, by default, assumed to be the frame state for the next
+region.  Each region is thought of as being divided into a
+\emph{prologue}, a \emph{body}, and an \emph{epilogue}.  Each of them
+can be empty.  If non-empty, the prologue sets up the frame state for
+the body.  For example, the prologue may need to allocate some space
+on the stack and save certain callee-saved registers.  The body
+performs the actual work of the procedure but does not change the
+frame state in any way.  If non-empty, the epilogue restores the
+previous frame state and as such it undoes or cancels the effect of
+the prologue.  In fact, a single epilogue may undo the effect of the
+prologues of several (nested) regions.
+
+We should point out that even though the prologue, body, and epilogue
+are logically separate entities, optimizing code-generators will
+generally interleave instructions from all three entities.  For this
+reason, the dynamic unwind-info interface of \Prog{libunwind} makes no
+distinction whatsoever between prologue and body.  Similarly, the
+exact set of instructions that make up an epilogue is also irrelevant.
+The only point in the epilogue that needs to be described explicitly
+by the dynamic unwind-info is the point at which the stack-pointer
+gets restored.  The reason this point needs to be described is that
+once the stack-pointer is restored, all values saved in the
+deallocated portion of the stack frame become invalid and hence
+\Prog{libunwind} needs to know about it.  The portion of the frame
+state not saved on the stack is assume to remain valid through the end
+of the region.  For this reason, there is usually no need to describe
+instructions which restore the contents of callee-saved registers.
+
+Within a region, each instruction that affects the frame state in some
+fashion needs to be described with an operation descriptor.  For this
+purpose, each instruction in the region is assigned a unique index.
+Exactly how this index is derived depends on the architecture.  For
+example, on RISC and EPIC-style architecture, instructions have a
+fixed size so it's possible to simply number the instructions.  In
+contrast, most CISC use variable-length instruction encodings, so it
+is usually necessary to use a byte-offset as the index.  Given the
+instruction index, the operation descriptor specifies the effect of
+the instruction in an abstract manner.  For example, it might express
+that the instruction stores calle-saved register \Var{r1} at offset 16
+in the stack frame.
+
+\section{Procedures}
+
+A runtime code-generator registers the dynamic unwind-info of a
+procedure by setting up a structure of type \Type{unw\_dyn\_info\_t}
+and calling \Func{\_U\_dyn\_register}(), passing the address of the
+structure as the sole argument.  The members of the
+\Type{unw\_dyn\_info\_t} structure are described below:
+\begin{itemize}
+\item[\Type{void~*}next] Private to \Prog{libunwind}.  Must not be used
+  by the application.
+\item[\Type{void~*}prev] Private to \Prog{libunwind}.  Must not be used
+  by the application.
+\item[\Type{unw\_word\_t} \Var{start\_ip}] The start-address of the
+  instructions of the procedure (remember: procedure are defined to be
+  contiguous pieces of code, so a single code-range is sufficient).
+\item[\Type{unw\_word\_t} \Var{end\_ip}] The end-address of the
+  instructions of the procedure (non-inclusive, that is,
+  \Var{end\_ip}-\Var{start\_ip} is the size of the procedure in
+  bytes).
+\item[\Type{unw\_word\_t} \Var{gp}] The global-pointer value in use
+  for this procedure.  The exact meaing of the global-pointer is
+  architecture-specific and on some architecture, it is not used at
+  all.
+\item[\Type{int32\_t} \Var{format}] The format of the unwind-info.
+  This member can be one of \Const{UNW\_INFO\_FORMAT\_DYNAMIC},
+  \Const{UNW\_INFO\_FORMAT\_TABLE}, or
+  \Const{UNW\_INFO\_FORMAT\_REMOTE\_TABLE}.
+\item[\Type{union} \Var{u}] This union contains one sub-member
+  structure for every possible unwind-info format:
+  \begin{description}
+  \item[\Type{unw\_dyn\_proc\_info\_t} \Var{pi}] This member is used
+    for format \Const{UNW\_INFO\_FORMAT\_DYNAMIC}.
+  \item[\Type{unw\_dyn\_table\_info\_t} \Var{ti}] This member is used
+    for format \Const{UNW\_INFO\_FORMAT\_TABLE}.
+  \item[\Type{unw\_dyn\_remote\_table\_info\_t} \Var{rti}] This member
+    is used for format \Const{UNW\_INFO\_FORMAT\_REMOTE\_TABLE}.
+  \end{description}\
+  The format of these sub-members is described in detail below.
+\end{itemize}
+
+\subsection{Proc-info format}
+
+This is the preferred dynamic unwind-info format and it is generally
+the one used by full-blown runtime code-generators.  In this format,
+the details of a procedure are described by a structure of type
+\Type{unw\_dyn\_proc\_info\_t}.  This structure contains the following
+members:
+\begin{description}
+
+\item[\Type{unw\_word\_t} \Var{name\_ptr}] The address of a
+  (human-readable) name of the procedure or 0 if no such name is
+  available.  If non-zero, The string stored at this address must be
+  ASCII NUL terminated.  For source languages that use name-mangling
+  (such as C++ or Java) the string stored at this address should be
+  the \emph{demangled} version of the name.
+
+\item[\Type{unw\_word\_t} \Var{handler}] The address of the
+  personality-routine for this procedure.  Personality-routines are
+  used in conjunction with exception handling.  See the C++ ABI draft
+  (http://www.codesourcery.com/cxx-abi/) for an overview and a
+  description of the personality routine.  If the procedure has no
+  personality routine, \Var{handler} must be set to 0.
+
+\item[\Type{uint32\_t} \Var{flags}] A bitmask of flags.  At the
+  moment, no flags have been defined and this member must be
+  set to 0.
+
+\item[\Type{unw\_dyn\_region\_info\_t~*}\Var{regions}] A NULL-terminated
+  linked list of region-descriptors.  See section ``Region
+  descriptors'' below for more details.
+
+\end{description}
+
+\subsection{Table-info format}
+
+This format is generally used when the dynamically generated code was
+derived from static code and the unwind-info for the dynamic and the
+static versions is identical.  For example, this format can be useful
+when loading statically-generated code into an address-space in a
+non-standard fashion (i.e., through some means other than
+\Func{dlopen}()).  In this format, the details of a group of procedures
+is described by a structure of type \Type{unw\_dyn\_table\_info}.
+This structure contains the following members:
+\begin{description}
+
+\item[\Type{unw\_word\_t} \Var{name\_ptr}] The address of a
+  (human-readable) name of the procedure or 0 if no such name is
+  available.  If non-zero, The string stored at this address must be
+  ASCII NUL terminated.  For source languages that use name-mangling
+  (such as C++ or Java) the string stored at this address should be
+  the \emph{demangled} version of the name.
+
+\item[\Type{unw\_word\_t} \Var{segbase}] The segment-base value
+  that needs to be added to the segment-relative values stored in the
+  unwind-info.  The exact meaning of this value is
+  architecture-specific.
+
+\item[\Type{unw\_word\_t} \Var{table\_len}] The length of the
+  unwind-info (\Var{table\_data}) counted in units of words
+  (\Type{unw\_word\_t}).
+
+\item[\Type{unw\_word\_t} \Var{table\_data}] A pointer to the actual
+  data encoding the unwind-info.  The exact format is
+  architecture-specific (see architecture-specific sections below).
+
+\end{description}
+
+\subsection{Remote table-info format}
+
+The remote table-info format has the same basic purpose as the regular
+table-info format.  The only difference is that when \Prog{libunwind}
+uses the unwind-info, it will keep the table data in the target
+address-space (which may be remote).  Consequently, the type of the
+\Var{table\_data} member is \Type{unw\_word\_t} rather than a pointer.
+This implies that \Prog{libunwind} will have to access the table-data
+via the address-space's \Func{access\_mem}() call-back, rather than
+through a direct memory reference.
+
+From the point of view of a runtime-code generator, the remote
+table-info format offers no advantage and it is expected that such
+generators will describe their procedures either with the proc-info
+format or the normal table-info format.  The main reason that the
+remote table-info format exists is to enable the
+address-space-specific \Func{find\_proc\_info}() callback (see
+\SeeAlso{unw\_create\_addr\_space}(3)) to return unwind tables whose
+data remains in remote memory.  This can speed up unwinding (e.g., for
+a debugger) because it reduces the amount of data that needs to be
+loaded from remote memory.
+
+\section{Regions descriptors}
+
+A region descriptor is a variable length structure that describes how
+each instruction in the region affects the frame state.  Of course,
+most instructions in a region usualy do not change the frame state and
+for those, nothing needs to be recorded in the region descriptor.  A
+region descriptor is a structure of type
+\Type{unw\_dyn\_region\_info\_t} and has the following members:
+\begin{description}
+\item[\Type{unw\_dyn\_region\_info\_t~*}\Var{next}] A pointer to the
+  next region.  If this is the last region, \Var{next} is \Const{NULL}.
+\item[\Type{int32\_t} \Var{insn\_count}] The length of the region in
+  instructions.  Each instruction is assumed to have a fixed size (see
+  architecture-specific sections for details).  The value of
+  \Var{insn\_count} may be negative in the last region of a procedure
+  (i.e., it may be negative only if \Var{next} is \Const{NULL}).  A
+  negative value indicates that the region covers the last \emph{N}
+  instructions of the procedure, where \emph{N} is the absolute value
+  of \Var{insn\_count}.
+\item[\Type{uint32\_t} \Var{op\_count}] The (allocated) length of
+  the \Var{op\_count} array.
+\item[\Type{unw\_dyn\_op\_t} \Var{op}] An array of dynamic unwind
+  directives.  See Section ``Dynamic unwind directives'' for a
+  description of the directives.
+\end{description}
+A region descriptor with an \Var{insn\_count} of zero is an
+\emph{empty region} and such regions are perfectly legal.  In fact,
+empty regions can be useful to establish a particular frame state
+before the start of another region.
+
+A single region list can be shared across multiple procedures provided
+those procedures share a common prologue and epilogue (their bodies
+may differ, of course).  Normally, such procedures consist of a canned
+prologue, the body, and a canned epilogue.  This could be described by
+two regions: one covering the prologue and one covering the epilogue.
+Since the body length is variable, the latter region would need to
+specify a negative value in \Var{insn\_count} such that
+\Prog{libunwind} knows that the region covers the end of the procedure
+(up to the address specified by \Var{end\_ip}).
+
+The region descriptor is a variable length structure to make it
+possible to allocate all the necessary memory with a single
+memory-allocation request.  To facilitate the allocation of a region
+descriptors \Prog{libunwind} provides a helper routine with the
+following synopsis:
+
+\noindent
+\Type{size\_t} \Func{\_U\_dyn\_region\_size}(\Type{int} \Var{op\_count});
+
+This routine returns the number of bytes needed to hold a region
+descriptor with space for \Var{op\_count} unwind directives.  Note
+that the length of the \Var{op} array does not have to match exactly
+with the number of directives in a region.  Instead, it is sufficient
+if the \Var{op} array contains at least as many entries as there are
+directives, since the end of the directives can always be indicated
+with the \Const{UNW\_DYN\_STOP} directive.
+
+\section{Dynamic unwind directives}
+
+A dynamic unwind directive describes how the frame state changes
+at a particular point within a region.  The description is in
+the form of a structure of type \Type{unw\_dyn\_op\_t}.  This
+structure has the following members:
+\begin{description}
+\item[\Type{int8\_t} \Var{tag}] The operation tag.  Must be one
+  of the \Type{unw\_dyn\_operation\_t} values described below.
+\item[\Type{int8\_t} \Var{qp}] The qualifying predicate that controls
+  whether or not this directive is active.  This is useful for
+  predicated architecturs such as IA-64 or ARM, where the contents of
+  another (callee-saved) register determines whether or not an
+  instruction is executed (takes effect).  If the directive is always
+  active, this member should be set to the manifest constant
+  \Const{\_U\_QP\_TRUE} (this constant is defined for all
+  architectures, predicated or not).
+\item[\Type{int16\_t} \Var{reg}] The number of the register affected
+  by the instruction.
+\item[\Type{int32\_t} \Var{when}] The region-relative number of
+  the instruction to which this directive applies.  For example,
+  a value of 0 means that the effect described by this directive
+  has taken place once the first instruction in the region has
+  executed.
+\item[\Type{unw\_word\_t} \Var{val}] The value to be applied by the
+  operation tag.  The exact meaning of this value varies by tag.  See
+  Section ``Operation tags'' below.
+\end{description}
+It is perfectly legitimate to specify multiple dynamic unwind
+directives with the same \Var{when} value, if a particular instruction
+has a complex effect on the frame state.
+
+Empty regions by definition contain no actual instructions and as such
+the directives are not tied to a particular instruction.  By
+convention, the \Var{when} member should be set to 0, however.
+
+There is no need for the dynamic unwind directives to appear
+in order of increasing \Var{when} values.  If the directives happen to
+be sorted in that order, it may result in slightly faster execution,
+but a runtime code-generator should not go to extra lengths just to
+ensure that the directives are sorted.
+
+IMPLEMENTATION NOTE: should \Prog{libunwind} implementations for
+certain architectures prefer the list of unwind directives to be
+sorted, it is recommended that such implementations first check
+whether the list happens to be sorted already and, if not, sort the
+directives explicitly before the first use.  With this approach, the
+overhead of explicit sorting is only paid when there is a real benefit
+and if the runtime code-generator happens to generated sorted lists
+naturally, the performance penalty is limited to a simple O(N) check.
+
+\subsection{Operations tags}
+
+The possible operation tags are defined by enumeration type
+\Type{unw\_dyn\_operation\_t} which defines the following
+values:
+\begin{description}
+
+\item[\Const{UNW\_DYN\_STOP}] Marks the end of the dynamic unwind
+  directive list.  All remaining entries in the \Var{op} array of the
+  region-descriptor are ignored.  This tag is guaranteed to have a
+  value of 0.
+
+\item[\Const{UNW\_DYN\_SAVE\_REG}] Marks an instruction which saves
+  register \Var{reg} to register \Var{val}.
+
+\item[\Const{UNW\_DYN\_SPILL\_FP\_REL}] Marks an instruction which
+  spills register \Var{reg} to a frame-pointer-relative location.  The
+  frame-pointer-relative offset is given by the value stored in member
+  \Var{val}.  See the architecture-specific sections for a description
+  of the stack frame layout.
+
+\item[\Const{UNW\_DYN\_SPILL\_SP\_REL}] Marks an instruction which
+  spills register \Var{reg} to a stack-pointer-relative location.  The
+  stack-pointer-relative offset is given by the value stored in member
+  \Var{val}.  See the architecture-specific sections for a description
+  of the stack frame layout.
+
+\item[\Const{UNW\_DYN\_ADD}] Marks an instruction which adds
+  the constant value \Var{val} to register \Var{reg}.  To add subtract
+  a constant value, store the two's-complement of the value in
+  \Var{val}.  The set of registers that can be specified for this tag
+  is described in the architecture-specific sections below.
+
+\item[\Const{UNW\_DYN\_POP\_FRAMES}]
+
+\item[\Const{UNW\_DYN\_LABEL\_STATE}]
+
+\item[\Const{UNW\_DYN\_COPY\_STATE}]
+
+\item[\Const{UNW\_DYN\_ALIAS}]
+
+\end{description}
+
+unw\_dyn\_op\_t
+
+\_U\_dyn\_op\_save\_reg();
+\_U\_dyn\_op\_spill\_fp\_rel();
+\_U\_dyn\_op\_spill\_sp\_rel();
+\_U\_dyn\_op\_add();
+\_U\_dyn\_op\_pop\_frames();
+\_U\_dyn\_op\_label\_state();
+\_U\_dyn\_op\_copy\_state();
+\_U\_dyn\_op\_alias();
+\_U\_dyn\_op\_stop();
+
+\section{IA-64 specifics}
+
+- meaning of segbase member in table-info/table-remote-info format
+- format of table\_data in table-info/table-remote-info format
+- instruction size: each bundle is counted as 3 instructions, regardless
+  of template (MLX)
+- describe stack-frame layout, especially with regards to sp-relative
+  and fp-relative addressing
+- UNW\_DYN\_ADD can only add to ``sp'' (always a negative value); use
+  POP\_FRAMES otherwise
+
+\section{See Also}
+
+\SeeAlso{libunwind(3)},
+\SeeAlso{\_U\_dyn\_register(3)},
+\SeeAlso{\_U\_dyn\_cancel(3)}
+
+\section{Author}
+
+\noindent
+David Mosberger-Tang\\
+Email: \Email{dmosberger@gmail.com}\\
+WWW: \URL{http://www.nongnu.org/libunwind/}.
+\LatexManEnd
+
+\end{document}
diff --git a/libunwind/doc/libunwind-ia64.man b/libunwind/doc/libunwind-ia64.man
new file mode 100644
index 0000000..06b141e
--- /dev/null
+++ b/libunwind/doc/libunwind-ia64.man
@@ -0,0 +1,314 @@
+'\" t
+.\" Manual page created with latex2man on Thu Aug 16 09:44:44 MDT 2007
+.\" NOTE: This file is generated, DO NOT EDIT.
+.de Vb
+.ft CW
+.nf
+..
+.de Ve
+.ft R
+
+.fi
+..
+.TH "LIBUNWIND\-IA64" "3" "16 August 2007" "Programming Library " "Programming Library "
+.SH NAME
+libunwind\-ia64
+\-\- IA\-64\-specific support in libunwind 
+.PP
+.SH INTRODUCTION
+
+.PP
+The IA\-64 version of libunwind
+uses a platform\-string of 
+ia64
+and, at least in theory, should be able to support all 
+operating systems adhering to the processor\-specific ABI defined for 
+the Itanium Processor Family. This includes both little\-endian Linux 
+and big\-endian HP\-UX. Furthermore, to make it possible for a single 
+library to unwind both 32\- and 64\-bit targets, the type 
+unw_word_t
+is always defined to be 64 bits wide (independent 
+of the natural word\-size of the host). Having said that, the current 
+implementation has been tested only with IA\-64 Linux. 
+.PP
+When targeting IA\-64, the libunwind
+header file defines the 
+macro UNW_TARGET_IA64
+as 1 and the macro UNW_TARGET
+as ``ia64\&'' (without the quotation marks). The former makes it 
+possible for platform\-dependent unwind code to use 
+conditional\-compilation to select an appropriate implementation. The 
+latter is useful for stringification purposes and to construct 
+target\-platform\-specific symbols. 
+.PP
+One special feature of IA\-64 is the use of NaT bits to support 
+speculative execution. Often, NaT bits are thought of as the ``65\-th 
+bit\&'' of a general register. However, to make everything fit into 
+64\-bit wide unw_word_t
+values, libunwind
+treats the 
+NaT\-bits like separate boolean registers, whose 64\-bit value is either 
+TRUE (non\-zero) or FALSE (zero). 
+.PP
+.SH MACHINE\-STATE
+
+.PP
+The machine\-state (set of registers) that is accessible through 
+libunwind
+depends on the type of stack frame that a cursor 
+points to. For normal frames, all ``preserved\&'' (callee\-saved) 
+registers are accessible. For signal\-trampoline frames, all registers 
+(including ``scratch\&'' (caller\-saved) registers) are accessible. Most 
+applications do not have to worry a\-priori about which registers are 
+accessible when. In case of doubt, it is always safe to \fItry\fP
+to 
+access a register (via unw_get_reg()
+or 
+unw_get_fpreg())
+and if the register isn\&'t accessible, the 
+call will fail with a return\-value of \-UNW_EBADREG\&.
+.PP
+As a special exception to the above general rule, scratch registers 
+r15\-r18
+are always accessible, even in normal 
+frames. This makes it possible to pass arguments, e.g., to exception 
+handlers. 
+.PP
+For a detailed description of the IA\-64 register usage convention, 
+please see the ``Itanium Software Conventions and Runtime Architecture 
+Guide\&'', available at: 
+.ce 100
+\fBhttp://www.intel.com/design/itanium/downloads/245358.htm\fP
+.ce 0
+
+.PP
+.SH REGISTER NAMES
+
+.PP
+The IA\-64\-version of libunwind
+defines three kinds of register 
+name macros: frame\-register macros, normal register macros, and 
+convenience macros. Below, we describe each kind in turn: 
+.PP
+.SS FRAME\-REGISTER MACROS
+.PP
+Frame\-registers are special (pseudo) registers because they always 
+have a valid value, even though sometimes they do not get saved 
+explicitly (e.g., if a memory stack frame is 16 bytes in size, the 
+previous stack\-pointer value can be calculated simply as 
+sp+16,
+so there is no need to save the stack\-pointer 
+explicitly). Moreover, the set of frame register values uniquely 
+identifies a stack frame. The IA\-64 architecture defines two stacks 
+(a memory and a register stack). Including the instruction\-pointer 
+(IP), this means there are three frame registers: 
+.TP
+UNW_IA64_IP:
+ Contains the instruction pointer (IP, or 
+``program counter\&'') of the current stack frame. Given this value, 
+the remaining machine\-state corresponds to the register\-values that 
+were present in the CPU when it was just about to execute the 
+instruction pointed to by UNW_IA64_IP\&.
+Bits 0 and 1 of 
+this frame\-register encode the slot number of the instruction. 
+\fBNote:\fP
+Due to the way the call instruction works on IA\-64, 
+the slot number is usually zero, but can be non\-zero, e.g., in the 
+stack\-frame of a signal\-handler trampoline. 
+.TP
+UNW_IA64_SP:
+ Contains the (memory) stack\-pointer 
+value (SP). 
+.TP
+UNW_IA64_BSP:
+ Contains the register backing\-store 
+pointer (BSP). \fBNote:\fP
+the value in this register is equal 
+to the contents of register ar.bsp
+at the time the 
+instruction at UNW_IA64_IP
+was about to begin execution. 
+.PP
+.SS NORMAL REGISTER MACROS
+.PP
+The following normal register name macros are available: 
+.TP
+UNW_IA64_GR:
+ The base\-index for general (integer) 
+registers. Add an index in the range from 0..127 to get a 
+particular general register. For example, to access r4,
+the index UNW_IA64_GR+4
+should be used. 
+Registers r0
+and r1
+(gp)
+are read\-only, 
+and any attempt to write them will result in an error 
+(\-UNW_EREADONLYREG).
+Even though r1
+is 
+read\-only, libunwind
+will automatically adjust its value if 
+the instruction\-pointer (UNW_IA64_IP)
+is modified. For 
+example, if UNW_IA64_IP
+is set to a value inside a 
+function func(),
+then reading 
+UNW_IA64_GR+1
+will return the global\-pointer 
+value for this function. 
+.TP
+UNW_IA64_NAT:
+ The base\-index for the NaT bits of the 
+general (integer) registers. A non\-zero value in these registers 
+corresponds to a set NaT\-bit. Add an index in the range from 0..127 
+to get a particular NaT\-bit register. For example, to access the 
+NaT bit of r4,
+the index UNW_IA64_NAT+4
+should be used. 
+.TP
+UNW_IA64_FR:
+ The base\-index for floating\-point 
+registers. Add an index in the range from 0..127 to get a 
+particular floating\-point register. For example, to access 
+f2,
+the index UNW_IA64_FR+2
+should be 
+used. Registers f0
+and f1
+are read\-only, and any 
+attempt to write to indices UNW_IA64_FR+0
+or 
+UNW_IA64_FR+1
+will result in an error 
+(\-UNW_EREADONLYREG).
+.TP
+UNW_IA64_AR:
+ The base\-index for application 
+registers. Add an index in the range from 0..127 to get a 
+particular application register. For example, to access 
+ar40,
+the index UNW_IA64_AR+40
+should be 
+used. The IA\-64 architecture defines several application registers 
+as ``reserved for future use\&''\&. Attempting to access such registers 
+results in an error (\-UNW_EBADREG).
+.TP
+UNW_IA64_BR:
+ The base\-index for branch registers. 
+Add an index in the range from 0..7 to get a particular branch 
+register. For example, to access b6,
+the index 
+UNW_IA64_BR+6
+should be used. 
+.TP
+UNW_IA64_PR:
+ Contains the set of predicate registers. 
+This 64\-bit wide register contains registers p0
+through 
+p63
+in the ``broad\-side\&'' format. Just like with the 
+``move predicates\&'' instruction, the registers are mapped as if 
+CFM.rrb.pr
+were set to 0. Thus, in general the value of 
+predicate register pN
+with N>=16 can be found 
+in bit 16 + ((N\-16)+CFM.rrb.pr) % 48\&.
+.TP
+UNW_IA64_CFM:
+ Contains the current\-frame\-mask 
+register. 
+.PP
+.SS CONVENIENCE MACROS
+.PP
+Convenience macros are simply aliases for certain frequently used 
+registers: 
+.TP
+UNW_IA64_GP:
+ Alias for UNW_IA64_GR+1,
+the global\-pointer register. 
+.TP
+UNW_IA64_TP:
+ Alias for UNW_IA64_GR+13,
+the thread\-pointer register. 
+.TP
+UNW_IA64_AR_RSC:
+ Alias for UNW_IA64_GR+16,
+the register\-stack configuration register. 
+.TP
+UNW_IA64_AR_BSP:
+ Alias for 
+UNW_IA64_GR+17\&.
+This register index accesses the 
+value of register ar.bsp
+as of the time it was last saved 
+explicitly. This is rarely what you want. Normally, you\&'ll want to 
+use UNW_IA64_BSP
+instead. 
+.TP
+UNW_IA64_AR_BSPSTORE:
+ Alias for UNW_IA64_GR+18,
+the register\-backing store write pointer. 
+.TP
+UNW_IA64_AR_RNAT:
+ Alias for UNW_IA64_GR+19,
+the register\-backing store NaT\-collection register. 
+.TP
+UNW_IA64_AR_CCV:
+ Alias for UNW_IA64_GR+32,
+the compare\-and\-swap value register. 
+.TP
+UNW_IA64_AR_CSD:
+ Alias for UNW_IA64_GR+25,
+the compare\-and\-swap\-data register (used by 16\-byte atomic operations). 
+.TP
+UNW_IA64_AR_UNAT:
+ Alias for UNW_IA64_GR+36,
+the user NaT\-collection register. 
+.TP
+UNW_IA64_AR_FPSR:
+ Alias for UNW_IA64_GR+40,
+the floating\-point status (and control) register. 
+.TP
+UNW_IA64_AR_PFS:
+ Alias for UNW_IA64_GR+64,
+the previous frame\-state register. 
+.TP
+UNW_IA64_AR_LC:
+ Alias for UNW_IA64_GR+65
+the loop\-count register. 
+.TP
+UNW_IA64_AR_EC:
+ Alias for UNW_IA64_GR+66,
+the epilogue\-count register. 
+.PP
+.SH THE UNWIND\-CONTEXT TYPE
+
+.PP
+On IA\-64, unw_context_t
+is simply an alias for 
+ucontext_t
+(as defined by the Single UNIX Spec). This implies 
+that it is possible to initialize a value of this type not just with 
+unw_getcontext(),
+but also with getcontext(),
+for 
+example. However, since this is an IA\-64\-specific extension to 
+libunwind,
+portable code should not rely on this equivalence. 
+.PP
+.SH SEE ALSO
+
+.PP
+libunwind(3)
+.PP
+.SH AUTHOR
+
+.PP
+David Mosberger\-Tang
+.br
+Email: \fBdmosberger@gmail.com\fP
+.br
+WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
+.\" NOTE: This file is generated, DO NOT EDIT.
diff --git a/libunwind/doc/libunwind-ia64.tex b/libunwind/doc/libunwind-ia64.tex
new file mode 100644
index 0000000..c08946d
--- /dev/null
+++ b/libunwind/doc/libunwind-ia64.tex
@@ -0,0 +1,216 @@
+\documentclass{article}
+\usepackage[fancyhdr,pdf]{latex2man}
+
+\input{common.tex}
+
+\begin{document}
+
+\begin{Name}{3}{libunwind-ia64}{David Mosberger-Tang}{Programming Library}{IA-64-specific support in libunwind}libunwind-ia64 -- IA-64-specific support in libunwind
+\end{Name}
+
+
+\section{Introduction}
+
+The IA-64 version of \Prog{libunwind} uses a platform-string of
+\texttt{ia64} and, at least in theory, should be able to support all
+operating systems adhering to the processor-specific ABI defined for
+the Itanium Processor Family.  This includes both little-endian Linux
+and big-endian HP-UX.  Furthermore, to make it possible for a single
+library to unwind both 32- and 64-bit targets, the type
+\Type{unw\_word\_t} is always defined to be 64 bits wide (independent
+of the natural word-size of the host).  Having said that, the current
+implementation has been tested only with IA-64 Linux.
+
+When targeting IA-64, the \Prog{libunwind} header file defines the
+macro \Const{UNW\_TARGET\_IA64} as 1 and the macro \Const{UNW\_TARGET}
+as ``ia64'' (without the quotation marks).  The former makes it
+possible for platform-dependent unwind code to use
+conditional-compilation to select an appropriate implementation.  The
+latter is useful for stringification purposes and to construct
+target-platform-specific symbols.
+
+One special feature of IA-64 is the use of NaT bits to support
+speculative execution.  Often, NaT bits are thought of as the ``65-th
+bit'' of a general register.  However, to make everything fit into
+64-bit wide \Type{unw\_word\_t} values, \Prog{libunwind} treats the
+NaT-bits like separate boolean registers, whose 64-bit value is either
+TRUE (non-zero) or FALSE (zero).
+
+
+\section{Machine-State}
+
+The machine-state (set of registers) that is accessible through
+\Prog{libunwind} depends on the type of stack frame that a cursor
+points to.  For normal frames, all ``preserved'' (callee-saved)
+registers are accessible.  For signal-trampoline frames, all registers
+(including ``scratch'' (caller-saved) registers) are accessible.  Most
+applications do not have to worry a-priori about which registers are
+accessible when.  In case of doubt, it is always safe to \emph{try} to
+access a register (via \Func{unw\_get\_reg}() or
+\Func{unw\_get\_fpreg}()) and if the register isn't accessible, the
+call will fail with a return-value of \texttt{-}\Const{UNW\_EBADREG}.
+
+As a special exception to the above general rule, scratch registers
+\texttt{r15}-\texttt{r18} are always accessible, even in normal
+frames.  This makes it possible to pass arguments, e.g., to exception
+handlers.
+
+For a detailed description of the IA-64 register usage convention,
+please see the ``Itanium Software Conventions and Runtime Architecture
+Guide'', available at:
+\begin{center}
+  \URL{http://www.intel.com/design/itanium/downloads/245358.htm}
+\end{center}
+
+
+\section{Register Names}
+
+The IA-64-version of \Prog{libunwind} defines three kinds of register
+name macros: frame-register macros, normal register macros, and
+convenience macros.  Below, we describe each kind in turn:
+
+
+\subsection{Frame-register Macros}
+
+Frame-registers are special (pseudo) registers because they always
+have a valid value, even though sometimes they do not get saved
+explicitly (e.g., if a memory stack frame is 16 bytes in size, the
+previous stack-pointer value can be calculated simply as
+\texttt{sp+16}, so there is no need to save the stack-pointer
+explicitly).  Moreover, the set of frame register values uniquely
+identifies a stack frame.  The IA-64 architecture defines two stacks
+(a memory and a register stack). Including the instruction-pointer
+(IP), this means there are three frame registers:
+\begin{Description}
+\item[\Const{UNW\_IA64\_IP}:] Contains the instruction pointer (IP, or
+  ``program counter'') of the current stack frame.  Given this value,
+  the remaining machine-state corresponds to the register-values that
+  were present in the CPU when it was just about to execute the
+  instruction pointed to by \Const{UNW\_IA64\_IP}.  Bits 0 and 1 of
+  this frame-register encode the slot number of the instruction.
+  \textbf{Note:} Due to the way the call instruction works on IA-64,
+  the slot number is usually zero, but can be non-zero, e.g., in the
+  stack-frame of a signal-handler trampoline.
+\item[\Const{UNW\_IA64\_SP}:] Contains the (memory) stack-pointer
+  value (SP).
+\item[\Const{UNW\_IA64\_BSP}:] Contains the register backing-store
+  pointer (BSP).  \textbf{Note:} the value in this register is equal
+  to the contents of register \texttt{ar.bsp} at the time the
+  instruction at \Const{UNW\_IA64\_IP} was about to begin execution.
+\end{Description}
+
+
+\subsection{Normal Register Macros}
+
+The following normal register name macros are available:
+\begin{Description}
+\item[\Const{UNW\_IA64\_GR}:] The base-index for general (integer)
+  registers.  Add an index in the range from 0..127 to get a
+  particular general register.  For example, to access \texttt{r4},
+  the index \Const{UNW\_IA64\_GR}\texttt{+4} should be used.
+  Registers \texttt{r0} and \texttt{r1} (\texttt{gp}) are read-only,
+  and any attempt to write them will result in an error
+  (\texttt{-}\Const{UNW\_EREADONLYREG}).  Even though \texttt{r1} is
+  read-only, \Prog{libunwind} will automatically adjust its value if
+  the instruction-pointer (\Const{UNW\_IA64\_IP}) is modified.  For
+  example, if \Const{UNW\_IA64\_IP} is set to a value inside a
+  function \Func{func}(), then reading
+  \Const{UNW\_IA64\_GR}\texttt{+1} will return the global-pointer
+  value for this function.
+\item[\Const{UNW\_IA64\_NAT}:] The base-index for the NaT bits of the
+  general (integer) registers.  A non-zero value in these registers
+  corresponds to a set NaT-bit.  Add an index in the range from 0..127
+  to get a particular NaT-bit register.  For example, to access the
+  NaT bit of \texttt{r4}, the index \Const{UNW\_IA64\_NAT}\texttt{+4}
+  should be used.
+\item[\Const{UNW\_IA64\_FR}:] The base-index for floating-point
+  registers.  Add an index in the range from 0..127 to get a
+  particular floating-point register.  For example, to access
+  \texttt{f2}, the index \Const{UNW\_IA64\_FR}\texttt{+2} should be
+  used.  Registers \texttt{f0} and \texttt{f1} are read-only, and any
+  attempt to write to indices \Const{UNW\_IA64\_FR}\texttt{+0} or
+  \Const{UNW\_IA64\_FR}\texttt{+1} will result in an error
+  (\texttt{-}\Const{UNW\_EREADONLYREG}).
+\item[\Const{UNW\_IA64\_AR}:] The base-index for application
+  registers.  Add an index in the range from 0..127 to get a
+  particular application register.  For example, to access
+  \texttt{ar40}, the index \Const{UNW\_IA64\_AR}\texttt{+40} should be
+  used.  The IA-64 architecture defines several application registers
+  as ``reserved for future use''.  Attempting to access such registers
+  results in an error (\texttt{-}\Const{UNW\_EBADREG}).
+\item[\Const{UNW\_IA64\_BR}:] The base-index for branch registers.
+  Add an index in the range from 0..7 to get a particular branch
+  register.  For example, to access \texttt{b6}, the index
+  \Const{UNW\_IA64\_BR}\texttt{+6} should be used.
+\item[\Const{UNW\_IA64\_PR}:] Contains the set of predicate registers.
+  This 64-bit wide register contains registers \texttt{p0} through
+  \texttt{p63} in the ``broad-side'' format.  Just like with the
+  ``move predicates'' instruction, the registers are mapped as if
+  \texttt{CFM.rrb.pr} were set to 0.  Thus, in general the value of
+  predicate register \texttt{p}$N$ with $N$>=16 can be found
+  in bit \texttt{16 + (($N$-16)+CFM.rrb.pr) \% 48}.
+\item[\Const{UNW\_IA64\_CFM}:] Contains the current-frame-mask
+  register.
+\end{Description}
+
+
+\subsection{Convenience Macros}
+
+Convenience macros are simply aliases for certain frequently used
+registers:
+\begin{Description}
+\item[\Const{UNW\_IA64\_GP}:] Alias for \Const{UNW\_IA64\_GR}\texttt{+1},
+  the global-pointer register.
+\item[\Const{UNW\_IA64\_TP}:] Alias for \Const{UNW\_IA64\_GR}\texttt{+13},
+  the thread-pointer register.
+\item[\Const{UNW\_IA64\_AR\_RSC}:] Alias for \Const{UNW\_IA64\_GR}\texttt{+16},
+  the register-stack configuration register.
+\item[\Const{UNW\_IA64\_AR\_BSP}:] Alias for
+  \Const{UNW\_IA64\_GR}\texttt{+17}.  This register index accesses the
+  value of register \texttt{ar.bsp} as of the time it was last saved
+  explicitly.  This is rarely what you want.  Normally, you'll want to
+  use \Const{UNW\_IA64\_BSP} instead.
+\item[\Const{UNW\_IA64\_AR\_BSPSTORE}:] Alias for \Const{UNW\_IA64\_GR}\texttt{+18},
+  the register-backing store write pointer.
+\item[\Const{UNW\_IA64\_AR\_RNAT}:] Alias for \Const{UNW\_IA64\_GR}\texttt{+19},
+  the register-backing store NaT-collection register.
+\item[\Const{UNW\_IA64\_AR\_CCV}:] Alias for \Const{UNW\_IA64\_GR}\texttt{+32},
+  the compare-and-swap value register.
+\item[\Const{UNW\_IA64\_AR\_CSD}:] Alias for \Const{UNW\_IA64\_GR}\texttt{+25},
+  the compare-and-swap-data register (used by 16-byte atomic operations).
+\item[\Const{UNW\_IA64\_AR\_UNAT}:] Alias for \Const{UNW\_IA64\_GR}\texttt{+36},
+  the user NaT-collection register.
+\item[\Const{UNW\_IA64\_AR\_FPSR}:] Alias for \Const{UNW\_IA64\_GR}\texttt{+40},
+  the floating-point status (and control) register.
+\item[\Const{UNW\_IA64\_AR\_PFS}:] Alias for \Const{UNW\_IA64\_GR}\texttt{+64},
+  the previous frame-state register.
+\item[\Const{UNW\_IA64\_AR\_LC}:] Alias for \Const{UNW\_IA64\_GR}\texttt{+65}
+  the loop-count register.
+\item[\Const{UNW\_IA64\_AR\_EC}:] Alias for \Const{UNW\_IA64\_GR}\texttt{+66},
+  the epilogue-count register.
+\end{Description}
+
+
+\section{The Unwind-Context Type}
+
+On IA-64, \Type{unw\_context\_t} is simply an alias for
+\Type{ucontext\_t} (as defined by the Single UNIX Spec).  This implies
+that it is possible to initialize a value of this type not just with
+\Func{unw\_getcontext}(), but also with \Func{getcontext}(), for
+example.  However, since this is an IA-64-specific extension to
+\Prog{libunwind}, portable code should not rely on this equivalence.
+
+
+\section{See Also}
+
+\SeeAlso{libunwind(3)}
+
+\section{Author}
+
+\noindent
+David Mosberger-Tang\\
+Email: \Email{dmosberger@gmail.com}\\
+WWW: \URL{http://www.nongnu.org/libunwind/}.
+\LatexManEnd
+
+\end{document}
diff --git a/libunwind/doc/libunwind-ptrace.man b/libunwind/doc/libunwind-ptrace.man
new file mode 100644
index 0000000..985fcae
--- /dev/null
+++ b/libunwind/doc/libunwind-ptrace.man
@@ -0,0 +1,220 @@
+'\" t
+.\" Manual page created with latex2man on Thu Aug 16 09:44:44 MDT 2007
+.\" NOTE: This file is generated, DO NOT EDIT.
+.de Vb
+.ft CW
+.nf
+..
+.de Ve
+.ft R
+
+.fi
+..
+.TH "LIBUNWIND\-PTRACE" "3" "16 August 2007" "Programming Library " "Programming Library "
+.SH NAME
+libunwind\-ptrace
+\-\- ptrace() support in libunwind 
+.PP
+.SH SYNOPSIS
+
+.PP
+#include <libunwind\-ptrace.h>
+.br
+.PP
+unw_accessors_t
+_UPT_accessors;
+.br
+.PP
+void *_UPT_create(pid_t);
+.br
+void
+_UPT_destroy(void *);
+.br
+.PP
+int
+_UPT_find_proc_info(unw_addr_space_t,
+unw_word_t,
+unw_proc_info_t *,
+int,
+void *);
+.br
+void
+_UPT_put_unwind_info(unw_addr_space_t,
+unw_proc_info_t *,
+void *);
+.br
+int
+_UPT_get_dyn_info_list_addr(unw_addr_space_t,
+unw_word_t *,
+void *);
+.br
+int
+_UPT_access_mem(unw_addr_space_t,
+unw_word_t,
+unw_word_t *,
+int,
+void *);
+.br
+int
+_UPT_access_reg(unw_addr_space_t,
+unw_regnum_t,
+unw_word_t *,
+int,
+void *);
+.br
+int
+_UPT_access_fpreg(unw_addr_space_t,
+unw_regnum_t,
+unw_fpreg_t *,
+int,
+void *);
+.br
+int
+_UPT_get_proc_name(unw_addr_space_t,
+unw_word_t,
+char *,
+size_t,
+unw_word_t *,
+void *);
+.br
+int
+_UPT_resume(unw_addr_space_t,
+unw_cursor_t *,
+void *);
+.br
+.PP
+.SH DESCRIPTION
+
+.PP
+The ptrace(2)
+system\-call makes it possible for a process to 
+gain access to the machine\-state and virtual memory of \fIanother\fP
+process. With the right set of call\-back routines, it is therefore 
+possible to hook up libunwind
+to another process via 
+ptrace(2).
+While it\&'s not very difficult to do so directly, 
+libunwind
+further facilitates this task by providing 
+ready\-to\-use callbacks for this purpose. The routines and variables 
+implementing this facility use a name\-prefix of _UPT,
+which is 
+stands for ``unwind\-via\-ptrace\&''\&. 
+.PP
+An application that wants to use the _UPT\-facility
+first needs 
+to create a new libunwind
+address\-space that represents the 
+target process. This is done by calling 
+unw_create_addr_space().
+In many cases, the application 
+will simply want to pass the address of _UPT_accessors
+as the 
+first argument to this routine. Doing so will ensure that 
+libunwind
+will be able to properly unwind the target process. 
+However, in special circumstances, an application may prefer to use 
+only portions of the _UPT\-facility.
+For this reason, the 
+individual callback routines (_UPT_find_proc_info(),
+_UPT_put_unwind_info(),
+etc.) are also available for direct 
+use. Of course, the addresses of these routines could also be picked 
+up from _UPT_accessors,
+but doing so would prevent static 
+initialization. Also, when using _UPT_accessors,
+\fIall\fP
+the callback routines will be linked into the application, even if 
+they are never actually called. 
+.PP
+Next, the application can turn on ptrace\-mode on the target process, 
+either by forking a new process, invoking PTRACE_TRACEME,
+and 
+then starting the target program (via execve(2)),
+or by 
+directly attaching to an already running process (via 
+PTRACE_ATTACH).
+Either way, once the process\-ID (pid) of the 
+target process is known, a _UPT\-info\-structure
+can be created 
+by calling _UPT_create(),
+passing the pid of the target process 
+as the only argument. The returned void\-pointer then needs to be 
+passed as the ``argument\&'' pointer (third argument) to 
+unw_init_remote().
+.PP
+The _UPT_resume()
+routine can be used to resume execution of 
+the target process. It simply invokes ptrace(2)
+with a command 
+value of PTRACE_CONT\&.
+.PP
+When the application is done using libunwind
+on the target 
+process, _UPT_destroy()
+needs to be called, passing it the 
+void\-pointer that was returned by the corresponding call to 
+_UPT_create().
+This ensures that all memory and other 
+resources are freed up. 
+.PP
+.SH AVAILABILITY
+
+.PP
+Since ptrace(2)
+works within a single machine only, the 
+_UPT\-facility
+by definition is not available in 
+libunwind\-versions
+configured for cross\-unwinding. 
+.PP
+.SH THREAD SAFETY
+
+.PP
+The _UPT\-facility
+assumes that a single _UPT\-info
+structure is never shared between threads. Because of this, no 
+explicit locking is used. As long as only one thread uses 
+a _UPT\-info
+structure at any given time, this facility 
+is thread\-safe. 
+.PP
+.SH RETURN VALUE
+
+.PP
+_UPT_create()
+may return a NULL
+pointer if it fails 
+to create the _UPT\-info\-structure
+for any reason. For the 
+current implementation, the only reason this call may fail is when the 
+system is out of memory. 
+.PP
+.SH FILES
+
+.PP
+.TP
+libunwind\-ptrace.h
+ Headerfile to include when using the 
+interface defined by this library. 
+.TP
+\fB\-l\fPunwind\-ptrace \fB\-l\fPunwind\-generic
+ Linker\-switches to add when building a program that uses the 
+functions defined by this library. 
+.PP
+.SH SEE ALSO
+
+.PP
+execve(2), 
+libunwind(3),
+ptrace(2) 
+.PP
+.SH AUTHOR
+
+.PP
+David Mosberger\-Tang
+.br
+Email: \fBdmosberger@gmail.com\fP
+.br
+WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
+.\" NOTE: This file is generated, DO NOT EDIT.
diff --git a/libunwind/doc/libunwind-ptrace.tex b/libunwind/doc/libunwind-ptrace.tex
new file mode 100644
index 0000000..fe074d8
--- /dev/null
+++ b/libunwind/doc/libunwind-ptrace.tex
@@ -0,0 +1,134 @@
+\documentclass{article}
+\usepackage[fancyhdr,pdf]{latex2man}
+
+\input{common.tex}
+
+\begin{document}
+
+\begin{Name}{3}{libunwind-ptrace}{David Mosberger-Tang}{Programming Library}{ptrace() support in libunwind}libunwind-ptrace -- ptrace() support in libunwind
+\end{Name}
+
+\section{Synopsis}
+
+\File{\#include $<$libunwind-ptrace.h$>$}\\
+
+\noindent
+\Type{unw\_accessors\_t} \Var{\_UPT\_accessors};\\
+
+\Type{void~*}\Func{\_UPT\_create}(\Type{pid\_t});\\
+\noindent
+\Type{void} \Func{\_UPT\_destroy}(\Type{void~*});\\
+
+\noindent
+\Type{int} \Func{\_UPT\_find\_proc\_info}(\Type{unw\_addr\_space\_t}, \Type{unw\_word\_t}, \Type{unw\_proc\_info\_t~*}, \Type{int}, \Type{void~*});\\
+\noindent
+\Type{void} \Func{\_UPT\_put\_unwind\_info}(\Type{unw\_addr\_space\_t}, \Type{unw\_proc\_info\_t~*}, \Type{void~*});\\
+\noindent
+\Type{int} \Func{\_UPT\_get\_dyn\_info\_list\_addr}(\Type{unw\_addr\_space\_t}, \Type{unw\_word\_t~*}, \Type{void~*});\\
+\noindent
+\Type{int} \Func{\_UPT\_access\_mem}(\Type{unw\_addr\_space\_t}, \Type{unw\_word\_t}, \Type{unw\_word\_t~*}, \Type{int}, \Type{void~*});\\
+\noindent
+\Type{int} \Func{\_UPT\_access\_reg}(\Type{unw\_addr\_space\_t}, \Type{unw\_regnum\_t}, \Type{unw\_word\_t~*}, \Type{int}, \Type{void~*});\\
+\noindent
+\Type{int} \Func{\_UPT\_access\_fpreg}(\Type{unw\_addr\_space\_t}, \Type{unw\_regnum\_t}, \Type{unw\_fpreg\_t~*}, \Type{int}, \Type{void~*});\\
+\noindent
+\Type{int} \Func{\_UPT\_get\_proc\_name}(\Type{unw\_addr\_space\_t}, \Type{unw\_word\_t}, \Type{char~*}, \Type{size\_t}, \Type{unw\_word\_t~*}, \Type{void~*});\\
+\noindent
+\Type{int} \Func{\_UPT\_resume}(\Type{unw\_addr\_space\_t}, \Type{unw\_cursor\_t~*}, \Type{void~*});\\
+
+\section{Description}
+
+The \Func{ptrace}(2) system-call makes it possible for a process to
+gain access to the machine-state and virtual memory of \emph{another}
+process.  With the right set of call-back routines, it is therefore
+possible to hook up \Prog{libunwind} to another process via
+\Func{ptrace}(2).  While it's not very difficult to do so directly,
+\Prog{libunwind} further facilitates this task by providing
+ready-to-use callbacks for this purpose.  The routines and variables
+implementing this facility use a name-prefix of \Func{\_UPT}, which is
+stands for ``unwind-via-ptrace''.
+
+An application that wants to use the \Func{\_UPT}-facility first needs
+to create a new \Prog{libunwind} address-space that represents the
+target process.  This is done by calling
+\Func{unw\_create\_addr\_space}().  In many cases, the application
+will simply want to pass the address of \Var{\_UPT\_accessors} as the
+first argument to this routine.  Doing so will ensure that
+\Prog{libunwind} will be able to properly unwind the target process.
+However, in special circumstances, an application may prefer to use
+only portions of the \Prog{\_UPT}-facility.  For this reason, the
+individual callback routines (\Func{\_UPT\_find\_proc\_info}(),
+\Func{\_UPT\_put\_unwind\_info}(), etc.)  are also available for direct
+use.  Of course, the addresses of these routines could also be picked
+up from \Var{\_UPT\_accessors}, but doing so would prevent static
+initialization.  Also, when using \Var{\_UPT\_accessors}, \emph{all}
+the callback routines will be linked into the application, even if
+they are never actually called.
+
+Next, the application can turn on ptrace-mode on the target process,
+either by forking a new process, invoking \Const{PTRACE\_TRACEME}, and
+then starting the target program (via \Func{execve}(2)), or by
+directly attaching to an already running process (via
+\Const{PTRACE\_ATTACH}).  Either way, once the process-ID (pid) of the
+target process is known, a \Prog{\_UPT}-info-structure can be created
+by calling \Func{\_UPT\_create}(), passing the pid of the target process
+as the only argument.  The returned void-pointer then needs to be
+passed as the ``argument'' pointer (third argument) to
+\Func{unw\_init\_remote}().
+
+The \Func{\_UPT\_resume}() routine can be used to resume execution of
+the target process.  It simply invokes \Func{ptrace}(2) with a command
+value of \Const{PTRACE\_CONT}.
+
+When the application is done using \Prog{libunwind} on the target
+process, \Func{\_UPT\_destroy}() needs to be called, passing it the
+void-pointer that was returned by the corresponding call to
+\Func{\_UPT\_create}().  This ensures that all memory and other
+resources are freed up.
+
+\section{Availability}
+
+Since \Func{ptrace}(2) works within a single machine only, the
+\Prog{\_UPT}-facility by definition is not available in
+\Prog{libunwind}-versions configured for cross-unwinding.
+
+\section{Thread Safety}
+
+The \Prog{\_UPT}-facility assumes that a single \Prog{\_UPT}-info
+structure is never shared between threads.  Because of this, no
+explicit locking is used.  As long as only one thread uses
+a \Prog{\_UPT}-info structure at any given time, this facility
+is thread-safe.
+
+\section{Return Value}
+
+\Func{\_UPT\_create}() may return a \Const{NULL} pointer if it fails
+to create the \Prog{\_UPT}-info-structure for any reason.  For the
+current implementation, the only reason this call may fail is when the
+system is out of memory.
+
+\section{Files}
+
+\begin{Description}
+\item[\File{libunwind-ptrace.h}] Headerfile to include when using the
+  interface defined by this library.
+\item[\Opt{-l}\File{unwind-ptrace} \Opt{-l}\File{unwind-generic}]
+    Linker-switches to add when building a program that uses the
+    functions defined by this library.
+\end{Description}
+
+\section{See Also}
+
+execve(2),
+\SeeAlso{libunwind(3)},
+ptrace(2)
+
+\section{Author}
+
+\noindent
+David Mosberger-Tang\\
+Email: \Email{dmosberger@gmail.com}\\
+WWW: \URL{http://www.nongnu.org/libunwind/}.
+\LatexManEnd
+
+\end{document}
diff --git a/libunwind/doc/libunwind-setjmp.man b/libunwind/doc/libunwind-setjmp.man
new file mode 100644
index 0000000..1faa38e
--- /dev/null
+++ b/libunwind/doc/libunwind-setjmp.man
@@ -0,0 +1,132 @@
+'\" t
+.\" Manual page created with latex2man on Thu Aug 16 09:44:44 MDT 2007
+.\" NOTE: This file is generated, DO NOT EDIT.
+.de Vb
+.ft CW
+.nf
+..
+.de Ve
+.ft R
+
+.fi
+..
+.TH "LIBUNWIND\-SETJMP" "3" "16 August 2007" "Programming Library " "Programming Library "
+.SH NAME
+libunwind\-setjmp
+\-\- libunwind\-based non\-local gotos 
+.PP
+.SH SYNOPSIS
+
+.PP
+#include <setjmp.h>
+.br
+.PP
+int
+setjmp(jmp_buf env);
+.br
+void
+longjmp(jmp_buf env,
+int val);
+.br
+int
+_setjmp(jmp_buf env);
+.br
+void
+_longjmp(jmp_buf env,
+int val);
+.br
+int
+sigsetjmp(sigjmp_buf env,
+int savemask);
+.br
+void
+siglongjmp(sigjmp_buf env,
+int val);
+.br
+.PP
+.SH DESCRIPTION
+
+.PP
+The unwind\-setjmp
+library offers a libunwind\-based
+implementation of non\-local gotos. This implementation is intended to 
+be a drop\-in replacement for the normal, system\-provided routines of 
+the same name. The main advantage of using the unwind\-setjmp
+library is that setting up a non\-local goto via one of the 
+setjmp()
+routines is very fast. Typically, just 2 or 3 words 
+need to be saved in the jump\-buffer (plus one call to 
+sigprocmask(2),
+in the case of sigsetjmp).
+On the 
+other hand, executing a non\-local goto by calling one of the 
+longjmp()
+routines tends to be much slower than with the 
+system\-provided routines. In fact, the time spent on a 
+longjmp()
+will be proportional to the number of call frames 
+that exist between the points where setjmp()
+and 
+longjmp()
+were called. For this reason, the 
+unwind\-setjmp
+library is beneficial primarily in applications 
+that frequently call setjmp()
+but only rarely call 
+longjmp().
+.PP
+.SH CAVEATS
+
+.PP
+.TP
+.B *
+The correct operation of this library depends on the presence of 
+correct unwind information. On newer platforms, this is rarely an 
+issue. On older platforms, care needs to be taken to 
+ensure that each of the functions whose stack frames may have to be 
+unwound during a longjmp()
+have correct unwind information 
+(on those platforms, there is usually a compiler\-switch, such as 
+\fB\-funwind\-tables\fP,
+to request the generation of unwind 
+information). 
+.TP
+.B *
+The contents of jmp_buf and sigjmp_buf as setup
+and used by these routines is completely different from the ones 
+used by the system\-provided routines. Thus, a jump\-buffer created 
+by the libunwind\-based setjmp()/_setjmp
+may only be 
+used in a call to the libunwind\-based 
+longjmp()/_longjmp().
+The analogous applies for 
+sigjmp_buf
+with sigsetjmp()
+and siglongjmp().
+.PP
+.SH FILES
+
+.PP
+.TP
+\fB\-l\fPunwind\-setjmp
+ The library an application should 
+be linked against to ensure it uses the libunwind\-based non\-local 
+goto routines. 
+.PP
+.SH SEE ALSO
+
+.PP
+libunwind(3),
+setjmp(3), longjmp(3), 
+_setjmp(3), _longjmp(3), 
+sigsetjmp(3), siglongjmp(3) 
+.PP
+.SH AUTHOR
+
+.PP
+David Mosberger\-Tang
+.br
+Email: \fBdmosberger@gmail.com\fP
+.br
+WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
+.\" NOTE: This file is generated, DO NOT EDIT.
diff --git a/libunwind/doc/libunwind-setjmp.tex b/libunwind/doc/libunwind-setjmp.tex
new file mode 100644
index 0000000..17ce073
--- /dev/null
+++ b/libunwind/doc/libunwind-setjmp.tex
@@ -0,0 +1,87 @@
+\documentclass{article}
+\usepackage[fancyhdr,pdf]{latex2man}
+
+\input{common.tex}
+
+\begin{document}
+
+\begin{Name}{3}{libunwind-setjmp}{David Mosberger-Tang}{Programming Library}{libunwind-based non-local gotos}libunwind-setjmp -- libunwind-based non-local gotos
+\end{Name}
+
+\section{Synopsis}
+
+\File{\#include $<$setjmp.h$>$}\\
+
+\noindent
+\Type{int} \Func{setjmp}(\Type{jmp\_buf}~\Var{env});\\
+\Type{void} \Func{longjmp}(\Type{jmp\_buf}~\Var{env}, \Type{int}~\Var{val});\\
+\Type{int} \Func{\_setjmp}(\Type{jmp\_buf}~\Var{env});\\
+\Type{void} \Func{\_longjmp}(\Type{jmp\_buf}~\Var{env}, \Type{int}~\Var{val});\\
+\Type{int} \Func{sigsetjmp}(\Type{sigjmp\_buf}~\Var{env}, \Type{int}~\Var{savemask});\\
+\Type{void} \Func{siglongjmp}(\Type{sigjmp\_buf}~\Var{env}, \Type{int}~\Var{val});\\
+
+\section{Description}
+
+The \Prog{unwind-setjmp} library offers a \Prog{libunwind}-based
+implementation of non-local gotos.  This implementation is intended to
+be a drop-in replacement for the normal, system-provided routines of
+the same name.  The main advantage of using the \Prog{unwind-setjmp}
+library is that setting up a non-local goto via one of the
+\Func{setjmp}() routines is very fast.  Typically, just 2 or 3 words
+need to be saved in the jump-buffer (plus one call to
+\Func{sigprocmask}(2), in the case of \Func{sigsetjmp}).  On the
+other hand, executing a non-local goto by calling one of the
+\Func{longjmp}() routines tends to be much slower than with the
+system-provided routines.  In fact, the time spent on a
+\Func{longjmp}() will be proportional to the number of call frames
+that exist between the points where \Func{setjmp}() and
+\Func{longjmp}() were called.  For this reason, the
+\Prog{unwind-setjmp} library is beneficial primarily in applications
+that frequently call \Func{setjmp}() but only rarely call
+\Func{longjmp}().
+
+\section{Caveats}
+
+\begin{itemize}
+\item The correct operation of this library depends on the presence of
+  correct unwind information.  On newer platforms, this is rarely an
+  issue.  On older platforms, care needs to be taken to
+  ensure that each of the functions whose stack frames may have to be
+  unwound during a \Func{longjmp}() have correct unwind information
+  (on those platforms, there is usually a compiler-switch, such as
+  \Opt{-funwind-tables}, to request the generation of unwind
+  information).
+\item The contents of \Type{jmp\_buf} and \Type{sigjmp\_buf} as setup
+  and used by these routines is completely different from the ones
+  used by the system-provided routines.  Thus, a jump-buffer created
+  by the libunwind-based \Func{setjmp}()/\Func{\_setjmp} may only be
+  used in a call to the libunwind-based
+  \Func{longjmp}()/\Func{\_longjmp}().  The analogous applies for
+  \Type{sigjmp\_buf} with \Func{sigsetjmp}() and \Func{siglongjmp}().
+\end{itemize}
+
+\section{Files}
+
+\begin{Description}
+\item[\Opt{-l}\File{unwind-setjmp}] The library an application should
+  be linked against to ensure it uses the libunwind-based non-local
+  goto routines.
+\end{Description}
+
+
+\section{See Also}
+
+\SeeAlso{libunwind(3)},
+setjmp(3), longjmp(3),
+\_setjmp(3), \_longjmp(3),
+sigsetjmp(3), siglongjmp(3)
+
+\section{Author}
+
+\noindent
+David Mosberger-Tang\\
+Email: \Email{dmosberger@gmail.com}\\
+WWW: \URL{http://www.nongnu.org/libunwind/}.
+\LatexManEnd
+
+\end{document}
diff --git a/libunwind/doc/libunwind.man b/libunwind/doc/libunwind.man
new file mode 100644
index 0000000..c6046e2
--- /dev/null
+++ b/libunwind/doc/libunwind.man
@@ -0,0 +1,500 @@
+'\" t
+.\" Manual page created with latex2man on Thu Aug 16 09:44:43 MDT 2007
+.\" NOTE: This file is generated, DO NOT EDIT.
+.de Vb
+.ft CW
+.nf
+..
+.de Ve
+.ft R
+
+.fi
+..
+.TH "LIBUNWIND" "3" "16 August 2007" "Programming Library " "Programming Library "
+.SH NAME
+libunwind
+\-\- a (mostly) platform\-independent unwind API 
+.PP
+.SH SYNOPSIS
+
+.PP
+#include <libunwind.h>
+.br
+.PP
+int
+unw_getcontext(unw_context_t *);
+.br
+int
+unw_init_local(unw_cursor_t *,
+unw_context_t *);
+.br
+int
+unw_init_remote(unw_cursor_t *,
+unw_addr_space_t,
+void *);
+.br
+int
+unw_step(unw_cursor_t *);
+.br
+int
+unw_get_reg(unw_cursor_t *,
+unw_regnum_t,
+unw_word_t *);
+.br
+int
+unw_get_fpreg(unw_cursor_t *,
+unw_regnum_t,
+unw_fpreg_t *);
+.br
+int
+unw_set_reg(unw_cursor_t *,
+unw_regnum_t,
+unw_word_t);
+.br
+int
+unw_set_fpreg(unw_cursor_t *,
+unw_regnum_t,
+unw_fpreg_t);
+.br
+int
+unw_resume(unw_cursor_t *);
+.br
+.PP
+unw_addr_space_t
+unw_local_addr_space;
+.br
+unw_addr_space_t
+unw_create_addr_space(unw_accessors_t,
+int);
+.br
+void
+unw_destroy_addr_space(unw_addr_space_t);
+.br
+unw_accessors_t
+unw_get_accessors(unw_addr_space_t);
+.br
+void
+unw_flush_cache(unw_addr_space_t,
+unw_word_t,
+unw_word_t);
+.br
+int
+unw_set_caching_policy(unw_addr_space_t,
+unw_caching_policy_t);
+.br
+.PP
+const char *unw_regname(unw_regnum_t);
+.br
+int
+unw_get_proc_info(unw_cursor_t *,
+unw_proc_info_t *);
+.br
+int
+unw_get_save_loc(unw_cursor_t *,
+int,
+unw_save_loc_t *);
+.br
+int
+unw_is_fpreg(unw_regnum_t);
+.br
+int
+unw_is_signal_frame(unw_cursor_t *);
+.br
+int
+unw_get_proc_name(unw_cursor_t *,
+char *,
+size_t,
+unw_word_t *);
+.br
+.PP
+void
+_U_dyn_register(unw_dyn_info_t *);
+.br
+void
+_U_dyn_cancel(unw_dyn_info_t *);
+.br
+.PP
+.SH LOCAL UNWINDING
+
+.PP
+Libunwind
+is very easy to use when unwinding a stack from 
+within a running program. This is called \fIlocal\fP
+unwinding. Say 
+you want to unwind the stack while executing in some function 
+F().
+In this function, you would call unw_getcontext()
+to get a snapshot of the CPU registers (machine\-state). Then you 
+initialize an \fIunwind cursor\fP
+based on this snapshot. This is 
+done with a call to unw_init_local().
+The cursor now points 
+to the current frame, that is, the stack frame that corresponds to the 
+current activation of function F().
+The unwind cursor can then 
+be moved ``up\&'' (towards earlier stack frames) by calling 
+unw_step().
+By repeatedly calling this routine, you can 
+uncover the entire call\-chain that led to the activation of function 
+F().
+A positive return value from unw_step()
+indicates 
+that there are more frames in the chain, zero indicates that the end 
+of the chain has been reached, and any negative value indicates that 
+some sort of error has occurred. 
+.PP
+While it is not possible to directly move the unwind cursor in the 
+``down\&'' direction (towards newer stack frames), this effect can be 
+achieved by making copies of an unwind cursor. For example, a program 
+that sometimes has to move ``down\&'' by one stack frame could maintain 
+two cursor variables: ``curr\&''
+and ``prev\&''\&.
+The former 
+would be used as the current cursor and prev
+would be maintained 
+as the ``previous frame\&'' cursor by copying the contents of curr
+to prev
+right before calling unw_step().
+With this 
+approach, the program could move one step ``down\&'' simply by copying 
+back prev
+to curr
+whenever that is necessary. In the most 
+extreme case, a program could maintain a separate cursor for each call 
+frame and that way it could move up and down the callframe\-chain at 
+will. 
+.PP
+Given an unwind cursor, it is possible to read and write the CPU 
+registers that were preserved for the current stack frame (as 
+identified by the cursor). Libunwind
+provides several routines 
+for this purpose: unw_get_reg()
+reads an integer (general) 
+register, unw_get_fpreg()
+reads a floating\-point register, 
+unw_set_reg()
+writes an integer register, and 
+unw_set_fpreg()
+writes a floating\-point register. Note that, 
+by definition, only the \fIpreserved\fP
+machine state can be accessed 
+during an unwind operation. Normally, this state consists of the 
+\fIcallee\-saved\fP
+(``preserved\&'') registers. However, in some 
+special circumstances (e.g., in a signal handler trampoline), even the 
+\fIcaller\-saved\fP
+(``scratch\&'') registers are preserved in the stack 
+frame and, in those cases, libunwind
+will grant access to them 
+as well. The exact set of registers that can be accessed via the 
+cursor depends, of course, on the platform. However, there are two 
+registers that can be read on all platforms: the instruction pointer 
+(IP), sometimes also known as the ``program counter\&'', and the stack 
+pointer (SP). In libunwind,
+these registers are identified by 
+the macros UNW_REG_IP
+and UNW_REG_SP,
+respectively. 
+.PP
+Besides just moving the unwind cursor and reading/writing saved 
+registers, libunwind
+also provides the ability to resume 
+execution at an arbitrary stack frame. As you might guess, this is 
+useful for implementing non\-local gotos and the exception handling 
+needed by some high\-level languages such as Java. Resuming execution 
+with a particular stack frame simply requires calling 
+unw_resume()
+and passing the cursor identifying the target 
+frame as the only argument. 
+.PP
+Normally, libunwind
+supports both local and remote unwinding 
+(the latter will be explained in the next section). However, if you 
+tell libunwind that your program only needs local unwinding, then a 
+special implementation can be selected which may run much faster than 
+the generic implementation which supports both kinds of unwinding. To 
+select this optimized version, simply define the macro 
+UNW_LOCAL_ONLY
+before including the headerfile 
+<libunwind.h>\&.
+It is perfectly OK for a single program to 
+employ both local\-only and generic unwinding. That is, whether or not 
+UNW_LOCAL_ONLY
+is defined is a choice that each source\-file 
+(compilation\-unit) can make on its own. Independent of the setting(s) 
+of UNW_LOCAL_ONLY,
+you\&'ll always link the same library into 
+the program (normally \fB\-l\fPunwind).
+Furthermore, the 
+portion of libunwind
+that manages unwind\-info for dynamically 
+generated code is not affected by the setting of 
+UNW_LOCAL_ONLY\&.
+.PP
+If we put all of the above together, here is how we could use 
+libunwind
+to write a function ``show_backtrace()\&''
+which prints a classic stack trace: 
+.PP
+.Vb
+#define UNW_LOCAL_ONLY
+#include <libunwind.h>
+
+void show_backtrace (void) {
+  unw_cursor_t cursor; unw_context_t uc;
+  unw_word_t ip, sp;
+
+  unw_getcontext(&uc);
+  unw_init_local(&cursor, &uc);
+  while (unw_step(&cursor) > 0) {
+    unw_get_reg(&cursor, UNW_REG_IP, &ip);
+    unw_get_reg(&cursor, UNW_REG_SP, &sp);
+    printf ("ip = %lx, sp = %lx\\n", (long) ip, (long) sp);
+  }
+}
+.Ve
+.PP
+.SH REMOTE UNWINDING
+
+.PP
+Libunwind
+can also be used to unwind a stack in a ``remote\&'' 
+process. Here, ``remote\&'' may mean another process on the same 
+machine or even a process on a completely different machine from the 
+one that is running libunwind\&.
+Remote unwinding is typically 
+used by debuggers and instruction\-set simulators, for example. 
+.PP
+Before you can unwind a remote process, you need to create a new 
+address\-space object for that process. This is achieved with the 
+unw_create_addr_space()
+routine. The routine takes two 
+arguments: a pointer to a set of \fIaccessor\fP
+routines and an 
+integer that specifies the byte\-order of the target process. The 
+accessor routines provide libunwind
+with the means to 
+communicate with the remote process. In particular, there are 
+callbacks to read and write the process\&'s memory, its registers, and 
+to access unwind information which may be needed by libunwind\&.
+.PP
+With the address space created, unwinding can be initiated by a call 
+to unw_init_remote().
+This routine is very similar to 
+unw_init_local(),
+except that it takes an address\-space 
+object and an opaque pointer as arguments. The routine uses these 
+arguments to fetch the initial machine state. Libunwind
+never 
+uses the opaque pointer on its own, but instead just passes it on to 
+the accessor (callback) routines. Typically, this pointer is used to 
+select, e.g., the thread within a process that is to be unwound. 
+.PP
+Once a cursor has been initialized with unw_init_remote(),
+unwinding works exactly like in the local case. That is, you can use 
+unw_step()
+to move ``up\&'' in the call\-chain, read and write 
+registers, or resume execution at a particular stack frame by calling 
+unw_resume\&.
+.PP
+.SH CROSS\-PLATFORM AND MULTI\-PLATFORM UNWINDING
+
+.PP
+Libunwind
+has been designed to enable unwinding across 
+platforms (architectures). Indeed, a single program can use 
+libunwind
+to unwind an arbitrary number of target platforms, 
+all at the same time! 
+.PP
+We call the machine that is running libunwind
+the \fIhost\fP
+and the machine that is running the process being unwound the 
+\fItarget\fP\&.
+If the host and the target platform are the same, we 
+call it \fInative\fP
+unwinding. If they differ, we call it 
+\fIcross\-platform\fP
+unwinding. 
+.PP
+The principle behind supporting native, cross\-platform, and 
+multi\-platform unwinding is very simple: for native unwinding, a 
+program includes <libunwind.h>
+and uses the linker switch 
+\fB\-l\fPunwind\&.
+For cross\-platform unwinding, a program 
+includes <libunwind\-PLAT\&.h>
+and uses the linker 
+switch \fB\-l\fPunwind\-PLAT,
+where PLAT
+is the name 
+of the target platform (e.g., ia64
+for IA\-64, hppa\-elf
+for ELF\-based HP PA\-RISC, or x86
+for 80386). Multi\-platform 
+unwinding works exactly like cross\-platform unwinding, the only 
+limitation is that a single source file (compilation unit) can include 
+at most one libunwind
+header file. In other words, the 
+platform\-specific support for each supported target needs to be 
+isolated in separate source files\-\-\-a limitation that shouldn\&'t be an 
+issue in practice. 
+.PP
+Note that, by definition, local unwinding is possible only for the 
+native case. Attempting to call, e.g., unw_local_init()
+when 
+targeting a cross\-platform will result in a link\-time error 
+(unresolved references). 
+.PP
+.SH THREAD\- AND SIGNAL\-SAFETY
+
+.PP
+All libunwind
+routines are thread\-safe. What this means is 
+that multiple threads may use libunwind
+simulatenously. 
+However, any given cursor may be accessed by only one thread at 
+any given time. 
+.PP
+To ensure thread\-safety, some libunwind
+routines may have to 
+use locking. Such routines \fImust not\fP
+be called from signal 
+handlers (directly or indirectly) and are therefore \fInot\fP
+signal\-safe. The manual page for each libunwind
+routine 
+identifies whether or not it is signal\-safe, but as a general rule, 
+any routine that may be needed for \fIlocal\fP
+unwinding is 
+signal\-safe (e.g., unw_step()
+for local unwinding is 
+signal\-safe). For remote\-unwinding, \fInone\fP
+of the 
+libunwind
+routines are guaranteed to be signal\-safe. 
+.PP
+.SH UNWINDING THROUGH DYNAMICALLY GENERATED CODE
+
+.PP
+Libunwind
+provides the routines _U_dyn_register()
+and 
+_U_dyn_cancel()
+to register/cancel the information required to 
+unwind through code that has been generated at runtime (e.g., by a 
+just\-in\-time (JIT) compiler). It is important to register the 
+information for \fIall\fP
+dynamically generated code because 
+otherwise, a debugger may not be able to function properly or 
+high\-level language exception handling may not work as expected. 
+.PP
+The interface for registering and canceling dynamic unwind info has 
+been designed for maximum efficiency, so as to minimize the 
+performance impact on JIT\-compilers. In particular, both routines are 
+guaranteed to execute in ``constant time\&'' (O(1)) and the 
+data\-structure encapsulating the dynamic unwind info has been designed 
+to facilitate sharing, such that similar procedures can share much of 
+the underlying information. 
+.PP
+For more information on the libunwind
+support for dynamically 
+generated code, see libunwind\-dynamic(3)\&.
+.PP
+.SH CACHING OF UNWIND INFO
+
+.PP
+To speed up execution, libunwind
+may aggressively cache the 
+information it needs to perform unwinding. If a process changes 
+during its lifetime, this creates a risk of libunwind
+using 
+stale data. For example, this would happen if libunwind
+were 
+to cache information about a shared library which later on gets 
+unloaded (e.g., via \fIdlclose\fP(3)).
+.PP
+To prevent the risk of using stale data, libunwind
+provides two 
+facilities: first, it is possible to flush the cached information 
+associated with a specific address range in the target process (or the 
+entire address space, if desired). This functionality is provided by 
+unw_flush_cache().
+The second facility is provided by 
+unw_set_caching_policy(),
+which lets a program 
+select the exact caching policy in use for a given address\-space 
+object. In particular, by selecting the policy 
+UNW_CACHE_NONE,
+it is possible to turn off caching 
+completely, therefore eliminating the risk of stale data alltogether 
+(at the cost of slower execution). By default, caching is enabled for 
+local unwinding only. 
+.PP
+.SH FILES
+
+.PP
+.TP
+libunwind.h
+ Headerfile to include for native (same 
+platform) unwinding. 
+.TP
+libunwind\-PLAT\&.h
+ Headerfile to include when 
+the unwind target runs on platform PLAT\&.
+For example, to unwind 
+an IA\-64 program, the header file libunwind\-ia64.h
+should be 
+included. 
+.TP
+\fB\-l\fPunwind
+ Linker\-switch to add when building a 
+program that does native (same platform) unwinding. 
+.TP
+\fB\-l\fPunwind\-PLAT
+ Linker\-switch to add when 
+building a program that unwinds a program on platform PLAT\&.
+For example, to (cross\-)unwind an IA\-64 program, the linker switch 
+\-lunwind\-ia64
+should be added. Note: multiple such switches 
+may need to be specified for programs that can unwind programs on 
+multiple platforms. 
+.PP
+.SH SEE ALSO
+
+.PP
+libunwind\-dynamic(3),
+libunwind\-ia64(3),
+libunwind\-ptrace(3),
+libunwind\-setjmp(3),
+unw_create_addr_space(3),
+unw_destroy_addr_space(3),
+unw_flush_cache(3),
+unw_get_accessors(3),
+unw_get_fpreg(3),
+unw_get_proc_info(3),
+unw_get_proc_name(3),
+unw_get_reg(3),
+unw_getcontext(3),
+unw_init_local(3),
+unw_init_remote(3),
+unw_is_fpreg(3),
+unw_is_signal_frame(3),
+unw_regname(3),
+unw_resume(3),
+unw_set_caching_policy(3),
+unw_set_fpreg(3),
+unw_set_reg(3),
+unw_step(3),
+unw_strerror(3),
+_U_dyn_register(3),
+_U_dyn_cancel(3)
+.PP
+.SH AUTHOR
+
+.PP
+David Mosberger\-Tang
+.br
+Email: \fBdmosberger@gmail.com\fP
+.br
+WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
+.\" NOTE: This file is generated, DO NOT EDIT.
diff --git a/libunwind/doc/libunwind.tex b/libunwind/doc/libunwind.tex
new file mode 100644
index 0000000..534bd4d
--- /dev/null
+++ b/libunwind/doc/libunwind.tex
@@ -0,0 +1,355 @@
+\documentclass{article}
+\usepackage[fancyhdr,pdf]{latex2man}
+
+\input{common.tex}
+
+\begin{document}
+
+\begin{Name}{3}{libunwind}{David Mosberger-Tang}{Programming Library}{Introduction to libunwind}libunwind -- a (mostly) platform-independent unwind API
+\end{Name}
+
+\section{Synopsis}
+
+\File{\#include $<$libunwind.h$>$}\\
+
+\noindent
+\Type{int} \Func{unw\_getcontext}(\Type{unw\_context\_t~*});\\
+\noindent
+\Type{int} \Func{unw\_init\_local}(\Type{unw\_cursor\_t~*}, \Type{unw\_context\_t~*});\\
+\noindent
+\Type{int} \Func{unw\_init\_remote}(\Type{unw\_cursor\_t~*}, \Type{unw\_addr\_space\_t}, \Type{void~*});\\
+\noindent
+\Type{int} \Func{unw\_step}(\Type{unw\_cursor\_t~*});\\
+\noindent
+\Type{int} \Func{unw\_get\_reg}(\Type{unw\_cursor\_t~*}, \Type{unw\_regnum\_t}, \Type{unw\_word\_t~*});\\
+\noindent
+\Type{int} \Func{unw\_get\_fpreg}(\Type{unw\_cursor\_t~*}, \Type{unw\_regnum\_t}, \Type{unw\_fpreg\_t~*});\\
+\noindent
+\Type{int} \Func{unw\_set\_reg}(\Type{unw\_cursor\_t~*}, \Type{unw\_regnum\_t}, \Type{unw\_word\_t});\\
+\noindent
+\Type{int} \Func{unw\_set\_fpreg}(\Type{unw\_cursor\_t~*}, \Type{unw\_regnum\_t}, \Type{unw\_fpreg\_t});\\
+\noindent
+\Type{int} \Func{unw\_resume}(\Type{unw\_cursor\_t~*});\\
+
+\noindent
+\Type{unw\_addr\_space\_t} \Var{unw\_local\_addr\_space};\\
+\noindent
+\Type{unw\_addr\_space\_t} \Func{unw\_create\_addr\_space}(\Type{unw\_accessors\_t}, \Type{int});\\
+\noindent
+\Type{void} \Func{unw\_destroy\_addr\_space}(\Type{unw\_addr\_space\_t});\\
+\noindent
+\Type{unw\_accessors\_t} \Func{unw\_get\_accessors}(\Type{unw\_addr\_space\_t});\\
+\noindent
+\Type{void} \Func{unw\_flush\_cache}(\Type{unw\_addr\_space\_t}, \Type{unw\_word\_t}, \Type{unw\_word\_t});\\
+\noindent
+\Type{int} \Func{unw\_set\_caching\_policy}(\Type{unw\_addr\_space\_t}, \Type{unw\_caching\_policy\_t});\\
+
+\noindent
+\Type{const char *}\Func{unw\_regname}(\Type{unw\_regnum\_t});\\
+\noindent
+\Type{int} \Func{unw\_get\_proc\_info}(\Type{unw\_cursor\_t~*}, \Type{unw\_proc\_info\_t~*});\\
+\noindent
+\Type{int} \Func{unw\_get\_save\_loc}(\Type{unw\_cursor\_t~*}, \Type{int}, \Type{unw\_save\_loc\_t~*});\\
+\noindent
+\Type{int} \Func{unw\_is\_fpreg}(\Type{unw\_regnum\_t});\\
+\Type{int} \Func{unw\_is\_signal\_frame}(\Type{unw\_cursor\_t~*});\\
+\noindent
+\Type{int} \Func{unw\_get\_proc\_name}(\Type{unw\_cursor\_t~*}, \Type{char~*}, \Type{size\_t}, \Type{unw\_word\_t~*});\\
+
+\noindent
+\Type{void} \Func{\_U\_dyn\_register}(\Type{unw\_dyn\_info\_t~*});\\
+\noindent
+\Type{void} \Func{\_U\_dyn\_cancel}(\Type{unw\_dyn\_info\_t~*});\\
+
+\section{Local Unwinding}
+
+\Prog{Libunwind} is very easy to use when unwinding a stack from
+within a running program.  This is called \emph{local} unwinding.  Say
+you want to unwind the stack while executing in some function
+\Func{F}().  In this function, you would call \Func{unw\_getcontext}()
+to get a snapshot of the CPU registers (machine-state).  Then you
+initialize an \emph{unwind~cursor} based on this snapshot.  This is
+done with a call to \Func{unw\_init\_local}().  The cursor now points
+to the current frame, that is, the stack frame that corresponds to the
+current activation of function \Func{F}().  The unwind cursor can then
+be moved ``up'' (towards earlier stack frames) by calling
+\Func{unw\_step}().  By repeatedly calling this routine, you can
+uncover the entire call-chain that led to the activation of function
+\Func{F}().  A positive return value from \Func{unw\_step}() indicates
+that there are more frames in the chain, zero indicates that the end
+of the chain has been reached, and any negative value indicates that
+some sort of error has occurred.
+
+While it is not possible to directly move the unwind cursor in the
+``down'' direction (towards newer stack frames), this effect can be
+achieved by making copies of an unwind cursor.  For example, a program
+that sometimes has to move ``down'' by one stack frame could maintain
+two cursor variables: ``\Var{curr}'' and ``\Var{prev}''.  The former
+would be used as the current cursor and \Var{prev} would be maintained
+as the ``previous frame'' cursor by copying the contents of \Var{curr}
+to \Var{prev} right before calling \Func{unw\_step}().  With this
+approach, the program could move one step ``down'' simply by copying
+back \Var{prev} to \Var{curr} whenever that is necessary.  In the most
+extreme case, a program could maintain a separate cursor for each call
+frame and that way it could move up and down the callframe-chain at
+will.
+
+Given an unwind cursor, it is possible to read and write the CPU
+registers that were preserved for the current stack frame (as
+identified by the cursor).  \Prog{Libunwind} provides several routines
+for this purpose: \Func{unw\_get\_reg}() reads an integer (general)
+register, \Func{unw\_get\_fpreg}() reads a floating-point register,
+\Func{unw\_set\_reg}() writes an integer register, and
+\Func{unw\_set\_fpreg}() writes a floating-point register.  Note that,
+by definition, only the \emph{preserved} machine state can be accessed
+during an unwind operation.  Normally, this state consists of the
+\emph{callee-saved} (``preserved'') registers.  However, in some
+special circumstances (e.g., in a signal handler trampoline), even the
+\emph{caller-saved} (``scratch'') registers are preserved in the stack
+frame and, in those cases, \Prog{libunwind} will grant access to them
+as well.  The exact set of registers that can be accessed via the
+cursor depends, of course, on the platform.  However, there are two
+registers that can be read on all platforms: the instruction pointer
+(IP), sometimes also known as the ``program counter'', and the stack
+pointer (SP).  In \Prog{libunwind}, these registers are identified by
+the macros \Const{UNW\_REG\_IP} and \Const{UNW\_REG\_SP},
+respectively.
+
+Besides just moving the unwind cursor and reading/writing saved
+registers, \Prog{libunwind} also provides the ability to resume
+execution at an arbitrary stack frame.  As you might guess, this is
+useful for implementing non-local gotos and the exception handling
+needed by some high-level languages such as Java.  Resuming execution
+with a particular stack frame simply requires calling
+\Func{unw\_resume}() and passing the cursor identifying the target
+frame as the only argument.
+
+Normally, \Prog{libunwind} supports both local and remote unwinding
+(the latter will be explained in the next section).  However, if you
+tell libunwind that your program only needs local unwinding, then a
+special implementation can be selected which may run much faster than
+the generic implementation which supports both kinds of unwinding.  To
+select this optimized version, simply define the macro
+\Const{UNW\_LOCAL\_ONLY} before including the headerfile
+\File{$<$libunwind.h$>$}.  It is perfectly OK for a single program to
+employ both local-only and generic unwinding.  That is, whether or not
+\Const{UNW\_LOCAL\_ONLY} is defined is a choice that each source-file
+(compilation-unit) can make on its own.  Independent of the setting(s)
+of \Const{UNW\_LOCAL\_ONLY}, you'll always link the same library into
+the program (normally \Opt{-l}\File{unwind}).  Furthermore, the
+portion of \Prog{libunwind} that manages unwind-info for dynamically
+generated code is not affected by the setting of
+\Const{UNW\_LOCAL\_ONLY}.
+
+If we put all of the above together, here is how we could use
+\Prog{libunwind} to write a function ``\Func{show\_backtrace}()''
+which prints a classic stack trace:
+
+\begin{verbatim}
+#define UNW_LOCAL_ONLY
+#include <libunwind.h>
+
+void show_backtrace (void) {
+  unw_cursor_t cursor; unw_context_t uc;
+  unw_word_t ip, sp;
+
+  unw_getcontext(&uc);
+  unw_init_local(&cursor, &uc);
+  while (unw_step(&cursor) > 0) {
+    unw_get_reg(&cursor, UNW_REG_IP, &ip);
+    unw_get_reg(&cursor, UNW_REG_SP, &sp);
+    printf ("ip = %lx, sp = %lx\n", (long) ip, (long) sp);
+  }
+}
+\end{verbatim}
+
+
+\section{Remote Unwinding}
+
+\Prog{Libunwind} can also be used to unwind a stack in a ``remote''
+process.  Here, ``remote'' may mean another process on the same
+machine or even a process on a completely different machine from the
+one that is running \Prog{libunwind}.  Remote unwinding is typically
+used by debuggers and instruction-set simulators, for example.
+
+Before you can unwind a remote process, you need to create a new
+address-space object for that process.  This is achieved with the
+\Func{unw\_create\_addr\_space}() routine.  The routine takes two
+arguments: a pointer to a set of \emph{accessor} routines and an
+integer that specifies the byte-order of the target process.  The
+accessor routines provide \Func{libunwind} with the means to
+communicate with the remote process.  In particular, there are
+callbacks to read and write the process's memory, its registers, and
+to access unwind information which may be needed by \Func{libunwind}.
+
+With the address space created, unwinding can be initiated by a call
+to \Func{unw\_init\_remote}().  This routine is very similar to
+\Func{unw\_init\_local}(), except that it takes an address-space
+object and an opaque pointer as arguments.  The routine uses these
+arguments to fetch the initial machine state.  \Prog{Libunwind} never
+uses the opaque pointer on its own, but instead just passes it on to
+the accessor (callback) routines.  Typically, this pointer is used to
+select, e.g., the thread within a process that is to be unwound.
+
+Once a cursor has been initialized with \Func{unw\_init\_remote}(),
+unwinding works exactly like in the local case.  That is, you can use
+\Func{unw\_step}() to move ``up'' in the call-chain, read and write
+registers, or resume execution at a particular stack frame by calling
+\Func{unw\_resume}.
+
+
+\section{Cross-platform and Multi-platform Unwinding}
+
+\Prog{Libunwind} has been designed to enable unwinding across
+platforms (architectures).  Indeed, a single program can use
+\Prog{libunwind} to unwind an arbitrary number of target platforms,
+all at the same time!
+
+We call the machine that is running \Prog{libunwind} the \emph{host}
+and the machine that is running the process being unwound the
+\emph{target}.  If the host and the target platform are the same, we
+call it \emph{native} unwinding.  If they differ, we call it
+\emph{cross-platform} unwinding.
+
+The principle behind supporting native, cross-platform, and
+multi-platform unwinding is very simple: for native unwinding, a
+program includes \File{$<$libunwind.h$>$} and uses the linker switch
+\Opt{-l}\File{unwind}.  For cross-platform unwinding, a program
+includes \File{$<$libunwind-}\Var{PLAT}\File{.h$>$} and uses the linker
+switch \Opt{-l}\File{unwind-}\Var{PLAT}, where \Var{PLAT} is the name
+of the target platform (e.g., \File{ia64} for IA-64, \File{hppa-elf}
+for ELF-based HP PA-RISC, or \File{x86} for 80386).  Multi-platform
+unwinding works exactly like cross-platform unwinding, the only
+limitation is that a single source file (compilation unit) can include
+at most one \Prog{libunwind} header file.  In other words, the
+platform-specific support for each supported target needs to be
+isolated in separate source files---a limitation that shouldn't be an
+issue in practice.
+
+Note that, by definition, local unwinding is possible only for the
+native case.  Attempting to call, e.g., \Func{unw\_local\_init}() when
+targeting a cross-platform will result in a link-time error
+(unresolved references).
+
+
+\section{Thread- and Signal-Safety}
+
+
+All \Prog{libunwind} routines are thread-safe.  What this means is
+that multiple threads may use \Prog{libunwind} simulatenously.
+However, any given cursor may be accessed by only one thread at
+any given time.
+
+To ensure thread-safety, some \Prog{libunwind} routines may have to
+use locking.  Such routines \emph{must~not} be called from signal
+handlers (directly or indirectly) and are therefore \emph{not}
+signal-safe.  The manual page for each \Prog{libunwind} routine
+identifies whether or not it is signal-safe, but as a general rule,
+any routine that may be needed for \emph{local} unwinding is
+signal-safe (e.g., \Func{unw\_step}() for local unwinding is
+signal-safe).  For remote-unwinding, \emph{none} of the
+\Prog{libunwind} routines are guaranteed to be signal-safe.
+
+
+\section{Unwinding Through Dynamically Generated Code}
+
+\Func{Libunwind} provides the routines \Func{\_U\_dyn\_register}() and
+\Func{\_U\_dyn\_cancel}() to register/cancel the information required to
+unwind through code that has been generated at runtime (e.g., by a
+just-in-time (JIT) compiler).  It is important to register the
+information for \emph{all} dynamically generated code because
+otherwise, a debugger may not be able to function properly or
+high-level language exception handling may not work as expected.
+
+The interface for registering and canceling dynamic unwind info has
+been designed for maximum efficiency, so as to minimize the
+performance impact on JIT-compilers.  In particular, both routines are
+guaranteed to execute in ``constant time'' (O(1)) and the
+data-structure encapsulating the dynamic unwind info has been designed
+to facilitate sharing, such that similar procedures can share much of
+the underlying information.
+
+For more information on the \Prog{libunwind} support for dynamically
+generated code, see \SeeAlso{libunwind-dynamic(3)}.
+
+
+\section{Caching of Unwind Info}
+
+To speed up execution, \Prog{libunwind} may aggressively cache the
+information it needs to perform unwinding.  If a process changes
+during its lifetime, this creates a risk of \Prog{libunwind} using
+stale data.  For example, this would happen if \Prog{libunwind} were
+to cache information about a shared library which later on gets
+unloaded (e.g., via \Cmd{dlclose}{3}).
+
+To prevent the risk of using stale data, \Prog{libunwind} provides two
+facilities: first, it is possible to flush the cached information
+associated with a specific address range in the target process (or the
+entire address space, if desired).  This functionality is provided by
+\Func{unw\_flush\_cache}().  The second facility is provided by
+\Func{unw\_set\_caching\_policy}(), which lets a program
+select the exact caching policy in use for a given address-space
+object.  In particular, by selecting the policy
+\Const{UNW\_CACHE\_NONE}, it is possible to turn off caching
+completely, therefore eliminating the risk of stale data alltogether
+(at the cost of slower execution).  By default, caching is enabled for
+local unwinding only.
+
+
+\section{Files}
+
+\begin{Description}
+\item[\File{libunwind.h}] Headerfile to include for native (same
+  platform) unwinding.
+\item[\File{libunwind-}\Var{PLAT}\File{.h}] Headerfile to include when
+  the unwind target runs on platform \Var{PLAT}.  For example, to unwind
+  an IA-64 program, the header file \File{libunwind-ia64.h} should be
+  included.
+\item[\Opt{-l}\File{unwind}] Linker-switch to add when building a
+  program that does native (same platform) unwinding.
+\item[\Opt{-l}\File{unwind-}\Var{PLAT}] Linker-switch to add when
+  building a program that unwinds a program on platform \Var{PLAT}.
+  For example, to (cross-)unwind an IA-64 program, the linker switch
+  \File{-lunwind-ia64} should be added.  Note: multiple such switches
+  may need to be specified for programs that can unwind programs on
+  multiple platforms.
+\end{Description}
+
+\section{See Also}
+
+\SeeAlso{libunwind-dynamic(3)},
+\SeeAlso{libunwind-ia64(3)},
+\SeeAlso{libunwind-ptrace(3)},
+\SeeAlso{libunwind-setjmp(3)},
+\SeeAlso{unw\_create\_addr\_space(3)},
+\SeeAlso{unw\_destroy\_addr\_space(3)},
+\SeeAlso{unw\_flush\_cache(3)},
+\SeeAlso{unw\_get\_accessors(3)},
+\SeeAlso{unw\_get\_fpreg(3)},
+\SeeAlso{unw\_get\_proc\_info(3)},
+\SeeAlso{unw\_get\_proc\_name(3)},
+\SeeAlso{unw\_get\_reg(3)},
+\SeeAlso{unw\_getcontext(3)},
+\SeeAlso{unw\_init\_local(3)},
+\SeeAlso{unw\_init\_remote(3)},
+\SeeAlso{unw\_is\_fpreg(3)},
+\SeeAlso{unw\_is\_signal\_frame(3)},
+\SeeAlso{unw\_regname(3)},
+\SeeAlso{unw\_resume(3)},
+\SeeAlso{unw\_set\_caching\_policy(3)},
+\SeeAlso{unw\_set\_fpreg(3)},
+\SeeAlso{unw\_set\_reg(3)},
+\SeeAlso{unw\_step(3)},
+\SeeAlso{unw\_strerror(3)},
+\SeeAlso{\_U\_dyn\_register(3)},
+\SeeAlso{\_U\_dyn\_cancel(3)}
+
+\section{Author}
+
+\noindent
+David Mosberger-Tang\\
+Email: \Email{dmosberger@gmail.com}\\
+WWW: \URL{http://www.nongnu.org/libunwind/}.
+\LatexManEnd
+
+\end{document}
diff --git a/libunwind/doc/libunwind.trans b/libunwind/doc/libunwind.trans
new file mode 100644
index 0000000..a514e5a
--- /dev/null
+++ b/libunwind/doc/libunwind.trans
@@ -0,0 +1,34 @@
+$manMacro1a{'Type'}		= $manMacro1a{File};
+	$manMacro1b{'Type'}	= $manMacro1b{File};
+$htmlMacro1a{'Type'}		= $htmlMacro1a{File};
+	$htmlMacro1b{'Type'}	= $htmlMacro1b{File};
+$texiMacro1a{'Type'}		= $texiMacro1a{File};
+	$texiMacro1b{'Type'}	= $texiMacro1b{File};
+$manMacro1a{'Func'}		= $manMacro1a{Prog};
+	$manMacro1b{'Func'}	= $manMacro1b{Prog};
+$htmlMacro1a{'Func'}		= $htmlMacro1a{Arg};
+	$htmlMacro1b{'Func'}	= $htmlMacro1b{Arg};
+$texiMacro1a{'Func'}		= $texiMacro1a{Prog};
+	$texiMacro1b{'Func'}	= $texiMacro1b{Prog};
+$manMacro1a{'Var'}		= $manMacro1a{Prog};
+	$manMacro1b{'Var'}	= $manMacro1b{Prog};
+$htmlMacro1a{'Var'}		= $htmlMacro1a{Prog};
+	$htmlMacro1b{'Var'}	= $htmlMacro1b{Prog};
+$texiMacro1a{'Var'}		= $texiMacro1a{Prog};
+	$texiMacro1b{'Var'}	= $texiMacro1b{Prog};
+$manMacro1a{'Const'}		= $manMacro1a{File};
+	$manMacro1b{'Const'}	= $manMacro1b{File};
+$htmlMacro1a{'Const'}		= $htmlMacro1a{File};
+	$htmlMacro1b{'Const'}	= $htmlMacro1b{File};
+$texiMacro1a{'Const'}		= $texiMacro1a{File};
+	$texiMacro1b{'Const'}	= $texiMacro1b{File};
+
+$manMacro1a{'SeeAlso'}		= $manMacro1a{File};
+	$manMacro1b{'SeeAlso'}	= $manMacro1b{File};
+# special handling of SeeAlso in latex2man, so that argument gets doubled:
+$htmlMacro2a{'SeeAlso'}		= "<a href=\"";
+	$htmlMacro2b{'SeeAlso'}	= ".html\">$htmlMacro1a{File}";
+	$htmlMacro2c{'SeeAlso'}	= "$htmlMacro1b{File}</a>";
+$texiMacro1a{'SeeAlso'}		= $texiMacro1a{File};
+	$texiMacro1b{'SeeAlso'}	= $texiMacro1b{File};
+
diff --git a/libunwind/doc/unw_backtrace.man b/libunwind/doc/unw_backtrace.man
new file mode 100644
index 0000000..5699bbf
--- /dev/null
+++ b/libunwind/doc/unw_backtrace.man
@@ -0,0 +1,86 @@
+'\" t
+.\" Manual page created with latex2man on Fri Aug 31 13:39:04 EEST 2012
+.\" NOTE: This file is generated, DO NOT EDIT.
+.de Vb
+.ft CW
+.nf
+..
+.de Ve
+.ft R
+
+.fi
+..
+.TH "UNW\\_BACKTRACE" "3" "31 August 2012" "Programming Library " "Programming Library "
+.SH NAME
+unw_backtrace
+\-\- return backtrace for the calling program 
+.PP
+.SH SYNOPSIS
+
+.PP
+#include <libunwind.h>
+.br
+.PP
+int
+unw_backtrace(void **buffer,
+int size);
+.br
+.PP
+#include <execinfo.h>
+.br
+.PP
+int
+backtrace(void **buffer,
+int size);
+.br
+.PP
+.SH DESCRIPTION
+
+.PP
+unw_backtrace()
+is a convenient routine for obtaining the backtrace for 
+the calling program. The routine fills up to size
+addresses in the array 
+pointed by buffer\&.
+The routine is only available for local unwinding. 
+.PP
+Note that many (but not all) systems provide practically identical function 
+called backtrace().
+The prototype for this function is usually obtained 
+by including the <execinfo.h>
+header file \-\- a prototype for 
+backtrace()
+is not provided by libunwind\&.
+libunwind
+weakly 
+aliases backtrace()
+to unw_backtrace(),
+so when a program 
+calling backtrace()
+is linked against libunwind,
+it may end up 
+calling unw_backtrace().
+.PP
+.SH RETURN VALUE
+
+.PP
+The routine returns the number of addresses stored in the array pointed by 
+buffer\&.
+The return value may be zero to indicate that no addresses were 
+stored. 
+.PP
+.SH SEE ALSO
+
+.PP
+libunwind(3),
+unw_step(3)
+.PP
+.SH AUTHOR
+
+.PP
+David Mosberger\-Tang
+.br
+Email: \fBdmosberger@gmail.com\fP
+.br
+WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
+.\" NOTE: This file is generated, DO NOT EDIT.
diff --git a/libunwind/doc/unw_backtrace.tex b/libunwind/doc/unw_backtrace.tex
new file mode 100644
index 0000000..c383eeb
--- /dev/null
+++ b/libunwind/doc/unw_backtrace.tex
@@ -0,0 +1,54 @@
+\documentclass{article}
+\usepackage[fancyhdr,pdf]{latex2man}
+
+\input{common.tex}
+
+\begin{document}
+
+\begin{Name}{3}{unw\_backtrace}{David Mosberger-Tang}{Programming Library}{unw\_backtrace}unw\_backtrace -- return backtrace for the calling program
+\end{Name}
+
+\section{Synopsis}
+
+\File{\#include $<$libunwind.h$>$}\\
+
+\Type{int} \Func{unw\_backtrace}(\Type{void~**}\Var{buffer}, \Type{int}~\Var{size});\\
+
+\File{\#include $<$execinfo.h$>$}\\
+
+\Type{int} \Func{backtrace}(\Type{void~**}\Var{buffer}, \Type{int}~\Var{size});\\
+
+\section{Description}
+
+\Func{unw\_backtrace}() is a convenient routine for obtaining the backtrace for
+the calling program. The routine fills up to \Var{size} addresses in the array
+pointed by \Var{buffer}. The routine is only available for local unwinding.
+
+Note that many (but not all) systems provide practically identical function
+called \Func{backtrace}(). The prototype for this function is usually obtained
+by including the \File{$<$execinfo.h$>$} header file -- a prototype for
+\Func{backtrace}() is not provided by \Prog{libunwind}. \Prog{libunwind} weakly
+aliases \Func{backtrace}() to \Func{unw\_backtrace}(), so when a program
+calling \Func{backtrace}() is linked against \Prog{libunwind}, it may end up
+calling \Func{unw\_backtrace}().
+
+\section{Return Value}
+
+The routine returns the number of addresses stored in the array pointed by
+\Var{buffer}. The return value may be zero to indicate that no addresses were
+stored.
+
+\section{See Also}
+
+\SeeAlso{libunwind(3)},
+\SeeAlso{unw\_step(3)}
+
+\section{Author}
+
+\noindent
+David Mosberger-Tang\\
+Email: \Email{dmosberger@gmail.com}\\
+WWW: \URL{http://www.nongnu.org/libunwind/}.
+\LatexManEnd
+
+\end{document}
diff --git a/libunwind/doc/unw_create_addr_space.man b/libunwind/doc/unw_create_addr_space.man
new file mode 100644
index 0000000..4aca13e
--- /dev/null
+++ b/libunwind/doc/unw_create_addr_space.man
@@ -0,0 +1,457 @@
+'\" t
+.\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007
+.\" NOTE: This file is generated, DO NOT EDIT.
+.de Vb
+.ft CW
+.nf
+..
+.de Ve
+.ft R
+
+.fi
+..
+.TH "UNW\\_CREATE\\_ADDR\\_SPACE" "3" "16 August 2007" "Programming Library " "Programming Library "
+.SH NAME
+unw_create_addr_space
+\-\- create address space for remote unwinding 
+.PP
+.SH SYNOPSIS
+
+.PP
+#include <libunwind.h>
+.br
+.PP
+unw_addr_space_t
+unw_create_addr_space(unw_accessors_t *ap,
+int
+byteorder);
+.br
+.PP
+.SH DESCRIPTION
+
+.PP
+The unw_create_addr_space()
+routine creates a new unwind 
+address\-space and initializes it based on the call\-back routines 
+passed via the ap
+pointer and the specified byteorder\&.
+The call\-back routines are described in detail below. The 
+byteorder
+can be set to 0 to request the default byte\-order of 
+the unwind target. To request a particular byte\-order, 
+byteorder
+can be set to any constant defined by 
+<endian.h>\&.
+In particular, __LITTLE_ENDIAN
+would 
+request little\-endian byte\-order and __BIG_ENDIAN
+would 
+request big\-endian byte\-order. Whether or not a particular byte\-order 
+is supported depends on the target platform. 
+.PP
+.SH CALL\-BACK ROUTINES
+
+.PP
+Libunwind
+uses a set of call\-back routines to access the 
+information it needs to unwind a chain of stack\-frames. These 
+routines are specified via the ap
+argument, which points to a 
+variable of type unw_accessors_t\&.
+The contents of this 
+variable is copied into the newly\-created address space, so the 
+variable must remain valid only for the duration of the call to 
+unw_create_addr_space().
+.PP
+The first argument to every call\-back routine is an address\-space 
+identifier (as)
+and the last argument is an arbitrary, 
+application\-specified void\-pointer (arg).
+When invoking a 
+call\-back routine, libunwind
+sets the as
+argument to the 
+address\-space on whose behalf the invocation is made and the arg
+argument to the value that was specified when 
+unw_init_remote(3)
+was called. 
+.PP
+The synopsis and a detailed description of every call\-back routine 
+follows below. 
+.PP
+.SS CALL\-BACK ROUTINE SYNOPSIS
+.PP
+int
+find_proc_info(unw_addr_space_t
+as,
+.br
+\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fPunw_word_t
+ip,
+unw_proc_info_t *pip,
+.br
+\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fPint
+need_unwind_info,
+void *arg);
+.br
+void
+put_unwind_info(unw_addr_space_t
+as,
+.br
+\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fPunw_proc_info_t *pip,
+void *arg);
+.br
+int
+get_dyn_info_list_addr(unw_addr_space_t
+as,
+.br
+\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fPunw_word_t *dilap,
+void *arg);
+.br
+int
+access_mem(unw_addr_space_t
+as,
+.br
+\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fPunw_word_t
+addr,
+unw_word_t *valp,
+.br
+\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fPint
+write,
+void *arg);
+.br
+int
+access_reg(unw_addr_space_t
+as,
+.br
+\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fPunw_regnum_t
+regnum,
+unw_word_t *valp,
+.br
+\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fPint
+write,
+void *arg);
+.br
+int
+access_fpreg(unw_addr_space_t
+as,
+.br
+\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fPunw_regnum_t
+regnum,
+unw_fpreg_t *fpvalp,
+.br
+\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fPint
+write,
+void *arg);
+.br
+int
+resume(unw_addr_space_t
+as,
+.br
+\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fPunw_cursor_t *cp,
+void *arg);
+.br
+int
+get_proc_name(unw_addr_space_t
+as,
+.br
+\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fPunw_word_t
+addr,
+char *bufp,
+.br
+\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fPsize_t
+buf_len,
+unw_word_t *offp,
+.br
+\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fP\fB \fPvoid *arg);
+.br
+.PP
+.SS FIND_PROC_INFO
+.PP
+Libunwind
+invokes the find_proc_info()
+call\-back to 
+locate the information need to unwind a particular procedure. The 
+ip
+argument is an instruction\-address inside the procedure whose 
+information is needed. The pip
+argument is a pointer to the 
+variable used to return the desired information. The type of this 
+variable is unw_proc_info_t\&.
+See 
+unw_get_proc_info(3)
+for details. Argument 
+need_unwind_info
+is zero if the call\-back does not need to 
+provide values for the following members in the 
+unw_proc_info_t
+structure: format,
+unwind_info_size,
+and unwind_info\&.
+If 
+need_unwind_info
+is non\-zero, valid values need to be returned 
+in these members. Furthermore, the contents of the memory addressed 
+by the unwind_info
+member must remain valid until the info is 
+released via the put_unwind_info
+call\-back (see below). 
+.PP
+On successful completion, the find_proc_info()
+call\-back must 
+return zero. Otherwise, the negative value of one of the 
+unw_error_t
+error\-codes may be returned. In particular, this 
+call\-back may return \-UNW_ESTOPUNWIND
+to signal the end of 
+the frame\-chain. 
+.PP
+.SS PUT_UNWIND_INFO
+.PP
+Libunwind
+invokes the put_unwind_info()
+call\-back to 
+release the resources (such as memory) allocated by a previous call to 
+find_proc_info()
+with the need_unwind_info
+argument 
+set to a non\-zero value. The pip
+argument has the same value as 
+the argument of the same name in the previous matching call to 
+find_proc_info().
+Note that libunwind
+does \fInot\fP
+invoke put_unwind_info
+for calls to find_proc_info()
+with a zero need_unwind_info
+argument. 
+.PP
+.SS GET_DYN_INFO_LIST_ADDR
+.PP
+Libunwind
+invokes the get_dyn_info_list_addr()
+call\-back to obtain the address of the head of the dynamic unwind\-info 
+registration list. The variable stored at the returned address must 
+have a type of unw_dyn_info_list_t
+(see 
+_U_dyn_register(3)).
+The dliap
+argument is a pointer 
+to a variable of type unw_word_t
+which is used to return the 
+address of the dynamic unwind\-info registration list. If no dynamic 
+unwind\-info registration list exist, the value pointed to by 
+dliap
+must be cleared to zero. Libunwind
+will cache the 
+value returned by get_dyn_info_list_addr()
+if caching is 
+enabled for the given address\-space. The cache can be cleared with a 
+call to unw_flush_cache().
+.PP
+On successful completion, the get_dyn_info_list_addr()
+call\-back must return zero. Otherwise, the negative value of one of 
+the unw_error_t
+error\-codes may be returned. 
+.PP
+.SS ACCESS_MEM
+.PP
+Libunwind
+invokes the access_mem()
+call\-back to read 
+from or write to a word of memory in the target address\-space. The 
+address of the word to be accessed is passed in argument addr\&.
+To read memory, libunwind
+sets argument write
+to zero and 
+valp
+to point to the word that receives the read value. To 
+write memory, libunwind
+sets argument write
+to a non\-zero 
+value and valp
+to point to the word that contains the value to 
+be written. The word that valp
+points to is always in the 
+byte\-order of the host\-platform, regardless of the byte\-order of the 
+target. In other words, it is the responsibility of the call\-back 
+routine to convert between the target\&'s and the host\&'s byte\-order, if 
+necessary. 
+.PP
+On successful completion, the access_mem()
+call\-back must return zero. Otherwise, the negative value of one of 
+the unw_error_t
+error\-codes may be returned. 
+.PP
+.SS ACCESS_REG
+.PP
+Libunwind
+invokes the access_reg()
+call\-back to read 
+from or write to a scalar (non\-floating\-point) CPU register. The 
+index of the register to be accessed is passed in argument 
+regnum\&.
+To read a register, libunwind
+sets argument 
+write
+to zero and valp
+to point to the word that receives 
+the read value. To write a register, libunwind
+sets argument 
+write
+to a non\-zero value and valp
+to point to the word 
+that contains the value to be written. The word that valp
+points to is always in the byte\-order of the host\-platform, regardless 
+of the byte\-order of the target. In other words, it is the 
+responsibility of the call\-back routine to convert between the 
+target\&'s and the host\&'s byte\-order, if necessary. 
+.PP
+On successful completion, the access_reg()
+call\-back must 
+return zero. Otherwise, the negative value of one of the 
+unw_error_t
+error\-codes may be returned. 
+.PP
+.SS ACCESS_FPREG
+.PP
+Libunwind
+invokes the access_fpreg()
+call\-back to read 
+from or write to a floating\-point CPU register. The index of the 
+register to be accessed is passed in argument regnum\&.
+To read a 
+register, libunwind
+sets argument write
+to zero and 
+fpvalp
+to point to a variable of type unw_fpreg_t
+that 
+receives the read value. To write a register, libunwind
+sets 
+argument write
+to a non\-zero value and fpvalp
+to point to 
+the variable of type unw_fpreg_t
+that contains the value to 
+be written. The word that fpvalp
+points to is always in the 
+byte\-order of the host\-platform, regardless of the byte\-order of the 
+target. In other words, it is the responsibility of the call\-back 
+routine to convert between the target\&'s and the host\&'s byte\-order, if 
+necessary. 
+.PP
+On successful completion, the access_fpreg()
+call\-back must 
+return zero. Otherwise, the negative value of one of the 
+unw_error_t
+error\-codes may be returned. 
+.PP
+.SS RESUME
+.PP
+Libunwind
+invokes the resume()
+call\-back to resume 
+execution in the target address space. Argument cp
+is the 
+unwind\-cursor that identifies the stack\-frame in which execution 
+should resume. By the time libunwind
+invokes the resume
+call\-back, it has already established the desired machine\- and 
+memory\-state via calls to the access_reg(),
+access_fpreg,
+and access_mem()
+call\-backs. Thus, all 
+the call\-back needs to do is perform whatever action is needed to 
+actually resume execution. 
+.PP
+The resume
+call\-back is invoked only in response to a call to 
+unw_resume(3),
+so applications which never invoke 
+unw_resume(3)
+need not define the resume
+callback. 
+.PP
+On successful completion, the resume()
+call\-back must return 
+zero. Otherwise, the negative value of one of the 
+unw_error_t
+error\-codes may be returned. As a special case, 
+when resuming execution in the local address space, the call\-back will 
+not return on success. 
+.PP
+.SS GET_PROC_NAME
+.PP
+Libunwind
+invokes the get_proc_name()
+call\-back to 
+obtain the procedure\-name of a static (not dynamically generated) 
+procedure. Argument addr
+is an instruction\-address within the 
+procedure whose name is to be obtained. The bufp
+argument is a 
+pointer to a character\-buffer used to return the procedure name. The 
+size of this buffer is specified in argument buf_len\&.
+The 
+returned name must be terminated by a NUL character. If the 
+procedure\&'s name is longer than buf_len
+bytes, it must be 
+truncated to buf_len\-1
+bytes, with the last byte in the 
+buffer set to the NUL character and \-UNW_ENOMEM
+must be 
+returned. Argument offp
+is a pointer to a word which is used to 
+return the byte\-offset relative to the start of the procedure whose 
+name is being returned. For example, if procedure foo()
+starts 
+at address 0x40003000, then invoking get_proc_name()
+with 
+addr
+set to 0x40003080 should return a value of 0x80 in the word 
+pointed to by offp
+(assuming the procedure is at least 0x80 
+bytes long). 
+.PP
+On successful completion, the get_proc_name()
+call\-back must 
+return zero. Otherwise, the negative value of one of the 
+unw_error_t
+error\-codes may be returned. 
+.PP
+.SH RETURN VALUE
+
+.PP
+On successful completion, unw_create_addr_space()
+returns a 
+non\-NULL
+value that represents the newly created 
+address\-space. Otherwise, NULL
+is returned. 
+.PP
+.SH THREAD AND SIGNAL SAFETY
+
+.PP
+unw_create_addr_space()
+is thread\-safe but \fInot\fP
+safe to use from a signal handler. 
+.PP
+.SH SEE ALSO
+
+.PP
+_U_dyn_register(3),
+libunwind(3),
+unw_destroy_addr_space(3),
+unw_get_proc_info(3),
+unw_init_remote(3),
+unw_resume(3)
+.PP
+.SH AUTHOR
+
+.PP
+David Mosberger\-Tang
+.br
+Email: \fBdmosberger@gmail.com\fP
+.br
+WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
+.\" NOTE: This file is generated, DO NOT EDIT.
diff --git a/libunwind/doc/unw_create_addr_space.tex b/libunwind/doc/unw_create_addr_space.tex
new file mode 100644
index 0000000..8de0691
--- /dev/null
+++ b/libunwind/doc/unw_create_addr_space.tex
@@ -0,0 +1,265 @@
+\documentclass{article}
+\usepackage[fancyhdr,pdf]{latex2man}
+
+\input{common.tex}
+
+\begin{document}
+
+\begin{Name}{3}{unw\_create\_addr\_space}{David Mosberger-Tang}{Programming Library}{unw\_create\_addr\_space}unw\_create\_addr\_space -- create address space for remote unwinding
+\end{Name}
+
+\section{Synopsis}
+
+\File{\#include $<$libunwind.h$>$}\\
+
+\Type{unw\_addr\_space\_t} \Func{unw\_create\_addr\_space}(\Type{unw\_accessors\_t~*}\Var{ap}, \Type{int} \Var{byteorder});\\
+
+\section{Description}
+
+The \Func{unw\_create\_addr\_space}() routine creates a new unwind
+address-space and initializes it based on the call-back routines
+passed via the \Var{ap} pointer and the specified \Var{byteorder}.
+The call-back routines are described in detail below.  The
+\Var{byteorder} can be set to 0 to request the default byte-order of
+the unwind target.  To request a particular byte-order,
+\Var{byteorder} can be set to any constant defined by
+\File{$<$endian.h$>$}.  In particular, \Const{\_\_LITTLE\_ENDIAN} would
+request little-endian byte-order and \Const{\_\_BIG\_ENDIAN} would
+request big-endian byte-order.  Whether or not a particular byte-order
+is supported depends on the target platform.
+
+\section{Call-back Routines}
+
+\Prog{Libunwind} uses a set of call-back routines to access the
+information it needs to unwind a chain of stack-frames.  These
+routines are specified via the \Var{ap} argument, which points to a
+variable of type \Type{unw\_accessors\_t}.  The contents of this
+variable is copied into the newly-created address space, so the
+variable must remain valid only for the duration of the call to
+\Func{unw\_create\_addr\_space}().
+
+The first argument to every call-back routine is an address-space
+identifier (\Var{as}) and the last argument is an arbitrary,
+application-specified void-pointer (\Var{arg}).  When invoking a
+call-back routine, \Prog{libunwind} sets the \Var{as} argument to the
+address-space on whose behalf the invocation is made and the \Var{arg}
+argument to the value that was specified when
+\Func{unw\_init\_remote}(3) was called.
+
+The synopsis and a detailed description of every call-back routine
+follows below.
+
+\subsection{Call-back Routine Synopsis}
+
+\Type{int} \Func{find\_proc\_info}(\Type{unw\_addr\_space\_t} \Var{as},\\
+\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\Type{unw\_word\_t} \Var{ip}, \Type{unw\_proc\_info\_t~*}\Var{pip},\\
+\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\Type{int} \Var{need\_unwind\_info}, \Type{void~*}arg);\\
+\Type{void} \Func{put\_unwind\_info}(\Type{unw\_addr\_space\_t} \Var{as},\\
+\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\Type{unw\_proc\_info\_t~*}pip, \Type{void~*}\Var{arg});\\
+\Type{int} \Func{get\_dyn\_info\_list\_addr}(\Type{unw\_addr\_space\_t} \Var{as},\\
+\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\Type{unw\_word\_t~*}\Var{dilap}, \Type{void~*}\Var{arg});\\
+\Type{int} \Func{access\_mem}(\Var{unw\_addr\_space\_t} \Var{as},\\
+\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\Type{unw\_word\_t} \Var{addr}, \Type{unw\_word\_t~*}\Var{valp},\\
+\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\Type{int} \Var{write}, \Type{void~*}\Var{arg});\\
+\Type{int} \Func{access\_reg}(\Var{unw\_addr\_space\_t} \Var{as},\\
+\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\Type{unw\_regnum\_t} \Var{regnum}, \Type{unw\_word\_t~*}\Var{valp},\\
+\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\Type{int} \Var{write}, \Type{void~*}\Var{arg});\\
+\Type{int} \Func{access\_fpreg}(\Var{unw\_addr\_space\_t} \Var{as},\\
+\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\Type{unw\_regnum\_t} \Var{regnum}, \Type{unw\_fpreg\_t~*}\Var{fpvalp},\\
+\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\Type{int} \Var{write}, \Type{void~*}\Var{arg});\\
+\Type{int} \Func{resume}(\Var{unw\_addr\_space\_t} \Var{as},\\
+\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\Type{unw\_cursor\_t~*}\Var{cp}, \Type{void~*}\Var{arg});\\
+\Type{int} \Func{get\_proc\_name}(\Type{unw\_addr\_space\_t} \Var{as},\\
+\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\Type{unw\_word\_t} \Var{addr}, \Type{char~*}\Var{bufp},\\
+\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\Type{size\_t} \Var{buf\_len}, \Type{unw\_word\_t~*}\Var{offp},\\
+\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\SP\Type{void~*}\Var{arg});\\
+
+\subsection{find\_proc\_info}
+
+\Prog{Libunwind} invokes the \Func{find\_proc\_info}() call-back to
+locate the information need to unwind a particular procedure.  The
+\Var{ip} argument is an instruction-address inside the procedure whose
+information is needed.  The \Var{pip} argument is a pointer to the
+variable used to return the desired information.  The type of this
+variable is \Type{unw\_proc\_info\_t}.  See
+\Func{unw\_get\_proc\_info(3)} for details.  Argument
+\Var{need\_unwind\_info} is zero if the call-back does not need to
+provide values for the following members in the
+\Type{unw\_proc\_info\_t} structure: \Var{format},
+\Var{unwind\_info\_size}, and \Var{unwind\_info}.  If
+\Var{need\_unwind\_info} is non-zero, valid values need to be returned
+in these members.  Furthermore, the contents of the memory addressed
+by the \Var{unwind\_info} member must remain valid until the info is
+released via the \Func{put\_unwind\_info} call-back (see below).
+
+On successful completion, the \Func{find\_proc\_info}() call-back must
+return zero.  Otherwise, the negative value of one of the
+\Type{unw\_error\_t} error-codes may be returned.  In particular, this
+call-back may return -\Const{UNW\_ESTOPUNWIND} to signal the end of
+the frame-chain.
+
+\subsection{put\_unwind\_info}
+
+\Prog{Libunwind} invokes the \Func{put\_unwind\_info}() call-back to
+release the resources (such as memory) allocated by a previous call to
+\Func{find\_proc\_info}() with the \Var{need\_unwind\_info} argument
+set to a non-zero value.  The \Var{pip} argument has the same value as
+the argument of the same name in the previous matching call to
+\Func{find\_proc\_info}().  Note that \Prog{libunwind} does \emph{not}
+invoke \Func{put\_unwind\_info} for calls to \Func{find\_proc\_info}()
+with a zero \Var{need\_unwind\_info} argument.
+
+
+\subsection{get\_dyn\_info\_list\_addr}
+
+\Prog{Libunwind} invokes the \Func{get\_dyn\_info\_list\_addr}()
+call-back to obtain the address of the head of the dynamic unwind-info
+registration list.  The variable stored at the returned address must
+have a type of \Type{unw\_dyn\_info\_list\_t} (see
+\Func{\_U\_dyn\_register}(3)).  The \Var{dliap} argument is a pointer
+to a variable of type \Type{unw\_word\_t} which is used to return the
+address of the dynamic unwind-info registration list.  If no dynamic
+unwind-info registration list exist, the value pointed to by
+\Var{dliap} must be cleared to zero.  \Prog{Libunwind} will cache the
+value returned by \Func{get\_dyn\_info\_list\_addr}() if caching is
+enabled for the given address-space.  The cache can be cleared with a
+call to \Func{unw\_flush\_cache}().
+
+On successful completion, the \Func{get\_dyn\_info\_list\_addr}()
+call-back must return zero.  Otherwise, the negative value of one of
+the \Type{unw\_error\_t} error-codes may be returned.
+
+\subsection{access\_mem}
+
+\Prog{Libunwind} invokes the \Func{access\_mem}() call-back to read
+from or write to a word of memory in the target address-space.  The
+address of the word to be accessed is passed in argument \Var{addr}.
+To read memory, \Prog{libunwind} sets argument \Var{write} to zero and
+\Var{valp} to point to the word that receives the read value.  To
+write memory, \Prog{libunwind} sets argument \Var{write} to a non-zero
+value and \Var{valp} to point to the word that contains the value to
+be written.  The word that \Var{valp} points to is always in the
+byte-order of the host-platform, regardless of the byte-order of the
+target.  In other words, it is the responsibility of the call-back
+routine to convert between the target's and the host's byte-order, if
+necessary.
+
+On successful completion, the \Func{access\_mem}()
+call-back must return zero.  Otherwise, the negative value of one of
+the \Type{unw\_error\_t} error-codes may be returned.
+
+\subsection{access\_reg}
+
+\Prog{Libunwind} invokes the \Func{access\_reg}() call-back to read
+from or write to a scalar (non-floating-point) CPU register.  The
+index of the register to be accessed is passed in argument
+\Var{regnum}.  To read a register, \Prog{libunwind} sets argument
+\Var{write} to zero and \Var{valp} to point to the word that receives
+the read value.  To write a register, \Prog{libunwind} sets argument
+\Var{write} to a non-zero value and \Var{valp} to point to the word
+that contains the value to be written.  The word that \Var{valp}
+points to is always in the byte-order of the host-platform, regardless
+of the byte-order of the target.  In other words, it is the
+responsibility of the call-back routine to convert between the
+target's and the host's byte-order, if necessary.
+
+On successful completion, the \Func{access\_reg}() call-back must
+return zero.  Otherwise, the negative value of one of the
+\Type{unw\_error\_t} error-codes may be returned.
+
+\subsection{access\_fpreg}
+
+\Prog{Libunwind} invokes the \Func{access\_fpreg}() call-back to read
+from or write to a floating-point CPU register.  The index of the
+register to be accessed is passed in argument \Var{regnum}.  To read a
+register, \Prog{libunwind} sets argument \Var{write} to zero and
+\Var{fpvalp} to point to a variable of type \Type{unw\_fpreg\_t} that
+receives the read value.  To write a register, \Prog{libunwind} sets
+argument \Var{write} to a non-zero value and \Var{fpvalp} to point to
+the variable of type \Type{unw\_fpreg\_t} that contains the value to
+be written.  The word that \Var{fpvalp} points to is always in the
+byte-order of the host-platform, regardless of the byte-order of the
+target.  In other words, it is the responsibility of the call-back
+routine to convert between the target's and the host's byte-order, if
+necessary.
+
+On successful completion, the \Func{access\_fpreg}() call-back must
+return zero.  Otherwise, the negative value of one of the
+\Type{unw\_error\_t} error-codes may be returned.
+
+\subsection{resume}
+
+\Prog{Libunwind} invokes the \Func{resume}() call-back to resume
+execution in the target address space.  Argument \Var{cp} is the
+unwind-cursor that identifies the stack-frame in which execution
+should resume.  By the time \Prog{libunwind} invokes the \Func{resume}
+call-back, it has already established the desired machine- and
+memory-state via calls to the \Func{access\_reg}(),
+\Func{access\_fpreg}, and \Func{access\_mem}() call-backs.  Thus, all
+the call-back needs to do is perform whatever action is needed to
+actually resume execution.
+
+The \Func{resume} call-back is invoked only in response to a call to
+\Func{unw\_resume}(3), so applications which never invoke
+\Func{unw\_resume}(3) need not define the \Func{resume} callback.
+
+On successful completion, the \Func{resume}() call-back must return
+zero.  Otherwise, the negative value of one of the
+\Type{unw\_error\_t} error-codes may be returned.  As a special case,
+when resuming execution in the local address space, the call-back will
+not return on success.
+
+\subsection{get\_proc\_name}
+
+\Prog{Libunwind} invokes the \Func{get\_proc\_name}() call-back to
+obtain the procedure-name of a static (not dynamically generated)
+procedure.  Argument \Var{addr} is an instruction-address within the
+procedure whose name is to be obtained.  The \Var{bufp} argument is a
+pointer to a character-buffer used to return the procedure name.  The
+size of this buffer is specified in argument \Var{buf\_len}.  The
+returned name must be terminated by a NUL character.  If the
+procedure's name is longer than \Var{buf\_len} bytes, it must be
+truncated to \Var{buf\_len}\Prog{-1} bytes, with the last byte in the
+buffer set to the NUL character and -\Const{UNW\_ENOMEM} must be
+returned.  Argument \Var{offp} is a pointer to a word which is used to
+return the byte-offset relative to the start of the procedure whose
+name is being returned.  For example, if procedure \Func{foo}() starts
+at address 0x40003000, then invoking \Func{get\_proc\_name}() with
+\Var{addr} set to 0x40003080 should return a value of 0x80 in the word
+pointed to by \Var{offp} (assuming the procedure is at least 0x80
+bytes long).
+
+On successful completion, the \Func{get\_proc\_name}() call-back must
+return zero.  Otherwise, the negative value of one of the
+\Type{unw\_error\_t} error-codes may be returned.
+
+
+\section{Return Value}
+
+On successful completion, \Func{unw\_create\_addr\_space}() returns a
+non-\Const{NULL} value that represents the newly created
+address-space.  Otherwise, \Const{NULL} is returned.
+
+\section{Thread and Signal Safety}
+
+\Func{unw\_create\_addr\_space}() is thread-safe but \emph{not}
+safe to use from a signal handler.
+
+\section{See Also}
+
+\SeeAlso{\_U\_dyn\_register(3)},
+\SeeAlso{libunwind(3)},
+\SeeAlso{unw\_destroy\_addr\_space(3)},
+\SeeAlso{unw\_get\_proc\_info(3)},
+\SeeAlso{unw\_init\_remote(3)},
+\SeeAlso{unw\_resume(3)}
+
+\section{Author}
+
+\noindent
+David Mosberger-Tang\\
+Email: \Email{dmosberger@gmail.com}\\
+WWW: \URL{http://www.nongnu.org/libunwind/}.
+\LatexManEnd
+
+\end{document}
diff --git a/libunwind/doc/unw_destroy_addr_space.man b/libunwind/doc/unw_destroy_addr_space.man
new file mode 100644
index 0000000..90c9777
--- /dev/null
+++ b/libunwind/doc/unw_destroy_addr_space.man
@@ -0,0 +1,57 @@
+'\" t
+.\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007
+.\" NOTE: This file is generated, DO NOT EDIT.
+.de Vb
+.ft CW
+.nf
+..
+.de Ve
+.ft R
+
+.fi
+..
+.TH "UNW\\_DESTROY\\_ADDR\\_SPACE" "3" "16 August 2007" "Programming Library " "Programming Library "
+.SH NAME
+unw_destroy_addr_space
+\-\- destroy unwind address space 
+.PP
+.SH SYNOPSIS
+
+.PP
+#include <libunwind.h>
+.br
+.PP
+void
+unw_destroy_addr_space(unw_addr_space_t
+as);
+.br
+.PP
+.SH DESCRIPTION
+
+.PP
+The unw_destroy_addr_space()
+routine destroys the 
+address space specified by argument as
+and thereby releases 
+all associated resources (such as memory). 
+.PP
+Applications must not destroy the local address space 
+unw_local_addr_space\&.
+Attempting to do so results in 
+undefined behavior (e.g., the application may crash). 
+.PP
+.SH SEE ALSO
+
+.PP
+libunwind(3),
+unw_create_addr_space(3)
+.PP
+.SH AUTHOR
+
+.PP
+David Mosberger\-Tang
+.br
+Email: \fBdmosberger@gmail.com\fP
+.br
+WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
+.\" NOTE: This file is generated, DO NOT EDIT.
diff --git a/libunwind/doc/unw_destroy_addr_space.tex b/libunwind/doc/unw_destroy_addr_space.tex
new file mode 100644
index 0000000..a66b10b
--- /dev/null
+++ b/libunwind/doc/unw_destroy_addr_space.tex
@@ -0,0 +1,40 @@
+\documentclass{article}
+\usepackage[fancyhdr,pdf]{latex2man}
+
+\input{common.tex}
+
+\begin{document}
+
+\begin{Name}{3}{unw\_destroy\_addr\_space}{David Mosberger-Tang}{Programming Library}{unw\_destroy\_addr\_space}unw\_destroy\_addr\_space -- destroy unwind address space
+\end{Name}
+
+\section{Synopsis}
+
+\File{\#include $<$libunwind.h$>$}\\
+
+\Type{void} \Func{unw\_destroy\_addr\_space}(\Type{unw\_addr\_space\_t} \Var{as});\\
+
+\section{Description}
+
+The \Func{unw\_destroy\_addr\_space}() routine destroys the
+address space specified by argument \Var{as} and thereby releases
+all associated resources (such as memory).
+
+Applications must not destroy the local address space
+\Var{unw\_local\_addr\_space}.  Attempting to do so results in
+undefined behavior (e.g., the application may crash).
+
+\section{See Also}
+
+\SeeAlso{libunwind(3)},
+\SeeAlso{unw\_create\_addr\_space(3)}
+
+\section{Author}
+
+\noindent
+David Mosberger-Tang\\
+Email: \Email{dmosberger@gmail.com}\\
+WWW: \URL{http://www.nongnu.org/libunwind/}.
+\LatexManEnd
+
+\end{document}
diff --git a/libunwind/doc/unw_flush_cache.man b/libunwind/doc/unw_flush_cache.man
new file mode 100644
index 0000000..2c05bc2
--- /dev/null
+++ b/libunwind/doc/unw_flush_cache.man
@@ -0,0 +1,92 @@
+'\" t
+.\" Manual page created with latex2man on Thu Aug 16 09:44:44 MDT 2007
+.\" NOTE: This file is generated, DO NOT EDIT.
+.de Vb
+.ft CW
+.nf
+..
+.de Ve
+.ft R
+
+.fi
+..
+.TH "UNW\\_FLUSH\\_CACHE" "3" "16 August 2007" "Programming Library " "Programming Library "
+.SH NAME
+unw_flush_cache
+\-\- flush cached info 
+.PP
+.SH SYNOPSIS
+
+.PP
+#include <libunwind.h>
+.br
+.PP
+void
+unw_flush_cache(unw_addr_space_t
+as,
+unw_word_t
+lo,
+unw_word_t
+hi);
+.br
+.PP
+.SH DESCRIPTION
+
+.PP
+The unw_flush_cache()
+routine flushes all cached info as it 
+relates to address\-range lo
+to hi
+(non\-inclusive) in the 
+target address\-space as\&.
+In addition, all info cached for 
+address\-space as
+that is not tied to a particular code\-range is 
+also flushed. For example, the address of the dynamic registration 
+list is not tied to a code\-range and its cached value (if any) is 
+flushed by a call to this routine. The address range specified by 
+lo
+and hi
+should be understood as a hint: 
+unw_flush_cache()
+may flush more information than requested, 
+but \fInever\fP
+less. In other words, unw_flush_cache()
+may 
+overflush, but not underflush. 
+.PP
+As a special case, if arguments lo
+and hi
+are both 0, all 
+information cached on behalf of address space as
+is flushed. 
+.PP
+.SH RETURN VALUE
+
+.PP
+The unw_flush_cache()
+routine cannot fail and does not 
+return a value. 
+.PP
+.SH THREAD AND SIGNAL SAFETY
+
+.PP
+The unw_flush_cache()
+routine is thread\-safe as well as safe to 
+use from a signal handler. 
+.PP
+.SH SEE ALSO
+
+.PP
+libunwind(3),
+unw_set_caching_policy(3)
+.PP
+.SH AUTHOR
+
+.PP
+David Mosberger\-Tang
+.br
+Email: \fBdmosberger@gmail.com\fP
+.br
+WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
+.\" NOTE: This file is generated, DO NOT EDIT.
diff --git a/libunwind/doc/unw_flush_cache.tex b/libunwind/doc/unw_flush_cache.tex
new file mode 100644
index 0000000..9b61dfc
--- /dev/null
+++ b/libunwind/doc/unw_flush_cache.tex
@@ -0,0 +1,57 @@
+\documentclass{article}
+\usepackage[fancyhdr,pdf]{latex2man}
+
+\input{common.tex}
+
+\begin{document}
+
+\begin{Name}{3}{unw\_flush\_cache}{David Mosberger-Tang}{Programming Library}{unw\_flush\_cache}unw\_flush\_cache -- flush cached info
+\end{Name}
+
+\section{Synopsis}
+
+\File{\#include $<$libunwind.h$>$}\\
+
+\Type{void} \Func{unw\_flush\_cache}(\Type{unw\_addr\_space\_t} \Var{as}, \Type{unw\_word\_t} \Var{lo}, \Type{unw\_word\_t} \Var{hi});\\
+
+\section{Description}
+
+The \Func{unw\_flush\_cache}() routine flushes all cached info as it
+relates to address-range \Var{lo} to \Var{hi} (non-inclusive) in the
+target address-space \Var{as}.  In addition, all info cached for
+address-space \Var{as} that is not tied to a particular code-range is
+also flushed.  For example, the address of the dynamic registration
+list is not tied to a code-range and its cached value (if any) is
+flushed by a call to this routine.  The address range specified by
+\Var{lo} and \Var{hi} should be understood as a hint:
+\Func{unw\_flush\_cache}() may flush more information than requested,
+but \emph{never} less.  In other words, \Func{unw\_flush\_cache}() may
+overflush, but not underflush.
+
+As a special case, if arguments \Var{lo} and \Var{hi} are both 0, all
+information cached on behalf of address space \Var{as} is flushed.
+
+\section{Return Value}
+
+The \Func{unw\_flush\_cache}() routine cannot fail and does not
+return a value.
+
+\section{Thread and Signal Safety}
+
+The \Func{unw\_flush\_cache}() routine is thread-safe as well as safe to
+use from a signal handler.
+
+\section{See Also}
+
+\SeeAlso{libunwind(3)},
+\SeeAlso{unw\_set\_caching\_policy(3)}
+
+\section{Author}
+
+\noindent
+David Mosberger-Tang\\
+Email: \Email{dmosberger@gmail.com}\\
+WWW: \URL{http://www.nongnu.org/libunwind/}.
+\LatexManEnd
+
+\end{document}
diff --git a/libunwind/doc/unw_get_accessors.man b/libunwind/doc/unw_get_accessors.man
new file mode 100644
index 0000000..83fe4fc
--- /dev/null
+++ b/libunwind/doc/unw_get_accessors.man
@@ -0,0 +1,79 @@
+'\" t
+.\" Manual page created with latex2man on Thu Aug 16 09:44:44 MDT 2007
+.\" NOTE: This file is generated, DO NOT EDIT.
+.de Vb
+.ft CW
+.nf
+..
+.de Ve
+.ft R
+
+.fi
+..
+.TH "UNW\\_GET\\_ACCESSORS" "3" "16 August 2007" "Programming Library " "Programming Library "
+.SH NAME
+unw_get_accessors
+\-\- get pointer to accessor call\-backs 
+.PP
+.SH SYNOPSIS
+
+.PP
+#include <libunwind.h>
+.br
+.PP
+unw_accessors_t *unw_get_accessors(unw_addr_space_t as);
+.br
+.PP
+.SH DESCRIPTION
+
+.PP
+The unw_get_accessors()
+routine returns a pointer to a 
+unw_accessors_t
+structure, which contains the call\-back 
+routines that were specified when address space as
+was created 
+(see unw_create_addr_space(3)).
+The returned pointer is 
+guaranteed to remain valid until address space as
+is destroyed 
+by a call to unw_destroy_addr_space(3).
+.PP
+Note that unw_get_accessors()
+can be used to retrieve the 
+call\-back routines for the local address space 
+unw_local_addr_space\&.
+.PP
+.SH RETURN VALUE
+
+.PP
+The unw_get_accessors()
+routine cannot fail and always 
+returns a valid (non\-NULL)
+pointer to an 
+unw_accessors_t
+structure. 
+.PP
+.SH THREAD AND SIGNAL SAFETY
+
+.PP
+The unw_get_accessors()
+routine is thread\-safe as well as 
+safe to use from a signal handler. 
+.PP
+.SH SEE ALSO
+
+.PP
+libunwind(3),
+unw_create_addr_space(3),
+unw_destroy_addr_space(3)
+.PP
+.SH AUTHOR
+
+.PP
+David Mosberger\-Tang
+.br
+Email: \fBdmosberger@gmail.com\fP
+.br
+WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
+.\" NOTE: This file is generated, DO NOT EDIT.
diff --git a/libunwind/doc/unw_get_accessors.tex b/libunwind/doc/unw_get_accessors.tex
new file mode 100644
index 0000000..bf344a3
--- /dev/null
+++ b/libunwind/doc/unw_get_accessors.tex
@@ -0,0 +1,55 @@
+\documentclass{article}
+\usepackage[fancyhdr,pdf]{latex2man}
+
+\input{common.tex}
+
+\begin{document}
+
+\begin{Name}{3}{unw\_get\_accessors}{David Mosberger-Tang}{Programming Library}{unw\_get\_accessors}unw\_get\_accessors -- get pointer to accessor call-backs
+\end{Name}
+
+\section{Synopsis}
+
+\File{\#include $<$libunwind.h$>$}\\
+
+\Type{unw\_accessors\_t~*}\Func{unw\_get\_accessors}(\Type{unw\_addr\_space\_t~}\Var{as});\\
+
+\section{Description}
+
+The \Func{unw\_get\_accessors}() routine returns a pointer to a
+\Type{unw\_accessors\_t} structure, which contains the call-back
+routines that were specified when address space \Var{as} was created
+(see \Func{unw\_create\_addr\_space}(3)).  The returned pointer is
+guaranteed to remain valid until address space \Var{as} is destroyed
+by a call to \Func{unw\_destroy\_addr\_space}(3).
+
+Note that \Func{unw\_get\_accessors}() can be used to retrieve the
+call-back routines for the local address space
+\Var{unw\_local\_addr\_space}.
+
+\section{Return Value}
+
+The \Func{unw\_get\_accessors}() routine cannot fail and always
+returns a valid (non-\Const{NULL}) pointer to an
+\Type{unw\_accessors\_t} structure.
+
+\section{Thread and Signal Safety}
+
+The \Func{unw\_get\_accessors}() routine is thread-safe as well as
+safe to use from a signal handler.
+
+\section{See Also}
+
+\SeeAlso{libunwind(3)},
+\SeeAlso{unw\_create\_addr\_space(3)},
+\SeeAlso{unw\_destroy\_addr\_space(3)}
+
+\section{Author}
+
+\noindent
+David Mosberger-Tang\\
+Email: \Email{dmosberger@gmail.com}\\
+WWW: \URL{http://www.nongnu.org/libunwind/}.
+\LatexManEnd
+
+\end{document}
diff --git a/libunwind/doc/unw_get_fpreg.man b/libunwind/doc/unw_get_fpreg.man
new file mode 100644
index 0000000..5e54ca1
--- /dev/null
+++ b/libunwind/doc/unw_get_fpreg.man
@@ -0,0 +1,111 @@
+'\" t
+.\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007
+.\" NOTE: This file is generated, DO NOT EDIT.
+.de Vb
+.ft CW
+.nf
+..
+.de Ve
+.ft R
+
+.fi
+..
+.TH "UNW\\_GET\\_FPREG" "3" "16 August 2007" "Programming Library " "Programming Library "
+.SH NAME
+unw_get_fpreg
+\-\- get contents of floating\-point register 
+.PP
+.SH SYNOPSIS
+
+.PP
+#include <libunwind.h>
+.br
+.PP
+int
+unw_get_fpreg(unw_cursor_t *cp,
+unw_regnum_t
+reg,
+unw_fpreg_t *valp);
+.br
+.PP
+.SH DESCRIPTION
+
+.PP
+The unw_get_fpreg()
+routine reads the value of floating\-point 
+register reg
+in the stack frame identified by cursor cp
+and stores the value in the variable pointed to by valp\&.
+.PP
+The register numbering is target\-dependent and described in separate 
+manual pages (e.g., libunwind\-ia64(3) for the IA\-64 target). 
+Furthermore, the exact set of accessible registers may depend on the 
+type of frame that cp
+is referring to. For ordinary stack 
+frames, it is normally possible to access only the preserved 
+(``callee\-saved\&'') registers and frame\-related registers (such as the 
+stack\-pointer). However, for signal frames (see 
+unw_is_signal_frame(3)),
+it is usually possible to access 
+all registers. 
+.PP
+Note that unw_get_fpreg()
+can only read the contents of 
+floating\-point registers. See unw_get_fpreg(3)
+for a way to 
+read registers which fit in a single word. 
+.PP
+.SH RETURN VALUE
+
+.PP
+On successful completion, unw_get_fpreg()
+returns 0. 
+Otherwise the negative value of one of the error\-codes below is 
+returned. 
+.PP
+.SH THREAD AND SIGNAL SAFETY
+
+.PP
+unw_get_fpreg()
+is thread\-safe as well as safe to use 
+from a signal handler. 
+.PP
+.SH ERRORS
+
+.PP
+.TP
+UNW_EUNSPEC
+ An unspecified error occurred. 
+.TP
+UNW_EBADREG
+ An attempt was made to read a register 
+that is either invalid or not accessible in the current frame. 
+.PP
+In addition, unw_get_fpreg()
+may return any error returned by 
+the access_mem(),
+access_reg(),
+and 
+access_fpreg()
+call\-backs (see 
+unw_create_addr_space(3)).
+.PP
+.SH SEE ALSO
+
+.PP
+libunwind(3),
+libunwind\-ia64(3),
+unw_get_reg(3),
+unw_is_fpreg(3),
+unw_is_signal_frame(3),
+unw_set_fpreg(3)
+.PP
+.SH AUTHOR
+
+.PP
+David Mosberger\-Tang
+.br
+Email: \fBdmosberger@gmail.com\fP
+.br
+WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
+.\" NOTE: This file is generated, DO NOT EDIT.
diff --git a/libunwind/doc/unw_get_fpreg.tex b/libunwind/doc/unw_get_fpreg.tex
new file mode 100644
index 0000000..dd679ad
--- /dev/null
+++ b/libunwind/doc/unw_get_fpreg.tex
@@ -0,0 +1,77 @@
+\documentclass{article}
+\usepackage[fancyhdr,pdf]{latex2man}
+
+\input{common.tex}
+
+\begin{document}
+
+\begin{Name}{3}{unw\_get\_fpreg}{David Mosberger-Tang}{Programming Library}{unw\_get\_fpreg}unw\_get\_fpreg -- get contents of floating-point register
+\end{Name}
+
+\section{Synopsis}
+
+\File{\#include $<$libunwind.h$>$}\\
+
+\Type{int} \Func{unw\_get\_fpreg}(\Type{unw\_cursor\_t~*}\Var{cp}, \Type{unw\_regnum\_t} \Var{reg}, \Type{unw\_fpreg\_t~*}\Var{valp});\\
+
+\section{Description}
+
+The \Func{unw\_get\_fpreg}() routine reads the value of floating-point
+register \Var{reg} in the stack frame identified by cursor \Var{cp}
+and stores the value in the variable pointed to by \Var{valp}.
+
+The register numbering is target-dependent and described in separate
+manual pages (e.g., libunwind-ia64(3) for the IA-64 target).
+Furthermore, the exact set of accessible registers may depend on the
+type of frame that \Var{cp} is referring to.  For ordinary stack
+frames, it is normally possible to access only the preserved
+(``callee-saved'') registers and frame-related registers (such as the
+stack-pointer).  However, for signal frames (see
+\Func{unw\_is\_signal\_frame}(3)), it is usually possible to access
+all registers.
+
+Note that \Func{unw\_get\_fpreg}() can only read the contents of
+floating-point registers.  See \Func{unw\_get\_fpreg}(3) for a way to
+read registers which fit in a single word.
+
+\section{Return Value}
+
+On successful completion, \Func{unw\_get\_fpreg}() returns 0.
+Otherwise the negative value of one of the error-codes below is
+returned.
+
+\section{Thread and Signal Safety}
+
+\Func{unw\_get\_fpreg}() is thread-safe as well as safe to use
+from a signal handler.
+
+\section{Errors}
+
+\begin{Description}
+\item[\Const{UNW\_EUNSPEC}] An unspecified error occurred.
+\item[\Const{UNW\_EBADREG}] An attempt was made to read a register
+  that is either invalid or not accessible in the current frame.
+\end{Description}
+In addition, \Func{unw\_get\_fpreg}() may return any error returned by
+the \Func{access\_mem}(), \Func{access\_reg}(), and
+\Func{access\_fpreg}() call-backs (see
+\Func{unw\_create\_addr\_space}(3)).
+
+\section{See Also}
+
+\SeeAlso{libunwind(3)},
+\SeeAlso{libunwind-ia64(3)},
+\SeeAlso{unw\_get\_reg(3)},
+\SeeAlso{unw\_is\_fpreg(3)},
+\SeeAlso{unw\_is\_signal\_frame(3)},
+\SeeAlso{unw\_set\_fpreg(3)}
+
+\section{Author}
+
+\noindent
+David Mosberger-Tang\\
+Email: \Email{dmosberger@gmail.com}\\
+WWW: \URL{http://www.nongnu.org/libunwind/}.
+\LatexManEnd
+
+\end{document}
diff --git a/libunwind/doc/unw_get_proc_info.man b/libunwind/doc/unw_get_proc_info.man
new file mode 100644
index 0000000..09eadee
--- /dev/null
+++ b/libunwind/doc/unw_get_proc_info.man
@@ -0,0 +1,203 @@
+'\" t
+.\" Manual page created with latex2man on Thu Aug 16 09:44:44 MDT 2007
+.\" NOTE: This file is generated, DO NOT EDIT.
+.de Vb
+.ft CW
+.nf
+..
+.de Ve
+.ft R
+
+.fi
+..
+.TH "UNW\\_GET\\_PROC\\_INFO" "3" "16 August 2007" "Programming Library " "Programming Library "
+.SH NAME
+unw_get_proc_info
+\-\- get info on current procedure 
+.PP
+.SH SYNOPSIS
+
+.PP
+#include <libunwind.h>
+.br
+.PP
+int
+unw_get_proc_info(unw_cursor_t *cp,
+unw_proc_info_t *pip);
+.br
+.PP
+.SH DESCRIPTION
+
+.PP
+The unw_get_proc_info()
+routine returns auxiliary 
+information about the procedure that created the stack frame 
+identified by argument cp\&.
+The pip
+argument is a pointer 
+to a structure of type unw_proc_info_t
+which is used to 
+return the information. The unw_proc_info_t
+has the 
+following members: 
+.TP
+unw_word_t start_ip
+ The address of the first 
+instruction of the procedure. If this address cannot be determined 
+(e.g., due to lack of unwind information), the start_ip
+member is cleared to 0. 
+.br
+.TP
+unw_word_t end_ip
+ The address of the first 
+instruction \fIbeyond\fP
+the end of the procedure. If this address 
+cannot be determined (e.g., due to lack of unwind information), 
+the end_ip
+member is cleared to 0. 
+.br
+.TP
+unw_word_t lsda
+ The address of the 
+language\-specific data\-area (LSDA). This area normally contains 
+language\-specific information needed during exception handling. If 
+the procedure has no such area, this member is cleared to 0. 
+.br
+.TP
+unw_word_t handler
+ The address of the exception 
+handler routine. This is sometimes called the \fIpersonality\fP
+routine. If the procedure does not define 
+a personality routine, the handler
+member is cleared to 0. 
+.br
+.TP
+unw_word_t gp
+ The global\-pointer of the 
+procedure. On platforms that do not use a global pointer, this 
+member may contain an undefined value. On all other platforms, it 
+must be set either to the correct global\-pointer value of the 
+procedure or to 0 if the proper global\-pointer cannot be 
+obtained for some reason. 
+.br
+.TP
+unw_word_t flags
+ A set of flags. There are 
+currently no target\-independent flags. For the IA\-64 target, the 
+flag UNW_PI_FLAG_IA64_RBS_SWITCH
+is set if the 
+procedure may switch the register\-backing store.
+.br
+.TP
+int format
+ The format of the unwind\-info for this 
+procedure. If the unwind\-info consists of dynamic procedure info, 
+format
+is equal to UNW_INFO_FORMAT_DYNAMIC\&.
+If the 
+unwind\-info consists of a (target\-specific) unwind table, it is 
+equal to to UNW_INFO_FORMAT_TABLE\&.
+All other values are 
+reserved for future use by libunwind\&.
+This member exists 
+for use by the find_proc_info()
+call\-back (see 
+unw_create_addr_space(3)).
+The 
+unw_get_proc_info()
+routine 
+may return an undefined value in this member. 
+.br
+.TP
+int unwind_info_size
+ The size of the unwind\-info 
+in bytes. This member exists for use by the 
+find_proc_info()
+call\-back (see 
+unw_create_addr_space(3)).
+The 
+unw_get_proc_info()
+routine 
+may return an undefined value in this member.
+.br
+.TP
+void *unwind_info
+ The pointer to the unwind\-info. 
+If no unwind info is available, this member must be set to 
+NULL\&.
+This member exists for use by the 
+find_proc_info()
+call\-back (see 
+unw_create_addr_space(3)).
+The 
+unw_get_proc_info()
+routine 
+may return an undefined value in this member.
+.br
+.PP
+Note that for the purposes of libunwind,
+the code of a 
+procedure is assumed to occupy a single, contiguous range of 
+addresses. For this reason, it is alwas possible to describe the 
+extent of a procedure with the start_ip
+and end_ip
+members. If a single function/routine is split into multiple, 
+discontiguous pieces, libunwind
+will treat each piece as a 
+separate procedure. 
+.PP
+.SH RETURN VALUE
+
+.PP
+On successful completion, unw_get_proc_info()
+returns 0. 
+Otherwise the negative value of one of the error\-codes below is 
+returned. 
+.PP
+.SH THREAD AND SIGNAL SAFETY
+
+.PP
+unw_get_proc_info()
+is thread\-safe. If cursor cp
+is 
+in the local address\-space, this routine is also safe to use from a 
+signal handler. 
+.PP
+.SH ERRORS
+
+.PP
+.TP
+UNW_EUNSPEC
+ An unspecified error occurred. 
+.TP
+UNW_ENOINFO
+ Libunwind
+was unable to locate 
+unwind\-info for the procedure. 
+.TP
+UNW_EBADVERSION
+ The unwind\-info for the procedure has 
+version or format that is not understood by libunwind\&.
+.PP
+In addition, unw_get_proc_info()
+may return any error 
+returned by the access_mem()
+call\-back (see 
+unw_create_addr_space(3)).
+.PP
+.SH SEE ALSO
+
+.PP
+libunwind(3),
+unw_create_addr_space(3),
+unw_get_proc_name(3)
+.PP
+.SH AUTHOR
+
+.PP
+David Mosberger\-Tang
+.br
+Email: \fBdmosberger@gmail.com\fP
+.br
+WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
+.\" NOTE: This file is generated, DO NOT EDIT.
diff --git a/libunwind/doc/unw_get_proc_info.tex b/libunwind/doc/unw_get_proc_info.tex
new file mode 100644
index 0000000..72621f1
--- /dev/null
+++ b/libunwind/doc/unw_get_proc_info.tex
@@ -0,0 +1,123 @@
+\documentclass{article}
+\usepackage[fancyhdr,pdf]{latex2man}
+
+\input{common.tex}
+
+\begin{document}
+
+\begin{Name}{3}{unw\_get\_proc\_info}{David Mosberger-Tang}{Programming Library}{unw\_get\_proc\_info}unw\_get\_proc\_info -- get info on current procedure
+\end{Name}
+
+\section{Synopsis}
+
+\File{\#include $<$libunwind.h$>$}\\
+
+\Type{int} \Func{unw\_get\_proc\_info}(\Type{unw\_cursor\_t~*}\Var{cp}, \Type{unw\_proc\_info\_t~*}\Var{pip});\\
+
+\section{Description}
+
+The \Func{unw\_get\_proc\_info}() routine returns auxiliary
+information about the procedure that created the stack frame
+identified by argument \Var{cp}.  The \Var{pip} argument is a pointer
+to a structure of type \Type{unw\_proc\_info\_t} which is used to
+return the information.  The \Type{unw\_proc\_info\_t} has the
+following members:
+\begin{description}
+\item[\Type{unw\_word\_t} \Var{start\_ip}] The address of the first
+  instruction of the procedure.  If this address cannot be determined
+  (e.g., due to lack of unwind information), the \Var{start\_ip}
+  member is cleared to 0.  \\
+\item[\Type{unw\_word\_t} \Var{end\_ip}] The address of the first
+  instruction \emph{beyond} the end of the procedure.  If this address
+  cannot be determined (e.g., due to lack of unwind information),
+  the \Var{end\_ip} member is cleared to 0.  \\
+\item[\Type{unw\_word\_t} \Var{lsda}] The address of the
+  language-specific data-area (LSDA).  This area normally contains
+  language-specific information needed during exception handling.  If
+  the procedure has no such area, this member is cleared to 0.  \\
+\item[\Type{unw\_word\_t} \Var{handler}] The address of the exception
+  handler routine.  This is sometimes called the \emph{personality}
+  routine.  If the procedure does not define
+  a personality routine, the \Var{handler} member is cleared to 0.  \\
+\item[\Type{unw\_word\_t} \Var{gp}] The global-pointer of the
+  procedure.  On platforms that do not use a global pointer, this
+  member may contain an undefined value.  On all other platforms, it
+  must be set either to the correct global-pointer value of the
+  procedure or to 0 if the proper global-pointer cannot be
+  obtained for some reason.  \\
+\item[\Type{unw\_word\_t} \Var{flags}] A set of flags.  There are
+  currently no target-independent flags.  For the IA-64 target, the
+  flag \Const{UNW\_PI\_FLAG\_IA64\_RBS\_SWITCH} is set if the
+  procedure may switch the register-backing store.\\
+\item[\Type{int} \Var{format}] The format of the unwind-info for this
+  procedure.  If the unwind-info consists of dynamic procedure info,
+  \Var{format} is equal to \Const{UNW\_INFO\_FORMAT\_DYNAMIC}.  If the
+  unwind-info consists of a (target-specific) unwind table, it is
+  equal to to \Const{UNW\_INFO\_FORMAT\_TABLE}.  All other values are
+  reserved for future use by \Prog{libunwind}.  This member exists
+  for use by the \Func{find\_proc\_info}() call-back (see
+  \Func{unw\_create\_addr\_space}(3)).  The
+  \Func{unw\_get\_proc\_info}() routine
+  may return an undefined value in this member. \\
+\item[\Type{int} \Var{unwind\_info\_size}] The size of the unwind-info
+  in bytes.  This member exists for use by the
+  \Func{find\_proc\_info}() call-back (see
+  \Func{unw\_create\_addr\_space}(3)).  The
+  \Func{unw\_get\_proc\_info}() routine
+  may return an undefined value in this member.\\
+\item[\Type{void~*}\Var{unwind\_info}] The pointer to the unwind-info.
+  If no unwind info is available, this member must be set to
+  \Const{NULL}.  This member exists for use by the
+  \Func{find\_proc\_info}() call-back (see
+  \Func{unw\_create\_addr\_space}(3)).  The
+  \Func{unw\_get\_proc\_info}() routine
+  may return an undefined value in this member.\\
+\end{description}
+Note that for the purposes of \Prog{libunwind}, the code of a
+procedure is assumed to occupy a single, contiguous range of
+addresses.  For this reason, it is alwas possible to describe the
+extent of a procedure with the \Var{start\_ip} and \Var{end\_ip}
+members.  If a single function/routine is split into multiple,
+discontiguous pieces, \Prog{libunwind} will treat each piece as a
+separate procedure.
+
+\section{Return Value}
+
+On successful completion, \Func{unw\_get\_proc\_info}() returns 0.
+Otherwise the negative value of one of the error-codes below is
+returned.
+
+\section{Thread and Signal Safety}
+
+\Func{unw\_get\_proc\_info}() is thread-safe.  If cursor \Var{cp} is
+in the local address-space, this routine is also safe to use from a
+signal handler.
+
+\section{Errors}
+
+\begin{Description}
+\item[\Const{UNW\_EUNSPEC}] An unspecified error occurred.
+\item[\Const{UNW\_ENOINFO}] \Prog{Libunwind} was unable to locate
+  unwind-info for the procedure.
+\item[\Const{UNW\_EBADVERSION}] The unwind-info for the procedure has
+  version or format that is not understood by \Prog{libunwind}.
+\end{Description}
+In addition, \Func{unw\_get\_proc\_info}() may return any error
+returned by the \Func{access\_mem}() call-back (see
+\Func{unw\_create\_addr\_space}(3)).
+
+\section{See Also}
+
+\SeeAlso{libunwind(3)},
+\SeeAlso{unw\_create\_addr\_space(3)},
+\SeeAlso{unw\_get\_proc\_name(3)}
+
+\section{Author}
+
+\noindent
+David Mosberger-Tang\\
+Email: \Email{dmosberger@gmail.com}\\
+WWW: \URL{http://www.nongnu.org/libunwind/}.
+\LatexManEnd
+
+\end{document}
diff --git a/libunwind/doc/unw_get_proc_info_by_ip.man b/libunwind/doc/unw_get_proc_info_by_ip.man
new file mode 100644
index 0000000..a347a1d
--- /dev/null
+++ b/libunwind/doc/unw_get_proc_info_by_ip.man
@@ -0,0 +1,134 @@
+'\" t
+.\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007
+.\" NOTE: This file is generated, DO NOT EDIT.
+.de Vb
+.ft CW
+.nf
+..
+.de Ve
+.ft R
+
+.fi
+..
+.TH "UNW\\_GET\\_PROC\\_INFO\\_BY\\_IP" "3" "16 August 2007" "Programming Library " "Programming Library "
+.SH NAME
+unw_get_proc_info_by_ip
+\-\- get procedure info by IP 
+.PP
+.SH SYNOPSIS
+
+.PP
+#include <libunwind.h>
+.br
+.PP
+int
+unw_get_proc_info_by_ip(unw_addr_space_t as,
+unw_word_t ip,
+unw_proc_info_t *pip,
+void *arg);
+.br
+.PP
+.SH DESCRIPTION
+
+.PP
+The unw_get_proc_info_by_ip()
+routine returns the same 
+kind of auxiliary information about a procedure as 
+unw_get_proc_info(),
+except that the info is looked up by 
+instruction\-pointer (IP) instead of a cursor. This is more flexible 
+because it is possible to look up the info for an arbitrary procedure, 
+even if it is not part of the current call\-chain. However, since it 
+is more flexible, it also tends to run slower (and often much slower) 
+than unw_get_proc_info().
+.PP
+The routine expects the followins arguments: as
+is the 
+address\-space in which the instruction\-pointer should be looked up. 
+For a look\-up in the local address\-space, 
+unw_local_addr_space
+can be passed for this argument. 
+Argument ip
+is the instruction\-pointer for which the procedure 
+info should be looked up and pip
+is a pointer to a structure of 
+type unw_proc_info_t
+which is used to return the info. 
+Lastly, arg
+is the address\-space argument that should be used 
+when accessing the address\-space. It has the same purpose as the 
+argument of the same name for unw_init_remote().
+When 
+accessing the local address\-space (first argument is 
+unw_local_addr_space),
+NULL
+must be passed for this 
+argument. 
+.PP
+Note that for the purposes of libunwind,
+the code of a 
+procedure is assumed to occupy a single, contiguous range of 
+addresses. For this reason, it is alwas possible to describe the 
+extent of a procedure with the start_ip
+and end_ip
+members. If a single function/routine is split into multiple, 
+discontiguous pieces, libunwind
+will treat each piece as a 
+separate procedure. 
+.PP
+.SH RETURN VALUE
+
+.PP
+On successful completion, unw_get_proc_info_by_ip()
+returns 0. Otherwise the negative value of one of the error\-codes 
+below is returned. 
+.PP
+.SH THREAD AND SIGNAL SAFETY
+
+.PP
+unw_get_proc_info()
+is thread\-safe. If the local 
+address\-space is passed in argument as,
+this routine is also 
+safe to use from a signal handler. 
+.PP
+.SH ERRORS
+
+.PP
+.TP
+UNW_EUNSPEC
+ An unspecified error occurred. 
+.TP
+UNW_ENOINFO
+ Libunwind
+was unable to locate 
+unwind\-info for the procedure. 
+.TP
+UNW_EBADVERSION
+ The unwind\-info for the procedure has 
+version or format that is not understood by libunwind\&.
+.PP
+In addition, unw_get_proc_info()
+may return any error 
+returned by the access_mem()
+call\-back (see 
+unw_create_addr_space(3)).
+.PP
+.SH SEE ALSO
+
+.PP
+libunwind(3),
+unw_create_addr_space(3),
+unw_get_proc_name(3),
+unw_get_proc_info(3),
+unw_init_remote(3)
+.PP
+.SH AUTHOR
+
+.PP
+David Mosberger\-Tang
+.br
+Email: \fBdmosberger@gmail.com\fP
+.br
+WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
+.\" NOTE: This file is generated, DO NOT EDIT.
diff --git a/libunwind/doc/unw_get_proc_info_by_ip.tex b/libunwind/doc/unw_get_proc_info_by_ip.tex
new file mode 100644
index 0000000..5e1d5d2
--- /dev/null
+++ b/libunwind/doc/unw_get_proc_info_by_ip.tex
@@ -0,0 +1,91 @@
+\documentclass{article}
+\usepackage[fancyhdr,pdf]{latex2man}
+
+\input{common.tex}
+
+\begin{document}
+
+\begin{Name}{3}{unw\_get\_proc\_info\_by\_ip}{David Mosberger-Tang}{Programming Library}{unw\_get\_proc\_info\_by\_ip}unw\_get\_proc\_info\_by\_ip -- get procedure info by IP
+\end{Name}
+
+\section{Synopsis}
+
+\File{\#include $<$libunwind.h$>$}\\
+
+\Type{int} \Func{unw\_get\_proc\_info\_by\_ip}(\Type{unw\_addr\_space\_t~}\Var{as}, \Type{unw\_word\_t~}\Var{ip}, \Type{unw\_proc\_info\_t~*}\Var{pip}, \Type{void~*}\Var{arg});\\
+
+\section{Description}
+
+The \Func{unw\_get\_proc\_info\_by\_ip}() routine returns the same
+kind of auxiliary information about a procedure as
+\Func{unw\_get\_proc\_info}(), except that the info is looked up by
+instruction-pointer (IP) instead of a cursor.  This is more flexible
+because it is possible to look up the info for an arbitrary procedure,
+even if it is not part of the current call-chain.  However, since it
+is more flexible, it also tends to run slower (and often much slower)
+than \Func{unw\_get\_proc\_info}().
+
+The routine expects the followins arguments: \Var{as} is the
+address-space in which the instruction-pointer should be looked up.
+For a look-up in the local address-space,
+\Var{unw\_local\_addr\_space} can be passed for this argument.
+Argument \Var{ip} is the instruction-pointer for which the procedure
+info should be looked up and \Var{pip} is a pointer to a structure of
+type \Type{unw\_proc\_info\_t} which is used to return the info.
+Lastly, \Var{arg} is the address-space argument that should be used
+when accessing the address-space.  It has the same purpose as the
+argument of the same name for \Func{unw\_init\_remote}().  When
+accessing the local address-space (first argument is
+\Var{unw\_local\_addr\_space}), \Const{NULL} must be passed for this
+argument.
+
+Note that for the purposes of \Prog{libunwind}, the code of a
+procedure is assumed to occupy a single, contiguous range of
+addresses.  For this reason, it is alwas possible to describe the
+extent of a procedure with the \Var{start\_ip} and \Var{end\_ip}
+members.  If a single function/routine is split into multiple,
+discontiguous pieces, \Prog{libunwind} will treat each piece as a
+separate procedure.
+
+\section{Return Value}
+
+On successful completion, \Func{unw\_get\_proc\_info\_by\_ip}()
+returns 0.  Otherwise the negative value of one of the error-codes
+below is returned.
+
+\section{Thread and Signal Safety}
+
+\Func{unw\_get\_proc\_info}() is thread-safe.  If the local
+address-space is passed in argument \Var{as}, this routine is also
+safe to use from a signal handler.
+
+\section{Errors}
+
+\begin{Description}
+\item[\Const{UNW\_EUNSPEC}] An unspecified error occurred.
+\item[\Const{UNW\_ENOINFO}] \Prog{Libunwind} was unable to locate
+  unwind-info for the procedure.
+\item[\Const{UNW\_EBADVERSION}] The unwind-info for the procedure has
+  version or format that is not understood by \Prog{libunwind}.
+\end{Description}
+In addition, \Func{unw\_get\_proc\_info}() may return any error
+returned by the \Func{access\_mem}() call-back (see
+\Func{unw\_create\_addr\_space}(3)).
+
+\section{See Also}
+
+\SeeAlso{libunwind(3)},
+\SeeAlso{unw\_create\_addr\_space(3)},
+\SeeAlso{unw\_get\_proc\_name(3)},
+\SeeAlso{unw\_get\_proc\_info(3)},
+\SeeAlso{unw\_init\_remote(3)}
+
+\section{Author}
+
+\noindent
+David Mosberger-Tang\\
+Email: \Email{dmosberger@gmail.com}\\
+WWW: \URL{http://www.nongnu.org/libunwind/}.
+\LatexManEnd
+
+\end{document}
diff --git a/libunwind/doc/unw_get_proc_name.man b/libunwind/doc/unw_get_proc_name.man
new file mode 100644
index 0000000..8b2bd06
--- /dev/null
+++ b/libunwind/doc/unw_get_proc_name.man
@@ -0,0 +1,123 @@
+'\" t
+.\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007
+.\" NOTE: This file is generated, DO NOT EDIT.
+.de Vb
+.ft CW
+.nf
+..
+.de Ve
+.ft R
+
+.fi
+..
+.TH "UNW\\_GET\\_PROC\\_NAME" "3" "16 August 2007" "Programming Library " "Programming Library "
+.SH NAME
+unw_get_proc_name
+\-\- get name of current procedure 
+.PP
+.SH SYNOPSIS
+
+.PP
+#include <libunwind.h>
+.br
+.PP
+int
+unw_get_proc_name(unw_cursor_t *cp,
+char *bufp,
+size_t
+len,
+unw_word_t *offp);
+.br
+.PP
+.SH DESCRIPTION
+
+.PP
+The unw_get_proc_name()
+routine returns the name of the 
+procedure that created the stack frame identified by argument 
+cp\&.
+The bufp
+argument is a pointer to a character buffer 
+that is at least len
+bytes long. This buffer is used to return 
+the name of the procedure. The offp
+argument is a pointer to a 
+word that is used to return the byte\-offset of the instruction\-pointer 
+saved in the stack frame identified by cp,
+relative to the start 
+of the procedure. For example, if procedure foo()
+starts at 
+address 0x40003000, then invoking unw_get_proc_name()
+on a 
+stack frame with an instruction\-pointer value of 0x40003080 would 
+return a value of 0x80 in the word pointed to by offp
+(assuming 
+the procedure is at least 0x80 bytes long). 
+.PP
+Note that on some platforms there is no reliable way to distinguish 
+between procedure names and ordinary labels. Furthermore, if symbol 
+information has been stripped from a program, procedure names may be 
+completely unavailable or may be limited to those exported via a 
+dynamic symbol table. In such cases, unw_get_proc_name()
+may return the name of a label or a preceeding (nearby) procedure. 
+However, the offset returned through offp
+is always relative to 
+the returned name, which ensures that the value (address) of the 
+returned name plus the returned offset will always be equal to the 
+instruction\-pointer of the stack frame identified by cp\&.
+.PP
+.SH RETURN VALUE
+
+.PP
+On successful completion, unw_get_proc_name()
+returns 0. 
+Otherwise the negative value of one of the error\-codes below is 
+returned. 
+.PP
+.SH THREAD AND SIGNAL SAFETY
+
+.PP
+unw_get_proc_name()
+is thread\-safe. If cursor cp
+is 
+in the local address\-space, this routine is also safe to use from a 
+signal handler. 
+.PP
+.SH ERRORS
+
+.PP
+.TP
+UNW_EUNSPEC
+ An unspecified error occurred. 
+.TP
+UNW_ENOINFO
+ Libunwind
+was unable to determine 
+the name of the procedure. 
+.TP
+UNW_ENOMEM
+ The procedure name is too long to fit 
+in the buffer provided. A truncated version of the name has been 
+returned. 
+.PP
+In addition, unw_get_proc_name()
+may return any error 
+returned by the access_mem()
+call\-back (see 
+unw_create_addr_space(3)).
+.PP
+.SH SEE ALSO
+
+.PP
+libunwind(3),
+unw_get_proc_info(3)
+.PP
+.SH AUTHOR
+
+.PP
+David Mosberger\-Tang
+.br
+Email: \fBdmosberger@gmail.com\fP
+.br
+WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
+.\" NOTE: This file is generated, DO NOT EDIT.
diff --git a/libunwind/doc/unw_get_proc_name.tex b/libunwind/doc/unw_get_proc_name.tex
new file mode 100644
index 0000000..c413990
--- /dev/null
+++ b/libunwind/doc/unw_get_proc_name.tex
@@ -0,0 +1,82 @@
+\documentclass{article}
+\usepackage[fancyhdr,pdf]{latex2man}
+
+\input{common.tex}
+
+\begin{document}
+
+\begin{Name}{3}{unw\_get\_proc\_name}{David Mosberger-Tang}{Programming Library}{unw\_get\_proc\_name}unw\_get\_proc\_name -- get name of current procedure
+\end{Name}
+
+\section{Synopsis}
+
+\File{\#include $<$libunwind.h$>$}\\
+
+\Type{int} \Func{unw\_get\_proc\_name}(\Type{unw\_cursor\_t~*}\Var{cp}, \Type{char~*}\Var{bufp}, \Type{size\_t} \Var{len}, \Type{unw\_word\_t~*}\Var{offp});\\
+
+\section{Description}
+
+The \Func{unw\_get\_proc\_name}() routine returns the name of the
+procedure that created the stack frame identified by argument
+\Var{cp}.  The \Var{bufp} argument is a pointer to a character buffer
+that is at least \Var{len} bytes long.  This buffer is used to return
+the name of the procedure.  The \Var{offp} argument is a pointer to a
+word that is used to return the byte-offset of the instruction-pointer
+saved in the stack frame identified by \Var{cp}, relative to the start
+of the procedure.  For example, if procedure \Func{foo}() starts at
+address 0x40003000, then invoking \Func{unw\_get\_proc\_name}() on a
+stack frame with an instruction-pointer value of 0x40003080 would
+return a value of 0x80 in the word pointed to by \Var{offp} (assuming
+the procedure is at least 0x80 bytes long).
+
+Note that on some platforms there is no reliable way to distinguish
+between procedure names and ordinary labels.  Furthermore, if symbol
+information has been stripped from a program, procedure names may be
+completely unavailable or may be limited to those exported via a
+dynamic symbol table.  In such cases, \Func{unw\_get\_proc\_name}()
+may return the name of a label or a preceeding (nearby) procedure.
+However, the offset returned through \Var{offp} is always relative to
+the returned name, which ensures that the value (address) of the
+returned name plus the returned offset will always be equal to the
+instruction-pointer of the stack frame identified by \Var{cp}.
+
+\section{Return Value}
+
+On successful completion, \Func{unw\_get\_proc\_name}() returns 0.
+Otherwise the negative value of one of the error-codes below is
+returned.
+
+\section{Thread and Signal Safety}
+
+\Func{unw\_get\_proc\_name}() is thread-safe.  If cursor \Var{cp} is
+in the local address-space, this routine is also safe to use from a
+signal handler.
+
+\section{Errors}
+
+\begin{Description}
+\item[\Const{UNW\_EUNSPEC}] An unspecified error occurred.
+\item[\Const{UNW\_ENOINFO}] \Prog{Libunwind} was unable to determine
+  the name of the procedure.
+\item[\Const{UNW\_ENOMEM}] The procedure name is too long to fit
+  in the buffer provided.  A truncated version of the name has been
+  returned.
+\end{Description}
+In addition, \Func{unw\_get\_proc\_name}() may return any error
+returned by the \Func{access\_mem}() call-back (see
+\Func{unw\_create\_addr\_space}(3)).
+
+\section{See Also}
+
+\SeeAlso{libunwind(3)},
+\SeeAlso{unw\_get\_proc\_info(3)}
+
+\section{Author}
+
+\noindent
+David Mosberger-Tang\\
+Email: \Email{dmosberger@gmail.com}\\
+WWW: \URL{http://www.nongnu.org/libunwind/}.
+\LatexManEnd
+
+\end{document}
diff --git a/libunwind/doc/unw_get_reg.man b/libunwind/doc/unw_get_reg.man
new file mode 100644
index 0000000..83e8bb4
--- /dev/null
+++ b/libunwind/doc/unw_get_reg.man
@@ -0,0 +1,112 @@
+'\" t
+.\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007
+.\" NOTE: This file is generated, DO NOT EDIT.
+.de Vb
+.ft CW
+.nf
+..
+.de Ve
+.ft R
+
+.fi
+..
+.TH "UNW\\_GET\\_REG" "3" "16 August 2007" "Programming Library " "Programming Library "
+.SH NAME
+unw_get_reg
+\-\- get register contents 
+.PP
+.SH SYNOPSIS
+
+.PP
+#include <libunwind.h>
+.br
+.PP
+int
+unw_get_reg(unw_cursor_t *cp,
+unw_regnum_t
+reg,
+unw_word_t *valp);
+.br
+.PP
+.SH DESCRIPTION
+
+.PP
+The unw_get_reg()
+routine reads the value of register 
+reg
+in the stack frame identified by cursor cp
+and stores 
+the value in the word pointed to by valp\&.
+.PP
+The register numbering is target\-dependent and described in separate 
+manual pages (e.g., libunwind\-ia64(3) for the IA\-64 target). 
+Furthermore, the exact set of accessible registers may depend on the 
+type of frame that cp
+is referring to. For ordinary stack 
+frames, it is normally possible to access only the preserved 
+(``callee\-saved\&'') registers and frame\-related registers (such as the 
+stack\-pointer). However, for signal frames (see 
+unw_is_signal_frame(3)),
+it is usually possible to access 
+all registers. 
+.PP
+Note that unw_get_reg()
+can only read the contents of 
+registers whose values fit in a single word. See 
+unw_get_fpreg(3)
+for a way to read registers which do not fit 
+this constraint. 
+.PP
+.SH RETURN VALUE
+
+.PP
+On successful completion, unw_get_reg()
+returns 0. 
+Otherwise the negative value of one of the error\-codes below is 
+returned. 
+.PP
+.SH THREAD AND SIGNAL SAFETY
+
+.PP
+unw_get_reg()
+is thread\-safe as well as safe to use 
+from a signal handler. 
+.PP
+.SH ERRORS
+
+.PP
+.TP
+UNW_EUNSPEC
+ An unspecified error occurred. 
+.TP
+UNW_EBADREG
+ An attempt was made to read a register 
+that is either invalid or not accessible in the current frame. 
+.PP
+In addition, unw_get_reg()
+may return any error returned by 
+the access_mem(),
+access_reg(),
+and 
+access_fpreg()
+call\-backs (see 
+unw_create_addr_space(3)).
+.PP
+.SH SEE ALSO
+
+.PP
+libunwind(3),
+libunwind\-ia64(3),
+unw_get_fpreg(3),
+unw_is_signal_frame(3),
+unw_set_reg(3)
+.PP