Skip to content
This repository was archived by the owner on Jan 18, 2024. It is now read-only.

Commit 0891ee8

Browse files
committed
Add tcc
1 parent c97e034 commit 0891ee8

File tree

1,391 files changed

+187155
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,391 files changed

+187155
-2
lines changed

mk/tinycc/0001-TCC_ANDROID.patch

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
From 1ac5da7fa000d322ca227e31bd90647451504ba1 Mon Sep 17 00:00:00 2001
2+
From: River <[email protected]>
3+
Date: Wed, 28 Mar 2018 22:15:42 +0800
4+
Subject: [PATCH] USE .SO
5+
6+
---
7+
configure | 8 ++++----
8+
1 file changed, 4 insertions(+), 4 deletions(-)
9+
10+
diff --git a/configure b/configure
11+
index 1ee3acb..75e2d1b 100755
12+
--- a/configure
13+
+++ b/configure
14+
@@ -51,10 +51,10 @@ gcc_minor=0
15+
# OS specific
16+
targetos=`uname`
17+
case $targetos in
18+
- Darwin)
19+
- confvars="$confvars OSX"
20+
- DLLSUF=".dylib"
21+
- ;;
22+
+ #Darwin)
23+
+ # confvars="$confvars OSX"
24+
+ # DLLSUF=".dylib"
25+
+ # ;;
26+
MINGW*|MSYS*|CYGWIN*)
27+
mingw32=yes
28+
;;
29+
diff --git a/tcc.h b/tcc.h
30+
index da26298..fbf46b5 100644
31+
--- a/tcc.h
32+
+++ b/tcc.h
33+
@@ -22,6 +22,7 @@
34+
#define _TCC_H
35+
36+
#define _GNU_SOURCE
37+
+#define __ANDROID_API__ 21
38+
#include "config.h"
39+
40+
#include <stdlib.h>
41+
diff --git a/tcc.h b/tcc.h
42+
index da26298..a8c9377 100644
43+
--- a/tcc.h
44+
+++ b/tcc.h
45+
@@ -176,7 +176,7 @@ extern long double strtold (const char *__nptr, char **__endptr);
46+
# define CONFIG_SYSROOT ""
47+
#endif
48+
#ifndef CONFIG_TCCDIR
49+
-# define CONFIG_TCCDIR "/usr/local/lib/tcc"
50+
+# define CONFIG_TCCDIR "/system/lib"
51+
#endif
52+
#ifndef CONFIG_LDDIR
53+
# define CONFIG_LDDIR "lib"
54+
--
55+
2.11.0 (Apple Git-81)
56+
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
From 2ab5d487de9160fd58ba77c6a85d6d85c0ea3de8 Mon Sep 17 00:00:00 2001
2+
From: River <[email protected]>
3+
Date: Fri, 30 Mar 2018 18:45:03 +0800
4+
Subject: [PATCH] Up
5+
6+
---
7+
Makefile | 2 +-
8+
lib/Makefile | 4 ++--
9+
2 files changed, 3 insertions(+), 3 deletions(-)
10+
11+
diff --git a/Makefile b/Makefile
12+
index 8888149..4bc6abf 100644
13+
--- a/Makefile
14+
+++ b/Makefile
15+
@@ -46,7 +46,7 @@ else
16+
NATIVE_TARGET = $(ARCH)
17+
ifdef CONFIG_OSX
18+
NATIVE_TARGET = $(ARCH)-osx
19+
- LDFLAGS += -flat_namespace -undefined warning
20+
+ LDFLAGS += -undefined
21+
export MACOSX_DEPLOYMENT_TARGET := 10.2
22+
endif
23+
endif
24+
diff --git a/lib/Makefile b/lib/Makefile
25+
index 0c1ec54..13e4087 100644
26+
--- a/lib/Makefile
27+
+++ b/lib/Makefile
28+
@@ -9,7 +9,7 @@ T = $(or $(CROSS_TARGET),$(NATIVE_TARGET),unknown)
29+
X = $(if $(CROSS_TARGET),$(CROSS_TARGET)-)
30+
BIN = $(TOP)/$(X)libtcc1.a
31+
32+
-XTCC ?= $(TOP)/$(X)tcc$(EXESUF)
33+
+XTCC ?= $(CC) $(CFLAGS_P) $(LIBS_P) $(LDFLAGS_P) #$(TOP)/$(X)tcc$(EXESUF)
34+
XCC = $(XTCC)
35+
XAR = $(XTCC) -ar
36+
XFLAGS-unx = -B$(TOPSRC)
37+
@@ -58,7 +58,7 @@ OBJ-arm-eabihf = $(ARM_O)
38+
OBJ-arm-wince = $(ARM_O) $(WIN_O)
39+
40+
$(BIN) : $(patsubst %.o,$(X)%.o,$(OBJ-$T))
41+
- $(XAR) rcs $@ $^
42+
+ $(AR) rcs $@ $^
43+
44+
$(X)%.o : %.c
45+
$(XCC) -c $< -o $@ $(XFLAGS)
46+
--
47+
2.11.0 (Apple Git-81)
48+

