Use macros to hold names of temporary files.

This commit is contained in:
Nick Clifton 1999-06-03 13:22:45 +00:00
parent 080e41e66b
commit 762100ed56
2 changed files with 40 additions and 10 deletions

View File

@ -1,3 +1,8 @@
1999-06-03 Nick Clifton <nickc@cygnus.com>
* dlltool.c (mcore_elf_gen_out_file): Use constants for temporary
file names.
Wed Jun 2 12:34:36 1999 Richard Henderson <rth@cygnus.com>
* dlltool.c (gen_exp_file): Revert 19990411 change.

View File

@ -3363,6 +3363,10 @@ mcore_elf_cache_filename (char * filename)
ptr->next->next = NULL;
}
#define MCORE_ELF_TMP_OBJ "mcoreelf.o"
#define MCORE_ELF_TMP_EXP "mcoreelf.exp"
#define MCORE_ELF_TMP_LIB "mcoreelf.lib"
static void
mcore_elf_gen_out_file (void)
{
@ -3392,7 +3396,8 @@ mcore_elf_gen_out_file (void)
ptr = ptr->next;
}
strcat (outfile, "-o mcoreelf.tmp");
strcat (outfile, "-o ");
strcat (outfile, MCORE_ELF_TMP_OBJ);
if (mcore_elf_linker == NULL)
mcore_elf_linker = deduce_name ("ld");
@ -3403,30 +3408,50 @@ mcore_elf_gen_out_file (void)
Do this by recursively invoking dlltool....*/
sprintf (outfile, "-S %s", as_name);
strcat (outfile, " -e mcoreelf.exp -l mcoreelf.lib mcoreelf.tmp");
strcat (outfile, " -e ");
strcat (outfile, MCORE_ELF_TMP_EXP);
strcat (outfile, " -l ");
strcat (outfile, MCORE_ELF_TMP_LIB);
strcat (outfile, " " );
strcat (outfile, MCORE_ELF_TMP_OBJ);
if (verbose)
strcat (outfile, " -v");
if (dontdeltemps)
{
strcat (outfile, " -n");
if (dontdeltemps > 1)
strcat (outfile, " -n");
}
/* XXX - FIME: ought to check/copy other command line options as well. */
run (program_name, outfile);
/* Step four. Feed the two new files to ld -shared. */
/* Step four. Feed the .exp and .lib files to ld -shared to create the dll. */
strcpy (outfile, "-shared ");
if (mcore_elf_linker_flags)
strcat (outfile, mcore_elf_linker_flags);
strcat (outfile, " mcoreelf.exp mcoreelf.lib -o ");
strcat (outfile, " ");
strcat (outfile, MCORE_ELF_TMP_EXP);
strcat (outfile, " ");
strcat (outfile, MCORE_ELF_TMP_LIB);
strcat (outfile, " -o ");
strcat (outfile, mcore_elf_out_file);
run (mcore_elf_linker, outfile);
if (dontdeltemps == 0)
{
unlink (MCORE_ELF_TMP_EXP);
unlink (MCORE_ELF_TMP_LIB);
}
if (dontdeltemps < 2)
unlink (MCORE_ELF_TMP_OBJ);
}
#endif /* DLLTOOL_MCORE_ELF */