Mirror of Apache Portable Runtime
Switch branches/tags
Clone or download
brainy Fix Python3 compatibility.
* build/gen-build.py (extract_deps): Do not assume that source files are only ASCII.
   This fixes a build failure on macOS High Sierra.

git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1846806 13f79535-47bb-0310-9956-ffa450edef68
Latest commit 5e6825f Nov 17, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
atomic Add in Atomics for 64bit ints Sep 17, 2018
buckets * We cannot access list any longer after we called apr_allocator_free… Jan 26, 2018
build Fix Python3 compatibility. Nov 17, 2018
crypto Remove non existent digests. Aug 27, 2018
dbd Untested but presumably this code was also -- found by Coverity: Oct 4, 2018
dbm Fix error handling in gdbm Feb 25, 2018
docs Spelling corrections in docs; Aug 30, 2018
dso Fix copy/paste typo Feb 17, 2009
encoding Add the apr_encode_* API that implements RFC4648 and RFC7515 Jun 25, 2018
file_io Unlock mutex only if APR_FOPEN_XTHREAD flag is set Apr 24, 2018
helpers Limit the renames performed in apr_rename.pl to the newest ones only. Nov 30, 2002
hooks Remove dereference of null pointer. Jul 18, 2018
include Add in Atomics for 64bit ints Sep 17, 2018
jose Perform nesting level checks before each invocation of apr_jose_decode() Sep 2, 2018
json apr_json: Split apr_json_object_set() into apr_json_object_set() with Sep 1, 2018
locks Revert 1839699, this contained unintended, additional noise. Re-corre… Aug 30, 2018
memcache Save some cycles by not copying the pollfds. Jun 2, 2017
memory/unix apr_pools: make index(es) an apr_size_t everywhere. Jan 26, 2018
misc Spelling corrections in docs; Aug 30, 2018
mmap Use CreateFileMappingW on Unicode capable Windows. Dec 18, 2016
network_io Fix breakage on _WIN32_WINNT>=0x0600 due to if_indextoname, Aug 28, 2018
passwd Whitespace. Sync with branches. Oct 3, 2013
poll poll, epoll: pollset's pfd is not modified on poll(), mark it const. Jan 3, 2018
random/unix Removed tabs; fixed braces indent; added ASF header. May 23, 2013
redis apr_redis: reserve buffer space for trailing \0. Feb 7, 2017
shmem Add apr_shm_delete() Apr 28, 2014
strings PR 62555: fix edge-case int overflow in apr_itoa Jul 23, 2018
strmatch Convert various APU_DECLARE into APR_DECLARE. Jul 16, 2009
support fix a bit of 'if FOO'/'ifdef FOO' confusion Mar 29, 2011
tables apr_table_overlap: Add APR_OVERLAP_TABLES_ADD to merge and set when Mar 7, 2016
test Add in Atomics for 64bit ints Sep 17, 2018
threadproc apr_crypto: follow up to r1833359: better cprng_stream_bytes() semant… Jun 28, 2018
time Correct cut-n-paste assignment error. Sep 8, 2018
tools Split the ability to filter LDAP escape sequences into DN escaping or… Apr 21, 2014
uri apr_uri_parse(): Do not accept invalid characters in the scheme. Mar 28, 2013
user Use 'apr_pstrmemdup' instead of 'apr_pstrndup' when applicable in ord… Oct 24, 2015
util-misc Simplify apr_errprintf() to return a structure instead of a status. Sep 1, 2018
xlate z/OS iconv uses ISO charset names with only one dash, e.g. ISO8859-1 Jul 22, 2011
xml Document apr_xml_internal.h. Jul 15, 2018
CHANGES Add in Atomics for 64bit ints Sep 17, 2018
CMakeLists.txt apr_crypto: follow up to r1833359. Jun 12, 2018
LICENSE Seems we forgot to merge apr-util/LICENSE while folding apr-util into… Feb 25, 2016
Makefile.in Revert 1839699, this contained unintended, additional noise. Re-corre… Aug 30, 2018
Makefile.win spelling fix Mar 30, 2013
NOTICE Happy New Year 2018 Jan 4, 2018
NWGNUmakefile Redis in APR_2.0 too Nov 5, 2016
README Fix test coverage functionality Sep 7, 2018
README.FREETDS Add missing svn:eol-style = native flags. Jun 11, 2018
README.cmake Fix the statement about OpenSSL and cmake 3.1.3. (Thanks, Bert) Apr 5, 2015
SConscript Revert testcstr.c for the time being while tests are structured Jan 27, 2016
SConstruct SCons: Remove unneeded file copy. Mar 24, 2009
STATUS Update STATUSes Oct 23, 2017
apr-config.in Drop the incomplete LDAP abstraction layer from APR 2.0 as decided on… May 31, 2011
apr.dsp Add in Atomics for 64bit ints Sep 17, 2018
apr.dsw Backport windows crypto build files from apr-util. We still need port… Dec 8, 2011
apr.pc.in fix the apr.pc.in file to include the cppflags in the Cflags varaible. Apr 7, 2005
build.conf apr_jose: Add support for encoding and decoding of JSON Object Sep 1, 2018
buildconf * build/buildcheck.sh, buildconf: Detect and run under Python 3 or 2, Jun 27, 2018
config.layout If --with-installbuilddir is not supplied, it unconditially overrides… Aug 25, 2018
configure.in Revert 1839699, this contained unintended, additional noise. Re-corre… Aug 30, 2018
emacs-mode Help idiots like me who use emacs. Nov 6, 2003
libapr.dsp Provide apr_siphash*() functions family. Oct 7, 2016
libapr.rc Remove more Win9x support (trunk only). Jan 18, 2014


