diff options
| author | grischka <grischka> | 2013-02-10 00:38:40 +0100 |
|---|---|---|
| committer | grischka <grischka> | 2013-02-10 00:38:40 +0100 |
| commit | 8042121d74906eacec7add2ddc85270e1db3ca88 (patch) | |
| tree | a2f40b84332e8209ad91a0a0005444f1d61c96c5 /libtcc.c | |
| parent | d6d7686b608c4b7cd88877b30579ca2346e5d284 (diff) | |
| download | tinycc-8042121d74906eacec7add2ddc85270e1db3ca88.tar.gz tinycc-8042121d74906eacec7add2ddc85270e1db3ca88.tar.bz2 | |
tcc -vv/--print-search-dirs: print more info
tests/Makefile:
- print-search-dirs when 'hello' fails
- split off hello-run
win32/include/_mingw.h:
- fix for compatibility with mingw headers
(While our headers in win32 are from mingw-64 and don't have
the problem)
tiny_libmaker:
- don't use "dangerous" mktemp
Diffstat (limited to 'libtcc.c')
| -rw-r--r-- | libtcc.c | 78 |
1 files changed, 64 insertions, 14 deletions
@@ -1589,20 +1589,6 @@ PUB_FUNC const char * tcc_set_linker(TCCState *s, char *option, int multi) return NULL; } -PUB_FUNC void tcc_print_stats(TCCState *s, int64_t total_time) -{ - double tt; - tt = (double)total_time / 1000000.0; - if (tt < 0.001) - tt = 0.001; - if (total_bytes < 1) - total_bytes = 1; - printf("%d idents, %d lines, %d bytes, %0.3f s, %d lines/s, %0.1f MB/s\n", - tok_ident - TOK_IDENT, total_lines, total_bytes, - tt, (int)(total_lines / tt), - total_bytes / tt / 1000000.0); -} - /* set CONFIG_TCCDIR at runtime */ LIBTCCAPI void tcc_set_lib_path(TCCState *s, const char *path) { @@ -1668,3 +1654,67 @@ PUB_FUNC void tcc_gen_makedeps(TCCState *s, const char *target, const char *file fprintf(depout, "\n"); fclose(depout); } + +PUB_FUNC void tcc_print_stats(TCCState *s, int64_t total_time) +{ + double tt; + tt = (double)total_time / 1000000.0; + if (tt < 0.001) + tt = 0.001; + if (total_bytes < 1) + total_bytes = 1; + printf("%d idents, %d lines, %d bytes, %0.3f s, %d lines/s, %0.1f MB/s\n", + tok_ident - TOK_IDENT, total_lines, total_bytes, + tt, (int)(total_lines / tt), + total_bytes / tt / 1000000.0); +} + +static void print_paths(const char *msg, char **paths, int nb_paths) +{ + int i; + printf("%s:\n%s", msg, nb_paths ? "" : " -\n"); + for(i = 0; i < nb_paths; i++) + printf(" %s\n", paths[i]); +} + +PUB_FUNC void tcc_display_info(TCCState *s, int what) +{ + switch (what) { + case 0: + printf("tcc version %s (" +#ifdef TCC_TARGET_I386 + "i386" +# ifdef TCC_TARGET_PE + " Win32" +# endif +#elif defined TCC_TARGET_X86_64 + "x86-64" +# ifdef TCC_TARGET_PE + " Win64" +# endif +#elif defined TCC_TARGET_ARM + "ARM" +# ifdef TCC_ARM_HARDFLOAT + " Hard Float" +# endif +# ifdef TCC_TARGET_PE + " WinCE" +# endif +#endif +#ifndef TCC_TARGET_PE +# ifdef __linux + " Linux" +# endif +#endif + ")\n", TCC_VERSION); + break; + case 1: + printf("install: %s/\n", s->tcc_lib_path); + /* print_paths("programs", NULL, 0); */ + print_paths("crt", s->crt_paths, s->nb_crt_paths); + print_paths("libraries", s->library_paths, s->nb_library_paths); + print_paths("include", s->sysinclude_paths, s->nb_sysinclude_paths); + break; + } +} + |
