This chapter explains how to build and install the Ada Web Application framework.
Before building the framework, you will need:
- The GNAT Ada compiler,
- Either the MySQL, PostgreSQL or SQLite development headers installed,
- Ada Web Server.
First get, build and install the above tools and libraries. For the best experience, it is necessary to have the SSL support in Ada Web Server. Indeed, the OpenID Authentication 2.0 can only be used through HTTPS.
The build process may also need the following commands:
- make (GNU make),
- liblzma libraries (used by Ada LZMA),
- CURL libraries (used by CURL support in Ada Utility Library)
The Ada Web Application library also uses the following projects:
- Ada LZMA,
- Ada Utility Library,
- Ada Expression Language Library,
- Ada Security Library,
- Ada Servlet Library,
- Ada Server Faces Library,
- Ada Wiki Library,
- Ada Database Objects Library,
- Swagger Ada Library,
They are integrated as Git submodules.
Getting the sources
The AWA framework uses git submodules to integrate several other projects. To get all the sources, use the following commands:
git clone firstname.lastname@example.org:stcarrez/ada-awa.git cd ada-awa git submodule init git submodule update
Development Host Installation
The PostgreSQL, MySQL and SQLite development headers and runtime are necessary for building the Ada Database Objects driver. The configure script will use them to enable the ADO drivers. The configure script will fail if it does not find any database driver.
First to get the LZMA and CURL support, it is necessary to install the following packages before configuring AWA:
sudo apt-get install liblzma-dev libcurl4-openssl-dev
MySQL Development installation
sudo apt-get install libmysqlclient-dev
MariaDB Development installation
sudo apt-get install mariadb-client libmariadb-client-lgpl-dev
SQLite Development installation
sudo apt-get install libsqlite3-dev
PostgreSQL Development installation
sudo apt-get install postgresql-client libpq-dev
It is recommended to use msys2 available at https://www.msys2.org/
and use the
pacman command to install the required packages.
pacman -S git pacman -S make pacman -S unzip pacman -S base-devel --needed pacman -S mingw-w64-x86_64-sqlite3
For Windows, the installation is a little bit more complex and manual.
You may either download the files from MySQL and SQLite download sites
or you may use the files provided by Ada Database Objects and
Ada LZMA in the
For Windows 32-bit, extract the files:
cd ada-ado/win32 && unzip sqlite-dll-win32-x86-3290000.zip cd ada-lzma/win32 && unzip liblzma-win32-x86-5.2.4.zip
For Windows 64-bit, extract the files:
cd ada-ado/win32 && unzip sqlite-dll-win64-x64-3290000.zip cd ada-lzma/win32 && unzip liblzma-win64-x64-5.2.4.zip
If your GNAT 2019 compiler is installed in
C:/GNAT/2019, you may
install the liblzma, MySQL and SQLite libraries by using msys cp with:
cp ada-lzma/win32/*.dll C:/GNAT/2019/bin cp ada-lzma/win32/*.dll C:/GNAT/2019/lib cp ada-lzma/win32/*.a C:/GNAT/2019/lib cp ada-ado/win32/*.dll C:/GNAT/2019/bin cp ada-ado/win32/*.dll C:/GNAT/2019/lib cp ada-ado/win32/*.lib C:/GNAT/2019/lib cp ada-ado/win32/*.a C:/GNAT/2019/lib
The library uses the
configure script to detect the build environment,
check for Ada Utility Library library.
configure script provides several standard options
and you may use:
--prefix=DIRto control the installation directory,
--enable-sharedto enable the build of shared libraries,
--disable-staticto disable the build of static libraries,
--enable-distribto build for a distribution and strip symbols,
--disable-distribto build with debugging support,
--enable-coverageto build with code coverage support (
--with-aws=PATHto control the installation path of Ada Web Server,
--with-xmlada=PATHto control the installation path of XML/Ada,
--helpto get a detailed list of supported options.
In most cases you will configure with the following command:
By default, the framework will be installed in
If you want to install the framework in a specific directory, use the
--prefix option as follows:
After configuration is successful, you can build the library by running:
The installation is done by running the
To use the library in an Ada project, add the following line at the beginning of your GNAT project file:
Depending on your application, you may also need to add the following GNAT projects which are provided by one or several of the libraries that Ada Web Application relies on:
with "utilada"; with "elada"; with "security"; with "servletada"; with "servletada_aws"; with "asf"; with "ado_mysql"; with "ado_sqlite"; with "ado_postgresql";
The library comes with several optional modules that you decide to use according to your needs.
When you decide to use a module, you should add the GNAT project that corresponds to the module
you wish to integrate For example, to use the
Wikis modules, you will need
the following lines in your GNAT project:
with "awa_jobs"; with "awa_wikis";