mirror of
https://github.com/godotengine/buildroot.git
synced 2026-01-05 14:09:53 +03:00
With gcc version 6, we get the following error when building logrotate:
logrotate.c: In function 'postrotateSingleLog':
logrotate.c:1784:5: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
if (!state->doRotate)
^~
logrotate.c:1787:2: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
if (!hasErrors && log->flags & LOG_FLAG_TMPFILENAME) {
^~
This is fixed by grabbing an upstream commit,
6a36c105587b07ad14fc937f3ee6e2eb402621a2. Once this is fixed, we get:
config.c: In function 'strndup':
config.c:87:10: error: nonnull argument 's' compared to NULL [-Werror=nonnull-compare]
if(!s)
^
cc1: all warnings being treated as errors
make[2]: *** [config.o] Error 1
make[2]: *** Waiting for unfinished jobs....
cc1: all warnings being treated as errors
make[2]: *** [logrotate.o] Error 1
This is due to logrotate providing its own implementation of
strndup(). We could fix it, but it much better to simply use the one
provided by the C library, by fixing the detection method for strndup
availability. This is done in patch
0002-Use-autoconf-checks-for-strndup-and-asprintf.patch.
Fixes:
http://autobuild.buildroot.net/results/6dc2eb22104076920d77425b1e608ef9b9e01c94/
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
[Thomas: replace fix for the nonnull issue with a different one.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
32 lines
1.1 KiB
Makefile
32 lines
1.1 KiB
Makefile
################################################################################
|
|
#
|
|
# logrotate
|
|
#
|
|
################################################################################
|
|
|
|
LOGROTATE_VERSION = 3.9.2
|
|
LOGROTATE_SITE = $(call github,logrotate,logrotate,$(LOGROTATE_VERSION))
|
|
LOGROTATE_LICENSE = GPLv2+
|
|
LOGROTATE_LICENSE_FILES = COPYING
|
|
LOGROTATE_DEPENDENCIES = popt host-pkgconf
|
|
# tarball does not have a generated configure script
|
|
LOGROTATE_AUTORECONF = YES
|
|
LOGROTATE_CONF_ENV = LIBS="`$(PKG_CONFIG_HOST_BINARY) --libs popt`"
|
|
LOGROTATE_CONF_OPTS = --without-selinux
|
|
LOGROTATE_PATCH = https://github.com/logrotate/logrotate/commit/6a36c105587b07ad14fc937f3ee6e2eb402621a2.patch
|
|
|
|
ifeq ($(BR2_PACKAGE_ACL),y)
|
|
LOGROTATE_DEPENDENCIES += acl
|
|
LOGROTATE_CONF_OPTS += --with-acl
|
|
else
|
|
LOGROTATE_CONF_OPTS += --without-acl
|
|
endif
|
|
|
|
define LOGROTATE_INSTALL_TARGET_CONF
|
|
$(INSTALL) -m 0644 package/logrotate/logrotate.conf $(TARGET_DIR)/etc/logrotate.conf
|
|
$(INSTALL) -d -m 0755 $(TARGET_DIR)/etc/logrotate.d
|
|
endef
|
|
LOGROTATE_POST_INSTALL_TARGET_HOOKS += LOGROTATE_INSTALL_TARGET_CONF
|
|
|
|
$(eval $(autotools-package))
|