char *segName, *c;
int system_ret;
const char *s;
+ char linkerScriptFileName[PATH_MAX];
if(port->linker.needLinkerScript)
}
/* first we need to create the <filename>.lnk file */
- SNPRINTF (scratchFileName, sizeof(scratchFileName),
+ SNPRINTF (linkerScriptFileName, sizeof(scratchFileName),
"%s.lnk", dstFileName);
- if (!(lnkfile = fopen (scratchFileName, "w")))
+ if (!(lnkfile = fopen (linkerScriptFileName, "w")))
{
- werror (E_FILE_OPEN_ERR, scratchFileName);
+ werror (E_FILE_OPEN_ERR, linkerScriptFileName);
exit (1);
}
tempSet = appendStrSet(libDirsSet, NULL, DIR_SEPARATOR_STRING);
tempSet = appendStrSet(tempSet, NULL, c);
- mergeSets(&tempSet, libDirsSet);
+ mergeSets(&tempSet, libPathsSet);
for (s = setFirstItem(tempSet); s != NULL; s = setNextItem(tempSet))
{
char buffer3[PATH_MAX];
set *tempSet=NULL, *libSet=NULL;
- strcpy(buffer3, dstFileName);
+ strcpy(buffer3, linkerScriptFileName);
if(TARGET_IS_PIC16) {
/* use $l to set the linker include directories */
setIncludePath(void)
{
char *p;
+ char *p2=NULL;
set *tempSet=NULL;
/*
mergeSets(&includeDirsSet, tempSet);
if ((p = getenv(SDCC_INCLUDE_NAME)) != NULL)
+ {
addSetHead(&includeDirsSet, p);
+ p2=Safe_alloc(strlen(p)+strlen(DIR_SEPARATOR_STRING)+strlen(port->target)+1);
+ if(p2!=NULL)
+ {
+ strcpy(p2, p);
+ strcat(p2, DIR_SEPARATOR_STRING);
+ strcat(p2, port->target);
+ addSetHead(&includeDirsSet, p2);
+ }
+ }
#if 0
if (options.printSearchDirs) {