Garbage Collected C Libraries
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
aclocal
attic
bin
cu
cucon
cudyn
cuex
cuflow
cufo
cugra
cuoo
cuos
custo
cutext
doc
edit
migration
pkgconfig
skel
tools
.gitignore
AUTHORS
COPYING
COPYING.Unicode
Makefile.am
README.rst
autotools.sh
configure.ac
cubase.spec.in
culibs.spec.in
mkskel

README.rst

Garbage Collected C Libraries

For elaborate documentation, see http://www.eideticdew.org/culibs/.

This source code contains several C libraries. It is split into modules, where each module roughly corresponds to one library:

Module Description Library
cu Common infrastructure. libcubase
cucon Containers, including lists, stacks, queues, sets, and maps tailored for various purposes. libcubase
cuoo Dynamically typed objects and prerequisites for cuex. libcubase
cuos Interface to the operating system, path manipulation, XDG base directory support, etc. libcuos
cutext Unicode text and stream support. libcutext
cufo Text formatting for logging and program output. libcufo
cugra Graphs and graph algorithms. libcugra
cuex Expression trees and related algorithms. libcuex
cudyn Dynamically typed objects to supplement cuex. libcuex

Compiling and Installing

In addition to a C and POSIX library with librt support, you need:

Optionally, the following may be used

  • libffi - Enables a few extra features in cuex.
  • buddy - Used in cugra for minimum feedback vertex set algorithm.
  • libunwind - Used to print stack trace after a crash.

For a system wide install,

./configure
make
sudo make install

To install to your home directory, you may use

./configure --prefix=$HOME/local
make
make install

adjusting the prefix to your taste. See INSTALL and ./configure --help for more detailed information about options to configure, make targets and other Autoconf related information.

Optionally, you may install the API documentation with

make install-doc

Building Individual Components

If you don't need the whole set of libraries or want to build them separately, you can pass the list of modules to build with the --enable-modules option, e.g. to build only the base and OS libraries:

./configure --enable-modules="cu cucon cuos"

If the listed modules depend on unlisted ones, configure will look for installed ones to fulfill the dependencies. Modules which are part of the same library are selected if one of the modules are listed. Either of "cu", "cucon", or "cubase" will select the base library.

For the precise module dependencies, look at the CUAC_MODULE invocations in configure.ac, where the second argument lists the dependencies.

Using the Libraries

The libraries come with a collection of pkg-config files, one for each module. You can use these either under Autoconf or directly with the pkg-config command.

If you your project uses Autoconf, add

PKG_CHECK_MODULES([CULIBS], [MODULES])

to your configure.ac, where MODULES is the space-separated list of modules that you want to use. You can now refer to $(CULIBS_CFLAGS) and $(CULIBS_LIBS) from your Makefile.in or Makefile.am.

To build from the command line or under non-Autoconf build files, use the pkg-config command

gcc -c `pkg-config --cflags MODULES` my_prog.c              # compile
gcc -o my_prog my_prog.o `pkg-config --libs MODULES`        # link