view INSTALL.md @ 23:4983392b356f

unicode: add totitle conversions
author David Demelier <markand@malikania.fr>
date Wed, 23 Mar 2022 11:46:41 +0100
parents 887a8fd73d1e
children f06312a7432b
line wrap: on
line source

libunicode -- installation instructions
=======================================

Requirements
------------

- C99 (at least `EILSEQ` has to be available as errno constant).
- C11 (for running tests).
- `uint32_t` and `uint8_t` types.

Embed
-----

Copy unicode.h and unicode.c to your project.

Regeneration
------------

The file unicode.c is generated from gen/ subdirectory. Edit the appropriate
files and run `make` in top level directory to regenerate them.

Installation
------------

The module is small enough to be incorporated verbatim into your project, but it
still possible to install it system wide.

### Using CMake (recommended)

Using [CMake][cmake] you get proper CMake package configuration files, shared
libraries and `pkg-config` files.

	$ cmake -S . -B build -DBUILD_SHARED_LIBS=On
	$ cmake --build build
	# cmake --build build --target install

Turn `BUILD_SHARED_LIBS` to *Off* if you don't want shared libraries.

Then, you can import `unicode` and use on of the imported targets:

- `unicode::libunicode`: shared if available, static otherwise,
- `unicode::libunicode-shared`: shared version,
- `unicode::libunicode-static`: static version.

Example:

	cmake_minimum_required(VERSION 3.20)
	project(example)
	find_package(unicode REQUIRED)
	add_executable(example example.c)
	target_link_libraries(example unicode::libunicode)

### Using POSIX make (not recommended)

POSIX make (not recommended, only static library):

	$ make
	# make install

The test suite is available using:

	$ make tests

[cmake]: http://cmake.org