Embedthis Appweb 3.0A.0
Home >Installation > Installing Supporting Packages

Quick Nav

See Also

Installing Supporting Packages

Ejscript integrates with other packages such as OpenSSL or MatrixSSL and alos may be built for specific environments such as uClibc and uClinux.

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.

Building and Integrating With:

MatrixSSL

PeerSec provide the MatrixSSL product which can be downloaded from www.matrixssl.org. Consult their build instructions and make 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.

uClinux

TODO - these instructions are not accurate or current

A patch for uClinux has been submitted and hopefully will soon be included in the default uClinux distributions from SnapGear and the uClinux project. Until then, a patch is available to update uClinux with Ejscript support. We have used the SnapGear distribution and have followed the included instructions.

Once you have uClinux installed, you should extract the Ejscript source code into the user/Ejscript directory. The following commands are a suggestion:

cd UCLINUX_DIR/user
tar xvfz Ejscript-src-VERSION.tar.gz
mv Ejscript-VERSION Ejscript

First you need to run the configuration utility. This can be either X based or curses based. To run the X utility:

make xconfig

After selecting your embedded board vendor, go into the Kernel/Library/Defaults Selection and Toggle Customize Vendor/User Settings to be "y". After you then click Main Menu, then Save and Exit, a new dialog will be displayed with the Application Configuration options. Select Network Applications and you should see Ejscript configuration options toward the top of the screen. Select "y" for the Ejscript option and select "y" for any other Ejscript options you require. The Help button will explain each option.

After configuring uClinux, you should type:

make depend
make

TODO - not correct: After the initial build, Ejscript remembers all the cross-compiler settings and you can recompile directly in the Ejscript directory. You can also customize your Ejscript configuration and then rebuild. For example: to enable the Embedded Gateway Interface:

cd user/Ejscript
./configure
cd ../..
make user_only

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