Set DEBUG/NDEBUG as part of user space build Rules.am
This commit is contained in:
parent
a726b89974
commit
ae0967ca15
|
@ -4,6 +4,6 @@ DEFAULT_INCLUDES = -I${top_srcdir}
|
||||||
AM_CFLAGS = -Wall -Wstrict-prototypes -fno-strict-aliasing -Werror
|
AM_CFLAGS = -Wall -Wstrict-prototypes -fno-strict-aliasing -Werror
|
||||||
|
|
||||||
# Expected defines not covered by zfs_config.h or spl_config.h
|
# Expected defines not covered by zfs_config.h or spl_config.h
|
||||||
AM_CFLAGS += -D_GNU_SOURCE -D__EXTENSIONS__ -D_REENTRANT
|
AM_CFLAGS += -D_GNU_SOURCE -D__EXTENSIONS__ -D_REENTRANT $(USERDEBUG)
|
||||||
AM_CFLAGS += -D_POSIX_PTHREAD_SEMANTICS -D_FILE_OFFSET_BITS=64
|
AM_CFLAGS += -D_POSIX_PTHREAD_SEMANTICS -D_FILE_OFFSET_BITS=64
|
||||||
AM_CFLAGS += -D_LARGEFILE64_SOURCE -DTEXT_DOMAIN=\"zfs-linux-user\"
|
AM_CFLAGS += -D_LARGEFILE64_SOURCE -DTEXT_DOMAIN=\"zfs-linux-user\"
|
||||||
|
|
|
@ -11,28 +11,34 @@ AC_DEFUN([ZFS_AC_LICENSE], [
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_DEBUG], [
|
AC_DEFUN([ZFS_AC_DEBUG], [
|
||||||
AC_MSG_CHECKING([whether debugging is enabled])
|
AC_MSG_CHECKING([whether debugging is enabled])
|
||||||
AC_ARG_ENABLE( [debug],
|
AC_ARG_ENABLE( [debug],
|
||||||
AS_HELP_STRING([--enable-debug],
|
AS_HELP_STRING([--enable-debug],
|
||||||
[Enable generic debug support (default off)]),
|
[Enable generic debug support (default off)]),
|
||||||
[ case "$enableval" in
|
[ case "$enableval" in
|
||||||
yes) zfs_ac_debug=yes ;;
|
yes) zfs_ac_debug=yes ;;
|
||||||
no) zfs_ac_debug=no ;;
|
no) zfs_ac_debug=no ;;
|
||||||
*) AC_MSG_RESULT([Error!])
|
*) AC_MSG_RESULT([Error!])
|
||||||
AC_MSG_ERROR([Bad value "$enableval" for --enable-debug]) ;;
|
AC_MSG_ERROR([Bad value "$enableval" for --enable-debug]) ;;
|
||||||
esac ]
|
esac ]
|
||||||
)
|
)
|
||||||
if test "$zfs_ac_debug" = yes; then
|
if test "$zfs_ac_debug" = yes; then
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG "
|
AC_DEFINE([DEBUG], [1],
|
||||||
|
[Define to 1 to enable debug tracing])
|
||||||
|
KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG "
|
||||||
HOSTCFLAGS="${HOSTCFLAGS} -DDEBUG "
|
HOSTCFLAGS="${HOSTCFLAGS} -DDEBUG "
|
||||||
else
|
USERDEBUG="-DDEBUG"
|
||||||
AC_MSG_RESULT([no])
|
else
|
||||||
AC_DEFINE([NDEBUG], [1],
|
AC_MSG_RESULT([no])
|
||||||
[Define to 1 to disable debug tracing])
|
AC_DEFINE([NDEBUG], [1],
|
||||||
KERNELCPPFLAGS="${KERNELCPPFLAGS} -DNDEBUG "
|
[Define to 1 to disable debug tracing])
|
||||||
|
KERNELCPPFLAGS="${KERNELCPPFLAGS} -DNDEBUG "
|
||||||
HOSTCFLAGS="${HOSTCFLAGS} -DNDEBUG "
|
HOSTCFLAGS="${HOSTCFLAGS} -DNDEBUG "
|
||||||
fi
|
USERDEBUG="-DNDEBUG"
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_SUBST(USERDEBUG)
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_CONFIG_SCRIPT], [
|
AC_DEFUN([ZFS_AC_CONFIG_SCRIPT], [
|
||||||
|
|
Loading…
Reference in New Issue