summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorGeorgy Yakovlev <[email protected]>2020-08-28 09:43:44 -0700
committerBrian Behlendorf <[email protected]>2020-08-30 14:18:36 -0700
commitfa0cd2d16f334ec86ef8a82adffe80e2a28b3af8 (patch)
treefabed9791c1410bd4db601bb40459914445d9891 /config
parenta00c61db44874285576ae198fd9edb277e8a6670 (diff)
config/zfs-build.m4: add --with-vendor flag
This will allow an override of auto-detection of distribution, which is based on checking presence of /etc/*-release files. Build systems makes a lot of file location assumptions based on detected distribution. Some distributions (like gentoo) may prefer explicitly setting --with-vendor=gentoo to avoid auto-detection. Since auto-detection checks all files in order, current script may misdetect even on gentoo system if /etc/redhat-release file is present Default behavior is unchanged and default is --with-vendor=check Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Georgy Yakovlev <[email protected]> Closes #10835
Diffstat (limited to 'config')
-rw-r--r--config/zfs-build.m464
1 files changed, 37 insertions, 27 deletions
diff --git a/config/zfs-build.m4 b/config/zfs-build.m4
index 54b61de09..2f0aca830 100644
--- a/config/zfs-build.m4
+++ b/config/zfs-build.m4
@@ -418,33 +418,43 @@ dnl # package type for 'make pkg': (rpm | deb | tgz)
dnl #
AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [
AC_MSG_CHECKING([os distribution])
- if test -f /etc/toss-release ; then
- VENDOR=toss ;
- elif test -f /etc/fedora-release ; then
- VENDOR=fedora ;
- elif test -f /etc/redhat-release ; then
- VENDOR=redhat ;
- elif test -f /etc/gentoo-release ; then
- VENDOR=gentoo ;
- elif test -f /etc/arch-release ; then
- VENDOR=arch ;
- elif test -f /etc/SuSE-release ; then
- VENDOR=sles ;
- elif test -f /etc/slackware-version ; then
- VENDOR=slackware ;
- elif test -f /etc/lunar.release ; then
- VENDOR=lunar ;
- elif test -f /etc/lsb-release ; then
- VENDOR=ubuntu ;
- elif test -f /etc/debian_version ; then
- VENDOR=debian ;
- elif test -f /etc/alpine-release ; then
- VENDOR=alpine ;
- elif test -f /bin/freebsd-version ; then
- VENDOR=freebsd ;
- else
- VENDOR= ;
- fi
+ AC_ARG_WITH([vendor],
+ [AS_HELP_STRING([--with-vendor],
+ [Distribution vendor @<:@default=check@:>@])],
+ [with_vendor=$withval],
+ [with_vendor=check])
+ AS_IF([test "x$with_vendor" = "xcheck"],[
+ if test -f /etc/toss-release ; then
+ VENDOR=toss ;
+ elif test -f /etc/fedora-release ; then
+ VENDOR=fedora ;
+ elif test -f /etc/redhat-release ; then
+ VENDOR=redhat ;
+ elif test -f /etc/gentoo-release ; then
+ VENDOR=gentoo ;
+ elif test -f /etc/arch-release ; then
+ VENDOR=arch ;
+ elif test -f /etc/SuSE-release ; then
+ VENDOR=sles ;
+ elif test -f /etc/slackware-version ; then
+ VENDOR=slackware ;
+ elif test -f /etc/lunar.release ; then
+ VENDOR=lunar ;
+ elif test -f /etc/lsb-release ; then
+ VENDOR=ubuntu ;
+ elif test -f /etc/debian_version ; then
+ VENDOR=debian ;
+ elif test -f /etc/alpine-release ; then
+ VENDOR=alpine ;
+ elif test -f /bin/freebsd-version ; then
+ VENDOR=freebsd ;
+ else
+ VENDOR= ;
+ fi],
+ [ test "x${with_vendor}" != x],[
+ VENDOR="$with_vendor" ],
+ [ VENDOR= ; ]
+ )
AC_MSG_RESULT([$VENDOR])
AC_SUBST(VENDOR)