summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronniesahlberg@gmail.com>2012-04-26 08:09:23 +1000
committerRonnie Sahlberg <ronniesahlberg@gmail.com>2012-04-26 08:09:23 +1000
commitdb411aaada39593c80f92e46be31d3473bf4639f (patch)
treef68222404db2155cc6d8d3f861ac486cb8a509ae
parent58e10b280d4a94a812bad07bbca049cddb2c1174 (diff)
parent195cf3c87e3c6c9f1784aa483110a64bc8760703 (diff)
downloadsamba-db411aaada39593c80f92e46be31d3473bf4639f.tar.gz
samba-db411aaada39593c80f92e46be31d3473bf4639f.tar.xz
samba-db411aaada39593c80f92e46be31d3473bf4639f.zip
Merge remote branch 'amitay/tevent-sync'
(This used to be ctdb commit 17ff3f240b0d72c72ed28d70fb9aeb3b20c80670)
-rw-r--r--ctdb/client/ctdb_client.c1
-rw-r--r--ctdb/common/cmdline.c1
-rw-r--r--ctdb/common/ctdb_io.c1
-rw-r--r--ctdb/common/ctdb_logging.c1
-rw-r--r--ctdb/common/ctdb_ltdb.c1
-rw-r--r--ctdb/common/ctdb_message.c1
-rw-r--r--ctdb/common/ctdb_util.c1
-rw-r--r--ctdb/common/system_freebsd.c1
-rw-r--r--ctdb/common/system_gnu.c1
-rw-r--r--ctdb/common/system_kfreebsd.c1
-rw-r--r--ctdb/common/system_linux.c1
-rw-r--r--ctdb/ib/ibw_ctdb.c1
-rw-r--r--ctdb/ib/ibw_ctdb_init.c1
-rw-r--r--ctdb/ib/ibwrapper_test.c1
-rw-r--r--ctdb/include/includes.h7
-rw-r--r--ctdb/lib/tevent/ABI/tevent-0.9.15.sigs (renamed from ctdb/lib/tevent/ABI/tevent-0.9.9.sigs)5
-rw-r--r--ctdb/lib/tevent/Makefile.in79
l---------ctdb/lib/tevent/autogen-waf.sh1
-rwxr-xr-xctdb/lib/tevent/autogen.sh13
-rw-r--r--ctdb/lib/tevent/build_macros.m414
-rwxr-xr-xctdb/lib/tevent/config.guess1561
-rwxr-xr-xctdb/lib/tevent/config.sub1686
-rw-r--r--ctdb/lib/tevent/configure.ac25
-rw-r--r--ctdb/lib/tevent/doc/mainpage.dox2
-rwxr-xr-xctdb/lib/tevent/install-sh238
-rw-r--r--ctdb/lib/tevent/libtalloc.m47
-rw-r--r--ctdb/lib/tevent/libtevent.m47
-rw-r--r--ctdb/lib/tevent/pkg.m4156
-rwxr-xr-xctdb/lib/tevent/release-script.sh48
-rw-r--r--ctdb/lib/tevent/rules.mk18
-rw-r--r--ctdb/lib/tevent/samba.m411
-rwxr-xr-xctdb/lib/tevent/script/abi_checks.sh91
-rwxr-xr-xctdb/lib/tevent/script/abi_checks_gcc.sh31
-rwxr-xr-xctdb/lib/tevent/script/mksigs.pl183
-rw-r--r--ctdb/lib/tevent/script/mksyms.awk75
-rwxr-xr-xctdb/lib/tevent/script/mksyms.sh45
-rw-r--r--ctdb/lib/tevent/testsuite.c4
-rw-r--r--ctdb/lib/tevent/tevent.c23
-rw-r--r--ctdb/lib/tevent/tevent.exports62
-rw-r--r--ctdb/lib/tevent/tevent.h368
-rw-r--r--ctdb/lib/tevent/tevent.mk46
-rw-r--r--ctdb/lib/tevent/tevent.signatures57
-rw-r--r--ctdb/lib/tevent/tevent_epoll.c26
-rw-r--r--ctdb/lib/tevent/tevent_fd.c6
-rw-r--r--ctdb/lib/tevent/tevent_internal.h9
-rw-r--r--ctdb/lib/tevent/tevent_poll.c312
-rw-r--r--ctdb/lib/tevent/tevent_queue.c99
-rw-r--r--ctdb/lib/tevent/tevent_req.c19
-rw-r--r--ctdb/lib/tevent/tevent_select.c14
-rw-r--r--ctdb/lib/tevent/tevent_signal.c42
-rw-r--r--ctdb/lib/tevent/tevent_standard.c27
-rw-r--r--ctdb/lib/tevent/tevent_timed.c4
-rw-r--r--ctdb/lib/tevent/tevent_util.c58
-rw-r--r--ctdb/lib/tevent/tevent_util.h5
-rw-r--r--ctdb/lib/tevent/wscript75
-rw-r--r--ctdb/lib/util/db_wrap.c1
-rw-r--r--ctdb/server/ctdb_banning.c1
-rw-r--r--ctdb/server/ctdb_call.c1
-rw-r--r--ctdb/server/ctdb_control.c1
-rw-r--r--ctdb/server/ctdb_daemon.c1
-rw-r--r--ctdb/server/ctdb_freeze.c1
-rw-r--r--ctdb/server/ctdb_keepalive.c1
-rw-r--r--ctdb/server/ctdb_lockwait.c1
-rw-r--r--ctdb/server/ctdb_logging.c1
-rw-r--r--ctdb/server/ctdb_ltdb_server.c1
-rw-r--r--ctdb/server/ctdb_monitor.c1
-rw-r--r--ctdb/server/ctdb_persistent.c1
-rw-r--r--ctdb/server/ctdb_recover.c1
-rw-r--r--ctdb/server/ctdb_recoverd.c1
-rw-r--r--ctdb/server/ctdb_server.c1
-rw-r--r--ctdb/server/ctdb_statistics.c1
-rw-r--r--ctdb/server/ctdb_takeover.c1
-rw-r--r--ctdb/server/ctdb_traverse.c1
-rw-r--r--ctdb/server/ctdb_update_record.c1
-rw-r--r--ctdb/server/ctdb_uptime.c1
-rw-r--r--ctdb/server/ctdb_vacuum.c2
-rw-r--r--ctdb/server/ctdbd.c1
-rw-r--r--ctdb/server/eventscript.c1
-rw-r--r--ctdb/tcp/tcp_connect.c1
-rw-r--r--ctdb/tcp/tcp_init.c1
-rw-r--r--ctdb/tcp/tcp_io.c1
-rw-r--r--ctdb/tests/src/ctdb_bench.c1
-rw-r--r--ctdb/tests/src/ctdb_fetch.c1
-rw-r--r--ctdb/tests/src/ctdb_fetch_one.c1
-rw-r--r--ctdb/tests/src/ctdb_fetch_readonly_loop.c1
-rw-r--r--ctdb/tests/src/ctdb_persistent.c1
-rw-r--r--ctdb/tests/src/ctdb_randrec.c1
-rw-r--r--ctdb/tests/src/ctdb_store.c1
-rw-r--r--ctdb/tests/src/ctdb_test.c7
-rw-r--r--ctdb/tests/src/ctdb_tool_stubby.c11
-rw-r--r--ctdb/tests/src/ctdb_trackingdb_test.c1
-rw-r--r--ctdb/tests/src/ctdb_transaction.c1
-rw-r--r--ctdb/tests/src/ctdb_traverse.c1
-rw-r--r--ctdb/tests/src/ctdb_update_record.c1
-rw-r--r--ctdb/tests/src/ctdb_update_record_persistent.c1
-rw-r--r--ctdb/tests/src/ctdbd_test.c1
-rw-r--r--ctdb/tests/src/rb_test.c1
-rw-r--r--ctdb/tools/ctdb.c1
-rw-r--r--ctdb/tools/ctdb_vacuum.c1
-rw-r--r--ctdb/utils/pmda/pmda_ctdb.c1
100 files changed, 884 insertions, 4751 deletions
diff --git a/ctdb/client/ctdb_client.c b/ctdb/client/ctdb_client.c
index b01e258626..69b0a04888 100644
--- a/ctdb/client/ctdb_client.c
+++ b/ctdb/client/ctdb_client.c
@@ -22,7 +22,6 @@
#include "db_wrap.h"
#include "lib/tdb/include/tdb.h"
#include "lib/util/dlinklist.h"
-#include "lib/tevent/tevent.h"
#include "system/network.h"
#include "system/filesys.h"
#include "system/locale.h"
diff --git a/ctdb/common/cmdline.c b/ctdb/common/cmdline.c
index 5c00763ed7..59e8722196 100644
--- a/ctdb/common/cmdline.c
+++ b/ctdb/common/cmdline.c
@@ -18,7 +18,6 @@
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "system/filesys.h"
#include "popt.h"
#include "../include/ctdb_client.h"
diff --git a/ctdb/common/ctdb_io.c b/ctdb/common/ctdb_io.c
index 810fd41dd1..3ac1b63b75 100644
--- a/ctdb/common/ctdb_io.c
+++ b/ctdb/common/ctdb_io.c
@@ -22,7 +22,6 @@
#include "includes.h"
#include "lib/tdb/include/tdb.h"
-#include "lib/tevent/tevent.h"
#include "lib/util/dlinklist.h"
#include "system/network.h"
#include "system/filesys.h"
diff --git a/ctdb/common/ctdb_logging.c b/ctdb/common/ctdb_logging.c
index dee4dfdb36..e3299d3c0f 100644
--- a/ctdb/common/ctdb_logging.c
+++ b/ctdb/common/ctdb_logging.c
@@ -18,7 +18,6 @@
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "lib/tdb/include/tdb.h"
#include "system/time.h"
#include "../include/ctdb_private.h"
diff --git a/ctdb/common/ctdb_ltdb.c b/ctdb/common/ctdb_ltdb.c
index 3a184bb28c..dab88f3618 100644
--- a/ctdb/common/ctdb_ltdb.c
+++ b/ctdb/common/ctdb_ltdb.c
@@ -19,7 +19,6 @@
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "lib/tdb/include/tdb.h"
#include "system/network.h"
#include "system/filesys.h"
diff --git a/ctdb/common/ctdb_message.c b/ctdb/common/ctdb_message.c
index 03a4b55389..5fc7b22a49 100644
--- a/ctdb/common/ctdb_message.c
+++ b/ctdb/common/ctdb_message.c
@@ -21,7 +21,6 @@
protocol design and packet details
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "lib/tdb/include/tdb.h"
#include "system/network.h"
#include "system/filesys.h"
diff --git a/ctdb/common/ctdb_util.c b/ctdb/common/ctdb_util.c
index dadaf18f1e..5584c1732e 100644
--- a/ctdb/common/ctdb_util.c
+++ b/ctdb/common/ctdb_util.c
@@ -18,7 +18,6 @@
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "lib/tdb/include/tdb.h"
#include "system/network.h"
#include "system/filesys.h"
diff --git a/ctdb/common/system_freebsd.c b/ctdb/common/system_freebsd.c
index c72b6f8d9c..ed30f8ccb7 100644
--- a/ctdb/common/system_freebsd.c
+++ b/ctdb/common/system_freebsd.c
@@ -29,7 +29,6 @@
#include "system/filesys.h"
#include "system/wait.h"
#include "../include/ctdb_private.h"
-#include "lib/tevent/tevent.h"
#include <net/ethernet.h>
#include <netinet/ip6.h>
#include <net/if_arp.h>
diff --git a/ctdb/common/system_gnu.c b/ctdb/common/system_gnu.c
index 604bb4828f..7b8af340ec 100644
--- a/ctdb/common/system_gnu.c
+++ b/ctdb/common/system_gnu.c
@@ -28,7 +28,6 @@
#include "system/filesys.h"
#include "system/wait.h"
#include "../include/ctdb_private.h"
-#include "lib/tevent/tevent.h"
#include <net/ethernet.h>
#include <netinet/ip6.h>
#include <net/if_arp.h>
diff --git a/ctdb/common/system_kfreebsd.c b/ctdb/common/system_kfreebsd.c
index a6cd148e8a..9e2aa07112 100644
--- a/ctdb/common/system_kfreebsd.c
+++ b/ctdb/common/system_kfreebsd.c
@@ -28,7 +28,6 @@
#include "system/filesys.h"
#include "system/wait.h"
#include "../include/ctdb_private.h"
-#include "lib/tevent/tevent.h"
#include <net/ethernet.h>
#include <netinet/ip6.h>
#include <net/if_arp.h>
diff --git a/ctdb/common/system_linux.c b/ctdb/common/system_linux.c
index 464daef9ad..21f5d6c814 100644
--- a/ctdb/common/system_linux.c
+++ b/ctdb/common/system_linux.c
@@ -23,7 +23,6 @@
#include "system/filesys.h"
#include "system/wait.h"
#include "../include/ctdb_private.h"
-#include "lib/tevent/tevent.h"
#include <netinet/if_ether.h>
#include <netinet/ip6.h>
#include <netinet/icmp6.h>
diff --git a/ctdb/ib/ibw_ctdb.c b/ctdb/ib/ibw_ctdb.c
index 5664c193ac..2e70d1d8e5 100644
--- a/ctdb/ib/ibw_ctdb.c
+++ b/ctdb/ib/ibw_ctdb.c
@@ -21,7 +21,6 @@
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include <system/network.h>
#include <assert.h>
#include "ctdb_private.h"
diff --git a/ctdb/ib/ibw_ctdb_init.c b/ctdb/ib/ibw_ctdb_init.c
index fed1381f6d..066814d12f 100644
--- a/ctdb/ib/ibw_ctdb_init.c
+++ b/ctdb/ib/ibw_ctdb_init.c
@@ -21,7 +21,6 @@
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include <system/network.h>
#include <assert.h>
#include "ctdb_private.h"
diff --git a/ctdb/ib/ibwrapper_test.c b/ctdb/ib/ibwrapper_test.c
index eb0d58858f..ba54286ace 100644
--- a/ctdb/ib/ibwrapper_test.c
+++ b/ctdb/ib/ibwrapper_test.c
@@ -37,7 +37,6 @@
#include <time.h>
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "ib/ibwrapper.h"
struct ibwtest_ctx {
diff --git a/ctdb/include/includes.h b/ctdb/include/includes.h
index b7d1e76eb8..b5655335af 100644
--- a/ctdb/include/includes.h
+++ b/ctdb/include/includes.h
@@ -11,6 +11,13 @@
#include "idtree.h"
#include "ctdb_client.h"
+/* Allow use of deprecated function tevent_loop_allow_nesting() */
+#define TEVENT_DEPRECATED
+/* Saves ctdb from massive churn. */
+#define TEVENT_COMPAT_DEFINES 1
+
+#include "tevent.h"
+
typedef bool BOOL;
#define True 1
diff --git a/ctdb/lib/tevent/ABI/tevent-0.9.9.sigs b/ctdb/lib/tevent/ABI/tevent-0.9.15.sigs
index 9adaba579b..13c461cc56 100644
--- a/ctdb/lib/tevent/ABI/tevent-0.9.9.sigs
+++ b/ctdb/lib/tevent/ABI/tevent-0.9.15.sigs
@@ -14,6 +14,7 @@ _tevent_req_done: void (struct tevent_req *, const char *)
_tevent_req_error: bool (struct tevent_req *, uint64_t, const char *)
_tevent_req_nomem: bool (const void *, struct tevent_req *, const char *)
_tevent_req_notify_callback: void (struct tevent_req *, const char *)
+_tevent_req_oom: void (struct tevent_req *, const char *)
_tevent_schedule_immediate: void (struct tevent_immediate *, struct tevent_context *, tevent_immediate_handler_t, void *, const char *, const char *)
tevent_backend_list: const char **(TALLOC_CTX *)
tevent_cleanup_pending_signal_handlers: void (struct tevent_signal *)
@@ -40,12 +41,16 @@ tevent_fd_set_flags: void (struct tevent_fd *, uint16_t)
tevent_loop_allow_nesting: void (struct tevent_context *)
tevent_loop_set_nesting_hook: void (struct tevent_context *, tevent_nesting_hook, void *)
tevent_queue_add: bool (struct tevent_queue *, struct tevent_context *, struct tevent_req *, tevent_queue_trigger_fn_t, void *)
+tevent_queue_add_entry: struct tevent_queue_entry *(struct tevent_queue *, struct tevent_context *, struct tevent_req *, tevent_queue_trigger_fn_t, void *)
+tevent_queue_add_optimize_empty: struct tevent_queue_entry *(struct tevent_queue *, struct tevent_context *, struct tevent_req *, tevent_queue_trigger_fn_t, void *)
tevent_queue_length: size_t (struct tevent_queue *)
+tevent_queue_running: bool (struct tevent_queue *)
tevent_queue_start: void (struct tevent_queue *)
tevent_queue_stop: void (struct tevent_queue *)
tevent_re_initialise: int (struct tevent_context *)
tevent_register_backend: bool (const char *, const struct tevent_ops *)
tevent_req_default_print: char *(struct tevent_req *, TALLOC_CTX *)
+tevent_req_defer_callback: void (struct tevent_req *, struct tevent_context *)
tevent_req_is_error: bool (struct tevent_req *, enum tevent_req_state *, uint64_t *)
tevent_req_is_in_progress: bool (struct tevent_req *)
tevent_req_poll: bool (struct tevent_req *, struct tevent_context *)
diff --git a/ctdb/lib/tevent/Makefile.in b/ctdb/lib/tevent/Makefile.in
deleted file mode 100644
index f3deb9df45..0000000000
--- a/ctdb/lib/tevent/Makefile.in
+++ /dev/null
@@ -1,79 +0,0 @@
-#!gmake
-#
-# Makefile for tdb directory
-#
-
-CC = @CC@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-bindir = @bindir@
-includedir = @includedir@
-libdir = @libdir@
-VPATH = @srcdir@:@libreplacedir@
-srcdir = @srcdir@
-builddir = @builddir@
-sharedbuilddir = @sharedbuilddir@
-INSTALLCMD = @INSTALL@
-CPPFLAGS = @CPPFLAGS@ -I$(srcdir)/include -Iinclude -I.
-LDFLAGS = @LDFLAGS@
-EXEEXT = @EXEEXT@
-SHLD = @SHLD@
-SHLD_FLAGS = @SHLD_FLAGS@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PICFLAG = @PICFLAG@
-SHLIBEXT = @SHLIBEXT@
-LIB_PATH_VAR = @LIB_PATH_VAR@
-teventdir = @teventdir@
-
-TALLOC_CFLAGS = @TALLOC_CFLAGS@
-TALLOC_LDFLAGS = @TALLOC_CFLAGS@
-TALLOC_LIBS = @TALLOC_LIBS@
-
-TEVENT_CFLAGS = @TEVENT_CFLAGS@
-TEVENT_LDFLAGS = @TEVENT_CFLAGS@
-TEVENT_LIBS = @TEVENT_LIBS@
-
-CFLAGS = $(CPPFLAGS) $(TALLOC_CFLAGS) $(TEVENT_CFLAGS) @CFLAGS@
-LDFLAGS = $(TALLOC_LDFLAGS) $(TEVENT_LDFLAGS) @LDFLAGS@
-LIBS = $(TALLOC_LIBS) $(TEVENT_LIBS) @LIBS@
-
-TEVENT_OBJ = @TEVENT_OBJ@ @LIBREPLACEOBJ@
-
-SONAMEFLAG = @SONAMEFLAG@
-VERSIONSCRIPT = @VERSIONSCRIPT@
-EXPORTSFILE = @EXPORTSFILE@
-
-default: all
-
-include $(teventdir)/tevent.mk
-include $(teventdir)/rules.mk
-
-all:: showflags dirs $(PROGS) $(TEVENT_SOLIB) libtevent.a
-
-install:: all
-$(TEVENT_SOLIB): $(TEVENT_OBJ)
- $(SHLD) $(SHLD_FLAGS) $(LDFLAGS) $(LIBS) -o $@ $(TEVENT_OBJ) $(VERSIONSCRIPT) $(EXPORTSFILE) $(SONAMEFLAG)$(TEVENT_SONAME)
-
-shared-build: all
- ${INSTALLCMD} -d $(sharedbuilddir)/lib
- ${INSTALLCMD} -m 644 libtevent.a $(sharedbuilddir)/lib
- ${INSTALLCMD} -m 755 $(TEVENT_SOLIB) $(sharedbuilddir)/lib
- ln -sf $(TEVENT_SOLIB) $(sharedbuilddir)/lib/$(TEVENT_SONAME)
- ln -sf $(TEVENT_SOLIB) $(sharedbuilddir)/lib/libtevent.so
- ${INSTALLCMD} -d $(sharedbuilddir)/include
- ${INSTALLCMD} -m 644 $(srcdir)/tevent.h $(sharedbuilddir)/include
-
-check: test
-
-installcheck:: test install
-
-clean::
- rm -f *.o *.a */*.o
- rm -fr abi
-
-distclean:: clean
- rm -f config.log config.status config.h config.cache
- rm -f Makefile
-
-realdistclean:: distclean
- rm -f configure config.h.in
diff --git a/ctdb/lib/tevent/autogen-waf.sh b/ctdb/lib/tevent/autogen-waf.sh
deleted file mode 120000
index 99150f3a28..0000000000
--- a/ctdb/lib/tevent/autogen-waf.sh
+++ /dev/null
@@ -1 +0,0 @@
-../../buildtools/scripts/autogen-waf.sh \ No newline at end of file
diff --git a/ctdb/lib/tevent/autogen.sh b/ctdb/lib/tevent/autogen.sh
deleted file mode 100755
index e87940f90d..0000000000
--- a/ctdb/lib/tevent/autogen.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-
-rm -rf autom4te.cache
-rm -f configure config.h.in
-
-IPATHS="-I libreplace -I lib/replace -I ../libreplace -I ../replace -I ../../../lib/replace"
-autoconf $IPATHS || exit 1
-autoheader $IPATHS || exit 1
-
-rm -rf autom4te.cache
-
-echo "Now run ./configure and then make."
-exit 0
diff --git a/ctdb/lib/tevent/build_macros.m4 b/ctdb/lib/tevent/build_macros.m4
deleted file mode 100644
index 7d795d48c4..0000000000
--- a/ctdb/lib/tevent/build_macros.m4
+++ /dev/null
@@ -1,14 +0,0 @@
-AC_DEFUN(BUILD_WITH_SHARED_BUILD_DIR,
- [ AC_ARG_WITH([shared-build-dir],
- [AC_HELP_STRING([--with-shared-build-dir=DIR],
- [temporary build directory where libraries are installed [$srcdir/sharedbuild]])])
-
- sharedbuilddir="$srcdir/sharedbuild"
- if test x"$with_shared_build_dir" != x; then
- sharedbuilddir=$with_shared_build_dir
- CFLAGS="$CFLAGS -I$with_shared_build_dir/include"
- CPPFLAGS="$CPPFLAGS -I$with_shared_build_dir/include"
- LDFLAGS="$LDFLAGS -L$with_shared_build_dir/lib"
- fi
- AC_SUBST(sharedbuilddir)
- ])
diff --git a/ctdb/lib/tevent/config.guess b/ctdb/lib/tevent/config.guess
deleted file mode 100755
index 1e2ae580c2..0000000000
--- a/ctdb/lib/tevent/config.guess
+++ /dev/null
@@ -1,1561 +0,0 @@
-#! /bin/sh
-# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-# Free Software Foundation, Inc.
-
-timestamp='2009-04-27'
-
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Originally written by Per Bothner <per@bothner.com>.
-# Please send patches to <config-patches@gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
-#
-# This script attempts to guess a canonical system name similar to
-# config.sub. If it succeeds, it prints the system name on stdout, and
-# exits with 0. Otherwise, it exits with 1.
-#
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit build system type.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION]
-
-Output the configuration name of the system \`$me' is run on.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.guess ($timestamp)
-
-Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit ;;
- --version | -v )
- echo "$version" ; exit ;;
- --help | --h* | -h )
- echo "$usage"; exit ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help" >&2
- exit 1 ;;
- * )
- break ;;
- esac
-done
-
-if test $# != 0; then
- echo "$me: too many arguments$help" >&2
- exit 1
-fi
-
-trap 'exit 1' 1 2 15
-
-# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
-# compiler to aid in system detection is discouraged as it requires
-# temporary files to be created and, as you can see below, it is a
-# headache to deal with in a portable fashion.
-
-# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
-# use `HOST_CC' if defined, but it is deprecated.
-
-# Portable tmp directory creation inspired by the Autoconf team.
-
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,) echo "int x;" > $dummy.c ;
- for c in cc gcc c89 c99 ; do
- if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
- CC_FOR_BUILD="$c"; break ;
- fi ;
- done ;
- if test x"$CC_FOR_BUILD" = x ; then
- CC_FOR_BUILD=no_compiler_found ;
- fi
- ;;
- ,,*) CC_FOR_BUILD=$CC ;;
- ,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
-
-# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
- PATH=$PATH:/.attbin ; export PATH
-fi
-
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-
-# Note: order is significant - the case branches are not exclusive.
-
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
- *:NetBSD:*:*)
- # NetBSD (nbsd) targets should (where applicable) match one or
- # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
- # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
- # switched to ELF, *-*-netbsd* would select the old
- # object file format. This provides both forward
- # compatibility and a consistent mechanism for selecting the
- # object file format.
- #
- # Note: NetBSD doesn't particularly care about the vendor
- # portion of the name. We always set it to "unknown".
- sysctl="sysctl -n hw.machine_arch"
- UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
- /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
- case "${UNAME_MACHINE_ARCH}" in
- armeb) machine=armeb-unknown ;;
- arm*) machine=arm-unknown ;;
- sh3el) machine=shl-unknown ;;
- sh3eb) machine=sh-unknown ;;
- sh5el) machine=sh5le-unknown ;;
- *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
- esac
- # The Operating System including object format, if it has switched
- # to ELF recently, or will in the future.
- case "${UNAME_MACHINE_ARCH}" in
- arm*|i386|m68k|ns32k|sh3*|sparc|vax)
- eval $set_cc_for_build
- if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep __ELF__ >/dev/null
- then
- # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
- # Return netbsd for either. FIX?
- os=netbsd
- else
- os=netbsdelf
- fi
- ;;
- *)
- os=netbsd
- ;;
- esac
- # The OS release
- # Debian GNU/NetBSD machines have a different userland, and
- # thus, need a distinct triplet. However, they do not need
- # kernel version information, so it can be replaced with a
- # suitable tag, in the style of linux-gnu.
- case "${UNAME_VERSION}" in
- Debian*)
- release='-gnu'
- ;;
- *)
- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
- ;;
- esac
- # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
- # contains redundant information, the shorter form:
- # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
- echo "${machine}-${os}${release}"
- exit ;;
- *:OpenBSD:*:*)
- UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
- exit ;;
- *:ekkoBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
- exit ;;
- *:SolidBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
- exit ;;
- macppc:MirBSD:*:*)
- echo powerpc-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
- *:MirBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
- alpha:OSF1:*:*)
- case $UNAME_RELEASE in
- *4.0)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
- ;;
- *5.*)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
- ;;
- esac
- # According to Compaq, /usr/sbin/psrinfo has been available on
- # OSF/1 and Tru64 systems produced since 1995. I hope that
- # covers most systems running today. This code pipes the CPU
- # types through head -n 1, so we only detect the type of CPU 0.
- ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
- case "$ALPHA_CPU_TYPE" in
- "EV4 (21064)")
- UNAME_MACHINE="alpha" ;;
- "EV4.5 (21064)")
- UNAME_MACHINE="alpha" ;;
- "LCA4 (21066/21068)")
- UNAME_MACHINE="alpha" ;;
- "EV5 (21164)")
- UNAME_MACHINE="alphaev5" ;;
- "EV5.6 (21164A)")
- UNAME_MACHINE="alphaev56" ;;
- "EV5.6 (21164PC)")
- UNAME_MACHINE="alphapca56" ;;
- "EV5.7 (21164PC)")
- UNAME_MACHINE="alphapca57" ;;
- "EV6 (21264)")
- UNAME_MACHINE="alphaev6" ;;
- "EV6.7 (21264A)")
- UNAME_MACHINE="alphaev67" ;;
- "EV6.8CB (21264C)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8AL (21264B)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8CX (21264D)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.9A (21264/EV69A)")
- UNAME_MACHINE="alphaev69" ;;
- "EV7 (21364)")
- UNAME_MACHINE="alphaev7" ;;
- "EV7.9 (21364A)")
- UNAME_MACHINE="alphaev79" ;;
- esac
- # A Pn.n version is a patched version.
- # A Vn.n version is a released version.
- # A Tn.n version is a released field test version.
- # A Xn.n version is an unreleased experimental baselevel.
- # 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- exit ;;
- Alpha\ *:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # Should we change UNAME_MACHINE based on the output of uname instead
- # of the specific Alpha model?
- echo alpha-pc-interix
- exit ;;
- 21064:Windows_NT:50:3)
- echo alpha-dec-winnt3.5
- exit ;;
- Amiga*:UNIX_System_V:4.0:*)
- echo m68k-unknown-sysv4
- exit ;;
- *:[Aa]miga[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-amigaos
- exit ;;
- *:[Mm]orph[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-morphos
- exit ;;
- *:OS/390:*:*)
- echo i370-ibm-openedition
- exit ;;
- *:z/VM:*:*)
- echo s390-ibm-zvmoe
- exit ;;
- *:OS400:*:*)
- echo powerpc-ibm-os400
- exit ;;
- arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
- exit ;;
- arm:riscos:*:*|arm:RISCOS:*:*)
- echo arm-unknown-riscos
- exit ;;
- SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
- echo hppa1.1-hitachi-hiuxmpp
- exit ;;
- Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
- # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
- if test "`(/bin/universe) 2>/dev/null`" = att ; then
- echo pyramid-pyramid-sysv3
- else
- echo pyramid-pyramid-bsd
- fi
- exit ;;
- NILE*:*:*:dcosx)
- echo pyramid-pyramid-svr4
- exit ;;
- DRS?6000:unix:4.0:6*)
- echo sparc-icl-nx6
- exit ;;
- DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
- case `/usr/bin/uname -p` in
- sparc) echo sparc-icl-nx7; exit ;;
- esac ;;
- s390x:SunOS:*:*)
- echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
- eval $set_cc_for_build
- SUN_ARCH="i386"
- # If there is a compiler, see if it is configured for 64-bit objects.
- # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
- # This test works for both compilers.
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
- if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
- then
- SUN_ARCH="x86_64"
- fi
- fi
- echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:6*:*)
- # According to config.sub, this is the proper way to canonicalize
- # SunOS6. Hard to guess exactly what SunOS6 will be like, but
- # it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:*:*)
- case "`/usr/bin/arch -k`" in
- Series*|S4*)
- UNAME_RELEASE=`uname -v`
- ;;
- esac
- # Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
- exit ;;
- sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
- exit ;;
- sun*:*:4.2BSD:*)
- UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
- case "`/bin/arch`" in
- sun3)
- echo m68k-sun-sunos${UNAME_RELEASE}
- ;;
- sun4)
- echo sparc-sun-sunos${UNAME_RELEASE}
- ;;
- esac
- exit ;;
- aushp:SunOS:*:*)
- echo sparc-auspex-sunos${UNAME_RELEASE}
- exit ;;
- # The situation for MiNT is a little confusing. The machine name
- # can be virtually everything (everything which is not
- # "atarist" or "atariste" at least should have a processor
- # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
- # to the lowercase version "mint" (or "freemint"). Finally
- # the system name "TOS" denotes a system which is actually not
- # MiNT. But MiNT is downward compatible to TOS, so this should
- # be no problem.
- atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit ;;
- hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit ;;
- *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
- exit ;;
- m68k:machten:*:*)
- echo m68k-apple-machten${UNAME_RELEASE}
- exit ;;
- powerpc:machten:*:*)
- echo powerpc-apple-machten${UNAME_RELEASE}
- exit ;;
- RISC*:Mach:*:*)
- echo mips-dec-mach_bsd4.3
- exit ;;
- RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix${UNAME_RELEASE}
- exit ;;
- VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
- exit ;;
- 2020:CLIX:*:* | 2430:CLIX:*:*)
- echo clipper-intergraph-clix${UNAME_RELEASE}
- exit ;;
- mips:*:*:UMIPS | mips:*:*:RISCos)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-#ifdef __cplusplus
-#include <stdio.h> /* for printf() prototype */
- int main (int argc, char *argv[]) {
-#else
- int main (argc, argv) int argc; char *argv[]; {
-#endif
- #if defined (host_mips) && defined (MIPSEB)
- #if defined (SYSTYPE_SYSV)
- printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_SVR4)
- printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
- printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
- #endif
- #endif
- exit (-1);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c &&
- dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
- SYSTEM_NAME=`$dummy $dummyarg` &&
- { echo "$SYSTEM_NAME"; exit; }
- echo mips-mips-riscos${UNAME_RELEASE}
- exit ;;
- Motorola:PowerMAX_OS:*:*)
- echo powerpc-motorola-powermax
- exit ;;
- Motorola:*:4.3:PL8-*)
- echo powerpc-harris-powermax
- exit ;;
- Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
- echo powerpc-harris-powermax
- exit ;;
- Night_Hawk:Power_UNIX:*:*)
- echo powerpc-harris-powerunix
- exit ;;
- m88k:CX/UX:7*:*)
- echo m88k-harris-cxux7
- exit ;;
- m88k:*:4*:R4*)
- echo m88k-motorola-sysv4
- exit ;;
- m88k:*:3*:R3*)
- echo m88k-motorola-sysv3
- exit ;;
- AViiON:dgux:*:*)
- # DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
- then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
- [ ${TARGET_BINARY_INTERFACE}x = x ]
- then
- echo m88k-dg-dgux${UNAME_RELEASE}
- else
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
- fi
- else
- echo i586-dg-dgux${UNAME_RELEASE}
- fi
- exit ;;
- M88*:DolphinOS:*:*) # DolphinOS (SVR3)
- echo m88k-dolphin-sysv3
- exit ;;
- M88*:*:R3*:*)
- # Delta 88k system running SVR3
- echo m88k-motorola-sysv3
- exit ;;
- XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
- echo m88k-tektronix-sysv3
- exit ;;
- Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
- echo m68k-tektronix-bsd
- exit ;;
- *:IRIX*:*:*)
- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
- exit ;;
- ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
- i*86:AIX:*:*)
- echo i386-ibm-aix
- exit ;;
- ia64:AIX:*:*)
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
- exit ;;
- *:AIX:2:3)
- if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <sys/systemcfg.h>
-
- main()
- {
- if (!__power_pc())
- exit(1);
- puts("powerpc-ibm-aix3.2.5");
- exit(0);
- }
-EOF
- if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
- then
- echo "$SYSTEM_NAME"
- else
- echo rs6000-ibm-aix3.2.5
- fi
- elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
- echo rs6000-ibm-aix3.2.4
- else
- echo rs6000-ibm-aix3.2
- fi
- exit ;;
- *:AIX:*:[456])
- IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
- if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
- IBM_ARCH=rs6000
- else
- IBM_ARCH=powerpc
- fi
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
- exit ;;
- *:AIX:*:*)
- echo rs6000-ibm-aix
- exit ;;
- ibmrt:4.4BSD:*|romp-ibm:BSD:*)
- echo romp-ibm-bsd4.4
- exit ;;
- ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit ;; # report: romp-ibm BSD 4.3
- *:BOSX:*:*)
- echo rs6000-bull-bosx
- exit ;;
- DPX/2?00:B.O.S.:*:*)
- echo m68k-bull-sysv3
- exit ;;
- 9000/[34]??:4.3bsd:1.*:*)
- echo m68k-hp-bsd
- exit ;;
- hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
- echo m68k-hp-bsd4.4
- exit ;;
- 9000/[34678]??:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- case "${UNAME_MACHINE}" in
- 9000/31? ) HP_ARCH=m68000 ;;
- 9000/[34]?? ) HP_ARCH=m68k ;;
- 9000/[678][0-9][0-9])
- if [ -x /usr/bin/getconf ]; then
- sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
- 532) # CPU_PA_RISC2_0
- case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
- '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
- esac ;;
- esac
- fi
- if [ "${HP_ARCH}" = "" ]; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-
- #define _HPUX_SOURCE
- #include <stdlib.h>
- #include <unistd.h>
-
- int main ()
- {
- #if defined(_SC_KERNEL_BITS)
- long bits = sysconf(_SC_KERNEL_BITS);
- #endif
- long cpu = sysconf (_SC_CPU_VERSION);
-
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
- case CPU_PA_RISC2_0:
- #if defined(_SC_KERNEL_BITS)
- switch (bits)
- {
- case 64: puts ("hppa2.0w"); break;
- case 32: puts ("hppa2.0n"); break;
- default: puts ("hppa2.0"); break;
- } break;
- #else /* !defined(_SC_KERNEL_BITS) */
- puts ("hppa2.0"); break;
- #endif
- default: puts ("hppa1.0"); break;
- }
- exit (0);
- }
-EOF
- (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
- test -z "$HP_ARCH" && HP_ARCH=hppa
- fi ;;
- esac
- if [ ${HP_ARCH} = "hppa2.0w" ]
- then
- eval $set_cc_for_build
-
- # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
- # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
- # generating 64-bit code. GNU and HP use different nomenclature:
- #
- # $ CC_FOR_BUILD=cc ./config.guess
- # => hppa2.0w-hp-hpux11.23
- # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
- # => hppa64-hp-hpux11.23
-
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
- grep __LP64__ >/dev/null
- then
- HP_ARCH="hppa2.0w"
- else
- HP_ARCH="hppa64"
- fi
- fi
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit ;;
- ia64:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ia64-hp-hpux${HPUX_REV}
- exit ;;
- 3050*:HI-UX:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <unistd.h>
- int
- main ()
- {
- long cpu = sysconf (_SC_CPU_VERSION);
- /* The order matters, because CPU_IS_HP_MC68K erroneously returns
- true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
- results, however. */
- if (CPU_IS_PA_RISC (cpu))
- {
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
- default: puts ("hppa-hitachi-hiuxwe2"); break;
- }
- }
- else if (CPU_IS_HP_MC68K (cpu))
- puts ("m68k-hitachi-hiuxwe2");
- else puts ("unknown-hitachi-hiuxwe2");
- exit (0);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
- { echo "$SYSTEM_NAME"; exit; }
- echo unknown-hitachi-hiuxwe2
- exit ;;
- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
- echo hppa1.1-hp-bsd
- exit ;;
- 9000/8??:4.3bsd:*:*)
- echo hppa1.0-hp-bsd
- exit ;;
- *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
- echo hppa1.0-hp-mpeix
- exit ;;
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
- echo hppa1.1-hp-osf
- exit ;;
- hp8??:OSF1:*:*)
- echo hppa1.0-hp-osf
- exit ;;
- i*86:OSF1:*:*)
- if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
- else
- echo ${UNAME_MACHINE}-unknown-osf1
- fi
- exit ;;
- parisc*:Lites*:*:*)
- echo hppa1.1-hp-lites
- exit ;;
- C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
- echo c1-convex-bsd
- exit ;;
- C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit ;;
- C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
- echo c34-convex-bsd
- exit ;;
- C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
- echo c38-convex-bsd
- exit ;;
- C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
- echo c4-convex-bsd
- exit ;;
- CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*[A-Z]90:*:*:*)
- echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
- | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
- -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
- -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*T3E:*:*:*)
- echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*SV1:*:*:*)
- echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- *:UNICOS/mp:*:*)
- echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
- FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
- 5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
- i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit ;;
- sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi${UNAME_RELEASE}
- exit ;;
- *:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
- exit ;;
- *:FreeBSD:*:*)
- case ${UNAME_MACHINE} in
- pc98)
- echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- amd64)
- echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- *)
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- esac
- exit ;;
- i*:CYGWIN*:*)
- echo ${UNAME_MACHINE}-pc-cygwin
- exit ;;
- *:MINGW*:*)
- echo ${UNAME_MACHINE}-pc-mingw32
- exit ;;
- i*:windows32*:*)
- # uname -m includes "-pc" on this system.
- echo ${UNAME_MACHINE}-mingw32
- exit ;;
- i*:PW*:*)
- echo ${UNAME_MACHINE}-pc-pw32
- exit ;;
- *:Interix*:[3456]*)
- case ${UNAME_MACHINE} in
- x86)
- echo i586-pc-interix${UNAME_RELEASE}
- exit ;;
- EM64T | authenticamd | genuineintel)
- echo x86_64-unknown-interix${UNAME_RELEASE}
- exit ;;
- IA64)
- echo ia64-unknown-interix${UNAME_RELEASE}
- exit ;;
- esac ;;
- [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
- echo i${UNAME_MACHINE}-pc-mks
- exit ;;
- i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
- # UNAME_MACHINE based on the output of uname instead of i386?
- echo i586-pc-interix
- exit ;;
- i*:UWIN*:*)
- echo ${UNAME_MACHINE}-pc-uwin
- exit ;;
- amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
- echo x86_64-unknown-cygwin
- exit ;;
- p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin
- exit ;;
- prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- *:GNU:*:*)
- # the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit ;;
- *:GNU/*:*:*)
- # other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
- exit ;;
- i*86:Minix:*:*)
- echo ${UNAME_MACHINE}-pc-minix
- exit ;;
- arm*:Linux:*:*)
- eval $set_cc_for_build
- if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep -q __ARM_EABI__
- then
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- else
- echo ${UNAME_MACHINE}-unknown-linux-gnueabi
- fi
- exit ;;
- avr32*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- cris:Linux:*:*)
- echo cris-axis-linux-gnu
- exit ;;
- crisv32:Linux:*:*)
- echo crisv32-axis-linux-gnu
- exit ;;
- frv:Linux:*:*)
- echo frv-unknown-linux-gnu
- exit ;;
- ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- mips:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef mips
- #undef mipsel
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mipsel
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips
- #else
- CPU=
- #endif
- #endif
-EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^CPU/{
- s: ::g
- p
- }'`"
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
- ;;
- mips64:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef mips64
- #undef mips64el
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mips64el
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips64
- #else
- CPU=
- #endif
- #endif
-EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^CPU/{
- s: ::g
- p
- }'`"
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
- ;;
- or32:Linux:*:*)
- echo or32-unknown-linux-gnu
- exit ;;
- ppc:Linux:*:*)
- echo powerpc-unknown-linux-gnu
- exit ;;
- ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-gnu
- exit ;;
- alpha:Linux:*:*)
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
- EV5) UNAME_MACHINE=alphaev5 ;;
- EV56) UNAME_MACHINE=alphaev56 ;;
- PCA56) UNAME_MACHINE=alphapca56 ;;
- PCA57) UNAME_MACHINE=alphapca56 ;;
- EV6) UNAME_MACHINE=alphaev6 ;;
- EV67) UNAME_MACHINE=alphaev67 ;;
- EV68*) UNAME_MACHINE=alphaev68 ;;
- esac
- objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
- exit ;;
- padre:Linux:*:*)
- echo sparc-unknown-linux-gnu
- exit ;;
- parisc:Linux:*:* | hppa:Linux:*:*)
- # Look for CPU level
- case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-gnu ;;
- PA8*) echo hppa2.0-unknown-linux-gnu ;;
- *) echo hppa-unknown-linux-gnu ;;
- esac
- exit ;;
- parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-gnu
- exit ;;
- s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux
- exit ;;
- sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-gnu
- exit ;;
- x86_64:Linux:*:*)
- echo x86_64-unknown-linux-gnu
- exit ;;
- xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- i*86:Linux:*:*)
- # The BFD linker knows what the default object file format is, so
- # first see if it will tell us. cd to the root directory to prevent
- # problems with other programs or directories called `ld' in the path.
- # Set LC_ALL=C to ensure ld outputs messages in English.
- ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
- | sed -ne '/supported targets:/!d
- s/[ ][ ]*/ /g
- s/.*supported targets: *//
- s/ .*//
- p'`
- case "$ld_supported_targets" in
- elf32-i386)
- TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
- ;;
- a.out-i386-linux)
- echo "${UNAME_MACHINE}-pc-linux-gnuaout"
- exit ;;
- "")
- # Either a pre-BFD a.out linker (linux-gnuoldld) or
- # one that does not give us useful --help.
- echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
- exit ;;
- esac
- # Determine whether the default compiler is a.out or elf
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <features.h>
- #ifdef __ELF__
- # ifdef __GLIBC__
- # if __GLIBC__ >= 2
- LIBC=gnu
- # else
- LIBC=gnulibc1
- # endif
- # else
- LIBC=gnulibc1
- # endif
- #else
- #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
- LIBC=gnu
- #else
- LIBC=gnuaout
- #endif
- #endif
- #ifdef __dietlibc__
- LIBC=dietlibc
- #endif
-EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^LIBC/{
- s: ::g
- p
- }'`"
- test x"${LIBC}" != x && {
- echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
- exit
- }
- test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
- ;;
- i*86:DYNIX/ptx:4*:*)
- # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
- # earlier versions are messed up and put the nodename in both
- # sysname and nodename.
- echo i386-sequent-sysv4
- exit ;;
- i*86:UNIX_SV:4.2MP:2.*)
- # Unixware is an offshoot of SVR4, but it has its own version
- # number series starting with 2...
- # I am not positive that other SVR4 systems won't match this,
- # I just have to hope. -- rms.
- # Use sysv4.2uw... so that sysv4* matches it.
- echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
- exit ;;
- i*86:OS/2:*:*)
- # If we were able to find `uname', then EMX Unix compatibility
- # is probably installed.
- echo ${UNAME_MACHINE}-pc-os2-emx
- exit ;;
- i*86:XTS-300:*:STOP)
- echo ${UNAME_MACHINE}-unknown-stop
- exit ;;
- i*86:atheos:*:*)
- echo ${UNAME_MACHINE}-unknown-atheos
- exit ;;
- i*86:syllable:*:*)
- echo ${UNAME_MACHINE}-pc-syllable
- exit ;;
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- i*86:*DOS:*:*)
- echo ${UNAME_MACHINE}-pc-msdosdjgpp
- exit ;;
- i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
- UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
- if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
- else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
- fi
- exit ;;
- i*86:*:5:[678]*)
- # UnixWare 7.x, OpenUNIX and OpenServer 6.
- case `/bin/uname -X | grep "^Machine"` in
- *486*) UNAME_MACHINE=i486 ;;
- *Pentium) UNAME_MACHINE=i586 ;;
- *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
- esac
- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
- exit ;;
- i*86:*:3.2:*)
- if test -f /usr/options/cb.name; then
- UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
- echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
- elif /bin/uname -X 2>/dev/null >/dev/null ; then
- UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
- (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
- (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
- && UNAME_MACHINE=i586
- (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
- && UNAME_MACHINE=i686
- (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
- && UNAME_MACHINE=i686
- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
- else
- echo ${UNAME_MACHINE}-pc-sysv32
- fi
- exit ;;
- pc:*:*:*)
- # Left here for compatibility:
- # uname -m prints for DJGPP always 'pc', but it prints nothing about
- # the processor, so we play safe by assuming i586.
- # Note: whatever this is, it MUST be the same as what config.sub
- # prints for the "djgpp" host, or else GDB configury will decide that
- # this is a cross-build.
- echo i586-pc-msdosdjgpp
- exit ;;
- Intel:Mach:3*:*)
- echo i386-pc-mach3
- exit ;;
- paragon:*:*:*)
- echo i860-intel-osf1
- exit ;;
- i860:*:4.*:*) # i860-SVR4
- if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
- else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
- fi
- exit ;;
- mini*:CTIX:SYS*5:*)
- # "miniframe"
- echo m68010-convergent-sysv
- exit ;;
- mc68k:UNIX:SYSTEM5:3.51m)
- echo m68k-convergent-sysv
- exit ;;
- M680?0:D-NIX:5.3:*)
- echo m68k-diab-dnix
- exit ;;
- M68*:*:R3V[5678]*:*)
- test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
- 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
- OS_REL=''
- test -r /etc/.relid \
- && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
- /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
- 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4; exit; } ;;
- NCR*:*:4.2:* | MPRAS*:*:4.2:*)
- OS_REL='.3'
- test -r /etc/.relid \
- && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
- /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
- /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
- m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- mc68030:UNIX_System_V:4.*:*)
- echo m68k-atari-sysv4
- exit ;;
- TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
- echo powerpc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv${UNAME_RELEASE}
- exit ;;
- RM*:ReliantUNIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
- RM*:SINIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
- *:SINIX-*:*:*)
- if uname -p 2>/dev/null >/dev/null ; then
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- echo ${UNAME_MACHINE}-sni-sysv4
- else
- echo ns32k-sni-sysv
- fi
- exit ;;
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says <Richard.M.Bartel@ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit ;;
- *:UNIX_System_V:4*:FTX*)
- # From Gerald Hewes <hewes@openmarket.com>.
- # How about differentiating between stratus architectures? -djm
- echo hppa1.1-stratus-sysv4
- exit ;;
- *:*:*:FTX*)
- # From seanf@swdc.stratus.com.
- echo i860-stratus-sysv4
- exit ;;
- i*86:VOS:*:*)
- # From Paul.Green@stratus.com.
- echo ${UNAME_MACHINE}-stratus-vos
- exit ;;
- *:VOS:*:*)
- # From Paul.Green@stratus.com.
- echo hppa1.1-stratus-vos
- exit ;;
- mc68*:A/UX:*:*)
- echo m68k-apple-aux${UNAME_RELEASE}
- exit ;;
- news*:NEWS-OS:6*:*)
- echo mips-sony-newsos6
- exit ;;
- R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
- if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
- else
- echo mips-unknown-sysv${UNAME_RELEASE}
- fi
- exit ;;
- BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
- echo powerpc-be-beos
- exit ;;
- BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
- echo powerpc-apple-beos
- exit ;;
- BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
- echo i586-pc-beos
- exit ;;
- BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
- echo i586-pc-haiku
- exit ;;
- SX-4:SUPER-UX:*:*)
- echo sx4-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-5:SUPER-UX:*:*)
- echo sx5-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-6:SUPER-UX:*:*)
- echo sx6-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-7:SUPER-UX:*:*)
- echo sx7-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-8:SUPER-UX:*:*)
- echo sx8-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-8R:SUPER-UX:*:*)
- echo sx8r-nec-superux${UNAME_RELEASE}
- exit ;;
- Power*:Rhapsody:*:*)
- echo powerpc-apple-rhapsody${UNAME_RELEASE}
- exit ;;
- *:Rhapsody:*:*)
- echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
- exit ;;
- *:Darwin:*:*)
- UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
- case $UNAME_PROCESSOR in
- unknown) UNAME_PROCESSOR=powerpc ;;
- esac
- echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
- exit ;;
- *:procnto*:*:* | *:QNX:[0123456789]*:*)
- UNAME_PROCESSOR=`uname -p`
- if test "$UNAME_PROCESSOR" = "x86"; then
- UNAME_PROCESSOR=i386
- UNAME_MACHINE=pc
- fi
- echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
- exit ;;
- *:QNX:*:4*)
- echo i386-pc-qnx
- exit ;;
- NSE-?:NONSTOP_KERNEL:*:*)
- echo nse-tandem-nsk${UNAME_RELEASE}
- exit ;;
- NSR-?:NONSTOP_KERNEL:*:*)
- echo nsr-tandem-nsk${UNAME_RELEASE}
- exit ;;
- *:NonStop-UX:*:*)
- echo mips-compaq-nonstopux
- exit ;;
- BS2000:POSIX*:*:*)
- echo bs2000-siemens-sysv
- exit ;;
- DS/*:UNIX_System_V:*:*)
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
- exit ;;
- *:Plan9:*:*)
- # "uname -m" is not consistent, so use $cputype instead. 386
- # is converted to i386 for consistency with other x86
- # operating systems.
- if test "$cputype" = "386"; then
- UNAME_MACHINE=i386
- else
- UNAME_MACHINE="$cputype"
- fi
- echo ${UNAME_MACHINE}-unknown-plan9
- exit ;;
- *:TOPS-10:*:*)
- echo pdp10-unknown-tops10
- exit ;;
- *:TENEX:*:*)
- echo pdp10-unknown-tenex
- exit ;;
- KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
- echo pdp10-dec-tops20
- exit ;;
- XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
- echo pdp10-xkl-tops20
- exit ;;
- *:TOPS-20:*:*)
- echo pdp10-unknown-tops20
- exit ;;
- *:ITS:*:*)
- echo pdp10-unknown-its
- exit ;;
- SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
- exit ;;
- *:DragonFly:*:*)
- echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit ;;
- *:*VMS:*:*)
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- case "${UNAME_MACHINE}" in
- A*) echo alpha-dec-vms ; exit ;;
- I*) echo ia64-dec-vms ; exit ;;
- V*) echo vax-dec-vms ; exit ;;
- esac ;;
- *:XENIX:*:SysV)
- echo i386-pc-xenix
- exit ;;
- i*86:skyos:*:*)
- echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
- exit ;;
- i*86:rdos:*:*)
- echo ${UNAME_MACHINE}-pc-rdos
- exit ;;
- i*86:AROS:*:*)
- echo ${UNAME_MACHINE}-pc-aros
- exit ;;
-esac
-
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
- /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
- I don't know.... */
- printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
- printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
- "4"
-#else
- ""
-#endif
- ); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
- printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
- int version;
- version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
- if (version < 4)
- printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
- else
- printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
- exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
- printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
- printf ("ns32k-encore-mach\n"); exit (0);
-#else
- printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
- printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
- printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
- printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
- struct utsname un;
-
- uname(&un);
-
- if (strncmp(un.version, "V2", 2) == 0) {
- printf ("i386-sequent-ptx2\n"); exit (0);
- }
- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
- printf ("i386-sequent-ptx1\n"); exit (0);
- }
- printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-# include <sys/param.h>
-# if defined (BSD)
-# if BSD == 43
- printf ("vax-dec-bsd4.3\n"); exit (0);
-# else
-# if BSD == 199006
- printf ("vax-dec-bsd4.3reno\n"); exit (0);
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# endif
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# else
- printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
- printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
- exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
- { echo "$SYSTEM_NAME"; exit; }
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
- case `getsysinfo -f cpu_type` in
- c1*)
- echo c1-convex-bsd
- exit ;;
- c2*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit ;;
- c34*)
- echo c34-convex-bsd
- exit ;;
- c38*)
- echo c38-convex-bsd
- exit ;;
- c4*)
- echo c4-convex-bsd
- exit ;;
- esac
-fi
-
-cat >&2 <<EOF
-$0: unable to guess system type
-
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
-
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
-and
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
-
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches@gnu.org> in order to provide the needed
-information to handle your system.
-
-config.guess timestamp = $timestamp
-
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
-
-hostinfo = `(hostinfo) 2>/dev/null`
-/bin/universe = `(/bin/universe) 2>/dev/null`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
-/bin/arch = `(/bin/arch) 2>/dev/null`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
-EOF
-
-exit 1
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/ctdb/lib/tevent/config.sub b/ctdb/lib/tevent/config.sub
deleted file mode 100755
index b5b9c1efc0..0000000000
--- a/ctdb/lib/tevent/config.sub
+++ /dev/null
@@ -1,1686 +0,0 @@
-#! /bin/sh
-# Configuration validation subroutine script.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-# Free Software Foundation, Inc.
-
-timestamp='2009-04-17'
-
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine. It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Please send patches to <config-patches@gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
-#
-# Configuration subroutine to validate and canonicalize a configuration type.
-# Supply the specified configuration type as an argument.
-# If it is invalid, we print an error message on stderr and exit with code 1.
-# Otherwise, we print the canonical config type on stdout and succeed.
-
-# This file is supposed to be the same for all GNU packages
-# and recognize all the CPU types, system types and aliases
-# that are meaningful with *any* GNU software.
-# Each package is responsible for reporting which valid configurations
-# it does not support. The user should be able to distinguish
-# a failure to support a valid configuration from a meaningless
-# configuration.
-
-# The goal of this file is to map all the various variations of a given
-# machine specification into a single specification in the form:
-# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or in some cases, the newer four-part form:
-# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# It is wrong to echo any other type of specification.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
- $0 [OPTION] ALIAS
-
-Canonicalize a configuration name.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.sub ($timestamp)
-
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit ;;
- --version | -v )
- echo "$version" ; exit ;;
- --help | --h* | -h )
- echo "$usage"; exit ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help"
- exit 1 ;;
-
- *local*)
- # First pass through any local machine types.
- echo $1
- exit ;;
-
- * )
- break ;;
- esac
-done
-
-case $# in
- 0) echo "$me: missing argument$help" >&2
- exit 1;;
- 1) ;;
- *) echo "$me: too many arguments$help" >&2
- exit 1;;
-esac
-
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
- uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
- kopensolaris*-gnu* | \
- storm-chaos* | os2-emx* | rtmk-nova*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
- *)
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
- if [ $basic_machine != $1 ]
- then os=`echo $1 | sed 's/.*-/-/'`
- else os=; fi
- ;;
-esac
-
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work. We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
- -sun*os*)
- # Prevent following clause from handling this invalid input.
- ;;
- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray)
- os=
- basic_machine=$1
- ;;
- -sim | -cisco | -oki | -wec | -winbond)
- os=
- basic_machine=$1
- ;;
- -scout)
- ;;
- -wrs)
- os=-vxworks
- basic_machine=$1
- ;;
- -chorusos*)
- os=-chorusos
- basic_machine=$1
- ;;
- -chorusrdb)
- os=-chorusrdb
- basic_machine=$1
- ;;
- -hiux*)
- os=-hiuxwe2
- ;;
- -sco6)
- os=-sco5v6
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5)
- os=-sco3.2v5
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco4)
- os=-sco3.2v4
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2v[4-9]*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5v6*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco*)
- os=-sco3.2v2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -udk*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -isc)
- os=-isc2.2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -clix*)
- basic_machine=clipper-intergraph
- ;;
- -isc*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -lynx*)
- os=-lynxos
- ;;
- -ptx*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
- ;;
- -windowsnt*)
- os=`echo $os | sed -e 's/windowsnt/winnt/'`
- ;;
- -psos*)
- os=-psos
- ;;
- -mint | -mint[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
-esac
-
-# Decode aliases for certain CPU-COMPANY combinations.
-case $basic_machine in
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
- 1750a | 580 \
- | a29k \
- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
- | am33_2.0 \
- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
- | bfin \
- | c4x | clipper \
- | d10v | d30v | dlx | dsp16xx \
- | fido | fr30 | frv \
- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
- | i370 | i860 | i960 | ia64 \
- | ip2k | iq2000 \
- | lm32 \
- | m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | mcore | mep | metag \
- | mips | mipsbe | mipseb | mipsel | mipsle \
- | mips16 \
- | mips64 | mips64el \
- | mips64octeon | mips64octeonel \
- | mips64orion | mips64orionel \
- | mips64r5900 | mips64r5900el \
- | mips64vr | mips64vrel \
- | mips64vr4100 | mips64vr4100el \
- | mips64vr4300 | mips64vr4300el \
- | mips64vr5000 | mips64vr5000el \
- | mips64vr5900 | mips64vr5900el \
- | mipsisa32 | mipsisa32el \
- | mipsisa32r2 | mipsisa32r2el \
- | mipsisa64 | mipsisa64el \
- | mipsisa64r2 | mipsisa64r2el \
- | mipsisa64sb1 | mipsisa64sb1el \
- | mipsisa64sr71k | mipsisa64sr71kel \
- | mipstx39 | mipstx39el \
- | mn10200 | mn10300 \
- | moxie \
- | mt \
- | msp430 \
- | nios | nios2 \
- | ns16k | ns32k \
- | or32 \
- | pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
- | pyramid \
- | score \
- | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
- | sh64 | sh64le \
- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
- | spu | strongarm \
- | tahoe | thumb | tic4x | tic80 | tron \
- | v850 | v850e \
- | we32k \
- | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
- | z8k | z80)
- basic_machine=$basic_machine-unknown
- ;;
- m6811 | m68hc11 | m6812 | m68hc12)
- # Motorola 68HC11/12.
- basic_machine=$basic_machine-unknown
- os=-none
- ;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
- ;;
- ms1)
- basic_machine=mt-unknown
- ;;
-
- # We use `pc' rather than `unknown'
- # because (1) that's what they normally are, and
- # (2) the word "unknown" tends to confuse beginning users.
- i*86 | x86_64)
- basic_machine=$basic_machine-pc
- ;;
- # Object if more than one company name word.
- *-*-*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
- # Recognize the basic CPU types with company name.
- 580-* \
- | a29k-* \
- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
- | avr-* | avr32-* \
- | bfin-* | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
- | clipper-* | craynv-* | cydra-* \
- | d10v-* | d30v-* | dlx-* \
- | elxsi-* \
- | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
- | h8300-* | h8500-* \
- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
- | i*86-* | i860-* | i960-* | ia64-* \
- | ip2k-* | iq2000-* \
- | lm32-* \
- | m32c-* | m32r-* | m32rle-* \
- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
- | mips16-* \
- | mips64-* | mips64el-* \
- | mips64octeon-* | mips64octeonel-* \
- | mips64orion-* | mips64orionel-* \
- | mips64r5900-* | mips64r5900el-* \
- | mips64vr-* | mips64vrel-* \
- | mips64vr4100-* | mips64vr4100el-* \
- | mips64vr4300-* | mips64vr4300el-* \
- | mips64vr5000-* | mips64vr5000el-* \
- | mips64vr5900-* | mips64vr5900el-* \
- | mipsisa32-* | mipsisa32el-* \
- | mipsisa32r2-* | mipsisa32r2el-* \
- | mipsisa64-* | mipsisa64el-* \
- | mipsisa64r2-* | mipsisa64r2el-* \
- | mipsisa64sb1-* | mipsisa64sb1el-* \
- | mipsisa64sr71k-* | mipsisa64sr71kel-* \
- | mipstx39-* | mipstx39el-* \
- | mmix-* \
- | mt-* \
- | msp430-* \
- | nios-* | nios2-* \
- | none-* | np1-* | ns16k-* | ns32k-* \
- | orion-* \
- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
- | pyramid-* \
- | romp-* | rs6000-* \
- | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
- | sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
- | tahoe-* | thumb-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
- | tron-* \
- | v850-* | v850e-* | vax-* \
- | we32k-* \
- | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
- | xstormy16-* | xtensa*-* \
- | ymp-* \
- | z8k-* | z80-*)
- ;;
- # Recognize the basic CPU types without company name, with glob match.
- xtensa*)
- basic_machine=$basic_machine-unknown
- ;;
- # Recognize the various machine names and aliases which stand
- # for a CPU type and a company and sometimes even an OS.
- 386bsd)
- basic_machine=i386-unknown
- os=-bsd
- ;;
- 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
- basic_machine=m68000-att
- ;;
- 3b*)
- basic_machine=we32k-att
- ;;
- a29khif)
- basic_machine=a29k-amd
- os=-udi
- ;;
- abacus)
- basic_machine=abacus-unknown
- ;;
- adobe68k)
- basic_machine=m68010-adobe
- os=-scout
- ;;
- alliant | fx80)
- basic_machine=fx80-alliant
- ;;
- altos | altos3068)
- basic_machine=m68k-altos
- ;;
- am29k)
- basic_machine=a29k-none
- os=-bsd
- ;;
- amd64)
- basic_machine=x86_64-pc
- ;;
- amd64-*)
- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- amdahl)
- basic_machine=580-amdahl
- os=-sysv
- ;;
- amiga | amiga-*)
- basic_machine=m68k-unknown
- ;;
- amigaos | amigados)
- basic_machine=m68k-unknown
- os=-amigaos
- ;;
- amigaunix | amix)
- basic_machine=m68k-unknown
- os=-sysv4
- ;;
- apollo68)
- basic_machine=m68k-apollo
- os=-sysv
- ;;
- apollo68bsd)
- basic_machine=m68k-apollo
- os=-bsd
- ;;
- aros)
- basic_machine=i386-pc
- os=-aros
- ;;
- aux)
- basic_machine=m68k-apple
- os=-aux
- ;;
- balance)
- basic_machine=ns32k-sequent
- os=-dynix
- ;;
- blackfin)
- basic_machine=bfin-unknown
- os=-linux
- ;;
- blackfin-*)
- basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- c90)
- basic_machine=c90-cray
- os=-unicos
- ;;
- cegcc)
- basic_machine=arm-unknown
- os=-cegcc
- ;;
- convex-c1)
- basic_machine=c1-convex
- os=-bsd
- ;;
- convex-c2)
- basic_machine=c2-convex
- os=-bsd
- ;;
- convex-c32)
- basic_machine=c32-convex
- os=-bsd
- ;;
- convex-c34)
- basic_machine=c34-convex
- os=-bsd
- ;;
- convex-c38)
- basic_machine=c38-convex
- os=-bsd
- ;;
- cray | j90)
- basic_machine=j90-cray
- os=-unicos
- ;;
- craynv)
- basic_machine=craynv-cray
- os=-unicosmp
- ;;
- cr16)
- basic_machine=cr16-unknown
- os=-elf
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
- crisv32 | crisv32-* | etraxfs*)
- basic_machine=crisv32-axis
- ;;
- cris | cris-* | etrax*)
- basic_machine=cris-axis
- ;;
- crx)
- basic_machine=crx-unknown
- os=-elf
- ;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
- basic_machine=mips-dec
- ;;
- decsystem10* | dec10*)
- basic_machine=pdp10-dec
- os=-tops10
- ;;
- decsystem20* | dec20*)
- basic_machine=pdp10-dec
- os=-tops20
- ;;
- delta | 3300 | motorola-3300 | motorola-delta \
- | 3300-motorola | delta-motorola)
- basic_machine=m68k-motorola
- ;;
- delta88)
- basic_machine=m88k-motorola
- os=-sysv3
- ;;
- dicos)
- basic_machine=i686-pc
- os=-dicos
- ;;
- djgpp)
- basic_machine=i586-pc
- os=-msdosdjgpp
- ;;
- dpx20 | dpx20-*)
- basic_machine=rs6000-bull
- os=-bosx
- ;;
- dpx2* | dpx2*-bull)
- basic_machine=m68k-bull
- os=-sysv3
- ;;
- ebmon29k)
- basic_machine=a29k-amd
- os=-ebmon
- ;;
- elxsi)
- basic_machine=elxsi-elxsi
- os=-bsd
- ;;
- encore | umax | mmax)
- basic_machine=ns32k-encore
- ;;
- es1800 | OSE68k | ose68k | ose | OSE)
- basic_machine=m68k-ericsson
- os=-ose
- ;;
- fx2800)
- basic_machine=i860-alliant
- ;;
- genix)
- basic_machine=ns32k-ns
- ;;
- gmicro)
- basic_machine=tron-gmicro
- os=-sysv
- ;;
- go32)
- basic_machine=i386-pc
- os=-go32
- ;;
- h3050r* | hiux*)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- h8300hms)
- basic_machine=h8300-hitachi
- os=-hms
- ;;
- h8300xray)
- basic_machine=h8300-hitachi
- os=-xray
- ;;
- h8500hms)
- basic_machine=h8500-hitachi
- os=-hms
- ;;
- harris)
- basic_machine=m88k-harris
- os=-sysv3
- ;;
- hp300-*)
- basic_machine=m68k-hp
- ;;
- hp300bsd)
- basic_machine=m68k-hp
- os=-bsd
- ;;
- hp300hpux)
- basic_machine=m68k-hp
- os=-hpux
- ;;
- hp3k9[0-9][0-9] | hp9[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k2[0-9][0-9] | hp9k31[0-9])
- basic_machine=m68000-hp
- ;;
- hp9k3[2-9][0-9])
- basic_machine=m68k-hp
- ;;
- hp9k6[0-9][0-9] | hp6[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k7[0-79][0-9] | hp7[0-79][0-9])
- basic_machine=hppa1.1-hp
- ;;
- hp9k78[0-9] | hp78[0-9])
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][13679] | hp8[0-9][13679])
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][0-9] | hp8[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hppa-next)
- os=-nextstep3
- ;;
- hppaosf)
- basic_machine=hppa1.1-hp
- os=-osf
- ;;
- hppro)
- basic_machine=hppa1.1-hp
- os=-proelf
- ;;
- i370-ibm* | ibm*)
- basic_machine=i370-ibm
- ;;
-# I'm not sure what "Sysv32" means. Should this be sysv3.2?
- i*86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv32
- ;;
- i*86v4*)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv4
- ;;
- i*86v)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv
- ;;
- i*86sol2)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-solaris2
- ;;
- i386mach)
- basic_machine=i386-mach
- os=-mach
- ;;
- i386-vsta | vsta)
- basic_machine=i386-unknown
- os=-vsta
- ;;
- iris | iris4d)
- basic_machine=mips-sgi
- case $os in
- -irix*)
- ;;
- *)
- os=-irix4
- ;;
- esac
- ;;
- isi68 | isi)
- basic_machine=m68k-isi
- os=-sysv
- ;;
- m68knommu)
- basic_machine=m68k-unknown
- os=-linux
- ;;
- m68knommu-*)
- basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- m88k-omron*)
- basic_machine=m88k-omron
- ;;
- magnum | m3230)
- basic_machine=mips-mips
- os=-sysv
- ;;
- merlin)
- basic_machine=ns32k-utek
- os=-sysv
- ;;
- mingw32)
- basic_machine=i386-pc
- os=-mingw32
- ;;
- mingw32ce)
- basic_machine=arm-unknown
- os=-mingw32ce
- ;;
- miniframe)
- basic_machine=m68000-convergent
- ;;
- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
- mips3*-*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
- ;;
- mips3*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
- ;;
- monitor)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- morphos)
- basic_machine=powerpc-unknown
- os=-morphos
- ;;
- msdos)
- basic_machine=i386-pc
- os=-msdos
- ;;
- ms1-*)
- basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
- ;;
- mvs)
- basic_machine=i370-ibm
- os=-mvs
- ;;
- ncr3000)
- basic_machine=i486-ncr
- os=-sysv4
- ;;
- netbsd386)
- basic_machine=i386-unknown
- os=-netbsd
- ;;
- netwinder)
- basic_machine=armv4l-rebel
- os=-linux
- ;;
- news | news700 | news800 | news900)
- basic_machine=m68k-sony
- os=-newsos
- ;;
- news1000)
- basic_machine=m68030-sony
- os=-newsos
- ;;
- news-3600 | risc-news)
- basic_machine=mips-sony
- os=-newsos
- ;;
- necv70)
- basic_machine=v70-nec
- os=-sysv
- ;;
- next | m*-next )
- basic_machine=m68k-next
- case $os in
- -nextstep* )
- ;;
- -ns2*)
- os=-nextstep2
- ;;
- *)
- os=-nextstep3
- ;;
- esac
- ;;
- nh3000)
- basic_machine=m68k-harris
- os=-cxux
- ;;
- nh[45]000)
- basic_machine=m88k-harris
- os=-cxux
- ;;
- nindy960)
- basic_machine=i960-intel
- os=-nindy
- ;;
- mon960)
- basic_machine=i960-intel
- os=-mon960
- ;;
- nonstopux)
- basic_machine=mips-compaq
- os=-nonstopux
- ;;
- np1)
- basic_machine=np1-gould
- ;;
- nsr-tandem)
- basic_machine=nsr-tandem
- ;;
- op50n-* | op60c-*)
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- openrisc | openrisc-*)
- basic_machine=or32-unknown
- ;;
- os400)
- basic_machine=powerpc-ibm
- os=-os400
- ;;
- OSE68000 | ose68000)
- basic_machine=m68000-ericsson
- os=-ose
- ;;
- os68k)
- basic_machine=m68k-none
- os=-os68k
- ;;
- pa-hitachi)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- paragon)
- basic_machine=i860-intel
- os=-osf
- ;;
- parisc)
- basic_machine=hppa-unknown
- os=-linux
- ;;
- parisc-*)
- basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- pbd)
- basic_machine=sparc-tti
- ;;
- pbb)
- basic_machine=m68k-tti
- ;;
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
- ;;
- pc98)
- basic_machine=i386-pc
- ;;
- pc98-*)
- basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium | p5 | k5 | k6 | nexgen | viac3)
- basic_machine=i586-pc
- ;;
- pentiumpro | p6 | 6x86 | athlon | athlon_*)
- basic_machine=i686-pc
- ;;
- pentiumii | pentium2 | pentiumiii | pentium3)
- basic_machine=i686-pc
- ;;
- pentium4)
- basic_machine=i786-pc
- ;;
- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumpro-* | p6-* | 6x86-* | athlon-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium4-*)
- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pn)
- basic_machine=pn-gould
- ;;
- power) basic_machine=power-ibm
- ;;
- ppc) basic_machine=powerpc-unknown
- ;;
- ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppcle | powerpclittle | ppc-le | powerpc-little)
- basic_machine=powerpcle-unknown
- ;;
- ppcle-* | powerpclittle-*)
- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64) basic_machine=powerpc64-unknown
- ;;
- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
- basic_machine=powerpc64le-unknown
- ;;
- ppc64le-* | powerpc64little-*)
- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ps2)
- basic_machine=i386-ibm
- ;;
- pw32)
- basic_machine=i586-unknown
- os=-pw32
- ;;
- rdos)
- basic_machine=i386-pc
- os=-rdos
- ;;
- rom68k)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- rm[46]00)
- basic_machine=mips-siemens
- ;;
- rtpc | rtpc-*)
- basic_machine=romp-ibm
- ;;
- s390 | s390-*)
- basic_machine=s390-ibm
- ;;
- s390x | s390x-*)
- basic_machine=s390x-ibm
- ;;
- sa29200)
- basic_machine=a29k-amd
- os=-udi
- ;;
- sb1)
- basic_machine=mipsisa64sb1-unknown
- ;;
- sb1el)
- basic_machine=mipsisa64sb1el-unknown
- ;;
- sde)
- basic_machine=mipsisa32-sde
- os=-elf
- ;;
- sei)
- basic_machine=mips-sei
- os=-seiux
- ;;
- sequent)
- basic_machine=i386-sequent
- ;;
- sh)
- basic_machine=sh-hitachi
- os=-hms
- ;;
- sh5el)
- basic_machine=sh5le-unknown
- ;;
- sh64)
- basic_machine=sh64-unknown
- ;;
- sparclite-wrs | simso-wrs)
- basic_machine=sparclite-wrs
- os=-vxworks
- ;;
- sps7)
- basic_machine=m68k-bull
- os=-sysv2
- ;;
- spur)
- basic_machine=spur-unknown
- ;;
- st2000)
- basic_machine=m68k-tandem
- ;;
- stratus)
- basic_machine=i860-stratus
- os=-sysv4
- ;;
- sun2)
- basic_machine=m68000-sun
- ;;
- sun2os3)
- basic_machine=m68000-sun
- os=-sunos3
- ;;
- sun2os4)
- basic_machine=m68000-sun
- os=-sunos4
- ;;
- sun3os3)
- basic_machine=m68k-sun
- os=-sunos3
- ;;
- sun3os4)
- basic_machine=m68k-sun
- os=-sunos4
- ;;
- sun4os3)
- basic_machine=sparc-sun
- os=-sunos3
- ;;
- sun4os4)
- basic_machine=sparc-sun
- os=-sunos4
- ;;
- sun4sol2)
- basic_machine=sparc-sun
- os=-solaris2
- ;;
- sun3 | sun3-*)
- basic_machine=m68k-sun
- ;;
- sun4)
- basic_machine=sparc-sun
- ;;
- sun386 | sun386i | roadrunner)
- basic_machine=i386-sun
- ;;
- sv1)
- basic_machine=sv1-cray
- os=-unicos
- ;;
- symmetry)
- basic_machine=i386-sequent
- os=-dynix
- ;;
- t3e)
- basic_machine=alphaev5-cray
- os=-unicos
- ;;
- t90)
- basic_machine=t90-cray
- os=-unicos
- ;;
- tic54x | c54x*)
- basic_machine=tic54x-unknown
- os=-coff
- ;;
- tic55x | c55x*)
- basic_machine=tic55x-unknown
- os=-coff
- ;;
- tic6x | c6x*)
- basic_machine=tic6x-unknown
- os=-coff
- ;;
- tile*)
- basic_machine=tile-unknown
- os=-linux-gnu
- ;;
- tx39)
- basic_machine=mipstx39-unknown
- ;;
- tx39el)
- basic_machine=mipstx39el-unknown
- ;;
- toad1)
- basic_machine=pdp10-xkl
- os=-tops20
- ;;
- tower | tower-32)
- basic_machine=m68k-ncr
- ;;
- tpf)
- basic_machine=s390x-ibm
- os=-tpf
- ;;
- udi29k)
- basic_machine=a29k-amd
- os=-udi
- ;;
- ultra3)
- basic_machine=a29k-nyu
- os=-sym1
- ;;
- v810 | necv810)
- basic_machine=v810-nec
- os=-none
- ;;
- vaxv)
- basic_machine=vax-dec
- os=-sysv
- ;;
- vms)
- basic_machine=vax-dec
- os=-vms
- ;;
- vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
- ;;
- vxworks960)
- basic_machine=i960-wrs
- os=-vxworks
- ;;
- vxworks68)
- basic_machine=m68k-wrs
- os=-vxworks
- ;;
- vxworks29k)
- basic_machine=a29k-wrs
- os=-vxworks
- ;;
- w65*)
- basic_machine=w65-wdc
- os=-none
- ;;
- w89k-*)
- basic_machine=hppa1.1-winbond
- os=-proelf
- ;;
- xbox)
- basic_machine=i686-pc
- os=-mingw32
- ;;
- xps | xps100)
- basic_machine=xps100-honeywell
- ;;
- ymp)
- basic_machine=ymp-cray
- os=-unicos
- ;;
- z8k-*-coff)
- basic_machine=z8k-unknown
- os=-sim
- ;;
- z80-*-coff)
- basic_machine=z80-unknown
- os=-sim
- ;;
- none)
- basic_machine=none-none
- os=-none
- ;;
-
-# Here we handle the default manufacturer of certain CPU types. It is in
-# some cases the only manufacturer, in others, it is the most popular.
- w89k)
- basic_machine=hppa1.1-winbond
- ;;
- op50n)
- basic_machine=hppa1.1-oki
- ;;
- op60c)
- basic_machine=hppa1.1-oki
- ;;
- romp)
- basic_machine=romp-ibm
- ;;
- mmix)
- basic_machine=mmix-knuth
- ;;
- rs6000)
- basic_machine=rs6000-ibm
- ;;
- vax)
- basic_machine=vax-dec
- ;;
- pdp10)
- # there are many clones, so DEC is not a safe bet
- basic_machine=pdp10-unknown
- ;;
- pdp11)
- basic_machine=pdp11-dec
- ;;
- we32k)
- basic_machine=we32k-att
- ;;
- sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
- basic_machine=sh-unknown
- ;;
- sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
- basic_machine=sparc-sun
- ;;
- cydra)
- basic_machine=cydra-cydrome
- ;;
- orion)
- basic_machine=orion-highlevel
- ;;
- orion105)
- basic_machine=clipper-highlevel
- ;;
- mac | mpw | mac-mpw)
- basic_machine=m68k-apple
- ;;
- pmac | pmac-mpw)
- basic_machine=powerpc-apple
- ;;
- *-unknown)
- # Make sure to match an already-canonicalized machine name.
- ;;
- *)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
-esac
-
-# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
- *-digital*)
- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
- ;;
- *-commodore*)
- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
- ;;
- *)
- ;;
-esac
-
-# Decode manufacturer-specific aliases for certain operating systems.
-
-if [ x"$os" != x"" ]
-then
-case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
- # -solaris* is a basic system type, with this one exception.
- -solaris1 | -solaris1.*)
- os=`echo $os | sed -e 's|solaris1|sunos4|'`
- ;;
- -solaris)
- os=-solaris2
- ;;
- -svr4*)
- os=-sysv4
- ;;
- -unixware*)
- os=-sysv4.2uw
- ;;
- -gnu/linux*)
- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
- ;;
- # First accept the basic system types.
- # The portable systems comes first.
- # Each alternative MUST END IN A *, to match a version number.
- # -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
- | -kopensolaris* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
- | -openbsd* | -solidbsd* \
- | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
- | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* | -cegcc* \
- | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
- | -uxpv* | -beos* | -mpeix* | -udk* \
- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
- # Remember, each alternative MUST END IN *, to match a version number.
- ;;
- -qnx*)
- case $basic_machine in
- x86-* | i*86-*)
- ;;
- *)
- os=-nto$os
- ;;
- esac
- ;;
- -nto-qnx*)
- ;;
- -nto*)
- os=`echo $os | sed -e 's|nto|nto-qnx|'`
- ;;
- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
- ;;
- -mac*)
- os=`echo $os | sed -e 's|mac|macos|'`
- ;;
- -linux-dietlibc)
- os=-linux-dietlibc
- ;;
- -linux*)
- os=`echo $os | sed -e 's|linux|linux-gnu|'`
- ;;
- -sunos5*)
- os=`echo $os | sed -e 's|sunos5|solaris2|'`
- ;;
- -sunos6*)
- os=`echo $os | sed -e 's|sunos6|solaris3|'`
- ;;
- -opened*)
- os=-openedition
- ;;
- -os400*)
- os=-os400
- ;;
- -wince*)
- os=-wince
- ;;
- -osfrose*)
- os=-osfrose
- ;;
- -osf*)
- os=-osf
- ;;
- -utek*)
- os=-bsd
- ;;
- -dynix*)
- os=-bsd
- ;;
- -acis*)
- os=-aos
- ;;
- -atheos*)
- os=-atheos
- ;;
- -syllable*)
- os=-syllable
- ;;
- -386bsd)
- os=-bsd
- ;;
- -ctix* | -uts*)
- os=-sysv
- ;;
- -nova*)
- os=-rtmk-nova
- ;;
- -ns2 )
- os=-nextstep2
- ;;
- -nsk*)
- os=-nsk
- ;;
- # Preserve the version number of sinix5.
- -sinix5.*)
- os=`echo $os | sed -e 's|sinix|sysv|'`
- ;;
- -sinix*)
- os=-sysv4
- ;;
- -tpf*)
- os=-tpf
- ;;
- -triton*)
- os=-sysv3
- ;;
- -oss*)
- os=-sysv3
- ;;
- -svr4)
- os=-sysv4
- ;;
- -svr3)
- os=-sysv3
- ;;
- -sysvr4)
- os=-sysv4
- ;;
- # This must come after -sysvr4.
- -sysv*)
- ;;
- -ose*)
- os=-ose
- ;;
- -es1800*)
- os=-ose
- ;;
- -xenix)
- os=-xenix
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- os=-mint
- ;;
- -aros*)
- os=-aros
- ;;
- -kaos*)
- os=-kaos
- ;;
- -zvmoe)
- os=-zvmoe
- ;;
- -dicos*)
- os=-dicos
- ;;
- -none)
- ;;
- *)
- # Get rid of the `-' at the beginning of $os.
- os=`echo $os | sed 's/[^-]*-//'`
- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
- exit 1
- ;;
-esac
-else
-
-# Here we handle the default operating systems that come with various machines.
-# The value should be what the vendor currently ships out the door with their
-# machine or put another way, the most popular os provided with the machine.
-
-# Note that if you're going to try to match "-MANUFACTURER" here (say,
-# "-sun"), then you have to tell the case statement up towards the top
-# that MANUFACTURER isn't an operating system. Otherwise, code above
-# will signal an error saying that MANUFACTURER isn't an operating
-# system, and we'll never get to this point.
-
-case $basic_machine in
- score-*)
- os=-elf
- ;;
- spu-*)
- os=-elf
- ;;
- *-acorn)
- os=-riscix1.2
- ;;
- arm*-rebel)
- os=-linux
- ;;
- arm*-semi)
- os=-aout
- ;;
- c4x-* | tic4x-*)
- os=-coff
- ;;
- # This must come before the *-dec entry.
- pdp10-*)
- os=-tops20
- ;;
- pdp11-*)
- os=-none
- ;;
- *-dec | vax-*)
- os=-ultrix4.2
- ;;
- m68*-apollo)
- os=-domain
- ;;
- i386-sun)
- os=-sunos4.0.2
- ;;
- m68000-sun)
- os=-sunos3
- # This also exists in the configure program, but was not the
- # default.
- # os=-sunos4
- ;;
- m68*-cisco)
- os=-aout
- ;;
- mep-*)
- os=-elf
- ;;
- mips*-cisco)
- os=-elf
- ;;
- mips*-*)
- os=-elf
- ;;
- or32-*)
- os=-coff
- ;;
- *-tti) # must be before sparc entry or we get the wrong os.
- os=-sysv3
- ;;
- sparc-* | *-sun)
- os=-sunos4.1.1
- ;;
- *-be)
- os=-beos
- ;;
- *-haiku)
- os=-haiku
- ;;
- *-ibm)
- os=-aix
- ;;
- *-knuth)
- os=-mmixware
- ;;
- *-wec)
- os=-proelf
- ;;
- *-winbond)
- os=-proelf
- ;;
- *-oki)
- os=-proelf
- ;;
- *-hp)
- os=-hpux
- ;;
- *-hitachi)
- os=-hiux
- ;;
- i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
- os=-sysv
- ;;
- *-cbm)
- os=-amigaos
- ;;
- *-dg)
- os=-dgux
- ;;
- *-dolphin)
- os=-sysv3
- ;;
- m68k-ccur)
- os=-rtu
- ;;
- m88k-omron*)
- os=-luna
- ;;
- *-next )
- os=-nextstep
- ;;
- *-sequent)
- os=-ptx
- ;;
- *-crds)
- os=-unos
- ;;
- *-ns)
- os=-genix
- ;;
- i370-*)
- os=-mvs
- ;;
- *-next)
- os=-nextstep3
- ;;
- *-gould)
- os=-sysv
- ;;
- *-highlevel)
- os=-bsd
- ;;
- *-encore)
- os=-bsd
- ;;
- *-sgi)
- os=-irix
- ;;
- *-siemens)
- os=-sysv4
- ;;
- *-masscomp)
- os=-rtu
- ;;
- f30[01]-fujitsu | f700-fujitsu)
- os=-uxpv
- ;;
- *-rom68k)
- os=-coff
- ;;
- *-*bug)
- os=-coff
- ;;
- *-apple)
- os=-macos
- ;;
- *-atari*)
- os=-mint
- ;;
- *)
- os=-none
- ;;
-esac
-fi
-
-# Here we handle the case where we know the os, and the CPU type, but not the
-# manufacturer. We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
- *-unknown)
- case $os in
- -riscix*)
- vendor=acorn
- ;;
- -sunos*)
- vendor=sun
- ;;
- -aix*)
- vendor=ibm
- ;;
- -beos*)
- vendor=be
- ;;
- -hpux*)
- vendor=hp
- ;;
- -mpeix*)
- vendor=hp
- ;;
- -hiux*)
- vendor=hitachi
- ;;
- -unos*)
- vendor=crds
- ;;
- -dgux*)
- vendor=dg
- ;;
- -luna*)
- vendor=omron
- ;;
- -genix*)
- vendor=ns
- ;;
- -mvs* | -opened*)
- vendor=ibm
- ;;
- -os400*)
- vendor=ibm
- ;;
- -ptx*)
- vendor=sequent
- ;;
- -tpf*)
- vendor=ibm
- ;;
- -vxsim* | -vxworks* | -windiss*)
- vendor=wrs
- ;;
- -aux*)
- vendor=apple
- ;;
- -hms*)
- vendor=hitachi
- ;;
- -mpw* | -macos*)
- vendor=apple
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- vendor=atari
- ;;
- -vos*)
- vendor=stratus
- ;;
- esac
- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
- ;;
-esac
-
-echo $basic_machine$os
-exit
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/ctdb/lib/tevent/configure.ac b/ctdb/lib/tevent/configure.ac
deleted file mode 100644
index b77a4ab4a1..0000000000
--- a/ctdb/lib/tevent/configure.ac
+++ /dev/null
@@ -1,25 +0,0 @@
-AC_PREREQ(2.50)
-AC_INIT(tevent, 0.9.9)
-AC_CONFIG_SRCDIR([tevent.c])
-AC_CONFIG_HEADER(config.h)
-
-AC_LIBREPLACE_ALL_CHECKS
-
-AC_LD_EXPORT_DYNAMIC
-AC_LD_SONAMEFLAG
-AC_LD_VERSIONSCRIPT
-AC_LD_PICFLAG
-AC_LD_SHLIBEXT
-AC_LIBREPLACE_SHLD
-AC_LIBREPLACE_SHLD_FLAGS
-AC_LIBREPLACE_RUNTIME_LIB_PATH_VAR
-
-m4_include(build_macros.m4)
-BUILD_WITH_SHARED_BUILD_DIR
-
-m4_include(pkg.m4)
-m4_include(libtalloc.m4)
-
-m4_include(libtevent.m4)
-
-AC_OUTPUT(Makefile tevent.pc)
diff --git a/ctdb/lib/tevent/doc/mainpage.dox b/ctdb/lib/tevent/doc/mainpage.dox
index 5cd3969c78..e2f986e1ef 100644
--- a/ctdb/lib/tevent/doc/mainpage.dox
+++ b/ctdb/lib/tevent/doc/mainpage.dox
@@ -8,7 +8,7 @@
* signals, and the classic file descriptor events.
*
* Tevent also provide helpers to deal with asynchronous code providing the
- * tevent_req (tevent tequest) functions.
+ * tevent_req (tevent request) functions.
*
* @section tevent_download Download
*
diff --git a/ctdb/lib/tevent/install-sh b/ctdb/lib/tevent/install-sh
deleted file mode 100755
index ba5e22ad4a..0000000000
--- a/ctdb/lib/tevent/install-sh
+++ /dev/null
@@ -1,238 +0,0 @@
-#! /bin/sh
-#
-# install - install a program, script, or datafile
-# This comes from X11R5.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch.
-#
-
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
-
-
-# put in absolute paths if you don't have them in your path; or use env. vars.
-
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
-
-transformbasename=""
-transform_arg=""
-instcmd="$mvprog"
-chmodcmd="$chmodprog 0755"
-chowncmd=""
-chgrpcmd=""
-stripcmd=""
-rmcmd="$rmprog -f"
-mvcmd="$mvprog"
-src=""
-dst=""
-dir_arg=""
-
-while [ x"$1" != x ]; do
- case $1 in
- -c) instcmd="$cpprog"
- shift
- continue;;
-
- -d) dir_arg=true
- shift
- continue;;
-
- -m) chmodcmd="$chmodprog $2"
- shift
- shift
- continue;;
-
- -o) chowncmd="$chownprog $2"
- shift
- shift
- continue;;
-
- -g) chgrpcmd="$chgrpprog $2"
- shift
- shift
- continue;;
-
- -s) stripcmd="$stripprog"
- shift
- continue;;
-
- -t=*) transformarg=`echo $1 | sed 's/-t=//'`
- shift
- continue;;
-
- -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
- shift
- continue;;
-
- *) if [ x"$src" = x ]
- then
- src=$1
- else
- # this colon is to work around a 386BSD /bin/sh bug
- :
- dst=$1
- fi
- shift
- continue;;
- esac
-done
-
-if [ x"$src" = x ]
-then
- echo "install: no input file specified"
- exit 1
-else
- true
-fi
-
-if [ x"$dir_arg" != x ]; then
- dst=$src
- src=""
-
- if [ -d $dst ]; then
- instcmd=:
- else
- instcmd=mkdir
- fi
-else
-
-# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
-# might cause directories to be created, which would be especially bad
-# if $src (and thus $dsttmp) contains '*'.
-
- if [ -f $src -o -d $src ]
- then
- true
- else
- echo "install: $src does not exist"
- exit 1
- fi
-
- if [ x"$dst" = x ]
- then
- echo "install: no destination specified"
- exit 1
- else
- true
- fi
-
-# If destination is a directory, append the input filename; if your system
-# does not like double slashes in filenames, you may need to add some logic
-
- if [ -d $dst ]
- then
- dst="$dst"/`basename $src`
- else
- true
- fi
-fi
-
-## this sed command emulates the dirname command
-dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
-
-# Make sure that the destination directory exists.
-# this part is taken from Noah Friedman's mkinstalldirs script
-
-# Skip lots of stat calls in the usual case.
-if [ ! -d "$dstdir" ]; then
-defaultIFS='
-'
-IFS="${IFS-${defaultIFS}}"
-
-oIFS="${IFS}"
-# Some sh's can't handle IFS=/ for some reason.
-IFS='%'
-set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
-IFS="${oIFS}"
-
-pathcomp=''
-
-while [ $# -ne 0 ] ; do
- pathcomp="${pathcomp}${1}"
- shift
-
- if [ ! -d "${pathcomp}" ] ;
- then
- $mkdirprog "${pathcomp}"
- else
- true
- fi
-
- pathcomp="${pathcomp}/"
-done
-fi
-
-if [ x"$dir_arg" != x ]
-then
- $doit $instcmd $dst &&
-
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
-else
-
-# If we're going to rename the final executable, determine the name now.
-
- if [ x"$transformarg" = x ]
- then
- dstfile=`basename $dst`
- else
- dstfile=`basename $dst $transformbasename |
- sed $transformarg`$transformbasename
- fi
-
-# don't allow the sed command to completely eliminate the filename
-
- if [ x"$dstfile" = x ]
- then
- dstfile=`basename $dst`
- else
- true
- fi
-
-# Make a temp file name in the proper directory.
-
- dsttmp=$dstdir/#inst.$$#
-
-# Move or copy the file name to the temp name
-
- $doit $instcmd $src $dsttmp &&
-
- trap "rm -f ${dsttmp}" 0 &&
-
-# and set any options; do chmod last to preserve setuid bits
-
-# If any of these fail, we abort the whole thing. If we want to
-# ignore errors from any of these, just make sure not to ignore
-# errors from the above "$doit $instcmd $src $dsttmp" command.
-
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
-
-# Now rename the file to the real destination.
-
- $doit $rmcmd -f $dstdir/$dstfile &&
- $doit $mvcmd $dsttmp $dstdir/$dstfile
-
-fi &&
-
-
-exit 0
diff --git a/ctdb/lib/tevent/libtalloc.m4 b/ctdb/lib/tevent/libtalloc.m4
deleted file mode 100644
index a4c5b8a9d9..0000000000
--- a/ctdb/lib/tevent/libtalloc.m4
+++ /dev/null
@@ -1,7 +0,0 @@
-AC_SUBST(TALLOC_OBJ)
-AC_SUBST(TALLOC_CFLAGS)
-AC_SUBST(TALLOC_LIBS)
-
-AC_CHECK_HEADER(talloc.h,
- [AC_CHECK_LIB(talloc, talloc_init, [TALLOC_LIBS="-ltalloc"]) ],
- [PKG_CHECK_MODULES(TALLOC, talloc)])
diff --git a/ctdb/lib/tevent/libtevent.m4 b/ctdb/lib/tevent/libtevent.m4
index 8a07eea2e7..409232a866 100644
--- a/ctdb/lib/tevent/libtevent.m4
+++ b/ctdb/lib/tevent/libtevent.m4
@@ -39,7 +39,7 @@ if test x"$INCLUDED_TEVENT" != x"no" ; then
TEVENT_OBJ="tevent.o tevent_debug.o tevent_util.o"
TEVENT_OBJ="$TEVENT_OBJ tevent_fd.o tevent_timed.o tevent_immediate.o tevent_signal.o"
TEVENT_OBJ="$TEVENT_OBJ tevent_req.o tevent_wakeup.o tevent_queue.o"
- TEVENT_OBJ="$TEVENT_OBJ tevent_standard.o tevent_select.o"
+ TEVENT_OBJ="$TEVENT_OBJ tevent_standard.o tevent_select.o tevent_poll.o"
AC_SUBST(TEVENT_OBJ)
TEVENT_CFLAGS="-I$teventdir"
@@ -55,8 +55,3 @@ if test x"$INCLUDED_TEVENT" != x"no" ; then
AC_DEFINE(HAVE_EPOLL, 1, [Whether epoll available])
fi
fi
-
-if test x"$VERSIONSCRIPT" != "x"; then
- EXPORTSFILE=tevent.exports
- AC_SUBST(EXPORTSFILE)
-fi
diff --git a/ctdb/lib/tevent/pkg.m4 b/ctdb/lib/tevent/pkg.m4
deleted file mode 100644
index 568127f104..0000000000
--- a/ctdb/lib/tevent/pkg.m4
+++ /dev/null
@@ -1,156 +0,0 @@
-# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
-#
-# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# PKG_PROG_PKG_CONFIG([MIN-VERSION])
-# ----------------------------------
-AC_DEFUN([PKG_PROG_PKG_CONFIG],
-[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
-m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
-AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
-if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
- AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
-fi
-if test -n "$PKG_CONFIG"; then
- _pkg_min_version=m4_default([$1], [0.9.0])
- AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
- if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
- PKG_CONFIG=""
- fi
-
-fi[]dnl
-])# PKG_PROG_PKG_CONFIG
-
-# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-#
-# Check to see whether a particular set of modules exists. Similar
-# to PKG_CHECK_MODULES(), but does not set variables or print errors.
-#
-#
-# Similar to PKG_CHECK_MODULES, make sure that the first instance of
-# this or PKG_CHECK_MODULES is called, or make sure to call
-# PKG_CHECK_EXISTS manually
-# --------------------------------------------------------------
-AC_DEFUN([PKG_CHECK_EXISTS],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
-if test -n "$PKG_CONFIG" && \
- AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
- m4_ifval([$2], [$2], [:])
-m4_ifvaln([$3], [else
- $3])dnl
-fi])
-
-
-# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
-# ---------------------------------------------
-m4_define([_PKG_CONFIG],
-[if test -n "$PKG_CONFIG"; then
- if test -n "$$1"; then
- pkg_cv_[]$1="$$1"
- else
- PKG_CHECK_EXISTS([$3],
- [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
- [pkg_failed=yes])
- fi
-else
- pkg_failed=untried
-fi[]dnl
-])# _PKG_CONFIG
-
-# _PKG_SHORT_ERRORS_SUPPORTED
-# -----------------------------
-AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
- _pkg_short_errors_supported=yes
-else
- _pkg_short_errors_supported=no
-fi[]dnl
-])# _PKG_SHORT_ERRORS_SUPPORTED
-
-
-# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
-# [ACTION-IF-NOT-FOUND])
-#
-#
-# Note that if there is a possibility the first call to
-# PKG_CHECK_MODULES might not happen, you should be sure to include an
-# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
-#
-#
-# --------------------------------------------------------------
-AC_DEFUN([PKG_CHECK_MODULES],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
-AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
-AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
-
-pkg_failed=no
-AC_MSG_CHECKING([for $1])
-
-_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
-_PKG_CONFIG([$1][_LIBS], [libs], [$2])
-
-m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
-and $1[]_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.])
-
-if test $pkg_failed = yes; then
- _PKG_SHORT_ERRORS_SUPPORTED
- if test $_pkg_short_errors_supported = yes; then
- $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
- else
- $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
- fi
- # Put the nasty error message in config.log where it belongs
- echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
-
- ifelse([$4], , [AC_MSG_ERROR(dnl
-[Package requirements ($2) were not met:
-
-$$1_PKG_ERRORS
-
-Consider adjusting the PKG_CONFIG_PATH environment variable if you
-installed software in a non-standard prefix.
-
-_PKG_TEXT
-])],
- [AC_MSG_RESULT([no])
- $4])
-elif test $pkg_failed = untried; then
- ifelse([$4], , [AC_MSG_FAILURE(dnl
-[The pkg-config script could not be found or is too old. Make sure it
-is in your PATH or set the PKG_CONFIG environment variable to the full
-path to pkg-config.
-
-_PKG_TEXT
-
-To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
- [$4])
-else
- $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
- $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
- AC_MSG_RESULT([yes])
- ifelse([$3], , :, [$3])
-fi[]dnl
-])# PKG_CHECK_MODULES
diff --git a/ctdb/lib/tevent/release-script.sh b/ctdb/lib/tevent/release-script.sh
deleted file mode 100755
index 077f562967..0000000000
--- a/ctdb/lib/tevent/release-script.sh
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/bash
-
-if [ "$1" = "" ]; then
- echo "Please provide version string, eg: 1.2.0"
- exit 1
-fi
-
-if [ ! -d "lib/tevent" ]; then
- echo "Run this script from the samba base directory."
- exit 1
-fi
-
-git clean -f -x -d lib/tevent
-git clean -f -x -d lib/replace
-
-curbranch=`git-branch |grep "^*" | tr -d "* "`
-
-version=$1
-strver=`echo ${version} | tr "." "-"`
-
-# Checkout the release tag
-git branch -f tevent-release-script-${strver} tevent-${strver}
-if [ ! "$?" = "0" ]; then
- echo "Unable to checkout tevent-${strver} release"
- exit 1
-fi
-
-git checkout tevent-release-script-${strver}
-
-# Test configure agrees with us
-confver=`grep "^AC_INIT" lib/tevent/configure.ac | tr -d "AC_INIT(tevent, " | tr -d ")"`
-if [ ! "$confver" = "$version" ]; then
- echo "Wrong version, requested release for ${version}, found ${confver}"
- exit 1
-fi
-
-# Now build tarball
-cp -a lib/tevent tevent-${version}
-cp -a lib/replace tevent-${version}/libreplace
-pushd tevent-${version}
-./autogen.sh
-popd
-tar cvzf tevent-${version}.tar.gz tevent-${version}
-rm -fr tevent-${version}
-
-#Clean up
-git checkout $curbranch
-git branch -d tevent-release-script-${strver}
diff --git a/ctdb/lib/tevent/rules.mk b/ctdb/lib/tevent/rules.mk
deleted file mode 100644
index c197e930a3..0000000000
--- a/ctdb/lib/tevent/rules.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-.SUFFIXES: .i _wrap.c
-
-showflags::
- @echo 'libtevent will be compiled with flags:'
- @echo ' CFLAGS = $(CFLAGS)'
- @echo ' CPPFLAGS = $(CPPFLAGS)'
- @echo ' LDFLAGS = $(LDFLAGS)'
- @echo ' LIBS = $(LIBS)'
-
-.SUFFIXES: .c .o
-
-.c.o:
- @echo Compiling $*.c
- @mkdir -p `dirname $@`
- @$(CC) $(PICFLAG) $(CFLAGS) $(ABI_CHECK) -c $< -o $@
-
-distclean::
- rm -f *~ */*~
diff --git a/ctdb/lib/tevent/samba.m4 b/ctdb/lib/tevent/samba.m4
deleted file mode 100644
index 549f39d210..0000000000
--- a/ctdb/lib/tevent/samba.m4
+++ /dev/null
@@ -1,11 +0,0 @@
-
-teventdir="\$(libteventsrcdir)"
-m4_include(../lib/tevent/libtevent.m4)
-
-SMB_EXT_LIB(LIBTEVENT_EXT, [${TEVENT_LIBS}])
-SMB_ENABLE(LIBTEVENT_EXT)
-
-SMB_SUBSYSTEM(LIBTEVENT,
- [\$(addprefix \$(libteventsrcdir)/, ${TEVENT_OBJ})],
- [LIBTEVENT_EXT],
- [${TEVENT_CFLAGS}])
diff --git a/ctdb/lib/tevent/script/abi_checks.sh b/ctdb/lib/tevent/script/abi_checks.sh
deleted file mode 100755
index c34a659d73..0000000000
--- a/ctdb/lib/tevent/script/abi_checks.sh
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/bin/sh
-
-#
-# abi_checks.sh - check for possible abi changes
-#
-# Copyright (C) 2009 Micheal Adam <obnox@samba.org>
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the Free
-# Software Foundation; either version 3 of the License, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-# more details.
-#
-# You should have received a copy of the GNU General Public License along with
-# this program; if not, see <http://www.gnu.org/licenses/>.
-#
-
-#
-# USAGE: abi_checks.sh LIBNAME header1 [header2 ...]
-#
-# This script creates symbol and signature lists from the provided header
-# files with the aid of the mksyms.sh and mksigs.pl scripts (saved as
-# $LIBNAME.exports.check and $LIBNAME.sigatures.check). It then compares
-# the resulting files with the files $LIBNAME.exports and $LIBNME.signatures
-# which it expects to find in the current directory.
-#
-
-LANG=C; export LANG
-LC_ALL=C; export LC_ALL
-LC_COLLATE=C; export LC_COLLATE
-
-script=$0
-dir_name=$(dirname ${script})
-
-if test x"$1" = "x" ; then
- echo "USAGE: ${script} libname header [header ...]"
- exit 1
-fi
-
-libname="$1"
-shift
-
-if test x"$1" = "x" ; then
- echo "USAGE: ${script} libname header [header ...]"
- exit 1
-fi
-
-headers="$*"
-
-exports_file=${libname}.exports
-exports_file_check=${exports_file}.check
-signatures_file=${libname}.signatures
-signatures_file_check=${signatures_file}.check
-
-
-${dir_name}/mksyms.sh awk ${exports_file_check} ${headers} 2>&1 > /dev/null
-
-cat ${headers} | ${dir_name}/mksigs.pl > ${signatures_file_check} 2> /dev/null
-
-normalize_exports_file() {
- filename=$1
- cat ${filename} \
- | sed -e 's/^[ \t]*//g' \
- | sed -e 's/^$//g' \
- | sed -e 's/^#.*$//g' \
- | sort | uniq > ${filename}.sort
-}
-
-normalize_exports_file ${exports_file}
-normalize_exports_file ${exports_file_check}
-
-normalize_exports_file ${signatures_file}
-normalize_exports_file ${signatures_file_check}
-
-diff -u ${exports_file}.sort ${exports_file_check}.sort
-if test "x$?" != "x0" ; then
- echo "WARNING: possible ABI change detected in exports!"
-else
- echo "exports check: OK"
-fi
-
-diff -u ${signatures_file}.sort ${signatures_file_check}.sort
-if test "x$?" != "x0" ; then
- echo "WARNING: possible ABI change detected in signatures!"
-else
- echo "signatures check: OK"
-fi
diff --git a/ctdb/lib/tevent/script/abi_checks_gcc.sh b/ctdb/lib/tevent/script/abi_checks_gcc.sh
deleted file mode 100755
index 95182097d5..0000000000
--- a/ctdb/lib/tevent/script/abi_checks_gcc.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/bash
-make clean
-
-mkdir abi
-ABI_CHECKS="-aux-info abi/\$@.X"
-make ABI_CHECK="$ABI_CHECKS" CC="/usr/bin/gcc"
-
-for i in abi/*.X; do cat $i | grep 'tevent\.h'; done | sort | uniq | awk -F "extern " '{ print $2 }' | sort> abi/signatures
-
-cat > abi/exports << EOF
-{
- global:
-EOF
-cat abi/signatures | awk -F '(' '{ print $1 }' | awk -F ' ' '{ print " "$NF";" }' | tr -d '*' | sort >> abi/exports
-cat >> abi/exports << EOF
-
- local: *;
-};
-EOF
-
-rm -fr abi/*.X
-
-diff -u tevent.signatures abi/signatures
-if [ "$?" != "0" ]; then
- echo "WARNING: Possible ABI Change!!"
-fi
-
-diff -u tevent.exports abi/exports
-if [ "$?" != "0" ]; then
- echo "WARNING: Export file may be outdated!!"
-fi
diff --git a/ctdb/lib/tevent/script/mksigs.pl b/ctdb/lib/tevent/script/mksigs.pl
deleted file mode 100755
index 755cd79603..0000000000
--- a/ctdb/lib/tevent/script/mksigs.pl
+++ /dev/null
@@ -1,183 +0,0 @@
-#!/usr/bin/perl
-
-# mksigs.pl - extract signatures from C headers
-#
-# Copyright (C) Michael Adam 2009
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the Free
-# Software Foundation; either version 3 of the License, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-# more details.
-#
-# You should have received a copy of the GNU General Public License along with
-# this program; if not, see <http://www.gnu.org/licenses/>.
-
-# USAGE: cat $header_files | mksigs.pl > $signature_file
-#
-# The header files to parse are read from stdin.
-# The output is in a form as produced by gcc with the -aux-info switch
-# and printed to stdout.
-
-use strict;
-use warnings;
-
-my $in_comment = 0;
-my $extern_C_block = 0;
-
-while (my $LINE = <>) {
- # find end of started multi-line-comment
- if ($in_comment) {
- if ($LINE =~ /^.*?\*\/(.*)$/) {
- $LINE = $1;
- $in_comment = 0;
- } else {
- # whole line within comment
- next;
- }
- }
-
- # strip C++-style comments
- $LINE =~ s/^(.*?)\/\/.*$/$1/;
-
- # strip in-line-comments:
- while ($LINE =~ /\/\*.*?\*\//) {
- $LINE =~ s/\/\*.*?\*\///;
- }
-
- # find starts of multi-line-comments
- if ($LINE =~ /^(.*)\/\*/) {
- $in_comment = 1;
- $LINE = $1;
- }
-
- # skip empty lines
- next if $LINE =~ /^\s*$/;
-
- # remove leading spaces
- $LINE =~ s/^\s*(.*)$/$1/;
-
- # concatenate lines split with "\" (usually macro defines)
- while ($LINE =~ /^(.*?)\s+\\$/) {
- my $LINE2 = <>;
- $LINE = $1;
- $LINE2 =~ s/^\s*(.*)$/$1/;
- $LINE .= " " . $LINE2;
- }
-
- # remove all preprocessor directives
- next if ($LINE =~ /^#/);
-
- if ($LINE =~ /^extern\s+"C"\s+\{/) {
- $extern_C_block = 1;
- next;
- }
-
- if (($LINE =~ /^[^\{]*\}/) and $extern_C_block) {
- $extern_C_block = 0;
- next;
- }
-
- $LINE =~ s/^extern\s//;
-
- # concatenate braces stretched over multiple lines
- # (from structs or enums)
- my $REST = $LINE;
- my $braces = 0;
- while (($REST =~ /[\{\}]/) or ($braces)) {
- while ($REST =~ /[\{\}]/) {
- # collect opening
- while ($REST =~ /^[^\{\}]*\{(.*)$/) {
- $braces++;
- $REST = $1;
- }
-
- # collect closing
- while ($REST =~ /^[^\{\}]*\}(.*)$/) {
- $braces--;
- $REST = $1;
- }
- }
-
- # concatenate if not balanced
- if ($braces) {
- if (my $LINE2 = <>) {
- $LINE2 =~ s/^\s*(.*)$/$1/;
- chomp($LINE);
- $LINE .= " " . $LINE2;
- chomp $REST;
- $REST .= " " . $LINE2;
- } else {
- print "ERROR: unbalanced braces ($braces)\n";
- last;
- }
- }
- }
-
- # concetenate function prototypes that stretch over multiple lines
- $REST = $LINE;
- my $parenthesis = 0;
- while (($REST =~ /[\(\)]/) or ($parenthesis)) {
- while ($REST =~ /[\(\)]/) {
- # collect opening
- while ($REST =~ /^[^\(\)]*\((.*)$/) {
- $parenthesis++;
- $REST = $1;
- }
-
- # collect closing
- while ($REST =~ /^[^\(\)]*\)(.*)$/) {
- $parenthesis--;
- $REST = $1;
- }
- }
-
- # concatenate if not balanced
- if ($parenthesis) {
- if (my $LINE2 = <>) {
- $LINE2 =~ s/^\s*(.*)$/$1/;
- chomp($LINE);
- $LINE .= " " . $LINE2;
- chomp($REST);
- $REST .= " " . $LINE2;
- } else {
- print "ERROR: unbalanced parantheses ($parenthesis)\n";
- last;
- }
- }
- }
-
- next if ($LINE =~ /^typedef\s/);
- next if ($LINE =~ /^enum\s+[^\{\(]+\s+\{/);
- next if ($LINE =~ /^struct\s+[^\{\(]+\s+\{.*\}\s*;/);
- next if ($LINE =~ /^struct\s+[a-zA-Z0-9_]+\s*;/);
-
- # remove trailing spaces
- $LINE =~ s/(.*?)\s*$/$1/;
-
- $LINE =~ s/^(.*\))\s+PRINTF_ATTRIBUTE\([^\)]*\)(\s*[;,])/$1$2/;
- $LINE =~ s/^(.*\))\s*[a-zA-Z0-9_]+\s*;$/$1;/;
-
- # remove parameter names - slightly too coarse probably
- $LINE =~ s/([\s\(]\*?)[_0-9a-zA-Z]+\s*([,\)])/$1$2/g;
-
- # remedy (void) from last line
- $LINE =~ s/\(\)/(void)/g;
-
- # normalize spaces
- $LINE =~ s/\s*\)\s*/)/g;
- $LINE =~ s/\s*\(\s*/ (/g;
- $LINE =~ s/\s*,\s*/, /g;
-
- # normalize unsigned
- $LINE =~ s/([\s,\(])unsigned([,\)])/$1unsigned int$2/g;
-
- # normalize bool
- $LINE =~ s/(\b)bool(\b)/_Bool/g;
-
- print $LINE . "\n";
-}
diff --git a/ctdb/lib/tevent/script/mksyms.awk b/ctdb/lib/tevent/script/mksyms.awk
deleted file mode 100644
index 63ff9db8f8..0000000000
--- a/ctdb/lib/tevent/script/mksyms.awk
+++ /dev/null
@@ -1,75 +0,0 @@
-#
-# mksyms.awk
-#
-# Extract symbols to export from C-header files.
-# output in version-script format for linking shared libraries.
-#
-# Copyright (C) 2008 Michael Adam <obnox@samba.org>
-#
-BEGIN {
- inheader=0;
- current_file="";
- print "#"
- print "# This file is automatically generated with \"make symbols\". DO NOT EDIT "
- print "#"
- print "{"
- print "\tglobal:"
-}
-
-END {
- print""
- print "\tlocal: *;"
- print "};"
-}
-
-{
- if (FILENAME!=current_file) {
- print "\t\t# The following definitions come from",FILENAME
- current_file=FILENAME
- }
- if (inheader) {
- if (match($0,"[)][^()]*[;][ \t]*$")) {
- inheader = 0;
- }
- next;
- }
-}
-
-/^static/ || /^[ \t]*typedef/ || !/^[a-zA-Z\_]/ {
- next;
-}
-
-/^extern[ \t]+[^()]+[;][ \t]*$/ {
- gsub(/[^ \t]+[ \t]+/, "");
- sub(/[;][ \t]*$/, "");
- printf "\t\t%s;\n", $0;
- next;
-}
-
-# look for function headers:
-{
- gotstart = 0;
- if ($0 ~ /^[A-Za-z_][A-Za-z0-9_]+/) {
- gotstart = 1;
- }
- if(!gotstart) {
- next;
- }
-}
-
-/[_A-Za-z0-9]+[ \t]*[(].*[)][^()]*;[ \t]*$/ {
- sub(/[(].*$/, "");
- gsub(/[^ \t]+[ \t]+/, "");
- gsub(/^[*]+/, "");
- printf "\t\t%s;\n",$0;
- next;
-}
-
-/[_A-Za-z0-9]+[ \t]*[(]/ {
- inheader=1;
- sub(/[(].*$/, "");
- gsub(/[^ \t]+[ \t]+/, "");
- gsub(/^[*]/, "");
- printf "\t\t%s;\n",$0;
- next;
-}
diff --git a/ctdb/lib/tevent/script/mksyms.sh b/ctdb/lib/tevent/script/mksyms.sh
deleted file mode 100755
index 7fb4031e2b..0000000000
--- a/ctdb/lib/tevent/script/mksyms.sh
+++ /dev/null
@@ -1,45 +0,0 @@
-#! /bin/sh
-
-#
-# mksyms.sh
-#
-# Extract symbols to export from C-header files.
-# output in version-script format for linking shared libraries.
-#
-# This is the shell wrapper for the mksyms.awk core script.
-#
-# Copyright (C) 2008 Michael Adam <obnox@samba.org>
-#
-
-LANG=C; export LANG
-LC_ALL=C; export LC_ALL
-LC_COLLATE=C; export LC_COLLATE
-
-if [ $# -lt 2 ]
-then
- echo "Usage: $0 awk output_file header_files"
- exit 1
-fi
-
-awk="$1"
-shift
-
-symsfile="$1"
-shift
-symsfile_tmp="$symsfile.$$.tmp~"
-
-proto_src="`echo $@ | tr ' ' '\n' | sort | uniq `"
-
-echo creating $symsfile
-
-mkdir -p `dirname $symsfile`
-
-${awk} -f `dirname $0`/mksyms.awk $proto_src > $symsfile_tmp
-
-if cmp -s $symsfile $symsfile_tmp 2>/dev/null
-then
- echo "$symsfile unchanged"
- rm $symsfile_tmp
-else
- mv $symsfile_tmp $symsfile
-fi
diff --git a/ctdb/lib/tevent/testsuite.c b/ctdb/lib/tevent/testsuite.c
index 3a763de6db..b674689669 100644
--- a/ctdb/lib/tevent/testsuite.c
+++ b/ctdb/lib/tevent/testsuite.c
@@ -101,7 +101,9 @@ static bool test_event_context(struct torture_context *test,
#ifdef SA_RESTART
se1 = event_add_signal(ev_ctx, ev_ctx, SIGALRM, SA_RESTART, count_handler, &alarm_count);
#endif
+#ifdef SA_RESETHAND
se2 = event_add_signal(ev_ctx, ev_ctx, SIGALRM, SA_RESETHAND, count_handler, &alarm_count);
+#endif
#ifdef SA_SIGINFO
se3 = event_add_signal(ev_ctx, ev_ctx, SIGUSR1, SA_SIGINFO, count_handler, &info_count);
#endif
@@ -146,7 +148,7 @@ static bool test_event_context(struct torture_context *test,
struct torture_suite *torture_local_event(TALLOC_CTX *mem_ctx)
{
- struct torture_suite *suite = torture_suite_create(mem_ctx, "EVENT");
+ struct torture_suite *suite = torture_suite_create(mem_ctx, "event");
const char **list = event_backend_list(suite);
int i;
diff --git a/ctdb/lib/tevent/tevent.c b/ctdb/lib/tevent/tevent.c
index 5eec5ccf56..d3421a2718 100644
--- a/ctdb/lib/tevent/tevent.c
+++ b/ctdb/lib/tevent/tevent.c
@@ -64,9 +64,6 @@
#include "tevent_internal.h"
#include "tevent_util.h"
-/* needed for the special ctdbd "track if time jumps unexpectedly */
-#include <time.h>
-
struct tevent_ops_list {
struct tevent_ops_list *next, *prev;
const char *name;
@@ -91,7 +88,7 @@ bool tevent_register_backend(const char *name, const struct tevent_ops *ops)
}
}
- e = talloc(talloc_autofree_context(), struct tevent_ops_list);
+ e = talloc(NULL, struct tevent_ops_list);
if (e == NULL) return false;
e->name = name;
@@ -107,8 +104,7 @@ bool tevent_register_backend(const char *name, const struct tevent_ops *ops)
void tevent_set_default_backend(const char *backend)
{
talloc_free(tevent_default_backend);
- tevent_default_backend = talloc_strdup(talloc_autofree_context(),
- backend);
+ tevent_default_backend = talloc_strdup(NULL, backend);
}
/*
@@ -117,6 +113,7 @@ void tevent_set_default_backend(const char *backend)
static void tevent_backend_init(void)
{
tevent_select_init();
+ tevent_poll_init();
tevent_standard_init();
#ifdef HAVE_EPOLL
tevent_epoll_init();
@@ -188,6 +185,17 @@ int tevent_common_context_destructor(struct tevent_context *ev)
tevent_cleanup_pending_signal_handlers(se);
}
+ /* removing nesting hook or we get an abort when nesting is
+ * not allowed. -- SSS
+ * Note that we need to leave the allowed flag at its current
+ * value, otherwise the use in tevent_re_initialise() will
+ * leave the event context with allowed forced to false, which
+ * will break users that expect nesting to be allowed
+ */
+ ev->nesting.level = 0;
+ ev->nesting.hook_fn = NULL;
+ ev->nesting.hook_private = NULL;
+
return 0;
}
@@ -394,7 +402,6 @@ struct tevent_immediate *_tevent_create_immediate(TALLOC_CTX *mem_ctx,
/*
schedule an immediate event
- return NULL on failure
*/
void _tevent_schedule_immediate(struct tevent_immediate *im,
struct tevent_context *ev,
@@ -581,14 +588,12 @@ done:
return ret;
}
-
/*
return on failure or (with 0) if all fd events are removed
*/
int tevent_common_loop_wait(struct tevent_context *ev,
const char *location)
{
-
/*
* loop as long as we have events pending
*/
diff --git a/ctdb/lib/tevent/tevent.exports b/ctdb/lib/tevent/tevent.exports
deleted file mode 100644
index 01d547ad85..0000000000
--- a/ctdb/lib/tevent/tevent.exports
+++ /dev/null
@@ -1,62 +0,0 @@
-{
- global:
- _tevent_add_fd;
- _tevent_add_signal;
- _tevent_add_timer;
- tevent_backend_list;
- tevent_context_init;
- tevent_context_init_byname;
- _tevent_create_immediate;
- tevent_fd_get_flags;
- tevent_fd_set_auto_close;
- tevent_fd_set_close_fn;
- tevent_fd_set_flags;
- tevent_loop_allow_nesting;
- _tevent_loop_once;
- tevent_loop_set_nesting_hook;
- _tevent_loop_until;
- _tevent_loop_wait;
- tevent_queue_add;
- _tevent_queue_create;
- tevent_queue_length;
- tevent_queue_start;
- tevent_queue_stop;
- tevent_register_backend;
- _tevent_req_callback_data;
- _tevent_req_create;
- _tevent_req_data;
- tevent_req_default_print;
- _tevent_req_done;
- _tevent_req_error;
- tevent_req_is_error;
- tevent_req_is_in_progress;
- _tevent_req_nomem;
- _tevent_req_notify_callback;
- tevent_req_poll;
- tevent_req_post;
- tevent_req_print;
- tevent_req_received;
- tevent_req_set_callback;
- tevent_req_set_endtime;
- tevent_req_set_print_fn;
- _tevent_schedule_immediate;
- tevent_set_abort_fn;
- tevent_set_debug;
- tevent_set_debug_stderr;
- tevent_set_default_backend;
- tevent_signal_support;
- tevent_timeval_add;
- tevent_timeval_compare;
- tevent_timeval_current;
- tevent_timeval_current_ofs;
- tevent_timeval_is_zero;
- tevent_timeval_set;
- tevent_timeval_until;
- tevent_timeval_zero;
- tevent_wakeup_recv;
- tevent_wakeup_send;
- _tevent_req_cancel;
- tevent_req_set_cancel_fn;
-
- local: *;
-};
diff --git a/ctdb/lib/tevent/tevent.h b/ctdb/lib/tevent/tevent.h
index 914548fd6e..b76e3a3769 100644
--- a/ctdb/lib/tevent/tevent.h
+++ b/ctdb/lib/tevent/tevent.h
@@ -28,10 +28,6 @@
#ifndef __TEVENT_H__
#define __TEVENT_H__
-#ifndef TEVENT_DEPRECATED
-#define TEVENT_DEPRECATED
-#endif
-
#include <stdint.h>
#include <talloc.h>
#include <sys/time.h>
@@ -115,7 +111,7 @@ typedef void (*tevent_signal_handler_t)(struct tevent_context *ev,
struct tevent_context *tevent_context_init(TALLOC_CTX *mem_ctx);
/**
- * @brief Create a event_context structure and name it.
+ * @brief Create a event_context structure and select a specific backend.
*
* This must be the first events call, and all subsequent calls pass this
* event_context as the first element. Event handlers also receive this as
@@ -123,7 +119,7 @@ struct tevent_context *tevent_context_init(TALLOC_CTX *mem_ctx);
*
* @param[in] mem_ctx The memory context to use.
*
- * @param[in] name The name for the tevent context.
+ * @param[in] name The name of the backend to use.
*
* @return An allocated tevent context, NULL on error.
*/
@@ -140,7 +136,7 @@ struct tevent_context *tevent_context_init_byname(TALLOC_CTX *mem_ctx, const cha
const char **tevent_backend_list(TALLOC_CTX *mem_ctx);
/**
- * @brief Set the default tevent backent.
+ * @brief Set the default tevent backend.
*
* @param[in] backend The name of the backend to set.
*/
@@ -513,50 +509,121 @@ int tevent_set_debug_stderr(struct tevent_context *ev);
* @defgroup tevent_request The tevent request functions.
* @ingroup tevent
*
- * This represents an async request being processed by callbacks via an event
- * context. A user can issue for example a write request to a socket, giving
- * an implementation function the fd, the buffer and the number of bytes to
- * transfer. The function issuing the request will immediately return without
- * blocking most likely without having sent anything. The API user then fills
- * in req->async.fn and req->async.private_data, functions that are called
- * when the request is finished.
+ * A tevent_req represents an asynchronous computation.
+ *
+ * The tevent_req group of API calls is the recommended way of
+ * programming async computations within tevent. In particular the
+ * file descriptor (tevent_add_fd) and timer (tevent_add_timed) events
+ * are considered too low-level to be used in larger computations. To
+ * read and write from and to sockets, Samba provides two calls on top
+ * of tevent_add_fd: read_packet_send/recv and writev_send/recv. These
+ * requests are much easier to compose than the low-level event
+ * handlers called from tevent_add_fd.
+ *
+ * A lot of the simplicity tevent_req has brought to the notoriously
+ * hairy async programming came via a set of conventions that every
+ * async computation programmed should follow. One central piece of
+ * these conventions is the naming of routines and variables.
+ *
+ * Every async computation needs a name (sensibly called "computation"
+ * down from here). From this name quite a few naming conventions are
+ * derived.
+ *
+ * Every computation that requires local state needs a
+ * @code
+ * struct computation_state {
+ * int local_var;
+ * };
+ * @endcode
+ * Even if no local variables are required, such a state struct should
+ * be created containing a dummy variable. Quite a few helper
+ * functions and macros (for example tevent_req_create()) assume such
+ * a state struct.
+ *
+ * An async computation is started by a computation_send
+ * function. When it is finished, its result can be received by a
+ * computation_recv function. For an example how to set up an async
+ * computation, see the code example in the documentation for
+ * tevent_req_create() and tevent_req_post(). The prototypes for _send
+ * and _recv functions should follow some conventions:
+ *
+ * @code
+ * struct tevent_req *computation_send(TALLOC_CTX *mem_ctx,
+ * struct tevent_req *ev,
+ * ... further args);
+ * int computation_recv(struct tevent_req *req, ... further output args);
+ * @endcode
+ *
+ * The "int" result of computation_recv() depends on the result the
+ * sync version of the function would have, "int" is just an example
+ * here.
+ *
+ * Another important piece of the conventions is that the program flow
+ * is interrupted as little as possible. Because a blocking
+ * sub-computation requires that the flow needs to continue in a
+ * separate function that is the logical sequel of some computation,
+ * it should lexically follow sending off the blocking
+ * sub-computation. Setting the callback function via
+ * tevent_req_set_callback() requires referencing a function lexically
+ * below the call to tevent_req_set_callback(), forward declarations
+ * are required. A lot of the async computations thus begin with a
+ * sequence of declarations such as
+ *
+ * @code
+ * static void computation_step1_done(struct tevent_req *subreq);
+ * static void computation_step2_done(struct tevent_req *subreq);
+ * static void computation_step3_done(struct tevent_req *subreq);
+ * @endcode
+ *
+ * It really helps readability a lot to do these forward declarations,
+ * because the lexically sequential program flow makes the async
+ * computations almost as clear to read as a normal, sync program
+ * flow.
*
- * It is up to the user of the async request to talloc_free it after it has
- * finished. This can happen while the completion function is called.
+ * It is up to the user of the async computation to talloc_free it
+ * after it has finished. If an async computation should be aborted,
+ * the tevent_req structure can be talloc_free'ed. After it has
+ * finished, it should talloc_free'ed by the API user.
*
* @{
*/
/**
- * An async request moves between the following 4 states:
+ * An async request moves from TEVENT_REQ_INIT to
+ * TEVENT_REQ_IN_PROGRESS. All other states are valid after a request
+ * has finished.
*/
enum tevent_req_state {
/**
- * we are creating the request
+ * We are creating the request
*/
TEVENT_REQ_INIT,
/**
- * we are waiting the request to complete
+ * We are waiting the request to complete
*/
TEVENT_REQ_IN_PROGRESS,
/**
- * the request is finished
+ * The request is finished successfully
*/
TEVENT_REQ_DONE,
/**
- * A user error has occurred
+ * A user error has occurred. The user error has been
+ * indicated by tevent_req_error(), it can be retrieved via
+ * tevent_req_is_error().
*/
TEVENT_REQ_USER_ERROR,
/**
- * Request timed out
+ * Request timed out after the timeout set by tevent_req_set_endtime.
*/
TEVENT_REQ_TIMED_OUT,
/**
- * No memory in between
+ * An internal allocation has failed, or tevent_req_nomem has
+ * been given a NULL pointer as the first argument.
*/
TEVENT_REQ_NO_MEMORY,
/**
- * the request is already received by the caller
+ * The request has been received by the caller. No further
+ * action is valid.
*/
TEVENT_REQ_RECEIVED
};
@@ -576,6 +643,9 @@ typedef void (*tevent_req_fn)(struct tevent_req *req);
/**
* @brief Set an async request callback.
*
+ * See the documentation of tevent_req_post() for an example how this
+ * is supposed to be used.
+ *
* @param[in] req The async request to set the callback.
*
* @param[in] fn The callback function to set.
@@ -587,9 +657,17 @@ void tevent_req_set_callback(struct tevent_req *req, tevent_req_fn fn, void *pvt
#ifdef DOXYGEN
/**
- * @brief Get the private data casted to the given type for a callback from
+ * @brief Get the private data cast to the given type for a callback from
* a tevent request structure.
*
+ * @code
+ * static void computation_done(struct tevent_req *subreq) {
+ * struct tevent_req *req = tevent_req_callback_data(subreq, struct tevent_req);
+ * struct computation_state *state = tevent_req_data(req, struct computation_state);
+ * .... more things, eventually maybe call tevent_req_done(req);
+ * }
+ * @endcode
+ *
* @param[in] req The structure to get the callback data from.
*
* @param[in] type The type of the private callback data to get.
@@ -623,11 +701,17 @@ void *tevent_req_callback_data_void(struct tevent_req *req);
/**
* @brief Get the private data from a tevent request structure.
*
+ * When the tevent_req has been created by tevent_req_create, the
+ * result of tevent_req_data() is the state variable created by
+ * tevent_req_create() as a child of the req.
+ *
* @param[in] req The structure to get the private data from.
*
+ * @param[in] type The type of the private data
+ *
* @return The private data or NULL if not set.
*/
-void *tevent_req_data(struct tevent_req *req);
+void *tevent_req_data(struct tevent_req *req, #type);
#else
void *_tevent_req_data(struct tevent_req *req);
#define tevent_req_data(_req, _type) \
@@ -759,22 +843,29 @@ bool _tevent_req_cancel(struct tevent_req *req, const char *location);
/**
* @brief Create an async tevent request.
*
- * The new async request will be initialized in state ASYNC_REQ_IN_PROGRESS.
+ * The new async request will be initialized in state TEVENT_REQ_IN_PROGRESS.
*
- * @param[in] mem_ctx The memory context for the result.
- *
- * @param[in] pstate The private state of the request.
+ * @code
+ * struct tevent_req *req;
+ * struct computation_state *state;
+ * req = tevent_req_create(mem_ctx, &state, struct computation_state);
+ * @endcode
*
- * @param[in] state_size The size of the private state of the request.
+ * Tevent_req_create() creates the state variable as a talloc child of
+ * its result. The state variable should be used as the talloc parent
+ * for all temporary variables that are allocated during the async
+ * computation. This way, when the user of the async computation frees
+ * the request, the state as a talloc child will be free'd along with
+ * all the temporary variables hanging off the state.
*
+ * @param[in] mem_ctx The memory context for the result.
+ * @param[in] pstate Pointer to the private request state.
* @param[in] type The name of the request.
*
* @return A new async request. NULL on error.
*/
struct tevent_req *tevent_req_create(TALLOC_CTX *mem_ctx,
- void *pstate,
- size_t state_size,
- const char *type);
+ void **pstate, #type);
#else
struct tevent_req *_tevent_req_create(TALLOC_CTX *mem_ctx,
void *pstate,
@@ -904,19 +995,52 @@ bool _tevent_req_nomem(const void *p,
_tevent_req_nomem(p, req, __location__)
#endif
+#ifdef DOXYGEN
+/**
+ * @brief Indicate out of memory to a request
+ *
+ * @param[in] req The request being processed.
+ */
+void tevent_req_oom(struct tevent_req *req);
+#else
+void _tevent_req_oom(struct tevent_req *req,
+ const char *location);
+#define tevent_req_oom(req) \
+ _tevent_req_oom(req, __location__)
+#endif
+
/**
* @brief Finish a request before the caller had the change to set the callback.
*
* An implementation of an async request might find that it can either finish
- * the request without waiting for an external event, or it can't even start
+ * the request without waiting for an external event, or it can not even start
* the engine. To present the illusion of a callback to the user of the API,
* the implementation can call this helper function which triggers an
- * immediate timed event. This way the caller can use the same calling
+ * immediate event. This way the caller can use the same calling
* conventions, independent of whether the request was actually deferred.
*
+ * @code
+ * struct tevent_req *computation_send(TALLOC_CTX *mem_ctx,
+ * struct tevent_context *ev)
+ * {
+ * struct tevent_req *req, *subreq;
+ * struct computation_state *state;
+ * req = tevent_req_create(mem_ctx, &state, struct computation_state);
+ * if (req == NULL) {
+ * return NULL;
+ * }
+ * subreq = subcomputation_send(state, ev);
+ * if (tevent_req_nomem(subreq, req)) {
+ * return tevent_req_post(req, ev);
+ * }
+ * tevent_req_set_callback(subreq, computation_done, req);
+ * return req;
+ * }
+ * @endcode
+ *
* @param[in] req The finished request.
*
- * @param[in] ev The tevent_context for the timed event.
+ * @param[in] ev The tevent_context for the immediate event.
*
* @return The given request will be returned.
*/
@@ -924,12 +1048,52 @@ struct tevent_req *tevent_req_post(struct tevent_req *req,
struct tevent_context *ev);
/**
+ * @brief Finish multiple requests within one function
+ *
+ * Normally tevent_req_notify_callback() and all wrappers
+ * (e.g. tevent_req_done() and tevent_req_error())
+ * need to be the last thing an event handler should call.
+ * This is because the callback is likely to destroy the
+ * context of the current function.
+ *
+ * If a function wants to notify more than one caller,
+ * it is dangerous if it just triggers multiple callbacks
+ * in a row. With tevent_req_defer_callback() it is possible
+ * to set an event context that will be used to defer the callback
+ * via an immediate event (similar to tevent_req_post()).
+ *
+ * @code
+ * struct complete_state {
+ * struct tevent_context *ev;
+ *
+ * struct tevent_req **reqs;
+ * };
+ *
+ * void complete(struct complete_state *state)
+ * {
+ * size_t i, c = talloc_array_length(state->reqs);
+ *
+ * for (i=0; i < c; i++) {
+ * tevent_req_defer_callback(state->reqs[i], state->ev);
+ * tevent_req_done(state->reqs[i]);
+ * }
+ * }
+ * @endcode
+ *
+ * @param[in] req The finished request.
+ *
+ * @param[in] ev The tevent_context for the immediate event.
+ *
+ * @return The given request will be returned.
+ */
+void tevent_req_defer_callback(struct tevent_req *req,
+ struct tevent_context *ev);
+
+/**
* @brief Check if the given request is still in progress.
*
* It is typically used by sync wrapper functions.
*
- * This function destroys the attached private data.
- *
* @param[in] req The request to poll.
*
* @return The boolean form of "is in progress".
@@ -967,7 +1131,21 @@ bool tevent_req_poll(struct tevent_req *req,
struct tevent_context *ev);
/**
- * @brief Get the tevent request and the actual error code you've set.
+ * @brief Get the tevent request state and the actual error set by
+ * tevent_req_error.
+ *
+ * @code
+ * int computation_recv(struct tevent_req *req, uint64_t *perr)
+ * {
+ * enum tevent_req_state state;
+ * uint64_t err;
+ * if (tevent_req_is_error(req, &state, &err)) {
+ * *perr = err;
+ * return -1;
+ * }
+ * return 0;
+ * }
+ * @endcode
*
* @param[in] req The tevent request to get the error from.
*
@@ -1008,7 +1186,7 @@ void tevent_req_received(struct tevent_req *req);
*
* Example:
* @code
- * static my_callback_wakeup_done(tevent_req *req)
+ * static void my_callback_wakeup_done(tevent_req *subreq)
* {
* struct tevent_req *req = tevent_req_callback_data(subreq,
* struct tevent_req);
@@ -1096,7 +1274,7 @@ struct timeval tevent_timeval_current(void);
*
* @param[in] secs The seconds to set.
*
- * @param[in] usecs The milliseconds to set.
+ * @param[in] usecs The microseconds to set.
*
* @return A timeval structure with the given values.
*/
@@ -1131,7 +1309,7 @@ bool tevent_timeval_is_zero(const struct timeval *tv);
*
* @param[in] secs The seconds to add to the timeval.
*
- * @param[in] usecs The milliseconds to add to the timeval.
+ * @param[in] usecs The microseconds to add to the timeval.
*
* @return The timeval structure with the new time.
*/
@@ -1143,7 +1321,7 @@ struct timeval tevent_timeval_add(const struct timeval *tv, uint32_t secs,
*
* @param[in] secs The seconds of the offset from now.
*
- * @param[in] usecs The milliseconds of the offset from now.
+ * @param[in] usecs The microseconds of the offset from now.
*
* @return A timval with the given offset in the future.
*/
@@ -1169,6 +1347,7 @@ struct timeval tevent_timeval_current_ofs(uint32_t secs, uint32_t usecs);
*/
struct tevent_queue;
+struct tevent_queue_entry;
#ifdef DOXYGEN
/**
@@ -1180,8 +1359,8 @@ struct tevent_queue;
*
* @return An allocated tevent queue on success, NULL on error.
*
- * @see tevent_start()
- * @see tevent_stop()
+ * @see tevent_queue_start()
+ * @see tevent_queue_stop()
*/
struct tevent_queue *tevent_queue_create(TALLOC_CTX *mem_ctx,
const char *name);
@@ -1203,6 +1382,8 @@ struct tevent_queue *_tevent_queue_create(TALLOC_CTX *mem_ctx,
* tevent_queue_add().
*
* @see tevent_queue_add()
+ * @see tevent_queue_add_entry()
+ * @see tevent_queue_add_optimize_empty()
*/
typedef void (*tevent_queue_trigger_fn_t)(struct tevent_req *req,
void *private_data);
@@ -1217,7 +1398,9 @@ typedef void (*tevent_queue_trigger_fn_t)(struct tevent_req *req,
* @param[in] req The tevent request to add to the queue.
*
* @param[in] trigger The function triggered by the queue when the request
- * is called.
+ * is called. Since tevent 0.9.14 it's possible to
+ * pass NULL, in order to just add a "blocker" to the
+ * queue.
*
* @param[in] private_data The private data passed to the trigger function.
*
@@ -1231,6 +1414,79 @@ bool tevent_queue_add(struct tevent_queue *queue,
void *private_data);
/**
+ * @brief Add a tevent request to the queue.
+ *
+ * The request can be removed from the queue by calling talloc_free()
+ * (or a similar function) on the returned queue entry. This
+ * is the only difference to tevent_queue_add().
+ *
+ * @param[in] queue The queue to add the request.
+ *
+ * @param[in] ev The event handle to use for the request.
+ *
+ * @param[in] req The tevent request to add to the queue.
+ *
+ * @param[in] trigger The function triggered by the queue when the request
+ * is called. Since tevent 0.9.14 it's possible to
+ * pass NULL, in order to just add a "blocker" to the
+ * queue.
+ *
+ * @param[in] private_data The private data passed to the trigger function.
+ *
+ * @return a pointer to the tevent_queue_entry if the request
+ * has been successfully added, NULL otherwise.
+ *
+ * @see tevent_queue_add()
+ * @see tevent_queue_add_optimize_empty()
+ */
+struct tevent_queue_entry *tevent_queue_add_entry(
+ struct tevent_queue *queue,
+ struct tevent_context *ev,
+ struct tevent_req *req,
+ tevent_queue_trigger_fn_t trigger,
+ void *private_data);
+
+/**
+ * @brief Add a tevent request to the queue using a possible optimization.
+ *
+ * This tries to optimize for the empty queue case and may calls
+ * the trigger function directly. This is the only difference compared
+ * to tevent_queue_add_entry().
+ *
+ * The caller needs to be prepared that the trigger function has
+ * already called tevent_req_notify_callback(), tevent_req_error(),
+ * tevent_req_done() or a similar function.
+ *
+ * The request can be removed from the queue by calling talloc_free()
+ * (or a similar function) on the returned queue entry.
+ *
+ * @param[in] queue The queue to add the request.
+ *
+ * @param[in] ev The event handle to use for the request.
+ *
+ * @param[in] req The tevent request to add to the queue.
+ *
+ * @param[in] trigger The function triggered by the queue when the request
+ * is called. Since tevent 0.9.14 it's possible to
+ * pass NULL, in order to just add a "blocker" to the
+ * queue.
+ *
+ * @param[in] private_data The private data passed to the trigger function.
+ *
+ * @return a pointer to the tevent_queue_entry if the request
+ * has been successfully added, NULL otherwise.
+ *
+ * @see tevent_queue_add()
+ * @see tevent_queue_add_entry()
+ */
+struct tevent_queue_entry *tevent_queue_add_optimize_empty(
+ struct tevent_queue *queue,
+ struct tevent_context *ev,
+ struct tevent_req *req,
+ tevent_queue_trigger_fn_t trigger,
+ void *private_data);
+
+/**
* @brief Start a tevent queue.
*
* The queue is started by default.
@@ -1257,6 +1513,17 @@ void tevent_queue_stop(struct tevent_queue *queue);
*/
size_t tevent_queue_length(struct tevent_queue *queue);
+/**
+ * @brief Is the tevent queue running.
+ *
+ * The queue is started by default.
+ *
+ * @param[in] queue The queue.
+ *
+ * @return Wether the queue is running or not..
+ */
+bool tevent_queue_running(struct tevent_queue *queue);
+
typedef int (*tevent_nesting_hook)(struct tevent_context *ev,
void *private_data,
uint32_t level,
@@ -1264,7 +1531,6 @@ typedef int (*tevent_nesting_hook)(struct tevent_context *ev,
void *stack_ptr,
const char *location);
#ifdef TEVENT_DEPRECATED
-#if (TEVENT_DEPRECATED_QUIET != 1)
#ifndef _DEPRECATED_
#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
#define _DEPRECATED_ __attribute__ ((deprecated))
@@ -1272,10 +1538,6 @@ typedef int (*tevent_nesting_hook)(struct tevent_context *ev,
#define _DEPRECATED_
#endif
#endif
-#else
-#undef _DEPRECATED_
-#define _DEPRECATED_
-#endif
void tevent_loop_allow_nesting(struct tevent_context *ev) _DEPRECATED_;
void tevent_loop_set_nesting_hook(struct tevent_context *ev,
tevent_nesting_hook hook,
@@ -1367,8 +1629,6 @@ bool tevent_register_backend(const char *name, const struct tevent_ops *ops);
* @{
*/
-/* Saves ctdb from massive churn. */
-#define TEVENT_COMPAT_DEFINES 1
#ifdef TEVENT_COMPAT_DEFINES
#define event_context tevent_context
diff --git a/ctdb/lib/tevent/tevent.mk b/ctdb/lib/tevent/tevent.mk
deleted file mode 100644
index 57bfd81222..0000000000
--- a/ctdb/lib/tevent/tevent.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-TEVENT_SOBASE = libtevent.$(SHLIBEXT)
-TEVENT_SONAME = $(TEVENT_SOBASE).0
-TEVENT_SOLIB = $(TEVENT_SOBASE).$(PACKAGE_VERSION)
-TEVENT_STLIB = libtevent.a
-
-$(TEVENT_STLIB): $(TEVENT_OBJ)
- ar -rv $(TEVENT_STLIB) $(TEVENT_OBJ)
-
-$(TEVENT_SOBASE): $(TEVENT_SOLIB)
- ln -fs $< $@
-
-$(TEVENT_SONAME): $(TEVENT_SOLIB)
- ln -fs $< $@
-
-dirs::
- @mkdir -p lib
-
-installdirs::
- mkdir -p $(DESTDIR)$(includedir)
- mkdir -p $(DESTDIR)$(libdir)
- mkdir -p $(DESTDIR)$(libdir)/pkgconfig
-
-installheaders:: installdirs
- cp $(srcdir)/tevent.h $(DESTDIR)$(includedir)
-
-installlibs:: installdirs
- cp tevent.pc $(DESTDIR)$(libdir)/pkgconfig
- cp $(TEVENT_STLIB) $(TEVENT_SOLIB) $(DESTDIR)$(libdir)
- rm -f $(DESTDIR)$(libdir)/$(TEVENT_SONAME)
- ln -s $(TEVENT_SOLIB) $(DESTDIR)$(libdir)/$(TEVENT_SONAME)
- rm -f $(DESTDIR)$(libdir)/$(TEVENT_SOBASE)
- ln -s $(TEVENT_SOLIB) $(DESTDIR)$(libdir)/$(TEVENT_SOBASE)
-
-install:: all installdirs installheaders installlibs $(PYTHON_INSTALL_TARGET)
-
-abi_checks::
- @echo ABI checks:
- @./script/abi_checks.sh tevent tevent.h
-
-test:: abi_checks
-
-clean::
- rm -f $(TEVENT_SOBASE) $(TEVENT_SONAME) $(TEVENT_SOLIB) $(TEVENT_STLIB)
- rm -f tevent.pc
- rm -f tevent.exports.sort tevent.exports.check tevent.exports.check.sort
- rm -f tevent.signatures.sort tevent.signatures.check tevent.signatures.check.sort
diff --git a/ctdb/lib/tevent/tevent.signatures b/ctdb/lib/tevent/tevent.signatures
deleted file mode 100644
index c752b9e933..0000000000
--- a/ctdb/lib/tevent/tevent.signatures
+++ /dev/null
@@ -1,57 +0,0 @@
-_Bool tevent_queue_add (struct tevent_queue *, struct tevent_context *, struct tevent_req *, tevent_queue_trigger_fn_t, void *);
-_Bool tevent_register_backend (const char *, const struct tevent_ops *);
-_Bool _tevent_req_error (struct tevent_req *, uint64_t, const char *);
-_Bool tevent_req_is_error (struct tevent_req *, enum tevent_req_state *, uint64_t *);
-_Bool tevent_req_is_in_progress (struct tevent_req *);
-_Bool _tevent_req_nomem (const void *, struct tevent_req *, const char *);
-_Bool tevent_req_poll (struct tevent_req *, struct tevent_context *);
-_Bool tevent_req_set_endtime (struct tevent_req *, struct tevent_context *, struct timeval);
-_Bool tevent_signal_support (struct tevent_context *);
-_Bool tevent_timeval_is_zero (const struct timeval *);
-_Bool tevent_wakeup_recv (struct tevent_req *);
-char *tevent_req_default_print (struct tevent_req *, TALLOC_CTX *);
-char *tevent_req_print (TALLOC_CTX *, struct tevent_req *);
-const char **tevent_backend_list (TALLOC_CTX *);
-int _tevent_loop_once (struct tevent_context *, const char *);
-int _tevent_loop_until (struct tevent_context *, _Bool (*) (void *), void *, const char *);
-int _tevent_loop_wait (struct tevent_context *, const char *);
-int tevent_set_debug_stderr (struct tevent_context *);
-int tevent_set_debug (struct tevent_context *, void (*) (void *, enum tevent_debug_level, const char *, va_list), void *);
-int tevent_timeval_compare (const struct timeval *, const struct timeval *);
-size_t tevent_queue_length (struct tevent_queue *);
-struct tevent_context *tevent_context_init_byname (TALLOC_CTX *, const char *);
-struct tevent_context *tevent_context_init (TALLOC_CTX *);
-struct tevent_fd *_tevent_add_fd (struct tevent_context *, TALLOC_CTX *, int, uint16_t, tevent_fd_handler_t, void *, const char *, const char *);
-struct tevent_immediate *_tevent_create_immediate (TALLOC_CTX *, const char *);
-struct tevent_queue *_tevent_queue_create (TALLOC_CTX *, const char *, const char *);
-struct tevent_req *_tevent_req_create (TALLOC_CTX *, void *, size_t, const char *, const char *);
-struct tevent_req *tevent_req_post (struct tevent_req *, struct tevent_context *);
-struct tevent_req *tevent_wakeup_send (TALLOC_CTX *, struct tevent_context *, struct timeval);
-struct tevent_signal *_tevent_add_signal (struct tevent_context *, TALLOC_CTX *, int, int, tevent_signal_handler_t, void *, const char *, const char *);
-struct tevent_timer *_tevent_add_timer (struct tevent_context *, TALLOC_CTX *, struct timeval, tevent_timer_handler_t, void *, const char *, const char *);
-struct timeval tevent_timeval_add (const struct timeval *, uint32_t, uint32_t);
-struct timeval tevent_timeval_current_ofs (uint32_t, uint32_t);
-struct timeval tevent_timeval_current (void);
-struct timeval tevent_timeval_set (uint32_t, uint32_t);
-struct timeval tevent_timeval_until (const struct timeval *, const struct timeval *);
-struct timeval tevent_timeval_zero (void);
-uint16_t tevent_fd_get_flags (struct tevent_fd *);
-void tevent_fd_set_auto_close (struct tevent_fd *);
-void tevent_fd_set_close_fn (struct tevent_fd *, tevent_fd_close_fn_t);
-void tevent_fd_set_flags (struct tevent_fd *, uint16_t);
-void tevent_loop_allow_nesting (struct tevent_context *);
-void tevent_loop_set_nesting_hook (struct tevent_context *, tevent_nesting_hook, void *);
-void tevent_queue_start (struct tevent_queue *);
-void tevent_queue_stop (struct tevent_queue *);
-void *_tevent_req_callback_data (struct tevent_req *);
-void *_tevent_req_data (struct tevent_req *);
-void _tevent_req_done (struct tevent_req *, const char *);
-void _tevent_req_notify_callback (struct tevent_req *, const char *);
-void tevent_req_received (struct tevent_req *);
-void tevent_req_set_callback (struct tevent_req *, tevent_req_fn, void *);
-void tevent_req_set_print_fn (struct tevent_req *, tevent_req_print_fn);
-void _tevent_schedule_immediate (struct tevent_immediate *, struct tevent_context *, tevent_immediate_handler_t, void *, const char *, const char *);
-void tevent_set_abort_fn (void (*) (const char *));
-void tevent_set_default_backend (const char *);
-_Bool _tevent_req_cancel (struct tevent_req *, const char *);
-void tevent_req_set_cancel_fn (struct tevent_req *, tevent_req_cancel_fn);
diff --git a/ctdb/lib/tevent/tevent_epoll.c b/ctdb/lib/tevent/tevent_epoll.c
index 1c3396eb6b..f5a69ddc50 100644
--- a/ctdb/lib/tevent/tevent_epoll.c
+++ b/ctdb/lib/tevent/tevent_epoll.c
@@ -42,8 +42,7 @@ struct epoll_event_context {
};
/*
- called when a epoll call fails, and we should fallback
- to using select
+ called when a epoll call fails
*/
static void epoll_panic(struct epoll_event_context *epoll_ev, const char *reason)
{
@@ -79,11 +78,20 @@ static int epoll_ctx_destructor(struct epoll_event_context *epoll_ev)
static int epoll_init_ctx(struct epoll_event_context *epoll_ev)
{
epoll_ev->epoll_fd = epoll_create(64);
- epoll_ev->pid = getpid();
- talloc_set_destructor(epoll_ev, epoll_ctx_destructor);
if (epoll_ev->epoll_fd == -1) {
+ tevent_debug(epoll_ev->ev, TEVENT_DEBUG_FATAL,
+ "Failed to create epoll handle.\n");
return -1;
}
+
+ if (!ev_set_close_on_exec(epoll_ev->epoll_fd)) {
+ tevent_debug(epoll_ev->ev, TEVENT_DEBUG_WARNING,
+ "Failed to set close-on-exec, file descriptor may be leaked to children.\n");
+ }
+
+ epoll_ev->pid = getpid();
+ talloc_set_destructor(epoll_ev, epoll_ctx_destructor);
+
return 0;
}
@@ -109,6 +117,12 @@ static void epoll_check_reopen(struct epoll_event_context *epoll_ev)
"Failed to recreate epoll handle after fork\n");
return;
}
+
+ if (!ev_set_close_on_exec(epoll_ev->epoll_fd)) {
+ tevent_debug(epoll_ev->ev, TEVENT_DEBUG_WARNING,
+ "Failed to set close-on-exec, file descriptor may be leaked to children.\n");
+ }
+
epoll_ev->pid = getpid();
for (fde=epoll_ev->ev->fd_events;fde;fde=fde->next) {
epoll_add_event(epoll_ev, fde);
@@ -228,8 +242,6 @@ static void epoll_change_event(struct epoll_event_context *epoll_ev, struct teve
}
}
-extern pid_t ctdbd_pid;
-
/*
event loop handling using epoll
*/
@@ -252,9 +264,7 @@ static int epoll_event_loop(struct epoll_event_context *epoll_ev, struct timeval
return 0;
}
- if (getpid() == ctdbd_pid) tevent_before_wait(epoll_ev->ev);
ret = epoll_wait(epoll_ev->epoll_fd, events, MAXEVENTS, timeout);
- if (getpid() == ctdbd_pid) tevent_after_wait(epoll_ev->ev);
if (ret == -1 && errno == EINTR && epoll_ev->ev->signal_events) {
if (tevent_common_check_signal(epoll_ev->ev)) {
diff --git a/ctdb/lib/tevent/tevent_fd.c b/ctdb/lib/tevent/tevent_fd.c
index c58e8e1ab1..455961b67c 100644
--- a/ctdb/lib/tevent/tevent_fd.c
+++ b/ctdb/lib/tevent/tevent_fd.c
@@ -51,6 +51,12 @@ struct tevent_fd *tevent_common_add_fd(struct tevent_context *ev, TALLOC_CTX *me
{
struct tevent_fd *fde;
+ /* tevent will crash later on select() if we save
+ * a negative file descriptor. Better to fail here
+ * so that consumers will be able to debug it
+ */
+ if (fd < 0) return NULL;
+
fde = talloc(mem_ctx?mem_ctx:ev, struct tevent_fd);
if (!fde) return NULL;
diff --git a/ctdb/lib/tevent/tevent_internal.h b/ctdb/lib/tevent/tevent_internal.h
index ba03bc50bc..7f1d8766ca 100644
--- a/ctdb/lib/tevent/tevent_internal.h
+++ b/ctdb/lib/tevent/tevent_internal.h
@@ -142,6 +142,12 @@ struct tevent_req {
struct tevent_immediate *trigger;
/**
+ * @brief An event context which will be used to
+ * defer the _tevent_req_notify_callback().
+ */
+ struct tevent_context *defer_callback_ev;
+
+ /**
* @brief the timer event if tevent_req_set_endtime was used
*
*/
@@ -162,7 +168,7 @@ struct tevent_fd {
const char *handler_name;
const char *location;
/* this is private for the events_ops implementation */
- uint16_t additional_flags;
+ uint64_t additional_flags;
void *additional_data;
};
@@ -303,6 +309,7 @@ void tevent_cleanup_pending_signal_handlers(struct tevent_signal *se);
bool tevent_standard_init(void);
bool tevent_select_init(void);
+bool tevent_poll_init(void);
#ifdef HAVE_EPOLL
bool tevent_epoll_init(void);
#endif
diff --git a/ctdb/lib/tevent/tevent_poll.c b/ctdb/lib/tevent/tevent_poll.c
new file mode 100644
index 0000000000..d2e45c88be
--- /dev/null
+++ b/ctdb/lib/tevent/tevent_poll.c
@@ -0,0 +1,312 @@
+/*
+ Unix SMB/CIFS implementation.
+ main select loop and event handling
+ Copyright (C) Andrew Tridgell 2003-2005
+ Copyright (C) Stefan Metzmacher 2005-2009
+
+ ** NOTE! The following LGPL license applies to the tevent
+ ** library. This does NOT imply that all of Samba is released
+ ** under the LGPL
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 3 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "replace.h"
+#include "system/filesys.h"
+#include "system/select.h"
+#include "tevent.h"
+#include "tevent_util.h"
+#include "tevent_internal.h"
+
+struct poll_event_context {
+ /*
+ * These two arrays are maintained together.
+ */
+ struct pollfd *fds;
+ struct tevent_fd **fd_events;
+ uint64_t num_fds;
+
+ /* information for exiting from the event loop */
+ int exit_code;
+};
+
+/*
+ create a select_event_context structure.
+*/
+static int poll_event_context_init(struct tevent_context *ev)
+{
+ struct poll_event_context *poll_ev;
+
+ poll_ev = talloc_zero(ev, struct poll_event_context);
+ if (poll_ev == NULL) {
+ return -1;
+ }
+ ev->additional_data = poll_ev;
+ return 0;
+}
+
+/*
+ destroy an fd_event
+*/
+static int poll_event_fd_destructor(struct tevent_fd *fde)
+{
+ struct tevent_context *ev = fde->event_ctx;
+ struct poll_event_context *poll_ev = NULL;
+ struct tevent_fd *moved_fde;
+ uint64_t del_idx = fde->additional_flags;
+
+ if (ev == NULL) {
+ goto done;
+ }
+
+ poll_ev = talloc_get_type_abort(
+ ev->additional_data, struct poll_event_context);
+
+ moved_fde = poll_ev->fd_events[poll_ev->num_fds-1];
+ poll_ev->fd_events[del_idx] = moved_fde;
+ poll_ev->fds[del_idx] = poll_ev->fds[poll_ev->num_fds-1];
+ moved_fde->additional_flags = del_idx;
+
+ poll_ev->num_fds -= 1;
+done:
+ return tevent_common_fd_destructor(fde);
+}
+
+/*
+ add a fd based event
+ return NULL on failure (memory allocation error)
+*/
+static struct tevent_fd *poll_event_add_fd(struct tevent_context *ev,
+ TALLOC_CTX *mem_ctx,
+ int fd, uint16_t flags,
+ tevent_fd_handler_t handler,
+ void *private_data,
+ const char *handler_name,
+ const char *location)
+{
+ struct poll_event_context *poll_ev = talloc_get_type_abort(
+ ev->additional_data, struct poll_event_context);
+ struct pollfd *pfd;
+ struct tevent_fd *fde;
+
+ fde = tevent_common_add_fd(ev, mem_ctx, fd, flags,
+ handler, private_data,
+ handler_name, location);
+ if (fde == NULL) {
+ return NULL;
+ }
+
+ /* we allocate 16 slots to avoid a lot of reallocations */
+ if (talloc_array_length(poll_ev->fds) == poll_ev->num_fds) {
+ struct pollfd *tmp_fds;
+ struct tevent_fd **tmp_fd_events;
+ tmp_fds = talloc_realloc(
+ poll_ev, poll_ev->fds, struct pollfd,
+ poll_ev->num_fds + 16);
+ if (tmp_fds == NULL) {
+ TALLOC_FREE(fde);
+ return NULL;
+ }
+ poll_ev->fds = tmp_fds;
+
+ tmp_fd_events = talloc_realloc(
+ poll_ev, poll_ev->fd_events, struct tevent_fd *,
+ poll_ev->num_fds + 16);
+ if (tmp_fd_events == NULL) {
+ TALLOC_FREE(fde);
+ return NULL;
+ }
+ poll_ev->fd_events = tmp_fd_events;
+ }
+
+ pfd = &poll_ev->fds[poll_ev->num_fds];
+
+ pfd->fd = fd;
+
+ pfd->events = 0;
+ pfd->revents = 0;
+
+ if (flags & TEVENT_FD_READ) {
+ pfd->events |= (POLLIN|POLLHUP);
+ }
+ if (flags & TEVENT_FD_WRITE) {
+ pfd->events |= (POLLOUT);
+ }
+
+ fde->additional_flags = poll_ev->num_fds;
+ poll_ev->fd_events[poll_ev->num_fds] = fde;
+
+ poll_ev->num_fds += 1;
+
+ talloc_set_destructor(fde, poll_event_fd_destructor);
+
+ return fde;
+}
+
+/*
+ set the fd event flags
+*/
+static void poll_event_set_fd_flags(struct tevent_fd *fde, uint16_t flags)
+{
+ struct poll_event_context *poll_ev = talloc_get_type_abort(
+ fde->event_ctx->additional_data, struct poll_event_context);
+ uint64_t idx = fde->additional_flags;
+ uint16_t pollflags = 0;
+
+ if (flags & TEVENT_FD_READ) {
+ pollflags |= (POLLIN|POLLHUP);
+ }
+ if (flags & TEVENT_FD_WRITE) {
+ pollflags |= (POLLOUT);
+ }
+
+ poll_ev->fds[idx].events = pollflags;
+
+ fde->flags = flags;
+}
+
+/*
+ event loop handling using poll()
+*/
+static int poll_event_loop_poll(struct tevent_context *ev,
+ struct timeval *tvalp)
+{
+ struct poll_event_context *poll_ev = talloc_get_type_abort(
+ ev->additional_data, struct poll_event_context);
+ struct tevent_fd *fde;
+ int pollrtn;
+ int timeout = -1;
+
+ if (ev->signal_events && tevent_common_check_signal(ev)) {
+ return 0;
+ }
+
+ if (tvalp != NULL) {
+ timeout = tvalp->tv_sec * 1000;
+ timeout += (tvalp->tv_usec + 999) / 1000;
+ }
+
+ pollrtn = poll(poll_ev->fds, poll_ev->num_fds, timeout);
+
+ if (pollrtn == -1 && errno == EINTR && ev->signal_events) {
+ tevent_common_check_signal(ev);
+ return 0;
+ }
+
+ if (pollrtn == -1 && errno == EBADF) {
+ /* the socket is dead! this should never
+ happen as the socket should have first been
+ made readable and that should have removed
+ the event, so this must be a bug. This is a
+ fatal error. */
+ tevent_debug(ev, TEVENT_DEBUG_FATAL,
+ "ERROR: EBADF on poll_event_loop_once\n");
+ poll_ev->exit_code = EBADF;
+ return -1;
+ }
+
+ if (pollrtn == 0 && tvalp) {
+ /* we don't care about a possible delay here */
+ tevent_common_loop_timer_delay(ev);
+ return 0;
+ }
+
+ if (pollrtn <= 0) {
+ /*
+ * No fd's ready
+ */
+ return 0;
+ }
+
+ /* at least one file descriptor is ready - check
+ which ones and call the handler, being careful to allow
+ the handler to remove itself when called */
+
+ for (fde = ev->fd_events; fde; fde = fde->next) {
+ struct pollfd *pfd;
+ uint64_t pfd_idx = fde->additional_flags;
+ uint16_t flags = 0;
+
+ pfd = &poll_ev->fds[pfd_idx];
+
+ if (pfd->revents & (POLLHUP|POLLERR)) {
+ /* If we only wait for TEVENT_FD_WRITE, we
+ should not tell the event handler about it,
+ and remove the writable flag, as we only
+ report errors when waiting for read events
+ to match the select behavior. */
+ if (!(fde->flags & TEVENT_FD_READ)) {
+ TEVENT_FD_NOT_WRITEABLE(fde);
+ continue;
+ }
+ flags |= TEVENT_FD_READ;
+ }
+ if (pfd->revents & POLLIN) {
+ flags |= TEVENT_FD_READ;
+ }
+ if (pfd->revents & POLLOUT) {
+ flags |= TEVENT_FD_WRITE;
+ }
+ if (flags != 0) {
+ fde->handler(ev, fde, flags, fde->private_data);
+ break;
+ }
+ }
+
+ return 0;
+}
+
+/*
+ do a single event loop using the events defined in ev
+*/
+static int poll_event_loop_once(struct tevent_context *ev,
+ const char *location)
+{
+ struct timeval tval;
+
+ if (ev->signal_events &&
+ tevent_common_check_signal(ev)) {
+ return 0;
+ }
+
+ if (ev->immediate_events &&
+ tevent_common_loop_immediate(ev)) {
+ return 0;
+ }
+
+ tval = tevent_common_loop_timer_delay(ev);
+ if (tevent_timeval_is_zero(&tval)) {
+ return 0;
+ }
+
+ return poll_event_loop_poll(ev, &tval);
+}
+
+static const struct tevent_ops poll_event_ops = {
+ .context_init = poll_event_context_init,
+ .add_fd = poll_event_add_fd,
+ .set_fd_close_fn = tevent_common_fd_set_close_fn,
+ .get_fd_flags = tevent_common_fd_get_flags,
+ .set_fd_flags = poll_event_set_fd_flags,
+ .add_timer = tevent_common_add_timer,
+ .schedule_immediate = tevent_common_schedule_immediate,
+ .add_signal = tevent_common_add_signal,
+ .loop_once = poll_event_loop_once,
+ .loop_wait = tevent_common_loop_wait,
+};
+
+_PRIVATE_ bool tevent_poll_init(void)
+{
+ return tevent_register_backend("poll", &poll_event_ops);
+}
diff --git a/ctdb/lib/tevent/tevent_queue.c b/ctdb/lib/tevent/tevent_queue.c
index 3715c35e4f..4750675802 100644
--- a/ctdb/lib/tevent/tevent_queue.c
+++ b/ctdb/lib/tevent/tevent_queue.c
@@ -144,17 +144,19 @@ static void tevent_queue_immediate_trigger(struct tevent_context *ev,
q->list->trigger(q->list->req, q->list->private_data);
}
-bool tevent_queue_add(struct tevent_queue *queue,
- struct tevent_context *ev,
- struct tevent_req *req,
- tevent_queue_trigger_fn_t trigger,
- void *private_data)
+static struct tevent_queue_entry *tevent_queue_add_internal(
+ struct tevent_queue *queue,
+ struct tevent_context *ev,
+ struct tevent_req *req,
+ tevent_queue_trigger_fn_t trigger,
+ void *private_data,
+ bool allow_direct)
{
struct tevent_queue_entry *e;
e = talloc_zero(req, struct tevent_queue_entry);
if (e == NULL) {
- return false;
+ return NULL;
}
e->queue = queue;
@@ -163,16 +165,53 @@ bool tevent_queue_add(struct tevent_queue *queue,
e->trigger = trigger;
e->private_data = private_data;
+ /*
+ * if there is no trigger, it is just a blocker
+ */
+ if (trigger == NULL) {
+ e->triggered = true;
+ }
+
+ if (queue->length > 0) {
+ /*
+ * if there are already entries in the
+ * queue do not optimize.
+ */
+ allow_direct = false;
+ }
+
+ if (req->async.fn != NULL) {
+ /*
+ * If the callers wants to optimize for the
+ * empty queue case, call the trigger only
+ * if there is no callback defined for the
+ * request yet.
+ */
+ allow_direct = false;
+ }
+
DLIST_ADD_END(queue->list, e, struct tevent_queue_entry *);
queue->length++;
talloc_set_destructor(e, tevent_queue_entry_destructor);
if (!queue->running) {
- return true;
+ return e;
}
if (queue->list->triggered) {
- return true;
+ return e;
+ }
+
+ /*
+ * If allowed we directly call the trigger
+ * avoiding possible delays caused by
+ * an immediate event.
+ */
+ if (allow_direct) {
+ queue->list->triggered = true;
+ queue->list->trigger(queue->list->req,
+ queue->list->private_data);
+ return e;
}
tevent_schedule_immediate(queue->immediate,
@@ -180,9 +219,48 @@ bool tevent_queue_add(struct tevent_queue *queue,
tevent_queue_immediate_trigger,
queue);
+ return e;
+}
+
+bool tevent_queue_add(struct tevent_queue *queue,
+ struct tevent_context *ev,
+ struct tevent_req *req,
+ tevent_queue_trigger_fn_t trigger,
+ void *private_data)
+{
+ struct tevent_queue_entry *e;
+
+ e = tevent_queue_add_internal(queue, ev, req,
+ trigger, private_data, false);
+ if (e == NULL) {
+ return false;
+ }
+
return true;
}
+struct tevent_queue_entry *tevent_queue_add_entry(
+ struct tevent_queue *queue,
+ struct tevent_context *ev,
+ struct tevent_req *req,
+ tevent_queue_trigger_fn_t trigger,
+ void *private_data)
+{
+ return tevent_queue_add_internal(queue, ev, req,
+ trigger, private_data, false);
+}
+
+struct tevent_queue_entry *tevent_queue_add_optimize_empty(
+ struct tevent_queue *queue,
+ struct tevent_context *ev,
+ struct tevent_req *req,
+ tevent_queue_trigger_fn_t trigger,
+ void *private_data)
+{
+ return tevent_queue_add_internal(queue, ev, req,
+ trigger, private_data, true);
+}
+
void tevent_queue_start(struct tevent_queue *queue)
{
if (queue->running) {
@@ -215,3 +293,8 @@ size_t tevent_queue_length(struct tevent_queue *queue)
{
return queue->length;
}
+
+bool tevent_queue_running(struct tevent_queue *queue)
+{
+ return queue->running;
+}
diff --git a/ctdb/lib/tevent/tevent_req.c b/ctdb/lib/tevent/tevent_req.c
index b0c9c57dde..d8d0c5f564 100644
--- a/ctdb/lib/tevent/tevent_req.c
+++ b/ctdb/lib/tevent/tevent_req.c
@@ -74,6 +74,7 @@ struct tevent_req *_tevent_req_create(TALLOC_CTX *mem_ctx,
talloc_free(req);
return NULL;
}
+ req->internal.defer_callback_ev = NULL;
data = talloc_zero_size(req, data_size);
if (data == NULL) {
@@ -91,6 +92,11 @@ struct tevent_req *_tevent_req_create(TALLOC_CTX *mem_ctx,
void _tevent_req_notify_callback(struct tevent_req *req, const char *location)
{
req->internal.finish_location = location;
+ if (req->internal.defer_callback_ev) {
+ (void)tevent_req_post(req, req->internal.defer_callback_ev);
+ req->internal.defer_callback_ev = NULL;
+ return;
+ }
if (req->async.fn != NULL) {
req->async.fn(req);
}
@@ -123,6 +129,11 @@ bool _tevent_req_error(struct tevent_req *req,
return true;
}
+void _tevent_req_oom(struct tevent_req *req, const char *location)
+{
+ tevent_req_finish(req, TEVENT_REQ_NO_MEMORY, location);
+}
+
bool _tevent_req_nomem(const void *p,
struct tevent_req *req,
const char *location)
@@ -130,7 +141,7 @@ bool _tevent_req_nomem(const void *p,
if (p != NULL) {
return false;
}
- tevent_req_finish(req, TEVENT_REQ_NO_MEMORY, location);
+ _tevent_req_oom(req, location);
return true;
}
@@ -164,6 +175,12 @@ struct tevent_req *tevent_req_post(struct tevent_req *req,
return req;
}
+void tevent_req_defer_callback(struct tevent_req *req,
+ struct tevent_context *ev)
+{
+ req->internal.defer_callback_ev = ev;
+}
+
bool tevent_req_is_in_progress(struct tevent_req *req)
{
if (req->internal.state == TEVENT_REQ_IN_PROGRESS) {
diff --git a/ctdb/lib/tevent/tevent_select.c b/ctdb/lib/tevent/tevent_select.c
index 1671198a20..51c1dec4a6 100644
--- a/ctdb/lib/tevent/tevent_select.c
+++ b/ctdb/lib/tevent/tevent_select.c
@@ -111,6 +111,11 @@ static struct tevent_fd *select_event_add_fd(struct tevent_context *ev, TALLOC_C
struct select_event_context);
struct tevent_fd *fde;
+ if (fd < 0 || fd >= FD_SETSIZE) {
+ errno = EBADF;
+ return NULL;
+ }
+
fde = tevent_common_add_fd(ev, mem_ctx, fd, flags,
handler, private_data,
handler_name, location);
@@ -125,8 +130,6 @@ static struct tevent_fd *select_event_add_fd(struct tevent_context *ev, TALLOC_C
return fde;
}
-extern pid_t ctdbd_pid;
-
/*
event loop handling using select()
*/
@@ -146,6 +149,11 @@ static int select_event_loop_select(struct select_event_context *select_ev, stru
/* setup any fd events */
for (fde = select_ev->ev->fd_events; fde; fde = fde->next) {
+ if (fde->fd < 0 || fde->fd >= FD_SETSIZE) {
+ errno = EBADF;
+ return -1;
+ }
+
if (fde->flags & TEVENT_FD_READ) {
FD_SET(fde->fd, &r_fds);
}
@@ -159,9 +167,7 @@ static int select_event_loop_select(struct select_event_context *select_ev, stru
return 0;
}
- if (getpid() == ctdbd_pid) tevent_before_wait(select_ev->ev);
selrtn = select(select_ev->maxfd+1, &r_fds, &w_fds, NULL, tvalp);
- if (getpid() == ctdbd_pid) tevent_after_wait(select_ev->ev);
if (selrtn == -1 && errno == EINTR &&
select_ev->ev->signal_events) {
diff --git a/ctdb/lib/tevent/tevent_signal.c b/ctdb/lib/tevent/tevent_signal.c
index c505419a2d..56bcef9150 100644
--- a/ctdb/lib/tevent/tevent_signal.c
+++ b/ctdb/lib/tevent/tevent_signal.c
@@ -208,7 +208,7 @@ struct tevent_signal *tevent_common_add_signal(struct tevent_context *ev,
/* the sig_state needs to be on a global context as it can last across
multiple event contexts */
if (sig_state == NULL) {
- sig_state = talloc_zero(talloc_autofree_context(), struct tevent_sig_state);
+ sig_state = talloc_zero(NULL, struct tevent_sig_state);
if (sig_state == NULL) {
return NULL;
}
@@ -307,6 +307,15 @@ struct tevent_signal *tevent_common_add_signal(struct tevent_context *ev,
return se;
}
+struct tevent_se_exists {
+ struct tevent_se_exists **myself;
+};
+
+static int tevent_se_exists_destructor(struct tevent_se_exists *s)
+{
+ *s->myself = NULL;
+ return 0;
+}
/*
check if a signal is pending
@@ -335,7 +344,25 @@ int tevent_common_check_signal(struct tevent_context *ev)
}
for (sl=sig_state->sig_handlers[i];sl;sl=next) {
struct tevent_signal *se = sl->se;
+ struct tevent_se_exists *exists;
+
next = sl->next;
+
+ /*
+ * We have to be careful to not touch "se"
+ * after it was deleted in its handler. Thus
+ * we allocate a child whose destructor will
+ * tell by nulling out itself that its parent
+ * is gone.
+ */
+ exists = talloc(se, struct tevent_se_exists);
+ if (exists == NULL) {
+ continue;
+ }
+ exists->myself = &exists;
+ talloc_set_destructor(
+ exists, tevent_se_exists_destructor);
+
#ifdef SA_SIGINFO
if (se->sa_flags & SA_SIGINFO) {
uint32_t j;
@@ -352,17 +379,26 @@ int tevent_common_check_signal(struct tevent_context *ev)
se->handler(ev, se, i, 1,
(void*)&sig_state->sig_info[i][ofs],
se->private_data);
+ if (!exists) {
+ break;
+ }
}
- if (se->sa_flags & SA_RESETHAND) {
+#ifdef SA_RESETHAND
+ if (exists && (se->sa_flags & SA_RESETHAND)) {
talloc_free(se);
}
+#endif
+ talloc_free(exists);
continue;
}
#endif
se->handler(ev, se, i, count, NULL, se->private_data);
- if (se->sa_flags & SA_RESETHAND) {
+#ifdef SA_RESETHAND
+ if (exists && (se->sa_flags & SA_RESETHAND)) {
talloc_free(se);
}
+#endif
+ talloc_free(exists);
}
#ifdef SA_SIGINFO
diff --git a/ctdb/lib/tevent/tevent_standard.c b/ctdb/lib/tevent/tevent_standard.c
index 05d734a627..534576c108 100644
--- a/ctdb/lib/tevent/tevent_standard.c
+++ b/ctdb/lib/tevent/tevent_standard.c
@@ -100,6 +100,17 @@ static int epoll_ctx_destructor(struct std_event_context *std_ev)
static void epoll_init_ctx(struct std_event_context *std_ev)
{
std_ev->epoll_fd = epoll_create(64);
+ if (std_ev->epoll_fd == -1) {
+ tevent_debug(std_ev->ev, TEVENT_DEBUG_FATAL,
+ "Failed to create epoll handle.\n");
+ return;
+ }
+
+ if (!ev_set_close_on_exec(std_ev->epoll_fd)) {
+ tevent_debug(std_ev->ev, TEVENT_DEBUG_WARNING,
+ "Failed to set close-on-exec, file descriptor may be leaked to children.\n");
+ }
+
std_ev->pid = getpid();
talloc_set_destructor(std_ev, epoll_ctx_destructor);
}
@@ -126,6 +137,12 @@ static void epoll_check_reopen(struct std_event_context *std_ev)
"Failed to recreate epoll handle after fork\n");
return;
}
+
+ if (!ev_set_close_on_exec(std_ev->epoll_fd)) {
+ tevent_debug(std_ev->ev, TEVENT_DEBUG_WARNING,
+ "Failed to set close-on-exec, file descriptor may be leaked to children.\n");
+ }
+
std_ev->pid = getpid();
for (fde=std_ev->ev->fd_events;fde;fde=fde->next) {
epoll_add_event(std_ev, fde);
@@ -239,8 +256,6 @@ static void epoll_change_event(struct std_event_context *std_ev, struct tevent_f
}
}
-extern pid_t ctdbd_pid;
-
/*
event loop handling using epoll
*/
@@ -263,9 +278,7 @@ static int epoll_event_loop(struct std_event_context *std_ev, struct timeval *tv
return 0;
}
- if (getpid() == ctdbd_pid) tevent_before_wait(std_ev->ev);
ret = epoll_wait(std_ev->epoll_fd, events, MAXEVENTS, timeout);
- if (getpid() == ctdbd_pid) tevent_after_wait(std_ev->ev);
if (ret == -1 && errno == EINTR && std_ev->ev->signal_events) {
if (tevent_common_check_signal(std_ev->ev)) {
@@ -461,6 +474,10 @@ static int std_event_loop_select(struct std_event_context *std_ev, struct timeva
/* setup any fd events */
for (fde = std_ev->ev->fd_events; fde; fde = fde->next) {
+ if (fde->fd < 0 || fde->fd >= FD_SETSIZE) {
+ std_ev->exit_code = EBADF;
+ return -1;
+ }
if (fde->flags & TEVENT_FD_READ) {
FD_SET(fde->fd, &r_fds);
}
@@ -509,7 +526,7 @@ static int std_event_loop_select(struct std_event_context *std_ev, struct timeva
if (FD_ISSET(fde->fd, &r_fds)) flags |= TEVENT_FD_READ;
if (FD_ISSET(fde->fd, &w_fds)) flags |= TEVENT_FD_WRITE;
- if (flags) {
+ if (flags & fde->flags) {
fde->handler(std_ev->ev, fde, flags, fde->private_data);
break;
}
diff --git a/ctdb/lib/tevent/tevent_timed.c b/ctdb/lib/tevent/tevent_timed.c
index 457ef1c21b..cc25428f18 100644
--- a/ctdb/lib/tevent/tevent_timed.c
+++ b/ctdb/lib/tevent/tevent_timed.c
@@ -197,7 +197,7 @@ struct tevent_timer *tevent_common_add_timer(struct tevent_context *ev, TALLOC_C
/*
do a single event loop using the events defined in ev
- return the delay untill the next timed event,
+ return the delay until the next timed event,
or zero if a timed event was triggered
*/
struct timeval tevent_common_loop_timer_delay(struct tevent_context *ev)
@@ -208,7 +208,7 @@ struct timeval tevent_common_loop_timer_delay(struct tevent_context *ev)
if (!te) {
/* have a default tick time of 30 seconds. This guarantees
that code that uses its own timeout checking will be
- able to proceeed eventually */
+ able to proceed eventually */
return tevent_timeval_set(30, 0);
}
diff --git a/ctdb/lib/tevent/tevent_util.c b/ctdb/lib/tevent/tevent_util.c
index 54c1787400..16af8f3b90 100644
--- a/ctdb/lib/tevent/tevent_util.c
+++ b/ctdb/lib/tevent/tevent_util.c
@@ -89,53 +89,19 @@ int ev_set_blocking(int fd, bool set)
#undef FLAG_TO_SET
}
-static struct timeval tevent_before_wait_ts;
-static struct timeval tevent_after_wait_ts;
-
-/*
- * measure the time difference between multiple arrivals
- * to the point where we wait for new events to come in
- *
- * allows to measure how long it takes to work on a
- * event
- */
-void tevent_before_wait(struct event_context *ev) {
-
- struct timeval diff;
- struct timeval now = tevent_timeval_current();
-
- if (!tevent_timeval_is_zero(&tevent_after_wait_ts)) {
- diff = tevent_timeval_until(&tevent_after_wait_ts, &now);
- if (diff.tv_sec > 3) {
- tevent_debug(ev, TEVENT_DEBUG_ERROR, __location__
- " Handling event took %d seconds!",
- (int) diff.tv_sec);
- }
- }
-
- tevent_before_wait_ts = tevent_timeval_current();
-
-}
+bool ev_set_close_on_exec(int fd)
+{
+#ifdef FD_CLOEXEC
+ int val;
-/*
- * measure how long the select()/epoll() call took
- *
- * allows to measure how long we are waiting for new events
- */
-void tevent_after_wait(struct event_context *ev) {
-
- struct timeval diff;
- struct timeval now = tevent_timeval_current();
-
- if (!tevent_timeval_is_zero(&tevent_before_wait_ts)) {
- diff = tevent_timeval_until(&tevent_before_wait_ts, &now);
- if (diff.tv_sec > 3) {
- tevent_debug(ev, TEVENT_DEBUG_FATAL, __location__
- " No event for %d seconds!",
- (int) diff.tv_sec);
+ val = fcntl(fd, F_GETFD, 0);
+ if (val >= 0) {
+ val |= FD_CLOEXEC;
+ val = fcntl(fd, F_SETFD, val);
+ if (val != -1) {
+ return true;
}
}
-
- tevent_after_wait_ts = tevent_timeval_current();
-
+#endif
+ return false;
}
diff --git a/ctdb/lib/tevent/tevent_util.h b/ctdb/lib/tevent/tevent_util.h
index 2852e9f26a..311be604a0 100644
--- a/ctdb/lib/tevent/tevent_util.h
+++ b/ctdb/lib/tevent/tevent_util.h
@@ -183,10 +183,7 @@ do { \
const char **ev_str_list_add(const char **list, const char *s);
int ev_set_blocking(int fd, bool set);
size_t ev_str_list_length(const char **list);
-
-void tevent_before_wait(struct event_context *ev);
-void tevent_after_wait(struct event_context *ev);
-
+bool ev_set_close_on_exec(int fd);
/* Defined here so we can build against older talloc versions that don't
* have this define yet. */
diff --git a/ctdb/lib/tevent/wscript b/ctdb/lib/tevent/wscript
deleted file mode 100644
index 114db31574..0000000000
--- a/ctdb/lib/tevent/wscript
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/usr/bin/env python
-
-APPNAME = 'tevent'
-VERSION = '0.9.9'
-
-blddir = 'bin'
-
-import sys, os
-
-# find the buildtools directory
-srcdir = '.'
-while not os.path.exists(srcdir+'/buildtools') and len(srcdir.split('/')) < 5:
- srcdir = '../' + srcdir
-sys.path.insert(0, srcdir + '/buildtools/wafsamba')
-
-import wafsamba, samba_dist
-
-samba_dist.DIST_DIRS('lib/tevent:. lib/replace:lib/replace lib/talloc:lib/talloc buildtools:buildtools')
-
-def set_options(opt):
- opt.BUILTIN_DEFAULT('replace')
- opt.BUNDLED_EXTENSION_DEFAULT('tevent', noextension='tevent')
- opt.RECURSE('lib/replace')
- opt.RECURSE('lib/talloc')
-
-def configure(conf):
- conf.RECURSE('lib/replace')
- conf.RECURSE('lib/talloc')
-
- conf.env.standalone_tevent = conf.IN_LAUNCH_DIR()
-
- if not conf.env.standalone_tevent:
- if conf.CHECK_BUNDLED_SYSTEM('tevent', minversion=VERSION,
- onlyif='talloc', implied_deps='replace talloc'):
- conf.define('USING_SYSTEM_TEVENT', 1)
-
- if conf.CHECK_FUNCS('epoll_create', headers='sys/epoll.h'):
- conf.DEFINE('HAVE_EPOLL', 1)
-
- conf.SAMBA_CONFIG_H()
-
-def build(bld):
- bld.RECURSE('lib/replace')
- bld.RECURSE('lib/talloc')
-
- SRC = '''tevent.c tevent_debug.c tevent_fd.c tevent_immediate.c
- tevent_queue.c tevent_req.c tevent_select.c
- tevent_signal.c tevent_standard.c tevent_timed.c tevent_util.c tevent_wakeup.c'''
-
- if bld.CONFIG_SET('HAVE_EPOLL'):
- SRC += ' tevent_epoll.c'
-
- if not bld.CONFIG_SET('USING_SYSTEM_TEVENT'):
- bld.SAMBA_LIBRARY('tevent',
- SRC,
- deps='replace talloc',
- enabled= not bld.CONFIG_SET('USING_SYSTEM_TEVENT'),
- abi_file='ABI/tevent-%s.sigs' % VERSION,
- abi_match='tevent_* _tevent_*',
- vnum=VERSION,
- is_bundled=not bld.env.standalone_tevent)
-
- if bld.env.standalone_tevent:
- bld.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
- bld.PKG_CONFIG_FILES('tevent.pc', vnum=VERSION)
- bld.INSTALL_FILES('${INCLUDEDIR}', 'tevent.h')
-
-def test(ctx):
- '''test tevent'''
- print("The tevent testsuite is part of smbtorture in samba4")
-
-
-def dist():
- '''makes a tarball for distribution'''
- samba_dist.dist()
diff --git a/ctdb/lib/util/db_wrap.c b/ctdb/lib/util/db_wrap.c
index 30474b1211..7e7e17fac4 100644
--- a/ctdb/lib/util/db_wrap.c
+++ b/ctdb/lib/util/db_wrap.c
@@ -28,7 +28,6 @@
#include "includes.h"
#include "lib/util/dlinklist.h"
-#include "lib/tevent/tevent.h"
#include "lib/tdb/include/tdb.h"
#include "db_wrap.h"
diff --git a/ctdb/server/ctdb_banning.c b/ctdb/server/ctdb_banning.c
index 56849072d7..4e6db31ee1 100644
--- a/ctdb/server/ctdb_banning.c
+++ b/ctdb/server/ctdb_banning.c
@@ -17,7 +17,6 @@
along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "lib/tdb/include/tdb.h"
#include "system/time.h"
#include "system/network.h"
diff --git a/ctdb/server/ctdb_call.c b/ctdb/server/ctdb_call.c
index cca7f01b6c..08b701c4fc 100644
--- a/ctdb/server/ctdb_call.c
+++ b/ctdb/server/ctdb_call.c
@@ -21,7 +21,6 @@
protocol design and packet details
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "lib/tdb/include/tdb.h"
#include "lib/util/dlinklist.h"
#include "system/network.h"
diff --git a/ctdb/server/ctdb_control.c b/ctdb/server/ctdb_control.c
index dee5818323..09210826fa 100644
--- a/ctdb/server/ctdb_control.c
+++ b/ctdb/server/ctdb_control.c
@@ -17,7 +17,6 @@
along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "lib/tdb/include/tdb.h"
#include "system/network.h"
#include "system/filesys.h"
diff --git a/ctdb/server/ctdb_daemon.c b/ctdb/server/ctdb_daemon.c
index a267b88e1b..5002629ef4 100644
--- a/ctdb/server/ctdb_daemon.c
+++ b/ctdb/server/ctdb_daemon.c
@@ -20,7 +20,6 @@
#include "includes.h"
#include "db_wrap.h"
#include "lib/tdb/include/tdb.h"
-#include "lib/tevent/tevent.h"
#include "lib/util/dlinklist.h"
#include "system/network.h"
#include "system/filesys.h"
diff --git a/ctdb/server/ctdb_freeze.c b/ctdb/server/ctdb_freeze.c
index 0f70fd3502..7233317667 100644
--- a/ctdb/server/ctdb_freeze.c
+++ b/ctdb/server/ctdb_freeze.c
@@ -17,7 +17,6 @@
along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "lib/tdb/include/tdb.h"
#include "system/network.h"
#include "system/filesys.h"
diff --git a/ctdb/server/ctdb_keepalive.c b/ctdb/server/ctdb_keepalive.c
index b4899b746f..5c95eb0c9b 100644
--- a/ctdb/server/ctdb_keepalive.c
+++ b/ctdb/server/ctdb_keepalive.c
@@ -19,7 +19,6 @@
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "system/filesys.h"
#include "system/wait.h"
#include "../include/ctdb_private.h"
diff --git a/ctdb/server/ctdb_lockwait.c b/ctdb/server/ctdb_lockwait.c
index 98606928b4..35f5902b00 100644
--- a/ctdb/server/ctdb_lockwait.c
+++ b/ctdb/server/ctdb_lockwait.c
@@ -18,7 +18,6 @@
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "system/filesys.h"
#include "system/wait.h"
#include "db_wrap.h"
diff --git a/ctdb/server/ctdb_logging.c b/ctdb/server/ctdb_logging.c
index 98087aaebb..7133d064e6 100644
--- a/ctdb/server/ctdb_logging.c
+++ b/ctdb/server/ctdb_logging.c
@@ -18,7 +18,6 @@
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "../include/ctdb_client.h"
#include "../include/ctdb_private.h"
#include "system/syslog.h"
diff --git a/ctdb/server/ctdb_ltdb_server.c b/ctdb/server/ctdb_ltdb_server.c
index 34da0192bf..1d21c07a56 100644
--- a/ctdb/server/ctdb_ltdb_server.c
+++ b/ctdb/server/ctdb_ltdb_server.c
@@ -18,7 +18,6 @@
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "lib/tdb/include/tdb.h"
#include "system/network.h"
#include "system/filesys.h"
diff --git a/ctdb/server/ctdb_monitor.c b/ctdb/server/ctdb_monitor.c
index 7258d3957a..bc21e5bb1d 100644
--- a/ctdb/server/ctdb_monitor.c
+++ b/ctdb/server/ctdb_monitor.c
@@ -19,7 +19,6 @@
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "system/filesys.h"
#include "system/wait.h"
#include "../include/ctdb_private.h"
diff --git a/ctdb/server/ctdb_persistent.c b/ctdb/server/ctdb_persistent.c
index ba93e8bc05..91c336c7a4 100644
--- a/ctdb/server/ctdb_persistent.c
+++ b/ctdb/server/ctdb_persistent.c
@@ -19,7 +19,6 @@
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "system/filesys.h"
#include "system/wait.h"
#include "db_wrap.h"
diff --git a/ctdb/server/ctdb_recover.c b/ctdb/server/ctdb_recover.c
index 330daedb93..937a2b8445 100644
--- a/ctdb/server/ctdb_recover.c
+++ b/ctdb/server/ctdb_recover.c
@@ -18,7 +18,6 @@
along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "lib/tdb/include/tdb.h"
#include "system/time.h"
#include "system/network.h"
diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c
index c079217868..359fe79749 100644
--- a/ctdb/server/ctdb_recoverd.c
+++ b/ctdb/server/ctdb_recoverd.c
@@ -18,7 +18,6 @@
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "system/filesys.h"
#include "system/time.h"
#include "system/network.h"
diff --git a/ctdb/server/ctdb_server.c b/ctdb/server/ctdb_server.c
index 3aae28e33e..ec608cfa56 100644
--- a/ctdb/server/ctdb_server.c
+++ b/ctdb/server/ctdb_server.c
@@ -19,7 +19,6 @@
#include "includes.h"
#include "lib/tdb/include/tdb.h"
-#include "lib/tevent/tevent.h"
#include "lib/util/dlinklist.h"
#include "system/network.h"
#include "system/filesys.h"
diff --git a/ctdb/server/ctdb_statistics.c b/ctdb/server/ctdb_statistics.c
index 502d4df1f9..96aad78323 100644
--- a/ctdb/server/ctdb_statistics.c
+++ b/ctdb/server/ctdb_statistics.c
@@ -19,7 +19,6 @@
#include "includes.h"
#include <string.h>
-#include "lib/tevent/tevent.h"
#include "../include/ctdb_private.h"
static void ctdb_statistics_update(struct event_context *ev, struct timed_event *te,
diff --git a/ctdb/server/ctdb_takeover.c b/ctdb/server/ctdb_takeover.c
index 43201a3832..c0acdcce91 100644
--- a/ctdb/server/ctdb_takeover.c
+++ b/ctdb/server/ctdb_takeover.c
@@ -19,7 +19,6 @@
along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "lib/tdb/include/tdb.h"
#include "lib/util/dlinklist.h"
#include "system/network.h"
diff --git a/ctdb/server/ctdb_traverse.c b/ctdb/server/ctdb_traverse.c
index da5a548da5..d7399347ec 100644
--- a/ctdb/server/ctdb_traverse.c
+++ b/ctdb/server/ctdb_traverse.c
@@ -18,7 +18,6 @@
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "system/filesys.h"
#include "system/wait.h"
#include "db_wrap.h"
diff --git a/ctdb/server/ctdb_update_record.c b/ctdb/server/ctdb_update_record.c
index 5845f1a7f2..92b304c08a 100644
--- a/ctdb/server/ctdb_update_record.c
+++ b/ctdb/server/ctdb_update_record.c
@@ -19,7 +19,6 @@
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "db_wrap.h"
#include "lib/tdb/include/tdb.h"
#include "ctdb_private.h"
diff --git a/ctdb/server/ctdb_uptime.c b/ctdb/server/ctdb_uptime.c
index 6720e0da82..b45ea80dd1 100644
--- a/ctdb/server/ctdb_uptime.c
+++ b/ctdb/server/ctdb_uptime.c
@@ -18,7 +18,6 @@
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "../include/ctdb_private.h"
#include "system/syslog.h"
#include "system/time.h"
diff --git a/ctdb/server/ctdb_vacuum.c b/ctdb/server/ctdb_vacuum.c
index b492f9b899..c5b4d9dc1b 100644
--- a/ctdb/server/ctdb_vacuum.c
+++ b/ctdb/server/ctdb_vacuum.c
@@ -20,7 +20,6 @@
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "lib/tdb/include/tdb.h"
#include "system/network.h"
#include "system/filesys.h"
@@ -28,7 +27,6 @@
#include "../include/ctdb_private.h"
#include "db_wrap.h"
#include "lib/util/dlinklist.h"
-#include "lib/tevent/tevent.h"
#include "../include/ctdb_private.h"
#include "../common/rb_tree.h"
diff --git a/ctdb/server/ctdbd.c b/ctdb/server/ctdbd.c
index 4205bd227b..eafef8d85a 100644
--- a/ctdb/server/ctdbd.c
+++ b/ctdb/server/ctdbd.c
@@ -18,7 +18,6 @@
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "system/filesys.h"
#include "popt.h"
#include "system/time.h"
diff --git a/ctdb/server/eventscript.c b/ctdb/server/eventscript.c
index 146da9d1ec..50ff7c3ceb 100644
--- a/ctdb/server/eventscript.c
+++ b/ctdb/server/eventscript.c
@@ -24,7 +24,6 @@
#include "system/dir.h"
#include "system/locale.h"
#include "../include/ctdb_private.h"
-#include "lib/tevent/tevent.h"
#include "../common/rb_tree.h"
#include "lib/util/dlinklist.h"
diff --git a/ctdb/tcp/tcp_connect.c b/ctdb/tcp/tcp_connect.c
index d7a0b33687..0e1318f9c0 100644
--- a/ctdb/tcp/tcp_connect.c
+++ b/ctdb/tcp/tcp_connect.c
@@ -19,7 +19,6 @@
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "lib/tdb/include/tdb.h"
#include "system/network.h"
#include "system/filesys.h"
diff --git a/ctdb/tcp/tcp_init.c b/ctdb/tcp/tcp_init.c
index 95141d5610..3fec599ee5 100644
--- a/ctdb/tcp/tcp_init.c
+++ b/ctdb/tcp/tcp_init.c
@@ -19,7 +19,6 @@
#include "includes.h"
#include "lib/tdb/include/tdb.h"
-#include "lib/tevent/tevent.h"
#include "system/network.h"
#include "system/filesys.h"
#include "../include/ctdb_private.h"
diff --git a/ctdb/tcp/tcp_io.c b/ctdb/tcp/tcp_io.c
index bba35decf5..f8904af9b2 100644
--- a/ctdb/tcp/tcp_io.c
+++ b/ctdb/tcp/tcp_io.c
@@ -18,7 +18,6 @@
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "lib/util/dlinklist.h"
#include "lib/tdb/include/tdb.h"
#include "system/network.h"
diff --git a/ctdb/tests/src/ctdb_bench.c b/ctdb/tests/src/ctdb_bench.c
index 14d25a138f..8463200342 100644
--- a/ctdb/tests/src/ctdb_bench.c
+++ b/ctdb/tests/src/ctdb_bench.c
@@ -18,7 +18,6 @@
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "system/filesys.h"
#include "popt.h"
#include "cmdline.h"
diff --git a/ctdb/tests/src/ctdb_fetch.c b/ctdb/tests/src/ctdb_fetch.c
index 3b5ce8bf16..01a5d76100 100644
--- a/ctdb/tests/src/ctdb_fetch.c
+++ b/ctdb/tests/src/ctdb_fetch.c
@@ -18,7 +18,6 @@
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "system/filesys.h"
#include "popt.h"
#include "cmdline.h"
diff --git a/ctdb/tests/src/ctdb_fetch_one.c b/ctdb/tests/src/ctdb_fetch_one.c
index a1529bcfdf..ba0e183fe5 100644
--- a/ctdb/tests/src/ctdb_fetch_one.c
+++ b/ctdb/tests/src/ctdb_fetch_one.c
@@ -19,7 +19,6 @@
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "system/filesys.h"
#include "popt.h"
#include "cmdline.h"
diff --git a/ctdb/tests/src/ctdb_fetch_readonly_loop.c b/ctdb/tests/src/ctdb_fetch_readonly_loop.c
index d2bf525a9a..557954f2e2 100644
--- a/ctdb/tests/src/ctdb_fetch_readonly_loop.c
+++ b/ctdb/tests/src/ctdb_fetch_readonly_loop.c
@@ -20,7 +20,6 @@
#include <time.h>
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "system/filesys.h"
#include "popt.h"
#include "cmdline.h"
diff --git a/ctdb/tests/src/ctdb_persistent.c b/ctdb/tests/src/ctdb_persistent.c
index 98c100f4ed..0bf92b345e 100644
--- a/ctdb/tests/src/ctdb_persistent.c
+++ b/ctdb/tests/src/ctdb_persistent.c
@@ -19,7 +19,6 @@
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "system/filesys.h"
#include "popt.h"
#include "cmdline.h"
diff --git a/ctdb/tests/src/ctdb_randrec.c b/ctdb/tests/src/ctdb_randrec.c
index dbaa4ba0fc..60d233bed8 100644
--- a/ctdb/tests/src/ctdb_randrec.c
+++ b/ctdb/tests/src/ctdb_randrec.c
@@ -19,7 +19,6 @@
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "system/filesys.h"
#include "popt.h"
#include "cmdline.h"
diff --git a/ctdb/tests/src/ctdb_store.c b/ctdb/tests/src/ctdb_store.c
index c657f7850e..69203434d6 100644
--- a/ctdb/tests/src/ctdb_store.c
+++ b/ctdb/tests/src/ctdb_store.c
@@ -19,7 +19,6 @@
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "system/filesys.h"
#include "popt.h"
#include "cmdline.h"
diff --git a/ctdb/tests/src/ctdb_test.c b/ctdb/tests/src/ctdb_test.c
index 0514f437cd..d692248535 100644
--- a/ctdb/tests/src/ctdb_test.c
+++ b/ctdb/tests/src/ctdb_test.c
@@ -26,12 +26,7 @@
#define _GNU_SOURCE
#include <stdio.h>
#include <sys/socket.h>
-#include "lib/tevent/tevent.h"
-#define tevent_context_init(x) tevent_context_init_foobar(x)
-struct tevent_context *tevent_context_init_foobar(TALLOC_CTX *mem_ctx);
-#define tevent_loop_allow_nesting(x) tevent_loop_allow_nesting_foobar(x)
-void tevent_loop_allow_nesting_foobar(struct tevent_context *ev);
#define ctdb_cmdline_client(x, y) ctdb_cmdline_client_foobar(x, y)
#define ctdb_get_socketname(x) ctdb_get_socketname_foobar(x)
@@ -46,8 +41,6 @@ void tevent_loop_allow_nesting_foobar(struct tevent_context *ev);
#include "tools/ctdb.c"
#ifdef CTDB_TEST_USE_MAIN
-#undef tevent_context_init
-#undef tevent_loop_allow_nesting
#undef ctdb_cmdline_client
#undef ctdb_get_socketname
#else
diff --git a/ctdb/tests/src/ctdb_tool_stubby.c b/ctdb/tests/src/ctdb_tool_stubby.c
index c388c63070..9a36030e69 100644
--- a/ctdb/tests/src/ctdb_tool_stubby.c
+++ b/ctdb/tests/src/ctdb_tool_stubby.c
@@ -22,11 +22,6 @@
#include "libctdb_test.c"
-void tevent_loop_allow_nesting_foobar(struct tevent_context *ev)
-{
- return;
-}
-
struct ctdb_context *ctdb_cmdline_client_foobar(struct tevent_context *ev,
struct timeval req_timeout)
{
@@ -37,12 +32,6 @@ struct ctdb_context *ctdb_cmdline_client_foobar(struct tevent_context *ev,
return ret;
}
-struct tevent_context *tevent_context_init_foobar(TALLOC_CTX *mem_ctx)
-{
- /* This should obviously never be used... */
- return (struct tevent_context *) 1;
-}
-
const char *ctdb_get_socketname_foobar(struct ctdb_context *ctdb)
{
return LIBCTDB_TEST_FAKESTATE;
diff --git a/ctdb/tests/src/ctdb_trackingdb_test.c b/ctdb/tests/src/ctdb_trackingdb_test.c
index 1957242494..0dcdcb49ce 100644
--- a/ctdb/tests/src/ctdb_trackingdb_test.c
+++ b/ctdb/tests/src/ctdb_trackingdb_test.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include <time.h>
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "system/filesys.h"
#include "popt.h"
#include "cmdline.h"
diff --git a/ctdb/tests/src/ctdb_transaction.c b/ctdb/tests/src/ctdb_transaction.c
index 6508874717..5b1a6c00d6 100644
--- a/ctdb/tests/src/ctdb_transaction.c
+++ b/ctdb/tests/src/ctdb_transaction.c
@@ -20,7 +20,6 @@
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "system/filesys.h"
#include "popt.h"
#include "cmdline.h"
diff --git a/ctdb/tests/src/ctdb_traverse.c b/ctdb/tests/src/ctdb_traverse.c
index 218e7f777d..d5eb304979 100644
--- a/ctdb/tests/src/ctdb_traverse.c
+++ b/ctdb/tests/src/ctdb_traverse.c
@@ -19,7 +19,6 @@
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "system/filesys.h"
#include "popt.h"
#include "cmdline.h"
diff --git a/ctdb/tests/src/ctdb_update_record.c b/ctdb/tests/src/ctdb_update_record.c
index c5f71a02a2..260f86ed14 100644
--- a/ctdb/tests/src/ctdb_update_record.c
+++ b/ctdb/tests/src/ctdb_update_record.c
@@ -19,7 +19,6 @@
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "system/filesys.h"
#include "popt.h"
#include "cmdline.h"
diff --git a/ctdb/tests/src/ctdb_update_record_persistent.c b/ctdb/tests/src/ctdb_update_record_persistent.c
index c54c0e4466..18156f8118 100644
--- a/ctdb/tests/src/ctdb_update_record_persistent.c
+++ b/ctdb/tests/src/ctdb_update_record_persistent.c
@@ -19,7 +19,6 @@
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "lib/util/db_wrap.h"
#include "system/filesys.h"
#include "popt.h"
diff --git a/ctdb/tests/src/ctdbd_test.c b/ctdb/tests/src/ctdbd_test.c
index 2eaa52e5d7..5427cf3a33 100644
--- a/ctdb/tests/src/ctdbd_test.c
+++ b/ctdb/tests/src/ctdbd_test.c
@@ -21,7 +21,6 @@
#define _CTDBD_TEST_C
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "lib/tdb/include/tdb.h"
#include "ctdb_private.h"
diff --git a/ctdb/tests/src/rb_test.c b/ctdb/tests/src/rb_test.c
index fded639f5d..092732bcf9 100644
--- a/ctdb/tests/src/rb_test.c
+++ b/ctdb/tests/src/rb_test.c
@@ -18,7 +18,6 @@
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "lib/util/dlinklist.h"
#include "system/filesys.h"
#include "popt.h"
diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c
index a56d579daf..647363e1b8 100644
--- a/ctdb/tools/ctdb.c
+++ b/ctdb/tools/ctdb.c
@@ -19,7 +19,6 @@
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "system/time.h"
#include "system/filesys.h"
#include "system/network.h"
diff --git a/ctdb/tools/ctdb_vacuum.c b/ctdb/tools/ctdb_vacuum.c
index e90e130acd..a05cdadfc1 100644
--- a/ctdb/tools/ctdb_vacuum.c
+++ b/ctdb/tools/ctdb_vacuum.c
@@ -18,7 +18,6 @@
*/
#include "includes.h"
-#include "lib/tevent/tevent.h"
#include "system/filesys.h"
#include "system/network.h"
#include "../include/ctdb_client.h"
diff --git a/ctdb/utils/pmda/pmda_ctdb.c b/ctdb/utils/pmda/pmda_ctdb.c
index 927fea5805..c8983ef2b8 100644
--- a/ctdb/utils/pmda/pmda_ctdb.c
+++ b/ctdb/utils/pmda/pmda_ctdb.c
@@ -23,7 +23,6 @@
#include <pcp/impl.h>
#include <pcp/pmda.h>
#include "../../include/includes.h"
-#include "../../lib/tevent/tevent.h"
#include "../../include/ctdb.h"
#include "../../include/ctdb_private.h"
#include "../../include/ctdb_protocol.h"