1AC_DEFUN([ZFS_AC_LICENSE], [ 2 AC_MSG_CHECKING([zfs author]) 3 AC_MSG_RESULT([$ZFS_META_AUTHOR]) 4 5 AC_MSG_CHECKING([zfs license]) 6 AC_MSG_RESULT([$ZFS_META_LICENSE]) 7]) 8 9AC_DEFUN([ZFS_AC_DEBUG_ENABLE], [ 10 DEBUG_CFLAGS="-Werror" 11 DEBUG_CPPFLAGS="-DDEBUG -UNDEBUG" 12 DEBUG_LDFLAGS="" 13 DEBUG_ZFS="_with_debug" 14 AC_DEFINE(ZFS_DEBUG, 1, [zfs debugging enabled]) 15 16 KERNEL_DEBUG_CFLAGS="-Werror" 17 KERNEL_DEBUG_CPPFLAGS="-DDEBUG -UNDEBUG" 18]) 19 20AC_DEFUN([ZFS_AC_DEBUG_DISABLE], [ 21 DEBUG_CFLAGS="" 22 DEBUG_CPPFLAGS="-UDEBUG -DNDEBUG" 23 DEBUG_LDFLAGS="" 24 DEBUG_ZFS="_without_debug" 25 26 KERNEL_DEBUG_CFLAGS="" 27 KERNEL_DEBUG_CPPFLAGS="-UDEBUG -DNDEBUG" 28]) 29 30dnl # 31dnl # When debugging is enabled: 32dnl # - Enable all ASSERTs (-DDEBUG) 33dnl # - Promote all compiler warnings to errors (-Werror) 34dnl # 35AC_DEFUN([ZFS_AC_DEBUG], [ 36 AC_MSG_CHECKING([whether assertion support will be enabled]) 37 AC_ARG_ENABLE([debug], 38 [AS_HELP_STRING([--enable-debug], 39 [Enable compiler and code assertions @<:@default=no@:>@])], 40 [], 41 [enable_debug=no]) 42 43 AS_CASE(["x$enable_debug"], 44 ["xyes"], 45 [ZFS_AC_DEBUG_ENABLE], 46 ["xno"], 47 [ZFS_AC_DEBUG_DISABLE], 48 [AC_MSG_ERROR([Unknown option $enable_debug])]) 49 50 AC_SUBST(DEBUG_CFLAGS) 51 AC_SUBST(DEBUG_CPPFLAGS) 52 AC_SUBST(DEBUG_LDFLAGS) 53 AC_SUBST(DEBUG_ZFS) 54 55 AC_SUBST(KERNEL_DEBUG_CFLAGS) 56 AC_SUBST(KERNEL_DEBUG_CPPFLAGS) 57 58 AC_MSG_RESULT([$enable_debug]) 59]) 60 61AC_DEFUN([ZFS_AC_DEBUGINFO_ENABLE], [ 62 DEBUG_CFLAGS="$DEBUG_CFLAGS -g -fno-inline $NO_IPA_SRA" 63 64 KERNEL_DEBUG_CFLAGS="$KERNEL_DEBUG_CFLAGS -fno-inline $NO_IPA_SRA" 65 KERNEL_MAKE="$KERNEL_MAKE CONFIG_DEBUG_INFO=y" 66 67 DEBUGINFO_ZFS="_with_debuginfo" 68]) 69 70AC_DEFUN([ZFS_AC_DEBUGINFO_DISABLE], [ 71 DEBUGINFO_ZFS="_without_debuginfo" 72]) 73 74AC_DEFUN([ZFS_AC_DEBUGINFO], [ 75 AC_MSG_CHECKING([whether debuginfo support will be forced]) 76 AC_ARG_ENABLE([debuginfo], 77 [AS_HELP_STRING([--enable-debuginfo], 78 [Force generation of debuginfo @<:@default=no@:>@])], 79 [], 80 [enable_debuginfo=no]) 81 82 AS_CASE(["x$enable_debuginfo"], 83 ["xyes"], 84 [ZFS_AC_DEBUGINFO_ENABLE], 85 ["xno"], 86 [ZFS_AC_DEBUGINFO_DISABLE], 87 [AC_MSG_ERROR([Unknown option $enable_debuginfo])]) 88 89 AC_SUBST(DEBUG_CFLAGS) 90 AC_SUBST(DEBUGINFO_ZFS) 91 92 AC_SUBST(KERNEL_DEBUG_CFLAGS) 93 AC_SUBST(KERNEL_MAKE) 94 95 AC_MSG_RESULT([$enable_debuginfo]) 96]) 97 98dnl # 99dnl # Disabled by default, provides basic memory tracking. Track the total 100dnl # number of bytes allocated with kmem_alloc() and freed with kmem_free(). 101dnl # Then at module unload time if any bytes were leaked it will be reported 102dnl # on the console. 103dnl # 104AC_DEFUN([ZFS_AC_DEBUG_KMEM], [ 105 AC_MSG_CHECKING([whether basic kmem accounting is enabled]) 106 AC_ARG_ENABLE([debug-kmem], 107 [AS_HELP_STRING([--enable-debug-kmem], 108 [Enable basic kmem accounting @<:@default=no@:>@])], 109 [], 110 [enable_debug_kmem=no]) 111 112 AS_IF([test "x$enable_debug_kmem" = xyes], [ 113 KERNEL_DEBUG_CPPFLAGS="${KERNEL_DEBUG_CPPFLAGS} -DDEBUG_KMEM" 114 DEBUG_KMEM_ZFS="_with_debug_kmem" 115 ], [ 116 DEBUG_KMEM_ZFS="_without_debug_kmem" 117 ]) 118 119 AC_SUBST(KERNEL_DEBUG_CPPFLAGS) 120 AC_SUBST(DEBUG_KMEM_ZFS) 121 122 AC_MSG_RESULT([$enable_debug_kmem]) 123]) 124 125dnl # 126dnl # Disabled by default, provides detailed memory tracking. This feature 127dnl # also requires --enable-debug-kmem to be set. When enabled not only will 128dnl # total bytes be tracked but also the location of every kmem_alloc() and 129dnl # kmem_free(). When the module is unloaded a list of all leaked addresses 130dnl # and where they were allocated will be dumped to the console. Enabling 131dnl # this feature has a significant impact on performance but it makes finding 132dnl # memory leaks straight forward. 133dnl # 134AC_DEFUN([ZFS_AC_DEBUG_KMEM_TRACKING], [ 135 AC_MSG_CHECKING([whether detailed kmem tracking is enabled]) 136 AC_ARG_ENABLE([debug-kmem-tracking], 137 [AS_HELP_STRING([--enable-debug-kmem-tracking], 138 [Enable detailed kmem tracking @<:@default=no@:>@])], 139 [], 140 [enable_debug_kmem_tracking=no]) 141 142 AS_IF([test "x$enable_debug_kmem_tracking" = xyes], [ 143 KERNEL_DEBUG_CPPFLAGS="${KERNEL_DEBUG_CPPFLAGS} -DDEBUG_KMEM_TRACKING" 144 DEBUG_KMEM_TRACKING_ZFS="_with_debug_kmem_tracking" 145 ], [ 146 DEBUG_KMEM_TRACKING_ZFS="_without_debug_kmem_tracking" 147 ]) 148 149 AC_SUBST(KERNEL_DEBUG_CPPFLAGS) 150 AC_SUBST(DEBUG_KMEM_TRACKING_ZFS) 151 152 AC_MSG_RESULT([$enable_debug_kmem_tracking]) 153]) 154 155AC_DEFUN([ZFS_AC_CONFIG_ALWAYS], [ 156 ZFS_AC_CONFIG_ALWAYS_CC_NO_UNUSED_BUT_SET_VARIABLE 157 ZFS_AC_CONFIG_ALWAYS_CC_NO_BOOL_COMPARE 158 ZFS_AC_CONFIG_ALWAYS_CC_FRAME_LARGER_THAN 159 ZFS_AC_CONFIG_ALWAYS_CC_NO_FORMAT_TRUNCATION 160 ZFS_AC_CONFIG_ALWAYS_CC_NO_FORMAT_ZERO_LENGTH 161 ZFS_AC_CONFIG_ALWAYS_CC_NO_OMIT_FRAME_POINTER 162 ZFS_AC_CONFIG_ALWAYS_CC_NO_IPA_SRA 163 ZFS_AC_CONFIG_ALWAYS_CC_ASAN 164 ZFS_AC_CONFIG_ALWAYS_TOOLCHAIN_SIMD 165 ZFS_AC_CONFIG_ALWAYS_SYSTEM 166 ZFS_AC_CONFIG_ALWAYS_ARCH 167 ZFS_AC_CONFIG_ALWAYS_PYTHON 168 ZFS_AC_CONFIG_ALWAYS_PYZFS 169 ZFS_AC_CONFIG_ALWAYS_SED 170]) 171 172AC_DEFUN([ZFS_AC_CONFIG], [ 173 174 dnl # Remove the previous build test directory. 175 rm -Rf build 176 177 ZFS_CONFIG=all 178 AC_ARG_WITH([config], 179 AS_HELP_STRING([--with-config=CONFIG], 180 [Config file 'kernel|user|all|srpm']), 181 [ZFS_CONFIG="$withval"]) 182 AC_ARG_ENABLE([linux-builtin], 183 [AC_HELP_STRING([--enable-linux-builtin], 184 [Configure for builtin in-tree kernel modules @<:@default=no@:>@])], 185 [], 186 [enable_linux_builtin=no]) 187 188 AC_MSG_CHECKING([zfs config]) 189 AC_MSG_RESULT([$ZFS_CONFIG]); 190 AC_SUBST(ZFS_CONFIG) 191 192 ZFS_AC_CONFIG_ALWAYS 193 194 195 AM_COND_IF([BUILD_LINUX], [ 196 AC_ARG_VAR([TEST_JOBS], 197 [simultaneous jobs during configure (defaults to $(nproc))]) 198 if test "x$ac_cv_env_TEST_JOBS_set" != "xset"; then 199 TEST_JOBS=$(nproc) 200 fi 201 AC_SUBST(TEST_JOBS) 202 ]) 203 204 case "$ZFS_CONFIG" in 205 kernel) ZFS_AC_CONFIG_KERNEL ;; 206 user) ZFS_AC_CONFIG_USER ;; 207 all) ZFS_AC_CONFIG_USER 208 ZFS_AC_CONFIG_KERNEL ;; 209 srpm) ;; 210 *) 211 AC_MSG_RESULT([Error!]) 212 AC_MSG_ERROR([Bad value "$ZFS_CONFIG" for --with-config, 213 user kernel|user|all|srpm]) ;; 214 esac 215 216 AM_CONDITIONAL([CONFIG_USER], 217 [test "$ZFS_CONFIG" = user -o "$ZFS_CONFIG" = all]) 218 AM_CONDITIONAL([CONFIG_KERNEL], 219 [test "$ZFS_CONFIG" = kernel -o "$ZFS_CONFIG" = all] && 220 [test "x$enable_linux_builtin" != xyes ]) 221 AM_CONDITIONAL([CONFIG_QAT], 222 [test "$ZFS_CONFIG" = kernel -o "$ZFS_CONFIG" = all] && 223 [test "x$qatsrc" != x ]) 224 AM_CONDITIONAL([WANT_DEVNAME2DEVID], [test "x$user_libudev" = xyes ]) 225 AM_CONDITIONAL([WANT_MMAP_LIBAIO], [test "x$user_libaio" = xyes ]) 226 AM_CONDITIONAL([PAM_ZFS_ENABLED], [test "x$enable_pam" = xyes]) 227]) 228 229dnl # 230dnl # Check for rpm+rpmbuild to build RPM packages. If these tools 231dnl # are missing it is non-fatal but you will not be able to build 232dnl # RPM packages and will be warned if you try too. 233dnl # 234dnl # By default the generic spec file will be used because it requires 235dnl # minimal dependencies. Distribution specific spec files can be 236dnl # placed under the 'rpm/<distribution>' directory and enabled using 237dnl # the --with-spec=<distribution> configure option. 238dnl # 239AC_DEFUN([ZFS_AC_RPM], [ 240 RPM=rpm 241 RPMBUILD=rpmbuild 242 243 AC_MSG_CHECKING([whether $RPM is available]) 244 AS_IF([tmp=$($RPM --version 2>/dev/null)], [ 245 RPM_VERSION=$(echo $tmp | $AWK '/RPM/ { print $[3] }') 246 HAVE_RPM=yes 247 AC_MSG_RESULT([$HAVE_RPM ($RPM_VERSION)]) 248 ],[ 249 HAVE_RPM=no 250 AC_MSG_RESULT([$HAVE_RPM]) 251 ]) 252 253 AC_MSG_CHECKING([whether $RPMBUILD is available]) 254 AS_IF([tmp=$($RPMBUILD --version 2>/dev/null)], [ 255 RPMBUILD_VERSION=$(echo $tmp | $AWK '/RPM/ { print $[3] }') 256 HAVE_RPMBUILD=yes 257 AC_MSG_RESULT([$HAVE_RPMBUILD ($RPMBUILD_VERSION)]) 258 ],[ 259 HAVE_RPMBUILD=no 260 AC_MSG_RESULT([$HAVE_RPMBUILD]) 261 ]) 262 263 RPM_DEFINE_COMMON='--define "$(DEBUG_ZFS) 1"' 264 RPM_DEFINE_COMMON=${RPM_DEFINE_COMMON}' --define "$(DEBUGINFO_ZFS) 1"' 265 RPM_DEFINE_COMMON=${RPM_DEFINE_COMMON}' --define "$(DEBUG_KMEM_ZFS) 1"' 266 RPM_DEFINE_COMMON=${RPM_DEFINE_COMMON}' --define "$(DEBUG_KMEM_TRACKING_ZFS) 1"' 267 RPM_DEFINE_COMMON=${RPM_DEFINE_COMMON}' --define "$(ASAN_ZFS) 1"' 268 269 RPM_DEFINE_UTIL=' --define "_initconfdir $(initconfdir)"' 270 271 dnl # Make the next three RPM_DEFINE_UTIL additions conditional, since 272 dnl # their values may not be set when running: 273 dnl # 274 dnl # ./configure --with-config=srpm 275 dnl # 276 AS_IF([test -n "$dracutdir" ], [ 277 RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' --define "_dracutdir $(dracutdir)"' 278 ]) 279 AS_IF([test -n "$udevdir" ], [ 280 RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' --define "_udevdir $(udevdir)"' 281 ]) 282 AS_IF([test -n "$udevruledir" ], [ 283 RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' --define "_udevruledir $(udevruledir)"' 284 ]) 285 RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_SYSTEMD)' 286 RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_PYZFS)' 287 RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_PAM)' 288 RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_PYTHON_VERSION)' 289 RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_PYTHON_PKG_VERSION)' 290 291 dnl # Override default lib directory on Debian/Ubuntu systems. The 292 dnl # provided /usr/lib/rpm/platform/<arch>/macros files do not 293 dnl # specify the correct path for multiarch systems as described 294 dnl # by the packaging guidelines. 295 dnl # 296 dnl # https://wiki.ubuntu.com/MultiarchSpec 297 dnl # https://wiki.debian.org/Multiarch/Implementation 298 dnl # 299 AS_IF([test "$DEFAULT_PACKAGE" = "deb"], [ 300 MULTIARCH_LIBDIR="lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)" 301 RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' --define "_lib $(MULTIARCH_LIBDIR)"' 302 AC_SUBST(MULTIARCH_LIBDIR) 303 ]) 304 305 dnl # Make RPM_DEFINE_KMOD additions conditional on CONFIG_KERNEL, 306 dnl # since the values will not be set otherwise. The spec files 307 dnl # provide defaults for them. 308 dnl # 309 RPM_DEFINE_KMOD='--define "_wrong_version_format_terminate_build 0"' 310 AM_COND_IF([CONFIG_KERNEL], [ 311 RPM_DEFINE_KMOD=${RPM_DEFINE_KMOD}' --define "kernels $(LINUX_VERSION)"' 312 RPM_DEFINE_KMOD=${RPM_DEFINE_KMOD}' --define "ksrc $(LINUX)"' 313 RPM_DEFINE_KMOD=${RPM_DEFINE_KMOD}' --define "kobj $(LINUX_OBJ)"' 314 ]) 315 316 RPM_DEFINE_DKMS='' 317 318 SRPM_DEFINE_COMMON='--define "build_src_rpm 1"' 319 SRPM_DEFINE_UTIL= 320 SRPM_DEFINE_KMOD= 321 SRPM_DEFINE_DKMS= 322 323 RPM_SPEC_DIR="rpm/generic" 324 AC_ARG_WITH([spec], 325 AS_HELP_STRING([--with-spec=SPEC], 326 [Spec files 'generic|redhat']), 327 [RPM_SPEC_DIR="rpm/$withval"]) 328 329 AC_MSG_CHECKING([whether spec files are available]) 330 AC_MSG_RESULT([yes ($RPM_SPEC_DIR/*.spec.in)]) 331 332 AC_SUBST(HAVE_RPM) 333 AC_SUBST(RPM) 334 AC_SUBST(RPM_VERSION) 335 336 AC_SUBST(HAVE_RPMBUILD) 337 AC_SUBST(RPMBUILD) 338 AC_SUBST(RPMBUILD_VERSION) 339 340 AC_SUBST(RPM_SPEC_DIR) 341 AC_SUBST(RPM_DEFINE_UTIL) 342 AC_SUBST(RPM_DEFINE_KMOD) 343 AC_SUBST(RPM_DEFINE_DKMS) 344 AC_SUBST(RPM_DEFINE_COMMON) 345 AC_SUBST(SRPM_DEFINE_UTIL) 346 AC_SUBST(SRPM_DEFINE_KMOD) 347 AC_SUBST(SRPM_DEFINE_DKMS) 348 AC_SUBST(SRPM_DEFINE_COMMON) 349]) 350 351dnl # 352dnl # Check for dpkg+dpkg-buildpackage to build DEB packages. If these 353dnl # tools are missing it is non-fatal but you will not be able to build 354dnl # DEB packages and will be warned if you try too. 355dnl # 356AC_DEFUN([ZFS_AC_DPKG], [ 357 DPKG=dpkg 358 DPKGBUILD=dpkg-buildpackage 359 360 AC_MSG_CHECKING([whether $DPKG is available]) 361 AS_IF([tmp=$($DPKG --version 2>/dev/null)], [ 362 DPKG_VERSION=$(echo $tmp | $AWK '/Debian/ { print $[7] }') 363 HAVE_DPKG=yes 364 AC_MSG_RESULT([$HAVE_DPKG ($DPKG_VERSION)]) 365 ],[ 366 HAVE_DPKG=no 367 AC_MSG_RESULT([$HAVE_DPKG]) 368 ]) 369 370 AC_MSG_CHECKING([whether $DPKGBUILD is available]) 371 AS_IF([tmp=$($DPKGBUILD --version 2>/dev/null)], [ 372 DPKGBUILD_VERSION=$(echo $tmp | \ 373 $AWK '/Debian/ { print $[4] }' | cut -f-4 -d'.') 374 HAVE_DPKGBUILD=yes 375 AC_MSG_RESULT([$HAVE_DPKGBUILD ($DPKGBUILD_VERSION)]) 376 ],[ 377 HAVE_DPKGBUILD=no 378 AC_MSG_RESULT([$HAVE_DPKGBUILD]) 379 ]) 380 381 AC_SUBST(HAVE_DPKG) 382 AC_SUBST(DPKG) 383 AC_SUBST(DPKG_VERSION) 384 385 AC_SUBST(HAVE_DPKGBUILD) 386 AC_SUBST(DPKGBUILD) 387 AC_SUBST(DPKGBUILD_VERSION) 388]) 389 390dnl # 391dnl # Until native packaging for various different packing systems 392dnl # can be added the least we can do is attempt to use alien to 393dnl # convert the RPM packages to the needed package type. This is 394dnl # a hack but so far it has worked reasonable well. 395dnl # 396AC_DEFUN([ZFS_AC_ALIEN], [ 397 ALIEN=alien 398 399 AC_MSG_CHECKING([whether $ALIEN is available]) 400 AS_IF([tmp=$($ALIEN --version 2>/dev/null)], [ 401 ALIEN_VERSION=$(echo $tmp | $AWK '{ print $[3] }') 402 HAVE_ALIEN=yes 403 AC_MSG_RESULT([$HAVE_ALIEN ($ALIEN_VERSION)]) 404 ],[ 405 HAVE_ALIEN=no 406 AC_MSG_RESULT([$HAVE_ALIEN]) 407 ]) 408 409 AC_SUBST(HAVE_ALIEN) 410 AC_SUBST(ALIEN) 411 AC_SUBST(ALIEN_VERSION) 412]) 413 414dnl # 415dnl # Using the VENDOR tag from config.guess set the default 416dnl # package type for 'make pkg': (rpm | deb | tgz) 417dnl # 418AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [ 419 AC_MSG_CHECKING([os distribution]) 420 AC_ARG_WITH([vendor], 421 [AS_HELP_STRING([--with-vendor], 422 [Distribution vendor @<:@default=check@:>@])], 423 [with_vendor=$withval], 424 [with_vendor=check]) 425 AS_IF([test "x$with_vendor" = "xcheck"],[ 426 if test -f /etc/toss-release ; then 427 VENDOR=toss ; 428 elif test -f /etc/fedora-release ; then 429 VENDOR=fedora ; 430 elif test -f /etc/redhat-release ; then 431 VENDOR=redhat ; 432 elif test -f /etc/gentoo-release ; then 433 VENDOR=gentoo ; 434 elif test -f /etc/arch-release ; then 435 VENDOR=arch ; 436 elif test -f /etc/SuSE-release ; then 437 VENDOR=sles ; 438 elif test -f /etc/slackware-version ; then 439 VENDOR=slackware ; 440 elif test -f /etc/lunar.release ; then 441 VENDOR=lunar ; 442 elif test -f /etc/lsb-release ; then 443 VENDOR=ubuntu ; 444 elif test -f /etc/debian_version ; then 445 VENDOR=debian ; 446 elif test -f /etc/alpine-release ; then 447 VENDOR=alpine ; 448 elif test -f /bin/freebsd-version ; then 449 VENDOR=freebsd ; 450 else 451 VENDOR= ; 452 fi], 453 [ test "x${with_vendor}" != x],[ 454 VENDOR="$with_vendor" ], 455 [ VENDOR= ; ] 456 ) 457 AC_MSG_RESULT([$VENDOR]) 458 AC_SUBST(VENDOR) 459 460 AC_MSG_CHECKING([default package type]) 461 case "$VENDOR" in 462 toss) DEFAULT_PACKAGE=rpm ;; 463 redhat) DEFAULT_PACKAGE=rpm ;; 464 fedora) DEFAULT_PACKAGE=rpm ;; 465 gentoo) DEFAULT_PACKAGE=tgz ;; 466 alpine) DEFAULT_PACKAGE=tgz ;; 467 arch) DEFAULT_PACKAGE=tgz ;; 468 sles) DEFAULT_PACKAGE=rpm ;; 469 slackware) DEFAULT_PACKAGE=tgz ;; 470 lunar) DEFAULT_PACKAGE=tgz ;; 471 ubuntu) DEFAULT_PACKAGE=deb ;; 472 debian) DEFAULT_PACKAGE=deb ;; 473 freebsd) DEFAULT_PACKAGE=pkg ;; 474 *) DEFAULT_PACKAGE=rpm ;; 475 esac 476 AC_MSG_RESULT([$DEFAULT_PACKAGE]) 477 AC_SUBST(DEFAULT_PACKAGE) 478 479 AC_MSG_CHECKING([default init directory]) 480 case "$VENDOR" in 481 freebsd) initdir=$sysconfdir/rc.d ;; 482 *) initdir=$sysconfdir/init.d;; 483 esac 484 AC_MSG_RESULT([$initdir]) 485 AC_SUBST(initdir) 486 487 AC_MSG_CHECKING([default init script type and shell]) 488 case "$VENDOR" in 489 toss) DEFAULT_INIT_SCRIPT=redhat ;; 490 redhat) DEFAULT_INIT_SCRIPT=redhat ;; 491 fedora) DEFAULT_INIT_SCRIPT=fedora ;; 492 gentoo) DEFAULT_INIT_SCRIPT=openrc ;; 493 alpine) DEFAULT_INIT_SCRIPT=openrc ;; 494 arch) DEFAULT_INIT_SCRIPT=lsb ;; 495 sles) DEFAULT_INIT_SCRIPT=lsb ;; 496 slackware) DEFAULT_INIT_SCRIPT=lsb ;; 497 lunar) DEFAULT_INIT_SCRIPT=lunar ;; 498 ubuntu) DEFAULT_INIT_SCRIPT=lsb ;; 499 debian) DEFAULT_INIT_SCRIPT=lsb ;; 500 freebsd) DEFAULT_INIT_SCRIPT=freebsd;; 501 *) DEFAULT_INIT_SCRIPT=lsb ;; 502 esac 503 504 # On gentoo, it's possible that OpenRC isn't installed. Check if 505 # /sbin/openrc-run exists, and if not, fall back to generic defaults. 506 507 DEFAULT_INIT_SHELL="/bin/sh" 508 AS_IF([test "$DEFAULT_INIT_SCRIPT" = "openrc"], [ 509 AS_IF([test -x "/sbin/openrc-run"], 510 [DEFAULT_INIT_SHELL="/sbin/openrc-run"], 511 [DEFAULT_INIT_SCRIPT=lsb]) 512 ]) 513 514 AC_MSG_RESULT([$DEFAULT_INIT_SCRIPT:$DEFAULT_INIT_SHELL]) 515 AC_SUBST(DEFAULT_INIT_SCRIPT) 516 AC_SUBST(DEFAULT_INIT_SHELL) 517 518 AC_MSG_CHECKING([default nfs server init script]) 519 AS_IF([test "$VENDOR" = "debian"], 520 [DEFAULT_INIT_NFS_SERVER="nfs-kernel-server"], 521 [DEFAULT_INIT_NFS_SERVER="nfs"] 522 ) 523 AC_MSG_RESULT([$DEFAULT_INIT_NFS_SERVER]) 524 AC_SUBST(DEFAULT_INIT_NFS_SERVER) 525 526 AC_MSG_CHECKING([default init config directory]) 527 case "$VENDOR" in 528 alpine) initconfdir=/etc/conf.d ;; 529 gentoo) initconfdir=/etc/conf.d ;; 530 toss) initconfdir=/etc/sysconfig ;; 531 redhat) initconfdir=/etc/sysconfig ;; 532 fedora) initconfdir=/etc/sysconfig ;; 533 sles) initconfdir=/etc/sysconfig ;; 534 ubuntu) initconfdir=/etc/default ;; 535 debian) initconfdir=/etc/default ;; 536 freebsd) initconfdir=$sysconfdir/rc.conf.d;; 537 *) initconfdir=/etc/default ;; 538 esac 539 AC_MSG_RESULT([$initconfdir]) 540 AC_SUBST(initconfdir) 541 542 AC_MSG_CHECKING([whether initramfs-tools is available]) 543 if test -d /usr/share/initramfs-tools ; then 544 RPM_DEFINE_INITRAMFS='--define "_initramfs 1"' 545 AC_MSG_RESULT([yes]) 546 else 547 RPM_DEFINE_INITRAMFS='' 548 AC_MSG_RESULT([no]) 549 fi 550 AC_SUBST(RPM_DEFINE_INITRAMFS) 551]) 552 553dnl # 554dnl # Default ZFS package configuration 555dnl # 556AC_DEFUN([ZFS_AC_PACKAGE], [ 557 ZFS_AC_DEFAULT_PACKAGE 558 AS_IF([test x$VENDOR != xfreebsd], [ 559 ZFS_AC_RPM 560 ZFS_AC_DPKG 561 ZFS_AC_ALIEN 562 ]) 563]) 564