Initial import
[renesas/gralloc-kms.git] / external / drm / 0004-libdrm-Add-support-for-Android-build-system.patch
1 From 56a17581945bcf63038c6200e5637322b48eb4cc Mon Sep 17 00:00:00 2001
2 From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
3 Date: Sat, 15 Sep 2012 04:44:06 +0200
4 Subject: [PATCH 4/4] libdrm: Add support for Android build system
5
6 Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
7 ---
8  Android.mk        |   37 +++++++++++++++++++++++++++++++++++++
9  libkms/Android.mk |   23 +++++++++++++++++++++++
10  libkms/api.c      |    3 ++-
11  libkms/linux.c    |    3 ++-
12  4 files changed, 64 insertions(+), 2 deletions(-)
13  create mode 100644 Android.mk
14  create mode 100644 libkms/Android.mk
15
16 diff --git a/Android.mk b/Android.mk
17 new file mode 100644
18 index 0000000..39ba22c
19 --- /dev/null
20 +++ b/Android.mk
21 @@ -0,0 +1,37 @@
22 +LOCAL_PATH := $(call my-dir)
23 +
24 +#
25 +# DRM
26 +#
27 +
28 +include $(CLEAR_VARS)
29 +
30 +LOCAL_SRC_FILES := \
31 +       xf86drm.c \
32 +       xf86drmHash.c \
33 +       xf86drmRandom.c \
34 +       xf86drmSL.c \
35 +       xf86drmMode.c
36 +
37 +LOCAL_MODULE := libdrm
38 +LOCAL_MODULE_TAGS := optional
39 +
40 +LOCAL_C_INCLUDES += \
41 +       $(LOCAL_PATH)/include/drm
42 +
43 +LOCAL_COPY_HEADERS_TO := libdrm
44 +LOCAL_COPY_HEADERS := \
45 +       xf86drm.h \
46 +       xf86drmMode.h \
47 +       include/drm/drm.h \
48 +       include/drm/drm_fourcc.h \
49 +       include/drm/drm_mode.h \
50 +       include/drm/drm_sarea.h
51 +
52 +include $(BUILD_SHARED_LIBRARY)
53 +
54 +#
55 +# KMS
56 +#
57 +
58 +include $(LOCAL_PATH)/libkms/Android.mk
59 diff --git a/libkms/Android.mk b/libkms/Android.mk
60 new file mode 100644
61 index 0000000..f7e060a
62 --- /dev/null
63 +++ b/libkms/Android.mk
64 @@ -0,0 +1,22 @@
65 +LOCAL_PATH := $(call my-dir)
66 +
67 +include $(CLEAR_VARS)
68 +
69 +LOCAL_SRC_FILES := \
70 +       linux.c \
71 +       dumb.c \
72 +       api.c
73 +
74 +LOCAL_MODULE := libkms
75 +LOCAL_MODULE_TAGS := optional
76 +LOCAL_SHARED_LIBRARIES := libdrm
77 +
78 +LOCAL_C_INCLUDES += \
79 +       $(LOCAL_PATH)/.. \
80 +       $(LOCAL_PATH)/../include/drm
81 +
82 +LOCAL_COPY_HEADERS_TO := libdrm
83 +LOCAL_COPY_HEADERS := \
84 +       libkms.h
85 +
86 +include $(BUILD_SHARED_LIBRARY)
87 diff --git a/libkms/api.c b/libkms/api.c
88 index 5befaa0..c3dac75 100644
89 --- a/libkms/api.c
90 +++ b/libkms/api.c
91 @@ -25,8 +25,9 @@
92   *
93   **************************************************************************/
94  
95 -
96 +#ifdef HAVE_CONFIG_H
97  #include "config.h"
98 +#endif
99  #include <errno.h>
100  #include <stdlib.h>
101  #include <string.h>
102 diff --git a/libkms/linux.c b/libkms/linux.c
103 index 4f86121..2e1b10d 100644
104 --- a/libkms/linux.c
105 +++ b/libkms/linux.c
106 @@ -29,8 +29,9 @@
107   * going from fd to pci id via fstat and udev.
108   */
109  
110 -
111 +#ifdef HAVE_CONFIG_H
112  #include "config.h"
113 +#endif
114  #include <errno.h>
115  #include <stdio.h>
116  #include <stdlib.h>
117 -- 
118 1.7.8.6
119