mirror of
https://github.com/xroche/httrack.git
synced 2026-06-29 05:26:32 +03:00
The generated build system (configure, every Makefile.in, config.h.in, ltmain.sh, config.guess/sub, the aux scripts) was committed so a bare git clone could build without autotools. Nothing downstream relied on the committed copies: CI runs autoreconf -fi, Debian regenerates via dh_autoreconf, and the release tarball is built by make dist, which regenerates them regardless. The only cost was a recurring footgun: a stale Makefile.in after a *_SOURCES edit silently broke the plain build (undefined reference to cache_selftests), and CI could not catch it. Treat them as build products. They are now .gitignored and regenerated from configure.ac/Makefile.am by the new ./bootstrap (autoreconf -fi), and shipped only inside make dist tarballs so tarball users still need no autotools. build.sh is a one-shot wrapper (bootstrap + configure + make) that runs configure via /bin/sh, so it survives a noexec source tree. Both scripts join EXTRA_DIST. INSTALL.Linux, README.md and AGENTS.md document the git flow: ./bootstrap before ./configure, autotools required for a git build. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com>
35 lines
1.3 KiB
Bash
Executable File
35 lines
1.3 KiB
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# One-shot build from a git checkout: bootstrap (autoreconf) -> configure -> make.
|
|
# A convenience wrapper; the canonical steps are ./bootstrap && ./configure && make.
|
|
#
|
|
# Extra arguments are passed straight to ./configure, e.g.
|
|
# ./build.sh --prefix="$HOME" --disable-https
|
|
#
|
|
# Build out of tree (recommended; required if the source tree is read-only or
|
|
# mounted noexec) by pointing BUILD_DIR at a scratch directory:
|
|
# BUILD_DIR=/var/tmp/httrack-build ./build.sh
|
|
#
|
|
# On a noexec filesystem the executable bit does not take effect, so invoke the
|
|
# script explicitly with sh: sh build.sh
|
|
#
|
|
# Requires autoconf/automake/libtool (for bootstrap); the release tarball ships
|
|
# ./configure, so from a tarball just run ./configure && make.
|
|
|
|
set -e
|
|
|
|
# shellcheck disable=SC1007 # "CDPATH= cd" is a deliberate empty-CDPATH prefix.
|
|
srcdir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
|
|
|
# 1. Regenerate the build system in the source tree (autotools requires it).
|
|
sh "$srcdir/bootstrap"
|
|
|
|
# 2. Configure and build, out of tree when BUILD_DIR is set.
|
|
builddir=${BUILD_DIR:-$srcdir}
|
|
mkdir -p "$builddir"
|
|
cd "$builddir"
|
|
# Invoke configure via the shell, not execve: it is a portable sh script, and a
|
|
# noexec source tree (or a cleared executable bit) would make ./configure fail.
|
|
"${CONFIG_SHELL:-/bin/sh}" "$srcdir/configure" "$@"
|
|
make
|