aboutsummaryrefslogtreecommitdiff
path: root/tcc.h
diff options
context:
space:
mode:
authorThomas Preud'homme <thomas.preudhomme@celest.fr>2011-07-05 10:47:32 +0200
committerThomas Preud'homme <thomas.preudhomme@celest.fr>2011-07-05 11:16:12 +0200
commit31ca000d72bc48060f205d94bfffc25ffe5fd18d (patch)
treec020a188a8db2fe34a728c27d12cc143627f5378 /tcc.h
parentcb2138f8b098feb1b51a407343a4b99e25d5b506 (diff)
downloadtinycc-31ca000d72bc48060f205d94bfffc25ffe5fd18d.tar.gz
tinycc-31ca000d72bc48060f205d94bfffc25ffe5fd18d.tar.bz2
Add multiarch dirs to linker search path
By default, tcc search libraries in /lib and /usr/local/lib while crt*.o files are searched in /usr/lib and ld.so is searched in /lib. Unfortunetely the path are hardcoded in source code. This patch allow tcc to look in an other directory and also to look in extra directories. It's then possible to make tcc search libraries in /lib/x86_64-linux-gnu and /usr/local/lib/x86_64-linux-gnu while crt*.o files are searched in /usr/lib/x86_64-linux-gnu and ld.so is searched in /lib/x86_64-linux-gnu.
Diffstat (limited to 'tcc.h')
-rw-r--r--tcc.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/tcc.h b/tcc.h
index fcbfadc..686b3c5 100644
--- a/tcc.h
+++ b/tcc.h
@@ -142,13 +142,14 @@ typedef int BOOL;
/* path to find crt1.o, crti.o and crtn.o. Only needed when generating
executables or dlls */
-#if defined(TCC_TARGET_X86_64_CENTOS)
-# define CONFIG_TCC_CRT_PREFIX CONFIG_SYSROOT "/usr/lib64"
-# define CONFIG_TCC_LDDIR "/lib64"
-#else
-# define CONFIG_TCC_CRT_PREFIX CONFIG_SYSROOT "/usr/lib"
-# define CONFIG_TCC_LDDIR "/lib"
+#ifndef CONFIG_TCC_LDDIR
+ #if defined(TCC_TARGET_X86_64_CENTOS)
+ #define CONFIG_TCC_LDDIR "/lib64"
+ #else
+ #define CONFIG_TCC_LDDIR "/lib"
+ #endif
#endif
+#define CONFIG_TCC_CRT_PREFIX CONFIG_SYSROOT "/usr" CONFIG_TCC_LDDIR
#define INCLUDE_STACK_SIZE 32
#define IFDEF_STACK_SIZE 64