mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.3 KiB

  1. --- dietlibc-0.25/diet.c.orig 2004-06-28 13:49:18.742612936 +0200
  2. +++ dietlibc-0.25/diet.c 2004-06-28 14:12:08.260414584 +0200
  3. @@ -64,7 +64,7 @@
  4. int preprocess=0;
  5. int verbose=0;
  6. int profile=0;
  7. - char diethome[]=DIETHOME;
  8. + char *diethome;
  9. char platform[1000];
  10. #ifdef __DYN_LIB
  11. int shared=0;
  12. @@ -72,7 +72,7 @@
  13. char* shortplatform=0;
  14. #ifdef WANT_SAFEGUARD
  15. char safeguard1[]="-include";
  16. - char safeguard2[]=DIETHOME "/include/dietref.h";
  17. + char safeguard2[1000]; /*=DIETHOME "/include/dietref.h";*/
  18. #endif
  19. const char *nostdlib="-nostdlib";
  20. const char *libgcc="-lgcc";
  21. @@ -82,13 +82,29 @@
  22. int mangleopts=0;
  23. char manglebuf[1024];
  24. + /* Handle DIETHOME environment var */
  25. + if (!(diethome = getenv("DIETHOME")))
  26. + diethome = DIETHOME;
  27. +
  28. + if (strlen(diethome) > 500) {
  29. + __write2("Environment variable DIETHOME is too long.\n");
  30. + return -1;
  31. + }
  32. +
  33. +#ifdef WANT_SAFEGUARD
  34. + strcpy(safeguard2, diethome);
  35. + strcat(safeguard2, "/include/dietref.h");
  36. +#endif
  37. +
  38. + strcpy(platform, diethome);
  39. +
  40. #ifdef INSTALLVERSION
  41. - strcpy(platform,DIETHOME "/lib-");
  42. + strcat(platform, "/lib-");
  43. #else
  44. #ifndef __DYN_LIB
  45. - strcpy(platform,DIETHOME "/bin-");
  46. + strcat(platform, "/bin-");
  47. #else
  48. - strcpy(platform,DIETHOME "/pic-");
  49. + strcat(platform, "/pic-");
  50. #endif
  51. #endif
  52. strcpy(dashL,"-L");