github.com/anonymouse64/snapd@v0.0.0-20210824153203-04c4c42d842d/cmd/autogen.sh (about) 1 #!/bin/sh 2 # Welcome to the Happy Maintainer's Utility Script 3 # 4 # Set BUILD_DIR to the directory where the build will happen, otherwise $PWD 5 # will be used 6 set -eux 7 8 BUILD_DIR=${BUILD_DIR:-.} 9 selfdir=$(dirname "$0") 10 SRC_DIR=$(readlink -f "$selfdir") 11 12 # We need the VERSION file to configure 13 if [ ! -e VERSION ]; then 14 ( cd .. && ./mkversion.sh ) 15 fi 16 17 # Sanity check, are we in the right directory? 18 test -f configure.ac 19 20 # Regenerate the build system 21 rm -f config.status 22 autoreconf -i -f 23 24 # Configure the build 25 extra_opts= 26 # shellcheck disable=SC1091 27 . /etc/os-release 28 case "$ID" in 29 arch) 30 extra_opts="--libexecdir=/usr/lib/snapd --with-snap-mount-dir=/var/lib/snapd/snap --enable-apparmor --enable-nvidia-biarch --enable-merged-usr" 31 ;; 32 debian) 33 extra_opts="--libexecdir=/usr/lib/snapd" 34 ;; 35 gentoo) 36 extra_opts="--libexecdir=/usr/lib/snapd --with-snap-mount-dir=/var/lib/snapd/snap --enable-apparmor --enable-nvidia-biarch --enable-merged-usr" 37 ;; 38 ubuntu) 39 extra_opts="--libexecdir=/usr/lib/snapd --enable-nvidia-multiarch --enable-static-libcap --enable-static-libapparmor --with-host-arch-triplet=$(dpkg-architecture -qDEB_HOST_MULTIARCH)" 40 if [ "$(dpkg-architecture -qDEB_HOST_ARCH)" = "amd64" ]; then 41 extra_opts="$extra_opts --with-host-arch-32bit-triplet=$(dpkg-architecture -ai386 -qDEB_HOST_MULTIARCH)" 42 fi 43 ;; 44 fedora|centos|rhel) 45 extra_opts="--libexecdir=/usr/libexec/snapd --with-snap-mount-dir=/var/lib/snapd/snap --enable-merged-usr --disable-apparmor --enable-selinux" 46 ;; 47 opensuse-tumbleweed) 48 extra_opts="--libexecdir=/usr/libexec/snapd --enable-nvidia-biarch --with-32bit-libdir=/usr/lib --enable-merged-usr" 49 ;; 50 opensuse) 51 extra_opts="--libexecdir=/usr/lib/snapd --enable-nvidia-biarch --with-32bit-libdir=/usr/lib --enable-merged-usr" 52 ;; 53 solus) 54 extra_opts="--enable-nvidia-biarch" 55 ;; 56 esac 57 58 echo "Configuring in build directory $BUILD_DIR with: $extra_opts" 59 mkdir -p "$BUILD_DIR" && cd "$BUILD_DIR" 60 # shellcheck disable=SC2086 61 "${SRC_DIR}/configure" --enable-maintainer-mode --prefix=/usr $extra_opts "$@"