Rev 8250 | Rev 8799 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8250 | Rev 8272 | ||
---|---|---|---|
Line 69... | Line 69... | ||
69 | #include "tccpe.c" |
69 | #include "tccpe.c" |
70 | #endif |
70 | #endif |
71 | #ifdef TCC_TARGET_MEOS |
71 | #ifdef TCC_TARGET_MEOS |
72 | #include "tccmeos.c" |
72 | #include "tccmeos.c" |
73 | #endif |
73 | #endif |
- | 74 | #ifdef TCC_TARGET_MEOS_LINUX |
|
- | 75 | #include |
|
- | 76 | #endif |
|
- | 77 | ||
Line 74... | Line 78... | ||
74 | 78 | ||
Line 75... | Line 79... | ||
75 | #endif /* ONE_SOURCE */ |
79 | #endif /* ONE_SOURCE */ |
76 | 80 | ||
Line 138... | Line 142... | ||
138 | tcc_module = hDll; |
142 | tcc_module = hDll; |
139 | return TRUE; |
143 | return TRUE; |
140 | } |
144 | } |
141 | #endif |
145 | #endif |
142 | #else // _WIN32 |
146 | #else // _WIN32 |
143 | #if defined TCC_TARGET_MEOS && ! TCC_TARGET_MEOS_LINUX |
147 | #if defined TCC_TARGET_MEOS |
144 | /* on Kolibri host, we suppose the lib and includes are at the location of 'tcc' /lib, /include */ |
148 | /* on Kolibri host, we suppose the lib and includes are at the location of 'tcc' /lib, /include */ |
145 | static void tcc_set_lib_path_kos(TCCState *s) |
149 | static void tcc_set_lib_path_kos(TCCState *s) |
146 | { |
150 | { |
147 | char** argv0 = (char**)0x20; // path in kolibri header |
151 | char** argv0 = (char**)0x20; // path in kolibri header |
148 | char path[1024], *p; |
152 | char path[1024], *p; |
Line 150... | Line 154... | ||
150 | p = tcc_basename(path); |
154 | p = tcc_basename(path); |
151 | if (p > path) p--; |
155 | if (p > path) p--; |
152 | *p = 0; |
156 | *p = 0; |
153 | tcc_set_lib_path(s, path); |
157 | tcc_set_lib_path(s, path); |
154 | } |
158 | } |
- | 159 | ||
- | 160 | #if defined TCC_TARGET_MEOS_LINUX |
|
- | 161 | static void tcc_set_lib_path_linux(TCCState *s) |
|
- | 162 | { |
|
- | 163 | char buff[4096+1]; |
|
- | 164 | readlink("/proc/self/exe", buff, 4096); |
|
- | 165 | const char *path = dirname(buff); |
|
- | 166 | tcc_set_lib_path(s, path); |
|
- | 167 | } |
|
- | 168 | ||
- | 169 | #endif |
|
155 | #endif |
170 | #endif |
156 | #endif |
171 | #endif |
157 | - | ||
158 | /********************************************************/ |
172 | /********************************************************/ |
159 | /* copy a string and truncate it. */ |
173 | /* copy a string and truncate it. */ |
160 | PUB_FUNC char *pstrcpy(char *buf, int buf_size, const char *s) |
174 | PUB_FUNC char *pstrcpy(char *buf, int buf_size, const char *s) |
161 | { |
175 | { |
162 | char *q, *q_end; |
176 | char *q, *q_end; |
Line 1090... | Line 1104... | ||
1090 | return NULL; |
1104 | return NULL; |
1091 | tcc_state = s; |
1105 | tcc_state = s; |
1092 | #ifdef _WIN32 |
1106 | #ifdef _WIN32 |
1093 | tcc_set_lib_path_w32(s); |
1107 | tcc_set_lib_path_w32(s); |
1094 | #else |
1108 | #else |
- | 1109 | ||
1095 | #if defined TCC_TARGET_MEOS && ! TCC_TARGET_MEOS_LINUX |
1110 | #if defined TCC_TARGET_MEOS && ! TCC_TARGET_MEOS_LINUX |
1096 | tcc_set_lib_path_kos(s); |
1111 | tcc_set_lib_path_kos(s); |
1097 | #else |
1112 | #else |
- | 1113 | ||
- | 1114 | #ifdef TCC_TARGET_MEOS_LINUX |
|
- | 1115 | tcc_set_lib_path_linux(s); |
|
- | 1116 | #else |
|
1098 | tcc_set_lib_path(s, CONFIG_TCCDIR); |
1117 | tcc_set_lib_path(s, CONFIG_TCCDIR); |
1099 | #endif |
1118 | #endif |
1100 | #endif |
1119 | #endif |
- | 1120 | #endif |
|
1101 | s->output_type = 0; |
1121 | s->output_type = 0; |
1102 | preprocess_new(); |
1122 | preprocess_new(); |
1103 | s->include_stack_ptr = s->include_stack; |
1123 | s->include_stack_ptr = s->include_stack; |
Line 1104... | Line 1124... | ||
1104 | 1124 |