rc now also builds under R5 with TARGET_PLATFORM haiku.

Since we currently use the same build for the host and for the target,
this is only a temporary fix - we should build it twice.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12783 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2005-05-23 13:16:43 +00:00
parent 8b47fd8708
commit db4227c6ac
2 changed files with 8 additions and 10 deletions

View File

@ -9,5 +9,13 @@ StaticLibrary rdef :
BinCommand rc :
rc.cpp
# these two are needed for R5 only
strlcpy.c
strlcat.c
: librdef.a libstdc++.r4.so libbe.so
;
SEARCH on [ FGristFiles
strlcat.c strlcpy.c
] = [ FDirName $(OBOS_TOP) src system libroot posix string ] ;

View File

@ -153,12 +153,7 @@ cut_extension(char *name, const char *ext)
static void
add_extension(char *name, const char *ext)
{
#ifdef __HAIKU__
strlcat(name, ext, B_PATH_NAME_LENGTH);
#else
strncat(name, ext, B_PATH_NAME_LENGTH);
name[B_PATH_NAME_LENGTH - 1] = '\0';
#endif
}
@ -235,12 +230,7 @@ parse_options(int argc, char *argv[])
if (sOutputFile[0] == '\0') {
// no output file name was given, use the name of the
// first source file as base
#ifdef __HAIKU__
strlcpy(sOutputFile, sFirstInputFile, sizeof(sOutputFile));
#else
strncpy(sOutputFile, sFirstInputFile, sizeof(sOutputFile) - 1);
sOutputFile[sizeof(sOutputFile) - 1] = '\0';
#endif
cut_extension(sOutputFile, sDecompile ? ".rsrc" : ".rdef");
add_extension(sOutputFile, sDecompile ? ".rdef" : ".rsrc");