Embedthis Ejscript 1.1.2
Home >Installation > Installing Supporting Packages

Quick Nav

See Also

Installing Supporting Packages

Ejscript leverages other packages such as OpenSSL for additional functionality. Ejscript may be built for specific environments such as the small C library, uClibc.

Sometimes, you may have a requirement to rebuild one of these packages to add or remove features. This document describes the build process that Embedthis uses to build these packages. NOTE: we cannot support the building of these 3rd party packages. That is your responsibility and the responsibility of the various groups and vendors who provide these packages.

See the package specific notes for:

Patched Packages

Often minor changes are required to get a package to build cleanly with Appweb on some platforms. Embedthis archives the patched packages used with Appweb in a GitHub repository at http://github.com/embedthis/packages.

Use the following to checkout a copy of the packages:

git clone http://github.com/embedthis/packages

There is a top level Makefile which will build all the packages and there are individual Makefiles for each package. NOTE: Embedthis provides these packages as a service. The Makefiles and packages themselves are not supported.

MatrixSSL

PeerSec provide the MatrixSSL product which can be downloaded from www.matrixssl.org. Consult their instructions and build using the standard steps.

Configure Ejscript using the --with-matrixssl switch

./configure --with-matrixssl    

You may need to edit the build/packages/matrixssl configuration file to further modify the compiler and linker flags and search paths to match your configuration. You may need to define the base directory which can optionally be provided as a switch to the --with-matrixssl switch.

OpenSSL

These instructions are suitable for building OpenSSL version 0.9.7d.

Building OpenSSL 0.9.7d on Linux for X886

Use the following commands to build OpenSSL natively on Linux:

./config
make

To build single threaded, use the "--no-threads" option. If you wish to also build OpenSSL as shared libraries, use:

make build-shared

After you have built OpenSSL you must reference the OpenSSL installation directory in your Ejscript configuration. You can set this via the configure command. You may need to define the base directory which can optionally be provided as a switch to the --with-openssl switch.

./configure --with-openssl=../../openssl-0.9.7d

You may need to edit the build/packages/openssl configuration file to further modify the compiler and linker flags and search paths to match your configuration.

Building OpenSSL 0.9.7d on Windows for X886

The Windows OpenSSL build system uses Perl and nmake. The following commands will build the required shared libraries (DLLs) for Ejscript to use OpenSSL.

perl Configure VC-WIN32
cmd /c ms\\do_masm
rm -f libcrypto.lib libeay32.dll libssl.lib ssleay32.dll
rm -f out32dll/*.exe out32dll/*.dll out32dll/*.lib
rm -f tmp32dll/*
perl Configure VC-WIN32
cmd /c ms\\do_masm.bat
nmake -f ms/ntdll.mak
mv out32dll/libeay32.lib libcrypto.lib
mv out32dll/ssleay32.lib libssl.lib
mv out32dll/*.dll .
cp -r inc32/openssl include

After you have built OpenSSL you must reference the OpenSSL installation directory in your Ejscript configuration. You can set this via the configure command. You may need to define the base directory which can optionally be provided as a switch to the --with-openssl switch.

./configure --with-openssl=../../openssl-0.9.7d

You may need to edit the build/packages/openssl configuration file to further modify the compiler and linker flags and search paths to match your configuration.

uClibc

To get the smallest executable possible, there are several alternatives to the standard libc library. One of the leading tiny libcs on Linux is uClibc. For general information go to: www.uclibc.org.

To link with uClibc, you must first create a compiler toolchain that will link Ejscript with the uClibc library. This is not always an easy process. The easiest way appears to be to get one of the pre-built root file systems that contain the complete cross compiler and uClibc library. You then mount this file system, make it your root file system and copy the Ejscript source into it and built it there.

When you run the configure command, you will need to supply the Cross compiler settings. These are passed to configure via environment variables. For example, the following script configures Ejscript to build using the arm-linux cross compiler (supporting uclibc) that is installed under /usr/local.

DIR=/usr/local ; \
export CC=arm-linux-uclibc-gcc ; \
GCC_DIR=`$$CC -print-libgcc-file-name 2>&1 | sed -e 's/\/libgcc.a//'` ; \
AR=arm-linux-uclibc-ar \
LD=arm-linux-uclibc-ld \
RANLIB=arm-linux-uclibc-ranlib \
IFLAGS="-I$$DIR/arm-linux-uclibc/include -I$$GCC_DIR/include" \
LDFLAGS="-L$$GCC_DIR/lib -L$$DIR/arm-linux-uclibc/lib \
-Wl,--dynamic-linker -Wl,$$DIR/i386-linux/lib/ld-uClibc.so.0" \
./configure

See Building Ejscript from Source for full details on all the available configure switches.

© Embedthis Software LLC, 2003-2012. All rights reserved. Embedthis, Ejscript and Appweb are trademarks of Embedthis Software LLC.