configuring-the-build

Configures autotools build settings for compilers, flags, and sanitizer variants.

3.3k|1.1k|Updated Nov 24, 2014
One-click install
npx skills add https://github.com/stellar/stellar-core --skill configuring-the-build
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: configuring-the-build
Source: https://github.com/stellar/stellar-core/tree/main/.claude/skills/configuring-the-build
Command: npx skills add https://github.com/stellar/stellar-core --skill configuring-the-build

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Developers working on stellar-core need to correctly modify the autotools-based build configuration—switching compilers, adjusting compile flags, or enabling sanitizer instrumentation—without breaking the build by editing generated files or misusing configure options.

Core Features & Use Cases

  • Compiler and Flag Configuration: Switch between gcc and clang via CC/CXX variables, and adjust CXXFLAGS for optimization, debuginfo, or C++ standard library selection.
  • Build Variant Control: Enable or disable build variants such as --disable-tests and --disable-postgres to match development or shipping configurations.
  • Diagnostic Instrumentation: Turn on compile-time sanitizers and checks including --enable-asan, --enable-threadsanitizer, --enable-memcheck, --enable-undefinedcheck, --enable-extrachecks, and --enable-fuzz.
  • Use Case: You want to run a thread sanitizer build to catch data races. Re-run ./configure --enable-threadsanitizer --enable-ccache --enable-sdfprefs from the top level, then do a clean build since object files will have stale content.

Quick Start

Reconfigure the stellar-core build to use gcc with address sanitizer enabled by running autogen.sh and configure with the appropriate flags.

Frequently Asked Questions about configuring-the-build

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I switch the C++ compiler from clang to gcc in an autotools build?

Pass CC and CXX variables when running configure, for example `CXX=g++ CC=gcc ./configure ...`. This changes the compiler without editing any build files, and the build should work with both gcc and clang.

How do I enable address sanitizer in a configure-based C++ build?

Re-run configure with the `--enable-asan` flag to turn on address sanitizer instrumentation. You must do a clean build afterward because existing object files will have the wrong content.

Can I edit the generated configure or Makefile files directly?

No, never edit `configure`, `Makefile`, or `Makefile.in` directly since they are generated files. Only edit `configure.ac` and `Makefile.am`, then re-run `./autogen.sh` and `./configure` to regenerate them.

Why does my build break after enabling a sanitizer flag?

Sanitizer flags like `--enable-asan` or `--enable-threadsanitizer` change compile-time instrumentation, so stale object files cause failures. Perform a clean build after enabling any instrumentation flag.

How do I see which configuration flags are currently set?

Look at the head of the `config.log` file in the build directory, which records the flags used in the most recent configure run. If errors occur during configuration, they are also written to `config.log`.