$(LN_S) lib$(LIBBASE)$(SHLIBVEXT) $@
binutils.versions: $(SHLIB_EXPORT_FILE) Makefile
- echo > binutils.versions "$(LIBBASE)_$(LIBMAJOR)_MIT {"
+ base=`echo "$(LIBBASE)" | sed -e 's/-/_/'`; \
+ echo > binutils.versions "$${base}_$(LIBMAJOR)_MIT {"
sed >> binutils.versions < $(SHLIB_EXPORT_FILE) "s/$$/;/"
echo >> binutils.versions "};"
echo >> binutils.versions "HIDDEN { local: __*; _rest*; _save*; *; };"
else :; fi; \
done; echo "$$a" >> hpux10.tmp
echo "+e errno" >> hpux10.tmp
- echo "+e _GLOBAL__FD_lib$(LIBBASE)_$(LIBMAJOR)_$(LIBMINOR)" >> hpux10.tmp
- echo "+e _GLOBAL__FI_lib$(LIBBASE)_$(LIBMAJOR)_$(LIBMINOR)" >> hpux10.tmp
+ base=`echo "$(LIBBASE)" | sed -e 's/-/_/'`; \
+ echo "+e _GLOBAL__FD_lib$${base}_$(LIBMAJOR)_$(LIBMINOR)" >> hpux10.tmp; \
+ echo "+e _GLOBAL__FI_lib$${base}_$(LIBMAJOR)_$(LIBMINOR)" >> hpux10.tmp
mv -f hpux10.tmp hpux10.exports
lib$(LIBBASE)$(PFLIBEXT): $(PFOBJLISTS)
SS_LIB-k5 = $(TOPLIBD)/libss.a $(RL_LIBS)
KDB5_LIB = -lkdb5 $(KDB5_PLUGIN_LIBS)
+VERTO_DEPLIB = $(VERTO_DEPLIB-@VERTO_VERSION@)
+VERTO_DEPLIB-sys = # empty
+VERTO_DEPLIB-k5 = $(TOPLIBD)/libverto$(DEPLIBEXT)
+VERTO_CFLAGS = @VERTO_CFLAGS@
+VERTO_LIBS = @VERTO_LIBS@
+
DL_LIB = @DL_LIB@
LDAP_LIBS = @LDAP_LIBS@
AC_SUBST([RL_CFLAGS])
AC_SUBST([RL_LIBS])
+AC_ARG_WITH([system-verto],
+ [AC_HELP_STRING([--with-system-verto], [always use system verto library])],
+ [], [with_system_verto=default])
+VERTO_CFLAGS=
+VERTO_LIBS=-lverto
+VERTO_VERSION=k5
+if test "x$with_system_verto" != xno; then
+ if verto_cflags=`pkg-config --cflags libverto 2>&1`; then
+ VERTO_CFLAGS=$verto_cflags
+ VERTO_LIBS=`pkg-config --libs libverto`
+ VERTO_VERSION=sys
+ else
+ AC_CHECK_LIB([verto], [verto_run], [VERTO_VERSION=sys],
+ [if test "x$with_system_verto" = xyes; then
+ AC_MSG_ERROR([cannot detect system libverto])
+ fi])
+ fi
+fi
+if test "x$VERTO_VERSION" = xsys; then
+ AC_MSG_NOTICE([Using system libverto])
+else
+ AC_MSG_RESULT([Using built-in libverto])
+fi
+AC_SUBST([VERTO_CFLAGS])
+AC_SUBST([VERTO_LIBS])
+AC_SUBST([VERTO_VERSION])
+
AC_CONFIG_FILES(krb5-config, [chmod +x krb5-config])
V5_AC_OUTPUT_MAKEFILE(.
util util/support util/profile util/profile/testmod util/send-pr
+ util/verto util/k5ev
lib lib/kdb
# configure scripts, so hide this.
##WIN32##!if 0
SUBDIRS=support $(MAYBE_ET_@COM_ERR_VERSION@) $(MAYBE_SS_@SS_VERSION@) \
- profile send-pr gss-kernel-lib
+ profile send-pr gss-kernel-lib $(MAYBE_VERTO_@VERTO_VERSION@)
##WIN32##!endif
WINSUBDIRS=windows support et profile
BUILDTOP=$(REL)..
MAYBE_ET_sys =
MAYBE_ET_intlsys =
MAYBE_SS_sys =
+MAYBE_VERTO_sys =
+MAYBE_VERTO_k5 = verto k5ev
all-recurse:
--- /dev/null
+mydir=util$(S)k5ev
+BUILDTOP=$(REL)..$(S)..
+RELDIR=../util/k5ev
+DEFS=
+
+SED = sed
+
+LIBBASE=verto-k5ev
+LIBMAJOR=0
+LIBMINOR=0
+
+LOCALINCLUDES=-I. -I$(srcdir)/../verto
+
+# Turn off extra warnings since we're not going to clean up libev's code.
+WARN_CFLAGS=
+
+STLIBOBJS=verto-k5ev.o
+LIBOBJS=$(OUTPRE)verto-k5ev.$(OBJEXT)
+SRCS=verto-k5ev.c
+
+STOBJLISTS=OBJS.ST
+SHLIB_EXPLIBS= $(LIBS) -lverto -lm # libm needed for ceil() currently.
+SHLIB_DIRS=-L$(TOPLIBD)
+SHLIB_RDIRS=$(KRB5_LIBDIR)
+
+all-unix:: all-liblinks
+
+install-unix:: install-libs
+
+clean-unix:: clean-liblinks clean-libs clean-libobjs
+
+rename.h: $(srcdir)/Symbols.ev
+ $(RM) $@
+ $(SED) -e 's/.*/#define & k5&/' < $(srcdir)/Symbols.ev > $@
+
+clean::
+ $(RM) rename.h
+
+depend:: rename.h
+
+@lib_frag@
+@libobj_frag@
--- /dev/null
+This directory builds a private libverto module using an embedded
+libev with renamed symbols (so we don't leak libev symbols into the
+namespace on platforms where we can't control the export list). The
+module is not intended to be used directly by applications, so it has
+no header file.
+
+libev has built-in support for this kind of embedding, so we don't
+have to modify the libev sources. Following libev's documentation,
+the following files have been copied from the ev sources:
+
+ ev.h
+ ev_vars.h
+ ev_wrap.h
+ ev.c
+ ev_select.c
+ ev_poll.c
+ ev_win32.c
+ Symbols.ev
+
+(Symbols.ev wasn't included in the 4.04 tar file due to an oversight,
+so it is taken from the appropriate tag in libev's source repository.)
+
+To rename the exported symbols, we create rename.h from Symbols.ev.
+We also use Symbols.ev to construct the library export list.
+(Renaming libev's symbols would be unnecessary if libev's embedding
+had support for making its API symbols static, but it currently does
+not.) The source file verto-k5ev.c wraps ev.c with appropriate
+embedding defines, and then defines the libverto module functions
+using the slightly modified contents of libverto's verto-ev.c.
--- /dev/null
+#
+# Generated makefile dependencies follow.
+#
+verto-k5ev.so verto-k5ev.po $(OUTPRE)verto-k5ev.$(OBJEXT): \
+ $(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/verto.h \
+ $(srcdir)/../verto/verto-module.h ev.c ev.h ev_poll.c \
+ ev_vars.h ev_wrap.h rename.h verto-k5ev.c
--- /dev/null
+/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
+/* util/k5ev/k5ev.c - Wrapper to create libk5ev from libev sources */
+/*
+ * Copyright (C) 2011 by the Massachusetts Institute of Technology.
+ * All rights reserved.
+ *
+ * Export of this software from the United States of America may
+ * require a specific license from the United States Government.
+ * It is the responsibility of any person or organization contemplating
+ * export to obtain such a license before exporting.
+ *
+ * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
+ * distribute this software and its documentation for any purpose and
+ * without fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation, and that
+ * the name of M.I.T. not be used in advertising or publicity pertaining
+ * to distribution of the software without specific, written prior
+ * permission. Furthermore if you modify this software you must label
+ * your software as modified software and not distribute it in such a
+ * fashion that it might be confused with the original M.I.T. software.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is" without express
+ * or implied warranty.
+ */
+
+#include "rename.h"
+#include "autoconf.h"
+#define EV_STANDALONE 1
+#define EV_FEATURES 0x5f /* Everything but back ends */
+#ifdef HAVE_POLL_H
+#define EV_USE_POLL 1
+#else
+#define EV_USE_SELECT 1
+#endif
+#include "ev.c"
--- /dev/null
+verto_module_table
--- /dev/null
+/*
+ * Copyright 2011 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+/* An edited version of verto's verto-libev.c, using an embedded libev with
+ * renamed symbols. */
+
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
+#include <verto.h>
+#include <verto-module.h>
+#include "rename.h"
+#include "autoconf.h"
+#define EV_STANDALONE 1
+#define EV_FEATURES 0x5f /* Everything but back ends */
+#ifdef HAVE_POLL_H
+#define EV_USE_POLL 1
+#else
+#define EV_USE_SELECT 1
+#endif
+#include "ev.c"
+
+static void
+libev_ctx_free(void *ctx)
+{
+ if (ctx != EV_DEFAULT)
+ ev_loop_destroy(ctx);
+}
+
+static void
+libev_ctx_run(void *ctx)
+{
+ ev_run(ctx, 0);
+}
+
+static void
+libev_ctx_run_once(void *ctx)
+{
+ ev_run(ctx, EVRUN_ONCE);
+}
+
+static void
+libev_ctx_break(void *ctx)
+{
+ ev_break(ctx, EVBREAK_ONE);
+}
+
+static void
+libev_callback(EV_P_ ev_watcher *w, int revents)
+{
+ if (verto_get_type(w->data) == VERTO_EV_TYPE_CHILD)
+ verto_set_proc_status(w->data, ((ev_child*) w)->rstatus);
+
+ verto_fire(w->data);
+}
+
+#define setuptype(type, priv, ...) \
+ type ## w = malloc(sizeof(ev_ ## type)); \
+ if (!type ## w) \
+ return NULL; \
+ ev_ ## type ## _init(type ## w, (EV_CB(type, (*))) __VA_ARGS__); \
+ type ## w->data = (void *) priv; \
+ ev_ ## type ## _start(ctx, type ## w); \
+ return type ## w
+
+static void *
+libev_ctx_add(void *ctx, const verto_ev *ev, verto_ev_flag *flags)
+{
+ ev_io *iow = NULL;
+ ev_timer *timerw = NULL;
+ ev_idle *idlew = NULL;
+ ev_signal *signalw = NULL;
+ ev_child *childw = NULL;
+ ev_tstamp interval;
+ int events = EV_NONE;
+
+ *flags |= VERTO_EV_FLAG_PERSIST;
+ switch (verto_get_type(ev)) {
+ case VERTO_EV_TYPE_IO:
+ if (verto_get_flags(ev) & VERTO_EV_FLAG_IO_READ)
+ events |= EV_READ;
+ if (verto_get_flags(ev) & VERTO_EV_FLAG_IO_WRITE)
+ events |= EV_WRITE;
+ setuptype(io, ev, libev_callback, verto_get_fd(ev), events);
+ case VERTO_EV_TYPE_TIMEOUT:
+ interval = ((ev_tstamp) verto_get_interval(ev)) / 1000.0;
+ setuptype(timer, ev, libev_callback, interval, interval);
+ case VERTO_EV_TYPE_IDLE:
+ setuptype(idle, ev, libev_callback);
+ case VERTO_EV_TYPE_SIGNAL:
+ setuptype(signal, ev, libev_callback, verto_get_signal(ev));
+ case VERTO_EV_TYPE_CHILD:
+ *flags &= ~VERTO_EV_FLAG_PERSIST; /* Child events don't persist */
+ setuptype(child, ev, libev_callback, verto_get_proc(ev), 0);
+ default:
+ return NULL; /* Not supported */
+ }
+}
+
+static void
+libev_ctx_del(void *ctx, const verto_ev *ev, void *evpriv)
+{
+ switch (verto_get_type(ev)) {
+ case VERTO_EV_TYPE_IO:
+ ev_io_stop(ctx, evpriv);
+ case VERTO_EV_TYPE_TIMEOUT:
+ ev_timer_stop(ctx, evpriv);
+ case VERTO_EV_TYPE_IDLE:
+ ev_idle_stop(ctx, evpriv);
+ case VERTO_EV_TYPE_SIGNAL:
+ ev_signal_stop(ctx, evpriv);
+ case VERTO_EV_TYPE_CHILD:
+ ev_child_stop(ctx, evpriv);
+ default:
+ break;
+ }
+
+ free(evpriv);
+}
+
+static verto_ctx *verto_new_libev(void);
+static verto_ctx *verto_default_libev(void);
+
+VERTO_MODULE(libev, ev_loop_new,
+ VERTO_EV_TYPE_IO |
+ VERTO_EV_TYPE_TIMEOUT |
+ VERTO_EV_TYPE_IDLE |
+ VERTO_EV_TYPE_SIGNAL |
+ VERTO_EV_TYPE_CHILD);
+
+static verto_ctx *
+verto_new_libev()
+{
+ return verto_convert(libev, ev_loop_new(EVFLAG_AUTO));
+}
+
+static verto_ctx *
+verto_default_libev()
+{
+ return verto_convert(libev, ev_default_loop(EVFLAG_AUTO));
+}
--- /dev/null
+mydir=util$(S)verto
+BUILDTOP=$(REL)..$(S)..
+RELDIR=../util/verto
+
+LIBBASE=verto
+LIBMAJOR=0
+LIBMINOR=0
+
+LOCALINCLUDES=-I$(srcdir)
+DEFINES=-DDEFAULT_LIBRARY=\"k5ev\"
+
+# Turn off extra warnings since we're not going to clean up libverto's code.
+WARN_CFLAGS=
+
+STLIBOBJS=verto.o
+LIBOBJS=$(OUTPRE)verto.$(OBJEXT)
+SRCS=verto.c
+
+STOBJLISTS=OBJS.ST
+SHLIB_EXPLIBS= $(DL_LIB)
+SHLIB_DIRS=
+SHLIB_RDIRS=$(KRB5_LIBDIR)
+
+VERTO_HDR=$(BUILDTOP)$(S)include$(S)verto.h
+
+all-unix:: all-liblinks includes
+
+install-unix:: install-libs
+
+clean-unix:: clean-liblinks clean-libs clean-libobjs
+ $(RM) $(VERTO_HDR)
+
+includes:: $(VERTO_HDR)
+
+$(VERTO_HDR): $(srcdir)/verto.h
+ $(RM) $@
+ $(CP) $(srcdir)/verto.h $@
+
+install::
+ $(INSTALL_DATA) $(srcdir)/verto.h $(DESTDIR)$(KRB5_INCDIR)/verto.h
+ $(INSTALL_DATA) $(srcdir)/verto-module.h \
+ $(DESTDIR)$(KRB5_INCDIR)/verto-module.h
+
+@lib_frag@
+@libobj_frag@
--- /dev/null
+#
+# Generated makefile dependencies follow.
+#
+verto.so verto.po $(OUTPRE)verto.$(OBJEXT): $(BUILDTOP)/include/verto.h \
+ verto-module.h verto.c
--- /dev/null
+verto_add_child
+verto_add_idle
+verto_add_io
+verto_add_signal
+verto_add_timeout
+verto_break
+verto_convert_funcs
+verto_default
+verto_del
+verto_fire
+verto_free
+verto_get_fd
+verto_get_flags
+verto_get_interval
+verto_get_private
+verto_get_proc
+verto_get_proc_status
+verto_get_signal
+verto_get_supported_types
+verto_get_type
+verto_new
+verto_run
+verto_run_once
+verto_set_default
+verto_set_private
+verto_set_proc_status