History

tcc: add sysinclude path with -B, like gcc does

Joe Soroka committed 15 years ago

Commit db6fcce1 parent e939c401 file · +7 −1Browse files

Unified · Split

tcc.c+7−1
@@ -47,7 +47,7 @@ static void help(void) · 46 unmodified lines
4747 " -v display current version, increase verbosity\n"
4848 " -c compile only - generate an object file\n"
4949 " -o outfile set output filename\n"
50− " -Bdir set tcc internal library path\n"
50+ " -Bdir set tcc internal library and include path\n"
5151 " -bench output compilation statistics\n"
5252 " -run run compiled source\n"
5353 " -fflag set or reset (with 'no-' prefix) 'flag' (see man page)\n"
@@ -374,6 +374,12 @@ static int parse_args(TCCState *s, int argc, char **argv) · 320 unmodified lines
374374 case TCC_OPTION_B:
375375 /* set tcc utilities path (mainly for tcc development) */
376376 tcc_set_lib_path(s, optarg);
377+ /* append /include and add it as -isystem, as gcc does */
378+ r = tcc_strdup(optarg);
379+ r = tcc_realloc(r, strlen(r) + 8 + 1);
380+ strcat(r, "/include");
381+ tcc_add_sysinclude_path(s, r);
382+ tcc_free(r);
377383 break;
378384 case TCC_OPTION_l:
379385 dynarray_add((void ***)&files, &nb_files, r);

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