1
0
forked from 0ad/0ad

Linux support for including nasm in the build process

This was SVN commit r2703.
This commit is contained in:
Simon Brenner 2005-09-13 00:16:47 +00:00
parent a0a01e7a7d
commit 884418aed9
4 changed files with 25 additions and 6 deletions

View File

@ -1,7 +1,10 @@
function sourcesfromdirs(root, dirs)
local res = {}
for i=1, getn(dirs) do
local files = matchfiles(root..dirs[i].."/*.cpp", root..dirs[i].."/*.h")
local files = matchfiles(
root..dirs[i].."/*.cpp",
root..dirs[i].."/*.h",
root..dirs[i].."/*.asm")
tconcat(res, files)
end
return res

View File

@ -230,12 +230,21 @@ function setuppackage (projectname)
-- Audio
"openal", "vorbisfile",
-- Utilities
"xerces-c", "z", "pthread", "rt", "js"
"xerces-c", "z", "pthread", "rt", "js",
-- Debugging
"bfd", "iberty"
}
-- For debug_resolve_symbol
-- package.config["Debug"].links = { "bfd", "iberty" }
-- package.config["Testing"].links = { "bfd", "iberty" }
package.config["Debug"].linkoptions = { "-rdynamic" }
package.config["Testing"].linkoptions = { "-rdynamic" }
tinsert(package.libpaths, { "/usr/X11R6/lib" } )
-- Defines
package.defines = {
"__STDC_VERSION__=199901L" }
"__STDC_VERSION__=199901L",
"CONFIG_USE_MMGR" }
-- Includes
tinsert(package.includepaths, { "/usr/X11R6/include/X11" } )
end

View File

@ -360,13 +360,20 @@ static int writeCppPackage(Package* package)
{
if (strcmp(CPP_EXT[i], ".c") == 0)
fprintf(file, "\t%sdmc $(CFLAGS) -o $@ -c $<\n", prefix);
else
else if (strcmp(CPP_EXT[i], ".asm") != 0)
fprintf(file, "\t%sdmc -cpp -Ae -Ar -mn -D_WINDOWS $(CXXFLAGS) -o $@ -c $<\n", prefix);
}
else
{
if (strcmp(CPP_EXT[i], ".c") == 0)
fprintf(file, "\t%s$(CC) $(CFLAGS) -MD -o $@ -c $<\n", prefix);
else if (strcmp(CPP_EXT[i], ".asm") == 0)
{
/* nasm -f elf -o $@ $<
nasm -M -o $@ $< >OBJ_DIR/$*.P */
fprintf(file, "\t%snasm -f elf -o $@ $<\n", prefix);
fprintf(file, "\t%snasm -M -o $@ $< >$*.d\n", prefix);
}
else
fprintf(file, "\t%s$(CXX) $(CXXFLAGS) -MD -o $@ -c $<\n", prefix);
}
@ -377,7 +384,7 @@ static int writeCppPackage(Package* package)
fprintf(file, "\t -e '/^$$/ d' -e 's/$$/ :/' < %s/$*.d >> %s/$*.P; \\\n", OBJECTS_DIR, OBJECTS_DIR);
fprintf(file, "\trm -f %s/$*.d\n\n", OBJECTS_DIR);
}
// Write out the list of object file targets for all C/C++ sources
fprintf(file, "OBJECTS = \\\n");

View File

@ -9,7 +9,7 @@
// $Id: util.h,v 1.13 2004/03/27 13:42:24 jason379 Exp $
//-----------------------------------------------------------------------------
static char* CPP_EXT[] = { ".cc", ".cpp", ".cxx", ".c", NULL };
static char* CPP_EXT[] = { ".cc", ".cpp", ".cxx", ".c", ".asm", NULL };
enum { UNIX, WIN32, NATIVE };
extern char nativePathSep;