History

Use a display_info() to output a header of the tcc help listing

tcc version 0.9.26 (i386 Linux) Tiny C Compiler - Copyright (C) 2001-2006 Fabrice Bellard Usage: tcc [options...] [-o outfile] [-c] infile(s)... tcc [options...] -run infile [arguments...] ... instead of the tcc version 0.9.26 - Tiny C Compiler - Copyright (C) 2001-2006 Fabrice Bellard Usage: tcc [options...] [-o outfile] [-c] infile(s)... tcc [options...] -run infile [arguments...] ... Displaing a "Hard Float" info for the ARM arch is restored. It was broken by the AArm64 patch.

seyko committed 11 years ago

Commit 20074d81 parent 2437ccd1 file · +62 −55Browse files

Unified · Split

tcc.c+62−55
@@ -24,9 +24,68 @@ · 23 unmodified lines
2424 #include "tcc.h"
2525 #endif
2626
27−static void help(void)
27+static void print_paths(const char *msg, char **paths, int nb_paths)
28+{
29+ int i;
30+ printf("%s:\n%s", msg, nb_paths ? "" : " -\n");
31+ for(i = 0; i < nb_paths; i++)
32+ printf(" %s\n", paths[i]);
33+}
34+
35+static void display_info(TCCState *s, int what)
36+{
37+ switch (what) {
38+ case 0:
39+ printf("tcc version %s ("
40+#ifdef TCC_TARGET_I386
41+ "i386"
42+# ifdef TCC_TARGET_PE
43+ " Win32"
44+# endif
45+#elif defined TCC_TARGET_X86_64
46+ "x86-64"
47+# ifdef TCC_TARGET_PE
48+ " Win64"
49+# endif
50+#elif defined TCC_TARGET_ARM
51+ "ARM"
52+# ifdef TCC_ARM_HARDFLOAT
53+ " Hard Float"
54+# endif
55+# ifdef TCC_TARGET_PE
56+ " WinCE"
57+# endif
58+#elif defined TCC_TARGET_ARM64
59+ "AArch64"
60+# ifdef TCC_ARM_HARDFLOAT
61+ " Hard Float"
62+# endif
63+# ifdef TCC_TARGET_PE
64+ " WinCE"
65+# endif
66+#endif
67+#ifndef TCC_TARGET_PE
68+# ifdef __linux
69+ " Linux"
70+# endif
71+#endif
72+ ")\n", TCC_VERSION);
73+ break;
74+ case 1:
75+ printf("install: %s/\n", s->tcc_lib_path);
76+ /* print_paths("programs", NULL, 0); */
77+ print_paths("crt", s->crt_paths, s->nb_crt_paths);
78+ print_paths("libraries", s->library_paths, s->nb_library_paths);
79+ print_paths("include", s->sysinclude_paths, s->nb_sysinclude_paths);
80+ printf("elfinterp:\n %s\n", DEFAULT_ELFINTERP(s));
81+ break;
82+ }
83+}
84+
85+static void help(TCCState *s)
2886 {
29− printf("tcc version " TCC_VERSION " - Tiny C Compiler - Copyright (C) 2001-2006 Fabrice Bellard\n"
87+ display_info(s, 0);
88+ printf("Tiny C Compiler - Copyright (C) 2001-2006 Fabrice Bellard\n"
3089 "Usage: tcc [options...] [-o outfile] [-c] infile(s)...\n"
3190 " tcc [options...] -run infile [arguments...]\n"
3291 "General options:\n"
@@ -181,58 +240,6 @@ static char *default_outputfile(TCCState *s, const char *first_file) · 148 unmodified lines
181240 return tcc_strdup(buf);
182241 }
183242
184−static void print_paths(const char *msg, char **paths, int nb_paths)
185−{
186− int i;
187− printf("%s:\n%s", msg, nb_paths ? "" : " -\n");
188− for(i = 0; i < nb_paths; i++)
189− printf(" %s\n", paths[i]);
190−}
191−
192−static void display_info(TCCState *s, int what)
193−{
194− switch (what) {
195− case 0:
196− printf("tcc version %s ("
197−#ifdef TCC_TARGET_I386
198− "i386"
199−# ifdef TCC_TARGET_PE
200− " Win32"
201−# endif
202−#elif defined TCC_TARGET_X86_64
203− "x86-64"
204−# ifdef TCC_TARGET_PE
205− " Win64"
206−# endif
207−#elif defined TCC_TARGET_ARM
208− "ARM"
209−#elif defined TCC_TARGET_ARM64
210− "AArch64"
211−# ifdef TCC_ARM_HARDFLOAT
212− " Hard Float"
213−# endif
214−# ifdef TCC_TARGET_PE
215− " WinCE"
216−# endif
217−#endif
218−#ifndef TCC_TARGET_PE
219−# ifdef __linux
220− " Linux"
221−# endif
222−#endif
223− ")\n", TCC_VERSION);
224− break;
225− case 1:
226− printf("install: %s/\n", s->tcc_lib_path);
227− /* print_paths("programs", NULL, 0); */
228− print_paths("crt", s->crt_paths, s->nb_crt_paths);
229− print_paths("libraries", s->library_paths, s->nb_library_paths);
230− print_paths("include", s->sysinclude_paths, s->nb_sysinclude_paths);
231− printf("elfinterp:\n %s\n", DEFAULT_ELFINTERP(s));
232− break;
233− }
234−}
235−
236243 static int64_t getclock_us(void)
237244 {
238245 #ifdef _WIN32
@@ -259,7 +266,7 @@ int main(int argc, char **argv) · 20 unmodified lines
259266 tcc_set_environment(s);
260267
261268 if (optind == 0) {
262− help();
269+ help(s);
263270 return 1;
264271 }
265272

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t