]>
Commit | Line | Data |
---|---|---|
c9c0d073 BB |
1 | AC_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 | ||
6f174823 | 9 | AC_DEFUN([ZFS_AC_DEBUG_ENABLE], [ |
fed90353 BB |
10 | DEBUG_CFLAGS="-Werror" |
11 | DEBUG_CPPFLAGS="-DDEBUG -UNDEBUG" | |
12 | DEBUG_LDFLAGS="" | |
6f174823 RY |
13 | DEBUG_ZFS="_with_debug" |
14 | AC_DEFINE(ZFS_DEBUG, 1, [zfs debugging enabled]) | |
fed90353 BB |
15 | |
16 | KERNEL_DEBUG_CFLAGS="-Werror" | |
17 | KERNEL_DEBUG_CPPFLAGS="-DDEBUG -UNDEBUG" | |
6f174823 RY |
18 | ]) |
19 | ||
20 | AC_DEFUN([ZFS_AC_DEBUG_DISABLE], [ | |
fed90353 BB |
21 | DEBUG_CFLAGS="" |
22 | DEBUG_CPPFLAGS="-UDEBUG -DNDEBUG" | |
23 | DEBUG_LDFLAGS="" | |
6f174823 | 24 | DEBUG_ZFS="_without_debug" |
fed90353 BB |
25 | |
26 | KERNEL_DEBUG_CFLAGS="" | |
27 | KERNEL_DEBUG_CPPFLAGS="-UDEBUG -DNDEBUG" | |
6f174823 RY |
28 | ]) |
29 | ||
fed90353 BB |
30 | dnl # |
31 | dnl # When debugging is enabled: | |
32 | dnl # - Enable all ASSERTs (-DDEBUG) | |
33 | dnl # - Promote all compiler warnings to errors (-Werror) | |
34 | dnl # | |
c9c0d073 | 35 | AC_DEFUN([ZFS_AC_DEBUG], [ |
6f174823 | 36 | AC_MSG_CHECKING([whether assertion support will be enabled]) |
c9c0d073 BB |
37 | AC_ARG_ENABLE([debug], |
38 | [AS_HELP_STRING([--enable-debug], | |
fed90353 | 39 | [Enable compiler and code assertions @<:@default=no@:>@])], |
c9c0d073 BB |
40 | [], |
41 | [enable_debug=no]) | |
42 | ||
6f174823 RY |
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])]) | |
c9c0d073 | 49 | |
fed90353 BB |
50 | AC_SUBST(DEBUG_CFLAGS) |
51 | AC_SUBST(DEBUG_CPPFLAGS) | |
52 | AC_SUBST(DEBUG_LDFLAGS) | |
4b787d75 | 53 | AC_SUBST(DEBUG_ZFS) |
fed90353 BB |
54 | |
55 | AC_SUBST(KERNEL_DEBUG_CFLAGS) | |
56 | AC_SUBST(KERNEL_DEBUG_CPPFLAGS) | |
57 | ||
c9c0d073 BB |
58 | AC_MSG_RESULT([$enable_debug]) |
59 | ]) | |
60 | ||
fed90353 BB |
61 | AC_DEFUN([ZFS_AC_DEBUGINFO_ENABLE], [ |
62 | DEBUG_CFLAGS="$DEBUG_CFLAGS -g -fno-inline" | |
63 | ||
64 | KERNEL_DEBUG_CFLAGS="$KERNEL_DEBUG_CFLAGS -fno-inline" | |
65 | KERNEL_MAKE="$KERNEL_MAKE CONFIG_DEBUG_INFO=y" | |
66 | ||
67 | DEBUGINFO_ZFS="_with_debuginfo" | |
0d3980ac RY |
68 | ]) |
69 | ||
fed90353 BB |
70 | AC_DEFUN([ZFS_AC_DEBUGINFO_DISABLE], [ |
71 | DEBUGINFO_ZFS="_without_debuginfo" | |
0d3980ac RY |
72 | ]) |
73 | ||
74 | AC_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"], | |
fed90353 | 84 | [ZFS_AC_DEBUGINFO_ENABLE], |
0d3980ac | 85 | ["xno"], |
fed90353 BB |
86 | [ZFS_AC_DEBUGINFO_DISABLE], |
87 | [AC_MSG_ERROR([Unknown option $enable_debuginfo])]) | |
0d3980ac RY |
88 | |
89 | AC_SUBST(DEBUG_CFLAGS) | |
fed90353 BB |
90 | AC_SUBST(DEBUGINFO_ZFS) |
91 | ||
92 | AC_SUBST(KERNEL_DEBUG_CFLAGS) | |
93 | AC_SUBST(KERNEL_MAKE) | |
94 | ||
0d3980ac RY |
95 | AC_MSG_RESULT([$enable_debuginfo]) |
96 | ]) | |
97 | ||
93ce2b4c BB |
98 | dnl # |
99 | dnl # Disabled by default, provides basic memory tracking. Track the total | |
100 | dnl # number of bytes allocated with kmem_alloc() and freed with kmem_free(). | |
101 | dnl # Then at module unload time if any bytes were leaked it will be reported | |
102 | dnl # on the console. | |
103 | dnl # | |
104 | AC_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+=" -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 | ||
125 | dnl # | |
126 | dnl # Disabled by default, provides detailed memory tracking. This feature | |
127 | dnl # also requires --enable-debug-kmem to be set. When enabled not only will | |
128 | dnl # total bytes be tracked but also the location of every kmem_alloc() and | |
129 | dnl # kmem_free(). When the module is unloaded a list of all leaked addresses | |
130 | dnl # and where they were allocated will be dumped to the console. Enabling | |
131 | dnl # this feature has a significant impact on performance but it makes finding | |
132 | dnl # memory leaks straight forward. | |
133 | dnl # | |
134 | AC_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+=" -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 | ||
2e08aedb | 155 | AC_DEFUN([ZFS_AC_CONFIG_ALWAYS], [ |
fed90353 BB |
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_ASAN | |
fc0c72b1 | 161 | ZFS_AC_CONFIG_ALWAYS_TOOLCHAIN_SIMD |
0b04990a | 162 | ZFS_AC_CONFIG_ALWAYS_ARCH |
6e72a5b9 | 163 | ZFS_AC_CONFIG_ALWAYS_PYTHON |
85ce3f4f | 164 | ZFS_AC_CONFIG_ALWAYS_PYZFS |
2e08aedb BB |
165 | ]) |
166 | ||
c9c0d073 | 167 | AC_DEFUN([ZFS_AC_CONFIG], [ |
c9c0d073 BB |
168 | ZFS_CONFIG=all |
169 | AC_ARG_WITH([config], | |
170 | AS_HELP_STRING([--with-config=CONFIG], | |
171 | [Config file 'kernel|user|all|srpm']), | |
172 | [ZFS_CONFIG="$withval"]) | |
319a99a3 ED |
173 | AC_ARG_ENABLE([linux-builtin], |
174 | [AC_HELP_STRING([--enable-linux-builtin], | |
175 | [Configure for builtin in-tree kernel modules @<:@default=no@:>@])], | |
176 | [], | |
177 | [enable_linux_builtin=no]) | |
c9c0d073 BB |
178 | |
179 | AC_MSG_CHECKING([zfs config]) | |
180 | AC_MSG_RESULT([$ZFS_CONFIG]); | |
181 | AC_SUBST(ZFS_CONFIG) | |
182 | ||
2e08aedb BB |
183 | ZFS_AC_CONFIG_ALWAYS |
184 | ||
c9c0d073 BB |
185 | case "$ZFS_CONFIG" in |
186 | kernel) ZFS_AC_CONFIG_KERNEL ;; | |
187 | user) ZFS_AC_CONFIG_USER ;; | |
6bb24f4d BB |
188 | all) ZFS_AC_CONFIG_USER |
189 | ZFS_AC_CONFIG_KERNEL ;; | |
c9c0d073 BB |
190 | srpm) ;; |
191 | *) | |
192 | AC_MSG_RESULT([Error!]) | |
193 | AC_MSG_ERROR([Bad value "$ZFS_CONFIG" for --with-config, | |
194 | user kernel|user|all|srpm]) ;; | |
195 | esac | |
196 | ||
197 | AM_CONDITIONAL([CONFIG_USER], | |
63e0828c | 198 | [test "$ZFS_CONFIG" = user -o "$ZFS_CONFIG" = all]) |
c9c0d073 | 199 | AM_CONDITIONAL([CONFIG_KERNEL], |
63e0828c BB |
200 | [test "$ZFS_CONFIG" = kernel -o "$ZFS_CONFIG" = all] && |
201 | [test "x$enable_linux_builtin" != xyes ]) | |
6a9d6359 | 202 | AM_CONDITIONAL([CONFIG_QAT], |
203 | [test "$ZFS_CONFIG" = kernel -o "$ZFS_CONFIG" = all] && | |
204 | [test "x$qatsrc" != x ]) | |
b2ab468d BB |
205 | AM_CONDITIONAL([WANT_DEVNAME2DEVID], [test "x$user_libudev" = xyes ]) |
206 | AM_CONDITIONAL([WANT_MMAP_LIBAIO], [test "x$user_libaio" = xyes ]) | |
c9c0d073 BB |
207 | ]) |
208 | ||
209 | dnl # | |
210 | dnl # Check for rpm+rpmbuild to build RPM packages. If these tools | |
211 | dnl # are missing it is non-fatal but you will not be able to build | |
212 | dnl # RPM packages and will be warned if you try too. | |
213 | dnl # | |
f3757573 BB |
214 | dnl # By default the generic spec file will be used because it requires |
215 | dnl # minimal dependencies. Distribution specific spec files can be | |
216 | dnl # placed under the 'rpm/<distribution>' directory and enabled using | |
217 | dnl # the --with-spec=<distribution> configure option. | |
218 | dnl # | |
c9c0d073 BB |
219 | AC_DEFUN([ZFS_AC_RPM], [ |
220 | RPM=rpm | |
221 | RPMBUILD=rpmbuild | |
222 | ||
223 | AC_MSG_CHECKING([whether $RPM is available]) | |
224 | AS_IF([tmp=$($RPM --version 2>/dev/null)], [ | |
225 | RPM_VERSION=$(echo $tmp | $AWK '/RPM/ { print $[3] }') | |
226 | HAVE_RPM=yes | |
227 | AC_MSG_RESULT([$HAVE_RPM ($RPM_VERSION)]) | |
228 | ],[ | |
229 | HAVE_RPM=no | |
230 | AC_MSG_RESULT([$HAVE_RPM]) | |
231 | ]) | |
232 | ||
233 | AC_MSG_CHECKING([whether $RPMBUILD is available]) | |
234 | AS_IF([tmp=$($RPMBUILD --version 2>/dev/null)], [ | |
235 | RPMBUILD_VERSION=$(echo $tmp | $AWK '/RPM/ { print $[3] }') | |
236 | HAVE_RPMBUILD=yes | |
237 | AC_MSG_RESULT([$HAVE_RPMBUILD ($RPMBUILD_VERSION)]) | |
238 | ],[ | |
239 | HAVE_RPMBUILD=no | |
240 | AC_MSG_RESULT([$HAVE_RPMBUILD]) | |
241 | ]) | |
242 | ||
3ec3bc21 | 243 | RPM_DEFINE_COMMON='--define "$(DEBUG_ZFS) 1"' |
93ce2b4c BB |
244 | RPM_DEFINE_COMMON+=' --define "$(DEBUG_KMEM_ZFS) 1"' |
245 | RPM_DEFINE_COMMON+=' --define "$(DEBUG_KMEM_TRACKING_ZFS) 1"' | |
fed90353 BB |
246 | RPM_DEFINE_COMMON+=' --define "$(DEBUGINFO_ZFS) 1"' |
247 | RPM_DEFINE_COMMON+=' --define "$(ASAN_ZFS) 1"' | |
248 | ||
9ea6c3d3 TH |
249 | RPM_DEFINE_UTIL=' --define "_initconfdir $(DEFAULT_INITCONF_DIR)"' |
250 | ||
251 | dnl # Make the next three RPM_DEFINE_UTIL additions conditional, since | |
252 | dnl # their values may not be set when running: | |
253 | dnl # | |
254 | dnl # ./configure --with-config=srpm | |
255 | dnl # | |
256 | AS_IF([test -n "$dracutdir" ], [ | |
257 | RPM_DEFINE_UTIL='--define "_dracutdir $(dracutdir)"' | |
258 | ]) | |
259 | AS_IF([test -n "$udevdir" ], [ | |
260 | RPM_DEFINE_UTIL+=' --define "_udevdir $(udevdir)"' | |
261 | ]) | |
262 | AS_IF([test -n "$udevruledir" ], [ | |
263 | RPM_DEFINE_UTIL+=' --define "_udevdir $(udevruledir)"' | |
264 | ]) | |
fed90353 BB |
265 | RPM_DEFINE_UTIL+=' $(DEFINE_INITRAMFS)' |
266 | RPM_DEFINE_UTIL+=' $(DEFINE_SYSTEMD)' | |
85ce3f4f | 267 | RPM_DEFINE_UTIL+=' $(DEFINE_PYZFS)' |
6e72a5b9 BB |
268 | RPM_DEFINE_UTIL+=' $(DEFINE_PYTHON_VERSION)' |
269 | RPM_DEFINE_UTIL+=' $(DEFINE_PYTHON_PKG_VERSION)' | |
fed90353 | 270 | |
6e72a5b9 BB |
271 | dnl # Override default lib directory on Debian/Ubuntu systems. The |
272 | dnl # provided /usr/lib/rpm/platform/<arch>/macros files do not | |
273 | dnl # specify the correct path for multiarch systems as described | |
274 | dnl # by the packaging guidelines. | |
3d25488a BB |
275 | dnl # |
276 | dnl # https://wiki.ubuntu.com/MultiarchSpec | |
277 | dnl # https://wiki.debian.org/Multiarch/Implementation | |
278 | dnl # | |
279 | AS_IF([test "$DEFAULT_PACKAGE" = "deb"], [ | |
280 | MULTIARCH_LIBDIR="lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)" | |
281 | RPM_DEFINE_UTIL+=' --define "_lib $(MULTIARCH_LIBDIR)"' | |
282 | AC_SUBST(MULTIARCH_LIBDIR) | |
283 | ]) | |
284 | ||
fed90353 | 285 | RPM_DEFINE_KMOD='--define "kernels $(LINUX_VERSION)"' |
fed90353 BB |
286 | RPM_DEFINE_KMOD+=' --define "ksrc $(LINUX)"' |
287 | RPM_DEFINE_KMOD+=' --define "kobj $(LINUX_OBJ)"' | |
c45c6d92 | 288 | RPM_DEFINE_KMOD+=' --define "_wrong_version_format_terminate_build 0"' |
fed90353 BB |
289 | |
290 | RPM_DEFINE_DKMS='' | |
f3757573 BB |
291 | |
292 | SRPM_DEFINE_COMMON='--define "build_src_rpm 1"' | |
293 | SRPM_DEFINE_UTIL= | |
294 | SRPM_DEFINE_KMOD= | |
295 | SRPM_DEFINE_DKMS= | |
296 | ||
297 | RPM_SPEC_DIR="rpm/generic" | |
298 | AC_ARG_WITH([spec], | |
299 | AS_HELP_STRING([--with-spec=SPEC], | |
ee2ca1db | 300 | [Spec files 'generic|redhat']), |
f3757573 BB |
301 | [RPM_SPEC_DIR="rpm/$withval"]) |
302 | ||
303 | AC_MSG_CHECKING([whether spec files are available]) | |
304 | AC_MSG_RESULT([yes ($RPM_SPEC_DIR/*.spec.in)]) | |
305 | ||
c9c0d073 BB |
306 | AC_SUBST(HAVE_RPM) |
307 | AC_SUBST(RPM) | |
308 | AC_SUBST(RPM_VERSION) | |
309 | ||
310 | AC_SUBST(HAVE_RPMBUILD) | |
311 | AC_SUBST(RPMBUILD) | |
312 | AC_SUBST(RPMBUILD_VERSION) | |
f3757573 BB |
313 | |
314 | AC_SUBST(RPM_SPEC_DIR) | |
315 | AC_SUBST(RPM_DEFINE_UTIL) | |
316 | AC_SUBST(RPM_DEFINE_KMOD) | |
317 | AC_SUBST(RPM_DEFINE_DKMS) | |
318 | AC_SUBST(RPM_DEFINE_COMMON) | |
319 | AC_SUBST(SRPM_DEFINE_UTIL) | |
320 | AC_SUBST(SRPM_DEFINE_KMOD) | |
321 | AC_SUBST(SRPM_DEFINE_DKMS) | |
322 | AC_SUBST(SRPM_DEFINE_COMMON) | |
c9c0d073 BB |
323 | ]) |
324 | ||
325 | dnl # | |
326 | dnl # Check for dpkg+dpkg-buildpackage to build DEB packages. If these | |
327 | dnl # tools are missing it is non-fatal but you will not be able to build | |
328 | dnl # DEB packages and will be warned if you try too. | |
329 | dnl # | |
330 | AC_DEFUN([ZFS_AC_DPKG], [ | |
331 | DPKG=dpkg | |
332 | DPKGBUILD=dpkg-buildpackage | |
333 | ||
334 | AC_MSG_CHECKING([whether $DPKG is available]) | |
335 | AS_IF([tmp=$($DPKG --version 2>/dev/null)], [ | |
336 | DPKG_VERSION=$(echo $tmp | $AWK '/Debian/ { print $[7] }') | |
337 | HAVE_DPKG=yes | |
338 | AC_MSG_RESULT([$HAVE_DPKG ($DPKG_VERSION)]) | |
339 | ],[ | |
340 | HAVE_DPKG=no | |
341 | AC_MSG_RESULT([$HAVE_DPKG]) | |
342 | ]) | |
343 | ||
344 | AC_MSG_CHECKING([whether $DPKGBUILD is available]) | |
345 | AS_IF([tmp=$($DPKGBUILD --version 2>/dev/null)], [ | |
346 | DPKGBUILD_VERSION=$(echo $tmp | \ | |
347 | $AWK '/Debian/ { print $[4] }' | cut -f-4 -d'.') | |
348 | HAVE_DPKGBUILD=yes | |
349 | AC_MSG_RESULT([$HAVE_DPKGBUILD ($DPKGBUILD_VERSION)]) | |
350 | ],[ | |
351 | HAVE_DPKGBUILD=no | |
352 | AC_MSG_RESULT([$HAVE_DPKGBUILD]) | |
353 | ]) | |
354 | ||
355 | AC_SUBST(HAVE_DPKG) | |
356 | AC_SUBST(DPKG) | |
357 | AC_SUBST(DPKG_VERSION) | |
358 | ||
359 | AC_SUBST(HAVE_DPKGBUILD) | |
360 | AC_SUBST(DPKGBUILD) | |
361 | AC_SUBST(DPKGBUILD_VERSION) | |
362 | ]) | |
363 | ||
364 | dnl # | |
365 | dnl # Until native packaging for various different packing systems | |
366 | dnl # can be added the least we can do is attempt to use alien to | |
367 | dnl # convert the RPM packages to the needed package type. This is | |
368 | dnl # a hack but so far it has worked reasonable well. | |
369 | dnl # | |
370 | AC_DEFUN([ZFS_AC_ALIEN], [ | |
371 | ALIEN=alien | |
372 | ||
373 | AC_MSG_CHECKING([whether $ALIEN is available]) | |
374 | AS_IF([tmp=$($ALIEN --version 2>/dev/null)], [ | |
375 | ALIEN_VERSION=$(echo $tmp | $AWK '{ print $[3] }') | |
376 | HAVE_ALIEN=yes | |
377 | AC_MSG_RESULT([$HAVE_ALIEN ($ALIEN_VERSION)]) | |
378 | ],[ | |
379 | HAVE_ALIEN=no | |
380 | AC_MSG_RESULT([$HAVE_ALIEN]) | |
381 | ]) | |
382 | ||
383 | AC_SUBST(HAVE_ALIEN) | |
384 | AC_SUBST(ALIEN) | |
385 | AC_SUBST(ALIEN_VERSION) | |
386 | ]) | |
387 | ||
388 | dnl # | |
389 | dnl # Using the VENDOR tag from config.guess set the default | |
390 | dnl # package type for 'make pkg': (rpm | deb | tgz) | |
391 | dnl # | |
392 | AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [ | |
393 | AC_MSG_CHECKING([linux distribution]) | |
76c2b24c RY |
394 | if test -f /etc/toss-release ; then |
395 | VENDOR=toss ; | |
c9c0d073 BB |
396 | elif test -f /etc/fedora-release ; then |
397 | VENDOR=fedora ; | |
76c2b24c RY |
398 | elif test -f /etc/redhat-release ; then |
399 | VENDOR=redhat ; | |
d9bfe0f5 AS |
400 | elif test -f /etc/gentoo-release ; then |
401 | VENDOR=gentoo ; | |
76c2b24c RY |
402 | elif test -f /etc/arch-release ; then |
403 | VENDOR=arch ; | |
c9c0d073 BB |
404 | elif test -f /etc/SuSE-release ; then |
405 | VENDOR=sles ; | |
406 | elif test -f /etc/slackware-version ; then | |
407 | VENDOR=slackware ; | |
712f8bd8 BB |
408 | elif test -f /etc/lunar.release ; then |
409 | VENDOR=lunar ; | |
76c2b24c RY |
410 | elif test -f /etc/lsb-release ; then |
411 | VENDOR=ubuntu ; | |
412 | elif test -f /etc/debian_version ; then | |
413 | VENDOR=debian ; | |
c53fb011 CL |
414 | elif test -f /etc/alpine-release ; then |
415 | VENDOR=alpine ; | |
c9c0d073 BB |
416 | else |
417 | VENDOR= ; | |
418 | fi | |
419 | AC_MSG_RESULT([$VENDOR]) | |
420 | AC_SUBST(VENDOR) | |
421 | ||
422 | AC_MSG_CHECKING([default package type]) | |
423 | case "$VENDOR" in | |
76c2b24c RY |
424 | toss) DEFAULT_PACKAGE=rpm ;; |
425 | redhat) DEFAULT_PACKAGE=rpm ;; | |
426 | fedora) DEFAULT_PACKAGE=rpm ;; | |
427 | gentoo) DEFAULT_PACKAGE=tgz ;; | |
c53fb011 | 428 | alpine) DEFAULT_PACKAGE=tgz ;; |
0da31cd6 | 429 | arch) DEFAULT_PACKAGE=tgz ;; |
76c2b24c RY |
430 | sles) DEFAULT_PACKAGE=rpm ;; |
431 | slackware) DEFAULT_PACKAGE=tgz ;; | |
432 | lunar) DEFAULT_PACKAGE=tgz ;; | |
433 | ubuntu) DEFAULT_PACKAGE=deb ;; | |
434 | debian) DEFAULT_PACKAGE=deb ;; | |
435 | *) DEFAULT_PACKAGE=rpm ;; | |
c9c0d073 | 436 | esac |
c9c0d073 BB |
437 | AC_MSG_RESULT([$DEFAULT_PACKAGE]) |
438 | AC_SUBST(DEFAULT_PACKAGE) | |
01c0e61d | 439 | |
0da31cd6 | 440 | DEFAULT_INIT_DIR=$sysconfdir/init.d |
615ab66d | 441 | AC_MSG_CHECKING([default init directory]) |
615ab66d KF |
442 | AC_MSG_RESULT([$DEFAULT_INIT_DIR]) |
443 | AC_SUBST(DEFAULT_INIT_DIR) | |
444 | ||
01c0e61d BB |
445 | AC_MSG_CHECKING([default init script type]) |
446 | case "$VENDOR" in | |
76c2b24c | 447 | toss) DEFAULT_INIT_SCRIPT=redhat ;; |
712f8bd8 | 448 | redhat) DEFAULT_INIT_SCRIPT=redhat ;; |
01c0e61d | 449 | fedora) DEFAULT_INIT_SCRIPT=fedora ;; |
c53fb011 CL |
450 | gentoo) DEFAULT_INIT_SCRIPT=openrc ;; |
451 | alpine) DEFAULT_INIT_SCRIPT=openrc ;; | |
0da31cd6 | 452 | arch) DEFAULT_INIT_SCRIPT=lsb ;; |
76c2b24c RY |
453 | sles) DEFAULT_INIT_SCRIPT=lsb ;; |
454 | slackware) DEFAULT_INIT_SCRIPT=lsb ;; | |
455 | lunar) DEFAULT_INIT_SCRIPT=lunar ;; | |
456 | ubuntu) DEFAULT_INIT_SCRIPT=lsb ;; | |
457 | debian) DEFAULT_INIT_SCRIPT=lsb ;; | |
458 | *) DEFAULT_INIT_SCRIPT=lsb ;; | |
01c0e61d | 459 | esac |
01c0e61d BB |
460 | AC_MSG_RESULT([$DEFAULT_INIT_SCRIPT]) |
461 | AC_SUBST(DEFAULT_INIT_SCRIPT) | |
2a34db1b TF |
462 | |
463 | AC_MSG_CHECKING([default init config direectory]) | |
464 | case "$VENDOR" in | |
c53fb011 | 465 | alpine) DEFAULT_INITCONF_DIR=/etc/conf.d ;; |
2a34db1b TF |
466 | gentoo) DEFAULT_INITCONF_DIR=/etc/conf.d ;; |
467 | toss) DEFAULT_INITCONF_DIR=/etc/sysconfig ;; | |
468 | redhat) DEFAULT_INITCONF_DIR=/etc/sysconfig ;; | |
469 | fedora) DEFAULT_INITCONF_DIR=/etc/sysconfig ;; | |
470 | sles) DEFAULT_INITCONF_DIR=/etc/sysconfig ;; | |
471 | ubuntu) DEFAULT_INITCONF_DIR=/etc/default ;; | |
472 | debian) DEFAULT_INITCONF_DIR=/etc/default ;; | |
473 | *) DEFAULT_INITCONF_DIR=/etc/default ;; | |
474 | esac | |
2a34db1b TF |
475 | AC_MSG_RESULT([$DEFAULT_INITCONF_DIR]) |
476 | AC_SUBST(DEFAULT_INITCONF_DIR) | |
2cac7f5f TF |
477 | |
478 | AC_MSG_CHECKING([whether initramfs-tools is available]) | |
479 | if test -d /usr/share/initramfs-tools ; then | |
480 | DEFINE_INITRAMFS='--define "_initramfs 1"' | |
481 | AC_MSG_RESULT([yes]) | |
482 | else | |
483 | DEFINE_INITRAMFS='' | |
484 | AC_MSG_RESULT([no]) | |
485 | fi | |
486 | AC_SUBST(DEFINE_INITRAMFS) | |
c9c0d073 BB |
487 | ]) |
488 | ||
489 | dnl # | |
490 | dnl # Default ZFS package configuration | |
491 | dnl # | |
492 | AC_DEFUN([ZFS_AC_PACKAGE], [ | |
58d956b0 | 493 | ZFS_AC_DEFAULT_PACKAGE |
c9c0d073 BB |
494 | ZFS_AC_RPM |
495 | ZFS_AC_DPKG | |
496 | ZFS_AC_ALIEN | |
c9c0d073 | 497 | ]) |