2010-08-26 22:22:58 +04:00
|
|
|
/*
|
2022-04-09 15:37:22 +03:00
|
|
|
* This file is part of OpenZFS.
|
2010-08-26 22:22:58 +04:00
|
|
|
*
|
|
|
|
* Copyright (c) 2009 Lawrence Livermore National Security, LLC.
|
|
|
|
* Produced at Lawrence Livermore National Laboratory
|
|
|
|
* Written by:
|
|
|
|
* Brian Behlendorf <behlendorf1@llnl.gov>,
|
|
|
|
* Herb Wartens <wartens2@llnl.gov>,
|
|
|
|
* Jim Garlick <garlick@llnl.gov>
|
|
|
|
* LLNL-CODE-403049
|
|
|
|
*
|
|
|
|
* CDDL HEADER START
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the terms of the
|
|
|
|
* Common Development and Distribution License, Version 1.0 only
|
|
|
|
* (the "License"). You may not use this file except in compliance
|
|
|
|
* with the License.
|
|
|
|
*
|
|
|
|
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
2022-07-12 00:16:13 +03:00
|
|
|
* or https://opensource.org/licenses/CDDL-1.0.
|
2010-08-26 22:22:58 +04:00
|
|
|
* See the License for the specific language governing permissions
|
|
|
|
* and limitations under the License.
|
|
|
|
*
|
|
|
|
* When distributing Covered Code, include this CDDL HEADER in each
|
|
|
|
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
|
|
|
* If applicable, add the following below this CDDL HEADER, with the
|
|
|
|
* fields enclosed by brackets "[]" replaced with your own identifying
|
|
|
|
* information: Portions Copyright [yyyy] [name of copyright owner]
|
|
|
|
*
|
|
|
|
* CDDL HEADER END
|
|
|
|
*/
|
|
|
|
|
2022-04-08 02:07:08 +03:00
|
|
|
AC_INIT(m4_esyscmd(awk '/^Name:/ {printf $2}' META),
|
|
|
|
m4_esyscmd(awk '/^Version:/ {printf $2}' META))
|
2022-12-14 04:33:05 +03:00
|
|
|
CFGOPTS="$*"
|
2010-08-26 22:22:58 +04:00
|
|
|
AC_LANG(C)
|
|
|
|
ZFS_AC_META
|
|
|
|
AC_CONFIG_AUX_DIR([config])
|
2013-03-30 06:33:09 +04:00
|
|
|
AC_CONFIG_MACRO_DIR([config])
|
2021-01-03 03:55:55 +03:00
|
|
|
AC_CANONICAL_TARGET
|
2010-08-26 22:22:58 +04:00
|
|
|
AM_MAINTAINER_MODE
|
2013-04-03 02:16:39 +04:00
|
|
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
2022-04-08 02:07:08 +03:00
|
|
|
AM_INIT_AUTOMAKE([subdir-objects foreign])
|
2022-04-10 20:00:47 +03:00
|
|
|
# Remove default macros from config.h:
|
|
|
|
# PACKAGE, PACKAGE_{BUGREPORT,NAME,STRING,TARNAME,VERSION}, STDC_HEADERS, VERSION
|
2010-08-26 22:22:58 +04:00
|
|
|
AC_CONFIG_HEADERS([zfs_config.h], [
|
2023-11-02 01:19:44 +03:00
|
|
|
$SED -nri~ -e '/^$/be' -e 'N;N;/#define (PACKAGE|VERSION|STDC_HEADERS)/d' -e ':e' -e 'p' zfs_config.h && rm zfs_config.h~ || exit])
|
2010-08-26 22:22:58 +04:00
|
|
|
|
2021-01-03 03:55:55 +03:00
|
|
|
LT_INIT
|
2010-08-26 22:22:58 +04:00
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_CC
|
2021-05-08 16:04:48 +03:00
|
|
|
AC_PROG_LN_S
|
config: better libtirpc detection
Improve the autoconf code for finding libtirpc and do not assume the
headers are in /usr/include/tirpc.
Also remove this assumption from the `rpc/xdr.h` header in libspl and
use the same `#include_next` mechanism that is used for other libspl
headers.
Include pkg.m4 from pkg-config in config/ for PKG_CHECK_MODULES(), the
file license allows this.
Include ax_save_flags.m4 and ax_restore_flags.m4 from autoconf-archive,
the file licenses are compatible. Use the 2012 versions so as not rely
on a more recent autoconf feature AS_VAR_COPY(), which breaks some build
slaves.
Add new macro library `config/find_system_library.m4` which defines the
FIND_SYSTEM_LIBRARY() macro which is a convenience wrapper over using
PKG_CHECK_MODULES() with a fallback to standard library locations and
some sanity checks.
The parameters are:
```
FIND_SYSTEM_LIBRARY(VARIABLE-PREFIX, MODULE, HEADER, HEADER-PREFIXES,
LIBRARY, FUNCTIONS, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
```
`HEADER-PREFIXES` and `FUNCTIONS` are comma-separated m4 lists.
For libtirpc we are using:
```
FIND_SYSTEM_LIBRARY(LIBTIRPC, [libtirpc], [rpc/xdr.h], [tirpc], [tirpc],
[xdrmem_create], [], [...])
```
The headers are first checked for without the prefixes and then with.
This system works with pkg-config and falls back on checking standard
header/library locations, it can be easily overridden by the user by
setting the `PREFIX_CFLAGS` and `PREFIX_LIBS` variables which are
automatically added to the `./configure --help` output.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Closes #7422
Closes #8313
2019-03-03 03:19:05 +03:00
|
|
|
PKG_PROG_PKG_CONFIG
|
2010-08-26 22:22:58 +04:00
|
|
|
AM_PROG_AS
|
2016-06-16 01:47:05 +03:00
|
|
|
AM_PROG_CC_C_O
|
2017-09-23 04:49:57 +03:00
|
|
|
AX_CODE_COVERAGE
|
2018-08-15 19:52:28 +03:00
|
|
|
_AM_PROG_TAR(pax)
|
2010-08-26 22:22:58 +04:00
|
|
|
|
|
|
|
ZFS_AC_LICENSE
|
|
|
|
ZFS_AC_CONFIG
|
2020-07-01 19:05:21 +03:00
|
|
|
ZFS_AC_PACKAGE
|
2010-08-26 22:22:58 +04:00
|
|
|
ZFS_AC_DEBUG
|
2014-09-23 22:29:30 +04:00
|
|
|
ZFS_AC_DEBUGINFO
|
2018-02-16 04:53:18 +03:00
|
|
|
ZFS_AC_DEBUG_KMEM
|
|
|
|
ZFS_AC_DEBUG_KMEM_TRACKING
|
2021-03-05 23:16:41 +03:00
|
|
|
ZFS_AC_DEBUG_INVARIANTS
|
2010-08-26 22:22:58 +04:00
|
|
|
|
2015-07-02 01:23:09 +03:00
|
|
|
AC_CONFIG_FILES([
|
2022-12-14 04:33:05 +03:00
|
|
|
contrib/debian/rules
|
2023-11-16 19:58:47 +03:00
|
|
|
contrib/debian/changelog
|
2010-08-26 22:22:58 +04:00
|
|
|
Makefile
|
2019-10-09 20:54:22 +03:00
|
|
|
include/Makefile
|
2014-06-07 03:23:22 +04:00
|
|
|
lib/libzfs/libzfs.pc
|
Clean up lib dependencies
libzutil is currently statically linked into libzfs, libzfs_core and
libzpool. Avoid the unnecessary duplication by removing it from libzfs
and libzpool, and adding libzfs_core to libzpool.
Remove a few unnecessary dependencies:
- libuutil from libzfs_core
- libtirpc from libspl
- keep only libcrypto in libzfs, as we don't use any functions from
libssl
- librt is only used for clock_gettime, however on modern systems that's
in libc rather than librt. Add a configure check to see if we actually
need librt
- libdl from raidz_test
Add a few missing dependencies:
- zlib to libefi and libzfs
- libuuid to zpool, and libuuid and libudev to zed
- libnvpair uses assertions, so add assert.c to provide aok and
libspl_assertf
Sort the LDADD for programs so that libraries that satisfy dependencies
come at the end rather than the beginning of the linker command line.
Revamp the configure tests for libaries to use FIND_SYSTEM_LIBRARY
instead. This can take advantage of pkg-config, and it also avoids
polluting LIBS.
List all the required dependencies in the pkgconfig files, and move the
one for libzfs_core into the latter's directory. Install pkgconfig files
in $(libdir)/pkgconfig on linux and $(prefix)/libdata/pkgconfig on
FreeBSD, instead of /usr/share/pkgconfig, as the more correct location
for library .pc files.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
Closes #10538
2020-06-30 20:10:41 +03:00
|
|
|
lib/libzfs_core/libzfs_core.pc
|
2022-04-10 19:24:48 +03:00
|
|
|
lib/libzfsbootenv/libzfsbootenv.pc
|
Cleanup linux module kbuild files
The linux module can be built either as an external module, or compiled
into the kernel, using copy-builtin. The source and build directories
are slightly different between the two cases, and currently, compiling
into the kernel still refers to some files from the configured ZFS
source tree, instead of the copies inside the kernel source tree. There
is also duplication between copy-builtin, which creates a Kbuild file to
build ZFS inside the kernel tree, and the top-level module/Makefile.in.
Fix this by moving the list of modules and the CFLAGS settings into a
new module/Kbuild.in, which will be used by the kernel kbuild
infrastructure, and using KBUILD_EXTMOD to distinguish the two cases
within the Makefiles, in order to choose appropriate include
directories etc.
Module CFLAGS setting is simplified by using subdir-ccflags-y (available
since 2.6.30) to set them in the top-level Kbuild instead of each
individual module. The disabling of -Wunused-but-set-variable is removed
from the lua and zfs modules. The variable that the Makefile uses is
actually not defined, so this has no effect; and the warning has long
been disabled by the kernel Makefile itself.
The target_cpu definition in module/{zfs,zcommon} is removed as it was
replaced by use of CONFIG_SPARC64 in
commit 70835c5b755e ("Unify target_cpu handling")
os/linux/{spl,zfs} are removed from obj-m, as they are not modules in
themselves, but are included by the Makefile in the spl and zfs module
directories. The vestigial Makefiles in os and os/linux are removed.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
Closes #10379
Closes #10421
2020-06-08 00:03:12 +03:00
|
|
|
module/Kbuild
|
2010-08-26 22:22:58 +04:00
|
|
|
module/Makefile
|
2019-10-09 20:54:22 +03:00
|
|
|
rpm/generic/zfs-dkms.spec
|
|
|
|
rpm/generic/zfs-kmod.spec
|
|
|
|
rpm/generic/zfs.spec
|
|
|
|
rpm/redhat/zfs-dkms.spec
|
|
|
|
rpm/redhat/zfs-kmod.spec
|
|
|
|
rpm/redhat/zfs.spec
|
2015-07-02 01:23:09 +03:00
|
|
|
tests/zfs-tests/tests/Makefile
|
2012-07-12 23:21:25 +04:00
|
|
|
zfs.release
|
2010-08-26 22:22:58 +04:00
|
|
|
])
|
|
|
|
|
2016-10-19 22:55:59 +03:00
|
|
|
|
2010-08-26 22:22:58 +04:00
|
|
|
AC_OUTPUT
|
config/kernel: enforce maximum kernel version, with escape hatch
META lists the maximum kernel version we consider to be fully supported.
However, we don't enforce this.
Sometimes we ship experimental patches for a newer kernel than we're
ready to support or, less often, we compile just fine against a newer
kernel. Invariably, something doesn't quite work properly, and it's
difficult for users to understand that they're actually running against
a kernel that we're not yet ready to support.
This commit tries to improve this situation. First, it simply enforces
Linux-Maximum, by having configure bail out if you try to compile
against a newer version that.
Then, it adds the --enable-linux-experimental switch to configure. When
supplied, this disables enforcing the maximum version, allowing the user
to attempt to build against a kernel with version higher than
Linux-Maximum.
Finally, if the switch is supplied _and_ configure is run against a
higher kernel version, it shows a big warning message when configure
finishes, and defines HAVE_LINUX_EXPERIMENTAL for the build. This allows
us to add code to modify runtime behaviour as well.
Reviewed-by: Robert Evans <evansr@google.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes #15986
2024-03-12 12:38:12 +03:00
|
|
|
|
|
|
|
ZFS_AC_KERNEL_VERSION_WARNING
|