aboutsummaryrefslogtreecommitdiff
path: root/tcc.c
diff options
context:
space:
mode:
authorDaniel Glöckner <daniel-gl@gmx.net>2008-09-05 21:08:22 +0200
committergrischka <grischka>2008-09-12 22:22:58 +0200
commit256f6e6200be1a73cbf663938213778624436cad (patch)
tree4a17d991045978d8f6f92f5cb1b09082206c6235 /tcc.c
parente8039673ad530fb5c268cf560ba0d2df95ec2fca (diff)
downloadtinycc-256f6e6200be1a73cbf663938213778624436cad.tar.gz
tinycc-256f6e6200be1a73cbf663938213778624436cad.tar.bz2
A prefix for default library/include search paths
This patch is useful for cross compilers. Without this patch tcc tries to use the host's libraries, crt*.o and include files. The patch prepends a string to all default paths. The string can be passed to configure with --sysroot=string. Daniel
Diffstat (limited to 'tcc.c')
-rw-r--r--tcc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tcc.c b/tcc.c
index aa34658..5252c44 100644
--- a/tcc.c
+++ b/tcc.c
@@ -113,7 +113,7 @@ typedef int BOOL;
/* path to find crt1.o, crti.o and crtn.o. Only needed when generating
executables or dlls */
-#define CONFIG_TCC_CRT_PREFIX "/usr/lib"
+#define CONFIG_TCC_CRT_PREFIX CONFIG_SYSROOT "/usr/lib"
#define INCLUDE_STACK_SIZE 32
#define IFDEF_STACK_SIZE 64
@@ -10190,9 +10190,9 @@ TCCState *tcc_new(void)
#ifndef TCC_TARGET_PE
/* default library paths */
- tcc_add_library_path(s, "/usr/local/lib");
- tcc_add_library_path(s, "/usr/lib");
- tcc_add_library_path(s, "/lib");
+ tcc_add_library_path(s, CONFIG_SYSROOT "/usr/local/lib");
+ tcc_add_library_path(s, CONFIG_SYSROOT "/usr/lib");
+ tcc_add_library_path(s, CONFIG_SYSROOT "/lib");
#endif
/* no section zero */
@@ -10469,8 +10469,8 @@ int tcc_set_output_type(TCCState *s, int output_type)
/* default include paths */
/* XXX: reverse order needed if -isystem support */
#ifndef TCC_TARGET_PE
- tcc_add_sysinclude_path(s, "/usr/local/include");
- tcc_add_sysinclude_path(s, "/usr/include");
+ tcc_add_sysinclude_path(s, CONFIG_SYSROOT "/usr/local/include");
+ tcc_add_sysinclude_path(s, CONFIG_SYSROOT "/usr/include");
#endif
snprintf(buf, sizeof(buf), "%s/include", tcc_lib_path);
tcc_add_sysinclude_path(s, buf);