This commit is contained in:
Gregory Burd 2024-03-14 14:45:04 -04:00
parent 1f366b4cd4
commit ea57856932
36 changed files with 2536 additions and 28929 deletions

48
Makefile Normal file
View file

@ -0,0 +1,48 @@
CFLAGS = -Wall -Wextra -Wpedantic -Og -g -std=c99 -Iinclude/ -fPIC
TEST_FLAGS = -fsanitize=address,undefined
OBJS = skiplist.o
STATIC_LIB = libskiplist.a
SHARED_LIB = libskiplist.so
TESTS = tests/test
EXAMPLES = examples/example
.PHONY: all shared static clean tests examples
%.o: src/%.c
$(CC) $(CFLAGS) -c -o $@ $^
all: static shared
static: $(STATIC_LIB)
shared: $(SHARED_LIB)
$(STATIC_LIB): $(OBJS)
ar rcs $(STATIC_LIB) $?
$(SHARED_LIB): $(OBJS)
$(CC) $(CFLAGS) -o $@ $? -shared
tests: $(TESTS)
./tests/test
tests/test.c: tests/test.c tests/munit.c $(STATIC_LIB)
$(CC) $^ -o $@ $(CFLAGS) $(TEST_FLAGS)
tests/munit.c: tests/munit.c
$(CC) $^ -o $@ $(CFLAGS) $(TEST_FLAGS)
examples: $(EXAMPLES)
examples/example: examples/example.c $(STATIC_LIB)
$(CC) $^ -o $@ $(CFLAGS) $(TEST_FLAGS) -pthread
clean:
rm -f $(OBJS)
rm -f $(STATIC_LIB)
rm -f $(TESTS)
rm -f $(EXAMPLES)
format:
clang-format -i include/*.h src/*.c tests/*.c

203
dist/Makefile.in vendored
View file

@ -1,203 +0,0 @@
# SkipList
srcdir= @srcdir@/../src
tstdir= @srcdir@/../test
distdir= @srcdir@/../dist
builddir=.
##################################################
# Installation directories and permissions.
##################################################
prefix= @prefix@
exec_prefix= @exec_prefix@
bindir= @bindir@
includedir= @includedir@
libdir= @libdir@
docdir= $(prefix)/docs
dmode= 755
emode= 555
fmode= 444
transform=@program_transform_name@
##################################################
# Paths for standard user-level commands.
##################################################
SHELL= @db_cv_path_sh@
ar= @db_cv_path_ar@
awk= @db_cv_path_awk@
chmod= @db_cv_path_chmod@
cp= @db_cv_path_cp@
depend= @db_cv_path_makedepend@
grep= @db_cv_path_grep@
ln= @db_cv_path_ln@
mkdir= @db_cv_path_mkdir@
ranlib= @db_cv_path_ranlib@
rm= @db_cv_path_rm@
rpm= @db_cv_path_rpm@
sed= @db_cv_path_sed@
perl= @db_cv_path_perl@
splint= @db_cv_path_splint@
strip= @db_cv_path_strip@
##################################################
# General library information.
##################################################
DEF_LIB= @DEFAULT_LIB@
INSTALLER= @INSTALLER@
LIBTOOL= @LIBTOOL@
POSTLINK= @POSTLINK@
SOLINK= @MAKEFILE_SOLINK@
SOFLAGS= @SOFLAGS@
LIBMAJOR= @SKIPLIST_VERSION_MAJOR@
LIBVERSION= @SKIPLIST_VERSION_MAJOR@.@SKIPLIST_VERSION_MINOR@
CPPFLAGS= -I$(builddir) -I$(srcdir) @CPPFLAGS@
##################################################
# C
##################################################
CFLAGS= -c $(CPPFLAGS) @CFLAGS@
CC= @MAKEFILE_CC@
CCLINK= @MAKEFILE_CCLINK@
LDFLAGS= @LDFLAGS@
LIBS= @LIBS@
LIBSO_LIBS= @LIBSO_LIBS@
libskiplist_base= libskiplist
libskiplist= $(libskiplist_base).a
libskiplist_version= $(libskiplist_base)-$(LIBVERSION).a
libso= $(libskiplist_base)-$(LIBVERSION)@SOSUFFIX@
libso_target= $(libskiplist_base)-$(LIBVERSION).la
libso_default= $(libskiplist_base)@SOSUFFIX@
libso_major= $(libskiplist_base)-$(LIBMAJOR)@SOSUFFIX@
##################################################
# Source file lists.
##################################################
C_FILES=\
$(srcdir)/skiplist.c
##################################################
# Object and utility lists.
##################################################
C_OBJS=\
skiplist@o@
##################################################
# List of files installed into the library directory.
##################################################
LIB_INSTALL_FILE_LIST=\
$(libdbsql) \
$(libso) \
$(libso_default) \
$(libso_major) \
$(libdbsql_version) \
$(libso_target) \
$(libtso) \
$(libtso_default) \
$(libtso_major) \
$(libtso_static) \
$(libtso_target)
##################################################
# We're building a standard library or a RPM file hierarchy.
# Note: "all" must be the first target in the Makefile.
##################################################
all: @BUILD_TARGET@
install-strip install: all @INSTALL_TARGET@
##################################################
# Library build.
##################################################
library_build: $(libso_target) $(libtso_target)
# Static C library named libskiplist.a.
$(libskiplist): $(DEF_LIB)
$(rm) -f $@
test ! -f .libs/$(libskiplist_version) || \
$(ln) -s .libs/$(libskiplist_version) $@
test -f .libs/$(libskiplist_version) || \
(test -f $(libskiplist_version) &&
$(ln) -s $(libskiplist_version) $@)
# Real static C library.
$(libskiplist_version): skiplist.h $(C_OBJS)
$(ar) cr $@ $(C_OBJS)
test ! -f $(ranlib) || $(ranlib) $@
# Shared C library.
$(libso_target): skiplist.h $(C_OBJS)
$(SOLINK) $(SOFLAGS) $(LDFLAGS) -o $@ $(C_OBJS) $(LIBSO_LIBS)
##################################################
# Testing.
##################################################
test: test@o@ munit@o@
$(CCLINK) -o $@ $(LDFLAGS) \
test@o@ $(DEF_LIB) $(LIBS)
$(POSTLINK) $@
check: test
./test
##################################################
# Remaining standard Makefile targets.
##################################################
CLEAN_LIST=\
$(builddir)/example \
$(tstdir)/test $(tstdir)/*.o
mostly-clean clean:
$(rm) -rf $(C_OBJS)
$(rm) -rf *.exe $(CLEAN_LIST)
$(rm) -rf tags *@o@ *~ *.o *.o.lock *.lo core *.core *.loT
$(rm) -rf .libs $(LIB_INSTALL_FILE_LIST)
REALCLEAN_LIST=\
Makefile config.cache config.log config.status \
configure.lineno skiplist.h
distclean maintainer-clean realclean: clean
$(rm) -rf $(REALCLEAN_LIST)
$(rm) -rf libtool
LIBTOOL_DEPS = @LIBTOOL_DEPS@
libtool: $(LIBTOOL_DEPS)
$(SHELL) ./deps/config.status $(builddir)/libtool
check dvi info obj TAGS:
@echo "$@: make target not supported" && true
dist:
@echo "$@: make target not supported" && false
##################################################
# Example programs for C.
##################################################
example: $(DEF_LIB) example@o@
$(CCLINK) -o $@ $(LDFLAGS) \
example@o@ $(DEF_LIB) $(LIBS)
$(POSTLINK) $@
##################################################
# C
##################################################
example@o@: $(srcdir)/example.c
$(CC) $(CFLAGS) $?
skiplist@o@: $(srcdir)/skiplist.c
$(CC) $(CFLAGS) $?
munit@o@: $(tstdir)/munit.c
$(CC) $(CFLAGS) $?
test@o@: $(tstdir)/test.c
$(CC) $(CFLAGS) $?

9
dist/RELEASE vendored
View file

@ -1,9 +0,0 @@
SKIPLIST_VERSION_MAJOR=0
SKIPLIST_VERSION_MINOR=0
SKIPLIST_VERSION_PATCH=1
SKIPLIST_VERSION="$SKIPLIST_VERSION_MAJOR.$SKIPLIST_VERSION_MINOR.$SKIPLIST_VERSION_PATCH"
SKIPLIST_VERSION_UNIQUE_NAME=`printf "_%d%03d" $SKIPLIST_VERSION_MAJOR $SKIPLIST_VERSION_MINOR`
SKIPLIST_RELEASE_DATE=`date "+%B %e, %Y"`
SKIPLIST_VERSION_STRING="A skiplist $SKIPLIST_VERSION: ($SKIPLIST_RELEASE_DATE)"

View file

@ -1,26 +0,0 @@
# Features we don't test for, but want the #defines to exist for
# other ports.
AH_TEMPLATE(DBSQL_WIN32,
[We use DBSQL_WIN32 much as one would use _WIN32 -- to specify that
we're using an operating system environment that supports Win32
calls and semantics. We don't use _WIN32 because Cygwin/GCC also
defines _WIN32, even though Cygwin/GCC closely emulates the Unix
environment.])
AH_TEMPLATE(HAVE_FILESYSTEM_NOTZERO,
[Define to 1 if allocated filesystem blocks are not zeroed.])
AH_TEMPLATE(HAVE_UNLINK_WITH_OPEN_FAILURE,
[Define to 1 if unlink of file with open file descriptors will fail.])
AH_BOTTOM([/*
* Exit success/failure macros.
*/
#ifndef HAVE_EXIT_SUCCESS
#define EXIT_FAILURE 1
#define EXIT_SUCCESS 0
#endif
#ifdef DBSQL_WIN32
#include "win_dbsql.h"
#endif])

313
dist/aclocal/cxx.m4 vendored
View file

@ -1,313 +0,0 @@
# C++ language checks
AC_DEFUN(AC_CXX_STDHEADERS, [
AC_SUBST(cxx_have_stdheaders)
AC_MSG_CHECKING(whether C++ supports the ISO C++ standard includes)
AC_LANG_SAVE
AC_LANG([C++])
AC_COMPILE_IFELSE([AC_LANG_SOURCE(
[[#include <iostream>]],
[[std::ostream *o; return 0;]])],
db_cv_cxx_have_stdheaders=yes, db_cv_cxx_have_stdheaders=no)
AC_LANG_RESTORE
AC_MSG_RESULT($db_cv_cxx_have_stdheaders)
if test "$db_cv_cxx_have_stdheaders" = yes; then
cxx_have_stdheaders="#define HAVE_CXX_STDHEADERS 1"
fi])
AC_DEFUN(AC_CXX_WSTRING, [
AC_MSG_CHECKING(whether C++ supports the wstring class)
AC_SUBST(WSTRING_decl)
AC_LANG_SAVE
AC_LANG([C++])
AC_LINK_IFELSE(AC_LANG_SOURCE(
[[#include <string>]],
[[using std::wstring;
wstring ws; ws.find_first_of(ws);]]),
[WSTRING_decl="#define HAVE_WSTRING 1" ;
AC_MSG_RESULT(yes)],
[WSTRING_decl="#undef HAVE_WSTRING" ;
AC_MSG_RESULT(no)])
AC_LANG_RESTORE
])
AC_DEFUN(AC_CXX_SUPPORTS_TEMPLATES, [
AC_MSG_CHECKING(whether the C++ compiler supports templates for STL)
AC_LANG_SAVE
AC_LANG([C++])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <iostream>
#include <string>
#include <vector>
]], [[
using std::string;
using std::vector;
namespace dbstl_configure_test {
template<typename T1, typename T2 = int>
class MyClass
{
public:
explicit MyClass(int i) { imem = i;}
MyClass(const T1& t1, const T2& t2, int i)
{
mem1 = t1;
mem2 = t2;
imem = i;
}
template <typename T3>
T2 templ_mem_func(T1 t1, T3 t3)
{
mem2 = t1;
T3 t32 = t3;
T2 t2;
return t2;
}
double templ_mem_func(T1 t1, double t3)
{
mem1 = t1;
double t32 = t3;
return t3;
}
template <typename ReturnType, typename T7, typename T8>
ReturnType templ_mem_func(T7, T8);
operator T1() const {return mem1;}
private:
T1 mem1;
T2 mem2;
int imem;
};
template<typename T1, typename T2>
template <typename ReturnType, typename T7, typename T8>
ReturnType MyClass<T1, T2>::templ_mem_func(T7, T8)
{
ReturnType rt;
return rt;
}
template<>
class MyClass<double, float>
{
public:
explicit MyClass(int i) { imem = i;}
MyClass(const double& t1, const float& t2, int i)
{
mem1 = t1;
mem2 = t2;
imem = i;
}
template <typename T3>
float templ_mem_func(double t1, T3 t3)
{
mem2 = t1;
T3 t32 = t3;
float t2;
return t2;
}
double templ_mem_func(double t1, double t3)
{
mem1 = t1;
double t32 = t3;
return t3;
}
template <typename ReturnType, typename T7, typename T8>
ReturnType templ_mem_func(T7, T8);
operator double() const {return mem1;}
private:
double mem1;
float mem2;
int imem;
};
template <typename ReturnType, typename T7, typename T8>
ReturnType MyClass<double, float>::templ_mem_func(T7, T8)
{
ReturnType rt;
return rt;
}
template <typename T1, typename T2>
class MyClass2 {
public:
MyClass2(const T1& t1, const T2&t2){}
};
// partial specialization: both template parameters have same type
template <typename T>
class MyClass2<T,T> {
public:
MyClass2(const T& t1, const T&t2){}
};
// partial specialization: second type is int
template <typename T>
class MyClass2<T,int> {
public:
MyClass2(const T& t1, const int&t2){}
};
// partial specialization: both template parameters are pointer types
template <typename T1, typename T2>
class MyClass2<T1*,T2*> {
public:
MyClass2(const T1* t1, const T2*t2){}
};
template <typename T>
class MyClass2<T*,T*> {
public:
MyClass2(const T* t1, const T*t2){}
};
template <typename T4, typename T5>
int part_spec_func(T4 t4, T5 t5)
{
// Zero Initialization should work.
T4 t44 = T4();
T5 t55 = T5();
t44 = t4;
t55 = t5;
}
template <typename T4>
int part_spec_func(T4 t4, std::vector<T4> t55)
{
T4 t44 = t4;
std::vector<T4> abc = t55;
}
// maximum of two int values
inline int const& max (int const& a, int const& b)
{
return a<b?b:a;
}
// maximum of two values of any type
template <typename T1, typename T2>
inline T2 const max (T1 const& a, T2 const& b)
{
return a<b?b:a;
}
// maximum of two values of any type
template <typename T>
inline T const& max (T const& a, T const& b)
{
return a<b?b:a;
}
// maximum of three values of any type
template <typename T>
inline T const& max (T const& a, T const& b, T const& c)
{
return max (max(a,b), c);
}
template <typename T>
class Base {
public:
void exit2(){}
Base(){}
};
template <typename T>
class Derived : public Base<T> {
public:
// Call Base<T>() explicitly here, otherwise can't access it.
// Kind of like this->.
Derived() : Base<T>(){}
void foo() {
this->exit2();
}
};
} // dbstl_configure_test
using namespace dbstl_configure_test;], [
char cc = 'a';
int i = 4;
double pi = 3.14;
float gold = 0.618;
MyClass2<int,float> mif(i, gold); // uses MyClass2<T1,T2>
MyClass2<float,float> mff(gold, gold); // uses MyClass2<T,T>
MyClass2<float,int> mfi(gold, i); // uses MyClass2<T,int>
MyClass2<int*,float*> mp(&i, &gold); // uses MyClass2<T1*,T2*>
MyClass2<int*,int*> m(&i, &i); // uses MyClass2<T*, T*>
MyClass<char> obj1(i);
obj1.templ_mem_func(cc, pi);
obj1.templ_mem_func(cc, gold);
obj1.templ_mem_func(i, pi);
obj1.templ_mem_func(cc, cc);
char ch = (char)obj1;
string str1("abc"), str2("def");
MyClass<const char*, std::string> obj2(str1.c_str(), str2, i);
obj2.templ_mem_func("klm", str2);
obj2.templ_mem_func("hij", pi);
// Use j to help distinguish, otherwise unable to use the one defined
// outside of class body.
int j = obj2.templ_mem_func<int, char, char>(cc, cc);
// Call explicitly.
obj2.templ_mem_func<int, float, double>(gold, pi);
const char *pch = (const char*)obj2;
MyClass<double, float> obj3(pi, gold, i);
obj3.templ_mem_func(pi, i);
obj3.templ_mem_func(pi, str1);
obj3.templ_mem_func(pi, pi);
obj3.templ_mem_func(cc, pi);
obj3.templ_mem_func(cc, cc);
double tmpd = (double)obj3;
MyClass<double, float> obj4(i);
obj4.templ_mem_func(pi, i);
obj4.templ_mem_func(pi, str1);
obj4.templ_mem_func(pi, pi);
obj4.templ_mem_func(gold, pi);
tmpd = (double)obj4;
// Function template partial specialization.
part_spec_func(pi, gold);
part_spec_func(gold, i);
part_spec_func(str1, str2);
std::vector<std::string> strv;
part_spec_func(str1, strv);
std::vector<double> dblv;
part_spec_func(pi, dblv);
// Function template overloads and explicit call and deduction.
dbstl_configure_test::max(7, 42, 68); // calls the template for three arguments
dbstl_configure_test::max(7.0, 42.0); // calls max<double> (by argument deduction)
dbstl_configure_test::max('a', 'b'); // calls max<char> (by argument deduction)
dbstl_configure_test::max(7, 42.0);
dbstl_configure_test::max<double>(4,4.2); // instantiate T as double
dbstl_configure_test::max(7, 42); // calls the nontemplate for two ints
dbstl_configure_test::max<>(7, 42); // calls max<int> (by argument deduction)
dbstl_configure_test::max<double, double>(7, 42); // calls max<double> (no argument deduction)
dbstl_configure_test::max('a', 42.7); // calls the nontemplate for two ints
Base<double> bobj;
bobj.exit2();
// Using this-> to access base class members.
Derived<double> dobj;
dobj.foo();
dobj.exit2();
]])], AC_MSG_RESULT(yes), AC_MSG_ERROR(no))
AC_LANG_RESTORE
])

