As noted in the introduction, LibCXX targets Linux. An earlier version of LibCXX was also ported to FreeBSD 10, but has not been maintained to-date. Any patches required for porting to the current version are welcome, This appendix contains the last build instructions and notes as of FreeBSD 10:
The
pkg-config or pkgconf,
ca_root_nss,
pcre,
libxml2,
libxslt,
libyaml,
gnutls (port must be updated to 3.3.13, or
higher),
libgcrypt,
gettext,
libunwind,
libidn and
libiconv packages need to be installed to
build LibCXX, in addition to the current stable port of
gccNN
and gmake
that must be used to compile them.
The courier-unicode library must also
be installed, and compiled by the same gcc
port.
doxygen, graphviz,
and doxygen-xsl are also required to build
from LibCXX's source repository.
imbue
(), and any other code that
touches a locale object must be wrapped inside an instance
of x::globlocale
:
x::locale l; { x::globlocale global_locale(l); // Imbue the locale somewhere, then imbue somewhere's original locale back // into the same "somewhere". }
On a platform
without the xlocale
API,
x::globlocale
acquires a global process
mutex, and sets the global application locale. Before it goes out of
scope, the original locale gets restored.
On Linux this class is declared as an inline no-op, and will hopefully
get optimized away.
The kqueue
API emulates Linux
epoll,
event,
timer, and
signal file descriptors.
Currently, a separate kqueue
gets created
for each one of the emulated file descriptor APIs,
rather than a shared kqueue
for all of them.
Some aspects of the Linux APIs behave differently,
but still within its specifications, to various degrees. Events posted
to event file descriptors do not generally accumulate, but are
retrieved individually, in posted order. A substitute
x::signalfd::getsignal_t
gets defined in the
header files, containing only ssi_signo
, and none
of the other fields defined in Linux. Application that use
other stuff that's documented in Linux's
signalfd(2)
won't compile.
LibCXX provides most, but not complete, equivalents of the macro
constants used by the epoll
API, and the u64
member of the
epoll_data
union is not defined on 32-bit
platforms.
kqueues get invalidated by a fork
(). This means
that applications that fork and run as daemons cannot instantiate
any of the emulated file descriptor objects before the
fork
()ing gets done.
The libinotify package emulates the
inotify API. Not all
x::inotify_
mask
masks
are implemented; the ones that are not are set to
0
.
Applications should use
x::fork
,
instead
fork(2).
Linux locale-emulation code acquires an internal application
lock
(a x::globlock
)
for the duration of temporarily setting a global application
locale; x::fork
() acquires the same lock,
thus preventing locale leakage to child processes.
Use
x::forkexec
,
or instantiate a
x::globlock
manually before invoking exec
(), or its aliases.
A port Makefile is included in the tarball as a means of installing LibCXX on FreeBSD 10, which should be useful as a basis for building a port:
Copy the LibCXX tarball to /usr/ports/distfiles
.
Extract the tarball's contents into a temporary directory, then from
the packaging/freebsd10/devel/libcxx
subdirectory run
make makesum followed by
make.
Run make plist and save its output, to create a
packaging list (after remove the header line from
pkg-plist
's output); then run
make install (or make package).
Add “httportmap_enable=YES” to
/etc/rc.conf
.
This starts the
httportmap
service, which is required by LibCXX.
httportmap works with or without
Apache.
The Makefile
checks
if the Apache is installed, and if so it installs
a link to the required configuration file.
If Apache gets installed or deinstalled
after LibCXX, LibCXX must be reinstalled.