Building Appweb from Source
Appweb releases are available as source code distributions. Several build environments are supported:
- Linux — Linux 3 with GNU C/C++ or later
- Windows — Microsoft Windows 7 with Visual Studio 2017 or later
- Mac OS X — Mac OS X 10.11 (Yosemite) or later
The source code has been designed to run on FreeBSD, Linux, Mac OS X, and other operating systems. It has been tested under Fedora and Ubuntu Linux based on the Linux 3 Kernel and MAC OS X.
Accessing the Source Code
With each Appweb release, a complete source code snapshot is provided. You can download a source package from the EmbedThis Builder site.
Download SourceBuilding Appweb from Source
The Appweb source distribution contains all the required source files, headers, and test framework to reconfigure, build, and verify Appweb. The software supports three methods for building from source.
Building via make is the simplest way to build. Use make if you want a default build or if you need to integrate Appweb with an existing make-based build system.
Build with MakeMe on Linux or MacOS if you want to customize or configure the software for your system, or if you need to cross-compile for another operating system or architecture.
Use the Visual Studio or Xcode if you are most comfortable with these tools and want a default build.
Building
We use the MakeMe tool internally to generate the Appweb Makefiles, MakeMe and IDE projects. This cool tool generates clean, efficient makefiles and projects. The MakeMe project documents how to use these generated Makefiles and projects as they are the same for all projects that use MakeMe. For full details, read on, courtesy of MakeMe:
Regular Expressions (optional)
Appweb ships no regular expression engine. Route patterns, Alias prefixes, {token} segments and alternations of literals are matched natively by a compact, non-backtracking matcher. This covers the great majority of configurations, and it means a crafted request URI cannot drive the matcher into pathological behaviour.
Some pattern constructs are genuine regular expressions and need an engine:
- Sub-expressions in a route pattern, such as (user|admin)
- Character classes, such as [a-z]
- Repeat counts, such as \{2,4}
- Lookahead, such as ((?!\.php).*)
- Token fields with a pattern, such as {cmd=[0-9]+}
- A ServerName written as a regular expression, i.e. beginning and ending with "/"
If you need these, supply your own PCRE2 library and build with the --pcre2 option. You own the library: you choose the version, and you patch it on your own schedule.
brew install pcre2 # macOS. Or: apt install libpcre2-dev, vcpkg install pcre2
cd projects
premake5 --pcre2 gmake
cd ..
make
If PCRE2 is installed somewhere unusual, name the location:
premake5 --pcre2 --pcre2-path=/opt/pcre2 gmake
For constrained targets without an autotools toolchain, PCRE2 provides a NON-AUTOTOOLS-BUILD path — no configure, no cmake, just compile the sources.
If a configuration uses a pattern that needs an engine and Appweb was built without PCRE2, the server reports the offending pattern when it parses the configuration and does not start. It never fails silently at request time. Configuration that depends on regular expressions can be guarded with the <if PCRE2> conditional:
<if PCRE2>
<Route ^/route/(user|admin)/{cmd}$>
Target write 200 "${cmd}"
</Route>
</if>