Barracuda Application Server C/C++ Reference
Native APIs, integration guides, and platform interfaces
Mako Server: Win32 and x64 builds

Open mako.sln, select Win32 or x64, then choose Debug or Release and build. Use Release for performance measurements.

The projects use the version embedded in the released SDK's HttpServer.h. No BASLIB.VER file or project version definition is needed for a released SDK. An unstamped SVN development checkout needs BASLIB_VER_NO set to its actual revision; follow the development version step.

The default mako.vcxproj automatically selects SharkSSL's matching assembly:

Selected platform Included files Excluded files
Win32 (32-bit) X86_MSVC X64_MSVC
x64 (64-bit) X64_MSVC X86_MSVC

Seeing the x86 files excluded while x64 is selected is expected. Switching to Win32 reverses the exclusions; do not manually enable both sets.

Enabled optimizations

These C/C++ preprocessor definitions are already set in mako.vcxproj for both Debug and Release. No additional definitions are needed for the supplied backends with the default SharkSSL algorithm settings.

Definition Win32 x64
SHARKSSL_OPTIMIZED_GHASH_ASM 1 1
SHARKSSL_OPTIMIZED_GCM_ASM 1 1
SHARKSSL_OPTIMIZED_CHACHA_ASM 1 1
SHARKSSL_OPTIMIZED_POLY1305_ASM 1 1
SHARKSSL_X25519_ASM_HOOK 1 1
SHARKSSL_OPTIMIZED_GCM_VAES_ASM 0 1

Each Debug/Release and Win32/x64 configuration lists all six settings together. To inspect or edit them, select the configuration and platform in mako project Properties > C/C++ > Preprocessor > Preprocessor Definitions. Reload the project if Visual Studio still shows the earlier VAES-only entry. These are C compiler settings, not MASM definitions. Leave SHARKSSL_OPTIMIZED_BIGINT_ASM=0; X25519 uses its own hook.

CPU and OS checks select supported acceleration at runtime, with fallback when unavailable. Keep global /arch:AVX2 disabled. For optional algorithm settings, see the x86 build guide or x64 build guide.

Output

mako.exe and the matching mymodule.dll are written to ../obj/VcMake/<Platform>/<Configuration>/. Place the required mako.zip beside the executable for normal server use.

PSA project

From an ordinary CMD prompt in this directory, run ..\BuildPsa.cmd after building Debug x64 in Visual Studio. It warns, deletes the old simulator state after you type RESET, and uses the existing executable to create and verify fresh state. It takes no arguments and always uses ../obj/VcMake/psa/x64/Debug/. It does not compile code. See the Windows quick start for setup details, startup error numbers, and deliberate test-store reset.

Open mako-psa.vcxproj directly for the Windows PSA build. It enables BA_ENABLE_TPM=1 and SHARKSSL_PSA_CONSUMER=1, omits native crypto assembly, includes mDNS, and supports Debug/Release on Win32/x64. Its default development configuration builds the provider dependency and uses the shared Windows initializer through src/PsaSimInit.c, the supplied makoInitPsa() adapter. The provider stays open across Lua debugger restarts. The normal mako.sln remains the default softTPM build.

MSBuild property SharkSslUseSha512 defaults to 1 (HKDF-SHA-512). Set /p:SharkSslUseSha512=0 for HKDF-SHA-256; the project passes the value to both BAS and the simulator library. An external provider must support the selected hash. Changing it requires root and data migration.

For a different provider, set the Boolean MSBuild property PsaTestSimulator=false. Set the following string properties in the project's UserMacros group or environment before starting Visual Studio/MSBuild. In this mode they default to empty; lists use semicolons.

Property Value
PsaIncludeDirectories Required: include directories for the headers matching your provider.
PsaLibraries Required: provider libraries and their required system libraries.
PsaLibraryDirectories Optional: search directories when library paths are not absolute.
PsaSourceFiles Optional: paths to platform or driver C files. Include your makoInitPsa() implementation here unless you add it directly to the project.

In target-provider mode, the build reports a configuration error until the two required properties are supplied. Match the provider's architecture and runtime library to the selected configuration. BAS.c already compiles lpsa.c and the SharkSSL consumer adapters; their project entries are for browsing only.

For your target provider, implement int makoInitPsa(void) and select the root setup described in Mako's PSA startup instructions. Build the project:

rem Run from this VcMake directory.
msbuild mako-psa.vcxproj /m /p:Configuration=Debug /p:Platform=x64

The executable is ../obj/VcMake/psa/<Platform>/<Configuration>/mako-psa.exe, with separate intermediate files. The build copies the SDK's ../obj/mako.zip beside it. In an SVN checkout, it falls back to BAS-Resources/build/mako.zip. Override MakoResourcesZip to use another current archive. Standalone Xedge's xedge-psa.vcxproj uses the same provider properties and XedgeResourcesC for its PSA resource C file.