From 4268225df2447804aaacd2dd9ea2cbaae208468a Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Sun, 15 Mar 2009 17:16:00 +0100 Subject: [PATCH] works with an installed Parrot (parrot segfaults when lua_group is not installed) --- config/makefiles/pmc.in | 2 +- config/makefiles/root.in | 2 +- luap.pir | 8 ++++++++ src/lib/luabytecode.pir | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/config/makefiles/pmc.in b/config/makefiles/pmc.in index 56354c5..97a76eb 100644 --- a/config/makefiles/pmc.in +++ b/config/makefiles/pmc.in @@ -83,7 +83,7 @@ CLEANUPS := \ $(STAGING_DIR)/$(LUA_GROUP)$(LOAD_EXT) -all: staging +all: staging install generate: $(PMC_SOURCES) $(PMC2CD) lua.pmc diff --git a/config/makefiles/root.in b/config/makefiles/root.in index 1a54ffc..70f2ca0 100644 --- a/config/makefiles/root.in +++ b/config/makefiles/root.in @@ -29,7 +29,7 @@ MKPATH := @mkpath@ RM_F := @rm_f@ RM_RF := @rm_rf@ #IF(parrot_is_shared and not(cygwin or win32)):export LD_RUN_PATH := @blib_dir@:$(LD_RUN_PATH) -PARROT := @build_dir@/parrot@exe@ +PARROT := $(BIN_DIR)/parrot@exe@ PGE := $(PARROT) $(LIB_DIR)/library/PGE/Perl6Grammar.pir TGE := $(PARROT) $(LIB_DIR)/languages/tge/tgc.pir PBC_TO_EXE := $(BIN_DIR)/pbc_to_exe@exe@ diff --git a/luap.pir b/luap.pir index 0c5a9b3..0d8c6ce 100644 --- a/luap.pir +++ b/luap.pir @@ -18,9 +18,17 @@ with the standard interface of PCT::HLLCompiler. =cut +.include 'stat.pasm' + .sub 'main' :anon :main .param pmc args + $I0 = stat 'lua.pbc', .STAT_EXISTS + unless $I0 goto L1 + load_bytecode 'lua.pbc' + goto L2 + L1: load_bytecode 'languages/lua/lua.pbc' + L2: $P0 = compreg 'lua' $S0 = "Compiler Lua 5.1 on Parrot Copyright (C) 2005-2009, Parrot Foundation.\n" $P0.'commandline_banner'($S0) diff --git a/src/lib/luabytecode.pir b/src/lib/luabytecode.pir index fd9340c..773276a 100644 --- a/src/lib/luabytecode.pir +++ b/src/lib/luabytecode.pir @@ -503,7 +503,7 @@ PIRCODE .end -.include 'languages/lua/src/lib/luabytecode_gen.pir' +.include 'src/lib/luabytecode_gen.pir' # Local Variables: # mode: pir