Apache Portable Runtime Library (APR)

   The Apache Portable Runtime Library provides a predictable and
   consistent interface to underlying platform-specific
   implementations, with an API to which software developers may code
   and be assured of predictable if not identical behavior regardless
   of the platform on which their software is built, relieving them of
   the need to code special-case conditions to work around or take
   advantage of platform-specific deficiencies or features.

   APR and its companion libraries are implemented entirely in C
   and provide a common programming interface across a wide variety
   of operating system platforms without sacrificing performance.
   Currently supported platforms include:

     UNIX variants
     Mac OS X

   To give a brief overview, the primary core
   subsystems of APR 1.3 include the following:

     Atomic operations
     Dynamic Shared Object loading
     File I/O
     Locks (mutexes, condition variables, etc)
     Memory management (high performance allocators)
     Memory-mapped files
     Multicast Sockets
     Network I/O
     Shared memory
     Thread and Process management
     Various data structures (tables, hashes, priority queues, etc)

   APR 2.0 also provides a number of utility functions and library
   compatibility interfaces.  These were formerly part of APR-util,
   a seperate utility library in version 1 releases.  These include;

     Hashing and UUID services
     Multiple SQL DBD client interfaces
     Multiple flat-database DBM client interfaces
     Typesafe function Hooks abstraction
     MemCache interface
     Date parsing rourtines
     Resource Lists
     Thread Pools
     Relocatable Memory Management functions
     String filename-style pattern matching
     URI Parsing
     Charset translation (iconv based)
     XML parsing (expat based)

   For a more complete list, please refer to the following URLs:


   Users of APR 0.9 should be aware that migrating to the APR 1.x
   programming interfaces may require some adjustments; APR 1.x is
   neither source nor binary compatible with earlier APR 0.9 releases.
   Users of APR 1.x can expect consistent interfaces and binary backwards
   compatibility throughout the entire APR 1.x release cycle, as defined
   in our versioning rules:


   APR is already used extensively by the Apache HTTP Server
   version 2 and the Subversion revision control system, to
   name but a few.  We list all known projects using APR at
   http://apr.apache.org/projects.html -- so please let us know
   if you find our libraries useful in your own projects!

Database Providers
Interfaces for copy-left licensed MySQL and gdbm DBD drivers, and 
Berkeley DB DBM all ship as part of the distribution.  To avoid licensing
incompatibilities, these are not built by default.  To enable support, 
the corresponding use the --with-{provider} option, but be aware that 
these licenses may introduce licensing implications for your compiled code.
Similarly, the bindings for propritary drivers such as Oracle must also be 
explicitly enabled.

Whenever distributing apr-util in combination with database client 
drivers, always review the license requirements of all components.

Using a Subversion Checkout on Unix

If you are building APR from SVN, you need to perform a prerequisite
step.  You must have autoconf, libtool and python installed for this 
to work.  The prerequisite is simply;


