From fa9c31c3db1898d804db2289a11d9f368da88dd1 Mon Sep 17 00:00:00 2001 From: Detlef Riekenberg Date: Thu, 28 Apr 2022 17:36:10 +0200 Subject: [PATCH] tcc.h: Extend search path for include, lib and crt. This allows more tcc cross compiler to work out of the box without a buildsystem-specific config-extra.mak --- tcc.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tcc.h b/tcc.h index 1ea18561..d66baf78 100644 --- a/tcc.h +++ b/tcc.h @@ -258,7 +258,9 @@ extern long double strtold (const char *__nptr, char **__endptr); /* path to find crt1.o, crti.o and crtn.o */ #ifndef CONFIG_TCC_CRTPREFIX -# define CONFIG_TCC_CRTPREFIX USE_TRIPLET(CONFIG_SYSROOT "/usr/" CONFIG_LDDIR) +# define CONFIG_TCC_CRTPREFIX \ + ALSO_TRIPLET(CONFIG_SYSROOT "/usr/" CONFIG_LDDIR) \ + ":" USE_TRIPLET(CONFIG_SYSROOT "/usr") "/lib" #endif #ifndef CONFIG_USR_INCLUDE @@ -275,6 +277,8 @@ extern long double strtold (const char *__nptr, char **__endptr); # define CONFIG_TCC_SYSINCLUDEPATHS \ "{B}/include" \ ":" ALSO_TRIPLET(CONFIG_SYSROOT "/usr/local/include") \ + ":" USE_TRIPLET(CONFIG_SYSROOT "/usr") "/include" \ + ":" USE_TRIPLET(CONFIG_SYSROOT "/usr/local") "/include" \ ":" ALSO_TRIPLET(CONFIG_SYSROOT CONFIG_USR_INCLUDE) # endif #endif @@ -286,6 +290,8 @@ extern long double strtold (const char *__nptr, char **__endptr); # else # define CONFIG_TCC_LIBPATHS \ ALSO_TRIPLET(CONFIG_SYSROOT "/usr/" CONFIG_LDDIR) \ + ":" USE_TRIPLET(CONFIG_SYSROOT "/usr") "/lib" \ + ":" USE_TRIPLET(CONFIG_SYSROOT "/usr/local") "/lib" \ ":" ALSO_TRIPLET(CONFIG_SYSROOT "/" CONFIG_LDDIR) \ ":" ALSO_TRIPLET(CONFIG_SYSROOT "/usr/local/" CONFIG_LDDIR) # endif