1251875SpeterApache Portable Runtime Library (APR) 2251875Speter------------------------------------- 3251875Speter 4251875Speter The Apache Portable Runtime Library provides a predictable and 5251875Speter consistent interface to underlying platform-specific 6251875Speter implementations, with an API to which software developers may code 7251875Speter and be assured of predictable if not identical behavior regardless 8251875Speter of the platform on which their software is built, relieving them of 9251875Speter the need to code special-case conditions to work around or take 10251875Speter advantage of platform-specific deficiencies or features. 11251875Speter 12251875Speter APR and its companion libraries are implemented entirely in C 13251875Speter and provide a common programming interface across a wide variety 14251875Speter of operating system platforms without sacrificing performance. 15251875Speter Currently supported platforms include: 16251875Speter 17251875Speter UNIX variants 18251875Speter Windows 19251875Speter Netware 20251875Speter Mac OS X 21251875Speter OS/2 22251875Speter 23251875Speter To give a brief overview, the primary core 24251875Speter subsystems of APR 1.3 include the following: 25251875Speter 26251875Speter Atomic operations 27251875Speter Dynamic Shared Object loading 28251875Speter File I/O 29251875Speter Locks (mutexes, condition variables, etc) 30251875Speter Memory management (high performance allocators) 31251875Speter Memory-mapped files 32251875Speter Multicast Sockets 33251875Speter Network I/O 34251875Speter Shared memory 35251875Speter Thread and Process management 36251875Speter Various data structures (tables, hashes, priority queues, etc) 37251875Speter 38251875Speter For a more complete list, please refer to the following URLs: 39251875Speter 40251875Speter http://apr.apache.org/docs/apr/modules.html 41251875Speter 42251875Speter Users of APR 0.9 should be aware that migrating to the APR 1.x 43251875Speter programming interfaces may require some adjustments; APR 1.x is 44251875Speter neither source nor binary compatible with earlier APR 0.9 releases. 45251875Speter Users of APR 1.x can expect consistent interfaces and binary backwards 46251875Speter compatibility throughout the entire APR 1.x release cycle, as defined 47251875Speter in our versioning rules: 48251875Speter 49251875Speter http://apr.apache.org/versioning.html 50251875Speter 51251875Speter APR is already used extensively by the Apache HTTP Server 52251875Speter version 2 and the Subversion revision control system, to 53251875Speter name but a few. We list all known projects using APR at 54251875Speter http://apr.apache.org/projects.html -- so please let us know 55251875Speter if you find our libraries useful in your own projects! 56251875Speter 57251875Speter 58251875SpeterUsing a Subversion Checkout on Unix 59251875Speter=================================== 60251875Speter 61251875SpeterIf you are building APR from SVN, you need to perform a prerequisite 62251875Speterstep. You must have autoconf, libtool and python installed for this 63251875Speterto work. The prerequisite is simply; 64251875Speter 65251875Speter ./buildconf 66251875Speter 67251875SpeterIf you are building APR from a distribution tarball, buildconf is 68251875Speteralready run for you, and you do not need autoconf, libtool or python 69251875Speterinstalled or to run buildconf unless you have patched APR's buildconf 70251875Speterinputs (such as configure.in, build.conf, virtually any file within 71251875Speterthe build/ tree, or you add or remove source files). 72251875Speter 73251875SpeterRemember when updating from svn that you must rerun ./buildconf again 74251875Speterto effect any changes made to the build schema in your fresh update. 75251875Speter 76251875Speter 77251875SpeterConfiguring and Building APR on Unix 78251875Speter==================================== 79251875Speter 80251875SpeterSimply; 81251875Speter 82251875Speter ./configure --prefix=/desired/path/of/apr 83251875Speter make 84251875Speter make test 85251875Speter make install 86251875Speter 87251875SpeterConfigure has additional options, ./configure --help will offer you 88251875Speterthose choices. You may also add CC=compiler CFLAGS="compiler flags" 89251875Speteretc. prior to the ./configure statement (on the same line). Please 90251875Speterbe warned, some flags must be passed as part of the CC command, 91251875Speteritself, in order for autoconf to make the right determinations. Eg.; 92251875Speter 93251875Speter CC="gcc -m64" ./configure --prefix=/desired/path/of/apr 94251875Speter 95251875Speterwill inform APR that you are compiling to a 64 bit CPU, and autoconf 96251875Spetermust consider that when setting up all of APR's internal and external 97251875Spetertype declarations. 98251875Speter 99251875SpeterFor more verbose output from testall, you may wish to invoke testall 100251875Speterwith the flag; 101251875Speter 102251875Speter cd test 103251875Speter ./testall -v 104251875Speter 105251875Speter 106251875SpeterBuilding APR RPM files on Linux 107251875Speter=============================== 108251875Speter 109251875SpeterRun the following to create SRPMs: 110251875Speter 111251875Speterrpmbuild -ts apr-<version>.tar.bz2 112251875Speterrpmbuild -ts apr-util-<version>.tar.bz2 113251875Speter 114251875SpeterRun the following to create RPMs (or build from the SRPMs): 115251875Speter 116251875Speterrpmbuild -tb apr-<version>.tar.bz2 117251875Speterrpmbuild -tb apr-util-<version>.tar.bz2 118251875Speter 119251875SpeterResolve dependencies as appropriate. 120251875Speter 121251875Speter 122251875SpeterConfiguring and Building APR on Windows 123251875Speter======================================= 124251875Speter 125251875SpeterUsing Visual Studio, you can build and run the test validation of APR. 126251875SpeterThe Makefile.win make file has a bunch of documentation about it's 127251875Speteroptions, but a trivial build is simply; 128251875Speter 129251875Speter nmake -f Makefile.win 130251875Speter nmake -f Makefile.win PREFIX=c:\desired\path\of\apr install 131251875Speter 132251875SpeterNote you must manually modify the include\apr.hw file before you 133251875Speterbuild to change default options, see the #define APR_HAS_... or the 134251875Speter#define APR_HAVE_... statements. Be careful, many of these aren't 135251875Speterappropriate to be modified. The most common change is 136251875Speter 137251875Speter#define APR_HAVE_IPV6 1 138251875Speter 139251875Speterrather than 0 if this build of APR will be used strictly on machines 140251875Speterwith the IPv6 adapter support installed. 141251875Speter 142251875SpeterIt's trivial to include the apr.dsp (for a static library) or the 143251875Speterlibapr.dsp (for a dynamic library) in your own build project, or you 144251875Spetercan load apr.dsw in Visual Studio 2002 (.NET) or later, which will 145251875Speterconvert these for you into apr.sln and associated .vcproj files. 146251875Speter 147251875SpeterWhen using APR as a dynamic library, nothing special is required, 148251875Spetersimply link to libapr.lib. To use it as a static library, simply 149251875Speterdefine APR_DECLARE_STATIC before you include any apr header files 150251875Speterin your source, and link to apr.lib instead. 151251875Speter 152251875Speter 153251875SpeterGenerating Test Coverage information with gcc 154251875Speter============================================= 155251875Speter 156251875SpeterIf you want to generate test coverage data, use the following steps: 157251875Speter 158251875Speter ./buildconf 159251875Speter CFLAGS="-fprofile-arcs -ftest-coverage" ./configure 160251875Speter make 161251875Speter cd test 162251875Speter make 163251875Speter ./testall 164251875Speter cd .. 165251875Speter make gcov 166251875Speter 167251875Speter 168