aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Soroka <gits@joesoroka.com>2011-02-02 00:00:12 -0800
committerJoe Soroka <gits@joesoroka.com>2011-02-02 00:00:12 -0800
commitdb6fcce78f4d8ea25036dd6643e9fa83d8e52e5a (patch)
tree57793bdb164b55439635aec10c6e500da777bdcc
parente939c4072ceeb0bc4c8dca7603cfbb73648cb9d4 (diff)
downloadtinycc-db6fcce78f4d8ea25036dd6643e9fa83d8e52e5a.tar.gz
tinycc-db6fcce78f4d8ea25036dd6643e9fa83d8e52e5a.tar.bz2
tcc: add sysinclude path with -B, like gcc does
-rw-r--r--tcc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tcc.c b/tcc.c
index 549b012..570a61c 100644
--- a/tcc.c
+++ b/tcc.c
@@ -47,7 +47,7 @@ static void help(void)
" -v display current version, increase verbosity\n"
" -c compile only - generate an object file\n"
" -o outfile set output filename\n"
- " -Bdir set tcc internal library path\n"
+ " -Bdir set tcc internal library and include path\n"
" -bench output compilation statistics\n"
" -run run compiled source\n"
" -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)
case TCC_OPTION_B:
/* set tcc utilities path (mainly for tcc development) */
tcc_set_lib_path(s, optarg);
+ /* append /include and add it as -isystem, as gcc does */
+ r = tcc_strdup(optarg);
+ r = tcc_realloc(r, strlen(r) + 8 + 1);
+ strcat(r, "/include");
+ tcc_add_sysinclude_path(s, r);
+ tcc_free(r);
break;
case TCC_OPTION_l:
dynarray_add((void ***)&files, &nb_files, r);