19
dist/aclocal/gcc.m4 vendored
View file

@ -1,19 +0,0 @@
# Version 2.96 of gcc (shipped with RedHat Linux 7.[01] and Mandrake) had
# serious problems.
AC_DEFUN(AC_GCC_CONFIG1, [
AC_CACHE_CHECK([whether we are using gcc version 2.96],
db_cv_gcc_2_96, [
db_cv_gcc_2_96=no
if test "$GCC" = "yes"; then
GCC_VERSION=`${MAKEFILE_CC} --version`
case ${GCC_VERSION} in
2.96*)
db_cv_gcc_2_96=yes;;
esac
fi])
if test "$db_cv_gcc_2_96" = "yes"; then
CFLAGS=`echo "$CFLAGS" | sed 's/-O2/-O/'`
CXXFLAGS=`echo "$CXXFLAGS" | sed 's/-O2/-O/'`
AC_MSG_WARN([INSTALLED GCC COMPILER HAS SERIOUS BUGS; PLEASE UPGRADE.])
AC_MSG_WARN([GCC OPTIMIZATION LEVEL SET TO -O.])
fi])

8400
dist/aclocal/libtool.m4 vendored

File diff suppressed because it is too large Load diff

View file

@ -1,437 +0,0 @@
# Helper functions for option handling. -*- Autoconf -*-
#
# Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free
# Software Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 8 ltoptions.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
# ------------------------------------------
m4_define([_LT_MANGLE_OPTION],
[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
# ---------------------------------------
# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
# matching handler defined, dispatch to it. Other OPTION-NAMEs are
# saved as a flag.
m4_define([_LT_SET_OPTION],
[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
_LT_MANGLE_DEFUN([$1], [$2]),
[m4_warning([Unknown $1 option '$2'])])[]dnl
])
# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
# ------------------------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
m4_define([_LT_IF_OPTION],
[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
# -------------------------------------------------------
# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
# are set.
m4_define([_LT_UNLESS_OPTIONS],
[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
[m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
[m4_define([$0_found])])])[]dnl
m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
])[]dnl
])
# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
# ----------------------------------------
# OPTION-LIST is a space-separated list of Libtool options associated
# with MACRO-NAME. If any OPTION has a matching handler declared with
# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
# the unknown option and exit.
m4_defun([_LT_SET_OPTIONS],
[# Set options
m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
[_LT_SET_OPTION([$1], _LT_Option)])
m4_if([$1],[LT_INIT],[
dnl
dnl Simply set some default values (i.e off) if boolean options were not
dnl specified:
_LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
])
_LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
])
dnl
dnl If no reference was made to various pairs of opposing options, then
dnl we run the default mode handler for the pair. For example, if neither
dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
dnl archives by default:
_LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
_LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
_LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
_LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
[_LT_ENABLE_FAST_INSTALL])
_LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
[_LT_WITH_AIX_SONAME([aix])])
])
])# _LT_SET_OPTIONS
## --------------------------------- ##
## Macros to handle LT_INIT options. ##
## --------------------------------- ##
# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
# -----------------------------------------
m4_define([_LT_MANGLE_DEFUN],
[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
# -----------------------------------------------
m4_define([LT_OPTION_DEFINE],
[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
])# LT_OPTION_DEFINE
# dlopen
# ------
LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
])
AU_DEFUN([AC_LIBTOOL_DLOPEN],
[_LT_SET_OPTION([LT_INIT], [dlopen])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the 'dlopen' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
# win32-dll
# ---------
# Declare package support for building win32 dll's.
LT_OPTION_DEFINE([LT_INIT], [win32-dll],
[enable_win32_dll=yes
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
AC_CHECK_TOOL(AS, as, false)
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(OBJDUMP, objdump, false)
;;
esac
test -z "$AS" && AS=as
_LT_DECL([], [AS], [1], [Assembler program])dnl
test -z "$DLLTOOL" && DLLTOOL=dlltool
_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
test -z "$OBJDUMP" && OBJDUMP=objdump
_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
])# win32-dll
AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
_LT_SET_OPTION([LT_INIT], [win32-dll])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the 'win32-dll' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
# _LT_ENABLE_SHARED([DEFAULT])
# ----------------------------
# implement the --enable-shared flag, and supports the 'shared' and
# 'disable-shared' LT_INIT options.
# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
m4_define([_LT_ENABLE_SHARED],
[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([shared],
[AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_shared=yes ;;
no) enable_shared=no ;;
*)
enable_shared=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
for pkg in $enableval; do
IFS=$lt_save_ifs
if test "X$pkg" = "X$p"; then
enable_shared=yes
fi
done
IFS=$lt_save_ifs
;;
esac],
[enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
_LT_DECL([build_libtool_libs], [enable_shared], [0],
[Whether or not to build shared libraries])
])# _LT_ENABLE_SHARED
LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
# Old names:
AC_DEFUN([AC_ENABLE_SHARED],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
])
AC_DEFUN([AC_DISABLE_SHARED],
[_LT_SET_OPTION([LT_INIT], [disable-shared])
])
AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AM_ENABLE_SHARED], [])
dnl AC_DEFUN([AM_DISABLE_SHARED], [])
# _LT_ENABLE_STATIC([DEFAULT])
# ----------------------------
# implement the --enable-static flag, and support the 'static' and
# 'disable-static' LT_INIT options.
# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
m4_define([_LT_ENABLE_STATIC],
[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([static],
[AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_static=yes ;;
no) enable_static=no ;;
*)
enable_static=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
for pkg in $enableval; do
IFS=$lt_save_ifs
if test "X$pkg" = "X$p"; then
enable_static=yes
fi
done
IFS=$lt_save_ifs
;;
esac],
[enable_static=]_LT_ENABLE_STATIC_DEFAULT)
_LT_DECL([build_old_libs], [enable_static], [0],
[Whether or not to build static libraries])
])# _LT_ENABLE_STATIC
LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
# Old names:
AC_DEFUN([AC_ENABLE_STATIC],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
])
AC_DEFUN([AC_DISABLE_STATIC],
[_LT_SET_OPTION([LT_INIT], [disable-static])
])
AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AM_ENABLE_STATIC], [])
dnl AC_DEFUN([AM_DISABLE_STATIC], [])
# _LT_ENABLE_FAST_INSTALL([DEFAULT])
# ----------------------------------
# implement the --enable-fast-install flag, and support the 'fast-install'
# and 'disable-fast-install' LT_INIT options.
# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
m4_define([_LT_ENABLE_FAST_INSTALL],
[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([fast-install],
[AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
[optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_fast_install=yes ;;
no) enable_fast_install=no ;;
*)
enable_fast_install=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
for pkg in $enableval; do
IFS=$lt_save_ifs
if test "X$pkg" = "X$p"; then
enable_fast_install=yes
fi
done
IFS=$lt_save_ifs
;;
esac],
[enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
_LT_DECL([fast_install], [enable_fast_install], [0],
[Whether or not to optimize for fast installation])dnl
])# _LT_ENABLE_FAST_INSTALL
LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
# Old names:
AU_DEFUN([AC_ENABLE_FAST_INSTALL],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
the 'fast-install' option into LT_INIT's first parameter.])
])
AU_DEFUN([AC_DISABLE_FAST_INSTALL],
[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
the 'disable-fast-install' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
# _LT_WITH_AIX_SONAME([DEFAULT])
# ----------------------------------
# implement the --with-aix-soname flag, and support the `aix-soname=aix'
# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'.
m4_define([_LT_WITH_AIX_SONAME],
[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
shared_archive_member_spec=
case $host,$enable_shared in
power*-*-aix[[5-9]]*,yes)
AC_MSG_CHECKING([which variant of shared library versioning to provide])
AC_ARG_WITH([aix-soname],
[AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
[shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
[case $withval in
aix|svr4|both)
;;
*)
AC_MSG_ERROR([Unknown argument to --with-aix-soname])
;;
esac
lt_cv_with_aix_soname=$with_aix_soname],
[AC_CACHE_VAL([lt_cv_with_aix_soname],
[lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
with_aix_soname=$lt_cv_with_aix_soname])
AC_MSG_RESULT([$with_aix_soname])
if test aix != "$with_aix_soname"; then
# For the AIX way of multilib, we name the shared archive member
# based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
# and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
# Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
# the AIX toolchain works better with OBJECT_MODE set (default 32).
if test 64 = "${OBJECT_MODE-32}"; then
shared_archive_member_spec=shr_64
else
shared_archive_member_spec=shr
fi
fi
;;
*)
with_aix_soname=aix
;;
esac
_LT_DECL([], [shared_archive_member_spec], [0],
[Shared archive member basename, for filename based shared library versioning on AIX])dnl
])# _LT_WITH_AIX_SONAME
LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
# _LT_WITH_PIC([MODE])
# --------------------
# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
# LT_INIT options.
# MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'.
m4_define([_LT_WITH_PIC],
[AC_ARG_WITH([pic],
[AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
[lt_p=${PACKAGE-default}
case $withval in
yes|no) pic_mode=$withval ;;
*)
pic_mode=default
# Look at the argument we got. We use all the common list separators.
lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
for lt_pkg in $withval; do
IFS=$lt_save_ifs
if test "X$lt_pkg" = "X$lt_p"; then
pic_mode=yes
fi
done
IFS=$lt_save_ifs
;;
esac],
[pic_mode=m4_default([$1], [default])])
_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
])# _LT_WITH_PIC
LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
# Old name:
AU_DEFUN([AC_LIBTOOL_PICMODE],
[_LT_SET_OPTION([LT_INIT], [pic-only])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the 'pic-only' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
## ----------------- ##
## LTDL_INIT Options ##
## ----------------- ##
m4_define([_LTDL_MODE], [])
LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
[m4_define([_LTDL_MODE], [nonrecursive])])
LT_OPTION_DEFINE([LTDL_INIT], [recursive],
[m4_define([_LTDL_MODE], [recursive])])
LT_OPTION_DEFINE([LTDL_INIT], [subproject],
[m4_define([_LTDL_MODE], [subproject])])
m4_define([_LTDL_TYPE], [])
LT_OPTION_DEFINE([LTDL_INIT], [installable],
[m4_define([_LTDL_TYPE], [installable])])
LT_OPTION_DEFINE([LTDL_INIT], [convenience],
[m4_define([_LTDL_TYPE], [convenience])])

View file

@ -1,123 +0,0 @@
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
#
# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 6 ltsugar.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
# lt_join(SEP, ARG1, [ARG2...])
# -----------------------------
# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
# associated separator.
# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
# versions in m4sugar had bugs.
m4_define([lt_join],
[m4_if([$#], [1], [],
[$#], [2], [[$2]],
[m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
m4_define([_lt_join],
[m4_if([$#$2], [2], [],
[m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
# lt_car(LIST)
# lt_cdr(LIST)
# ------------
# Manipulate m4 lists.
# These macros are necessary as long as will still need to support
# Autoconf-2.59 which quotes differently.
m4_define([lt_car], [[$1]])
m4_define([lt_cdr],
[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
[$#], 1, [],
[m4_dquote(m4_shift($@))])])
m4_define([lt_unquote], $1)
# lt_append(MACRO-NAME, STRING, [SEPARATOR])
# ------------------------------------------
# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
# Note that neither SEPARATOR nor STRING are expanded; they are appended
# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
# No SEPARATOR is output if MACRO-NAME was previously undefined (different
# than defined and empty).
#
# This macro is needed until we can rely on Autoconf 2.62, since earlier
# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
m4_define([lt_append],
[m4_define([$1],
m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
# ----------------------------------------------------------
# Produce a SEP delimited list of all paired combinations of elements of
# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
# has the form PREFIXmINFIXSUFFIXn.
# Needed until we can rely on m4_combine added in Autoconf 2.62.
m4_define([lt_combine],
[m4_if(m4_eval([$# > 3]), [1],
[m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
[[m4_foreach([_Lt_prefix], [$2],
[m4_foreach([_Lt_suffix],
]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
# -----------------------------------------------------------------------
# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
m4_define([lt_if_append_uniq],
[m4_ifdef([$1],
[m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
[lt_append([$1], [$2], [$3])$4],
[$5])],
[lt_append([$1], [$2], [$3])$4])])
# lt_dict_add(DICT, KEY, VALUE)
# -----------------------------
m4_define([lt_dict_add],
[m4_define([$1($2)], [$3])])
# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
# --------------------------------------------
m4_define([lt_dict_add_subkey],
[m4_define([$1($2:$3)], [$4])])
# lt_dict_fetch(DICT, KEY, [SUBKEY])
# ----------------------------------
m4_define([lt_dict_fetch],
[m4_ifval([$3],
m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
# -----------------------------------------------------------------
m4_define([lt_if_dict_fetch],
[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
[$5],
[$6])])
# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
# --------------------------------------------------------------
m4_define([lt_dict_filter],
[m4_if([$5], [], [],
[lt_join(m4_quote(m4_default([$4], [[, ]])),
lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
[lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
])

View file

@ -1,24 +0,0 @@
# ltversion.m4 -- version numbers -*- Autoconf -*-
#
# Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation,
# Inc.
# Written by Scott James Remnant, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# @configure_input@
# serial 4245 ltversion.m4
# This file is part of GNU Libtool
m4_define([LT_PACKAGE_VERSION], [2.4.7])
m4_define([LT_PACKAGE_REVISION], [2.4.7])
AC_DEFUN([LTVERSION_VERSION],
[macro_version='2.4.7'
macro_revision='2.4.7'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])

View file

@ -1,99 +0,0 @@
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
#
# Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 Free
# Software Foundation, Inc.
# Written by Scott James Remnant, 2004.
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 5 lt~obsolete.m4
# These exist entirely to fool aclocal when bootstrapping libtool.
#
# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
# which have later been changed to m4_define as they aren't part of the
# exported API, or moved to Autoconf or Automake where they belong.
#
# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
# using a macro with the same name in our local m4/libtool.m4 it'll
# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
# and doesn't know about Autoconf macros at all.)
#
# So we provide this file, which has a silly filename so it's always
# included after everything else. This provides aclocal with the
# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
# because those macros already exist, or will be overwritten later.
# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
#
# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
# Yes, that means every name once taken will need to remain here until
# we give up compatibility with versions before 1.7, at which point
# we need to keep only those names which we still refer to.
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])

View file

@ -1,45 +0,0 @@
# $Id: options.ac 7 2007-02-03 13:34:17Z gburd $
# Process user-specified options.
AC_DEFUN(AM_OPTIONS_SET, [
AC_MSG_CHECKING(if --disable-statistics option specified)
AC_ARG_ENABLE(statistics,
AS_HELP_STRING([--disable-statistics],
[Do not build statistics support.]),, enableval="yes")
db_cv_build_statistics="$enableval"
case "$enableval" in
no) AC_MSG_RESULT(yes);;
yes) AC_MSG_RESULT(no);;
esac
AC_MSG_CHECKING(if --enable-posixmutexes option specified)
AC_ARG_ENABLE(posixmutexes,
[AS_HELP_STRING([--enable-posixmutexes],
[Force use of POSIX standard mutexes.])],
[db_cv_posixmutexes="$enable_posixmutexes"], [db_cv_posixmutexes="no"])
AC_MSG_RESULT($db_cv_posixmutexes)
AC_MSG_CHECKING(if --enable-debug option specified)
AC_ARG_ENABLE(debug,
[AS_HELP_STRING([--enable-debug],
[Build a debugging version.])],
[db_cv_debug="$enable_debug"], [db_cv_debug="no"])
AC_MSG_RESULT($db_cv_debug)
AC_MSG_CHECKING(if --enable-diagnostic option specified)
AC_ARG_ENABLE(diagnostic,
[AS_HELP_STRING([--enable-diagnostic],
[Build a version with run-time diagnostics.])],
[db_cv_diagnostic="$enable_diagnostic"], [db_cv_diagnostic="no"])
AC_MSG_RESULT($db_cv_diagnostic)
AC_MSG_CHECKING(if --enable-test option specified)
AC_ARG_ENABLE(test,
[AS_HELP_STRING([--enable-test],
[Configure to run the test suite.])],
[db_cv_test="$enable_test"], [db_cv_test="no"])
AC_MSG_RESULT($db_cv_test)
])

View file

@ -1,113 +0,0 @@
# $Id: programs.ac 7 2007-02-03 13:34:17Z gburd $
# Check for programs used in building/installation.
AC_DEFUN(AM_PROGRAMS_SET, [
AC_CHECK_TOOL(db_cv_path_ar, ar, missing_ar)
if test "$db_cv_path_ar" = missing_ar; then
AC_MSG_ERROR([No ar utility found.])
fi
AC_CHECK_TOOL(db_cv_path_chmod, chmod, missing_chmod)
if test "$db_cv_path_chmod" = missing_chmod; then
AC_MSG_ERROR([No chmod utility found.])
fi
AC_CHECK_TOOL(db_cv_path_sed, sed, missing_sed)
if test "$db_cv_path_sed" = missing_sed; then
AC_MSG_ERROR([No sed utility found.])
fi
AC_CHECK_TOOL(db_cv_path_makedepend, makedepend, missing_makedepend)
if test "$db_cv_path_makedepend" = missing_makedepend; then
AC_MSG_RESULT([no])
db_cv_path_makedepend=echo
fi
AC_CHECK_TOOL(db_cv_path_splint, splint, missing_splint)
if test "$db_cv_path_splint" = missing_splint; then
AC_MSG_RESULT([no])
db_cv_path_splint=echo
fi
AC_CHECK_TOOL(db_cv_path_python, python, missing_python)
if test "$db_cv_path_python" = missing_python; then
AC_MSG_RESULT([no])
db_cv_path_python=echo
fi
AC_CHECK_TOOL(db_cv_path_grep, grep, missing_grep)
if test "$db_cv_path_grep" = missing_grep; then
AC_MSG_ERROR([No grep utility found.])
fi
AC_CHECK_TOOL(db_cv_path_awk, awk, missing_awk)
if test "$db_cv_path_awk" = missing_awk; then
AC_MSG_ERROR([No awk utility found.])
fi
AC_CHECK_TOOL(db_cv_path_cp, cp, missing_cp)
if test "$db_cv_path_cp" = missing_cp; then
AC_MSG_ERROR([No cp utility found.])
fi
if test "$db_cv_rpm" = "yes"; then
AC_CHECK_TOOL(path_ldconfig, ldconfig, missing_ldconfig)
AC_PATH_PROG(db_cv_path_ldconfig, $path_ldconfig, missing_ldconfig)
if test "$db_cv_path_ldconfig" != missing_ldconfig; then
RPM_POST_INSTALL="%post -p $db_cv_path_ldconfig"
RPM_POST_UNINSTALL="%postun -p $db_cv_path_ldconfig"
fi
fi
AC_CHECK_TOOL(db_cv_path_ln, ln, missing_ln)
if test "$db_cv_path_ln" = missing_ln; then
AC_MSG_ERROR([No ln utility found.])
fi
AC_CHECK_TOOL(db_cv_path_mkdir, mkdir, missing_mkdir)
if test "$db_cv_path_mkdir" = missing_mkdir; then
AC_MSG_ERROR([No mkdir utility found.])
fi
# We need a complete path for ranlib, because it doesn't exist on some
# architectures because the ar utility packages the library itself.
AC_CHECK_TOOL(path_ranlib, ranlib, missing_ranlib)
AC_PATH_PROG(db_cv_path_ranlib, $path_ranlib, missing_ranlib)
AC_CHECK_TOOL(db_cv_path_rm, rm, missing_rm)
if test "$db_cv_path_rm" = missing_rm; then
AC_MSG_ERROR([No rm utility found.])
fi
if test "$db_cv_rpm" = "yes"; then
AC_CHECK_TOOL(db_cv_path_rpm, rpm, missing_rpm)
if test "$db_cv_path_rpm" = missing_rpm; then
AC_MSG_ERROR([No rpm utility found.])
fi
fi
# We need a complete path for sh, because some implementations of make
# get upset if SHELL is set to just the command name.
AC_CHECK_TOOL(path_sh, sh, missing_sh)
AC_PATH_PROG(db_cv_path_sh, $path_sh, missing_sh)
if test "$db_cv_path_sh" = missing_sh; then
AC_MSG_ERROR([No sh utility found.])
fi
# Don't strip the binaries if --enable-debug was specified.
if test "$db_cv_debug" = yes; then
db_cv_path_strip=debug_build_no_strip
else
AC_CHECK_TOOL(path_strip, strip, missing_strip)
AC_PATH_PROG(db_cv_path_strip, $path_strip, missing_strip)
fi
if test "$db_cv_test" = "yes"; then
AC_CHECK_TOOL(db_cv_path_kill, kill, missing_kill)
if test "$db_cv_path_kill" = missing_kill; then
AC_MSG_ERROR([No kill utility found.])
fi
fi
])

View file

@ -1,47 +0,0 @@
# $Id: readline.ac 7 2007-02-03 13:34:17Z gburd $
# Find a readline compatible library.
AC_DEFUN([VL_LIB_READLINE], [
AC_CACHE_CHECK([for a readline compatible library],
vl_cv_lib_readline, [
ORIG_LIBS="$LIBS"
for readline_lib in readline edit editline; do
for termcap_lib in "" termcap curses ncurses; do
if test -z "$termcap_lib"; then
TRY_LIB="-l$readline_lib"
else
TRY_LIB="-l$readline_lib -l$termcap_lib"
fi
LIBS="$ORIG_LIBS $TRY_LIB"
AC_TRY_LINK_FUNC(readline, vl_cv_lib_readline="$TRY_LIB")
if test -n "$vl_cv_lib_readline"; then
break
fi
done
if test -n "$vl_cv_lib_readline"; then
break
fi
done
if test -z "$vl_cv_lib_readline"; then
vl_cv_lib_readline="no"
LIBS="$ORIG_LIBS"
fi
])
if test "$vl_cv_lib_readline" != "no"; then
AC_DEFINE(HAVE_LIBREADLINE, 1,
[Define if you have a readline compatible library])
AC_CHECK_HEADERS(readline.h readline/readline.h)
AC_CACHE_CHECK([whether readline supports history],
vl_cv_lib_readline_history, [
vl_cv_lib_readline_history="no"
AC_TRY_LINK_FUNC(add_history, vl_cv_lib_readline_history="yes")
])
if test "$vl_cv_lib_readline_history" = "yes"; then
AC_DEFINE(HAVE_READLINE_HISTORY, 1,
[Define if your readline library has \`add_history'])
AC_CHECK_HEADERS(history.h readline/history.h)
fi
fi
])dnl

View file

@ -1,75 +0,0 @@
# $Id$
# Determine shared object suffixes.
#
# Our method is to use the libtool variable $library_names_spec,
# set by using LT_INIT. This variable is a snippet of shell
# defined in terms of $versuffix, $release, $libname and $module
# We want to eval it and grab the suffix used for shared objects.
# By setting $module to yes/no, we obtain the suffixes
# used to create dlloadable, or java loadable modules.
# On many (*nix) systems, these all evaluate to .so, but there
# are some notable exceptions.
# Before calling this macro, libtool must have been configured.
# This macro is used internally to discover the suffix for the current
# settings of $module. The result is stored in $_SOSUFFIX.
AC_DEFUN(_SOSUFFIX_INTERNAL, [
versuffix=""
release=""
libname=libfoo
eval _SOSUFFIX=\"$shrext_cmds\"
if test "$_SOSUFFIX" = "" ; then
_SOSUFFIX=".so"
if test "$enable_shared" != "yes"; then
if test "$_SOSUFFIX_MESSAGE" = ""; then
_SOSUFFIX_MESSAGE=yes
AC_MSG_WARN([libtool may not know about this architecture.])
AC_MSG_WARN([assuming $_SOSUFFIX suffix for dynamic libraries.])
fi
fi
fi
])
# SOSUFFIX_CONFIG will set the variable SOSUFFIX to be the
# shared library extension used for general linking, not dlopen.
AC_DEFUN(SOSUFFIX_CONFIG, [
AC_MSG_CHECKING([SOSUFFIX from libtool])
module=no
_SOSUFFIX_INTERNAL
SOSUFFIX=$_SOSUFFIX
AC_MSG_RESULT($SOSUFFIX)
AC_SUBST(SOSUFFIX)
])
# MODSUFFIX_CONFIG will set the variable MODSUFFIX to be the
# shared library extension used for dlopen'ed modules.
# To discover this, we set $module, simulating libtool's -module option.
AC_DEFUN(MODSUFFIX_CONFIG, [
AC_MSG_CHECKING([MODSUFFIX from libtool])
module=yes
_SOSUFFIX_INTERNAL
MODSUFFIX=$_SOSUFFIX
AC_MSG_RESULT($MODSUFFIX)
AC_SUBST(MODSUFFIX)
])
# JMODSUFFIX_CONFIG will set the variable JMODSUFFIX to be the
# shared library extension used JNI modules opened by Java.
# To discover this, we set $jnimodule, simulating libtool's -shrext option.
##########################################################################
# Robert Boehne: Not much point in this macro any more because apparently
# Darwin is the only OS that wants or needs the .jnilib extension.
##########################################################################
AC_DEFUN(JMODSUFFIX_CONFIG, [
AC_MSG_CHECKING([JMODSUFFIX from libtool])
module=yes
_SOSUFFIX_INTERNAL
if test `uname` = "Darwin"; then
JMODSUFFIX=".jnilib"
else
JMODSUFFIX=$_SOSUFFIX
fi
AC_MSG_RESULT($JMODSUFFIX)
AC_SUBST(JMODSUFFIX)
])

128
dist/aclocal/tcl.m4 vendored
View file

@ -1,128 +0,0 @@
# $Id: tcl.ac 7 2007-02-03 13:34:17Z gburd $
# The SC_* macros in this file are from the unix/tcl.m4 files in the Tcl
# 8.3.0 distribution, with some minor changes. For this reason, license
# terms for the Berkeley DB distribution dist/aclocal/tcl.m4 file are as
# follows (copied from the license.terms file in the Tcl 8.3 distribution):
#
# This software is copyrighted by the Regents of the University of
# California, Sun Microsystems, Inc., Scriptics Corporation,
# and other parties. The following terms apply to all files associated
# with the software unless explicitly disclaimed in individual files.
#
# The authors hereby grant permission to use, copy, modify, distribute,
# and license this software and its documentation for any purpose, provided
# that existing copyright notices are retained in all copies and that this
# notice is included verbatim in any distributions. No written agreement,
# license, or royalty fee is required for any of the authorized uses.
# Modifications to this software may be copyrighted by their authors
# and need not follow the licensing terms described here, provided that
# the new terms are clearly indicated on the first page of each file where
# they apply.
#
# IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
# FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
# ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
# DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE
# IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
# NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
# MODIFICATIONS.
#
# GOVERNMENT USE: If you are acquiring this software on behalf of the
# U.S. government, the Government shall have only "Restricted Rights"
# in the software and related documentation as defined in the Federal
# Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
# are acquiring the software on behalf of the Department of Defense, the
# software shall be classified as "Commercial Computer Software" and the
# Government shall have only "Restricted Rights" as defined in Clause
# 252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the
# authors grant the U.S. Government and others acting in its behalf
# permission to use and distribute the software in accordance with the
# terms specified in this license.
AC_DEFUN(SC_PATH_TCLCONFIG, [
AC_CACHE_VAL(ac_cv_c_tclconfig,[
# First check to see if --with-tclconfig was specified.
if test x"${with_tclconfig}" != x; then
if test -f "${with_tclconfig}/tclConfig.sh" ; then
ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
else
AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh])
fi
fi
# check in a few common install locations
if test x"${ac_cv_c_tclconfig}" = x ; then
for i in `ls -d /usr/local/lib 2>/dev/null` ; do
if test -f "$i/tclConfig.sh" ; then
ac_cv_c_tclconfig=`(cd $i; pwd)`
break
fi
done
fi
])
if test x"${ac_cv_c_tclconfig}" = x ; then
TCL_BIN_DIR="# no Tcl configs found"
AC_MSG_ERROR(can't find Tcl configuration definitions)
else
TCL_BIN_DIR=${ac_cv_c_tclconfig}
fi
AC_SUBST(TCL_BIN_DIR)
])
AC_DEFUN(SC_LOAD_TCLCONFIG, [
AC_MSG_CHECKING([for existence of $TCL_BIN_DIR/tclConfig.sh])
if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then
AC_MSG_RESULT([loading])
. $TCL_BIN_DIR/tclConfig.sh
else
AC_MSG_RESULT([file not found])
fi
# DBSQL requires at least version 8.4.
if test ${TCL_MAJOR_VERSION} -lt 8 \
-o ${TCL_MAJOR_VERSION} -eq 8 -a ${TCL_MINOR_VERSION} -lt 4; then
AC_MSG_ERROR([Berkeley DB requires Tcl version 8.4 or better.])
fi
if test x"$TCL_INCLUDE_SPEC" != x; then
TCL_CFLAGS="$TCL_INCLUDE_SPEC"
fi
AC_SUBST(TCL_LD_FLAGS)
AC_SUBST(TCL_LIBS)
AC_SUBST(TCL_LIB_SPEC)
])
# Optional Tcl API.
AC_DEFUN(AM_TCL_LOAD, [
if test "$db_cv_tcl" = "yes"; then
if test `$LIBTOOL_PROG --config | grep build_libtool_libs | grep no` 2>/dev/null; then
AC_MSG_ERROR([Tcl requires shared libraries])
fi
SC_PATH_TCLCONFIG
SC_LOAD_TCLCONFIG
if test x"$TCL_INCLUDE_SPEC" != x && test -f "$TCL_INCLUDE_SPEC/tcl.h"; then
TCL_CFLAGS="${TCL_CFLAGS} -I$TCL_INCLUDE_SPEC"
fi
INSTALL_LIBS="${INSTALL_LIBS} \$(libtso_target)"
TCL_TCLSH="${TCL_PREFIX}/bin/tclsh${TCL_VERSION}"
AC_SUBST(TCL_SRC_DIR)
AC_SUBST(TCL_LIB_FILE)
AC_SUBST(TCL_CFLAGS)
AC_SUBST(TCL_TCLSH)
fi])

218
dist/aclocal/types.m4 vendored
View file

@ -1,218 +0,0 @@
# $Id$
# Check the sizes we know about, and see if any of them match what's needed.
#
# Prefer ints to anything else, because read, write and others historically
# returned an int.
AC_DEFUN(AM_SEARCH_USIZES, [
case "$3" in
"$ac_cv_sizeof_unsigned_int")
$1="typedef unsigned int $2;";;
"$ac_cv_sizeof_unsigned_char")
$1="typedef unsigned char $2;";;
"$ac_cv_sizeof_unsigned_short")
$1="typedef unsigned short $2;";;
"$ac_cv_sizeof_unsigned_long")
$1="typedef unsigned long $2;";;
"$ac_cv_sizeof_unsigned_long_long")
$1="typedef unsigned long long $2;";;
*)
if test "$4" != "notfatal"; then
AC_MSG_ERROR([No unsigned $3-byte integral type])
fi;;
esac])
AC_DEFUN(AM_SEARCH_SSIZES, [
case "$3" in
"$ac_cv_sizeof_int")
$1="typedef int $2;";;
"$ac_cv_sizeof_char")
$1="typedef char $2;";;
"$ac_cv_sizeof_short")
$1="typedef short $2;";;
"$ac_cv_sizeof_long")
$1="typedef long $2;";;
"$ac_cv_sizeof_long_long")
$1="typedef long long $2;";;
*)
if test "$4" != "notfatal"; then
AC_MSG_ERROR([No signed $3-byte integral type])
fi;;
esac])
# Check for the standard system types.
AC_DEFUN(AM_TYPES, [
# db.h includes <sys/types.h> and <stdio.h>, not the other default includes
# autoconf usually includes. For that reason, we specify a set of includes
# for all type checking tests. [#5060]
#
# C99 says types should be in <stdint.h>; include <stdint.h> if it exists.
#
# Some systems have types in <stddef.h>; include <stddef.h> if it exists.
#
# IBM's OS/390 and z/OS releases have types in <inttypes.h> not also found
# in <sys/types.h>; include <inttypes.h> if it exists.
db_includes="#include <sys/types.h>"
AC_SUBST(inttypes_h_decl)
AC_CHECK_HEADER(inttypes.h, [
db_includes="$db_includes
#include <inttypes.h>"
inttypes_h_decl="#include <inttypes.h>"])
# IRIX has stdint.h that is only available when using c99 (i.e. __c99
# is defined). Problem with having it in a public header is that a c++
# compiler cannot #include <db.h> if db.h #includes stdint.h, so we
# need to check that stdint.h is available for all cases. Also the
# IRIX compiler does not exit with a non-zero exit code when it sees
# #error, so we actually need to use the header for the compiler to fail.
AC_SUBST(stdint_h_decl)
AC_MSG_CHECKING(for stdint.h)
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <stdint.h>
int main() {
uint_least8_t x=0;
return x;
}]])],[AC_MSG_RESULT(yes)
if test "$db_cv_cxx" = "yes"; then
AC_MSG_CHECKING([if stdint.h can be used by C++])
AC_LANG_PUSH(C++)
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <stdint.h>
int main() {
uint_least8_t x=0;
return x;
}]])],[AC_MSG_RESULT(yes)
stdint_h_decl="#include <stdint.h>"
db_includes="$db_includes
#include <stdint.h>"
],[AC_MSG_RESULT(no)
stdint_h_decl="#ifndef __cplusplus
#include <stdint.h>
#endif"
db_includes="$db_includes
#ifndef __cplusplus
#include <stdint.h>
#endif"
])
AC_LANG_POP
else
stdint_h_decl="#include <stdint.h>"
db_includes="$db_includes
#include <stdint.h>"
fi],[AC_MSG_RESULT(no)])
AC_SUBST(stddef_h_decl)
AC_CHECK_HEADER(stddef.h, [
db_includes="$db_includes
#include <stddef.h>"
stddef_h_decl="#include <stddef.h>"])
AC_SUBST(unistd_h_decl)
AC_CHECK_HEADER(unistd.h, [
db_includes="$db_includes
#include <unistd.h>"
unistd_h_decl="#include <unistd.h>"])
db_includes="$db_includes
#include <stdio.h>"
# We need to know the sizes of various objects on this system.
AC_CHECK_SIZEOF(char,, $db_includes)
AC_CHECK_SIZEOF(unsigned char,, $db_includes)
AC_CHECK_SIZEOF(short,, $db_includes)
AC_CHECK_SIZEOF(unsigned short,, $db_includes)
AC_CHECK_SIZEOF(int,, $db_includes)
AC_CHECK_SIZEOF(unsigned int,, $db_includes)
AC_CHECK_SIZEOF(long,, $db_includes)
AC_CHECK_SIZEOF(unsigned long,, $db_includes)
AC_CHECK_SIZEOF(long long,, $db_includes)
AC_CHECK_SIZEOF(unsigned long long,, $db_includes)
AC_CHECK_SIZEOF(char *,, $db_includes)
AC_CHECK_SIZEOF(long double,, $db_includes)
# We look for u_char, u_short, u_int, u_long -- if we can't find them,
# we create our own.
AC_SUBST(u_char_decl)
AC_CHECK_TYPE(u_char,,
[u_char_decl="typedef unsigned char u_char;"], $db_includes)
AC_SUBST(u_short_decl)
AC_CHECK_TYPE(u_short,,
[u_short_decl="typedef unsigned short u_short;"], $db_includes)
AC_SUBST(u_int_decl)
AC_CHECK_TYPE(u_int,,
[u_int_decl="typedef unsigned int u_int;"], $db_includes)
AC_SUBST(u_long_decl)
AC_CHECK_TYPE(u_long,,
[u_long_decl="typedef unsigned long u_long;"], $db_includes)
# We look for fixed-size variants of u_char, u_short, u_int, u_long as well.
AC_SUBST(u_int8_decl)
AC_CHECK_TYPE(u_int8_t,,
[AM_SEARCH_USIZES(u_int8_decl, u_int8_t, 1)], $db_includes)
AC_SUBST(u_int16_decl)
AC_CHECK_TYPE(u_int16_t,,
[AM_SEARCH_USIZES(u_int16_decl, u_int16_t, 2)], $db_includes)
AC_SUBST(int16_decl)
AC_CHECK_TYPE(int16_t,,
[AM_SEARCH_SSIZES(int16_decl, int16_t, 2)], $db_includes)
AC_SUBST(u_int32_decl)
AC_CHECK_TYPE(u_int32_t,,
[AM_SEARCH_USIZES(u_int32_decl, u_int32_t, 4)], $db_includes)
AC_SUBST(int32_decl)
AC_CHECK_TYPE(int32_t,,
[AM_SEARCH_SSIZES(int32_decl, int32_t, 4)], $db_includes)
AC_SUBST(u_int64_decl)
AC_CHECK_TYPE(u_int64_t,,
[AM_SEARCH_USIZES(u_int64_decl, u_int64_t, 8, notfatal)], $db_includes)
AC_SUBST(int64_decl)
AC_CHECK_TYPE(int64_t,,
[AM_SEARCH_SSIZES(int64_decl, int64_t, 8, notfatal)], $db_includes)
AC_SUBST(long_double_decl)
AC_CHECK_TYPE(long double,
[long_double_decl="typedef long double long_double_t;"],
[long_double_decl="typedef long double long_double_t;"], $db_includes)
# No currently autoconf'd systems lack FILE, off_t pid_t, size_t, time_t.
#
# We require them, we don't try to substitute our own if we can't find them.
AC_SUBST(FILE_t_decl)
AC_CHECK_TYPE(FILE *,, AC_MSG_ERROR([No FILE type.]), $db_includes)
AC_SUBST(off_t_decl)
AC_CHECK_TYPE(off_t,, AC_MSG_ERROR([No off_t type.]), $db_includes)
AC_SUBST(pid_t_decl)
AC_CHECK_TYPE(pid_t,, AC_MSG_ERROR([No pid_t type.]), $db_includes)
AC_SUBST(size_t_decl)
AC_CHECK_TYPE(size_t,, AC_MSG_ERROR([No size_t type.]), $db_includes)
AC_SUBST(time_t_decl)
AC_CHECK_TYPE(time_t,, AC_MSG_ERROR([No time_t type.]), $db_includes)
# Check for ssize_t -- if none exists, find a signed integral type that's
# the same size as a size_t.
AC_CHECK_SIZEOF(size_t,, $db_includes)
AC_SUBST(ssize_t_decl)
AC_CHECK_TYPE(ssize_t,,
[AM_SEARCH_SSIZES(ssize_t_decl, ssize_t, $ac_cv_sizeof_size_t)],
$db_includes)
# Check for uintmax_t -- if none exists, find the largest unsigned integral
# type available.
AC_SUBST(uintmax_t_decl)
AC_CHECK_TYPE(uintmax_t,, [AC_CHECK_TYPE(unsigned long long,
[uintmax_t_decl="typedef unsigned long long uintmax_t;"],
[uintmax_t_decl="typedef unsigned long uintmax_t;"], $db_includes)])
# Check for uintptr_t -- if none exists, find an integral type which is
# the same size as a pointer.
AC_SUBST(uintptr_t_decl)
AC_CHECK_TYPE(uintptr_t,,
[AM_SEARCH_USIZES(uintptr_t_decl, uintptr_t, $ac_cv_sizeof_char_p)])
])

1803
dist/config.guess vendored

File diff suppressed because it is too large Load diff

1895
dist/config.sub vendored

File diff suppressed because it is too large Load diff

477
dist/configure.ac vendored
View file

@ -1,477 +0,0 @@
# SkipList
#
# Process this file with autoconf to produce a configure script.
PACKAGE=skiplist
AC_INIT([SKIPLIST],[__EDIT_SKIPLIST_VERSION__],[support@skiplist.org],[skiplist-__EDIT_SKIPLIST_VERSION__])
AC_LANG(C)
AC_CONFIG_SRCDIR([../src/skiplist.c])
AC_CONFIG_HEADERS([skiplist_config.h:config.hin])
# Configure setup.
AC_CANONICAL_HOST()
AC_ARG_PROGRAM()
# Don't build in the top-level or dist directories.
AC_MSG_CHECKING(if building in the top-level or dist directories)
if [ test -d build_unix -o -d aclocal ] ; then
AC_MSG_RESULT(yes)
AC_MSG_ERROR(
[SKIPLIST should not be built in the top-level or dist directories.])
fi
AC_MSG_RESULT(no)
# Substitution variables.
AC_SUBST(ADDITIONAL_INCS)
AC_SUBST(ADDITIONAL_LANG)
AC_SUBST(ADDITIONAL_OBJS)
AC_SUBST(ADDITIONAL_PROGS)
AC_SUBST(BUILD_TARGET)
AC_SUBST(CFLAGS)
AC_SUBST(CONFIGURATION_ARGS)
AC_SUBST(CONFIGURATION_PATH)
AC_SUBST(CPPFLAGS)
AC_SUBST(CXX)
AC_SUBST(CXXFLAGS)
AC_SUBST(DEFAULT_LIB)
AC_SUBST(ENCODING)
AC_SUBST(INSTALLER)
AC_SUBST(INSTALL_LIBS)
AC_SUBST(INSTALL_TARGET)
AC_SUBST(LDFLAGS)
AC_SUBST(LIBS)
AC_SUBST(LIBSO_LIBS)
AC_SUBST(LIBTOOL)
AC_SUBST(LIBTSO_LIBS)
AC_SUBST(LIBTSO_MODSUFFIX)
AC_SUBST(LIBTSO_MODULE)
AC_SUBST(LIBXSO_LIBS)
AC_SUBST(LOAD_LIBS)
AC_SUBST(MAKEFILE_CC)
AC_SUBST(MAKEFILE_CCLINK)
AC_SUBST(MAKEFILE_CXX)
AC_SUBST(MAKEFILE_CXXLINK)
AC_SUBST(MAKEFILE_SOLINK)
AC_SUBST(MAKEFILE_XSOLINK)
AC_SUBST(OSDIR)
AC_SUBST(PATH_SEPARATOR)
AC_SUBST(POSTLINK)
AC_SUBST(REPLACEMENT_OBJS)
AC_SUBST(RPC_CLIENT_OBJS)
AC_SUBST(RPM_BUILD)
AC_SUBST(RPM_POST_INSTALL)
AC_SUBST(RPM_POST_UNINSTALL)
AC_SUBST(SOFLAGS)
AC_SUBST(o)
# RPM needs the current absolute path.
# RPM needs the list of original arguments, but we don't include the RPM
# option itself.
CONFIGURATION_PATH=${PWD-`pwd`}
CONFIGURATION_ARGS=`echo "$*" | sed -e 's/--with-rpm[[^ ]]*//'`
# Set the default installation location.
AC_PREFIX_DEFAULT(/usr/local/SKIPLIST.__EDIT_SKIPLIST_VERSION_MAJOR__.__EDIT_SKIPLIST_VERSION_MINOR__)
# Configure the version information.
AC_SUBST(SKIPLIST_VERSION_MAJOR)
SKIPLIST_VERSION_MAJOR="__EDIT_SKIPLIST_VERSION_MAJOR__"
AC_SUBST(SKIPLIST_VERSION_MINOR)
SKIPLIST_VERSION_MINOR="__EDIT_SKIPLIST_VERSION_MINOR__"
AC_SUBST(SKIPLIST_VERSION_PATCH)
SKIPLIST_VERSION_PATCH="__EDIT_SKIPLIST_VERSION_PATCH__"
AC_SUBST(SKIPLIST_VERSION_STRING)
SKIPLIST_VERSION_STRING='"__EDIT_SKIPLIST_VERSION_STRING__"'
AC_SUBST(SKIPLIST_VERSION_UNIQUE_NAME)
# Process all options before using them.
AM_OPTIONS_SET
# Set some #defines based on configuration options.
if test "$db_cv_diagnostic" = "yes"; then
AC_DEFINE(DIAGNOSTIC)
AH_TEMPLATE(DIAGNOSTIC,
[Define to 1 if you want a version with run-time diagnostic checking.])
fi
if test "$db_cv_test" = "yes"; then
AC_DEFINE(CONFIG_TEST)
AH_TEMPLATE(CONFIG_TEST,
[Define to 1 if you want to build a version for running the test suite.])
fi
# Check for programs used in building and installation.
AM_PROGRAMS_SET
AC_PROG_INSTALL
# RPM support: change the standard make and install targets
if test "$db_cv_rpm" = "yes"; then
BUILD_TARGET="rpm_build"
# Check if we are running RPM version 3 or 4.
case "`rpm --version`" in
*version\ 4*)
RPM_BUILD="rpmbuild"
echo "_topdir $CONFIGURATION_PATH" > rpm-macro-defines;;
*version\ 3*)
RPM_BUILD="rpm"
echo "topdir: $CONFIGURATION_PATH" > rpm-macro-defines;;
esac
INSTALL_TARGET="rpm_install"
else
BUILD_TARGET="library_build"
INSTALL_TARGET="library_install"
fi
# This is where we handle stuff that autoconf can't handle: compiler,
# preprocessor and load flags, libraries that the standard tests don't
# look for. The default optimization is -O. We would like to set the
# default optimization for systems using gcc to -O2, but we can't. By
# the time we know we're using gcc, it's too late to set optimization
# flags.
#
# There are additional libraries we need for some compiler/architecture
# combinations.
#
# Some architectures require DB to be compiled with special flags and/or
# libraries for threaded applications
#
# The makefile CC may be different than the CC used in config testing,
# because the makefile CC may be set to use $(LIBTOOL).
#
# XXX
# Don't override anything if it's already set from the environment.
optimize_def="-O"
case "$host_os" in
aix4.3.*|aix5*)
optimize_def="-O2"
CC=${CC-"xlc_r"}
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
LDFLAGS="$LDFLAGS -Wl,-brtl";;
bsdi3*) optimize_def="-O2"
CC=${CC-"shlicc2"}
LIBS="$LIBS -lipc";;
bsdi*) optimize_def="-O2";;
cygwin*)
optimize_def="-O2"
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE -D_REENTRANT";;
freebsd*)
optimize_def="-O2"
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
LDFLAGS="$LDFLAGS -pthread";;
gnu*|k*bsd*-gnu|linux*)
optimize_def="-O2"
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE -D_REENTRANT";;
hpux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT";;
irix*) optimize_def="-O2"
CPPFLAGS="$CPPFLAGS -D_SGI_MP_SOURCE";;
mpeix*) CPPFLAGS="$CPPFLAGS -D_POSIX_SOURCE -D_SOCKET_SOURCE"
LIBS="$LIBS -lsocket -lsvipc";;
osf*) CPPFLAGS="$CPPFLAGS -pthread";;
*qnx*) AC_DEFINE(HAVE_QNX)
AH_TEMPLATE(HAVE_QNX, [Define to 1 if building on QNX.]);;
solaris*)
CPPFLAGS="$CPPFLAGS -D_REENTRANT";;
esac
# Set CFLAGS/CXXFLAGS. We MUST set the flags before we call autoconf
# compiler configuration macros, because if we don't, they set CFLAGS
# to no optimization and -g, which isn't what we want.
if test "$db_cv_debug" = "no"; then
CFLAGS=${CFLAGS-$optimize_def}
fi
CXXFLAGS=${CXXFLAGS-"$CFLAGS"}
# If the user wants a TCL library interface setup for testing, add
# -DCONFIG_TEST to the CFLAGS value.
if test "$db_cv_test" = "yes"; then
AC_DEFINE(CONFIG_TEST)
AH_TEMPLATE(CONFIG_TEST,
[Define to 1 if you want a TCL API with test support.])
CFLAGS="$CFLAGS -DCONFIG_TEST"
CXXFLAGS="$CXXFLAGS -DCONFIG_TEST"
db_cv_build_tcl_test_objs=TCL_TEST_OBJS
else
db_cv_build_tcl_test_objs=
fi
AC_SUBST(db_cv_build_tcl_test_objs)
# If the user wants a debugging environment, add -g to the CFLAGS value.
#
# XXX
# Some compilers can't mix optimizing and debug flags. The only way to
# handle this is to specify CFLAGS in the environment before configuring.
if test "$db_cv_debug" = "yes"; then
AC_DEFINE(DEBUG)
AH_TEMPLATE(DEBUG, [Define to 1 if you want a debugging version.])
CFLAGS="$CFLAGS -g"
CXXFLAGS="$CXXFLAGS -g"
db_cv_build_type=debug
else
db_cv_build_type=release
fi
AC_SUBST(db_cv_build_type)
# The default compiler is cc (NOT gcc), the default CFLAGS is as specified
# above, NOT what is set by AC_PROG_CC, as it won't set optimization flags
# for any compiler other than gcc.
AC_PROG_CC(cc gcc)
# Checks for compiler characteristics.
AC_SUBST(DB_PROTO1)
AC_SUBST(DB_PROTO2)
# Clear __P, some other systems use it too.
DB_PROTO1="#undef __P"
if test "$ac_cv_prog_cc_c89" = "no"; then
DB_PROTO2="#define __P(protos) ()"
else
DB_PROTO2="#define __P(protos) protos"
fi
# Check for "const" and "inline" keywords.
AC_C_CONST
AC_SUBST(DB_CONST)
if test "$ac_cv_c_const" != "yes"; then
DB_CONST="#define const"
fi
AC_C_INLINE
# Because of shared library building, the ${CC} used for config tests
# may be different than the ${CC} we want to put in the Makefile.
# The latter is known as ${MAKEFILE_CC} in this script.
MAKEFILE_CC="${CC}"
MAKEFILE_CCLINK="${CC}"
MAKEFILE_CXX="nocxx"
MAKEFILE_CXXLINK="nocxx"
# See if we need the C++ compiler at all. If so, we'd like to find one that
# interoperates with the C compiler we chose. Since we prefered cc over gcc,
# we'll also prefer the vendor's compiler over g++/gcc. If we're wrong, the
# user can set CC and CXX in their environment before running configure.
#
# AC_PROG_CXX sets CXX, but it uses $CXX and $CCC (in that order) as its
# first choices.
if test "$db_cv_cxx" = "yes"; then
if test "$GCC" != "yes"; then
case "$host_os" in
aix*) AC_CHECK_TOOL(CCC, xlC_r)
LIBXSO_LIBS="-lC_r $LIBXSO_LIBS"
LIBS="-lC_r $LIBS";;
hpux*) AC_CHECK_TOOL(CCC, aCC);;
irix*) AC_CHECK_TOOL(CCC, CC);;
osf*) AC_CHECK_TOOL(CCC, cxx);;
solaris*) AC_CHECK_TOOL(CCC, CC);;
esac
fi
AC_PROG_CXX
###### WORKAROUND: SEE SR #7938
AC_PROG_CXXCPP
###############################
AC_CXX_STDHEADERS
MAKEFILE_CXX="${CXX}"
MAKEFILE_CXXLINK="${CXX}"
fi
# Do some gcc specific configuration.
AC_GCC_CONFIG1
# We need the -Kthread/-pthread flag when compiling on SCO/Caldera's UnixWare
# and OpenUNIX releases. We can't make the test until we know which compiler
# we're using.
case "$host_os" in
sysv5UnixWare*|sysv5OpenUNIX8*)
if test "$GCC" == "yes"; then
CPPFLAGS="$CPPFLAGS -pthread"
LDFLAGS="$LDFLAGS -pthread"
else
CPPFLAGS="$CPPFLAGS -Kthread"
LDFLAGS="$LDFLAGS -Kthread"
fi;;
esac
# Export our compiler preferences for the libtool configuration.
export CC CCC
CCC=CXX
# Libtool configuration.
LT_INIT
AC_SUBST([LIBTOOL_DEPS])
SOFLAGS="-rpath \$(libdir)"
LIBTOOL_PROG="${SHELL} ./libtool"
# Set SOSUFFIX and friends
SOSUFFIX_CONFIG
MODSUFFIX_CONFIG
INSTALLER="\$(LIBTOOL) --mode=install cp -p"
MAKEFILE_CC="\$(LIBTOOL) --mode=compile ${MAKEFILE_CC}"
MAKEFILE_SOLINK="\$(LIBTOOL) --mode=link ${MAKEFILE_CCLINK} -avoid-version"
MAKEFILE_CCLINK="\$(LIBTOOL) --mode=link ${MAKEFILE_CCLINK}"
MAKEFILE_CXX="\$(LIBTOOL) --mode=compile ${MAKEFILE_CXX}"
MAKEFILE_XSOLINK="\$(LIBTOOL) --mode=link ${MAKEFILE_CXXLINK} -avoid-version"
MAKEFILE_CXXLINK="\$(LIBTOOL) --mode=link ${MAKEFILE_CXXLINK}"
LIBTOOL="\$(SHELL) ./libtool"
case "$host_os" in
cygwin*)
MAKEFILE_SOLINK="$MAKEFILE_SOLINK -no-undefined"
MAKEFILE_XSOLINK="$MAKEFILE_XSOLINK -no-undefined";;
esac
# Configure for shared libraries, static libraries, or both. If both are
# configured, build the utilities and example programs with shared versions.
#
# $o is set to ".o" or ".lo", and is the file suffix used in the Makefile
# instead of .o
if test `$LIBTOOL_PROG --config |
grep build_libtool_libs | grep no` 2>/dev/null; then
enable_shared="no"
else
enable_shared="yes"
fi
if test `$LIBTOOL_PROG --config |
grep build_old_libs | grep no` 2>/dev/null; then
enable_static="no"
else
enable_static="yes"
fi
# C
if test "$enable_shared" = "no"; then
DEFAULT_LIB="\$(libskiplist_version)"
POSTLINK=": "
o=".o"
else
DEFAULT_LIB="\$(libso_target)"
POSTLINK="\$(LIBTOOL) --mode=execute true"
o=".lo"
fi
INSTALL_LIBS="$DEFAULT_LIB"
if test "$enable_static" = "yes"; then
INSTALL_LIBS="$INSTALL_LIBS \$(libdb)"
fi
# Apple's Mac OS/X had to rename shared libraries, so much for standards.
case "$host_os" in
darwin*)
LIBTSO_MODULE=""
LIBTSO_MODSUFFIX=".dylib"
;;
*)
LIBTSO_MODULE="-module"
LIBTSO_MODSUFFIX=@MODSUFFIX@
;;
esac
AM_TCL_LOAD
# You can disable pieces of functionality to save space.
# The stat code.
if test "$db_cv_build_statistics" = "yes"; then
AC_DEFINE(HAVE_STATISTICS)
AH_TEMPLATE(HAVE_STATISTICS,
[Define to 1 if building statistics support.])
fi
# Checks for include files, structures, C types.
AC_HEADER_STAT
AC_CHECK_HEADERS_ONCE([sys/time.h])
# End of obsolete code.
AC_HEADER_DIRENT
AC_CHECK_HEADERS(sys/select.h sys/time.h sys/fcntl.h)
AC_CHECK_MEMBERS([struct stat.st_blksize])
AM_TYPES
AC_CACHE_CHECK([for ANSI C exit success/failure values], db_cv_exit_defines, [
AC_COMPILE_IFELSE([AC_LANG_SOURCE(
[[#include <stdlib.h>]],
[[return (EXIT_SUCCESS);]])],
[db_cv_exit_defines=yes],[db_cv_exit_defines=no])])
if test "$db_cv_exit_defines" = "yes"; then
AC_DEFINE(HAVE_EXIT_SUCCESS)
AH_TEMPLATE(HAVE_EXIT_SUCCESS,
[Define to 1 if you have EXIT_SUCCESS/EXIT_FAILURE #defines.])
fi
# Test for various functions/libraries that the test and example programs use:
# sched_yield function
# pthreads, socket and math libraries
AC_CHECK_FUNC(sched_yield,,
AC_SEARCH_LIBS(sched_yield, rt, LOAD_LIBS="$LOAD_LIBS -lrt"))
# XXX
# We can't check for pthreads in the same way we did the test for sched_yield
# because the Solaris C library includes pthread interfaces which are not
# thread-safe. For that reason we always add -lpthread if we find a pthread
# library. Also we can't depend on any specific call existing (pthread_create,
# for example), as it may be #defined in an include file -- OSF/1 (Tru64) has
# this problem.
AC_CHECK_LIB([pthread],[main],[LOAD_LIBS="$LOAD_LIBS -lpthread"],[],[])ac_cv_lib_pthread=ac_cv_lib_pthread_main
# We use sqrt() so we need the math library -lm
AC_CHECK_LIB([m],[main],[LIBS="$LIBS -lm"],[],[])ac_cv_lib_m=ac_cv_lib_m_main
# Checks for system functions for which we have replacements.
AC_REPLACE_FUNCS(getopt memcmp memcpy memmove strdup strndup strerror)
AC_REPLACE_FUNCS(snprintf localtime_r strcasecmp strncasecmp)
AC_REPLACE_FUNCS(srand48_r lrand48_r)
# Check for system functions we use.
AC_CHECK_FUNCS(usleep)
# A/UX has a broken getopt(3).
case "$host_os" in
aux*) AC_LIBOBJ([getopt]);;
esac
# Apple's Mac OS/X complains about long doubles, make it stop.
case "$host_os" in
darwin*)
CFLAGS="$CFLAGS -Wno-long-double -no-cpp-precomp"
;;
esac
# We need to add the additional object files into the Makefile with the correct
# suffix. We can't use $LTLIBOBJS itself, because that variable has $U encoded
# in it for automake, and that's not what we want.
REPLACEMENT_OBJS=`echo "$LIB@&t@OBJS" |
sed "s,\.[[^.]]* ,$o ,g;s,\.[[^.]]*$,$o,"`
# This is necessary so that .o files in LIBOBJS are also built via
# the ANSI2KNR-filtering rules.
LIB@&t@OBJS=`echo "$LIB@&t@OBJS" |
sed 's,\.[[^.]]* ,$U&,g;s,\.[[^.]]*$,$U&,'`
LTLIBOBJS=`echo "$LIB@&t@OBJS" |
sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
AC_SUBST(LTLIBOBJS)
# Initial output file list.
CREATE_LIST="Makefile"
# MinGW needs win_db.h.
if test "$db_cv_mingw" = "yes"; then
CREATE_LIST="$CREATE_LIST
win_db.h:$srcdir/win_skiplist.in"
fi
# Create the skiplist.h file from a source file and a list of global function
# prototypes.
CREATE_LIST="$CREATE_LIST
skiplist.h:$srcdir/../src/skiplist.in"
if test "$db_cv_rpm" = "yes"; then
CREATE_LIST="$CREATE_LIST db.spec:../dist/skiplist.spec.in"
fi
AC_CONFIG_FILES($CREATE_LIST)
AC_OUTPUT

541
dist/install-sh vendored
View file

@ -1,541 +0,0 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2020-11-14.01; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# 'make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
tab=' '
nl='
'
IFS=" $tab$nl"
# Set DOITPROG to "echo" to test this script.
doit=${DOITPROG-}
doit_exec=${doit:-exec}
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_mkdir=
# Desired mode of installed file.
mode=0755
# Create dirs (including intermediate dirs) using mode 755.
# This is like GNU 'install' as of coreutils 8.32 (2020).
mkdir_umask=22
backupsuffix=
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
is_target_a_directory=possibly
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-p pass -p to $cpprog.
-s $stripprog installed files.
-S SUFFIX attempt to back up existing files, with suffix SUFFIX.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
By default, rm is invoked with -f; when overridden with RMPROG,
it's up to you to specify -f if you want it.
If -S is not specified, no backups are attempted.
Email bug reports to bug-automake@gnu.org.
Automake home page: https://www.gnu.org/software/automake/
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-p) cpprog="$cpprog -p";;
-s) stripcmd=$stripprog;;
-S) backupsuffix="$2"
shift;;
-t)
is_target_a_directory=always
dst_arg=$2
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
shift;;
-T) is_target_a_directory=never;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
# We allow the use of options -d and -T together, by making -d
# take the precedence; this is for compatibility with GNU install.
if test -n "$dir_arg"; then
if test -n "$dst_arg"; then
echo "$0: target directory not allowed when installing a directory." >&2
exit 1
fi
fi
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call 'install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
if test $# -gt 1 || test "$is_target_a_directory" = always; then
if test ! -d "$dst_arg"; then
echo "$0: $dst_arg: Is not a directory." >&2
exit 1
fi
fi
fi
if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
trap "ret=141; $do_exit" 13
trap "ret=143; $do_exit" 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names problematic for 'test' and other utilities.
case $src in
-* | [=\(\)!]) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
# Don't chown directories that already exist.
if test $dstdir_status = 0; then
chowncmd=""
fi
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# If destination is a directory, append the input filename.
if test -d "$dst"; then
if test "$is_target_a_directory" = never; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dstbase=`basename "$src"`
case $dst in
*/) dst=$dst$dstbase;;
*) dst=$dst/$dstbase;;
esac
dstdir_status=0
else
dstdir=`dirname "$dst"`
test -d "$dstdir"
dstdir_status=$?
fi
fi
case $dstdir in
*/) dstdirslash=$dstdir;;
*) dstdirslash=$dstdir/;;
esac
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
# The $RANDOM variable is not portable (e.g., dash). Use it
# here however when possible just to lower collision chance.
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap '
ret=$?
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null
exit $ret
' 0
# Because "mkdir -p" follows existing symlinks and we likely work
# directly in world-writeable /tmp, make sure that the '$tmpdir'
# directory is successfully created first before we actually test
# 'mkdir -p'.
if (umask $mkdir_umask &&
$mkdirprog $mkdir_mode "$tmpdir" &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
test_tmpdir="$tmpdir/a"
ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
fi
trap '' 0;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
[-=\(\)!]*) prefix='./';;
*) prefix='';;
esac
oIFS=$IFS
IFS=/
set -f
set fnord $dstdir
shift
set +f
IFS=$oIFS
prefixes=
for d
do
test X"$d" = X && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=${dstdirslash}_inst.$$_
rmtmp=${dstdirslash}_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask &&
{ test -z "$stripcmd" || {
# Create $dsttmp read-write so that cp doesn't create it read-only,
# which would cause strip to fail.
if test -z "$doit"; then
: >"$dsttmp" # No need to fork-exec 'touch'.
else
$doit touch "$dsttmp"
fi
}
} &&
$doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# If $backupsuffix is set, and the file being installed
# already exists, attempt a backup. Don't worry if it fails,
# e.g., if mv doesn't support -f.
if test -n "$backupsuffix" && test -f "$dst"; then
$doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null
fi
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:

11436
dist/ltmain.sh vendored

File diff suppressed because it is too large Load diff

27
dist/reconfig vendored
View file

@ -1,27 +0,0 @@
#!/bin/sh -
#
[ -d build_unix ] && {
echo 'You cannot build in the top-level directory.'
exit 1
}
[ -d aclocal ] && {
echo 'You cannot build in the dist directory.'
exit 1
}
args=""
#args="--disable-shared $args"
#args="--disable-static $args"
args="--enable-debug $args"
args="--enable-diagnostic $args"
args="--enable-test $args"
# On NixOS enable:
CFLAGS="${NIX_CFLAGS_COMPILE} -O0 -g -DDEBUG"
LDLAGS="${NIX_LDFLAGS}"
echo "env $cppflags $ldflags $libs ../dist/configure -C $args"
env $cppflags $ldflags $libs sh ../dist/configure -C $args
rm -f tags
ln -s ../dist/tags tags
mkdir -p .libs && true

4
dist/s_all vendored
View file

@ -1,4 +0,0 @@
#!/bin/sh -
sh s_perm
sh s_config

32
dist/s_config vendored
View file

@ -1,32 +0,0 @@
#!/bin/sh -x
# Build the autoconfiguration files.
trap 'rm -f aclocal.m4 ; exit 0' 0 1 2 3 13 15
. ./RELEASE
echo "autoconf: building aclocal.m4..."
cat aclocal/*.m4 > aclocal.m4
echo "autoconf: running autoheader to build config.hin..."
rm -f config.hin
autoheader --warnings=all
chmod 444 config.hin
echo "autoconf: running autoconf to build configure"
rm -f configure
autoconf
# Edit version information we couldn't pre-compute.
(echo "1,\$s/__EDIT_SKIPLIST_VERSION_MAJOR__/$SKIPLIST_VERSION_MAJOR/g" &&
echo "1,\$s/__EDIT_SKIPLIST_VERSION_MINOR__/$SKIPLIST_VERSION_MINOR/g" &&
echo "1,\$s/__EDIT_SKIPLIST_VERSION_PATCH__/$SKIPLIST_VERSION_PATCH/g" &&
echo "1,\$s/__EDIT_SKIPLIST_VERSION_STRING__/$SKIPLIST_VERSION_STRING/g" &&
echo "1,\$s/__EDIT_SKIPLIST_VERSION__/$SKIPLIST_VERSION/g" &&
echo "w" &&
echo "q") | ed -s configure
rm -rf autom4te.cache
chmod 555 configure
chmod 555 config.guess config.sub install-sh

23
dist/s_perm vendored
View file

@ -1,23 +0,0 @@
#!/bin/sh -
d=..
echo 'Updating skiplist source tree permissions...'
run()
{
#echo " $1 ($2)"
if [ -f "$d/$1" ]; then
chmod "$2" "$d/$1"
else
echo "$d/$1: no such file or directory"
exit 1
fi
}
run dist/config.guess 555
run dist/config.sub 555
run dist/configure 555
run dist/install-sh 555
run dist/s_all 555
run dist/s_config 555
run dist/s_perm 555

View file

@ -35,7 +35,7 @@
#define SKIPLIST_MAX_LAYER (64)
// #define _STL_ATOMIC (1)
#define _STL_ATOMIC (1)
#ifdef __APPLE__
#define _STL_ATOMIC (1)
#endif
@ -54,14 +54,16 @@ typedef struct _sl_node {
atm_bool is_fully_linked;
atm_bool being_modified;
atm_bool removed;
uint8_t top_layer; // 0: bottom
uint8_t top_layer; /* 0: bottom */
atm_uint16_t ref_count;
atm_uint32_t accessing_next;
} sl_node;
// *a < *b : return neg
// *a == *b : return 0
// *a > *b : return pos
/*
* *a < *b : return neg
* *a == *b : return 0
* *a > *b : return pos
*/
typedef int sl_cmp_t(sl_node *a, sl_node *b, void *aux);
typedef struct {
@ -127,4 +129,4 @@ sl_node *sl_end(sl_raw *slist);
}
#endif
#endif // SKIPLIST_H__
#endif /* SKIPLIST_H__ */

View file

@ -30,7 +30,87 @@
#include "skiplist.h"
#define __SL_DEBUG 0
#include "sldbg.h"
#if __SL_DEBUG > 0
#include <sys/types.h>
#include <assert.h>
#include <pthread.h>
#include <stdio.h>
#include <unistd.h>
#endif
#if __SL_DEBUG >= 1
#define __SLD_ASSERT(cond) assert(cond)
#define __SLD_(b) b
#elif __SL_DEBUG >= 2
#define __SLD_P(...) printf(__VA_ARGS__)
#elif __SL_DEBUG >= 3
typedef struct dbg_node {
sl_node snode;
int value;
} dbg_node_t;
inline void
__sld_rt_ins(int error_code, sl_node *node, int top_layer, int cur_layer)
{
dbg_node_t *ddd = sl_get_entry(node, dbg_node_t, snode);
printf("[INS] retry (code %d) "
"%p (top %d, cur %d) %d\n",
error_code, node, top_layer, cur_layer, ddd->value);
}
inline void
__sld_nc_ins(sl_node *node, sl_node *next_node, int top_layer, int cur_layer)
{
dbg_node_t *ddd = sl_get_entry(node, dbg_node_t, snode);
dbg_node_t *ddd_next = sl_get_entry(next_node, dbg_node_t, snode);
printf("[INS] next node changed, "
"%p %p (top %d, cur %d) %d %d\n",
node, next_node, top_layer, cur_layer, ddd->value, ddd_next->value);
}
inline void
__sld_rt_rmv(int error_code, sl_node *node, int top_layer, int cur_layer)
{
dbg_node_t *ddd = sl_get_entry(node, dbg_node_t, snode);
printf("[RMV] retry (code %d) "
"%p (top %d, cur %d) %d\n",
error_code, node, top_layer, cur_layer, ddd->value);
}
inline void
__sld_nc_rmv(sl_node *node, sl_node *next_node, int top_layer, int cur_layer)
{
dbg_node_t *ddd = sl_get_entry(node, dbg_node_t, snode);
dbg_node_t *ddd_next = sl_get_entry(next_node, dbg_node_t, snode);
printf("[RMV] next node changed, "
"%p %p (top %d, cur %d) %d %d\n",
node, next_node, top_layer, cur_layer, ddd->value, ddd_next->value);
}
inline void
__sld_bm(sl_node *node)
{
dbg_node_t *ddd = sl_get_entry(node, dbg_node_t, snode);
printf("[RMV] node is being modified %d\n", ddd->value);
}
#define __SLD_RT_INS(e, n, t, c) __sld_rt_ins(e, n, t, c)
#define __SLD_NC_INS(n, nn, t, c) __sld_nc_ins(n, nn, t, c)
#define __SLD_RT_RMV(e, n, t, c) __sld_rt_rmv(e, n, t, c)
#define __SLD_NC_RMV(n, nn, t, c) __sld_nc_rmv(n, nn, t, c)
#define __SLD_BM(n) __sld_bm(n)
#else
#define __SLD_RT_INS(e, n, t, c) ((void)0)
#define __SLD_NC_INS(n, nn, t, c) ((void)0)
#define __SLD_RT_RMV(e, n, t, c) ((void)0)
#define __SLD_NC_RMV(n, nn, t, c) ((void)0)
#define __SLD_BM(n) ((void)0)
#define __SLD_ASSERT(cond) ((void)0)
#define __SLD_P(...) ((void)0)
#define __SLD_(b) ((void)0)
#endif
#define YIELD() sched_yield()
@ -51,10 +131,13 @@ typedef uint8_t bool;
#define ATM_GET(var) (var)
#define ATM_LOAD(var, val) __atomic_load(&(var), &(val), __ATOMIC_RELAXED)
#define ATM_STORE(var, val) __atomic_store(&(var), &(val), __ATOMIC_RELAXED)
#define ATM_CAS(var, exp, val) \
__atomic_compare_exchange(&(var), &(exp), &(val), 1, __ATOMIC_RELAXED, __ATOMIC_RELAXED)
#define ATM_FETCH_ADD(var, val) __atomic_fetch_add(&(var), (val), __ATOMIC_RELAXED)
#define ATM_FETCH_SUB(var, val) __atomic_fetch_sub(&(var), (val), __ATOMIC_RELAXED)
#define ATM_CAS(var, exp, val) \
__atomic_compare_exchange(&(var), &(exp), &(val), 1, __ATOMIC_RELAXED, \
__ATOMIC_RELAXED)
#define ATM_FETCH_ADD(var, val) \
__atomic_fetch_add(&(var), (val), __ATOMIC_RELAXED)
#define ATM_FETCH_SUB(var, val) \
__atomic_fetch_sub(&(var), (val), __ATOMIC_RELAXED)
/*
* __sl_node_init --
@ -64,13 +147,14 @@ typedef uint8_t bool;
static void
__sl_node_init(sl_node *node, size_t top_layer)
{
bool bool_val = false;
if (top_layer > UINT8_MAX)
top_layer = UINT8_MAX;
__SLD_ASSERT(node->is_fully_linked == false);
__SLD_ASSERT(node->being_modified == false);
bool bool_val = false;
ATM_STORE(node->is_fully_linked, bool_val);
ATM_STORE(node->being_modified, bool_val);
ATM_STORE(node->removed, bool_val);
@ -93,6 +177,9 @@ __sl_node_init(sl_node *node, size_t top_layer)
void
sl_init(sl_raw *slist, sl_cmp_t *cmp_func)
{
size_t layer;
bool bool_val = true;
slist->cmp_func = NULL;
slist->aux = NULL;
@ -111,13 +198,11 @@ sl_init(sl_raw *slist, sl_cmp_t *cmp_func)
__sl_node_init(&slist->head, slist->max_layer);
__sl_node_init(&slist->tail, slist->max_layer);
size_t layer;
for (layer = 0; layer < slist->max_layer; ++layer) {
slist->head.next[layer] = &slist->tail;
slist->tail.next[layer] = NULL;
}
bool bool_val = true;
ATM_STORE(slist->head.is_fully_linked, bool_val);
ATM_STORE(slist->tail.is_fully_linked, bool_val);
slist->cmp_func = cmp_func;
@ -164,9 +249,10 @@ sl_free(sl_raw *slist)
void
sl_init_node(sl_node *node)
{
bool bool_false = false;
node->next = NULL;
bool bool_false = false;
ATM_STORE(node->is_fully_linked, bool_false);
ATM_STORE(node->being_modified, bool_false);
ATM_STORE(node->removed, bool_false);
@ -197,7 +283,7 @@ sl_get_size(sl_raw *slist)
* PUBLIC: sl_get_default_config __P(());
*/
sl_raw_config
sl_get_default_config()
sl_get_default_config(void)
{
sl_raw_config ret;
ret.fanout = 4;
@ -362,7 +448,8 @@ __sl_write_unlock_an(sl_node *node)
static sl_node *
__sl_fnd_next(sl_node *cur_node, size_t layer, sl_node *to_find, bool *found)
{
sl_node *next_node = NULL;
size_t i, num_nodes = 0;
sl_node *nodes[256], *temp, *next_node = NULL;
/* Turn on `accessing_next`:
* now `cur_node` is not removable from skiplist,
@ -401,14 +488,11 @@ __sl_fnd_next(sl_node *cur_node, size_t layer, sl_node *to_find, bool *found)
}
__sl_read_unlock_an(cur_node);
size_t num_nodes = 0;
sl_node *nodes[256];
while ((next_node && !__sl_valid_node(next_node)) || next_node == to_find) {
if (found && to_find == next_node)
*found = true;
sl_node *temp = next_node;
temp = next_node;
__sl_read_lock_an(temp);
{
__SLD_ASSERT(next_node);
@ -426,8 +510,8 @@ __sl_fnd_next(sl_node *cur_node, size_t layer, sl_node *to_find, bool *found)
__sl_read_unlock_an(temp);
}
for (size_t ii = 0; ii < num_nodes; ++ii) {
ATM_FETCH_SUB(nodes[ii]->ref_count, 1);
for (i = 0; i < num_nodes; ++i) {
ATM_FETCH_SUB(nodes[i]->ref_count, 1);
}
return next_node;
@ -457,7 +541,7 @@ __sl_decide_top_layer(sl_raw *slist)
size_t layer = 0;
while (layer + 1 < slist->max_layer) {
/* coin flip */
if (rand() % slist->fanout == 0) { // NOLINT(*-msc50-cpp)
if (rand() % slist->fanout == 0) { /* NOLINT(*-msc50-cpp) */
/* grow: 1/fanout probability */
layer++;
} else {
@ -502,38 +586,38 @@ __sl_valid_prev_next(sl_node *prev, sl_node *next)
static int
__sl_insert(sl_raw *slist, sl_node *node, bool no_dup)
{
int i, cmp, error_code;
size_t layer, cur_layer, top_layer, locked_layer, sl_top_layer;
bool bool_true = true;
sl_node *exp, *cur_node, *next_node, *next_node_again,
*prev[SKIPLIST_MAX_LAYER], *next[SKIPLIST_MAX_LAYER];
__SLD_(uint64_t tid; pthread_threadid_np(NULL, &tid);
size_t tid_hash = (size_t)tid % 256; (void)tid_hash;);
size_t top_layer = __sl_decide_top_layer(slist);
bool bool_true = true;
top_layer = __sl_decide_top_layer(slist);
/* init node before insertion */
__sl_node_init(node, top_layer);
__sl_write_lock_an(node);
sl_node *prev[SKIPLIST_MAX_LAYER];
sl_node *next[SKIPLIST_MAX_LAYER];
__SLD_P("%02x ins %p begin\n", (int)tid_hash, node);
insert_retry:;
int cmp, cur_layer;
size_t layer;
sl_node *cur_node = &slist->head;
cur_node = &slist->head;
ATM_FETCH_ADD(cur_node->ref_count, 1);
__SLD_(size_t nh = 0);
__SLD_(static __thread sl_node * history[1024]; (void)history);
size_t sl_top_layer = slist->top_layer;
sl_top_layer = slist->top_layer;
if (top_layer > sl_top_layer)
sl_top_layer = top_layer;
for (cur_layer = sl_top_layer; cur_layer >= 0; --cur_layer) { // NOLINT(*-narrowing-conversions)
for (cur_layer = sl_top_layer; cur_layer >= 0; --cur_layer) {
do {
__SLD_(history[nh++] = cur_node);
sl_node *next_node = __sl_next(cur_node, cur_layer);
next_node = __sl_next(cur_node, cur_layer);
if (!next_node) {
__sl_clr_flags(prev, cur_layer + 1, top_layer);
ATM_FETCH_SUB(cur_node->ref_count, 1);
@ -567,8 +651,8 @@ insert_retry:;
/* Both 'prev' and 'next' should be fully linked
before insertion, and no other thread should
not modify 'prev' at the same time. */
int error_code = 0;
size_t locked_layer = cur_layer + 1;
error_code = 0;
locked_layer = cur_layer + 1;
/* check if prev node is duplicated with upper
* layer */
@ -606,7 +690,7 @@ insert_retry:;
/* check if `cur_node->next` has been changed
* from `next_node` */
sl_node *next_node_again = __sl_next(cur_node, cur_layer);
next_node_again = __sl_next(cur_node, cur_layer);
ATM_FETCH_SUB(next_node_again->ref_count, 1);
if (next_node_again != next_node) {
__SLD_NC_INS(cur_node, next_node, top_layer, cur_layer);
@ -630,7 +714,7 @@ insert_retry:;
for (layer = 0; layer <= top_layer; ++layer) {
// `accessing_next` works as a spin-lock.
__sl_write_lock_an(prev[layer]);
sl_node *exp = next[layer];
exp = next[layer];
if (!ATM_CAS(prev[layer]->next[layer], exp, node)) {
__SLD_P("%02x ASSERT ins %p[%d] -> %p (expected %p)\n",
(int)tid_hash, prev[layer], cur_layer,
@ -652,9 +736,9 @@ insert_retry:;
ATM_FETCH_ADD(slist->num_entries, 1);
ATM_FETCH_ADD(slist->layer_entries[node->top_layer], 1);
for (int ii = slist->max_layer - 1; ii >= 0; --ii) {
if (slist->layer_entries[ii] > 0) {
slist->top_layer = ii;
for (i = slist->max_layer - 1; i >= 0; --i) {
if (slist->layer_entries[i] > 0) {
slist->top_layer = i;
break;
}
}
@ -695,11 +779,11 @@ sl_insert_nodup(sl_raw *slist, sl_node *node)
}
typedef enum {
SM = -2, // < less than (smaller)
SMEQ = -1, // <= less than or equal
EQ = 0, // == equal
GTEQ = 1, // >= greater than or equal
GT = 2 // > greater than
SM = -2, /* < less than (smaller) */
SMEQ = -1, /* <= less than or equal */
EQ = 0, /* == equal */
GTEQ = 1, /* >= greater than or equal */
GT = 2 /* > greater than */
} __sl_find_mode;
/*
@ -714,21 +798,23 @@ typedef enum {
static sl_node *
_sl_find(sl_raw *slist, sl_node *query, __sl_find_mode mode)
{
int cmp, cur_layer;
sl_node *cur_node, *next_node, *temp;
uint8_t sl_top_layer;
find_retry:;
int cmp;
int cur_layer;
sl_node *cur_node = &slist->head;
cur_node = &slist->head;
ATM_FETCH_ADD(cur_node->ref_count, 1);
__SLD_(size_t nh = 0);
__SLD_(static __thread sl_node * history[1024]; (void)history);
uint8_t sl_top_layer = slist->top_layer;
sl_top_layer = slist->top_layer;
for (cur_layer = sl_top_layer; cur_layer >= 0; --cur_layer) {
do {
__SLD_(history[nh++] = cur_node);
sl_node *next_node = __sl_next(cur_node, cur_layer);
next_node = __sl_next(cur_node, cur_layer);
if (!next_node) {
ATM_FETCH_SUB(cur_node->ref_count, 1);
YIELD();
@ -738,7 +824,7 @@ find_retry:;
if (cmp > 0) {
/* cur_node < next_node < query
=> move to next node */
sl_node *temp = cur_node;
temp = cur_node;
cur_node = next_node;
ATM_FETCH_SUB(temp->ref_count, 1);
continue;
@ -820,31 +906,30 @@ sl_find_greater_or_equal(sl_raw *slist, sl_node *query)
int
sl_erase_node_passive(sl_raw *slist, sl_node *node)
{
int i, error_code, cmp, cur_layer, top_layer, locked_layer;
bool bool_true = true, bool_false = false;
bool removed = false, is_fully_linked = false, expected = false;
bool found_node_to_erase = false;
bool node_found;
sl_node *prev[SKIPLIST_MAX_LAYER], *next[SKIPLIST_MAX_LAYER];
sl_node *cur_node, *next_node, *next_node_again, *exp;
__SLD_(uint64_t tid; pthread_threadid_np(NULL, &tid);
size_t tid_hash = (size_t)tid % 256; (void)tid_hash;);
int top_layer = node->top_layer;
bool bool_true = true, bool_false = false;
bool removed = false;
bool is_fully_linked = false;
top_layer = node->top_layer;
ATM_LOAD(node->removed, removed);
if (removed) {
// already removed
return -1;
}
if (removed)
return -1; /* already removed */
sl_node *prev[SKIPLIST_MAX_LAYER];
sl_node *next[SKIPLIST_MAX_LAYER];
bool expected = false;
if (!ATM_CAS(node->being_modified, expected, bool_true)) {
// already being modified ... cannot work on this node for now.
/* already being modified ... cannot work on this node for now */
__SLD_BM(node);
return -2;
}
// set removed flag first, so that reader cannot read this node.
/* set removed flag first, so that reader cannot read this node */
ATM_STORE(node->removed, bool_true);
__SLD_P("%02x rmv %p begin\n", (int)tid_hash, node);
@ -852,29 +937,27 @@ sl_erase_node_passive(sl_raw *slist, sl_node *node)
erase_node_retry:
ATM_LOAD(node->is_fully_linked, is_fully_linked);
if (!is_fully_linked) {
// already unlinked ... remove is done by other thread
/* already unlinked ... remove is done by other thread */
ATM_STORE(node->removed, bool_false);
ATM_STORE(node->being_modified, bool_false);
return -3;
}
int cmp;
bool found_node_to_erase = false;
found_node_to_erase = false;
(void)found_node_to_erase;
sl_node *cur_node = &slist->head;
cur_node = &slist->head;
ATM_FETCH_ADD(cur_node->ref_count, 1);
__SLD_(size_t nh = 0);
__SLD_(static __thread sl_node * history[1024]; (void)history);
int cur_layer = slist->top_layer;
cur_layer = slist->top_layer;
for (; cur_layer >= 0; --cur_layer) {
do {
__SLD_(history[nh++] = cur_node);
bool node_found = false;
sl_node *next_node = __sl_fnd_next(cur_node, cur_layer, node,
&node_found);
node_found = false;
next_node = __sl_fnd_next(cur_node, cur_layer, node, &node_found);
if (!next_node) {
__sl_clr_flags(prev, cur_layer + 1, top_layer);
ATM_FETCH_SUB(cur_node->ref_count, 1);
@ -882,19 +965,18 @@ erase_node_retry:
goto erase_node_retry;
}
// Note: unlike insert(), we should find exact position
// of `node`.
/* unlike insert(), we should find exact position of `node` */
cmp = __sl_cmp(slist, node, next_node);
if (cmp > 0 || (cur_layer <= top_layer && !node_found)) {
// cur_node <= next_node < node
// => move to next node
/* cur_node <= next_node < node
=> move to next node */
sl_node *temp = cur_node;
cur_node = next_node;
__SLD_(if (cmp > 0) {
int cmp2 = __sl_cmp(slist, cur_node, node);
if (cmp2 > 0) {
// node < cur_node <= next_node:
// not found.
/* node < cur_node <= next_node:
not found. */
__sl_clr_flags(prev, cur_layer + 1, top_layer);
ATM_FETCH_SUB(temp->ref_count, 1);
ATM_FETCH_SUB(next_node->ref_count, 1);
@ -904,28 +986,26 @@ erase_node_retry:
ATM_FETCH_SUB(temp->ref_count, 1);
continue;
} else {
// otherwise: cur_node <= node <= next_node
/* otherwise: cur_node <= node <= next_node */
ATM_FETCH_SUB(next_node->ref_count, 1);
}
if (cur_layer <= top_layer) {
prev[cur_layer] = cur_node;
// note: 'next_node' and 'node' should not be
// the same,
// as 'removed' flag is already set.
/* 'next_node' and 'node' should not be
the same, as 'removed' flag is already set. */
__SLD_ASSERT(next_node != node);
next[cur_layer] = next_node;
// check if prev node duplicates with upper
// layer
int error_code = 0;
int locked_layer = cur_layer + 1;
/* check if prev node duplicates with upper layer */
error_code = 0;
locked_layer = cur_layer + 1;
if (cur_layer < top_layer &&
prev[cur_layer] == prev[cur_layer + 1]) {
// duplicate with upper layer
// => which means that 'being_modified'
// flag is already true
// => do nothing.
/* duplicate with upper layer
=> which means that 'being_modified'
flag is already true
=> do nothing. */
} else {
expected = false;
if (ATM_CAS(prev[cur_layer]->being_modified, expected,
@ -949,12 +1029,11 @@ erase_node_retry:
goto erase_node_retry;
}
sl_node *next_node_again = __sl_fnd_next(cur_node, cur_layer,
node, NULL);
next_node_again = __sl_fnd_next(cur_node, cur_layer, node,
NULL);
ATM_FETCH_SUB(next_node_again->ref_count, 1);
if (next_node_again != next[cur_layer]) {
// `next` pointer has been changed,
// retry.
/* `next` pointer has been changed, retry */
__SLD_NC_RMV(cur_node, next[cur_layer], top_layer,
cur_layer);
__sl_clr_flags(prev, cur_layer, top_layer);
@ -965,24 +1044,23 @@ erase_node_retry:
}
if (cur_layer == 0)
found_node_to_erase = true;
// go down
/* go down */
break;
} while (cur_node != &slist->tail);
}
// Not exist in the skiplist, should not happen.
/* not exist in the skiplist, should not happen */
__SLD_ASSERT(found_node_to_erase);
// bottom layer => removal succeeded.
// mark this node unlinked
/* bottom layer => removal succeeded, mark this node unlinked */
__sl_write_lock_an(node);
{
ATM_STORE(node->is_fully_linked, bool_false);
}
__sl_write_unlock_an(node);
// change prev nodes' next pointer from 0 ~ top_layer
/* change prev nodes' next pointer from 0 ~ top_layer */
for (cur_layer = 0; cur_layer <= top_layer; ++cur_layer) {
__sl_write_lock_an(prev[cur_layer]);
sl_node *exp = node;
exp = node;
__SLD_ASSERT(exp != next[cur_layer]);
__SLD_ASSERT(next[cur_layer]->is_fully_linked);
if (!ATM_CAS(prev[cur_layer]->next[cur_layer], exp, next[cur_layer])) {
@ -1001,14 +1079,14 @@ erase_node_retry:
ATM_FETCH_SUB(slist->num_entries, 1);
ATM_FETCH_SUB(slist->layer_entries[node->top_layer], 1);
for (int ii = slist->max_layer - 1; ii >= 0; --ii) {
if (slist->layer_entries[ii] > 0) {
slist->top_layer = ii;
for (i = slist->max_layer - 1; i >= 0; --i) {
if (slist->layer_entries[i] > 0) {
slist->top_layer = i;
break;
}
}
// modification is done for all layers
/* modification is done for all layers */
__sl_clr_flags(prev, 0, top_layer);
ATM_FETCH_SUB(cur_node->ref_count, 1);
@ -1032,18 +1110,17 @@ sl_erase_node(sl_raw *slist, sl_node *node)
int
sl_erase(sl_raw *slist, sl_node *query)
{
sl_node *found = sl_find(slist, query);
if (!found) {
/* key not found */
return -4;
}
int ret;
do {
sl_node *found = sl_find(slist, query);
if (!found)
return -4; /* key not found */
/* if ret == -2, other thread is accessing the same node
at the same time, so try again */
do
ret = sl_erase_node_passive(slist, found);
/* if ret == -2, other thread is accessing the same node
at the same time, so try again */
} while (ret == -2);
while (ret == -2);
ATM_FETCH_SUB(found->ref_count, 1);
return ret;
@ -1058,6 +1135,8 @@ sl_is_valid_node(sl_node *node)
int
sl_is_safe_to_free(sl_node *node)
{
uint16_t ref_count;
if (node->accessing_next)
return 0;
if (node->being_modified)
@ -1065,7 +1144,7 @@ sl_is_safe_to_free(sl_node *node)
if (!node->removed)
return 0;
uint16_t ref_count = 0;
ref_count = 0;
ATM_LOAD(node->ref_count, ref_count);
if (ref_count)
return 0;

View file

@ -1,24 +0,0 @@
#ifndef _SKIPLIST_H_
#define _SKIPLIST_H_
@inttypes_h_decl@
#include <stdio.h>
#endif
#if defined(__cplusplus)
extern "C" {
#endif
@DB_CONST@
@DB_PROTO1@
@DB_PROTO2@
#define SKIPLIST_VERSION_MAJOR @SKIPLIST_VERSION_MAJOR@
#define SKIPLIST_VERSION_MINOR @SKIPLIST_VERSION_MINOR@
#define SKIPLIST_VERSION_PATCH @SKIPLIST_VERSION_PATCH@
#define SKIPLIST_VERSION_STRING @SKIPLIST_VERSION_STRING@
#ifdef __cplusplus
}
#endif
#endif /* !_SKIPLIST_H_ */

View file

@ -1,117 +0,0 @@
/**
* Copyright (C) 2017-present Jung-Sang Ahn <jungsang.ahn@gmail.com>
* All rights reserved.
*
* https://github.com/greensky00
*
* Skiplist
* Version: 0.2.5
*
* 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.
*/
#pragma once
#include <assert.h>
#include <stdio.h>
#include "skiplist.h"
struct dbg_node {
skiplist_node snode;
int value;
};
#if __SL_DEBUG >= 1
#undef __SLD_ASSERT
#undef __SLD_
#define __SLD_ASSERT(cond) assert(cond)
#define __SLD_(b) b
#endif
#if __SL_DEBUG >= 2
#undef __SLD_P
#define __SLD_P(args...) printf(args)
#endif
#if __SL_DEBUG >= 3
#undef __SLD_RT_INS
#undef __SLD_NC_INS
#undef __SLD_RT_RMV
#undef __SLD_NC_RMV
#undef __SLD_BM
#define __SLD_RT_INS(e, n, t, c) __sld_rt_ins(e, n, t, c)
#define __SLD_NC_INS(n, nn, t, c) __sld_nc_ins(n, nn, t, c)
#define __SLD_RT_RMV(e, n, t, c) __sld_rt_rmv(e, n, t, c)
#define __SLD_NC_RMV(n, nn, t, c) __sld_nc_rmv(n, nn, t, c)
#define __SLD_BM(n) __sld_bm(n)
#endif
#if __SL_DEBUG >= 4
#error "unknown debugging level"
#endif
inline void
__sld_rt_ins(int error_code, skiplist_node *node, int top_layer, int cur_layer)
{
dbg_node *ddd = sl_get_entry(node, dbg_node, snode);
printf("[INS] retry (code %d) "
"%p (top %d, cur %d) %d\n",
error_code, node, top_layer, cur_layer, ddd->value);
}
inline void
__sld_nc_ins(skiplist_node *node, skiplist_node *next_node, int top_layer,
int cur_layer)
{
dbg_node *ddd = sl_get_entry(node, dbg_node, snode);
dbg_node *ddd_next = sl_get_entry(next_node, dbg_node, snode);
printf("[INS] next node changed, "
"%p %p (top %d, cur %d) %d %d\n",
node, next_node, top_layer, cur_layer, ddd->value, ddd_next->value);
}
inline void
__sld_rt_rmv(int error_code, skiplist_node *node, int top_layer, int cur_layer)
{
dbg_node *ddd = sl_get_entry(node, dbg_node, snode);
printf("[RMV] retry (code %d) "
"%p (top %d, cur %d) %d\n",
error_code, node, top_layer, cur_layer, ddd->value);
}
inline void
__sld_nc_rmv(skiplist_node *node, skiplist_node *next_node, int top_layer,
int cur_layer)
{
dbg_node *ddd = sl_get_entry(node, dbg_node, snode);
dbg_node *ddd_next = sl_get_entry(next_node, dbg_node, snode);
printf("[RMV] next node changed, "
"%p %p (top %d, cur %d) %d %d\n",
node, next_node, top_layer, cur_layer, ddd->value, ddd_next->value);
}
inline void
__sld_bm(skiplist_node *node)
{
dbg_node *ddd = sl_get_entry(node, dbg_node, snode);
printf("[RMV] node is being modified %d\n", ddd->value);
}

View file

@ -1,97 +0,0 @@
#if __SL_DEBUG > 0
#include <sys/types.h>
#include <assert.h>
#include <pthread.h>
#include <stdio.h>
#include <unistd.h>
#endif
#if __SL_DEBUG >= 1
#define __SLD_ASSERT(cond) assert(cond)
#define __SLD_(b) b
#elif __SL_DEBUG >= 2
#define __SLD_P(args...) printf(args)
#elif __SL_DEBUG >= 3
typedef struct dbg_node {
sl_node snode;
int value;
} dbg_node_t;
inline void
__sld_rt_ins(int error_code, sl_node *node, int top_layer, int cur_layer)
{
dbg_node_t *ddd = sl_get_entry(node, dbg_node_t, snode);
printf("[INS] retry (code %d) "
"%p (top %d, cur %d) %d\n",
error_code, node, top_layer, cur_layer, ddd->value);
}
inline void
__sld_nc_ins(sl_node *node, sl_node *next_node, int top_layer, int cur_layer)
{
dbg_node_t *ddd = sl_get_entry(node, dbg_node_t, snode);
dbg_node_t *ddd_next = sl_get_entry(next_node, dbg_node_t, snode);
printf("[INS] next node changed, "
"%p %p (top %d, cur %d) %d %d\n",
node, next_node, top_layer, cur_layer, ddd->value, ddd_next->value);
}
inline void
__sld_rt_rmv(int error_code, sl_node *node, int top_layer, int cur_layer)
{
dbg_node_t *ddd = sl_get_entry(node, dbg_node_t, snode);
printf("[RMV] retry (code %d) "
"%p (top %d, cur %d) %d\n",
error_code, node, top_layer, cur_layer, ddd->value);
}
inline void
__sld_nc_rmv(sl_node *node, sl_node *next_node, int top_layer, int cur_layer)
{
dbg_node_t *ddd = sl_get_entry(node, dbg_node_t, snode);
dbg_node_t *ddd_next = sl_get_entry(next_node, dbg_node_t, snode);
printf("[RMV] next node changed, "
"%p %p (top %d, cur %d) %d %d\n",
node, next_node, top_layer, cur_layer, ddd->value, ddd_next->value);
}
inline void
__sld_bm(sl_node *node)
{
dbg_node_t *ddd = sl_get_entry(node, dbg_node_t, snode);
printf("[RMV] node is being modified %d\n", ddd->value);
}
#define __SLD_RT_INS(e, n, t, c) __sld_rt_ins(e, n, t, c)
#define __SLD_NC_INS(n, nn, t, c) __sld_nc_ins(n, nn, t, c)
#define __SLD_RT_RMV(e, n, t, c) __sld_rt_rmv(e, n, t, c)
#define __SLD_NC_RMV(n, nn, t, c) __sld_nc_rmv(n, nn, t, c)
#define __SLD_BM(n) __sld_bm(n)
#else
#define __SLD_RT_INS(e, n, t, c) \
do { \
} while (0)
#define __SLD_NC_INS(n, nn, t, c) \
do { \
} while (0)
#define __SLD_RT_RMV(e, n, t, c) \
do { \
} while (0)
#define __SLD_NC_RMV(n, nn, t, c) \
do { \
} while (0)
#define __SLD_BM(n) \
do { \
} while (0)
#define __SLD_ASSERT(cond) \
do { \
} while (0)
#define __SLD_P(args...) \
do { \
} while (0)
#define __SLD_(b) \
do { \
} while (0)
#endif

File diff suppressed because it is too large Load diff

2287
tests/munit.c Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,7 @@
#include "stdio.h"
int main(int argc, char * * argv)
int
main(int argc, char **argv)
{
printf("Hello Nixers!\n");
}