CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
orangepi-xunlong

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: orangepi-xunlong/orangepi-build
Path: blob/next/external/packages/extras-buildpkgs/libmali-sunxi-r3p0/debian/patches/fix-makefiles.patch
Views: 3963
1
diff --git a/.gitignore b/.gitignore
2
index 6865abf..2f0cfe4 100644
3
--- a/.gitignore
4
+++ b/.gitignore
5
@@ -1,2 +1,4 @@
6
config.mk
7
*~
8
+*.pc
9
+!Makefile.pc
10
diff --git a/Makefile b/Makefile
11
index 60d4a0f..83b40bb 100644
12
--- a/Makefile
13
+++ b/Makefile
14
@@ -3,6 +3,7 @@
15
all: config.mk
16
$(MAKE) -C include
17
$(MAKE) -C lib
18
+ $(MAKE) -f Makefile.pc
19
20
config:
21
rm -f config.mk
22
@@ -12,15 +13,21 @@ config.mk:
23
$(MAKE) -f Makefile.config
24
25
clean:
26
+ touch config.mk
27
$(MAKE) -C version clean
28
$(MAKE) -C test clean
29
$(MAKE) -C lib clean
30
- $(MAKE) -C include clean
31
+ $(MAKE) -f Makefile.pc clean
32
rm -f config.mk
33
34
install: config.mk
35
$(MAKE) -C lib install
36
$(MAKE) -C include install
37
+ $(MAKE) -C test install
38
+ $(MAKE) -f Makefile.pc install
39
40
-test: config.mk
41
+prepare: config.mk
42
+ $(MAKE) -C lib prepare
43
+
44
+test: config.mk prepare
45
$(MAKE) -C test test
46
diff --git a/Makefile.pc b/Makefile.pc
47
new file mode 100644
48
index 0000000..333347a
49
--- /dev/null
50
+++ b/Makefile.pc
51
@@ -0,0 +1,24 @@
52
+include Makefile.setup
53
+include config.mk
54
+
55
+all:
56
+ echo "prefix=$(prefix)" > egl.pc
57
+ echo "libdir=$(prefix)lib/$(libsubdir)/$(private_dir)" >> egl.pc
58
+ cat egl.pc.in >> egl.pc
59
+ sed -i "s/MVERSION/${MALI_VERSION}/g" egl.pc
60
+ echo "prefix=$(prefix)" > gles_cm.pc
61
+ echo "libdir=$(prefix)lib/$(libsubdir)/$(private_dir)" >> gles_cm.pc
62
+ cat gles_cm.pc.in >> gles_cm.pc
63
+ sed -i "s/MVERSION/${MALI_VERSION}/g" gles_cm.pc
64
+ echo "prefix=$(prefix)" > glesv2.pc
65
+ echo "libdir=$(prefix)lib/$(libsubdir)/$(private_dir)" >> glesv2.pc
66
+ cat glesv2.pc.in >> glesv2.pc
67
+ sed -i "s/MVERSION/${MALI_VERSION}/g" glesv2.pc
68
+
69
+install: egl.pc gles_cm.pc glesv2.pc
70
+ $(MKDIR) $(pkgconfigdir)/pkgconfig
71
+ $(INSTALL_DATA) $^ $(pkgconfigdir)/pkgconfig
72
+
73
+clean:
74
+ $(RM) egl.pc gles_cm.pc glesv2.pc
75
+
76
diff --git a/Makefile.setup b/Makefile.setup
77
index 9b1ef0d..31da0d2 100644
78
--- a/Makefile.setup
79
+++ b/Makefile.setup
80
@@ -1,6 +1,9 @@
81
DESTDIR ?= /
82
prefix ?= /usr/
83
-libdir ?= $(DESTDIR)$(prefix)lib/
84
+libsubdir ?=
85
+private_dir ?=
86
+libdir ?= $(DESTDIR)$(prefix)lib/$(libsubdir)/$(private_dir)/
87
+pkgconfigdir ?= $(DESTDIR)$(prefix)lib/$(libsubdir)/
88
includedir ?= $(DESTDIR)$(prefix)/include
89
90
INSTALL ?= install
91
diff --git a/egl.pc.in b/egl.pc.in
92
new file mode 100644
93
index 0000000..e5917b0
94
--- /dev/null
95
+++ b/egl.pc.in
96
@@ -0,0 +1,10 @@
97
+exec_prefix=${prefix}
98
+includedir=${prefix}/include
99
+
100
+Name: egl
101
+Description: Mali EGL library
102
+Requires.private:
103
+Version: MVERSION
104
+Libs: -L${libdir} -lEGL
105
+Libs.private: -lm -lpthread -ldl
106
+Cflags: -I${includedir}
107
diff --git a/gles_cm.pc.in b/gles_cm.pc.in
108
new file mode 100644
109
index 0000000..86f30fb
110
--- /dev/null
111
+++ b/gles_cm.pc.in
112
@@ -0,0 +1,10 @@
113
+exec_prefix=${prefix}
114
+includedir=${prefix}/include
115
+
116
+Name: gles_cm
117
+Description: Mali OpenGL ES 1.1 CM library
118
+Requires.private:
119
+Version: MVERSION
120
+Libs: -L${libdir} -lGLES_CM
121
+Libs.private: -lm -lpthread -ldl
122
+Cflags: -I${includedir}
123
diff --git a/glesv2.pc.in b/glesv2.pc.in
124
new file mode 100644
125
index 0000000..21cc87b
126
--- /dev/null
127
+++ b/glesv2.pc.in
128
@@ -0,0 +1,10 @@
129
+exec_prefix=${prefix}
130
+includedir=${prefix}/include
131
+
132
+Name: glesv2
133
+Description: Mali OpenGL ES 2.0 library
134
+Requires.private:
135
+Version: MVERSION
136
+Libs: -L${libdir} -lGLESv2
137
+Libs.private: -lm -lpthread -ldl
138
+Cflags: -I${includedir}
139
diff --git a/include/GLES/gl.h b/include/GLES/gl.h
140
index 858f394..a6bb591 100644
141
--- a/include/GLES/gl.h
142
+++ b/include/GLES/gl.h
143
@@ -29,6 +29,7 @@ typedef float GLfloat;
144
typedef float GLclampf;
145
typedef signed int GLfixed;
146
typedef signed int GLclampx;
147
+typedef char GLchar;
148
149
typedef int * GLintptr;
150
typedef int * GLsizeiptr;
151
diff --git a/include/GLES2/gl2.h b/include/GLES2/gl2.h
152
index 59e376c..90d96bb 100644
153
--- a/include/GLES2/gl2.h
154
+++ b/include/GLES2/gl2.h
155
@@ -32,6 +32,7 @@ typedef unsigned int GLuint;
156
typedef khronos_float_t GLfloat;
157
typedef khronos_float_t GLclampf;
158
typedef khronos_int32_t GLfixed;
159
+typedef char GLchar;
160
161
/* GL types for handling large vertex buffer objects */
162
typedef khronos_intptr_t GLintptr;
163
diff --git a/lib/Makefile b/lib/Makefile
164
index 574bc2c..1df2e2e 100644
165
--- a/lib/Makefile
166
+++ b/lib/Makefile
167
@@ -2,6 +2,9 @@ all:
168
169
clean:
170
171
+prepare:
172
+ $(MAKE) -C mali prepare
173
+
174
install:
175
$(MAKE) -C mali install
176
177
diff --git a/test/Makefile b/test/Makefile
178
index 700416e..1fce02f 100644
179
--- a/test/Makefile
180
+++ b/test/Makefile
181
@@ -1,11 +1,15 @@
182
include ../Makefile.setup
183
+include ../config.mk
184
185
CFLAGS ?= -Wall
186
187
all: test
188
189
test: ../config.mk test.c
190
- $(CC) $(CFLAGS) -o $@ test.c -lEGL -lGLESv2
191
+ $(CC) $(CFLAGS) -o $@ test.c -I../include/ -L../lib/mali/$(MALI_VERSION)/$(MALI_LIBS_ABI)/$(MALI_EGL_TYPE)/ -lEGL -lGLESv2 -lX11
192
+
193
+install:
194
+ $(INSTALL) -m 755 test $(DESTDIR)$(prefix)/bin/mali-triangle
195
196
clean:
197
rm -f test
198
199