source "package/mpfr/Config.in"
source "package/msgpack/Config.in"
source "package/mtdev2tuio/Config.in"
- source "package/netbsd-queue/Config.in"
+ source "package/musl-compat-headers/Config.in"
source "package/openblas/Config.in"
source "package/orc/Config.in"
source "package/p11-kit/Config.in"
--- /dev/null
+config BR2_PACKAGE_MUSL_COMPAT_HEADERS
+ bool
--- /dev/null
+/* Copyright (C) 2016 Yann E. MORIN <yann.morin.1998@free.fr>
+ *
+ * This file is in the Public Domain.
+ *
+ * For jurisdictions in which the Public Domain does not exist
+ * or it is not otherwise applicable, this file is licensed CC0
+ * (Creative Commons Zero).
+ */
+
+/* This file contains definitions for non-standard macros defined by
+ * glibc, but quite commonly used in packages.
+ *
+ * Because they are non-standard, musl does not define those macros.
+ * It does not provide cdefs.h either.
+ *
+ * This file is a compatibility header written from scratch, to be
+ * installed when the C library is musl.
+ *
+ * Not all macros from the glibc's cdefs.h are available, only the
+ * most commonly used ones.
+ *
+ * Please refer to the glibc documentation and source code for
+ * explanations about those macros.
+ */
+
+#ifndef BUILDROOT_SYS_CDEFS_H
+#define BUILDROOT_SYS_CDEFS_H
+
+/* Function prototypes. */
+#undef __P
+#define __P(arg) arg
+
+/* C declarations in C++ mode. */
+#ifdef __cplusplus
+# define __BEGIN_DECLS extern "C" {
+# define __END_DECLS }
+#else
+# define __BEGIN_DECLS
+# define __END_DECLS
+#endif
+
+/* Don't throw exceptions in C functions. */
+#ifndef __cplusplus
+# define __THROW __attribute__ ((__nothrow__))
+# define __NTH(f) __attribute__ ((__nothrow__)) f
+#else
+# define __THROW
+# define __NTH(f) f
+#endif
+
+#endif /* ifndef BUILDROOT_SYS_CDEFS_H */
--- /dev/null
+# Locally calculated
+sha256 c13407edd0e33be73cae72514cb234f8612e1c0e54401c9448daffd3a240158b queue.h?rev=1.70
--- /dev/null
+################################################################################
+#
+# musl-compat-headers
+#
+################################################################################
+
+# No main site, just using extra downloads
+MUSL_COMPAT_HEADERS_QUEUE_H = http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys/queue.h?rev=1.70
+
+MUSL_COMPAT_HEADERS_EXTRA_DOWNLOADS = $(MUSL_COMPAT_HEADERS_QUEUE_H)
+
+MUSL_COMPAT_HEADERS_LICENSE = BSD-3c, Public Domain or CC0
+MUSL_COMPAT_HEADERS_LICENSE_FILES = queue.h cdefs.h
+
+MUSL_COMPAT_HEADERS_ADD_TOOLCHAIN_DEPENDENCY = NO
+
+# Only installs headers
+MUSL_COMPAT_HEADERS_INSTALL_TARGET = NO
+MUSL_COMPAT_HEADERS_INSTALL_STAGING = YES
+
+# Copying both headers so legal-info finds them (they are _LICENSE_FILES)
+define MUSL_COMPAT_HEADERS_EXTRACT_CMDS
+ $(INSTALL) -m 0644 -D $(DL_DIR)/$(notdir $(MUSL_COMPAT_HEADERS_QUEUE_H)) $(@D)/queue.h
+ $(INSTALL) -m 0644 -D $(MUSL_COMPAT_HEADERS_PKGDIR)/cdefs.h $(@D)/cdefs.h
+endef
+
+define MUSL_COMPAT_HEADERS_INSTALL_STAGING_CMDS
+ $(INSTALL) -D -m 0644 $(@D)/queue.h \
+ $(STAGING_DIR)/usr/include/sys/queue.h
+ $(INSTALL) -D -m 0644 $(@D)/cdefs.h \
+ $(STAGING_DIR)/usr/include/sys/cdefs.h
+endef
+
+$(eval $(generic-package))
depends on BR2_TOOLCHAIN_USES_MUSL
default y
select BR2_PACKAGE_LINUX_HEADERS
- select BR2_PACKAGE_NETBSD_QUEUE
select BR2_TOOLCHAIN_HAS_SSP
+ # Compatibility headers: cdefs.h, queue.h
+ select BR2_PACKAGE_MUSL_COMPAT_HEADERS
# cross-compiler and the kernel headers
MUSL_DEPENDENCIES = host-gcc-initial linux-headers
-# musl does not provide a sys/queue.h implementation, so add the
-# netbsd-queue package that will install a sys/queue.h file in the
-# staging directory based on the NetBSD implementation.
-MUSL_DEPENDENCIES += netbsd-queue
+# musl does not provide an implementation for sys/queue.h or sys/cdefs.h.
+# So, add the musl-compat-headers package that will install those files,
+# into the staging directory:
+# sys/queue.h: header from NetBSD
+# sys/cdefs.h: minimalist header bundled in Buildroot
+MUSL_DEPENDENCIES += musl-compat-headers
# musl is part of the toolchain so disable the toolchain dependency
MUSL_ADD_TOOLCHAIN_DEPENDENCY = NO
+++ /dev/null
-config BR2_PACKAGE_NETBSD_QUEUE
- bool
+++ /dev/null
-# Locally calculated
-sha256 c13407edd0e33be73cae72514cb234f8612e1c0e54401c9448daffd3a240158b queue.h?rev=1.70
+++ /dev/null
-################################################################################
-#
-# netbsd-queue
-#
-################################################################################
-
-NETBSD_QUEUE_VERSION = 1.70
-NETBSD_QUEUE_SITE = http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys
-NETBSD_QUEUE_SOURCE = queue.h?rev=$(NETBSD_QUEUE_VERSION)
-NETBSD_QUEUE_LICENSE = BSD-3c
-
-NETBSD_QUEUE_ADD_TOOLCHAIN_DEPENDENCY = NO
-NETBSD_QUEUE_INSTALL_STAGING = YES
-
-define NETBSD_QUEUE_EXTRACT_CMDS
- cp $(DL_DIR)/$(NETBSD_QUEUE_SOURCE) $(@D)/queue.h
-endef
-
-define NETBSD_QUEUE_INSTALL_STAGING_CMDS
- $(INSTALL) -D -m 0644 $(@D)/queue.h \
- $(STAGING_DIR)/usr/include/sys/queue.h
-endef
-
-$(eval $(generic-package))
config BR2_TOOLCHAIN_EXTERNAL_MUSL
bool
select BR2_TOOLCHAIN_USES_MUSL
- select BR2_PACKAGE_NETBSD_QUEUE
+ # Compatibility headers: cdefs.h, queue.h
+ select BR2_PACKAGE_MUSL_COMPAT_HEADERS
if BR2_TOOLCHAIN_EXTERNAL_CUSTOM
TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += -DBR_SOFTFLOAT=1
endif
-# musl does not provide a sys/queue.h implementation, so add the
-# netbsd-queue package that will install a sys/queue.h file in the
-# staging directory based on the NetBSD implementation.
+# musl does not provide an implementation for sys/queue.h or sys/cdefs.h.
+# So, add the musl-compat-headers package that will install those files,
+# into the staging directory:
+# sys/queue.h: header from NetBSD
+# sys/cdefs.h: minimalist header bundled in Buildroot
ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
-TOOLCHAIN_EXTERNAL_DEPENDENCIES += netbsd-queue
+TOOLCHAIN_EXTERNAL_DEPENDENCIES += musl-compat-headers
endif
# The Linaro toolchain expects the libraries in