2010-08-26 22:50:56 +04:00
|
|
|
include $(top_srcdir)/config/Rules.am
|
|
|
|
|
2020-01-17 23:40:09 +03:00
|
|
|
if TARGET_CPU_I386
|
|
|
|
TARGET_CPU_DIR = asm-i386
|
|
|
|
else
|
|
|
|
if TARGET_CPU_X86_64
|
|
|
|
TARGET_CPU_DIR = asm-x86_64
|
|
|
|
else
|
|
|
|
TARGET_CPU_DIR = asm-generic
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2014-06-10 01:55:31 +04:00
|
|
|
VPATH = \
|
|
|
|
$(top_srcdir)/lib/libspl \
|
2020-01-17 23:40:09 +03:00
|
|
|
$(top_srcdir)/lib/libspl/$(TARGET_CPU_DIR)
|
2014-06-10 01:55:31 +04:00
|
|
|
|
2020-01-17 23:40:09 +03:00
|
|
|
SUBDIRS = include $(TARGET_CPU_DIR)
|
2010-08-26 22:50:56 +04:00
|
|
|
DIST_SUBDIRS = include asm-generic asm-i386 asm-x86_64
|
|
|
|
|
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
|
|
|
AM_CFLAGS += $(LIBTIRPC_CFLAGS)
|
|
|
|
|
2010-08-26 22:50:56 +04:00
|
|
|
AM_CCASFLAGS = \
|
2017-10-11 08:36:26 +03:00
|
|
|
$(CFLAGS)
|
2010-08-26 22:50:56 +04:00
|
|
|
|
2012-01-01 03:30:52 +04:00
|
|
|
noinst_LTLIBRARIES = libspl.la
|
2010-08-26 22:50:56 +04:00
|
|
|
|
2014-06-10 01:55:31 +04:00
|
|
|
USER_C = \
|
|
|
|
list.c \
|
|
|
|
mkdirp.c \
|
2016-10-26 07:32:23 +03:00
|
|
|
page.c \
|
2018-12-12 03:01:41 +03:00
|
|
|
strlcat.c \
|
|
|
|
strlcpy.c \
|
2014-06-10 01:55:31 +04:00
|
|
|
timestamp.c \
|
|
|
|
zone.c \
|
|
|
|
include/sys/list.h \
|
|
|
|
include/sys/list_impl.h
|
|
|
|
|
2019-10-02 20:39:48 +03:00
|
|
|
if BUILD_LINUX
|
|
|
|
USER_C += \
|
|
|
|
os/linux/getexecname.c \
|
|
|
|
os/linux/gethostid.c \
|
|
|
|
os/linux/getmntany.c
|
|
|
|
endif
|
|
|
|
|
2020-04-14 21:36:28 +03:00
|
|
|
if BUILD_FREEBSD
|
|
|
|
USER_C += \
|
|
|
|
os/freebsd/getexecname.c \
|
|
|
|
os/freebsd/gethostid.c \
|
|
|
|
os/freebsd/getmntany.c \
|
|
|
|
os/freebsd/mnttab.c
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
2014-06-10 01:55:31 +04:00
|
|
|
USER_ASM = atomic.S
|
|
|
|
|
|
|
|
nodist_libspl_la_SOURCES = \
|
|
|
|
$(USER_C) \
|
2018-01-10 21:49:27 +03:00
|
|
|
$(USER_ASM)
|
2011-07-05 23:12:08 +04:00
|
|
|
|
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
|
|
|
libspl_la_LIBADD = -lrt $(LIBTIRPC_LIBS)
|
2014-06-10 01:55:31 +04:00
|
|
|
|
|
|
|
EXTRA_DIST = $(USER_C)
|