aboutsummaryrefslogtreecommitdiff
path: root/tcc.h
diff options
context:
space:
mode:
authorgrischka <grischka>2017-02-23 08:41:57 +0100
committergrischka <grischka>2017-02-23 08:41:57 +0100
commit569255e6c40f45a0d78b409c05353d4c1de6ca43 (patch)
tree5ec1e51fe2a233d74d5570af8fb62ac41fd25989 /tcc.h
parent576bee9a37cbe53227a27308a1b8ccc25e9b0e35 (diff)
downloadtinycc-569255e6c40f45a0d78b409c05353d4c1de6ca43.tar.gz
tinycc-569255e6c40f45a0d78b409c05353d4c1de6ca43.tar.bz2
cross-compilers: allow individual configuration
since configure supports only native configuration a file 'cross-tcc.mak' needs to be created manually. It is included in the Makefile if present. # ---------------------------------------------------- # Example config-cross.mak: # # windows -> i386-linux cross-compiler # (it expects the linux files in <prefix>/i386-linux) ROOT-i386 = {B}/i386-linux CRT-i386 = $(ROOT-i386)/usr/lib LIB-i386 = $(ROOT-i386)/lib:$(ROOT-i386)/usr/lib INC-i386 = {B}/lib/include:$(ROOT-i386)/usr/include DEF-i386 += -D__linux__ # ---------------------------------------------------- Also: - use libtcc1-<target>.a instead of directories - add dummy arm assembler - remove include dependencies from armeabi.c/lib-arm64.c - tccelf/ld_add_file: add SYSROOT (when defined) to absolute filenames coming from ld-scripts
Diffstat (limited to 'tcc.h')
-rw-r--r--tcc.h53
1 files changed, 26 insertions, 27 deletions
diff --git a/tcc.h b/tcc.h
index bc1bd69..a67c68a 100644
--- a/tcc.h
+++ b/tcc.h
@@ -254,13 +254,15 @@
# define DEFAULT_ELFINTERP(s) default_elfinterp(s)
#endif
-/* target specific subdir for libtcc1.a */
-#ifndef TCC_ARCH_DIR
-# define TCC_ARCH_DIR ""
+/* (target specific) libtcc1.a */
+#ifndef TCC_LIBTCC1
+# define TCC_LIBTCC1 "libtcc1.a"
#endif
/* library to use with CONFIG_USE_LIBGCC instead of libtcc1.a */
+#if defined CONFIG_USE_LIBGCC && !defined TCC_LIBGCC
#define TCC_LIBGCC USE_TRIPLET(CONFIG_SYSROOT "/" CONFIG_LDDIR) "/libgcc_s.so.1"
+#endif
/* -------------------------------------------- */
@@ -287,6 +289,26 @@
#define addr_t ElfW(Addr)
/* -------------------------------------------- */
+
+#ifndef PUB_FUNC /* functions used by tcc.c but not in libtcc.h */
+# define PUB_FUNC
+#endif
+
+#ifdef ONE_SOURCE
+#define ST_INLN static inline
+#define ST_FUNC static
+#define ST_DATA static
+#else
+#define ST_INLN
+#define ST_FUNC
+#define ST_DATA extern
+#endif
+
+#ifdef TCC_PROFILE /* profile all functions */
+# define static
+#endif
+
+/* -------------------------------------------- */
/* include the target specific definitions */
#define TARGET_DEFS_ONLY
@@ -1031,26 +1053,6 @@ enum tcc_token {
/* keywords: tok >= TOK_IDENT && tok < TOK_UIDENT */
#define TOK_UIDENT TOK_DEFINE
-/* -------------------------------------------- */
-
-#ifndef PUB_FUNC /* functions used by tcc.c but not in libtcc.h */
-# define PUB_FUNC
-#endif
-
-#ifdef ONE_SOURCE
-#define ST_INLN static inline
-#define ST_FUNC static
-#define ST_DATA static
-#else
-#define ST_INLN
-#define ST_FUNC
-#define ST_DATA extern
-#endif
-
-#ifdef TCC_PROFILE /* profile all functions */
-# define static
-#endif
-
/* ------------ libtcc.c ------------ */
/* use GNU C extensions */
@@ -1137,12 +1139,9 @@ ST_FUNC int tcc_add_file_internal(TCCState *s1, const char *filename, int flags)
#define AFF_BINTYPE_AR 3
#define AFF_BINTYPE_C67 4
-ST_FUNC int tcc_add_crt(TCCState *s, const char *filename);
-#ifndef TCC_TARGET_PE
+ST_FUNC int tcc_add_crt(TCCState *s, const char *filename);
ST_FUNC int tcc_add_dll(TCCState *s, const char *filename, int flags);
-#endif
-
ST_FUNC void tcc_add_pragma_libs(TCCState *s1);
PUB_FUNC int tcc_add_library_err(TCCState *s, const char *f);
PUB_FUNC void tcc_print_stats(TCCState *s, unsigned total_time);