If you are building APR from a distribution tarball, buildconf is
already run for you, and you do not need autoconf, libtool or python
installed or to run buildconf unless you have patched APR's buildconf 
inputs (such as configure.in, build.conf, virtually any file within 
the build/ tree, or you add or remove source files).

Remember when updating from svn that you must rerun ./buildconf again 
to effect any changes made to the build schema in your fresh update.

Configuring and Building APR on Unix


   ./configure --prefix=/desired/path/of/apr
   make test
   make install

Configure has additional options, ./configure --help will offer you
those choices.  You may also add CC=compiler CFLAGS="compiler flags"
etc. prior to the ./configure statement (on the same line).  Please
be warned, some flags must be passed as part of the CC command,
itself, in order for autoconf to make the right determinations. Eg.;

  CC="gcc -m64" ./configure --prefix=/desired/path/of/apr

will inform APR that you are compiling to a 64 bit CPU, and autoconf
must consider that when setting up all of APR's internal and external
type declarations.

For more verbose output from testall, you may wish to invoke testall
with the flag;

   cd test
   ./testall -v

Building APR RPM files on Linux

Run the following to create SRPMs:

rpmbuild -ts apr-<version>.tar.bz2
rpmbuild -ts apr-util-<version>.tar.bz2

Run the following to create RPMs (or build from the SRPMs):

rpmbuild -tb apr-<version>.tar.bz2
rpmbuild -tb apr-util-<version>.tar.bz2

Resolve dependencies as appropriate.

Configuring and Building APR on Windows

Using Visual Studio, you can build and run the test validation of APR.
The Makefile.win make file has a bunch of documentation about it's
options, but a trivial build is simply;

  nmake -f Makefile.win 
  nmake -f Makefile.win PREFIX=c:\desired\path\of\apr install

Note you must manually modify the include\apr.hw file before you
build to change default options, see the #define APR_HAS_... or the
#define APR_HAVE_... statements.  Be careful, many of these aren't
appropriate to be modified.  The most common change is 

#define APR_HAVE_IPV6           1

rather than 0 if this build of APR will be used strictly on machines
with the IPv6 adapter support installed.

It's trivial to include the apr.dsp (for a static library) or the
libapr.dsp (for a dynamic library) in your own build project, or you
can load apr.dsw in Visual Studio 2002 (.NET) or later, which will
convert these for you into apr.sln and associated .vcproj files.

When using APR as a dynamic library, nothing special is required,
simply link to libapr-2.lib.  To use it as a static library, simply 
define APR_DECLARE_STATIC before you include any apr header files 
in your source, and link to apr-2.lib instead.

On windows, selection of database drivers is via the environment values
DBD_LIST (for mysql, oracle, pgsql, sqlite2 and/or sqlite3) 
and DBM_LIST (db and/or gdbm).  DBD odbc and DBM sdbm are unconditionally
compiled and installed, do not include these in the list.

Generating Test Coverage information with gcc

If you want to generate test coverage data, use the following steps:

  CFLAGS="--coverage -fprofile-abs-path" LDFLAGS="--coverage" ./configure
  cd test
  cd ..
  make gcov

Cryptographic Software Notice
This distribution includes cryptographic software.  The country in 
which you currently reside may have restrictions on the import, 
possession, use, and/or re-export to another country, of 
encryption software.  BEFORE using any encryption software, please 
check your country's laws, regulations and policies concerning the
import, possession, or use, and re-export of encryption software, to 
see if this is permitted.  See http://www.wassenaar.org/ for more

The U.S. Government Department of Commerce, Bureau of Industry and
Security (BIS), has classified this software as Export Commodity 
Control Number (ECCN) 5D002.C.1, which includes information security
software using or performing cryptographic functions with asymmetric
algorithms.  The form and manner of this Apache Software Foundation
distribution makes it eligible for export under the License Exception
ENC Technology Software Unrestricted (TSU) exception (see the BIS 
Export Administration Regulations, Section 740.13) for both object 
code and source code.

The following provides more details on the included cryptographic

  APR provides an abstract interface for symmetrical cryptographic
  functions that make use of a general-purpose encryption library,
  such as OpenSSL, NSS, or the operating system's platform-specific
  facilities. This interface is known as the apr_crypto interface,
  with implementation beneath the /crypto directory.