build: remove autotools configuration from scripts
This commit is contained in:
@@ -21,8 +21,6 @@ usage() {
|
||||
echo " -g|--git: create tarball from current git HEAD (skips make dist)"
|
||||
echo " -Q|--quick: only create the distribution tarball, without running checks"
|
||||
echo " -N|--no-dist: skip creating the source tarball if you already did \`make dist\`"
|
||||
echo " -m|--meson: (default) use meson to create the source tarball"
|
||||
echo " -A|--autotools: use autotools to create the source tarball"
|
||||
echo " -w|--with \$OPTION: pass --with \$OPTION to rpmbuild. For example --with debug"
|
||||
echo " -W|--without \$OPTION: pass --without \$OPTION to rpmbuild. For example --without debug"
|
||||
echo " -s|--snapshot TEXT: use TEXT as the snapshot version for the new package (overwrites \$NM_BUILD_SNAPSHOT environment)"
|
||||
@@ -99,14 +97,6 @@ while [[ $# -gt 0 ]]; do
|
||||
IGNORE_DIRTY=1
|
||||
SOURCE_FROM_GIT=1
|
||||
;;
|
||||
-m|--meson)
|
||||
[ "$USE_AUTOTOOLS" = 1 ] && die "conflicting argument: $A when building with autotools is requested";
|
||||
USE_MESON=1
|
||||
;;
|
||||
-A|--autotools)
|
||||
[ "$USE_MESON" = 1 ] && die "conflicting argument: $A when building with meson is explicitly requested";
|
||||
USE_AUTOTOOLS=1
|
||||
;;
|
||||
-Q|--quick)
|
||||
QUICK=1
|
||||
;;
|
||||
@@ -203,96 +193,48 @@ get_version_meson() {
|
||||
}
|
||||
|
||||
if [[ $NO_DIST != 1 ]]; then
|
||||
if [[ $USE_AUTOTOOLS != 1 ]]; then
|
||||
meson setup "$GITDIR/build" \
|
||||
--prefix=/usr \
|
||||
--bindir=/usr/bin \
|
||||
--sbindir=/usr/sbin \
|
||||
--sysconfdir=/etc \
|
||||
--datadir=/usr/share \
|
||||
--includedir=/usr/include \
|
||||
--libdir=/usr/lib \
|
||||
--libexecdir=/usr/libexec \
|
||||
--localstatedir=/var \
|
||||
--sharedstatedir=/var/lib \
|
||||
--mandir=/usr/share/man \
|
||||
--infodir=/usr/share/info \
|
||||
-Ddocs=true \
|
||||
-Dintrospection=true \
|
||||
-Difcfg_rh=true \
|
||||
-Difupdown=true \
|
||||
-Dconfig_logging_backend_default=syslog \
|
||||
-Dconfig_wifi_backend_default=wpa_supplicant \
|
||||
-Dlibaudit=yes-disabled-by-default \
|
||||
-Dpolkit=true \
|
||||
-Dnm_cloud_setup=true \
|
||||
-Ddhclient=/usr/sbin/dhclient \
|
||||
-Dconfig_dhcp_default=internal \
|
||||
-Dconfig_dns_rc_manager_default=auto \
|
||||
-Diptables=/usr/sbin/iptables \
|
||||
-Dnft=/usr/bin/nft \
|
||||
|| die "Error meson setup"
|
||||
meson setup "$GITDIR/build" \
|
||||
--prefix=/usr \
|
||||
--bindir=/usr/bin \
|
||||
--sbindir=/usr/sbin \
|
||||
--sysconfdir=/etc \
|
||||
--datadir=/usr/share \
|
||||
--includedir=/usr/include \
|
||||
--libdir=/usr/lib \
|
||||
--libexecdir=/usr/libexec \
|
||||
--localstatedir=/var \
|
||||
--sharedstatedir=/var/lib \
|
||||
--mandir=/usr/share/man \
|
||||
--infodir=/usr/share/info \
|
||||
-Ddocs=true \
|
||||
-Dintrospection=true \
|
||||
-Difcfg_rh=true \
|
||||
-Difupdown=true \
|
||||
-Dconfig_logging_backend_default=syslog \
|
||||
-Dconfig_wifi_backend_default=wpa_supplicant \
|
||||
-Dlibaudit=yes-disabled-by-default \
|
||||
-Dpolkit=true \
|
||||
-Dnm_cloud_setup=true \
|
||||
-Ddhclient=/usr/sbin/dhclient \
|
||||
-Dconfig_dhcp_default=internal \
|
||||
-Dconfig_dns_rc_manager_default=auto \
|
||||
-Diptables=/usr/sbin/iptables \
|
||||
-Dnft=/usr/bin/nft \
|
||||
|| die "Error meson setup"
|
||||
|
||||
VERSION="${VERSION:-$(get_version_meson || die "Could not read $VERSION")}"
|
||||
if [[ $QUICK == 1 ]]; then
|
||||
meson dist --allow-dirty -C "$GITDIR/build/" --no-tests || die "Error meson dist"
|
||||
else
|
||||
meson dist --allow-dirty -C "$GITDIR/build/" || die "Error meson dist with tests"
|
||||
fi
|
||||
export SOURCE="$(ls -1 "$GITDIR/build/meson-dist/NetworkManager-${VERSION}.tar.xz" 2>/dev/null | head -n1)"
|
||||
else
|
||||
./autogen.sh \
|
||||
--with-runstatedir=/run \
|
||||
--program-prefix= \
|
||||
--prefix=/usr \
|
||||
--exec-prefix=/usr \
|
||||
--bindir=/usr/bin \
|
||||
--sbindir=/usr/sbin \
|
||||
--sysconfdir=/etc \
|
||||
--datadir=/usr/share \
|
||||
--includedir=/usr/include \
|
||||
--libdir=/usr/lib \
|
||||
--libexecdir=/usr/libexec \
|
||||
--localstatedir=/var \
|
||||
--sharedstatedir=/var/lib \
|
||||
--mandir=/usr/share/man \
|
||||
--infodir=/usr/share/info \
|
||||
\
|
||||
--disable-dependency-tracking \
|
||||
--enable-gtk-doc \
|
||||
--enable-introspection \
|
||||
--enable-ifcfg-rh \
|
||||
--enable-ifupdown \
|
||||
--with-config-logging-backend-default=syslog \
|
||||
--with-config-wifi-backend-default=wpa_supplicant \
|
||||
--with-libaudit=yes-disabled-by-default \
|
||||
--enable-polkit=yes \
|
||||
--with-nm-cloud-setup=yes \
|
||||
--with-dhclient=yes \
|
||||
--with-config-dhcp-default=internal \
|
||||
--with-config-dns-rc-manager-default=auto \
|
||||
\
|
||||
--with-iptables=/usr/sbin/iptables \
|
||||
--with-nft=/usr/sbin/nft \
|
||||
--disable-autotools-deprecation \
|
||||
\
|
||||
|| die "Error autogen.sh"
|
||||
if [[ $QUICK == 1 ]]; then
|
||||
make dist -j 7 || die "Error make dist"
|
||||
else
|
||||
make distcheck -j 7 || die "Error make distcheck"
|
||||
fi
|
||||
VERSION="${VERSION:-$(get_version_meson || die "Could not read $VERSION")}"
|
||||
TEST_FLAG=""
|
||||
if [[ $QUICK == 1 ]]; then
|
||||
TEST_FLAG="--no-tests"
|
||||
fi
|
||||
meson dist --allow-dirty -C "$GITDIR/build/" $TEST_FLAG || die "Error meson dist"
|
||||
export SOURCE="$(ls -1 "$GITDIR/build/meson-dist/NetworkManager-${VERSION}.tar.xz" 2>/dev/null | head -n1)"
|
||||
fi
|
||||
|
||||
if [[ "$ADD_WITH_TEST" == 1 ]]; then
|
||||
WITH_LIST=("${WITH_LIST[@]}" "--with" "test")
|
||||
fi
|
||||
|
||||
if [[ "$USE_AUTOTOOLS" != 1 ]]; then
|
||||
WITH_LIST=("${WITH_LIST[@]}" "--with" "meson")
|
||||
fi
|
||||
|
||||
export SOURCE_FROM_GIT
|
||||
export BUILDTYPE
|
||||
export NM_RPMBUILD_ARGS="${WITH_LIST[@]}"
|
||||
|
@@ -30,7 +30,7 @@ vars_with_vals() {
|
||||
}
|
||||
|
||||
usage() {
|
||||
echo "$ $0 [-m|--meson <builddir>] [-a|--autotools] [-s|--show] [-B|--no-build] [-h|--help]"
|
||||
echo "$ $0 [-m|--meson <builddir>] [-s|--show] [-B|--no-build] [-h|--help]"
|
||||
echo ""
|
||||
echo "Configure NetworkManager in a way that is similar to when building"
|
||||
echo "RPMs of NetworkManager for Fedora/RHEL. The effect is that \`make install\`"
|
||||
@@ -142,7 +142,6 @@ P_NOBUILD="${NOBUILD-0}"
|
||||
|
||||
P_DEBUG="${DEBUG-1}"
|
||||
|
||||
P_BUILD_TYPE="${BUILD_TYPE-meson}"
|
||||
P_MESON_BUILDDIR="${MESON_BUILDDIR-./build}"
|
||||
[ -n "$MESON_BUILDDIR" ] && P_MESON_BUILDDIR_FORCE=1
|
||||
P_CFLAGS="${CFLAGS-}"
|
||||
@@ -306,14 +305,10 @@ while [[ $# -gt 0 ]] ; do
|
||||
shift
|
||||
case "$A" in
|
||||
--meson|-m)
|
||||
P_BUILD_TYPE=meson
|
||||
P_MESON_BUILDDIR="$1"
|
||||
P_MESON_BUILDDIR_FORCE=1
|
||||
shift
|
||||
;;
|
||||
--autotools|-a)
|
||||
P_BUILD_TYPE=autotools
|
||||
;;
|
||||
-s|--show)
|
||||
SHOW_CMD=show_cmd
|
||||
;;
|
||||
@@ -331,7 +326,7 @@ while [[ $# -gt 0 ]] ; do
|
||||
esac
|
||||
done
|
||||
|
||||
if [ "$P_BUILD_TYPE" = meson -a "$P_MESON_BUILDDIR_FORCE" != 1 ]; then
|
||||
if [ "$P_MESON_BUILDDIR_FORCE" != 1 ]; then
|
||||
if [ -d "$P_MESON_BUILDDIR" ]; then
|
||||
echo "Build directory '$P_MESON_BUILDDIR' chosen by default, but it exists and will be overwritten." \
|
||||
"If you really want that, pass '--meson \"$P_MESON_BUILDDIR\"'." >&2
|
||||
@@ -341,181 +336,89 @@ fi
|
||||
|
||||
vars_with_vals
|
||||
|
||||
if [ "$P_BUILD_TYPE" == meson ] ; then
|
||||
MESON_RECONFIGURE=
|
||||
if test -d "$P_MESON_BUILDDIR" ; then
|
||||
MESON_RECONFIGURE="--reconfigure"
|
||||
fi
|
||||
|
||||
$SHOW_CMD \
|
||||
env \
|
||||
CC="$P_CC" \
|
||||
CFLAGS="$P_CFLAGS" \
|
||||
meson setup\
|
||||
$MESON_RECONFIGURE \
|
||||
--buildtype=plain \
|
||||
--prefix="$D_PREFIX" \
|
||||
--libdir="$D_LIBDIR" \
|
||||
--libexecdir="$D_LIBEXECDIR" \
|
||||
--bindir="$D_BINDIR" \
|
||||
--sbindir="$D_SBINDIR" \
|
||||
--includedir="$D_INCLUDEDIR" \
|
||||
--datadir="$D_DATADIR" \
|
||||
--mandir="$D_MANDIR" \
|
||||
--infodir="$D_INFODIR" \
|
||||
--localedir="$D_DATADIR"/locale \
|
||||
--sysconfdir="$D_SYSCONFDIR" \
|
||||
--localstatedir="$D_LOCALSTATEDIR" \
|
||||
--sharedstatedir="$D_SHAREDSTATEDIR" \
|
||||
--wrap-mode=nodownload \
|
||||
--auto-features=enabled \
|
||||
-Db_ndebug=false \
|
||||
--warnlevel 2 \
|
||||
$(args_enable "$P_TEST" --werror) \
|
||||
-Dnft="${D_SBINDIR}/nft" \
|
||||
-Diptables="${D_SBINDIR}/iptables" \
|
||||
-Ddhclient="${D_SBINDIR}/dhclient" \
|
||||
-Ddhcpcanon=no \
|
||||
-Ddhcpcd=no \
|
||||
-Dconfig_dhcp_default="$P_DHCP_DEFAULT" \
|
||||
"-Dcrypto=$P_CRYPTO" \
|
||||
$(args_enable "$P_DEBUG" -Dmore_logging=true -Dmore_asserts=10000) \
|
||||
$(args_enable "$(bool_not_true "$P_DEBUG")" -Dmore_logging=false -Dmore_asserts=0 ) \
|
||||
-Dld_gc=true \
|
||||
-Db_lto="$(bool_true "$P_LTO")" \
|
||||
-Dlibaudit=yes-disabled-by-default \
|
||||
-Dmodem_manager="$(bool_true "$P_MODEM_MANAGER_1")" \
|
||||
$(args_enable "$P_WIFI" -Dwifi=true -Dwext="$(bool_true "$P_FEDORA")") \
|
||||
$(args_enable "$(bool_not_true "$P_WIFI")" -Dwifi=false ) \
|
||||
-Diwd="$(bool_true "$P_IWD")" \
|
||||
-Dbluez5_dun="$(bool_true "$P_BLUETOOTH")" \
|
||||
-Dnmtui="$(bool_true "$P_NMTUI")" \
|
||||
-Dnm_cloud_setup="$(bool_true "$P_NM_CLOUD_SETUP")" \
|
||||
-Dvapi=true \
|
||||
-Dintrospection=true \
|
||||
-Ddocs="$(bool_true "$P_REGEN_DOCS")" \
|
||||
-Dteamdctl="$(bool_true "$P_TEAM")" \
|
||||
-Dovs="$(bool_true "$P_OVS")" \
|
||||
-Dselinux=true \
|
||||
-Dpolkit=true \
|
||||
-Dconfig_auth_polkit_default=true \
|
||||
-Dmodify_system=true \
|
||||
-Dconcheck=true \
|
||||
-Dlibpsl="$(bool_true "$P_FEDORA")" \
|
||||
-Debpf="$(bool_true "$P_EBPF_ENABLED")" \
|
||||
-Dsession_tracking=systemd \
|
||||
-Dsuspend_resume=systemd \
|
||||
-Dsystemdsystemunitdir=/usr/lib/systemd/system \
|
||||
-Dsystem_ca_path=/etc/pki/tls/cert.pem \
|
||||
-Ddbus_conf_dir="$P_DBUS_SYS_DIR" \
|
||||
-Dtests=yes \
|
||||
-Dvalgrind=no \
|
||||
-Difcfg_rh=true \
|
||||
-Difupdown=false \
|
||||
$(args_enable "$P_PPP" -Dppp=true -Dpppd="$D_SBINDIR/pppd" -Dpppd_plugin_dir="$D_LIBDIR/pppd/$P_PPP_VERSION") \
|
||||
$(args_enable "$(bool_not_true "$P_PPP")" -Dppp=false ) \
|
||||
-Dfirewalld_zone="$(bool_true "$P_FIREWALLD_ZONE}")" \
|
||||
-Ddist_version="$P_VERSION-$P_RELEASE" \
|
||||
$(args_enable "$P_CONFIG_PLUGINS_DEFAULT_IFCFG_RH" -Dconfig_plugins_default=ifcfg-rh) \
|
||||
-Dresolvconf=no \
|
||||
-Dnetconfig=no \
|
||||
-Dconfig_dns_rc_manager_default="$P_DNS_RC_MANAGER_DEFAULT" \
|
||||
-Dconfig_logging_backend_default="$P_LOGGING_BACKEND_DEFAULT" \
|
||||
\
|
||||
"$P_MESON_BUILDDIR" \
|
||||
;
|
||||
else
|
||||
if ! test -x ./configure ; then
|
||||
if [ -z "$SHOW_CMD" ]; then
|
||||
NOCONFIGURE=yes ./autogen.sh
|
||||
fi
|
||||
fi
|
||||
$SHOW_CMD \
|
||||
./configure \
|
||||
--build=x86_64-redhat-linux-gnu \
|
||||
--host=x86_64-redhat-linux-gnu \
|
||||
--program-prefix= \
|
||||
--prefix="$D_PREFIX" \
|
||||
--exec-prefix=/usr \
|
||||
--bindir="$D_BINDIR" \
|
||||
--sbindir="$D_SBINDIR" \
|
||||
--sysconfdir="$D_SYSCONFDIR" \
|
||||
--datadir="$D_DATADIR" \
|
||||
--includedir="$D_INCLUDEDIR" \
|
||||
--libdir="$D_LIBDIR" \
|
||||
--libexecdir="$D_LIBEXECDIR" \
|
||||
--localstatedir="$D_LOCALSTATEDIR" \
|
||||
--sharedstatedir="$D_SHAREDSTATEDIR" \
|
||||
--mandir="$D_MANDIR" \
|
||||
--infodir="$D_INFODIR" \
|
||||
\
|
||||
CC="$P_CC" \
|
||||
CFLAGS="$P_CFLAGS" \
|
||||
\
|
||||
--enable-dependency-tracking=yes \
|
||||
\
|
||||
--with-runstatedir="$D_RUNDIR" \
|
||||
--enable-silent-rules="$(bool_yes "$P_SILENT_RULES")" \
|
||||
--enable-static=no \
|
||||
--with-nft="${D_SBINDIR}/nft" \
|
||||
--with-iptables="${D_SBINDIR}/iptables" \
|
||||
--with-dhclient="${D_SBINDIR}/dhclient" \
|
||||
--with-dhcpcd=no \
|
||||
--with-dhcpcanon=no \
|
||||
--with-config-dhcp-default="$P_DHCP_DEFAULT" \
|
||||
--with-crypto="$P_CRYPTO" \
|
||||
$(args_enable "$P_SANITIZER" --with-address-sanitizer=exec --enable-undefined-sanitizer="$( (bool "$P_FEDORA" || test "$P_RHEL" -ge 8) && echo yes || echo no)" ) \
|
||||
$(args_enable "$(bool_not_true "$P_SANITIZER")" --with-address-sanitizer=no --enable-undefined-sanitizer=no ) \
|
||||
$(args_enable "$P_DEBUG" --enable-more-logging=yes --with-more-asserts=10000) \
|
||||
$(args_enable "$(bool_not_true "$P_DEBUG")" --enable-more-logging=no --with-more-asserts=0 ) \
|
||||
--enable-ld-gc=yes \
|
||||
--enable-lto="$(bool_yes "$P_LTO")" \
|
||||
--with-libaudit=yes-disabled-by-default \
|
||||
--with-modem-manager-1="$(bool_yes "$P_MODEM_MANAGER_1")" \
|
||||
$(args_enable "$P_WIFI" --enable-wifi=yes --with-wext="$(bool_yes "$P_FEDORA")") \
|
||||
$(args_enable "$(bool_not_true "$P_WIFI")" --enable-wifi=no ) \
|
||||
--with-iwd="$(bool_yes "$P_IWD")" \
|
||||
--enable-bluez5-dun="$(bool_yes "$P_BLUETOOTH")" \
|
||||
--with-nmtui="$(bool_yes "$P_NMTUI")" \
|
||||
--with-nm-cloud-setup="$(bool_yes "$P_NM_CLOUD_SETUP")" \
|
||||
--enable-vala=yes \
|
||||
--enable-introspection=yes \
|
||||
--enable-gtk-doc="$(bool_yes "$P_REGEN_DOCS")" \
|
||||
--enable-teamdctl="$(bool_yes "$P_TEAM")" \
|
||||
--enable-ovs="$(bool_yes "$P_OVS")" \
|
||||
--with-selinux=yes \
|
||||
--enable-polkit=yes \
|
||||
--enable-modify-system=yes \
|
||||
--enable-concheck=yes \
|
||||
--with-libpsl="$(bool_yes "$P_FEDORA")" \
|
||||
--with-ebpf="$(bool_yes "$P_EBPF_ENABLED")" \
|
||||
--with-session-tracking=systemd \
|
||||
--with-suspend-resume=systemd \
|
||||
--with-systemdsystemunitdir=/usr/lib/systemd/system \
|
||||
--with-system-ca-path=/etc/pki/tls/cert.pem \
|
||||
--with-dbus-sys-dir="$P_DBUS_SYS_DIR" \
|
||||
--with-tests=yes \
|
||||
--enable-more-warnings="$(bool "$P_TEST" && echo error || echo yes)" \
|
||||
--with-valgrind=no \
|
||||
--enable-ifcfg-rh=yes \
|
||||
--enable-ifupdown=no \
|
||||
$(args_enable "$P_PPP" --enable-ppp=yes --with-pppd="$D_SBINDIR/pppd" --with-pppd-plugin-dir="$D_LIBDIR/pppd/$P_PPP_VERSION") \
|
||||
$(args_enable "$(bool_not_true "$P_PPP")" --enable-ppp=no ) \
|
||||
--enable-firewalld-zone="$(bool_yes "$P_FIREWALLD_ZONE")" \
|
||||
--with-dist-version="$P_VERSION-$P_RELEASE" \
|
||||
$(args_enable "$P_CONFIG_PLUGINS_DEFAULT_IFCFG_RH" --with-config-plugins-default=ifcfg-rh) \
|
||||
--with-resolvconf=no \
|
||||
--with-netconfig=no \
|
||||
--with-config-dns-rc-manager-default="$P_DNS_RC_MANAGER_DEFAULT" \
|
||||
--with-config-logging-backend-default="$P_LOGGING_BACKEND_DEFAULT" \
|
||||
--disable-autotools-deprecation \
|
||||
;
|
||||
MESON_RECONFIGURE=
|
||||
if test -d "$P_MESON_BUILDDIR" ; then
|
||||
MESON_RECONFIGURE="--reconfigure"
|
||||
fi
|
||||
|
||||
$SHOW_CMD \
|
||||
env \
|
||||
CC="$P_CC" \
|
||||
CFLAGS="$P_CFLAGS" \
|
||||
meson setup\
|
||||
$MESON_RECONFIGURE \
|
||||
--buildtype=plain \
|
||||
--prefix="$D_PREFIX" \
|
||||
--libdir="$D_LIBDIR" \
|
||||
--libexecdir="$D_LIBEXECDIR" \
|
||||
--bindir="$D_BINDIR" \
|
||||
--sbindir="$D_SBINDIR" \
|
||||
--includedir="$D_INCLUDEDIR" \
|
||||
--datadir="$D_DATADIR" \
|
||||
--mandir="$D_MANDIR" \
|
||||
--infodir="$D_INFODIR" \
|
||||
--localedir="$D_DATADIR"/locale \
|
||||
--sysconfdir="$D_SYSCONFDIR" \
|
||||
--localstatedir="$D_LOCALSTATEDIR" \
|
||||
--sharedstatedir="$D_SHAREDSTATEDIR" \
|
||||
--wrap-mode=nodownload \
|
||||
--auto-features=enabled \
|
||||
-Db_ndebug=false \
|
||||
--warnlevel 2 \
|
||||
$(args_enable "$P_TEST" --werror) \
|
||||
-Dnft="${D_SBINDIR}/nft" \
|
||||
-Diptables="${D_SBINDIR}/iptables" \
|
||||
-Ddhclient="${D_SBINDIR}/dhclient" \
|
||||
-Ddhcpcanon=no \
|
||||
-Ddhcpcd=no \
|
||||
-Dconfig_dhcp_default="$P_DHCP_DEFAULT" \
|
||||
"-Dcrypto=$P_CRYPTO" \
|
||||
$(args_enable "$P_DEBUG" -Dmore_logging=true -Dmore_asserts=10000) \
|
||||
$(args_enable "$(bool_not_true "$P_DEBUG")" -Dmore_logging=false -Dmore_asserts=0 ) \
|
||||
-Dld_gc=true \
|
||||
-Db_lto="$(bool_true "$P_LTO")" \
|
||||
-Dlibaudit=yes-disabled-by-default \
|
||||
-Dmodem_manager="$(bool_true "$P_MODEM_MANAGER_1")" \
|
||||
$(args_enable "$P_WIFI" -Dwifi=true -Dwext="$(bool_true "$P_FEDORA")") \
|
||||
$(args_enable "$(bool_not_true "$P_WIFI")" -Dwifi=false ) \
|
||||
-Diwd="$(bool_true "$P_IWD")" \
|
||||
-Dbluez5_dun="$(bool_true "$P_BLUETOOTH")" \
|
||||
-Dnmtui="$(bool_true "$P_NMTUI")" \
|
||||
-Dnm_cloud_setup="$(bool_true "$P_NM_CLOUD_SETUP")" \
|
||||
-Dvapi=true \
|
||||
-Dintrospection=true \
|
||||
-Ddocs="$(bool_true "$P_REGEN_DOCS")" \
|
||||
-Dteamdctl="$(bool_true "$P_TEAM")" \
|
||||
-Dovs="$(bool_true "$P_OVS")" \
|
||||
-Dselinux=true \
|
||||
-Dpolkit=true \
|
||||
-Dconfig_auth_polkit_default=true \
|
||||
-Dmodify_system=true \
|
||||
-Dconcheck=true \
|
||||
-Dlibpsl="$(bool_true "$P_FEDORA")" \
|
||||
-Debpf="$(bool_true "$P_EBPF_ENABLED")" \
|
||||
-Dsession_tracking=systemd \
|
||||
-Dsuspend_resume=systemd \
|
||||
-Dsystemdsystemunitdir=/usr/lib/systemd/system \
|
||||
-Dsystem_ca_path=/etc/pki/tls/cert.pem \
|
||||
-Ddbus_conf_dir="$P_DBUS_SYS_DIR" \
|
||||
-Dtests=yes \
|
||||
-Dvalgrind=no \
|
||||
-Difcfg_rh=true \
|
||||
-Difupdown=false \
|
||||
$(args_enable "$P_PPP" -Dppp=true -Dpppd="$D_SBINDIR/pppd" -Dpppd_plugin_dir="$D_LIBDIR/pppd/$P_PPP_VERSION") \
|
||||
$(args_enable "$(bool_not_true "$P_PPP")" -Dppp=false ) \
|
||||
-Dfirewalld_zone="$(bool_true "$P_FIREWALLD_ZONE}")" \
|
||||
-Ddist_version="$P_VERSION-$P_RELEASE" \
|
||||
$(args_enable "$P_CONFIG_PLUGINS_DEFAULT_IFCFG_RH" -Dconfig_plugins_default=ifcfg-rh) \
|
||||
-Dresolvconf=no \
|
||||
-Dnetconfig=no \
|
||||
-Dconfig_dns_rc_manager_default="$P_DNS_RC_MANAGER_DEFAULT" \
|
||||
-Dconfig_logging_backend_default="$P_LOGGING_BACKEND_DEFAULT" \
|
||||
\
|
||||
"$P_MESON_BUILDDIR" \
|
||||
;
|
||||
|
||||
if ! bool "$P_NOBUILD" ; then
|
||||
if [ "$P_BUILD_TYPE" == meson ] ; then
|
||||
$SHOW_CMD ninja -C "$P_MESON_BUILDDIR"
|
||||
else
|
||||
$SHOW_CMD make -j 10
|
||||
fi
|
||||
$SHOW_CMD ninja -C "$P_MESON_BUILDDIR"
|
||||
fi
|
||||
|
@@ -3,7 +3,6 @@
|
||||
# Arguments via environment variables:
|
||||
# - CI
|
||||
# - CC
|
||||
# - BUILD_TYPE
|
||||
# - CFLAGS
|
||||
# - WITH_DOCS
|
||||
|
||||
@@ -50,23 +49,13 @@ grep -q '^NAME=.*\(Alpine\)' /etc/os-release && IS_ALPINE=1
|
||||
|
||||
###############################################################################
|
||||
|
||||
if [ "$BUILD_TYPE" == meson ]; then
|
||||
_TRUE=true
|
||||
_FALSE=false
|
||||
elif [ "$BUILD_TYPE" == autotools ]; then
|
||||
_TRUE=yes
|
||||
_FALSE=no
|
||||
else
|
||||
die "invalid \$BUILD_TYPE \"$BUILD_TYPE\""
|
||||
fi
|
||||
|
||||
_WITH_CRYPTO="gnutls"
|
||||
_WITH_WERROR=1
|
||||
_WITH_LIBTEAM="$_TRUE"
|
||||
_WITH_DOCS="$_TRUE"
|
||||
_WITH_SYSTEMD_LOGIND="$_TRUE"
|
||||
_WITH_LIBTEAM="true"
|
||||
_WITH_DOCS="true"
|
||||
_WITH_SYSTEMD_LOGIND="true"
|
||||
if [ $IS_ALPINE = 1 ]; then
|
||||
_WITH_SYSTEMD_LOGIND="$_FALSE"
|
||||
_WITH_SYSTEMD_LOGIND="false"
|
||||
fi
|
||||
|
||||
if [ -z "${NMTST_SEED_RAND+x}" ]; then
|
||||
@@ -92,9 +81,9 @@ fi
|
||||
|
||||
if [ "$WITH_DOCS" != "" ]; then
|
||||
if _is_true "$WITH_DOCS"; then
|
||||
_WITH_DOCS="$_TRUE"
|
||||
_WITH_DOCS="true"
|
||||
else
|
||||
_WITH_DOCS="$_FALSE"
|
||||
_WITH_DOCS="false"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -149,149 +138,72 @@ _print_test_logs() {
|
||||
fi
|
||||
}
|
||||
|
||||
run_autotools() {
|
||||
NOCONFIGURE=1 ./autogen.sh
|
||||
mkdir ./build
|
||||
if [ "$_WITH_WERROR" == 1 ]; then
|
||||
_WITH_WERROR_VAL="error"
|
||||
else
|
||||
_WITH_WERROR_VAL="yes"
|
||||
fi
|
||||
DISABLE_DEPENDENCY_TRACKING=
|
||||
if [ $IS_ALPINE = 1 ]; then
|
||||
DISABLE_DEPENDENCY_TRACKING='--disable-dependency-tracking'
|
||||
fi
|
||||
pushd ./build
|
||||
../configure \
|
||||
--prefix="$PWD/INST" \
|
||||
$DISABLE_DEPENDENCY_TRACKING \
|
||||
\
|
||||
--enable-introspection=$_WITH_DOCS \
|
||||
--enable-gtk-doc=$_WITH_DOCS \
|
||||
--with-systemd-logind=$_WITH_SYSTEMD_LOGIND \
|
||||
--enable-more-warnings="$_WITH_WERROR_VAL" \
|
||||
--enable-tests=yes \
|
||||
--with-crypto=$_WITH_CRYPTO \
|
||||
\
|
||||
--with-ebpf=no \
|
||||
\
|
||||
--with-iwd=yes \
|
||||
--with-ofono=yes \
|
||||
--enable-teamdctl=$_WITH_LIBTEAM \
|
||||
\
|
||||
--with-dhcpcanon=yes \
|
||||
--with-dhcpcd=yes \
|
||||
--with-dhclient=yes \
|
||||
\
|
||||
--with-netconfig=/bin/nowhere/netconfig \
|
||||
--with-resolvconf=/bin/nowhere/resolvconf \
|
||||
\
|
||||
--enable-ifcfg-rh=yes \
|
||||
--enable-ifupdown=yes \
|
||||
--disable-autotools-deprecation \
|
||||
\
|
||||
#end
|
||||
|
||||
if [ "$CONFIGURE_ONLY" != 1 ]; then
|
||||
make -j 6
|
||||
make install
|
||||
|
||||
export NM_TEST_CLIENT_CHECK_L10N=1
|
||||
|
||||
if ! make check -j 6 -k ; then
|
||||
_print_test_logs "first-test"
|
||||
echo ">>>> RUN SECOND TEST (start)"
|
||||
NMTST_DEBUG="debug,TRACE,no-expect-message" make check -k || :
|
||||
echo ">>>> RUN SECOND TEST (done)"
|
||||
_print_test_logs "second-test"
|
||||
die "autotools test failed"
|
||||
fi
|
||||
|
||||
if _with_valgrind; then
|
||||
if ! NMTST_USE_VALGRIND=1 make check -j 3 -k ; then
|
||||
_print_test_logs "(valgrind test)"
|
||||
die "autotools+valgrind test failed"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
popd
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
|
||||
run_meson() {
|
||||
if [ "$_WITH_WERROR" == 1 ]; then
|
||||
_WITH_WERROR_VAL="--werror"
|
||||
else
|
||||
_WITH_WERROR_VAL=""
|
||||
if [ "$_WITH_WERROR" == 1 ]; then
|
||||
_WITH_WERROR_VAL="--werror"
|
||||
else
|
||||
_WITH_WERROR_VAL=""
|
||||
fi
|
||||
|
||||
meson setup build \
|
||||
\
|
||||
-Dprefix="$PWD/INST" \
|
||||
\
|
||||
--warnlevel 2 \
|
||||
$_WITH_WERROR_VAL \
|
||||
\
|
||||
-D ld_gc=false \
|
||||
-D session_tracking=no \
|
||||
-D systemdsystemunitdir=no \
|
||||
-D systemd_journal=false \
|
||||
-D selinux=false \
|
||||
-D libaudit=no \
|
||||
-D libpsl=false \
|
||||
-D vapi=false \
|
||||
-D introspection=$_WITH_DOCS \
|
||||
-D qt=false \
|
||||
-D crypto=$_WITH_CRYPTO \
|
||||
-D docs=$_WITH_DOCS \
|
||||
\
|
||||
-D ebpf=false \
|
||||
\
|
||||
-D iwd=true \
|
||||
-D ofono=true \
|
||||
-D teamdctl=$_WITH_LIBTEAM \
|
||||
\
|
||||
-D dhclient=/bin/nowhere/dhclient \
|
||||
-D dhcpcanon=/bin/nowhere/dhcpcanon \
|
||||
-D dhcpcd=/bin/nowhere/dhcpd \
|
||||
\
|
||||
-D netconfig=/bin/nowhere/netconfig \
|
||||
-D resolvconf=/bin/nowhere/resolvconf \
|
||||
\
|
||||
-D ifcfg_rh=false \
|
||||
-D ifupdown=true \
|
||||
\
|
||||
#end
|
||||
|
||||
export NM_TEST_CLIENT_CHECK_L10N=1
|
||||
|
||||
if [ "$CONFIGURE_ONLY" != 1 ]; then
|
||||
ninja -C build -v
|
||||
ninja -C build install
|
||||
|
||||
if ! meson test -C build -v --print-errorlogs ; then
|
||||
echo ">>>> RUN SECOND TEST (start)"
|
||||
NMTST_DEBUG="debug,TRACE,no-expect-message" \
|
||||
meson test -C build -v --print-errorlogs || :
|
||||
echo ">>>> RUN SECOND TEST (done)"
|
||||
die "meson test failed"
|
||||
fi
|
||||
meson setup build \
|
||||
\
|
||||
-Dprefix="$PWD/INST" \
|
||||
\
|
||||
--warnlevel 2 \
|
||||
$_WITH_WERROR_VAL \
|
||||
\
|
||||
-D ld_gc=false \
|
||||
-D session_tracking=no \
|
||||
-D systemdsystemunitdir=no \
|
||||
-D systemd_journal=false \
|
||||
-D selinux=false \
|
||||
-D libaudit=no \
|
||||
-D libpsl=false \
|
||||
-D vapi=false \
|
||||
-D introspection=$_WITH_DOCS \
|
||||
-D qt=false \
|
||||
-D crypto=$_WITH_CRYPTO \
|
||||
-D docs=$_WITH_DOCS \
|
||||
\
|
||||
-D ebpf=false \
|
||||
\
|
||||
-D iwd=true \
|
||||
-D ofono=true \
|
||||
-D teamdctl=$_WITH_LIBTEAM \
|
||||
\
|
||||
-D dhclient=/bin/nowhere/dhclient \
|
||||
-D dhcpcanon=/bin/nowhere/dhcpcanon \
|
||||
-D dhcpcd=/bin/nowhere/dhcpd \
|
||||
\
|
||||
-D netconfig=/bin/nowhere/netconfig \
|
||||
-D resolvconf=/bin/nowhere/resolvconf \
|
||||
\
|
||||
-D ifcfg_rh=false \
|
||||
-D ifupdown=true \
|
||||
\
|
||||
#end
|
||||
|
||||
export NM_TEST_CLIENT_CHECK_L10N=1
|
||||
|
||||
if [ "$CONFIGURE_ONLY" != 1 ]; then
|
||||
ninja -C build -v
|
||||
ninja -C build install
|
||||
|
||||
if ! meson test -C build -v --print-errorlogs ; then
|
||||
echo ">>>> RUN SECOND TEST (start)"
|
||||
NMTST_DEBUG="debug,TRACE,no-expect-message" \
|
||||
meson test -C build -v --print-errorlogs || :
|
||||
echo ">>>> RUN SECOND TEST (done)"
|
||||
die "meson test failed"
|
||||
fi
|
||||
|
||||
if _with_valgrind; then
|
||||
if ! NMTST_USE_VALGRIND=1 meson test -C build -v --print-errorlogs ; then
|
||||
_print_test_logs "(valgrind test)"
|
||||
die "meson+valgrind test failed"
|
||||
fi
|
||||
if _with_valgrind; then
|
||||
if ! NMTST_USE_VALGRIND=1 meson test -C build -v --print-errorlogs ; then
|
||||
_print_test_logs "(valgrind test)"
|
||||
die "meson+valgrind test failed"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
|
||||
if [ "$BUILD_TYPE" == autotools ]; then
|
||||
run_autotools
|
||||
elif [ "$BUILD_TYPE" == meson ]; then
|
||||
run_meson
|
||||
fi
|
||||
|
||||
if [ "$USE_CCACHE" = 1 ]; then
|
||||
|
Reference in New Issue
Block a user