github.com/hugh712/snapd@v0.0.0-20200910133618-1a99902bd583/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 ubuntu) 36 extra_opts="--libexecdir=/usr/lib/snapd --enable-nvidia-multiarch --enable-static-libcap --enable-static-libapparmor --with-host-arch-triplet=$(dpkg-architecture -qDEB_HOST_MULTIARCH)" 37 if [ "$(dpkg-architecture -qDEB_HOST_ARCH)" = "amd64" ]; then 38 extra_opts="$extra_opts --with-host-arch-32bit-triplet=$(dpkg-architecture -ai386 -qDEB_HOST_MULTIARCH)" 39 fi 40 ;; 41 fedora|centos|rhel) 42 extra_opts="--libexecdir=/usr/libexec/snapd --with-snap-mount-dir=/var/lib/snapd/snap --enable-merged-usr --disable-apparmor --enable-selinux" 43 ;; 44 opensuse|opensuse-tumbleweed) 45 extra_opts="--libexecdir=/usr/lib/snapd --enable-nvidia-biarch --with-32bit-libdir=/usr/lib --enable-merged-usr" 46 ;; 47 solus) 48 extra_opts="--enable-nvidia-biarch" 49 ;; 50 esac 51 52 echo "Configuring in build directory $BUILD_DIR with: $extra_opts" 53 mkdir -p "$BUILD_DIR" && cd "$BUILD_DIR" 54 # shellcheck disable=SC2086 55 "${SRC_DIR}/configure" --enable-maintainer-mode --prefix=/usr $extra_opts "$@"