mirror of https://gitlab.com/nakst/essence
				
				
				
			extract sysroot for pre built toolchain 2
This commit is contained in:
		
							parent
							
								
									a8e26c63b8
								
							
						
					
					
						commit
						2c2f767c05
					
				|  | @ -1591,7 +1591,7 @@ void DoCommand(const char *l) { | ||||||
| 		CallSystem("mv bin/source cross"); | 		CallSystem("mv bin/source cross"); | ||||||
| 		CallSystem("mkdir -p cross/bin2"); | 		CallSystem("mkdir -p cross/bin2"); | ||||||
| 		CallSystem("gcc -o bin/change_sysroot util/change_sysroot.c -Wall -Wextra"); | 		CallSystem("gcc -o bin/change_sysroot util/change_sysroot.c -Wall -Wextra"); | ||||||
| 		CallSystem("cross/bin2/" TOOLCHAIN_PREFIX "-gcc --verbose > bin/temp.txt"); | 		CallSystem("cross/bin/" TOOLCHAIN_PREFIX "-gcc --verbose 2> bin/temp.txt"); | ||||||
| 		char *configureFlags = (char *) LoadFile("bin/temp.txt", NULL); | 		char *configureFlags = (char *) LoadFile("bin/temp.txt", NULL); | ||||||
| 		char *sysrootPath = strstr(configureFlags, "--with-sysroot="); | 		char *sysrootPath = strstr(configureFlags, "--with-sysroot="); | ||||||
| 		sysrootPath += 15; | 		sysrootPath += 15; | ||||||
|  | @ -1599,7 +1599,7 @@ void DoCommand(const char *l) { | ||||||
| 		if (sysrootPathEnd) *sysrootPathEnd = 0; | 		if (sysrootPathEnd) *sysrootPathEnd = 0; | ||||||
| 		free(configureFlags); | 		free(configureFlags); | ||||||
| 		CallSystem("rm bin/temp.txt"); | 		CallSystem("rm bin/temp.txt"); | ||||||
| 		fprintf("Detected sysroot from gcc as \"%s\".\n", sysrootPath); | 		fprintf(stderr, "Detected sysroot from gcc as \"%s\".\n", sysrootPath); | ||||||
| #define MAKE_TOOLCHAIN_WRAPPER(tool) \ | #define MAKE_TOOLCHAIN_WRAPPER(tool) \ | ||||||
| 		CallSystemF("gcc -o cross/bin2/" TOOLCHAIN_PREFIX "-" tool \ | 		CallSystemF("gcc -o cross/bin2/" TOOLCHAIN_PREFIX "-" tool \ | ||||||
| 				" util/toolchain_wrapper.c -Wall -Wextra -g " \ | 				" util/toolchain_wrapper.c -Wall -Wextra -g " \ | ||||||
|  |  | ||||||
|  | @ -28,7 +28,7 @@ int main(int argc, char **argv) { | ||||||
| 	// printf("'%s'\n", tool);
 | 	// printf("'%s'\n", tool);
 | ||||||
| 	char **newArgv = (char **) calloc(sizeof(char *), (argc + 4)); | 	char **newArgv = (char **) calloc(sizeof(char *), (argc + 4)); | ||||||
| 	newArgv[0] = change; | 	newArgv[0] = change; | ||||||
| 	newArgv[1] = CONFIGURE_SYSROOT; | 	newArgv[1] = STRING(CONFIGURE_SYSROOT); | ||||||
| 	newArgv[2] = sysroot; | 	newArgv[2] = sysroot; | ||||||
| 	newArgv[3] = tool; | 	newArgv[3] = tool; | ||||||
| 	memcpy(newArgv + 4, argv + 1, (argc - 1) * sizeof(char *)); | 	memcpy(newArgv + 4, argv + 1, (argc - 1) * sizeof(char *)); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 nakst
						nakst