|
|
@ -0,0 +1,53 @@ |
|
|
|
--- dietlibc-0.25/diet.c.orig 2004-06-28 13:49:18.742612936 +0200
|
|
|
|
+++ dietlibc-0.25/diet.c 2004-06-28 14:12:08.260414584 +0200
|
|
|
|
@@ -64,7 +64,7 @@
|
|
|
|
int preprocess=0; |
|
|
|
int verbose=0; |
|
|
|
int profile=0; |
|
|
|
- char diethome[]=DIETHOME;
|
|
|
|
+ char *diethome;
|
|
|
|
char platform[1000]; |
|
|
|
#ifdef __DYN_LIB |
|
|
|
int shared=0; |
|
|
|
@@ -72,7 +72,7 @@
|
|
|
|
char* shortplatform=0; |
|
|
|
#ifdef WANT_SAFEGUARD |
|
|
|
char safeguard1[]="-include"; |
|
|
|
- char safeguard2[]=DIETHOME "/include/dietref.h";
|
|
|
|
+ char safeguard2[1000]; /*=DIETHOME "/include/dietref.h";*/
|
|
|
|
#endif |
|
|
|
const char *nostdlib="-nostdlib"; |
|
|
|
const char *libgcc="-lgcc"; |
|
|
|
@@ -82,13 +82,29 @@
|
|
|
|
int mangleopts=0; |
|
|
|
char manglebuf[1024]; |
|
|
|
|
|
|
|
+ /* Handle DIETHOME environment var */
|
|
|
|
+ if (!(diethome = getenv("DIETHOME")))
|
|
|
|
+ diethome = DIETHOME;
|
|
|
|
+
|
|
|
|
+ if (strlen(diethome) > 500) {
|
|
|
|
+ __write2("Environment variable DIETHOME is too long.\n");
|
|
|
|
+ return -1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+#ifdef WANT_SAFEGUARD
|
|
|
|
+ strcpy(safeguard2, diethome);
|
|
|
|
+ strcat(safeguard2, "/include/dietref.h");
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+ strcpy(platform, diethome);
|
|
|
|
+
|
|
|
|
#ifdef INSTALLVERSION |
|
|
|
- strcpy(platform,DIETHOME "/lib-");
|
|
|
|
+ strcat(platform, "/lib-");
|
|
|
|
#else |
|
|
|
#ifndef __DYN_LIB |
|
|
|
- strcpy(platform,DIETHOME "/bin-");
|
|
|
|
+ strcat(platform, "/bin-");
|
|
|
|
#else |
|
|
|
- strcpy(platform,DIETHOME "/pic-");
|
|
|
|
+ strcat(platform, "/pic-");
|
|
|
|
#endif |
|
|
|
#endif |
|
|
|
strcpy(dashL,"-L"); |