2018-01-10 18:49:27 +00: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-02 17:39:48 +00:00
|
|
|
DEFAULT_INCLUDES = \
|
2020-06-20 02:08:59 +00:00
|
|
|
-include $(top_builddir)/zfs_config.h \
|
|
|
|
-I$(top_builddir)/include \
|
2019-10-02 17:39:48 +00: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-26 18:22:58 +00:00
|
|
|
|
2020-04-14 18:36:28 +00:00
|
|
|
if BUILD_FREEBSD
|
|
|
|
DEFAULT_INCLUDES += \
|
|
|
|
-I$(top_srcdir)/lib/libspl/include/os/freebsd
|
|
|
|
endif
|
|
|
|
|
2010-08-26 18:22:58 +00:00
|
|
|
AM_LIBTOOLFLAGS = --silent
|
2018-01-10 18:49:27 +00:00
|
|
|
|
2020-06-16 23:46:04 +00:00
|
|
|
AM_CFLAGS = -std=gnu99 -Wall -Wstrict-prototypes -Wmissing-prototypes
|
|
|
|
AM_CFLAGS += -fno-strict-aliasing
|
2019-04-14 18:04:54 +00:00
|
|
|
AM_CFLAGS += $(NO_OMIT_FRAME_POINTER)
|
2018-01-10 18:49:27 +00:00
|
|
|
AM_CFLAGS += $(DEBUG_CFLAGS)
|
|
|
|
AM_CFLAGS += $(ASAN_CFLAGS)
|
2020-04-14 18:36:28 +00: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-10 18:49:27 +00: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 00:15:45 +00:00
|
|
|
AM_CPPFLAGS += -DLIBEXECDIR=\"$(libexecdir)\"
|
|
|
|
AM_CPPFLAGS += -DRUNSTATEDIR=\"$(runstatedir)\"
|
|
|
|
AM_CPPFLAGS += -DSBINDIR=\"$(sbindir)\"
|
|
|
|
AM_CPPFLAGS += -DSYSCONFDIR=\"$(sysconfdir)\"
|
2018-01-10 18:49:27 +00:00
|
|
|
AM_CPPFLAGS += $(DEBUG_CPPFLAGS)
|
2017-09-23 01:49:57 +00:00
|
|
|
AM_CPPFLAGS += $(CODE_COVERAGE_CPPFLAGS)
|
2020-04-14 18:36:28 +00: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-10 18:49:27 +00:00
|
|
|
|
|
|
|
AM_LDFLAGS = $(DEBUG_LDFLAGS)
|
|
|
|
AM_LDFLAGS += $(ASAN_LDFLAGS)
|
2020-04-14 18:36:28 +00: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
|