2018-01-10 21:49:27 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								#
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# Default build rules for all user space components, every Makefile.am
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# should include these rules and override or extend them as needed.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								#
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-01-22 23:54:34 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								PHONY =
							 
						 
					
						
							
								
									
										
										
										
											2022-04-08 02:07:08 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								AM_CPPFLAGS = \
							 
						 
					
						
							
								
									
										
										
										
											2020-06-20 05:08:59 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									-include $(top_builddir)/zfs_config.h \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									-I$(top_builddir)/include \
							 
						 
					
						
							
								
									
										
										
										
											2019-10-02 20:39:48 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									-I$(top_srcdir)/include \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									-I$(top_srcdir)/module/icp/include \
							 
						 
					
						
							
								
									
										
										
										
											2022-04-08 02:07:08 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									-I$(top_srcdir)/lib/libspl/include \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									-I$(top_srcdir)/lib/libspl/include/os/@ac_system_l@
							 
						 
					
						
							
								
									
										
										
										
											2020-04-14 21:36:28 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-08-26 22:22:58 +04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								AM_LIBTOOLFLAGS = --silent
							 
						 
					
						
							
								
									
										
										
										
											2018-01-10 21:49:27 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-16 05:01:30 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								AM_CFLAGS  = -std=gnu99 -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Wno-sign-compare -Wno-missing-field-initializers
							 
						 
					
						
							
								
									
										
										
										
											2020-06-17 02:46:04 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								AM_CFLAGS += -fno-strict-aliasing
							 
						 
					
						
							
								
									
										
										
										
											2019-04-14 21:04:54 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								AM_CFLAGS += $(NO_OMIT_FRAME_POINTER)
							 
						 
					
						
							
								
									
										
										
										
											2021-09-14 19:17:54 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								AM_CFLAGS += $(IMPLICIT_FALLTHROUGH)
							 
						 
					
						
							
								
									
										
										
										
											2018-01-10 21:49:27 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								AM_CFLAGS += $(DEBUG_CFLAGS)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								AM_CFLAGS += $(ASAN_CFLAGS)
							 
						 
					
						
							
								
									
										
										
										
											2022-02-04 01:35:38 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								AM_CFLAGS += $(UBSAN_CFLAGS)
							 
						 
					
						
							
								
									
										
										
										
											2020-04-14 21:36:28 +03: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
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								endif
							 
						 
					
						
							
								
									
										
										
										
											2018-01-10 21:49:27 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-04-08 02:07:08 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								AM_CPPFLAGS += -D_GNU_SOURCE
							 
						 
					
						
							
								
									
										
										
										
											2018-01-10 21:49:27 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								AM_CPPFLAGS += -D_REENTRANT
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								AM_CPPFLAGS += -D_FILE_OFFSET_BITS=64
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								AM_CPPFLAGS += -D_LARGEFILE64_SOURCE
							 
						 
					
						
							
								
									
										
											 
										
											
												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 04:15:45 +04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								AM_CPPFLAGS += -DLIBEXECDIR=\"$(libexecdir)\"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								AM_CPPFLAGS += -DRUNSTATEDIR=\"$(runstatedir)\"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								AM_CPPFLAGS += -DSBINDIR=\"$(sbindir)\"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								AM_CPPFLAGS += -DSYSCONFDIR=\"$(sysconfdir)\"
							 
						 
					
						
							
								
									
										
										
										
											2021-02-18 08:30:45 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								AM_CPPFLAGS += -DPKGDATADIR=\"$(pkgdatadir)\"
							 
						 
					
						
							
								
									
										
										
										
											2018-01-10 21:49:27 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								AM_CPPFLAGS += $(DEBUG_CPPFLAGS)
							 
						 
					
						
							
								
									
										
										
										
											2017-09-23 04:49:57 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								AM_CPPFLAGS += $(CODE_COVERAGE_CPPFLAGS)
							 
						 
					
						
							
								
									
										
										
										
											2022-04-08 02:07:08 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								AM_CPPFLAGS += -DTEXT_DOMAIN=\"zfs-@ac_system_l@-user\"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								AM_CPPFLAGS_NOCHECK  = -D"strtok(...)=strtok(__VA_ARGS__) __attribute__((deprecated(\"Use strtok_r(3) instead!\")))"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								AM_CPPFLAGS_NOCHECK += -D"__xpg_basename(...)=__xpg_basename(__VA_ARGS__) __attribute__((deprecated(\"basename(3) is underspecified. Use zfs_basename() instead!\")))"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								AM_CPPFLAGS_NOCHECK += -D"basename(...)=basename(__VA_ARGS__) __attribute__((deprecated(\"basename(3) is underspecified. Use zfs_basename() instead!\")))"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								AM_CPPFLAGS_NOCHECK += -D"dirname(...)=dirname(__VA_ARGS__) __attribute__((deprecated(\"dirname(3) is underspecified. Use zfs_dirnamelen() instead!\")))"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								AM_CPPFLAGS_NOCHECK += -D"bcopy(...)=__attribute__((deprecated(\"bcopy(3) is deprecated. Use memcpy(3)/memmove(3) instead!\"))) bcopy(__VA_ARGS__)"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								AM_CPPFLAGS_NOCHECK += -D"bcmp(...)=__attribute__((deprecated(\"bcmp(3) is deprecated. Use memcmp(3) instead!\"))) bcmp(__VA_ARGS__)"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								AM_CPPFLAGS_NOCHECK += -D"bzero(...)=__attribute__((deprecated(\"bzero(3) is deprecated. Use memset(3) instead!\"))) bzero(__VA_ARGS__)"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								AM_CPPFLAGS_NOCHECK += -D"asctime(...)=__attribute__((deprecated(\"Use strftime(3) instead!\"))) asctime(__VA_ARGS__)"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								AM_CPPFLAGS_NOCHECK += -D"asctime_r(...)=__attribute__((deprecated(\"Use strftime(3) instead!\"))) asctime_r(__VA_ARGS__)"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								AM_CPPFLAGS_NOCHECK += -D"gmtime(...)=__attribute__((deprecated(\"gmtime(3) isn't thread-safe. Use gmtime_r(3) instead!\"))) gmtime(__VA_ARGS__)"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								AM_CPPFLAGS_NOCHECK += -D"localtime(...)=__attribute__((deprecated(\"localtime(3) isn't thread-safe. Use localtime_r(3) instead!\"))) localtime(__VA_ARGS__)"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								AM_CPPFLAGS += $(AM_CPPFLAGS_NOCHECK)
							 
						 
					
						
							
								
									
										
										
										
											2018-01-10 21:49:27 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-04 01:35:38 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								if ASAN_ENABLED
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								AM_CPPFLAGS += -DZFS_ASAN_ENABLED
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								endif
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								if UBSAN_ENABLED
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								AM_CPPFLAGS += -DZFS_UBSAN_ENABLED
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								endif
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-01-10 21:49:27 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								AM_LDFLAGS  = $(DEBUG_LDFLAGS)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								AM_LDFLAGS += $(ASAN_LDFLAGS)
							 
						 
					
						
							
								
									
										
										
										
											2022-02-04 01:35:38 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								AM_LDFLAGS += $(UBSAN_LDFLAGS)
							 
						 
					
						
							
								
									
										
										
										
											2020-04-14 21:36:28 +03: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
							 
						 
					
						
							
								
									
										
										
										
											2022-04-08 02:07:08 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# If a target includes kernel code, generate warnings for large stack frames
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								KERNEL_CFLAGS       = $(FRAME_LARGER_THAN)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=54020
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								LIBRARY_CFLAGS      = -no-suppress
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# Forcibly enable asserts/debugging for libzpool &al.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								FORCEDEBUG_CPPFLAGS = -DDEBUG -UNDEBUG -DZFS_DEBUG