mk/tinycc/build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
arm-tcc helloworld.c -I./sysinclude -I./sysinclude/linux -I./sysinclude/arm-linux-androideabi -I./tccinclude -I./tccinclude/include -L/system/lib -lc -m32 -nostdinc -nostdlib -g -o helloworld

mk/tinycc/helloworld.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#incude "libtcc.h"
2+
/*#include "stdio.h"*/
3+
int main()
4+
{
5+
//printf("Hello World!\n");
6+
return 0;
7+
}

mk/tinycc/sysinculde/.stdio.h.swp

4 KB
Binary file not shown.

mk/tinycc/sysinculde/EGL/egl.h

Lines changed: 247 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,247 @@
1+
#ifndef __egl_h_
2+
#define __egl_h_ 1
3+
4+
#ifdef __cplusplus
5+
extern "C" {
6+
#endif
7+
8+
/*
9+
** Copyright (c) 2013-2017 The Khronos Group Inc.
10+
**
11+
** Permission is hereby granted, free of charge, to any person obtaining a
12+
** copy of this software and/or associated documentation files (the
13+
** "Materials"), to deal in the Materials without restriction, including
14+
** without limitation the rights to use, copy, modify, merge, publish,
15+
** distribute, sublicense, and/or sell copies of the Materials, and to
16+
** permit persons to whom the Materials are furnished to do so, subject to
17+
** the following conditions:
18+
**
19+
** The above copyright notice and this permission notice shall be included
20+
** in all copies or substantial portions of the Materials.
21+
**
22+
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23+
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24+
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
25+
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
26+
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
27+
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
28+
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
29+
*/
30+
/*
31+
** This header is generated from the Khronos OpenGL / OpenGL ES XML
32+
** API Registry. The current version of the Registry, generator scripts
33+
** used to make the header, and the header can be found at
34+
** http://www.khronos.org/registry/egl
35+
**
36+
** Khronos $Git commit SHA1: a732b061e7 $ on $Git commit date: 2017-06-17 23:27:53 +0100 $
37+
*/
38+
39+
#include <EGL/eglplatform.h>
40+
41+
/* Generated on date 20170627 */
42+
43+
/* Generated C header for:
44+
* API: egl
45+
* Versions considered: .*
46+
* Versions emitted: .*
47+
* Default extensions included: None
48+
* Additional extensions included: _nomatch_^
49+
* Extensions removed: _nomatch_^
50+
*/
51+
52+
#ifndef EGL_VERSION_1_0
53+
#define EGL_VERSION_1_0 1
54+
typedef unsigned int EGLBoolean;
55+
typedef void *EGLDisplay;
56+
#include <KHR/khrplatform.h>
57+
#include <EGL/eglplatform.h>
58+
typedef void *EGLConfig;
59+
typedef void *EGLSurface;
60+
typedef void *EGLContext;
61+
typedef void (*__eglMustCastToProperFunctionPointerType)(void);
62+
#define EGL_ALPHA_SIZE 0x3021
63+
#define EGL_BAD_ACCESS 0x3002
64+
#define EGL_BAD_ALLOC 0x3003
65+
#define EGL_BAD_ATTRIBUTE 0x3004
66+
#define EGL_BAD_CONFIG 0x3005
67+
#define EGL_BAD_CONTEXT 0x3006
68+
#define EGL_BAD_CURRENT_SURFACE 0x3007
69+
#define EGL_BAD_DISPLAY 0x3008
70+
#define EGL_BAD_MATCH 0x3009
71+
#define EGL_BAD_NATIVE_PIXMAP 0x300A
72+
#define EGL_BAD_NATIVE_WINDOW 0x300B
73+
#define EGL_BAD_PARAMETER 0x300C
74+
#define EGL_BAD_SURFACE 0x300D
75+
#define EGL_BLUE_SIZE 0x3022
76+
#define EGL_BUFFER_SIZE 0x3020
77+
#define EGL_CONFIG_CAVEAT 0x3027
78+
#define EGL_CONFIG_ID 0x3028
79+
#define EGL_CORE_NATIVE_ENGINE 0x305B
80+
#define EGL_DEPTH_SIZE 0x3025
81+
#define EGL_DONT_CARE EGL_CAST(EGLint,-1)
82+
#define EGL_DRAW 0x3059
83+
#define EGL_EXTENSIONS 0x3055
84+
#define EGL_FALSE 0
85+
#define EGL_GREEN_SIZE 0x3023
86+
#define EGL_HEIGHT 0x3056
87+
#define EGL_LARGEST_PBUFFER 0x3058
88+
#define EGL_LEVEL 0x3029
89+
#define EGL_MAX_PBUFFER_HEIGHT 0x302A
90+
#define EGL_MAX_PBUFFER_PIXELS 0x302B
91+
#define EGL_MAX_PBUFFER_WIDTH 0x302C
92+
#define EGL_NATIVE_RENDERABLE 0x302D
93+
#define EGL_NATIVE_VISUAL_ID 0x302E
94+
#define EGL_NATIVE_VISUAL_TYPE 0x302F
95+
#define EGL_NONE 0x3038
96+
#define EGL_NON_CONFORMANT_CONFIG 0x3051
97+
#define EGL_NOT_INITIALIZED 0x3001
98+
#define EGL_NO_CONTEXT EGL_CAST(EGLContext,0)
99+
#define EGL_NO_DISPLAY EGL_CAST(EGLDisplay,0)
100+
#define EGL_NO_SURFACE EGL_CAST(EGLSurface,0)
101+
#define EGL_PBUFFER_BIT 0x0001
102+
#define EGL_PIXMAP_BIT 0x0002
103+
#define EGL_READ 0x305A
104+
#define EGL_RED_SIZE 0x3024
105+
#define EGL_SAMPLES 0x3031
106+
#define EGL_SAMPLE_BUFFERS 0x3032
107+
#define EGL_SLOW_CONFIG 0x3050
108+
#define EGL_STENCIL_SIZE 0x3026
109+
#define EGL_SUCCESS 0x3000
110+
#define EGL_SURFACE_TYPE 0x3033
111+
#define EGL_TRANSPARENT_BLUE_VALUE 0x3035
112+
#define EGL_TRANSPARENT_GREEN_VALUE 0x3036
113+
#define EGL_TRANSPARENT_RED_VALUE 0x3037
114+
#define EGL_TRANSPARENT_RGB 0x3052
115+
#define EGL_TRANSPARENT_TYPE 0x3034
116+
#define EGL_TRUE 1
117+
#define EGL_VENDOR 0x3053
118+
#define EGL_VERSION 0x3054
119+
#define EGL_WIDTH 0x3057
120+
#define EGL_WINDOW_BIT 0x0004
121+
EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config);
122+
EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target);
123+
EGLAPI EGLContext EGLAPIENTRY eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list);
124+
EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
125+
EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list);
126+
EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list);
127+
EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext (EGLDisplay dpy, EGLContext ctx);
128+
EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface (EGLDisplay dpy, EGLSurface surface);
129+
EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value);
130+
EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config);
131+
EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay (void);
132+
EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface (EGLint readdraw);
133+
EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay (EGLNativeDisplayType display_id);
134+
EGLAPI EGLint EGLAPIENTRY eglGetError (void);
135+
EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress (const char *procname);
136+
EGLAPI EGLBoolean EGLAPIENTRY eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor);
137+
EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
138+
EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value);
139+
EGLAPI const char *EGLAPIENTRY eglQueryString (EGLDisplay dpy, EGLint name);
140+
EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value);
141+
EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers (EGLDisplay dpy, EGLSurface surface);
142+
EGLAPI EGLBoolean EGLAPIENTRY eglTerminate (EGLDisplay dpy);
143+
EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL (void);
144+
EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative (EGLint engine);
145+
#endif /* EGL_VERSION_1_0 */
146+
147+
#ifndef EGL_VERSION_1_1
148+
#define EGL_VERSION_1_1 1
149+
#define EGL_BACK_BUFFER 0x3084
150+
#define EGL_BIND_TO_TEXTURE_RGB 0x3039
151+
#define EGL_BIND_TO_TEXTURE_RGBA 0x303A
152+
#define EGL_CONTEXT_LOST 0x300E
153+
#define EGL_MIN_SWAP_INTERVAL 0x303B
154+
#define EGL_MAX_SWAP_INTERVAL 0x303C
155+
#define EGL_MIPMAP_TEXTURE 0x3082
156+
#define EGL_MIPMAP_LEVEL 0x3083
157+
#define EGL_NO_TEXTURE 0x305C
158+
#define EGL_TEXTURE_2D 0x305F
159+
#define EGL_TEXTURE_FORMAT 0x3080
160+
#define EGL_TEXTURE_RGB 0x305D
161+
#define EGL_TEXTURE_RGBA 0x305E
162+
#define EGL_TEXTURE_TARGET 0x3081
163+
EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer);
164+
EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer);
165+
EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value);
166+
EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval (EGLDisplay dpy, EGLint interval);
167+
#endif /* EGL_VERSION_1_1 */
168+
169+
#ifndef EGL_VERSION_1_2
170+
#define EGL_VERSION_1_2 1
171+
typedef unsigned int EGLenum;
172+
typedef void *EGLClientBuffer;
173+
#define EGL_ALPHA_FORMAT 0x3088
174+
#define EGL_ALPHA_FORMAT_NONPRE 0x308B
175+
#define EGL_ALPHA_FORMAT_PRE 0x308C
176+
#define EGL_ALPHA_MASK_SIZE 0x303E
177+
#define EGL_BUFFER_PRESERVED 0x3094
178+
#define EGL_BUFFER_DESTROYED 0x3095
179+
#define EGL_CLIENT_APIS 0x308D
180+
#define EGL_COLORSPACE 0x3087
181+
#define EGL_COLORSPACE_sRGB 0x3089
182+
#define EGL_COLORSPACE_LINEAR 0x308A
183+
#define EGL_COLOR_BUFFER_TYPE 0x303F
184+
#define EGL_CONTEXT_CLIENT_TYPE 0x3097
185+
#define EGL_DISPLAY_SCALING 10000
186+
#define EGL_HORIZONTAL_RESOLUTION 0x3090
187+
#define EGL_LUMINANCE_BUFFER 0x308F
188+
#define EGL_LUMINANCE_SIZE 0x303D
189+
#define EGL_OPENGL_ES_BIT 0x0001
190+
#define EGL_OPENVG_BIT 0x0002
191+
#define EGL_OPENGL_ES_API 0x30A0
192+
#define EGL_OPENVG_API 0x30A1
193+
#define EGL_OPENVG_IMAGE 0x3096
194+
#define EGL_PIXEL_ASPECT_RATIO 0x3092
195+
#define EGL_RENDERABLE_TYPE 0x3040
196+
#define EGL_RENDER_BUFFER 0x3086
197+
#define EGL_RGB_BUFFER 0x308E
198+
#define EGL_SINGLE_BUFFER 0x3085
199+
#define EGL_SWAP_BEHAVIOR 0x3093
200+
#define EGL_UNKNOWN EGL_CAST(EGLint,-1)
201+
#define EGL_VERTICAL_RESOLUTION 0x3091
202+
EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI (EGLenum api);
203+
EGLAPI EGLenum EGLAPIENTRY eglQueryAPI (void);
204+
EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list);
205+
EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread (void);
206+
EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient (void);
207+
#endif /* EGL_VERSION_1_2 */
208+
209+
#ifndef EGL_VERSION_1_3
210+
#define EGL_VERSION_1_3 1
211+
#define EGL_CONFORMANT 0x3042
212+
#define EGL_CONTEXT_CLIENT_VERSION 0x3098
213+
#define EGL_MATCH_NATIVE_PIXMAP 0x3041
214+
#define EGL_OPENGL_ES2_BIT 0x0004
215+
#define EGL_VG_ALPHA_FORMAT 0x3088
216+
#define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B
217+
#define EGL_VG_ALPHA_FORMAT_PRE 0x308C
218+
#define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040
219+
#define EGL_VG_COLORSPACE 0x3087
220+
#define EGL_VG_COLORSPACE_sRGB 0x3089
221+
#define EGL_VG_COLORSPACE_LINEAR 0x308A
222+
#define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020
223+
#endif /* EGL_VERSION_1_3 */
224+
225+
#ifndef EGL_VERSION_1_4
226+
#define EGL_VERSION_1_4 1
227+
#define EGL_DEFAULT_DISPLAY EGL_CAST(EGLNativeDisplayType,0)
228+
#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200
229+
#define EGL_MULTISAMPLE_RESOLVE 0x3099
230+
#define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A
231+
#define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B
232+
#define EGL_OPENGL_API 0x30A2
233+
#define EGL_OPENGL_BIT 0x0008
234+
#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400
235+
EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext (void);
236+
#endif /* EGL_VERSION_1_4 */
237+
238+
/* This version of Android does not yet support EGL 1.5, but the following
239+
* portion of EGL 1.5 is included in order to support portions of "eglext.h".
240+
*/
241+
typedef intptr_t EGLAttrib;
242+
243+
#ifdef __cplusplus
244+
}
245+
#endif
246+
247+
#endif

0 commit comments

Comments
 (0)