From a768648acbcc235ca6d31993cacec8cca68843a4 Mon Sep 17 00:00:00 2001 From: Chris Phoenix Date: Mon, 22 Feb 2016 15:58:11 -0800 Subject: [PATCH] Make it build under Android Replace version_gen.h with hardcoded version_non_gen.h Add Android.mk and libfdt/Android.mk Change dtc-parser.tab.h to dtc-parser.h (in dtc-lexer.l) Change-Id: If7b8ac5fdad41294298161b3e800fc81347be415 --- Android.mk | 25 +++++++++++++++++++++++++ README.version | 3 +++ dtc-lexer.l | 2 +- libfdt/Android.mk | 16 ++++++++++++++++ util.c | 2 +- version_non_gen.h | 1 + 6 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 Android.mk create mode 100644 README.version create mode 100644 libfdt/Android.mk create mode 100644 version_non_gen.h diff --git a/Android.mk b/Android.mk new file mode 100644 index 0000000..0fad195 --- /dev/null +++ b/Android.mk @@ -0,0 +1,25 @@ +# Copyright 2016 The Android Open Source Project + +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + checks.c \ + data.c \ + dtc.c \ + dtc-lexer.l \ + dtc-parser.y \ + flattree.c \ + fstree.c \ + livetree.c \ + srcpos.c \ + treesource.c \ + util.c + +LOCAL_STATIC_LIBRARIES := \ + libfdt +LOCAL_MODULE := dtc + +include $(BUILD_HOST_EXECUTABLE) + +include $(LOCAL_PATH)/libfdt/Android.mk diff --git a/README.version b/README.version new file mode 100644 index 0000000..ee72e1f --- /dev/null +++ b/README.version @@ -0,0 +1,3 @@ +URL: https://git.kernel.org/cgit/utils/dtc/dtc.git/commit/?id=b06e55c88b9b922ff7e25cd62a4709b65524f0fc +Version: 1.4.1 plus bugfixes +Owners: cphoenix diff --git a/dtc-lexer.l b/dtc-lexer.l index 40bbc87..7032f46 100644 --- a/dtc-lexer.l +++ b/dtc-lexer.l @@ -36,7 +36,7 @@ LINECOMMENT "//".*\n %{ #include "dtc.h" #include "srcpos.h" -#include "dtc-parser.tab.h" +#include "dtc-parser.h" YYLTYPE yylloc; extern bool treesource_error; diff --git a/libfdt/Android.mk b/libfdt/Android.mk new file mode 100644 index 0000000..23bdcce --- /dev/null +++ b/libfdt/Android.mk @@ -0,0 +1,16 @@ +LOCAL_PATH:= $(call my-dir) + +include $(CLEAR_VARS) +LOCAL_SRC_FILES := \ + fdt.c \ + fdt_ro.c \ + fdt_wip.c \ + fdt_sw.c \ + fdt_rw.c \ + fdt_strerror.c \ + fdt_empty_tree.c \ + fdt_addresses.c + +LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) +LOCAL_MODULE := libfdt +include $(BUILD_HOST_STATIC_LIBRARY) diff --git a/util.c b/util.c index fb124ee..17efa5c 100644 --- a/util.c +++ b/util.c @@ -34,7 +34,7 @@ #include "libfdt.h" #include "util.h" -#include "version_gen.h" +#include "version_non_gen.h" char *xstrdup(const char *s) { diff --git a/version_non_gen.h b/version_non_gen.h new file mode 100644 index 0000000..f2fde7b --- /dev/null +++ b/version_non_gen.h @@ -0,0 +1 @@ +#define DTC_VERSION "DTC 1.4.1-Android-build"