History

added CPATH, C_INCLUDE_PATH and LD_LIBRARY_PATH

Andrew Aladjev committed 13 years ago

Commit 0ad857c1 parent 0db7f613 files · +21 −0Browse files

Unified · Split

3 files
  1. libtcc.c +18 −0
  2. tcc.c +1 −0
  3. tcc.h +2 −0
libtcc.c+18−0
@@ -1941,3 +1941,21 @@ PUB_FUNC void tcc_print_stats(TCCState *s, int64_t total_time) · 1940 unmodified lines
1941 tt, (int)(total_lines / tt),1941 tt, (int)(total_lines / tt),
1942 total_bytes / tt / 1000000.0);1942 total_bytes / tt / 1000000.0);
1943}1943}
1944
1945PUB_FUNC void tcc_set_environment(TCCState *s)
1946{
1947 char * path;
1948
1949 path = getenv("C_INCLUDE_PATH");
1950 if(path != NULL) {
1951 tcc_add_include_path(s, path);
1952 }
1953 path = getenv("CPATH");
1954 if(path != NULL) {
1955 tcc_add_include_path(s, path);
1956 }
1957 path = getenv("LD_LIBRARY_PATH");
1958 if(path != NULL) {
1959 tcc_add_library_path(s, path);
1960 }
1961}
tcc.c+1−0
@@ -252,6 +252,7 @@ int main(int argc, char **argv) · 251 unmodified lines
252 s->output_type = TCC_OUTPUT_EXE;252 s->output_type = TCC_OUTPUT_EXE;
253 253
254 optind = tcc_parse_args(s, argc - 1, argv + 1);254 optind = tcc_parse_args(s, argc - 1, argv + 1);
255 tcc_set_environment(s);
255 256
256 if (optind == 0) {257 if (optind == 0) {
257 help();258 help();
tcc.h+2−0
@@ -1061,6 +1061,8 @@ ST_FUNC int tcc_add_dll(TCCState *s, const char *filename, int flags); · 1060 unmodified lines
1061PUB_FUNC void tcc_print_stats(TCCState *s, int64_t total_time);1061PUB_FUNC void tcc_print_stats(TCCState *s, int64_t total_time);
1062PUB_FUNC int tcc_parse_args(TCCState *s, int argc, char **argv);1062PUB_FUNC int tcc_parse_args(TCCState *s, int argc, char **argv);
1063 1063
1064PUB_FUNC void tcc_set_environment(TCCState *s);
1065
1064/* ------------ tccpp.c ------------ */1066/* ------------ tccpp.c ------------ */
1065 1067
1066ST_DATA struct BufferedFile *file;1068ST_DATA struct BufferedFile *file;

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