devicetree-compiler.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Packham <chris.packham-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
To: David Gibson
	<david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>,
	Jon Loeliger <jdl-CYoMK+44s/E@public.gmane.org>
Cc: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Chris Packham
	<chris.packham-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
Subject: [RFC/PATCH] libfdt: Use quotes to include header files
Date: Sat,  3 Jan 2015 10:10:23 +1300	[thread overview]
Message-ID: <1420233023-12710-1-git-send-email-chris.packham@alliedtelesis.co.nz> (raw)

The linux kernel which carries the source of the device-tree-compiler
and libfdt verbatim makes use of the include guards in libfdt_env.h and
fdt.h to substitute kernel specific versions of the files. Unfortunately
because these hare included in libfdt.h using angle brackets they are
looked for in the "system" header location instead of the same directory
as libfdt.h. This means that any file that includes libfdt.h needs to
have special CFLAGS to add the path containing libfdt_env.h and fdt.h
just so that their contents can be discarded by the include guards.

By using quotes in libfdt/libfdt.h it picks up fdt.h and libfdt_env.h
from the source directory without needing to add CFLAGS for the sources
that happen to include linux/libfdt.h.

Signed-off-by: Chris Packham <chris.packham-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
---
Hi,

This patch has bounced around a couple of other mailing lists[1] and I've
been directed here. This is a fairly linux-kernel centric problem so I'm
open to other suggestions. The desire has been expressed to avoid having
to have custom CFLAGS[2] just because a file needs to operate on the
flattened device tree.

Jon had previously mentioned a recollection that the angle brackets were
intentional[3] can anyone confirm or deny this?

Regards,
Chris
--
[1] - http://www.spinics.net/lists/devicetree/msg62553.html
[2] - http://lists.infradead.org/pipermail/linux-arm-kernel/2014-December/310297.html
[3] - http://www.spinics.net/lists/devicetree/msg62604.html

 libfdt/libfdt.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libfdt/libfdt.h b/libfdt/libfdt.h
index 32d5227..020e760 100644
--- a/libfdt/libfdt.h
+++ b/libfdt/libfdt.h
@@ -51,8 +51,8 @@
  *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <libfdt_env.h>
-#include <fdt.h>
+#include "libfdt_env.h"
+#include "fdt.h"
 
 #define FDT_FIRST_SUPPORTED_VERSION	0x10
 #define FDT_LAST_SUPPORTED_VERSION	0x11
-- 
2.2.0.rc0

--
To unsubscribe from this list: send the line "unsubscribe devicetree-compiler" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2015-01-02 21:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-02 21:10 Chris Packham [this message]
     [not found] ` <1420233023-12710-1-git-send-email-chris.packham-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
2015-01-27  6:01   ` [RFC/PATCH] libfdt: Use quotes to include header files David Gibson

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=1420233023-12710-1-git-send-email-chris.packham@alliedtelesis.co.nz \
    --to=chris.packham-6g8wrflrtwxfdca3tkvle6u/zskkhjvu@public.gmane.org \
    --cc=david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org \
    --cc=devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=jdl-CYoMK+44s/E@public.gmane.org \
    /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;
as well as URLs for NNTP newsgroup(s).