mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Christian Melki <christian.melki@t2data.com>
To: ptxdist@pengutronix.de
Subject: [ptxdist] [PATCH] libfdt: New package.
Date: Wed,  3 Jan 2024 20:23:52 +0100	[thread overview]
Message-ID: <20240103192352.3447044-1-christian.melki@t2data.com> (raw)

Add the device-tree-compiler source as libfdt.
I guess the package could have been named dtc as a target
variant with libfdt, but I don't know of any uses of the
dtc on target environments. So the only use I can think of
is libfdt. I think the name is more accurate towards usage,
but it isn't as symmetrical as the typical host-* and normal
variants.

The use of libfdt is separate from the host-dtc usage too,
so whatever version you'd use for external device trees are probably
not the same as target lifdt. There you'd typically want the latest
version.

This work is prepping for qemu 8.2.0+, as it requires libfdt
as a separate library. It has stopped providing one internally.

Signed-off-by: Christian Melki <christian.melki@t2data.com>
---
 rules/libfdt.in   |  9 +++++++
 rules/libfdt.make | 69 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 78 insertions(+)
 create mode 100644 rules/libfdt.in
 create mode 100644 rules/libfdt.make

diff --git a/rules/libfdt.in b/rules/libfdt.in
new file mode 100644
index 000000000..3e30062e9
--- /dev/null
+++ b/rules/libfdt.in
@@ -0,0 +1,9 @@
+## SECTION=system_libraries
+
+menuconfig LIBFDT
+	tristate
+	prompt "libfdt                        "
+	help
+	  libfdt is the flattend device tree library.
+	  It's technically a part of the device tree compiler code,
+	  but for target uses, libfdt is sometimes required.
\ No newline at end of file
diff --git a/rules/libfdt.make b/rules/libfdt.make
new file mode 100644
index 000000000..a7f5cc566
--- /dev/null
+++ b/rules/libfdt.make
@@ -0,0 +1,69 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2023 Christian Melki <christian.melki@t2data.com>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_LIBFDT) += libfdt
+
+#
+# Paths and names
+#
+LIBFDT_VERSION		:= 1.7.0
+LIBFDT_MD5		:= f8b4469ad89f4b882091895ec60dde6b
+LIBFDT			:= dtc-$(LIBFDT_VERSION)
+LIBFDT_SUFFIX		:= tar.gz
+LIBFDT_URL		:= https://git.kernel.org/pub/scm/utils/dtc/dtc.git/snapshot/$(LIBFDT).$(LIBFDT_SUFFIX)
+LIBFDT_SOURCE		:= $(SRCDIR)/$(LIBFDT).$(LIBFDT_SUFFIX)
+LIBFDT_DIR		:= $(BUILDDIR)/$(LIBFDT)
+LIBFDT_LICENSE		:= BSD-2-Clause OR GPL-2.0
+LIBFDT_LICENSE_FILES := \
+	file://README.license;md5=a1eb22e37f09df5b5511b8a278992d0e \
+	file://GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+	file://BSD-2-Clause;md5=5d6306d1b08f8df623178dfd81880927
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+LIBFDT_CONF_TOOL := NO
+
+LIBFDT_MAKE_ENV := \
+	$(CROSS_ENV)
+
+LIBFDT_MAKE_OPT := \
+	PREFIX=/usr \
+	NO_PYTHON=1 \
+	NO_VALGRIND=1 \
+	NO_YAML=1
+
+LIBFDT_INSTALL_OPT := \
+	$(LIBFDT_MAKE_OPT) \
+	install-includes \
+	install-lib
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/libfdt.targetinstall:
+	@$(call targetinfo)
+
+	@$(call install_init, libfdt)
+	@$(call install_fixup, libfdt,PRIORITY,optional)
+	@$(call install_fixup, libfdt,SECTION,base)
+	@$(call install_fixup, libfdt,AUTHOR,"Christian Melki <christian.melki@t2data.com>")
+	@$(call install_fixup, libfdt,DESCRIPTION,missing)
+
+	@$(call install_lib, libfdt, 0, 0, 0644, libfdt-$(LIBFDT_VERSION))
+
+	@$(call install_finish, libfdt)
+
+	@$(call touch)
+
+# vim: syntax=make
-- 
2.34.1




             reply	other threads:[~2024-01-03 19:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-03 19:23 Christian Melki [this message]
2024-01-04  9:12 ` Ladislav Michl
2024-01-04  9:26   ` Christian Melki
2024-01-04 11:16     ` Ladislav Michl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240103192352.3447044-1-christian.melki@t2data.com \
    --to=christian.melki@t2data.com \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox