build: remove autotools configuration from scripts

This commit is contained in:
Jan Vaclav
2024-08-22 13:14:01 +02:00
parent 82a6a82031
commit 12b5b8317b
12 changed files with 196 additions and 558 deletions

View File

@@ -13,24 +13,6 @@ die() {
# plugins. Note that this depends on how NetworkManager and
# the plugins are build. For example, compiling without
# --with-more-asserts will yield less symbols.
#
# _build re-builds NetworkManager with relevant compile time
# options to yield the most symbols.
_build() {
git clean -fdx
./autogen.sh --enable-ld-gc \
--enable-ifcfg-rh \
--enable-ifupdown \
--enable-teamdctl \
--enable-wifi \
--with-modem-manager-1 \
--with-ofono \
--with-more-asserts \
--with-more-logging \
--disable-autotools-deprecation
make -j20
}
_sort() {
LANG=C sort -u
}
@@ -75,16 +57,6 @@ pretty() {
sed 's/.*/\t&;/'
}
do_build() {
do_update
make
}
do_rebuild() {
_build
do_build
}
do_update() {
do_generate > ./src/core/NetworkManager.ver
}
@@ -117,14 +89,6 @@ EOF
test -f ./src/core/${libs}libNetworkManager.a || die "must be called from NetworkManager top build dir after building the tree"
case "$1" in
rebuild)
[ -n "$from_meson" ] && die "can't do a build when called from meson"
do_rebuild
;;
build)
[ -n "$from_meson" ] && die "can't do a build when called from meson"
do_build
;;
--called-from-build)
if test -z "${NM_BUILD_NO_CREATE_EXPORTS+x}"; then
do_update

View File

@@ -4,11 +4,6 @@ set -ex
cd /NetworkManager
if [ -f ./config.log ] ; then
make -j 5 install
else
meson install -C build
fi
meson install -C build
systemctl daemon-reload
systemctl restart NetworkManager.service

View File

@@ -1,4 +1,3 @@
alias m="make -j 8"
alias n="ninja -C build"
alias l='ls -l --color=auto'

View File

@@ -229,7 +229,6 @@ RUN dnf install -y \\
libtool \\
libubsan \\
libuuid-devel \\
make \\
meson \\
mlocate \\
mobile-broadband-provider-info-devel \\

View File

@@ -35,9 +35,7 @@ usage() {
echo " the automatism to always launch a D-Bus session"
echo " --no-launch-dbus|-D: prevent launching a D-Bus session"
echo " --no-libtool: when running with valgrind, the script tries automatically to"
echo " use libtool as necessary. This disables libtool usage"
echo " --make-first|-m: before running the test, make it (only works with autotools build)"
echo " --no-make-first|-M: disable --make-first option"
echo " use libtool as necessary. This disables libtool usage"
echo " --valgrind|-v: run under valgrind"
echo " --no-valgrind|-V: disable running under valgrind (overrides NMTST_USE_VALGRIND=1)"
echo " -d: set NMTST_DEBUG=d"
@@ -126,8 +124,6 @@ if [ "$CALLED_FROM_MAKE" == 1 ]; then
NMTST_LAUNCH_DBUS=0
fi
TEST="$1"; shift
NMTST_MAKE_FIRST=0
TEST_ARGV=("$@")
else
if [[ -z "${NMTST_USE_VALGRIND+x}" ]]; then
@@ -162,14 +158,6 @@ else
NMTST_LIBTOOL=()
shift
;;
--make-first|-m)
NMTST_MAKE_FIRST=1
shift
;;
--no-make-first|-M)
NMTST_MAKE_FIRST=0
shift
;;
"--valgrind"|-v)
NMTST_USE_VALGRIND=1
shift;
@@ -235,14 +223,6 @@ fi
[ -n "$TEST" ] || die "Missing test name. Specify it on the command line."
if _is_true "$NMTST_MAKE_FIRST" 0; then
git_dir="$(readlink -f "$(git rev-parse --show-toplevel)")"
rel_path="$(realpath --relative-to="$git_dir" -m "$TEST" 2>/dev/null)" || die "cannot resolve test-name \"$TEST\". Did you call the script properly?"
cd "$git_dir"
make -j5 "$rel_path" || die "make of $TEST failed ($git_dir / $rel_path)"
cd - 1>/dev/null
fi
[ -x "$TEST" ] || die "Test \"$TEST\" does not exist"
TEST_PATH="$(readlink -f "$(dirname "$TEST")")"
TEST_NAME="${TEST##*/}"

View File

@@ -1,56 +0,0 @@
#!/bin/bash
set -e
die() {
echo "$@"
exit 1
}
if [[ "x$(LANG=C git clean -ndx)" != x ]]; then
die "The working directory is not clean. Refuse to run. Try \`git clean -dx -n\`"
fi
if [[ "x$(git status --porcelain)" != x ]]; then
die "The working directory has local changes. Refuse to run. Try \`git reset --hard\`"
fi
build_out_of_tree() {
local TARGET="$1"
local C="$2"
local M="$3"
(
git clean -fdx || return 1
NOCONFIGURE=x ./autogen.sh || return 1
mkdir -p x/y || return 1
cd x/y || return 1
../../configure $C $NMTST_CONFIGURE || return 1
make $TARGET $M $NMTST_MAKE || return 1
)
}
TARGETS=("$@")
if [ "${#TARGETS}" -lt 1 ]; then
TARGETS=(
dispatcher/nm-dispatcher
src/core/NetworkManager
src/core/dhcp/nm-dhcp-helper
src/core/ndisc/tests/test-ndisc-linux
src/core/platform/tests/monitor
src/nm-online/nm-online
src/nmcli/nmcli
src/nmtui/nmtui
$(git grep -h '\.l\?a\>' Makefile.am | sed 's/[a-zA-Z.0-9_-/]\+/\n\0\n/g' | sort -u | grep '\.l\?a$')
)
fi
set -x
cd "$(dirname "$(readlink -f "$0")")/.."
IDX=($(seq 0 $((${#TARGETS[@]} - 1))))
IDX=($(printf '%s\n' "${IDX[@]}" | sort -R))
for idx in "${IDX[@]}"; do
TARGET="${TARGETS[$idx]}"
echo "### $idx: TARGET=$TARGET"
build_out_of_tree "$TARGET" "--enable-gtk-doc" "-j 5"
done