diff options
| author | Thomas Preud'homme <robotux@celest.fr> | 2013-02-13 17:01:53 +0100 |
|---|---|---|
| committer | Thomas Preud'homme <robotux@celest.fr> | 2013-02-13 17:03:30 +0100 |
| commit | f6cfaa6d2591b8931f8fde9aebf7822202b78810 (patch) | |
| tree | d3d9f62c359ddd3443f8fdd9bbe85dcc75b092ed /tcc.h | |
| parent | 05108a3b0a8eff70739b253b8995999b1861f9f2 (diff) | |
| download | tinycc-f6cfaa6d2591b8931f8fde9aebf7822202b78810.tar.gz tinycc-f6cfaa6d2591b8931f8fde9aebf7822202b78810.tar.bz2 | |
Improve multiarch detection
* Detect multiarch at configure time
* Detect based on the place where crti.o is
* Define multiarch triplet in tcc.h
Diffstat (limited to 'tcc.h')
| -rw-r--r-- | tcc.h | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -156,6 +156,34 @@ # define CONFIG_SYSROOT "" #endif +#if defined(CONFIG_TCC_MULTIARCH) && defined(TCC_IS_NATIVE) +/* Define architecture */ +# if defined(TCC_TARGET_I386) +# define TRIPLET_ARCH "i386" +# elif defined(TCC_TARGET_X86_64) +# define TRIPLET_ARCH "x86_64" +# elif defined(TCC_TARGET_ARM) +# define TRIPLET_ARCH "arm" +# else +# define TRIPLET_ARCH "unknown" +# endif +/* Define OS */ +# if defined (__linux__) +# define TRIPLET_OS "linux" +# elif defined (__FreeBSD__) || defined (__FreeBSD_kernel__) +# define TRIPLET_OS "kfreebsd" +# elif !defined (__GNU__) +# define TRIPLET_OS "unknown" +# endif +/* Define calling convention and ABI */ +# define TRIPLET_ABI "gnu" +# ifdef __GNU__ +# define CONFIG_MULTIARCHDIR TRIPLET_ARCH "-" TRIPLET_ABI +# else +# define CONFIG_MULTIARCHDIR TRIPLET_ARCH "-" TRIPLET_OS "-" TRIPLET_ABI +# endif +#endif + #ifndef CONFIG_LDDIR # ifdef CONFIG_MULTIARCHDIR # define CONFIG_LDDIR "lib/" CONFIG_MULTIARCHDIR |
