summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Blandy <jimb@redhat.com>2004-11-23 06:02:18 +0000
committerJim Blandy <jimb@redhat.com>2004-11-23 06:02:18 +0000
commit76264cb4f8639177e489662a1581283cf6a29657 (patch)
treedcee9fbe17c222b159d39226cf71421448ccad04
parentefb9469a88c9676a264da8700762ac0fde29163a (diff)
downloadgdb-76264cb4f8639177e489662a1581283cf6a29657.tar.gz
Separate management of kernel-level LWPs from that of libpthread /
libthread_db-level threads. * lwp-pool.c, lwp-pool.h: New files. * thread-db.c: #include "lwp-ctrl.h" and "lwp-pool.h". (struct gdbserv_thread): Delete members 'attached', 'stopped', 'waited', and 'stepping'. This structure is now just a 'td_thrinfo_t' and a list link. Describe some quirks in the meanings of certain 'ti' fields. (thread_list_lookup_by_lid): Move later in file, so we can use information directly from our proc handle. Be skeptical of ZOMBIE or UNKNOWN threads whose LWP ID is equal to the PID in the proc handle. (thread_debug_name): Move later in file, so we can use thread_db_state_str. (attach_thread): Use lwp pool functions to attach. Attach to zombies. When using signal-based communication, send the thread the restart signal immediately. (find_new_threads_callback): Go ahead and attach to all threads. The LWP pool functions tolerate attaching to a given LWP more than once. (update_thread_list): Take the process as an argument. If the focus thread has disappeared, set process->focus_thread to NULL. (thread_db_thread_next): Pass the process to update_thread_list. (stop_thread, stop_all_threads, add_pending_event, delete_pending_event, select_pending_event, send_pending_signals, wait_all_threads, continue_all_threads): Deleted. (handle_thread_db_event): Renamed from handle_thread_db_events. Take the process structure as an argument, and check only for a thread-db event notification from process->event_thread. Use LWP pool functions. (continue_thread, singlestep_thread): Use LWP pool functions. (thread_db_continue_program, thread_db_singlestep_program, thread_db_continue_thread, thread_db_singlestep_thread): Use LWP pool functions, and update process->focus_thread appropriately. (thread_db_check_child_state): Use the LWP pool functions. Rather than stopping all LWP's, choosing the most interesting events, and then arranging to re-create all the other wait statuses we got, just pick the first event we get from lwp_pool_waitpid (either on the focus thread, if there is one, or on any thread) and report that. Use the new handle_thread_db_event function. (struct event_list, pending_events, pending_events_listsize, pending_events_top): Deleted; replaced by LWP pool code. (thread_db_attach): Tell the LWP pool about the PID we're attaching to. Clear the focus thread. * server.h (struct process): New member: 'focus_thread'. * gdbserv-thread-db.h (continue_lwp, singlestep_lwp, attach_lwp, stop_lwp): Move declarations from here... * lwp-ctrl.h: ... to here. New file. (kill_lwp): Renamed from stop_lwp; allow caller to specify any signal. * ptrace-target.c: #include "lwp-ctrl.h". (continue_lwp, singlestep_lwp, attach_lwp, stop_lwp): Move function comments to lwp-ctrl.h, and expand. * configure.in: Whenever we select 'thread-db.o', select 'lwp-pool.o' as well. * configure: Regenerated. * thread-db.c (thread_db_check_child_state): Remove extraneous call to handle_waitstatus. Remove extra check for exited main thread. * thread-db.c (thread_db_thread_info): List the type and state before the PID, and mention whether the LWP's PID is equal to that of the main thread, since ZOMBIE and UNKNOWN threads whose LWP's PID is equal are probably actually exited threads. * thread-db.c (add_thread_to_list): Zero out entire structure. * thread-db.c (thread_db_state_str, thread_db_type_str): Remove spaces from names; we don't always want them, and the caller can use printf formatting directives to arrange things as they please. * ptrace-target.c (continue_lwp, singlestep_lwp, attach_lwp, stop_lwp): Change arguments from 'lwpid_t' to 'pid_t'. lwpid_t is strictly a thread-db type; these are functions that use system calls, which all expect pid_t. Rename arguments from 'lwpid' to 'pid'. * ptrace-target.c: #define _GNU_SOURCE to get declaration for strsignal. (kill_lwp): Enhance error reporting.
-rw-r--r--rda/unix/ChangeLog84
-rwxr-xr-xrda/unix/configure6379
-rw-r--r--rda/unix/configure.in225
-rw-r--r--rda/unix/gdbserv-thread-db.h12
-rw-r--r--rda/unix/lwp-ctrl.h61
-rw-r--r--rda/unix/lwp-pool.c1468
-rw-r--r--rda/unix/lwp-pool.h173
-rw-r--r--rda/unix/ptrace-target.c90
-rw-r--r--rda/unix/server.h95
-rw-r--r--rda/unix/thread-db.c892
10 files changed, 8821 insertions, 658 deletions
diff --git a/rda/unix/ChangeLog b/rda/unix/ChangeLog
index dcb7a42ff72..7cd0629e788 100644
--- a/rda/unix/ChangeLog
+++ b/rda/unix/ChangeLog
@@ -1,3 +1,87 @@
+2004-11-23 Jim Blandy <jimb@redhat.com>
+
+ Separate management of kernel-level LWPs from that of libpthread /
+ libthread_db-level threads.
+ * lwp-pool.c, lwp-pool.h: New files.
+ * thread-db.c: #include "lwp-ctrl.h" and "lwp-pool.h".
+ (struct gdbserv_thread): Delete members 'attached', 'stopped',
+ 'waited', and 'stepping'. This structure is now just a
+ 'td_thrinfo_t' and a list link. Describe some quirks in the
+ meanings of certain 'ti' fields.
+ (thread_list_lookup_by_lid): Move later in file, so we can use
+ information directly from our proc handle. Be skeptical of ZOMBIE
+ or UNKNOWN threads whose LWP ID is equal to the PID in the proc
+ handle.
+ (thread_debug_name): Move later in file, so we can use
+ thread_db_state_str.
+ (attach_thread): Use lwp pool functions to attach. Attach to
+ zombies. When using signal-based communication, send the thread
+ the restart signal immediately.
+ (find_new_threads_callback): Go ahead and attach to all threads.
+ The LWP pool functions tolerate attaching to a given LWP more than
+ once.
+ (update_thread_list): Take the process as an argument. If the
+ focus thread has disappeared, set process->focus_thread to NULL.
+ (thread_db_thread_next): Pass the process to update_thread_list.
+ (stop_thread, stop_all_threads, add_pending_event,
+ delete_pending_event, select_pending_event, send_pending_signals,
+ wait_all_threads, continue_all_threads): Deleted.
+ (handle_thread_db_event): Renamed from handle_thread_db_events.
+ Take the process structure as an argument, and check only for a
+ thread-db event notification from process->event_thread. Use LWP
+ pool functions.
+ (continue_thread, singlestep_thread): Use LWP pool functions.
+ (thread_db_continue_program, thread_db_singlestep_program,
+ thread_db_continue_thread, thread_db_singlestep_thread): Use LWP
+ pool functions, and update process->focus_thread appropriately.
+ (thread_db_check_child_state): Use the LWP pool functions. Rather
+ than stopping all LWP's, choosing the most interesting events, and
+ then arranging to re-create all the other wait statuses we got,
+ just pick the first event we get from lwp_pool_waitpid (either on
+ the focus thread, if there is one, or on any thread) and report
+ that. Use the new handle_thread_db_event function.
+ (struct event_list, pending_events, pending_events_listsize,
+ pending_events_top): Deleted; replaced by LWP pool code.
+ (thread_db_attach): Tell the LWP pool about the PID we're
+ attaching to. Clear the focus thread.
+ * server.h (struct process): New member: 'focus_thread'.
+ * gdbserv-thread-db.h (continue_lwp, singlestep_lwp, attach_lwp,
+ stop_lwp): Move declarations from here...
+ * lwp-ctrl.h: ... to here. New file.
+ (kill_lwp): Renamed from stop_lwp; allow caller to specify any
+ signal.
+ * ptrace-target.c: #include "lwp-ctrl.h".
+ (continue_lwp, singlestep_lwp, attach_lwp, stop_lwp): Move
+ function comments to lwp-ctrl.h, and expand.
+ * configure.in: Whenever we select 'thread-db.o', select
+ 'lwp-pool.o' as well.
+ * configure: Regenerated.
+
+ * thread-db.c (thread_db_check_child_state): Remove extraneous
+ call to handle_waitstatus. Remove extra check for exited main
+ thread.
+
+ * thread-db.c (thread_db_thread_info): List the type and state
+ before the PID, and mention whether the LWP's PID is equal to that
+ of the main thread, since ZOMBIE and UNKNOWN threads whose LWP's
+ PID is equal are probably actually exited threads.
+
+ * thread-db.c (add_thread_to_list): Zero out entire structure.
+
+ * thread-db.c (thread_db_state_str, thread_db_type_str): Remove
+ spaces from names; we don't always want them, and the caller can
+ use printf formatting directives to arrange things as they please.
+
+ * ptrace-target.c (continue_lwp, singlestep_lwp, attach_lwp,
+ stop_lwp): Change arguments from 'lwpid_t' to 'pid_t'. lwpid_t is
+ strictly a thread-db type; these are functions that use system
+ calls, which all expect pid_t. Rename arguments from 'lwpid' to
+ 'pid'.
+
+ * ptrace-target.c: #define _GNU_SOURCE to get declaration for
+ strsignal.
+ (kill_lwp): Enhance error reporting.
+
2004-11-01 Jim Blandy <jimb@redhat.com>
* thread-db.c (delete_pending_event): Fix bounds-check assertion.
diff --git a/rda/unix/configure b/rda/unix/configure
new file mode 100755
index 00000000000..1dcf7bc726d
--- /dev/null
+++ b/rda/unix/configure
@@ -0,0 +1,6379 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.57.
+#
+# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+# Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+
+# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
+ else
+ as_ln_s='ln -s'
+ fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_config_libobj_dir=.
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete. It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+# Identity of this package.
+PACKAGE_NAME=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+
+ac_unique_file="server.h"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+# include <stdint.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LN_S RANLIB ac_ct_RANLIB LIBTOOL CPP EGREP TARGET_MODULES LIBOBJS LTLIBOBJS'
+ac_subst_files=''
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+ac_prev=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_option in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ eval "enable_$ac_feature=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_$ac_feature='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_$ac_package='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package | sed 's/-/_/g'`
+ eval "with_$ac_package=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; }
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+ { (exit 1); exit 1; }; }
+ ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+ eval "$ac_envvar='$ac_optarg'"
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ { echo "$as_me: error: missing argument to $ac_option" >&2
+ { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+ localstatedir libdir includedir oldincludedir infodir mandir
+do
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$0" : 'X\(//\)[^/]' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+ { (exit 1); exit 1; }; }
+ else
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+ { (exit 1); exit 1; }; }
+ fi
+fi
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+ { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+ { (exit 1); exit 1; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures this package to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+
+ cat <<_ACEOF
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --infodir=DIR info documentation [PREFIX/info]
+ --mandir=DIR man documentation [PREFIX/man]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
+ --target=TARGET configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer
+ --enable-shared=PKGS build shared libraries default=yes
+ --enable-static=PKGS build static libraries default=yes
+ --enable-fast-install=PKGS optimize for fast installation default=yes
+ --disable-dependency-tracking Speeds up one-time builds
+ --enable-dependency-tracking Do not reject slow dependency extractors
+ --disable-libtool-lock avoid locking (might break parallel builds)
+ --enable-arm32=yes to force arm to 32 bit compilation
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-gnu-ld assume the C compiler uses GNU ld default=no
+ --with-pic try to use only PIC/non-PIC objects default=use both
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
+ headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_ACEOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ ac_popdir=`pwd`
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d $ac_dir || continue
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+ cd $ac_dir
+ # Check for guested configure; otherwise get Cygnus style configure.
+ if test -f $ac_srcdir/configure.gnu; then
+ echo
+ $SHELL $ac_srcdir/configure.gnu --help=recursive
+ elif test -f $ac_srcdir/configure; then
+ echo
+ $SHELL $ac_srcdir/configure --help=recursive
+ elif test -f $ac_srcdir/configure.ac ||
+ test -f $ac_srcdir/configure.in; then
+ echo
+ $ac_configure --help
+ else
+ echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi
+ cd $ac_popdir
+ done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+ cat <<\_ACEOF
+
+Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit 0
+fi
+exec 5>config.log
+cat >&5 <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by $as_me, which was
+generated by GNU Autoconf 2.57. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ echo "PATH: $as_dir"
+done
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_sep=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+ 2)
+ ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+ # Get rid of the leading space.
+ ac_sep=" "
+ ;;
+ esac
+ done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+{
+ (set) 2>&1 |
+ case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ sed -n \
+ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+ ;;
+ *)
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+}
+ echo
+
+ cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ cat <<\_ASBOX
+## ------------- ##
+## Output files. ##
+## ------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+ echo
+ sed "/^$/d" confdefs.h | sort
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ echo "$as_me: caught signal $ac_signal"
+ echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core core.* *.core &&
+ rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+ ' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . $cache_file;;
+ *) . ./$cache_file;;
+ esac
+ fi
+else
+ { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+ eval ac_new_val="\$ac_env_${ac_var}_value"
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
+echo "$as_me: former value: $ac_old_val" >&2;}
+ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
+echo "$as_me: current value: $ac_new_val" >&2;}
+ ac_cache_corrupted=:
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f $ac_dir/shtool; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+
+# Make sure we can run config.sub.
+$ac_config_sub sun4 >/dev/null 2>&1 ||
+ { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
+echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+ { (exit 1); exit 1; }; }
+
+echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6
+if test "${ac_cv_build+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_build_alias=$build_alias
+test -z "$ac_cv_build_alias" &&
+ ac_cv_build_alias=`$ac_config_guess`
+test -z "$ac_cv_build_alias" &&
+ { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+ { (exit 1); exit 1; }; }
+ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6
+build=$ac_cv_build
+build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6
+if test "${ac_cv_host+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_host_alias=$host_alias
+test -z "$ac_cv_host_alias" &&
+ ac_cv_host_alias=$ac_cv_build_alias
+ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6
+host=$ac_cv_host
+host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking target system type" >&5
+echo $ECHO_N "checking target system type... $ECHO_C" >&6
+if test "${ac_cv_target+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_target_alias=$target_alias
+test "x$ac_cv_target_alias" = "x" &&
+ ac_cv_target_alias=$ac_cv_host_alias
+ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_target" >&5
+echo "${ECHO_T}$ac_cv_target" >&6
+target=$ac_cv_target
+target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+# case "$target" in
+# sh-*) CC=sh-linux-gnu-gcc;;
+# esac
+am__api_version="1.7"
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+done
+
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL=$ac_install_sh
+ fi
+fi
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&5
+echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+test "$program_prefix" != NONE &&
+ program_transform_name="s,^,$program_prefix,;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s,\$,$program_suffix,;$program_transform_name"
+# Double any \ or $. echo might interpret backslashes.
+# By default was `s,x,x', remove it if useless.
+cat <<\_ACEOF >conftest.sed
+s/[\\$]/&&/g;s/;s,x,x,$//
+_ACEOF
+program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
+rm conftest.sed
+
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AWK+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AWK="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$AWK" && break
+done
+
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.make <<\_ACEOF
+all:
+ @echo 'ac_maketemp="$(MAKE)"'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+ eval ac_cv_prog_make_${ac_make}_set=yes
+else
+ eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftest.make
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ SET_MAKE=
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+ # test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+ test -f $srcdir/config.status; then
+ { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE=rda
+ VERSION=0.1
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ STRIP=$ac_ct_STRIP
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+
+
+
+ ac_config_headers="$ac_config_headers config.h:config.in"
+
+
+echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6
+ # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then
+ enableval="$enable_maintainer_mode"
+ USE_MAINTAINER_MODE=$enableval
+else
+ USE_MAINTAINER_MODE=no
+fi;
+ echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
+echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6
+
+
+if test $USE_MAINTAINER_MODE = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
+else
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
+fi
+
+ MAINT=$MAINTAINER_MODE_TRUE
+
+
+# Check whether --enable-shared or --disable-shared was given.
+if test "${enable_shared+set}" = set; then
+ enableval="$enable_shared"
+ p=${PACKAGE-default}
+case $enableval in
+yes) enable_shared=yes ;;
+no) enable_shared=no ;;
+*)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+else
+ enable_shared=yes
+fi;
+# Check whether --enable-static or --disable-static was given.
+if test "${enable_static+set}" = set; then
+ enableval="$enable_static"
+ p=${PACKAGE-default}
+case $enableval in
+yes) enable_static=yes ;;
+no) enable_static=no ;;
+*)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+else
+ enable_static=yes
+fi;
+# Check whether --enable-fast-install or --disable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+ enableval="$enable_fast_install"
+ p=${PACKAGE-default}
+case $enableval in
+yes) enable_fast_install=yes ;;
+no) enable_fast_install=no ;;
+*)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+else
+ enable_fast_install=yes
+fi;
+DEPDIR="${am__leading_dot}deps"
+
+ ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
+fi
+
+
+echo "$as_me:$LINENO: result: $_am_result" >&5
+echo "${ECHO_T}$_am_result" >&6
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+ enableval="$enable_dependency_tracking"
+
+fi;
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+
+
+if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$ac_ct_CC" && break
+done
+
+ CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+ "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+echo "$as_me:$LINENO: checking for C compiler default output" >&5
+echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+ (eval $ac_link_default) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Find the output, starting from the most likely. This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+ ;;
+ conftest.$ac_ext )
+ # This is the source file.
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ # FIXME: I believe we export ac_cv_exeext for Libtool,
+ # but it would be cool to find out if it's true. Does anybody
+ # maintain Libtool? --akim.
+ export ac_cv_exeext
+ break;;
+ * )
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ fi
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ export ac_cv_exeext
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cc_g=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi
+# Ultrix and OSF/1 -std1
+# HP-UX 10.20 and later -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+ x|xno)
+ echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+ *)
+ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+ CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# Some people use a C++ compiler to compile C. Since we use `exit',
+# in C++ we need to declare it. In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+ choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ for ac_declaration in \
+ ''\
+ '#include <stdlib.h>' \
+ 'extern "C" void std::exit (int) throw (); using std::exit;' \
+ 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
+do
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
+fi
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CC" am_compiler_list=
+
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ : > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored.
+ if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+
+
+if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+
+# Check whether --with-gnu-ld or --without-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+ withval="$with_gnu_ld"
+ test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi;
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ echo "$as_me:$LINENO: checking for ld used by GCC" >&5
+echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | [A-Za-z]:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the path of ld
+ ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
+else
+ echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -z "$LD"; then
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+ test "$with_gnu_ld" != no && break
+ else
+ test "$with_gnu_ld" != yes && break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+ { (exit 1); exit 1; }; }
+echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+ lt_cv_prog_gnu_ld=yes
+else
+ lt_cv_prog_gnu_ld=no
+fi
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
+echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6
+if test "${lt_cv_ld_reload_flag+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_ld_reload_flag='-r'
+fi
+echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
+echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6
+reload_flag=$lt_cv_ld_reload_flag
+test -n "$reload_flag" && reload_flag=" $reload_flag"
+
+echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
+echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6
+if test "${lt_cv_path_NM+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+ for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm=$ac_dir/${ac_tool_prefix}nm
+ if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ else
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi
+fi
+
+NM="$lt_cv_path_NM"
+echo "$as_me:$LINENO: result: $NM" >&5
+echo "${ECHO_T}$NM" >&6
+
+echo "$as_me:$LINENO: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+ echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6
+fi
+
+echo "$as_me:$LINENO: checking how to recognise dependant libraries" >&5
+echo $ECHO_N "checking how to recognise dependant libraries... $ECHO_C" >&6
+if test "${lt_cv_deplibs_check_method+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [regex]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given egrep regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi4*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin* | mingw* |pw32*)
+ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ case "$host_os" in
+ rhapsody* | darwin1.012)
+ lt_cv_file_magic_test_file='/System/Library/Frameworks/System.framework/System'
+ ;;
+ *) # Darwin 1.3 on
+ lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
+ ;;
+ esac
+ ;;
+
+freebsd* | kfreebsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20*|hpux11*)
+ case $host_cpu in
+ hppa*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ esac
+ ;;
+
+irix5* | irix6*)
+ case $host_os in
+ irix5*)
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
+ ;;
+ *)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
+ ;;
+ esac
+ lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux-gnu*)
+ case $host_cpu in
+ alpha* | mips* | hppa* | i*86 | powerpc* | sparc* | ia64* )
+ lt_cv_deplibs_check_method=pass_all ;;
+ *)
+ # glibc up to 2.1.1 does not perform some relocations on ARM
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
+ esac
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
+netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'
+ fi
+ ;;
+
+newsos6)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+osf3* | osf4* | osf5*)
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sco3.2v5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+
+sysv5uw[78]* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ case $host_vendor in
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ esac
+ ;;
+esac
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
+echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+
+
+
+
+
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
+echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case $MAGIC_CMD in
+ /*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
+ ;;
+ *)
+ ac_save_MAGIC_CMD="$MAGIC_CMD"
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="/usr/bin:$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/${ac_tool_prefix}file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ egrep "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ MAGIC_CMD="$ac_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ echo "$as_me:$LINENO: checking for file" >&5
+echo $ECHO_N "checking for file... $ECHO_C" >&6
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case $MAGIC_CMD in
+ /*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
+ ;;
+ *)
+ ac_save_MAGIC_CMD="$MAGIC_CMD"
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="/usr/bin:$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ egrep "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ MAGIC_CMD="$ac_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ else
+ MAGIC_CMD=:
+ fi
+fi
+
+ fi
+ ;;
+esac
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ RANLIB=$ac_ct_RANLIB
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ STRIP=$ac_ct_STRIP
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+
+# Check for any special flags to pass to ltconfig.
+libtool_flags="--cache-file=$cache_file"
+test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
+test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
+test "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc"
+test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
+
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+ enableval="$enable_libtool_lock"
+
+fi;
+test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
+test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
+
+
+# Check whether --with-pic or --without-pic was given.
+if test "${with_pic+set}" = set; then
+ withval="$with_pic"
+ pic_mode="$withval"
+else
+ pic_mode=default
+fi;
+test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic"
+test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '#line 3569 "configure"' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case "`/usr/bin/file conftest.o`" in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
+echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6
+if test "${lt_cv_cc_needs_belf+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ lt_cv_cc_needs_belf=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+lt_cv_cc_needs_belf=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
+echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+
+
+esac
+
+
+# Save cache, so that ltconfig can load it
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+{
+ (set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+} |
+ sed '
+ t clear
+ : clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
+ if test -w $cache_file; then
+ test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+ cat confcache >$cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+# Actually configure libtool. ac_aux_dir is where install-sh is found.
+AR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
+AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
+objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
+deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
+$libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \
+|| { { echo "$as_me:$LINENO: error: libtool configure failed" >&5
+echo "$as_me: error: libtool configure failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+# Reload cache, that may have been modified by ltconfig
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . $cache_file;;
+ *) . ./$cache_file;;
+ esac
+ fi
+else
+ { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh $ac_aux_dir/ltcf-c.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+# Redirect the config.log output again, so that the ltconfig log is not
+# clobbered by the next message.
+exec 5>>./config.log
+
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+arm32=yes
+# Check whether --enable-arm32 or --disable-arm32 was given.
+if test "${enable_arm32+set}" = set; then
+ enableval="$enable_arm32"
+ case "${enableval}" in
+ yes) arm32=yes ;;
+ no) arm32=no ;;
+ *)
+esac
+fi;
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if test "${ac_cv_prog_CPP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
+else
+ { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+ then ac_cv_prog_egrep='grep -E'
+ else ac_cv_prog_egrep='egrep'
+ fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_header_stdc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then
+ :
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ exit(2);
+ exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_header in errno.h ptrace.h signal.h string.h strings.h sys/procfs.h \
+ asm/reg.h sys/ptrace.h sys/reg.h sys/wait.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+case "$target" in
+ mips64*linux*)
+ TARGET_MODULES="linux-target.o thread-db.o lwp-pool.o ptrace-target.o"
+ cat >>confdefs.h <<\_ACEOF
+#define LINUX_TARGET 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define GREGSET_T prgregset_t
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define FPREGSET_T prfpregset_t
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_LWPID_T 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_PSADDR_T 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_PRGREGSET_T 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_PRFPREGSET_T 1
+_ACEOF
+
+ ;;
+ i?86*linux* | \
+ powerpc*linux* | \
+ arm*linux* | \
+ mips*linux* | \
+ frv*linux*)
+ TARGET_MODULES="linux-target.o thread-db.o lwp-pool.o ptrace-target.o"
+ cat >>confdefs.h <<\_ACEOF
+#define LINUX_TARGET 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define GREGSET_T prgregset_t
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define FPREGSET_T prfpregset_t
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_LWPID_T 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_PSADDR_T 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_PRGREGSET_T 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_PRFPREGSET_T 1
+_ACEOF
+
+ ;;
+ *linux*)
+ TARGET_MODULES="linux-target.o no-threads.o ptrace-target.o"
+ cat >>confdefs.h <<\_ACEOF
+#define LINUX_TARGET 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define GREGSET_T prgregset_t
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define FPREGSET_T prfpregset_t
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_LWPID_T 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_PSADDR_T 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_PRGREGSET_T 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_PRFPREGSET_T 1
+_ACEOF
+
+ ;;
+ *solaris*)
+ TARGET_MODULES="solaris-target.o dummy-target.o"
+ cat >>confdefs.h <<\_ACEOF
+#define SOLARIS_TARGET 1
+_ACEOF
+
+# Place-holders -- not necessarily correct...
+ cat >>confdefs.h <<\_ACEOF
+#define GREGSET_T gregset_t
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define FPREGSET_T fpregset_t
+_ACEOF
+
+ ;;
+esac
+
+# Some architectures use the stock breakpoint model.
+case "$target" in
+ i?86*linux*)
+ TARGET_MODULES="$TARGET_MODULES stock-breakpoints.o"
+ cat >>confdefs.h <<\_ACEOF
+#define STOCK_BREAKPOINTS 1
+_ACEOF
+
+ ;;
+esac
+
+
+
+case "$target" in
+ *solaris*)
+ cat >>confdefs.h <<\_ACEOF
+#define SPARC32_SOLARIS_TARGET 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_XFER_SIZE 4
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_XFER_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG1_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG2_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG3_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG4_TYPE_LONG 1
+_ACEOF
+
+ ;;
+ sh*linux*)
+ cat >>confdefs.h <<\_ACEOF
+#define SH_LINUX_TARGET 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_XFER_SIZE 4
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_XFER_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG1_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG2_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG3_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG4_TYPE_LONG 1
+_ACEOF
+
+ ;;
+ mips64*linux*)
+ cat >>confdefs.h <<\_ACEOF
+#define MIPS64_LINUX_TARGET 1
+_ACEOF
+
+ echo "$as_me:$LINENO: checking mips abi" >&5
+echo $ECHO_N "checking mips abi... $ECHO_C" >&6
+ mipsabi=o32
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+#if !defined(_ABIN32) || _MIPS_SIM != _ABIN32
+#error not n32
+#endif
+
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ mipsabi=n32
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+#if !defined(_ABI64) || _MIPS_SIM != _ABI64
+#error not n64
+#endif
+
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ mipsabi=n64
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $mipsabi" >&5
+echo "${ECHO_T}$mipsabi" >&6
+ case $mipsabi in
+ o32)
+ cat >>confdefs.h <<\_ACEOF
+#define MIPS_ABI_O32 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_XFER_SIZE 4
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_XFER_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG1_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG2_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG3_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG4_TYPE_LONG 1
+_ACEOF
+
+ ;;
+ n32)
+ cat >>confdefs.h <<\_ACEOF
+#define MIPS_ABI_N32 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_XFER_SIZE 8
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_XFER_TYPE_LONG_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG1_TYPE_LONG_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG2_TYPE_LONG_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG3_TYPE_LONG_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG4_TYPE_LONG_LONG 1
+_ACEOF
+
+ ;;
+ n64)
+ cat >>confdefs.h <<\_ACEOF
+#define MIPS_ABI_N64 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_XFER_SIZE 8
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_XFER_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG1_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG2_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG3_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG4_TYPE_LONG 1
+_ACEOF
+
+ ;;
+ esac
+ ;;
+ mips*linux*)
+ cat >>confdefs.h <<\_ACEOF
+#define MIPS_LINUX_TARGET 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define MIPS_ABI_O32 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_XFER_SIZE 4
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_XFER_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG1_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG2_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG3_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG4_TYPE_LONG 1
+_ACEOF
+
+ ;;
+ i?86*linux*)
+ cat >>confdefs.h <<\_ACEOF
+#define X86_LINUX_TARGET 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_XFER_SIZE 4
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_XFER_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG1_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG2_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG3_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG4_TYPE_LONG 1
+_ACEOF
+
+ ;;
+ powerpc*linux*)
+ cat >>confdefs.h <<\_ACEOF
+#define PPC_LINUX_TARGET 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_XFER_SIZE 4
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_XFER_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG1_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG2_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG3_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG4_TYPE_LONG 1
+_ACEOF
+
+ ;;
+ m68k*linux*)
+ cat >>confdefs.h <<\_ACEOF
+#define M68K_LINUX_TARGET 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_XFER_SIZE 4
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_XFER_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG1_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG2_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG3_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG4_TYPE_LONG 1
+_ACEOF
+
+ ;;
+ alpha*linux*)
+ cat >>confdefs.h <<\_ACEOF
+#define ALPHA_LINUX_TARGET 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_XFER_SIZE 8
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_XFER_TYPE_LONG_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG1_TYPE_LONG_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG2_TYPE_LONG_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG3_TYPE_LONG_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG4_TYPE_LONG_LONG 1
+_ACEOF
+
+ ;;
+ arm*linux*)
+ if test "$arm32" = "yes"; then
+ cat >>confdefs.h <<\_ACEOF
+#define ARM_LINUX_TARGET 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_XFER_SIZE 4
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_XFER_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG1_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG2_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG3_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG4_TYPE_LONG 1
+_ACEOF
+
+ else
+ cat >>confdefs.h <<\_ACEOF
+#define ARM_LINUX_TARGET 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_XFER_SIZE 8
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_XFER_TYPE_LONG_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG1_TYPE_LONG_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG2_TYPE_LONG_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG3_TYPE_LONG_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG4_TYPE_LONG_LONG 1
+_ACEOF
+
+ fi
+ ;;
+ frv*linux*)
+ cat >>confdefs.h <<\_ACEOF
+#define FRV_LINUX_TARGET 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_XFER_SIZE 4
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_XFER_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG1_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG2_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG3_TYPE_LONG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define PTRACE_ARG4_TYPE_LONG 1
+_ACEOF
+
+ ;;
+esac
+
+ ac_config_files="$ac_config_files Makefile"
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+{
+ (set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+} |
+ sed '
+ t clear
+ : clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
+ if test -w $cache_file; then
+ test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+ cat confcache >$cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[ ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[ ]*$//;
+}'
+fi
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_i=`echo "$ac_i" |
+ sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+ # 2. Add them.
+ ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+
+# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
+ else
+ as_ln_s='ln -s'
+ fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+exec 6>&1
+
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling. Logging --version etc. is OK.
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by $as_me, which was
+generated by GNU Autoconf 2.57. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+ echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+ echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+ echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+ echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf@gnu.org>."
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+config.status
+configured by $0, generated by GNU Autoconf 2.57,
+ with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=$srcdir
+INSTALL="$INSTALL"
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value. By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=*)
+ ac_option=`expr "x$1" : 'x\([^=]*\)='`
+ ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ -*)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ *) # This is not an option, so the user has probably given explicit
+ # arguments.
+ ac_option=$1
+ ac_need_defaults=false;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --vers* | -V )
+ echo "$ac_cs_version"; exit 0 ;;
+ --he | --h)
+ # Conflict between --help and --header
+ { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; };;
+ --help | --hel | -h )
+ echo "$ac_cs_usage"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+ ac_need_defaults=false;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; } ;;
+
+ *) ac_config_targets="$ac_config_targets $1" ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+ echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+ exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS section.
+#
+
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_config_target in $ac_config_targets
+do
+ case "$ac_config_target" in
+ # Handling of arguments.
+ "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
+ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason to put it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+ trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+} ||
+{
+ tmp=./confstat$$-$RANDOM
+ (umask 077 && mkdir $tmp)
+} ||
+{
+ echo "$me: cannot create a temporary directory in ." >&2
+ { (exit 1); exit 1; }
+}
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+ # Protect against being on the right side of a sed subst in config.status.
+ sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+ s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s,@SHELL@,$SHELL,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s,@exec_prefix@,$exec_prefix,;t t
+s,@prefix@,$prefix,;t t
+s,@program_transform_name@,$program_transform_name,;t t
+s,@bindir@,$bindir,;t t
+s,@sbindir@,$sbindir,;t t
+s,@libexecdir@,$libexecdir,;t t
+s,@datadir@,$datadir,;t t
+s,@sysconfdir@,$sysconfdir,;t t
+s,@sharedstatedir@,$sharedstatedir,;t t
+s,@localstatedir@,$localstatedir,;t t
+s,@libdir@,$libdir,;t t
+s,@includedir@,$includedir,;t t
+s,@oldincludedir@,$oldincludedir,;t t
+s,@infodir@,$infodir,;t t
+s,@mandir@,$mandir,;t t
+s,@build_alias@,$build_alias,;t t
+s,@host_alias@,$host_alias,;t t
+s,@target_alias@,$target_alias,;t t
+s,@DEFS@,$DEFS,;t t
+s,@ECHO_C@,$ECHO_C,;t t
+s,@ECHO_N@,$ECHO_N,;t t
+s,@ECHO_T@,$ECHO_T,;t t
+s,@LIBS@,$LIBS,;t t
+s,@build@,$build,;t t
+s,@build_cpu@,$build_cpu,;t t
+s,@build_vendor@,$build_vendor,;t t
+s,@build_os@,$build_os,;t t
+s,@host@,$host,;t t
+s,@host_cpu@,$host_cpu,;t t
+s,@host_vendor@,$host_vendor,;t t
+s,@host_os@,$host_os,;t t
+s,@target@,$target,;t t
+s,@target_cpu@,$target_cpu,;t t
+s,@target_vendor@,$target_vendor,;t t
+s,@target_os@,$target_os,;t t
+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+s,@CYGPATH_W@,$CYGPATH_W,;t t
+s,@PACKAGE@,$PACKAGE,;t t
+s,@VERSION@,$VERSION,;t t
+s,@ACLOCAL@,$ACLOCAL,;t t
+s,@AUTOCONF@,$AUTOCONF,;t t
+s,@AUTOMAKE@,$AUTOMAKE,;t t
+s,@AUTOHEADER@,$AUTOHEADER,;t t
+s,@MAKEINFO@,$MAKEINFO,;t t
+s,@AMTAR@,$AMTAR,;t t
+s,@install_sh@,$install_sh,;t t
+s,@STRIP@,$STRIP,;t t
+s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
+s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
+s,@AWK@,$AWK,;t t
+s,@SET_MAKE@,$SET_MAKE,;t t
+s,@am__leading_dot@,$am__leading_dot,;t t
+s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t
+s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t
+s,@MAINT@,$MAINT,;t t
+s,@CC@,$CC,;t t
+s,@CFLAGS@,$CFLAGS,;t t
+s,@LDFLAGS@,$LDFLAGS,;t t
+s,@CPPFLAGS@,$CPPFLAGS,;t t
+s,@ac_ct_CC@,$ac_ct_CC,;t t
+s,@EXEEXT@,$EXEEXT,;t t
+s,@OBJEXT@,$OBJEXT,;t t
+s,@DEPDIR@,$DEPDIR,;t t
+s,@am__include@,$am__include,;t t
+s,@am__quote@,$am__quote,;t t
+s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t
+s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t
+s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
+s,@CCDEPMODE@,$CCDEPMODE,;t t
+s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
+s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
+s,@LN_S@,$LN_S,;t t
+s,@RANLIB@,$RANLIB,;t t
+s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s,@LIBTOOL@,$LIBTOOL,;t t
+s,@CPP@,$CPP,;t t
+s,@EGREP@,$EGREP,;t t
+s,@TARGET_MODULES@,$TARGET_MODULES,;t t
+s,@LIBOBJS@,$LIBOBJS,;t t
+s,@LTLIBOBJS@,$LTLIBOBJS,;t t
+CEOF
+
+_ACEOF
+
+ cat >>$CONFIG_STATUS <<\_ACEOF
+ # Split the substitutions into bite-sized pieces for seds with
+ # small command number limits, like on Digital OSF/1 and HP-UX.
+ ac_max_sed_lines=48
+ ac_sed_frag=1 # Number of current file.
+ ac_beg=1 # First line for current file.
+ ac_end=$ac_max_sed_lines # Line after last line for current file.
+ ac_more_lines=:
+ ac_sed_cmds=
+ while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ else
+ sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ fi
+ if test ! -s $tmp/subs.frag; then
+ ac_more_lines=false
+ else
+ # The purpose of the label and of the branching condition is to
+ # speed up the sed processing (if there are no `@' at all, there
+ # is no need to browse any of the substitutions).
+ # These are the two extra sed commands mentioned above.
+ (echo ':t
+ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+ fi
+ ac_sed_frag=`expr $ac_sed_frag + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_lines`
+ fi
+ done
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+ fi
+fi # test -n "$CONFIG_FILES"
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
+ esac
+
+ # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+ esac
+
+ if test x"$ac_file" != x-; then
+ { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+ rm -f "$ac_file"
+ fi
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ configure_input=
+ else
+ configure_input="$ac_file. "
+ fi
+ configure_input=$configure_input"Generated from `echo $ac_file_in |
+ sed 's,.*/,,'` by configure."
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ echo $f;;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo $f
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo $srcdir/$f
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s,@configure_input@,$configure_input,;t t
+s,@srcdir@,$ac_srcdir,;t t
+s,@abs_srcdir@,$ac_abs_srcdir,;t t
+s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s,@builddir@,$ac_builddir,;t t
+s,@abs_builddir@,$ac_abs_builddir,;t t
+s,@top_builddir@,$ac_top_builddir,;t t
+s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
+s,@INSTALL@,$ac_INSTALL,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+ rm -f $tmp/stdin
+ if test x"$ac_file" != x-; then
+ mv $tmp/out $ac_file
+ else
+ cat $tmp/out
+ rm -f $tmp/out
+ fi
+
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_HEADER section.
+#
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='[ ].*$,\1#\2'
+ac_dC=' '
+ac_dD=',;t'
+# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_uB='$,\1#\2define\3'
+ac_uC=' '
+ac_uD=',;t'
+
+for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
+ esac
+
+ test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ echo $f;;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo $f
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo $srcdir/$f
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+ # Remove the trailing spaces.
+ sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
+
+_ACEOF
+
+# Transform confdefs.h into two sed scripts, `conftest.defines' and
+# `conftest.undefs', that substitutes the proper values into
+# config.h.in to produce config.h. The first handles `#define'
+# templates, and the second `#undef' templates.
+# And first: Protect against being on the right side of a sed subst in
+# config.status. Protect against being in an unquoted here document
+# in config.status.
+rm -f conftest.defines conftest.undefs
+# Using a here document instead of a string reduces the quoting nightmare.
+# Putting comments in sed scripts is not portable.
+#
+# `end' is used to avoid that the second main sed command (meant for
+# 0-ary CPP macros) applies to n-ary macro definitions.
+# See the Autoconf documentation for `clear'.
+cat >confdef2sed.sed <<\_ACEOF
+s/[\\&,]/\\&/g
+s,[\\$`],\\&,g
+t clear
+: clear
+s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+t end
+s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+: end
+_ACEOF
+# If some macros were called several times there might be several times
+# the same #defines, which is useless. Nevertheless, we may not want to
+# sort them, since we want the *last* AC-DEFINE to be honored.
+uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
+sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
+rm -f confdef2sed.sed
+
+# This sed command replaces #undef with comments. This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >>conftest.undefs <<\_ACEOF
+s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+_ACEOF
+
+# Break up conftest.defines because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
+echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
+echo ' :' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.defines >/dev/null
+do
+ # Write a limited-size here document to $tmp/defines.sed.
+ echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
+ # Speed up: don't consider the non `#define' lines.
+ echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
+ # Work around the forget-to-reset-the-flag bug.
+ echo 't clr' >>$CONFIG_STATUS
+ echo ': clr' >>$CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+ echo 'CEOF
+ sed -f $tmp/defines.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+ rm -f conftest.defines
+ mv conftest.tail conftest.defines
+done
+rm -f conftest.defines
+echo ' fi # grep' >>$CONFIG_STATUS
+echo >>$CONFIG_STATUS
+
+# Break up conftest.undefs because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo ' # Handle all the #undef templates' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.undefs >/dev/null
+do
+ # Write a limited-size here document to $tmp/undefs.sed.
+ echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
+ # Speed up: don't consider the non `#undef'
+ echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
+ # Work around the forget-to-reset-the-flag bug.
+ echo 't clr' >>$CONFIG_STATUS
+ echo ': clr' >>$CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
+ echo 'CEOF
+ sed -f $tmp/undefs.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
+ rm -f conftest.undefs
+ mv conftest.tail conftest.undefs
+done
+rm -f conftest.undefs
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ echo "/* Generated by configure. */" >$tmp/config.h
+ else
+ echo "/* $ac_file. Generated by configure. */" >$tmp/config.h
+ fi
+ cat $tmp/in >>$tmp/config.h
+ rm -f $tmp/in
+ if test x"$ac_file" != x-; then
+ if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
+ { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ rm -f $ac_file
+ mv $tmp/config.h $ac_file
+ fi
+ else
+ cat $tmp/config.h
+ rm -f $tmp/config.h
+ fi
+# Compute $ac_file's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $ac_file | $ac_file:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
+$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X$ac_file : 'X\(//\)[^/]' \| \
+ X$ac_file : 'X\(//\)$' \| \
+ X$ac_file : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X$ac_file |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_COMMANDS section.
+#
+for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
+ ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
+ ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
+$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_dest" : 'X\(//\)[^/]' \| \
+ X"$ac_dest" : 'X\(//\)$' \| \
+ X"$ac_dest" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_dest" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+
+ { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
+echo "$as_me: executing $ac_dest commands" >&6;}
+ case $ac_dest in
+ depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # So let's grep whole file.
+ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+ dirpart=`(dirname "$mf") 2>/dev/null ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
+ # Extract the definition of DEP_FILES from the Makefile without
+ # running `make'.
+ DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n -e '/^U = / s///p' < "$mf"`
+ test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
+ # We invoke sed twice because it is the simplest approach to
+ # changing $(DEPDIR) to its actual value in the expansion.
+ for file in `sed -n -e '
+ /^DEP_FILES = .*\\\\$/ {
+ s/^DEP_FILES = //
+ :loop
+ s/\\\\$//
+ p
+ n
+ /\\\\$/ b loop
+ p
+ }
+ /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`(dirname "$file") 2>/dev/null ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p $dirpart/$fdir
+ else
+ as_dir=$dirpart/$fdir
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
+echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+ ;;
+ esac
+done
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || { (exit 1); exit 1; }
+fi
+
diff --git a/rda/unix/configure.in b/rda/unix/configure.in
new file mode 100644
index 00000000000..45b00b41799
--- /dev/null
+++ b/rda/unix/configure.in
@@ -0,0 +1,225 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(server.h)
+AC_CANONICAL_SYSTEM
+# case "$target" in
+# sh-*) CC=sh-linux-gnu-gcc;;
+# esac
+AM_INIT_AUTOMAKE(rda,0.1)
+AM_CONFIG_HEADER(config.h:config.in)
+
+dnl automake support
+AM_MAINTAINER_MODE
+AM_PROG_LIBTOOL
+AC_EXEEXT
+AC_LANG_C
+
+arm32=yes
+AC_ARG_ENABLE(arm32,
+[ --enable-arm32=yes to force arm to 32 bit compilation],
+[case "${enableval}" in
+ yes) arm32=yes ;;
+ no) arm32=no ;;
+ *)
+esac])
+
+dnl headers
+AC_CHECK_HEADERS(errno.h ptrace.h signal.h string.h strings.h sys/procfs.h \
+ asm/reg.h sys/ptrace.h sys/reg.h sys/wait.h )
+
+case "$target" in
+ mips64*linux*)
+ TARGET_MODULES="linux-target.o thread-db.o lwp-pool.o ptrace-target.o"
+ AC_DEFINE(LINUX_TARGET)
+ AC_DEFINE(GREGSET_T, prgregset_t)
+ AC_DEFINE(FPREGSET_T, prfpregset_t)
+ AC_DEFINE(HAVE_LWPID_T)
+ AC_DEFINE(HAVE_PSADDR_T)
+ AC_DEFINE(HAVE_PRGREGSET_T)
+ AC_DEFINE(HAVE_PRFPREGSET_T)
+ ;;
+ i?86*linux* | \
+ powerpc*linux* | \
+ arm*linux* | \
+ mips*linux* | \
+ frv*linux*)
+ TARGET_MODULES="linux-target.o thread-db.o lwp-pool.o ptrace-target.o"
+ AC_DEFINE(LINUX_TARGET)
+ AC_DEFINE(GREGSET_T, prgregset_t)
+ AC_DEFINE(FPREGSET_T, prfpregset_t)
+ AC_DEFINE(HAVE_LWPID_T)
+ AC_DEFINE(HAVE_PSADDR_T)
+ AC_DEFINE(HAVE_PRGREGSET_T)
+ AC_DEFINE(HAVE_PRFPREGSET_T)
+ ;;
+ *linux*)
+ TARGET_MODULES="linux-target.o no-threads.o ptrace-target.o"
+ AC_DEFINE(LINUX_TARGET)
+ AC_DEFINE(GREGSET_T, prgregset_t)
+ AC_DEFINE(FPREGSET_T, prfpregset_t)
+ AC_DEFINE(HAVE_LWPID_T)
+ AC_DEFINE(HAVE_PSADDR_T)
+ AC_DEFINE(HAVE_PRGREGSET_T)
+ AC_DEFINE(HAVE_PRFPREGSET_T)
+ ;;
+ *solaris*)
+ TARGET_MODULES="solaris-target.o dummy-target.o"
+ AC_DEFINE(SOLARIS_TARGET)
+# Place-holders -- not necessarily correct...
+ AC_DEFINE(GREGSET_T, gregset_t)
+ AC_DEFINE(FPREGSET_T, fpregset_t)
+ ;;
+esac
+
+# Some architectures use the stock breakpoint model.
+case "$target" in
+ i?86*linux*)
+ TARGET_MODULES="$TARGET_MODULES stock-breakpoints.o"
+ AC_DEFINE(STOCK_BREAKPOINTS)
+ ;;
+esac
+
+AC_SUBST(TARGET_MODULES)
+
+case "$target" in
+ *solaris*)
+ dnl FIXME: differentiate between flavors of Solaris!
+ AC_DEFINE(SPARC32_SOLARIS_TARGET)
+ AC_DEFINE(PTRACE_XFER_SIZE, 4)
+ AC_DEFINE(PTRACE_XFER_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG1_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG2_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG3_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG4_TYPE_LONG)
+ ;;
+ sh*linux*)
+ AC_DEFINE(SH_LINUX_TARGET)
+ AC_DEFINE(PTRACE_XFER_SIZE, 4)
+ AC_DEFINE(PTRACE_XFER_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG1_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG2_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG3_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG4_TYPE_LONG)
+ ;;
+ mips64*linux*)
+ AC_DEFINE(MIPS64_LINUX_TARGET)
+ AC_MSG_CHECKING([mips abi])
+ mipsabi=o32
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+#if !defined(_ABIN32) || _MIPS_SIM != _ABIN32
+#error not n32
+#endif
+ ]])],[mipsabi=n32])
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+#if !defined(_ABI64) || _MIPS_SIM != _ABI64
+#error not n64
+#endif
+ ]])],[mipsabi=n64])
+ AC_MSG_RESULT([$mipsabi])
+ case $mipsabi in
+ o32)
+ AC_DEFINE(MIPS_ABI_O32)
+ AC_DEFINE(PTRACE_XFER_SIZE, 4)
+ AC_DEFINE(PTRACE_XFER_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG1_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG2_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG3_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG4_TYPE_LONG)
+ ;;
+ n32)
+ AC_DEFINE(MIPS_ABI_N32)
+ AC_DEFINE(PTRACE_XFER_SIZE, 8)
+ AC_DEFINE(PTRACE_XFER_TYPE_LONG_LONG)
+ AC_DEFINE(PTRACE_ARG1_TYPE_LONG_LONG)
+ AC_DEFINE(PTRACE_ARG2_TYPE_LONG_LONG)
+ AC_DEFINE(PTRACE_ARG3_TYPE_LONG_LONG)
+ AC_DEFINE(PTRACE_ARG4_TYPE_LONG_LONG)
+ ;;
+ n64)
+ AC_DEFINE(MIPS_ABI_N64)
+ AC_DEFINE(PTRACE_XFER_SIZE, 8)
+ AC_DEFINE(PTRACE_XFER_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG1_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG2_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG3_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG4_TYPE_LONG)
+ ;;
+ esac
+ ;;
+ mips*linux*)
+ AC_DEFINE(MIPS_LINUX_TARGET)
+ AC_DEFINE(MIPS_ABI_O32)
+ AC_DEFINE(PTRACE_XFER_SIZE, 4)
+ AC_DEFINE(PTRACE_XFER_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG1_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG2_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG3_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG4_TYPE_LONG)
+ ;;
+ i?86*linux*)
+ AC_DEFINE(X86_LINUX_TARGET)
+ AC_DEFINE(PTRACE_XFER_SIZE, 4)
+ AC_DEFINE(PTRACE_XFER_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG1_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG2_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG3_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG4_TYPE_LONG)
+ ;;
+ powerpc*linux*)
+ AC_DEFINE(PPC_LINUX_TARGET)
+ AC_DEFINE(PTRACE_XFER_SIZE, 4)
+ AC_DEFINE(PTRACE_XFER_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG1_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG2_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG3_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG4_TYPE_LONG)
+ ;;
+ m68k*linux*)
+ AC_DEFINE(M68K_LINUX_TARGET)
+ AC_DEFINE(PTRACE_XFER_SIZE, 4)
+ AC_DEFINE(PTRACE_XFER_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG1_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG2_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG3_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG4_TYPE_LONG)
+ ;;
+ alpha*linux*)
+ AC_DEFINE(ALPHA_LINUX_TARGET)
+ AC_DEFINE(PTRACE_XFER_SIZE, 8)
+ AC_DEFINE(PTRACE_XFER_TYPE_LONG_LONG)
+ AC_DEFINE(PTRACE_ARG1_TYPE_LONG_LONG)
+ AC_DEFINE(PTRACE_ARG2_TYPE_LONG_LONG)
+ AC_DEFINE(PTRACE_ARG3_TYPE_LONG_LONG)
+ AC_DEFINE(PTRACE_ARG4_TYPE_LONG_LONG)
+ ;;
+ arm*linux*)
+ if test "$arm32" = "yes"; then
+ AC_DEFINE(ARM_LINUX_TARGET)
+ AC_DEFINE(PTRACE_XFER_SIZE, 4)
+ AC_DEFINE(PTRACE_XFER_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG1_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG2_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG3_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG4_TYPE_LONG)
+ else
+ AC_DEFINE(ARM_LINUX_TARGET)
+ AC_DEFINE(PTRACE_XFER_SIZE, 8)
+ AC_DEFINE(PTRACE_XFER_TYPE_LONG_LONG)
+ AC_DEFINE(PTRACE_ARG1_TYPE_LONG_LONG)
+ AC_DEFINE(PTRACE_ARG2_TYPE_LONG_LONG)
+ AC_DEFINE(PTRACE_ARG3_TYPE_LONG_LONG)
+ AC_DEFINE(PTRACE_ARG4_TYPE_LONG_LONG)
+ fi
+ ;;
+ frv*linux*)
+ AC_DEFINE(FRV_LINUX_TARGET)
+ AC_DEFINE(PTRACE_XFER_SIZE, 4)
+ AC_DEFINE(PTRACE_XFER_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG1_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG2_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG3_TYPE_LONG)
+ AC_DEFINE(PTRACE_ARG4_TYPE_LONG)
+ ;;
+esac
+
+dnl Outputs
+AC_OUTPUT(Makefile)
diff --git a/rda/unix/gdbserv-thread-db.h b/rda/unix/gdbserv-thread-db.h
index 1cbd7b40a66..c813b5b2e14 100644
--- a/rda/unix/gdbserv-thread-db.h
+++ b/rda/unix/gdbserv-thread-db.h
@@ -83,29 +83,17 @@ extern int reg_from_xregset (struct gdbserv *serv,
int regno,
const void *xregset);
-/* Resume a stopped LWP. */
-extern int continue_lwp (lwpid_t lid, int signal);
-
-/* Step a stopped LWP. */
-extern int singlestep_lwp (struct gdbserv *serv, lwpid_t lid, int signal);
-
/* Software singlestep for mips. */
#if defined (MIPS_LINUX_TARGET) || defined (MIPS64_LINUX_TARGET)
extern int mips_singlestep (struct gdbserv *serv, pid_t pid, int sig);
#endif
-/* Attach an LWP. */
-extern int attach_lwp (lwpid_t lid);
-
/* Fetch the value of PC for debugging purposes. */
extern unsigned long debug_get_pc (struct gdbserv *serv, pid_t pid);
/* Adjust PC value after trap has been hit. */
extern int decr_pc_after_break (struct gdbserv *serv, pid_t pid);
-/* Send SIGSTOP to an LWP. */
-extern int stop_lwp (lwpid_t lwpid);
-
struct child_process;
extern int handle_waitstatus (struct child_process *process, union wait w);
diff --git a/rda/unix/lwp-ctrl.h b/rda/unix/lwp-ctrl.h
new file mode 100644
index 00000000000..dbdc404337a
--- /dev/null
+++ b/rda/unix/lwp-ctrl.h
@@ -0,0 +1,61 @@
+/* lwp-ctrl.h --- interface to functions for controlling LWP's
+
+ Copyright 2004 Red Hat, Inc.
+
+ This file is part of RDA, the Red Hat Debug Agent (and library).
+
+ 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.
+
+ Alternative licenses for RDA may be arranged by contacting Red Hat,
+ Inc. */
+
+#ifndef RDA_UNIX_LWP_CTRL_H
+#define RDA_UNIX_LWP_CTRL_H
+
+#include <sys/types.h>
+
+struct gdbserv;
+
+/* Do a PTRACE_ATTACH on LWP. Do not wait for the resulting wait
+ status. On success, return zero; on failure, print a message, set
+ errno, and return -1. */
+int attach_lwp (pid_t lwp);
+
+/* Singlestep the stopped lwp LWP, which is managed by SERV. If LWP
+ successfully completes the next instruction, it will receive a
+ SIGTRAP signal. If SIGNAL is non-zero, send it to LWP. Do not
+ wait for the resulting wait status. On success, return zero; on
+ failure, print a message, set errno, and return -1. */
+int singlestep_lwp (struct gdbserv *serv, pid_t lwp, int signal);
+
+/* Continue the stopped lwp LWP. If SIGNAL is non-zero, send it to
+ LWP. Do not wait for the resulting wait status. On success,
+ return zero; on failure, print a message, set errno, and return
+ -1. */
+int continue_lwp (pid_t lwp, int signal);
+
+/* Send LWP the signal SIGNAL. Do not wait for the resulting wait
+ status. On success, return zero; on failure, print a message, set
+ errno, and return -1.
+
+ If possible, this uses the 'tkill' system call to ensure the signal
+ is sent to that exact LWP, and not distributed to whatever thread
+ in the process is ready to handle it (as POSIX says ordinary 'kill'
+ must do). */
+int kill_lwp (pid_t lwp, int signal);
+
+
+#endif /* RDA_UNIX_LWP_CTRL_H */
diff --git a/rda/unix/lwp-pool.c b/rda/unix/lwp-pool.c
new file mode 100644
index 00000000000..9fd0dc2e073
--- /dev/null
+++ b/rda/unix/lwp-pool.c
@@ -0,0 +1,1468 @@
+/* lwp-pool.c --- implementation of a stoppable, waitable LWP pool.
+
+ Copyright 2004 Red Hat, Inc.
+
+ This file is part of RDA, the Red Hat Debug Agent (and library).
+
+ 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.
+
+ Alternative licenses for RDA may be arranged by contacting Red Hat,
+ Inc. */
+
+#include "config.h"
+
+#define _GNU_SOURCE /* for strerror */
+
+#include <assert.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#include "lwp-pool.h"
+#include "lwp-ctrl.h"
+
+static int debug_lwp_pool = 1;
+
+
+/* THE LIFETIME OF A TRACED LWP
+
+ POSIX uses these terms in talking about signals:
+
+ - To "generate" a signal is to call kill or raise, divide by zero,
+ etc.
+
+ - To "deliver" a signal is to do whatever that signal's designated
+ action is: ignore it, enter a signal handler, terminate the
+ process, or stop the process.
+
+ - To "accept" a signal is to have 'sigwait' or a similar function
+ select and return the signal.
+
+ - A signal is "pending" between the time it is generated and the
+ time it is delivered.
+
+ So, here is the life cycle of a traced LWP:
+
+ - It is created by fork or vfork and does a PTRACE_TRACEME. The
+ PTRACE_TRACEME makes it a traced, running LWP. When a traced LWP
+ does an exec, it gets a SIGTRAP before executing the first
+ instruction in the new process image, so the LWP will then stop.
+
+ Or, we attach to it with a PTRACE_ATTACH. This sends a SIGSTOP
+ to the LWP, so it will stop.
+
+ - While a traced LWP is stopped, we can read and write its
+ registers and memory. We can also send it signals; they become
+ pending on the LWP, and are not delivered or accepted until it is
+ continued.
+
+ - A stopped LWP can be set running again in one of two ways:
+
+ + by doing a PTRACE_CONT, PTRACE_SINGLESTEP, or PTRACE_SYSCALL; or
+
+ + by sending it a SIGCONT.
+
+ The ptrace requests all let you specify a signal to be delivered to
+ the process.
+
+ Sending a SIGCONT clears any pending SIGSTOPs; PTRACE_CONT and
+ PTRACE_SINGLESTEP don't have that side effect.
+
+ (Sending an LWP a SIGKILL via the 'kill' or 'tkill' system calls
+ acts like sending it a SIGKILL followed by a SIGCONT.)
+
+ - A running LWP may exit or be terminated by a signal at any time,
+ so accessing its memory or registers or sending it a signal is
+ always a race.
+
+ - waitpid will eventually return a status S for a continued LWP:
+
+ + If WIFEXITED (S) or WIFSIGNALED (S), the LWP no longer exists.
+
+ + IF WIFSTOPPED (S), the LWP is stopped again, because some
+ signal WSTOPSIG (S) was about to be delivered to it. Here we
+ go back to the second step.
+
+ Note that the signal WSTOPSIG (S) has not yet been delivered to
+ the process, and is no longer pending on the process. Only
+ signals passed to the ptrace requests get delivered. In
+ effect, the debugger gets to intercept signals before they are
+ delivered, and decide whether to pass them through or not.
+ (The exception is SIGKILL: that always produces a WIFSIGNALED
+ wait status, and terminates the process.)
+
+ So, to put all that together:
+
+ - A traced LWP goes back and forth from running to stopped, until
+ eventually it goes from running to exited or killed.
+
+ - Running->stopped transitions are always signal deliveries, yielding
+ WIFSTOPPED wait statuses.
+
+ - Stopping->running transitions are generally due to ptrace
+ requests by the debugger. (The debugger could send signals, but
+ that's messy.)
+
+ - Running->exited transitions are due to, duh, the LWP exiting.
+
+ - Running->killed transitions are due to a signal being delivered
+ to the LWP that is neither ignored nor caught.
+
+
+ Under NPTL, this life cycle is a bit different: LWPs simply exit,
+ without creating a zombie; they produce no wait status. The NPTL
+ libthread_db generates a TD_DEATH event for them, but at the kernel
+ level the only indication that they're gone is that the tkill
+ system call fails with ESRCH ("No such process").
+
+ Under LinuxThreads, LWPs remain zombie processes until they're
+ waited for. Attempts to send them signals while zombies have no
+ effect, but return no error.
+
+
+ STOPPING A PROCESS
+
+ The major challenge here is implementing the lwp_pool_stop_all
+ function. The only way to stop a running LWP is to send it a
+ SIGSTOP, and then wait for a status acknowledging the stop. But as
+ explained above, a running LWP could stop at any time of its own
+ accord, so sending it a SIGSTOP is always a race. By the time you
+ call waitpid, you don't know whether you'll get a status for the
+ SIGSTOP you just sent, or for something else: some other signal, an
+ exit, or a termination by signal.
+
+ If the LWP turns out to have exited or died, then that's pretty
+ easy to handle. Your attempt to send a SIGSTOP will get an error,
+ and then you'll get a wait status for the termination. A
+ termination status is always the last status you'll get from wait
+ for that LWP, so there'll be no further record of your SIGSTOP.
+
+ If the LWP was about to have some other signal delivered to it,
+ then the next wait will return a WIFSTOPPED status for that signal;
+ we'll have to continue the LWP and wait again until we get the
+ status for our SIGSTOP. The kernel forgets about any signals the
+ LWP has received once it has reported them to us, so it's up to us
+ to keep track of them and report them via lwp_pool_waitpid. */
+
+
+
+/* The LWP structure. */
+
+/* The states an LWP we're managing might be in.
+
+ For the purposes of these states, we classify wait statuses as
+ follows:
+
+ - An "interesting" wait status is one that isn't a result of us
+ attaching to the LWP or sending it a SIGSTOP for
+ lwp_pool_stop_all. It indicates something that happened to the
+ LWP other than as a result of this code's fiddling with it. We
+ report all interesting wait statuses via lwp_pool_waitpid.
+
+ - A "boring" wait status is one that results from our attaching to
+ it or sending it a SIGSTOP for lwp_pool_stop_all. We do not
+ report these via lwp_pool_stop_all.
+
+ Most of these states are combinations of various semi-independent
+ factors, which we'll name and define here:
+
+ - RUNNING / STOPPED / DEAD: These are the kernel states of the LWP:
+ it's either running freely and could stop at any moment, is
+ stopped but can be continued, or has died.
+
+ - INTERESTING: this LWP has stopped or died with a wait status that
+ has not yet been reported via lwp_pool_waitpid. It is on the
+ interesting LWP queue.
+
+ This never applies to RUNNING LWPs: we never continue an
+ INTERESTING LWP until we've reported its status.
+
+ It always applies to DEAD LWPs.
+
+ - STOP PENDING: we've sent this LWP a SIGSTOP, or attached to it,
+ but we haven't yet received the boring WIFSTOPPED SIGSTOP status.
+
+ This never applies to DEAD LWPs; the wait status that announces a
+ LWP's death is always the last for that LWP.
+
+ There's nothing wrong with having STOPPED, un-INTERESTING, and
+ STOP PENDING LWP's, but it turns out that we can always just
+ continue the thread and wait immediately for it, making such a
+ combination unnecessary.
+
+ We could do something similar and eliminate the RUNNING, STOP
+ PENDING state, but that state turns out to be handy for error
+ checking.
+
+ We could certainly represent these with independent bits or
+ bitfields, but not all combinations are possible. So instead, we
+ assign each possible combination a distinct enum value, to make it
+ easier to enumerate all the valid possibilities and be sure we've
+ handled them. */
+
+enum lwp_state {
+
+ /* An uninitialized LWP entry. Only the lookup function itself,
+ hash_find, creates entries in this state, and any function
+ that calls that should put the entry in a meaningful state before
+ returning. */
+ lwp_state_uninitialized,
+
+ /* RUNNING. This LWP is running --- last we knew. It may have
+ exited or been terminated by a signal, or it may have had a
+ signal about to be delivered to it. We won't know until we wait
+ for it. */
+ lwp_state_running,
+
+ /* STOPPED. This LWP has stopped, and has no interesting status to
+ report. */
+ lwp_state_stopped,
+
+ /* STOPPED, INTERESTING. This LWP has stopped with an interesting
+ wait status, which we haven't yet reported to the user. It is on
+ the interesting LWP queue. */
+ lwp_state_stopped_interesting,
+
+ /* DEAD, INTERESTING. This LWP exited, or was killed by a signal.
+ This LWP is on the interesting LWP queue. Once we've reported it
+ to the user, we'll delete it altogether. */
+ lwp_state_dead_interesting,
+
+ /* RUNNING, STOP PENDING. This LWP was running, and will eventually
+ stop with a boring WIFSTOPPED SIGSTOP status, but may report an
+ interesting status first.
+
+ It's always safe to wait for a thread in this state, so we do
+ that as soon as possible; there shouldn't be any threads in this
+ state between calls to public lwp_pool functions. This is an
+ internal-use state. */
+ lwp_state_running_stop_pending,
+
+ /* STOPPED, STOP PENDING, and INTERESTING. This LWP has stopped with
+ an interesting wait status. We're also expecting a boring wait
+ status from it. */
+ lwp_state_stopped_stop_pending_interesting,
+
+};
+
+
+/* The thread_db death state. See the descriptions of the
+ lwp_pool_thread_db_* functions in lwp-pool.h. */
+enum death_state {
+
+ /* We've received no indication that this thread will exit. */
+ death_state_running,
+
+ /* We've received a TD_DEATH event for this thread, but it hasn't
+ completed its event notification yet. */
+ death_state_event_received,
+
+ /* We've received a TD_DEATH event for this thread, and it has
+ completed its event notification; when we continue it next, we
+ will delete it from the hash table and forget about it
+ entirely. */
+ death_state_delete_when_continued
+};
+
+
+struct lwp
+{
+ /* This lwp's PID. */
+ pid_t pid;
+
+ /* The state this LWP is in. */
+ enum lwp_state state;
+
+ /* Its thread_db death notification state. */
+ enum death_state death_state;
+
+ /* If STATE is one of the lwp_state_*_interesting states, then this
+ LWP is on the interesting LWP queue, headed by interesting_queue.
+
+ If STATE is lwp_state_running_stop_pending, then this LWP is on
+ the stopping LWP queue, stopping_queue. (Note that
+ stopping_queue is local to lwp_pool_stop_all; no thread should be
+ in that state by the time that function returns. */
+ struct lwp *prev, *next;
+
+ /* If STATE is one of the lwp_state_*_interesting states, then
+ STATUS is the interesting wait status. */
+ int status;
+};
+
+
+
+/* The LWP hash table. */
+
+/* A hash table of all the live LWP's we know about.
+ hash_population is the number of occupied entries in the table.
+
+ hash_size is the total length of the table; it is always a power of
+ two. We resize the table to ensure that it is between 12.5% and
+ 50% occupied. (Since the table's size is a power of two, resizing
+ the table will always halve or double the populated ratio. So
+ there should be comfortably more than a factor of two between the
+ maximum and minimum populations, for hysteresis.)
+
+ The first slot we try is hash[PID % hash_size]. After C
+ collisions, we try hash[(PID + C * STRIDE) % hash_size], where
+ STRIDE is hash_size / 4 + 1. The kernel assigns pids sequentially,
+ so a STRIDE of 1, as many hash tables use, would make further
+ collisions very likely. But since hash_size is always a power of
+ two, and hash_size / 4 + 1 is always odd, they are always
+ relatively prime, so stepping by that many elements each time will
+ eventually visit every table element. A constant odd stride would
+ be fine, but it's nice to have it scale with the overall population
+ of the table.
+
+ The table is an array of pointers to lwp's, rather than a direct
+ array of lwp structures, so that pointers to lwp's don't become
+ invalid when we rehash or delete entries. */
+static size_t hash_size, hash_population;
+static struct lwp **hash;
+
+/* The minimum size for the hash table. Small for testing. */
+enum { minimum_hash_size = 8 };
+
+
+/* Return the hash slot for pid PID. */
+static int
+hash_slot (pid_t pid, size_t size)
+{
+ return pid & (size - 1);
+}
+
+
+/* If there was a collision in SLOT, return the next slot. */
+static int
+hash_next_slot (int slot, size_t size)
+{
+ int stride = size / 4 + 1;
+
+ return (slot + stride) & (size - 1);
+}
+
+
+/* Return the earliest empty hash slot for PID. */
+static int
+hash_empty_slot (pid_t pid)
+{
+ int slot = hash_slot (pid, hash_size);
+
+ /* Since hash_next_slot will eventually visit every slot, and we
+ know the table isn't full, this loop will terminate. */
+ while (hash[slot])
+ slot = hash_next_slot (slot, hash_size);
+
+ return slot;
+}
+
+
+/* Return a new, empty hash table containing ELEMENTS elements. This has
+ no effect on the LWP pool's global variables. */
+static struct lwp **
+make_hash_table (size_t elements)
+{
+ struct lwp **hash;
+ size_t size = elements * sizeof (*hash);
+
+ hash = malloc (size);
+ memset (hash, 0, size);
+
+ return hash;
+}
+
+
+/* Resize hash as needed to ensure that the table's population is
+ between 12.5% and 50% of its size. */
+static void
+resize_hash (void)
+{
+ struct lwp **new_hash;
+ size_t new_hash_size;
+ int new_hash_population; /* just for sanity checking */
+ int i;
+
+ /* Pick a new size. */
+ new_hash_size = hash_size;
+ while (new_hash_size < hash_population * 2)
+ new_hash_size *= 2;
+ while (new_hash_size > minimum_hash_size
+ && new_hash_size > hash_population * 8)
+ new_hash_size /= 2;
+
+ /* We may have re-chosen the minimum table size. */
+ if (new_hash_size == hash_size)
+ return;
+
+ new_hash = make_hash_table (new_hash_size);
+ new_hash_population = 0;
+
+ /* Re-insert all the old lwp's in the new table. */
+ for (i = 0; i < hash_size; i++)
+ if (hash[i])
+ {
+ struct lwp *l = hash[i];
+ int new_slot = hash_slot (l->pid, new_hash_size);
+
+ while (new_hash[new_slot])
+ new_slot = hash_next_slot (new_slot, new_hash_size);
+
+ new_hash[new_slot] = l;
+ new_hash_population++;
+ }
+
+ if (new_hash_population != hash_population)
+ fprintf (stderr, "ERROR: rehashing changed population from %d to %d\n",
+ hash_population, new_hash_population);
+
+ /* Free the old table, and drop in the new one. */
+ free (hash);
+ hash = new_hash;
+ hash_size = new_hash_size;
+}
+
+
+/* Find an existing hash table entry for LWP. If there is none,
+ create one in state lwp_state_uninitialized. */
+static struct lwp *
+hash_find (pid_t lwp)
+{
+ int slot;
+ struct lwp *l;
+
+ /* Do we need to initialize the hash table? */
+ if (! hash)
+ {
+ hash_size = minimum_hash_size;
+ hash = make_hash_table (hash_size);
+ hash_population = 0;
+ }
+
+ for (slot = hash_slot (lwp, hash_size);
+ hash[slot];
+ slot = hash_next_slot (slot, hash_size))
+ if (hash[slot]->pid == lwp)
+ return hash[slot];
+
+ /* There is no entry for this lwp. Create one. */
+ l = malloc (sizeof (*l));
+ l->pid = lwp;
+ l->state = lwp_state_uninitialized;
+ l->death_state = 0;
+ l->next = l->prev = NULL;
+ l->status = 42;
+
+ hash[slot] = l;
+ hash_population++;
+
+ /* Do we need to resize? */
+ if (hash_size < hash_population * 2)
+ resize_hash ();
+
+ return l;
+}
+
+
+/* Remove the LWP L from the pool. This does not free L itself. */
+static void
+hash_delete (struct lwp *l)
+{
+ int slot;
+
+ for (slot = hash_slot (l->pid, hash_size);
+ hash[slot];
+ slot = hash_next_slot (slot, hash_size))
+ if (hash[slot]->pid == l->pid)
+ break;
+
+ /* We shouldn't ever be asked to delete a 'struct lwp' that isn't in
+ the table. */
+ assert (hash[slot]);
+
+ /* There should be only one 'struct lwp' with a given PID. */
+ assert (hash[slot] == l);
+
+ /* Deleting from this kind of hash table is interesting, because of
+ the way we handle collisions.
+
+ For the sake of discussion, pretend that STRIDE is 1 (the
+ reasoning is basically the same either way, but this has less
+ hair).
+
+ When we search for an LWP that hashes to slot S, because there
+ may be collisions, the set of slots we'll actually search is the
+ contiguous run of non-empty table entries that starts at S,
+ heading towards higher indices (and possibly wrapping around at
+ the end of the table). When we find an empty table entry, we
+ give up the search.
+
+ When we delete an LWP, if we simply set its slot to zero, that
+ could cause us to cut off later searches too early. For example,
+ if three LWP's all hash to slot S, and have been placed in slots
+ S, S+1, and S+2, and we set slot S+1 to zero, then a search for
+ the LWP at S+2 will start at S, and then stop at S+1 without ever
+ seeing the right entry at S+2.
+
+ Some implementations place a special "deleted" marker in the slot
+ to let searches continue. But then it's hard to ensure that the
+ table doesn't get choked with deleted markers; and should deleted
+ markers count towards the population for resizing purposes? It's
+ a mess.
+
+ So after clearing a slot, we walk the remainder of the contiguous
+ run of entries and re-hash them all. If the hash function is
+ doing a good job distributing entries across the table,
+ contiguous runs should be short. And it had better be good,
+ because this is potentially quadratic.
+
+ Of course, if we're going to resize the table, that removes all
+ deleted elements, so we needn't bother with any of this. */
+
+ hash[slot] = NULL;
+ hash_population--;
+
+ if (hash_size > minimum_hash_size
+ && hash_size > hash_population * 8)
+ resize_hash ();
+ else
+ for (slot = hash_next_slot (slot, hash_size);
+ hash[slot];
+ slot = hash_next_slot (slot, hash_size))
+ {
+ struct lwp *refugee = hash[slot];
+
+ hash[slot] = NULL;
+ hash[hash_empty_slot (refugee->pid)] = refugee;
+ }
+}
+
+
+
+/* Queue functions. */
+
+/* Insert L at the end of the queue headed by QUEUE. */
+static void
+queue_enqueue (struct lwp *queue, struct lwp *l)
+{
+ assert (! l->next && ! l->prev);
+
+ l->next = queue;
+ l->prev = queue->prev;
+ l->prev->next = l;
+ l->next->prev = l;
+}
+
+
+/* If L is part of some queue, remove it. */
+static void
+queue_delete (struct lwp *l)
+{
+ assert (l->next && l->prev);
+
+ l->next->prev = l->prev;
+ l->prev->next = l->next;
+ l->next = l->prev = NULL;
+}
+
+
+/* Return non-zero if there is anything in QUEUE, zero otherwise. */
+static int
+queue_non_empty (struct lwp *queue)
+{
+ return queue->next != queue;
+}
+
+
+/* Return the first LWP from QUEUE, but don't remove it. If QUEUE is
+ empty, return NULL. */
+static struct lwp *
+queue_first (struct lwp *queue)
+{
+ struct lwp *l = queue->next;
+
+ if (l != queue)
+ return l;
+ else
+ return NULL;
+}
+
+
+
+/* Hashing LWP's, but with error checking and cleanup. */
+
+
+/* Add an entry for LWP to the pool and return it. There should be no
+ existing entry for LWP; if there is, clean it up. The returned
+ LWP's state is always lwp_state_uninitialized; the caller must
+ initialize the LWP before returning. */
+static struct lwp *
+hash_find_new (pid_t lwp)
+{
+ struct lwp *l = hash_find (lwp);
+
+ if (l->state != lwp_state_uninitialized)
+ {
+ fprintf (stderr, "ERROR: new LWP %d already in table\n", (int) lwp);
+
+ /* Remove ourselves from any queue we might be in. */
+ if (l->next)
+ queue_delete (l);
+ }
+
+ l->state = lwp_state_uninitialized;
+
+ return l;
+}
+
+
+/* Find an entry for an existing LWP, and return it. If we have no
+ existing entry for LWP, print an error message, but return the new,
+ uninitialized entry anyway. */
+static struct lwp *
+hash_find_known (pid_t lwp)
+{
+ struct lwp *l = hash_find (lwp);
+
+ if (l->state == lwp_state_uninitialized)
+ fprintf (stderr, "ERROR: unexpected lwp: %d\n", (int) lwp);
+
+ return l;
+}
+
+
+
+/* Waiting. */
+
+
+/* The head of the queue of LWP's with interesting wait statuses.
+ Only the prev and next members are meaningful.
+
+ Every LWP in one of the lwp_state_*_interesting states should be on
+ this queue. If an LWP's state is lwp_state_dead_interesting, the
+ LWP is not in the hash table any more. */
+static struct lwp interesting_queue
+= { -1, 0, 0, &interesting_queue, &interesting_queue, 42 };
+
+
+static const char *
+wait_status_str (int status)
+{
+ static char buf[100];
+
+ if (WIFSTOPPED (status))
+ sprintf (buf, "WIFSTOPPED (s) && WSTOPSIG (s) == %d (%s)",
+ WSTOPSIG (status), strsignal (WSTOPSIG (status)));
+ else if (WIFEXITED (status))
+ sprintf (buf, "WIFEXITED (s) && WEXITSTATUS (s) == %d",
+ WEXITSTATUS (status));
+ else if (WIFSIGNALED (status))
+ sprintf (buf, "WIFSIGNALED (s) && WTERMSIG (s) == %d (%s)%s",
+ WTERMSIG (status),
+ strsignal (WTERMSIG (status)),
+ WCOREDUMP (status) ? " && WCOREDUMP(s)" : "");
+ else
+ sprintf (buf, "%d (unrecognized status)", status);
+
+ return buf;
+}
+
+
+static const char *
+wait_flags_str (int flags)
+{
+ static const struct {
+ int flag;
+ const char *name;
+ } flag_table[] = {
+ { WNOHANG, "WNOHANG" },
+ { WUNTRACED, "WUNTRACED" },
+#ifdef __WCLONE
+ { __WCLONE, "__WCLONE" },
+#endif
+#ifdef __WALL
+ { __WALL, "__WALL" },
+#endif
+#ifdef __WNOTHREAD
+ { __WNOTHREAD, "__WNOTHREAD" },
+#endif
+ { 0, 0 }
+ };
+ static char buf[100];
+ int i;
+
+ buf[0] = '\0';
+ for (i = 0; flag_table[i].flag; i++)
+ if (flags & flag_table[i].flag)
+ {
+ strcat (buf, flag_table[i].name);
+ flags &= ~flag_table[i].flag;
+ if (flags)
+ strcat (buf, " | ");
+ }
+
+ if (flags)
+ sprintf (buf + strlen (buf), "0x%x", (unsigned) flags);
+
+ return buf;
+}
+
+
+static const char *
+lwp_state_str (enum lwp_state state)
+{
+ switch (state)
+ {
+ case lwp_state_uninitialized:
+ return "uninitialized";
+ case lwp_state_running:
+ return "running";
+ case lwp_state_stopped:
+ return "stopped";
+ case lwp_state_stopped_interesting:
+ return "stopped_interesting";
+ case lwp_state_dead_interesting:
+ return "dead_interesting";
+ case lwp_state_running_stop_pending:
+ return "running_stop_pending";
+ case lwp_state_stopped_stop_pending_interesting:
+ return "stopped_stop_pending_interesting";
+ default:
+ {
+ static char buf[100];
+ sprintf (buf, "%d (unrecognized lwp_state)", state);
+ return buf;
+ }
+ }
+}
+
+
+static void
+debug_report_state_change (pid_t lwp,
+ enum lwp_state old,
+ enum lwp_state new)
+{
+ if (debug_lwp_pool && old != new)
+ fprintf (stderr,
+ "%32s -- %5d -> %-32s\n",
+ lwp_state_str (old), (int) lwp, lwp_state_str (new));
+}
+
+
+/* Wait for a status from the LWP L (or any LWP, if L is NULL),
+ passing FLAGS to waitpid, and record the resulting wait status in
+ the LWP pool appropriately.
+
+ If no wait status was available (if FLAGS & WNOHANG), return zero.
+ If we successfully processed some wait status, return 1. If an
+ error occurs, set errno and return -1.
+
+ If waitpid returns an error, print a message to stderr. */
+static int
+wait_and_handle (struct lwp *l, int flags)
+{
+ int status;
+ pid_t new_pid;
+ enum lwp_state old_state;
+
+ /* We can only wait for LWP's that are running. */
+ if (l)
+ assert (l->state == lwp_state_running
+ || l->state == lwp_state_running_stop_pending);
+
+ /* This should be the only call to waitpid in this module, to ensure
+ that we always keep each LWP's state up to date. In fact, it
+ should be the only call to waitpid used by any module using the
+ LWP pool code at all. */
+ new_pid = waitpid (l ? l->pid : -1, &status, flags);
+
+ if (debug_lwp_pool)
+ {
+ fprintf (stderr,
+ "lwp_pool: wait_and_handle: waitpid (%d, %s, %s) == %d\n",
+ l ? l->pid : -1,
+ (new_pid <= 0 ? "(unset)" : wait_status_str (status)),
+ wait_flags_str (flags),
+ new_pid);
+ }
+
+ if (new_pid == -1)
+ {
+ /* If we call fprintf, that'll wipe out the value of errno. */
+ int saved_errno = errno;
+
+ fprintf (stderr, "ERROR: waitpid (%d) failed: %s\n",
+ l ? (int) l->pid : -1,
+ strerror (saved_errno));
+
+ errno = saved_errno;
+ return -1;
+ }
+
+ if (new_pid == 0)
+ /* No status, so no LWP has changed state. */
+ return 0;
+
+ if (l)
+ {
+ if (l->pid != new_pid)
+ {
+ fprintf (stderr, "ERROR: waited for %d, but got %d\n",
+ l->pid, new_pid);
+ l = hash_find_known (new_pid);
+ }
+ }
+ else
+ l = hash_find_known (new_pid);
+
+ old_state = l->state;
+
+ l->status = status;
+
+ if (WIFEXITED (status) || WIFSIGNALED (status))
+ {
+ /* Remove dead LWP's from the hash table, and put them in the
+ interesting queue. */
+ hash_delete (l);
+ l->state = lwp_state_dead_interesting;
+ if (l->next)
+ queue_delete (l);
+ queue_enqueue (&interesting_queue, l);
+ }
+ else
+ {
+ int stopsig;
+
+ assert (WIFSTOPPED (status));
+
+ stopsig = WSTOPSIG (status);
+
+ switch (l->state)
+ {
+ case lwp_state_uninitialized:
+ /* Might as well clean it up. */
+ case lwp_state_running:
+ /* It stopped, but not because of anything we did, so it's
+ interesting even if it was a SIGSTOP. */
+ l->state = lwp_state_stopped_interesting;
+ queue_enqueue (&interesting_queue, l);
+ break;
+
+ case lwp_state_running_stop_pending:
+
+ /* If we were in stopping_queue, we're stopped now. */
+ if (l->next)
+ queue_delete (l);
+
+ /* We are expecting a boring SIGSTOP. Is this it? */
+ if (stopsig == SIGSTOP)
+ l->state = lwp_state_stopped;
+ else
+ {
+ /* Report this status, but remember that we're still
+ expecting the boring SIGSTOP. */
+ l->state = lwp_state_stopped_stop_pending_interesting;
+ queue_enqueue (&interesting_queue, l);
+ }
+ break;
+
+ default:
+ /* The assert at top should prevent any other states from
+ showing up here. */
+ fprintf (stderr, "ERROR: called waitpid on LWP %d in bad state %s\n",
+ (int) l->pid, lwp_state_str (l->state));
+ abort ();
+ break;
+ }
+ }
+
+ debug_report_state_change (l->pid, old_state, l->state);
+
+ return 1;
+}
+
+
+/* Wait for a pending stop on the running LWP L. Return non-zero if L
+ ends up in an interesting state, or zero if L ends up in
+ lwp_state_stopped.
+
+ Whenever we have an LWP with no interesting status, but with a stop
+ pending, we can always wait on it:
+
+ - Since SIGCONT can't be blocked, caught, or ignored, the wait will
+ always return immediately. The process won't run amok.
+
+ - Since the LWP is uninteresting to begin with, we'll end up with
+ at most one interesting wait status to report; no need to queue
+ up multiple statuses per LWP (which we'd rather not implement if
+ we can avoid it).
+
+ By always waiting immediately, we avoid the need for a state like
+ lwp_state_stopped_stop_pending.
+
+ So, this function takes a thread in lwp_state_running_stop_pending,
+ and puts that thread in either lwp_state_stopped (no stop pending)
+ or some INTERESTING state. It's really just
+ wait_and_handle, with some error checking wrapped around
+ it. */
+static int
+check_stop_pending (struct lwp *l)
+{
+ assert (l->state == lwp_state_running_stop_pending);
+
+ wait_and_handle (l, __WALL);
+
+ switch (l->state)
+ {
+ case lwp_state_stopped:
+ return 0;
+
+ case lwp_state_stopped_stop_pending_interesting:
+ case lwp_state_stopped_interesting:
+ case lwp_state_dead_interesting:
+ return 1;
+
+ default:
+ fprintf (stderr,
+ "ERROR: checking lwp %d for pending stop yielded "
+ "bad state %s\n",
+ (int) l->pid, lwp_state_str (l->state));
+ abort ();
+ break;
+ }
+}
+
+
+pid_t
+lwp_pool_waitpid (pid_t pid, int *stat_loc, int options)
+{
+ struct lwp *l;
+ enum lwp_state old_state;
+
+ if (debug_lwp_pool)
+ fprintf (stderr, "lwp_pool_waitpid (%d, stat_loc, %s)\n",
+ (int) pid, wait_flags_str (options));
+
+ /* Check that we're not being passed arguments that would be
+ meaningful for the real waitpid, but that we can't handle. */
+ assert (pid == -1 || pid > 0);
+ assert (! (options & ~WNOHANG));
+
+ /* Do the wait, and choose an LWP to report on. */
+ if (pid == -1)
+ {
+ /* Handle wait statuses of any sort until something appears on
+ the interesting queue. */
+ while (! queue_non_empty (&interesting_queue))
+ {
+ int result = wait_and_handle (NULL, options | __WALL);
+
+ if (result <= 0)
+ return result;
+ }
+
+ l = queue_first (&interesting_queue);
+ }
+ else
+ {
+ /* Waiting for a status from a specific pid PID. */
+ l = hash_find_known (pid);
+
+ /* We should only wait for known, running LWP's. */
+ assert (l->state == lwp_state_running
+ || l->state == lwp_state_running_stop_pending);
+
+ /* Wait until this pid is no longer running. */
+ while (l->state == lwp_state_running
+ || l->state == lwp_state_running_stop_pending)
+ {
+ int result = wait_and_handle (l, options | __WALL);
+
+ if (result <= 0)
+ return result;
+ }
+ }
+
+ /* Gather info from L early, in case we free it. */
+ pid = l->pid;
+ old_state = l->state;
+ if (stat_loc)
+ *stat_loc = l->status;
+
+ /* The INTERESTING states specifically mean that the LWP has a
+ status which should be reported to the user, but that hasn't been
+ yet. Now we're about to report that status, so we need to mark
+ interesting LWP's as uninteresting. */
+ switch (l->state)
+ {
+ case lwp_state_uninitialized:
+ case lwp_state_running:
+ case lwp_state_stopped:
+ case lwp_state_running_stop_pending:
+ /* These are uninteresting states. The waiting code above
+ should never have chosen an LWP in one of these states. */
+ fprintf (stderr,
+ "ERROR: %s: selected uninteresting LWP %d state %s\n",
+ __func__, l->pid, lwp_state_str (l->state));
+ abort ();
+ break;
+
+ case lwp_state_stopped_interesting:
+ /* Now that we've reported this wait status to the user, the LWP
+ is not interesting any more. */
+ l->state = lwp_state_stopped;
+ queue_delete (l);
+ debug_report_state_change (l->pid, old_state, l->state);
+ break;
+
+ case lwp_state_dead_interesting:
+ /* Once we've reported this status, we have washed our hands of
+ this LWP entirely. */
+ queue_delete (l);
+ free (l);
+ if (debug_lwp_pool)
+ fprintf (stderr,
+ "lwp_pool: %s: LWP %d state dead_interesting -> freed\n",
+ __func__, pid);
+ break;
+
+ case lwp_state_stopped_stop_pending_interesting:
+ /* We're about to report this LWP's status, making it
+ uninteresting, but it's still got a stop pending. So a state
+ like lwp_state_stopped_stop_pending would seem reasonable.
+
+ However, this is the only place such a state would occur. By
+ removing the LWP from the interesting queue and continuing
+ it, we can go directly from
+ lwp_state_stopped_stop_pending_interesting to
+ lwp_state_running_stop_pending.
+
+ Since SIGSTOP cannot be blocked, caught, or ignored, we know
+ continuing the LWP won't actually allow it to run anywhere;
+ it just allows it to report another status. */
+ queue_delete (l);
+ continue_lwp (l->pid, 0);
+ l->state = lwp_state_running_stop_pending;
+ debug_report_state_change (l->pid, old_state, l->state);
+ check_stop_pending (l);
+ break;
+
+ default:
+ fprintf (stderr, "ERROR: lwp %d in bad state: %s\n",
+ (int) l->pid, lwp_state_str (l->state));
+ abort ();
+ break;
+ }
+
+ return pid;
+}
+
+
+
+/* libthread_db-based death handling, for NPTL. */
+
+
+static const char *
+death_state_str (enum death_state d)
+{
+ switch (d)
+ {
+ case death_state_running: return "death_state_running";
+ case death_state_event_received: return "death_state_event_received";
+ case death_state_delete_when_continued:
+ return "death_state_delete_when_continued";
+ default:
+ {
+ static char buf[100];
+ sprintf (buf, "%d (unrecognized death_state)", d);
+ return buf;
+ }
+ }
+}
+
+
+static void
+debug_report_death_state_change (pid_t lwp,
+ enum death_state old,
+ enum death_state new)
+{
+ if (debug_lwp_pool && old != new)
+ fprintf (stderr,
+ "%32s -- %5d -> %-32s\n",
+ death_state_str (old), (int) lwp, death_state_str (new));
+}
+
+
+void
+lwp_pool_thread_db_death_event (pid_t pid)
+{
+ struct lwp *l = hash_find_known (pid);
+ enum death_state old_state = l->death_state;
+
+ if (debug_lwp_pool)
+ fprintf (stderr, "lwp_pool_thread_db_death_event (%d)\n",
+ (int) pid);
+
+ if (l->state == lwp_state_uninitialized)
+ {
+ /* hash_find_known has already complained about this; we just
+ clean up. */
+ hash_delete (l);
+ free (l);
+ return;
+ }
+
+ if (l->death_state == death_state_running)
+ l->death_state = death_state_event_received;
+
+ debug_report_death_state_change (pid, old_state, l->death_state);
+}
+
+
+void
+lwp_pool_thread_db_death_notified (pid_t pid)
+{
+ struct lwp *l = hash_find_known (pid);
+ enum death_state old_state = l->death_state;
+
+ if (debug_lwp_pool)
+ fprintf (stderr, "lwp_pool_thread_db_death_notified (%d)\n",
+ (int) pid);
+
+ if (l->state == lwp_state_uninitialized)
+ {
+ /* hash_find_known has already complained about this; we just
+ clean up. */
+ hash_delete (l);
+ free (l);
+ return;
+ }
+
+ if (l->death_state == death_state_event_received)
+ l->death_state = death_state_delete_when_continued;
+
+ debug_report_death_state_change (pid, old_state, l->death_state);
+}
+
+
+/* Subroutine for the 'continue' functions. If the LWP L should be
+ forgotten once continued, delete it from the hash table, and free
+ its storage; we'll get no further wait status from it to indicate
+ that it's gone. */
+static void
+check_for_exiting_nptl_lwp (struct lwp *l)
+{
+ if (l->state == lwp_state_running
+ && l->death_state == death_state_delete_when_continued)
+ {
+ if (debug_lwp_pool)
+ fprintf (stderr,
+ "lwp_pool: %s: NPTL LWP %d will disappear silently\n",
+ __func__, l->pid);
+ assert (! l->next && ! l->prev);
+ hash_delete (l);
+ free (l);
+ }
+}
+
+
+
+
+/* Stopping and continuing. */
+
+
+void
+lwp_pool_stop_all (void)
+{
+ int i;
+
+ if (debug_lwp_pool)
+ fprintf (stderr, "lwp_pool_stop_all ()\n");
+
+ /* The head of the queue of running LWP's that we are stopping.
+ Only the prev and next members are meaningful. */
+ struct lwp stopping_queue;
+
+ stopping_queue.next = stopping_queue.prev = &stopping_queue;
+
+ /* First, put every LWP that's not already STOPPED or DEAD in a STOP
+ PENDING state, and put them all on stopping_queue. */
+ for (i = 0; i < hash_size; i++)
+ {
+ struct lwp *l = hash[i];
+
+ if (l)
+ {
+ enum lwp_state old_state = l->state;
+
+ switch (l->state)
+ {
+ /* There should never be 'uninitialized' entries left in
+ the table. Whoever created them ought to have put them
+ in some meaningful state before returning. */
+ case lwp_state_uninitialized:
+ assert (l->state != lwp_state_uninitialized);
+ break;
+
+ case lwp_state_running:
+ /* A 'no such process' error here indicates an NPTL thread
+ that has exited. */
+ kill_lwp (l->pid, SIGSTOP);
+ l->state = lwp_state_running_stop_pending;
+ queue_enqueue (&stopping_queue, l);
+ break;
+
+ case lwp_state_stopped:
+ case lwp_state_stopped_interesting:
+ case lwp_state_dead_interesting:
+ case lwp_state_stopped_stop_pending_interesting:
+ /* Nothing needs to be done here. */
+ break;
+
+ case lwp_state_running_stop_pending:
+ /* Threads should never be in this state between calls to
+ public lwp_pool functions. */
+ assert (l->state != lwp_state_running_stop_pending);
+ break;
+
+ default:
+ fprintf (stderr, "ERROR: lwp %d in bad state: %s\n",
+ (int) l->pid, lwp_state_str (l->state));
+ abort ();
+ break;
+ }
+
+ debug_report_state_change (l->pid, old_state, l->state);
+ }
+ }
+
+ /* Gather wait results until the stopping queue is empty. */
+ while (queue_non_empty (&stopping_queue))
+ if (wait_and_handle (NULL, __WALL) < 0)
+ {
+ fprintf (stderr, "ERROR: lwp_pool_stop_all wait failed: %s",
+ strerror (errno));
+ return;
+ }
+
+ /* Now all threads should be stopped or dead. But let's check. */
+ for (i = 0; i < hash_size; i++)
+ {
+ struct lwp *l = hash[i];
+ if (l)
+ switch (l->state)
+ {
+ case lwp_state_uninitialized:
+ assert (l->state != lwp_state_uninitialized);
+ break;
+
+ case lwp_state_running:
+ case lwp_state_running_stop_pending:
+ fprintf (stderr,
+ "ERROR: lwp_pool_stop_all failed: LWP %d still running\n",
+ (int) l->pid);
+ break;
+
+ case lwp_state_stopped:
+ case lwp_state_stopped_interesting:
+ case lwp_state_dead_interesting:
+ case lwp_state_stopped_stop_pending_interesting:
+ /* That's all as it should be. */
+ break;
+
+ default:
+ fprintf (stderr, "ERROR: lwp %d in bad state: %s\n",
+ (int) l->pid, lwp_state_str (l->state));
+ abort ();
+ break;
+ }
+ }
+}
+
+
+void
+lwp_pool_continue_all (void)
+{
+ int i;
+
+ if (debug_lwp_pool)
+ fprintf (stderr, "lwp_pool_continue_all ()\n");
+
+ /* This loop makes every LWP either INTERESTING, or RUNNING. */
+ for (i = 0; i < hash_size; i++)
+ {
+ struct lwp *l = hash[i];
+
+ if (l)
+ {
+ enum lwp_state old_state = l->state;
+
+ switch (l->state)
+ {
+ /* There should never be 'uninitialized' entries left in
+ the table. Whoever created them ought to have put them
+ in some meaningful state before returning. */
+ case lwp_state_uninitialized:
+ assert (l->state != lwp_state_uninitialized);
+ break;
+
+ case lwp_state_running:
+ /* It's already running, so nothing needs to be done. */
+ break;
+
+ case lwp_state_stopped:
+ if (continue_lwp (l->pid, 0) == 0)
+ l->state = lwp_state_running;
+ break;
+
+ case lwp_state_stopped_interesting:
+ case lwp_state_dead_interesting:
+ case lwp_state_stopped_stop_pending_interesting:
+ /* We still have an unreported wait status here, so leave it
+ alone; we'll report it. */
+ break;
+
+ case lwp_state_running_stop_pending:
+ /* There shouldn't be any threads in this state at this
+ point. We should be calling check_stop_pending or
+ wait_and_handle as soon as we create them. */
+ assert (l->state != lwp_state_running_stop_pending);
+ break;
+
+ default:
+ fprintf (stderr, "ERROR: lwp %d in bad state: %s\n",
+ (int) l->pid, lwp_state_str (l->state));
+ abort ();
+ break;
+ }
+
+ debug_report_state_change (l->pid, old_state, l->state);
+
+ check_for_exiting_nptl_lwp (l);
+ }
+ }
+}
+
+
+int
+lwp_pool_continue_lwp (pid_t pid, int signal)
+{
+ struct lwp *l = hash_find_known (pid);
+ enum lwp_state old_state = l->state;
+ int result;
+
+ if (debug_lwp_pool)
+ fprintf (stderr, "lwp_pool_continue_lwp (%d, %d)\n",
+ (int) pid, signal);
+
+ /* We should only be continuing stopped threads, with no interesting
+ status to report. And we should have cleaned up any pending
+ stops as soon as we created them. */
+ assert (l->state == lwp_state_stopped);
+ result = continue_lwp (l->pid, signal);
+ if (result == 0)
+ l->state = lwp_state_running;
+ debug_report_state_change (l->pid, old_state, l->state);
+
+ check_for_exiting_nptl_lwp (l);
+
+ return result;
+}
+
+
+int
+lwp_pool_singlestep_lwp (struct gdbserv *serv, pid_t lwp, int signal)
+{
+ struct lwp *l = hash_find_known (lwp);
+ enum lwp_state old_state = l->state;
+ int result;
+
+ if (debug_lwp_pool)
+ fprintf (stderr, "lwp_pool_singlestep_lwp (%p, %d, %d)\n",
+ serv, (int) lwp, signal);
+
+ /* We should only be single-stepping known, stopped threads, with no
+ interesting status to report. And we should have cleaned up any
+ pending stops as soon as we created them. */
+ assert (l->state == lwp_state_stopped);
+ result = singlestep_lwp (serv, l->pid, signal);
+ if (result == 0)
+ l->state = lwp_state_running;
+ debug_report_state_change (l->pid, old_state, l->state);
+ return result;
+}
+
+
+
+/* Adding new LWP's to the pool. */
+
+void
+lwp_pool_new_stopped (pid_t pid)
+{
+ struct lwp *l = hash_find_new (pid);
+
+ if (debug_lwp_pool)
+ fprintf (stderr, "lwp_pool_new_stopped (%d)\n", (int) pid);
+
+ l->state = lwp_state_stopped;
+
+ if (debug_lwp_pool)
+ fprintf (stderr, "lwp_pool: %s: new LWP %d state %s\n",
+ __func__, l->pid, lwp_state_str (l->state));
+}
+
+
+int
+lwp_pool_attach (pid_t pid)
+{
+ /* Are we already managing this LWP? */
+ struct lwp *l = hash_find (pid);
+
+ if (debug_lwp_pool)
+ fprintf (stderr, "lwp_pool_attach (%d)\n", (int) pid);
+
+ if (l->state == lwp_state_uninitialized)
+ {
+ /* No, we really need to attach to it. */
+ int status = attach_lwp (pid);
+
+ if (status)
+ {
+ /* Forget about the lwp. */
+ hash_delete (l);
+ free (l);
+ return status;
+ }
+
+ /* Since we attached to it, we'll get a SIGSTOP for this
+ eventually. Wait for it now, to put it in either
+ lwp_state_stopped, or in some interesting state. */
+ l->state = lwp_state_running_stop_pending;
+
+ if (debug_lwp_pool)
+ fprintf (stderr, "lwp_pool: %s: new LWP %d state %s\n",
+ __func__, l->pid, lwp_state_str (l->state));
+
+ check_stop_pending (l);
+
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/rda/unix/lwp-pool.h b/rda/unix/lwp-pool.h
new file mode 100644
index 00000000000..d2d7a966753
--- /dev/null
+++ b/rda/unix/lwp-pool.h
@@ -0,0 +1,173 @@
+/* lwp-pool.h --- interface to a stoppable, waitable LWP pool.
+
+ Copyright 2004 Red Hat, Inc.
+
+ This file is part of RDA, the Red Hat Debug Agent (and library).
+
+ 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.
+
+ Alternative licenses for RDA may be arranged by contacting Red Hat,
+ Inc. */
+
+#ifndef RDA_UNIX_LWP_POOL_H
+#define RDA_UNIX_LWP_POOL_H
+
+#include <sys/types.h>
+#include <sys/wait.h>
+
+struct gdbserv;
+
+/* These functions manage a set of LWPs that you can wait for for á là
+ waitpid, but that you can also stop and continue as a group without
+ disturbing individual threads' wait statuses.
+
+ Here we use "LWP" to mean the kernel-level thingy that is running
+ code, and "thread" to mean the POSIX threads / libthread_db-level
+ object. The Linux kernel calls an 'LWP' a 'thread', which would be
+ confusing.
+
+ The LWPs must be either children of the calling process, or
+ processes we have attached to --- something we will hear about when
+ we call 'waitpid'.
+
+ We have separate tables for Unix LWP's and libthread_db threads,
+ because even though standard Linux distributions have never used
+ M:N threads, there still isn't a simple 1:1 relationship between
+ them. Before the thread library has been loaded and initialized
+ itself, you have an LWP with no thread. After a thread has exited,
+ but before any other thread has joined with it, you can have a
+ thread with no LWP. Add that to the way libthread_db reports the
+ id of an exited LWP as being equal to ps_getpid (proc_handle), and
+ it becomes worthwhile having a clear separation between the two. */
+
+
+/* Add PID to the LWP pool, assuming that PID is stopped, and the
+ uninteresting wait status has been received (and thrown away). Use
+ this for a child that has been forked, and where we've waited for
+ the exec SIGSTOP. */
+void lwp_pool_new_stopped (pid_t pid);
+
+
+/* Attach to PID, add it to the LWP pool, and wait for it to stop. If
+ PID is already in the pool, do nothing and return 0. If PID was
+ not already in the pool and we successfully attached to it, return
+ 1. On failure, return -1 and set errno.
+
+ If there is an interesting wait status available for PID,
+ lwp_pool_waitpid will report it, but the wait status caused by the
+ attach is handled internally, and will not be reported via
+ lwp_pool_waitpid. */
+int lwp_pool_attach (pid_t pid);
+
+
+/* Do we need a function for detaching from each LWP in the pool
+ individually? */
+
+
+/* Behave like 'waitpid (PID, STAT_LOC, OPTIONS)', but do not report
+ boring wait statuses --- those due to calls to lwp_pool_attach,
+ lwp_pool_stop_all, etc.
+
+ PID must be either -1 (wait for any process) or a positive
+ integer (wait for the process with that specific pid).
+
+ The only bit that may be set in OPTIONS is WNOHANG. We need to
+ monitor the status of all LWP's, so we add __WALL as appropriate. */
+pid_t lwp_pool_waitpid (pid_t pid, int *stat_loc, int options);
+
+
+/* Stop all running LWP's in the pool. This function does not return
+ until all LWP's are known to be stopped.
+
+ The wait status caused by the stop is handled internally, and will
+ not be reported by lwp_pool_waitpid. */
+void lwp_pool_stop_all (void);
+
+
+/* Continue all stopped, uninteresting LWP's in the pool.
+ If some of the LWP's have been resumed with lwp_pool_singlestep or
+ lwp_pool_continue, those will be left to continue to run. */
+void lwp_pool_continue_all (void);
+
+
+/* Continue LWP. If SIGNAL is non-zero, continue it with signal
+ SIGNAL. Return zero on success, -1 on failure. */
+int lwp_pool_continue_lwp (pid_t pid, int signal);
+
+
+/* Continue LWP in SERV for one instruction, delivering SIGNAL if it
+ is non-zero, and stop with SIGSTOP if/when that instruction has
+ been completed.
+
+ The SERV argument is there because singlestep_lwp requires it.
+ Inconsistency, bleah. */
+int lwp_pool_singlestep_lwp (struct gdbserv *serv, pid_t lwp, int signal);
+
+
+/* Under NPTL, LWP's simply disappear, without becoming a zombie or
+ producing any wait status. At the kernel level, we have no way of
+ knowing that the LWP's PID is now free and may be reused ---
+ perhaps by an entirely different program! So we need to use the
+ death events from libthread_db to help us keep our LWP table clean.
+
+ There are two steps:
+
+ - first, the thread sends RDA a libthread_db TD_DEATH event,
+ indicating that it is about to exit.
+
+ - then, the thread takes some pre-negotiated action (hitting a
+ breakpoint; making a system call) to notify libthread_db that
+ there are events queued it should attend to.
+
+ What's tricky here is that the queueing of the event and the
+ notification are not synchronized. So RDA could easily receive
+ TD_DEATH events for several threads when the first of those threads
+ performs its notification. We need to continue to manage the LWPs
+ of the remaining threads whose death is foretold (are there any
+ named Santiago?) until they have completed their notifications.
+
+ (And since RDA consumes all the events each time a notification is
+ received, we should be prepared to receive notifications even when
+ the queue is empty. But that's not our problem here.)
+
+ So the LWP pool code has the following two entry points:
+
+ - The first indicates that a TD_DEATH event has been received for a
+ given thread, and that once it has completed its notification, we
+ should expect to hear nothing from it again.
+
+ - The second indicates that some LWP, whether marked for death or
+ not, has completed its notification.
+
+ So when a thread completes its notification, *and* that thread has
+ been marked for death, we should drop it from the LWP pool. */
+
+
+/* Indicate that LWP's death has been foretold by a TD_DEATH message
+ from libthread_db. Once we are told that it has completed its
+ event notification by a call to lwp_pool_nptl_death_notified, we
+ will forget about LWP entirely. */
+void lwp_pool_thread_db_death_event (pid_t lwp);
+
+
+/* Indicate that LWP has completed its event notification. LWP must
+ be currently stopped. If LWP's death has been fortold by a call to
+ lwp_pool_nptl_death_event, when LWP is continued, we will remove it
+ from the LWP pool and forget about it entirely. */
+void lwp_pool_thread_db_death_notified (pid_t lwp);
+
+
+#endif /* RDA_UNIX_LWP_POOL_H */
diff --git a/rda/unix/ptrace-target.c b/rda/unix/ptrace-target.c
index 89952077db0..4217e1db3d1 100644
--- a/rda/unix/ptrace-target.c
+++ b/rda/unix/ptrace-target.c
@@ -24,6 +24,8 @@
#include "config.h"
+#define _GNU_SOURCE
+
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
@@ -44,6 +46,7 @@
#include "server.h"
#include "ptrace-target.h"
+#include "lwp-ctrl.h"
/* This is unix ptrace gdbserv target that uses the RDA library to implement
a remote gdbserver on a unix ptrace host. It controls the process
to be debugged on the linux host, allowing GDB to pull the strings
@@ -1264,90 +1267,85 @@ ptrace_check_child_state (struct child_process *process)
return 0;
}
-/* Exported service functions */
-
-/* Function: continue_lwp
- Send PTRACE_CONT to an lwp.
- Returns -1 for failure, zero for success. */
+/* Exported service functions; see "lwp-ctrl.h". */
-extern int
-continue_lwp (lwpid_t lwpid, int signal)
+int
+continue_lwp (pid_t lwp, int signal)
{
if (thread_db_noisy)
- fprintf (stderr, "<ptrace (PTRACE_CONT, %d, 0, %d)>\n", lwpid, signal);
+ fprintf (stderr, "<ptrace (PTRACE_CONT, %d, 0, %d)>\n", lwp, signal);
- if (ptrace (PTRACE_CONT, lwpid, 0, signal) < 0)
+ if (ptrace (PTRACE_CONT, lwp, 0, signal) < 0)
{
- fprintf (stderr, "<<< ERROR: PTRACE_CONT %d failed >>>\n", lwpid);
+ fprintf (stderr, "<<< ERROR: PTRACE_CONT %d failed: %s >>>\n",
+ lwp, strerror (errno));
return -1;
}
return 0;
}
-/* Function: singlestep_lwp
- Send PTRACE_SINGLESTEP to an lwp.
- Returns -1 for failure, zero for success. */
-
int
-singlestep_lwp (struct gdbserv *serv, lwpid_t lwpid, int signal)
+singlestep_lwp (struct gdbserv *serv, pid_t lwp, int signal)
{
#if defined (MIPS_LINUX_TARGET) || defined (MIPS64_LINUX_TARGET)
{
if (thread_db_noisy)
- fprintf (stderr, "<singlestep_lwp lwpid=%d signal=%d>\n", lwpid, signal);
- mips_singlestep (serv, lwpid, signal);
+ fprintf (stderr, "<singlestep_lwp lwp=%d signal=%d>\n", lwp, signal);
+ mips_singlestep (serv, lwp, signal);
return 0;
}
#else
if (thread_db_noisy)
- fprintf (stderr, "<ptrace (PTRACE_SINGLESTEP, %d, 0, %d)>\n", lwpid, signal);
+ fprintf (stderr, "<ptrace (PTRACE_SINGLESTEP, %d, 0, %d)>\n", lwp, signal);
- if (ptrace (PTRACE_SINGLESTEP, lwpid, 0, signal) < 0)
+ if (ptrace (PTRACE_SINGLESTEP, lwp, 0, signal) < 0)
{
- fprintf (stderr, "<<< ERROR: PTRACE_SINGLESTEP %d failed >>>\n", lwpid);
+ int saved_errno = errno;
+
+ fprintf (stderr, "<<< ERROR: PTRACE_SINGLESTEP %d failed: %s >>>\n",
+ lwp, strerror (errno));
+
+ errno = saved_errno;
return -1;
}
#endif
return 0;
}
-/* Function: attach_lwp
- Send PTRACE_ATTACH to an lwp.
- Returns -1 for failure, zero for success. */
-
-extern int
-attach_lwp (lwpid_t lwpid)
+int
+attach_lwp (pid_t lwp)
{
errno = 0;
- if (ptrace (PTRACE_ATTACH, lwpid, 0, 0) == 0)
+ if (ptrace (PTRACE_ATTACH, lwp, 0, 0) == 0)
{
if (thread_db_noisy)
- fprintf (stderr, "<ptrace (PTRACE_ATTACH, %d, 0, 0)>\n", lwpid);
+ fprintf (stderr, "<ptrace (PTRACE_ATTACH, %d, 0, 0)>\n", lwp);
return 0;
}
else
{
+ int saved_errno = errno;
+
fprintf (stderr, "<<< ERROR ptrace attach %d failed, %s >>>\n",
- lwpid, strerror (errno));
+ lwp, strerror (errno));
+
+ errno = saved_errno;
return -1;
}
}
-/* Function: stop_lwp
- Use SIGSTOP to force an lwp to stop.
- Returns -1 for failure, zero for success. */
-
-extern int
-stop_lwp (lwpid_t lwpid)
+int
+kill_lwp (pid_t lwp, int signal)
{
int result;
/* Under NPTL, signals sent via kill get delivered to whatever
thread in the group can handle them; they don't necessarily go to
the thread whose PID you passed. This makes kill useless for
- stop_lwp's purposes: it's trying to stop a particular thread.
+ kill_lwp's purposes: it's trying to send a signal to a particular
+ thread.
The tkill system call lets you direct a signal at a particular
thread. Use that if it's available (as it is on all systems
@@ -1361,7 +1359,7 @@ stop_lwp (lwpid_t lwpid)
if (could_have_tkill)
{
errno = 0;
- result = syscall (SYS_tkill, lwpid, SIGSTOP);
+ result = syscall (SYS_tkill, lwp, signal);
if (errno == 0)
return result;
else if (errno == ENOSYS)
@@ -1369,18 +1367,28 @@ stop_lwp (lwpid_t lwpid)
could_have_tkill = 0;
else
{
- fprintf (stderr, "<<< ERROR -- tkill (%d, SIGSTOP) failed >>>\n",
- lwpid);
+ int saved_errno = errno;
+
+ fprintf (stderr,
+ "<<< ERROR -- tkill (%d, %s) failed: %s >>>\n",
+ lwp, strsignal (signal), strerror (errno));
+
+ errno = saved_errno;
return -1;
}
}
}
#endif
- result = kill (lwpid, SIGSTOP);
+ result = kill (lwp, signal);
if (result != 0)
{
- fprintf (stderr, "<<< ERROR -- kill (%d, SIGSTOP) failed >>>\n", lwpid);
+ int saved_errno = errno;
+
+ fprintf (stderr, "<<< ERROR -- kill (%d, %s) failed >>>\n",
+ lwp, strsignal (signal));
+
+ errno = saved_errno;
return -1;
}
diff --git a/rda/unix/server.h b/rda/unix/server.h
new file mode 100644
index 00000000000..3294f7a933c
--- /dev/null
+++ b/rda/unix/server.h
@@ -0,0 +1,95 @@
+/* server.h
+
+ Copyright 2000, 2002 Red Hat, Inc.
+
+ This file is part of RDA, the Red Hat Debug Agent (and library).
+
+ 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.
+
+ Alternative licenses for RDA may be arranged by contacting Red Hat,
+ Inc. */
+
+/* Shared definitions for an RDA based native gdb server. */
+
+#if defined(_MIPSEL) || defined(_MIPSEB)
+/*
+ * We single-step by setting breakpoints. When an exception
+ * is handled, we need to restore the previous instructions
+ *
+ * This is where we save the original instructions.
+ */
+
+struct ss_save {
+ int in_use;
+ struct gdbserv_reg ss_addr;
+ unsigned int ss_val;
+};
+#endif
+
+struct arch;
+struct arch_bp_table;
+
+/* Definition of a "process", or an instance of the server.
+ * Theoretically one server could run an arbitrary number of these.
+ */
+struct child_process {
+ struct gdbserv *serv;
+ struct arch *arch;
+ char *executable;
+ char **argv;
+ int pid;
+
+ /* The last thread we reported an event for. */
+ struct gdbserv_thread *event_thread;
+
+ /* If the client continues or single-steps a single thread, leaving
+ the rest of the program stopped, this is that thread. */
+ struct gdbserv_thread *focus_thread;
+
+ int stop_status;
+ int stop_signal;
+ long signal_to_send;
+ int debug_backend;
+ int debug_informational;
+ int running;
+
+#if defined(_MIPSEL) || defined(_MIPSEB)
+ int is_ss; /* we are single stepping */
+ struct ss_save ss_info[2]; /* single stepping saved information */
+#endif
+
+ /* A breakpoint table for the current process. May be zero if we
+ don't support breakpoints. */
+ struct arch_bp_table *breakpoint_table;
+};
+
+/* Definition of the entry points to the server,
+ * needed by main.
+ */
+struct server_vector {
+ struct gdbserv_target * (*attach) (struct gdbserv *serv, void *data);
+ int (*check_child_state) (struct child_process *process);
+ void (*fromtarget_break) (struct child_process *process);
+ void (*fromtarget_exit) (struct child_process *process);
+ void (*fromtarget_terminate) (struct child_process *process);
+};
+
+extern struct server_vector gdbserver;
+
+/* Global flag used by the server to tell main to quit out of its loop.
+ */
+extern int server_quit_p;
+
diff --git a/rda/unix/thread-db.c b/rda/unix/thread-db.c
index 497c7bdfd26..5095118ba03 100644
--- a/rda/unix/thread-db.c
+++ b/rda/unix/thread-db.c
@@ -41,6 +41,8 @@
#include "arch.h"
#include "gdb_proc_service.h"
#include "gdbserv-thread-db.h"
+#include "lwp-ctrl.h"
+#include "lwp-pool.h"
/* Make lots of noise (debugging output). */
int thread_db_noisy = 1;
@@ -184,25 +186,57 @@ next_undefined_symbol (void)
/* Define the struct gdbserv_thread object. */
struct gdbserv_thread {
- td_thrinfo_t ti;
-
- /* True if we have attached to this thread, but haven't yet
- continued or single-stepped it. */
- int attached : 1;
-
- /* True if we have sent this thread a SIGSTOP (because some other
- thread has had something interesting happen, and we want the
- whole program to stop), but not yet continued or single-stepped it. */
- int stopped : 1;
- /* True if we have called waitpid, and consumed any extraneous wait
- statuses created by attaching, stopping, etc. */
- int waited : 1;
+ /* A note about thread states (TI.ti_state):
+
+ When a thread calls pthread_exit, it first runs all its
+ cancellation cleanup functions (see pthread_cleanup_push), and
+ then calls destructors for its thread-specific data (see
+ pthread_key_create). If the thread is not detached, it then
+ makes the pointer passed to pthread_exit available for thread(s)
+ calling pthread_join. Then, the thread terminates.
+
+ If a thread's start function, passed to pthread_create, returns,
+ then an implementation may assume that the cleanups have run
+ already (the POSIX threads interface requires user code to ensure
+ that this is the case). So it just runs the destructors, and
+ terminates.
+
+ In glibc 2.3.3's NPTL, if a thread calls pthread_exit,
+ libthread_db says its state is TD_THR_ZOMBIE while it runs its
+ cleanups and destructors. However, if a thread simply returns
+ from its start function, then libthread_db says it's
+ TD_THR_ACTIVE while it runs its destructors. Other versions of
+ libthread_db seem to do inconsistent things like that as well.
+
+ A note about LWP id's (TI.ti_lid):
+
+ After a thread has exited, the libthread_db's for LinuxThreads
+ and NPTL report its ti_lid as being equal to the pid of the main
+ thread. To be precise, it reports the LWP id's as being equal to
+ ps_getpid (PROCHANDLE), where PROCHANDLE is the 'struct
+ ps_prochandle' passed to td_ta_new when we created the thread
+ agent in the first place.
+
+ The idea here seems to be, "There are no kernel-level resources
+ devoted to the thread any more that a debugger could talk to, so
+ let's hand the debugger whatever info we used to create the
+ thread agent in the first place, so it can at least talk to what
+ remains of the process." This is a nice thought, but since the
+ thread_db interface doesn't give us any way to stop threads or
+ wait for them, the debugger needs to break through the
+ abstraction and operate on LWP's directly to do those things.
+ libthread_db's attempt to be helpful, together with the
+ sloppiness in the ti_state handling, makes figuring whether there
+ even *is* an LWP to operate on pretty difficult.
+
+ If we attach to a process using some pid P, whose corresponding
+ thread happens to have called pthread_exit, then there's no way
+ for us to distinguish threads whose lwp is reported as P because
+ they're dead from the thread whose lwp is reported as P because
+ it actually is: they're all zombies. */
+ td_thrinfo_t ti;
- /* True if we last single-stepped this thread, instead of continuing
- it. When choosing one event out of many to report to GDB, we
- give stepped events higher priority than some others. */
- int stepping : 1;
struct gdbserv_thread *next;
} *thread_list;
@@ -215,6 +249,7 @@ add_thread_to_list (td_thrinfo_t *ti)
struct gdbserv_thread *new = malloc (sizeof (struct gdbserv_thread));
/* First cut -- add to start of list. */
+ memset (new, 0, sizeof (*new));
memcpy (&new->ti, ti, sizeof (td_thrinfo_t));
new->next = thread_list;
thread_list = new;
@@ -284,33 +319,6 @@ thread_list_lookup_by_tid (thread_t tid)
return tmp;
}
-static struct gdbserv_thread *
-thread_list_lookup_by_lid (lwpid_t pid)
-{
- struct gdbserv_thread *tmp;
-
- for (tmp = thread_list; tmp; tmp = tmp->next)
- if (tmp->ti.ti_lid == pid)
- break;
-
- return tmp;
-}
-
-/* Return a pointer to a statically allocated string describing
- THREAD. For debugging. */
-static const char *
-thread_debug_name (struct gdbserv_thread *thread)
-{
- if (thread)
- {
- static char buf[50];
- sprintf (buf, "(%p %d)", thread, thread->ti.ti_lid);
- return buf;
- }
- else
- return "(null thread)";
-}
-
/* A copy of the next lower layer's target vector, before we modify it. */
static struct gdbserv_target parentvec;
@@ -424,9 +432,9 @@ thread_db_state_str (td_thr_state_e statecode)
case TD_THR_UNKNOWN: return "<officially unknown>";
case TD_THR_STOPPED: return "<stopped>";
case TD_THR_RUN: return "<running>";
- case TD_THR_ACTIVE: return "<active> ";
- case TD_THR_ZOMBIE: return "<zombie> ";
- case TD_THR_SLEEP: return "<sleep> ";
+ case TD_THR_ACTIVE: return "<active>";
+ case TD_THR_ZOMBIE: return "<zombie>";
+ case TD_THR_SLEEP: return "<sleep>";
case TD_THR_STOPPED_ASLEEP: return "<stopped asleep>";
default:
sprintf (buf, "<unknown state code %d>", statecode);
@@ -438,7 +446,7 @@ static char *
thread_db_type_str (td_thr_type_e type)
{
switch (type) {
- case TD_THR_USER: return "<user> ";
+ case TD_THR_USER: return "<user>";
case TD_THR_SYSTEM: return "<system>";
default: return "<unknown>";
}
@@ -505,6 +513,32 @@ thread_db_event_str (td_event_e event)
}
}
+/* Return a pointer to a statically allocated string describing
+ THREAD. For debugging. The resulting string has the form
+ "(TID STATE LID PTR)", where:
+ - TID is the thread ID, which you'll see in the user program and
+ in the remote protocol,
+ - STATE is the state of the thread, which can be important in
+ deciding how to interpret LID,
+ - LID is the PID of the underlying LWP, and
+ - PTR is the address of the 'struct thread' in RDA, so you can
+ actually mess with it further if you want. */
+static const char *
+thread_debug_name (struct gdbserv_thread *thread)
+{
+ if (thread)
+ {
+ static char buf[100];
+ sprintf (buf, "(0x%lx %s %d %p)",
+ (unsigned long) thread->ti.ti_tid,
+ thread_db_state_str (thread->ti.ti_state),
+ thread->ti.ti_lid,
+ thread);
+ return buf;
+ }
+ else
+ return "(null thread)";
+}
/* flag which indicates if the map_id2thr cache is valid. See below. */
static int thread_db_map_id2thr_cache_valid;
@@ -551,6 +585,30 @@ thread_db_invalidate_map_id2thr_cache (void)
thread_db_map_id2thr_cache_valid = 0;
}
+static struct gdbserv_thread *
+thread_list_lookup_by_lid (lwpid_t pid)
+{
+ struct gdbserv_thread *t;
+ struct gdbserv_thread *second_choice = NULL;
+
+ /* Ideally, we'd be using td_ta_map_lwp2thr here. */
+
+ for (t = thread_list; t; t = t->next)
+ if (t->ti.ti_lid == pid)
+ {
+ /* libthread_db reports the ti_lid of a deceased thread as
+ being equal to ps_getpid (&proc_handle). So be a bit
+ skeptical of those. */
+ if (pid == proc_handle.pid
+ && (t->ti.ti_state == TD_THR_ZOMBIE
+ || t->ti.ti_state == TD_THR_UNKNOWN))
+ second_choice = t;
+ else return t;
+ }
+
+ return second_choice;
+}
+
/* The regset cache object. This object keeps track of the most
recently fetched or set gregset (of a particular type) and whether
or not it needs to still needs to be synchronized with the target. */
@@ -1301,13 +1359,29 @@ thread_db_detach (struct gdbserv *serv, struct gdbserv_target *target)
static void
attach_thread (struct gdbserv_thread *thread)
{
- if (thread->ti.ti_lid != 0 &&
- thread->ti.ti_state != TD_THR_ZOMBIE) /* Don't attach a zombie. */
+ if (thread->ti.ti_lid != 0)
{
- if (attach_lwp (thread->ti.ti_lid) == 0)
- thread->attached = 1;
- else
- thread->attached = 0;
+ /* We attach to all threads with a plausible LWP PID, including
+ TD_THR_ZOMBIE threads. libthread_db sometimes reports
+ threads still executing cleanups or thread-specific data
+ destructors as zombies, so it may be important to attach to
+ them.
+
+ libthread_db never reports an invalid LWP PID in ti.ti_lid,
+ even when the LWP has exited --- in that case, it returns
+ ps_getpid (&proc_handle). The LWP pool code tolerates
+ multiple requests to attach to the same PID. */
+ int status = lwp_pool_attach (thread->ti.ti_lid);
+
+ /* If we're using signals to communicate with the thread
+ library, send the newly attached thread the restart
+ signal. It will remain stopped, but it will receive the
+ signal as soon as we continue it. */
+ if (got_thread_signals)
+ {
+ if (status == 1)
+ kill_lwp (thread->ti.ti_lid, restart_signal);
+ }
}
}
@@ -1339,12 +1413,7 @@ find_new_threads_callback (const td_thrhandle_t *thandle, void *data)
if (thread_db_noisy)
fprintf (stderr, "(new thread %s)\n", thread_debug_name (thread));
- /* Now make sure we've attached to it.
- Skip the main pid (already attached). */
- if (thread->ti.ti_lid != proc_handle.pid)
- {
- attach_thread (thread);
- }
+ attach_thread (thread);
if (using_thread_db_events)
{
@@ -1372,7 +1441,7 @@ find_new_threads_callback (const td_thrhandle_t *thandle, void *data)
If not, prune it from the list. */
static void
-update_thread_list (void)
+update_thread_list (struct child_process *process)
{
struct gdbserv_thread *thread, *next;
td_thrhandle_t handle;
@@ -1404,6 +1473,9 @@ update_thread_list (void)
/* Thread is no longer "valid".
By the time this happens, it's too late for us to
detach from it. Just delete it from the list. */
+
+ if (thread == process->focus_thread)
+ process->focus_thread = NULL;
delete_thread_from_list (thread);
}
@@ -1422,7 +1494,8 @@ thread_db_thread_next (struct gdbserv *serv, struct gdbserv_thread *thread)
/* First request -- build up thread list using td_ta_thr_iter. */
/* NOTE: this should be unnecessary, once we begin to keep the
list up to date all the time. */
- update_thread_list ();
+ struct child_process *process = gdbserv_target_data (serv);
+ update_thread_list (process);
}
return next_thread_in_list (thread);
}
@@ -1600,424 +1673,52 @@ thread_db_thread_info (struct gdbserv *serv, struct gdbserv_thread *thread)
{
char *info = malloc (128);
- sprintf (info, "PID %d Type %s State %s",
- thread->ti.ti_lid,
+ /* When a thread's LWP has exited, NPTL reports its ti_lid as
+ being equal to that of the main process. Which is a little
+ confusing. So print the pid in a helpfully detailed way. */
+ sprintf (info, "Type %s State %s PID %d%s",
thread_db_type_str (thread->ti.ti_type),
- thread_db_state_str (thread->ti.ti_state));
- return info;
-}
+ thread_db_state_str (thread->ti.ti_state),
+ thread->ti.ti_lid,
+ (thread->ti.ti_lid == proc_handle.pid ? " (main)" : ""));
-/* Function: stop_thread
- Use SIGSTOP to force a thread to stop. */
-
-static void
-stop_thread (struct gdbserv_thread *thread)
-{
- if (thread->ti.ti_lid != 0)
- {
- if (thread_db_noisy)
- fprintf (stderr, "(stop thread %s)\n", thread_debug_name (thread));
- if (stop_lwp (thread->ti.ti_lid) == 0)
- thread->stopped = 1;
- else
- thread->stopped = 0;
- }
-}
-
-/* Function: stop_all_threads
- Use SIGSTOP to make sure all child threads are stopped.
- Do not send SIGSTOP to the event thread, or to any
- new threads that have just been attached. */
-
-static void
-stop_all_threads (struct child_process *process)
-{
- struct gdbserv_thread *thread;
-
- for (thread = first_thread_in_list ();
- thread;
- thread = next_thread_in_list (thread))
- {
- if (thread->ti.ti_lid == process->pid)
- {
- /* HACK: mark him stopped.
- It would make more sense to do this in
- thread_db_check_child_state, where we received his
- waitstatus and thus know he's stopped. But that code is
- also used when we don't have a thread list yet, so the
- 'struct gdbserv_thread' whose 'stopped' flag we want to
- set may not exist. */
- thread->stopped = 1;
- continue; /* This thread is already stopped. */
- }
- /* All threads must be stopped, unless
- a) they have only just been attached, or
- b) they're already stopped. */
- if (!thread->attached && !thread->stopped &&
- thread->ti.ti_state != TD_THR_ZOMBIE &&
- thread->ti.ti_state != TD_THR_UNKNOWN)
- stop_thread (thread);
- }
-}
-
-/* A list of signals that have been prematurely sucked out of the threads.
- Because of the complexities of linux threads, we must send SIGSTOP to
- every thread, and then call waitpid on the thread to retrieve the
- SIGSTOP event. Sometimes another signal is pending on the thread,
- and we get that one by mistake. Throw all such signals into this
- list, and send them back to their respective threads once we're
- finished calling waitpid. */
-
-static struct event_list {
- struct gdbserv_thread *thread;
- union wait waited;
- int selected;
- int thread_db_event;
-} *pending_events;
-static int pending_events_listsize;
-static int pending_events_top;
-
-/* Function: add_pending_event
- Helper function for wait_all_threads.
-
- When we call waitpid for each thread (trying to consume the SIGSTOP
- events that we sent from stop_all_threads), we sometimes inadvertantly
- get other events that we didn't send. We pend these to a list, and
- then resend them to the child threads after our own SIGSTOP events
- have been consumed.
-
- This list will be used to choose which of the possible events
- will be returned to the debugger by check_child_status. */
-
-static void
-add_pending_event (struct gdbserv_thread *thread, union wait waited)
-{
- if (pending_events_top >= pending_events_listsize)
- {
- pending_events_listsize += 64;
- pending_events =
- realloc (pending_events,
- pending_events_listsize * sizeof (*pending_events));
- }
- pending_events [pending_events_top].thread = thread;
- pending_events [pending_events_top].waited = waited;
- pending_events [pending_events_top].selected = 0;
- pending_events [pending_events_top].thread_db_event = 0;
- pending_events_top ++;
-}
-
-
-/* Delete the I'th pending event. This will reorder events at indices
- I and higher, but not events whose indices are less than I.
-
- This function runs in constant time, so you can iterate through the
- whole pending event pool by deleting events as you process them.
- But the nice thing about this function is that you can also handle
- only selected events, and leave others for later. */
-static void
-delete_pending_event (int i)
-{
- /* You shouldn't ask to delete an event that's not actually in the
- list. */
- assert (0 <= i && i < pending_events_top);
-
- /* Copy the last element down into this element's position, unless
- this is the last element itself. */
- if (i < pending_events_top - 1)
- pending_events[i] = pending_events[pending_events_top - 1];
-
- /* Now the deleted space is at the end of the array. So just
- decrement the top pointer, and we're done. */
- pending_events_top--;
+ return info;
}
-/* Function: select_pending_event
- Helper function for thread_db_check_child_state.
-
- Having collected a list of events from various threads,
- choose one "favored event" to be returned to the debugger.
-
- Return non-zero if we selected an event, or zero if we couldn't
- find anything interesting to report. */
-
+/* If we are using the libthread_db event interface, and PROCESS is
+ stopped at an event breakpoint, handle the event.
+ If we've taken care of PROCESS's situation and it needs no further
+ attention, return non-zero. If PROCESS still needs attention (say,
+ because we're not using the event interface, or PROCESS didn't in
+ fact hit an event breakpoint, or it did but had new interesting
+ things happen when we tried to single-step it), return zero. */
static int
-select_pending_event (struct child_process *process)
-{
- int i = 0;
- int num_wifstopped_events = 0;
- int random_key;
-
- /* Select the event that will be returned to the debugger. */
-
- /* Selection criterion #0:
- If there are no events, don't do anything! (paranoia) */
- if (pending_events_top == 0)
- {
- if (thread_db_noisy)
- fprintf (stderr, "(selected nothing)\n");
- return 0;
- }
-
- /* Selection criterion #1:
- If the thread pointer is null, then the thread library is
- not in play yet, so this is the only thread and the only event. */
- if (pending_events[0].thread == NULL)
- {
- i = 0;
- goto selected;
- }
-
- /* Selection criterion #2:
- Exit and terminate events take priority. */
- for (i = 0; i < pending_events_top; i++)
- if (WIFEXITED (pending_events[i].waited) ||
- WIFSIGNALED (pending_events[i].waited))
- {
- goto selected;
- }
-
- /* Selection criterion #3:
- Give priority to a stepping SIGTRAP. */
- for (i = 0; i < pending_events_top; i++)
- if (pending_events[i].thread->stepping &&
- WIFSTOPPED (pending_events[i].waited) &&
- WSTOPSIG (pending_events[i].waited) == SIGTRAP)
- {
- /* We don't actually know whether this sigtrap was the result
- of a singlestep, or of executing a trap instruction. But
- GDB has a better chance of figuring it out than we do. */
- goto selected;
- }
-
- /* Selection criterion #4:
- Count the WIFSTOPPED events and choose one at random. */
- for (i = 0; i < pending_events_top; i++)
- if (WIFSTOPPED (pending_events[i].waited))
- num_wifstopped_events ++;
-
- random_key = (int)
- ((num_wifstopped_events * (double) rand ()) / (RAND_MAX + 1.0));
-
- for (i = pending_events_top - 1; i >= 0; i--)
- if (WIFSTOPPED (pending_events[i].waited))
- {
- if (random_key == --num_wifstopped_events)
- {
- goto selected;
- }
- else if (WSTOPSIG (pending_events[i].waited) == SIGINT)
- {
- goto selected; /* Give preference to SIGINT. */
- }
- }
-
- /* Selection criterion #4 (should never get here):
- If all else fails, take the first event in the list. */
- i = 0;
-
- selected: /* Got our favored event. */
-
- if (thread_db_noisy)
- fprintf (stderr, "(selected %s)\n",
- thread_debug_name (pending_events[i].thread));
-
- pending_events[i].selected = 1;
- process->event_thread = pending_events[i].thread;
- if (pending_events[i].thread)
- process->pid = pending_events[i].thread->ti.ti_lid;
-
- handle_waitstatus (process, pending_events[i].waited);
- if (thread_db_noisy)
- fprintf (stderr, "<select_pending_event: pid %d '%c' %d>\n",
- process->pid, process->stop_status, process->stop_signal);
- return 1;
-}
-
-/* Function: send_pending_signals
- Helper function for thread_db_check_child_state.
-
- When we call waitpid for each thread (trying to consume the SIGSTOP
- events that we sent from stop_all_threads), we sometimes inadvertantly
- get other events that we didn't send. We pend these to a list, and
- then resend them to the child threads after our own SIGSTOP events
- have been consumed.
-
- Some events in the list require special treatment:
- * One event is "selected" to be returned to the debugger.
- Skip that one.
- * Trap events may represent breakpoints. We can't just resend
- the signal. Instead we must arrange for the breakpoint to be
- hit again when the thread resumes. */
-
-static void
-send_pending_signals (struct child_process *process)
+handle_thread_db_event (struct child_process *process)
{
- int i;
- int signum;
-
- for (i = 0; i < pending_events_top; i++)
- {
- if (WIFSTOPPED (pending_events[i].waited) &&
- ! pending_events[i].selected)
- {
- signum = WSTOPSIG (pending_events[i].waited);
- if (signum == SIGTRAP &&
- pending_events[i].thread->stepping == 0)
- {
- /* Breakpoint. Push it back. */
- if (thread_db_noisy)
- fprintf (stderr, "<send_pending_events: pushing back SIGTRAP for %d>\n",
- pending_events[i].thread->ti.ti_lid);
- decr_pc_after_break (process->serv,
- pending_events[i].thread->ti.ti_lid);
- }
- else /* FIXME we're letting SIGINT go thru as normal */
- {
- /* Put the signal back into the child's queue. */
- kill (pending_events[i].thread->ti.ti_lid,
- WSTOPSIG (pending_events[i].waited));
- }
- }
- }
- pending_events_top = 0;
-}
-
-/* Function: wait_all_threads
- Use waitpid to close the loop on all threads that have been
- attached or SIGSTOP'd. Skip the eventpid -- it's already been waited.
-
- Special considerations:
- The debug signal does not go into the event queue,
- does not get forwarded to the thread etc. */
-
-static void
-wait_all_threads (struct child_process *process)
-{
- struct gdbserv_thread *thread;
- union wait w;
- int ret, stopsig;
-
- for (thread = first_thread_in_list ();
- thread;
- thread = next_thread_in_list (thread))
- {
- /* Special handling for the thread that has already been waited. */
- if (thread->ti.ti_lid == process->pid)
- {
- /* HACK mark him waited. */
- thread->waited = 1;
- continue;
- }
-
- while ((thread->stopped || thread->attached) &&
- !thread->waited)
- {
- errno = 0;
- if (thread_db_noisy)
- fprintf (stderr, "(waiting for %s)\n",
- thread_debug_name (thread));
- ret = waitpid (thread->ti.ti_lid, (int *) &w,
- thread->ti.ti_lid == proc_handle.pid ? 0 : __WCLONE);
- if (ret == -1)
- {
- if (errno == ECHILD)
- fprintf (stderr, "<wait_all_threads: %d has disappeared>\n",
- thread->ti.ti_lid);
- else
- fprintf (stderr, "<wait_all_threads: waitpid %d failed, '%s'>\n",
- thread->ti.ti_lid, strerror (errno));
- break;
- }
- if (WIFEXITED (w))
- {
- add_pending_event (thread, w);
- fprintf (stderr, "<wait_all_threads: %d has exited>\n",
- thread->ti.ti_lid);
- break;
- }
- if (WIFSIGNALED (w))
- {
- add_pending_event (thread, w);
- fprintf (stderr, "<wait_all_threads: %d died with signal %d>\n",
- thread->ti.ti_lid, WTERMSIG (w));
- break;
- }
- stopsig = WSTOPSIG (w);
- switch (stopsig) {
- case SIGSTOP:
- /* This is the one we're looking for.
- Mark the thread as 'waited' and move on to the next thread. */
-#if 0 /* too noisy! */
- if (thread_db_noisy)
- fprintf (stderr, "<waitpid (%d, SIGSTOP)>\n", thread->ti.ti_lid);
-#endif
- thread->waited = 1;
- break;
- default:
- if (stopsig == debug_signal)
- {
- /* This signal does not need to be forwarded. */
- if (thread_db_noisy)
- fprintf (stderr, "<wait_all_threads: ignoring SIGDEBUG (%d) for %d>\n",
- debug_signal,
- thread->ti.ti_lid);
- }
- else
- {
- if (thread_db_noisy)
- fprintf (stderr, "<wait_all_threads: stash sig %d for %d at 0x%08lx>\n",
- stopsig, thread->ti.ti_lid,
- (unsigned long) debug_get_pc (process->serv,
- thread->ti.ti_lid));
- add_pending_event (thread, w);
- }
- }
-
- if (!thread->waited) /* Signal was something other than STOP. */
- {
- /* Continue the thread so it can stop on the next signal. */
- continue_lwp (thread->ti.ti_lid, 0);
- }
- }
- }
-}
-
+ struct gdbserv *serv = process->serv;
+ struct gdbserv_thread *thread = process->event_thread;
+ lwpid_t lwp;
+ union wait w;
-/* Scan the list for threads that have stopped at libthread_db event
- breakpoints, process the events they're reporting, and step the
- threads past the breakpoints, updating the pending_events
- table.
+ /* We need to be actually using the event interface. */
+ if (! using_thread_db_events)
+ return 0;
- This function assumes that all threads have been stopped. */
-static void
-handle_thread_db_events (struct child_process *process)
-{
- struct gdbserv *serv = process->serv;
- int i;
- int any_events;
+ /* We need a thread to work on. */
+ if (! thread)
+ return 0;
- /* Are there any threads at all stopped at libthread_db event
- breakpoints? */
- any_events = 0;
- for (i = 0; i < pending_events_top; i++)
- {
- struct event_list *e = &pending_events[i];
- if (e->thread
- && WIFSTOPPED (e->waited)
- && WSTOPSIG (e->waited) == SIGTRAP
- && hit_thread_db_event_breakpoint (serv, e->thread))
- {
- any_events = 1;
- e->thread_db_event = 1;
- }
- }
+ /* It needs to be stopped at an event breakpoint. */
+ if (! (process->stop_status == 'T'
+ && process->stop_signal == SIGTRAP
+ && hit_thread_db_event_breakpoint (serv, thread)))
+ return 0;
- if (! any_events)
- return;
+ lwp = thread->ti.ti_lid;
- /* Consume events. */
+ /* Consume events from the queue. */
for (;;)
{
td_event_msg_t msg;
@@ -2034,69 +1735,79 @@ handle_thread_db_events (struct child_process *process)
}
/* The only messages we're concerned with are TD_CREATE and
- TD_DEATH. But since we call update_thread_list every time
- thread_db_check_child_state gets a wait status from waitpid,
- our list is always up to date, so we don't actually need to
- do anything with these messages.
+ TD_DEATH.
+
+ Every time thread_db_check_child_state gets a wait status
+ from waitpid, we call update_thread_list, so our list is
+ always up to date; we don't actually need to do anything with
+ these messages for our own sake.
+
+ However, the LWP pool module needs to be told when threads
+ are about to exit, since NPTL gives no kernel-level
+ indication of this. Threads just disappear.
(Ignore the question, for now, of how RDA loses when threads
spawn off new threads after we've updated our list, but
- before we've managed to send each of the threads on our list
- a SIGSTOP.) */
- }
+ before we've managed to send each of the LWP's a
+ SIGSTOP.) */
- /* Disable the event breakpoints while we step the threads across
- them. */
- delete_thread_db_event_breakpoints (serv);
-
- for (i = 0; i < pending_events_top;)
- {
- struct event_list *e = &pending_events[i];
- if (e->thread_db_event)
+ if (msg.event == TD_DEATH)
{
- struct gdbserv_thread *thread = e->thread;
- lwpid_t lwp = thread->ti.ti_lid;
- union wait w;
+ td_thrinfo_t ti;
+
+ status = td_thr_get_info_p (msg.th_p, &ti);
+ if (status != TD_OK)
+ {
+ fprintf (stderr,
+ "error getting thread info on dying thread: %s\n",
+ thread_db_err_str (status));
+ break;
+ }
- /* Delete this pending event. If appropriate, we'll add a
- new pending event below, but if stepping across the event
- breakpoint is successful, then this pending event, at
- least, has been addressed. */
- delete_pending_event (i);
+ /* Tell the LWP pool code that this thread's death has been
+ foretold. */
+ lwp_pool_thread_db_death_event ((pid_t) ti.ti_lid);
+ }
+ }
- /* Back up the thread, if needed. */
- decr_pc_after_break (serv, lwp);
+ /* Disable the event breakpoints while we step the thread across them. */
+ delete_thread_db_event_breakpoints (serv);
- /* Single-step the thread across the breakpoint. */
- singlestep_lwp (serv, lwp, 0);
+ /* Back up the thread, if needed. */
+ decr_pc_after_break (serv, lwp);
- /* Get a new status for that thread. */
- if (thread_db_noisy)
- fprintf (stderr, "(waiting after event bp step %s)\n",
- thread_debug_name (thread));
- if (waitpid (lwp, (int *) &w, lwp == proc_handle.pid ? 0 : __WCLONE)
- < 0)
- fprintf (stderr, "error waiting for thread %d after "
- "stepping over event breakpoint:\n%s",
- lwp, strerror (errno));
- else
- {
- /* If the result is a SIGTRAP signal, then that means
- the single-step proceeded normally. Otherwise, it's
- a new pending event. */
- if (WIFSTOPPED (w)
- && WSTOPSIG (w) == SIGTRAP)
- ;
- else
- add_pending_event (thread, w);
- }
- }
- else
- i++;
+ /* Single-step the thread across the breakpoint. */
+ lwp_pool_singlestep_lwp (serv, lwp, 0);
+
+ /* Get a new status for that thread. */
+ if (thread_db_noisy)
+ fprintf (stderr, "(waiting after event bp step %s)\n",
+ thread_debug_name (thread));
+ if (lwp_pool_waitpid (lwp, (int *) &w, 0) < 0)
+ {
+ fprintf (stderr, "error waiting for thread %d after "
+ "stepping over event breakpoint:\n%s",
+ lwp, strerror (errno));
+ /* We don't have any new status to report... */
+ return 1;
}
+ /* Tell the LWP pool that this thread has notified RDA of an event. */
+ lwp_pool_thread_db_death_notified (lwp);
+
/* Re-insert the event breakpoints. */
insert_thread_db_event_breakpoints (serv);
+
+ /* If the wait status is a SIGTRAP signal, then that means the
+ single-step proceeded normally. Otherwise, it's a new event we
+ should deal with. */
+ if (WIFSTOPPED (w) && WSTOPSIG (w) == SIGTRAP)
+ return 1;
+ else
+ {
+ handle_waitstatus (process, w);
+ return 0;
+ }
}
@@ -2108,37 +1819,10 @@ continue_thread (struct gdbserv_thread *thread, int signal)
{
thread_db_flush_regset_caches();
- /* Continue thread only if (a) it was just attached, or
- (b) we stopped it and waited for it. */
if (thread->ti.ti_lid != 0)
- if (thread->attached || (thread->stopped && thread->waited))
- {
- continue_lwp (thread->ti.ti_lid, signal);
- thread->stopped = thread->attached = thread->waited = 0;
- }
- thread_db_invalidate_caches ();
-}
-
-/* Function: continue_all_threads
- Send continue to all stopped or attached threads
- except the event thread (which will be continued separately). */
+ lwp_pool_continue_lwp (thread->ti.ti_lid, signal);
-static void
-continue_all_threads (struct gdbserv *serv)
-{
- struct gdbserv_thread *thread;
-
- for (thread = first_thread_in_list ();
- thread;
- thread = next_thread_in_list (thread))
- {
- /* If we're using signals to communicate with the thread
- library, send any newly attached thread the restart signal. */
- if (got_thread_signals && thread->attached)
- continue_thread (thread, restart_signal);
- else
- continue_thread (thread, 0);
- }
+ thread_db_invalidate_caches ();
}
/* Function: continue_program
@@ -2154,17 +1838,19 @@ thread_db_continue_program (struct gdbserv *serv)
/* First resume the event thread. */
if (process->event_thread)
- continue_thread (process->event_thread, process->signal_to_send);
+ continue_thread (process->event_thread, process->signal_to_send);
else
- continue_lwp (process->pid, process->signal_to_send);
+ lwp_pool_continue_lwp (process->pid, process->signal_to_send);
process->stop_signal = process->stop_status =
process->signal_to_send = 0;
/* Then resume everyone else. */
- continue_all_threads (serv);
+ lwp_pool_continue_all ();
process->running = 1;
thread_db_invalidate_caches ();
+
+ process->focus_thread = NULL;
}
/* Function: singlestep_thread
@@ -2175,9 +1861,7 @@ singlestep_thread (struct gdbserv *serv,
struct gdbserv_thread *thread,
int signal)
{
- singlestep_lwp (serv, thread->ti.ti_lid, signal);
- thread->stopped = thread->attached = thread->waited = 0;
- thread->stepping = 1;
+ lwp_pool_singlestep_lwp (serv, thread->ti.ti_lid, signal);
}
/* Function: singlestep_program
@@ -2196,15 +1880,17 @@ thread_db_singlestep_program (struct gdbserv *serv)
if (process->event_thread)
singlestep_thread (serv, process->event_thread, process->signal_to_send);
else
- singlestep_lwp (serv, process->pid, process->signal_to_send);
+ lwp_pool_singlestep_lwp (serv, process->pid, process->signal_to_send);
process->stop_status = process->stop_signal =
process->signal_to_send = 0;
/* Then resume everyone else. */
- continue_all_threads (serv); /* All but the event thread. */
+ lwp_pool_continue_all ();
process->running = 1;
thread_db_invalidate_caches ();
+
+ process->focus_thread = NULL;
}
/* Function: thread_db_continue_thread
@@ -2240,6 +1926,11 @@ thread_db_continue_thread (struct gdbserv *serv,
process->running = 1;
}
thread_db_invalidate_caches ();
+
+ /* If we continued a particular thread, then collect wait statuses
+ for that thread only. Otherwise, look for events from
+ everyone. */
+ process->focus_thread = thread;
}
/* Function: singlestep_thread
@@ -2274,6 +1965,10 @@ thread_db_singlestep_thread (struct gdbserv *serv,
process->running = 1;
}
thread_db_invalidate_caches ();
+
+ /* If we stepped a particular thread, then collect wait statuses for
+ that thread only. Otherwise, look for events from everyone. */
+ process->focus_thread = thread;
}
/* Function: exit_program
@@ -2323,17 +2018,19 @@ thread_db_check_child_state (struct child_process *process)
if (process->running)
{
- eventpid = waitpid (-1, (int *) &w, WNOHANG);
- /* If no event on main thread, check clone threads.
- It doesn't matter what event we find first, since we now have
- a fair algorithm for choosing which event to handle next. */
- if (eventpid <= 0)
- eventpid = waitpid (-1, (int *) &w, WNOHANG | __WCLONE);
+ eventpid = -1;
+
+ /* If we only stepped or continued a single thread, check for
+ status results only from that thread, even though there may
+ be others collected from before. */
+ if (process->focus_thread)
+ eventpid = lwp_pool_waitpid (process->focus_thread->ti.ti_lid,
+ (int *) &w, WNOHANG);
+ else
+ eventpid = lwp_pool_waitpid (-1, (int *) &w, WNOHANG);
if (eventpid > 0) /* found an event */
{
- int selected_anything;
-
/* Allow underlying target to use the event process by default,
since it is stopped and the others are still running. */
process->pid = eventpid;
@@ -2353,54 +2050,48 @@ thread_db_check_child_state (struct child_process *process)
return 0; /* Just a thread exit, don't tell GDB. */
}
- /* FIXME: this debugging output will be removed soon, but
- putting it here before the update_thread_list etc. is
- bad from the point of view of synchronization. */
- handle_waitstatus (process, w);
+ /* It doesn't hurt to call this twice. But if there are a
+ lot of other threads running, then RDA is competing with
+ them for time slices and it can take a long time for the
+ thread list update to complete. */
+ lwp_pool_stop_all ();
+
if (thread_db_noisy)
fprintf (stderr,
"\n<check_child_state: %d got '%c' - %d at 0x%08lx>\n",
- process->pid, process->stop_status, process->stop_signal,
+ process->pid,
+ process->stop_status,
+ process->stop_signal,
(unsigned long) debug_get_pc (process->serv, process->pid));
- /* It shouldn't hurt to call this twice. But if there are a
- lot of other threads running, it can take a *long* time
- for the thread list update to complete. */
- stop_all_threads (process);
/* Update the thread list. */
- update_thread_list ();
+ update_thread_list (process);
+
+ process->event_thread = thread_list_lookup_by_lid (process->pid);
/* For now, call get_thread_signals from here (FIXME:) */
get_thread_signals ();
- /* Put this child's event into the pending list. */
- add_pending_event (thread_list_lookup_by_lid ((lwpid_t) eventpid),
- w);
+ /* Stop any new threads we've recognized. */
+ lwp_pool_stop_all ();
- stop_all_threads (process);
- wait_all_threads (process);
- if (using_thread_db_events)
- handle_thread_db_events (process);
- selected_anything = select_pending_event (process);
- send_pending_signals (process);
-
- /* If there weren't any pending events to report, then
- continue the program, and let the main loop know that
- nothing interesting happened. */
- if (! selected_anything)
+ /* If we're using the thread_db event interface, and this is
+ a thread_db event, then just handle it silently and
+ continue. */
+ if (handle_thread_db_event (process))
{
currentvec->continue_program (serv);
return 0;
}
- /* Note: if more than one thread has an event ready to be
- handled, wait_all_threads will have chosen one at random. */
-
+ /* If we're using the signal-based interface, and someone
+ got a thread-related signal, then deal with that. */
if (got_thread_signals && ignore_thread_signal (process))
{
/* Ignore this signal, restart the child. */
if (thread_db_noisy)
- fprintf (stderr, "<check_child_state: ignoring signal %d for %d>\n",
+ fprintf (stderr,
+ "<check_child_state: ignoring signal %d for %d>\n",
process->stop_signal, process->pid);
if (process->stop_signal == debug_signal)
{
@@ -2429,23 +2120,8 @@ thread_db_check_child_state (struct child_process *process)
return 0;
}
- if (process->stop_status == 'W')
- {
- if (process->pid == proc_handle.pid)
- return 1; /* Main thread exited! */
- else
- {
- currentvec->continue_program (serv);
- return 0; /* Just a thread exit, don't tell GDB. */
- }
- }
-
process->running = 0;
- /* This is the place to cancel its 'stepping' flag. */
- if (process && process->event_thread)
- process->event_thread->stepping = 0;
-
/* Pass this event back to GDB. */
if (process->debug_backend)
fprintf (stderr, "wait returned '%c' (%d) for %d.\n",
@@ -2863,6 +2539,12 @@ thread_db_attach (struct gdbserv *serv, struct gdbserv_target *target)
gdbserver.fromtarget_break = thread_db_fromtarget_thread_break;
/* FIXME what about terminate and exit? */
+ /* Record the initial thread's pid in the LWP pool. */
+ lwp_pool_new_stopped (process->pid);
+
+ /* Initially, there is no focus thread. */
+ process->focus_thread = NULL;
+
/* Set up the regset caches. */
initialize_regset_caches ();
return 0; /* success */