2010-08-26 18:22:58 +00:00
|
|
|
/*
|
2022-04-09 12:37:22 +00:00
|
|
|
* This file is part of OpenZFS.
|
2010-08-26 18:22:58 +00: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
|
|
|
|
* or http://www.opensolaris.org/os/licensing.
|
|
|
|
* 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-07 23:07:08 +00:00
|
|
|
AC_INIT(m4_esyscmd(awk '/^Name:/ {printf $2}' META),
|
|
|
|
m4_esyscmd(awk '/^Version:/ {printf $2}' META))
|
2010-08-26 18:22:58 +00:00
|
|
|
AC_LANG(C)
|
|
|
|
ZFS_AC_META
|
|
|
|
AC_CONFIG_AUX_DIR([config])
|
2013-03-30 02:33:09 +00:00
|
|
|
AC_CONFIG_MACRO_DIR([config])
|
2021-01-03 00:55:55 +00:00
|
|
|
AC_CANONICAL_TARGET
|
2010-08-26 18:22:58 +00:00
|
|
|
AM_MAINTAINER_MODE
|
2013-04-02 22:16:39 +00:00
|
|
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
2022-04-07 23:07:08 +00:00
|
|
|
AM_INIT_AUTOMAKE([subdir-objects foreign])
|
2022-04-10 17:00:47 +00:00
|
|
|
# Remove default macros from config.h:
|
|
|
|
# PACKAGE, PACKAGE_{BUGREPORT,NAME,STRING,TARNAME,VERSION}, STDC_HEADERS, VERSION
|
2010-08-26 18:22:58 +00:00
|
|
|
AC_CONFIG_HEADERS([zfs_config.h], [
|
2022-04-10 17:00:47 +00:00
|
|
|
sed -nEi~ -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 18:22:58 +00:00
|
|
|
|
2021-01-03 00:55:55 +00:00
|
|
|
LT_INIT
|
2010-08-26 18:22:58 +00:00
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_CC
|
2021-05-08 13:04:48 +00: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 00:19:05 +00:00
|
|
|
PKG_PROG_PKG_CONFIG
|
2010-08-26 18:22:58 +00:00
|
|
|
AM_PROG_AS
|
2016-06-15 22:47:05 +00:00
|
|
|
AM_PROG_CC_C_O
|
2017-09-23 01:49:57 +00:00
|
|
|
AX_CODE_COVERAGE
|
2018-08-15 16:52:28 +00:00
|
|
|
_AM_PROG_TAR(pax)
|
2010-08-26 18:22:58 +00:00
|
|
|
|
|
|
|
ZFS_AC_LICENSE
|
|
|
|
ZFS_AC_CONFIG
|
2020-07-01 16:05:21 +00:00
|
|
|
ZFS_AC_PACKAGE
|
2010-08-26 18:22:58 +00:00
|
|
|
ZFS_AC_DEBUG
|
2014-09-23 18:29:30 +00:00
|
|
|
ZFS_AC_DEBUGINFO
|
2018-02-16 01:53:18 +00:00
|
|
|
ZFS_AC_DEBUG_KMEM
|
|
|
|
ZFS_AC_DEBUG_KMEM_TRACKING
|
2021-03-05 20:16:41 +00:00
|
|
|
ZFS_AC_DEBUG_INVARIANTS
|
2010-08-26 18:22:58 +00:00
|
|
|
|
2015-07-01 22:23:09 +00:00
|
|
|
AC_CONFIG_FILES([
|
2010-08-26 18:22:58 +00:00
|
|
|
Makefile
|
2019-10-09 17:54:22 +00:00
|
|
|
include/Makefile
|
2014-06-06 23:23:22 +00: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 17:10:41 +00:00
|
|
|
lib/libzfs_core/libzfs_core.pc
|
2022-04-10 16:24:48 +00: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-07 21:03:12 +00:00
|
|
|
module/Kbuild
|
2010-08-26 18:22:58 +00:00
|
|
|
module/Makefile
|
2019-10-09 17:54:22 +00: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-01 22:23:09 +00:00
|
|
|
tests/zfs-tests/tests/Makefile
|
2012-07-12 19:21:25 +00:00
|
|
|
zfs.release
|
2010-08-26 18:22:58 +00:00
|
|
|
])
|
|
|
|
|
2016-10-19 19:55:59 +00:00
|
|
|
|
2010-08-26 18:22:58 +00:00
|
|
|
AC_OUTPUT
|