From 0a5153044f823b12d998fdda1acf88bc1e1c21f8 Mon Sep 17 00:00:00 2001 From: "Juergen \"George\" Sawinski" Date: Sat, 3 Jul 2004 10:16:58 +0000 Subject: [PATCH] Juergen Sawinski: -teach diet to handle the env variable DIETHOME [2004062901295714638] (https://www.rocklinux.net/submaster) git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@3499 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc --- package/base/dietlibc/diethome.patch | 53 ++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 package/base/dietlibc/diethome.patch diff --git a/package/base/dietlibc/diethome.patch b/package/base/dietlibc/diethome.patch new file mode 100644 index 000000000..b90c3287c --- /dev/null +++ b/package/base/dietlibc/diethome.patch @@ -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");