added CPATH, C_INCLUDE_PATH and LD_LIBRARY_PATH

This commit is contained in:
Andrew Aladjev
2013-02-19 14:47:36 +03:00
parent 0db7f616ad
commit 0ad857c80e
3 changed files with 21 additions and 0 deletions

View File

@ -1941,3 +1941,21 @@ PUB_FUNC void tcc_print_stats(TCCState *s, int64_t total_time)
tt, (int)(total_lines / tt),
total_bytes / tt / 1000000.0);
}
PUB_FUNC void tcc_set_environment(TCCState *s)
{
char * path;
path = getenv("C_INCLUDE_PATH");
if(path != NULL) {
tcc_add_include_path(s, path);
}
path = getenv("CPATH");
if(path != NULL) {
tcc_add_include_path(s, path);
}
path = getenv("LD_LIBRARY_PATH");
if(path != NULL) {
tcc_add_library_path(s, path);
}
}