2018-01-11 02:49:27 +08:00
|
|
|
#
|
|
|
|
# Default build rules for all user space components, every Makefile.am
|
|
|
|
# should include these rules and override or extend them as needed.
|
|
|
|
#
|
|
|
|
|
2019-10-03 01:39:48 +08:00
|
|
|
DEFAULT_INCLUDES = \
|
2020-06-20 10:08:59 +08:00
|
|
|
-include $(top_builddir)/zfs_config.h \
|
|
|
|
-I$(top_builddir)/include \
|
2019-10-03 01:39:48 +08:00
|
|
|
-I$(top_srcdir)/include \
|
|
|
|
-I$(top_srcdir)/module/icp/include \
|
|
|
|
-I$(top_srcdir)/lib/libspl/include
|
|
|
|
|
|
|
|
if BUILD_LINUX
|
|
|
|
DEFAULT_INCLUDES += \
|
|
|
|
-I$(top_srcdir)/lib/libspl/include/os/linux
|
|
|
|
endif
|
2010-08-27 02:22:58 +08:00
|
|
|
|
2020-04-15 02:36:28 +08:00
|
|
|
if BUILD_FREEBSD
|
|
|
|
DEFAULT_INCLUDES += \
|
|
|
|
-I$(top_srcdir)/lib/libspl/include/os/freebsd
|
|
|
|
endif
|
|
|
|
|
2010-08-27 02:22:58 +08:00
|
|
|
AM_LIBTOOLFLAGS = --silent
|
2018-01-11 02:49:27 +08:00
|
|
|
|
2020-06-17 07:46:04 +08:00
|
|
|
AM_CFLAGS = -std=gnu99 -Wall -Wstrict-prototypes -Wmissing-prototypes
|
|
|
|
AM_CFLAGS += -fno-strict-aliasing
|
2019-04-15 02:04:54 +08:00
|
|
|
AM_CFLAGS += $(NO_OMIT_FRAME_POINTER)
|
2018-01-11 02:49:27 +08:00
|
|
|
AM_CFLAGS += $(DEBUG_CFLAGS)
|
|
|
|
AM_CFLAGS += $(ASAN_CFLAGS)
|
2020-04-15 02:36:28 +08:00
|
|
|
AM_CFLAGS += $(CODE_COVERAGE_CFLAGS) $(NO_FORMAT_ZERO_LENGTH)
|
|
|
|
if BUILD_FREEBSD
|
|
|
|
AM_CFLAGS += -fPIC -Werror -Wno-unknown-pragmas -Wno-enum-conversion
|
|
|
|
AM_CFLAGS += -include $(top_srcdir)/include/os/freebsd/spl/sys/ccompile.h
|
|
|
|
AM_CFLAGS += -I/usr/include -I/usr/local/include
|
|
|
|
AM_CFLAGS += -D_MACHINE_ENDIAN_H_
|
|
|
|
endif
|
2018-01-11 02:49:27 +08:00
|
|
|
|
|
|
|
AM_CPPFLAGS = -D_GNU_SOURCE
|
|
|
|
AM_CPPFLAGS += -D_REENTRANT
|
|
|
|
AM_CPPFLAGS += -D_FILE_OFFSET_BITS=64
|
|
|
|
AM_CPPFLAGS += -D_LARGEFILE64_SOURCE
|
|
|
|
AM_CPPFLAGS += -DHAVE_LARGE_STACKS=1
|
Add defs for makefile installation dir vars
Add macro definitions to AM_CPPFLAGS to propagate makefile installation
directory variables for libexecdir, runstatedir, sbindir, and
sysconfdir.
https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Installation-Directory-Variables.html
A corollary is that you should not use these variables except
in makefiles. For instance, instead of trying to evaluate
datadir in configure and hard-coding it in makefiles using e.g.,
'AC_DEFINE_UNQUOTED([DATADIR], ["$datadir"], [Data directory.])',
you should add -DDATADIR='$(datadir)' to your makefile's definition
of CPPFLAGS (AM_CPPFLAGS if you are also using Automake).
The runstatedir directory is for "installing data files which the
programs modify while they run, that pertain to one specific machine,
and which need not persist longer than the execution of the program".
https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
It will be defined by autoconf 2.70 or later, and default to
"$(localstatedir)/run".
http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commit;h=a197431414088a417b407b9b20583b2e8f7363bd
Signed-off-by: Chris Dunlap <cdunlap@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #2
2014-01-07 08:15:45 +08:00
|
|
|
AM_CPPFLAGS += -DLIBEXECDIR=\"$(libexecdir)\"
|
|
|
|
AM_CPPFLAGS += -DRUNSTATEDIR=\"$(runstatedir)\"
|
|
|
|
AM_CPPFLAGS += -DSBINDIR=\"$(sbindir)\"
|
|
|
|
AM_CPPFLAGS += -DSYSCONFDIR=\"$(sysconfdir)\"
|
2018-01-11 02:49:27 +08:00
|
|
|
AM_CPPFLAGS += $(DEBUG_CPPFLAGS)
|
2017-09-23 09:49:57 +08:00
|
|
|
AM_CPPFLAGS += $(CODE_COVERAGE_CPPFLAGS)
|
2020-04-15 02:36:28 +08:00
|
|
|
if BUILD_LINUX
|
|
|
|
AM_CPPFLAGS += -DTEXT_DOMAIN=\"zfs-linux-user\"
|
|
|
|
endif
|
|
|
|
if BUILD_FREEBSD
|
|
|
|
AM_CPPFLAGS += -DTEXT_DOMAIN=\"zfs-freebsd-user\"
|
|
|
|
endif
|
2018-01-11 02:49:27 +08:00
|
|
|
|
|
|
|
AM_LDFLAGS = $(DEBUG_LDFLAGS)
|
|
|
|
AM_LDFLAGS += $(ASAN_LDFLAGS)
|
2020-04-15 02:36:28 +08:00
|
|
|
|
|
|
|
if BUILD_FREEBSD
|
|
|
|
AM_LDFLAGS += -fstack-protector-strong -shared
|
|
|
|
AM_LDFLAGS += -Wl,-x -Wl,--fatal-warnings -Wl,--warn-shared-textrel
|
|
|
|
AM_LDFLAGS += -lm
|
|
|
|
endif
|