Unified · Split
| @@ -47,7 +47,7 @@ static void help(void) · 46 unmodified lines | ||
| 47 | 47 | " -v display current version, increase verbosity\n" |
| 48 | 48 | " -c compile only - generate an object file\n" |
| 49 | 49 | " -o outfile set output filename\n" |
| 50 | − " -Bdir set tcc internal library path\n" | |
| 50 | + " -Bdir set tcc internal library and include path\n" | |
| 51 | 51 | " -bench output compilation statistics\n" |
| 52 | 52 | " -run run compiled source\n" |
| 53 | 53 | " -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 | ||
| 374 | 374 | case TCC_OPTION_B: |
| 375 | 375 | /* set tcc utilities path (mainly for tcc development) */ |
| 376 | 376 | 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); | |
| 377 | 383 | break; |
| 378 | 384 | case TCC_OPTION_l: |
| 379 | 385 | dynarray_add((void ***)&files, &nb_files, r); |