HowToBuildJXTA-C < Jxta < TWiki
|
TWiki . Jxta . HowToBuildJXTA-C
|
Updates
Note: this page is deprecated for Linux/Unix platforms.
This page details steps to build JXTA-C from scratch, if you find anything does not work for you, please send a note to JXTA-C discussion mailing list
The steps described here applies to the releases after 2.2 and current CVS head branch. For instructions on how to build JXTA-C 2.1.* releases, look here
Step 1: Get the source code
Download a source archive
You can get source code for JXTA-C releases at
Check out from CVS
svn checkout https://jxta-c.dev.java.net/svn/jxta-c/jxta-c/trunk jxta-c --username guest
Step 2: Prepare for prerequisite
You will need following libraries:
You will also need to build the following libraries from source (see Building Prerequisite Libraries from Source):
- Apache Portable Runtime: apr-util 1.2.7 with SQLite3 support
- The apr-util driver for SQLite3 requires a patch for transaction support.
- libxml2: You will apply the patch comes with JXTA-C to enable wildcard search in XPath query
- SQLite3
As how to prepare those prerequisite, it various on different operating systems. Please add information for your favorite system here:
Building Prerequisite Libraries from Source
You can always build from source code, refer to those projects for instructions on how to build them on your platform. The following are the considerations for JXTA-C.
- libXML2
- Apply the patch that comes with JXTA-C. Follow the directions in: JXTA-C directory/lib/libxml2/INSTALL
- SQLite
- Should be built with --enable-threadsafe option
- When using ephemeral address spaces, there is a problem in SQLite that creates a memory leak. The current CVS repository contains a fix for this problem and should be rebuilt. If ephemeral address spaces are not used the official release 3.3.6 is recommended.
- apr-util
- Version 1.2.7 of apr-util is required along with a fix for SQL transaction support. You have 2 options for building apr-util.
- You can download from the SVN repository revision 398048. This revision has been tested.
svn co http://svn.apache.org/repos/asf/apr/apr-util/trunk apr-util -r 398048
-
-
- A patch can be applied to the current 1.2.7 release. The source can be obtained from http://apr.apache.org/download.cgi. Download the tar ball for your system and extract the files. Create an apr_dbd_fix.patch file in the root directory of apr-util. Copy and paste the following patch into apr_dbd_fix.patch file.
Index: dbd/apr_dbd_sqlite3.c
===================================================================
--- dbd/apr_dbd_sqlite3.c (revision 392824)
+++ dbd/apr_dbd_sqlite3.c (working copy)
@@ -335,7 +335,6 @@
int nrows = 0;
if (trans) {
- ret = dbd_sqlite3_query(trans->handle, &nrows, "END TRANSACTION;");
if (trans->errnum) {
trans->errnum = 0;
ret = dbd_sqlite3_query(trans->handle, &nrows, "ROLLBACK;");
Execute the following commands to patch and build apr-util.
patch -p0 -i apr_dbd_fix.patch
./configure --enable-layout=apr-util --with-apr=/location --with-sqlite3=/location
make
make install
Step 3: Build
For *nices
./configure
make
make install
For Win32
Ruben Niederhagen maintains the Win32 build environment. Go to the win32 folder and you will find the jxta.sln file. Here is the instruction as in the README.txt file.
For Win32 you do also need the expat-library as described in the readme-file.
General
=======
Currently, we support only Visual Studio .NET 2005 to build JXTA-C.
To create JXTA-C on Windows you need following libraries:
- APR (http://apr.apache.org/)
- OpenSSL (http://www.openssl.org/)
- zlib (http://www.zlib.net/)
- sqlite3 (http://www.sqlite.org/)
- xml2 (http://xmlsoft.org/index.html)
- expat (http://expat.sourceforge.net/)
Beside XML2 you can use the official distribution of these libraries. The
XML2 library has been modified in order to provide wild card searching
of text elements with the Enhanced Discovery Service. Therefore, you need to
create this custom version of XML2. See INSTALL in lib/xml2 for instructions on
building this version of XML2.
Check out the sources from SVN
==============================
svn checkout https://jxta-c.dev.java.net/svn/jxta-c/jxta-c/trunk --username guest
Configuring the sources
=======================
You have to specify the environment variables (APACHE2, XML2, ZLIB, SQLITE3 and OPENSSL)
to the location of the necessary libraries. It is assumed that
the headers are located in the subdirectory "include", the DLLs in the subdirectory
"bin" and the link libraries in the subdirectory "lib". For instance, zlib.h is located
at $(ZLIB)/include.
The expat-stuff does not reside in an own directory for historical reasons; the library
and the header file need to be put into the APACHE2 directory.
Building the sources
====================
Open with Visual Studio .NET 2005 the project file jxta.sln in the directory "win32".
Afterwards, press F7 to build the JXTA libraries and all examples.
----- Revision r21 - 30 Jan 2008 - 19:34:37 - HenryJen
|