wolfSSL Buildfest 2026: autotools

When building wolfSSL on Linux, macOS, BSD, WSL, or any Unix-like host, or when cross-compiling with a GNU-style toolchain, the Autotools ./configure build system is the canonical and most heavily tested way to build wolfSSL.

Instead of writing a configuration header by hand, you choose features with –enable-* and –disable-* options. The configure step then records every resulting define in a generated header, wolfssl/options.h, which your application includes so that it sees the same configuration as the library.

When should I use Autotools?


Use Autotools when:

  • You are building on Linux, macOS, BSD, WSL, Cygwin, or MSYS2.
  • You are cross-compiling with a toolchain that has gcc/clang-style command lines.
  • You want to install wolfSSL system-wide and consume it with pkg-config or CMake find_package().
  • You want a quick, reproducible build from a single command line.
  • You want to run the full wolfSSL test suite with make check.

If you are using a vendor IDE or a bare-metal build with no shell or configure step, you generally do not want Autotools. Use user_settings.h instead.

CMake is also supported and maps almost one-to-one onto the configure options.

How does the Autotools build work?


./configure reads the options you pass, works out the matching C preprocessor defines, and writes them to:

wolfssl/options.h

The library is compiled with those defines, and your application must see the same ones. Your application should include:

#include 

before including any other wolfSSL header. Alternatively, compile your application with -DWOLFSSL_USE_OPTIONS_H and wolfSSL’s headers will pull in options.h for you.

A typical flow therefore looks like:

wolfssl/
├── configure.ac        <- source of truth for every option
├── configure           <- generated by ./autogen.sh
└── wolfssl/
    └── options.h       <- generated by ./configure

Step 1: Generate the configure script (git checkouts only)

If you cloned wolfSSL from GitHub, run:

./autogen.sh

This requires autoconf, automake, and libtool.
Release tarballs downloaded from wolfssl.com ship with a prebuilt configure script, so you can skip this step.

Step 2: Configure


Run ./configure with the options your application needs.
For example:

./configure --enable-tls13 --enable-curve25519 --enable-ed25519 --enable-sni --enable-alpn

To see every available option:

./configure --help

Extra compiler defines can be passed through CFLAGS or EXTRA_CFLAGS:

./configure CFLAGS="-DWOLFSSL_DTLS_NO_HVR_ON_RESUME"

When cross-compiling, add the usual --host triple and compiler:

./configure --host=arm-linux-gnueabihf CC=arm-linux-gnueabihf-gcc

Step 3: Build, test, and install


make -j
make check
sudo make install

make check is optional but strongly recommended. It runs the wolfCrypt self-tests, the TLS unit tests, and client/server loopback tests.

make install installs the library, headers (including options.h), a wolfssl.pc pkg-config file, and CMake package files.

If you can't or don't want to use sudo, install to a prefix you own with ./configure --prefix=$HOME/wolfssl-install and run plain make install. You will then need PKG_CONFIG_PATH (and LD_LIBRARY_PATH at runtime, for shared builds) to point at that prefix.

Step 4: Build your application against wolfSSL


With pkg-config:

gcc -o myapp myapp.c $(pkg-config --cflags --libs wolfssl)

Or from a CMake project:

find_package(wolfssl CONFIG REQUIRED)
target_link_libraries(myapp PRIVATE wolfssl::wolfssl)

In your source:

#include 
#include 

Why use configure options instead of hand-written defines?


You generally should not hand-assemble a long list of -D flags for an Autotools build.

Configure options give you:

  • Correct dependency handling between features
  • Sensible defaults for your host platform
  • A generated options.h that exactly matches the library
  • Application recipes that set exactly the flags a given project needs
  • Easy reproduction: the full configure line is recorded in config.log

What are the defaults?


A plain ./configure already enables:

  • TLS 1.2 and TLS 1.3
  • ECC and RSA
  • AES (including AES-GCM), SHA-2, ChaCha20-Poly1305
  • ML-KEM
  • Hardening (timing resistance and blinding)
  • SP math for the full algorithm suite (--enable-sp-math-all)
  • SNI, on x86, x86_64, and aarch64 hosts

The faster single-precision implementation for common key sizes is not on by default. Add --enable-sp --enable-sp-asm to get it.

A common mistake: configuring the library and application differently


One of the most common wolfSSL build problems is a mismatch between the configuration used to compile the wolfSSL library and the configuration used by the application.

For example, if the library was built with --enable-opensslextra but the application does not include options.h, structures can have different layouts in the library and the application. The build succeeds, but the program crashes or corrupts memory at runtime.

The application and wolfSSL library need to use the same configuration.

Always include first, or compile with -DWOLFSSL_USE_OPTIONS_H.

What about user_settings.h?


Autotools can also build from a user_settings.h file.

Place user_settings.h in the root of the wolfSSL source tree and run:

./configure --enable-usersettings --disable-examples
make

This is a handy way to sanity-check an embedded user_settings.h configuration on your host before taking it to your IDE.

Quick troubleshooting checklist


If your build isn't behaving the way you expect, check these first:

  1. Did you run ./autogen.sh after cloning (or after pulling changes to configure.ac)?
  2. Does config.log show the configure line you think you used?
  3. Does your application include before other wolfSSL headers?
  4. Are you linking against the library you just built, not an older system-installed copy? Check ldd and pkg-config --modversion wolfssl.
  5. Are you accidentally mixing a generated options.h with WOLFSSL_USER_SETTINGS?
  6. Is wolfSSL_Debugging_ON() silent? Rebuild with --enable-debug.
  7. Does make check pass for this configuration?

If you have questions about any of the above, please contact us at facts@wolfssl.com or call us at +1 425 245 8247.

Download wolfSSL Now