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
This commit is contained in:
Chris Phoenix 2016-02-22 15:58:11 -08:00
parent dbac4d46c8
commit a768648acb
6 changed files with 47 additions and 2 deletions

25
Android.mk Normal file
View file

@ -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

3
README.version Normal file
View file

@ -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

View file

@ -36,7 +36,7 @@ LINECOMMENT "//".*\n
%{ %{
#include "dtc.h" #include "dtc.h"
#include "srcpos.h" #include "srcpos.h"
#include "dtc-parser.tab.h" #include "dtc-parser.h"
YYLTYPE yylloc; YYLTYPE yylloc;
extern bool treesource_error; extern bool treesource_error;

16
libfdt/Android.mk Normal file
View file

@ -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)

2
util.c
View file

@ -34,7 +34,7 @@
#include "libfdt.h" #include "libfdt.h"
#include "util.h" #include "util.h"
#include "version_gen.h" #include "version_non_gen.h"
char *xstrdup(const char *s) char *xstrdup(const char *s)
{ {

1
version_non_gen.h Normal file
View file

@ -0,0 +1 @@
#define DTC_VERSION "DTC 1.4.1-Android-build"