Skip to content

Commit 4e8bc1f

Browse files
author
bogdanm
committed
mostly cosmetic changes for the new romfs compress/compile feature
git-svn-id: svn://svn.berlios.de/elua/trunk@566 67d3b963-1d53-0410-ba23-e466f4efc467
1 parent 0a1c364 commit 4e8bc1f

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

Diff for: SConstruct

+5
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,11 @@ if romfsmode not in ['verbatim', 'compile', 'compress']:
234234
# Build the compilation command now
235235
compcmd = ''
236236
if romfsmode == 'compile':
237+
# First check for luac.cross in the current directory
238+
if not os.path.isfile( "luac.cross" ):
239+
print "The eLua cross compiler was not found."
240+
print "Build it by running 'scons -f cross-lua.py'"
241+
sys.exit( -1 )
237242
compcmd = './luac.cross -ccn %s -cce %s -o %%s -s %%s' % ( toolset[ 'cross_%s' % target ], toolset[ 'cross_cpumode' ] )
238243
elif romfsmode == 'compress':
239244
compcmd = 'lua luasrcdiet.lua --quiet --maximum --opt-comments --opt-whitespace --opt-emptylines --opt-eols --opt-strings --opt-numbers --opt-locals -o %s %s'

Diff for: mkfs.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,13 @@ def mkfs( dirname, outname, flist, mode, compcmd ):
7575
return False
7676

7777
# Do we need to process the file?
78+
fextpart = ''
7879
if mode == "compile" or mode == "compress":
7980
fnamepart, fextpart = os.path.splitext( realname )
8081
if mode == "compress":
8182
newext = ".lua.tmp"
8283
else:
83-
newext = ".luac"
84+
newext = ".lc"
8485
if fextpart == ".lua":
8586
newname = fnamepart + newext
8687
if mode == "compress":
@@ -102,9 +103,8 @@ def mkfs( dirname, outname, flist, mode, compcmd ):
102103
fname = fnamepart + ".lc"
103104
filedata = crtfile.read()
104105
crtfile.close()
105-
if mode == 'compile' or mode == "compress":
106-
if fextpart == ".lua":
107-
os.remove( newname )
106+
if fextpart == ".lua" and mode != "verbatim":
107+
os.remove( newname )
108108

109109
# Write name, size, id, numpars
110110
for c in fname:

0 commit comments

Comments
 (0)