Skip to content

Building

Phil Shafer edited this page Jul 9, 2013 · 3 revisions

How to build juise

Building juise invokes four steps:

  • installing prerequisite software
  • downloading software
  • building juise binaries
  • installing juise

Prerequisites

juise depends on a set of prerequisite software packages which must be installed before building juise. Chief among these is libslax. Refer to the github release page to find the latest release. See also the building instructions.

Retrieving the source code

[Note: for Solaris users, the "tar" command lacks the "-z" flag, so you'll need to substitute "gzip -dc file | tar xf -" instead of "tar -zxf file".]

You can retrieve the source for juise in two ways:

A) Use a "distfile" for a specific release. We use github to maintain our releases. Visit github release page to see the list of releases. To download the latest, look for the release with the green "Latest release" button and the green "juise-RELEASE.tar.gz" button under that section.

After downloading that release's distfile, untar it as follows:

tar -zxf juise-RELEASE.tar.gz
cd juise-RELEASE

B) Use the current build from github. This gives you the most recent source code, which might be less stable than a specific release. To build juise from the git repo:

git clone https://github.com/Juniper/juise.git
cd juise

BE AWARE: The github repository does not contain the files generated by "autoreconf", with the notable exception of the "m4" directory. Since these files (depcomp, configure, missing, install-sh, etc) are generated files, we keep them out of the source code repository.

This means that if you download the a release distfile, these files will be ready and you'll just need to run "configure", but if you download the source code from svn, then you'll need to run "autoreconf" by hand. This step is done for you by the "setup.sh" script, described in the next section.

Building juise

To build juise, you'll need to set up the build, run the configure script, run the make command, and run the regression tests.

The following is a summary of the commands needed. These commands are explained in detail in the rest of this section.

sh bin/setup.sh
cd build
../configure
make
make test
sudo make install

We'll step through each of these commands, with more complete explanations.

Setting up the build

[If you downloaded a distfile, you can skip this step.]

Run the "setup.sh" script to set up the build. This script runs the "autoreconf" command to generate the configure script and other generated files.

sh bin/setup.sh

Note: We're are currently using autoreconf version 2.69.

Running the configure Script

Configure (and autoconf in general) provides a means of building software in diverse environments. Our configure script supports a set of options that can be used to adjust to your operating environment. Use "configure --help" to view these options.

We use the "build" directory to keep object files and generated files away from the source tree.

To run the configure script, change into the build directory, and run the configure script. Add any required options to the "../configure" command line.

% cd build
% ../configure

Expect to see the configure script generate the following error:

/usr/bin/rm: cannot remove `libtoolT': No such file or directory

This error is harmless and can be safely ignored.

By default, juise installs architecture-independent files, including extension library files, in the /usr/local directories. To specify an installation prefix other than /usr/local for all installation files, include the --prefix=prefix option and specify an alternate location. To install just the extension library files in a different, user-defined location, include the --with-extensions-dir=dir option and specify the location where the extension libraries will live.

% cd build
% ../configure [OPTION]... [VAR=VALUE]...

If you want to use the regression tests from libxslt, add the "--with-libxslt-tests=DIR" to the configure command:

../configure --with-libxslt-tests=~/work/libxslt-1.1.24
juise configure Options

The juise-specific options are:

  --enable-warnings    Turn on compiler warnings
  --enable-debug    Turn on debugging
  --enable-readline    Enable support for GNU readline
  --enable-libedit    Enable support for libedit (BSD readline)
  --enable-printflike    Enable use of GCC __printflike attribute
 
  --with-libxml-prefix=PFX            Specify location of libxml config
  --with-libxml-include-prefix=PFX    Specify location of libxml headers
  --with-libxml-libs-prefix=PFX       Specify location of libxml libs
  --with-libxml-src=DIR               For libxml thats not installed yet (sets all three above)
  --with-libxslt-prefix=PFX           Specify location of libxslt config
  --with-libxslt-include-prefix=PFX   Specify location of libxslt headers
  --with-libxslt-libs-prefix=PFX      Specify location of libxslt libs
  --with-libxslt-src=DIR              For libxslt thats not installed yet (sets all three above)
  --with-libslax-prefix=PFX           Specify location of libslax config
  --with-libslax-include-prefix=PFX   Specify location of libslax headers
  --with-libslax-libs-prefix=PFX      Specify location of libslax libs
  --with-libslax-src=DIR              For libslax thats not installed yet (sets all three above)
  --with-libssh2-prefix=PFX           Specify location of libssh2 config
  --with-libssh2-include-prefix=PFX   Specify location of libssh2 headers
  --with-libssh2-libs-prefix=PFX      Specify location of libssh2 libs
  --with-sqlite3-prefix=PFX           Specify location of sqlite3 config
  --with-sqlite3-include-prefix=PFX   Specify location of sqlite3 headers
  --with-sqlite3-libs-prefix=PFX      Specify location of sqlite3 libs
  --with-pcre                  Enable pcre support (default yes)
  --with-lighttpd-src=DIR      Specify location of lighttpd src
  --with-lighttpd-obj=DIR      Specify location of lighttpd obj
  --with-lighttpd-mod=DIR      Specify location of lighttpd mods
  --with-lighttpd-lib=DIR      Specify location of lighttpd libraries
  --with-juise-dir=DIR         Specify location of juise files
  --with-script-dir=DIR        Specify location of juise scripts
  --with-web-dir=DIR           Specify location of web server
  --with-cgi-dir=DIR           Specify location of cgi files
  --with-php-cgi=DIR           Specify location of php-cgi binary

If these packages (libxml2, libxslt, libslax) are installed normally, then their options are not needed.

Running the make command

Once the configure script is run, build the images using the make command:

% make

Running the Regression Tests

juise includes a set of regression tests that can be run to ensure the software is working properly. These test are optional, but will help determine if there are any issues running juise on your machine. To run the regression tests:

% make test

Installing juise

Once the software is built, you'll need to install juise using the "make install" command. If you are the root user, or the owner of the installation directory, simply issue the command:

% make install

If you are not the "root" user and are using the sudo package, use:

% sudo make install

Verify the installation by viewing the output of "juise --version":

% juise --version
libjuice version 0.5.1
libslax version 0.16.9
Using libxml 20900, libxslt 10128 and libexslt 817
slaxproc was compiled against libxml 20900, libxslt 10128 and libexslt 817
libxslt 10128 was compiled against libxml 20900
libexslt 817 was compiled against libxml 20900