From: Kay Sievers Date: Thu, 10 Mar 2016 17:20:30 +0000 (+0100) Subject: build: update build system X-Git-Url: http://git.zarvox.org/static/main.js?a=commitdiff_plain;h=4c80c4df9b6236179d3bf6b1a76b27ab26de8303;p=crbtree.git build: update build system --- diff --git a/.autom4te.cfg b/.autom4te.cfg new file mode 100644 index 0000000..e54988b --- /dev/null +++ b/.autom4te.cfg @@ -0,0 +1,3 @@ +begin-language: "Autoconf-without-aclocal-m4" +args: --cache=build/.autom4te.cache +end-language: "Autoconf-without-aclocal-m4" diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..fcd47c5 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,17 @@ +# EditorConfig configuration for base +# http://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file, utf-8 charset +[*] +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +charset = utf-8 + +# match config files, set indent to spaces with width of eight +[*.{c,h}] +indent_style = space +indent_size = 8 diff --git a/.gitignore b/.gitignore index 394b6fe..80b2be5 100644 --- a/.gitignore +++ b/.gitignore @@ -6,27 +6,24 @@ *.o *.stamp *.swp +*.tar.xz *.trs *~ -/.config.args -/.libs/ -/*.tar.xz -/Makefile -/Makefile.in -/autom4te.cache/ /aclocal.m4 -/build-aux/ -/config.h -/config.h.in +/build/ /config.log /config.status /configure -/libtool -!/m4/attributes.m4 -/src/.deps/ -/src/.dirstamp -/stamp-* +.deps/ +.dirstamp +/Makefile +/Makefile.in +/install-tree + +/src/libcrbtree.pc +/libcrbtree.so.0 + /test-api /test-basic /test-map diff --git a/COPYING b/COPYING index 8cc26a1..69713b2 100644 --- a/COPYING +++ b/COPYING @@ -1,19 +1,19 @@ LICENSE: - crbtree is free software; you can redistribute it and/or modify it + bus1 is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. - crbtree is distributed in the hope that it will be useful, but + bus1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with crbtree; If not, see . + License along with bus1; If not, see . -COPYRIGHT: - Copyright (C) 2014-2015 Red Hat, Inc. +COPYRIGHT: (ordered alphabetically) + Copyright (C) 2015-2016 Red Hat, Inc. -AUTHORS: +AUTHORS: (ordered alphabetically) David Herrmann diff --git a/Makefile.am b/Makefile.am index 83e75f6..171ab63 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,38 +1,38 @@ # ------------------------------------------------------------------------------ -# main +# autotools -ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} +SHELL = bash +ACLOCAL_AMFLAGS = -I build/m4 ${ACLOCAL_FLAGS} AM_MAKEFLAGS = --no-print-directory AUTOMAKE_OPTIONS = color-tests parallel-tests GCC_COLORS ?= 'ooh, shiny!' export GCC_COLORS -SUBDIRS = . - # remove targets if the command fails .DELETE_ON_ERROR: # keep intermediate files .SECONDARY: -# Keep the test-suite.log and Makefile around at all times +# keep the test-suite.log and Makefile around at all times .PRECIOUS: $(TEST_SUITE_LOG) Makefile +pkgincludedir=$(includedir)/org.bus1 +pkgconfiglibdir=$(libdir)/pkgconfig + +BUILT_SOURCES = CLEANFILES = $(BUILT_SOURCES) -DISTCLEANFILES = EXTRA_DIST = -BUILT_SOURCES = -lib_LTLIBRARIES = -noinst_LTLIBRARIES = -bin_PROGRAMS = -noinst_PROGRAMS = -check_PROGRAMS = -TESTS = +pkginclude_HEADERS = +pkgconfiglib_DATA = +noinst_LIBRARIES = +check_PROGRAMS = $(default_tests) +TESTS = $(default_tests) default_tests = AM_CPPFLAGS = \ - -include $(top_builddir)/config.h \ + -include $(top_builddir)/build/config.h \ -I $(top_srcdir)/src \ -I $(top_builddir)/src \ $(OUR_CPPFLAGS) @@ -41,46 +41,58 @@ AM_CFLAGS = $(OUR_CFLAGS) AM_LDFLAGS = $(OUR_LDFLAGS) # ------------------------------------------------------------------------------ -# libcrbtree-private (used for our tests, which access internal data) +# libcrbtree.a -noinst_LTLIBRARIES += \ - libcrbtree-private.la +noinst_LIBRARIES += \ + libcrbtree.a -libcrbtree_private_la_SOURCES = \ - src/crbtree.h \ - src/crbtree-private.h \ - src/crbtree.c +pkginclude_HEADERS += \ + src/org.bus1/c-rbtree.h -libcrbtree_private_la_CFLAGS = \ - $(AM_CFLAGS) +libcrbtree_a_SOURCES = \ + src/libcrbtree.sym \ + src/c-rbtree-private.h \ + src/c-rbtree.c -libcrbtree_private_la_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - -UNDEBUG +# ------------------------------------------------------------------------------ +# libcrbtree.so.0 -libcrbtree_private_la_LDFLAGS = \ - $(AM_LDFLAGS) +libcrbtree.so.0: libcrbtree.a $(top_srcdir)/src/libcrbtree.sym + $(AM_V_CCLD)$(CCLD) $(AM_CFLAGS) $(AM_LDFLAGS) \ + -shared \ + -Wl,-soname=$@ \ + -Wl,--version-script=$(top_srcdir)/src/libcrbtree.sym \ + -Wl,--whole-archive libcrbtree.a -Wl,--no-whole-archive \ + -o $@ -# ------------------------------------------------------------------------------ -# libcrbtree +CLEANFILES += \ + libcrbtree.so.0 + +all-local: libcrbtree.so.0 -lib_LTLIBRARIES += \ - libcrbtree.la +install-exec-hook: + $(MKDIR_P) $(DESTDIR)$(libdir) + cp libcrbtree.so.0 $(DESTDIR)$(libdir) + $(AM_V_LN)ln -sf libcrbtree.so.0 $(DESTDIR)$(libdir)/libcrbtree.so -libcrbtree_la_SOURCES = \ - $(libcrbtree_private_la_SOURCES) +uninstall-hook: + rm -f $(DESTDIR)$(libdir)/libcrbtree.so.0 -libcrbtree_la_CFLAGS = \ - $(AM_CFLAGS) +%.pc: %.pc.in + $(AM_V_GEN)$(SED) \ + -e 's,@includedir\@,$(includedir),g' \ + -e 's,@libdir\@,$(libdir),g' \ + -e 's,@VERSION\@,$(VERSION),g' \ + $< > $@ -libcrbtree_la_CPPFLAGS = \ - $(AM_CPPFLAGS) +pkgconfiglib_DATA += \ + src/libcrbtree.pc -libcrbtree_la_LDFLAGS = \ - $(AM_LDFLAGS) \ - -version-info $(LIBCRBTREE_CURRENT):$(LIBCRBTREE_REVISION):$(LIBCRBTREE_AGE) \ - -Wl,--version-script=$(top_srcdir)/src/libcrbtree.sym +EXTRA_DIST += \ + src/libcrbtree.pc.in +CLEANFILES += \ + src/libcrbtree.pc # ------------------------------------------------------------------------------ # test-api @@ -91,7 +103,7 @@ test_api_SOURCES = \ src/test-api.c test_api_LDADD = \ - libcrbtree.la # explicitly linked against public library + libcrbtree.so.0 # explicitly linked against public library # ------------------------------------------------------------------------------ # test-basic @@ -103,7 +115,7 @@ test_basic_SOURCES = \ src/test-basic.c test_basic_LDADD = \ - libcrbtree-private.la + libcrbtree.a # ------------------------------------------------------------------------------ # test-map @@ -115,10 +127,20 @@ test_map_SOURCES = \ src/test-map.c test_map_LDADD = \ - libcrbtree-private.la + libcrbtree.a # ------------------------------------------------------------------------------ # test suite +AM_TESTS_ENVIRONMENT = LD_LIBRARY_PATH=$(abs_builddir) check_PROGRAMS += $(default_tests) TESTS += $(default_tests) + +# ------------------------------------------------------------------------------¶ +# check "make install" directory tree + +install-tree: all + rm -rf $(abs_srcdir)/install-tree + $(MAKE) install DESTDIR=$(abs_srcdir)/install-tree + tree $(abs_srcdir)/install-tree +.PHONY: install-tree diff --git a/README b/README index b96e911..fe78e6a 100644 --- a/README +++ b/README @@ -1,17 +1,17 @@ crbtree - Standalone Red-Black Tree Implementation in Standard ISO-C11 DETAILS: - https://github.com/dvdhrm/crbtree + https://github.com/bus1/crbtree BUG REPORTS: - https://github.com/dvdhrm/crbtree/issues + https://github.com/bus1/crbtree/issues GIT: - git@github.com:dvdhrm/crbtree.git - https://github.com/dvdhrm/crbtree.git + git@github.com:bus1/crbtree.git + https://github.com/bus1/crbtree.git GITWEB: - https://github.com/dvdhrm/crbtree + https://github.com/bus1/crbtree LICENSE: LGPLv2.1+ (LICENSE.LGPL2.1) diff --git a/autogen.sh b/autogen.sh index d969f8d..704bd2c 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,24 +1,29 @@ -#!/bin/sh - +#!/bin/bash set -e oldpwd=$(pwd) topdir=$(dirname $0) -cd $topdir +cd $topdir +mkdir -p ./build/m4/ autoreconf --force --install --symlink +cd $oldpwd -if [ -f "$topdir/.config.args" ]; then - args="$args $(cat $topdir/.config.args)" +# https://wiki.debian.org/Multiarch/Tuples +if [[ "$HOSTTYPE" == "x86_64" ]]; then + ARCHITECTURE_TUPLE=x86_64-linux-gnu +elif [[ "$HOSTTYPE" == "arm" ]]; then + ARCHITECTURE_TUPLE=arm-linux-gnueabihf +else + echo "Unknown HOSTTYPE" + exit 1 fi -cd $oldpwd - -if [ "x$1" = "xc" ]; then - $topdir/configure --enable-debug $args +if [[ "$1" == "b" ]]; then + $topdir/configure --prefix=/usr --libdir=/usr/lib/$ARCHITECTURE_TUPLE make clean -elif [ "x$1" = "xl" ]; then - $topdir/configure CC=clang $args +elif [[ "$1" = "c" ]]; then + $topdir/configure make clean else echo @@ -26,6 +31,6 @@ else echo "Initialized build system. For a common configuration please run:" echo "----------------------------------------------------------------" echo - echo "$topdir/configure $args" + echo "$topdir/configure" echo fi diff --git a/configure.ac b/configure.ac index 02acd7e..24a453a 100644 --- a/configure.ac +++ b/configure.ac @@ -2,24 +2,19 @@ # versions AC_PREREQ([2.64]) - AC_INIT([crbtree], [1], - [http://www.github.com/dvdhrm/crbtree], + [http://www.github.com/bus1/crbtree], [crbtree], - [http://www.github.com/dvdhrm/crbtree]) - -AC_SUBST([LIBCRBTREE_CURRENT], 0) -AC_SUBST([LIBCRBTREE_AGE], 0) -AC_SUBST([LIBCRBTREE_REVISION], 1) + [http://www.github.com/bus1/crbtree]) # ------------------------------------------------------------------------------ -# main +# autotools -AC_CONFIG_SRCDIR([src/crbtree.h]) -AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_AUX_DIR([build-aux]) +AC_CONFIG_SRCDIR([src/org.bus1/c-rbtree.h]) +AC_CONFIG_MACRO_DIR([build/m4]) +AC_CONFIG_HEADERS([build/config.h]) +AC_CONFIG_AUX_DIR([build/build-aux]) AC_USE_SYSTEM_EXTENSIONS AC_SYS_LARGEFILE @@ -28,38 +23,39 @@ AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax no-di AM_SILENT_RULES([yes]) AC_CANONICAL_HOST AC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [Canonical host string.]) - -AC_PROG_MKDIR_P -AC_PROG_LN_S -AC_PROG_SED -AC_PROG_GREP -AC_PROG_AWK AC_PROG_CC_C99 - -LT_PREREQ(2.2) -LT_INIT([disable-static]) - -AC_PATH_PROG([M4], [m4]) -AC_PATH_PROG([XSLTPROC], [xsltproc]) +AC_PROG_RANLIB +AC_PROG_SED AS_IF([! ln --relative --help > /dev/null 2>&1], [AC_MSG_ERROR([*** ln doesn't support --relative ***])]) - -# ------------------------------------------------------------------------------ -# arguments - -AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [enable debug options])) +m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config]) # ------------------------------------------------------------------------------ # toolchain -CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\ +OUR_CFLAGS=${OUR_CFLAGS:-$(echo \ + -g \ + -Og \ -pipe \ + -ftrapv \ + -ffast-math \ + -fno-common \ + -fdiagnostics-show-option \ + -fno-strict-aliasing \ + -fvisibility=hidden \ + -ffunction-sections \ + -fdata-sections \ + -fstack-protector \ + -fstack-protector-strong \ + -fPIE \ + --param=ssp-buffer-size=4 \ -Wall \ -Wextra \ -Wno-inline \ -Wundef \ - "-Wformat=2 -Wformat-security -Wformat-nonliteral" \ - -Wlogical-op \ + -Wformat=2 \ + -Wformat-security \ + -Wformat-nonliteral \ -Wsign-compare \ -Wmissing-include-dirs \ -Wold-style-definition \ @@ -67,7 +63,6 @@ CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\ -Winit-self \ -Wdeclaration-after-statement \ -Wfloat-equal \ - -Wsuggest-attribute=noreturn \ -Wmissing-prototypes \ -Wstrict-prototypes \ -Wredundant-decls \ @@ -84,54 +79,24 @@ CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\ -Wno-unused-result \ -Werror=overflow \ -Wdate-time \ - -Wnested-externs \ - -ffast-math \ - -fno-common \ - -fdiagnostics-show-option \ - -fno-strict-aliasing \ - -fvisibility=hidden \ - -ffunction-sections \ - -fdata-sections \ - -fstack-protector \ - -fstack-protector-strong \ - -fPIE \ - --param=ssp-buffer-size=4]) + -Wnested-externs)} -AS_CASE([$CC], [*clang*], - [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [ \ - -Wno-typedef-redefinition \ - -Wno-gnu-variable-sized-type-not-at-end \ - ])]) +OUR_CPPFLAGS=${OUR_CPPFLAGS:-$(echo \ + -Wp,-D_FORTIFY_SOURCE=2 \ + -Wno-typedef-redefinition \ + -Wno-gnu-variable-sized-type-not-at-end)} -CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\ +OUR_LDFLAGS=${OUR_LDFLAGS:-$(echo \ -Wl,--as-needed \ -Wl,--no-undefined \ -Wl,--gc-sections \ -Wl,-z,relro \ -Wl,-z,now \ - -pie]) + -pie)} -AS_IF([test "x$enable_debug" = "xyes"], - [ - CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [ \ - -g \ - -O0 \ - -ftrapv]) - ], [ - CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\ - -Wp,-D_FORTIFY_SOURCE=2 \ - -DNDEBUG]) - ]) - -AC_SUBST([OUR_CFLAGS], "$with_cflags") -AC_SUBST([OUR_CPPFLAGS], "$with_cppflags") -AC_SUBST([OUR_LDFLAGS], "$with_ldflags") - -# ------------------------------------------------------------------------------ -# system features - -# This makes sure pkg.m4 is available. -m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config]) +AC_SUBST(OUR_CFLAGS) +AC_SUBST(OUR_CPPFLAGS) +AC_SUBST(OUR_LDFLAGS) # ------------------------------------------------------------------------------ # report @@ -140,9 +105,7 @@ AC_CONFIG_FILES([Makefile]) AC_OUTPUT AC_MSG_RESULT([ - $PACKAGE_NAME $VERSION ($LIBCRBTREE_CURRENT.$LIBCRBTREE_AGE.$LIBCRBTREE_REVISION) - debug: ${enable_debug} - + $PACKAGE_NAME $VERSION prefix: ${prefix} exec_prefix: ${exec_prefix} includedir: ${includedir} diff --git a/m4/attributes.m4 b/m4/attributes.m4 deleted file mode 100644 index e145f49..0000000 --- a/m4/attributes.m4 +++ /dev/null @@ -1,77 +0,0 @@ -dnl Macros to check the presence of generic (non-typed) symbols. -dnl Copyright (c) 2006-2008 Diego Pettenò -dnl Copyright (c) 2006-2008 xine project -dnl Copyright (c) 2012 Lucas De Marchi -dnl -dnl This program is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2, or (at your option) -dnl any later version. -dnl -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with this program; if not, write to the Free Software -dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -dnl 02110-1301, USA. -dnl -dnl As a special exception, the copyright owners of the -dnl macro gives unlimited permission to copy, distribute and modify the -dnl configure scripts that are the output of Autoconf when processing the -dnl Macro. You need not follow the terms of the GNU General Public -dnl License when using or distributing such scripts, even though portions -dnl of the text of the Macro appear in them. The GNU General Public -dnl License (GPL) does govern all other use of the material that -dnl constitutes the Autoconf Macro. -dnl -dnl This special exception to the GPL applies to versions of the -dnl Autoconf Macro released by this project. When you make and -dnl distribute a modified version of the Autoconf Macro, you may extend -dnl this special exception to the GPL to apply to your modified version as -dnl well. - -dnl Check if FLAG in ENV-VAR is supported by compiler and append it -dnl to WHERE-TO-APPEND variable. Note that we invert -Wno-* checks to -dnl -W* as gcc cannot test for negated warnings. -dnl CC_CHECK_FLAG_APPEND([WHERE-TO-APPEND], [ENV-VAR], [FLAG]) - -AC_DEFUN([CC_CHECK_FLAG_APPEND], [ - AC_CACHE_CHECK([if $CC supports flag $3 in envvar $2], - AS_TR_SH([cc_cv_$2_$3]), - [eval "AS_TR_SH([cc_save_$2])='${$2}'" - eval "AS_TR_SH([$2])='-Werror `echo "$3" | sed 's/^-Wno-/-W/'`'" - AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void) { return 0; } ])], - [eval "AS_TR_SH([cc_cv_$2_$3])='yes'"], - [eval "AS_TR_SH([cc_cv_$2_$3])='no'"]) - eval "AS_TR_SH([$2])='$cc_save_$2'"]) - - AS_IF([eval test x$]AS_TR_SH([cc_cv_$2_$3])[ = xyes], - [eval "$1='${$1} $3'"]) -]) - -dnl CC_CHECK_FLAGS_APPEND([WHERE-TO-APPEND], [ENV-VAR], [FLAG1 FLAG2]) -AC_DEFUN([CC_CHECK_FLAGS_APPEND], [ - for flag in $3; do - CC_CHECK_FLAG_APPEND($1, $2, $flag) - done -]) - -dnl Check if the flag is supported by linker (cacheable) -dnl CC_CHECK_LDFLAGS([FLAG], [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND]) -AC_DEFUN([CC_CHECK_LDFLAGS], [ - AC_CACHE_CHECK([if $CC supports $1 flag], - AS_TR_SH([cc_cv_ldflags_$1]), - [ac_save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $1" - AC_LINK_IFELSE([int main() { return 1; }], - [eval "AS_TR_SH([cc_cv_ldflags_$1])='yes'"], - [eval "AS_TR_SH([cc_cv_ldflags_$1])="]) - LDFLAGS="$ac_save_LDFLAGS" - ]) - - AS_IF([eval test x$]AS_TR_SH([cc_cv_ldflags_$1])[ = xyes], - [$2], [$3]) -]) diff --git a/src/crbtree-private.h b/src/c-rbtree-private.h similarity index 97% rename from src/crbtree-private.h rename to src/c-rbtree-private.h index 417ff75..04bdf42 100644 --- a/src/crbtree-private.h +++ b/src/c-rbtree-private.h @@ -24,7 +24,7 @@ */ #include -#include "crbtree.h" +#include "org.bus1/c-rbtree.h" /* * Macros diff --git a/src/crbtree.c b/src/c-rbtree.c similarity index 98% rename from src/crbtree.c rename to src/c-rbtree.c index 564bab2..fffab86 100644 --- a/src/crbtree.c +++ b/src/c-rbtree.c @@ -1,18 +1,18 @@ /*** - This file is part of crbtree. See COPYING for details. + This file is part of bus1. See COPYING for details. - crbtree is free software; you can redistribute it and/or modify it + bus1 is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. - crbtree is distributed in the hope that it will be useful, but + bus1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License - along with crbtree; If not, see . + along with bus1; If not, see . ***/ /* @@ -42,8 +42,9 @@ #include #include -#include "crbtree.h" -#include "crbtree-private.h" + +#include "c-rbtree-private.h" +#include "org.bus1/c-rbtree.h" /** * c_rbnode_leftmost() - return leftmost child diff --git a/src/libcrbtree.pc.in b/src/libcrbtree.pc.in new file mode 100644 index 0000000..f44749c --- /dev/null +++ b/src/libcrbtree.pc.in @@ -0,0 +1,20 @@ +# This file is part of bus1. See COPYING for details. +# +# bus1 is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# bus1 is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with bus1; If not, see . + +Name: libcrbtree +Description: Red-Black Tree Implementation +Version: @VERSION@ +Libs: -L$@libdir@ -lcrbtree +Cflags: -I$@includedir@ diff --git a/src/crbtree.h b/src/org.bus1/c-rbtree.h similarity index 97% rename from src/crbtree.h rename to src/org.bus1/c-rbtree.h index b80364a..126f73a 100644 --- a/src/crbtree.h +++ b/src/org.bus1/c-rbtree.h @@ -1,23 +1,23 @@ #pragma once /*** - This file is part of crbtree. See COPYING for details. + This file is part of bus1. See COPYING for details. - crbtree is free software; you can redistribute it and/or modify it + bus1 is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. - crbtree is distributed in the hope that it will be useful, but + bus1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License - along with crbtree; If not, see . + along with bus1; If not, see . ***/ -/** +/* * Standalone Red-Black-Tree Implementation in Standard ISO-C11 * * This header provides an RB-Tree API, that is fully implemented in ISO-C11 @@ -54,7 +54,7 @@ typedef struct CRBTree CRBTree; * Each node in an RB-Tree must embed an CRBNode object. This object contains * pointers to its left and right child, which can be freely accessed by the * API user at any time. They are NULL, if the node does not have a left/right - * child + * child. * * The @__parent_and_color field must never be accessed directly. It encodes * the pointer to the parent node, and the color of the node. Use the accessor diff --git a/src/test-api.c b/src/test-api.c index 69b2958..b52c5b5 100644 --- a/src/test-api.c +++ b/src/test-api.c @@ -26,7 +26,8 @@ #include #include #include -#include "crbtree.h" + +#include "org.bus1/c-rbtree.h" static void test_api(void) { CRBTree t = {}; diff --git a/src/test-basic.c b/src/test-basic.c index 1f823e6..07e3c65 100644 --- a/src/test-basic.c +++ b/src/test-basic.c @@ -34,8 +34,9 @@ #include #include #include -#include "crbtree.h" -#include "crbtree-private.h" + +#include "org.bus1/c-rbtree.h" +#include "c-rbtree-private.h" static size_t validate(CRBTree *t) { unsigned int i_black, n_black; diff --git a/src/test-map.c b/src/test-map.c index d0ad8dc..7236956 100644 --- a/src/test-map.c +++ b/src/test-map.c @@ -29,8 +29,9 @@ #include #include #include -#include "crbtree.h" -#include "crbtree-private.h" + +#include "org.bus1/c-rbtree.h" +#include "c-rbtree-private.h" typedef struct { unsigned long key;