aboutsummaryrefslogtreecommitdiff
path: root/tcc.h
diff options
context:
space:
mode:
authorgrischka <grischka>2011-08-06 16:11:12 +0200
committergrischka <grischka>2011-08-06 16:11:12 +0200
commit81cd0cf6fdcbdd1d38c1a9f317d04fdac287a1e5 (patch)
treed1d0015cd3ba90177e7c6eefd677a090287f7464 /tcc.h
parent9ffd77f18d07c595e7bd1fcc032f3cbb7b09cc6f (diff)
downloadtinycc-81cd0cf6fdcbdd1d38c1a9f317d04fdac287a1e5.tar.gz
tinycc-81cd0cf6fdcbdd1d38c1a9f317d04fdac287a1e5.tar.bz2
configure: add switches to set search paths
--sysincludepaths=.. specify system include paths, colon separated" Sets CONFIG_TCC_SYSINCLUDEPATHS --libpaths=... specify system library paths, colon separated" Sets CONFIG_TCC_LIBPATHS --crtprefix=... specify location of crt?.o" Sets CONFIG_TCC_CRTPREFIX --elfinterp=... specify elf interpreter" Sets CONFIG_TCC_ELFINTERP Also the CONFIG_TCC_XXX were renamed to make them look more consistent. Also move the elf_interp definitions to tcc.h.
Diffstat (limited to 'tcc.h')
-rw-r--r--tcc.h69
1 files changed, 50 insertions, 19 deletions
diff --git a/tcc.h b/tcc.h
index f8ad00c..6e9b01f 100644
--- a/tcc.h
+++ b/tcc.h
@@ -133,44 +133,75 @@
#define CONFIG_TCC_BACKTRACE
#endif
-#define FALSE 0
-#define false 0
-#define TRUE 1
-#define true 1
-typedef int BOOL;
+/* ------------ path configuration ------------ */
#ifndef CONFIG_TCC_LDDIR
- #if defined(TCC_TARGET_X86_64_CENTOS)
- #define CONFIG_TCC_LDDIR "/lib64"
- #else
- #define CONFIG_TCC_LDDIR "/lib"
- #endif
+# if defined(TCC_TARGET_X86_64_CENTOS)
+# define CONFIG_TCC_LDDIR "/lib64"
+# else
+# define CONFIG_TCC_LDDIR "/lib"
+# endif
#endif
/* path to find crt1.o, crti.o and crtn.o */
-#ifndef CONFIG_TCC_CRT_PREFIX
-# define CONFIG_TCC_CRT_PREFIX "/usr" CONFIG_TCC_LDDIR
+#ifndef CONFIG_TCC_CRTPREFIX
+# define CONFIG_TCC_CRTPREFIX "/usr" CONFIG_TCC_LDDIR
#endif
-#ifndef CONFIG_TCC_SYSINCLUDE_PATHS
+/* system include paths */
+#ifndef CONFIG_TCC_SYSINCLUDEPATHS
# ifdef TCC_TARGET_PE
-# define CONFIG_TCC_SYSINCLUDE_PATHS "\b/include;\b/include/winapi"
+# define CONFIG_TCC_SYSINCLUDEPATHS "\b/include;\b/include/winapi"
# else
-# define CONFIG_TCC_SYSINCLUDE_PATHS "/usr/local/include:/usr/include:\b/include"
+# define CONFIG_TCC_SYSINCLUDEPATHS \
+ CONFIG_SYSROOT "/usr/local/include" \
+ ":" CONFIG_SYSROOT "/usr/include" \
+ ":" "\b/include"
# endif
#endif
-#ifndef CONFIG_TCC_LIBPATH
+/* library search paths */
+#ifndef CONFIG_TCC_LIBPATHS
# ifdef TCC_TARGET_PE
-# define CONFIG_TCC_LIBPATH "\b/lib"
+# define CONFIG_TCC_LIBPATHS "\b/lib"
# else
-# define CONFIG_TCC_LIBPATH \
- CONFIG_SYSROOT CONFIG_TCC_CRT_PREFIX \
+# define CONFIG_TCC_LIBPATHS \
+ CONFIG_SYSROOT CONFIG_TCC_CRTPREFIX \
":" CONFIG_SYSROOT CONFIG_TCC_LDDIR \
":" CONFIG_SYSROOT "/usr/local" CONFIG_TCC_LDDIR
# endif
#endif
+/* name of ELF interpreter */
+#ifndef CONFIG_TCC_ELFINTERP
+# if defined __FreeBSD__
+# define CONFIG_TCC_ELFINTERP "/libexec/ld-elf.so.1"
+# elif defined __FreeBSD_kernel__
+# define CONFIG_TCC_ELFINTERP CONFIG_TCC_LDDIR"/ld.so.1"
+# elif defined TCC_ARM_EABI
+# define CONFIG_TCC_ELFINTERP CONFIG_TCC_LDDIR"/ld-linux.so.3"
+# elif defined(TCC_TARGET_X86_64)
+# define CONFIG_TCC_ELFINTERP CONFIG_TCC_LDDIR"/ld-linux-x86-64.so.2"
+# elif defined(TCC_UCLIBC)
+# define CONFIG_TCC_ELFINTERP CONFIG_TCC_LDDIR"/ld-uClibc.so.0"
+# else
+# define CONFIG_TCC_ELFINTERP CONFIG_TCC_LDDIR"/ld-linux.so.2"
+# endif
+#endif
+
+/* library to use with CONFIG_USE_LIBGCC instead of libtcc1.a */
+#define TCC_LIBGCC CONFIG_SYSROOT CONFIG_TCC_LDDIR "/libgcc_s.so.1"
+/* crt?.o files */
+#define TCC_CRTO(crto) CONFIG_SYSROOT CONFIG_TCC_CRTPREFIX "/" crto
+
+/* -------------------------------------------- */
+
+#define FALSE 0
+#define false 0
+#define TRUE 1
+#define true 1
+typedef int BOOL;
+
#define INCLUDE_STACK_SIZE 32
#define IFDEF_STACK_SIZE 64
#define VSTACK_SIZE 256