Compiling software from source code on Linux is often described in online guides with the traditional three-step formula: ./configure && make && sudo make install. However, downloading an open-source GitHub repository, extracting the tarball, typing ./configure, and being met with the immediate error: ‘bash: ./configure: No such file or directory’ halts compilation before it begins. This error does not indicate that your Linux shell is broken; rather, it indicates that the project does not use a pre-generated Autotools configure script or utilizes a modern build system like CMake, Meson, or Ninja. Knowing how to inspect project files and generate build recipes resolves this instantly.
Why Is ./configure Missing?
The ./configure script is an automated shell script generated by GNU Autotools to check for system libraries and compiler dependencies. It is missing because:
- Unbuilt Autotools Git Repository: Developers who publish source code directly to GitHub often omit the generated
configurescript from Git to keep repositories lightweight, providing anautogen.shorbootstrapscript instead. - Modern Build Systems (CMake / Meson): The project uses modern cross-platform build systems that rely on
CMakeLists.txtormeson.buildrather than legacy Autotools. - Language-Specific Build Systems: Projects written in Rust (
Cargo.toml), Go (go.mod), or Python (pyproject.toml) that do not use standard C makefiles. - Missing Execute Permissions: The
configurefile exists in the directory but lacks execution (+x) permissions, causing bash to fail execution. - Wrong Working Directory: Running the command from the parent folder rather than entering the extracted source directory.
Step 1: Inspect the Project Directory Structure
The first step is listing the exact files in the project folder to identify which build system the software uses.
- In your terminal, navigate to your extracted project directory:
cd /path/to/extracted-source/ - List all files, including hidden files:
ls -la - Look for key build configuration files:
- If you see autogen.sh or bootstrap.sh, proceed to Step 2.
- If you see configure.ac or configure.in, proceed to Step 3.
- If you see CMakeLists.txt, proceed to Step 4.
- If you see meson.build, proceed to Step 5.
Step 2: Generate the configure Script Using autogen.sh
In many cloned Git repositories, running the bootstrap script invokes GNU Autotools to build the configure file for your specific environment.
- Ensure you have the required Autotools packages installed:
# On Ubuntu/Debian: sudo apt update && sudo apt install -y autoconf automake libtool build-essential # On Fedora/RHEL: sudo dnf install -y autoconf automake libtool make gcc - Grant execute permissions to the generation script and run it:
chmod +x autogen.sh ./autogen.sh - The script will execute
aclocal,autoheader, andautomaketo produce a validconfigurefile. - Once complete, run your standard compilation commands:
./configure make sudo make install
Step 3: Generate configure via autoreconf
If the repository contains configure.ac but no autogen.sh, use the universal autoreconf utility.
- Execute
autoreconfwith install and force flags:autoreconf -i -f - The utility will inspect
configure.acand create the missingconfigurescript along with supporting makefile templates. - Run
ls -l configureto verify the script was created, then proceed with./configure.
Step 4: Build Projects Using CMake
If the directory contains a file named CMakeLists.txt, the software compiles using the modern CMake build system.
- Install CMake:
sudo apt install -y cmake build-essential - Create an isolated build directory to keep source code clean:
mkdir build && cd build - Configure and compile the project:
cmake .. make -j$(nproc) sudo make install
Step 5: Build Projects Using Meson and Ninja
If the directory contains meson.build, use the high-performance Meson build engine.
- Install Meson and Ninja:
sudo apt install -y meson ninja-build - Set up the build directory:
meson setup build - Compile and install:
ninja -C build sudo ninja -C build install
Identifying the correct build system and generating necessary configure scripts ensures that open-source software compiles cleanly on any Linux system.